From 6793f9c5da2b085e637adbff6cebf97e7bada213 Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 17 Jun 2022 02:00:52 +0800 Subject: [PATCH] return non-0 heap size in case of increaseheap of 0 this allows hosted mode to work, as it always reports a 0 heap size. --- kernel/src/syscall.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/src/syscall.rs b/kernel/src/syscall.rs index 22292d4fc..925af42d0 100644 --- a/kernel/src/syscall.rs +++ b/kernel/src/syscall.rs @@ -714,7 +714,11 @@ pub fn handle_inner(pid: PID, tid: TID, in_irq: bool, call: SysCall) -> SysCallR (process_inner.mem_heap_base, process_inner.mem_heap_size) }); return Ok(xous_kernel::Result::MemoryRange(unsafe { - MemoryRange::new(start, length).unwrap() + MemoryRange::new( + start, + // 0-length MemoryRanges are disallowed -- so return 4096 as the minimum in any case, even though it's a lie + if length == 0 { 4096 } else { length } + ).unwrap() })); }