[−][src]Struct x86_64::structures::paging::mapper::OffsetPageTable
A Mapper implementation that requires that the complete physically memory is mapped at some offset in the virtual address space.
Implementations
impl<'a> OffsetPageTable<'a>
[src]
pub unsafe fn new(
level_4_table: &'a mut PageTable,
phys_offset: VirtAddr
) -> Self
[src]
level_4_table: &'a mut PageTable,
phys_offset: VirtAddr
) -> Self
Creates a new OffsetPageTable
that uses the given offset for converting virtual
to physical addresses.
The complete physical memory must be mapped in the virtual address space starting at
address phys_offset
. This means that for example physical address 0x5000
can be
accessed through virtual address phys_offset + 0x5000
. This mapping is required because
the mapper needs to access page tables, which are not mapped into the virtual address
space by default.
Safety
This function is unsafe because the caller must guarantee that the passed phys_offset
is correct. Also, the passed level_4_table
must point to the level 4 page table
of a valid page table hierarchy. Otherwise this function might break memory safety, e.g.
by writing to an illegal memory location.
pub fn level_4_table(&mut self) -> &mut PageTable
[src]
Returns a mutable reference to the wrapped level 4 PageTable
instance.
Trait Implementations
impl<'a> Debug for OffsetPageTable<'a>
[src]
impl<'a> Mapper<Size1GiB> for OffsetPageTable<'a>
[src]
pub unsafe fn map_to_with_table_flags<A>(
&mut self,
page: Page<Size1GiB>,
frame: PhysFrame<Size1GiB>,
flags: PageTableFlags,
parent_table_flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<Size1GiB>, MapToError<Size1GiB>> where
A: FrameAllocator<Size4KiB>,
[src]
&mut self,
page: Page<Size1GiB>,
frame: PhysFrame<Size1GiB>,
flags: PageTableFlags,
parent_table_flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<Size1GiB>, MapToError<Size1GiB>> where
A: FrameAllocator<Size4KiB>,
pub 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>
pub unsafe 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>
pub unsafe fn set_flags_p4_entry(
&mut self,
page: Page<Size1GiB>,
flags: PageTableFlags
) -> Result<MapperFlushAll, FlagUpdateError>
[src]
&mut self,
page: Page<Size1GiB>,
flags: PageTableFlags
) -> Result<MapperFlushAll, FlagUpdateError>
pub unsafe fn set_flags_p3_entry(
&mut self,
page: Page<Size1GiB>,
flags: PageTableFlags
) -> Result<MapperFlushAll, FlagUpdateError>
[src]
&mut self,
page: Page<Size1GiB>,
flags: PageTableFlags
) -> Result<MapperFlushAll, FlagUpdateError>
pub unsafe fn set_flags_p2_entry(
&mut self,
page: Page<Size1GiB>,
flags: PageTableFlags
) -> Result<MapperFlushAll, FlagUpdateError>
[src]
&mut self,
page: Page<Size1GiB>,
flags: PageTableFlags
) -> Result<MapperFlushAll, FlagUpdateError>
pub fn translate_page(
&self,
page: Page<Size1GiB>
) -> Result<PhysFrame<Size1GiB>, TranslateError>
[src]
&self,
page: Page<Size1GiB>
) -> Result<PhysFrame<Size1GiB>, TranslateError>
pub unsafe fn map_to<A>(
&mut self,
page: Page<S>,
frame: PhysFrame<S>,
flags: PageTableFlags,
frame_allocator: &mut A
) -> Result<MapperFlush<S>, MapToError<S>> where
Self: Sized,
A: FrameAllocator<Size4KiB>,
[src]
&mut self,
page: Page<S>,
frame: PhysFrame<S>,
flags: PageTableFlags,
frame_allocator: &mut A
) -> Result<MapperFlush<S>, MapToError<S>> where
Self: Sized,
A: FrameAllocator<Size4KiB>,
pub unsafe fn identity_map<A>(
&mut self,
frame: PhysFrame<S>,
flags: PageTableFlags,
frame_allocator: &mut A
) -> Result<MapperFlush<S>, MapToError<S>> where
Self: Sized,
A: FrameAllocator<Size4KiB>,
S: PageSize,
Self: Mapper<S>,
[src]
&mut self,
frame: PhysFrame<S>,
flags: PageTableFlags,
frame_allocator: &mut A
) -> Result<MapperFlush<S>, MapToError<S>> where
Self: Sized,
A: FrameAllocator<Size4KiB>,
S: PageSize,
Self: Mapper<S>,
impl<'a> Mapper<Size2MiB> for OffsetPageTable<'a>
[src]
pub unsafe fn map_to_with_table_flags<A>(
&mut self,
page: Page<Size2MiB>,
frame: PhysFrame<Size2MiB>,
flags: PageTableFlags,
parent_table_flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<Size2MiB>, MapToError<Size2MiB>> where
A: FrameAllocator<Size4KiB>,
[src]
&mut self,
page: Page<Size2MiB>,
frame: PhysFrame<Size2MiB>,
flags: PageTableFlags,
parent_table_flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<Size2MiB>, MapToError<Size2MiB>> where
A: FrameAllocator<Size4KiB>,
pub 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>
pub unsafe 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>
pub unsafe fn set_flags_p4_entry(
&mut self,
page: Page<Size2MiB>,
flags: PageTableFlags
) -> Result<MapperFlushAll, FlagUpdateError>
[src]
&mut self,
page: Page<Size2MiB>,
flags: PageTableFlags
) -> Result<MapperFlushAll, FlagUpdateError>
pub unsafe fn set_flags_p3_entry(
&mut self,
page: Page<Size2MiB>,
flags: PageTableFlags
) -> Result<MapperFlushAll, FlagUpdateError>
[src]
&mut self,
page: Page<Size2MiB>,
flags: PageTableFlags
) -> Result<MapperFlushAll, FlagUpdateError>
pub unsafe fn set_flags_p2_entry(
&mut self,
page: Page<Size2MiB>,
flags: PageTableFlags
) -> Result<MapperFlushAll, FlagUpdateError>
[src]
&mut self,
page: Page<Size2MiB>,
flags: PageTableFlags
) -> Result<MapperFlushAll, FlagUpdateError>
pub fn translate_page(
&self,
page: Page<Size2MiB>
) -> Result<PhysFrame<Size2MiB>, TranslateError>
[src]
&self,
page: Page<Size2MiB>
) -> Result<PhysFrame<Size2MiB>, TranslateError>
pub unsafe fn map_to<A>(
&mut self,
page: Page<S>,
frame: PhysFrame<S>,
flags: PageTableFlags,
frame_allocator: &mut A
) -> Result<MapperFlush<S>, MapToError<S>> where
Self: Sized,
A: FrameAllocator<Size4KiB>,
[src]
&mut self,
page: Page<S>,
frame: PhysFrame<S>,
flags: PageTableFlags,
frame_allocator: &mut A
) -> Result<MapperFlush<S>, MapToError<S>> where
Self: Sized,
A: FrameAllocator<Size4KiB>,
pub unsafe fn identity_map<A>(
&mut self,
frame: PhysFrame<S>,
flags: PageTableFlags,
frame_allocator: &mut A
) -> Result<MapperFlush<S>, MapToError<S>> where
Self: Sized,
A: FrameAllocator<Size4KiB>,
S: PageSize,
Self: Mapper<S>,
[src]
&mut self,
frame: PhysFrame<S>,
flags: PageTableFlags,
frame_allocator: &mut A
) -> Result<MapperFlush<S>, MapToError<S>> where
Self: Sized,
A: FrameAllocator<Size4KiB>,
S: PageSize,
Self: Mapper<S>,
impl<'a> Mapper<Size4KiB> for OffsetPageTable<'a>
[src]
pub unsafe fn map_to_with_table_flags<A>(
&mut self,
page: Page<Size4KiB>,
frame: PhysFrame<Size4KiB>,
flags: PageTableFlags,
parent_table_flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<Size4KiB>, MapToError<Size4KiB>> where
A: FrameAllocator<Size4KiB>,
[src]
&mut self,
page: Page<Size4KiB>,
frame: PhysFrame<Size4KiB>,
flags: PageTableFlags,
parent_table_flags: PageTableFlags,
allocator: &mut A
) -> Result<MapperFlush<Size4KiB>, MapToError<Size4KiB>> where
A: FrameAllocator<Size4KiB>,
pub 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>
pub unsafe 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>
pub unsafe fn set_flags_p4_entry(
&mut self,
page: Page<Size4KiB>,
flags: PageTableFlags
) -> Result<MapperFlushAll, FlagUpdateError>
[src]
&mut self,
page: Page<Size4KiB>,
flags: PageTableFlags
) -> Result<MapperFlushAll, FlagUpdateError>
pub unsafe fn set_flags_p3_entry(
&mut self,
page: Page<Size4KiB>,
flags: PageTableFlags
) -> Result<MapperFlushAll, FlagUpdateError>
[src]
&mut self,
page: Page<Size4KiB>,
flags: PageTableFlags
) -> Result<MapperFlushAll, FlagUpdateError>
pub unsafe fn set_flags_p2_entry(
&mut self,
page: Page<Size4KiB>,
flags: PageTableFlags
) -> Result<MapperFlushAll, FlagUpdateError>
[src]
&mut self,
page: Page<Size4KiB>,
flags: PageTableFlags
) -> Result<MapperFlushAll, FlagUpdateError>
pub fn translate_page(
&self,
page: Page<Size4KiB>
) -> Result<PhysFrame<Size4KiB>, TranslateError>
[src]
&self,
page: Page<Size4KiB>
) -> Result<PhysFrame<Size4KiB>, TranslateError>
pub unsafe fn map_to<A>(
&mut self,
page: Page<S>,
frame: PhysFrame<S>,
flags: PageTableFlags,
frame_allocator: &mut A
) -> Result<MapperFlush<S>, MapToError<S>> where
Self: Sized,
A: FrameAllocator<Size4KiB>,
[src]
&mut self,
page: Page<S>,
frame: PhysFrame<S>,
flags: PageTableFlags,
frame_allocator: &mut A
) -> Result<MapperFlush<S>, MapToError<S>> where
Self: Sized,
A: FrameAllocator<Size4KiB>,
pub unsafe fn identity_map<A>(
&mut self,
frame: PhysFrame<S>,
flags: PageTableFlags,
frame_allocator: &mut A
) -> Result<MapperFlush<S>, MapToError<S>> where
Self: Sized,
A: FrameAllocator<Size4KiB>,
S: PageSize,
Self: Mapper<S>,
[src]
&mut self,
frame: PhysFrame<S>,
flags: PageTableFlags,
frame_allocator: &mut A
) -> Result<MapperFlush<S>, MapToError<S>> where
Self: Sized,
A: FrameAllocator<Size4KiB>,
S: PageSize,
Self: Mapper<S>,
impl<'a> MapperAllSizes for OffsetPageTable<'a>
[src]
pub fn translate(&self, addr: VirtAddr) -> TranslateResult
[src]
pub fn translate_addr(&self, addr: VirtAddr) -> Option<PhysAddr>
[src]
Auto Trait Implementations
impl<'a> Send for OffsetPageTable<'a>
[src]
impl<'a> Sync for OffsetPageTable<'a>
[src]
impl<'a> Unpin for OffsetPageTable<'a>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,