14#if MOS_PLATFORM_PAGING_LEVELS < 3
23 return pml3.pml2.table;
33 return (pml2_t){ .table = (pml2e_t *) pml3e };
39 for (
size_t i = pml3_index(*vaddr); i <
PML3_ENTRIES && *n_pages; i++)
54 *n_pages -=
MIN(*n_pages, PML3E_NPAGES);
70 const bool should_zap_this_pml3 = pml3_index(*vaddr) == 0 && *n_pages >=
PML3_ENTRIES * PML3E_NPAGES;
72 for (
size_t i = pml3_index(*vaddr); i <
PML3_ENTRIES && *n_pages; i++)
86 *n_pages -=
MIN(*n_pages, PML3E_NPAGES);
91 if (should_zap_this_pml3)
94 return should_zap_this_pml3;
99 return &pml3.table[pml3_index(vaddr)];
void platform_pml3e_set_pml2(pml3e_t *pml3, pml2_t pml2, pfn_t pml2_pfn)
bool platform_pml3e_get_present(const pml3e_t *pml3)
pml2_t platform_pml3e_get_pml2(const pml3e_t *pml3)
bool callback(pb_istream_t *stream, uint8_t *buf, size_t count)
bool pml2e_is_present(const pml2e_t *pml2e)
void pml2_traverse(pml2_t pml2, ptr_t *vaddr, size_t *n_pages, pagetable_walk_options_t callback, void *data)
__nodiscard bool pml2_destroy_range(pml2_t pml2, ptr_t *vaddr, size_t *n_pages)
pml2_t pml3e_get_pml2(const pml3e_t *pml3e)
bool pml3e_is_present(const pml3e_t *pml3e)
void pml3_traverse(pml3_t pml3, ptr_t *vaddr, size_t *n_pages, pagetable_walk_options_t callback, void *data)
pml3e_t * pml3_entry(pml3_t pml3, ptr_t vaddr)
pml2_t pml3e_get_or_create_pml2(pml3e_t *pml3e)
__nodiscard bool pml3_destroy_range(pml3_t pml3, ptr_t *vaddr, size_t *n_pages)
#define pml_destroy_table(x)
#define pml_create_table(x)
#define pmlxe_destroy(pmlxe)
void(* pml3e_pre_traverse)(pml3_t pml3, pml3e_t *e, ptr_t vaddr, void *data)