Commit Graph

413 Commits

Author SHA1 Message Date
eeh
c0ac678704 I should have made uvm_page_physload() take paddr_t's instead of vaddr_t's.
Also, add uvm_coredump32().
1999-12-30 16:09:47 +00:00
thorpej
fd9aa8fbba Cast the argument to ptoa() to a vaddr_t to prevent an integer overflow
from occurring on systems with more than 2G of RAM.
1999-11-30 19:31:05 +00:00
thorpej
1da427a80a Change the pmap_enter() API slightly; pmap_enter() now returns an error
value (KERN_SUCCESS or KERN_RESOURCE_SHORTAGE) indicating if it succeeded
or failed.  Change the `wired' and `access_type' arguments to a single
`flags' argument, which includes the access type, and flags:

	PMAP_WIRED	the old `wired' boolean
	PMAP_CANFAIL	pmap_enter() is allowed to fail

If PMAP_CANFAIL is not specified, the pmap should behave as it always
has in the face of a drastic resource shortage: fall over dead.

Change the fault handler to deal with failure (which indicates resource
shortage) by unlocking everything, waiting for the pagedaemon to free
more memory, then retrying the fault.
1999-11-13 00:24:38 +00:00
chs
f3a668ed84 eliminate the PMAP_NEW option by making it required for all ports.
ports which previously had no support for PMAP_NEW now implement
the pmap_k* interfaces as wrappers around the non-k versions.
1999-09-12 01:16:55 +00:00
thorpej
3f176180d5 Garbage collect thread_sleep()/thread_wakeup() left over from the old
Mach VM code.  Also nuke iprintf(), which was no longer used anywhere.

Add proclist locking where appropriate.
1999-07-22 22:58:38 +00:00
thorpej
3ebbe095e0 Change the pmap_extract() interface to:
boolean_t pmap_extract(pmap_t, vaddr_t, paddr_t *);
This makes it possible for the pmap to map physical address 0.
1999-07-08 18:05:21 +00:00
thorpej
ad1a5ef5cf Add a macro to modify flags in a VM map, which handles the locking
for you.
1999-07-07 05:33:33 +00:00
thorpej
11c67d01a5 Fix a corner case locking error, which could lead to map corruption in
SMP environments.  See comments in <vm/vm_map.h> for details.
1999-07-01 20:07:05 +00:00
thorpej
0288ffb53a pmap_change_wiring() -> pmap_unwire(). 1999-06-17 19:23:20 +00:00
thorpej
f5a527bb4e Remove pmap_pageable(); no pmap implements it, and it is not really useful,
because pmap_enter()/pmap_change_wiring() (soon to be pmap_unwire())
communicate the information in greater detail.
1999-06-17 18:21:21 +00:00
thorpej
26879cb8fb Clean up some comments. 1999-06-16 17:43:49 +00:00
thorpej
ee9703dea9 Add a macro to test if a map entry is wired. 1999-06-16 00:29:04 +00:00
thorpej
c5a43ae10c Several changes, developed and tested concurrently:
* Provide POSIX 1003.1b mlockall(2) and munlockall(2) system calls.
  MCL_CURRENT is presently implemented.  MCL_FUTURE is not fully
  implemented.  Also, the same one-unlock-for-every-lock caveat
  currently applies here as it does to mlock(2).  This will be
  addressed in a future commit.
* Provide the mincore(2) system call, with the same semantics as
  Solaris.
* Clean up the error recovery in uvm_map_pageable().
* Fix a bug where a process would hang if attempting to mlock a
  zero-fill region where none of the pages in that region are resident.
  [ This fix has been submitted for inclusion in 1.4.1 ]
1999-06-15 23:27:47 +00:00
thorpej
ec9fd3b48c Fix a braino in vm_map_unlock(). Thanks to Chuck Silvers for pointing
out that there was a problem, and for sending me a trace.
1999-06-07 16:34:04 +00:00
thorpej
397b71aaca Fix a typo. 1999-06-07 15:25:19 +00:00
thorpej
f421cc0851 Keep interrupt-safe maps on an additional queue. In uvm_fault(), if we're
looking up a kernel address, check to see if the address is on this
"interrupt-safe" list.  If so, return failure immediately.  This prevents
a locking screw if a page fault is taken on an interrupt-safe map in or
out of interrupt context.
1999-06-05 04:12:31 +00:00
thorpej
108b13d5a9 Make "intrsafe" maps locked only by exclusive spin locks, never sleep
locks (and thus, never shared locks).  Move the "set/clear recursive"
functions to uvm_map.c, which is the only placed they're used (and
they should go away anyhow).  Delete some unused cruft.
1999-05-28 20:31:42 +00:00
thorpej
2580d306ab Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags.  PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that.  INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now).  This will eventually
change now these maps are locked, as well.
1999-05-26 19:16:28 +00:00
thorpej
96993ef749 Make a slight modification of pmap_growkernel() -- it now returns the
end of the mappable kernel virtual address space.  Previously, it would
get called more often than necessary, because the caller only new what
was requested.

Also, export uvm_maxkaddr so that uvm_pageboot_alloc() can grow the
kernel pmap if necessary, as well.  Note that pmap_growkernel() must
now be able to handle being called before pmap_init().
1999-05-20 23:25:42 +00:00
thorpej
c10a926030 Allow the caller to specify a stack for the child process. If NULL,
the child inherits the stack pointer from the parent (traditional
behavior).  Like the signal stack, the stack area is secified as
a low address and a size; machine-dependent code accounts for stack
direction.

This is required for clone(2).
1999-05-13 21:58:32 +00:00
thorpej
f5108f64e7 Add an optional pmap hook, pmap_fork(), to be called at the end of
uvmspace_fork().

pmap_fork() is used to "fork a pmap", that is copy data from one pmap
to the other that is NOT related to actual mappings in the pmap, but is
otherwise logically coupled to the address space.
1999-05-12 19:11:23 +00:00
simonb
e3a5c2451c Check to see if TRUE and FALSE are already defined before blindly
trying to define them ourselves.

Fixes PRs kern/2813 and misc/7356.
1999-04-11 00:59:07 +00:00
drochner
d79282e281 rip out some old-vm specific definitions and prototypes for address space
sanity
1999-04-10 13:52:11 +00:00
mrg
920344b9c2 put back #ifdef _KERNEL that broken xosview build. 1999-03-31 12:29:51 +00:00
mycroft
e7ad33406b Nuke at least a few files which are clearly not used any more. 1999-03-30 13:08:55 +00:00
mycroft
31a2536cd0 Add a new `access type' argument to pmap_enter(). This indicates what type of
memory access a mapping was caused by.  This is passed through from uvm_fault()
and udv_fault(), and in most other cases is 0.
The pmap module may use this to preset R/M information.  On MMUs which require
R/M emulation, the implementation may preset the bits and avoid taking another
fault.  On MMUs which keep R/M information in hardware, the implementation may
preset its cached bits to speed up the next call to pmap_is_modified() or
pmap_is_referenced().
1999-03-26 21:58:39 +00:00
mrg
d2397ac5f7 completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
1999-03-24 05:50:49 +00:00
kleink
b0fe22c29d Have unimplemented/unsupported system calls (madvise(), mincore(), sbrk(),
sstk()) fail with ENOSYS.
1999-03-09 12:18:22 +00:00
hubertf
dcd5f59c0a RCS ID police 1999-02-15 04:14:54 +00:00
chuck
d22647b17e remove old (dead) non-MNN code 1999-01-16 20:00:28 +00:00
cgd
2690e920cb patch from chuck:
remove bogus permission check in uvm_map_clean().   fixes mmap/msync
problem discussed/reported by jonathan and Andreas Wrede <andreas@planix.com>.
1998-11-29 06:15:58 +00:00
mrg
b4f6a27f69 comment how a diag test is possible broken. 1998-11-19 05:23:46 +00:00
mycroft
967a4693f2 Set the B_NOCACHE bit so that NFSv3 will not try to do async writes. 1998-11-08 19:45:17 +00:00
jonathan
9a06d5e2a6 Compute compile-time value of old-VM parameter MAX_KMAPENT from NPROC
(2x NPROC plus slop) unless expclitly set. Use current constant value
(100) as a lower bound, as suggested by Chuck Cranor.

Move NPROC and other parameter definitions from param.c to param.h so
they are visible to vm/vm_map.h.

Systems with hand-tuned NPROC should now support that many processes.
1998-10-23 19:37:32 +00:00
tron
39876df951 Defopt SYSVMSG, SYSVSEM and SYSVSHM. 1998-10-19 22:14:54 +00:00
ws
03de6ac37b Physical addresses are paddr_t, not vaddr_t 1998-10-14 11:45:16 +00:00
chuck
1449d78fd3 remove the following if UVM is defined:
- share_map in vm_map_object.   UVM doesn't use share maps, so drop unused
	partial support for them to simplify the code.
 - is_main_map in vm_map.   no longer needed once share maps are gone.
 - vm_map_version_t.   map versions are handled elsewhere in UVM.
1998-10-11 22:56:42 +00:00
mrg
9cf8633378 back out previous. 1998-10-02 08:00:57 +00:00
tv
8219f068e2 Declare silent success on madvise(). As an advisory call, it is harmless
to pretend success even though it's not supported, and some emulations
rely on its success.
1998-09-30 12:07:51 +00:00
christos
45935a4c8d Make copyrights consistent; remove extra trailing spaces, change reformatted
copyrights to original format, change ' ' to '\t'.
1998-09-13 13:21:37 +00:00
thorpej
dd07e08538 Implement vm_exit(), which frees VM resources when a process finishes
exiting.
1998-09-08 23:44:41 +00:00
pk
d2d3f83fd7 Panic instead failing the syscall on an impossible condition (from Robert Elz).
Plug possible memory leakage with the recently added device path stuff.
1998-09-06 23:09:39 +00:00
drochner
0ff42b44b1 Fix UIO_SYSSPACE / UIO_USERSPACE confusion in the new swappath code. 1998-09-06 11:59:28 +00:00
christos
344ed1eaef Assign copyright to TNF. 1998-09-05 14:20:01 +00:00
drochner
3af18e2765 add missing label 1998-08-30 12:32:48 +00:00
mrg
e10d7cb026 add sys/swap.h, and not that vm/vm_swap.h should go away later. 1998-08-29 17:06:11 +00:00
mrg
edda33e00c move <vm/vm_swap.h> to <sys/swap.h>. <vm/vm_swap.h> still works for now (goes away later) 1998-08-29 17:01:14 +00:00
mrg
b5f69ff667 add a `char se_path[PATH_MAX]' member to struct swapent, that
the pathname of the swap device is saved into.  add a char *swd_path
member to struct swapdev, that contains a copy of the pathname
(using malloc(9)).  rename swapctl(2)'s SWAP_STATS to SWAP_OSTATS,
and add a new SWAP_STATS command (number).  make swapctl(SWAP_STATS,
...) [new version] copy the path out.  if COMPAT_13, also include
support for SWAP_OSTATS.  also fix a minor bug in swapctl(2).

the point of this is that swapfiles are now shown in `swapctl -l'.
1998-08-29 13:27:50 +00:00
thorpej
77d0a69569 Add a waitok boolean argument to the VM system's pool page allocator backend. 1998-08-28 20:05:48 +00:00
mrg
514a5d2570 vm_page_bootstrap takes vaddr_t *'s not paddr_t *'s 1998-08-24 22:36:36 +00:00