mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +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;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Reveal state for debugging outside the crate.
|
||||
pub fn state(&self) -> ProcessState { self.state }
|
||||
}
|
||||
|
||||
#[cfg(not(baremetal))]
|
||||
|
|
@ -679,6 +682,12 @@ impl SystemServices {
|
|||
);
|
||||
}
|
||||
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_process.current_thread_mut(),
|
||||
pid.get() == 1,
|
||||
|
|
|
|||
Loading…
Reference in a new issue