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_startshould be the physical address of the structure to be mapped.virtual_startshould 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_lengthshould be the number of bytes requested to be mapped. It must be equal to or larger thansize_of::<T>().mapped_lengthshould 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.handlershould be the sameAcpiHandlerthat created the mapping. When thePhysicalMappingis dropped, it will be used to unmap the structure.
§Safety
The caller must ensure that the physical memory can be safely mapped.
pub fn physical_start(&self) -> usize
pub fn virtual_start(&self) -> NonNull<T>
pub fn get(&self) -> Pin<&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 for PhysicalMapping<H, T>where
H: AcpiHandler + Debug,
impl<H, T> Debug for PhysicalMapping<H, T>where
H: AcpiHandler + Debug,
Source§impl<H, T> Deref for PhysicalMapping<H, T>where
T: Unpin,
H: AcpiHandler,
impl<H, T> Deref for PhysicalMapping<H, T>where
T: Unpin,
H: AcpiHandler,
Source§impl<H, T> DerefMut for PhysicalMapping<H, T>where
T: Unpin,
H: AcpiHandler,
impl<H, T> DerefMut for PhysicalMapping<H, T>where
T: Unpin,
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> 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 Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more