1 #include <lunaix/sections.h>
2 #include <asm-generic/init_pagetable.h>
3 #include <asm/boot_stage.h>
7 static pte_t kpt[LEVEL_SIZE][32];
12 struct pt_alloc alloc;
17 init_pt_alloc(&alloc, to_kphysical(&kpt), sizeof(kpt));
18 init_ptw_state(&ptw, &alloc, kpt_alloc_table(&alloc));
20 pte = mkpte(boot_start, KERNEL_DATA);
21 pte = pte_mkexec(pte);
22 nr = leaf_count(boot_end - boot_start);
23 kpt_set_ptes(&ptw, boot_start, pte, LFT_SIZE, nr);
25 kpt_mktable_at(&ptw, VMAP, L0T_SIZE);
26 kpt_mktable_at(&ptw, PMAP, L2T_SIZE);
27 kpt_mktable_at(&ptw, KMAP, LFT_SIZE);
29 kpt_migrate_highmem(&ptw);
31 pte = mkpte(__ptr(ptw.root), KERNEL_PGTAB);
32 kpt_set_ptes(&ptw, VMS_SELF, pte, L0T_SIZE, 1);
34 return __ptr(ptw.root);