diff options
-rw-r--r-- | sys/dev/acpica/acpi.c | 4 | ||||
-rw-r--r-- | sys/dev/syscons/syscons.c | 2 | ||||
-rw-r--r-- | sys/dev/vt/vt_core.c | 4 | ||||
-rw-r--r-- | sys/sys/eventhandler.h | 1 |
4 files changed, 8 insertions, 3 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 0e8998b..a4732c4 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -2749,6 +2749,8 @@ acpi_EnterSleepState(struct acpi_softc *sc, int state) return_ACPI_STATUS (AE_OK); } + EVENTHANDLER_INVOKE(power_suspend_early); + stop_all_proc(); EVENTHANDLER_INVOKE(power_suspend); if (smp_started) { @@ -2892,6 +2894,8 @@ backout: thread_unlock(curthread); } + resume_all_proc(); + EVENTHANDLER_INVOKE(power_resume); /* Allow another sleep request after a while. */ diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 6a19523..2ab2889 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -549,7 +549,7 @@ sc_attach_unit(int unit, int flags) /* Register suspend/resume/shutdown callbacks for the kernel console. */ if (sc_console_unit == unit) { - EVENTHANDLER_REGISTER(power_suspend, scsuspend, NULL, + EVENTHANDLER_REGISTER(power_suspend_early, scsuspend, NULL, EVENTHANDLER_PRI_ANY); EVENTHANDLER_REGISTER(power_resume, scresume, NULL, EVENTHANDLER_PRI_ANY); diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index d700730..47b3c8a 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -2556,8 +2556,8 @@ vt_upgrade(struct vt_device *vd) vd->vd_timer_armed = 1; /* Register suspend/resume handlers. */ - EVENTHANDLER_REGISTER(power_suspend, vt_suspend_handler, vd, - EVENTHANDLER_PRI_ANY); + EVENTHANDLER_REGISTER(power_suspend_early, vt_suspend_handler, + vd, EVENTHANDLER_PRI_ANY); EVENTHANDLER_REGISTER(power_resume, vt_resume_handler, vd, EVENTHANDLER_PRI_ANY); } diff --git a/sys/sys/eventhandler.h b/sys/sys/eventhandler.h index 4e77d5b..d82ece7 100644 --- a/sys/sys/eventhandler.h +++ b/sys/sys/eventhandler.h @@ -182,6 +182,7 @@ EVENTHANDLER_DECLARE(shutdown_final, shutdown_fn); typedef void (*power_change_fn)(void *); EVENTHANDLER_DECLARE(power_resume, power_change_fn); EVENTHANDLER_DECLARE(power_suspend, power_change_fn); +EVENTHANDLER_DECLARE(power_suspend_early, power_change_fn); /* Low memory event */ typedef void (*vm_lowmem_handler_t)(void *, int); |