2 ACPI 1.0b definitions from the ACPI Specification, revision 1.0b
4 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #include <IndustryStandard/AcpiAml.h>
20 /// Common table header, this prefaces all ACPI tables, including FACS, but
21 /// excluding the RSD PTR structure.
26 } EFI_ACPI_COMMON_HEADER
;
30 /// The common ACPI description table header. This structure prefaces most ACPI tables.
41 UINT32 CreatorRevision
;
42 } EFI_ACPI_DESCRIPTION_HEADER
;
46 // Define for Desriptor
48 #define ACPI_SMALL_ITEM_FLAG 0x00
49 #define ACPI_LARGE_ITEM_FLAG 0x01
52 // Small Item Descriptor Name
54 #define ACPI_SMALL_IRQ_DESCRIPTOR_NAME 0x04
55 #define ACPI_SMALL_DMA_DESCRIPTOR_NAME 0x05
56 #define ACPI_SMALL_START_DEPENDENT_DESCRIPTOR_NAME 0x06
57 #define ACPI_SMALL_END_DEPENDENT_DESCRIPTOR_NAME 0x07
58 #define ACPI_SMALL_IO_PORT_DESCRIPTOR_NAME 0x08
59 #define ACPI_SMALL_FIXED_IO_PORT_DESCRIPTOR_NAME 0x09
60 #define ACPI_SMALL_VENDOR_DEFINED_DESCRIPTOR_NAME 0x0E
61 #define ACPI_SMALL_END_TAG_DESCRIPTOR_NAME 0x0F
64 // Large Item Descriptor Name
66 #define ACPI_LARGE_24_BIT_MEMORY_RANGE_DESCRIPTOR_NAME 0x01
67 #define ACPI_LARGE_VENDOR_DEFINED_DESCRIPTOR_NAME 0x04
68 #define ACPI_LARGE_32_BIT_MEMORY_RANGE_DESCRIPTOR_NAME 0x05
69 #define ACPI_LARGE_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR_NAME 0x06
70 #define ACPI_LARGE_DWORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x07
71 #define ACPI_LARGE_WORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x08
72 #define ACPI_LARGE_EXTENDED_IRQ_DESCRIPTOR_NAME 0x09
73 #define ACPI_LARGE_QWORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x0A
76 // Small Item Descriptor Value
78 #define ACPI_IRQ_NOFLAG_DESCRIPTOR 0x22
79 #define ACPI_IRQ_DESCRIPTOR 0x23
80 #define ACPI_DMA_DESCRIPTOR 0x2A
81 #define ACPI_START_DEPENDENT_DESCRIPTOR 0x30
82 #define ACPI_START_DEPENDENT_EX_DESCRIPTOR 0x31
83 #define ACPI_END_DEPENDENT_DESCRIPTOR 0x38
84 #define ACPI_IO_PORT_DESCRIPTOR 0x47
85 #define ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR 0x4B
86 #define ACPI_END_TAG_DESCRIPTOR 0x79
89 // Large Item Descriptor Value
91 #define ACPI_24_BIT_MEMORY_RANGE_DESCRIPTOR 0x81
92 #define ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR 0x85
93 #define ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR 0x86
94 #define ACPI_DWORD_ADDRESS_SPACE_DESCRIPTOR 0x87
95 #define ACPI_WORD_ADDRESS_SPACE_DESCRIPTOR 0x88
96 #define ACPI_EXTENDED_INTERRUPT_DESCRIPTOR 0x89
97 #define ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR 0x8A
98 #define ACPI_ADDRESS_SPACE_DESCRIPTOR 0x8A
103 #define ACPI_ADDRESS_SPACE_TYPE_MEM 0x00
104 #define ACPI_ADDRESS_SPACE_TYPE_IO 0x01
105 #define ACPI_ADDRESS_SPACE_TYPE_BUS 0x02
108 /// Power Management Timer frequency is fixed at 3.579545MHz.
110 #define ACPI_TIMER_FREQUENCY 3579545
113 // Ensure proper structure formats
118 /// The commond definition of QWORD, DWORD, and WORD
119 /// Address Space Descriptors.
121 typedef PACKED
struct {
127 UINT64 AddrSpaceGranularity
;
130 UINT64 AddrTranslationOffset
;
132 } EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
;
134 typedef PACKED
union {
141 } ACPI_SMALL_RESOURCE_HEADER
;
143 typedef PACKED
struct {
152 } ACPI_LARGE_RESOURCE_HEADER
;
157 typedef PACKED
struct {
158 ACPI_SMALL_RESOURCE_HEADER Header
;
160 } EFI_ACPI_IRQ_NOFLAG_DESCRIPTOR
;
165 typedef PACKED
struct {
166 ACPI_SMALL_RESOURCE_HEADER Header
;
169 } EFI_ACPI_IRQ_DESCRIPTOR
;
174 typedef PACKED
struct {
175 ACPI_SMALL_RESOURCE_HEADER Header
;
178 } EFI_ACPI_DMA_DESCRIPTOR
;
181 /// I/O Port Descriptor
183 typedef PACKED
struct {
184 ACPI_SMALL_RESOURCE_HEADER Header
;
186 UINT16 BaseAddressMin
;
187 UINT16 BaseAddressMax
;
190 } EFI_ACPI_IO_PORT_DESCRIPTOR
;
193 /// Fixed Location I/O Port Descriptor.
195 typedef PACKED
struct {
196 ACPI_SMALL_RESOURCE_HEADER Header
;
199 } EFI_ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR
;
202 /// 24-Bit Memory Range Descriptor
204 typedef PACKED
struct {
205 ACPI_LARGE_RESOURCE_HEADER Header
;
207 UINT16 BaseAddressMin
;
208 UINT16 BaseAddressMax
;
211 } EFI_ACPI_24_BIT_MEMORY_RANGE_DESCRIPTOR
;
214 /// 32-Bit Memory Range Descriptor
216 typedef PACKED
struct {
217 ACPI_LARGE_RESOURCE_HEADER Header
;
219 UINT32 BaseAddressMin
;
220 UINT32 BaseAddressMax
;
223 } EFI_ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR
;
226 /// Fixed 32-Bit Fixed Memory Range Descriptor
228 typedef PACKED
struct {
229 ACPI_LARGE_RESOURCE_HEADER Header
;
233 } EFI_ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR
;
236 /// QWORD Address Space Descriptor
238 typedef PACKED
struct {
239 ACPI_LARGE_RESOURCE_HEADER Header
;
243 UINT64 AddrSpaceGranularity
;
246 UINT64 AddrTranslationOffset
;
248 } EFI_ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR
;
251 /// DWORD Address Space Descriptor
253 typedef PACKED
struct {
254 ACPI_LARGE_RESOURCE_HEADER Header
;
258 UINT32 AddrSpaceGranularity
;
261 UINT32 AddrTranslationOffset
;
263 } EFI_ACPI_DWORD_ADDRESS_SPACE_DESCRIPTOR
;
266 /// WORD Address Space Descriptor
268 typedef PACKED
struct {
269 ACPI_LARGE_RESOURCE_HEADER Header
;
273 UINT16 AddrSpaceGranularity
;
276 UINT16 AddrTranslationOffset
;
278 } EFI_ACPI_WORD_ADDRESS_SPACE_DESCRIPTOR
;
281 /// Extended Interrupt Descriptor
283 typedef PACKED
struct {
284 ACPI_LARGE_RESOURCE_HEADER Header
;
285 UINT8 InterruptVectorFlags
;
286 UINT8 InterruptTableLength
;
287 UINT32 InterruptNumber
[1];
288 } EFI_ACPI_EXTENDED_INTERRUPT_DESCRIPTOR
;
293 /// The End tag identifies an end of resource data.
298 } EFI_ACPI_END_TAG_DESCRIPTOR
;
301 // General use definitions
303 #define EFI_ACPI_RESERVED_BYTE 0x00
304 #define EFI_ACPI_RESERVED_WORD 0x0000
305 #define EFI_ACPI_RESERVED_DWORD 0x00000000
306 #define EFI_ACPI_RESERVED_QWORD 0x0000000000000000
309 // Resource Type Specific Flags
310 // Ref ACPI specification 6.4.3.5.5
312 // Bit [0] : Write Status, _RW
314 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_WRITE (1 << 0)
315 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_ONLY (0 << 0)
317 // Bit [2:1] : Memory Attributes, _MEM
319 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_NON_CACHEABLE (0 << 1)
320 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE (1 << 1)
321 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_WRITE_COMBINING (2 << 1)
322 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE (3 << 1)
324 // Bit [4:3] : Memory Attributes, _MTP
326 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMORY (0 << 3)
327 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERVED (1 << 3)
328 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI (2 << 3)
329 #define EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS (3 << 3)
331 // Bit [5] : Memory to I/O Translation, _TTP
333 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_TRANSLATION (1 << 5)
334 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC (0 << 5)
338 // Ref ACPI specification 6.4.2.1
340 #define EFI_ACPI_IRQ_SHARABLE_MASK 0x10
341 #define EFI_ACPI_IRQ_SHARABLE 0x10
343 #define EFI_ACPI_IRQ_POLARITY_MASK 0x08
344 #define EFI_ACPI_IRQ_HIGH_TRUE 0x00
345 #define EFI_ACPI_IRQ_LOW_FALSE 0x08
347 #define EFI_ACPI_IRQ_MODE 0x01
348 #define EFI_ACPI_IRQ_LEVEL_TRIGGERED 0x00
349 #define EFI_ACPI_IRQ_EDGE_TRIGGERED 0x01
353 // Ref ACPI specification 6.4.2.2
355 #define EFI_ACPI_DMA_SPEED_TYPE_MASK 0x60
356 #define EFI_ACPI_DMA_SPEED_TYPE_COMPATIBILITY 0x00
357 #define EFI_ACPI_DMA_SPEED_TYPE_A 0x20
358 #define EFI_ACPI_DMA_SPEED_TYPE_B 0x40
359 #define EFI_ACPI_DMA_SPEED_TYPE_F 0x60
361 #define EFI_ACPI_DMA_BUS_MASTER_MASK 0x04
362 #define EFI_ACPI_DMA_BUS_MASTER 0x04
364 #define EFI_ACPI_DMA_TRANSFER_TYPE_MASK 0x03
365 #define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT 0x00
366 #define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT_AND_16_BIT 0x01
367 #define EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT 0x10
371 // Ref ACPI specification 6.4.2.5
373 #define EFI_ACPI_IO_DECODE_MASK 0x01
374 #define EFI_ACPI_IO_DECODE_16_BIT 0x01
375 #define EFI_ACPI_IO_DECODE_10_BIT 0x00
378 // Memory Information
379 // Ref ACPI specification 6.4.3.4
381 #define EFI_ACPI_MEMORY_WRITE_STATUS_MASK 0x01
382 #define EFI_ACPI_MEMORY_WRITABLE 0x01
383 #define EFI_ACPI_MEMORY_NON_WRITABLE 0x00
386 // Ensure proper structure formats
390 // ACPI 1.0b table structures
394 /// Root System Description Pointer Structure.
402 } EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER
;
405 // Root System Description Table
406 // No definition needed as it is a common description table header, the same with
407 // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT32 table pointers.
411 /// RSDT Revision (as defined in ACPI 1.0b specification).
413 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
416 /// Fixed ACPI Description Table Structure (FADT).
419 EFI_ACPI_DESCRIPTION_HEADER Header
;
459 } EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE
;
462 /// FADT Version (as defined in ACPI 1.0b specification).
464 #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x01
466 #define EFI_ACPI_1_0_INT_MODE_DUAL_PIC 0
467 #define EFI_ACPI_1_0_INT_MODE_MULTIPLE_APIC 1
470 // Fixed ACPI Description Table Fixed Feature Flags
471 // All other bits are reserved and must be set to 0.
473 #define EFI_ACPI_1_0_WBINVD BIT0
474 #define EFI_ACPI_1_0_WBINVD_FLUSH BIT1
475 #define EFI_ACPI_1_0_PROC_C1 BIT2
476 #define EFI_ACPI_1_0_P_LVL2_UP BIT3
477 #define EFI_ACPI_1_0_PWR_BUTTON BIT4
478 #define EFI_ACPI_1_0_SLP_BUTTON BIT5
479 #define EFI_ACPI_1_0_FIX_RTC BIT6
480 #define EFI_ACPI_1_0_RTC_S4 BIT7
481 #define EFI_ACPI_1_0_TMR_VAL_EXT BIT8
482 #define EFI_ACPI_1_0_DCK_CAP BIT9
485 /// Firmware ACPI Control Structure.
490 UINT32 HardwareSignature
;
491 UINT32 FirmwareWakingVector
;
495 } EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE
;
498 /// Firmware Control Structure Feature Flags.
499 /// All other bits are reserved and must be set to 0.
501 #define EFI_ACPI_1_0_S4BIOS_F BIT0
504 /// Multiple APIC Description Table header definition. The rest of the table
505 /// must be defined in a platform-specific manner.
508 EFI_ACPI_DESCRIPTION_HEADER Header
;
509 UINT32 LocalApicAddress
;
511 } EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER
;
514 /// MADT Revision (as defined in ACPI 1.0b specification).
516 #define EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
519 /// Multiple APIC Flags
520 /// All other bits are reserved and must be set to 0.
522 #define EFI_ACPI_1_0_PCAT_COMPAT BIT0
525 // Multiple APIC Description Table APIC structure types
526 // All other values between 0x05 an 0xFF are reserved and
527 // will be ignored by OSPM.
529 #define EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC 0x00
530 #define EFI_ACPI_1_0_IO_APIC 0x01
531 #define EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE 0x02
532 #define EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
533 #define EFI_ACPI_1_0_LOCAL_APIC_NMI 0x04
536 // APIC Structure Definitions
540 /// Processor Local APIC Structure Definition.
545 UINT8 AcpiProcessorId
;
548 } EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE
;
551 /// Local APIC Flags. All other bits are reserved and must be 0.
553 #define EFI_ACPI_1_0_LOCAL_APIC_ENABLED BIT0
556 /// IO APIC Structure.
563 UINT32 IoApicAddress
;
564 UINT32 SystemVectorBase
;
565 } EFI_ACPI_1_0_IO_APIC_STRUCTURE
;
568 /// Interrupt Source Override Structure.
575 UINT32 GlobalSystemInterruptVector
;
577 } EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE
;
580 /// Non-Maskable Interrupt Source Structure.
586 UINT32 GlobalSystemInterruptVector
;
587 } EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE
;
590 /// Local APIC NMI Structure.
595 UINT8 AcpiProcessorId
;
598 } EFI_ACPI_1_0_LOCAL_APIC_NMI_STRUCTURE
;
601 /// Smart Battery Description Table (SBST)
604 EFI_ACPI_DESCRIPTION_HEADER Header
;
605 UINT32 WarningEnergyLevel
;
606 UINT32 LowEnergyLevel
;
607 UINT32 CriticalEnergyLevel
;
608 } EFI_ACPI_1_0_SMART_BATTERY_DESCRIPTION_TABLE
;
611 // Known table signatures
615 /// "RSD PTR " Root System Description Pointer.
617 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE SIGNATURE_64('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ')
620 /// "APIC" Multiple APIC Description Table.
622 #define EFI_ACPI_1_0_APIC_SIGNATURE SIGNATURE_32('A', 'P', 'I', 'C')
625 /// "DSDT" Differentiated System Description Table.
627 #define EFI_ACPI_1_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('D', 'S', 'D', 'T')
630 /// "FACS" Firmware ACPI Control Structure.
632 #define EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'S')
635 /// "FACP" Fixed ACPI Description Table.
637 #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'P')
640 /// "PSDT" Persistent System Description Table.
642 #define EFI_ACPI_1_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('P', 'S', 'D', 'T')
645 /// "RSDT" Root System Description Table.
647 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('R', 'S', 'D', 'T')
650 /// "SBST" Smart Battery Specification Table.
652 #define EFI_ACPI_1_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE SIGNATURE_32('S', 'B', 'S', 'T')
655 /// "SSDT" Secondary System Description Table.
657 #define EFI_ACPI_1_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('S', 'S', 'D', 'T')