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