summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_shutdown.c
diff options
context:
space:
mode:
authorjasone <jasone@FreeBSD.org>2000-09-07 01:33:02 +0000
committerjasone <jasone@FreeBSD.org>2000-09-07 01:33:02 +0000
commit769e0f974d8929599ba599ac496510fffc90ff34 (patch)
tree9387522900085835de81e7830e570ef3f6b3ea80 /sys/kern/kern_shutdown.c
parentacf1927de02afda4855ec278b1128fd9446405ea (diff)
downloadFreeBSD-src-769e0f974d8929599ba599ac496510fffc90ff34.zip
FreeBSD-src-769e0f974d8929599ba599ac496510fffc90ff34.tar.gz
Major update to the way synchronization is done in the kernel. Highlights
include: * Mutual exclusion is used instead of spl*(). See mutex(9). (Note: The alpha port is still in transition and currently uses both.) * Per-CPU idle processes. * Interrupts are run in their own separate kernel threads and can be preempted (i386 only). Partially contributed by: BSDi (BSD/OS) Submissions by (at least): cp, dfr, dillon, grog, jake, jhb, sheldonh
Diffstat (limited to 'sys/kern/kern_shutdown.c')
-rw-r--r--sys/kern/kern_shutdown.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index 9c744c7..8a6ccd8 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -63,6 +63,7 @@
#include <machine/pcb.h>
#include <machine/clock.h>
+#include <machine/lock.h>
#include <machine/md_var.h>
#include <machine/smp.h> /* smp_active, cpuid */
@@ -524,6 +525,11 @@ panic(const char *fmt, ...)
va_list ap;
static char buf[256];
+#ifdef SMP
+ /* Only 1 CPU can panic at a time */
+ s_lock(&panic_lock);
+#endif
+
bootopt = RB_AUTOBOOT | RB_DUMP;
if (panicstr)
bootopt |= RB_NOSYNC;
@@ -537,8 +543,7 @@ panic(const char *fmt, ...)
va_end(ap);
printf("panic: %s\n", buf);
#ifdef SMP
- /* three seperate prints in case of an unmapped page and trap */
- printf("mp_lock = %08x; ", mp_lock);
+ /* two seperate prints in case of an unmapped page and trap */
printf("cpuid = %d; ", cpuid);
printf("lapic.id = %08x\n", lapic.id);
#endif
OpenPOWER on IntegriCloud