[−][src]Trait rsdp::handler::AcpiHandler
An implementation of this trait must be provided to allow acpi
to access platform-specific
functionality, such as mapping regions of physical memory. You are free to implement these
however you please, as long as they conform to the documentation of each function. The handler is stored in
every PhysicalMapping
so it's able to unmap itself when dropped, so this type needs to be something you can
clone/move about freely (e.g. a reference, wrapper over Rc
, marker struct, etc.).
Required methods
unsafe fn map_physical_region<T>(
&self,
physical_address: usize,
size: usize
) -> PhysicalMapping<Self, T>
&self,
physical_address: usize,
size: usize
) -> PhysicalMapping<Self, T>
Given a physical address and a size, map a region of physical memory that contains T
(note: the passed
size may be larger than size_of::<T>()
). The address is not neccessarily page-aligned, so the
implementation may need to map more than size
bytes. The virtual address the region is mapped to does not
matter, as long as it is accessible to acpi
.
fn unmap_physical_region<T>(&self, region: &PhysicalMapping<Self, T>)
Unmap the given physical mapping. This is called when a PhysicalMapping
is dropped.