mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
handle both cases in the irq return handler
differentiate between the case that we got here via a page fault, or a syscall, and handle appropriately
This commit is contained in:
parent
2f23225b9d
commit
ec439a38d4
1 changed files with 12 additions and 4 deletions
|
|
@ -320,7 +320,7 @@ pub extern "C" fn trap_handler(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// 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.
|
||||||
unsafe { s.exit_blocking_call() })
|
unsafe { s.exit_blocking_call() })
|
||||||
.unwrap_or_else(xous_kernel::Result::Error);
|
.unwrap_or_else(xous_kernel::Result::Error);
|
||||||
|
|
@ -345,9 +345,17 @@ pub extern "C" fn trap_handler(
|
||||||
// Re-enable interrupts now that we're out of the swap context
|
// Re-enable interrupts now that we're out of the swap context
|
||||||
enable_all_irqs();
|
enable_all_irqs();
|
||||||
|
|
||||||
ArchProcess::with_current_mut(|process| {
|
if response == xous_kernel::Result::ResumeProcess {
|
||||||
crate::arch::syscall::resume(current_pid().get() == 1, process.current_thread())
|
ArchProcess::with_current_mut(|process| {
|
||||||
});
|
crate::arch::syscall::resume(current_pid().get() == 1, process.current_thread())
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ArchProcess::with_current_mut(|p| {
|
||||||
|
let thread = p.current_thread();
|
||||||
|
println!("Returning to address {:08x}", thread.sepc);
|
||||||
|
unsafe { _xous_syscall_return_result(&response, thread) };
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "gdb-stub")]
|
#[cfg(feature = "gdb-stub")]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue