summaryrefslogtreecommitdiffstats
path: root/sys/i386/apm/apm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/apm/apm.c')
-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