]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Guid/StatusCodeDataTypeId.h
supply comments on data structure to follow spec.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Guid / StatusCodeDataTypeId.h
1 /** @file
2 GUID used to identify id for the caller who is initiating the Status Code.
3
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 Module Name: StatusCodeDataTypeId.h
14
15 @par Revision Reference:
16 GUIDs defined in Status Codes Specification 0.92
17
18 **/
19
20 #ifndef __STATUS_CODE_DATA_TYPE_ID_GUID_H__
21 #define __STATUS_CODE_DATA_TYPE_ID_GUID_H__
22
23 #include <PiPei.h>
24 #include <Framework/StatusCode.h>
25 #include <Framework/DataHubRecords.h>
26 #include <Protocol/DebugSupport.h>
27 #include <Protocol/FrameworkHii.h>
28
29 //////////////////////////////////////////////////////////////////////////////////////////
30 // String Data Type defintion. This is part of Status Code Specification
31 //////////////////////////////////////////////////////////////////////////////////////////
32 #define EFI_STATUS_CODE_DATA_TYPE_STRING_GUID \
33 { 0x92D11080, 0x496F, 0x4D95, { 0xBE, 0x7E, 0x03, 0x74, 0x88, 0x38, 0x2B, 0x0A } }
34
35 #pragma pack(1)
36
37 typedef enum {
38 ///
39 /// A NULL-terminated ASCII string.
40 ///
41 EfiStringAscii,
42 ///
43 /// A double NULL-terminated Unicode string.
44 ///
45 EfiStringUnicode,
46 ///
47 /// An EFI_STATUS_CODE_STRING_TOKEN representing the string. The actual string
48 /// can be obtained by querying the HII Database.
49 ///
50 EfiStringToken
51 } EFI_STRING_TYPE;
52
53 typedef struct {
54 ///
55 /// The HII handle of the string pack, which can be used to retrieve the string.
56 /// It is a dynamic value that may not be the same for different boots.
57 ///
58 FRAMEWORK_EFI_HII_HANDLE Handle;
59 ///
60 /// When combined with the HII handle, the string token can be used to retrieve the
61 /// string.
62 ///
63 STRING_REF Token;
64 } EFI_STATUS_CODE_STRING_TOKEN;
65
66 typedef union {
67 ///
68 /// ASCII formatted string.
69 ///
70 CHAR8 *Ascii;
71 ///
72 /// Unicode formatted string.
73 ///
74 CHAR16 *Unicode;
75 ///
76 /// HII handle/token pair.
77 ///
78 EFI_STATUS_CODE_STRING_TOKEN Hii;
79 } EFI_STATUS_CODE_STRING;
80
81 typedef struct {
82 ///
83 /// The data header identifying the data. The HeaderSize should be sizeof
84 /// (EFI_STATUS_CODE_DATA).
85 /// The Size should be sizeof(EFI_STATUS_CODE_STRING_DATA) - HeaderSize.
86 /// The Type should be EFI_STATUS_CODE_DATA_TYPE_STRING_GUID.
87 ///
88 EFI_STATUS_CODE_DATA DataHeader;
89 ///
90 /// Specifies if the string is ASCII or Unicode.
91 ///
92 EFI_STRING_TYPE StringType;
93 ///
94 /// A pointer to a null-terminated ASCII or Unicode string.
95 ///
96 EFI_STATUS_CODE_STRING String;
97 } EFI_STATUS_CODE_STRING_DATA;
98 #pragma pack()
99
100 extern EFI_GUID gEfiStatusCodeDataTypeStringGuid;
101
102
103 //////////////////////////////////////////////////////////////////////////////////////////
104 // Special Data Type defintion. This is part of Status Code Specification
105 //////////////////////////////////////////////////////////////////////////////////////////
106 #define EFI_STATUS_CODE_SPECIFIC_DATA_GUID \
107 { 0x335984bd, 0xe805, 0x409a, { 0xb8, 0xf8, 0xd2, 0x7e, 0xce, 0x5f, 0xf7, 0xa6 } }
108
109 #pragma pack(1)
110
111 ///
112 /// Device handle Extended Data. Used for many
113 /// errors and progress codes to point to the device.
114 ///
115 typedef struct {
116 EFI_STATUS_CODE_DATA DataHeader;
117 EFI_HANDLE Handle;
118 } EFI_DEVICE_HANDLE_EXTENDED_DATA;
119
120 ///
121 /// Extended data about the device path, which is used for many errors and
122 /// progress codes to point to the device.
123 ///
124 typedef struct {
125 EFI_STATUS_CODE_DATA DataHeader;
126 UINT8 *DevicePath;
127 } EFI_DEVICE_PATH_EXTENDED_DATA;
128
129 ///
130 /// This structure defines extended data describing a PCI resource allocation error.
131 ///
132 typedef struct {
133 EFI_STATUS_CODE_DATA DataHeader;
134 UINT32 Bar;
135 UINT16 DevicePathSize;
136 UINT16 ReqResSize;
137 UINT16 AllocResSize;
138 UINT8 *DevicePath;
139 UINT8 *ReqRes;
140 UINT8 *AllocRes;
141 } EFI_RESOURCE_ALLOC_FAILURE_ERROR_DATA;
142
143 ///
144 /// This structure provides the voltage at the time of error. It also provides
145 /// the threshold value indicating the minimum or maximum voltage that is considered
146 /// an error. If the voltage is less then the threshold, the error indicates that the
147 /// voltage fell below the minimum acceptable value. If the voltage is greater then the threshold,
148 /// the error indicates that the voltage rose above the maximum acceptable value.
149 ///
150 typedef struct {
151 ///
152 /// The data header identifying the data.
153 ///
154 EFI_STATUS_CODE_DATA DataHeader;
155 ///
156 /// The voltage value at the time of the error.
157 ///
158 EFI_EXP_BASE10_DATA Voltage;
159 ///
160 /// The voltage threshold.
161 ///
162 EFI_EXP_BASE10_DATA Threshold;
163 } EFI_COMPUTING_UNIT_VOLTAGE_ERROR_DATA;
164
165 ///
166 /// Microcode Update Extended Error Data
167 ///
168 typedef struct {
169 ///
170 /// The data header identifying the data.
171 ///
172 EFI_STATUS_CODE_DATA DataHeader;
173 ///
174 /// The version of the microcode update from the header.
175 ///
176 UINT32 Version;
177 } EFI_COMPUTING_UNIT_MICROCODE_UPDATE_ERROR_DATA;
178
179 ///
180 /// Asynchronous Timer Extended Error Data
181 /// The timer limit provides the timeout value of the timer prior to expiration.
182 ///
183 typedef struct {
184 ///
185 /// The data header identifying the data.
186 ///
187 EFI_STATUS_CODE_DATA DataHeader;
188 ///
189 /// The number of seconds that the computing unit timer was configured to expire.
190 ///
191 EFI_EXP_BASE10_DATA TimerLimit;
192 } EFI_COMPUTING_UNIT_TIMER_EXPIRED_ERROR_DATA;
193
194 ///
195 /// Host Processor Mismatch Extended Error Data
196 /// This provides information to indicate which processors mismatch, and how they mismatch. The
197 /// status code contains the instance number of the processor that is in error. This structure's
198 /// Instance indicates the second processor that does not match. This differentiation allows the
199 /// consumer to determine which two processors do not match. The Attributes indicate what
200 /// mismatch is being reported. Because Attributes is a bit field, more than one mismatch can be
201 /// reported with one error code.
202 ///
203 typedef struct {
204 ///
205 /// The data header identifying the data.
206 ///
207 EFI_STATUS_CODE_DATA DataHeader;
208 ///
209 /// The unit number of the computing unit that does not match.
210 ///
211 UINT32 Instance;
212 ///
213 /// The attributes describing the failure.
214 ///
215 UINT16 Attributes;
216 } EFI_HOST_PROCESSOR_MISMATCH_ERROR_DATA;
217
218 ///
219 /// Thermal Extended Error Data
220 /// This structure provides the temperature at the time of error. It also provides the threshold value
221 /// indicating the minimum temperature that is considered an error.
222 ///
223 typedef struct {
224 ///
225 /// The data header identifying the data.
226 ///
227 EFI_STATUS_CODE_DATA DataHeader;
228 ///
229 /// The thermal value at the time of the error.
230 ///
231 EFI_EXP_BASE10_DATA Temperature;
232 ///
233 /// The thermal threshold.
234 ///
235 EFI_EXP_BASE10_DATA Threshold;
236 } EFI_COMPUTING_UNIT_THERMAL_ERROR_DATA;
237
238 //
239 // Valid cache types
240 //
241 typedef enum {
242 EfiInitCacheDataOnly,
243 EfiInitCacheInstrOnly,
244 EfiInitCacheBoth,
245 EfiInitCacheUnspecified
246 } EFI_INIT_CACHE_TYPE;
247
248 ///
249 /// Embedded cache init extended data
250 ///
251 typedef struct {
252 EFI_STATUS_CODE_DATA DataHeader;
253 UINT32 Level;
254 EFI_INIT_CACHE_TYPE Type;
255 } EFI_CACHE_INIT_DATA;
256
257 ///
258 /// Processor Disabled Extended Error Data
259 /// This structure provides details as to why and how the computing unit was disabled. The causes
260 /// should cover the typical reasons a processor would be disabled. How the processor was disabled is
261 /// important because there are distinct differences between hardware and software disabling.
262 ///
263 typedef struct {
264 ///
265 /// The data header identifying the data.
266 ///
267 EFI_STATUS_CODE_DATA DataHeader;
268 ///
269 /// The reason for disabling the processor.
270 ///
271 UINT32 Cause;
272 ///
273 /// TRUE if the processor is disabled via software means such as not listing it in the ACPI tables.
274 /// Such a processor will respond to Interprocessor Interrupts (IPIs). FALSE if the processor is hardware
275 /// disabled, which means it is invisible to software and will not respond to IPIs.
276 ///
277 BOOLEAN SoftwareDisabled;
278 } EFI_COMPUTING_UNIT_CPU_DISABLED_ERROR_DATA;
279
280 ///
281 /// Memory Error Operation Definition
282 ///
283 typedef UINT8 EFI_MEMORY_ERROR_OPERATION;
284
285 ///
286 /// Memory Error Granularity Definition
287 ///
288 typedef UINT8 EFI_MEMORY_ERROR_GRANULARITY;
289
290 ///
291 /// This structure provides specific details about the memory error that was detected. It provides
292 /// enough information so that consumers can identify the exact failure and provides enough
293 /// information to enable corrective action if necessary.
294 ///
295 typedef struct {
296 ///
297 /// The data header identifying the data.
298 ///
299 EFI_STATUS_CODE_DATA DataHeader;
300 ///
301 /// The error granularity type.
302 ///
303 EFI_MEMORY_ERROR_GRANULARITY Granularity;
304 ///
305 /// The operation that resulted in the error being detected.
306 ///
307 EFI_MEMORY_ERROR_OPERATION Operation;
308 ///
309 /// The error syndrome, vendor-specific ECC syndrome, or CRC data associated with
310 /// the error. If unknown, should be initialized to 0.
311 ///
312 UINTN Syndrome;
313 ///
314 /// The physical address of the error.
315 ///
316 EFI_PHYSICAL_ADDRESS Address;
317 ///
318 /// The range, in bytes, within which the error address can be determined.
319 ///
320 UINTN Resolution;
321 } EFI_MEMORY_EXTENDED_ERROR_DATA;
322
323 ///
324 /// This extended data provides some context that consumers can use to locate a DIMM within the
325 /// overall memory scheme.
326 ///
327 typedef struct {
328 ///
329 /// The data header identifying the data.
330 ///
331 EFI_STATUS_CODE_DATA DataHeader;
332 ///
333 /// The memory array number.
334 ///
335 UINT16 Array;
336 ///
337 /// The device number within that Array.
338 ///
339 UINT16 Device;
340 } EFI_STATUS_CODE_DIMM_NUMBER;
341
342 ///
343 /// Memory Module Mismatch Extended Error Data
344 ///
345 typedef struct {
346 ///
347 /// The data header identifying the data.
348 ///
349 EFI_STATUS_CODE_DATA DataHeader;
350 ///
351 /// The instance number of the memory module that does not match.
352 ///
353 EFI_STATUS_CODE_DIMM_NUMBER Instance;
354 } EFI_MEMORY_MODULE_MISMATCH_ERROR_DATA;
355
356 ///
357 /// Memory Range Extended Data
358 /// This extended data may be used to convey the specifics of a memory range. Ranges are specified
359 /// with a start address and a length.
360 ///
361 typedef struct {
362 ///
363 /// The data header identifying the data.
364 ///
365 EFI_STATUS_CODE_DATA DataHeader;
366 ///
367 /// The starting address of the memory range.
368 ///
369 EFI_PHYSICAL_ADDRESS Start;
370 ///
371 /// The length in bytes of the memory range.
372 ///
373 EFI_PHYSICAL_ADDRESS Length;
374 } EFI_MEMORY_RANGE_EXTENDED_DATA;
375
376 ///
377 /// Extended Error Data for Assert
378 /// The data indicates the location of the assertion that failed in the source code. This information
379 /// includes the file name and line number that are necessary to find the failing assertion in source code.
380 ///
381 typedef struct {
382 ///
383 /// The data header identifying the data.
384 ///
385 EFI_STATUS_CODE_DATA DataHeader;
386 ///
387 /// The line number of the source file where the fault was generated.
388 ///
389 UINT32 LineNumber;
390 ///
391 /// The size in bytes of FileName.
392 ///
393 UINT32 FileNameSize;
394 ///
395 /// A pointer to a NULL-terminated ASCII or Unicode string that represents the file
396 /// name of the source file where the fault was generated.
397 ///
398 EFI_STATUS_CODE_STRING_DATA *FileName;
399 } EFI_DEBUG_ASSERT_DATA;
400
401 ///
402 /// System Context Data EBC/IA32/IPF
403 ///
404 typedef union {
405 EFI_SYSTEM_CONTEXT_EBC SystemContextEbc;
406 EFI_SYSTEM_CONTEXT_IA32 SystemContextIa32;
407 EFI_SYSTEM_CONTEXT_IPF SystemContextIpf;
408 } EFI_STATUS_CODE_EXCEP_SYSTEM_CONTEXT;
409
410 ///
411 /// This extended data allows the processor context that is present at the time of the exception to be
412 /// reported with the exception. The format and contents of the context data varies depending on the
413 /// processor architecture.
414 ///
415 typedef struct {
416 ///
417 /// The data header identifying the data.
418 ///
419 EFI_STATUS_CODE_DATA DataHeader;
420 ///
421 /// The system context.
422 ///
423 EFI_STATUS_CODE_EXCEP_SYSTEM_CONTEXT Context;
424 } EFI_STATUS_CODE_EXCEP_EXTENDED_DATA;
425
426 ///
427 /// This extended data records information about a Start() function call. Start() is a member of
428 /// the EFI 1.10 Driver Binding Protocol.
429 ///
430 typedef struct {
431 ///
432 /// The data header identifying the data.
433 ///
434 EFI_STATUS_CODE_DATA DataHeader;
435 ///
436 /// The controller handle.
437 ///
438 EFI_HANDLE ControllerHandle;
439 ///
440 /// The driver binding handle.
441 ///
442 EFI_HANDLE DriverBindingHandle;
443 ///
444 /// The size of the RemainingDevicePath. It is zero if the Start() function is
445 /// called with RemainingDevicePath = NULL.
446 ///
447 UINT16 DevicePathSize;
448 ///
449 /// Matches the RemainingDevicePath parameter being passed to the Start()
450 /// function. Note that this parameter is the variable-length device path and not a pointer
451 /// to the device path.
452 ///
453 UINT8 *RemainingDevicePath;
454 } EFI_STATUS_CODE_START_EXTENDED_DATA;
455
456 ///
457 /// Legacy Oprom extended data
458 /// The device handle and ROM image base can be used by consumers to determine which option
459 /// ROM failed. Due to the black-box nature of legacy option ROMs, the amount of information that
460 /// can be obtained may be limited.
461 ///
462 typedef struct {
463 ///
464 /// The data header identifying the data.
465 ///
466 EFI_STATUS_CODE_DATA DataHeader;
467 ///
468 /// The handle corresponding to the device that this legacy option ROM is being invoked.
469 ///
470 EFI_HANDLE DeviceHandle;
471 ///
472 /// The base address of the shadowed legacy ROM image.
473 /// May or may not point to the shadow RAM area.
474 ///
475 EFI_PHYSICAL_ADDRESS RomImageBase;
476 } EFI_LEGACY_OPROM_EXTENDED_DATA;
477
478 #pragma pack()
479
480 extern EFI_GUID gEfiStatusCodeSpecificDataGuid;
481
482 //
483 // EFI_COMPUTING_UNIT_MISMATCH_ATTRIBUTES
484 // All other attributes are reserved for future use and
485 // must be initialized to 0.
486 //
487 #define EFI_COMPUTING_UNIT_MISMATCH_SPEED 0x0001
488 #define EFI_COMPUTING_UNIT_MISMATCH_FSB_SPEED 0x0002
489 #define EFI_COMPUTING_UNIT_MISMATCH_FAMILY 0x0004
490 #define EFI_COMPUTING_UNIT_MISMATCH_MODEL 0x0008
491 #define EFI_COMPUTING_UNIT_MISMATCH_STEPPING 0x0010
492 #define EFI_COMPUTING_UNIT_MISMATCH_CACHE_SIZE 0x0020
493 #define EFI_COMPUTING_UNIT_MISMATCH_OEM1 0x1000
494 #define EFI_COMPUTING_UNIT_MISMATCH_OEM2 0x2000
495 #define EFI_COMPUTING_UNIT_MISMATCH_OEM3 0x4000
496 #define EFI_COMPUTING_UNIT_MISMATCH_OEM4 0x8000
497
498
499
500 //
501 // Memory Error Granularities
502 //
503 #define EFI_MEMORY_ERROR_OTHER 0x01
504 #define EFI_MEMORY_ERROR_UNKNOWN 0x02
505 #define EFI_MEMORY_ERROR_DEVICE 0x03
506 #define EFI_MEMORY_ERROR_PARTITION 0x04
507
508 //
509 // Memory Error Operations
510 //
511 #define EFI_MEMORY_OPERATION_OTHER 0x01
512 #define EFI_MEMORY_OPERATION_UNKNOWN 0x02
513 #define EFI_MEMORY_OPERATION_READ 0x03
514 #define EFI_MEMORY_OPERATION_WRITE 0x04
515 #define EFI_MEMORY_OPERATION_PARTIAL_WRITE 0x05
516
517 //
518 // Define shorthands to describe Group Operations
519 // Many memory init operations are essentially group
520 // operations.
521
522 /// A shorthand to describe that the operation is performed
523 /// on multiple devices within the array
524 ///
525 #define EFI_MULTIPLE_MEMORY_DEVICE_OPERATION 0xfffe
526 ///
527 /// A shorthand to describe that the operation is performed on all devices within the array
528 ///
529 #define EFI_ALL_MEMORY_DEVICE_OPERATION 0xffff
530 ///
531 /// A shorthand to describe that the operation is performed on multiple arrays
532 ///
533 #define EFI_MULTIPLE_MEMORY_ARRAY_OPERATION 0xfffe
534 ///
535 /// A shorthand to describe that the operation is performed on all the arrays
536 ///
537 #define EFI_ALL_MEMORY_ARRAY_OPERATION 0xffff
538
539 #endif