summaryrefslogtreecommitdiff
path: root/sys/arch/hppa/dev
diff options
context:
space:
mode:
authorMasao Uebayashi <uebayasi@cvs.openbsd.org>2014-07-12 20:18:10 +0000
committerMasao Uebayashi <uebayasi@cvs.openbsd.org>2014-07-12 20:18:10 +0000
commit894698ab3f603897bffd7993a7f1074e85172047 (patch)
treee571d148ab102f6dbdd88730714fd93b02641e2b /sys/arch/hppa/dev
parent93f226fdd7fd863d667ca20568296621176a26d3 (diff)
reboot(9): Shutdown system by signaling init(8) from kernel where appropriate
Some ports watch temperature in MD and try to shutdown system, when overheated, by calling directly (re)boot(9). Change this to signal init(8) from kernel, as acpi(4) and acpitz(4) do, which has been more tested. This also helps to clarify design that ``clean shutdown must be always started by init(8)''. Note that SIGUSR2 causes init(8) to call reboot(2) with RB_POWERDOWN, as acpi(4) etc. already does. It is reasonable, pointed out by kettenis@, considering system is overheated and immediate reboot may be dangerous. OK deraadt@ miod@
Diffstat (limited to 'sys/arch/hppa/dev')
-rw-r--r--sys/arch/hppa/dev/power.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/arch/hppa/dev/power.c b/sys/arch/hppa/dev/power.c
index 0c0318b0bec..d13bdbef42f 100644
--- a/sys/arch/hppa/dev/power.c
+++ b/sys/arch/hppa/dev/power.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: power.c,v 1.7 2014/07/12 14:12:44 uebayasi Exp $ */
+/* $OpenBSD: power.c,v 1.8 2014/07/12 20:18:08 uebayasi Exp $ */
/*
* Copyright (c) 2003 Michael Shalayeff
@@ -27,9 +27,10 @@
*/
#include <sys/param.h>
+#include <sys/proc.h>
+#include <sys/signalvar.h>
#include <sys/kernel.h>
#include <sys/systm.h>
-#include <sys/reboot.h>
#include <sys/device.h>
#include <sys/kthread.h>
@@ -154,7 +155,7 @@ power_thread_dr(void *v)
* switch and thus we have do dampen it ourselves.
*/
if (sc->sc_dr_cnt == hz / 10)
- reboot(RB_POWERDOWN | RB_HALT);
+ prsignal(initprocess, SIGUSR2);
tsleep(v, PWAIT, "drpower", 10);
}