From 931a10c9d2fdacbf0b8627aba57014446943a68b Mon Sep 17 00:00:00 2001 From: Mitsuru IWASAKI Date: Fri, 30 Nov 2001 16:06:00 +0000 Subject: [PATCH] Add a couple of minor changes. - set sc->acpi_s4bios to 1 by default for hibernation until OS-initiated S4 transition is implemented. - change the behavior of acpi_sleep_state_sysctl() if new value is the same as old one, do nothing instead of EINVAL. --- sys/dev/acpica/acpi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index cc8b86f30620..8aba3cc70ea1 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -414,6 +414,7 @@ acpi_attach(device_t dev) SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), OID_AUTO, "verbose", CTLFLAG_RD | CTLFLAG_RW, &sc->acpi_verbose, 0, "verbose mode"); + sc->acpi_s4bios = 1; if (bootverbose) sc->acpi_verbose = 1; @@ -1758,8 +1759,10 @@ acpi_sleep_state_sysctl(SYSCTL_HANDLER_ARGS) sizeof(sleep_state)) == 0) break; } - if ((new_state != old_state) && (new_state <= ACPI_S_STATES_MAX+1)) { - *(u_int *)oidp->oid_arg1 = new_state; + if (new_state <= ACPI_S_STATES_MAX+1) { + if (new_state != old_state) { + *(u_int *)oidp->oid_arg1 = new_state; + } } else { error = EINVAL; }