[][src]Struct x86_64::structures::paging::OffsetMapper

pub struct OffsetMapper<'a, PhysToVirt> where
    PhysToVirt: Fn(PhysAddr) -> VirtAddr
{ /* 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 (hence the name of this type). 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> OffsetMapper<'a, PhysToVirt> where
    PhysToVirt: Fn(PhysAddr) -> VirtAddr
[src]

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

Creates a new OffsetMapper 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 OffsetMapper<'a, PhysToVirt> where
    PhysToVirt: Fn(PhysAddr) -> VirtAddr
[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, PhysToVirt> Mapper<Size2MiB> for OffsetMapper<'a, PhysToVirt> where
    PhysToVirt: Fn(PhysAddr) -> VirtAddr
[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, PhysToVirt> Mapper<Size4KiB> for OffsetMapper<'a, PhysToVirt> where
    PhysToVirt: Fn(PhysAddr) -> VirtAddr
[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, PhysToVirt: Debug> Debug for OffsetMapper<'a, PhysToVirt> where
    PhysToVirt: Fn(PhysAddr) -> VirtAddr
[src]

Auto Trait Implementations

impl<'a, PhysToVirt> Send for OffsetMapper<'a, PhysToVirt> where
    PhysToVirt: Send

impl<'a, PhysToVirt> Sync for OffsetMapper<'a, PhysToVirt> where
    PhysToVirt: Sync

Blanket Implementations

impl<T> From for T
[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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