TianoCore EDK2 master
Loading...
Searching...
No Matches
Acpi10.h
Go to the documentation of this file.
1
9#ifndef _ACPI_1_0_H_
10#define _ACPI_1_0_H_
11
13
18typedef struct {
19 UINT32 Signature;
20 UINT32 Length;
22
23#pragma pack(1)
27typedef struct {
28 UINT32 Signature;
29 UINT32 Length;
30 UINT8 Revision;
31 UINT8 Checksum;
32 UINT8 OemId[6];
33 UINT64 OemTableId;
34 UINT32 OemRevision;
35 UINT32 CreatorId;
36 UINT32 CreatorRevision;
38#pragma pack()
39
40//
41// Define for Descriptor
42//
43#define ACPI_SMALL_ITEM_FLAG 0x00
44#define ACPI_LARGE_ITEM_FLAG 0x01
45
46//
47// Small Item Descriptor Name
48//
49#define ACPI_SMALL_IRQ_DESCRIPTOR_NAME 0x04
50#define ACPI_SMALL_DMA_DESCRIPTOR_NAME 0x05
51#define ACPI_SMALL_START_DEPENDENT_DESCRIPTOR_NAME 0x06
52#define ACPI_SMALL_END_DEPENDENT_DESCRIPTOR_NAME 0x07
53#define ACPI_SMALL_IO_PORT_DESCRIPTOR_NAME 0x08
54#define ACPI_SMALL_FIXED_IO_PORT_DESCRIPTOR_NAME 0x09
55#define ACPI_SMALL_VENDOR_DEFINED_DESCRIPTOR_NAME 0x0E
56#define ACPI_SMALL_END_TAG_DESCRIPTOR_NAME 0x0F
57
58//
59// Large Item Descriptor Name
60//
61#define ACPI_LARGE_24_BIT_MEMORY_RANGE_DESCRIPTOR_NAME 0x01
62#define ACPI_LARGE_VENDOR_DEFINED_DESCRIPTOR_NAME 0x04
63#define ACPI_LARGE_32_BIT_MEMORY_RANGE_DESCRIPTOR_NAME 0x05
64#define ACPI_LARGE_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR_NAME 0x06
65#define ACPI_LARGE_DWORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x07
66#define ACPI_LARGE_WORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x08
67#define ACPI_LARGE_EXTENDED_IRQ_DESCRIPTOR_NAME 0x09
68#define ACPI_LARGE_QWORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x0A
69
70//
71// Small Item Descriptor Value
72//
73#define ACPI_IRQ_NOFLAG_DESCRIPTOR 0x22
74#define ACPI_IRQ_DESCRIPTOR 0x23
75#define ACPI_DMA_DESCRIPTOR 0x2A
76#define ACPI_START_DEPENDENT_DESCRIPTOR 0x30
77#define ACPI_START_DEPENDENT_EX_DESCRIPTOR 0x31
78#define ACPI_END_DEPENDENT_DESCRIPTOR 0x38
79#define ACPI_IO_PORT_DESCRIPTOR 0x47
80#define ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR 0x4B
81#define ACPI_END_TAG_DESCRIPTOR 0x79
82
83//
84// Large Item Descriptor Value
85//
86#define ACPI_24_BIT_MEMORY_RANGE_DESCRIPTOR 0x81
87#define ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR 0x85
88#define ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR 0x86
89#define ACPI_DWORD_ADDRESS_SPACE_DESCRIPTOR 0x87
90#define ACPI_WORD_ADDRESS_SPACE_DESCRIPTOR 0x88
91#define ACPI_EXTENDED_INTERRUPT_DESCRIPTOR 0x89
92#define ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR 0x8A
93#define ACPI_ADDRESS_SPACE_DESCRIPTOR 0x8A
94
95//
96// Resource Type
97//
98#define ACPI_ADDRESS_SPACE_TYPE_MEM 0x00
99#define ACPI_ADDRESS_SPACE_TYPE_IO 0x01
100#define ACPI_ADDRESS_SPACE_TYPE_BUS 0x02
101
105#define ACPI_TIMER_FREQUENCY 3579545
106
107//
108// Ensure proper structure formats
109//
110#pragma pack(1)
111
116typedef PACKED struct {
117 UINT8 Desc;
118 UINT16 Len;
119 UINT8 ResType;
120 UINT8 GenFlag;
121 UINT8 SpecificFlag;
122 UINT64 AddrSpaceGranularity;
123 UINT64 AddrRangeMin;
124 UINT64 AddrRangeMax;
125 UINT64 AddrTranslationOffset;
126 UINT64 AddrLen;
128
129typedef PACKED union {
130 UINT8 Byte;
131 PACKED struct {
132 UINT8 Length : 3;
133 UINT8 Name : 4;
134 UINT8 Type : 1;
135 } Bits;
136} ACPI_SMALL_RESOURCE_HEADER;
137
138typedef PACKED struct {
139 PACKED union {
140 UINT8 Byte;
141 PACKED struct {
142 UINT8 Name : 7;
143 UINT8 Type : 1;
144 } Bits;
145 } Header;
146 UINT16 Length;
147} ACPI_LARGE_RESOURCE_HEADER;
148
152typedef PACKED struct {
153 ACPI_SMALL_RESOURCE_HEADER Header;
154 UINT16 Mask;
156
160typedef PACKED struct {
161 ACPI_SMALL_RESOURCE_HEADER Header;
162 UINT16 Mask;
163 UINT8 Information;
165
169typedef PACKED struct {
170 ACPI_SMALL_RESOURCE_HEADER Header;
171 UINT8 ChannelMask;
172 UINT8 Information;
174
178typedef PACKED struct {
179 ACPI_SMALL_RESOURCE_HEADER Header;
180 UINT8 Information;
181 UINT16 BaseAddressMin;
182 UINT16 BaseAddressMax;
183 UINT8 Alignment;
184 UINT8 Length;
186
190typedef PACKED struct {
191 ACPI_SMALL_RESOURCE_HEADER Header;
192 UINT16 BaseAddress;
193 UINT8 Length;
195
199typedef PACKED struct {
200 ACPI_LARGE_RESOURCE_HEADER Header;
201 UINT8 Information;
202 UINT16 BaseAddressMin;
203 UINT16 BaseAddressMax;
204 UINT16 Alignment;
205 UINT16 Length;
207
211typedef PACKED struct {
212 ACPI_LARGE_RESOURCE_HEADER Header;
213 UINT8 Information;
214 UINT32 BaseAddressMin;
215 UINT32 BaseAddressMax;
216 UINT32 Alignment;
217 UINT32 Length;
219
223typedef PACKED struct {
224 ACPI_LARGE_RESOURCE_HEADER Header;
225 UINT8 Information;
226 UINT32 BaseAddress;
227 UINT32 Length;
229
233typedef PACKED struct {
234 ACPI_LARGE_RESOURCE_HEADER Header;
235 UINT8 ResType;
236 UINT8 GenFlag;
237 UINT8 SpecificFlag;
238 UINT64 AddrSpaceGranularity;
239 UINT64 AddrRangeMin;
240 UINT64 AddrRangeMax;
241 UINT64 AddrTranslationOffset;
242 UINT64 AddrLen;
244
248typedef PACKED struct {
249 ACPI_LARGE_RESOURCE_HEADER Header;
250 UINT8 ResType;
251 UINT8 GenFlag;
252 UINT8 SpecificFlag;
253 UINT32 AddrSpaceGranularity;
254 UINT32 AddrRangeMin;
255 UINT32 AddrRangeMax;
256 UINT32 AddrTranslationOffset;
257 UINT32 AddrLen;
259
263typedef PACKED struct {
264 ACPI_LARGE_RESOURCE_HEADER Header;
265 UINT8 ResType;
266 UINT8 GenFlag;
267 UINT8 SpecificFlag;
268 UINT16 AddrSpaceGranularity;
269 UINT16 AddrRangeMin;
270 UINT16 AddrRangeMax;
271 UINT16 AddrTranslationOffset;
272 UINT16 AddrLen;
274
278typedef PACKED struct {
279 ACPI_LARGE_RESOURCE_HEADER Header;
280 UINT8 InterruptVectorFlags;
281 UINT8 InterruptTableLength;
282 UINT32 InterruptNumber[1];
284
285#pragma pack()
286
290typedef struct {
291 UINT8 Desc;
292 UINT8 Checksum;
294
295//
296// General use definitions
297//
298#define EFI_ACPI_RESERVED_BYTE 0x00
299#define EFI_ACPI_RESERVED_WORD 0x0000
300#define EFI_ACPI_RESERVED_DWORD 0x00000000
301#define EFI_ACPI_RESERVED_QWORD 0x0000000000000000
302
303//
304// Resource Type Specific Flags
305// Ref ACPI specification 6.4.3.5.5
306//
307// Bit [0] : Write Status, _RW
308//
309#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_WRITE (1 << 0)
310#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_ONLY (0 << 0)
311//
312// Bit [2:1] : Memory Attributes, _MEM
313//
314#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_NON_CACHEABLE (0 << 1)
315#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE (1 << 1)
316#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_WRITE_COMBINING (2 << 1)
317#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE (3 << 1)
318//
319// Bit [4:3] : Memory Attributes, _MTP
320//
321#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMORY (0 << 3)
322#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERVED (1 << 3)
323#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI (2 << 3)
324#define EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS (3 << 3)
325//
326// Bit [5] : Memory to I/O Translation, _TTP
327//
328#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_TRANSLATION (1 << 5)
329#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC (0 << 5)
330
331//
332// IRQ Information
333// Ref ACPI specification 6.4.2.1
334//
335#define EFI_ACPI_IRQ_SHARABLE_MASK 0x10
336#define EFI_ACPI_IRQ_SHARABLE 0x10
337
338#define EFI_ACPI_IRQ_POLARITY_MASK 0x08
339#define EFI_ACPI_IRQ_HIGH_TRUE 0x00
340#define EFI_ACPI_IRQ_LOW_FALSE 0x08
341
342#define EFI_ACPI_IRQ_MODE 0x01
343#define EFI_ACPI_IRQ_LEVEL_TRIGGERED 0x00
344#define EFI_ACPI_IRQ_EDGE_TRIGGERED 0x01
345
346//
347// DMA Information
348// Ref ACPI specification 6.4.2.2
349//
350#define EFI_ACPI_DMA_SPEED_TYPE_MASK 0x60
351#define EFI_ACPI_DMA_SPEED_TYPE_COMPATIBILITY 0x00
352#define EFI_ACPI_DMA_SPEED_TYPE_A 0x20
353#define EFI_ACPI_DMA_SPEED_TYPE_B 0x40
354#define EFI_ACPI_DMA_SPEED_TYPE_F 0x60
355
356#define EFI_ACPI_DMA_BUS_MASTER_MASK 0x04
357#define EFI_ACPI_DMA_BUS_MASTER 0x04
358
359#define EFI_ACPI_DMA_TRANSFER_TYPE_MASK 0x03
360#define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT 0x00
361#define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT_AND_16_BIT 0x01
362#define EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT 0x02
363
364//
365// IO Information
366// Ref ACPI specification 6.4.2.5
367//
368#define EFI_ACPI_IO_DECODE_MASK 0x01
369#define EFI_ACPI_IO_DECODE_16_BIT 0x01
370#define EFI_ACPI_IO_DECODE_10_BIT 0x00
371
372//
373// Memory Information
374// Ref ACPI specification 6.4.3.4
375//
376#define EFI_ACPI_MEMORY_WRITE_STATUS_MASK 0x01
377#define EFI_ACPI_MEMORY_WRITABLE 0x01
378#define EFI_ACPI_MEMORY_NON_WRITABLE 0x00
379
380//
381// Interrupt Vector Flags definitions for Extended Interrupt Descriptor
382// Ref ACPI specification 6.4.3.6
383//
384#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_PRODUCER_CONSUMER_MASK BIT0
385#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_MODE_MASK BIT1
386#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_POLARITY_MASK BIT2
387#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_SHARABLE_MASK BIT3
388#define EFI_ACPI_EXTENDED_INTERRUPT_FLAG_WAKE_CAPABLITY_MASK BIT4
389
390//
391// Ensure proper structure formats
392//
393#pragma pack(1)
394//
395// ACPI 1.0b table structures
396//
397
401typedef struct {
402 UINT64 Signature;
403 UINT8 Checksum;
404 UINT8 OemId[6];
405 UINT8 Reserved;
406 UINT32 RsdtAddress;
408
409//
410// Root System Description Table
411// No definition needed as it is a common description table header, the same with
412// EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT32 table pointers.
413//
414
418#define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
419
423typedef struct {
425 UINT32 FirmwareCtrl;
426 UINT32 Dsdt;
427 UINT8 IntModel;
428 UINT8 Reserved1;
429 UINT16 SciInt;
430 UINT32 SmiCmd;
431 UINT8 AcpiEnable;
432 UINT8 AcpiDisable;
433 UINT8 S4BiosReq;
434 UINT8 Reserved2;
435 UINT32 Pm1aEvtBlk;
436 UINT32 Pm1bEvtBlk;
437 UINT32 Pm1aCntBlk;
438 UINT32 Pm1bCntBlk;
439 UINT32 Pm2CntBlk;
440 UINT32 PmTmrBlk;
441 UINT32 Gpe0Blk;
442 UINT32 Gpe1Blk;
443 UINT8 Pm1EvtLen;
444 UINT8 Pm1CntLen;
445 UINT8 Pm2CntLen;
446 UINT8 PmTmLen;
447 UINT8 Gpe0BlkLen;
448 UINT8 Gpe1BlkLen;
449 UINT8 Gpe1Base;
450 UINT8 Reserved3;
451 UINT16 PLvl2Lat;
452 UINT16 PLvl3Lat;
453 UINT16 FlushSize;
454 UINT16 FlushStride;
455 UINT8 DutyOffset;
456 UINT8 DutyWidth;
457 UINT8 DayAlrm;
458 UINT8 MonAlrm;
459 UINT8 Century;
460 UINT8 Reserved4;
461 UINT8 Reserved5;
462 UINT8 Reserved6;
463 UINT32 Flags;
465
469#define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x01
470
471#define EFI_ACPI_1_0_INT_MODE_DUAL_PIC 0
472#define EFI_ACPI_1_0_INT_MODE_MULTIPLE_APIC 1
473
474//
475// Fixed ACPI Description Table Fixed Feature Flags
476// All other bits are reserved and must be set to 0.
477//
478#define EFI_ACPI_1_0_WBINVD BIT0
479#define EFI_ACPI_1_0_WBINVD_FLUSH BIT1
480#define EFI_ACPI_1_0_PROC_C1 BIT2
481#define EFI_ACPI_1_0_P_LVL2_UP BIT3
482#define EFI_ACPI_1_0_PWR_BUTTON BIT4
483#define EFI_ACPI_1_0_SLP_BUTTON BIT5
484#define EFI_ACPI_1_0_FIX_RTC BIT6
485#define EFI_ACPI_1_0_RTC_S4 BIT7
486#define EFI_ACPI_1_0_TMR_VAL_EXT BIT8
487#define EFI_ACPI_1_0_DCK_CAP BIT9
488
492typedef struct {
493 UINT32 Signature;
494 UINT32 Length;
495 UINT32 HardwareSignature;
496 UINT32 FirmwareWakingVector;
497 UINT32 GlobalLock;
498 UINT32 Flags;
499 UINT8 Reserved[40];
501
506#define EFI_ACPI_1_0_S4BIOS_F BIT0
507
512typedef struct {
514 UINT32 LocalApicAddress;
515 UINT32 Flags;
517
521#define EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
522
527#define EFI_ACPI_1_0_PCAT_COMPAT BIT0
528
529//
530// Multiple APIC Description Table APIC structure types
531// All other values between 0x05 an 0xFF are reserved and
532// will be ignored by OSPM.
533//
534#define EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC 0x00
535#define EFI_ACPI_1_0_IO_APIC 0x01
536#define EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE 0x02
537#define EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
538#define EFI_ACPI_1_0_LOCAL_APIC_NMI 0x04
539
540//
541// APIC Structure Definitions
542//
543
547typedef struct {
548 UINT8 Type;
549 UINT8 Length;
550 UINT8 AcpiProcessorId;
551 UINT8 ApicId;
552 UINT32 Flags;
554
558#define EFI_ACPI_1_0_LOCAL_APIC_ENABLED BIT0
559
563typedef struct {
564 UINT8 Type;
565 UINT8 Length;
566 UINT8 IoApicId;
567 UINT8 Reserved;
568 UINT32 IoApicAddress;
569 UINT32 SystemVectorBase;
571
575typedef struct {
576 UINT8 Type;
577 UINT8 Length;
578 UINT8 Bus;
579 UINT8 Source;
580 UINT32 GlobalSystemInterruptVector;
581 UINT16 Flags;
583
587typedef struct {
588 UINT8 Type;
589 UINT8 Length;
590 UINT16 Flags;
591 UINT32 GlobalSystemInterruptVector;
593
597typedef struct {
598 UINT8 Type;
599 UINT8 Length;
600 UINT8 AcpiProcessorId;
601 UINT16 Flags;
602 UINT8 LocalApicInti;
604
608typedef struct {
610 UINT32 WarningEnergyLevel;
611 UINT32 LowEnergyLevel;
612 UINT32 CriticalEnergyLevel;
614
615//
616// Known table signatures
617//
618
622#define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE SIGNATURE_64('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ')
623
627#define EFI_ACPI_1_0_APIC_SIGNATURE SIGNATURE_32('A', 'P', 'I', 'C')
628
632#define EFI_ACPI_1_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('D', 'S', 'D', 'T')
633
637#define EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'S')
638
642#define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'P')
643
647#define EFI_ACPI_1_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('P', 'S', 'D', 'T')
648
652#define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('R', 'S', 'D', 'T')
653
657#define EFI_ACPI_1_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE SIGNATURE_32('S', 'B', 'S', 'T')
658
662#define EFI_ACPI_1_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('S', 'S', 'D', 'T')
663
664#pragma pack()
665
666#endif
PACKED struct @101 EFI_ACPI_DWORD_ADDRESS_SPACE_DESCRIPTOR
PACKED struct @97 EFI_ACPI_24_BIT_MEMORY_RANGE_DESCRIPTOR
PACKED struct @94 EFI_ACPI_DMA_DESCRIPTOR
PACKED struct @103 EFI_ACPI_EXTENDED_INTERRUPT_DESCRIPTOR
PACKED struct @96 EFI_ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR
PACKED struct @100 EFI_ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR
PACKED struct @95 EFI_ACPI_IO_PORT_DESCRIPTOR
PACKED struct @99 EFI_ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR
PACKED struct @93 EFI_ACPI_IRQ_DESCRIPTOR
PACKED struct @89 EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
PACKED struct @92 EFI_ACPI_IRQ_NOFLAG_DESCRIPTOR
PACKED struct @98 EFI_ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR
PACKED struct @102 EFI_ACPI_WORD_ADDRESS_SPACE_DESCRIPTOR