[][src]Trait acpi::AcpiHandler

pub trait AcpiHandler: Clone {
    pub unsafe fn map_physical_region<T>(
        &self,
        physical_address: usize,
        size: usize
    ) -> PhysicalMapping<Self, T>;
pub fn unmap_physical_region<T>(&self, region: &PhysicalMapping<Self, T>); }

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

pub unsafe fn map_physical_region<T>(
    &self,
    physical_address: usize,
    size: usize
) -> PhysicalMapping<Self, T>
[src]

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.

pub fn unmap_physical_region<T>(&self, region: &PhysicalMapping<Self, T>)[src]

Unmap the given physical mapping. This is called when a PhysicalMapping is dropped.

Loading content...

Implementors

Loading content...