From dc42353f53df0b5425377330f16e668829d8fd9a Mon Sep 17 00:00:00 2001 From: dzwdz Date: Thu, 5 May 2022 21:01:25 +0200 Subject: kernel: ps2 driver is now a separate backend --- src/kernel/proc.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/kernel/proc.c') diff --git a/src/kernel/proc.c b/src/kernel/proc.c index 7c41eb2..ed317ec 100644 --- a/src/kernel/proc.c +++ b/src/kernel/proc.c @@ -125,22 +125,23 @@ static _Noreturn void process_switch(struct process *proc) { /** If there are any processes waiting for IRQs, wait with them. Otherwise, shut down */ static _Noreturn void process_idle(void) { + // this mess is temporary + struct process *procs[16]; size_t len = process_find_multiple(PS_WAITS4IRQ, procs, 16); if (len == 0) shutdown(); - for (;;) { - for (size_t i = 0; i < len; i++) { - if (procs[i]->waits4irq.ready()) { - /* if this is entered during the first iteration, it indicates a - * kernel bug. this should be logged. TODO? */ - procs[i]->waits4irq.callback(procs[i]); - process_switch_any(); - } + cpu_pause(); + for (size_t i = 0; i < len; i++) { + if (procs[i]->waits4irq.ready()) { + /* if this is entered during the first iteration, it indicates a + * kernel bug. this should be logged. TODO? */ + procs[i]->waits4irq.callback(procs[i]); } - cpu_pause(); } + + process_switch_any(); } _Noreturn void process_switch_any(void) { -- cgit v1.2.3