summaryrefslogtreecommitdiffstats
path: root/sys/i386
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/i386
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/i386')
-rw-r--r--sys/i386/i386/vm_machdep.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c
index 4fc91dd..53cedff 100644
--- a/sys/i386/i386/vm_machdep.c
+++ b/sys/i386/i386/vm_machdep.c
@@ -268,38 +268,12 @@ cpu_exit(p)
reset_dbregs();
pcb->pcb_flags &= ~PCB_DBREGS;
}
- PROC_LOCK(p);
- mtx_lock_spin(&sched_lock);
- while (mtx_owned(&Giant))
- mtx_unlock_flags(&Giant, MTX_NOSWITCH);
-
- /*
- * We have to wait until after releasing all locks before
- * changing p_stat. If we block on a mutex then we will be
- * back at SRUN when we resume and our parent will never
- * harvest us.
- */
- p->p_stat = SZOMB;
-
- wakeup(p->p_pptr);
- PROC_UNLOCK_NOSWITCH(p);
-
- cnt.v_swtch++;
- cpu_throw();
- panic("cpu_exit");
}
void
cpu_wait(p)
struct proc *p;
{
- GIANT_REQUIRED;
-
- /* drop per-process resources */
- pmap_dispose_proc(p);
-
- /* and clean-out the vmspace */
- vmspace_free(p->p_vmspace);
}
/*
OpenPOWER on IntegriCloud