page_table_entry

Trait GenericPTE

Source
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 bits(self) -> usize;
    fn is_unused(&self) -> bool;
    fn is_present(&self) -> bool;
    fn is_huge(&self) -> bool;
    fn clear(&mut 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 bits(self) -> usize

Returns the raw bits of this 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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.