diff options
author | Benji Dial <benji@benjidial.net> | 2024-01-13 16:43:49 -0500 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2024-01-13 16:43:49 -0500 |
commit | 4130562b1555cabe441efe9420cebe12e7ed8d39 (patch) | |
tree | beaf0012373aab2c3a13fe0147a5cda4af28ef78 /include/mercury/kernel/paging.hpp | |
parent | 882e74b2191c059a9226cbd8bcb51c97da36247c (diff) | |
download | hilbert-os-4130562b1555cabe441efe9420cebe12e7ed8d39.tar.gz |
application loading
Diffstat (limited to 'include/mercury/kernel/paging.hpp')
-rw-r--r-- | include/mercury/kernel/paging.hpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/include/mercury/kernel/paging.hpp b/include/mercury/kernel/paging.hpp index 4ba5fdf..f6d400a 100644 --- a/include/mercury/kernel/paging.hpp +++ b/include/mercury/kernel/paging.hpp @@ -11,27 +11,36 @@ namespace mercury::kernel::paging { void mark_all_pram_used(); void mark_all_vram_free(); - //assumes page-alignment void mark_pram_region_free(uint64_t start_addr, uint64_t end_addr); - //assumes page-alignment void mark_vram_region_used(uint64_t start_addr, uint64_t end_addr); uint64_t find_unmapped_vram_region(uint64_t page_count); + uint64_t encode_pte( + uint64_t addr, bool user, bool write, bool execute, bool ps); + void init_kernel_page_tables(uint64_t kernel_offset); - void map_kernel_stack(); + void map_kernel_stacks(); - //assumes page-alignment void map_kernel_page( uint64_t paddr, uint64_t vaddr, bool write, bool execute); + void unmap_kernel_page(uint64_t vaddr); + //maps writable and not executable void *map_new_kernel_pages(uint64_t count); + //maps writable and not executable + void map_new_kernel_page(uint64_t &vaddr_out, uint64_t &paddr_out); + uint64_t get_used_vram_page_count(); uint64_t get_free_pram_page_count(); + extern uint64_t kernel_p4e; + + uint64_t take_2mib_pram_page(); + } #endif |