mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
kernel: don't block on full queue for Scalar/Move msgs
For Scalar and Move messages, the client does not need to block if the server does not have any waiting messages. In this case, send an `Ok` response. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
506d01fe4a
commit
ba7bb29ce2
1 changed files with 14 additions and 14 deletions
|
|
@ -465,9 +465,7 @@ pub fn handle(pid: PID, call: SysCall) -> core::result::Result<xous::Result, xou
|
||||||
ctx_number,
|
ctx_number,
|
||||||
xous::Result::Message(envelope),
|
xous::Result::Message(envelope),
|
||||||
)
|
)
|
||||||
.and_then(|_| {
|
.and_then(|_| ss.switch_from(pid, context_nr, false))
|
||||||
ss.switch_from(pid, context_nr, false)
|
|
||||||
})
|
|
||||||
.map(|_| xous::Result::BlockedProcess)
|
.map(|_| xous::Result::BlockedProcess)
|
||||||
} else if cfg!(baremetal) {
|
} else if cfg!(baremetal) {
|
||||||
// println!("Setting the return value of the Server and returning to Client");
|
// println!("Setting the return value of the Server and returning to Client");
|
||||||
|
|
@ -501,17 +499,19 @@ pub fn handle(pid: PID, call: SysCall) -> core::result::Result<xous::Result, xou
|
||||||
|
|
||||||
// Park this context if it's blocking. This is roughly
|
// Park this context if it's blocking. This is roughly
|
||||||
// equivalent to a "Yield".
|
// equivalent to a "Yield".
|
||||||
if !cfg!(baremetal) {
|
if blocking {
|
||||||
ss.switch_from(pid, context_nr, false)?;
|
if !cfg!(baremetal) {
|
||||||
Ok(xous::Result::BlockedProcess)
|
ss.switch_from(pid, context_nr, false)?;
|
||||||
} else if blocking {
|
Ok(xous::Result::BlockedProcess)
|
||||||
// println!("Returning to parent");
|
} else {
|
||||||
let process = ss.get_process(pid).expect("Can't get current process");
|
// println!("Returning to parent");
|
||||||
let ppid = process.ppid;
|
let process = ss.get_process(pid).expect("Can't get current process");
|
||||||
unsafe { SWITCHTO_CALLER = None };
|
let ppid = process.ppid;
|
||||||
ss.activate_process_context(ppid, 0, !blocking, blocking)
|
unsafe { SWITCHTO_CALLER = None };
|
||||||
.map(|_| Ok(xous::Result::ResumeProcess))
|
ss.activate_process_context(ppid, 0, !blocking, blocking)
|
||||||
.unwrap_or(Err(xous::Error::ProcessNotFound))
|
.map(|_| Ok(xous::Result::ResumeProcess))
|
||||||
|
.unwrap_or(Err(xous::Error::ProcessNotFound))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// println!("Returning to Client with Ok result");
|
// println!("Returning to Client with Ok result");
|
||||||
Ok(xous::Result::Ok)
|
Ok(xous::Result::Ok)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue