PageFormat

Struct PageFormat 

Source
pub struct PageFormat<'a, PTE>{
    pub levels: &'a [PageLevel<PTE>],
    pub physical_mask: PTE,
}
Expand description

Describes the page format of the page hierarchy and the mask of bits in the PTE that refer to the actual physical address and are not used for metadata.

Fields§

§levels: &'a [PageLevel<PTE>]

Describes the page table hierarchy as a slice of crate::level::PageLevel structs that each describe a single level in this hierarchy, where the level at index zero is the leaf node and the last page level is the root.

§physical_mask: PTE

The physical mask of bits that refer to an actual physical address and are not used for PTE metadata.

Implementations§

Source§

impl<'a, PTE> PageFormat<'a, PTE>

Source

pub fn virtual_mask(&self) -> usize

Calculates the full virtual address mask by setting all the bits for each page level and finding the largest mask. This is used by the PageFormat::sign_extend method to determine the sign bit.

Source

pub fn sign_extend(&self, address: usize) -> usize

Sign extends a given virtual address by extending the sign bit into the unused upper bits of the virtual address.

Source

pub fn walk<PageWalker, Error>( &self, phys_addr: PTE, range: Range<usize>, walker: &mut PageWalker, ) -> Result<(), Error>
where PageWalker: PageWalker<PTE, Error>,

This is a recursive function used to traverse the page table hierarchy for a given virtual address range and the given physical address of the root page table of the page table hierarchy. It invokes the appropriate user callbacks in crate::walker::PageWalker, while traversing the page tables.

Source

pub fn walk_mut<PageWalkerMut, Error>( &self, phys_addr: PTE, range: Range<usize>, walker: &mut PageWalkerMut, ) -> Result<(), Error>
where PageWalkerMut: PageWalkerMut<PTE, Error>,

This is a recursive function used to traverse the page table hierarchy for a given virtual address range and the given physical address of the root page table of the page table hierarchy. It invokes the appropriate user callbacks in crate::walker::PageWalker, while traversing the page tables.

Trait Implementations§

Source§

impl<'a, PTE> Clone for PageFormat<'a, PTE>

Source§

fn clone(&self) -> PageFormat<'a, PTE>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, PTE> Debug for PageFormat<'a, PTE>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, PTE> Freeze for PageFormat<'a, PTE>
where PTE: Freeze,

§

impl<'a, PTE> RefUnwindSafe for PageFormat<'a, PTE>
where PTE: RefUnwindSafe,

§

impl<'a, PTE> Send for PageFormat<'a, PTE>
where PTE: Send + Sync,

§

impl<'a, PTE> Sync for PageFormat<'a, PTE>
where PTE: Sync,

§

impl<'a, PTE> Unpin for PageFormat<'a, PTE>
where PTE: Unpin,

§

impl<'a, PTE> UnwindSafe for PageFormat<'a, PTE>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.