diff options
author | Christian Weisgerber <naddy@cvs.openbsd.org> | 2011-06-24 19:47:50 +0000 |
---|---|---|
committer | Christian Weisgerber <naddy@cvs.openbsd.org> | 2011-06-24 19:47:50 +0000 |
commit | 3da505965757e4e925366c29b363105405fd202d (patch) | |
tree | 3bd93b0681c5ada7d7dac32ec4fcd54b6063055f /sys/dev/acpi | |
parent | 7f1ea65fed8697f18acb9a18feab7940904e5e80 (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/dev/acpi')
-rw-r--r-- | sys/dev/acpi/acpi.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index afe55a227ae..231f34b3f83 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.225 2011/06/16 23:02:11 pirofti Exp $ */ +/* $OpenBSD: acpi.c,v 1.226 2011/06/24 19:47:49 naddy Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -1452,8 +1452,12 @@ acpi_sbtn_task(void *arg0, int dummy) void acpi_powerdown_task(void *arg0, int dummy) { - /* XXX put a knob in front of this */ - psignal(initproc, SIGUSR2); + extern int allowpowerdown; + + if (allowpowerdown == 1) { + allowpowerdown = 0; + psignal(initproc, SIGUSR2); + } } void |