diff options
author | njl <njl@FreeBSD.org> | 2004-11-07 06:58:45 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2004-11-07 06:58:45 +0000 |
commit | d8a46083bd6aa8f0cfa4cebcc58f7b57ba23b98c (patch) | |
tree | ed87e3202879ac027322401787a5b22866288ca6 /sys/kern/kern_shutdown.c | |
parent | df15e501afa6063063093f374034fadd09757236 (diff) | |
download | FreeBSD-src-d8a46083bd6aa8f0cfa4cebcc58f7b57ba23b98c.zip FreeBSD-src-d8a46083bd6aa8f0cfa4cebcc58f7b57ba23b98c.tar.gz |
Add comments to clarify why we need to run shutdown code on the BSP, update
an old comment about boot() being MI, and note that splhigh() no longer
disables interrupts.
Diffstat (limited to 'sys/kern/kern_shutdown.c')
-rw-r--r-- | sys/kern/kern_shutdown.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 27b4cfd..3c40d6d 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -238,9 +238,7 @@ doadump(void) } /* - * Go through the rigmarole of shutting down.. - * this used to be in machdep.c but I'll be dammned if I could see - * anything machine dependant in it. + * Shutdown the system cleanly to prepare for reboot, halt, or power off. */ static void boot(int howto) @@ -248,7 +246,11 @@ boot(int howto) static int first_buf_printf = 1; #if defined(SMP) && (defined(__i386__) || defined(__amd64__)) - /* Do all shutdown processing on cpu0 */ + /* + * Bind us to CPU 0 so that all shutdown code runs there. Some + * systems don't shutdown properly (i.e., ACPI power off) if we + * run on another processor. + */ mtx_lock_spin(&sched_lock); sched_bind(curthread, 0); mtx_unlock_spin(&sched_lock); @@ -391,7 +393,10 @@ boot(int howto) * been completed. */ EVENTHANDLER_INVOKE(shutdown_post_sync, howto); + + /* XXX This doesn't disable interrupts any more. Reconsider? */ splhigh(); + if ((howto & (RB_HALT|RB_DUMP)) == RB_DUMP && !cold && !dumping) doadump(); |