mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
services: add exception handler routines
Add a function to set and one to clear the current exception handler. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
a096509a04
commit
059fc18850
1 changed files with 8 additions and 0 deletions
|
|
@ -2131,6 +2131,14 @@ impl SystemServices {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// Sets the exception handler for the given process ID. If an exception handler
|
||||
/// exists, it will be silently overridden.
|
||||
pub fn set_exception_handler(&mut self, pid: PID, pc: usize, sp: usize) -> Result<(), xous_kernel::Error> {
|
||||
let process = self.get_process_mut(pid)?;
|
||||
process.exception_handler = Some(ExceptionHandler { pc, sp });
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Causes the provided process to go into an exception state. This will fail
|
||||
/// if any of the following are true:
|
||||
/// 1. The process does not exist
|
||||
|
|
|
|||
Loading…
Reference in a new issue