page_table_multiarch

Trait PagingMetaData

source
pub trait PagingMetaData: Sync + Send {
    type VirtAddr: MemoryAddr;

    const LEVELS: usize;
    const PA_MAX_BITS: usize;
    const VA_MAX_BITS: usize;
    const PA_MAX_ADDR: usize = _;

    // Required method
    fn flush_tlb(vaddr: Option<Self::VirtAddr>);

    // Provided methods
    fn paddr_is_valid(paddr: usize) -> bool { ... }
    fn vaddr_is_valid(vaddr: usize) -> bool { ... }
}
Expand description

The architecture-dependent metadata that must be provided for PageTable64.

Required Associated Constants§

source

const LEVELS: usize

The number of levels of the hardware page table.

source

const PA_MAX_BITS: usize

The maximum number of bits of physical address.

source

const VA_MAX_BITS: usize

The maximum number of bits of virtual address.

Provided Associated Constants§

source

const PA_MAX_ADDR: usize = _

The maximum physical address.

Required Associated Types§

source

type VirtAddr: MemoryAddr

The virtual address to be translated in this page table.

This associated type allows more flexible use of page tables structs like PageTable64, for example, to implement EPTs.

Required Methods§

source

fn flush_tlb(vaddr: Option<Self::VirtAddr>)

Flushes the TLB.

If vaddr is None, flushes the entire TLB. Otherwise, flushes the TLB entry at the given virtual address.

Provided Methods§

source

fn paddr_is_valid(paddr: usize) -> bool

Whether a given physical address is valid.

source

fn vaddr_is_valid(vaddr: usize) -> bool

Whether a given virtual address is valid.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl PagingMetaData for A64PagingMetaData

Available on AArch64 only.
source§

const LEVELS: usize = 4usize

source§

const PA_MAX_BITS: usize = 48usize

source§

const VA_MAX_BITS: usize = 48usize

source§

type VirtAddr = VirtAddr

source§

impl PagingMetaData for X64PagingMetaData

Available on x86-64 only.
source§

const LEVELS: usize = 4usize

source§

const PA_MAX_BITS: usize = 52usize

source§

const VA_MAX_BITS: usize = 48usize

source§

type VirtAddr = VirtAddr

source§

impl<VA: SvVirtAddr> PagingMetaData for Sv39MetaData<VA>

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

const LEVELS: usize = 3usize

source§

const PA_MAX_BITS: usize = 56usize

source§

const VA_MAX_BITS: usize = 39usize

source§

type VirtAddr = VA

source§

impl<VA: SvVirtAddr> PagingMetaData for Sv48MetaData<VA>

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

const LEVELS: usize = 4usize

source§

const PA_MAX_BITS: usize = 56usize

source§

const VA_MAX_BITS: usize = 48usize

source§

type VirtAddr = VA