From 869bba4dad32dd7834492da800b1f3755ab77682 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Thu, 22 Aug 2024 14:03:03 +0300 Subject: [PATCH] Kernel: Add check for panic in timer interrupt handler Previously processors would not get notified about kernel panic if they were idling --- kernel/kernel/IDT.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/kernel/IDT.cpp b/kernel/kernel/IDT.cpp index c9872f708f..2211c1b449 100644 --- a/kernel/kernel/IDT.cpp +++ b/kernel/kernel/IDT.cpp @@ -335,6 +335,14 @@ done: extern "C" void cpp_timer_handler() { + if (g_paniced) + { + dprintln("Processor {} halted", Processor::current_id()); + if (InterruptController::is_initialized()) + InterruptController::get().broadcast_ipi(); + asm volatile("cli; 1: hlt; jmp 1b"); + } + ASSERT(InterruptController::get().is_in_service(IRQ_TIMER)); InterruptController::get().eoi(IRQ_TIMER);