mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-20 09:03:28 +00:00
cleanup debug
This commit is contained in:
parent
1112ef5df6
commit
1f12a97b64
1 changed files with 4 additions and 12 deletions
|
|
@ -318,6 +318,7 @@ pub extern "C" fn trap_handler(
|
||||||
}
|
}
|
||||||
#[cfg(feature = "swap")]
|
#[cfg(feature = "swap")]
|
||||||
RiscvException::InstructionPageFault(RETURN_FROM_SWAPPER, _offset) => {
|
RiscvException::InstructionPageFault(RETURN_FROM_SWAPPER, _offset) => {
|
||||||
|
/*
|
||||||
#[cfg(feature = "debug-swap")]
|
#[cfg(feature = "debug-swap")]
|
||||||
{
|
{
|
||||||
let pid = crate::arch::process::current_pid();
|
let pid = crate::arch::process::current_pid();
|
||||||
|
|
@ -327,7 +328,7 @@ pub extern "C" fn trap_handler(
|
||||||
pid.get(),
|
pid.get(),
|
||||||
hardware_pid
|
hardware_pid
|
||||||
);
|
);
|
||||||
}
|
} */
|
||||||
// Cleanup after the swapper
|
// Cleanup after the swapper
|
||||||
let response = Swap::with_mut(|s|
|
let response = Swap::with_mut(|s|
|
||||||
// safety: this is safe because on return from swapper, we're in the swapper's memory space.
|
// safety: this is safe because on return from swapper, we're in the swapper's memory space.
|
||||||
|
|
@ -336,19 +337,12 @@ pub extern "C" fn trap_handler(
|
||||||
|
|
||||||
#[cfg(feature = "debug-swap")]
|
#[cfg(feature = "debug-swap")]
|
||||||
{
|
{
|
||||||
let pid = crate::arch::process::current_pid();
|
|
||||||
let hardware_pid = (riscv::register::satp::read().bits() >> 22) & ((1 << 9) - 1);
|
|
||||||
println!(
|
|
||||||
"aft swapper cleanup PROCESS_TABLE.current: {}, hw_pid: {}",
|
|
||||||
pid.get(),
|
|
||||||
hardware_pid
|
|
||||||
);
|
|
||||||
|
|
||||||
// debugging
|
// debugging
|
||||||
SystemServices::with(|ss| {
|
SystemServices::with(|ss| {
|
||||||
|
let hardware_pid = (riscv::register::satp::read().bits() >> 22) & ((1 << 9) - 1);
|
||||||
let current = ss.get_process(current_pid()).unwrap();
|
let current = ss.get_process(current_pid()).unwrap();
|
||||||
let state = current.state();
|
let state = current.state();
|
||||||
println!("state after swapper switch: {} {:?}", current.pid.get(), state);
|
println!("swapper returning: PID{}(hw{})-{:?}", current.pid.get(), hardware_pid, state);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Re-enable interrupts now that we're out of the swap context
|
// Re-enable interrupts now that we're out of the swap context
|
||||||
|
|
@ -361,8 +355,6 @@ pub extern "C" fn trap_handler(
|
||||||
} else {
|
} else {
|
||||||
ArchProcess::with_current_mut(|p| {
|
ArchProcess::with_current_mut(|p| {
|
||||||
let thread = p.current_thread();
|
let thread = p.current_thread();
|
||||||
#[cfg(feature = "debug-swap")]
|
|
||||||
println!("Returning to address {:08x}", thread.sepc);
|
|
||||||
unsafe { _xous_syscall_return_result(&response, thread) };
|
unsafe { _xous_syscall_return_result(&response, thread) };
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue