]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/IndustryStandard/Acpi20.h
add #pragma pack(1) for some structures.
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / Acpi20.h
1 /** @file
2 ACPI 2.0 definitions from the ACPI Specification, revision 2.0
3
4 Copyright (c) 2006 - 2008, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
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.
12 **/
13
14 #ifndef _ACPI_2_0_H_
15 #define _ACPI_2_0_H_
16
17 #include <IndustryStandard/Acpi10.h>
18
19 //
20 // Ensure proper structure formats
21 //
22 #pragma pack(1)
23
24 ///
25 /// ACPI 2.0 Generic Address Space definition
26 ///
27 typedef struct {
28 UINT8 AddressSpaceId;
29 UINT8 RegisterBitWidth;
30 UINT8 RegisterBitOffset;
31 UINT8 Reserved;
32 UINT64 Address;
33 } EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE;
34
35 #pragma pack()
36
37 //
38 // Generic Address Space Address IDs
39 //
40 #define EFI_ACPI_2_0_SYSTEM_MEMORY 0
41 #define EFI_ACPI_2_0_SYSTEM_IO 1
42 #define EFI_ACPI_2_0_PCI_CONFIGURATION_SPACE 2
43 #define EFI_ACPI_2_0_EMBEDDED_CONTROLLER 3
44 #define EFI_ACPI_2_0_SMBUS 4
45 #define EFI_ACPI_2_0_FUNCTIONAL_FIXED_HARDWARE 0x7F
46
47 //
48 // ACPI 2.0 table structures
49 //
50
51 ///
52 /// Root System Description Pointer Structure
53 ///
54 typedef struct {
55 UINT64 Signature;
56 UINT8 Checksum;
57 UINT8 OemId[6];
58 UINT8 Revision;
59 UINT32 RsdtAddress;
60 UINT32 Length;
61 UINT64 XsdtAddress;
62 UINT8 ExtendedChecksum;
63 UINT8 Reserved[3];
64 } EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
65
66 ///
67 /// RSD_PTR Revision (as defined in ACPI 2.0 spec.)
68 ///
69 #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION 0x02
70
71 ///
72 /// Common table header, this prefaces all ACPI tables, including FACS, but
73 /// excluding the RSD PTR structure
74 ///
75 typedef struct {
76 UINT32 Signature;
77 UINT32 Length;
78 } EFI_ACPI_2_0_COMMON_HEADER;
79
80 //
81 // Root System Description Table
82 // No definition needed as it is a common description table header, the same with
83 // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT32 table pointers.
84 //
85
86 ///
87 /// RSDT Revision (as defined in ACPI 2.0 spec.)
88 ///
89 #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
90
91 //
92 // Extended System Description Table
93 // No definition needed as it is a common description table header, the same with
94 // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT64 table pointers.
95 //
96
97 ///
98 /// XSDT Revision (as defined in ACPI 2.0 spec.)
99 ///
100 #define EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
101
102 //
103 // Ensure proper structure formats
104 //
105 #pragma pack(1)
106 ///
107 /// Fixed ACPI Description Table Structure (FADT)
108 ///
109 typedef struct {
110 EFI_ACPI_DESCRIPTION_HEADER Header;
111 UINT32 FirmwareCtrl;
112 UINT32 Dsdt;
113 UINT8 Reserved0;
114 UINT8 PreferredPmProfile;
115 UINT16 SciInt;
116 UINT32 SmiCmd;
117 UINT8 AcpiEnable;
118 UINT8 AcpiDisable;
119 UINT8 S4BiosReq;
120 UINT8 PstateCnt;
121 UINT32 Pm1aEvtBlk;
122 UINT32 Pm1bEvtBlk;
123 UINT32 Pm1aCntBlk;
124 UINT32 Pm1bCntBlk;
125 UINT32 Pm2CntBlk;
126 UINT32 PmTmrBlk;
127 UINT32 Gpe0Blk;
128 UINT32 Gpe1Blk;
129 UINT8 Pm1EvtLen;
130 UINT8 Pm1CntLen;
131 UINT8 Pm2CntLen;
132 UINT8 PmTmrLen;
133 UINT8 Gpe0BlkLen;
134 UINT8 Gpe1BlkLen;
135 UINT8 Gpe1Base;
136 UINT8 CstCnt;
137 UINT16 PLvl2Lat;
138 UINT16 PLvl3Lat;
139 UINT16 FlushSize;
140 UINT16 FlushStride;
141 UINT8 DutyOffset;
142 UINT8 DutyWidth;
143 UINT8 DayAlrm;
144 UINT8 MonAlrm;
145 UINT8 Century;
146 UINT16 IaPcBootArch;
147 UINT8 Reserved1;
148 UINT32 Flags;
149 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE ResetReg;
150 UINT8 ResetValue;
151 UINT8 Reserved2[3];
152 UINT64 XFirmwareCtrl;
153 UINT64 XDsdt;
154 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aEvtBlk;
155 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bEvtBlk;
156 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1aCntBlk;
157 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm1bCntBlk;
158 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPm2CntBlk;
159 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XPmTmrBlk;
160 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe0Blk;
161 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE XGpe1Blk;
162 } EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE;
163 #pragma pack()
164
165 ///
166 /// FADT Version (as defined in ACPI 2.0 spec.)
167 ///
168 #define EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x03
169
170 //
171 // Fixed ACPI Description Table Boot Architecture Flags
172 // All other bits are reserved and must be set to 0.
173 //
174 #define EFI_ACPI_2_0_LEGACY_DEVICES BIT0
175 #define EFI_ACPI_2_0_8042 BIT1
176
177 //
178 // Fixed ACPI Description Table Fixed Feature Flags
179 // All other bits are reserved and must be set to 0.
180 //
181 #define EFI_ACPI_2_0_WBINVD BIT0
182 #define EFI_ACPI_2_0_WBINVD_FLUSH BIT1
183 #define EFI_ACPI_2_0_PROC_C1 BIT2
184 #define EFI_ACPI_2_0_P_LVL2_UP BIT3
185 #define EFI_ACPI_2_0_PWR_BUTTON BIT4
186 #define EFI_ACPI_2_0_SLP_BUTTON BIT5
187 #define EFI_ACPI_2_0_FIX_RTC BIT6
188 #define EFI_ACPI_2_0_RTC_S4 BIT7
189 #define EFI_ACPI_2_0_TMR_VAL_EXT BIT8
190 #define EFI_ACPI_2_0_DCK_CAP BIT9
191 #define EFI_ACPI_2_0_RESET_REG_SUP BIT10
192 #define EFI_ACPI_2_0_SEALED_CASE BIT11
193 #define EFI_ACPI_2_0_HEADLESS BIT12
194 #define EFI_ACPI_2_0_CPU_SW_SLP BIT13
195
196 ///
197 /// Firmware ACPI Control Structure
198 ///
199 typedef struct {
200 UINT32 Signature;
201 UINT32 Length;
202 UINT32 HardwareSignature;
203 UINT32 FirmwareWakingVector;
204 UINT32 GlobalLock;
205 UINT32 Flags;
206 UINT64 XFirmwareWakingVector;
207 UINT8 Version;
208 UINT8 Reserved[31];
209 } EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
210
211 ///
212 /// FACS Version (as defined in ACPI 2.0 spec.)
213 ///
214 #define EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION 0x01
215
216 ///
217 /// Firmware Control Structure Feature Flags
218 /// All other bits are reserved and must be set to 0.
219 ///
220 #define EFI_ACPI_2_0_S4BIOS_F BIT0
221
222 ///
223 /// Multiple APIC Description Table header definition. The rest of the table
224 /// must be defined in a platform specific manner.
225 ///
226 typedef struct {
227 EFI_ACPI_DESCRIPTION_HEADER Header;
228 UINT32 LocalApicAddress;
229 UINT32 Flags;
230 } EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
231
232 ///
233 /// MADT Revision (as defined in ACPI 2.0 spec.)
234 ///
235 #define EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
236
237 ///
238 /// Multiple APIC Flags
239 /// All other bits are reserved and must be set to 0.
240 ///
241 #define EFI_ACPI_2_0_PCAT_COMPAT BIT0
242
243 //
244 // Multiple APIC Description Table APIC structure types
245 // All other values between 0x09 an 0xFF are reserved and
246 // will be ignored by OSPM.
247 //
248 #define EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC 0x00
249 #define EFI_ACPI_2_0_IO_APIC 0x01
250 #define EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE 0x02
251 #define EFI_ACPI_2_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
252 #define EFI_ACPI_2_0_LOCAL_APIC_NMI 0x04
253 #define EFI_ACPI_2_0_LOCAL_APIC_ADDRESS_OVERRIDE 0x05
254 #define EFI_ACPI_2_0_IO_SAPIC 0x06
255 #define EFI_ACPI_2_0_PROCESSOR_LOCAL_SAPIC 0x07
256 #define EFI_ACPI_2_0_PLATFORM_INTERRUPT_SOURCES 0x08
257
258 //
259 // APIC Structure Definitions
260 //
261
262 ///
263 /// Processor Local APIC Structure Definition
264 ///
265 typedef struct {
266 UINT8 Type;
267 UINT8 Length;
268 UINT8 AcpiProcessorId;
269 UINT8 ApicId;
270 UINT32 Flags;
271 } EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
272
273 ///
274 /// Local APIC Flags. All other bits are reserved and must be 0.
275 ///
276 #define EFI_ACPI_2_0_LOCAL_APIC_ENABLED BIT0
277
278 ///
279 /// IO APIC Structure
280 ///
281 typedef struct {
282 UINT8 Type;
283 UINT8 Length;
284 UINT8 IoApicId;
285 UINT8 Reserved;
286 UINT32 IoApicAddress;
287 UINT32 GlobalSystemInterruptBase;
288 } EFI_ACPI_2_0_IO_APIC_STRUCTURE;
289
290 ///
291 /// Interrupt Source Override Structure
292 ///
293 typedef struct {
294 UINT8 Type;
295 UINT8 Length;
296 UINT8 Bus;
297 UINT8 Source;
298 UINT32 GlobalSystemInterrupt;
299 UINT16 Flags;
300 } EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
301
302 ///
303 /// Non-Maskable Interrupt Source Structure
304 ///
305 typedef struct {
306 UINT8 Type;
307 UINT8 Length;
308 UINT16 Flags;
309 UINT32 GlobalSystemInterrupt;
310 } EFI_ACPI_2_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
311
312 //
313 // Ensure proper structure formats
314 //
315 #pragma pack(1)
316
317 ///
318 /// Local APIC NMI Structure
319 ///
320 typedef struct {
321 UINT8 Type;
322 UINT8 Length;
323 UINT8 AcpiProcessorId;
324 UINT16 Flags;
325 UINT8 LocalApicLint;
326 } EFI_ACPI_2_0_LOCAL_APIC_NMI_STRUCTURE;
327
328 ///
329 /// Local APIC Address Override Structure
330 ///
331 typedef struct {
332 UINT8 Type;
333 UINT8 Length;
334 UINT16 Reserved;
335 UINT64 LocalApicAddress;
336 } EFI_ACPI_2_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
337
338 #pragma pack()
339
340 ///
341 /// IO SAPIC Structure
342 ///
343 typedef struct {
344 UINT8 Type;
345 UINT8 Length;
346 UINT8 IoApicId;
347 UINT8 Reserved;
348 UINT32 GlobalSystemInterruptBase;
349 UINT64 IoSapicAddress;
350 } EFI_ACPI_2_0_IO_SAPIC_STRUCTURE;
351
352 ///
353 /// Local SAPIC Structure
354 ///
355 typedef struct {
356 UINT8 Type;
357 UINT8 Length;
358 UINT8 AcpiProcessorId;
359 UINT8 LocalSapicId;
360 UINT8 LocalSapicEid;
361 UINT8 Reserved[3];
362 UINT32 Flags;
363 } EFI_ACPI_2_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
364
365 ///
366 /// Platform Interrupt Sources Structure
367 ///
368 typedef struct {
369 UINT8 Type;
370 UINT8 Length;
371 UINT16 Flags;
372 UINT8 InterruptType;
373 UINT8 ProcessorId;
374 UINT8 ProcessorEid;
375 UINT8 IoSapicVector;
376 UINT32 GlobalSystemInterrupt;
377 UINT32 Reserved;
378 } EFI_ACPI_2_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
379
380 ///
381 /// Smart Battery Description Table (SBST)
382 ///
383 typedef struct {
384 EFI_ACPI_DESCRIPTION_HEADER Header;
385 UINT32 WarningEnergyLevel;
386 UINT32 LowEnergyLevel;
387 UINT32 CriticalEnergyLevel;
388 } EFI_ACPI_2_0_SMART_BATTERY_DESCRIPTION_TABLE;
389
390 ///
391 /// SBST Version (as defined in ACPI 2.0 spec.)
392 ///
393 #define EFI_ACPI_2_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION 0x01
394
395 ///
396 /// Embedded Controller Boot Resources Table (ECDT)
397 /// The table is followed by a null terminated ASCII string that contains
398 /// a fully qualified reference to the name space object.
399 ///
400 typedef struct {
401 EFI_ACPI_DESCRIPTION_HEADER Header;
402 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE EcControl;
403 EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE EcData;
404 UINT32 Uid;
405 UINT8 GpeBit;
406 } EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
407
408 ///
409 /// ECDT Version (as defined in ACPI 2.0 spec.)
410 ///
411 #define EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_REVISION 0x01
412
413 //
414 // Known table signatures
415 //
416
417 ///
418 /// "RSD PTR " Root System Description Pointer
419 ///
420 #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE SIGNATURE_64('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ')
421
422 ///
423 /// "SPIC" Multiple SAPIC Description Table
424 ///
425 /// BUGBUG: Don't know where this came from except SR870BN4 uses it.
426 /// #define EFI_ACPI_2_0_MULTIPLE_SAPIC_DESCRIPTION_TABLE_SIGNATURE 0x43495053
427 ///
428 #define EFI_ACPI_2_0_MULTIPLE_SAPIC_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('S', 'P', 'I', 'C')
429
430 ///
431 /// "BOOT" MS Simple Boot Spec
432 ///
433 #define EFI_ACPI_2_0_SIMPLE_BOOT_FLAG_TABLE_SIGNATURE SIGNATURE_32('B', 'O', 'O', 'T')
434
435 ///
436 /// "DBGP" MS Bebug Port Spec
437 ///
438 #define EFI_ACPI_2_0_DEBUG_PORT_TABLE_SIGNATURE SIGNATURE_32('D', 'B', 'G', 'P')
439
440 ///
441 /// "DSDT" Differentiated System Description Table
442 ///
443 #define EFI_ACPI_2_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('D', 'S', 'D', 'T')
444
445 ///
446 /// "ECDT" Embedded Controller Boot Resources Table
447 ///
448 #define EFI_ACPI_2_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_SIGNATURE SIGNATURE_32('E', 'C', 'D', 'T')
449
450 ///
451 /// "ETDT" Event Timer Description Table
452 ///
453 #define EFI_ACPI_2_0_EVENT_TIMER_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('E', 'T', 'D', 'T')
454
455 ///
456 /// "FACS" Firmware ACPI Control Structure
457 ///
458 #define EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'S')
459
460 ///
461 /// "FACP" Fixed ACPI Description Table
462 ///
463 #define EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'P')
464
465 ///
466 /// "APIC" Multiple APIC Description Table
467 ///
468 #define EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('A', 'P', 'I', 'C')
469
470 ///
471 /// "PSDT" Persistent System Description Table
472 ///
473 #define EFI_ACPI_2_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('P', 'S', 'D', 'T')
474
475 ///
476 /// "RSDT" Root System Description Table
477 ///
478 #define EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('R', 'S', 'D', 'T')
479
480 ///
481 /// "SBST" Smart Battery Specification Table
482 ///
483 #define EFI_ACPI_2_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE SIGNATURE_32('S', 'B', 'S', 'T')
484
485 ///
486 /// "SLIT" System Locality Information Table
487 ///
488 #define EFI_ACPI_2_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE SIGNATURE_32('S', 'L', 'I', 'T')
489
490 ///
491 /// "SPCR" Serial Port Concole Redirection Table
492 ///
493 #define EFI_ACPI_2_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE SIGNATURE_32('S', 'P', 'C', 'R')
494
495 ///
496 /// "SRAT" Static Resource Affinity Table
497 ///
498 #define EFI_ACPI_2_0_STATIC_RESOURCE_AFFINITY_TABLE_SIGNATURE SIGNATURE_32('S', 'R', 'A', 'T')
499
500 ///
501 /// "SSDT" Secondary System Description Table
502 ///
503 #define EFI_ACPI_2_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('S', 'S', 'D', 'T')
504
505 ///
506 /// "SPMI" Server Platform Management Interface Table
507 ///
508 #define EFI_ACPI_2_0_SERVER_PLATFORM_MANAGEMENT_INTERFACE_SIGNATURE SIGNATURE_32('S', 'P', 'M', 'I')
509
510 ///
511 /// "XSDT" Extended System Description Table
512 ///
513 #define EFI_ACPI_2_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('X', 'S', 'D', 'T')
514
515 ///
516 /// "MCFG" Static Resource Affinity Table
517 ///
518 #define EFI_ACPI_2_0_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_SIGNATURE SIGNATURE_32('M', 'C', 'F', 'G')
519
520 #endif