diff options
| author | Ian Moffett <ian@osmora.org> | 2025-11-16 12:59:49 -0500 |
|---|---|---|
| committer | Ian Moffett <ian@osmora.org> | 2025-11-16 12:59:49 -0500 |
| commit | 1d8a4028ca290cd0a99164038bd5a034cf052afa (patch) | |
| tree | 13d4a62fd3f9732137a2d104e7bc375aec1b2eab /sys/kern/kern_panic.c | |
| parent | 98a6a352ff5dc0866da9c1369c491e26a27a61cc (diff) | |
kern: panic: Deprecate mu_panic_preamble()
This commit deprecates mu_panic_preamble() in favor of the
mu_spinlock_acq() function
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern/kern_panic.c')
| -rw-r--r-- | sys/kern/kern_panic.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/kern_panic.c b/sys/kern/kern_panic.c index d6beccb..1ac9c64 100644 --- a/sys/kern/kern_panic.c +++ b/sys/kern/kern_panic.c @@ -30,10 +30,13 @@ #include <kern/panic.h> #include <kern/serial.h> #include <mu/panic.h> +#include <mu/spinlock.h> #include <lib/string.h> #include <lib/stdarg.h> #include <lib/stdbool.h> +static volatile size_t __sync = 0; + void panic(const char *fmt, ...) { @@ -41,7 +44,7 @@ panic(const char *fmt, ...) static char buf[256]; static va_list ap; - mu_panic_preamble(); + mu_spinlock_acq(&__sync, SPINLOCK_INTTOG); va_start(ap, fmt); vsnprintf(buf, sizeof(buf), fmt, ap); |
