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

pub fn physical_start(&self) -> usize

source

pub fn virtual_start(&self) -> NonNull<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> 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 H: AcpiHandler,

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

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

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.