1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-02-04 17:15:50 +00:00

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.
This commit is contained in:
Nate Lawson 2003-09-15 06:29:31 +00:00
parent 82f9defeaf
commit 2d610c4638
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=120087

View File

@ -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)