diff options
author | iwasaki <iwasaki@FreeBSD.org> | 2001-07-22 19:13:54 +0000 |
---|---|---|
committer | iwasaki <iwasaki@FreeBSD.org> | 2001-07-22 19:13:54 +0000 |
commit | 3e49617509e16373184b50aad15ec9b66b31cca1 (patch) | |
tree | 01544b1cf32da46bdc3bc6355f76adadf6800ab7 | |
parent | 6e2ef43eedee8839bc7db512e0692c80a73cb935 (diff) | |
download | FreeBSD-src-3e49617509e16373184b50aad15ec9b66b31cca1.zip FreeBSD-src-3e49617509e16373184b50aad15ec9b66b31cca1.tar.gz |
Don't do sleep state transition if specified sleep state is not
supported by the system.
-rw-r--r-- | sys/amd64/acpica/acpi_wakeup.c | 13 | ||||
-rw-r--r-- | sys/dev/acpica/acpi.c | 8 | ||||
-rw-r--r-- | sys/i386/acpica/acpi_wakeup.c | 13 |
3 files changed, 20 insertions, 14 deletions
diff --git a/sys/amd64/acpica/acpi_wakeup.c b/sys/amd64/acpica/acpi_wakeup.c index bd97f77..ad67313 100644 --- a/sys/amd64/acpica/acpi_wakeup.c +++ b/sys/amd64/acpica/acpi_wakeup.c @@ -253,13 +253,6 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) #endif icu_reinit(); - pmap_remove(pm, sc->acpi_wakephys, - sc->acpi_wakephys + PAGE_SIZE); - if (opage) { - pmap_enter(pm, sc->acpi_wakephys, page, - VM_PROT_READ | VM_PROT_WRITE, 0); - } - if (debug_wakeup) { acpi_savecpu(); acpi_printcpu(); @@ -267,6 +260,12 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) } out: + pmap_remove(pm, sc->acpi_wakephys, sc->acpi_wakephys + PAGE_SIZE); + if (opage) { + pmap_enter(pm, sc->acpi_wakephys, page, + VM_PROT_READ | VM_PROT_WRITE, 0); + } + write_eflags(ef); return (ret); diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 93f58b5..8eaaeb2 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1041,6 +1041,8 @@ acpi_SetSleepState(struct acpi_softc *sc, int state) { ACPI_STATUS status = AE_OK; UINT16 Count; + UINT8 TypeA; + UINT8 TypeB; FUNCTION_TRACE_U32(__func__, state); ACPI_ASSERTLOCK; @@ -1057,6 +1059,12 @@ acpi_SetSleepState(struct acpi_softc *sc, int state) case ACPI_STATE_S2: case ACPI_STATE_S3: case ACPI_STATE_S4: + status = AcpiHwObtainSleepTypeRegisterData((UINT8)state, &TypeA, &TypeB); + if (status != AE_OK) { + device_printf(sc->acpi_dev, "AcpiHwObtainSleepTypeRegisterData failed - %s\n", AcpiFormatException(status)); + break; + } + /* * Inform all devices that we are going to sleep. */ diff --git a/sys/i386/acpica/acpi_wakeup.c b/sys/i386/acpica/acpi_wakeup.c index bd97f77..ad67313 100644 --- a/sys/i386/acpica/acpi_wakeup.c +++ b/sys/i386/acpica/acpi_wakeup.c @@ -253,13 +253,6 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) #endif icu_reinit(); - pmap_remove(pm, sc->acpi_wakephys, - sc->acpi_wakephys + PAGE_SIZE); - if (opage) { - pmap_enter(pm, sc->acpi_wakephys, page, - VM_PROT_READ | VM_PROT_WRITE, 0); - } - if (debug_wakeup) { acpi_savecpu(); acpi_printcpu(); @@ -267,6 +260,12 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) } out: + pmap_remove(pm, sc->acpi_wakephys, sc->acpi_wakephys + PAGE_SIZE); + if (opage) { + pmap_enter(pm, sc->acpi_wakephys, page, + VM_PROT_READ | VM_PROT_WRITE, 0); + } + write_eflags(ef); return (ret); |