Struct acpi::AcpiTables
source · pub struct AcpiTables<H: AcpiHandler> { /* private fields */ }
Expand description
Type capable of enumerating the existing ACPI tables on the system.
Implementation Note
When using the allocator_api
±alloc
features, PlatformInfo::new()
or PlatformInfo::new_in()
provide
a much cleaner API for enumerating ACPI structures once an AcpiTables
has been constructed.
Implementations§
source§impl<H> AcpiTables<H>where
H: AcpiHandler,
impl<H> AcpiTables<H>where H: AcpiHandler,
sourcepub unsafe fn from_rsdp(handler: H, address: usize) -> AcpiResult<Self>
pub unsafe fn from_rsdp(handler: H, address: usize) -> AcpiResult<Self>
Create an AcpiTables
if you have the physical address of the RSDP.
Safety: Caller must ensure the provided address is valid to read as an RSDP.
sourcepub unsafe fn search_for_rsdp_bios(handler: H) -> AcpiResult<Self>
pub unsafe fn search_for_rsdp_bios(handler: H) -> AcpiResult<Self>
Search for the RSDP on a BIOS platform. This accesses BIOS-specific memory locations and will probably not work on UEFI platforms. See Rsdp::search_for_rsdp_bios for details.
sourcepub unsafe fn from_validated_rsdp(
handler: H,
rsdp_mapping: PhysicalMapping<H, Rsdp>
) -> AcpiResult<Self>
pub unsafe fn from_validated_rsdp( handler: H, rsdp_mapping: PhysicalMapping<H, Rsdp> ) -> AcpiResult<Self>
Create an AcpiTables
if you have a PhysicalMapping
of the RSDP that you know is correct. This is called
from from_rsdp
after validation, but can also be used if you’ve searched for the RSDP manually on a BIOS
system.
Safety: Caller must ensure that the provided mapping is a fully validated RSDP.
sourcepub const fn revision(&self) -> u8
pub const fn revision(&self) -> u8
The ACPI revision of the tables enumerated by this structure.
sourcepub fn find_table<T: AcpiTable>(&self) -> AcpiResult<PhysicalMapping<H, T>>
pub fn find_table<T: AcpiTable>(&self) -> AcpiResult<PhysicalMapping<H, T>>
Searches through the ACPI table headers and attempts to locate the table with a matching T::SIGNATURE
.
sourcepub fn dsdt(&self) -> AcpiResult<AmlTable>
pub fn dsdt(&self) -> AcpiResult<AmlTable>
Finds and returns the DSDT AML table, if it exists.
sourcepub fn ssdts(&self) -> SsdtIterator<'_, H> ⓘ
pub fn ssdts(&self) -> SsdtIterator<'_, H> ⓘ
Iterates through all of the SSDT tables.
sourcepub fn platform_info(&self) -> AcpiResult<PlatformInfo<'_, Global>>
pub fn platform_info(&self) -> AcpiResult<PlatformInfo<'_, Global>>
Convenience method for contructing a PlatformInfo
. This is one of the
first things you should usually do with an AcpiTables
, and allows to collect helpful information about
the platform from the ACPI tables.
Like platform_info_in
, but uses the global allocator.
sourcepub fn platform_info_in<A>(
&self,
allocator: A
) -> AcpiResult<PlatformInfo<'_, A>>where
A: Allocator + Clone,
pub fn platform_info_in<A>( &self, allocator: A ) -> AcpiResult<PlatformInfo<'_, A>>where A: Allocator + Clone,
Convenience method for contructing a PlatformInfo
. This is one of the
first things you should usually do with an AcpiTables
, and allows to collect helpful information about
the platform from the ACPI tables.