Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 Don't shutdown the boostrap processor (BSP)...



details:   https://anonhg.NetBSD.org/src/rev/82109d342409
branches:  trunk
changeset: 767764:82109d342409
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Fri Jul 29 21:21:43 2011 +0000

description:
Don't shutdown the boostrap processor (BSP) because we may have to run
BIOS methods on it.  For example, ACPI requires that we execute the code
for changing sleep state on the BSP.

This may help the problem where folks' machines would hang instead of
powering off when they entered ACPI sleep state 5.

XXX If the BSP is already shut down, we should start it back up.

diffstat:

 sys/arch/x86/x86/cpu.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 4e8ac17ab6d8 -r 82109d342409 sys/arch/x86/x86/cpu.c
--- a/sys/arch/x86/x86/cpu.c    Fri Jul 29 21:01:43 2011 +0000
+++ b/sys/arch/x86/x86/cpu.c    Fri Jul 29 21:21:43 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.89 2011/06/22 09:28:08 jruoho Exp $  */
+/*     $NetBSD: cpu.c,v 1.90 2011/07/29 21:21:43 dyoung Exp $  */
 
 /*-
  * Copyright (c) 2000, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.89 2011/06/22 09:28:08 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.90 2011/07/29 21:21:43 dyoung Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"                /* for MPDEBUG */
@@ -1137,6 +1137,12 @@
 static bool
 cpu_shutdown(device_t dv, int how)
 {
+       struct cpu_softc *sc = device_private(dv);
+       struct cpu_info *ci = sc->sc_info;
+
+       if (ci->ci_flags & CPUF_BSP)
+               return false;
+
        return cpu_suspend(dv, NULL);
 }
 



Home | Main Index | Thread Index | Old Index