map_page: add support for mapping 1GiB pages

Signed-off-by: Andy-Python-Programmer <andypythonappdeveloper@gmail.com>
This commit is contained in:
Andy-Python-Programmer 2022-01-27 10:59:16 +11:00 committed by mintsuki
parent 7a1e3cb35c
commit a218423b9c
2 changed files with 8 additions and 1 deletions

View File

@ -65,6 +65,12 @@ level5:
pml4 = get_next_level(pml5, pml5_entry);
level4:
pml3 = get_next_level(pml4, pml4_entry);
if (pg_size == Size1GiB) {
pml3[pml3_entry] = (pt_entry_t)(phys_addr | flags | (1 << 7));
return;
}
pml2 = get_next_level(pml3, pml3_entry);
if (pg_size == Size2MiB) {

View File

@ -15,7 +15,8 @@ typedef struct {
enum page_size {
Size4KiB,
Size2MiB
Size2MiB,
Size1GiB
};
void vmm_assert_nx(void);