summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2006-06-21 22:55:39 +0000
committerJason Wright <jason@cvs.openbsd.org>2006-06-21 22:55:39 +0000
commitb7efbe1e6fc638b4341f2344aa371add34340236 (patch)
treee2ba0217289966cd708f858d97517a02e65c3698 /sys/arch/sparc64
parentd692a6dbf25f4740a623ab0b04cfab35fe85ad7e (diff)
if machdep.kbdreset==1 and the front panel button interrupt fires, tell init
that it's time to go sleepy-bye.
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/conf/GENERIC3
-rw-r--r--sys/arch/sparc64/dev/power.c18
2 files changed, 12 insertions, 9 deletions
diff --git a/sys/arch/sparc64/conf/GENERIC b/sys/arch/sparc64/conf/GENERIC
index 800852de549..b71877f188a 100644
--- a/sys/arch/sparc64/conf/GENERIC
+++ b/sys/arch/sparc64/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.148 2006/06/21 19:28:08 jason Exp $
+# $OpenBSD: GENERIC,v 1.149 2006/06/21 22:55:38 jason Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
@@ -177,6 +177,7 @@ udcf* at uhub? # Gude Expert mouseCLOCK
auxio* at ebus?
auxio* at sbus?
beeper* at ebus?
+power* at ebus?
# SAB82532 based serial ports
sab* at ebus?
diff --git a/sys/arch/sparc64/dev/power.c b/sys/arch/sparc64/dev/power.c
index 19904a84d2e..4974c7fd6c4 100644
--- a/sys/arch/sparc64/dev/power.c
+++ b/sys/arch/sparc64/dev/power.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: power.c,v 1.2 2006/06/16 22:21:22 jason Exp $ */
+/* $OpenBSD: power.c,v 1.3 2006/06/21 22:55:38 jason Exp $ */
/*
* Copyright (c) 2006 Jason L. Wright (jason@thought.net)
@@ -37,6 +37,8 @@
#include <sys/device.h>
#include <sys/conf.h>
#include <sys/timeout.h>
+#include <sys/proc.h>
+#include <sys/signalvar.h>
#include <machine/bus.h>
#include <machine/autoconf.h>
@@ -113,23 +115,23 @@ power_attach(parent, self, aux)
if (ea->ea_nintrs > 0 && OF_getproplen(ea->ea_node, "button") >= 0) {
sc->sc_ih = bus_intr_establish(sc->sc_tag, ea->ea_intrs[0],
- IPL_HIGH, 0, power_intr, sc, self->dv_xname);
+ IPL_BIO, 0, power_intr, sc, self->dv_xname);
if (sc->sc_ih == NULL) {
printf(": can't establish interrupt\n");
return;
}
}
-
printf("\n");
}
int
power_intr(void *vsc)
{
- /*
- * to turn the machine off:
- * bus_space_write_4(sc->sc_tag, sc->sc_handle, POWER_REG,
- * POWER_REG_CPWR_OFF | POWER_REG_SPWR_OFF);
- */
+ extern int kbd_reset;
+
+ if (kbd_reset == 1) {
+ kbd_reset = 0;
+ psignal(initproc, SIGUSR1);
+ }
return (1);
}