Struct page_walker::level::PageLevel [−][src]
pub struct PageLevel<PTE> where
PTE: PrimInt + Unsigned, {
pub shift_bits: usize,
pub va_bits: usize,
pub present_bit: (PTE, PTE),
pub huge_page_bit: (PTE, PTE),
pub page_table_mask: PTE,
}Expand description
Describes a single page level of the page hierarchy.
Fields
shift_bits: usizeThe number of bits to shift right in the virtual address to get the index bits for this page level.
va_bits: usizeThe number of bits in the virtual address to extract as the index for this page level.
present_bit: (PTE, PTE)The present bit in the PTE. The first mask is to select the relevants bits, the second is what the value should be upon masking.
huge_page_bit: (PTE, PTE)The huge page bit in the PTE. If the current page level does not support huge pages, then this should be set to zero. The first mask is to select the relevant bits, the second is what the value should be upon masking.
page_table_mask: PTEThe page table mask that should be set when allocating new page tables.
Implementations
Calculates the number of entries present in a page table for this page level.
Calculates the shifted mask to select the appropriate bits from the virtual address.
Calculates the last virtual address within the same page for the current page level of the given a virtual address. This can be used to retrieve the first address of the next page for the current page level by simply adding one.
Calculates the PTE index of the given virtual address for the current page table level, which can then be used to index into the page table to get the corresponding PTE for this virtual address.
Given a PTE, it checks if the PTE points to a present page or page table.
Given a PTE, it checks if the PTE points to a huge page. Always returns false if the
current page level does not support huge pages.
Trait Implementations
Auto Trait Implementations
impl<PTE> RefUnwindSafe for PageLevel<PTE> where
PTE: RefUnwindSafe,
impl<PTE> UnwindSafe for PageLevel<PTE> where
PTE: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more