Kernel: Add check for panic in timer interrupt handler

Previously processors would not get notified about kernel panic if they
were idling
This commit is contained in:
Bananymous 2024-08-22 14:03:03 +03:00
parent 23194d1f53
commit 869bba4dad
1 changed files with 8 additions and 0 deletions

View File

@ -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);