18 lines
441 B
C
18 lines
441 B
C
|
#pragma once
|
||
|
#include <luna/Result.h>
|
||
|
#include <luna/Types.h>
|
||
|
|
||
|
// Simple bitmap allocator which hands out kernel-space virtual addresses for use in kmalloc() and friends.
|
||
|
namespace KernelVM
|
||
|
{
|
||
|
void init();
|
||
|
|
||
|
Result<u64> alloc_one_page();
|
||
|
Result<u64> alloc_several_pages(usize count);
|
||
|
|
||
|
Result<void> free_one_page(u64 address);
|
||
|
Result<void> free_several_pages(u64 address, usize count);
|
||
|
|
||
|
usize free();
|
||
|
usize used();
|
||
|
}
|