raw_acpi/psdt.rs
1use crate::SDTHeader;
2
3#[derive(Copy, Clone)]
4#[repr(C, packed)]
5/// ## Persistent System Description Table
6///
7/// The table signature, "PSDT" refers to the Persistent System Description Table (PSDT) defined in the ACPI 1.0 specification.
8/// The PSDT was judged to provide no specific benefit and as such has been deleted from follow-on versions of the ACPI specification.
9/// OSPM will evaluate a table with the "PSDT" signature in like manner to the evaluation of an SSDT as described in Section 5.2.11.2
10pub struct PersistentSystemDescriptionTable {
11 /// - **Signature** - "PSDT"
12 pub header: SDTHeader,
13 /// The bytes of AML code.
14 pub def_block: [u8; 0],
15}
16impl PersistentSystemDescriptionTable {
17 pub const fn def_block(&self) -> &[u8] {
18 // SAFETY: I sure hope the OEM doesn't frick things up...
19 unsafe {
20 core::slice::from_raw_parts(
21 (self as *const _ as *const u8).add(crate::SDT_HEADER_SIZE),
22 self.header.length as usize - crate::SDT_HEADER_SIZE,
23 )
24 }
25 }
26}