summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_shutdown.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-08-01 13:39:33 +0000
committerjhb <jhb@FreeBSD.org>2002-08-01 13:39:33 +0000
commit679a3f5aa3b6e409547035fb75bb40852c16baa6 (patch)
treea5e4b1ed84fa456d9208886efec681de6de63ddc /sys/kern/kern_shutdown.c
parent81ac9f4b3e7626e8bccf43d5b7846133d6154164 (diff)
downloadFreeBSD-src-679a3f5aa3b6e409547035fb75bb40852c16baa6.zip
FreeBSD-src-679a3f5aa3b6e409547035fb75bb40852c16baa6.tar.gz
Revert previous revision which was accidentally committed and has not been
tested yet.
Diffstat (limited to 'sys/kern/kern_shutdown.c')
-rw-r--r--sys/kern/kern_shutdown.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index ec740ec..13a9c7a 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -420,7 +420,7 @@ shutdown_reset(void *junk, int howto)
}
#ifdef SMP
-static uintptr_t panic_thread = NULL;
+static u_int panic_cpu = NOCPU;
#endif
/*
@@ -441,17 +441,15 @@ panic(const char *fmt, ...)
#ifdef SMP
/*
* We don't want multiple CPU's to panic at the same time, so we
- * use panic_thread as a simple spinlock. We have to keep checking
- * panic_thread if we are spinning in case the panic on the first
+ * use panic_cpu as a simple spinlock. We have to keep checking
+ * panic_cpu if we are spinning in case the panic on the first
* CPU is canceled.
*/
- if (panic_thread != curthread)
- while (atomic_cmpset_ptr(&panic_thread, NULL, curthread) == 0)
- while (panic_thread != NULL) {
-#ifdef __i386__
- ia32_pause();
-#endif
- }
+ if (panic_cpu != PCPU_GET(cpuid))
+ while (atomic_cmpset_int(&panic_cpu, NOCPU,
+ PCPU_GET(cpuid)) == 0)
+ while (panic_cpu != NOCPU)
+ ; /* nothing */
#endif
bootopt = RB_AUTOBOOT | RB_DUMP;
@@ -483,7 +481,7 @@ panic(const char *fmt, ...)
/* See if the user aborted the panic, in which case we continue. */
if (panicstr == NULL) {
#ifdef SMP
- atomic_store_rel_ptr(&panic_thread, NULL);
+ atomic_store_rel_int(&panic_cpu, NOCPU);
#endif
return;
}
OpenPOWER on IntegriCloud