pub struct PageTable {
root_ppn: PhysPageNum,
frames: Vec<Arc<FrameTracker>>,
}Fields
root_ppn: PhysPageNumframes: Vec<Arc<FrameTracker>>Implementations
Assume that it won’t encounter oom when creating/mapping.
Create an empty page table from satp
Argument
satpSupervisor Address Translation & Protection reg. that points to the physical page containing the root page.
Predicate for the valid bit.
Find the page in the page table, creating the page on the way if not exists. Note: It does NOT create the terminal node. The caller must verify its validity and create according to his own needs.
Find the page table entry denoted by vpn, returning Some(&_) if found or None if not.
Find and return reference the page table entry denoted by vpn, None if not found.
Map the vpn to ppn with the flags.
Note
Allocation should be done elsewhere.
Exceptions
Panics if the vpn is mapped.
Translate the vpn into its corresponding Some(PageTableEntry) if exists
None is returned if nothing is found.
Translate the virtual address into its corresponding PhysAddr if mapped in current page table.
None is returned if nothing is found.