Struct memory::PageTable

source ·
pub struct PageTable { /* private fields */ }
Expand description

A top-level root (P4) page table.

Auto-derefs into a Mapper for easy invocation of memory mapping functions.

Implementations§

Initializes a new top-level P4 PageTable whose root is located in the given new_p4_frame. It requires using the given current_active_table to set up its initial mapping contents.

A single allocated page can optionally be provided for use as part of a new TemporaryPage for the recursive mapping.

Returns the new PageTable that exists in physical memory at the given new_p4_frame. Note that this new page table has no current mappings beyond the recursive P4 mapping, so you will need to create or copy over any relevant mappings before using (switching) to this new page table in order to ensure the system keeps running.

Temporarily maps the given other PageTable to the temporary recursive index (508th entry)

Accepts a closure f that is passed a mutable reference to the other table’s mapper, and an immutable reference to the current table’s mapper.

Note

This does not perform any task switching or changing of the current page table register (e.g., cr3).

Switches from the currently-active page table (this PageTable, i.e., self) to the given new_table. After this function, the given new_table will be the currently-active PageTable.

Returns the physical address of this page table’s top-level p4 frame

Methods from Deref<Target = Mapper>§

Dumps all page table entries at all four page table levels for the given VirtualAddress, and also shows their PteFlags.

The page table details are written to the log as an info message.

Translates a VirtualAddress to a PhysicalAddress by walking the page tables.

Translates a virtual memory Page to a physical memory Frame by walking the page tables.

Maps the given virtual AllocatedPages to the given physical AllocatedFrames.

Consumes the given AllocatedPages and returns a MappedPages object which contains those AllocatedPages.

Maps the given AllocatedPages to randomly chosen (allocated) physical frames.

Consumes the given AllocatedPages and returns a MappedPages object which contains those AllocatedPages.

Trait Implementations§

Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.