]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Common/StatusCodeDataTypeId.h
Initial import.
[mirror_edk2.git] / MdePkg / Include / Common / StatusCodeDataTypeId.h
1 /** @file
2 This file defines the data structures to support Status Code Data.
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 These definitions are from Framework of EFI Status Code Spec
17 Version 0.92.
18
19 **/
20
21 #ifndef __STATUS_CODE_DATA_TYPE_ID_H__
22 #define __STATUS_CODE_DATA_TYPE_ID_H__
23
24
25 ///
26 /// The size of string
27 ///
28 #define EFI_STATUS_CODE_DATA_MAX_STRING_SIZE 150
29
30 ///
31 /// This is the max data size including all the headers which can be passed
32 /// as Status Code data. This data should be multiple of 8 byte
33 /// to avoid any kind of boundary issue. Also, sum of this data size (inclusive
34 /// of size of EFI_STATUS_CODE_DATA should not exceed the max record size of
35 /// data hub
36 ///
37 #define EFI_STATUS_CODE_DATA_MAX_SIZE 200
38
39 #pragma pack(1)
40 typedef enum {
41 EfiStringAscii,
42 EfiStringUnicode,
43 EfiStringToken
44 } EFI_STRING_TYPE;
45
46 typedef struct {
47 EFI_HII_HANDLE Handle;
48 STRING_REF Token;
49 } EFI_STATUS_CODE_STRING_TOKEN;
50
51 typedef union {
52 CHAR8 *Ascii;
53 CHAR16 *Unicode;
54 EFI_STATUS_CODE_STRING_TOKEN Hii;
55 } EFI_STATUS_CODE_STRING;
56
57 typedef struct {
58 EFI_STATUS_CODE_DATA DataHeader;
59 EFI_STRING_TYPE StringType;
60 EFI_STATUS_CODE_STRING String;
61 } EFI_STATUS_CODE_STRING_DATA;
62
63 #pragma pack()
64
65 #pragma pack(1)
66
67 typedef struct {
68 UINT32 ErrorLevel;
69 //
70 // 12 * sizeof (UINT64) Var Arg stack
71 //
72 // ascii DEBUG () Format string
73 //
74 } EFI_DEBUG_INFO;
75
76 #pragma pack()
77
78 //
79 // declaration for EFI_EXP_DATA. This may change
80 //
81 // typedef UINTN EFI_EXP_DATA;
82
83 ///
84 /// Voltage Extended Error Data
85 ///
86 typedef struct {
87 EFI_STATUS_CODE_DATA DataHeader;
88 EFI_EXP_BASE10_DATA Voltage;
89 EFI_EXP_BASE10_DATA Threshold;
90 } EFI_COMPUTING_UNIT_VOLTAGE_ERROR_DATA;
91
92 ///
93 /// Microcode Update Extended Error Data
94 ///
95 typedef struct {
96 EFI_STATUS_CODE_DATA DataHeader;
97 UINT32 Version;
98 } EFI_COMPUTING_UNIT_MICROCODE_UPDATE_ERROR_DATA;
99
100 ///
101 /// Asynchronous Timer Extended Error Data
102 ///
103 typedef struct {
104 EFI_STATUS_CODE_DATA DataHeader;
105 EFI_EXP_BASE10_DATA TimerLimit;
106 } EFI_COMPUTING_UNIT_TIMER_EXPIRED_ERROR_DATA;
107
108 ///
109 /// Host Processor Mismatch Extended Error Data
110 ///
111 typedef struct {
112 EFI_STATUS_CODE_DATA DataHeader;
113 UINT32 Instance;
114 UINT16 Attributes;
115 } EFI_HOST_PROCESSOR_MISMATCH_ERROR_DATA;
116
117 //
118 // EFI_COMPUTING_UNIT_MISMATCH_ATTRIBUTES
119 // All other attributes are reserved for future use and
120 // must be initialized to 0.
121 //
122 #define EFI_COMPUTING_UNIT_MISMATCH_SPEED 0x0001
123 #define EFI_COMPUTING_UNIT_MISMATCH_FSB_SPEED 0x0002
124 #define EFI_COMPUTING_UNIT_MISMATCH_FAMILY 0x0004
125 #define EFI_COMPUTING_UNIT_MISMATCH_MODEL 0x0008
126 #define EFI_COMPUTING_UNIT_MISMATCH_STEPPING 0x0010
127 #define EFI_COMPUTING_UNIT_MISMATCH_CACHE_SIZE 0x0020
128 #define EFI_COMPUTING_UNIT_MISMATCH_OEM1 0x1000
129 #define EFI_COMPUTING_UNIT_MISMATCH_OEM2 0x2000
130 #define EFI_COMPUTING_UNIT_MISMATCH_OEM3 0x4000
131 #define EFI_COMPUTING_UNIT_MISMATCH_OEM4 0x8000
132
133 ///
134 /// Thermal Extended Error Data
135 ///
136 typedef struct {
137 EFI_STATUS_CODE_DATA DataHeader;
138 EFI_EXP_BASE10_DATA Temperature;
139 EFI_EXP_BASE10_DATA Threshold;
140 } EFI_COMPUTING_UNIT_THERMAL_ERROR_DATA;
141
142 ///
143 /// Processor Disabled Extended Error Data
144 ///
145 typedef struct {
146 EFI_STATUS_CODE_DATA DataHeader;
147 UINT32 Cause;
148 BOOLEAN SoftwareDisabled;
149 } EFI_COMPUTING_UNIT_CPU_DISABLED_ERROR_DATA;
150
151 typedef enum {
152 EfiInitCacheDataOnly,
153 EfiInitCacheInstrOnly,
154 EfiInitCacheBoth,
155 EfiInitCacheUnspecified
156 } EFI_INIT_CACHE_TYPE;
157
158 ///
159 /// Embedded cache init extended data
160 ///
161 typedef struct {
162 EFI_STATUS_CODE_DATA DataHeader;
163 UINT32 Level;
164 EFI_INIT_CACHE_TYPE Type;
165 } EFI_CACHE_INIT_DATA;
166
167 //
168 // Memory Extended Error Data
169 //
170
171 ///
172 /// Memory Error Granularity Definition
173 ///
174 typedef UINT8 EFI_MEMORY_ERROR_GRANULARITY;
175
176 ///
177 /// Memory Error Operation Definition
178 ///
179 typedef UINT8 EFI_MEMORY_ERROR_OPERATION;
180
181 typedef struct {
182 EFI_STATUS_CODE_DATA DataHeader;
183 EFI_MEMORY_ERROR_GRANULARITY Granularity;
184 EFI_MEMORY_ERROR_OPERATION Operation;
185 UINTN Syndrome;
186 EFI_PHYSICAL_ADDRESS Address;
187 UINTN Resolution;
188 } EFI_MEMORY_EXTENDED_ERROR_DATA;
189
190 //
191 // Memory Error Granularities
192 //
193 #define EFI_MEMORY_ERROR_OTHER 0x01
194 #define EFI_MEMORY_ERROR_UNKNOWN 0x02
195 #define EFI_MEMORY_ERROR_DEVICE 0x03
196 #define EFI_MEMORY_ERROR_PARTITION 0x04
197
198 //
199 // Memory Error Operations
200 //
201 #define EFI_MEMORY_OPERATION_OTHER 0x01
202 #define EFI_MEMORY_OPERATION_UNKNOWN 0x02
203 #define EFI_MEMORY_OPERATION_READ 0x03
204 #define EFI_MEMORY_OPERATION_WRITE 0x04
205 #define EFI_MEMORY_OPERATION_PARTIAL_WRITE 0x05
206
207 //
208 // Define shorthands to describe Group Operations
209 // Many memory init operations are essentially group
210 // operations.
211
212 /// A shorthand to describe that the operation is performed
213 /// on multiple devices within the array
214 ///
215 #define EFI_MULTIPLE_MEMORY_DEVICE_OPERATION 0xfffe
216 ///
217 /// A shorthand to describe that the operation is performed on all devices within the array
218 ///
219 #define EFI_ALL_MEMORY_DEVICE_OPERATION 0xffff
220 ///
221 /// A shorthand to describe that the operation is performed on multiple arrays
222 ///
223 #define EFI_MULTIPLE_MEMORY_ARRAY_OPERATION 0xfffe
224 ///
225 /// A shorthand to describe that the operation is performed on all the arrays
226 ///
227 #define EFI_ALL_MEMORY_ARRAY_OPERATION 0xffff
228
229 //
230 // DIMM number
231 //
232 #pragma pack(1)
233 typedef struct {
234 EFI_STATUS_CODE_DATA DataHeader;
235 UINT16 Array;
236 UINT16 Device;
237 } EFI_STATUS_CODE_DIMM_NUMBER;
238 #pragma pack()
239
240 ///
241 /// Memory Module Mismatch Extended Error Data
242 ///
243 typedef struct {
244 EFI_STATUS_CODE_DATA DataHeader;
245 EFI_STATUS_CODE_DIMM_NUMBER Instance;
246 } EFI_MEMORY_MODULE_MISMATCH_ERROR_DATA;
247
248 ///
249 /// Memory Range Extended Data
250 ///
251 typedef struct {
252 EFI_STATUS_CODE_DATA DataHeader;
253 EFI_PHYSICAL_ADDRESS Start;
254 EFI_PHYSICAL_ADDRESS Length;
255 } EFI_MEMORY_RANGE_EXTENDED_DATA;
256
257 ///
258 /// Device handle Extended Data. Used for many
259 /// errors and progress codes to point to the device.
260 ///
261 typedef struct {
262 EFI_STATUS_CODE_DATA DataHeader;
263 EFI_HANDLE Handle;
264 } EFI_DEVICE_HANDLE_EXTENDED_DATA;
265
266 typedef struct {
267 EFI_STATUS_CODE_DATA DataHeader;
268 UINT8 *DevicePath;
269 } EFI_DEVICE_PATH_EXTENDED_DATA;
270
271 typedef struct {
272 EFI_STATUS_CODE_DATA DataHeader;
273 EFI_HANDLE ControllerHandle;
274 EFI_HANDLE DriverBindingHandle;
275 UINT16 DevicePathSize;
276 UINT8 *RemainingDevicePath;
277 } EFI_STATUS_CODE_START_EXTENDED_DATA;
278
279 ///
280 /// Resource Allocation Failure Extended Error Data
281 ///
282
283 /*
284 typedef struct {
285 EFI_STATUS_CODE_DATA DataHeader;
286 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
287 UINT32 Bar;
288 VOID *ReqRes;
289 VOID *AllocRes;
290 } EFI_RESOURCE_ALLOC_FAILURE_ERROR_DATA;
291 */
292 typedef struct {
293 EFI_STATUS_CODE_DATA DataHeader;
294 UINT32 Bar;
295 UINT16 DevicePathSize;
296 UINT16 ReqResSize;
297 UINT16 AllocResSize;
298 UINT8 *DevicePath;
299 UINT8 *ReqRes;
300 UINT8 *AllocRes;
301 } EFI_RESOURCE_ALLOC_FAILURE_ERROR_DATA;
302
303 ///
304 /// Extended Error Data for Assert
305 ///
306 typedef struct {
307 EFI_STATUS_CODE_DATA DataHeader;
308 UINT32 LineNumber;
309 UINT32 FileNameSize;
310 EFI_STATUS_CODE_STRING_DATA *FileName;
311 } EFI_DEBUG_ASSERT_DATA;
312
313 ///
314 /// System Context Data EBC/IA32/IPF
315 ///
316 typedef union {
317 EFI_SYSTEM_CONTEXT_EBC SystemContextEbc;
318 EFI_SYSTEM_CONTEXT_IA32 SystemContextIa32;
319 EFI_SYSTEM_CONTEXT_IPF SystemContextIpf;
320 } EFI_STATUS_CODE_EXCEP_SYSTEM_CONTEXT;
321
322 typedef struct {
323 EFI_STATUS_CODE_DATA DataHeader;
324 EFI_STATUS_CODE_EXCEP_SYSTEM_CONTEXT Context;
325 } EFI_STATUS_CODE_EXCEP_EXTENDED_DATA;
326
327 ///
328 /// Legacy Oprom extended data
329 ///
330 typedef struct {
331 EFI_STATUS_CODE_DATA DataHeader;
332 EFI_HANDLE DeviceHandle;
333 EFI_PHYSICAL_ADDRESS RomImageBase;
334 } EFI_LEGACY_OPROM_EXTENDED_DATA;
335
336 #endif