aboutsummaryrefslogtreecommitdiff
path: root/sys/alpha
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2001-09-10 04:28:58 +0000
committerPeter Wemm <peter@FreeBSD.org>2001-09-10 04:28:58 +0000
commiteb30c1c0b9d31a4394a3b9c04325ab9e5af9ad1a (patch)
treefc0a72b711cffb263f307a3b8d70ec96d56e263b /sys/alpha
parente11e07928b89940001ae1ce77b08bff79b357253 (diff)
downloadsrc-eb30c1c0b9d31a4394a3b9c04325ab9e5af9ad1a.tar.gz
src-eb30c1c0b9d31a4394a3b9c04325ab9e5af9ad1a.zip
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
Notes
Notes: svn path=/head/; revision=83276
Diffstat (limited to 'sys/alpha')
-rw-r--r--sys/alpha/alpha/vm_machdep.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/sys/alpha/alpha/vm_machdep.c b/sys/alpha/alpha/vm_machdep.c
index a40ea11b4507..0aec8077b4a6 100644
--- a/sys/alpha/alpha/vm_machdep.c
+++ b/sys/alpha/alpha/vm_machdep.c
@@ -241,40 +241,14 @@ void
cpu_exit(p)
register struct proc *p;
{
- alpha_fpstate_drop(p);
-
- 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_switch();
- panic("cpu_exit");
+ alpha_fpstate_drop(p);
}
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);
}
/*