From: Amelia Coutard Date: Mon, 11 Dec 2023 23:19:35 +0000 (+0100) Subject: Made paging structs slightly more consistent X-Git-Url: https://git.ameliathe1st.gay/?a=commitdiff_plain;h=7a86089e2832cea735e12a4c4a5c8138465fc951;p=voyage-au-centre-des-fichiers.git Made paging structs slightly more consistent --- diff --git a/kernel/src/kernel.cpp b/kernel/src/kernel.cpp index e37a9a4..857766a 100644 --- a/kernel/src/kernel.cpp +++ b/kernel/src/kernel.cpp @@ -50,7 +50,7 @@ extern "C" void kmain(unsigned long magic, os::phys_ptr(os::paging::global_PML4T, (os::paging::page<2>*)(0xFFFF'FFFF'8000'0000 + i), os::phys_ptr>(i), - { .R_W = 0, .U_S = 0, .PWT = 0, .PCD = 0, .G = 1, .PAT = 0, .base_address = 0, .AVL_or_MPK = 0, .NX = 0 }); + { .R_W = 0, .U_S = 0, .PWT = 0, .PCD = 0, .G = 1, .PAT = 0, .base_address = 0, .NX = 0 }); i += 1024 * 1024 * 1024; } else if (i % (1024 * 1024 * 2) == 0 && i + 1024 * 1024 * 2 < std::size_t(&_kernel_phys_rw_start)) { os::paging::map_page<1, 3>(os::paging::global_PML4T, (os::paging::page<1>*)(0xFFFF'FFFF'8000'0000 + i), os::phys_ptr>(i), @@ -65,7 +65,7 @@ extern "C" void kmain(unsigned long magic, os::phys_ptr(os::paging::global_PML4T, (os::paging::page<2>*)(0xFFFF'FFFF'8000'0000 + i), os::phys_ptr>(i), - { .R_W = 1, .U_S = 0, .PWT = 0, .PCD = 0, .G = 1, .PAT = 0, .base_address = 0, .AVL_or_MPK = 0, .NX = 1 }); + { .R_W = 1, .U_S = 0, .PWT = 0, .PCD = 0, .G = 1, .PAT = 0, .base_address = 0, .NX = 1 }); i += 1024 * 1024 * 1024; } else if (i % (1024 * 1024 * 2) == 0 && i + 1024 * 1024 * 2 < std::size_t(&_kernel_phys_rw_start)) { os::paging::map_page<1, 3>(os::paging::global_PML4T, (os::paging::page<1>*)(0xFFFF'FFFF'8000'0000 + i), os::phys_ptr>(i), @@ -100,7 +100,7 @@ extern "C" void kmain(unsigned long magic, os::phys_ptr*)(0xFFFF'8000'0000'0000 + j), os::phys_ptr>(j), - { .R_W = 1, .U_S = 0, .PWT = 0, .PCD = 0, .G = 1, .PAT = 0, .base_address = 0, .AVL_or_MPK = 0, .NX = 1 }); + { .R_W = 1, .U_S = 0, .PWT = 0, .PCD = 0, .G = 1, .PAT = 0, .base_address = 0, .NX = 1 }); j += 1024 * 1024 * 1024; } else if (j % (1024 * 1024 * 2) == 0 && j + 1024 * 1024 * 2 < e) { os::paging::map_page<1, 3>(os::paging::global_PML4T, diff --git a/kernel/src/paging.hpp b/kernel/src/paging.hpp index c30d2c3..c6b78da 100644 --- a/kernel/src/paging.hpp +++ b/kernel/src/paging.hpp @@ -96,7 +96,7 @@ union { std::uint64_t reserved : 17 = 0; std::uint64_t base_address : 22; std::uint64_t AVL_high : 7 = 0; - std::uint64_t AVL_or_MPK : 4; + std::uint64_t AVL_or_MPK : 4 = 0; std::uint64_t NX : 1; } page; };