1 /** @file
2   GUIDs and definitions used for Common Platform Error Record.
3 
4   Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
5   (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
6   SPDX-License-Identifier: BSD-2-Clause-Patent
7 
8   @par Revision Reference:
9   GUIDs defined in UEFI 2.7 Specification.
10 
11 **/
12 
13 #ifndef __CPER_GUID_H__
14 #define __CPER_GUID_H__
15 
16 #pragma pack(1)
17 
18 #define EFI_ERROR_RECORD_SIGNATURE_START   SIGNATURE_32('C', 'P', 'E', 'R')
19 #define EFI_ERROR_RECORD_SIGNATURE_END     0xFFFFFFFF
20 
21 #define EFI_ERROR_RECORD_REVISION          0x0101
22 
23 ///
24 /// Error Severity in Error Record Header and Error Section Descriptor
25 ///@{
26 #define EFI_GENERIC_ERROR_RECOVERABLE                0x00000000
27 #define EFI_GENERIC_ERROR_FATAL                      0x00000001
28 #define EFI_GENERIC_ERROR_CORRECTED                  0x00000002
29 #define EFI_GENERIC_ERROR_INFO                       0x00000003
30 ///@}
31 
32 ///
33 /// The validation bit mask indicates the validity of the following fields
34 /// in Error Record Header.
35 ///@{
36 #define EFI_ERROR_RECORD_HEADER_PLATFORM_ID_VALID    BIT0
37 #define EFI_ERROR_RECORD_HEADER_TIME_STAMP_VALID     BIT1
38 #define EFI_ERROR_RECORD_HEADER_PARTITION_ID_VALID   BIT2
39 ///@}
40 
41 ///
42 /// Timestamp is precise if this bit is set and correlates to the time of the
43 /// error event.
44 ///
45 #define EFI_ERROR_TIME_STAMP_PRECISE                 BIT0
46 
47 ///
48 /// The timestamp correlates to the time when the error information was collected
49 /// by the system software and may not necessarily represent the time of the error
50 /// event. The timestamp contains the local time in BCD format.
51 ///
52 typedef struct {
53   UINT8              Seconds;
54   UINT8              Minutes;
55   UINT8              Hours;
56   UINT8              Flag;
57   UINT8              Day;
58   UINT8              Month;
59   UINT8              Year;
60   UINT8              Century;
61 } EFI_ERROR_TIME_STAMP;
62 
63 ///
64 /// GUID value indicating the record association with an error event notification type.
65 ///@{
66 #define EFI_EVENT_NOTIFICATION_TYEP_CMC_GUID \
67   { \
68     0x2DCE8BB1, 0xBDD7, 0x450e, { 0xB9, 0xAD, 0x9C, 0xF4, 0xEB, 0xD4, 0xF8, 0x90 } \
69   }
70 #define EFI_EVENT_NOTIFICATION_TYEP_CPE_GUID \
71   { \
72     0x4E292F96, 0xD843, 0x4a55, { 0xA8, 0xC2, 0xD4, 0x81, 0xF2, 0x7E, 0xBE, 0xEE } \
73   }
74 #define EFI_EVENT_NOTIFICATION_TYEP_MCE_GUID \
75   { \
76     0xE8F56FFE, 0x919C, 0x4cc5, { 0xBA, 0x88, 0x65, 0xAB, 0xE1, 0x49, 0x13, 0xBB } \
77   }
78 #define EFI_EVENT_NOTIFICATION_TYEP_PCIE_GUID \
79   { \
80     0xCF93C01F, 0x1A16, 0x4dfc, { 0xB8, 0xBC, 0x9C, 0x4D, 0xAF, 0x67, 0xC1, 0x04 } \
81   }
82 #define EFI_EVENT_NOTIFICATION_TYEP_INIT_GUID \
83   { \
84     0xCC5263E8, 0x9308, 0x454a, { 0x89, 0xD0, 0x34, 0x0B, 0xD3, 0x9B, 0xC9, 0x8E } \
85   }
86 #define EFI_EVENT_NOTIFICATION_TYEP_NMI_GUID \
87   { \
88     0x5BAD89FF, 0xB7E6, 0x42c9, { 0x81, 0x4A, 0xCF, 0x24, 0x85, 0xD6, 0xE9, 0x8A } \
89   }
90 #define EFI_EVENT_NOTIFICATION_TYEP_BOOT_GUID \
91   { \
92     0x3D61A466, 0xAB40, 0x409a, { 0xA6, 0x98, 0xF3, 0x62, 0xD4, 0x64, 0xB3, 0x8F } \
93   }
94 #define EFI_EVENT_NOTIFICATION_TYEP_DMAR_GUID \
95   { \
96     0x667DD791, 0xC6B3, 0x4c27, { 0x8A, 0x6B, 0x0F, 0x8E, 0x72, 0x2D, 0xEB, 0x41 } \
97   }
98 ///@}
99 
100 ///
101 /// Error Record Header Flags
102 ///@{
103 #define EFI_HW_ERROR_FLAGS_RECOVERED                 0x00000001
104 #define EFI_HW_ERROR_FLAGS_PREVERR                   0x00000002
105 #define EFI_HW_ERROR_FLAGS_SIMULATED                 0x00000004
106 ///@}
107 
108 ///
109 /// Common error record header
110 ///
111 typedef struct {
112   UINT32               SignatureStart;
113   UINT16               Revision;
114   UINT32               SignatureEnd;
115   UINT16               SectionCount;
116   UINT32               ErrorSeverity;
117   UINT32               ValidationBits;
118   UINT32               RecordLength;
119   EFI_ERROR_TIME_STAMP TimeStamp;
120   EFI_GUID             PlatformID;
121   EFI_GUID             PartitionID;
122   EFI_GUID             CreatorID;
123   EFI_GUID             NotificationType;
124   UINT64               RecordID;
125   UINT32               Flags;
126   UINT64               PersistenceInfo;
127   UINT8                Resv1[12];
128   ///
129   /// An array of SectionCount descriptors for the associated
130   /// sections. The number of valid sections is equivalent to the
131   /// SectionCount. The buffer size of the record may include
132   /// more space to dynamically add additional Section
133   /// Descriptors to the error record.
134   ///
135 } EFI_COMMON_ERROR_RECORD_HEADER;
136 
137 #define EFI_ERROR_SECTION_REVISION  0x0100
138 
139 ///
140 /// Validity Fields in Error Section Descriptor.
141 ///
142 #define EFI_ERROR_SECTION_FRU_ID_VALID               BIT0
143 #define EFI_ERROR_SECTION_FRU_STRING_VALID           BIT1
144 
145 ///
146 /// Flag field contains information that describes the error section
147 /// in Error Section Descriptor.
148 ///
149 #define EFI_ERROR_SECTION_FLAGS_PRIMARY                        BIT0
150 #define EFI_ERROR_SECTION_FLAGS_CONTAINMENT_WARNING            BIT1
151 #define EFI_ERROR_SECTION_FLAGS_RESET                          BIT2
152 #define EFI_ERROR_SECTION_FLAGS_ERROR_THRESHOLD_EXCEEDED       BIT3
153 #define EFI_ERROR_SECTION_FLAGS_RESOURCE_NOT_ACCESSIBLE        BIT4
154 #define EFI_ERROR_SECTION_FLAGS_LATENT_ERROR                   BIT5
155 
156 ///
157 /// Error Sectition Type GUIDs in Error Section Descriptor
158 ///@{
159 #define EFI_ERROR_SECTION_PROCESSOR_GENERIC_GUID \
160   { \
161     0x9876ccad, 0x47b4, 0x4bdb, { 0xb6, 0x5e, 0x16, 0xf1, 0x93, 0xc4, 0xf3, 0xdb } \
162   }
163 #define EFI_ERROR_SECTION_PROCESSOR_SPECIFIC_GUID \
164   { \
165     0xdc3ea0b0, 0xa144, 0x4797, { 0xb9, 0x5b, 0x53, 0xfa, 0x24, 0x2b, 0x6e, 0x1d } \
166   }
167 #define EFI_ERROR_SECTION_PROCESSOR_SPECIFIC_IA32X64_GUID \
168   { \
169     0xdc3ea0b0, 0xa144, 0x4797, { 0xb9, 0x5b, 0x53, 0xfa, 0x24, 0x2b, 0x6e, 0x1d } \
170   }
171 #define EFI_ERROR_SECTION_PROCESSOR_SPECIFIC_ARM_GUID \
172   { \
173     0xe19e3d16, 0xbc11, 0x11e4, { 0x9c, 0xaa, 0xc2, 0x05, 0x1d, 0x5d, 0x46, 0xb0 } \
174   }
175 #define EFI_ERROR_SECTION_PLATFORM_MEMORY_GUID \
176   { \
177     0xa5bc1114, 0x6f64, 0x4ede, { 0xb8, 0x63, 0x3e, 0x83, 0xed, 0x7c, 0x83, 0xb1 } \
178   }
179 #define EFI_ERROR_SECTION_PLATFORM_MEMORY2_GUID \
180   { \
181     0x61EC04FC, 0x48E6, 0xD813, { 0x25, 0xC9, 0x8D, 0xAA, 0x44, 0x75, 0x0B, 0x12 } \
182   }
183 #define EFI_ERROR_SECTION_PCIE_GUID \
184   { \
185     0xd995e954, 0xbbc1, 0x430f, { 0xad, 0x91, 0xb4, 0x4d, 0xcb, 0x3c, 0x6f, 0x35 } \
186   }
187 #define EFI_ERROR_SECTION_FW_ERROR_RECORD_GUID \
188   { \
189     0x81212a96, 0x09ed, 0x4996, { 0x94, 0x71, 0x8d, 0x72, 0x9c, 0x8e, 0x69, 0xed } \
190   }
191 #define EFI_ERROR_SECTION_PCI_PCIX_BUS_GUID \
192   { \
193     0xc5753963, 0x3b84, 0x4095, { 0xbf, 0x78, 0xed, 0xda, 0xd3, 0xf9, 0xc9, 0xdd } \
194   }
195 #define EFI_ERROR_SECTION_PCI_DEVICE_GUID \
196   { \
197     0xeb5e4685, 0xca66, 0x4769, { 0xb6, 0xa2, 0x26, 0x06, 0x8b, 0x00, 0x13, 0x26 } \
198   }
199 #define EFI_ERROR_SECTION_DMAR_GENERIC_GUID \
200   { \
201     0x5b51fef7, 0xc79d, 0x4434, { 0x8f, 0x1b, 0xaa, 0x62, 0xde, 0x3e, 0x2c, 0x64 } \
202   }
203 #define EFI_ERROR_SECTION_DIRECTED_IO_DMAR_GUID \
204   { \
205     0x71761d37, 0x32b2, 0x45cd, { 0xa7, 0xd0, 0xb0, 0xfe, 0xdd, 0x93, 0xe8, 0xcf } \
206   }
207 #define EFI_ERROR_SECTION_IOMMU_DMAR_GUID \
208   { \
209     0x036f84e1, 0x7f37, 0x428c, { 0xa7, 0x9e, 0x57, 0x5f, 0xdf, 0xaa, 0x84, 0xec } \
210   }
211 ///@}
212 
213 ///
214 /// Error Section Descriptor
215 ///
216 typedef struct {
217   UINT32                 SectionOffset;
218   UINT32                 SectionLength;
219   UINT16                 Revision;
220   UINT8                  SecValidMask;
221   UINT8                  Resv1;
222   UINT32                 SectionFlags;
223   EFI_GUID               SectionType;
224   EFI_GUID               FruId;
225   UINT32                 Severity;
226   CHAR8                  FruString[20];
227 } EFI_ERROR_SECTION_DESCRIPTOR;
228 
229 ///
230 /// The validation bit mask indicates whether or not each of the following fields are
231 /// valid in Proessor Generic Error section.
232 ///@{
233 #define EFI_GENERIC_ERROR_PROC_TYPE_VALID            BIT0
234 #define EFI_GENERIC_ERROR_PROC_ISA_VALID             BIT1
235 #define EFI_GENERIC_ERROR_PROC_ERROR_TYPE_VALID      BIT2
236 #define EFI_GENERIC_ERROR_PROC_OPERATION_VALID       BIT3
237 #define EFI_GENERIC_ERROR_PROC_FLAGS_VALID           BIT4
238 #define EFI_GENERIC_ERROR_PROC_LEVEL_VALID           BIT5
239 #define EFI_GENERIC_ERROR_PROC_VERSION_VALID         BIT6
240 #define EFI_GENERIC_ERROR_PROC_BRAND_VALID           BIT7
241 #define EFI_GENERIC_ERROR_PROC_ID_VALID              BIT8
242 #define EFI_GENERIC_ERROR_PROC_TARGET_ADDR_VALID     BIT9
243 #define EFI_GENERIC_ERROR_PROC_REQUESTER_ID_VALID    BIT10
244 #define EFI_GENERIC_ERROR_PROC_RESPONDER_ID_VALID    BIT11
245 #define EFI_GENERIC_ERROR_PROC_INST_IP_VALID         BIT12
246 ///@}
247 
248 ///
249 /// The type of the processor architecture in Proessor Generic Error section.
250 ///@{
251 #define EFI_GENERIC_ERROR_PROC_TYPE_IA32_X64         0x00
252 #define EFI_GENERIC_ERROR_PROC_TYPE_IA64             0x01
253 #define EFI_GENERIC_ERROR_PROC_TYPE_ARM              0x02
254 ///@}
255 
256 ///
257 /// The type of the instruction set executing when the error occurred in Proessor
258 /// Generic Error section.
259 ///@{
260 #define EFI_GENERIC_ERROR_PROC_ISA_IA32              0x00
261 #define EFI_GENERIC_ERROR_PROC_ISA_IA64              0x01
262 #define EFI_GENERIC_ERROR_PROC_ISA_X64               0x02
263 #define EFI_GENERIC_ERROR_PROC_ISA_ARM_A32_T32       0x03
264 #define EFI_GENERIC_ERROR_PROC_ISA_ARM_A64           0x04
265 ///@}
266 
267 ///
268 /// The type of error that occurred in Proessor Generic Error section.
269 ///@{
270 #define EFI_GENERIC_ERROR_PROC_ERROR_TYPE_UNKNOWN    0x00
271 #define EFI_GENERIC_ERROR_PROC_ERROR_TYPE_CACHE      0x01
272 #define EFI_GENERIC_ERROR_PROC_ERROR_TYPE_TLB        0x02
273 #define EFI_GENERIC_ERROR_PROC_ERROR_TYPE_BUS        0x04
274 #define EFI_GENERIC_ERROR_PROC_ERROR_TYPE_MICRO_ARCH 0x08
275 ///@}
276 
277 ///
278 /// The type of operation in Proessor Generic Error section.
279 ///@{
280 #define EFI_GENERIC_ERROR_PROC_OPERATION_GENERIC               0x00
281 #define EFI_GENERIC_ERROR_PROC_OPERATION_DATA_READ             0x01
282 #define EFI_GENERIC_ERROR_PROC_OPERATION_DATA_WRITE            0x02
283 #define EFI_GENERIC_ERROR_PROC_OPERATION_INSTRUCTION_EXEC      0x03
284 ///@}
285 
286 ///
287 /// Flags bit mask indicates additional information about the error in Proessor Generic
288 /// Error section
289 ///@{
290 #define EFI_GENERIC_ERROR_PROC_FLAGS_RESTARTABLE     BIT0
291 #define EFI_GENERIC_ERROR_PROC_FLAGS_PRECISE_IP      BIT1
292 #define EFI_GENERIC_ERROR_PROC_FLAGS_OVERFLOW        BIT2
293 #define EFI_GENERIC_ERROR_PROC_FLAGS_CORRECTED       BIT3
294 ///@}
295 
296 ///
297 /// Processor Generic Error Section
298 /// describes processor reported hardware errors for logical processors in the system.
299 ///
300 typedef struct {
301   UINT64             ValidFields;
302   UINT8              Type;
303   UINT8              Isa;
304   UINT8              ErrorType;
305   UINT8              Operation;
306   UINT8              Flags;
307   UINT8              Level;
308   UINT16             Resv1;
309   UINT64             VersionInfo;
310   CHAR8              BrandString[128];
311   UINT64             ApicId;
312   UINT64             TargetAddr;
313   UINT64             RequestorId;
314   UINT64             ResponderId;
315   UINT64             InstructionIP;
316 } EFI_PROCESSOR_GENERIC_ERROR_DATA;
317 
318 
319 #if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
320 ///
321 /// IA32 and x64 Specific definitions.
322 ///
323 
324 ///
325 /// GUID value indicating the type of Processor Error Information structure
326 /// in IA32/X64 Processor Error Information Structure.
327 ///@{
328 #define EFI_IA32_X64_ERROR_TYPE_CACHE_CHECK_GUID \
329   { \
330     0xA55701F5, 0xE3EF, 0x43de, {0xAC, 0x72, 0x24, 0x9B, 0x57, 0x3F, 0xAD, 0x2C } \
331   }
332 #define EFI_IA32_X64_ERROR_TYPE_TLB_CHECK_GUID \
333   { \
334     0xFC06B535, 0x5E1F, 0x4562, {0x9F, 0x25, 0x0A, 0x3B, 0x9A, 0xDB, 0x63, 0xC3 } \
335   }
336 #define EFI_IA32_X64_ERROR_TYPE_BUS_CHECK_GUID \
337   { \
338     0x1CF3F8B3, 0xC5B1, 0x49a2, {0xAA, 0x59, 0x5E, 0xEF, 0x92, 0xFF, 0xA6, 0x3C } \
339   }
340 #define EFI_IA32_X64_ERROR_TYPE_MS_CHECK_GUID \
341   { \
342     0x48AB7F57, 0xDC34, 0x4f6c, {0xA7, 0xD3, 0xB0, 0xB5, 0xB0, 0xA7, 0x43, 0x14 } \
343   }
344 ///@}
345 
346 ///
347 /// The validation bit mask indicates which fields in the IA32/X64 Processor
348 /// Error Record structure are valid.
349 ///@{
350 #define EFI_IA32_X64_PROCESSOR_ERROR_APIC_ID_VALID         BIT0
351 #define EFI_IA32_X64_PROCESSOR_ERROR_CPU_ID_INFO_VALID     BIT1
352 ///@}
353 
354 ///
355 /// IA32/X64 Processor Error Record
356 ///
357 typedef struct {
358   UINT64             ValidFields;
359   UINT64             ApicId;
360   UINT8              CpuIdInfo[48];
361 } EFI_IA32_X64_PROCESSOR_ERROR_RECORD;
362 
363 ///
364 /// The validation bit mask indicates which fields in the Cache Check structure
365 /// are valid.
366 ///@{
367 #define EFI_CACHE_CHECK_TRANSACTION_TYPE_VALID       BIT0
368 #define EFI_CACHE_CHECK_OPERATION_VALID              BIT1
369 #define EFI_CACHE_CHECK_LEVEL_VALID                  BIT2
370 #define EFI_CACHE_CHECK_CONTEXT_CORRUPT_VALID        BIT3
371 #define EFI_CACHE_CHECK_UNCORRECTED_VALID            BIT4
372 #define EFI_CACHE_CHECK_PRECISE_IP_VALID             BIT5
373 #define EFI_CACHE_CHECK_RESTARTABLE_VALID            BIT6
374 #define EFI_CACHE_CHECK_OVERFLOW_VALID               BIT7
375 ///@}
376 
377 ///
378 /// Type of cache error in the Cache Check structure
379 ///@{
380 #define EFI_CACHE_CHECK_ERROR_TYPE_INSTRUCTION       0
381 #define EFI_CACHE_CHECK_ERROR_TYPE_DATA_ACCESS       1
382 #define EFI_CACHE_CHECK_ERROR_TYPE_GENERIC           2
383 ///@}
384 
385 ///
386 /// Type of cache operation that caused the error in the Cache
387 /// Check structure
388 ///@{
389 #define EFI_CACHE_CHECK_OPERATION_TYPE_GENERIC                 0
390 #define EFI_CACHE_CHECK_OPERATION_TYPE_GENERIC_READ            1
391 #define EFI_CACHE_CHECK_OPERATION_TYPE_GENERIC_WRITE           2
392 #define EFI_CACHE_CHECK_OPERATION_TYPE_DATA_READ               3
393 #define EFI_CACHE_CHECK_OPERATION_TYPE_DATA_WRITE              4
394 #define EFI_CACHE_CHECK_OPERATION_TYPE_INSTRUCTION_FETCH       5
395 #define EFI_CACHE_CHECK_OPERATION_TYPE_PREFETCH                6
396 #define EFI_CACHE_CHECK_OPERATION_TYPE_EVICTION                7
397 #define EFI_CACHE_CHECK_OPERATION_TYPE_SNOOP                   8
398 ///@}
399 
400 ///
401 /// IA32/X64 Cache Check Structure
402 ///
403 typedef struct {
404   UINT64             ValidFields:16;
405   UINT64             TransactionType:2;
406   UINT64             Operation:4;
407   UINT64             Level:3;
408   UINT64             ContextCorrupt:1;
409   UINT64             ErrorUncorrected:1;
410   UINT64             PreciseIp:1;
411   UINT64             RestartableIp:1;
412   UINT64             Overflow:1;
413   UINT64             Resv1:34;
414 } EFI_IA32_X64_CACHE_CHECK_INFO;
415 
416 ///
417 /// The validation bit mask indicates which fields in the TLB Check structure
418 /// are valid.
419 ///@{
420 #define EFI_TLB_CHECK_TRANSACTION_TYPE_VALID         BIT0
421 #define EFI_TLB_CHECK_OPERATION_VALID                BIT1
422 #define EFI_TLB_CHECK_LEVEL_VALID                    BIT2
423 #define EFI_TLB_CHECK_CONTEXT_CORRUPT_VALID          BIT3
424 #define EFI_TLB_CHECK_UNCORRECTED_VALID              BIT4
425 #define EFI_TLB_CHECK_PRECISE_IP_VALID               BIT5
426 #define EFI_TLB_CHECK_RESTARTABLE_VALID              BIT6
427 #define EFI_TLB_CHECK_OVERFLOW_VALID                 BIT7
428 ///@}
429 
430 ///
431 /// Type of cache error in the TLB Check structure
432 ///@{
433 #define EFI_TLB_CHECK_ERROR_TYPE_INSTRUCTION         0
434 #define EFI_TLB_CHECK_ERROR_TYPE_DATA_ACCESS         1
435 #define EFI_TLB_CHECK_ERROR_TYPE_GENERIC             2
436 ///@}
437 
438 ///
439 /// Type of cache operation that caused the error in the TLB
440 /// Check structure
441 ///@{
442 #define EFI_TLB_CHECK_OPERATION_TYPE_GENERIC         0
443 #define EFI_TLB_CHECK_OPERATION_TYPE_GENERIC_READ    1
444 #define EFI_TLB_CHECK_OPERATION_TYPE_GENERIC_WRITE   2
445 #define EFI_TLB_CHECK_OPERATION_TYPE_DATA_READ       3
446 #define EFI_TLB_CHECK_OPERATION_TYPE_DATA_WRITE      4
447 #define EFI_TLB_CHECK_OPERATION_TYPE_INST_FETCH      5
448 #define EFI_TLB_CHECK_OPERATION_TYPE_PREFETCH        6
449 ///@}
450 
451 ///
452 /// IA32/X64 TLB Check Structure
453 ///
454 typedef struct {
455   UINT64             ValidFields:16;
456   UINT64             TransactionType:2;
457   UINT64             Operation:4;
458   UINT64             Level:3;
459   UINT64             ContextCorrupt:1;
460   UINT64             ErrorUncorrected:1;
461   UINT64             PreciseIp:1;
462   UINT64             RestartableIp:1;
463   UINT64             Overflow:1;
464   UINT64             Resv1:34;
465 } EFI_IA32_X64_TLB_CHECK_INFO;
466 
467 ///
468 /// The validation bit mask indicates which fields in the MS Check structure
469 /// are valid.
470 ///@{
471 #define EFI_BUS_CHECK_TRANSACTION_TYPE_VALID         BIT0
472 #define EFI_BUS_CHECK_OPERATION_VALID                BIT1
473 #define EFI_BUS_CHECK_LEVEL_VALID                    BIT2
474 #define EFI_BUS_CHECK_CONTEXT_CORRUPT_VALID          BIT3
475 #define EFI_BUS_CHECK_UNCORRECTED_VALID              BIT4
476 #define EFI_BUS_CHECK_PRECISE_IP_VALID               BIT5
477 #define EFI_BUS_CHECK_RESTARTABLE_VALID              BIT6
478 #define EFI_BUS_CHECK_OVERFLOW_VALID                 BIT7
479 #define EFI_BUS_CHECK_PARTICIPATION_TYPE_VALID       BIT8
480 #define EFI_BUS_CHECK_TIME_OUT_VALID                 BIT9
481 #define EFI_BUS_CHECK_ADDRESS_SPACE_VALID            BIT10
482 ///@}
483 
484 ///
485 /// Type of cache error in the Bus Check structure
486 ///@{
487 #define EFI_BUS_CHECK_ERROR_TYPE_INSTRUCTION         0
488 #define EFI_BUS_CHECK_ERROR_TYPE_DATA_ACCESS         1
489 #define EFI_BUS_CHECK_ERROR_TYPE_GENERIC             2
490 ///@}
491 
492 ///
493 /// Type of cache operation that caused the error in the Bus
494 /// Check structure
495 ///@{
496 #define EFI_BUS_CHECK_OPERATION_TYPE_GENERIC         0
497 #define EFI_BUS_CHECK_OPERATION_TYPE_GENERIC_READ    1
498 #define EFI_BUS_CHECK_OPERATION_TYPE_GENERIC_WRITE   2
499 #define EFI_BUS_CHECK_OPERATION_TYPE_DATA_READ       3
500 #define EFI_BUS_CHECK_OPERATION_TYPE_DATA_WRITE      4
501 #define EFI_BUS_CHECK_OPERATION_TYPE_INST_FETCH      5
502 #define EFI_BUS_CHECK_OPERATION_TYPE_PREFETCH        6
503 ///@}
504 
505 ///
506 /// Type of Participation
507 ///@{
508 #define EFI_BUS_CHECK_PARTICIPATION_TYPE_REQUEST     0
509 #define EFI_BUS_CHECK_PARTICIPATION_TYPE_RESPONDED   1
510 #define EFI_BUS_CHECK_PARTICIPATION_TYPE_OBSERVED    2
511 #define EFI_BUS_CHECK_PARTICIPATION_TYPE_GENERIC     3
512 ///@}
513 
514 ///
515 /// Type of Address Space
516 ///@{
517 #define EFI_BUS_CHECK_ADDRESS_SPACE_TYPE_MEMORY      0
518 #define EFI_BUS_CHECK_ADDRESS_SPACE_TYPE_RESERVED    1
519 #define EFI_BUS_CHECK_ADDRESS_SPACE_TYPE_IO          2
520 #define EFI_BUS_CHECK_ADDRESS_SPACE_TYPE_OTHER       3
521 ///@}
522 
523 ///
524 /// IA32/X64 Bus Check Structure
525 ///
526 typedef struct {
527   UINT64             ValidFields:16;
528   UINT64             TransactionType:2;
529   UINT64             Operation:4;
530   UINT64             Level:3;
531   UINT64             ContextCorrupt:1;
532   UINT64             ErrorUncorrected:1;
533   UINT64             PreciseIp:1;
534   UINT64             RestartableIp:1;
535   UINT64             Overflow:1;
536   UINT64             ParticipationType:2;
537   UINT64             TimeOut:1;
538   UINT64             AddressSpace:2;
539   UINT64             Resv1:29;
540 } EFI_IA32_X64_BUS_CHECK_INFO;
541 
542 ///
543 /// The validation bit mask indicates which fields in the MS Check structure
544 /// are valid.
545 ///@{
546 #define EFI_MS_CHECK_ERROR_TYPE_VALID                BIT0
547 #define EFI_MS_CHECK_CONTEXT_CORRUPT_VALID           BIT1
548 #define EFI_MS_CHECK_UNCORRECTED_VALID               BIT2
549 #define EFI_MS_CHECK_PRECISE_IP_VALID                BIT3
550 #define EFI_MS_CHECK_RESTARTABLE_VALID               BIT4
551 #define EFI_MS_CHECK_OVERFLOW_VALID                  BIT5
552 ///@}
553 
554 ///
555 /// Error type identifies the operation that caused the error.
556 ///@{
557 #define EFI_MS_CHECK_ERROR_TYPE_NO                             0
558 #define EFI_MS_CHECK_ERROR_TYPE_UNCLASSIFIED                   1
559 #define EFI_MS_CHECK_ERROR_TYPE_MICROCODE_PARITY               2
560 #define EFI_MS_CHECK_ERROR_TYPE_EXTERNAL                       3
561 #define EFI_MS_CHECK_ERROR_TYPE_FRC                            4
562 #define EFI_MS_CHECK_ERROR_TYPE_INTERNAL_UNCLASSIFIED          5
563 ///@}
564 
565 ///
566 /// IA32/X64 MS Check Field Description
567 ///
568 typedef struct {
569   UINT64             ValidFields:16;
570   UINT64             ErrorType:3;
571   UINT64             ContextCorrupt:1;
572   UINT64             ErrorUncorrected:1;
573   UINT64             PreciseIp:1;
574   UINT64             RestartableIp:1;
575   UINT64             Overflow:1;
576   UINT64             Resv1:40;
577 } EFI_IA32_X64_MS_CHECK_INFO;
578 
579 ///
580 /// IA32/X64 Check Information Item
581 ///
582 typedef union {
583   EFI_IA32_X64_CACHE_CHECK_INFO  CacheCheck;
584   EFI_IA32_X64_TLB_CHECK_INFO    TlbCheck;
585   EFI_IA32_X64_BUS_CHECK_INFO    BusCheck;
586   EFI_IA32_X64_MS_CHECK_INFO     MsCheck;
587   UINT64                         Data64;
588 } EFI_IA32_X64_CHECK_INFO_ITEM;
589 
590 ///
591 /// The validation bit mask indicates which fields in the IA32/X64 Processor Error
592 /// Information Structure are valid.
593 ///@{
594 #define EFI_IA32_X64_ERROR_PROC_CHECK_INFO_VALID       BIT0
595 #define EFI_IA32_X64_ERROR_PROC_TARGET_ADDR_VALID      BIT1
596 #define EFI_IA32_X64_ERROR_PROC_REQUESTER_ID_VALID     BIT2
597 #define EFI_IA32_X64_ERROR_PROC_RESPONDER_ID_VALID     BIT3
598 #define EFI_IA32_X64_ERROR_PROC_INST_IP_VALID          BIT4
599 ///@}
600 
601 ///
602 /// IA32/X64 Processor Error Information Structure
603 ///
604 typedef struct {
605   EFI_GUID                     ErrorType;
606   UINT64                       ValidFields;
607   EFI_IA32_X64_CHECK_INFO_ITEM CheckInfo;
608   UINT64                       TargetId;
609   UINT64                       RequestorId;
610   UINT64                       ResponderId;
611   UINT64                       InstructionIP;
612 } EFI_IA32_X64_PROCESS_ERROR_INFO;
613 
614 ///
615 /// IA32/X64 Processor Context Information Structure
616 ///
617 typedef struct {
618   UINT16             RegisterType;
619   UINT16             ArraySize;
620   UINT32             MsrAddress;
621   UINT64             MmRegisterAddress;
622   //
623   // This field will provide the contents of the actual registers or raw data.
624   // The number of Registers or size of the raw data reported is determined
625   // by (Array Size / 8) or otherwise specified by the context structure type
626   // definition.
627   //
628 } EFI_IA32_X64_PROCESSOR_CONTEXT_INFO;
629 
630 ///
631 /// Register Context Type
632 ///@{
633 #define EFI_REG_CONTEXT_TYPE_UNCLASSIFIED            0x0000
634 #define EFI_REG_CONTEXT_TYPE_MSR                     0x0001
635 #define EFI_REG_CONTEXT_TYPE_IA32                    0x0002
636 #define EFI_REG_CONTEXT_TYPE_X64                     0x0003
637 #define EFI_REG_CONTEXT_TYPE_FXSAVE                  0x0004
638 #define EFI_REG_CONTEXT_TYPE_DR_IA32                 0x0005
639 #define EFI_REG_CONTEXT_TYPE_DR_X64                  0x0006
640 #define EFI_REG_CONTEXT_TYPE_MEM_MAP                 0x0007
641 ///@}
642 
643 ///
644 /// IA32 Register State
645 ///
646 typedef struct {
647   UINT32             Eax;
648   UINT32             Ebx;
649   UINT32             Ecx;
650   UINT32             Edx;
651   UINT32             Esi;
652   UINT32             Edi;
653   UINT32             Ebp;
654   UINT32             Esp;
655   UINT16             Cs;
656   UINT16             Ds;
657   UINT16             Ss;
658   UINT16             Es;
659   UINT16             Fs;
660   UINT16             Gs;
661   UINT32             Eflags;
662   UINT32             Eip;
663   UINT32             Cr0;
664   UINT32             Cr1;
665   UINT32             Cr2;
666   UINT32             Cr3;
667   UINT32             Cr4;
668   UINT32             Gdtr[2];
669   UINT32             Idtr[2];
670   UINT16             Ldtr;
671   UINT16             Tr;
672 } EFI_CONTEXT_IA32_REGISTER_STATE;
673 
674 ///
675 /// X64 Register State
676 ///
677 typedef struct {
678   UINT64             Rax;
679   UINT64             Rbx;
680   UINT64             Rcx;
681   UINT64             Rdx;
682   UINT64             Rsi;
683   UINT64             Rdi;
684   UINT64             Rbp;
685   UINT64             Rsp;
686   UINT64             R8;
687   UINT64             R9;
688   UINT64             R10;
689   UINT64             R11;
690   UINT64             R12;
691   UINT64             R13;
692   UINT64             R14;
693   UINT64             R15;
694   UINT16             Cs;
695   UINT16             Ds;
696   UINT16             Ss;
697   UINT16             Es;
698   UINT16             Fs;
699   UINT16             Gs;
700   UINT32             Resv1;
701   UINT64             Rflags;
702   UINT64             Rip;
703   UINT64             Cr0;
704   UINT64             Cr1;
705   UINT64             Cr2;
706   UINT64             Cr3;
707   UINT64             Cr4;
708   UINT64             Gdtr[2];
709   UINT64             Idtr[2];
710   UINT16             Ldtr;
711   UINT16             Tr;
712 } EFI_CONTEXT_X64_REGISTER_STATE;
713 
714 ///
715 /// The validation bit mask indicates each of the following field is in IA32/X64
716 /// Processor Error Section.
717 ///
718 typedef struct {
719   UINT64             ApicIdValid:1;
720   UINT64             CpuIdInforValid:1;
721   UINT64             ErrorInfoNum:6;
722   UINT64             ContextNum:6;
723   UINT64             Resv1:50;
724 } EFI_IA32_X64_VALID_BITS;
725 
726 #endif
727 
728 ///
729 /// Error Status Fields
730 ///
731 typedef struct {
732   UINT64          Resv1:8;
733   UINT64          Type:8;
734   UINT64          AddressSignal:1;        ///< Error in Address signals or in Address portion of transaction
735   UINT64          ControlSignal:1;        ///< Error in Control signals or in Control portion of transaction
736   UINT64          DataSignal:1;           ///< Error in Data signals or in Data portion of transaction
737   UINT64          DetectedByResponder:1;  ///< Error detected by responder
738   UINT64          DetectedByRequester:1;  ///< Error detected by requestor
739   UINT64          FirstError:1;           ///< First Error in the sequence - option field
740   UINT64          OverflowNotLogged:1;    ///< Additional errors were not logged due to lack of resources
741   UINT64          Resv2:41;
742 } EFI_GENERIC_ERROR_STATUS;
743 
744 ///
745 /// Error Type
746 ///
747 typedef enum {
748   ///
749   /// General Internal errors
750   ///
751   ErrorInternal       = 1,
752   ErrorBus            = 16,
753   ///
754   /// Component Internal errors
755   ///
756   ErrorMemStorage     = 4,        // Error in memory device
757   ErrorTlbStorage     = 5,        // TLB error in cache
758   ErrorCacheStorage   = 6,
759   ErrorFunctionalUnit = 7,
760   ErrorSelftest       = 8,
761   ErrorOverflow       = 9,
762   ///
763   /// Bus internal errors
764   ///
765   ErrorVirtualMap     = 17,
766   ErrorAccessInvalid  = 18,       // Improper access
767   ErrorUnimplAccess   = 19,       // Unimplemented memory access
768   ErrorLossOfLockstep = 20,
769   ErrorResponseInvalid= 21,       // Response not associated with request
770   ErrorParity         = 22,
771   ErrorProtocol       = 23,
772   ErrorPath           = 24,       // Detected path error
773   ErrorTimeout        = 25,       // Bus timeout
774   ErrorPoisoned       = 26        // Read data poisoned
775 } EFI_GENERIC_ERROR_STATUS_ERROR_TYPE;
776 
777 ///
778 /// Validation bit mask indicates which fields in the memory error record are valid
779 /// in Memory Error section
780 ///@{
781 #define EFI_PLATFORM_MEMORY_ERROR_STATUS_VALID                 BIT0
782 #define EFI_PLATFORM_MEMORY_PHY_ADDRESS_VALID                  BIT1
783 #define EFI_PLATFORM_MEMORY_PHY_ADDRESS_MASK_VALID             BIT2
784 #define EFI_PLATFORM_MEMORY_NODE_VALID                         BIT3
785 #define EFI_PLATFORM_MEMORY_CARD_VALID                         BIT4
786 #define EFI_PLATFORM_MEMORY_MODULE_VALID                       BIT5
787 #define EFI_PLATFORM_MEMORY_BANK_VALID                         BIT6
788 #define EFI_PLATFORM_MEMORY_DEVICE_VALID                       BIT7
789 #define EFI_PLATFORM_MEMORY_ROW_VALID                          BIT8
790 #define EFI_PLATFORM_MEMORY_COLUMN_VALID                       BIT9
791 #define EFI_PLATFORM_MEMORY_BIT_POS_VALID                      BIT10
792 #define EFI_PLATFORM_MEMORY_REQUESTOR_ID_VALID                 BIT11
793 #define EFI_PLATFORM_MEMORY_RESPONDER_ID_VALID                 BIT12
794 #define EFI_PLATFORM_MEMORY_TARGET_ID_VALID                    BIT13
795 #define EFI_PLATFORM_MEMORY_ERROR_TYPE_VALID                   BIT14
796 #define EFI_PLATFORM_MEMORY_ERROR_RANK_NUM_VALID               BIT15
797 #define EFI_PLATFORM_MEMORY_ERROR_CARD_HANDLE_VALID            BIT16
798 #define EFI_PLATFORM_MEMORY_ERROR_MODULE_HANDLE_VALID          BIT17
799 #define EFI_PLATFORM_MEMORY_ERROR_EXTENDED_ROW_BIT_16_17_VALID BIT18
800 #define EFI_PLATFORM_MEMORY_ERROR_BANK_GROUP_VALID             BIT19
801 #define EFI_PLATFORM_MEMORY_ERROR_BANK_ADDRESS_VALID           BIT20
802 #define EFI_PLATFORM_MEMORY_ERROR_CHIP_IDENTIFICATION_VALID    BIT21
803 ///@}
804 
805 ///
806 /// Memory Error Type identifies the type of error that occurred in Memory
807 /// Error section
808 ///@{
809 #define EFI_PLATFORM_MEMORY_ERROR_UNKNOWN                      0x00
810 #define EFI_PLATFORM_MEMORY_ERROR_NONE                         0x01
811 #define EFI_PLATFORM_MEMORY_ERROR_SINGLEBIT_ECC                0x02
812 #define EFI_PLATFORM_MEMORY_ERROR_MLTIBIT_ECC                  0x03
813 #define EFI_PLATFORM_MEMORY_ERROR_SINGLESYMBOLS_CHIPKILL       0x04
814 #define EFI_PLATFORM_MEMORY_ERROR_MULTISYMBOL_CHIPKILL         0x05
815 #define EFI_PLATFORM_MEMORY_ERROR_MATER_ABORT                  0x06
816 #define EFI_PLATFORM_MEMORY_ERROR_TARGET_ABORT                 0x07
817 #define EFI_PLATFORM_MEMORY_ERROR_PARITY                       0x08
818 #define EFI_PLATFORM_MEMORY_ERROR_WDT                          0x09
819 #define EFI_PLATFORM_MEMORY_ERROR_INVALID_ADDRESS              0x0A
820 #define EFI_PLATFORM_MEMORY_ERROR_MIRROR_FAILED                0x0B
821 #define EFI_PLATFORM_MEMORY_ERROR_SPARING                      0x0C
822 #define EFI_PLATFORM_MEMORY_ERROR_SCRUB_CORRECTED              0x0D
823 #define EFI_PLATFORM_MEMORY_ERROR_SCRUB_UNCORRECTED            0x0E
824 #define EFI_PLATFORM_MEMORY_ERROR_MEMORY_MAP_EVENT             0x0F
825 ///@}
826 
827 ///
828 /// Memory Error Section
829 ///
830 typedef struct {
831   UINT64                   ValidFields;
832   EFI_GENERIC_ERROR_STATUS ErrorStatus;
833   UINT64                   PhysicalAddress;      // Error physical address
834   UINT64                   PhysicalAddressMask;  // Grnaularity
835   UINT16                   Node;                 // Node #
836   UINT16                   Card;
837   UINT16                   ModuleRank;           // Module or Rank#
838   UINT16                   Bank;
839   UINT16                   Device;
840   UINT16                   Row;
841   UINT16                   Column;
842   UINT16                   BitPosition;
843   UINT64                   RequestorId;
844   UINT64                   ResponderId;
845   UINT64                   TargetId;
846   UINT8                    ErrorType;
847   UINT8                    Extended;
848   UINT16                   RankNum;
849   UINT16                   CardHandle;
850   UINT16                   ModuleHandle;
851 } EFI_PLATFORM_MEMORY_ERROR_DATA;
852 
853 ///
854 /// Validation bit mask indicates which fields in the memory error record 2 are valid
855 /// in Memory Error section 2
856 ///@{
857 #define EFI_PLATFORM_MEMORY2_ERROR_STATUS_VALID                 BIT0
858 #define EFI_PLATFORM_MEMORY2_PHY_ADDRESS_VALID                  BIT1
859 #define EFI_PLATFORM_MEMORY2_PHY_ADDRESS_MASK_VALID             BIT2
860 #define EFI_PLATFORM_MEMORY2_NODE_VALID                         BIT3
861 #define EFI_PLATFORM_MEMORY2_CARD_VALID                         BIT4
862 #define EFI_PLATFORM_MEMORY2_MODULE_VALID                       BIT5
863 #define EFI_PLATFORM_MEMORY2_BANK_VALID                         BIT6
864 #define EFI_PLATFORM_MEMORY2_DEVICE_VALID                       BIT7
865 #define EFI_PLATFORM_MEMORY2_ROW_VALID                          BIT8
866 #define EFI_PLATFORM_MEMORY2_COLUMN_VALID                       BIT9
867 #define EFI_PLATFORM_MEMORY2_RANK_VALID                         BIT10
868 #define EFI_PLATFORM_MEMORY2_BIT_POS_VALID                      BIT11
869 #define EFI_PLATFORM_MEMORY2_CHIP_ID_VALID                      BIT12
870 #define EFI_PLATFORM_MEMORY2_MEMORY_ERROR_TYPE_VALID            BIT13
871 #define EFI_PLATFORM_MEMORY2_STATUS_VALID                       BIT14
872 #define EFI_PLATFORM_MEMORY2_REQUESTOR_ID_VALID                 BIT15
873 #define EFI_PLATFORM_MEMORY2_RESPONDER_ID_VALID                 BIT16
874 #define EFI_PLATFORM_MEMORY2_TARGET_ID_VALID                    BIT17
875 #define EFI_PLATFORM_MEMORY2_CARD_HANDLE_VALID                  BIT18
876 #define EFI_PLATFORM_MEMORY2_MODULE_HANDLE_VALID                BIT19
877 #define EFI_PLATFORM_MEMORY2_BANK_GROUP_VALID                   BIT20
878 #define EFI_PLATFORM_MEMORY2_BANK_ADDRESS_VALID                 BIT21
879 ///@}
880 
881 ///
882 /// Memory Error Type identifies the type of error that occurred in Memory
883 /// Error section 2
884 ///@{
885 #define EFI_PLATFORM_MEMORY2_ERROR_UNKNOWN                      0x00
886 #define EFI_PLATFORM_MEMORY2_ERROR_NONE                         0x01
887 #define EFI_PLATFORM_MEMORY2_ERROR_SINGLEBIT_ECC                0x02
888 #define EFI_PLATFORM_MEMORY2_ERROR_MLTIBIT_ECC                  0x03
889 #define EFI_PLATFORM_MEMORY2_ERROR_SINGLESYMBOL_CHIPKILL        0x04
890 #define EFI_PLATFORM_MEMORY2_ERROR_MULTISYMBOL_CHIPKILL         0x05
891 #define EFI_PLATFORM_MEMORY2_ERROR_MASTER_ABORT                 0x06
892 #define EFI_PLATFORM_MEMORY2_ERROR_TARGET_ABORT                 0x07
893 #define EFI_PLATFORM_MEMORY2_ERROR_PARITY                       0x08
894 #define EFI_PLATFORM_MEMORY2_ERROR_WDT                          0x09
895 #define EFI_PLATFORM_MEMORY2_ERROR_INVALID_ADDRESS              0x0A
896 #define EFI_PLATFORM_MEMORY2_ERROR_MIRROR_BROKEN                0x0B
897 #define EFI_PLATFORM_MEMORY2_ERROR_MEMORY_SPARING               0x0C
898 #define EFI_PLATFORM_MEMORY2_ERROR_SCRUB_CORRECTED              0x0D
899 #define EFI_PLATFORM_MEMORY2_ERROR_SCRUB_UNCORRECTED            0x0E
900 #define EFI_PLATFORM_MEMORY2_ERROR_MEMORY_MAP_EVENT             0x0F
901 ///@}
902 
903 ///
904 /// Memory Error Section 2
905 ///
906 typedef struct {
907   UINT64                    ValidFields;
908   EFI_GENERIC_ERROR_STATUS  ErrorStatus;
909   UINT64                    PhysicalAddress;      // Error physical address
910   UINT64                    PhysicalAddressMask;  // Grnaularity
911   UINT16                    Node;                 // Node #
912   UINT16                    Card;
913   UINT16                    Module;               // Module or Rank#
914   UINT16                    Bank;
915   UINT32                    Device;
916   UINT32                    Row;
917   UINT32                    Column;
918   UINT32                    Rank;
919   UINT32                    BitPosition;
920   UINT8                     ChipId;
921   UINT8                     MemErrorType;
922   UINT8                     Status;
923   UINT8                     Reserved;
924   UINT64                    RequestorId;
925   UINT64                    ResponderId;
926   UINT64                    TargetId;
927   UINT32                    CardHandle;
928   UINT32                    ModuleHandle;
929 } EFI_PLATFORM_MEMORY2_ERROR_DATA;
930 
931 ///
932 /// Validation bits mask indicates which of the following fields is valid
933 /// in PCI Express Error Record.
934 ///@{
935 #define EFI_PCIE_ERROR_PORT_TYPE_VALID               BIT0
936 #define EFI_PCIE_ERROR_VERSION_VALID                 BIT1
937 #define EFI_PCIE_ERROR_COMMAND_STATUS_VALID          BIT2
938 #define EFI_PCIE_ERROR_DEVICE_ID_VALID               BIT3
939 #define EFI_PCIE_ERROR_SERIAL_NO_VALID               BIT4
940 #define EFI_PCIE_ERROR_BRIDGE_CRL_STS_VALID          BIT5
941 #define EFI_PCIE_ERROR_CAPABILITY_INFO_VALID         BIT6
942 #define EFI_PCIE_ERROR_AER_INFO_VALID                BIT7
943 ///@}
944 
945 ///
946 /// PCIe Device/Port Type as defined in the PCI Express capabilities register
947 ///@{
948 #define EFI_PCIE_ERROR_PORT_PCIE_ENDPOINT            0x00000000
949 #define EFI_PCIE_ERROR_PORT_PCI_ENDPOINT             0x00000001
950 #define EFI_PCIE_ERROR_PORT_ROOT_PORT                0x00000004
951 #define EFI_PCIE_ERROR_PORT_UPSWITCH_PORT            0x00000005
952 #define EFI_PCIE_ERROR_PORT_DOWNSWITCH_PORT          0x00000006
953 #define EFI_PCIE_ERROR_PORT_PCIE_TO_PCI_BRIDGE       0x00000007
954 #define EFI_PCIE_ERROR_PORT_PCI_TO_PCIE_BRIDGE       0x00000008
955 #define EFI_PCIE_ERROR_PORT_ROOT_INT_ENDPOINT        0x00000009
956 #define EFI_PCIE_ERROR_PORT_ROOT_EVENT_COLLECTOR     0x0000000A
957 ///@}
958 
959 ///
960 /// PCI Slot number
961 ///
962 typedef struct {
963   UINT16          Resv1:3;
964   UINT16          Number:13;
965 } EFI_GENERIC_ERROR_PCI_SLOT;
966 
967 ///
968 /// PCIe Root Port PCI/bridge PCI compatible device number and
969 /// bus number information to uniquely identify the root port or
970 /// bridge. Default values for both the bus numbers is zero.
971 ///
972 typedef struct {
973   UINT16                     VendorId;
974   UINT16                     DeviceId;
975   UINT8                      ClassCode[3];
976   UINT8                      Function;
977   UINT8                      Device;
978   UINT16                     Segment;
979   UINT8                      PrimaryOrDeviceBus;
980   UINT8                      SecondaryBus;
981   EFI_GENERIC_ERROR_PCI_SLOT Slot;
982   UINT8                      Resv1;
983 } EFI_GENERIC_ERROR_PCIE_DEV_BRIDGE_ID;
984 
985 ///
986 /// PCIe Capability Structure
987 ///
988 typedef struct {
989   UINT8           PcieCap[60];
990 } EFI_PCIE_ERROR_DATA_CAPABILITY;
991 
992 ///
993 /// PCIe Advanced Error Reporting Extended Capability Structure.
994 ///
995 typedef struct {
996   UINT8           PcieAer[96];
997 } EFI_PCIE_ERROR_DATA_AER;
998 
999 ///
1000 /// PCI Express Error Record
1001 ///
1002 typedef struct {
1003   UINT64                               ValidFields;
1004   UINT32                               PortType;
1005   UINT32                               Version;
1006   UINT32                               CommandStatus;
1007   UINT32                               Resv2;
1008   EFI_GENERIC_ERROR_PCIE_DEV_BRIDGE_ID DevBridge;
1009   UINT64                               SerialNo;
1010   UINT32                               BridgeControlStatus;
1011   EFI_PCIE_ERROR_DATA_CAPABILITY       Capability;
1012   EFI_PCIE_ERROR_DATA_AER              AerInfo;
1013 } EFI_PCIE_ERROR_DATA;
1014 
1015 ///
1016 /// Validation bits Indicates which of the following fields is valid
1017 /// in PCI/PCI-X Bus Error Section.
1018 ///@{
1019 #define EFI_PCI_PCIX_BUS_ERROR_STATUS_VALID          BIT0
1020 #define EFI_PCI_PCIX_BUS_ERROR_TYPE_VALID            BIT1
1021 #define EFI_PCI_PCIX_BUS_ERROR_BUS_ID_VALID          BIT2
1022 #define EFI_PCI_PCIX_BUS_ERROR_BUS_ADDRESS_VALID     BIT3
1023 #define EFI_PCI_PCIX_BUS_ERROR_BUS_DATA_VALID        BIT4
1024 #define EFI_PCI_PCIX_BUS_ERROR_COMMAND_VALID         BIT5
1025 #define EFI_PCI_PCIX_BUS_ERROR_REQUESTOR_ID_VALID    BIT6
1026 #define EFI_PCI_PCIX_BUS_ERROR_COMPLETER_ID_VALID    BIT7
1027 #define EFI_PCI_PCIX_BUS_ERROR_TARGET_ID_VALID       BIT8
1028 ///@}
1029 
1030 ///
1031 /// PCI Bus Error Type in PCI/PCI-X Bus Error Section
1032 ///@{
1033 #define EFI_PCI_PCIX_BUS_ERROR_UNKNOWN               0x0000
1034 #define EFI_PCI_PCIX_BUS_ERROR_DATA_PARITY           0x0001
1035 #define EFI_PCI_PCIX_BUS_ERROR_SYSTEM                0x0002
1036 #define EFI_PCI_PCIX_BUS_ERROR_MASTER_ABORT          0x0003
1037 #define EFI_PCI_PCIX_BUS_ERROR_BUS_TIMEOUT           0x0004
1038 #define EFI_PCI_PCIX_BUS_ERROR_MASTER_DATA_PARITY    0x0005
1039 #define EFI_PCI_PCIX_BUS_ERROR_ADDRESS_PARITY        0x0006
1040 #define EFI_PCI_PCIX_BUS_ERROR_COMMAND_PARITY        0x0007
1041 ///@}
1042 
1043 ///
1044 /// PCI/PCI-X Bus Error Section
1045 ///
1046 typedef struct {
1047   UINT64                   ValidFields;
1048   EFI_GENERIC_ERROR_STATUS ErrorStatus;
1049   UINT16                   Type;
1050   UINT16                   BusId;
1051   UINT32                   Resv2;
1052   UINT64                   BusAddress;
1053   UINT64                   BusData;
1054   UINT64                   BusCommand;
1055   UINT64                   RequestorId;
1056   UINT64                   ResponderId;
1057   UINT64                   TargetId;
1058 } EFI_PCI_PCIX_BUS_ERROR_DATA;
1059 
1060 ///
1061 /// Validation bits Indicates which of the following fields is valid
1062 /// in PCI/PCI-X Component Error Section.
1063 ///@{
1064 #define EFI_PCI_PCIX_DEVICE_ERROR_STATUS_VALID                 BIT0
1065 #define EFI_PCI_PCIX_DEVICE_ERROR_ID_INFO_VALID                BIT1
1066 #define EFI_PCI_PCIX_DEVICE_ERROR_MEM_NUM_VALID                BIT2
1067 #define EFI_PCI_PCIX_DEVICE_ERROR_IO_NUM_VALID                 BIT3
1068 #define EFI_PCI_PCIX_DEVICE_ERROR_REG_DATA_PAIR_VALID          BIT4
1069 ///@}
1070 
1071 ///
1072 /// PCI/PCI-X Device Identification Information
1073 ///
1074 typedef struct {
1075   UINT16          VendorId;
1076   UINT16          DeviceId;
1077   UINT8           ClassCode[3];
1078   UINT8           Function;
1079   UINT8           Device;
1080   UINT8           Bus;
1081   UINT8           Segment;
1082   UINT8           Resv1;
1083   UINT32          Resv2;
1084 } EFI_GENERIC_ERROR_PCI_DEVICE_ID;
1085 
1086 ///
1087 /// Identifies the type of firmware error record
1088 ///@{
1089 #define EFI_FIRMWARE_ERROR_TYPE_IPF_SAL              0x00
1090 #define EFI_FIRMWARE_ERROR_TYPE_SOC_TYPE1            0x01
1091 #define EFI_FIRMWARE_ERROR_TYPE_SOC_TYPE2            0x02
1092 ///@}
1093 
1094 ///
1095 /// Firmware Error Record Section
1096 ///
1097 typedef struct {
1098   UINT8       ErrorType;
1099   UINT8       Revision;
1100   UINT8       Resv1[6];
1101   UINT64      RecordId;
1102   EFI_GUID    RecordIdGuid;
1103 } EFI_FIRMWARE_ERROR_DATA;
1104 
1105 ///
1106 /// Fault Reason in DMAr Generic Error Section
1107 ///@{
1108 #define EFI_DMA_FAULT_REASON_TABLE_ENTRY_NOT_PRESENT           0x01
1109 #define EFI_DMA_FAULT_REASON_TABLE_ENTRY_INVALID               0x02
1110 #define EFI_DMA_FAULT_REASON_ACCESS_MAPPING_TABLE_ERROR        0x03
1111 #define EFI_DMA_FAULT_REASON_RESV_BIT_ERROR_IN_MAPPING_TABLE   0x04
1112 #define EFI_DMA_FAULT_REASON_ACCESS_ADDR_OUT_OF_SPACE          0x05
1113 #define EFI_DMA_FAULT_REASON_INVALID_ACCESS                    0x06
1114 #define EFI_DMA_FAULT_REASON_INVALID_REQUEST                   0x07
1115 #define EFI_DMA_FAULT_REASON_ACCESS_TRANSLATE_TABLE_ERROR      0x08
1116 #define EFI_DMA_FAULT_REASON_RESV_BIT_ERROR_IN_TRANSLATE_TABLE 0x09
1117 #define EFI_DMA_FAULT_REASON_INVALID_COMMAOND                  0x0A
1118 #define EFI_DMA_FAULT_REASON_ACCESS_COMMAND_BUFFER_ERROR       0x0B
1119 ///@}
1120 
1121 ///
1122 /// DMA access type in DMAr Generic Error Section
1123 ///@{
1124 #define EFI_DMA_ACCESS_TYPE_READ                     0x00
1125 #define EFI_DMA_ACCESS_TYPE_WRITE                    0x01
1126 ///@}
1127 
1128 ///
1129 /// DMA address type in DMAr Generic Error Section
1130 ///@{
1131 #define EFI_DMA_ADDRESS_UNTRANSLATED                 0x00
1132 #define EFI_DMA_ADDRESS_TRANSLATION                  0x01
1133 ///@}
1134 
1135 ///
1136 /// Architecture type in DMAr Generic Error Section
1137 ///@{
1138 #define EFI_DMA_ARCH_TYPE_VT                         0x01
1139 #define EFI_DMA_ARCH_TYPE_IOMMU                      0x02
1140 ///@}
1141 
1142 ///
1143 /// DMAr Generic Error Section
1144 ///
1145 typedef struct {
1146   UINT16      RequesterId;
1147   UINT16      SegmentNumber;
1148   UINT8       FaultReason;
1149   UINT8       AccessType;
1150   UINT8       AddressType;
1151   UINT8       ArchType;
1152   UINT64      DeviceAddr;
1153   UINT8       Resv1[16];
1154 } EFI_DMAR_GENERIC_ERROR_DATA;
1155 
1156 ///
1157 /// Intel VT for Directed I/O specific DMAr Errors
1158 ///
1159 typedef struct {
1160   UINT8           Version;
1161   UINT8           Revision;
1162   UINT8           OemId[6];
1163   UINT64          Capability;
1164   UINT64          CapabilityEx;
1165   UINT32          GlobalCommand;
1166   UINT32          GlobalStatus;
1167   UINT32          FaultStatus;
1168   UINT8           Resv1[12];
1169   UINT64          FaultRecord[2];
1170   UINT64          RootEntry[2];
1171   UINT64          ContextEntry[2];
1172   UINT64          PteL6;
1173   UINT64          PteL5;
1174   UINT64          PteL4;
1175   UINT64          PteL3;
1176   UINT64          PteL2;
1177   UINT64          PteL1;
1178 } EFI_DIRECTED_IO_DMAR_ERROR_DATA;
1179 
1180 ///
1181 /// IOMMU specific DMAr Errors
1182 ///
1183 typedef struct {
1184   UINT8           Revision;
1185   UINT8           Resv1[7];
1186   UINT64          Control;
1187   UINT64          Status;
1188   UINT8           Resv2[8];
1189   UINT64          EventLogEntry[2];
1190   UINT8           Resv3[16];
1191   UINT64          DeviceTableEntry[4];
1192   UINT64          PteL6;
1193   UINT64          PteL5;
1194   UINT64          PteL4;
1195   UINT64          PteL3;
1196   UINT64          PteL2;
1197   UINT64          PteL1;
1198 } EFI_IOMMU_DMAR_ERROR_DATA;
1199 
1200 #pragma pack()
1201 
1202 extern EFI_GUID gEfiEventNotificationTypeCmcGuid;
1203 extern EFI_GUID gEfiEventNotificationTypeCpeGuid;
1204 extern EFI_GUID gEfiEventNotificationTypeMceGuid;
1205 extern EFI_GUID gEfiEventNotificationTypePcieGuid;
1206 extern EFI_GUID gEfiEventNotificationTypeInitGuid;
1207 extern EFI_GUID gEfiEventNotificationTypeNmiGuid;
1208 extern EFI_GUID gEfiEventNotificationTypeBootGuid;
1209 extern EFI_GUID gEfiEventNotificationTypeDmarGuid;
1210 
1211 extern EFI_GUID gEfiProcessorGenericErrorSectionGuid;
1212 extern EFI_GUID gEfiProcessorSpecificErrorSectionGuid;
1213 extern EFI_GUID gEfiIa32X64ProcessorErrorSectionGuid;
1214 extern EFI_GUID gEfiArmProcessorErrorSectionGuid ;
1215 extern EFI_GUID gEfiPlatformMemoryErrorSectionGuid;
1216 extern EFI_GUID gEfiPlatformMemory2ErrorSectionGuid;
1217 extern EFI_GUID gEfiPcieErrorSectionGuid;
1218 extern EFI_GUID gEfiFirmwareErrorSectionGuid;
1219 extern EFI_GUID gEfiPciBusErrorSectionGuid;
1220 extern EFI_GUID gEfiPciDevErrorSectionGuid;
1221 extern EFI_GUID gEfiDMArGenericErrorSectionGuid;
1222 extern EFI_GUID gEfiDirectedIoDMArErrorSectionGuid;
1223 extern EFI_GUID gEfiIommuDMArErrorSectionGuid;
1224 
1225 #if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
1226 ///
1227 /// IA32 and x64 Specific definitions.
1228 ///
1229 
1230 extern EFI_GUID gEfiIa32X64ErrorTypeCacheCheckGuid;
1231 extern EFI_GUID gEfiIa32X64ErrorTypeTlbCheckGuid;
1232 extern EFI_GUID gEfiIa32X64ErrorTypeBusCheckGuid;
1233 extern EFI_GUID gEfiIa32X64ErrorTypeMsCheckGuid;
1234 
1235 #endif
1236 
1237 #endif
1238