2 ACPI 1.0b definitions from the ACPI Specification, revision 1.0b
4 Copyright (c) 2006 - 2010, 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.
18 /// Common table header, this prefaces all ACPI tables, including FACS, but
19 /// excluding the RSD PTR structure.
24 } EFI_ACPI_COMMON_HEADER
;
28 /// The common ACPI description table header. This structure prefaces most ACPI tables.
39 UINT32 CreatorRevision
;
40 } EFI_ACPI_DESCRIPTION_HEADER
;
44 // Define for Desriptor
46 #define ACPI_DMA_DESCRIPTOR 0x2A
47 #define ACPI_IO_PORT_DESCRIPTOR 0x47
48 #define ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR 0x4B
49 #define ACPI_IRQ_NOFLAG_DESCRIPTOR 0x22
50 #define ACPI_IRQ_DESCRIPTOR 0x23
51 #define ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR 0x85
52 #define ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR 0x86
53 #define ACPI_ADDRESS_SPACE_DESCRIPTOR 0x8A
54 #define ACPI_END_TAG_DESCRIPTOR 0x79
59 #define ACPI_ADDRESS_SPACE_TYPE_MEM 0x00
60 #define ACPI_ADDRESS_SPACE_TYPE_IO 0x01
61 #define ACPI_ADDRESS_SPACE_TYPE_BUS 0x02
64 /// Power Management Timer frequency is fixed at 3.579545MHz.
66 #define ACPI_TIMER_FREQUENCY 3579545
69 // Ensure proper structure formats
74 /// The commond definition of QWORD, DWORD, and WORD
75 /// Address Space Descriptors.
77 typedef PACKED
struct {
83 UINT64 AddrSpaceGranularity
;
86 UINT64 AddrTranslationOffset
;
88 } EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
;
90 typedef PACKED
union {
97 } ACPI_SMALL_RESOURCE_HEADER
;
99 typedef PACKED
struct {
108 } ACPI_LARGE_RESOURCE_HEADER
;
113 typedef PACKED
struct {
114 ACPI_SMALL_RESOURCE_HEADER Header
;
116 } EFI_ACPI_IRQ_NOFLAG_DESCRIPTOR
;
121 typedef PACKED
struct {
122 ACPI_SMALL_RESOURCE_HEADER Header
;
125 } EFI_ACPI_IRQ_DESCRIPTOR
;
130 typedef PACKED
struct {
131 ACPI_SMALL_RESOURCE_HEADER Header
;
134 } EFI_ACPI_DMA_DESCRIPTOR
;
137 /// I/O Port Descriptor
139 typedef PACKED
struct {
140 ACPI_SMALL_RESOURCE_HEADER Header
;
142 UINT16 BaseAddressMin
;
143 UINT16 BaseAddressMax
;
146 } EFI_ACPI_IO_PORT_DESCRIPTOR
;
149 /// Fixed Location I/O Port Descriptor.
151 typedef PACKED
struct {
152 ACPI_SMALL_RESOURCE_HEADER Header
;
155 } EFI_ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR
;
158 /// 32-Bit Memory Range Descriptor
160 typedef PACKED
struct {
161 ACPI_LARGE_RESOURCE_HEADER Header
;
163 UINT32 BaseAddressMin
;
164 UINT32 BaseAddressMax
;
167 } EFI_ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR
;
170 /// Fixed 32-Bit Fixed Memory Range Descriptor
172 typedef PACKED
struct {
173 ACPI_LARGE_RESOURCE_HEADER Header
;
177 } EFI_ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR
;
181 /// The End tag identifies an end of resource data.
186 } EFI_ACPI_END_TAG_DESCRIPTOR
;
189 // General use definitions
191 #define EFI_ACPI_RESERVED_BYTE 0x00
192 #define EFI_ACPI_RESERVED_WORD 0x0000
193 #define EFI_ACPI_RESERVED_DWORD 0x00000000
194 #define EFI_ACPI_RESERVED_QWORD 0x0000000000000000
197 // Resource Type Specific Flags
198 // Ref ACPI specification 6.4.3.5.5
200 // Bit [0] : Write Status, _RW
202 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_WRITE (1 << 0)
203 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_ONLY (0 << 0)
205 // Bit [2:1] : Memory Attributes, _MEM
207 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_NON_CACHEABLE (0 << 1)
208 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE (1 << 1)
209 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_WRITE_COMBINING (2 << 1)
210 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE (3 << 1)
212 // Bit [4:3] : Memory Attributes, _MTP
214 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMORY (0 << 3)
215 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERVED (1 << 3)
216 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI (2 << 3)
217 #define EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS (3 << 3)
219 // Bit [5] : Memory to I/O Translation, _TTP
221 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_TRANSLATION (1 << 5)
222 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC (0 << 5)
226 // Ref ACPI specification 6.4.2.1
228 #define EFI_ACPI_IRQ_SHARABLE_MASK 0x10
229 #define EFI_ACPI_IRQ_SHARABLE 0x10
231 #define EFI_ACPI_IRQ_POLARITY_MASK 0x08
232 #define EFI_ACPI_IRQ_HIGH_TRUE 0x00
233 #define EFI_ACPI_IRQ_LOW_FALSE 0x08
235 #define EFI_ACPI_IRQ_MODE 0x01
236 #define EFI_ACPI_IRQ_LEVEL_TRIGGERED 0x00
237 #define EFI_ACPI_IRQ_EDGE_TRIGGERED 0x01
241 // Ref ACPI specification 6.4.2.2
243 #define EFI_ACPI_DMA_SPEED_TYPE_MASK 0x60
244 #define EFI_ACPI_DMA_SPEED_TYPE_COMPATIBILITY 0x00
245 #define EFI_ACPI_DMA_SPEED_TYPE_A 0x20
246 #define EFI_ACPI_DMA_SPEED_TYPE_B 0x40
247 #define EFI_ACPI_DMA_SPEED_TYPE_F 0x60
249 #define EFI_ACPI_DMA_BUS_MASTER_MASK 0x04
250 #define EFI_ACPI_DMA_BUS_MASTER 0x04
252 #define EFI_ACPI_DMA_TRANSFER_TYPE_MASK 0x03
253 #define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT 0x00
254 #define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT_AND_16_BIT 0x01
255 #define EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT 0x10
259 // Ref ACPI specification 6.4.2.5
261 #define EFI_ACPI_IO_DECODE_MASK 0x01
262 #define EFI_ACPI_IO_DECODE_16_BIT 0x01
263 #define EFI_ACPI_IO_DECODE_10_BIT 0x00
266 // Memory Information
267 // Ref ACPI specification 6.4.3.4
269 #define EFI_ACPI_MEMORY_WRITE_STATUS_MASK 0x01
270 #define EFI_ACPI_MEMORY_WRITABLE 0x01
271 #define EFI_ACPI_MEMORY_NON_WRITABLE 0x00
274 // Ensure proper structure formats
278 // ACPI 1.0b table structures
282 /// Root System Description Pointer Structure.
290 } EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER
;
293 // Root System Description Table
294 // No definition needed as it is a common description table header, the same with
295 // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT32 table pointers.
299 /// RSDT Revision (as defined in ACPI 1.0b specification).
301 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
304 /// Fixed ACPI Description Table Structure (FADT).
307 EFI_ACPI_DESCRIPTION_HEADER Header
;
347 } EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE
;
350 /// FADT Version (as defined in ACPI 1.0b specification).
352 #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x01
355 // Fixed ACPI Description Table Fixed Feature Flags
356 // All other bits are reserved and must be set to 0.
358 #define EFI_ACPI_1_0_WBINVD BIT0
359 #define EFI_ACPI_1_0_WBINVD_FLUSH BIT1
360 #define EFI_ACPI_1_0_PROC_C1 BIT2
361 #define EFI_ACPI_1_0_P_LVL2_UP BIT3
362 #define EFI_ACPI_1_0_PWR_BUTTON BIT4
363 #define EFI_ACPI_1_0_SLP_BUTTON BIT5
364 #define EFI_ACPI_1_0_FIX_RTC BIT6
365 #define EFI_ACPI_1_0_RTC_S4 BIT7
366 #define EFI_ACPI_1_0_TMR_VAL_EXT BIT8
367 #define EFI_ACPI_1_0_DCK_CAP BIT9
370 /// Firmware ACPI Control Structure.
375 UINT32 HardwareSignature
;
376 UINT32 FirmwareWakingVector
;
380 } EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE
;
383 /// Firmware Control Structure Feature Flags.
384 /// All other bits are reserved and must be set to 0.
386 #define EFI_ACPI_1_0_S4BIOS_F BIT0
389 /// Multiple APIC Description Table header definition. The rest of the table
390 /// must be defined in a platform-specific manner.
393 EFI_ACPI_DESCRIPTION_HEADER Header
;
394 UINT32 LocalApicAddress
;
396 } EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER
;
399 /// MADT Revision (as defined in ACPI 1.0b specification).
401 #define EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
404 /// Multiple APIC Flags
405 /// All other bits are reserved and must be set to 0.
407 #define EFI_ACPI_1_0_PCAT_COMPAT BIT0
410 // Multiple APIC Description Table APIC structure types
411 // All other values between 0x05 an 0xFF are reserved and
412 // will be ignored by OSPM.
414 #define EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC 0x00
415 #define EFI_ACPI_1_0_IO_APIC 0x01
416 #define EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE 0x02
417 #define EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
418 #define EFI_ACPI_1_0_LOCAL_APIC_NMI 0x04
421 // APIC Structure Definitions
425 /// Processor Local APIC Structure Definition.
430 UINT8 AcpiProcessorId
;
433 } EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE
;
436 /// Local APIC Flags. All other bits are reserved and must be 0.
438 #define EFI_ACPI_1_0_LOCAL_APIC_ENABLED BIT0
441 /// IO APIC Structure.
448 UINT32 IoApicAddress
;
449 UINT32 SystemVectorBase
;
450 } EFI_ACPI_1_0_IO_APIC_STRUCTURE
;
453 /// Interrupt Source Override Structure.
460 UINT32 GlobalSystemInterruptVector
;
462 } EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE
;
465 /// Non-Maskable Interrupt Source Structure.
471 UINT32 GlobalSystemInterruptVector
;
472 } EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE
;
475 /// Local APIC NMI Structure.
480 UINT8 AcpiProcessorId
;
483 } EFI_ACPI_1_0_LOCAL_APIC_NMI_STRUCTURE
;
486 /// Smart Battery Description Table (SBST)
489 EFI_ACPI_DESCRIPTION_HEADER Header
;
490 UINT32 WarningEnergyLevel
;
491 UINT32 LowEnergyLevel
;
492 UINT32 CriticalEnergyLevel
;
493 } EFI_ACPI_1_0_SMART_BATTERY_DESCRIPTION_TABLE
;
496 // Known table signatures
500 /// "RSD PTR " Root System Description Pointer.
502 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE SIGNATURE_64('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ')
505 /// "APIC" Multiple APIC Description Table.
507 #define EFI_ACPI_1_0_APIC_SIGNATURE SIGNATURE_32('A', 'P', 'I', 'C')
510 /// "DSDT" Differentiated System Description Table.
512 #define EFI_ACPI_1_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('D', 'S', 'D', 'T')
515 /// "FACS" Firmware ACPI Control Structure.
517 #define EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'S')
520 /// "FACP" Fixed ACPI Description Table.
522 #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'P')
525 /// "PSDT" Persistent System Description Table.
527 #define EFI_ACPI_1_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('P', 'S', 'D', 'T')
530 /// "RSDT" Root System Description Table.
532 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('R', 'S', 'D', 'T')
535 /// "SBST" Smart Battery Specification Table.
537 #define EFI_ACPI_1_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE SIGNATURE_32('S', 'B', 'S', 'T')
540 /// "SSDT" Secondary System Description Table.
542 #define EFI_ACPI_1_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('S', 'S', 'D', 'T')