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