summaryrefslogtreecommitdiff
path: root/sys/kern/kern_panic.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_panic.c')
-rw-r--r--sys/kern/kern_panic.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/kern/kern_panic.c b/sys/kern/kern_panic.c
index d22f5b2..5b90dc8 100644
--- a/sys/kern/kern_panic.c
+++ b/sys/kern/kern_panic.c
@@ -30,6 +30,7 @@
#include <sys/panic.h>
#include <sys/syslog.h>
#include <sys/machdep.h>
+#include <sys/spinlock.h>
/*
* Tells the user something terribly
@@ -45,6 +46,10 @@ void
panic(const char *fmt, ...)
{
va_list ap;
+ static struct spinlock lock = {0};
+
+ spinlock_acquire(&lock); /* Never released */
+ __TRY_CALL(cpu_halt_others);
va_start(ap, fmt);