From 8137f417f73319fb29a5398dd0f43f1d909f1429 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 30 Apr 2024 20:43:42 -0400 Subject: kernel: panic: Try to stop other processors Signed-off-by: Ian Moffett --- sys/kern/kern_panic.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sys/kern') 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 #include #include +#include /* * 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); -- cgit v1.2.3