summaryrefslogtreecommitdiff
path: root/src/kernel/proc.c
diff options
context:
space:
mode:
authordzwdz2022-04-11 23:11:37 +0200
committerdzwdz2022-04-11 23:11:37 +0200
commit07b7e8ad787180b7e3eaccc819b9e5c4802edfcd (patch)
tree2215fd11cd9ab4ce49a490b9d77421cf83e093f8 /src/kernel/proc.c
parent4ebebf6d842e919db5c7499ee3b7cc738980cf25 (diff)
kernel/arch: only allow IRQs in the idle process
Diffstat (limited to 'src/kernel/proc.c')
-rw-r--r--src/kernel/proc.c6
1 files changed, 3 insertions, 3 deletions
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);
}
}