diff --git a/arch/x86_64/src/paging/mapper.rs b/arch/x86_64/src/paging/mapper.rs index 5b7665a..819efa9 100644 --- a/arch/x86_64/src/paging/mapper.rs +++ b/arch/x86_64/src/paging/mapper.rs @@ -93,6 +93,13 @@ impl Mapper { .and_then(|p1| p1[page.p1_index()].pointed_frame()) } + pub fn translate_page_flags(&self, page: Page) -> Option { + self.p4().next_table(page.p4_index()) + .and_then(|p3| p3.next_table(page.p3_index())) + .and_then(|p2| p2.next_table(page.p2_index())) + .and_then(|p1| Some(p1[page.p1_index()].flags())) + } + /// Translate a virtual address to a physical one pub fn translate(&self, virtual_address: VirtualAddress) -> Option { let offset = virtual_address.get() % PAGE_SIZE;