From 8f5a9e28d1e030ed2b9532e9d87b883a9f2e8f15 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Thu, 28 Apr 2022 19:03:15 +0200 Subject: kernel/proc: explicitly handle all process states in switch()es --- src/kernel/proc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/kernel/proc.c b/src/kernel/proc.c index 1fd392a..5b96760 100644 --- a/src/kernel/proc.c +++ b/src/kernel/proc.c @@ -219,6 +219,8 @@ void process_transition(struct process *p, enum process_state state) { case PS_WAITS4IRQ: assert(last == PS_WAITS4FS); break; + + case PS_LAST: panic_invalid_state(); } } @@ -265,7 +267,9 @@ void process_kill(struct process *p, int ret) { p->controlled->handler = NULL; break; - default: + case PS_DEAD: + case PS_DEADER: + case PS_LAST: kprintf("process_kill unexpected state 0x%x\n", p->state); panic_invalid_state(); } -- cgit v1.2.3