aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-04-30 20:43:42 -0400
committerIan Moffett <ian@osmora.org>2024-04-30 20:43:42 -0400
commit8137f417f73319fb29a5398dd0f43f1d909f1429 (patch)
treef7484992ba0b002692a417e4c69e2569728ff639
parent130ef7a34df14a57097a273867bc2bb5816d5f49 (diff)
kernel: panic: Try to stop other processors
Signed-off-by: Ian Moffett <ian@osmora.org>
-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);