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 <sean@xobs.io>
This commit is contained in:
Sean Cross 2021-08-15 19:25:29 +08:00
parent 353311b987
commit e29dc5a739

View file

@ -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);
}