summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_shutdown.c
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>2000-08-31 00:08:50 +0000
committermsmith <msmith@FreeBSD.org>2000-08-31 00:08:50 +0000
commitafc6787158045131a17b21bc5d97f5ab2e957025 (patch)
treebc8d4fc17933b763fe18328e6b570b77c7f77e9a /sys/kern/kern_shutdown.c
parent814369526cbe56d7630a8d9534b8d71cb7b12d64 (diff)
downloadFreeBSD-src-afc6787158045131a17b21bc5d97f5ab2e957025.zip
FreeBSD-src-afc6787158045131a17b21bc5d97f5ab2e957025.tar.gz
Make it possible to pass boot()'s flags to shutdown_nice() so that the
kernel can instigate an orderly shutdown but still determine the form of that shutdown. Make it possible eg. to cleanly shutdown and power off the system under ACPI when the power button is pressed.
Diffstat (limited to 'sys/kern/kern_shutdown.c')
-rw-r--r--sys/kern/kern_shutdown.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index cf8081f..258699e 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -150,9 +150,13 @@ reboot(p, uap)
/*
* Called by events that want to shut down.. e.g <CTL><ALT><DEL> on a PC
*/
+static int shutdown_howto = 0;
+
void
-shutdown_nice()
+shutdown_nice(int howto)
{
+ shutdown_howto = howto;
+
/* Send a signal to init(8) and have it shutdown the world */
if (initproc != NULL) {
psignal(initproc, SIGINT);
@@ -202,6 +206,9 @@ boot(howto)
int howto;
{
+ /* collect extra flags that shutdown_nice might have set */
+ howto |= shutdown_howto;
+
#ifdef SMP
if (smp_active) {
printf("boot() called on cpu#%d\n", cpuid);
OpenPOWER on IntegriCloud