MemoryManager: Add an unmap_weak_and_free_vm() helper function
This function mirrors unmap_owned_and_free_vm(), but using weak unmapping (does not free the underlying physical memory)
This commit is contained in:
parent
d3c414af4e
commit
c53bba0392
@ -309,6 +309,15 @@ namespace MemoryManager
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result<void> unmap_weak_and_free_vm(u64 virt, usize count)
|
||||||
|
{
|
||||||
|
CHECK_PAGE_ALIGNED(virt);
|
||||||
|
|
||||||
|
KernelVM::free_several_pages(virt, count);
|
||||||
|
|
||||||
|
return unmap_weak(virt, count);
|
||||||
|
}
|
||||||
|
|
||||||
Result<void> remap_unaligned(u64 address, usize count, int flags)
|
Result<void> remap_unaligned(u64 address, usize count, int flags)
|
||||||
{
|
{
|
||||||
if (!is_aligned<ARCH_PAGE_SIZE>(address)) count++;
|
if (!is_aligned<ARCH_PAGE_SIZE>(address)) count++;
|
||||||
|
@ -30,6 +30,7 @@ namespace MemoryManager
|
|||||||
Result<void> unmap_owned(u64 virt, usize count);
|
Result<void> unmap_owned(u64 virt, usize count);
|
||||||
Result<void> unmap_owned_and_free_vm(u64 virt, usize count);
|
Result<void> unmap_owned_and_free_vm(u64 virt, usize count);
|
||||||
Result<void> unmap_weak(u64 virt, usize count);
|
Result<void> unmap_weak(u64 virt, usize count);
|
||||||
|
Result<void> unmap_weak_and_free_vm(u64 virt, usize count);
|
||||||
|
|
||||||
usize free();
|
usize free();
|
||||||
usize used();
|
usize used();
|
||||||
|
Loading…
Reference in New Issue
Block a user