diff options
author | Mike Smith <msmith@FreeBSD.org> | 1998-10-30 05:41:15 +0000 |
---|---|---|
committer | Mike Smith <msmith@FreeBSD.org> | 1998-10-30 05:41:15 +0000 |
commit | 35d27a0f39e3f560673f0a6e1029236bd30dbf15 (patch) | |
tree | 6e5881796caf5a310f15452200ad984e0f7dcd2f /sys/i386/bios | |
parent | 400ea5dc6a8a45ca9ba9a19d08857d4731d7781e (diff) | |
download | src-35d27a0f39e3f560673f0a6e1029236bd30dbf15.tar.gz src-35d27a0f39e3f560673f0a6e1029236bd30dbf15.zip |
Add the ability to specify where on the at_shutdown queue a handler is
installed.
Remove cpu_power_down, and replace it with an entry at the end of the
SHUTDOWN_FINAL queue in the only place it's used (APM).
Submitted by: Some ideas from Bruce Walter <walter@fortean.com>
Notes
Notes:
svn path=/head/; revision=40751
Diffstat (limited to 'sys/i386/bios')
-rw-r--r-- | sys/i386/bios/apm.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c index c871151c7ae0..ffe4b0a95b3a 100644 --- a/sys/i386/bios/apm.c +++ b/sys/i386/bios/apm.c @@ -15,7 +15,7 @@ * * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * - * $Id: apm.c,v 1.73 1998/07/06 06:29:03 imp Exp $ + * $Id: apm.c,v 1.74 1998/09/28 03:41:12 jlemon Exp $ */ #include "opt_devfs.h" @@ -29,6 +29,7 @@ #endif /*DEVFS*/ #include <sys/systm.h> #include <sys/time.h> +#include <sys/reboot.h> #include <i386/isa/isa_device.h> #include <machine/apm_bios.h> #include <machine/segments.h> @@ -245,12 +246,13 @@ apm_display(int newstate) /* * Turn off the entire system. */ -void -apm_power_off(void) +static void +apm_power_off(int howto, void *junk) { u_long eax, ebx, ecx, edx; - if (!apm_softc.active) + /* Not halting, or not active */ + if (!(howto & RB_HALT) || !apm_softc.active) return; eax = (APM_BIOS << 8) | APM_SETPWSTATE; ebx = PMDV_ALLDEV; @@ -903,6 +905,9 @@ apmattach(struct isa_device *dvp) apm_event_enable(); + /* Power the system off using APM */ + at_shutdown_pri(apm_power_off, NULL, SHUTDOWN_FINAL, SHUTDOWN_PRI_LAST); + sc->initialized = 1; #ifdef DEVFS |