Skip to main content

PageTableEntry

Trait PageTableEntry 

Source
pub trait PageTableEntry:
    Debug
    + Sync
    + Send
    + Clone
    + Copy
    + Sized
    + '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.

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".

Implementors§