Vmm

Struct Vmm 

Source
pub struct Vmm<'m, M: PhysMapper, A: FrameAlloc> {
    aspace: AddressSpace<'m, M>,
    alloc: &'m mut A,
}
Expand description

Minimal kernel virtual memory manager.

Fields§

§aspace: AddressSpace<'m, M>§alloc: &'m mut A

Implementations§

Source§

impl<'m, M: PhysMapper, A: FrameAlloc> Vmm<'m, M, A>

Source

pub unsafe fn from_current(mapper: &'m M, alloc: &'m mut A) -> Self

§Safety
  • Must run at CPL0 with paging enabled.
  • Assumes CR3 points at a valid PML4 frame.
Source

pub fn map_region( &mut self, va: VirtualAddress, pa: PhysicalAddress, len: u64, nonleaf: VirtualMemoryPageBits, leaf: VirtualMemoryPageBits, ) -> Result<(), AddressSpaceMapRegionError>

§Errors

Allocation fails, e.g. due to OOM.

Source

pub fn unmap_region(&mut self, va: VirtualAddress, len: u64)

Source

pub fn query(&self, va: VirtualAddress) -> Option<PhysicalAddress>

Auto Trait Implementations§

§

impl<'m, M, A> Freeze for Vmm<'m, M, A>

§

impl<'m, M, A> RefUnwindSafe for Vmm<'m, M, A>

§

impl<'m, M, A> Send for Vmm<'m, M, A>
where A: Send, M: Sync,

§

impl<'m, M, A> Sync for Vmm<'m, M, A>
where A: Sync, M: Sync,

§

impl<'m, M, A> Unpin for Vmm<'m, M, A>

§

impl<'m, M, A> !UnwindSafe for Vmm<'m, M, A>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.