summaryrefslogtreecommitdiffstats
path: root/sys/i386/apm
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1998-10-30 05:41:15 +0000
committermsmith <msmith@FreeBSD.org>1998-10-30 05:41:15 +0000
commite79dcdb69f35b4c9a8524672d1c364e750730b38 (patch)
treec2d16e98b9b0fc0b55a9e67cbcf5b278c400f11f /sys/i386/apm
parent0fcabcf90e9664f8f2c243b394255dda6012386f (diff)
downloadFreeBSD-src-e79dcdb69f35b4c9a8524672d1c364e750730b38.zip
FreeBSD-src-e79dcdb69f35b4c9a8524672d1c364e750730b38.tar.gz
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>
Diffstat (limited to 'sys/i386/apm')
-rw-r--r--sys/i386/apm/apm.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/i386/apm/apm.c b/sys/i386/apm/apm.c
index c871151..ffe4b0a 100644
--- a/sys/i386/apm/apm.c
+++ b/sys/i386/apm/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
OpenPOWER on IntegriCloud