diff options
author | njl <njl@FreeBSD.org> | 2003-09-15 06:29:31 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2003-09-15 06:29:31 +0000 |
commit | 655e8629be4288bec60568a57560a16e04493d51 (patch) | |
tree | 183ae81e95be86ad13410a5119ed568b832a6f4a | |
parent | 38e47abc4afd48fe0e6d234875e3cf8724eaa92f (diff) | |
download | FreeBSD-src-655e8629be4288bec60568a57560a16e04493d51.zip FreeBSD-src-655e8629be4288bec60568a57560a16e04493d51.tar.gz |
Only enable S4BIOS by default if the FACS says it is available. The
user can override this with a sysctl.
Be sure to return the acpi_SetSleepState return value to userland.
-rw-r--r-- | sys/dev/acpica/acpi.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 309709b..d7149d6 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -431,7 +431,6 @@ acpi_attach(device_t dev) */ sc->acpi_sleep_delay = 5; sc->acpi_disable_on_poweroff = 1; - sc->acpi_s4bios = 1; if (bootverbose) sc->acpi_verbose = 1; if ((env = getenv("hw.acpi.verbose")) && strcmp(env, "0")) { @@ -439,6 +438,10 @@ acpi_attach(device_t dev) freeenv(env); } + /* Only enable S4BIOS by default if the FACS says it is available. */ + if (AcpiGbl_FACS->S4Bios_f != 0) + sc->acpi_s4bios = 1; + /* * Dispatch the default sleep state to devices. * TBD: should be configured from userland policy manager. @@ -1980,10 +1983,12 @@ acpiioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, d_thread_t *td) break; } state = *(int *)addr; - if (state >= ACPI_STATE_S0 && state <= ACPI_S_STATES_MAX) - acpi_SetSleepState(sc, state); - else + if (state >= ACPI_STATE_S0 && state <= ACPI_S_STATES_MAX) { + if (ACPI_FAILURE(acpi_SetSleepState(sc, state))) + error = EINVAL; + } else { error = EINVAL; + } break; default: if (error == 0) |