diff options
author | jkim <jkim@FreeBSD.org> | 2011-04-19 16:20:55 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2011-04-19 16:20:55 +0000 |
commit | 830058933714d904d4f17fd73a72b0cbc425409e (patch) | |
tree | 370b2d2ba80eeda42ea9a68e5e0c42b0061adc10 | |
parent | 94dea9059f0ff01c8960a0b84dfc86d2f92fcabe (diff) | |
download | FreeBSD-src-830058933714d904d4f17fd73a72b0cbc425409e.zip FreeBSD-src-830058933714d904d4f17fd73a72b0cbc425409e.tar.gz |
Add suspend/resume event handlers for apm(4) as well.
-rw-r--r-- | sys/i386/bios/apm.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c index f33bafd..1fe2e86 100644 --- a/sys/i386/bios/apm.c +++ b/sys/i386/bios/apm.c @@ -484,16 +484,16 @@ apm_do_suspend(void) apm_op_inprog = 0; sc->suspends = sc->suspend_countdown = 0; + EVENTHANDLER_INVOKE(power_suspend); + /* * Be sure to hold Giant across DEVICE_SUSPEND/RESUME since * non-MPSAFE drivers need this. */ mtx_lock(&Giant); error = DEVICE_SUSPEND(root_bus); - if (error) { - mtx_unlock(&Giant); - return; - } + if (error) + goto backout; apm_execute_hook(hook[APM_HOOK_SUSPEND]); if (apm_suspend_system(PMST_SUSPEND) == 0) { @@ -504,8 +504,9 @@ apm_do_suspend(void) apm_execute_hook(hook[APM_HOOK_RESUME]); DEVICE_RESUME(root_bus); } +backout: mtx_unlock(&Giant); - return; + EVENTHANDLER_INVOKE(power_resume); } static void @@ -612,7 +613,7 @@ apm_resume(void) mtx_lock(&Giant); DEVICE_RESUME(root_bus); mtx_unlock(&Giant); - return; + EVENTHANDLER_INVOKE(power_resume); } |