mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
kernel: syscall: implement SendMessage
SendMessage is a blocking version of TrySendMessage, except this call will block if the server queue is full. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
0c344efb60
commit
e5100bcb33
1 changed files with 11 additions and 1 deletions
|
|
@ -673,7 +673,17 @@ pub fn handle_inner(pid: PID, tid: TID, call: SysCall) -> SysCallResult {
|
|||
// SysCall::Connect(sid) => {
|
||||
// SystemServices::with_mut(|ss| ss.connect_to_server(sid).map(xous_kernel::Result::ConnectionID))
|
||||
// }
|
||||
// SysCall::SendMessage(cid, message) => send_message(pid, tid, cid, message),
|
||||
SysCall::SendMessage(cid, message) => {
|
||||
let result = send_message(pid, tid, cid, message);
|
||||
match result {
|
||||
Ok(o) => Ok(o),
|
||||
Err(xous_kernel::Error::ServerQueueFull) => {
|
||||
arch::process::Process::with_current_mut(|p| p.retry_instruction(tid))?;
|
||||
do_yield(pid, tid)
|
||||
},
|
||||
Err(e) => Err(e),
|
||||
}
|
||||
}
|
||||
_ => panic!("Unhandled Syscall: {:?}", call), //Err(xous_kernel::Error::UnhandledSyscall),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue