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