summaryrefslogtreecommitdiff
path: root/kernel/paging.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/paging.cpp')
-rw-r--r--kernel/paging.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/paging.cpp b/kernel/paging.cpp
index 3bd27d0..8c27abc 100644
--- a/kernel/paging.cpp
+++ b/kernel/paging.cpp
@@ -96,6 +96,13 @@ namespace mercury::kernel::paging {
return 0;
}
+ void *map_new_kernel_pages(uint64_t count) {
+ uint64_t vaddr = find_unmapped_vram_region(count);
+ for (uint64_t i = 0; i < count; ++i)
+ map_kernel_page(take_pram_page(), vaddr + i * 4096, true, false);
+ return (void *)vaddr;
+ }
+
uint64_t get_used_vram_page_count() {
uint64_t count = 0;
for (uint64_t i = 0; i < kernel_vram_pages; ++i)