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