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: usize

The number of bits to shift right in the virtual address to get the index bits for this page level.

va_bits: usize

The 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: PTE

The 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 page size 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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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 resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

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.