make swapper api generic for re-entrant kernel calls (alloc element)

This commit is contained in:
bunnie 2024-05-28 02:44:36 +08:00
parent 0e135b0e4c
commit 62eb233db1

View file

@ -404,13 +404,18 @@ impl MemoryManager {
} }
} }
} }
if !crate::swap::Swap::with_mut(|s| s.hard_oom_inline()) { crate::swap::Swap::with_mut(|s| {
break; s.swap_reentrant_syscall(xous_kernel::SysCall::SwapOp(
} crate::swap::SwapAbi::HardOom as usize,
0,
0,
0,
0,
0,
0,
))
});
} }
// the call above actually diverges -- the final path will actually depend on how much memory
// could be freed by the swapper.
Err(xous_kernel::Error::OutOfMemory)
} }
/// Find a virtual address in the current process that is big enough /// Find a virtual address in the current process that is big enough