[−][src]Struct x86_64::structures::paging::MappedPageTable
A Mapper implementation that relies on a PhysAddr to VirtAddr conversion function.
This type requires that the all physical page table frames are mapped to some virtual
address. Normally, this is done by mapping the complete physical address space into
the virtual address space at some offset. Other mappings between physical and virtual
memory are possible too, as long as they can be calculated as an PhysAddr
to
VirtAddr
closure.
Methods
impl<'a, PhysToVirt> MappedPageTable<'a, PhysToVirt> where
PhysToVirt: Fn(PhysFrame) -> *mut PageTable,
[src]
PhysToVirt: Fn(PhysFrame) -> *mut PageTable,
pub unsafe fn new(
level_4_table: &'a mut PageTable,
phys_to_virt: PhysToVirt
) -> Self
[src]
level_4_table: &'a mut PageTable,
phys_to_virt: PhysToVirt
) -> Self
Creates a new MappedPageTable
that uses the passed closure for converting virtual
to physical addresses.
This function is unsafe because the caller must guarantee that the passed phys_to_virt
closure is correct. Otherwise this function might break memory safety, e.g. by writing
to an illegal memory location.
Trait Implementations
impl<'a, PhysToVirt> Mapper<Size1GiB> for MappedPageTable<'a, PhysToVirt> where
PhysToVirt: Fn(PhysFrame) -> *mut PageTable,
[src]
PhysToVirt: Fn(PhysFrame) -> *mut PageTable,
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, PhysToVirt> Mapper<Size2MiB> for MappedPageTable<'a, PhysToVirt> where
PhysToVirt: Fn(PhysFrame) -> *mut PageTable,
[src]
PhysToVirt: Fn(PhysFrame) -> *mut PageTable,
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, PhysToVirt> Mapper<Size4KiB> for MappedPageTable<'a, PhysToVirt> where
PhysToVirt: Fn(PhysFrame) -> *mut PageTable,
[src]
PhysToVirt: Fn(PhysFrame) -> *mut PageTable,
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, PhysToVirt: Debug> Debug for MappedPageTable<'a, PhysToVirt> where
PhysToVirt: Fn(PhysFrame) -> *mut PageTable,
[src]
PhysToVirt: Fn(PhysFrame) -> *mut PageTable,
Auto Trait Implementations
impl<'a, PhysToVirt> Send for MappedPageTable<'a, PhysToVirt> where
PhysToVirt: Send,
PhysToVirt: Send,
impl<'a, PhysToVirt> Sync for MappedPageTable<'a, PhysToVirt> where
PhysToVirt: Sync,
PhysToVirt: Sync,
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,