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
  • satp Supervisor 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.

Unmap the vpn to ppn with the flags.

Exceptions

Panics if the vpn is NOT mapped (invalid).

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.

Return the physical token to current page.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.