kernel: properly set current_thread on init

Previously the `current_thread` was set to 0, which is invalid. Set the
`current_thread` so that it defaults to the initial thread ID.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2023-01-29 18:40:58 +08:00
parent fcf74c4d9b
commit 69b5e924f3

View file

@ -272,7 +272,7 @@ static mut SYSTEM_SERVICES: SystemServices = SystemServices {
ppid: unsafe { PID::new_unchecked(1) },
pid: unsafe { PID::new_unchecked(1) },
mapping: arch::mem::DEFAULT_MEMORY_MAPPING,
current_thread: 0_usize,
current_thread: INITIAL_TID,
previous_thread: INITIAL_TID as TID,
exception_handler: None,
}; MAX_PROCESS_COUNT],