Add table function for mapper, to get inner page table

This commit is contained in:
Jeremy Soller
2020-09-08 13:52:22 -06:00
parent b4c8ab797d
commit db7869d995
+7 -3
View File
@@ -29,12 +29,16 @@ impl<'f, A: Arch, F: FrameAllocator> PageMapper<'f, A, F> {
A::set_table(self.table_addr);
}
pub unsafe fn map(&mut self, virt: VirtualAddress, entry: PageEntry<A>) -> Option<()> {
let mut table = PageTable::new(
pub unsafe fn table(&self) -> PageTable<A> {
PageTable::new(
VirtualAddress::new(0),
self.table_addr,
A::PAGE_LEVELS - 1
);
)
}
pub unsafe fn map(&mut self, virt: VirtualAddress, entry: PageEntry<A>) -> Option<()> {
let mut table = self.table();
loop {
let i = table.index_of(virt)?;
if table.level() == 0 {