mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
add some debug & add state visibility
@xobs made the `state` element of a process publicly read-only visible through a function call. I don't think this is a security issue but please lmk if that's a problem.
This commit is contained in:
parent
1af43fba7b
commit
ecbce84385
1 changed files with 9 additions and 0 deletions
|
|
@ -265,6 +265,9 @@ impl Process {
|
||||||
self.state = ProcessState::Free;
|
self.state = ProcessState::Free;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Reveal state for debugging outside the crate.
|
||||||
|
pub fn state(&self) -> ProcessState { self.state }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(baremetal))]
|
#[cfg(not(baremetal))]
|
||||||
|
|
@ -679,6 +682,12 @@ impl SystemServices {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
CallbackType::Swap(args) => {
|
CallbackType::Swap(args) => {
|
||||||
|
#[cfg(feature = "debug-swap")]
|
||||||
|
{
|
||||||
|
let pid = crate::arch::process::current_pid();
|
||||||
|
let hardware_pid = (riscv::register::satp::read().bits() >> 22) & ((1 << 9) - 1);
|
||||||
|
println!("bef invoke PROCESS_TABLE.current: {}, hw_pid: {}", pid.get(), hardware_pid);
|
||||||
|
}
|
||||||
arch::syscall::invoke(
|
arch::syscall::invoke(
|
||||||
arch_process.current_thread_mut(),
|
arch_process.current_thread_mut(),
|
||||||
pid.get() == 1,
|
pid.get() == 1,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue