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 e37f3fd191
commit dd4546c2c0

View file

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