Struct PageTableImpl

Source
pub struct PageTableImpl<T: HierarchicalLevel> { /* private fields */ }

Implementations§

Source§

impl<T> PageTableImpl<T>

Source

pub fn new(frame: Frame, physical_base: VAddr) -> PageTableImpl<T>

Source

pub unsafe fn from_frame(frame: Frame, physical_base: VAddr) -> PageTableImpl<T>

Create a PageTableImpl from a Frame that already contains a top-level table. This is very unsafe because it assumes that the frame contains a valid page table, and that no other PageTableImpls currently exist that use this same backing frame (as calling mapper on both could lead to two mutable references aliasing the same data to exist, which is UB).

Source

pub fn top(&self) -> &Table<T>

Source

pub fn top_mut(&mut self) -> &mut Table<T>

Source§

impl PageTableImpl<Level4>

Source

pub fn satp(&self) -> Satp

Source§

impl PageTableImpl<Level3>

Source

pub fn satp(&self) -> Satp

Trait Implementations§

Source§

impl Debug for PageTableImpl<Level3>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Debug for PageTableImpl<Level4>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PageTable<Size4KiB> for PageTableImpl<Level3>

Source§

fn new_with_kernel_mapped<A>(kernel_page_table: &Self, allocator: &A) -> Self

Constructs a new set of page tables, but with the kernel mapped into it. This is generally useful for constructing page tables for userspace.
Source§

unsafe fn switch_to(&self)

Install these page tables as the current set.
Source§

fn translate(&self, address: VAddr) -> Option<PAddr>

Get the physical address that a given virtual address is mapped to, if it’s mapped. Returns None if the address is not mapped into physical memory.
Source§

fn map<S, A>( &mut self, page: Page<S>, frame: Frame<S>, flags: Flags, allocator: &A, ) -> Result<(), PagingError>

Map a Page to a Frame with the given flags.
Source§

fn map_area<A>( &mut self, virtual_start: VAddr, physical_start: PAddr, size: usize, flags: Flags, allocator: &A, ) -> Result<(), PagingError>

Map an area of size bytes starting at the given address pair with the given flags. Implementations are free to map this area however they desire, and may do so with a range of page sizes.
Source§

fn unmap<S>(&mut self, page: Page<S>) -> Option<Frame<S>>
where S: FrameSize,

Source§

fn map_range<S, A>( &mut self, pages: Range<Page<S>>, frames: Range<Frame<S>>, flags: Flags, allocator: &A, ) -> Result<(), PagingError>
where S: FrameSize, A: FrameAllocator<TableSize>,

Map each Page in a range to a corresponding Frame with the given flags.
Source§

impl PageTable<Size4KiB> for PageTableImpl<Level4>

Source§

fn new_with_kernel_mapped<A>(kernel_page_table: &Self, allocator: &A) -> Self

Constructs a new set of page tables, but with the kernel mapped into it. This is generally useful for constructing page tables for userspace.
Source§

unsafe fn switch_to(&self)

Install these page tables as the current set.
Source§

fn translate(&self, address: VAddr) -> Option<PAddr>

Get the physical address that a given virtual address is mapped to, if it’s mapped. Returns None if the address is not mapped into physical memory.
Source§

fn map<S, A>( &mut self, page: Page<S>, frame: Frame<S>, flags: Flags, allocator: &A, ) -> Result<(), PagingError>

Map a Page to a Frame with the given flags.
Source§

fn map_area<A>( &mut self, virtual_start: VAddr, physical_start: PAddr, size: usize, flags: Flags, allocator: &A, ) -> Result<(), PagingError>

Map an area of size bytes starting at the given address pair with the given flags. Implementations are free to map this area however they desire, and may do so with a range of page sizes.
Source§

fn unmap<S>(&mut self, page: Page<S>) -> Option<Frame<S>>
where S: FrameSize,

Source§

fn map_range<S, A>( &mut self, pages: Range<Page<S>>, frames: Range<Frame<S>>, flags: Flags, allocator: &A, ) -> Result<(), PagingError>
where S: FrameSize, A: FrameAllocator<TableSize>,

Map each Page in a range to a corresponding Frame with the given flags.

Auto Trait Implementations§

§

impl<T> Freeze for PageTableImpl<T>

§

impl<T> RefUnwindSafe for PageTableImpl<T>
where T: RefUnwindSafe,

§

impl<T> Send for PageTableImpl<T>
where T: Send,

§

impl<T> Sync for PageTableImpl<T>
where T: Sync,

§

impl<T> Unpin for PageTableImpl<T>
where T: Unpin,

§

impl<T> UnwindSafe for PageTableImpl<T>
where T: UnwindSafe,

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.