AcpiTable

Trait AcpiTable 

Source
pub unsafe trait AcpiTable {
    const SIGNATURE: Signature;

    // Required method
    fn header(&self) -> &SdtHeader;

    // Provided method
    fn validate(&self) -> AcpiResult<()> { ... }
}
Expand description

All types representing ACPI tables should implement this trait.

§Safety

The table’s memory is naively interpreted, so you must be careful in providing a type that correctly represents the table’s structure. Regardless of the provided type’s size, the region mapped will be the size specified in the SDT’s header. Providing a table impl that is larger than this, may lead to page-faults, aliasing references, or derefencing uninitialized memory (the latter two being UB). This isn’t forbidden, however, because some tables rely on the impl being larger than a provided SDT in some versions of ACPI (the ExtendedField type will be useful if you need to do this. See our Fadt type for an example of this).

Required Associated Constants§

Required Methods§

Source

fn header(&self) -> &SdtHeader

Provided Methods§

Source

fn validate(&self) -> AcpiResult<()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl AcpiTable for Bgrt

§Safety: Implementation properly represents a valid BGRT.
Source§

const SIGNATURE: Signature = Signature::BGRT

Source§

impl AcpiTable for Fadt

§Safety: Implementation properly represents a valid FADT.
Source§

const SIGNATURE: Signature = Signature::FADT

Source§

impl AcpiTable for HpetTable

§Safety: Implementation properly represents a valid HPET table.
Source§

const SIGNATURE: Signature = Signature::HPET

Source§

impl AcpiTable for Madt

§Safety: Implementation properly represents a valid MADT.
Source§

const SIGNATURE: Signature = Signature::MADT

Source§

impl AcpiTable for Mcfg

§Safety: Implementation properly represents a valid MCFG.
Source§

const SIGNATURE: Signature = Signature::MCFG

Source§

impl AcpiTable for Spcr

Source§

const SIGNATURE: Signature = Signature::SPCR