summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_glue.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-09-10 04:28:58 +0000
committerpeter <peter@FreeBSD.org>2001-09-10 04:28:58 +0000
commit96b9a12bd20f300ee8fcf003538e8aa560536c2c (patch)
treefc0a72b711cffb263f307a3b8d70ec96d56e263b /sys/vm/vm_glue.c
parent86ba2579206ed1037ff3581eaaf5854b2821fae9 (diff)
downloadFreeBSD-src-96b9a12bd20f300ee8fcf003538e8aa560536c2c.zip
FreeBSD-src-96b9a12bd20f300ee8fcf003538e8aa560536c2c.tar.gz
Rip some well duplicated code out of cpu_wait() and cpu_exit() and move
it to the MI area. KSE touched cpu_wait() which had the same change replicated five ways for each platform. Now it can just do it once. The only MD parts seemed to be dealing with fpu state cleanup and things like vm86 cleanup on x86. The rest was identical. XXX: ia64 and powerpc did not have cpu_throw(), so I've put a functional stub in place. Reviewed by: jake, tmm, dillon
Diffstat (limited to 'sys/vm/vm_glue.c')
-rw-r--r--sys/vm/vm_glue.c18
1 files changed, 17 insertions, 1 deletions
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