[−][src]Struct x86_64::structures::paging::mapper::RecursivePageTable
A recursive page table is a last level page table with an entry mapped to the table itself.
This recursive mapping allows accessing all page tables in the hierarchy:
- To access the level 4 page table, we “loop“ (i.e. follow the recursively mapped entry) four times.
- To access a level 3 page table, we “loop” three times and then use the level 4 index.
- To access a level 2 page table, we “loop” two times, then use the level 4 index, then the level 3 index.
- To access a level 1 page table, we “loop” once, then use the level 4 index, then the level 3 index, then the level 2 index.
This struct implements the Mapper
trait.
Methods
impl<'a> RecursivePageTable<'a>
[src]
pub fn new(table: &'a mut PageTable) -> Result<Self, ()>
[src]
Creates a new RecursivePageTable from the passed level 4 PageTable.
The page table must be recursively mapped, that means:
- The page table must have one recursive entry, i.e. an entry that points to the table
itself.
- The reference must use that “loop”, i.e. be of the form
0o_xxx_xxx_xxx_xxx_0000
wherexxx
is the recursive entry.
- The reference must use that “loop”, i.e. be of the form
- The page table must be active, i.e. the CR3 register must contain its physical address.
Otherwise Err(())
is returned.
pub unsafe fn new_unchecked(
table: &'a mut PageTable,
recursive_index: u9
) -> Self
[src]
table: &'a mut PageTable,
recursive_index: u9
) -> Self
Creates a new RecursivePageTable without performing any checks.
The recursive_index
parameter must be the index of the recursively mapped entry.
Trait Implementations
impl<'a> Mapper<Size1GiB> for RecursivePageTable<'a>
[src]
unsafe fn map_to<A>(
&mut self,
page: Page<Size1GiB>,
frame: PhysFrame<Size1GiB>,
flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<Size1GiB>, MapToError> where
A: FrameAllocator<Size4KiB>,
[src]
&mut self,
page: Page<Size1GiB>,
frame: PhysFrame<Size1GiB>,
flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<Size1GiB>, MapToError> 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>
unsafe fn identity_map<A>(
&mut self,
frame: PhysFrame<S>,
flags: PageTableFlags,
frame_allocator: &mut A
) -> Result<MapperFlush<S>, MapToError> where
A: FrameAllocator<Size4KiB>,
S: PageSize,
Self: Mapper<S>,
[src]
&mut self,
frame: PhysFrame<S>,
flags: PageTableFlags,
frame_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. Read more
impl<'a> Mapper<Size2MiB> for RecursivePageTable<'a>
[src]
unsafe fn map_to<A>(
&mut self,
page: Page<Size2MiB>,
frame: PhysFrame<Size2MiB>,
flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<Size2MiB>, MapToError> where
A: FrameAllocator<Size4KiB>,
[src]
&mut self,
page: Page<Size2MiB>,
frame: PhysFrame<Size2MiB>,
flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<Size2MiB>, MapToError> 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>
unsafe fn identity_map<A>(
&mut self,
frame: PhysFrame<S>,
flags: PageTableFlags,
frame_allocator: &mut A
) -> Result<MapperFlush<S>, MapToError> where
A: FrameAllocator<Size4KiB>,
S: PageSize,
Self: Mapper<S>,
[src]
&mut self,
frame: PhysFrame<S>,
flags: PageTableFlags,
frame_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. Read more
impl<'a> Mapper<Size4KiB> for RecursivePageTable<'a>
[src]
unsafe fn map_to<A>(
&mut self,
page: Page<Size4KiB>,
frame: PhysFrame<Size4KiB>,
flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<Size4KiB>, MapToError> where
A: FrameAllocator<Size4KiB>,
[src]
&mut self,
page: Page<Size4KiB>,
frame: PhysFrame<Size4KiB>,
flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<Size4KiB>, MapToError> 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>
unsafe fn identity_map<A>(
&mut self,
frame: PhysFrame<S>,
flags: PageTableFlags,
frame_allocator: &mut A
) -> Result<MapperFlush<S>, MapToError> where
A: FrameAllocator<Size4KiB>,
S: PageSize,
Self: Mapper<S>,
[src]
&mut self,
frame: PhysFrame<S>,
flags: PageTableFlags,
frame_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. Read more
impl<'a> Debug for RecursivePageTable<'a>
[src]
Auto Trait Implementations
impl<'a> Send for RecursivePageTable<'a>
impl<'a> Sync for RecursivePageTable<'a>
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,