/* * cpu_exit is called as the last action during exit. * * We clean up a little and then call switch_exit() with the old proc as an * argument. switch_exit() first switches to proc0's context, then does the * vmspace_free() and kmem_free() that we don't do here, and finally jumps * into switch() to wait for another process to wake up. */ void cpu_exit(register struct proc *p) { #if NNPX > 0 /* If we were using the FPU, forget about it. */ if (p->p_addr->u_pcb.pcb_fpcpu != NULL) npxsave_proc(p, 0); #endif switch_exit(p); }
/* * cpu_exit is called as the last action during exit. * * We clean up a little and then call switch_exit() with the old proc as an * argument. switch_exit() first switches to proc0's context, and finally * jumps into switch() to wait for another process to wake up. */ void cpu_exit(struct proc *p) { /* If we were using the FPU, forget about it. */ if (p->p_addr->u_pcb.pcb_fpcpu != NULL) fpusave_proc(p, 0); if (p->p_md.md_flags & MDP_USEDMTRR) mtrr_clean(p); /* * No need to do user LDT cleanup here; it's handled in * pmap_destroy(). */ uvmexp.swtch++; switch_exit(p, exit2); }
void cpu_exit(struct lwp *l) { (void) splsched(); switch_exit(l, lwp_exit2); }