Struct acpi::handler::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,
impl<H, T> PhysicalMapping<H, T>where H: AcpiHandler,
sourcepub unsafe fn new(
physical_start: usize,
virtual_start: NonNull<T>,
region_length: usize,
mapped_length: usize,
handler: H
) -> Self
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 thansize_of::<T>()
.mapped_length
should be the number of bytes mapped to fulfill the request. It may be equal to or larger thanregion_length
, due to requirements of the paging system or other reasoning.handler
should be the sameAcpiHandler
that created the mapping. When thePhysicalMapping
is dropped, it will be used to unmap the structure.
pub fn physical_start(&self) -> usize
pub fn virtual_start(&self) -> NonNull<T>
pub fn region_length(&self) -> usize
pub fn mapped_length(&self) -> usize
pub fn handler(&self) -> &H
Trait Implementations§
source§impl<H, T: Debug> Debug for PhysicalMapping<H, T>where
H: AcpiHandler + Debug,
impl<H, T: Debug> Debug for PhysicalMapping<H, T>where H: AcpiHandler + Debug,
source§impl<H, T> Deref for PhysicalMapping<H, T>where
H: AcpiHandler,
impl<H, T> Deref for PhysicalMapping<H, T>where H: AcpiHandler,
source§impl<H, T> Drop for PhysicalMapping<H, T>where
H: AcpiHandler,
impl<H, T> Drop for PhysicalMapping<H, T>where H: AcpiHandler,
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more