PageTable

Struct PageTable 

Source
#[repr(C, align(4096))]
pub struct PageTable { entries: [PtEntry4k; 512], }
Expand description

The Page Table (L1): 512 entries, 4 KiB-aligned.

Fields§

§entries: [PtEntry4k; 512]

Implementations§

Source§

impl PageTable

Source

pub const fn zeroed() -> Self

Create a fully zeroed Page Table (all entries non-present).

Source

pub const fn get(&self, i: L1Index) -> PtEntry4k

Read the entry at i.

Plain load; does not imply any TLB synchronization.

Source

pub const fn set(&mut self, i: L1Index, e: PtEntry4k)

Write the entry at i.

Caller must handle any required TLB invalidation when changing active mappings.

Source

pub const fn set_zero(&mut self, i: L1Index)

Set the entry at i to PtEntry4k::zero.

Caller is responsible for necessary TLB invalidations if this affects an active address space.

Source

pub const fn index_of(va: VirtualAddress) -> L1Index

Derive the PT index from a virtual address.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.