summaryrefslogtreecommitdiff
path: root/sys/arch/sgi
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@cvs.openbsd.org>2011-06-24 19:47:50 +0000
committerChristian Weisgerber <naddy@cvs.openbsd.org>2011-06-24 19:47:50 +0000
commit3da505965757e4e925366c29b363105405fd202d (patch)
tree3bd93b0681c5ada7d7dac32ec4fcd54b6063055f /sys/arch/sgi
parent7f1ea65fed8697f18acb9a18feab7940904e5e80 (diff)
machdep.kbdreset enables a shutdown by Ctrl-Alt-Del on amd64 and
i386. Stop abusing it on other archs for controling a shutdown by pressing the soft power button: * Add a MI sysctl hw.allowpowerdown; if set to 1 (the default) it allows a power button shutdown. * Make acpi(4)/acpibtn(4) honor hw.allowpowerdown. * Switch the various power button intercepts on landisk, sgi, sparc64 and zaurus over to hw.allowpowerdown. * Garbage collect the machdep.kbdreset sysctl on all archs other than amd64 and i386. ok miod@
Diffstat (limited to 'sys/arch/sgi')
-rw-r--r--sys/arch/sgi/dev/power.c8
-rw-r--r--sys/arch/sgi/sgi/machdep.c7
2 files changed, 5 insertions, 10 deletions
diff --git a/sys/arch/sgi/dev/power.c b/sys/arch/sgi/dev/power.c
index 3696db748f5..ed8350a51c8 100644
--- a/sys/arch/sgi/dev/power.c
+++ b/sys/arch/sgi/dev/power.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: power.c,v 1.13 2009/11/25 11:23:29 miod Exp $ */
+/* $OpenBSD: power.c,v 1.14 2011/06/24 19:47:49 naddy Exp $ */
/*
* Copyright (c) 2007 Jasper Lievisse Adriaanse <jasper@openbsd.org>
@@ -126,7 +126,7 @@ power_mainbus_intr(void *v)
int
power_intr(void *unused)
{
- extern int kbd_reset;
+ extern int allowpowerdown;
int val;
/*
@@ -140,8 +140,8 @@ power_intr(void *unused)
/* debounce condition */
dsrtc_register_write(DS1687_EXT_CTRL, val & ~DS1687_KICKSTART);
- if (kbd_reset == 1) {
- kbd_reset = 0;
+ if (allowpowerdown == 1) {
+ allowpowerdown = 0;
psignal(initproc, SIGUSR2);
}
diff --git a/sys/arch/sgi/sgi/machdep.c b/sys/arch/sgi/sgi/machdep.c
index e3e817b53ba..dd6e701ad16 100644
--- a/sys/arch/sgi/sgi/machdep.c
+++ b/sys/arch/sgi/sgi/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.110 2011/06/05 19:41:08 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.111 2011/06/24 19:47:49 naddy Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -106,7 +106,6 @@ int rsvdmem; /* Reserved memory not usable. */
int ncpu = 1; /* At least one CPU in the system. */
struct user *proc0paddr;
int console_ok; /* Set when console initialized. */
-int kbd_reset;
int16_t masternasid;
int32_t *environment;
@@ -657,10 +656,6 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
return ENOTDIR; /* Overloaded */
switch (name[0]) {
- case CPU_KBDRESET:
- if (securelevel > 0)
- return (sysctl_rdint(oldp, oldlenp, newp, kbd_reset));
- return (sysctl_int(oldp, oldlenp, newp, newlen, &kbd_reset));
default:
return EOPNOTSUPP;
}