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