pub struct PageTableImpl<T: HierarchicalLevel> { /* private fields */ }
Implementations§
Source§impl<T> PageTableImpl<T>where
T: HierarchicalLevel,
impl<T> PageTableImpl<T>where
T: HierarchicalLevel,
pub fn new(frame: Frame, physical_base: VAddr) -> PageTableImpl<T>
Sourcepub unsafe fn from_frame(frame: Frame, physical_base: VAddr) -> PageTableImpl<T>
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 PageTableImpl
s 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).
pub fn top(&self) -> &Table<T>
pub fn top_mut(&mut self) -> &mut Table<T>
Trait Implementations§
Source§impl Debug for PageTableImpl<Level3>
impl Debug for PageTableImpl<Level3>
Source§impl Debug for PageTableImpl<Level4>
impl Debug for PageTableImpl<Level4>
Source§impl PageTable<Size4KiB> for PageTableImpl<Level3>
impl PageTable<Size4KiB> for PageTableImpl<Level3>
Source§fn new_with_kernel_mapped<A>(kernel_page_table: &Self, allocator: &A) -> Selfwhere
A: FrameAllocator<Size4KiB>,
fn new_with_kernel_mapped<A>(kernel_page_table: &Self, allocator: &A) -> Selfwhere
A: FrameAllocator<Size4KiB>,
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§fn translate(&self, address: VAddr) -> Option<PAddr>
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>
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>where
A: FrameAllocator<Size4KiB>,
fn map_area<A>(
&mut self,
virtual_start: VAddr,
physical_start: PAddr,
size: usize,
flags: Flags,
allocator: &A,
) -> Result<(), PagingError>where
A: FrameAllocator<Size4KiB>,
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.fn unmap<S>(&mut self, page: Page<S>) -> Option<Frame<S>>where
S: FrameSize,
Source§impl PageTable<Size4KiB> for PageTableImpl<Level4>
impl PageTable<Size4KiB> for PageTableImpl<Level4>
Source§fn new_with_kernel_mapped<A>(kernel_page_table: &Self, allocator: &A) -> Selfwhere
A: FrameAllocator<Size4KiB>,
fn new_with_kernel_mapped<A>(kernel_page_table: &Self, allocator: &A) -> Selfwhere
A: FrameAllocator<Size4KiB>,
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§fn translate(&self, address: VAddr) -> Option<PAddr>
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>
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>where
A: FrameAllocator<Size4KiB>,
fn map_area<A>(
&mut self,
virtual_start: VAddr,
physical_start: PAddr,
size: usize,
flags: Flags,
allocator: &A,
) -> Result<(), PagingError>where
A: FrameAllocator<Size4KiB>,
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.fn unmap<S>(&mut self, page: Page<S>) -> Option<Frame<S>>where
S: FrameSize,
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more