[][src]Struct x86_64::structures::paging::mapper::MappedPageTable

pub struct MappedPageTable<'a, P: PhysToVirt> { /* fields omitted */ }

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, P: PhysToVirt> MappedPageTable<'a, P>[src]

pub unsafe fn new(level_4_table: &'a mut PageTable, phys_to_virt: P) -> Self[src]

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. 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.

Trait Implementations

impl<'a, P: PhysToVirt> MapperAllSizes for MappedPageTable<'a, P>[src]

fn translate_addr(&self, addr: VirtAddr) -> Option<PhysAddr>[src]

Translates the given virtual address to the physical address that it maps to. Read more

impl<'a, P: PhysToVirt> Mapper<Size1GiB> for MappedPageTable<'a, P>[src]

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]

Maps the given frame to the virtual page with the same address. Read more

impl<'a, P: PhysToVirt> Mapper<Size2MiB> for MappedPageTable<'a, P>[src]

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]

Maps the given frame to the virtual page with the same address. Read more

impl<'a, P: PhysToVirt> Mapper<Size4KiB> for MappedPageTable<'a, P>[src]

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]

Maps the given frame to the virtual page with the same address. Read more

impl<'a, P: Debug + PhysToVirt> Debug for MappedPageTable<'a, P>[src]

Auto Trait Implementations

impl<'a, P> Unpin for MappedPageTable<'a, P> where
    P: Unpin

impl<'a, P> Send for MappedPageTable<'a, P> where
    P: Send

impl<'a, P> Sync for MappedPageTable<'a, P> where
    P: Sync

Blanket Implementations

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]