summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2006-01-05 21:22:22 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2006-01-05 21:22:22 +0000
commitb2cc79c6a1e76f0de98c89dedc848cc6154d18d1 (patch)
tree19aa2c6f8b15e05b30803033ba195c9bfcbc96b9
parent3721b52c72f33552deb4f42fff4a5a4f9195014c (diff)
Provide symbolic names for the acpi sleeping states and use it.
-rw-r--r--sys/dev/acpi/acpi.c4
-rw-r--r--sys/dev/acpi/acpireg.h12
2 files changed, 13 insertions, 3 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index 3647fe1a9b1..056a16028a1 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.13 2005/12/28 03:09:21 marco Exp $ */
+/* $OpenBSD: acpi.c,v 1.14 2006/01/05 21:22:21 grange Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -810,7 +810,7 @@ acpi_enter_sleep_state(struct acpi_softc *sc, int state)
void
acpi_powerdown(void)
{
- acpi_enter_sleep_state(acpi_softc, 5);
+ acpi_enter_sleep_state(acpi_softc, ACPI_STATE_S5);
}
int
diff --git a/sys/dev/acpi/acpireg.h b/sys/dev/acpi/acpireg.h
index d9eea47b1ad..8cac200f83a 100644
--- a/sys/dev/acpi/acpireg.h
+++ b/sys/dev/acpi/acpireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpireg.h,v 1.6 2005/12/16 18:11:55 jordan Exp $ */
+/* $OpenBSD: acpireg.h,v 1.7 2006/01/05 21:22:21 grange Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Marco Peereboom <marco@opebsd.org>
@@ -432,6 +432,16 @@ struct acpi_facs {
#define ACPI_PM1_SLP_EN 0x2000
/*
+ * Sleeping States
+ */
+#define ACPI_STATE_S0 0
+#define ACPI_STATE_S1 1
+#define ACPI_STATE_S2 2
+#define ACPI_STATE_S3 3
+#define ACPI_STATE_S4 4
+#define ACPI_STATE_S5 5
+
+/*
* ACPI Device IDs
*/
#define ACPI_DEV_ACPI "PNP0C08" /* ACPI device */