Struct VirtualMemoryMap

Source
pub struct VirtualMemoryMap {
    pub pmarea: MemoryArea,
    pub vmarea: MemoryArea,
    pub permissions: usize,
    pub is_shared: bool,
}
Expand description

Represents a mapping between physical and virtual memory areas.

This structure defines the relationship between a physical memory area and its corresponding virtual memory area in the kernel’s memory management system.

§Fields

  • pmarea - The physical memory area that is being mapped
  • vmarea - The virtual memory area where the physical memory is mapped to

Fields§

§pmarea: MemoryArea§vmarea: MemoryArea§permissions: usize§is_shared: bool

Implementations§

Source§

impl VirtualMemoryMap

Source

pub fn new( pmarea: MemoryArea, vmarea: MemoryArea, permissions: usize, is_shared: bool, ) -> Self

Creates a new virtual memory map with the given physical and virtual memory areas.

§Arguments
  • pmarea - The physical memory area to map
  • vmarea - The virtual memory area to map to
  • permissions - The permissions to set for the virtual memory area
  • is_shared - Whether this memory map should be shared between tasks
§Returns

A new virtual memory map with the given physical and virtual memory areas.

Source

pub fn get_paddr(&self, vaddr: usize) -> Option<usize>

Returns the physical address corresponding to the given virtual address.

§Arguments
  • vaddr - The virtual address to translate
§Returns

The physical address corresponding to the given virtual address, if it exists. If the virtual address is not part of the memory map, None is returned.

Trait Implementations§

Source§

impl Clone for VirtualMemoryMap

Source§

fn clone(&self) -> VirtualMemoryMap

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VirtualMemoryMap

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for VirtualMemoryMap

Source§

fn eq(&self, other: &VirtualMemoryMap) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for VirtualMemoryMap

Source§

impl StructuralPartialEq for VirtualMemoryMap

Auto Trait Implementations§

§

impl Freeze for VirtualMemoryMap

§

impl RefUnwindSafe for VirtualMemoryMap

§

impl Send for VirtualMemoryMap

§

impl Sync for VirtualMemoryMap

§

impl Unpin for VirtualMemoryMap

§

impl UnwindSafe for VirtualMemoryMap

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where 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>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where 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>

Performs the conversion.