Luna/kernel/src/memory/Heap.cpp

15 lines
389 B
C++
Raw Normal View History

#include "memory/Heap.h"
#include "arch/MMU.h"
#include "memory/MemoryManager.h"
#include <luna/Heap.h>
Result<void*> allocate_pages_impl(usize count)
{
return (void*)TRY(MemoryManager::alloc_for_kernel(count, MMU::ReadWrite | MMU::NoExecute));
}
Result<void> release_pages_impl(void* address, usize count)
2022-12-04 11:52:49 +00:00
{
return MemoryManager::unmap_owned_and_free_vm((u64)address, count);
2023-01-02 12:07:29 +00:00
}