diff --git a/kernel/src/memory/MemoryManager.cpp b/kernel/src/memory/MemoryManager.cpp index 93447a5d..75014bae 100644 --- a/kernel/src/memory/MemoryManager.cpp +++ b/kernel/src/memory/MemoryManager.cpp @@ -309,6 +309,15 @@ namespace MemoryManager return {}; } + Result 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 remap_unaligned(u64 address, usize count, int flags) { if (!is_aligned(address)) count++; diff --git a/kernel/src/memory/MemoryManager.h b/kernel/src/memory/MemoryManager.h index 13a02a8a..d22ed45c 100644 --- a/kernel/src/memory/MemoryManager.h +++ b/kernel/src/memory/MemoryManager.h @@ -30,6 +30,7 @@ namespace MemoryManager Result unmap_owned(u64 virt, usize count); Result unmap_owned_and_free_vm(u64 virt, usize count); Result unmap_weak(u64 virt, usize count); + Result unmap_weak_and_free_vm(u64 virt, usize count); usize free(); usize used();