able to react to this suitably.
-/* $OpenBSD: apm.c,v 1.15 2022/02/15 21:17:12 deraadt Exp $ */
+/* $OpenBSD: apm.c,v 1.16 2022/02/16 06:41:27 deraadt Exp $ */
/*-
* Copyright (c) 2001 Alexander Guy. All rights reserved.
return 0;
}
-void
+int
gosleep(void *v)
{
- // XXX
+ return EOPNOTSUPP;
}
void
return 0;
}
-void
+int
suspend_finish(void *v)
{
#if 0
if (acpibtn_numopenlids() == 0 && lid_action != 0)
acpi_addtask(sc, acpi_sleep_task, sc, sc->sc_state);
#endif
+ return 0;
}
#endif /* SUSPEND */
-
-/* $OpenBSD: apm.c,v 1.31 2022/02/15 21:17:12 deraadt Exp $ */
+/* $OpenBSD: apm.c,v 1.32 2022/02/16 06:41:27 deraadt Exp $ */
/*-
* Copyright (c) 2001 Alexander Guy. All rights reserved.
return 0;
}
-void
+int
gosleep(void *v)
{
+ return EOPNOTSUPP;
}
-void
+int
suspend_finish(void *v)
{
+ return 0;
}
#endif /* SUSPEND */
-/* $OpenBSD: acpi_x86.c,v 1.7 2022/02/15 21:17:12 deraadt Exp $ */
+/* $OpenBSD: acpi_x86.c,v 1.8 2022/02/16 06:41:27 deraadt Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
return 0;
}
-void
+int
gosleep(void *v)
{
struct acpi_softc *sc = v;
+ int ret;
/* Clear fixed event status */
acpi_write_pmreg(sc, ACPIREG_PM1_STS, 0, ACPI_PM1_ALL_STS);
acpi_disable_allgpes(sc);
acpi_enable_wakegpes(sc, sc->sc_state);
- /* Sleep */
- acpi_sleep_cpu(sc, sc->sc_state);
- /* Resume */
-
+ ret = acpi_sleep_cpu(sc, sc->sc_state);
acpi_resume_cpu(sc, sc->sc_state);
sc->sc_state = ACPI_STATE_S0;
+
+ return ret;
}
void
return 0;
}
-void
+int
suspend_finish(void *v)
{
struct acpi_softc *sc = v;
/* If we woke up but all the lids are closed, go back to sleep */
if (acpibtn_numopenlids() == 0 && lid_action != 0)
acpi_addtask(sc, acpi_sleep_task, sc, sc->sc_state);
+ return 0;
}
-/* $OpenBSD: subr_suspend.c,v 1.7 2022/02/15 21:17:12 deraadt Exp $ */
+/* $OpenBSD: subr_suspend.c,v 1.8 2022/02/16 06:41:27 deraadt Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
boothowto &= ~RB_POWERDOWN;
}
- gosleep(v);
+ error = gosleep(v);
#ifdef HIBERNATE
if (sleepmode == SLEEP_HIBERNATE) {
-/* $OpenBSD: device.h,v 1.61 2022/02/15 21:17:12 deraadt Exp $ */
+/* $OpenBSD: device.h,v 1.62 2022/02/16 06:41:27 deraadt Exp $ */
/* $NetBSD: device.h,v 1.15 1996/04/09 20:55:24 cgd Exp $ */
/*
int sleep_setstate(void *v);
int sleep_resume(void *v);
void sleep_abort(void *v);
-void gosleep(void *v);
-void suspend_finish(void *v);
+int gosleep(void *v);
+int suspend_finish(void *v);
struct device *device_mainbus(void);
struct device *device_mpath(void);