quiet down debug in the irq routine

This commit is contained in:
bunnie 2024-05-18 00:24:25 +08:00
parent aa61e091ef
commit c412f44b51

View file

@ -30,6 +30,7 @@ static IRQ_ENABLED: AtomicBool = AtomicBool::new(true);
// Indicate when we handle an IRQ // Indicate when we handle an IRQ
static HANDLING_IRQ: AtomicBool = AtomicBool::new(false); static HANDLING_IRQ: AtomicBool = AtomicBool::new(false);
#[cfg(feature = "swap")]
pub fn is_handling_irq() -> bool { HANDLING_IRQ.load(Ordering::SeqCst) } pub fn is_handling_irq() -> bool { HANDLING_IRQ.load(Ordering::SeqCst) }
fn sim_read() -> usize { fn sim_read() -> usize {
@ -338,7 +339,7 @@ pub extern "C" fn trap_handler(
unsafe { s.exit_blocking_call() }) unsafe { s.exit_blocking_call() })
.unwrap_or_else(xous_kernel::Result::Error); .unwrap_or_else(xous_kernel::Result::Error);
#[cfg(feature = "debug-swap")] #[cfg(feature = "debug-swap-verbose")]
{ {
// debugging // debugging
SystemServices::with(|ss| { SystemServices::with(|ss| {
@ -346,7 +347,7 @@ pub extern "C" fn trap_handler(
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!( println!(
"swapper returning: PID{}(hw{})-{:?} result {:?}", "Swapper irq-like handler returning to PID{}(hw{})-{:?} with result {:?}",
current.pid.get(), current.pid.get(),
hardware_pid, hardware_pid,
state, state,
@ -364,7 +365,8 @@ 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();
println!("Swap syscall returning to address {:08x}", thread.sepc); #[cfg(feature = "debug-swap-verbose")]
println!("Swapper syscall returning to address {:08x}", thread.sepc);
// re-enable IRQs as late as possible // re-enable IRQs as late as possible
enable_all_irqs(); enable_all_irqs();
unsafe { _xous_syscall_return_result(&response, thread) }; unsafe { _xous_syscall_return_result(&response, thread) };