2 ACPI 1.0b definitions from the ACPI Specification, revision 1.0b
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #include <IndustryStandard/AcpiAml.h>
14 /// Common table header, this prefaces all ACPI tables, including FACS, but
15 /// excluding the RSD PTR structure.
20 } EFI_ACPI_COMMON_HEADER
;
24 /// The common ACPI description table header. This structure prefaces most ACPI tables.
35 UINT32 CreatorRevision
;
36 } EFI_ACPI_DESCRIPTION_HEADER
;
40 // Define for Desriptor
42 #define ACPI_SMALL_ITEM_FLAG 0x00
43 #define ACPI_LARGE_ITEM_FLAG 0x01
46 // Small Item Descriptor Name
48 #define ACPI_SMALL_IRQ_DESCRIPTOR_NAME 0x04
49 #define ACPI_SMALL_DMA_DESCRIPTOR_NAME 0x05
50 #define ACPI_SMALL_START_DEPENDENT_DESCRIPTOR_NAME 0x06
51 #define ACPI_SMALL_END_DEPENDENT_DESCRIPTOR_NAME 0x07
52 #define ACPI_SMALL_IO_PORT_DESCRIPTOR_NAME 0x08
53 #define ACPI_SMALL_FIXED_IO_PORT_DESCRIPTOR_NAME 0x09
54 #define ACPI_SMALL_VENDOR_DEFINED_DESCRIPTOR_NAME 0x0E
55 #define ACPI_SMALL_END_TAG_DESCRIPTOR_NAME 0x0F
58 // Large Item Descriptor Name
60 #define ACPI_LARGE_24_BIT_MEMORY_RANGE_DESCRIPTOR_NAME 0x01
61 #define ACPI_LARGE_VENDOR_DEFINED_DESCRIPTOR_NAME 0x04
62 #define ACPI_LARGE_32_BIT_MEMORY_RANGE_DESCRIPTOR_NAME 0x05
63 #define ACPI_LARGE_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR_NAME 0x06
64 #define ACPI_LARGE_DWORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x07
65 #define ACPI_LARGE_WORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x08
66 #define ACPI_LARGE_EXTENDED_IRQ_DESCRIPTOR_NAME 0x09
67 #define ACPI_LARGE_QWORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x0A
70 // Small Item Descriptor Value
72 #define ACPI_IRQ_NOFLAG_DESCRIPTOR 0x22
73 #define ACPI_IRQ_DESCRIPTOR 0x23
74 #define ACPI_DMA_DESCRIPTOR 0x2A
75 #define ACPI_START_DEPENDENT_DESCRIPTOR 0x30
76 #define ACPI_START_DEPENDENT_EX_DESCRIPTOR 0x31
77 #define ACPI_END_DEPENDENT_DESCRIPTOR 0x38
78 #define ACPI_IO_PORT_DESCRIPTOR 0x47
79 #define ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR 0x4B
80 #define ACPI_END_TAG_DESCRIPTOR 0x79
83 // Large Item Descriptor Value
85 #define ACPI_24_BIT_MEMORY_RANGE_DESCRIPTOR 0x81
86 #define ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR 0x85
87 #define ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR 0x86
88 #define ACPI_DWORD_ADDRESS_SPACE_DESCRIPTOR 0x87
89 #define ACPI_WORD_ADDRESS_SPACE_DESCRIPTOR 0x88
90 #define ACPI_EXTENDED_INTERRUPT_DESCRIPTOR 0x89
91 #define ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR 0x8A
92 #define ACPI_ADDRESS_SPACE_DESCRIPTOR 0x8A
97 #define ACPI_ADDRESS_SPACE_TYPE_MEM 0x00
98 #define ACPI_ADDRESS_SPACE_TYPE_IO 0x01
99 #define ACPI_ADDRESS_SPACE_TYPE_BUS 0x02
102 /// Power Management Timer frequency is fixed at 3.579545MHz.
104 #define ACPI_TIMER_FREQUENCY 3579545
107 // Ensure proper structure formats
112 /// The commond definition of QWORD, DWORD, and WORD
113 /// Address Space Descriptors.
115 typedef PACKED
struct {
121 UINT64 AddrSpaceGranularity
;
124 UINT64 AddrTranslationOffset
;
126 } EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
;
128 typedef PACKED
union {
135 } ACPI_SMALL_RESOURCE_HEADER
;
137 typedef PACKED
struct {
146 } ACPI_LARGE_RESOURCE_HEADER
;
151 typedef PACKED
struct {
152 ACPI_SMALL_RESOURCE_HEADER Header
;
154 } EFI_ACPI_IRQ_NOFLAG_DESCRIPTOR
;
159 typedef PACKED
struct {
160 ACPI_SMALL_RESOURCE_HEADER Header
;
163 } EFI_ACPI_IRQ_DESCRIPTOR
;
168 typedef PACKED
struct {
169 ACPI_SMALL_RESOURCE_HEADER Header
;
172 } EFI_ACPI_DMA_DESCRIPTOR
;
175 /// I/O Port Descriptor
177 typedef PACKED
struct {
178 ACPI_SMALL_RESOURCE_HEADER Header
;
180 UINT16 BaseAddressMin
;
181 UINT16 BaseAddressMax
;
184 } EFI_ACPI_IO_PORT_DESCRIPTOR
;
187 /// Fixed Location I/O Port Descriptor.
189 typedef PACKED
struct {
190 ACPI_SMALL_RESOURCE_HEADER Header
;
193 } EFI_ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR
;
196 /// 24-Bit Memory Range Descriptor
198 typedef PACKED
struct {
199 ACPI_LARGE_RESOURCE_HEADER Header
;
201 UINT16 BaseAddressMin
;
202 UINT16 BaseAddressMax
;
205 } EFI_ACPI_24_BIT_MEMORY_RANGE_DESCRIPTOR
;
208 /// 32-Bit Memory Range Descriptor
210 typedef PACKED
struct {
211 ACPI_LARGE_RESOURCE_HEADER Header
;
213 UINT32 BaseAddressMin
;
214 UINT32 BaseAddressMax
;
217 } EFI_ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR
;
220 /// Fixed 32-Bit Fixed Memory Range Descriptor
222 typedef PACKED
struct {
223 ACPI_LARGE_RESOURCE_HEADER Header
;
227 } EFI_ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR
;
230 /// QWORD Address Space Descriptor
232 typedef PACKED
struct {
233 ACPI_LARGE_RESOURCE_HEADER Header
;
237 UINT64 AddrSpaceGranularity
;
240 UINT64 AddrTranslationOffset
;
242 } EFI_ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR
;
245 /// DWORD Address Space Descriptor
247 typedef PACKED
struct {
248 ACPI_LARGE_RESOURCE_HEADER Header
;
252 UINT32 AddrSpaceGranularity
;
255 UINT32 AddrTranslationOffset
;
257 } EFI_ACPI_DWORD_ADDRESS_SPACE_DESCRIPTOR
;
260 /// WORD Address Space Descriptor
262 typedef PACKED
struct {
263 ACPI_LARGE_RESOURCE_HEADER Header
;
267 UINT16 AddrSpaceGranularity
;
270 UINT16 AddrTranslationOffset
;
272 } EFI_ACPI_WORD_ADDRESS_SPACE_DESCRIPTOR
;
275 /// Extended Interrupt Descriptor
277 typedef PACKED
struct {
278 ACPI_LARGE_RESOURCE_HEADER Header
;
279 UINT8 InterruptVectorFlags
;
280 UINT8 InterruptTableLength
;
281 UINT32 InterruptNumber
[1];
282 } EFI_ACPI_EXTENDED_INTERRUPT_DESCRIPTOR
;
287 /// The End tag identifies an end of resource data.
292 } EFI_ACPI_END_TAG_DESCRIPTOR
;
295 // General use definitions
297 #define EFI_ACPI_RESERVED_BYTE 0x00
298 #define EFI_ACPI_RESERVED_WORD 0x0000
299 #define EFI_ACPI_RESERVED_DWORD 0x00000000
300 #define EFI_ACPI_RESERVED_QWORD 0x0000000000000000
303 // Resource Type Specific Flags
304 // Ref ACPI specification 6.4.3.5.5
306 // Bit [0] : Write Status, _RW
308 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_WRITE (1 << 0)
309 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_ONLY (0 << 0)
311 // Bit [2:1] : Memory Attributes, _MEM
313 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_NON_CACHEABLE (0 << 1)
314 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE (1 << 1)
315 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_WRITE_COMBINING (2 << 1)
316 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE (3 << 1)
318 // Bit [4:3] : Memory Attributes, _MTP
320 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMORY (0 << 3)
321 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERVED (1 << 3)
322 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI (2 << 3)
323 #define EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS (3 << 3)
325 // Bit [5] : Memory to I/O Translation, _TTP
327 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_TRANSLATION (1 << 5)
328 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC (0 << 5)
332 // Ref ACPI specification 6.4.2.1
334 #define EFI_ACPI_IRQ_SHARABLE_MASK 0x10
335 #define EFI_ACPI_IRQ_SHARABLE 0x10
337 #define EFI_ACPI_IRQ_POLARITY_MASK 0x08
338 #define EFI_ACPI_IRQ_HIGH_TRUE 0x00
339 #define EFI_ACPI_IRQ_LOW_FALSE 0x08
341 #define EFI_ACPI_IRQ_MODE 0x01
342 #define EFI_ACPI_IRQ_LEVEL_TRIGGERED 0x00
343 #define EFI_ACPI_IRQ_EDGE_TRIGGERED 0x01
347 // Ref ACPI specification 6.4.2.2
349 #define EFI_ACPI_DMA_SPEED_TYPE_MASK 0x60
350 #define EFI_ACPI_DMA_SPEED_TYPE_COMPATIBILITY 0x00
351 #define EFI_ACPI_DMA_SPEED_TYPE_A 0x20
352 #define EFI_ACPI_DMA_SPEED_TYPE_B 0x40
353 #define EFI_ACPI_DMA_SPEED_TYPE_F 0x60
355 #define EFI_ACPI_DMA_BUS_MASTER_MASK 0x04
356 #define EFI_ACPI_DMA_BUS_MASTER 0x04
358 #define EFI_ACPI_DMA_TRANSFER_TYPE_MASK 0x03
359 #define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT 0x00
360 #define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT_AND_16_BIT 0x01
361 #define EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT 0x10
365 // Ref ACPI specification 6.4.2.5
367 #define EFI_ACPI_IO_DECODE_MASK 0x01
368 #define EFI_ACPI_IO_DECODE_16_BIT 0x01
369 #define EFI_ACPI_IO_DECODE_10_BIT 0x00
372 // Memory Information
373 // Ref ACPI specification 6.4.3.4
375 #define EFI_ACPI_MEMORY_WRITE_STATUS_MASK 0x01
376 #define EFI_ACPI_MEMORY_WRITABLE 0x01
377 #define EFI_ACPI_MEMORY_NON_WRITABLE 0x00
380 // Ensure proper structure formats
384 // ACPI 1.0b table structures
388 /// Root System Description Pointer Structure.
396 } EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER
;
399 // Root System Description Table
400 // No definition needed as it is a common description table header, the same with
401 // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT32 table pointers.
405 /// RSDT Revision (as defined in ACPI 1.0b specification).
407 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
410 /// Fixed ACPI Description Table Structure (FADT).
413 EFI_ACPI_DESCRIPTION_HEADER Header
;
453 } EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE
;
456 /// FADT Version (as defined in ACPI 1.0b specification).
458 #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x01
460 #define EFI_ACPI_1_0_INT_MODE_DUAL_PIC 0
461 #define EFI_ACPI_1_0_INT_MODE_MULTIPLE_APIC 1
464 // Fixed ACPI Description Table Fixed Feature Flags
465 // All other bits are reserved and must be set to 0.
467 #define EFI_ACPI_1_0_WBINVD BIT0
468 #define EFI_ACPI_1_0_WBINVD_FLUSH BIT1
469 #define EFI_ACPI_1_0_PROC_C1 BIT2
470 #define EFI_ACPI_1_0_P_LVL2_UP BIT3
471 #define EFI_ACPI_1_0_PWR_BUTTON BIT4
472 #define EFI_ACPI_1_0_SLP_BUTTON BIT5
473 #define EFI_ACPI_1_0_FIX_RTC BIT6
474 #define EFI_ACPI_1_0_RTC_S4 BIT7
475 #define EFI_ACPI_1_0_TMR_VAL_EXT BIT8
476 #define EFI_ACPI_1_0_DCK_CAP BIT9
479 /// Firmware ACPI Control Structure.
484 UINT32 HardwareSignature
;
485 UINT32 FirmwareWakingVector
;
489 } EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE
;
492 /// Firmware Control Structure Feature Flags.
493 /// All other bits are reserved and must be set to 0.
495 #define EFI_ACPI_1_0_S4BIOS_F BIT0
498 /// Multiple APIC Description Table header definition. The rest of the table
499 /// must be defined in a platform-specific manner.
502 EFI_ACPI_DESCRIPTION_HEADER Header
;
503 UINT32 LocalApicAddress
;
505 } EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER
;
508 /// MADT Revision (as defined in ACPI 1.0b specification).
510 #define EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
513 /// Multiple APIC Flags
514 /// All other bits are reserved and must be set to 0.
516 #define EFI_ACPI_1_0_PCAT_COMPAT BIT0
519 // Multiple APIC Description Table APIC structure types
520 // All other values between 0x05 an 0xFF are reserved and
521 // will be ignored by OSPM.
523 #define EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC 0x00
524 #define EFI_ACPI_1_0_IO_APIC 0x01
525 #define EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE 0x02
526 #define EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
527 #define EFI_ACPI_1_0_LOCAL_APIC_NMI 0x04
530 // APIC Structure Definitions
534 /// Processor Local APIC Structure Definition.
539 UINT8 AcpiProcessorId
;
542 } EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE
;
545 /// Local APIC Flags. All other bits are reserved and must be 0.
547 #define EFI_ACPI_1_0_LOCAL_APIC_ENABLED BIT0
550 /// IO APIC Structure.
557 UINT32 IoApicAddress
;
558 UINT32 SystemVectorBase
;
559 } EFI_ACPI_1_0_IO_APIC_STRUCTURE
;
562 /// Interrupt Source Override Structure.
569 UINT32 GlobalSystemInterruptVector
;
571 } EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE
;
574 /// Non-Maskable Interrupt Source Structure.
580 UINT32 GlobalSystemInterruptVector
;
581 } EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE
;
584 /// Local APIC NMI Structure.
589 UINT8 AcpiProcessorId
;
592 } EFI_ACPI_1_0_LOCAL_APIC_NMI_STRUCTURE
;
595 /// Smart Battery Description Table (SBST)
598 EFI_ACPI_DESCRIPTION_HEADER Header
;
599 UINT32 WarningEnergyLevel
;
600 UINT32 LowEnergyLevel
;
601 UINT32 CriticalEnergyLevel
;
602 } EFI_ACPI_1_0_SMART_BATTERY_DESCRIPTION_TABLE
;
605 // Known table signatures
609 /// "RSD PTR " Root System Description Pointer.
611 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE SIGNATURE_64('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ')
614 /// "APIC" Multiple APIC Description Table.
616 #define EFI_ACPI_1_0_APIC_SIGNATURE SIGNATURE_32('A', 'P', 'I', 'C')
619 /// "DSDT" Differentiated System Description Table.
621 #define EFI_ACPI_1_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('D', 'S', 'D', 'T')
624 /// "FACS" Firmware ACPI Control Structure.
626 #define EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'S')
629 /// "FACP" Fixed ACPI Description Table.
631 #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'P')
634 /// "PSDT" Persistent System Description Table.
636 #define EFI_ACPI_1_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('P', 'S', 'D', 'T')
639 /// "RSDT" Root System Description Table.
641 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('R', 'S', 'D', 'T')
644 /// "SBST" Smart Battery Specification Table.
646 #define EFI_ACPI_1_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE SIGNATURE_32('S', 'B', 'S', 'T')
649 /// "SSDT" Secondary System Description Table.
651 #define EFI_ACPI_1_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('S', 'S', 'D', 'T')