summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-04-12 12:49:29 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-04-12 12:49:29 +0000
commit55b7ceed0ca2cd9984cd3d2a58ae84439a3510f0 (patch)
treeda79f888feb519f98c27a7c3424b4c9266827293
parent93de1ab6042ecbf745ff778bc42998c0ef836f5e (diff)
Get rid of acpi_s5 global variables; simply send SIGUSR2 instead of SUGUSR1
to tell init(8) to power down the machine. ok krw@
-rw-r--r--sys/arch/amd64/amd64/machdep.c6
-rw-r--r--sys/arch/i386/i386/machdep.c6
-rw-r--r--sys/dev/acpi/acpi.c4
-rw-r--r--sys/dev/acpi/acpibtn.c9
-rw-r--r--sys/dev/acpi/acpitz.c6
5 files changed, 13 insertions, 18 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index c190adb165f..59ba69927a3 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.70 2008/04/09 16:58:10 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.71 2008/04/12 12:49:28 kettenis Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -790,11 +790,11 @@ haltsys:
if (howto & RB_HALT) {
#if NACPI > 0 && !defined(SMALL_KERNEL)
- extern int acpi_s5, acpi_enabled;
+ extern int acpi_enabled;
if (acpi_enabled) {
delay(500000);
- if (howto & RB_POWERDOWN || acpi_s5)
+ if (howto & RB_POWERDOWN)
acpi_powerdown();
}
#endif
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index bcf7ce29dd4..6fbc22adb49 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.421 2008/04/09 16:58:10 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.422 2008/04/12 12:49:28 kettenis Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -2407,11 +2407,11 @@ haltsys:
if (howto & RB_HALT) {
#if NACPI > 0 && !defined(SMALL_KERNEL)
- extern int acpi_s5, acpi_enabled;
+ extern int acpi_enabled;
if (acpi_enabled) {
delay(500000);
- if ((howto & RB_POWERDOWN) || acpi_s5)
+ if (howto & RB_POWERDOWN)
acpi_powerdown();
}
#endif
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index a81dbbc553e..2519faacc53 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.113 2008/01/21 12:43:09 jsg Exp $ */
+/* $OpenBSD: acpi.c,v 1.114 2008/04/12 12:49:28 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -106,7 +106,7 @@ struct cfdriver acpi_cd = {
};
struct acpi_softc *acpi_softc;
-int acpi_s5, acpi_evindex;
+int acpi_evindex;
#define acpi_bus_space_map _bus_space_map
#define acpi_bus_space_unmap _bus_space_unmap
diff --git a/sys/dev/acpi/acpibtn.c b/sys/dev/acpi/acpibtn.c
index b47cb8b12e9..8d7ae2fdd42 100644
--- a/sys/dev/acpi/acpibtn.c
+++ b/sys/dev/acpi/acpibtn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpibtn.c,v 1.15 2006/12/26 23:58:08 marco Exp $ */
+/* $OpenBSD: acpibtn.c,v 1.16 2008/04/12 12:49:28 kettenis Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
@@ -118,7 +118,6 @@ int
acpibtn_notify(struct aml_node *node, int notify_type, void *arg)
{
struct acpibtn_softc *sc = arg;
- extern int acpi_s5;
dnprintf(10, "acpibtn_notify: %.2x %s\n", notify_type,
sc->sc_devnode->parent->name);
@@ -128,10 +127,8 @@ acpibtn_notify(struct aml_node *node, int notify_type, void *arg)
case ACPIBTN_SLEEP:
break;
case ACPIBTN_POWER:
- if (notify_type == 0x80) {
- acpi_s5 = 1;
- psignal(initproc, SIGUSR1);
- }
+ if (notify_type == 0x80)
+ psignal(initproc, SIGUSR2);
break;
default:
printf("%s: spurious acpi button interrupt %i\n", DEVNAME(sc),
diff --git a/sys/dev/acpi/acpitz.c b/sys/dev/acpi/acpitz.c
index ccf7f841b25..725cf65db1a 100644
--- a/sys/dev/acpi/acpitz.c
+++ b/sys/dev/acpi/acpitz.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpitz.c,v 1.22 2008/01/08 20:49:59 marco Exp $ */
+/* $OpenBSD: acpitz.c,v 1.23 2008/04/12 12:49:28 kettenis Exp $ */
/*
* Copyright (c) 2006 Can Erkin Acar <canacar@openbsd.org>
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
@@ -250,7 +250,6 @@ acpitz_refresh(void *arg)
{
struct acpitz_softc *sc = arg;
int i, perc;
- extern int acpi_s5;
dnprintf(30, "%s: %s: refresh\n", DEVNAME(sc),
sc->sc_devnode->parent->name);
@@ -266,8 +265,7 @@ acpitz_refresh(void *arg)
/* do critical shutdown */
printf("%s: Critical temperature, shutting down\n",
DEVNAME(sc));
- acpi_s5 = 1;
- psignal(initproc, SIGUSR1);
+ psignal(initproc, SIGUSR2);
}
if (sc->sc_hot != -1 && sc->sc_hot <= sc->sc_tmp) {
printf("%s: _HOT temperature\n", DEVNAME(sc));