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,

source

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.
source

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.

source

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.
source

pub const fn revision(&self) -> u8

The ACPI revision of the tables enumerated by this structure.

source

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.

source

pub fn dsdt(&self) -> AcpiResult<AmlTable>

Finds and returns the DSDT AML table, if it exists.

source

pub fn ssdts(&self) -> SsdtIterator<'_, H>

Iterates through all of the SSDT tables.

source

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.

source

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.

Trait Implementations§

source§

impl<H: Debug + AcpiHandler> Debug for AcpiTables<H>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<H> RefUnwindSafe for AcpiTables<H>where H: RefUnwindSafe,

§

impl<H> Send for AcpiTables<H>where H: Send,

§

impl<H> !Sync for AcpiTables<H>

§

impl<H> Unpin for AcpiTables<H>where H: Unpin,

§

impl<H> UnwindSafe for AcpiTables<H>where H: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.