diff options
author | dzwdz | 2022-05-05 21:01:25 +0200 |
---|---|---|
committer | dzwdz | 2022-05-05 21:01:25 +0200 |
commit | dc42353f53df0b5425377330f16e668829d8fd9a (patch) | |
tree | 7d2af922417df9e0a708007e17bcce1ef2833b99 /src/kernel/proc.c | |
parent | 3beaeaadf36de4e494d0b40ad31e3c5c503c596e (diff) |
kernel: ps2 driver is now a separate backend
Diffstat (limited to 'src/kernel/proc.c')
-rw-r--r-- | src/kernel/proc.c | 19 |
1 files changed, 10 insertions, 9 deletions
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) { |