Index: alpha/alpha/vm_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/alpha/alpha/vm_machdep.c,v retrieving revision 1.66 diff -u -r1.66 vm_machdep.c --- alpha/alpha/vm_machdep.c 5 Apr 2002 00:52:15 -0000 1.66 +++ alpha/alpha/vm_machdep.c 23 Jun 2002 00:38:40 -0000 @@ -248,6 +248,12 @@ } void +cpu_sched_exit(td) + register struct thread *td; +{ +} + +void cpu_wait(p) struct proc *p; { Index: i386/i386/vm_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/vm_machdep.c,v retrieving revision 1.187 diff -u -r1.187 vm_machdep.c --- i386/i386/vm_machdep.c 27 Mar 2002 05:39:19 -0000 1.187 +++ i386/i386/vm_machdep.c 23 Jun 2002 00:38:42 -0000 @@ -283,6 +283,12 @@ } void +cpu_sched_exit(td) + register struct thread *td; +{ +} + +void cpu_wait(p) struct proc *p; { Index: ia64/ia64/vm_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/ia64/ia64/vm_machdep.c,v retrieving revision 1.40 diff -u -r1.40 vm_machdep.c --- ia64/ia64/vm_machdep.c 5 May 2002 08:16:10 -0000 1.40 +++ ia64/ia64/vm_machdep.c 23 Jun 2002 00:38:43 -0000 @@ -314,6 +314,12 @@ } void +cpu_sched_exit(td) + register struct thread *td; +{ +} + +void cpu_wait(p) struct proc *p; { Index: kern/kern_exit.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_exit.c,v retrieving revision 1.167 diff -u -r1.167 kern_exit.c --- kern/kern_exit.c 7 Jun 2002 05:41:27 -0000 1.167 +++ kern/kern_exit.c 23 Jun 2002 00:38:43 -0000 @@ -448,6 +448,7 @@ binuptime(PCPU_PTR(switchtime)); PCPU_SET(switchticks, ticks); + cpu_sched_exit(td); cpu_throw(); panic("exit1"); } Index: powerpc/powerpc/vm_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/powerpc/powerpc/vm_machdep.c,v retrieving revision 1.71 diff -u -r1.71 vm_machdep.c --- powerpc/powerpc/vm_machdep.c 28 May 2002 12:24:29 -0000 1.71 +++ powerpc/powerpc/vm_machdep.c 23 Jun 2002 00:38:44 -0000 @@ -209,6 +209,12 @@ } void +cpu_sched_exit(td) + register struct thread *td; +{ +} + +void cpu_wait(td) struct proc *td; { Index: sparc64/sparc64/vm_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/sparc64/sparc64/vm_machdep.c,v retrieving revision 1.24 diff -u -r1.24 vm_machdep.c --- sparc64/sparc64/vm_machdep.c 29 May 2002 06:16:47 -0000 1.24 +++ sparc64/sparc64/vm_machdep.c 23 Jun 2002 00:38:44 -0000 @@ -86,6 +86,28 @@ } } +void +cpu_sched_exit(struct thread *td) +{ + struct vmspace *vm; + struct pcpu *pc; + struct proc *p; + + mtx_assert(&sched_lock, MA_OWNED); + + p = td->td_proc; + vm = p->p_vmspace; + if (vm->vm_refcnt > 1) + return; + SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { + if (pc->pc_vmspace == vm) { + vm->vm_pmap.pm_active &= ~pc->pc_cpumask; + vm->vm_pmap.pm_context[pc->pc_cpuid] = -1; + pc->pc_vmspace = NULL; + } + } +} + /* * Finish a fork operation, with process p2 nearly set up. * Copy and update the pcb, set up the stack so that the child Index: sys/proc.h =================================================================== RCS file: /home/ncvs/src/sys/sys/proc.h,v retrieving revision 1.223 diff -u -r1.223 proc.h --- sys/proc.h 7 Jun 2002 05:11:08 -0000 1.223 +++ sys/proc.h 23 Jun 2002 00:38:45 -0000 @@ -752,6 +752,7 @@ void maybe_resched(struct thread *); void cpu_exit(struct thread *); +void cpu_sched_exit(struct thread *); void exit1(struct thread *, int) __dead2; void cpu_fork(struct thread *, struct proc *, struct thread *, int); void cpu_set_fork_handler(struct thread *, void (*)(void *), void *);