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