iPXE
Acpi10.h
Go to the documentation of this file.
1/** @file
2 ACPI 1.0b definitions from the ACPI Specification, revision 1.0b
3
4Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5Copyright (c) 2020, Arm Limited. All rights reserved.<BR>
6SPDX-License-Identifier: BSD-2-Clause-Patent
7**/
8
9#pragma once
10
11FILE_LICENCE ( BSD2_PATENT );
12FILE_SECBOOT ( PERMITTED );
13
15
16///
17/// Common table header, this prefaces all ACPI tables, including FACS, but
18/// excluding the RSD PTR structure.
19///
24
25#pragma pack(1)
26///
27/// The common ACPI description table header. This structure prefaces most ACPI tables.
28///
40#pragma pack()
41
42//
43// Define for Descriptor
44//
45#define ACPI_SMALL_ITEM_FLAG 0x00
46#define ACPI_LARGE_ITEM_FLAG 0x01
47
48//
49// Small Item Descriptor Name
50//
51#define ACPI_SMALL_IRQ_DESCRIPTOR_NAME 0x04
52#define ACPI_SMALL_DMA_DESCRIPTOR_NAME 0x05
53#define ACPI_SMALL_START_DEPENDENT_DESCRIPTOR_NAME 0x06
54#define ACPI_SMALL_END_DEPENDENT_DESCRIPTOR_NAME 0x07
55#define ACPI_SMALL_IO_PORT_DESCRIPTOR_NAME 0x08
56#define ACPI_SMALL_FIXED_IO_PORT_DESCRIPTOR_NAME 0x09
57#define ACPI_SMALL_VENDOR_DEFINED_DESCRIPTOR_NAME 0x0E
58#define ACPI_SMALL_END_TAG_DESCRIPTOR_NAME 0x0F
59
60//
61// Large Item Descriptor Name
62//
63#define ACPI_LARGE_24_BIT_MEMORY_RANGE_DESCRIPTOR_NAME 0x01
64#define ACPI_LARGE_VENDOR_DEFINED_DESCRIPTOR_NAME 0x04
65#define ACPI_LARGE_32_BIT_MEMORY_RANGE_DESCRIPTOR_NAME 0x05
66#define ACPI_LARGE_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR_NAME 0x06
67#define ACPI_LARGE_DWORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x07
68#define ACPI_LARGE_WORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x08
69#define ACPI_LARGE_EXTENDED_IRQ_DESCRIPTOR_NAME 0x09
70#define ACPI_LARGE_QWORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x0A
71
72//
73// Small Item Descriptor Value
74//
75#define ACPI_IRQ_NOFLAG_DESCRIPTOR 0x22
76#define ACPI_IRQ_DESCRIPTOR 0x23
77#define ACPI_DMA_DESCRIPTOR 0x2A
78#define ACPI_START_DEPENDENT_DESCRIPTOR 0x30
79#define ACPI_START_DEPENDENT_EX_DESCRIPTOR 0x31
80#define ACPI_END_DEPENDENT_DESCRIPTOR 0x38
81#define ACPI_IO_PORT_DESCRIPTOR 0x47
82#define ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR 0x4B
83#define ACPI_END_TAG_DESCRIPTOR 0x79
84
85//
86// Large Item Descriptor Value
87//
88#define ACPI_24_BIT_MEMORY_RANGE_DESCRIPTOR 0x81
89#define ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR 0x85
90#define ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR 0x86
91#define ACPI_DWORD_ADDRESS_SPACE_DESCRIPTOR 0x87
92#define ACPI_WORD_ADDRESS_SPACE_DESCRIPTOR 0x88
93#define ACPI_EXTENDED_INTERRUPT_DESCRIPTOR 0x89
94#define ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR 0x8A
95#define ACPI_ADDRESS_SPACE_DESCRIPTOR 0x8A
96
97//
98// Resource Type
99//
100#define ACPI_ADDRESS_SPACE_TYPE_MEM 0x00
101#define ACPI_ADDRESS_SPACE_TYPE_IO 0x01
102#define ACPI_ADDRESS_SPACE_TYPE_BUS 0x02
103
104///
105/// Power Management Timer frequency is fixed at 3.579545MHz.
106///
107#define ACPI_TIMER_FREQUENCY 3579545
108
109//
110// Ensure proper structure formats
111//
112#pragma pack(1)
113
114///
115/// The common definition of QWORD, DWORD, and WORD
116/// Address Space Descriptors.
117///
118typedef PACKED struct {
130
131typedef PACKED union {
133 PACKED struct {
139
140typedef PACKED struct {
141 PACKED union {
142 UINT8 Byte;
143 PACKED struct {
144 UINT8 Name : 7;
145 UINT8 Type : 1;
146 } Bits;
147 } Header;
150
151///
152/// IRQ Descriptor.
153///
154typedef PACKED struct {
158
159///
160/// IRQ Descriptor.
161///
162typedef PACKED struct {
164 UINT16 Mask;
167
168///
169/// DMA Descriptor.
170///
171typedef PACKED struct {
176
177///
178/// I/O Port Descriptor
179///
180typedef PACKED struct {
188
189///
190/// Fixed Location I/O Port Descriptor.
191///
192typedef PACKED struct {
197
198///
199/// 24-Bit Memory Range Descriptor
200///
201typedef PACKED struct {
209
210///
211/// 32-Bit Memory Range Descriptor
212///
213typedef PACKED struct {
221
222///
223/// Fixed 32-Bit Fixed Memory Range Descriptor
224///
225typedef PACKED struct {
231
232///
233/// QWORD Address Space Descriptor
234///
235typedef PACKED struct {
246
247///
248/// DWORD Address Space Descriptor
249///
250typedef PACKED struct {
261
262///
263/// WORD Address Space Descriptor
264///
265typedef PACKED struct {
276
277///
278/// Extended Interrupt Descriptor
279///
280typedef PACKED struct {
286
287#pragma pack()
288
289///
290/// The End tag identifies an end of resource data.
291///
296
297//
298// General use definitions
299//
300#define EFI_ACPI_RESERVED_BYTE 0x00
301#define EFI_ACPI_RESERVED_WORD 0x0000
302#define EFI_ACPI_RESERVED_DWORD 0x00000000
303#define EFI_ACPI_RESERVED_QWORD 0x0000000000000000
304
305//
306// Resource Type Specific Flags
307// Ref ACPI specification 6.4.3.5.5
308//
309// Bit [0] : Write Status, _RW
310//
311#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_WRITE (1 << 0)
312#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_ONLY (0 << 0)
313//
314// Bit [2:1] : Memory Attributes, _MEM
315//
316#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_NON_CACHEABLE (0 << 1)
317#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE (1 << 1)
318#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_WRITE_COMBINING (2 << 1)
319#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE (3 << 1)
320//
321// Bit [4:3] : Memory Attributes, _MTP
322//
323#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMORY (0 << 3)
324#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERVED (1 << 3)
325#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI (2 << 3)
326#define EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS (3 << 3)
327//
328// Bit [5] : Memory to I/O Translation, _TTP
329//
330#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_TRANSLATION (1 << 5)
331#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC (0 << 5)
332
333//
334// IRQ Information
335// Ref ACPI specification 6.4.2.1
336//
337#define EFI_ACPI_IRQ_SHARABLE_MASK 0x10
338#define EFI_ACPI_IRQ_SHARABLE 0x10
339
340#define EFI_ACPI_IRQ_POLARITY_MASK 0x08
341#define EFI_ACPI_IRQ_HIGH_TRUE 0x00
342#define EFI_ACPI_IRQ_LOW_FALSE 0x08
343
344#define EFI_ACPI_IRQ_MODE 0x01
345#define EFI_ACPI_IRQ_LEVEL_TRIGGERED 0x00
346#define EFI_ACPI_IRQ_EDGE_TRIGGERED 0x01
347
348//
349// DMA Information
350// Ref ACPI specification 6.4.2.2
351//
352#define EFI_ACPI_DMA_SPEED_TYPE_MASK 0x60
353#define EFI_ACPI_DMA_SPEED_TYPE_COMPATIBILITY 0x00
354#define EFI_ACPI_DMA_SPEED_TYPE_A 0x20
355#define EFI_ACPI_DMA_SPEED_TYPE_B 0x40
356#define EFI_ACPI_DMA_SPEED_TYPE_F 0x60
357
358#define EFI_ACPI_DMA_BUS_MASTER_MASK 0x04
359#define EFI_ACPI_DMA_BUS_MASTER 0x04
360
361#define EFI_ACPI_DMA_TRANSFER_TYPE_MASK 0x03
362#define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT 0x00
363#define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT_AND_16_BIT 0x01
364#define EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT 0x02
365
366//
367// IO Information
368// Ref ACPI specification 6.4.2.5
369//
370#define EFI_ACPI_IO_DECODE_MASK 0x01
371#define EFI_ACPI_IO_DECODE_16_BIT 0x01
372#define EFI_ACPI_IO_DECODE_10_BIT 0x00
373
374//
375// Memory Information
376// Ref ACPI specification 6.4.3.4
377//
378#define EFI_ACPI_MEMORY_WRITE_STATUS_MASK 0x01
379#define EFI_ACPI_MEMORY_WRITABLE 0x01
380#define EFI_ACPI_MEMORY_NON_WRITABLE 0x00
381
382//
383// Interrupt Vector Flags definitions for Extended Interrupt Descriptor
384// Ref ACPI specification 6.4.3.6
385//
386#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_PRODUCER_CONSUMER_MASK BIT0
387#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_MODE_MASK BIT1
388#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_POLARITY_MASK BIT2
389#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_SHARABLE_MASK BIT3
390#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_WAKE_CAPABLITY_MASK BIT4
391
392//
393// Ensure proper structure formats
394//
395#pragma pack(1)
396//
397// ACPI 1.0b table structures
398//
399
400///
401/// Root System Description Pointer Structure.
402///
410
411//
412// Root System Description Table
413// No definition needed as it is a common description table header, the same with
414// EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT32 table pointers.
415//
416
417///
418/// RSDT Revision (as defined in ACPI 1.0b specification).
419///
420#define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
421
422///
423/// Fixed ACPI Description Table Structure (FADT).
424///
467
468///
469/// FADT Version (as defined in ACPI 1.0b specification).
470///
471#define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x01
472
473#define EFI_ACPI_1_0_INT_MODE_DUAL_PIC 0
474#define EFI_ACPI_1_0_INT_MODE_MULTIPLE_APIC 1
475
476//
477// Fixed ACPI Description Table Fixed Feature Flags
478// All other bits are reserved and must be set to 0.
479//
480#define EFI_ACPI_1_0_WBINVD BIT0
481#define EFI_ACPI_1_0_WBINVD_FLUSH BIT1
482#define EFI_ACPI_1_0_PROC_C1 BIT2
483#define EFI_ACPI_1_0_P_LVL2_UP BIT3
484#define EFI_ACPI_1_0_PWR_BUTTON BIT4
485#define EFI_ACPI_1_0_SLP_BUTTON BIT5
486#define EFI_ACPI_1_0_FIX_RTC BIT6
487#define EFI_ACPI_1_0_RTC_S4 BIT7
488#define EFI_ACPI_1_0_TMR_VAL_EXT BIT8
489#define EFI_ACPI_1_0_DCK_CAP BIT9
490
491///
492/// Firmware ACPI Control Structure.
493///
503
504///
505/// Firmware Control Structure Feature Flags.
506/// All other bits are reserved and must be set to 0.
507///
508#define EFI_ACPI_1_0_S4BIOS_F BIT0
509
510///
511/// Multiple APIC Description Table header definition. The rest of the table
512/// must be defined in a platform-specific manner.
513///
519
520///
521/// MADT Revision (as defined in ACPI 1.0b specification).
522///
523#define EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
524
525///
526/// Multiple APIC Flags
527/// All other bits are reserved and must be set to 0.
528///
529#define EFI_ACPI_1_0_PCAT_COMPAT BIT0
530
531//
532// Multiple APIC Description Table APIC structure types
533// All other values between 0x05 an 0xFF are reserved and
534// will be ignored by OSPM.
535//
536#define EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC 0x00
537#define EFI_ACPI_1_0_IO_APIC 0x01
538#define EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE 0x02
539#define EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
540#define EFI_ACPI_1_0_LOCAL_APIC_NMI 0x04
541
542//
543// APIC Structure Definitions
544//
545
546///
547/// Processor Local APIC Structure Definition.
548///
556
557///
558/// Local APIC Flags. All other bits are reserved and must be 0.
559///
560#define EFI_ACPI_1_0_LOCAL_APIC_ENABLED BIT0
561
562///
563/// IO APIC Structure.
564///
573
574///
575/// Interrupt Source Override Structure.
576///
585
586///
587/// Non-Maskable Interrupt Source Structure.
588///
595
596///
597/// Local APIC NMI Structure.
598///
606
607///
608/// Smart Battery Description Table (SBST)
609///
616
617//
618// Known table signatures
619//
620
621///
622/// "RSD PTR " Root System Description Pointer.
623///
624#define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE SIGNATURE_64('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ')
625
626///
627/// "APIC" Multiple APIC Description Table.
628///
629#define EFI_ACPI_1_0_APIC_SIGNATURE SIGNATURE_32('A', 'P', 'I', 'C')
630
631///
632/// "DSDT" Differentiated System Description Table.
633///
634#define EFI_ACPI_1_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('D', 'S', 'D', 'T')
635
636///
637/// "FACS" Firmware ACPI Control Structure.
638///
639#define EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'S')
640
641///
642/// "FACP" Fixed ACPI Description Table.
643///
644#define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'P')
645
646///
647/// "PSDT" Persistent System Description Table.
648///
649#define EFI_ACPI_1_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('P', 'S', 'D', 'T')
650
651///
652/// "RSDT" Root System Description Table.
653///
654#define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('R', 'S', 'D', 'T')
655
656///
657/// "SBST" Smart Battery Specification Table.
658///
659#define EFI_ACPI_1_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE SIGNATURE_32('S', 'B', 'S', 'T')
660
661///
662/// "SSDT" Secondary System Description Table.
663///
664#define EFI_ACPI_1_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('S', 'S', 'D', 'T')
665
666#pragma pack()
unsigned short UINT16
2-byte unsigned value.
unsigned long long UINT64
8-byte unsigned value.
unsigned char UINT8
1-byte unsigned value.
unsigned int UINT32
4-byte unsigned value.
UINT8 ResType
Definition Acpi10.h:121
UINT64 AddrRangeMin
Definition Acpi10.h:125
PACKED struct @227247123332077166066161132023247065141323042164 EFI_ACPI_DMA_DESCRIPTOR
DMA Descriptor.
PACKED struct @076237114001023334235305306253055271250234102116 EFI_ACPI_IRQ_NOFLAG_DESCRIPTOR
IRQ Descriptor.
UINT8 ChannelMask
Definition Acpi10.h:173
PACKED struct @353215227041375130360056216056366322300031324221 EFI_ACPI_WORD_ADDRESS_SPACE_DESCRIPTOR
WORD Address Space Descriptor.
UINT64 AddrSpaceGranularity
Definition Acpi10.h:124
UINT8 Information
Definition Acpi10.h:165
PACKED struct @261327014120320200040134046062170334032016331337 EFI_ACPI_IO_PORT_DESCRIPTOR
I/O Port Descriptor.
UINT16 BaseAddress
Definition Acpi10.h:194
UINT8 SpecificFlag
Definition Acpi10.h:123
UINT64 AddrTranslationOffset
Definition Acpi10.h:127
UINT16 BaseAddressMin
Definition Acpi10.h:183
PACKED struct @070126363266142000122014272037224307124317056203 EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
The common definition of QWORD, DWORD, and WORD Address Space Descriptors.
PACKED struct @377012342272350211221350135141225373040123366024 EFI_ACPI_DWORD_ADDRESS_SPACE_DESCRIPTOR
DWORD Address Space Descriptor.
UINT16 BaseAddressMax
Definition Acpi10.h:184
UINT8 InterruptTableLength
Definition Acpi10.h:283
UINT64 AddrLen
Definition Acpi10.h:128
UINT8 Name
Definition Acpi10.h:135
UINT32 InterruptNumber[1]
Definition Acpi10.h:284
PACKED struct @306176217015200260143323171142141232265330211254::@257346040113042050160177011172173346053034203263 Bits
UINT8 GenFlag
Definition Acpi10.h:122
PACKED struct @322164373304052060305030263006055262163126106103 EFI_ACPI_EXTENDED_INTERRUPT_DESCRIPTOR
Extended Interrupt Descriptor.
PACKED union @306176217015200260143323171142141232265330211254 ACPI_SMALL_RESOURCE_HEADER
PACKED struct @300236171037157050314047353342111247347045220320 EFI_ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR
32-Bit Memory Range Descriptor
UINT16 Mask
Definition Acpi10.h:156
PACKED struct @165104130223077263224044232125337106163015377141 ACPI_LARGE_RESOURCE_HEADER
UINT8 Type
Definition Acpi10.h:136
PACKED struct @217250170034264011120252170177365075310053270036 EFI_ACPI_24_BIT_MEMORY_RANGE_DESCRIPTOR
24-Bit Memory Range Descriptor
UINT64 AddrRangeMax
Definition Acpi10.h:126
UINT8 InterruptVectorFlags
Definition Acpi10.h:282
UINT8 Byte
Definition Acpi10.h:132
UINT8 Desc
Definition Acpi10.h:119
UINT8 Alignment
Definition Acpi10.h:185
PACKED struct @302153152003011147117230130025116227326340051011 EFI_ACPI_IRQ_DESCRIPTOR
IRQ Descriptor.
PACKED union @165104130223077263224044232125337106163015377141::@273126103036270271166311122320164340317073026312 Header
Definition Acpi10.h:155
PACKED struct @046304245237222140166043120272364245326314043312 EFI_ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR
QWORD Address Space Descriptor.
UINT16 Len
Definition Acpi10.h:120
PACKED struct @302330271104021245050051323273102313354336076200 EFI_ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR
Fixed 32-Bit Fixed Memory Range Descriptor.
PACKED struct @055232371034011371332300342010216377256100312343 EFI_ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR
Fixed Location I/O Port Descriptor.
This file contains AML code definition in the latest ACPI spec.
#define PACKED
Definition Base.h:209
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:921
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:951
UINT8_t Length
Length of this structure.
Definition pxe_api.h:13
Firmware ACPI Control Structure.
Definition Acpi10.h:494
Fixed ACPI Description Table Structure (FADT).
Definition Acpi10.h:425
EFI_ACPI_DESCRIPTION_HEADER Header
Definition Acpi10.h:426
Interrupt Source Override Structure.
Definition Acpi10.h:577
IO APIC Structure.
Definition Acpi10.h:565
Local APIC NMI Structure.
Definition Acpi10.h:599
Multiple APIC Description Table header definition.
Definition Acpi10.h:514
Non-Maskable Interrupt Source Structure.
Definition Acpi10.h:589
Processor Local APIC Structure Definition.
Definition Acpi10.h:549
Root System Description Pointer Structure.
Definition Acpi10.h:403
Smart Battery Description Table (SBST)
Definition Acpi10.h:610
EFI_ACPI_DESCRIPTION_HEADER Header
Definition Acpi10.h:611
Common table header, this prefaces all ACPI tables, including FACS, but excluding the RSD PTR structu...
Definition Acpi10.h:20
The common ACPI description table header.
Definition Acpi10.h:29
The End tag identifies an end of resource data.
Definition Acpi10.h:292