Trait x86_64::structures::paging::Mapper [−][src]
pub trait Mapper<S: PageSize> { fn map_to<A>(
&mut self,
page: Page<S>,
frame: PhysFrame<S>,
flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<S>, MapToError>
where
A: FrameAllocator<Size4KiB>; fn unmap(
&mut self,
page: Page<S>
) -> Result<(PhysFrame<S>, MapperFlush<S>), UnmapError>; fn update_flags(
&mut self,
page: Page<S>,
flags: PageTableFlags
) -> Result<MapperFlush<S>, FlagUpdateError>; fn translate_page(&self, page: Page<S>) -> Option<PhysFrame<S>>; fn identity_map<A>(
&mut self,
frame: PhysFrame<S>,
flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<S>, MapToError>
where
A: FrameAllocator<Size4KiB>,
S: PageSize,
Self: Mapper<S>, { ... } }
A trait for common page table operations.
Required Methods
fn map_to<A>(
&mut self,
page: Page<S>,
frame: PhysFrame<S>,
flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<S>, MapToError> where
A: FrameAllocator<Size4KiB>,
&mut self,
page: Page<S>,
frame: PhysFrame<S>,
flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<S>, MapToError> where
A: FrameAllocator<Size4KiB>,
Creates a new mapping in the page table.
This function might need additional physical frames to create new page tables. These
frames are allocated from the allocator
argument. At most three frames are required.
fn unmap(
&mut self,
page: Page<S>
) -> Result<(PhysFrame<S>, MapperFlush<S>), UnmapError>
&mut self,
page: Page<S>
) -> Result<(PhysFrame<S>, MapperFlush<S>), UnmapError>
Removes a mapping from the page table and returns the frame that used to be mapped.
Note that no page tables or pages are deallocated.
fn update_flags(
&mut self,
page: Page<S>,
flags: PageTableFlags
) -> Result<MapperFlush<S>, FlagUpdateError>
&mut self,
page: Page<S>,
flags: PageTableFlags
) -> Result<MapperFlush<S>, FlagUpdateError>
Updates the flags of an existing mapping.
fn translate_page(&self, page: Page<S>) -> Option<PhysFrame<S>>
Return the frame that the specified page is mapped to.
Provided Methods
fn identity_map<A>(
&mut self,
frame: PhysFrame<S>,
flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<S>, MapToError> where
A: FrameAllocator<Size4KiB>,
S: PageSize,
Self: Mapper<S>,
&mut self,
frame: PhysFrame<S>,
flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<S>, MapToError> where
A: FrameAllocator<Size4KiB>,
S: PageSize,
Self: Mapper<S>,
Maps the given frame to the virtual page with the same address.
Implementors
impl<'a> Mapper<Size1GiB> for RecursivePageTable<'a>
impl<'a> Mapper<Size2MiB> for RecursivePageTable<'a>
impl<'a> Mapper<Size4KiB> for RecursivePageTable<'a>