Skip to main content

acpi_lite/
structures.rs

1// Copyright 2026 The Fuchsia Authors
2//
3// Use of this source code is governed by a MIT-style
4// license that can be found in the LICENSE file or at
5// https://opensource.org/licenses/MIT
6
7use core::fmt;
8
9// First byte and length of the x86 BIOS read-only area, [0xe0'000, 0xff'fff].
10//
11// Reference: ACPI v6.3, Section 5.2.5.1
12pub const K_BIOS_READ_ONLY_AREA_START: usize = 0xe0_000;
13pub const K_BIOS_READ_ONLY_AREA_LENGTH: usize = 0x20_000;
14
15#[derive(
16    Copy,
17    Clone,
18    Eq,
19    PartialEq,
20    zerocopy::FromBytes,
21    zerocopy::Unaligned,
22    zerocopy::Immutable,
23    zerocopy::KnownLayout,
24    zerocopy::IntoBytes,
25)]
26#[repr(transparent)]
27// ACPI signature.
28//
29// Signatures are 4 byte ASCII strings. We represent them as an array of bytes.
30pub struct AcpiSignature(pub [u8; AcpiSignature::K_ASCII_LENGTH]);
31
32impl AcpiSignature {
33    // Length of the signature when represented as ASCII.
34    pub const K_ASCII_LENGTH: usize = 4;
35
36    pub const fn new(name: &[u8; Self::K_ASCII_LENGTH]) -> Self {
37        Self(*name)
38    }
39
40    // Write the signature into the given buffer.
41    //
42    // Buffer must have a length of at least 5.
43    pub fn write_to_buffer(&self, buffer: &mut [u8]) {
44        assert!(buffer.len() > Self::K_ASCII_LENGTH);
45        buffer[..Self::K_ASCII_LENGTH].copy_from_slice(&self.0);
46        buffer[Self::K_ASCII_LENGTH] = 0;
47    }
48}
49
50impl fmt::Debug for AcpiSignature {
51    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
52        if let Ok(s) = core::str::from_utf8(&self.0) {
53            write!(f, "AcpiSignature({})", s)
54        } else {
55            write!(f, "AcpiSignature({:?})", self.0)
56        }
57    }
58}
59
60pub trait VariableSized {
61    fn size(&self) -> usize;
62}
63
64#[derive(
65    Copy,
66    Clone,
67    zerocopy::FromBytes,
68    zerocopy::Unaligned,
69    zerocopy::Immutable,
70    zerocopy::KnownLayout,
71    zerocopy::IntoBytes,
72)]
73#[repr(C, packed)]
74// Root System Description Pointer (RSDP)
75//
76// Reference: ACPI v6.3 Section 5.2.5.3.
77pub struct AcpiRsdp {
78    pub sig1: AcpiSignature, // "RSD "
79    pub sig2: AcpiSignature, // "PTR "
80    pub checksum: u8,
81    pub oemid: [u8; 6],
82    pub revision: u8,
83    pub rsdt_address: u32,
84}
85
86impl AcpiRsdp {
87    pub const K_SIGNATURE1: AcpiSignature = AcpiSignature(*b"RSD ");
88    pub const K_SIGNATURE2: AcpiSignature = AcpiSignature(*b"PTR ");
89}
90
91#[derive(
92    Copy,
93    Clone,
94    zerocopy::FromBytes,
95    zerocopy::Unaligned,
96    zerocopy::Immutable,
97    zerocopy::KnownLayout,
98    zerocopy::IntoBytes,
99)]
100#[repr(C, packed)]
101pub struct AcpiRsdpV2 {
102    pub v1: AcpiRsdp,
103    pub length: u32,
104    pub xsdt_address: u64,
105    pub extended_checksum: u8,
106    pub reserved: [u8; 3],
107}
108
109impl VariableSized for AcpiRsdpV2 {
110    fn size(&self) -> usize {
111        self.length as usize
112    }
113}
114
115#[derive(
116    Copy,
117    Clone,
118    Debug,
119    zerocopy::FromBytes,
120    zerocopy::Unaligned,
121    zerocopy::Immutable,
122    zerocopy::KnownLayout,
123    zerocopy::IntoBytes,
124)]
125#[repr(C, packed)]
126// Standard system description table header, used as the header of
127// multiple structures below.
128//
129// Reference: ACPI v6.3 Section 5.2.6.
130pub struct AcpiSdtHeader {
131    pub sig: AcpiSignature,
132    pub length: u32,
133    pub revision: u8,
134    pub checksum: u8,
135    pub oemid: [u8; 6],
136    pub oem_table_id: [u8; 8],
137    pub oem_revision: u32,
138    pub creator_id: u32,
139    pub creator_revision: u32,
140}
141
142impl VariableSized for AcpiSdtHeader {
143    fn size(&self) -> usize {
144        self.length as usize
145    }
146}
147
148#[derive(
149    Copy,
150    Clone,
151    zerocopy::FromBytes,
152    zerocopy::Unaligned,
153    zerocopy::Immutable,
154    zerocopy::KnownLayout,
155    zerocopy::IntoBytes,
156)]
157#[repr(C, packed)]
158// Root System Description Table (RSDT)
159//
160// Reference: ACPI v6.3 Section 5.2.7.
161pub struct AcpiRsdt {
162    pub header: AcpiSdtHeader,
163}
164
165impl AcpiRsdt {
166    pub const K_SIGNATURE: AcpiSignature = AcpiSignature(*b"RSDT");
167
168    /// # Safety
169    /// The caller must ensure that `index` is within the bounds of the table
170    /// payload (which is determined by the table length in the header).
171    pub unsafe fn get_entry(&self, index: usize) -> u32 {
172        let self_size = core::mem::size_of::<AcpiSdtHeader>();
173        // SAFETY: The caller guarantees `index` is within bounds. The pointer
174        // arithmetic is safe as it stays within the allocated table memory.
175        // We use read_unaligned because the entry might not be aligned.
176        unsafe {
177            let ptr = (self as *const Self as *const u8).add(self_size) as *const u32;
178            let entry_ptr = ptr.add(index);
179            core::ptr::read_unaligned(entry_ptr)
180        }
181    }
182}
183
184impl VariableSized for AcpiRsdt {
185    fn size(&self) -> usize {
186        self.header.size()
187    }
188}
189
190#[derive(
191    Copy,
192    Clone,
193    zerocopy::FromBytes,
194    zerocopy::Unaligned,
195    zerocopy::Immutable,
196    zerocopy::KnownLayout,
197    zerocopy::IntoBytes,
198)]
199#[repr(C, packed)]
200// Extended System Description Table (XSDT)
201//
202// Reference: ACPI v6.3 Section 5.2.8.
203pub struct AcpiXsdt {
204    pub header: AcpiSdtHeader,
205}
206
207impl AcpiXsdt {
208    pub const K_SIGNATURE: AcpiSignature = AcpiSignature(*b"XSDT");
209
210    /// # Safety
211    /// The caller must ensure that `index` is within the bounds of the table
212    /// payload (which is determined by the table length in the header).
213    pub unsafe fn get_entry(&self, index: usize) -> u64 {
214        let self_size = core::mem::size_of::<AcpiSdtHeader>();
215        // SAFETY: The caller guarantees `index` is within bounds. The pointer
216        // arithmetic is safe as it stays within the allocated table memory.
217        // We use read_unaligned because the entry might not be aligned.
218        unsafe {
219            let ptr = (self as *const Self as *const u8).add(self_size) as *const u64;
220            let entry_ptr = ptr.add(index);
221            core::ptr::read_unaligned(entry_ptr)
222        }
223    }
224}
225
226impl VariableSized for AcpiXsdt {
227    fn size(&self) -> usize {
228        self.header.size()
229    }
230}
231
232#[derive(
233    Copy,
234    Clone,
235    Debug,
236    zerocopy::FromBytes,
237    zerocopy::Unaligned,
238    zerocopy::Immutable,
239    zerocopy::KnownLayout,
240    zerocopy::IntoBytes,
241)]
242#[repr(C, packed)]
243// ACPI Generic Address
244//
245// Reference: ACPI v6.3 Section 5.2.3.2
246pub struct AcpiGenericAddress {
247    pub address_space_id: u8,
248    pub register_bit_width: u8,
249    pub register_bit_offset: u8,
250    pub access_size: u8,
251    pub address: u64,
252}
253
254pub const ACPI_ADDR_SPACE_MEMORY: u8 = 0;
255pub const ACPI_ADDR_SPACE_IO: u8 = 1;
256
257#[derive(
258    Copy,
259    Clone,
260    zerocopy::FromBytes,
261    zerocopy::Unaligned,
262    zerocopy::Immutable,
263    zerocopy::KnownLayout,
264    zerocopy::IntoBytes,
265)]
266#[repr(C, packed)]
267// Fixed ACPI Description Table
268//
269// Reference: ACPI v6.3 Section 5.2.9.
270pub struct AcpiFadt {
271    pub header: AcpiSdtHeader,
272    pub firmware_ctrl: u32,
273    pub dsdt: u32,
274    pub _reserved: u8,
275    pub preferred_pm_profile: u8,
276    pub sci_int: u16,
277    pub smi_cmd: u32,
278    pub acpi_enable: u8,
279    pub acpi_disable: u8,
280    pub s4bios_req: u8,
281    pub pstate_cnt: u8,
282    pub pm1a_evt_blk: u32,
283    pub pm1b_evt_blk: u32,
284    pub pm1a_cnt_blk: u32,
285    pub pm1b_cnt_blk: u32,
286    pub pm2_cnt_blk: u32,
287    pub pm_tmr_blk: u32,
288    pub gpe0_blk: u32,
289    pub gpe1_blk: u32,
290    pub pm1_evt_len: u8,
291    pub pm1_cnt_len: u8,
292    pub pm2_cnt_len: u8,
293    pub pm_tmr_len: u8,
294    pub gpe0_blk_len: u8,
295    pub gpe1_blk_len: u8,
296    pub gpe1_base: u8,
297    pub cst_cnt: u8,
298    pub p_lvl2_lat: u16,
299    pub p_lvl3_lat: u16,
300    pub flush_size: u16,
301    pub flush_stride: u16,
302    pub duty_offset: u8,
303    pub duty_width: u8,
304    pub day_alrm: u8,
305    pub mon_alrm: u8,
306    pub century: u8,
307    pub iapc_boot_arch: u16,
308    pub _reserved2: u8,
309    pub flags: u32,
310    pub reset_reg: AcpiGenericAddress,
311    pub reset_value: u8,
312    pub arm_boot_arch: u16,
313    pub fadt_minor_version: u8,
314    pub x_firmware_ctrl: u64,
315    pub x_dsdt: u64,
316    pub x_pm1a_evt_blk: AcpiGenericAddress,
317    pub x_pm1b_evt_blk: AcpiGenericAddress,
318    pub x_pm1a_cnt_blk: AcpiGenericAddress,
319    pub x_pm1b_cnt_blk: AcpiGenericAddress,
320    pub x_pm2_cnt_blk: AcpiGenericAddress,
321    pub x_pm_tmr_blk: AcpiGenericAddress,
322    pub x_gpe0_blk: AcpiGenericAddress,
323    pub x_gpe1_blk: AcpiGenericAddress,
324}
325
326impl AcpiFadt {
327    pub const K_SIGNATURE: AcpiSignature = AcpiSignature(*b"FACP");
328}
329
330impl VariableSized for AcpiFadt {
331    fn size(&self) -> usize {
332        self.header.size()
333    }
334}
335
336#[derive(
337    Copy,
338    Clone,
339    zerocopy::FromBytes,
340    zerocopy::Unaligned,
341    zerocopy::Immutable,
342    zerocopy::KnownLayout,
343    zerocopy::IntoBytes,
344)]
345#[repr(C, packed)]
346// Firmware ACPI Control Structure
347//
348// Reference: ACPI v6.3 Section 5.2.10.
349pub struct AcpiFacs {
350    pub sig: AcpiSignature,
351    pub length: u32,
352    pub hardware_signature: u32,
353    pub firmware_waking_vector: u32,
354    pub global_lock: u32,
355    pub flags: u32,
356    pub x_firmware_waking_vector: u64,
357    pub version: u8,
358    pub _reserved: [u8; 3],
359    pub ospm_flags: u32,
360    pub _reserved2: [u8; 24],
361}
362
363impl AcpiFacs {
364    pub const K_SIGNATURE: AcpiSignature = AcpiSignature(*b"FACS");
365}
366
367impl VariableSized for AcpiFacs {
368    fn size(&self) -> usize {
369        self.length as usize
370    }
371}
372
373#[derive(
374    Copy,
375    Clone,
376    zerocopy::FromBytes,
377    zerocopy::Unaligned,
378    zerocopy::Immutable,
379    zerocopy::KnownLayout,
380    zerocopy::IntoBytes,
381)]
382#[repr(C, packed)]
383// Multiple APIC Description Table
384//
385// The table is followed by interrupt control structures, each with
386// a "AcpiSubTableHeader" header.
387//
388// Reference: ACPI v6.3 5.2.12.
389pub struct AcpiMadtTable {
390    pub header: AcpiSdtHeader,
391    pub local_int_controller_address: u32,
392    pub flags: u32,
393}
394
395impl AcpiMadtTable {
396    pub const K_SIGNATURE: AcpiSignature = AcpiSignature(*b"APIC");
397}
398
399impl VariableSized for AcpiMadtTable {
400    fn size(&self) -> usize {
401        self.header.size()
402    }
403}
404
405#[derive(
406    Copy,
407    Clone,
408    zerocopy::FromBytes,
409    zerocopy::Unaligned,
410    zerocopy::Immutable,
411    zerocopy::KnownLayout,
412    zerocopy::IntoBytes,
413)]
414#[repr(C, packed)]
415pub struct AcpiSubTableHeader {
416    pub r#type: u8,
417    pub length: u8,
418}
419
420impl VariableSized for AcpiSubTableHeader {
421    fn size(&self) -> usize {
422        self.length as usize
423    }
424}
425
426#[derive(
427    Copy,
428    Clone,
429    zerocopy::FromBytes,
430    zerocopy::Unaligned,
431    zerocopy::Immutable,
432    zerocopy::KnownLayout,
433    zerocopy::IntoBytes,
434)]
435#[repr(C, packed)]
436// High Precision Event Timer Table
437//
438// Reference: IA-PC HPET (High Precision Event Timers) v1.0a, Section 3.2.4.
439pub struct AcpiHpetTable {
440    pub header: AcpiSdtHeader,
441    pub id: u32,
442    pub address: AcpiGenericAddress,
443    pub sequence: u8,
444    pub minimum_tick: u16,
445    pub flags: u8,
446}
447
448impl AcpiHpetTable {
449    pub const K_SIGNATURE: AcpiSignature = AcpiSignature(*b"HPET");
450}
451
452impl VariableSized for AcpiHpetTable {
453    fn size(&self) -> usize {
454        self.header.size()
455    }
456}
457
458#[derive(
459    Copy,
460    Clone,
461    zerocopy::FromBytes,
462    zerocopy::Unaligned,
463    zerocopy::Immutable,
464    zerocopy::KnownLayout,
465    zerocopy::IntoBytes,
466)]
467#[repr(C, packed)]
468// SRAT table and descriptors.
469//
470// Reference: ACPI v6.3 Section 5.2.16.
471pub struct AcpiSratTable {
472    pub header: AcpiSdtHeader,
473    pub _reserved: u32,
474    pub _reserved2: u64,
475}
476
477impl AcpiSratTable {
478    pub const K_SIGNATURE: AcpiSignature = AcpiSignature(*b"SRAT");
479}
480
481impl VariableSized for AcpiSratTable {
482    fn size(&self) -> usize {
483        self.header.size()
484    }
485}
486
487pub const ACPI_SRAT_TYPE_PROCESSOR_AFFINITY: u8 = 0;
488
489#[derive(
490    Copy,
491    Clone,
492    zerocopy::FromBytes,
493    zerocopy::Unaligned,
494    zerocopy::Immutable,
495    zerocopy::KnownLayout,
496    zerocopy::IntoBytes,
497)]
498#[repr(C, packed)]
499// Type 0: processor local apic/sapic affinity structure
500//
501// Reference: ACPI v6.3 Section 5.2.16.1.
502pub struct AcpiSratProcessorAffinityEntry {
503    pub header: AcpiSubTableHeader,
504    pub proximity_domain_low: u8,
505    pub apic_id: u8,
506    pub flags: u32,
507    pub sapic_eid: u8,
508    pub proximity_domain_high: [u8; 3],
509    pub clock_domain: u32,
510}
511
512impl AcpiSratProcessorAffinityEntry {
513    pub fn proximity_domain(&self) -> u32 {
514        let low = self.proximity_domain_low as u32;
515        let high0 = self.proximity_domain_high[0] as u32;
516        let high1 = self.proximity_domain_high[1] as u32;
517        let high2 = self.proximity_domain_high[2] as u32;
518        low | (high0 << 8) | (high1 << 16) | (high2 << 24)
519    }
520}
521
522impl VariableSized for AcpiSratProcessorAffinityEntry {
523    fn size(&self) -> usize {
524        self.header.size()
525    }
526}
527
528pub const ACPI_SRAT_FLAG_ENABLED: u32 = 1;
529
530pub const ACPI_SRAT_TYPE_MEMORY_AFFINITY: u8 = 1;
531
532#[derive(
533    Copy,
534    Clone,
535    zerocopy::FromBytes,
536    zerocopy::Unaligned,
537    zerocopy::Immutable,
538    zerocopy::KnownLayout,
539    zerocopy::IntoBytes,
540)]
541#[repr(C, packed)]
542// Type 1: memory affinity structure
543//
544// Reference: ACPI v6.3 Section 5.2.16.2.
545pub struct AcpiSratMemoryAffinityEntry {
546    pub header: AcpiSubTableHeader,
547    pub proximity_domain: u32,
548    pub _reserved: u16,
549    pub base_address_low: u32,
550    pub base_address_high: u32,
551    pub length_low: u32,
552    pub length_high: u32,
553    pub _reserved2: u32,
554    pub flags: u32,
555    pub _reserved3: u32,
556    pub _reserved4: u32,
557}
558
559impl VariableSized for AcpiSratMemoryAffinityEntry {
560    fn size(&self) -> usize {
561        self.header.size()
562    }
563}
564
565pub const ACPI_SRAT_TYPE_PROCESSOR_X2APIC_AFFINITY: u8 = 2;
566
567#[derive(
568    Copy,
569    Clone,
570    zerocopy::FromBytes,
571    zerocopy::Unaligned,
572    zerocopy::Immutable,
573    zerocopy::KnownLayout,
574    zerocopy::IntoBytes,
575)]
576#[repr(C, packed)]
577// Type 2: processor x2apic affinity structure
578//
579// Reference: ACPI v6.3 Section 5.2.16.3.
580pub struct AcpiSratProcessorX2ApicAffinityEntry {
581    pub header: AcpiSubTableHeader,
582    pub _reserved: u16,
583    pub proximity_domain: u32,
584    pub x2apic_id: u32,
585    pub flags: u32,
586    pub clock_domain: u32,
587    pub _reserved2: u32,
588}
589
590impl VariableSized for AcpiSratProcessorX2ApicAffinityEntry {
591    fn size(&self) -> usize {
592        self.header.size()
593    }
594}
595
596pub const ACPI_MADT_TYPE_LOCAL_APIC: u8 = 0;
597
598#[derive(
599    Copy,
600    Clone,
601    zerocopy::FromBytes,
602    zerocopy::Unaligned,
603    zerocopy::Immutable,
604    zerocopy::KnownLayout,
605    zerocopy::IntoBytes,
606)]
607#[repr(C, packed)]
608// MADT entry type 0: Processor Local APIC (ACPI v6.3 Section 5.2.12.2)
609pub struct AcpiMadtLocalApicEntry {
610    pub header: AcpiSubTableHeader,
611    pub processor_id: u8,
612    pub apic_id: u8,
613    pub flags: u32,
614}
615
616impl VariableSized for AcpiMadtLocalApicEntry {
617    fn size(&self) -> usize {
618        self.header.size()
619    }
620}
621
622pub const ACPI_MADT_FLAG_ENABLED: u32 = 0x1;
623
624pub const ACPI_MADT_TYPE_IO_APIC: u8 = 1;
625
626#[derive(
627    Copy,
628    Clone,
629    zerocopy::FromBytes,
630    zerocopy::Unaligned,
631    zerocopy::Immutable,
632    zerocopy::KnownLayout,
633    zerocopy::IntoBytes,
634)]
635#[repr(C, packed)]
636// MADT entry type 1: I/O APIC (ACPI v6.3 Section 5.2.12.3)
637pub struct AcpiMadtIoApicEntry {
638    pub header: AcpiSubTableHeader,
639    pub io_apic_id: u8,
640    pub reserved: u8,
641    pub io_apic_address: u32,
642    pub global_system_interrupt_base: u32,
643}
644
645impl VariableSized for AcpiMadtIoApicEntry {
646    fn size(&self) -> usize {
647        self.header.size()
648    }
649}
650
651pub const ACPI_MADT_TYPE_INT_SOURCE_OVERRIDE: u8 = 2;
652
653#[derive(
654    Copy,
655    Clone,
656    zerocopy::FromBytes,
657    zerocopy::Unaligned,
658    zerocopy::Immutable,
659    zerocopy::KnownLayout,
660    zerocopy::IntoBytes,
661)]
662#[repr(C, packed)]
663// MADT entry type 2: Interrupt Source Override (ACPI v6.3 Section 5.2.12.5)
664pub struct AcpiMadtIntSourceOverrideEntry {
665    pub header: AcpiSubTableHeader,
666    pub bus: u8,
667    pub source: u8,
668    pub global_sys_interrupt: u32,
669    pub flags: u16,
670}
671
672impl VariableSized for AcpiMadtIntSourceOverrideEntry {
673    fn size(&self) -> usize {
674        self.header.size()
675    }
676}
677
678pub const ACPI_MADT_FLAG_POLARITY_CONFORMS: u16 = 0b00;
679pub const ACPI_MADT_FLAG_POLARITY_HIGH: u16 = 0b01;
680pub const ACPI_MADT_FLAG_POLARITY_LOW: u16 = 0b11;
681pub const ACPI_MADT_FLAG_POLARITY_MASK: u16 = 0b11;
682
683pub const ACPI_MADT_FLAG_TRIGGER_CONFORMS: u16 = 0b0000;
684pub const ACPI_MADT_FLAG_TRIGGER_EDGE: u16 = 0b0100;
685pub const ACPI_MADT_FLAG_TRIGGER_LEVEL: u16 = 0b1100;
686pub const ACPI_MADT_FLAG_TRIGGER_MASK: u16 = 0b1100;
687
688#[derive(
689    Copy,
690    Clone,
691    zerocopy::FromBytes,
692    zerocopy::Unaligned,
693    zerocopy::Immutable,
694    zerocopy::KnownLayout,
695    zerocopy::IntoBytes,
696)]
697#[repr(C, packed)]
698// DBG2 table
699pub struct AcpiDbg2Table {
700    pub header: AcpiSdtHeader,
701    pub offset: u32,
702    pub num_entries: u32,
703}
704
705impl AcpiDbg2Table {
706    pub const K_SIGNATURE: AcpiSignature = AcpiSignature(*b"DBG2");
707}
708
709impl VariableSized for AcpiDbg2Table {
710    fn size(&self) -> usize {
711        self.header.size()
712    }
713}
714
715#[derive(
716    Copy,
717    Clone,
718    zerocopy::FromBytes,
719    zerocopy::Unaligned,
720    zerocopy::Immutable,
721    zerocopy::KnownLayout,
722    zerocopy::IntoBytes,
723)]
724#[repr(C, packed)]
725// DBG2 device information
726pub struct AcpiDbg2Device {
727    pub revision: u8,
728    pub length: u16,
729    pub register_count: u8,
730    pub namepath_length: u16,
731    pub namepath_offset: u16,
732    pub oem_data_length: u16,
733    pub oem_data_offset: u16,
734    pub port_type: u16,
735    pub port_subtype: u16,
736    pub reserved: u16,
737    pub base_address_offset: u16,
738    pub address_size_offset: u16,
739}
740
741impl VariableSized for AcpiDbg2Device {
742    fn size(&self) -> usize {
743        self.length as usize
744    }
745}
746
747// debug port types
748pub const ACPI_DBG2_TYPE_SERIAL_PORT: u16 = 0x8000;
749pub const ACPI_DBG2_TYPE_1394_PORT: u16 = 0x8001;
750pub const ACPI_DBG2_TYPE_USB_PORT: u16 = 0x8002;
751pub const ACPI_DBG2_TYPE_NET_PORT: u16 = 0x8003;
752
753// debug port subtypes
754pub const ACPI_DBG2_SUBTYPE_16550_COMPATIBLE: u16 = 0x0000;
755pub const ACPI_DBG2_SUBTYPE_16550_SUBSET: u16 = 0x0001;
756pub const ACPI_DBG2_SUBTYPE_1394_STANDARD: u16 = 0x0000;
757pub const ACPI_DBG2_SUBTYPE_USB_XHCI: u16 = 0x0000;
758pub const ACPI_DBG2_SUBTYPE_USB_EHCI: u16 = 0x0001;
759
760const _: () = {
761    assert!(core::mem::size_of::<AcpiSignature>() == 4);
762    assert!(core::mem::align_of::<AcpiSignature>() == 1);
763
764    assert!(core::mem::size_of::<AcpiRsdp>() == 20);
765    assert!(core::mem::align_of::<AcpiRsdp>() == 1);
766
767    assert!(core::mem::size_of::<AcpiRsdpV2>() == 36);
768    assert!(core::mem::align_of::<AcpiRsdpV2>() == 1);
769
770    assert!(core::mem::size_of::<AcpiSdtHeader>() == 36);
771    assert!(core::mem::align_of::<AcpiSdtHeader>() == 1);
772
773    assert!(core::mem::size_of::<AcpiRsdt>() == 36);
774    assert!(core::mem::align_of::<AcpiRsdt>() == 1);
775
776    assert!(core::mem::size_of::<AcpiXsdt>() == 36);
777    assert!(core::mem::align_of::<AcpiXsdt>() == 1);
778
779    assert!(core::mem::size_of::<AcpiGenericAddress>() == 12);
780    assert!(core::mem::align_of::<AcpiGenericAddress>() == 1);
781
782    assert!(core::mem::size_of::<AcpiFadt>() == 244);
783    assert!(core::mem::align_of::<AcpiFadt>() == 1);
784
785    assert!(core::mem::size_of::<AcpiFacs>() == 64);
786    assert!(core::mem::align_of::<AcpiFacs>() == 1);
787
788    assert!(core::mem::size_of::<AcpiMadtTable>() == 44);
789    assert!(core::mem::align_of::<AcpiMadtTable>() == 1);
790
791    assert!(core::mem::size_of::<AcpiSubTableHeader>() == 2);
792    assert!(core::mem::align_of::<AcpiSubTableHeader>() == 1);
793
794    assert!(core::mem::size_of::<AcpiHpetTable>() == 56);
795    assert!(core::mem::align_of::<AcpiHpetTable>() == 1);
796
797    assert!(core::mem::size_of::<AcpiSratTable>() == 48);
798    assert!(core::mem::align_of::<AcpiSratTable>() == 1);
799
800    assert!(core::mem::size_of::<AcpiSratProcessorAffinityEntry>() == 16);
801    assert!(core::mem::align_of::<AcpiSratProcessorAffinityEntry>() == 1);
802
803    assert!(core::mem::size_of::<AcpiSratMemoryAffinityEntry>() == 40);
804    assert!(core::mem::align_of::<AcpiSratMemoryAffinityEntry>() == 1);
805
806    assert!(core::mem::size_of::<AcpiSratProcessorX2ApicAffinityEntry>() == 24);
807    assert!(core::mem::align_of::<AcpiSratProcessorX2ApicAffinityEntry>() == 1);
808
809    assert!(core::mem::size_of::<AcpiMadtLocalApicEntry>() == 8);
810    assert!(core::mem::align_of::<AcpiMadtLocalApicEntry>() == 1);
811
812    assert!(core::mem::size_of::<AcpiMadtIoApicEntry>() == 12);
813    assert!(core::mem::align_of::<AcpiMadtIoApicEntry>() == 1);
814
815    assert!(core::mem::size_of::<AcpiMadtIntSourceOverrideEntry>() == 10);
816    assert!(core::mem::align_of::<AcpiMadtIntSourceOverrideEntry>() == 1);
817
818    assert!(core::mem::size_of::<AcpiDbg2Table>() == 44);
819    assert!(core::mem::align_of::<AcpiDbg2Table>() == 1);
820
821    assert!(core::mem::size_of::<AcpiDbg2Device>() == 22);
822    assert!(core::mem::align_of::<AcpiDbg2Device>() == 1);
823};