Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch Restore the interrupt level in cpu_reboot() before ...



details:   https://anonhg.NetBSD.org/src/rev/a6437dad5176
branches:  trunk
changeset: 760720:a6437dad5176
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Tue Jan 11 21:10:17 2011 +0000

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

diffstat:

 sys/arch/amd64/amd64/machdep.c |  10 +++++++---
 sys/arch/i386/i386/machdep.c   |  11 ++++++++---
 2 files changed, 15 insertions(+), 6 deletions(-)

diffs (92 lines):

diff -r 307773d2fee8 -r a6437dad5176 sys/arch/amd64/amd64/machdep.c
--- a/sys/arch/amd64/amd64/machdep.c    Tue Jan 11 20:35:24 2011 +0000
+++ b/sys/arch/amd64/amd64/machdep.c    Tue Jan 11 21:10:17 2011 +0000
@@ -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 */
diff -r 307773d2fee8 -r a6437dad5176 sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c      Tue Jan 11 20:35:24 2011 +0000
+++ b/sys/arch/i386/i386/machdep.c      Tue Jan 11 21:10:17 2011 +0000
@@ -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)



Home | Main Index | Thread Index | Old Index