-/* $OpenBSD: cpu.c,v 1.191 2024/07/21 19:41:31 bluhm Exp $ */
+/* $OpenBSD: cpu.c,v 1.192 2024/08/08 07:02:38 kettenis Exp $ */
/* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
#endif
int cpu_suspended;
+int cpu_wakeups;
#ifdef SUSPEND
cpu_suspend_primary(void)
{
struct cpu_info *ci = curcpu();
- int count = 0;
-
- printf("suspend\n");
/* Mask clock interrupts. */
local_pic.pic_hwmask(&local_pic, 0);
while (cpu_suspended) {
cpu_suspend_cycle();
- count++;
+ cpu_wakeups++;
}
intr_disable();
/* Unmask clock interrupts. */
local_pic.pic_hwunmask(&local_pic, 0);
- printf("resume %d\n", count);
return 0;
}
-/* $OpenBSD: cpu.c,v 1.115 2024/05/29 12:21:33 kettenis Exp $ */
+/* $OpenBSD: cpu.c,v 1.116 2024/08/08 07:02:38 kettenis Exp $ */
/* $NetBSD: cpu.c,v 1.1.2.7 2000/06/26 02:04:05 sommerfeld Exp $ */
/*-
#endif
int cpu_suspended;
+int cpu_wakeups;
-/* $OpenBSD: acpi_x86.c,v 1.24 2024/08/06 17:38:56 kettenis Exp $ */
+/* $OpenBSD: acpi_x86.c,v 1.25 2024/08/08 07:02:38 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
int
gosleep(void *v)
{
+ extern int cpu_wakeups;
struct acpi_softc *sc = v;
int ret;
if (sc->sc_pmc_suspend)
sc->sc_pmc_suspend(sc->sc_pmc_cookie);
+ cpu_wakeups = 0;
sc->sc_wakeup = 0;
+ sc->sc_wakeups = 0;
while (!sc->sc_wakeup) {
ret = acpi_sleep_cpu(sc, sc->sc_state);
acpi_resume_cpu(sc, sc->sc_state);
+ sc->sc_wakeups++;
if (sc->sc_ec && sc->sc_wakegpe == sc->sc_ec->sc_gpe) {
sc->sc_wakeup = 0;
int
suspend_finish(void *v)
{
+ extern int cpu_wakeups;
struct acpi_softc *sc = v;
+ printf("wakeups: %d %d\n", cpu_wakeups, sc->sc_wakeups);
printf("wakeup event: ");
switch (sc->sc_wakegpe) {
case 0:
-/* $OpenBSD: acpivar.h,v 1.133 2024/08/06 17:38:56 kettenis Exp $ */
+/* $OpenBSD: acpivar.h,v 1.134 2024/08/08 07:02:38 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
struct aml_node *sc_wak;
int sc_state;
int sc_wakeup;
+ int sc_wakeups;
time_t sc_resume_time;
struct acpiec_softc *sc_ec; /* XXX assume single EC */