summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorCan Erkin Acar <canacar@cvs.openbsd.org>2010-08-07 16:55:39 +0000
committerCan Erkin Acar <canacar@cvs.openbsd.org>2010-08-07 16:55:39 +0000
commit388df754f25094ae80d0448e2533c9dee13733b1 (patch)
treefe38c70c7a8592607422f20de581733756647ef4 /sys/dev
parenta6a589c475158a6012cad5a942ee018c4fedf6ac (diff)
Generate power change events for APM. Makes powerup and powerdown scripts
work with ACPI. ok deraadt@, phessler@, feedback kettenis@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpi/acpiac.c5
-rw-r--r--sys/dev/acpi/acpibat.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/acpi/acpiac.c b/sys/dev/acpi/acpiac.c
index 1e534c44703..d4b48cf0780 100644
--- a/sys/dev/acpi/acpiac.c
+++ b/sys/dev/acpi/acpiac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpiac.c,v 1.27 2009/03/11 20:37:46 jordan Exp $ */
+/* $OpenBSD: acpiac.c,v 1.28 2010/08/07 16:55:38 canacar Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
@@ -16,11 +16,13 @@
*/
#include <sys/param.h>
+#include <sys/event.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/malloc.h>
#include <machine/bus.h>
+#include <machine/apmvar.h>
#include <dev/acpi/acpireg.h>
#include <dev/acpi/acpivar.h>
@@ -95,6 +97,7 @@ acpiac_refresh(void *arg)
acpiac_getsta(sc);
sc->sc_sens[0].value = sc->sc_ac_stat;
+ acpi_record_event(sc->sc_acpi, APM_POWER_CHANGE);
}
int
diff --git a/sys/dev/acpi/acpibat.c b/sys/dev/acpi/acpibat.c
index ee6bcdb9977..882846b6c60 100644
--- a/sys/dev/acpi/acpibat.c
+++ b/sys/dev/acpi/acpibat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpibat.c,v 1.56 2010/07/21 19:35:15 deraadt Exp $ */
+/* $OpenBSD: acpibat.c,v 1.57 2010/08/07 16:55:38 canacar Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
@@ -23,6 +23,7 @@
#include <sys/sensors.h>
#include <machine/bus.h>
+#include <machine/apmvar.h>
#include <dev/acpi/acpireg.h>
#include <dev/acpi/acpivar.h>
@@ -279,6 +280,7 @@ acpibat_refresh(void *arg)
sc->sc_sens[7].status = SENSOR_S_UNSPEC;
sc->sc_sens[7].flags = 0;
}
+ acpi_record_event(sc->sc_acpi, APM_POWER_CHANGE);
}
int