-/* $OpenBSD: acpi.c,v 1.202 2010/08/05 17:00:50 deraadt Exp $ */
+/* $OpenBSD: acpi.c,v 1.203 2010/08/05 17:26:57 deraadt Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
sc->sc_powerbtn = 0;
dnprintf(1,"power button pressed\n");
- aml_notify_dev(ACPI_DEV_PBD, 0x80);
+ sc->sc_powerdown = 1;
/* Reset the latch and re-enable the GPE */
s = spltty();
acpi_poll_notify();
}
+ if (sc->sc_powerdown) {
+ sc->sc_powerdown = 0;
+
+ /* XXX put a knob in front of this */
+ psignal(initproc, SIGUSR2);
+ }
+
if (sc->sc_sleepmode) {
int sleepmode = sc->sc_sleepmode;
-/* $OpenBSD: acpibtn.c,v 1.27 2010/07/06 20:14:17 deraadt Exp $ */
+/* $OpenBSD: acpibtn.c,v 1.28 2010/08/05 17:26:57 deraadt Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
break;
case ACPIBTN_POWER:
if (notify_type == 0x80)
- psignal(initproc, SIGUSR2);
+ sc->sc_acpi->sc_powerdown = 1;
break;
default:
printf("%s: spurious acpi button interrupt %i\n", DEVNAME(sc),
-/* $OpenBSD: acpivar.h,v 1.63 2010/07/20 12:14:10 deraadt Exp $ */
+/* $OpenBSD: acpivar.h,v 1.64 2010/08/05 17:26:57 deraadt Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
int sc_sleepbtn;
int sc_sleepmode;
+ int sc_powerdown;
struct {
int slp_typa;