From fa900df5a7848c940d8a2bb61effca92d1c7c146 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Wed, 3 Apr 2024 15:07:18 +0300 Subject: [PATCH] Kernel: Add signals for threads after IRQs This allows signals to be called even if the process does no syscalls The old scheduler did signal handling but I feel like it should be enough to handle them only after syscalls and IRQs. ISRs already handle signals that caused the ISR and there is no other route to kernel space. --- kernel/kernel/IDT.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/kernel/IDT.cpp b/kernel/kernel/IDT.cpp index 8f8e7206..dc89aadd 100644 --- a/kernel/kernel/IDT.cpp +++ b/kernel/kernel/IDT.cpp @@ -362,6 +362,10 @@ done: dprintln("no handler for irq 0x{2H}", irq); } + auto& current_thread = Thread::current(); + if (current_thread.can_add_signal_to_execute()) + current_thread.handle_signal(); + Scheduler::get().reschedule_if_idling(); ASSERT(Thread::current().state() != Thread::State::Terminated);