diff options
| author | Raghuram Subramani <raghus2247@gmail.com> | 2025-12-06 20:14:28 -0500 |
|---|---|---|
| committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-12-06 20:14:28 -0500 |
| commit | 2cf843ae6de1f35e5a5d3a947d0179337e82752f (patch) | |
| tree | 7e7983be37568fb0f9cbd806de94573a61df83ca /kernel/include/mm/virtual_mm.h | |
| parent | 096d9ab61281062b6672c6c9f413de97e034d3f7 (diff) | |
I know; it's POINTLESS! However, I do enjoy programming in C more than
C++ so I ended up spending the hour it takes converting this project
from C++ to C.
Diffstat (limited to 'kernel/include/mm/virtual_mm.h')
| -rw-r--r-- | kernel/include/mm/virtual_mm.h | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/kernel/include/mm/virtual_mm.h b/kernel/include/mm/virtual_mm.h index 818ce8b..4583fc0 100644 --- a/kernel/include/mm/virtual_mm.h +++ b/kernel/include/mm/virtual_mm.h @@ -69,51 +69,46 @@ #define VIRTUAL_ADDRESS(pd_index, pt_index) \ (((pd_index) << 22) | ((pt_index) << 12)) -namespace VirtualMM -{ - -uint32_t *get_page_directory(void); +uint32_t *vmm_get_page_directory(void); /* * Loads a given page directory into CR0 */ -void load_page_directory(uint32_t *page_directory); +void vmm_load_page_directory(uint32_t *page_directory); /* * Switches the current page directory to a given page directory */ -bool switch_page_directory(uint32_t *page_directory); +bool vmm_switch_page_directory(uint32_t *page_directory); /* * Initialize the virtual memory manager */ -void initialize(void); +void vmm_initialize(void); /* * Map a physical address to a virtual address */ -void map_page(void *physical_address, void *virtual_address); +void vmm_map_page(void *physical_address, void *virtual_address); /* * Unmap a page starting at virtual address */ -void unmap_page(void *virtual_address); +void vmm_unmap_page(void *virtual_address); /* * Find a virtual address with n consecutive free addresses. */ -void *find_free_pages(uint32_t n_pages); +void *vmm_find_free_pages(uint32_t n_pages); /* * Allocate and map n pages. */ -void *alloc_pages(uint32_t n_pages); +void *vmm_alloc_pages(uint32_t n_pages); /* * Free n pages from the starting address. */ -void free_pages(void *starting_address, uint32_t n_pages); - -} +void vmm_free_pages(void *starting_address, uint32_t n_pages); #endif |
