[−][src]Trait x86_64::structures::paging::mapper::Mapper
A trait for common page table operations on pages of size S
.
Required methods
fn map_to<A>(
&mut self,
page: Page<S>,
frame: UnusedPhysFrame<S>,
flags: PageTableFlags,
frame_allocator: &mut A
) -> Result<MapperFlush<S>, MapToError<S>> where
Self: Sized,
A: FrameAllocator<Size4KiB>,
&mut self,
page: Page<S>,
frame: UnusedPhysFrame<S>,
flags: PageTableFlags,
frame_allocator: &mut A
) -> Result<MapperFlush<S>, MapToError<S>> where
Self: Sized,
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>) -> Result<PhysFrame<S>, TranslateError>
Return the frame that the specified page is mapped to.
This function assumes that the page is mapped to a frame of size S
and returns an
error otherwise.
Provided methods
unsafe fn identity_map<A>(
&mut self,
frame: UnusedPhysFrame<S>,
flags: PageTableFlags,
frame_allocator: &mut A
) -> Result<MapperFlush<S>, MapToError<S>> where
Self: Sized,
A: FrameAllocator<Size4KiB>,
S: PageSize,
Self: Mapper<S>,
&mut self,
frame: UnusedPhysFrame<S>,
flags: PageTableFlags,
frame_allocator: &mut A
) -> Result<MapperFlush<S>, MapToError<S>> where
Self: Sized,
A: FrameAllocator<Size4KiB>,
S: PageSize,
Self: Mapper<S>,
Maps the given frame to the virtual page with the same address.
Implementors
impl<'a, P: PhysToVirt> Mapper<Size1GiB> for MappedPageTable<'a, P>
[src]
fn map_to<A>(
&mut self,
page: Page<Size1GiB>,
frame: UnusedPhysFrame<Size1GiB>,
flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<Size1GiB>, MapToError<Size1GiB>> where
A: FrameAllocator<Size4KiB>,
[src]
&mut self,
page: Page<Size1GiB>,
frame: UnusedPhysFrame<Size1GiB>,
flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<Size1GiB>, MapToError<Size1GiB>> where
A: FrameAllocator<Size4KiB>,
fn unmap(
&mut self,
page: Page<Size1GiB>
) -> Result<(PhysFrame<Size1GiB>, MapperFlush<Size1GiB>), UnmapError>
[src]
&mut self,
page: Page<Size1GiB>
) -> Result<(PhysFrame<Size1GiB>, MapperFlush<Size1GiB>), UnmapError>
fn update_flags(
&mut self,
page: Page<Size1GiB>,
flags: PageTableFlags
) -> Result<MapperFlush<Size1GiB>, FlagUpdateError>
[src]
&mut self,
page: Page<Size1GiB>,
flags: PageTableFlags
) -> Result<MapperFlush<Size1GiB>, FlagUpdateError>
fn translate_page(
&self,
page: Page<Size1GiB>
) -> Result<PhysFrame<Size1GiB>, TranslateError>
[src]
&self,
page: Page<Size1GiB>
) -> Result<PhysFrame<Size1GiB>, TranslateError>
impl<'a, P: PhysToVirt> Mapper<Size2MiB> for MappedPageTable<'a, P>
[src]
fn map_to<A>(
&mut self,
page: Page<Size2MiB>,
frame: UnusedPhysFrame<Size2MiB>,
flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<Size2MiB>, MapToError<Size2MiB>> where
A: FrameAllocator<Size4KiB>,
[src]
&mut self,
page: Page<Size2MiB>,
frame: UnusedPhysFrame<Size2MiB>,
flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<Size2MiB>, MapToError<Size2MiB>> where
A: FrameAllocator<Size4KiB>,
fn unmap(
&mut self,
page: Page<Size2MiB>
) -> Result<(PhysFrame<Size2MiB>, MapperFlush<Size2MiB>), UnmapError>
[src]
&mut self,
page: Page<Size2MiB>
) -> Result<(PhysFrame<Size2MiB>, MapperFlush<Size2MiB>), UnmapError>
fn update_flags(
&mut self,
page: Page<Size2MiB>,
flags: PageTableFlags
) -> Result<MapperFlush<Size2MiB>, FlagUpdateError>
[src]
&mut self,
page: Page<Size2MiB>,
flags: PageTableFlags
) -> Result<MapperFlush<Size2MiB>, FlagUpdateError>
fn translate_page(
&self,
page: Page<Size2MiB>
) -> Result<PhysFrame<Size2MiB>, TranslateError>
[src]
&self,
page: Page<Size2MiB>
) -> Result<PhysFrame<Size2MiB>, TranslateError>
impl<'a, P: PhysToVirt> Mapper<Size4KiB> for MappedPageTable<'a, P>
[src]
fn map_to<A>(
&mut self,
page: Page<Size4KiB>,
frame: UnusedPhysFrame<Size4KiB>,
flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<Size4KiB>, MapToError<Size4KiB>> where
A: FrameAllocator<Size4KiB>,
[src]
&mut self,
page: Page<Size4KiB>,
frame: UnusedPhysFrame<Size4KiB>,
flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<Size4KiB>, MapToError<Size4KiB>> where
A: FrameAllocator<Size4KiB>,
fn unmap(
&mut self,
page: Page<Size4KiB>
) -> Result<(PhysFrame<Size4KiB>, MapperFlush<Size4KiB>), UnmapError>
[src]
&mut self,
page: Page<Size4KiB>
) -> Result<(PhysFrame<Size4KiB>, MapperFlush<Size4KiB>), UnmapError>
fn update_flags(
&mut self,
page: Page<Size4KiB>,
flags: PageTableFlags
) -> Result<MapperFlush<Size4KiB>, FlagUpdateError>
[src]
&mut self,
page: Page<Size4KiB>,
flags: PageTableFlags
) -> Result<MapperFlush<Size4KiB>, FlagUpdateError>
fn translate_page(
&self,
page: Page<Size4KiB>
) -> Result<PhysFrame<Size4KiB>, TranslateError>
[src]
&self,
page: Page<Size4KiB>
) -> Result<PhysFrame<Size4KiB>, TranslateError>