1/** @file
2  GUID used to identify id for the caller who is initiating the Status Code.
3
4  Copyright (c) 2006 - 2013, 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  These GUIDs and structures are defined in UEFI Platform Initialization Specification 1.2
15  Volume 3: Shared Architectural Elements
16
17**/
18
19#ifndef __PI_STATUS_CODE_DATA_TYPE_ID_GUID_H__
20#define __PI_STATUS_CODE_DATA_TYPE_ID_GUID_H__
21
22#include <PiDxe.h>
23#include <Protocol/DebugSupport.h>
24
25///
26/// Global ID for the EFI_STATUS_CODE_STRING structure
27///
28#define EFI_STATUS_CODE_DATA_TYPE_STRING_GUID \
29  { 0x92D11080, 0x496F, 0x4D95, { 0xBE, 0x7E, 0x03, 0x74, 0x88, 0x38, 0x2B, 0x0A } }
30
31typedef enum {
32  ///
33  /// A NULL-terminated ASCII string.
34  ///
35  EfiStringAscii,
36  ///
37  /// A double NULL-terminated Unicode string.
38  ///
39  EfiStringUnicode,
40  ///
41  /// An EFI_STATUS_CODE_STRING_TOKEN representing the string.  The actual
42  /// string can be obtained by querying the HII Database
43  ///
44  EfiStringToken
45} EFI_STRING_TYPE;
46
47///
48/// Specifies the format of the data in EFI_STATUS_CODE_STRING_DATA.String.
49///
50typedef struct {
51  ///
52  /// The HII package list which contains the string.  Handle is a dynamic value that may
53  /// not be the same for different boots.  Type EFI_HII_HANDLE is defined in
54  /// EFI_HII_DATABASE_PROTOCOL.NewPackageList() in the UEFI Specification.
55  ///
56  EFI_HII_HANDLE  Handle;
57  ///
58  /// When combined with Handle, the string token can be used to retrieve the string.
59  /// Type EFI_STRING_ID is defined in EFI_IFR_OP_HEADER in the UEFI Specification.
60  ///
61  EFI_STRING_ID   Token;
62} EFI_STATUS_CODE_STRING_TOKEN;
63
64typedef union {
65  ///
66  /// ASCII formatted string.
67  ///
68  CHAR8                         *Ascii;
69  ///
70  /// Unicode formatted string.
71  ///
72  CHAR16                        *Unicode;
73  ///
74  /// HII handle/token pair.
75  ///
76  EFI_STATUS_CODE_STRING_TOKEN  Hii;
77} EFI_STATUS_CODE_STRING;
78
79///
80/// This data type defines a string type of extended data. A string can accompany
81/// any status code. The string can provide additional information about the
82/// status code. The string can be ASCII, Unicode, or a Human Interface Infrastructure
83/// (HII) token/GUID pair.
84///
85typedef struct {
86  ///
87  /// The data header identifying the data. DataHeader.HeaderSize should be
88  /// sizeof (EFI_STATUS_CODE_DATA), DataHeader.Size should be
89  /// sizeof (EFI_STATUS_CODE_STRING_DATA) - HeaderSize, and
90  /// DataHeader.Type should be
91  /// EFI_STATUS_CODE_DATA_TYPE_STRING_GUID.
92  ///
93  EFI_STATUS_CODE_DATA           DataHeader;
94  ///
95  /// Specifies the format of the data in String.
96  ///
97  EFI_STRING_TYPE                StringType;
98  ///
99  /// A pointer to the extended data. The data follows the format specified by
100  /// StringType.
101  ///
102  EFI_STATUS_CODE_STRING         String;
103} EFI_STATUS_CODE_STRING_DATA;
104
105extern EFI_GUID gEfiStatusCodeDataTypeStringGuid;
106
107///
108/// Global ID for the following structures:
109///   - EFI_DEVICE_PATH_EXTENDED_DATA
110///   - EFI_DEVICE_HANDLE_EXTENDED_DATA
111///   - EFI_RESOURCE_ALLOC_FAILURE_ERROR_DATA
112///   - EFI_COMPUTING_UNIT_VOLTAGE_ERROR_DATA
113///   - EFI_COMPUTING_UNIT_MICROCODE_UPDATE_ERROR_DATA
114///   - EFI_COMPUTING_UNIT_TIMER_EXPIRED_ERROR_DATA
115///   - EFI_HOST_PROCESSOR_MISMATCH_ERROR_DATA
116///   - EFI_MEMORY_RANGE_EXTENDED_DATA
117///   - EFI_DEBUG_ASSERT_DATA
118///   - EFI_STATUS_CODE_EXCEP_EXTENDED_DATA
119///   - EFI_STATUS_CODE_START_EXTENDED_DATA
120///   - EFI_LEGACY_OPROM_EXTENDED_DATA
121///
122#define EFI_STATUS_CODE_SPECIFIC_DATA_GUID \
123  { 0x335984bd, 0xe805, 0x409a, { 0xb8, 0xf8, 0xd2, 0x7e, 0xce, 0x5f, 0xf7, 0xa6 } }
124
125///
126/// Extended data about the device path, which is used for many errors and
127/// progress codes to point to the device.
128///
129/// The device path is used to point to the physical device in case there is more than one device
130/// belonging to the same subclass. For example, the system may contain two USB keyboards and one
131/// PS/2* keyboard. The driver that parses the status code can use the device path extended data to
132/// differentiate between the three. The index field is not useful in this case because there is no standard
133/// numbering convention. Device paths are preferred over using device handles because device handles
134/// for a given device can change from one boot to another and do not mean anything beyond Boot
135/// Services time. In certain cases, the bus driver may not create a device handle for a given device if it
136/// detects a critical error. In these cases, the device path extended data can be used to refer to the
137/// device, but there may not be any device handles with an instance of
138/// EFI_DEVICE_PATH_PROTOCOL that matches DevicePath. The variable device path structure
139/// is included in this structure to make it self sufficient.
140///
141typedef struct {
142  ///
143  /// The data header identifying the data. DataHeader.HeaderSize should be
144  /// sizeof (EFI_STATUS_CODE_DATA). DataHeader.Size should be the size
145  /// of variable-length DevicePath, and DataHeader.Size is zero for a virtual
146  /// device that does not have a device path. DataHeader.Type should be
147  /// EFI_STATUS_CODE_SPECIFIC_DATA_GUID.
148  ///
149  EFI_STATUS_CODE_DATA                 DataHeader;
150  ///
151  /// The device path to the controller or the hardware device. Note that this parameter is a
152  /// variable-length device path structure and not a pointer to such a structure. This structure is
153  /// populated only if it is a physical device. For virtual devices, the Size field in DataHeader
154  /// is set to zero and this field is not populated.
155  ///
156  //  EFI_DEVICE_PATH_PROTOCOL         DevicePath;
157} EFI_DEVICE_PATH_EXTENDED_DATA;
158
159///
160/// Device handle Extended Data. Used for many
161/// errors and progress codes to point to the device.
162///
163/// The handle of the device with which the progress or error code is associated. The handle is
164/// guaranteed to be accurate only at the time the status code is reported. Handles are dynamic entities
165/// between boots, so handles cannot be considered to be valid if the system has reset subsequent to the
166/// status code being reported. Handles may be used to determine a wide variety of useful information
167/// about the source of the status code.
168///
169typedef struct {
170  ///
171  /// The data header identifying the data. DataHeader.HeaderSize should be
172  /// sizeof (EFI_STATUS_CODE_DATA), DataHeader.Size should be
173  /// sizeof (EFI_DEVICE_HANDLE_EXTENDED_DATA) - HeaderSize, and
174  /// DataHeader.Type should be EFI_STATUS_CODE_SPECIFIC_DATA_GUID.
175  ///
176  EFI_STATUS_CODE_DATA  DataHeader;
177  ///
178  /// The device handle.
179  ///
180  EFI_HANDLE            Handle;
181} EFI_DEVICE_HANDLE_EXTENDED_DATA;
182
183///
184/// This structure defines extended data describing a PCI resource allocation error.
185///
186/// @par Note:
187///   The following structure contains variable-length fields and cannot be defined as a C-style
188///   structure.
189///
190/// This extended data conveys details for a PCI resource allocation failure error. See the PCI
191/// specification and the ACPI specification for details on PCI resource allocations and the format for
192/// resource descriptors. This error does not detail why the resource allocation failed. It may be due to a
193/// bad resource request or a lack of available resources to satisfy a valid request. The variable device
194/// path structure and the resource structures are included in this structure to make it self sufficient.
195///
196typedef struct {
197  ///
198  /// The data header identifying the data. DataHeader.HeaderSize should be sizeof
199  /// (EFI_STATUS_CODE_DATA), DataHeader.Size should be
200  /// (DevicePathSize + DevicePathSize + DevicePathSize +
201  /// sizeof(UINT32) + 3 * sizeof (UINT16) ), and DataHeader.Type
202  /// should be EFI_STATUS_CODE_SPECIFIC_DATA_GUID.
203  ///
204  EFI_STATUS_CODE_DATA               DataHeader;
205  ///
206  /// The PCI BAR. Applicable only for PCI devices. Ignored for all other devices.
207  ///
208  UINT32                             Bar;
209  ///
210  /// DevicePathSize should be zero if it is a virtual device that is not associated with
211  /// a device path. Otherwise, this parameter is the length of the variable-length
212  /// DevicePath.
213  ///
214  UINT16                             DevicePathSize;
215  ///
216  /// Represents the size the ReqRes parameter. ReqResSize should be zero if the
217  /// requested resources are not provided as a part of extended data.
218  ///
219  UINT16                             ReqResSize;
220  ///
221  /// Represents the size the AllocRes parameter. AllocResSize should be zero if the
222  /// allocated resources are not provided as a part of extended data.
223  ///
224  UINT16                             AllocResSize;
225  ///
226  /// The device path to the controller or the hardware device that did not get the requested
227  /// resources. Note that this parameter is the variable-length device path structure and not
228  /// a pointer to this structure.
229  ///
230  //  EFI_DEVICE_PATH_PROTOCOL       DevicePath;
231  ///
232  /// The requested resources in the format of an ACPI 2.0 resource descriptor. This
233  /// parameter is not a pointer; it is the complete resource descriptor.
234  ///
235  //  UINT8                          ReqRes[];
236  ///
237  /// The allocated resources in the format of an ACPI 2.0 resource descriptor. This
238  /// parameter is not a pointer; it is the complete resource descriptor.
239  ///
240  //  UINT8                          AllocRes[];
241} EFI_RESOURCE_ALLOC_FAILURE_ERROR_DATA;
242
243///
244/// This structure provides a calculation for base-10 representations.
245///
246/// Not consistent with PI 1.2 Specification.
247/// This data type is not defined in the PI 1.2 Specification, but is
248/// required by several of the other data structures in this file.
249///
250typedef struct {
251  ///
252  /// The INT16 number by which to multiply the base-2 representation.
253  ///
254  INT16                            Value;
255  ///
256  /// The INT16 number by which to raise the base-2 calculation.
257  ///
258  INT16                            Exponent;
259} EFI_EXP_BASE10_DATA;
260
261///
262/// This structure provides the voltage at the time of error. It also provides
263/// the threshold value indicating the minimum or maximum voltage that is considered
264/// an error. If the voltage is less then the threshold, the error indicates that the
265/// voltage fell below the minimum acceptable value. If the voltage is greater then the threshold,
266/// the error indicates that the voltage rose above the maximum acceptable value.
267///
268typedef struct {
269  ///
270  /// The data header identifying the data. DataHeader.HeaderSize should be
271  /// sizeof (EFI_STATUS_CODE_DATA), DataHeader.Size should be
272  /// sizeof (EFI_COMPUTING_UNIT_VOLTAGE_ERROR_DATA) -
273  /// HeaderSize, and DataHeader.Type should be
274  /// EFI_STATUS_CODE_SPECIFIC_DATA_GUID.
275  ///
276  EFI_STATUS_CODE_DATA  DataHeader;
277  ///
278  /// The voltage value at the time of the error.
279  ///
280  EFI_EXP_BASE10_DATA   Voltage;
281  ///
282  /// The voltage threshold.
283  ///
284  EFI_EXP_BASE10_DATA   Threshold;
285} EFI_COMPUTING_UNIT_VOLTAGE_ERROR_DATA;
286
287///
288/// Microcode Update Extended Error Data
289///
290typedef struct {
291  ///
292  /// The data header identifying the data. DataHeader.HeaderSize should be
293  /// sizeof (EFI_STATUS_CODE_DATA), DataHeader.Size should be
294  /// sizeof (EFI_COMPUTING_UNIT_MICROCODE_UPDATE_ERROR_DATA) -
295  /// HeaderSize, and DataHeader.Type should be
296  /// EFI_STATUS_CODE_SPECIFIC_DATA_GUID.
297  ///
298  EFI_STATUS_CODE_DATA  DataHeader;
299  ///
300  /// The version of the microcode update from the header.
301  ///
302  UINT32                Version;
303} EFI_COMPUTING_UNIT_MICROCODE_UPDATE_ERROR_DATA;
304
305///
306/// This structure provides details about the computing unit timer expiration error.
307/// The timer limit provides the timeout value of the timer prior to expiration.
308///
309typedef struct {
310  ///
311  /// The data header identifying the data. DataHeader.HeaderSize should be
312  /// sizeof (EFI_STATUS_CODE_DATA), DataHeader.Size should be
313  /// sizeof (EFI_COMPUTING_UNIT_TIMER_EXPIRED_ERROR_DATA) -
314  /// HeaderSize, and DataHeader.Type should be
315  /// EFI_STATUS_CODE_SPECIFIC_DATA_GUID.
316  ///
317  EFI_STATUS_CODE_DATA  DataHeader;
318  ///
319  /// The number of seconds that the computing unit timer was configured to expire.
320  ///
321  EFI_EXP_BASE10_DATA   TimerLimit;
322} EFI_COMPUTING_UNIT_TIMER_EXPIRED_ERROR_DATA;
323
324///
325/// Attribute bits for EFI_HOST_PROCESSOR_MISMATCH_ERROR_DATA.Attributes
326/// All other attributes are reserved for future use and must be initialized to 0.
327///
328///@{
329#define EFI_COMPUTING_UNIT_MISMATCH_SPEED       0x0001
330#define EFI_COMPUTING_UNIT_MISMATCH_FSB_SPEED   0x0002
331#define EFI_COMPUTING_UNIT_MISMATCH_FAMILY      0x0004
332#define EFI_COMPUTING_UNIT_MISMATCH_MODEL       0x0008
333#define EFI_COMPUTING_UNIT_MISMATCH_STEPPING    0x0010
334#define EFI_COMPUTING_UNIT_MISMATCH_CACHE_SIZE  0x0020
335#define EFI_COMPUTING_UNIT_MISMATCH_OEM1        0x1000
336#define EFI_COMPUTING_UNIT_MISMATCH_OEM2        0x2000
337#define EFI_COMPUTING_UNIT_MISMATCH_OEM3        0x4000
338#define EFI_COMPUTING_UNIT_MISMATCH_OEM4        0x8000
339///@}
340
341///
342/// This structure defines extended data for processor mismatch errors.
343///
344/// This provides information to indicate which processors mismatch, and how they mismatch. The
345/// status code contains the instance number of the processor that is in error. This structure's
346/// Instance indicates the second processor that does not match. This differentiation allows the
347/// consumer to determine which two processors do not match. The Attributes indicate what
348/// mismatch is being reported. Because Attributes is a bit field, more than one mismatch can be
349/// reported with one error code.
350///
351typedef struct {
352  ///
353  /// The data header identifying the data. DataHeader.HeaderSize should be
354  /// sizeof (EFI_STATUS_CODE_DATA), DataHeader.Size should be
355  /// sizeof (EFI_ HOST_PROCESSOR_MISMATCH_ERROR_DATA) -
356  /// HeaderSize , and DataHeader.Type should be
357  /// EFI_STATUS_CODE_SPECIFIC_DATA_GUID.
358  ///
359  EFI_STATUS_CODE_DATA  DataHeader;
360  ///
361  /// The unit number of the computing unit that does not match.
362  ///
363  UINT32                Instance;
364  ///
365  /// The attributes describing the failure.
366  ///
367  UINT16                Attributes;
368} EFI_HOST_PROCESSOR_MISMATCH_ERROR_DATA;
369
370///
371/// This structure provides details about the computing unit thermal failure.
372///
373/// This structure provides the temperature at the time of error. It also provides the threshold value
374/// indicating the minimum temperature that is considered an error.
375///
376typedef struct {
377  ///
378  /// The data header identifying the data. DataHeader.HeaderSize should be
379  /// sizeof (EFI_STATUS_CODE_DATA), DataHeader.Size should be
380  /// sizeof (EFI_COMPUTING_UNIT_THERMAL_ERROR_DATA) -
381  /// HeaderSize , and DataHeader.Type should be
382  /// EFI_STATUS_CODE_SPECIFIC_DATA_GUID.
383  ///
384  EFI_STATUS_CODE_DATA  DataHeader;
385  ///
386  /// The thermal value at the time of the error.
387  ///
388  EFI_EXP_BASE10_DATA   Temperature;
389  ///
390  /// The thermal threshold.
391  ///
392  EFI_EXP_BASE10_DATA   Threshold;
393} EFI_COMPUTING_UNIT_THERMAL_ERROR_DATA;
394
395///
396/// Enumeration of valid cache types
397///
398typedef enum {
399  EfiInitCacheDataOnly,
400  EfiInitCacheInstrOnly,
401  EfiInitCacheBoth,
402  EfiInitCacheUnspecified
403} EFI_INIT_CACHE_TYPE;
404
405///
406/// Embedded cache init extended data
407///
408typedef struct {
409  ///
410  /// The data header identifying the data. DataHeader.HeaderSize should be
411  /// sizeof (EFI_STATUS_CODE_DATA), DataHeader.Size should be
412  /// sizeof (EFI_CACHE_INIT_DATA) - HeaderSize , and
413  /// DataHeader.Type should be EFI_STATUS_CODE_SPECIFIC_DATA_GUID.
414  ///
415  EFI_STATUS_CODE_DATA  DataHeader;
416  ///
417  /// The cache level. Starts with 1 for level 1 cache.
418  ///
419  UINT32                Level;
420  ///
421  /// The type of cache.
422  ///
423  EFI_INIT_CACHE_TYPE   Type;
424} EFI_CACHE_INIT_DATA;
425
426///
427///
428///
429typedef UINT32  EFI_CPU_STATE_CHANGE_CAUSE;
430
431///
432/// The reasons that the processor is disabled.
433/// Used to fill in EFI_COMPUTING_UNIT_CPU_DISABLED_ERROR_DATA.Cause.
434///
435///@{
436#define EFI_CPU_CAUSE_INTERNAL_ERROR            0x0001
437#define EFI_CPU_CAUSE_THERMAL_ERROR             0x0002
438#define EFI_CPU_CAUSE_SELFTEST_FAILURE          0x0004
439#define EFI_CPU_CAUSE_PREBOOT_TIMEOUT           0x0008
440#define EFI_CPU_CAUSE_FAILED_TO_START           0x0010
441#define EFI_CPU_CAUSE_CONFIG_ERROR              0x0020
442#define EFI_CPU_CAUSE_USER_SELECTION            0x0080
443#define EFI_CPU_CAUSE_BY_ASSOCIATION            0x0100
444#define EFI_CPU_CAUSE_UNSPECIFIED               0x8000
445///@}
446
447///
448/// This structure provides information about the disabled computing unit.
449///
450/// This structure provides details as to why and how the computing unit was disabled. The causes
451/// should cover the typical reasons a processor would be disabled. How the processor was disabled is
452/// important because there are distinct differences between hardware and software disabling.
453///
454typedef struct {
455  ///
456  /// The data header identifying the data. DataHeader.HeaderSize should be
457  /// sizeof (EFI_STATUS_CODE_DATA), DataHeader.Size should be
458  /// sizeof (EFI_COMPUTING_UNIT_CPU_DISABLED_ERROR_DATA) -
459  /// HeaderSize, and DataHeader.Type should be
460  /// EFI_STATUS_CODE_SPECIFIC_DATA_GUID.
461  ///
462  EFI_STATUS_CODE_DATA  DataHeader;
463  ///
464  /// The reason for disabling the processor.
465  ///
466  UINT32                Cause;
467  ///
468  /// TRUE if the processor is disabled via software means such as not listing it in the ACPI tables.
469  /// Such a processor will respond to Interprocessor Interrupts (IPIs). FALSE if the processor is hardware
470  /// disabled, which means it is invisible to software and will not respond to IPIs.
471  ///
472  BOOLEAN               SoftwareDisabled;
473} EFI_COMPUTING_UNIT_CPU_DISABLED_ERROR_DATA;
474
475///
476/// Memory Error Granularity Definition
477///
478typedef UINT8 EFI_MEMORY_ERROR_GRANULARITY;
479
480///
481/// Memory Error Granularities.  Used to fill in EFI_MEMORY_EXTENDED_ERROR_DATA.Granularity.
482///
483///@{
484#define EFI_MEMORY_ERROR_OTHER      0x01
485#define EFI_MEMORY_ERROR_UNKNOWN    0x02
486#define EFI_MEMORY_ERROR_DEVICE     0x03
487#define EFI_MEMORY_ERROR_PARTITION  0x04
488///@}
489
490///
491/// Memory Error Operation Definition
492///
493typedef UINT8 EFI_MEMORY_ERROR_OPERATION;
494
495///
496/// Memory Error Operations.  Used to fill in EFI_MEMORY_EXTENDED_ERROR_DATA.Operation.
497///
498///@{
499#define EFI_MEMORY_OPERATION_OTHER 0x01
500#define EFI_MEMORY_OPERATION_UNKNOWN 0x02
501#define EFI_MEMORY_OPERATION_READ 0x03
502#define EFI_MEMORY_OPERATION_WRITE 0x04
503#define EFI_MEMORY_OPERATION_PARTIAL_WRITE 0x05
504///@}
505
506///
507/// This structure provides specific details about the memory error that was detected. It provides
508/// enough information so that consumers can identify the exact failure and provides enough
509/// information to enable corrective action if necessary.
510///
511typedef struct {
512  ///
513  /// The data header identifying the data. DataHeader.HeaderSize should be
514  /// sizeof (EFI_STATUS_CODE_DATA), DataHeader.Size should be
515  /// sizeof (EFI_MEMORY_EXTENDED_ERROR_DATA) - HeaderSize, and
516  /// DataHeader.Type should be EFI_STATUS_CODE_SPECIFIC_DATA_GUID.
517  ///
518  EFI_STATUS_CODE_DATA          DataHeader;
519  ///
520  /// The error granularity type.
521  ///
522  EFI_MEMORY_ERROR_GRANULARITY  Granularity;
523  ///
524  /// The operation that resulted in the error being detected.
525  ///
526  EFI_MEMORY_ERROR_OPERATION    Operation;
527  ///
528  /// The error syndrome, vendor-specific ECC syndrome, or CRC data associated with
529  /// the error.  If unknown, should be initialized to 0.
530  /// Inconsistent with specification here:
531  /// This field in StatusCodes spec0.9 is defined as UINT32, keep code unchanged.
532  ///
533  UINTN                         Syndrome;
534  ///
535  /// The physical address of the error.
536  ///
537  EFI_PHYSICAL_ADDRESS          Address;
538  ///
539  /// The range, in bytes, within which the error address can be determined.
540  ///
541  UINTN                         Resolution;
542} EFI_MEMORY_EXTENDED_ERROR_DATA;
543
544///
545/// A definition to describe that the operation is performed on multiple devices within the array.
546/// May be used for EFI_STATUS_CODE_DIMM_NUMBER.Array and EFI_STATUS_CODE_DIMM_NUMBER.Device.
547///
548#define EFI_MULTIPLE_MEMORY_DEVICE_OPERATION 0xfffe
549
550///
551/// A definition to describe that the operation is performed on all devices within the array.
552/// May be used for EFI_STATUS_CODE_DIMM_NUMBER.Array and EFI_STATUS_CODE_DIMM_NUMBER.Device.
553///
554#define EFI_ALL_MEMORY_DEVICE_OPERATION 0xffff
555
556///
557/// A definition to describe that the operation is performed on multiple arrays.
558/// May be used for EFI_STATUS_CODE_DIMM_NUMBER.Array and EFI_STATUS_CODE_DIMM_NUMBER.Device.
559///
560#define EFI_MULTIPLE_MEMORY_ARRAY_OPERATION 0xfffe
561
562///
563/// A definition to describe that the operation is performed on all the arrays.
564/// May be used for EFI_STATUS_CODE_DIMM_NUMBER.Array and EFI_STATUS_CODE_DIMM_NUMBER.Device.
565///
566#define EFI_ALL_MEMORY_ARRAY_OPERATION 0xffff
567
568///
569/// This extended data provides some context that consumers can use to locate a DIMM within the
570/// overall memory scheme.
571///
572/// This extended data provides some context that consumers can use to locate a DIMM within the
573/// overall memory scheme. The Array and Device numbers may indicate a specific DIMM, or they
574/// may be populated with the group definitions in "Related Definitions" below.
575///
576typedef struct {
577  ///
578  /// The data header identifying the data. DataHeader.HeaderSize should be
579  /// sizeof (EFI_STATUS_CODE_DATA), DataHeader.Size should be
580  /// sizeof (EFI_STATUS_CODE_DIMM_NUMBER) - HeaderSize, and
581  /// DataHeader.Type should be EFI_STATUS_CODE_SPECIFIC_DATA_GUID.
582  ///
583  EFI_STATUS_CODE_DATA  DataHeader;
584  ///
585  /// The memory array number.
586  ///
587  UINT16                Array;
588  ///
589  /// The device number within that Array.
590  ///
591  UINT16                Device;
592} EFI_STATUS_CODE_DIMM_NUMBER;
593
594///
595/// This structure defines extended data describing memory modules that do not match.
596///
597/// This extended data may be used to convey the specifics of memory modules that do not match.
598///
599typedef struct {
600  ///
601  /// The data header identifying the data. DataHeader.HeaderSize should be
602  /// sizeof (EFI_STATUS_CODE_DATA), DataHeader.Size should be
603  /// sizeof (EFI_MEMORY_MODULE_MISMATCH_ERROR_DATA) -
604  /// HeaderSize, and DataHeader.Type should be
605  /// EFI_STATUS_CODE_SPECIFIC_DATA_GUID.
606  ///
607  EFI_STATUS_CODE_DATA         DataHeader;
608  ///
609  /// The instance number of the memory module that does not match.
610  ///
611  EFI_STATUS_CODE_DIMM_NUMBER  Instance;
612} EFI_MEMORY_MODULE_MISMATCH_ERROR_DATA;
613
614///
615/// This structure defines extended data describing a memory range.
616///
617/// This extended data may be used to convey the specifics of a memory range.  Ranges are specified
618/// with a start address and a length.
619///
620typedef struct {
621  ///
622  /// The data header identifying the data. DataHeader.HeaderSize should be
623  /// sizeof (EFI_STATUS_CODE_DATA), DataHeader.Size should be
624  /// sizeof (EFI_MEMORY_RANGE_EXTENDED_DATA) - HeaderSize, and
625  /// DataHeader.Type should be EFI_STATUS_CODE_SPECIFIC_DATA_GUID.
626  ///
627  EFI_STATUS_CODE_DATA  DataHeader;
628  ///
629  /// The starting address of the memory range.
630  ///
631  EFI_PHYSICAL_ADDRESS  Start;
632  ///
633  /// The length in bytes of the memory range.
634  ///
635  EFI_PHYSICAL_ADDRESS  Length;
636} EFI_MEMORY_RANGE_EXTENDED_DATA;
637
638///
639/// This structure provides the assert information that is typically associated with a debug assertion failing.
640///
641/// The data indicates the location of the assertion that failed in the source code. This information
642/// includes the file name and line number that are necessary to find the failing assertion in source code.
643///
644typedef struct {
645  ///
646  /// The data header identifying the data. DataHeader.HeaderSize should be
647  /// sizeof (EFI_STATUS_CODE_DATA), DataHeader.Size should be
648  /// sizeof (EFI_DEBUG_ASSERT_DATA) - HeaderSize , and
649  /// DataHeader.Type should be EFI_STATUS_CODE_SPECIFIC_DATA_GUID.
650  ///
651  EFI_STATUS_CODE_DATA         DataHeader;
652  ///
653  /// The line number of the source file where the fault was generated.
654  ///
655  UINT32                       LineNumber;
656  ///
657  /// The size in bytes of FileName.
658  ///
659  UINT32                       FileNameSize;
660  ///
661  /// A pointer to a NULL-terminated ASCII or Unicode string that represents
662  /// the file name of the source file where the fault was generated.
663  ///
664  EFI_STATUS_CODE_STRING_DATA  *FileName;
665} EFI_DEBUG_ASSERT_DATA;
666
667///
668/// System Context Data EBC/IA32/IPF
669///
670typedef union {
671  ///
672  /// The context of the EBC virtual machine when the exception was generated. Type
673  /// EFI_SYSTEM_CONTEXT_EBC is defined in EFI_DEBUG_SUPPORT_PROTOCOL
674  /// in the UEFI Specification.
675  ///
676  EFI_SYSTEM_CONTEXT_EBC  SystemContextEbc;
677  ///
678  /// The context of the IA-32 processor when the exception was generated. Type
679  /// EFI_SYSTEM_CONTEXT_IA32 is defined in the
680  /// EFI_DEBUG_SUPPORT_PROTOCOL in the UEFI Specification.
681  ///
682  EFI_SYSTEM_CONTEXT_IA32 SystemContextIa32;
683  ///
684  /// The context of the Itanium(R) processor when the exception was generated. Type
685  /// EFI_SYSTEM_CONTEXT_IPF is defined in the
686  /// EFI_DEBUG_SUPPORT_PROTOCOL in the UEFI Specification.
687  ///
688  EFI_SYSTEM_CONTEXT_IPF  SystemContextIpf;
689  ///
690  /// The context of the X64 processor when the exception was generated. Type
691  /// EFI_SYSTEM_CONTEXT_X64 is defined in the
692  /// EFI_DEBUG_SUPPORT_PROTOCOL in the UEFI Specification.
693  ///
694  EFI_SYSTEM_CONTEXT_X64  SystemContextX64;
695  ///
696  /// The context of the ARM processor when the exception was generated. Type
697  /// EFI_SYSTEM_CONTEXT_ARM is defined in the
698  /// EFI_DEBUG_SUPPORT_PROTOCOL in the UEFI Specification.
699  ///
700  EFI_SYSTEM_CONTEXT_ARM  SystemContextArm;
701} EFI_STATUS_CODE_EXCEP_SYSTEM_CONTEXT;
702
703///
704/// This structure defines extended data describing a processor exception error.
705///
706/// This extended data allows the processor context that is present at the time of the exception to be
707/// reported with the exception. The format and contents of the context data varies depending on the
708/// processor architecture.
709///
710typedef struct {
711  ///
712  /// The data header identifying the data. DataHeader.HeaderSize should be
713  /// sizeof (EFI_STATUS_CODE_DATA), DataHeader.Size should be
714  /// sizeof (EFI_STATUS_CODE_EXCEP_EXTENDED_DATA) - HeaderSize,
715  /// and DataHeader.Type should be
716  /// EFI_STATUS_CODE_SPECIFIC_DATA_GUID.
717  ///
718  EFI_STATUS_CODE_DATA                  DataHeader;
719  ///
720  /// The system context.
721  ///
722  EFI_STATUS_CODE_EXCEP_SYSTEM_CONTEXT  Context;
723} EFI_STATUS_CODE_EXCEP_EXTENDED_DATA;
724
725///
726/// This structure defines extended data describing a call to a driver binding protocol start function.
727///
728/// This extended data records information about a Start() function call. Start() is a member of
729/// the UEFI Driver Binding Protocol.
730///
731typedef struct {
732  ///
733  /// The data header identifying the data. DataHeader.HeaderSize should be
734  /// sizeof (EFI_STATUS_CODE_DATA), DataHeader.Size should be
735  /// sizeof (EFI_STATUS_CODE_START_EXTENDED_DATA) - HeaderSize,
736  /// and DataHeader.Type should be
737  /// EFI_STATUS_CODE_SPECIFIC_DATA_GUID.
738  ///
739  EFI_STATUS_CODE_DATA           DataHeader;
740  ///
741  /// The controller handle.
742  ///
743  EFI_HANDLE                     ControllerHandle;
744  ///
745  /// The driver binding handle.
746  ///
747  EFI_HANDLE                     DriverBindingHandle;
748  ///
749  /// The size of the RemainingDevicePath. It is zero if the Start() function is
750  /// called with RemainingDevicePath = NULL.  The UEFI Specification allows
751  /// that the Start() function of bus drivers can be called in this way.
752  ///
753  UINT16                         DevicePathSize;
754  ///
755  /// Matches the RemainingDevicePath parameter being passed to the Start() function.
756  /// Note that this parameter is the variable-length device path and not a pointer
757  /// to the device path.
758  ///
759  //  EFI_DEVICE_PATH_PROTOCOL   RemainingDevicePath;
760} EFI_STATUS_CODE_START_EXTENDED_DATA;
761
762///
763/// This structure defines extended data describing a legacy option ROM (OpROM).
764///
765/// The device handle and ROM image base can be used by consumers to determine which option ROM
766/// failed. Due to the black-box nature of legacy option ROMs, the amount of information that can be
767/// obtained may be limited.
768///
769typedef struct {
770  ///
771  /// The data header identifying the data. DataHeader.HeaderSize should be
772  /// sizeof (EFI_STATUS_CODE_DATA), DataHeader.Size should be
773  /// sizeof (EFI_LEGACY_OPROM_EXTENDED_DATA) - HeaderSize, and
774  /// DataHeader.Type should be EFI_STATUS_CODE_SPECIFIC_DATA_GUID.
775  ///
776  EFI_STATUS_CODE_DATA  DataHeader;
777  ///
778  /// The handle corresponding to the device that this legacy option ROM is being invoked.
779  ///
780  EFI_HANDLE            DeviceHandle;
781  ///
782  /// The base address of the shadowed legacy ROM image.  May or may not point to the shadow RAM area.
783  ///
784  EFI_PHYSICAL_ADDRESS  RomImageBase;
785} EFI_LEGACY_OPROM_EXTENDED_DATA;
786
787extern EFI_GUID gEfiStatusCodeSpecificDataGuid;
788
789#endif
790