pub trait GenericPTE: Debug + Clone + Copy + Sync + Send + Sized {
    // Required methods
    fn new_page(paddr: PhysAddr, flags: MappingFlags, is_huge: bool) -> Self;
    fn new_table(paddr: PhysAddr) -> Self;
    fn paddr(&self) -> PhysAddr;
    fn flags(&self) -> MappingFlags;
    fn set_paddr(&mut self, paddr: PhysAddr);
    fn set_flags(&mut self, flags: MappingFlags, is_huge: bool);
    fn is_unused(&self) -> bool;
    fn is_present(&self) -> bool;
    fn is_huge(&self) -> bool;
    fn clear(&mut self);

    // Provided method
    fn new_fault_page(_flags: MappingFlags, _is_huge: bool) -> Self { ... }
}
Expand description

A generic page table entry.

All architecture-specific page table entry types implement this trait.

Required Methods§

source

fn new_page(paddr: PhysAddr, flags: MappingFlags, is_huge: bool) -> Self

Creates a page table entry point to a terminate page or block.

source

fn new_table(paddr: PhysAddr) -> Self

Creates a page table entry point to a next level page table.

source

fn paddr(&self) -> PhysAddr

Returns the physical address mapped by this entry.

source

fn flags(&self) -> MappingFlags

Returns the flags of this entry.

source

fn set_paddr(&mut self, paddr: PhysAddr)

Set mapped physical address of the entry.

source

fn set_flags(&mut self, flags: MappingFlags, is_huge: bool)

Set flags of the entry.

source

fn is_unused(&self) -> bool

Returns whether this entry is zero.

source

fn is_present(&self) -> bool

Returns whether this entry flag indicates present.

source

fn is_huge(&self) -> bool

For non-last level translation, returns whether this entry maps to a huge frame.

source

fn clear(&mut self)

Set this entry to zero.

Provided Methods§

source

fn new_fault_page(_flags: MappingFlags, _is_huge: bool) -> Self

Creates a fault page table entry.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl GenericPTE for A64PTE

Available on AArch64 only.
source§

impl GenericPTE for Rv64PTE

Available on RISC-V RV32 or RISC-V RV64 only.
source§

impl GenericPTE for X64PTE

Available on x86-64 only.