diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2024-08-18 02:53:09 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2024-08-18 02:53:09 +0000 |
commit | 755c02d0423d1f8a0808166b2ad221fd04a79015 (patch) | |
tree | 1977c8e559aadc4bae8003d32f0c05d0828b2085 /sys/dev/acpi | |
parent | e06085c5dfe6a8db8c223df74f19c444b86cf461 (diff) |
If FADT indicates FADT_POWER_S0_IDLE_CAPABLE, print "S0ix" instead
of "S0" on the acpi: sleep states line. (In my view, this flag-bit
announces that the hardware vendor + bios vendor + microsoft have agreed
this machine has enough "features" that S0 suspend is about as good or
better than S3, for various criteria).
ok kettenis mlarkin
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r-- | sys/dev/acpi/acpi.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index de66b0a45b7..5da2524cb75 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.437 2024/08/10 23:28:17 deraadt Exp $ */ +/* $OpenBSD: acpi.c,v 1.438 2024/08/18 02:53:08 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -2502,16 +2502,19 @@ acpi_init_states(struct acpi_softc *sc) snprintf(name, sizeof(name), "_S%d_", i); sc->sc_sleeptype[i].slp_typa = -1; sc->sc_sleeptype[i].slp_typb = -1; - if (aml_evalname(sc, sc->sc_root, name, 0, NULL, &res) == 0) { - if (res.type == AML_OBJTYPE_PACKAGE) { - sc->sc_sleeptype[i].slp_typa = - aml_val2int(res.v_package[0]); - sc->sc_sleeptype[i].slp_typb = - aml_val2int(res.v_package[1]); - printf(" S%d", i); - } + if (aml_evalname(sc, sc->sc_root, name, 0, NULL, &res) != 0) + continue; + if (res.type != AML_OBJTYPE_PACKAGE) { aml_freevalue(&res); + continue; } + sc->sc_sleeptype[i].slp_typa = aml_val2int(res.v_package[0]); + sc->sc_sleeptype[i].slp_typb = aml_val2int(res.v_package[1]); + aml_freevalue(&res); + + printf(" S%d", i); + if (i == 0 && (sc->sc_fadt->flags & FADT_POWER_S0_IDLE_CAPABLE)) + printf("ix"); } } |