diff options
author | Nate Lawson <njl@FreeBSD.org> | 2003-09-15 06:29:31 +0000 |
---|---|---|
committer | Nate Lawson <njl@FreeBSD.org> | 2003-09-15 06:29:31 +0000 |
commit | 2d610c463813e45ec0229741ba978fcc4ac8b332 (patch) | |
tree | 183ae81e95be86ad13410a5119ed568b832a6f4a /sys/dev/acpica/acpi.c | |
parent | 82f9defeaf31766b02eb4e61e41ad777de926372 (diff) | |
download | src-2d610c463813e45ec0229741ba978fcc4ac8b332.tar.gz src-2d610c463813e45ec0229741ba978fcc4ac8b332.zip |
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.
Notes
Notes:
svn path=/head/; revision=120087
Diffstat (limited to 'sys/dev/acpica/acpi.c')
-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 309709befd95..d7149d6523ac 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) |