add context switching debug option

This commit is contained in:
bunnie 2024-05-15 02:42:29 +08:00
parent 1b0fc181a5
commit 2b05626b69

View file

@ -105,12 +105,14 @@ pub extern "C" fn kmain() {
}
loop {
#[cfg(feature = "debug-print")]
let last_pid = pid;
pid = next_pid_to_run(pid);
match pid {
Some(pid) => {
// #[cfg(feature = "debug-print")]
// println!("switching to pid {}", pid);
#[cfg(feature = "debug-print")]
println!(" PID{:?}->{:?}", last_pid.unwrap_or(0), pid); // keep this succinct as it happens often
xous_kernel::rsyscall(xous_kernel::SysCall::SwitchTo(pid, 0))
.expect("couldn't switch to pid");
}