Skip to main content

PageTableEntry

Trait PageTableEntry 

Source
pub trait PageTableEntry:
    Sized
    + Debug
    + Sync
    + Send
    + Clone
    + Copy
    + 'static {
    type PteConfig: Copy;

    // Required methods
    fn new_page(paddr: PhysAddr, config: Self::PteConfig, is_huge: bool) -> Self;
    fn new_table(paddr: PhysAddr) -> Self;
    fn paddr(&self, is_dir: bool) -> PhysAddr;
    fn config(&self, is_dir: bool) -> Self::PteConfig;
    fn present(&self) -> bool;
    fn huge(&self, is_dir: bool) -> bool;
    fn unused(&self) -> bool;
    fn clear(&mut self);
}

Required Associated Types§

Source

type PteConfig: Copy

Configuration understood by this concrete PTE format.

Required Methods§

Source

fn new_page(paddr: PhysAddr, config: Self::PteConfig, is_huge: bool) -> Self

Creates a leaf or block entry.

Source

fn new_table(paddr: PhysAddr) -> Self

Creates an entry that points to a child page-table frame.

Source

fn paddr(&self, is_dir: bool) -> PhysAddr

Returns the physical address encoded by this entry.

is_dir lets formats with level-dependent layouts decode the address without exposing those layout rules to the generic walker.

Source

fn config(&self, is_dir: bool) -> Self::PteConfig

Decodes the owner-defined leaf configuration.

Source

fn present(&self) -> bool

Returns whether this entry participates in address translation.

Implementations must recognize both leaf mappings and child-table entries.

Source

fn huge(&self, is_dir: bool) -> bool

Returns whether this entry is a block mapping at the current level.

CPU page-table formats should preserve this structural answer for a retained non-present block. Formats that encode an empty-permission block as zero may return false; typed split then reports NotMapped.

Source

fn unused(&self) -> bool

Returns whether this entry contains no descriptor state at all.

This is distinct from Self::present: a non-present leaf may retain its physical address so that a later protection change can activate it.

Source

fn clear(&mut self)

Clears all descriptor state from this entry.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl PageTableEntry for EptEntry

Source§

type PteConfig = EptFlags

Source§

fn new_page(paddr: PhysAddr, flags: EptFlags, is_huge: bool) -> EptEntry

Source§

fn new_table(paddr: PhysAddr) -> EptEntry

Source§

fn paddr(&self, _is_dir: bool) -> PhysAddr

Source§

fn config(&self, _is_dir: bool) -> EptFlags

Source§

fn present(&self) -> bool

Source§

fn huge(&self, is_dir: bool) -> bool

Source§

fn unused(&self) -> bool

Source§

fn clear(&mut self)

Implementors§