From e29dc5a7397f200e8525033d23b637c63de8d93a Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Sun, 15 Aug 2021 19:25:29 +0800 Subject: [PATCH] kernel: don't allow allocating exception thread This prevents the exception thread from being allocated as a normal system thread. Signed-off-by: Sean Cross --- kernel/src/arch/riscv/process.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/src/arch/riscv/process.rs b/kernel/src/arch/riscv/process.rs index 800aa69f1..c958cdd58 100644 --- a/kernel/src/arch/riscv/process.rs +++ b/kernel/src/arch/riscv/process.rs @@ -254,7 +254,7 @@ impl Process { tid -= process.threads.len() } - if tid != IRQ_TID && thread.sepc == 0 { + if tid != IRQ_TID && tid != EXCEPTION_TID && thread.sepc == 0 { process.last_tid_allocated = tid as _; return Some(tid as TID); }