From ba8c4dbc7fa37e5d97dce50eb32fc9123e712c0e Mon Sep 17 00:00:00 2001 From: Bananymous Date: Wed, 1 Mar 2023 20:16:26 +0200 Subject: [PATCH] Kernel: panic now disables interrupts as the first thing --- kernel/include/kernel/Panic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/include/kernel/Panic.h b/kernel/include/kernel/Panic.h index 06b84d16..75e15b8d 100644 --- a/kernel/include/kernel/Panic.h +++ b/kernel/include/kernel/Panic.h @@ -13,10 +13,10 @@ namespace Kernel __attribute__((__noreturn__)) static void panic_impl(const char* file, int line, const char* message, Args... args) { + asm volatile("cli"); derrorln("Kernel panic at {}:{}", file, line); derrorln(message, args...); Debug::dump_stack_trace(); - asm volatile("cli"); for (;;) asm volatile("hlt"); __builtin_unreachable();