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