CPU_EXIT(9) BSD Kernel Developer's Manual CPU_EXIT(9)
cpu_exit -- machine-dependent process exit
cpu_exit(struct lwp *l, int is_process);
cpu_exit() is machine-dependent code invoked by exit1() or lwp_exit() as
the last action during process or lwp exit to switch to a new context
(possibly the idle context). cpu_exit() will clean up machine-dependent
process state. If is_process is 0, we're exiting an lwp. In that case,
cpu_exit() only does lwp-appropriate cleanup. cpu_exit() will then
invoke exit2() or lwp_exit2() to schedule the old lwp's u-area and stack
to be released by the reaper thread. cpu_exit() will then invoke an
equivalent of cpu_switch() to wait for another process to wake up.
This section describes places within the NetBSD source tree where actual
code using cpu_exit() be found. All pathnames are relative to /usr/src.
exit1() and exit2() can be found within the file sys/kern/kern_exit.c.
lwp_exit() and lwp_exit2() can be found within the file
BSD August 23, 2003 BSD