Disable interrupts before shutdownhooks are run, as all other ports.

shutdownhooks need to use polling functions (and most do).
This commit is contained in:
drochner 2008-08-05 17:09:17 +00:00
parent 91d4704c12
commit 687baea535
2 changed files with 11 additions and 21 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.97 2008/07/02 17:28:54 ad Exp $ */
/* $NetBSD: machdep.c,v 1.98 2008/08/05 17:09:17 drochner Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008
@ -112,7 +112,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.97 2008/07/02 17:28:54 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.98 2008/08/05 17:09:17 drochner Exp $");
/* #define XENDEBUG_LOW */
@ -629,7 +629,6 @@ struct pcb dumppcb;
void
cpu_reboot(int howto, char *bootstr)
{
int s;
if (cold) {
howto |= RB_HALT;
@ -647,21 +646,16 @@ cpu_reboot(int howto, char *bootstr)
resettodr();
}
/* Disable interrupts. */
splhigh();
/* Do a dump if requested. */
if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP) {
/* Disable interrupts. */
s = splhigh();
if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP)
dumpsys();
splx(s);
}
haltsys:
doshutdownhooks();
/* Disable interrupts. */
(void)splhigh();
if ((howto & RB_POWERDOWN) == RB_POWERDOWN) {
#ifndef XEN
#if NACPI > 0

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.637 2008/07/02 17:28:55 ad Exp $ */
/* $NetBSD: machdep.c,v 1.638 2008/08/05 17:09:17 drochner Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008 The NetBSD Foundation, Inc.
@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.637 2008/07/02 17:28:55 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.638 2008/08/05 17:09:17 drochner Exp $");
#include "opt_beep.h"
#include "opt_compat_ibcs2.h"
@ -857,7 +857,6 @@ int waittime = -1;
void
cpu_reboot(int howto, char *bootstr)
{
int s;
if (cold) {
howto |= RB_HALT;
@ -876,19 +875,16 @@ cpu_reboot(int howto, char *bootstr)
resettodr();
}
/* Disable interrupts. */
splhigh();
/* Do a dump if requested. */
if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP) {
s = splhigh();
if ((howto & (RB_DUMP | RB_HALT)) == RB_DUMP)
dumpsys();
splx(s);
}
haltsys:
doshutdownhooks();
/* Disable interrupts. */
(void)splhigh();
#ifdef MULTIPROCESSOR
x86_broadcast_ipi(X86_IPI_HALT);
#endif