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: PTEThe 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>
impl<'a, PTE> PageFormat<'a, PTE>
Sourcepub fn virtual_mask(&self) -> usize
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.
Sourcepub fn sign_extend(&self, address: usize) -> usize
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.
Sourcepub fn walk<PageWalker, Error>(
&self,
phys_addr: PTE,
range: Range<usize>,
walker: &mut PageWalker,
) -> Result<(), Error>where
PageWalker: PageWalker<PTE, Error>,
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.
Sourcepub fn walk_mut<PageWalkerMut, Error>(
&self,
phys_addr: PTE,
range: Range<usize>,
walker: &mut PageWalkerMut,
) -> Result<(), Error>where
PageWalkerMut: PageWalkerMut<PTE, Error>,
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>
impl<'a, PTE> Clone for PageFormat<'a, PTE>
Source§fn clone(&self) -> PageFormat<'a, PTE>
fn clone(&self) -> PageFormat<'a, PTE>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more