mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
syscall: add return_memory_offset_valid()
This sets the `valid` field in addition to the `offset` field when returning a MemoryMessage. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
32d740aa15
commit
b74396cfe7
1 changed files with 18 additions and 0 deletions
|
|
@ -1060,6 +1060,24 @@ pub fn return_memory_offset(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Map the given physical address to the given virtual address.
|
||||||
|
/// The `size` field must be page-aligned.
|
||||||
|
pub fn return_memory_offset_valid(
|
||||||
|
sender: MessageSender,
|
||||||
|
mem: MemoryRange,
|
||||||
|
offset: Option<MemorySize>,
|
||||||
|
valid: Option<MemorySize>,
|
||||||
|
) -> core::result::Result<(), Error> {
|
||||||
|
let result = rsyscall(SysCall::ReturnMemory(sender, mem, offset, valid))?;
|
||||||
|
if let crate::Result::Ok = result {
|
||||||
|
Ok(())
|
||||||
|
} else if let Result::Error(e) = result {
|
||||||
|
Err(e)
|
||||||
|
} else {
|
||||||
|
Err(Error::InternalError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Map the given physical address to the given virtual address.
|
/// Map the given physical address to the given virtual address.
|
||||||
/// The `size` field must be page-aligned.
|
/// The `size` field must be page-aligned.
|
||||||
pub fn return_scalar(sender: MessageSender, val: usize) -> core::result::Result<(), Error> {
|
pub fn return_scalar(sender: MessageSender, val: usize) -> core::result::Result<(), Error> {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue