Module Name:    src
Committed By:   jruoho
Date:           Tue Jan 11 21:10:18 UTC 2011

Modified Files:
        src/sys/arch/amd64/amd64: machdep.c
        src/sys/arch/i386/i386: machdep.c

Log Message:
Restore the interrupt level in cpu_reboot() before calling the
acpi_enter_sleep_state() function.


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.698 -r1.699 src/sys/arch/i386/i386/machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.157 src/sys/arch/amd64/amd64/machdep.c:1.158
--- src/sys/arch/amd64/amd64/machdep.c:1.157	Mon Nov 15 06:12:28 2010
+++ src/sys/arch/amd64/amd64/machdep.c	Tue Jan 11 21:10:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.157 2010/11/15 06:12:28 uebayasi Exp $	*/
+/*	$NetBSD: machdep.c,v 1.158 2011/01/11 21:10:17 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008
@@ -107,7 +107,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.157 2010/11/15 06:12:28 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.158 2011/01/11 21:10:17 jruoho Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -669,6 +669,7 @@
 void
 cpu_reboot(int howto, char *bootstr)
 {
+	int s = IPL_NONE;
 
 	if (cold) {
 		howto |= RB_HALT;
@@ -687,7 +688,7 @@
 	}
 
 	/* Disable interrupts. */
-	splhigh();
+	s = splhigh();
 
 	/* Do a dump if requested. */
 	if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP)
@@ -701,6 +702,9 @@
         if ((howto & RB_POWERDOWN) == RB_POWERDOWN) {
 #ifndef XEN
 #if NACPICA > 0
+		if (s != IPL_NONE)
+			splx(s);
+
 		acpi_enter_sleep_state(ACPI_STATE_S5);
 #endif
 #else /* XEN */

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.698 src/sys/arch/i386/i386/machdep.c:1.699
--- src/sys/arch/i386/i386/machdep.c:1.698	Fri Nov 12 13:18:57 2010
+++ src/sys/arch/i386/i386/machdep.c	Tue Jan 11 21:10:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.698 2010/11/12 13:18:57 uebayasi Exp $	*/
+/*	$NetBSD: machdep.c,v 1.699 2011/01/11 21:10:17 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.698 2010/11/12 13:18:57 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.699 2011/01/11 21:10:17 jruoho Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -864,7 +864,9 @@
 {
 	static bool syncdone = false;
 	struct lwp *l;
+	int s;
 
+	s = IPL_NONE;
 	l = (curlwp == NULL) ? &lwp0 : curlwp;
 
 	if (cold) {
@@ -908,7 +910,7 @@
 
 	pmf_system_shutdown(boothowto);
 
-	splhigh();
+	s = splhigh();
 haltsys:
 
 	if ((howto & RB_POWERDOWN) == RB_POWERDOWN) {
@@ -923,6 +925,9 @@
 		}
 #endif
 #if NACPICA > 0
+		if (s != IPL_NONE)
+			splx(s);
+
 		acpi_enter_sleep_state(ACPI_STATE_S5);
 #endif
 #if NAPMBIOS > 0 && !defined(APM_NO_POWEROFF)

Reply via email to