From 29b5133eaa04fbb70c852c7917617913d9f5fa6f Mon Sep 17 00:00:00 2001
From: Marco Peereboom <marco@cvs.openbsd.org>
Date: Fri, 16 Dec 2005 19:00:31 +0000
Subject: Power down machine from acpi.

Help deraadt, ok jordan@
---
 sys/arch/i386/i386/machdep.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

(limited to 'sys/arch/i386')

diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index e6177e83bc0..4f3226c84ff 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: machdep.c,v 1.333 2005/11/23 09:32:46 mickey Exp $	*/
+/*	$OpenBSD: machdep.c,v 1.334 2005/12/16 19:00:30 marco Exp $	*/
 /*	$NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $	*/
 
 /*-
@@ -132,6 +132,11 @@
 #include <i386/isa/isa_machdep.h>
 #include <i386/isa/nvram.h>
 
+#include "acpi.h"
+#if NACPI > 0
+#include <dev/acpi/acpivar.h>
+#endif
+
 #include "apm.h"
 #if NAPM > 0
 #include <machine/apmvar.h>
@@ -2318,6 +2323,13 @@ haltsys:
 	doshutdownhooks();
 
 	if (howto & RB_HALT) {
+#if NACPI > 0
+		extern int acpi_s5;
+
+		if (acpi_s5)
+			acpi_powerdown();
+#endif
+
 #if NAPM > 0
 		if (howto & RB_POWERDOWN) {
 			int rv;
-- 
cgit v1.2.3