-/* $OpenBSD: machdep.c,v 1.296 2024/07/29 18:43:11 kettenis Exp $ */
+/* $OpenBSD: machdep.c,v 1.297 2024/09/21 19:06:07 deraadt Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
extern int need_retpoline;
const struct sysctl_bounded_args cpuctl_vars[] = {
- { CPU_LIDACTION, &lid_action, 0, 2 },
+ { CPU_LIDACTION, &lid_action, -1, 2 },
{ CPU_PWRACTION, &pwr_action, 0, 2 },
{ CPU_CPUID, &cpu_id, SYSCTL_INT_READONLY },
{ CPU_CPUFEATURE, &cpu_feature, SYSCTL_INT_READONLY },
-/* $OpenBSD: acpi_x86.c,v 1.31 2024/08/31 15:53:44 deraadt Exp $ */
+/* $OpenBSD: acpi_x86.c,v 1.32 2024/09/21 19:06:06 deraadt Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
{
struct acpi_softc *sc = v;
int fallback_state = -1;
+ extern int lid_action;
switch (sleepmode) {
case SLEEP_SUSPEND:
sc->sc_state = ACPI_STATE_S3;
#ifdef __amd64__
- if (sc->sc_fadt->flags & FADT_POWER_S0_IDLE_CAPABLE)
+ if (lid_action == -1)
sc->sc_state = ACPI_STATE_S0;
fallback_state = ACPI_STATE_S0; /* No S3, use S0 */
#endif
-/* $OpenBSD: acpibtn.c,v 1.53 2024/08/06 17:38:56 kettenis Exp $ */
+/* $OpenBSD: acpibtn.c,v 1.54 2024/09/21 19:06:06 deraadt Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
switch (lid_action) {
case 1:
+ case -1:
goto sleep;
#ifdef HIBERNATE
case 2: