summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpi.c
diff options
context:
space:
mode:
authoriwasaki <iwasaki@FreeBSD.org>2001-11-28 12:09:42 +0000
committeriwasaki <iwasaki@FreeBSD.org>2001-11-28 12:09:42 +0000
commit08ec0d378eba37f5f0ac535a5b89978b9f37a31f (patch)
treeba2edf74d1fb35946c1f134c8e0c8fe1b0332140 /sys/dev/acpica/acpi.c
parent390c9f0f6ee0486a427e4caeea12828da443b805 (diff)
downloadFreeBSD-src-08ec0d378eba37f5f0ac535a5b89978b9f37a31f.zip
FreeBSD-src-08ec0d378eba37f5f0ac535a5b89978b9f37a31f.tar.gz
Yet another synch with minor changes in the ACPI CA 20011120 snapshot.
We need to call AcpiEnterSleepStatePrep() before AcpiEnterSleepState().
Diffstat (limited to 'sys/dev/acpica/acpi.c')
-rw-r--r--sys/dev/acpica/acpi.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index 6295816..cc8b86f 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -889,6 +889,12 @@ acpi_shutdown_final(void *arg, int howto)
if (howto & RB_POWEROFF) {
printf("Power system off using ACPI...\n");
+ status = AcpiEnterSleepStatePrep(acpi_off_state);
+ if (status != AE_OK) {
+ printf("AcpiEnterSleepStatePrep failed - %s\n",
+ AcpiFormatException(status));
+ return;
+ }
if ((status = AcpiEnterSleepState(acpi_off_state)) != AE_OK) {
printf("ACPI power-off failed - %s\n", AcpiFormatException(status));
} else {
@@ -1340,6 +1346,14 @@ acpi_SetSleepState(struct acpi_softc *sc, int state)
DEVICE_RESUME(root_bus);
return_ACPI_STATUS(AE_ERROR);
}
+
+ status = AcpiEnterSleepStatePrep(state);
+ if (status != AE_OK) {
+ device_printf(sc->acpi_dev, "AcpiEnterSleepStatePrep failed - %s\n",
+ AcpiFormatException(status));
+ break;
+ }
+
sc->acpi_sstate = state;
if (state != ACPI_STATE_S1) {
OpenPOWER on IntegriCloud