From 07b7e8ad787180b7e3eaccc819b9e5c4802edfcd Mon Sep 17 00:00:00 2001 From: dzwdz Date: Mon, 11 Apr 2022 23:11:37 +0200 Subject: kernel/arch: only allow IRQs in the idle process --- src/kernel/proc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/kernel/proc.c') diff --git a/src/kernel/proc.c b/src/kernel/proc.c index 74660fa..1f012fa 100644 --- a/src/kernel/proc.c +++ b/src/kernel/proc.c @@ -83,16 +83,16 @@ _Noreturn void process_idle(void) { cpu_shutdown(); } - irq_interrupt_flag(true); for (;;) { - asm("hlt" ::: "memory"); // TODO move to irq.c for (size_t i = 0; i < len; i++) { if (procs[i]->waits4irq.ready()) { - irq_interrupt_flag(false); vfs_root_handler(&procs[i]->waits4irq.req); // TODO this should be a function pointer too process_switch_any(); } } + irq_interrupt_flag(true); + asm("hlt" ::: "memory"); // TODO move to irq.c + irq_interrupt_flag(false); } } -- cgit v1.2.3