mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
syscall: add wrapper functions for destroy_server and disconnect
Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
0230ccb252
commit
461d6f23ee
1 changed files with 20 additions and 0 deletions
|
|
@ -1529,6 +1529,26 @@ pub fn current_tid() -> core::result::Result<TID, Error> {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn destroy_server(sid: SID) -> core::result::Result<(), Error> {
|
||||
rsyscall(SysCall::DestroyServer(sid)).and_then(|result| {
|
||||
if let Result::Ok = result {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(Error::InternalError)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub unsafe fn disconnect(cid: CID) -> core::result::Result<(), Error> {
|
||||
rsyscall(SysCall::Disconnect(cid)).and_then(|result| {
|
||||
if let Result::Ok = result {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(Error::InternalError)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub fn rsyscall(call: SysCall) -> SysCallResult {
|
||||
let mut ret = Result::Ok;
|
||||
let args = call.as_args();
|
||||
|
|
|
|||
Loading…
Reference in a new issue