summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_extern.h3
-rw-r--r--sys/vm/vm_glue.c18
2 files changed, 19 insertions, 2 deletions
diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h
index 307192f..9ff0191 100644
--- a/sys/vm/vm_extern.h
+++ b/sys/vm/vm_extern.h
@@ -80,7 +80,8 @@ void vm_fault_copy_entry __P((vm_map_t, vm_map_t, vm_map_entry_t, vm_map_entry_t
void vm_fault_unwire __P((vm_map_t, vm_offset_t, vm_offset_t));
int vm_fault_wire __P((vm_map_t, vm_offset_t, vm_offset_t));
int vm_fault_user_wire __P((vm_map_t, vm_offset_t, vm_offset_t));
-void vm_fork __P((struct proc *, struct proc *, int));
+void vm_forkproc __P((struct proc *, struct proc *, int));
+void vm_waitproc __P((struct proc *));
int vm_mmap __P((vm_map_t, vm_offset_t *, vm_size_t, vm_prot_t, vm_prot_t, int, void *, vm_ooffset_t));
vm_offset_t vm_page_alloc_contig __P((vm_offset_t, vm_offset_t, vm_offset_t, vm_offset_t));
void vm_set_page_size __P((void));
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index 8ac0dde..5638175 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -209,7 +209,7 @@ vsunlock(addr, len)
* to user mode to avoid stack copying and relocation problems.
*/
void
-vm_fork(p1, p2, flags)
+vm_forkproc(p1, p2, flags)
struct proc *p1, *p2;
int flags;
{
@@ -286,6 +286,22 @@ vm_fork(p1, p2, flags)
}
/*
+ * Called after process has been wait(2)'ed apon and is being reaped.
+ * The idea is to reclaim resources that we could not reclaim while
+ * the process was still executing.
+ */
+void
+vm_waitproc(p)
+ struct proc *p;
+{
+
+ GIANT_REQUIRED;
+ cpu_wait(p);
+ pmap_dispose_proc(p); /* drop per-process resources */
+ vmspace_free(p->p_vmspace); /* and clean-out the vmspace */
+}
+
+/*
* Set default limits for VM system.
* Called for proc 0, and then inherited by all others.
*
OpenPOWER on IntegriCloud