1 #include <lunaix/boot_generic.h>
2 #include <lunaix/mm/pagetable.h>
4 #include "sys/mm/mm_defs.h"
6 #ifdef CONFIG_ARCH_X86_64
9 boot_begin_arch_reserve(struct boot_handoff* bhctx)
16 boot_clean_arch_reserve(struct boot_handoff* bhctx)
23 #include <lunaix/mm/vmm.h>
26 boot_begin_arch_reserve(struct boot_handoff* bhctx)
28 // Identity-map the first 3GiB address spaces
29 pte_t* ptep = mkl0tep(mkptep_va(VMS_SELF, 0));
30 pte_t pte = mkpte_prot(KERNEL_DATA);
31 size_t count = page_count(KERNEL_RESIDENT, L0T_SIZE);
33 vmm_set_ptes_contig(ptep, pte_mkhuge(pte), L0T_SIZE, count);
38 boot_clean_arch_reserve(struct boot_handoff* bhctx)
40 pte_t* ptep = mkl0tep(mkptep_va(VMS_SELF, 0));
41 size_t count = page_count(KERNEL_RESIDENT, L0T_SIZE);
42 vmm_unset_ptes(ptep, count);