xous-rs: add increase_heap syscall

This is used in ARM version of dlmalloc-rs for Xous stdlib
This commit is contained in:
eupn 2023-03-14 18:51:07 +04:00
parent 0f420b7b63
commit 76114c060a
No known key found for this signature in database
GPG key ID: 0BBE77FB42014014

View file

@ -2053,6 +2053,16 @@ pub fn virt_to_phys(va: usize) -> core::result::Result<usize, Error> {
})
}
pub fn increase_heap(bytes: usize, flags: MemoryFlags) -> core::result::Result<MemoryRange, ()> {
let res = crate::arch::syscall(SysCall::IncreaseHeap(bytes, flags));
if let Ok(Result::MemoryRange(range)) = res
{
return Ok(range);
}
Err(())
}
/// Perform a raw syscall and return the result. This will transform
/// `xous::Result::Error(e)` into an `Err(e)`.
pub fn rsyscall(call: SysCall) -> SysCallResult {