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