xous: terminate process on panic

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2020-11-11 12:52:12 +08:00
parent 6b1dc7f853
commit b497ad113e
2 changed files with 5 additions and 0 deletions

View file

@ -73,6 +73,7 @@ macro_rules! maybe_main {
println!("PANIC!");
println!("Details: {:?}", arg);
xous::syscall::wait_event();
xous::syscall::terminate_process();
loop {}
}

View file

@ -1096,6 +1096,10 @@ pub fn send_message(connection: CID, message: Message) -> core::result::Result<R
}
}
pub fn terminate_process() {
rsyscall(SysCall::TerminateProcess).expect("terminate_process returned an error");
}
/// Return execution to the kernel. This function may return at any time,
/// including immediately
pub fn yield_slice() {