Add getters for free, used and reserved memory

This commit is contained in:
apio 2022-11-13 16:56:03 +01:00
parent 6a7097c9ec
commit 3358454833
2 changed files with 19 additions and 4 deletions

View File

@ -98,10 +98,6 @@ namespace MemoryManager
lock_pages((u64)page_bitmap_addr, page_bitmap_size / MMU::page_size() + 1); lock_pages((u64)page_bitmap_addr, page_bitmap_size / MMU::page_size() + 1);
} }
void protect_kernel_sections()
{
}
void init() void init()
{ {
init_physical_allocator(); init_physical_allocator();
@ -148,4 +144,19 @@ namespace MemoryManager
if (start_index > index) start_index = index; if (start_index > index) start_index = index;
return {}; return {};
} }
u64 free()
{
return free_mem;
}
u64 used()
{
return used_mem;
}
u64 reserved()
{
return reserved_mem;
}
} }

View File

@ -11,4 +11,8 @@ namespace MemoryManager
void lock_page(u64 page); void lock_page(u64 page);
void lock_pages(u64 pages, u64 count); void lock_pages(u64 pages, u64 count);
u64 free();
u64 used();
u64 reserved();
} }