PhysicalMapping

Struct PhysicalMapping 

Source
pub struct PhysicalMapping<H, T>
where H: AcpiHandler,
{ /* private fields */ }
Expand description

Describes a physical mapping created by AcpiHandler::map_physical_region and unmapped by AcpiHandler::unmap_physical_region. The region mapped must be at least size_of::<T>() bytes, but may be bigger.

See PhysicalMapping::new for the meaning of each field.

Implementations§

Source§

impl<H, T> PhysicalMapping<H, T>
where H: AcpiHandler,

Source

pub unsafe fn new( physical_start: usize, virtual_start: NonNull<T>, region_length: usize, mapped_length: usize, handler: H, ) -> Self

Construct a new PhysicalMapping.

  • physical_start should be the physical address of the structure to be mapped.
  • virtual_start should be the corresponding virtual address of that structure. It may differ from the start of the region mapped due to requirements of the paging system. It must be a valid, non-null pointer.
  • region_length should be the number of bytes requested to be mapped. It must be equal to or larger than size_of::<T>().
  • mapped_length should be the number of bytes mapped to fulfill the request. It may be equal to or larger than region_length, due to requirements of the paging system or other reasoning.
  • handler should be the same AcpiHandler that created the mapping. When the PhysicalMapping is dropped, it will be used to unmap the structure.
§Safety

The caller must ensure that the physical memory can be safely mapped.

Source

pub fn physical_start(&self) -> usize

Source

pub fn virtual_start(&self) -> NonNull<T>

Source

pub fn get(&self) -> Pin<&T>

Source

pub fn region_length(&self) -> usize

Source

pub fn mapped_length(&self) -> usize

Source

pub fn handler(&self) -> &H

Trait Implementations§

Source§

impl<H, T> Debug for PhysicalMapping<H, T>
where H: AcpiHandler + Debug,

Source§

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

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

impl<H, T> Deref for PhysicalMapping<H, T>
where T: Unpin, H: AcpiHandler,

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &T

Dereferences the value.
Source§

impl<H, T> DerefMut for PhysicalMapping<H, T>
where T: Unpin, H: AcpiHandler,

Source§

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

Mutably dereferences the value.
Source§

impl<H, T> Drop for PhysicalMapping<H, T>
where H: AcpiHandler,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<H: AcpiHandler + Send, T: Send> Send for PhysicalMapping<H, T>

Auto Trait Implementations§

§

impl<H, T> Freeze for PhysicalMapping<H, T>
where H: Freeze,

§

impl<H, T> RefUnwindSafe for PhysicalMapping<H, T>
where H: RefUnwindSafe, T: RefUnwindSafe,

§

impl<H, T> !Sync for PhysicalMapping<H, T>

§

impl<H, T> Unpin for PhysicalMapping<H, T>
where H: Unpin,

§

impl<H, T> UnwindSafe for PhysicalMapping<H, T>
where H: UnwindSafe, T: RefUnwindSafe,

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> 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
§

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.