1 /** @file
2   ACPI 4.0 definitions from the ACPI Specification Revision 4.0a April 5, 2010
3 
4   Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
5   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_4_0_H_
15 #define _ACPI_4_0_H_
16 
17 FILE_LICENCE ( BSD3 );
18 
19 #include <ipxe/efi/IndustryStandard/Acpi30.h>
20 
21 //
22 // Ensure proper structure formats
23 //
24 #pragma pack(1)
25 
26 ///
27 /// ACPI 4.0 Generic Address Space definition
28 ///
29 typedef struct {
30   UINT8   AddressSpaceId;
31   UINT8   RegisterBitWidth;
32   UINT8   RegisterBitOffset;
33   UINT8   AccessSize;
34   UINT64  Address;
35 } EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE;
36 
37 //
38 // Generic Address Space Address IDs
39 //
40 #define EFI_ACPI_4_0_SYSTEM_MEMORY              0
41 #define EFI_ACPI_4_0_SYSTEM_IO                  1
42 #define EFI_ACPI_4_0_PCI_CONFIGURATION_SPACE    2
43 #define EFI_ACPI_4_0_EMBEDDED_CONTROLLER        3
44 #define EFI_ACPI_4_0_SMBUS                      4
45 #define EFI_ACPI_4_0_FUNCTIONAL_FIXED_HARDWARE  0x7F
46 
47 //
48 // Generic Address Space Access Sizes
49 //
50 #define EFI_ACPI_4_0_UNDEFINED  0
51 #define EFI_ACPI_4_0_BYTE       1
52 #define EFI_ACPI_4_0_WORD       2
53 #define EFI_ACPI_4_0_DWORD      3
54 #define EFI_ACPI_4_0_QWORD      4
55 
56 //
57 // ACPI 4.0 table structures
58 //
59 
60 ///
61 /// Root System Description Pointer Structure
62 ///
63 typedef struct {
64   UINT64  Signature;
65   UINT8   Checksum;
66   UINT8   OemId[6];
67   UINT8   Revision;
68   UINT32  RsdtAddress;
69   UINT32  Length;
70   UINT64  XsdtAddress;
71   UINT8   ExtendedChecksum;
72   UINT8   Reserved[3];
73 } EFI_ACPI_4_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
74 
75 ///
76 /// RSD_PTR Revision (as defined in ACPI 4.0b spec.)
77 ///
78 #define EFI_ACPI_4_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION 0x02  ///< ACPISpec (Revision 4.0a) says current value is 2
79 
80 ///
81 /// Common table header, this prefaces all ACPI tables, including FACS, but
82 /// excluding the RSD PTR structure
83 ///
84 typedef struct {
85   UINT32  Signature;
86   UINT32  Length;
87 } EFI_ACPI_4_0_COMMON_HEADER;
88 
89 //
90 // Root System Description Table
91 // No definition needed as it is a common description table header, the same with
92 // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT32 table pointers.
93 //
94 
95 ///
96 /// RSDT Revision (as defined in ACPI 4.0 spec.)
97 ///
98 #define EFI_ACPI_4_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
99 
100 //
101 // Extended System Description Table
102 // No definition needed as it is a common description table header, the same with
103 // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT64 table pointers.
104 //
105 
106 ///
107 /// XSDT Revision (as defined in ACPI 4.0 spec.)
108 ///
109 #define EFI_ACPI_4_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
110 
111 ///
112 /// Fixed ACPI Description Table Structure (FADT)
113 ///
114 typedef struct {
115   EFI_ACPI_DESCRIPTION_HEADER             Header;
116   UINT32                                  FirmwareCtrl;
117   UINT32                                  Dsdt;
118   UINT8                                   Reserved0;
119   UINT8                                   PreferredPmProfile;
120   UINT16                                  SciInt;
121   UINT32                                  SmiCmd;
122   UINT8                                   AcpiEnable;
123   UINT8                                   AcpiDisable;
124   UINT8                                   S4BiosReq;
125   UINT8                                   PstateCnt;
126   UINT32                                  Pm1aEvtBlk;
127   UINT32                                  Pm1bEvtBlk;
128   UINT32                                  Pm1aCntBlk;
129   UINT32                                  Pm1bCntBlk;
130   UINT32                                  Pm2CntBlk;
131   UINT32                                  PmTmrBlk;
132   UINT32                                  Gpe0Blk;
133   UINT32                                  Gpe1Blk;
134   UINT8                                   Pm1EvtLen;
135   UINT8                                   Pm1CntLen;
136   UINT8                                   Pm2CntLen;
137   UINT8                                   PmTmrLen;
138   UINT8                                   Gpe0BlkLen;
139   UINT8                                   Gpe1BlkLen;
140   UINT8                                   Gpe1Base;
141   UINT8                                   CstCnt;
142   UINT16                                  PLvl2Lat;
143   UINT16                                  PLvl3Lat;
144   UINT16                                  FlushSize;
145   UINT16                                  FlushStride;
146   UINT8                                   DutyOffset;
147   UINT8                                   DutyWidth;
148   UINT8                                   DayAlrm;
149   UINT8                                   MonAlrm;
150   UINT8                                   Century;
151   UINT16                                  IaPcBootArch;
152   UINT8                                   Reserved1;
153   UINT32                                  Flags;
154   EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  ResetReg;
155   UINT8                                   ResetValue;
156   UINT8                                   Reserved2[3];
157   UINT64                                  XFirmwareCtrl;
158   UINT64                                  XDsdt;
159   EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  XPm1aEvtBlk;
160   EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  XPm1bEvtBlk;
161   EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  XPm1aCntBlk;
162   EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  XPm1bCntBlk;
163   EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  XPm2CntBlk;
164   EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  XPmTmrBlk;
165   EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  XGpe0Blk;
166   EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  XGpe1Blk;
167 } EFI_ACPI_4_0_FIXED_ACPI_DESCRIPTION_TABLE;
168 
169 ///
170 /// FADT Version (as defined in ACPI 4.0 spec.)
171 ///
172 #define EFI_ACPI_4_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION  0x04
173 
174 //
175 // Fixed ACPI Description Table Preferred Power Management Profile
176 //
177 #define EFI_ACPI_4_0_PM_PROFILE_UNSPECIFIED         0
178 #define EFI_ACPI_4_0_PM_PROFILE_DESKTOP             1
179 #define EFI_ACPI_4_0_PM_PROFILE_MOBILE              2
180 #define EFI_ACPI_4_0_PM_PROFILE_WORKSTATION         3
181 #define EFI_ACPI_4_0_PM_PROFILE_ENTERPRISE_SERVER   4
182 #define EFI_ACPI_4_0_PM_PROFILE_SOHO_SERVER         5
183 #define EFI_ACPI_4_0_PM_PROFILE_APPLIANCE_PC        6
184 #define EFI_ACPI_4_0_PM_PROFILE_PERFORMANCE_SERVER  7
185 
186 //
187 // Fixed ACPI Description Table Boot Architecture Flags
188 // All other bits are reserved and must be set to 0.
189 //
190 #define EFI_ACPI_4_0_LEGACY_DEVICES              BIT0
191 #define EFI_ACPI_4_0_8042                        BIT1
192 #define EFI_ACPI_4_0_VGA_NOT_PRESENT             BIT2
193 #define EFI_ACPI_4_0_MSI_NOT_SUPPORTED           BIT3
194 #define EFI_ACPI_4_0_PCIE_ASPM_CONTROLS          BIT4
195 
196 //
197 // Fixed ACPI Description Table Fixed Feature Flags
198 // All other bits are reserved and must be set to 0.
199 //
200 #define EFI_ACPI_4_0_WBINVD                                 BIT0
201 #define EFI_ACPI_4_0_WBINVD_FLUSH                           BIT1
202 #define EFI_ACPI_4_0_PROC_C1                                BIT2
203 #define EFI_ACPI_4_0_P_LVL2_UP                              BIT3
204 #define EFI_ACPI_4_0_PWR_BUTTON                             BIT4
205 #define EFI_ACPI_4_0_SLP_BUTTON                             BIT5
206 #define EFI_ACPI_4_0_FIX_RTC                                BIT6
207 #define EFI_ACPI_4_0_RTC_S4                                 BIT7
208 #define EFI_ACPI_4_0_TMR_VAL_EXT                            BIT8
209 #define EFI_ACPI_4_0_DCK_CAP                                BIT9
210 #define EFI_ACPI_4_0_RESET_REG_SUP                          BIT10
211 #define EFI_ACPI_4_0_SEALED_CASE                            BIT11
212 #define EFI_ACPI_4_0_HEADLESS                               BIT12
213 #define EFI_ACPI_4_0_CPU_SW_SLP                             BIT13
214 #define EFI_ACPI_4_0_PCI_EXP_WAK                            BIT14
215 #define EFI_ACPI_4_0_USE_PLATFORM_CLOCK                     BIT15
216 #define EFI_ACPI_4_0_S4_RTC_STS_VALID                       BIT16
217 #define EFI_ACPI_4_0_REMOTE_POWER_ON_CAPABLE                BIT17
218 #define EFI_ACPI_4_0_FORCE_APIC_CLUSTER_MODEL               BIT18
219 #define EFI_ACPI_4_0_FORCE_APIC_PHYSICAL_DESTINATION_MODE   BIT19
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   Reserved0[3];
234   UINT32  OspmFlags;
235   UINT8   Reserved1[24];
236 } EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
237 
238 ///
239 /// FACS Version (as defined in ACPI 4.0 spec.)
240 ///
241 #define EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION  0x02
242 
243 ///
244 /// Firmware Control Structure Feature Flags
245 /// All other bits are reserved and must be set to 0.
246 ///
247 #define EFI_ACPI_4_0_S4BIOS_F                     BIT0
248 #define EFI_ACPI_4_0_64BIT_WAKE_SUPPORTED_F       BIT1
249 
250 ///
251 /// OSPM Enabled Firmware Control Structure Flags
252 /// All other bits are reserved and must be set to 0.
253 ///
254 #define EFI_ACPI_4_0_OSPM_64BIT_WAKE__F           BIT0
255 
256 //
257 // Differentiated System Description Table,
258 // Secondary System Description Table
259 // and Persistent System Description Table,
260 // no definition needed as they are common description table header, the same with
261 // EFI_ACPI_DESCRIPTION_HEADER, followed by a definition block.
262 //
263 #define EFI_ACPI_4_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_REVISION   0x02
264 #define EFI_ACPI_4_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_REVISION        0x02
265 
266 ///
267 /// Multiple APIC Description Table header definition.  The rest of the table
268 /// must be defined in a platform specific manner.
269 ///
270 typedef struct {
271   EFI_ACPI_DESCRIPTION_HEADER Header;
272   UINT32                      LocalApicAddress;
273   UINT32                      Flags;
274 } EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
275 
276 ///
277 /// MADT Revision (as defined in ACPI 4.0 spec.)
278 ///
279 #define EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x03
280 
281 ///
282 /// Multiple APIC Flags
283 /// All other bits are reserved and must be set to 0.
284 ///
285 #define EFI_ACPI_4_0_PCAT_COMPAT         BIT0
286 
287 //
288 // Multiple APIC Description Table APIC structure types
289 // All other values between 0x0B an 0xFF are reserved and
290 // will be ignored by OSPM.
291 //
292 #define EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC           0x00
293 #define EFI_ACPI_4_0_IO_APIC                        0x01
294 #define EFI_ACPI_4_0_INTERRUPT_SOURCE_OVERRIDE      0x02
295 #define EFI_ACPI_4_0_NON_MASKABLE_INTERRUPT_SOURCE  0x03
296 #define EFI_ACPI_4_0_LOCAL_APIC_NMI                 0x04
297 #define EFI_ACPI_4_0_LOCAL_APIC_ADDRESS_OVERRIDE    0x05
298 #define EFI_ACPI_4_0_IO_SAPIC                       0x06
299 #define EFI_ACPI_4_0_LOCAL_SAPIC                    0x07
300 #define EFI_ACPI_4_0_PLATFORM_INTERRUPT_SOURCES     0x08
301 #define EFI_ACPI_4_0_PROCESSOR_LOCAL_X2APIC         0x09
302 #define EFI_ACPI_4_0_LOCAL_X2APIC_NMI               0x0A
303 
304 //
305 // APIC Structure Definitions
306 //
307 
308 ///
309 /// Processor Local APIC Structure Definition
310 ///
311 typedef struct {
312   UINT8   Type;
313   UINT8   Length;
314   UINT8   AcpiProcessorId;
315   UINT8   ApicId;
316   UINT32  Flags;
317 } EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
318 
319 ///
320 /// Local APIC Flags.  All other bits are reserved and must be 0.
321 ///
322 #define EFI_ACPI_4_0_LOCAL_APIC_ENABLED        BIT0
323 
324 ///
325 /// IO APIC Structure
326 ///
327 typedef struct {
328   UINT8   Type;
329   UINT8   Length;
330   UINT8   IoApicId;
331   UINT8   Reserved;
332   UINT32  IoApicAddress;
333   UINT32  GlobalSystemInterruptBase;
334 } EFI_ACPI_4_0_IO_APIC_STRUCTURE;
335 
336 ///
337 /// Interrupt Source Override Structure
338 ///
339 typedef struct {
340   UINT8   Type;
341   UINT8   Length;
342   UINT8   Bus;
343   UINT8   Source;
344   UINT32  GlobalSystemInterrupt;
345   UINT16  Flags;
346 } EFI_ACPI_4_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
347 
348 ///
349 /// Platform Interrupt Sources Structure Definition
350 ///
351 typedef struct {
352   UINT8   Type;
353   UINT8   Length;
354   UINT16  Flags;
355   UINT8   InterruptType;
356   UINT8   ProcessorId;
357   UINT8   ProcessorEid;
358   UINT8   IoSapicVector;
359   UINT32  GlobalSystemInterrupt;
360   UINT32  PlatformInterruptSourceFlags;
361   UINT8   CpeiProcessorOverride;
362   UINT8   Reserved[31];
363 } EFI_ACPI_4_0_PLATFORM_INTERRUPT_APIC_STRUCTURE;
364 
365 //
366 // MPS INTI flags.
367 // All other bits are reserved and must be set to 0.
368 //
369 #define EFI_ACPI_4_0_POLARITY      (3 << 0)
370 #define EFI_ACPI_4_0_TRIGGER_MODE  (3 << 2)
371 
372 ///
373 /// Non-Maskable Interrupt Source Structure
374 ///
375 typedef struct {
376   UINT8   Type;
377   UINT8   Length;
378   UINT16  Flags;
379   UINT32  GlobalSystemInterrupt;
380 } EFI_ACPI_4_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
381 
382 ///
383 /// Local APIC NMI Structure
384 ///
385 typedef struct {
386   UINT8   Type;
387   UINT8   Length;
388   UINT8   AcpiProcessorId;
389   UINT16  Flags;
390   UINT8   LocalApicLint;
391 } EFI_ACPI_4_0_LOCAL_APIC_NMI_STRUCTURE;
392 
393 ///
394 /// Local APIC Address Override Structure
395 ///
396 typedef struct {
397   UINT8   Type;
398   UINT8   Length;
399   UINT16  Reserved;
400   UINT64  LocalApicAddress;
401 } EFI_ACPI_4_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE;
402 
403 ///
404 /// IO SAPIC Structure
405 ///
406 typedef struct {
407   UINT8   Type;
408   UINT8   Length;
409   UINT8   IoApicId;
410   UINT8   Reserved;
411   UINT32  GlobalSystemInterruptBase;
412   UINT64  IoSapicAddress;
413 } EFI_ACPI_4_0_IO_SAPIC_STRUCTURE;
414 
415 ///
416 /// Local SAPIC Structure
417 /// This struct followed by a null-terminated ASCII string - ACPI Processor UID String
418 ///
419 typedef struct {
420   UINT8   Type;
421   UINT8   Length;
422   UINT8   AcpiProcessorId;
423   UINT8   LocalSapicId;
424   UINT8   LocalSapicEid;
425   UINT8   Reserved[3];
426   UINT32  Flags;
427   UINT32  ACPIProcessorUIDValue;
428 } EFI_ACPI_4_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE;
429 
430 ///
431 /// Platform Interrupt Sources Structure
432 ///
433 typedef struct {
434   UINT8   Type;
435   UINT8   Length;
436   UINT16  Flags;
437   UINT8   InterruptType;
438   UINT8   ProcessorId;
439   UINT8   ProcessorEid;
440   UINT8   IoSapicVector;
441   UINT32  GlobalSystemInterrupt;
442   UINT32  PlatformInterruptSourceFlags;
443 } EFI_ACPI_4_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE;
444 
445 ///
446 /// Platform Interrupt Source Flags.
447 /// All other bits are reserved and must be set to 0.
448 ///
449 #define EFI_ACPI_4_0_CPEI_PROCESSOR_OVERRIDE          BIT0
450 
451 ///
452 /// Processor Local x2APIC Structure Definition
453 ///
454 typedef struct {
455   UINT8   Type;
456   UINT8   Length;
457   UINT8   Reserved[2];
458   UINT32  X2ApicId;
459   UINT32  Flags;
460   UINT32  AcpiProcessorUid;
461 } EFI_ACPI_4_0_PROCESSOR_LOCAL_X2APIC_STRUCTURE;
462 
463 ///
464 /// Local x2APIC NMI Structure
465 ///
466 typedef struct {
467   UINT8   Type;
468   UINT8   Length;
469   UINT16  Flags;
470   UINT32  AcpiProcessorUid;
471   UINT8   LocalX2ApicLint;
472   UINT8   Reserved[3];
473 } EFI_ACPI_4_0_LOCAL_X2APIC_NMI_STRUCTURE;
474 
475 ///
476 /// Smart Battery Description Table (SBST)
477 ///
478 typedef struct {
479   EFI_ACPI_DESCRIPTION_HEADER Header;
480   UINT32                      WarningEnergyLevel;
481   UINT32                      LowEnergyLevel;
482   UINT32                      CriticalEnergyLevel;
483 } EFI_ACPI_4_0_SMART_BATTERY_DESCRIPTION_TABLE;
484 
485 ///
486 /// SBST Version (as defined in ACPI 4.0 spec.)
487 ///
488 #define EFI_ACPI_4_0_SMART_BATTERY_DESCRIPTION_TABLE_REVISION 0x01
489 
490 ///
491 /// Embedded Controller Boot Resources Table (ECDT)
492 /// The table is followed by a null terminated ASCII string that contains
493 /// a fully qualified reference to the name space object.
494 ///
495 typedef struct {
496   EFI_ACPI_DESCRIPTION_HEADER             Header;
497   EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  EcControl;
498   EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE  EcData;
499   UINT32                                  Uid;
500   UINT8                                   GpeBit;
501 } EFI_ACPI_4_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE;
502 
503 ///
504 /// ECDT Version (as defined in ACPI 4.0 spec.)
505 ///
506 #define EFI_ACPI_4_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_REVISION  0x01
507 
508 ///
509 /// System Resource Affinity Table (SRAT.  The rest of the table
510 /// must be defined in a platform specific manner.
511 ///
512 typedef struct {
513   EFI_ACPI_DESCRIPTION_HEADER Header;
514   UINT32                      Reserved1;  ///< Must be set to 1
515   UINT64                      Reserved2;
516 } EFI_ACPI_4_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER;
517 
518 ///
519 /// SRAT Version (as defined in ACPI 4.0 spec.)
520 ///
521 #define EFI_ACPI_4_0_SYSTEM_RESOURCE_AFFINITY_TABLE_REVISION  0x03
522 
523 //
524 // SRAT structure types.
525 // All other values between 0x03 an 0xFF are reserved and
526 // will be ignored by OSPM.
527 //
528 #define EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY  0x00
529 #define EFI_ACPI_4_0_MEMORY_AFFINITY                      0x01
530 #define EFI_ACPI_4_0_PROCESSOR_LOCAL_X2APIC_AFFINITY      0x02
531 
532 ///
533 /// Processor Local APIC/SAPIC Affinity Structure Definition
534 ///
535 typedef struct {
536   UINT8   Type;
537   UINT8   Length;
538   UINT8   ProximityDomain7To0;
539   UINT8   ApicId;
540   UINT32  Flags;
541   UINT8   LocalSapicEid;
542   UINT8   ProximityDomain31To8[3];
543   UINT32  ClockDomain;
544 } EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE;
545 
546 ///
547 /// Local APIC/SAPIC Flags.  All other bits are reserved and must be 0.
548 ///
549 #define EFI_ACPI_4_0_PROCESSOR_LOCAL_APIC_SAPIC_ENABLED (1 << 0)
550 
551 ///
552 /// Memory Affinity Structure Definition
553 ///
554 typedef struct {
555   UINT8   Type;
556   UINT8   Length;
557   UINT32  ProximityDomain;
558   UINT16  Reserved1;
559   UINT32  AddressBaseLow;
560   UINT32  AddressBaseHigh;
561   UINT32  LengthLow;
562   UINT32  LengthHigh;
563   UINT32  Reserved2;
564   UINT32  Flags;
565   UINT64  Reserved3;
566 } EFI_ACPI_4_0_MEMORY_AFFINITY_STRUCTURE;
567 
568 //
569 // Memory Flags.  All other bits are reserved and must be 0.
570 //
571 #define EFI_ACPI_4_0_MEMORY_ENABLED       (1 << 0)
572 #define EFI_ACPI_4_0_MEMORY_HOT_PLUGGABLE (1 << 1)
573 #define EFI_ACPI_4_0_MEMORY_NONVOLATILE   (1 << 2)
574 
575 ///
576 /// Processor Local x2APIC Affinity Structure Definition
577 ///
578 typedef struct {
579   UINT8   Type;
580   UINT8   Length;
581   UINT8   Reserved1[2];
582   UINT32  ProximityDomain;
583   UINT32  X2ApicId;
584   UINT32  Flags;
585   UINT32  ClockDomain;
586   UINT8   Reserved2[4];
587 } EFI_ACPI_4_0_PROCESSOR_LOCAL_X2APIC_AFFINITY_STRUCTURE;
588 
589 ///
590 /// System Locality Distance Information Table (SLIT).
591 /// The rest of the table is a matrix.
592 ///
593 typedef struct {
594   EFI_ACPI_DESCRIPTION_HEADER Header;
595   UINT64                      NumberOfSystemLocalities;
596 } EFI_ACPI_4_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER;
597 
598 ///
599 /// SLIT Version (as defined in ACPI 4.0 spec.)
600 ///
601 #define EFI_ACPI_4_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_REVISION  0x01
602 
603 ///
604 /// Corrected Platform Error Polling Table (CPEP)
605 ///
606 typedef struct {
607   EFI_ACPI_DESCRIPTION_HEADER Header;
608   UINT8                       Reserved[8];
609 } EFI_ACPI_4_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_HEADER;
610 
611 ///
612 /// CPEP Version (as defined in ACPI 4.0 spec.)
613 ///
614 #define EFI_ACPI_4_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_REVISION 0x01
615 
616 //
617 // CPEP processor structure types.
618 //
619 #define EFI_ACPI_4_0_CPEP_PROCESSOR_APIC_SAPIC  0x00
620 
621 ///
622 /// Corrected Platform Error Polling Processor Structure Definition
623 ///
624 typedef struct {
625   UINT8   Type;
626   UINT8   Length;
627   UINT8   ProcessorId;
628   UINT8   ProcessorEid;
629   UINT32  PollingInterval;
630 } EFI_ACPI_4_0_CPEP_PROCESSOR_APIC_SAPIC_STRUCTURE;
631 
632 ///
633 /// Maximum System Characteristics Table (MSCT)
634 ///
635 typedef struct {
636   EFI_ACPI_DESCRIPTION_HEADER Header;
637   UINT32                      OffsetProxDomInfo;
638   UINT32                      MaximumNumberOfProximityDomains;
639   UINT32                      MaximumNumberOfClockDomains;
640   UINT64                      MaximumPhysicalAddress;
641 } EFI_ACPI_4_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_HEADER;
642 
643 ///
644 /// MSCT Version (as defined in ACPI 4.0 spec.)
645 ///
646 #define EFI_ACPI_4_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_REVISION 0x01
647 
648 ///
649 /// Maximum Proximity Domain Information Structure Definition
650 ///
651 typedef struct {
652   UINT8   Revision;
653   UINT8   Length;
654   UINT32  ProximityDomainRangeLow;
655   UINT32  ProximityDomainRangeHigh;
656   UINT32  MaximumProcessorCapacity;
657   UINT64  MaximumMemoryCapacity;
658 } EFI_ACPI_4_0_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE;
659 
660 ///
661 /// Boot Error Record Table (BERT)
662 ///
663 typedef struct {
664   EFI_ACPI_DESCRIPTION_HEADER Header;
665   UINT32                      BootErrorRegionLength;
666   UINT64                      BootErrorRegion;
667 } EFI_ACPI_4_0_BOOT_ERROR_RECORD_TABLE_HEADER;
668 
669 ///
670 /// BERT Version (as defined in ACPI 4.0 spec.)
671 ///
672 #define EFI_ACPI_4_0_BOOT_ERROR_RECORD_TABLE_REVISION 0x01
673 
674 ///
675 /// Boot Error Region Block Status Definition
676 ///
677 typedef struct {
678   UINT32       UncorrectableErrorValid:1;
679   UINT32       CorrectableErrorValid:1;
680   UINT32       MultipleUncorrectableErrors:1;
681   UINT32       MultipleCorrectableErrors:1;
682   UINT32       ErrorDataEntryCount:10;
683   UINT32       Reserved:18;
684 } EFI_ACPI_4_0_ERROR_BLOCK_STATUS;
685 
686 ///
687 /// Boot Error Region Definition
688 ///
689 typedef struct {
690   EFI_ACPI_4_0_ERROR_BLOCK_STATUS              BlockStatus;
691   UINT32                                       RawDataOffset;
692   UINT32                                       RawDataLength;
693   UINT32                                       DataLength;
694   UINT32                                       ErrorSeverity;
695 } EFI_ACPI_4_0_BOOT_ERROR_REGION_STRUCTURE;
696 
697 //
698 // Boot Error Severity types
699 //
700 #define EFI_ACPI_4_0_ERROR_SEVERITY_CORRECTABLE  0x00
701 #define EFI_ACPI_4_0_ERROR_SEVERITY_FATAL        0x01
702 #define EFI_ACPI_4_0_ERROR_SEVERITY_CORRECTED    0x02
703 #define EFI_ACPI_4_0_ERROR_SEVERITY_NONE         0x03
704 
705 ///
706 /// Generic Error Data Entry Definition
707 ///
708 typedef struct {
709   UINT8    SectionType[16];
710   UINT32   ErrorSeverity;
711   UINT16   Revision;
712   UINT8    ValidationBits;
713   UINT8    Flags;
714   UINT32   ErrorDataLength;
715   UINT8    FruId[16];
716   UINT8    FruText[20];
717 } EFI_ACPI_4_0_GENERIC_ERROR_DATA_ENTRY_STRUCTURE;
718 
719 ///
720 /// Generic Error Data Entry Version (as defined in ACPI 4.0 spec.)
721 ///
722 #define EFI_ACPI_4_0_GENERIC_ERROR_DATA_ENTRY_REVISION  0x0201
723 
724 ///
725 /// HEST - Hardware Error Source Table
726 ///
727 typedef struct {
728   EFI_ACPI_DESCRIPTION_HEADER Header;
729   UINT32                      ErrorSourceCount;
730 } EFI_ACPI_4_0_HARDWARE_ERROR_SOURCE_TABLE_HEADER;
731 
732 ///
733 /// HEST Version (as defined in ACPI 4.0 spec.)
734 ///
735 #define EFI_ACPI_4_0_HARDWARE_ERROR_SOURCE_TABLE_REVISION 0x01
736 
737 //
738 // Error Source structure types.
739 //
740 #define EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_EXCEPTION  0x00
741 #define EFI_ACPI_4_0_IA32_ARCHITECTURE_CORRECTED_MACHINE_CHECK  0x01
742 #define EFI_ACPI_4_0_IA32_ARCHITECTURE_NMI_ERROR                0x02
743 #define EFI_ACPI_4_0_PCI_EXPRESS_ROOT_PORT_AER                  0x06
744 #define EFI_ACPI_4_0_PCI_EXPRESS_DEVICE_AER                     0x07
745 #define EFI_ACPI_4_0_PCI_EXPRESS_BRIDGE_AER                     0x08
746 #define EFI_ACPI_4_0_GENERIC_HARDWARE_ERROR                     0x09
747 
748 //
749 // Error Source structure flags.
750 //
751 #define EFI_ACPI_4_0_ERROR_SOURCE_FLAG_FIRMWARE_FIRST       (1 << 0)
752 #define EFI_ACPI_4_0_ERROR_SOURCE_FLAG_GLOBAL               (1 << 1)
753 
754 ///
755 /// IA-32 Architecture Machine Check Exception Structure Definition
756 ///
757 typedef struct {
758   UINT16  Type;
759   UINT16  SourceId;
760   UINT8   Reserved0[2];
761   UINT8   Flags;
762   UINT8   Enabled;
763   UINT32  NumberOfRecordsToPreAllocate;
764   UINT32  MaxSectionsPerRecord;
765   UINT64  GlobalCapabilityInitData;
766   UINT64  GlobalControlInitData;
767   UINT8   NumberOfHardwareBanks;
768   UINT8   Reserved1[7];
769 } EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_EXCEPTION_STRUCTURE;
770 
771 ///
772 /// IA-32 Architecture Machine Check Bank Structure Definition
773 ///
774 typedef struct {
775   UINT8   BankNumber;
776   UINT8   ClearStatusOnInitialization;
777   UINT8   StatusDataFormat;
778   UINT8   Reserved0;
779   UINT32  ControlRegisterMsrAddress;
780   UINT64  ControlInitData;
781   UINT32  StatusRegisterMsrAddress;
782   UINT32  AddressRegisterMsrAddress;
783   UINT32  MiscRegisterMsrAddress;
784 } EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_BANK_STRUCTURE;
785 
786 ///
787 /// IA-32 Architecture Machine Check Bank Structure MCA data format
788 ///
789 #define EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_IA32      0x00
790 #define EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_INTEL64   0x01
791 #define EFI_ACPI_4_0_IA32_ARCHITECTURE_MACHINE_CHECK_ERROR_DATA_FORMAT_AMD64     0x02
792 
793 //
794 // Hardware Error Notification types. All other values are reserved
795 //
796 #define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_POLLED                0x00
797 #define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_EXTERNAL_INTERRUPT    0x01
798 #define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_LOCAL_INTERRUPT       0x02
799 #define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_SCI                   0x03
800 #define EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_NMI                   0x04
801 
802 ///
803 /// Hardware Error Notification Configuration Write Enable Structure Definition
804 ///
805 typedef struct {
806   UINT16    Type:1;
807   UINT16    PollInterval:1;
808   UINT16    SwitchToPollingThresholdValue:1;
809   UINT16    SwitchToPollingThresholdWindow:1;
810   UINT16    ErrorThresholdValue:1;
811   UINT16    ErrorThresholdWindow:1;
812   UINT16    Reserved:10;
813 } EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE;
814 
815 ///
816 /// Hardware Error Notification Structure Definition
817 ///
818 typedef struct {
819   UINT8                                                                          Type;
820   UINT8                                                                          Length;
821   EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_CONFIGURATION_WRITE_ENABLE_STRUCTURE  ConfigurationWriteEnable;
822   UINT32                                                                         PollInterval;
823   UINT32                                                                         Vector;
824   UINT32                                                                         SwitchToPollingThresholdValue;
825   UINT32                                                                         SwitchToPollingThresholdWindow;
826   UINT32                                                                         ErrorThresholdValue;
827   UINT32                                                                         ErrorThresholdWindow;
828 } EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE;
829 
830 ///
831 /// IA-32 Architecture Corrected Machine Check Structure Definition
832 ///
833 typedef struct {
834   UINT16                                                 Type;
835   UINT16                                                 SourceId;
836   UINT8                                                  Reserved0[2];
837   UINT8                                                  Flags;
838   UINT8                                                  Enabled;
839   UINT32                                                 NumberOfRecordsToPreAllocate;
840   UINT32                                                 MaxSectionsPerRecord;
841   EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE     NotificationStructure;
842   UINT8                                                  NumberOfHardwareBanks;
843   UINT8                                                  Reserved1[3];
844 } EFI_ACPI_4_0_IA32_ARCHITECTURE_CORRECTED_MACHINE_CHECK_STRUCTURE;
845 
846 ///
847 /// IA-32 Architecture NMI Error Structure Definition
848 ///
849 typedef struct {
850   UINT16  Type;
851   UINT16  SourceId;
852   UINT8   Reserved0[2];
853   UINT32  NumberOfRecordsToPreAllocate;
854   UINT32  MaxSectionsPerRecord;
855   UINT32  MaxRawDataLength;
856 } EFI_ACPI_4_0_IA32_ARCHITECTURE_NMI_ERROR_STRUCTURE;
857 
858 ///
859 /// PCI Express Root Port AER Structure Definition
860 ///
861 typedef struct {
862   UINT16  Type;
863   UINT16  SourceId;
864   UINT8   Reserved0[2];
865   UINT8   Flags;
866   UINT8   Enabled;
867   UINT32  NumberOfRecordsToPreAllocate;
868   UINT32  MaxSectionsPerRecord;
869   UINT32  Bus;
870   UINT16  Device;
871   UINT16  Function;
872   UINT16  DeviceControl;
873   UINT8   Reserved1[2];
874   UINT32  UncorrectableErrorMask;
875   UINT32  UncorrectableErrorSeverity;
876   UINT32  CorrectableErrorMask;
877   UINT32  AdvancedErrorCapabilitiesAndControl;
878   UINT32  RootErrorCommand;
879 } EFI_ACPI_4_0_PCI_EXPRESS_ROOT_PORT_AER_STRUCTURE;
880 
881 ///
882 /// PCI Express Device AER Structure Definition
883 ///
884 typedef struct {
885   UINT16  Type;
886   UINT16  SourceId;
887   UINT8   Reserved0[2];
888   UINT8   Flags;
889   UINT8   Enabled;
890   UINT32  NumberOfRecordsToPreAllocate;
891   UINT32  MaxSectionsPerRecord;
892   UINT32  Bus;
893   UINT16  Device;
894   UINT16  Function;
895   UINT16  DeviceControl;
896   UINT8   Reserved1[2];
897   UINT32  UncorrectableErrorMask;
898   UINT32  UncorrectableErrorSeverity;
899   UINT32  CorrectableErrorMask;
900   UINT32  AdvancedErrorCapabilitiesAndControl;
901 } EFI_ACPI_4_0_PCI_EXPRESS_DEVICE_AER_STRUCTURE;
902 
903 ///
904 /// PCI Express Bridge AER Structure Definition
905 ///
906 typedef struct {
907   UINT16  Type;
908   UINT16  SourceId;
909   UINT8   Reserved0[2];
910   UINT8   Flags;
911   UINT8   Enabled;
912   UINT32  NumberOfRecordsToPreAllocate;
913   UINT32  MaxSectionsPerRecord;
914   UINT32  Bus;
915   UINT16  Device;
916   UINT16  Function;
917   UINT16  DeviceControl;
918   UINT8   Reserved1[2];
919   UINT32  UncorrectableErrorMask;
920   UINT32  UncorrectableErrorSeverity;
921   UINT32  CorrectableErrorMask;
922   UINT32  AdvancedErrorCapabilitiesAndControl;
923   UINT32  SecondaryUncorrectableErrorMask;
924   UINT32  SecondaryUncorrectableErrorSeverity;
925   UINT32  SecondaryAdvancedErrorCapabilitiesAndControl;
926 } EFI_ACPI_4_0_PCI_EXPRESS_BRIDGE_AER_STRUCTURE;
927 
928 ///
929 /// Generic Hardware Error Source Structure Definition
930 ///
931 typedef struct {
932   UINT16                                                 Type;
933   UINT16                                                 SourceId;
934   UINT16                                                 RelatedSourceId;
935   UINT8                                                  Flags;
936   UINT8                                                  Enabled;
937   UINT32                                                 NumberOfRecordsToPreAllocate;
938   UINT32                                                 MaxSectionsPerRecord;
939   UINT32                                                 MaxRawDataLength;
940   EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE                 ErrorStatusAddress;
941   EFI_ACPI_4_0_HARDWARE_ERROR_NOTIFICATION_STRUCTURE     NotificationStructure;
942   UINT32                                                 ErrorStatusBlockLength;
943 } EFI_ACPI_4_0_GENERIC_HARDWARE_ERROR_SOURCE_STRUCTURE;
944 
945 ///
946 /// Generic Error Status Definition
947 ///
948 typedef struct {
949   EFI_ACPI_4_0_ERROR_BLOCK_STATUS              BlockStatus;
950   UINT32                                       RawDataOffset;
951   UINT32                                       RawDataLength;
952   UINT32                                       DataLength;
953   UINT32                                       ErrorSeverity;
954 } EFI_ACPI_4_0_GENERIC_ERROR_STATUS_STRUCTURE;
955 
956 ///
957 /// ERST - Error Record Serialization Table
958 ///
959 typedef struct {
960   EFI_ACPI_DESCRIPTION_HEADER Header;
961   UINT32                      SerializationHeaderSize;
962   UINT8                       Reserved0[4];
963   UINT32                      InstructionEntryCount;
964 } EFI_ACPI_4_0_ERROR_RECORD_SERIALIZATION_TABLE_HEADER;
965 
966 ///
967 /// ERST Version (as defined in ACPI 4.0 spec.)
968 ///
969 #define EFI_ACPI_4_0_ERROR_RECORD_SERIALIZATION_TABLE_REVISION 0x01
970 
971 ///
972 /// ERST Serialization Actions
973 ///
974 #define EFI_ACPI_4_0_ERST_BEGIN_WRITE_OPERATION                    0x00
975 #define EFI_ACPI_4_0_ERST_BEGIN_READ_OPERATION                     0x01
976 #define EFI_ACPI_4_0_ERST_BEGIN_CLEAR_OPERATION                    0x02
977 #define EFI_ACPI_4_0_ERST_END_OPERATION                            0x03
978 #define EFI_ACPI_4_0_ERST_SET_RECORD_OFFSET                        0x04
979 #define EFI_ACPI_4_0_ERST_EXECUTE_OPERATION                        0x05
980 #define EFI_ACPI_4_0_ERST_CHECK_BUSY_STATUS                        0x06
981 #define EFI_ACPI_4_0_ERST_GET_COMMAND_STATUS                       0x07
982 #define EFI_ACPI_4_0_ERST_GET_RECORD_IDENTIFIER                    0x08
983 #define EFI_ACPI_4_0_ERST_SET_RECORD_IDENTIFIER                    0x09
984 #define EFI_ACPI_4_0_ERST_GET_RECORD_COUNT                         0x0A
985 #define EFI_ACPI_4_0_ERST_BEGIN_DUMMY_WRITE_OPERATION              0x0B
986 #define EFI_ACPI_4_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE              0x0D
987 #define EFI_ACPI_4_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE_LENGTH       0x0E
988 #define EFI_ACPI_4_0_ERST_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES   0x0F
989 
990 ///
991 /// ERST Action Command Status
992 ///
993 #define EFI_ACPI_4_0_EINJ_STATUS_SUCCESS                           0x00
994 #define EFI_ACPI_4_0_EINJ_STATUS_NOT_ENOUGH_SPACE                  0x01
995 #define EFI_ACPI_4_0_EINJ_STATUS_HARDWARE_NOT_AVAILABLE            0x02
996 #define EFI_ACPI_4_0_EINJ_STATUS_FAILED                            0x03
997 #define EFI_ACPI_4_0_EINJ_STATUS_RECORD_STORE_EMPTY                0x04
998 #define EFI_ACPI_4_0_EINJ_STATUS_RECORD_NOT_FOUND                  0x05
999 
1000 ///
1001 /// ERST Serialization Instructions
1002 ///
1003 #define EFI_ACPI_4_0_ERST_READ_REGISTER                            0x00
1004 #define EFI_ACPI_4_0_ERST_READ_REGISTER_VALUE                      0x01
1005 #define EFI_ACPI_4_0_ERST_WRITE_REGISTER                           0x02
1006 #define EFI_ACPI_4_0_ERST_WRITE_REGISTER_VALUE                     0x03
1007 #define EFI_ACPI_4_0_ERST_NOOP                                     0x04
1008 #define EFI_ACPI_4_0_ERST_LOAD_VAR1                                0x05
1009 #define EFI_ACPI_4_0_ERST_LOAD_VAR2                                0x06
1010 #define EFI_ACPI_4_0_ERST_STORE_VAR1                               0x07
1011 #define EFI_ACPI_4_0_ERST_ADD                                      0x08
1012 #define EFI_ACPI_4_0_ERST_SUBTRACT                                 0x09
1013 #define EFI_ACPI_4_0_ERST_ADD_VALUE                                0x0A
1014 #define EFI_ACPI_4_0_ERST_SUBTRACT_VALUE                           0x0B
1015 #define EFI_ACPI_4_0_ERST_STALL                                    0x0C
1016 #define EFI_ACPI_4_0_ERST_STALL_WHILE_TRUE                         0x0D
1017 #define EFI_ACPI_4_0_ERST_SKIP_NEXT_INSTRUCTION_IF_TRUE            0x0E
1018 #define EFI_ACPI_4_0_ERST_GOTO                                     0x0F
1019 #define EFI_ACPI_4_0_ERST_SET_SRC_ADDRESS_BASE                     0x10
1020 #define EFI_ACPI_4_0_ERST_SET_DST_ADDRESS_BASE                     0x11
1021 #define EFI_ACPI_4_0_ERST_MOVE_DATA                                0x12
1022 
1023 ///
1024 /// ERST Instruction Flags
1025 ///
1026 #define EFI_ACPI_4_0_ERST_PRESERVE_REGISTER                        0x01
1027 
1028 ///
1029 /// ERST Serialization Instruction Entry
1030 ///
1031 typedef struct {
1032   UINT8                                    SerializationAction;
1033   UINT8                                    Instruction;
1034   UINT8                                    Flags;
1035   UINT8                                    Reserved0;
1036   EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE   RegisterRegion;
1037   UINT64                                   Value;
1038   UINT64                                   Mask;
1039 } EFI_ACPI_4_0_ERST_SERIALIZATION_INSTRUCTION_ENTRY;
1040 
1041 ///
1042 /// EINJ - Error Injection Table
1043 ///
1044 typedef struct {
1045   EFI_ACPI_DESCRIPTION_HEADER Header;
1046   UINT32                      InjectionHeaderSize;
1047   UINT8                       InjectionFlags;
1048   UINT8                       Reserved0[3];
1049   UINT32                      InjectionEntryCount;
1050 } EFI_ACPI_4_0_ERROR_INJECTION_TABLE_HEADER;
1051 
1052 ///
1053 /// EINJ Version (as defined in ACPI 4.0 spec.)
1054 ///
1055 #define EFI_ACPI_4_0_ERROR_INJECTION_TABLE_REVISION 0x01
1056 
1057 ///
1058 /// EINJ Error Injection Actions
1059 ///
1060 #define EFI_ACPI_4_0_EINJ_BEGIN_INJECTION_OPERATION                0x00
1061 #define EFI_ACPI_4_0_EINJ_GET_TRIGGER_ERROR_ACTION_TABLE           0x01
1062 #define EFI_ACPI_4_0_EINJ_SET_ERROR_TYPE                           0x02
1063 #define EFI_ACPI_4_0_EINJ_GET_ERROR_TYPE                           0x03
1064 #define EFI_ACPI_4_0_EINJ_END_OPERATION                            0x04
1065 #define EFI_ACPI_4_0_EINJ_EXECUTE_OPERATION                        0x05
1066 #define EFI_ACPI_4_0_EINJ_CHECK_BUSY_STATUS                        0x06
1067 #define EFI_ACPI_4_0_EINJ_GET_COMMAND_STATUS                       0x07
1068 #define EFI_ACPI_4_0_EINJ_TRIGGER_ERROR                            0xFF
1069 
1070 ///
1071 /// EINJ Action Command Status
1072 ///
1073 #define EFI_ACPI_4_0_EINJ_STATUS_SUCCESS                           0x00
1074 #define EFI_ACPI_4_0_EINJ_STATUS_UNKNOWN_FAILURE                   0x01
1075 #define EFI_ACPI_4_0_EINJ_STATUS_INVALID_ACCESS                    0x02
1076 
1077 ///
1078 /// EINJ Error Type Definition
1079 ///
1080 #define EFI_ACPI_4_0_EINJ_ERROR_PROCESSOR_CORRECTABLE                 (1 << 0)
1081 #define EFI_ACPI_4_0_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_NONFATAL      (1 << 1)
1082 #define EFI_ACPI_4_0_EINJ_ERROR_PROCESSOR_UNCORRECTABLE_FATAL         (1 << 2)
1083 #define EFI_ACPI_4_0_EINJ_ERROR_MEMORY_CORRECTABLE                    (1 << 3)
1084 #define EFI_ACPI_4_0_EINJ_ERROR_MEMORY_UNCORRECTABLE_NONFATAL         (1 << 4)
1085 #define EFI_ACPI_4_0_EINJ_ERROR_MEMORY_UNCORRECTABLE_FATAL            (1 << 5)
1086 #define EFI_ACPI_4_0_EINJ_ERROR_PCI_EXPRESS_CORRECTABLE               (1 << 6)
1087 #define EFI_ACPI_4_0_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_NONFATAL    (1 << 7)
1088 #define EFI_ACPI_4_0_EINJ_ERROR_PCI_EXPRESS_UNCORRECTABLE_FATAL       (1 << 8)
1089 #define EFI_ACPI_4_0_EINJ_ERROR_PLATFORM_CORRECTABLE                  (1 << 9)
1090 #define EFI_ACPI_4_0_EINJ_ERROR_PLATFORM_UNCORRECTABLE_NONFATAL       (1 << 10)
1091 #define EFI_ACPI_4_0_EINJ_ERROR_PLATFORM_UNCORRECTABLE_FATAL          (1 << 11)
1092 
1093 ///
1094 /// EINJ Injection Instructions
1095 ///
1096 #define EFI_ACPI_4_0_EINJ_READ_REGISTER                            0x00
1097 #define EFI_ACPI_4_0_EINJ_READ_REGISTER_VALUE                      0x01
1098 #define EFI_ACPI_4_0_EINJ_WRITE_REGISTER                           0x02
1099 #define EFI_ACPI_4_0_EINJ_WRITE_REGISTER_VALUE                     0x03
1100 #define EFI_ACPI_4_0_EINJ_NOOP                                     0x04
1101 
1102 ///
1103 /// EINJ Instruction Flags
1104 ///
1105 #define EFI_ACPI_4_0_EINJ_PRESERVE_REGISTER                        0x01
1106 
1107 ///
1108 /// EINJ Injection Instruction Entry
1109 ///
1110 typedef struct {
1111   UINT8                                    InjectionAction;
1112   UINT8                                    Instruction;
1113   UINT8                                    Flags;
1114   UINT8                                    Reserved0;
1115   EFI_ACPI_4_0_GENERIC_ADDRESS_STRUCTURE   RegisterRegion;
1116   UINT64                                   Value;
1117   UINT64                                   Mask;
1118 } EFI_ACPI_4_0_EINJ_INJECTION_INSTRUCTION_ENTRY;
1119 
1120 ///
1121 /// EINJ Trigger Action Table
1122 ///
1123 typedef struct {
1124   UINT32  HeaderSize;
1125   UINT32  Revision;
1126   UINT32  TableSize;
1127   UINT32  EntryCount;
1128 } EFI_ACPI_4_0_EINJ_TRIGGER_ACTION_TABLE;
1129 
1130 //
1131 // Known table signatures
1132 //
1133 
1134 ///
1135 /// "RSD PTR " Root System Description Pointer
1136 ///
1137 #define EFI_ACPI_4_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE  SIGNATURE_64('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ')
1138 
1139 ///
1140 /// "APIC" Multiple APIC Description Table
1141 ///
1142 #define EFI_ACPI_4_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE  SIGNATURE_32('A', 'P', 'I', 'C')
1143 
1144 ///
1145 /// "BERT" Boot Error Record Table
1146 ///
1147 #define EFI_ACPI_4_0_BOOT_ERROR_RECORD_TABLE_SIGNATURE  SIGNATURE_32('B', 'E', 'R', 'T')
1148 
1149 ///
1150 /// "CPEP" Corrected Platform Error Polling Table
1151 ///
1152 #define EFI_ACPI_4_0_CORRECTED_PLATFORM_ERROR_POLLING_TABLE_SIGNATURE  SIGNATURE_32('C', 'P', 'E', 'P')
1153 
1154 ///
1155 /// "DSDT" Differentiated System Description Table
1156 ///
1157 #define EFI_ACPI_4_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE  SIGNATURE_32('D', 'S', 'D', 'T')
1158 
1159 ///
1160 /// "ECDT" Embedded Controller Boot Resources Table
1161 ///
1162 #define EFI_ACPI_4_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_SIGNATURE  SIGNATURE_32('E', 'C', 'D', 'T')
1163 
1164 ///
1165 /// "EINJ" Error Injection Table
1166 ///
1167 #define EFI_ACPI_4_0_ERROR_INJECTION_TABLE_SIGNATURE  SIGNATURE_32('E', 'I', 'N', 'J')
1168 
1169 ///
1170 /// "ERST" Error Record Serialization Table
1171 ///
1172 #define EFI_ACPI_4_0_ERROR_RECORD_SERIALIZATION_TABLE_SIGNATURE  SIGNATURE_32('E', 'R', 'S', 'T')
1173 
1174 ///
1175 /// "FACP" Fixed ACPI Description Table
1176 ///
1177 #define EFI_ACPI_4_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE  SIGNATURE_32('F', 'A', 'C', 'P')
1178 
1179 ///
1180 /// "FACS" Firmware ACPI Control Structure
1181 ///
1182 #define EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE  SIGNATURE_32('F', 'A', 'C', 'S')
1183 
1184 ///
1185 /// "HEST" Hardware Error Source Table
1186 ///
1187 #define EFI_ACPI_4_0_HARDWARE_ERROR_SOURCE_TABLE_SIGNATURE  SIGNATURE_32('H', 'E', 'S', 'T')
1188 
1189 ///
1190 /// "MSCT" Maximum System Characteristics Table
1191 ///
1192 #define EFI_ACPI_4_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_SIGNATURE  SIGNATURE_32('M', 'S', 'C', 'T')
1193 
1194 ///
1195 /// "PSDT" Persistent System Description Table
1196 ///
1197 #define EFI_ACPI_4_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE  SIGNATURE_32('P', 'S', 'D', 'T')
1198 
1199 ///
1200 /// "RSDT" Root System Description Table
1201 ///
1202 #define EFI_ACPI_4_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE  SIGNATURE_32('R', 'S', 'D', 'T')
1203 
1204 ///
1205 /// "SBST" Smart Battery Specification Table
1206 ///
1207 #define EFI_ACPI_4_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE  SIGNATURE_32('S', 'B', 'S', 'T')
1208 
1209 ///
1210 /// "SLIT" System Locality Information Table
1211 ///
1212 #define EFI_ACPI_4_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE  SIGNATURE_32('S', 'L', 'I', 'T')
1213 
1214 ///
1215 /// "SRAT" System Resource Affinity Table
1216 ///
1217 #define EFI_ACPI_4_0_SYSTEM_RESOURCE_AFFINITY_TABLE_SIGNATURE  SIGNATURE_32('S', 'R', 'A', 'T')
1218 
1219 ///
1220 /// "SSDT" Secondary System Description Table
1221 ///
1222 #define EFI_ACPI_4_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE  SIGNATURE_32('S', 'S', 'D', 'T')
1223 
1224 ///
1225 /// "XSDT" Extended System Description Table
1226 ///
1227 #define EFI_ACPI_4_0_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE  SIGNATURE_32('X', 'S', 'D', 'T')
1228 
1229 ///
1230 /// "BOOT" MS Simple Boot Spec
1231 ///
1232 #define EFI_ACPI_4_0_SIMPLE_BOOT_FLAG_TABLE_SIGNATURE  SIGNATURE_32('B', 'O', 'O', 'T')
1233 
1234 ///
1235 /// "DBGP" MS Debug Port Spec
1236 ///
1237 #define EFI_ACPI_4_0_DEBUG_PORT_TABLE_SIGNATURE  SIGNATURE_32('D', 'B', 'G', 'P')
1238 
1239 ///
1240 /// "DMAR" DMA Remapping Table
1241 ///
1242 #define EFI_ACPI_4_0_DMA_REMAPPING_TABLE_SIGNATURE  SIGNATURE_32('D', 'M', 'A', 'R')
1243 
1244 ///
1245 /// "ETDT" Event Timer Description Table
1246 ///
1247 #define EFI_ACPI_4_0_EVENT_TIMER_DESCRIPTION_TABLE_SIGNATURE  SIGNATURE_32('E', 'T', 'D', 'T')
1248 
1249 ///
1250 /// "HPET" IA-PC High Precision Event Timer Table
1251 ///
1252 #define EFI_ACPI_4_0_HIGH_PRECISION_EVENT_TIMER_TABLE_SIGNATURE  SIGNATURE_32('H', 'P', 'E', 'T')
1253 
1254 ///
1255 /// "iBFT" iSCSI Boot Firmware Table
1256 ///
1257 #define EFI_ACPI_4_0_ISCSI_BOOT_FIRMWARE_TABLE_SIGNATURE  SIGNATURE_32('i', 'B', 'F', 'T')
1258 
1259 ///
1260 /// "IVRS" I/O Virtualization Reporting Structure
1261 ///
1262 #define EFI_ACPI_4_0_IO_VIRTUALIZATION_REPORTING_STRUCTURE_SIGNATURE  SIGNATURE_32('I', 'V', 'R', 'S')
1263 
1264 ///
1265 /// "MCFG" PCI Express Memory Mapped Configuration Space Base Address Description Table
1266 ///
1267 #define EFI_ACPI_4_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE  SIGNATURE_32('M', 'C', 'F', 'G')
1268 
1269 ///
1270 /// "MCHI" Management Controller Host Interface Table
1271 ///
1272 #define EFI_ACPI_4_0_MANAGEMENT_CONTROLLER_HOST_INTERFACE_TABLE_SIGNATURE  SIGNATURE_32('M', 'C', 'H', 'I')
1273 
1274 ///
1275 /// "SPCR" Serial Port Concole Redirection Table
1276 ///
1277 #define EFI_ACPI_4_0_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE  SIGNATURE_32('S', 'P', 'C', 'R')
1278 
1279 ///
1280 /// "SPMI" Server Platform Management Interface Table
1281 ///
1282 #define EFI_ACPI_4_0_SERVER_PLATFORM_MANAGEMENT_INTERFACE_TABLE_SIGNATURE  SIGNATURE_32('S', 'P', 'M', 'I')
1283 
1284 ///
1285 /// "TCPA" Trusted Computing Platform Alliance Capabilities Table
1286 ///
1287 #define EFI_ACPI_4_0_TRUSTED_COMPUTING_PLATFORM_ALLIANCE_CAPABILITIES_TABLE_SIGNATURE  SIGNATURE_32('T', 'C', 'P', 'A')
1288 
1289 ///
1290 /// "UEFI" UEFI ACPI Data Table
1291 ///
1292 #define EFI_ACPI_4_0_UEFI_ACPI_DATA_TABLE_SIGNATURE  SIGNATURE_32('U', 'E', 'F', 'I')
1293 
1294 ///
1295 /// "WAET" Windows ACPI Enlightenment Table
1296 ///
1297 #define EFI_ACPI_4_0_WINDOWS_ACPI_ENLIGHTENMENT_TABLE_SIGNATURE  SIGNATURE_32('W', 'A', 'E', 'T')
1298 
1299 ///
1300 /// "WDAT" Watchdog Action Table
1301 ///
1302 #define EFI_ACPI_4_0_WATCHDOG_ACTION_TABLE_SIGNATURE  SIGNATURE_32('W', 'D', 'A', 'T')
1303 
1304 ///
1305 /// "WDRT" Watchdog Resource Table
1306 ///
1307 #define EFI_ACPI_4_0_WATCHDOG_RESOURCE_TABLE_SIGNATURE  SIGNATURE_32('W', 'D', 'R', 'T')
1308 
1309 #pragma pack()
1310 
1311 #endif
1312