]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /** @file\r |
2 | Report Status Code Library public .h file\r | |
3 | \r | |
4 | Copyright (c) 2006, 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 | **/\r | |
14 | \r | |
15 | #ifndef __REPORT_STATUS_CODE_LIB_H__\r | |
16 | #define __REPORT_STATUS_CODE_LIB_H__\r | |
17 | \r | |
18 | //\r | |
19 | // Declare bits for PcdReportStatusCodePropertyMask\r | |
20 | //\r | |
21 | #define REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED 0x00000001\r | |
22 | #define REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED 0x00000002\r | |
23 | #define REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED 0x00000004\r | |
878ddf1f | 24 | \r |
25 | //\r | |
26 | // Extended Data structure definitions with EFI_STATUS_CODE_DATA headers removed\r | |
27 | //\r | |
28 | \r | |
29 | ///\r | |
30 | /// Voltage Extended Error Data\r | |
31 | ///\r | |
32 | typedef struct {\r | |
33 | EFI_EXP_BASE10_DATA Voltage;\r | |
34 | EFI_EXP_BASE10_DATA Threshold;\r | |
35 | } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_VOLTAGE_ERROR_DATA;\r | |
36 | \r | |
37 | ///\r | |
38 | /// Microcode Update Extended Error Data\r | |
39 | ///\r | |
40 | typedef struct {\r | |
41 | UINT32 Version;\r | |
42 | } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_MICROCODE_UPDATE_ERROR_DATA;\r | |
43 | \r | |
44 | ///\r | |
45 | /// Asynchronous Timer Extended Error Data\r | |
46 | ///\r | |
47 | typedef struct {\r | |
48 | EFI_EXP_BASE10_DATA TimerLimit;\r | |
49 | } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_TIMER_EXPIRED_ERROR_DATA;\r | |
50 | \r | |
51 | ///\r | |
52 | /// Host Processor Mismatch Extended Error Data\r | |
53 | ///\r | |
54 | typedef struct {\r | |
55 | UINT32 Instance;\r | |
56 | UINT16 Attributes;\r | |
57 | } REPORT_STATUS_CODE_LIBRARY_HOST_PROCESSOR_MISMATCH_ERROR_DATA;\r | |
58 | \r | |
59 | ///\r | |
60 | /// Thermal Extended Error Data\r | |
61 | ///\r | |
62 | typedef struct {\r | |
63 | EFI_EXP_BASE10_DATA Temperature;\r | |
64 | EFI_EXP_BASE10_DATA Threshold;\r | |
65 | } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_THERMAL_ERROR_DATA;\r | |
66 | \r | |
67 | ///\r | |
68 | /// Processor Disabled Extended Error Data\r | |
69 | ///\r | |
70 | typedef struct {\r | |
71 | UINT32 Cause;\r | |
72 | BOOLEAN SoftwareDisabled;\r | |
73 | } REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_CPU_DISABLED_ERROR_DATA;\r | |
74 | \r | |
75 | ///\r | |
76 | /// Embedded cache init extended data\r | |
77 | ///\r | |
78 | typedef struct {\r | |
79 | UINT32 Level;\r | |
80 | EFI_INIT_CACHE_TYPE Type;\r | |
81 | } REPORT_STATUS_CODE_LIBRARY_CACHE_INIT_DATA;\r | |
82 | \r | |
83 | ///\r | |
84 | /// Memory Extended Error Data\r | |
85 | ///\r | |
86 | typedef struct {\r | |
87 | EFI_MEMORY_ERROR_GRANULARITY Granularity;\r | |
88 | EFI_MEMORY_ERROR_OPERATION Operation;\r | |
89 | UINTN Syndrome;\r | |
90 | EFI_PHYSICAL_ADDRESS Address;\r | |
91 | UINTN Resolution;\r | |
92 | } REPORT_STATUS_CODE_LIBRARY_MEMORY_EXTENDED_ERROR_DATA;\r | |
93 | \r | |
94 | ///\r | |
95 | /// DIMM number\r | |
96 | ///\r | |
97 | typedef struct {\r | |
98 | UINT16 Array;\r | |
99 | UINT16 Device;\r | |
100 | } REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_DIMM_NUMBER;\r | |
101 | \r | |
102 | ///\r | |
103 | /// Memory Module Mismatch Extended Error Data\r | |
104 | ///\r | |
105 | typedef struct {\r | |
106 | EFI_STATUS_CODE_DIMM_NUMBER Instance;\r | |
107 | } REPORT_STATUS_CODE_LIBRARY_MEMORY_MODULE_MISMATCH_ERROR_DATA;\r | |
108 | \r | |
109 | ///\r | |
110 | /// Memory Range Extended Data\r | |
111 | ///\r | |
112 | typedef struct {\r | |
113 | EFI_PHYSICAL_ADDRESS Start;\r | |
114 | EFI_PHYSICAL_ADDRESS Length;\r | |
115 | } REPORT_STATUS_CODE_LIBRARY_MEMORY_RANGE_EXTENDED_DATA;\r | |
116 | \r | |
117 | ///\r | |
118 | /// Device handle Extended Data. Used for many\r | |
119 | /// errors and progress codes to point to the device.\r | |
120 | ///\r | |
121 | typedef struct {\r | |
122 | EFI_HANDLE Handle;\r | |
123 | } REPORT_STATUS_CODE_LIBRARY_DEVICE_HANDLE_EXTENDED_DATA;\r | |
124 | \r | |
125 | typedef struct {\r | |
126 | UINT8 *DevicePath;\r | |
127 | } REPORT_STATUS_CODE_LIBRARY_DEVICE_PATH_EXTENDED_DATA;\r | |
128 | \r | |
129 | typedef struct {\r | |
130 | EFI_HANDLE ControllerHandle;\r | |
131 | EFI_HANDLE DriverBindingHandle;\r | |
132 | UINT16 DevicePathSize;\r | |
133 | UINT8 *RemainingDevicePath;\r | |
134 | } REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_START_EXTENDED_DATA;\r | |
135 | \r | |
136 | ///\r | |
137 | /// Resource Allocation Failure Extended Error Data\r | |
138 | ///\r | |
139 | typedef struct {\r | |
140 | UINT32 Bar;\r | |
141 | UINT16 DevicePathSize;\r | |
142 | UINT16 ReqResSize;\r | |
143 | UINT16 AllocResSize;\r | |
144 | UINT8 *DevicePath;\r | |
145 | UINT8 *ReqRes;\r | |
146 | UINT8 *AllocRes;\r | |
147 | } REPORT_STATUS_CODE_LIBRARY_RESOURCE_ALLOC_FAILURE_ERROR_DATA;\r | |
148 | \r | |
149 | ///\r | |
150 | /// Extended Error Data for Assert\r | |
151 | ///\r | |
152 | typedef struct {\r | |
153 | UINT32 LineNumber;\r | |
154 | UINT32 FileNameSize;\r | |
155 | EFI_STATUS_CODE_STRING_DATA *FileName;\r | |
156 | } REPORT_STATUS_CODE_LIBRARY_DEBUG_ASSERT_DATA;\r | |
157 | \r | |
158 | ///\r | |
159 | /// System Context Data EBC/IA32/IPF\r | |
160 | ///\r | |
161 | typedef struct {\r | |
162 | EFI_STATUS_CODE_EXCEP_SYSTEM_CONTEXT Context;\r | |
163 | } REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_EXCEP_EXTENDED_DATA;\r | |
164 | \r | |
165 | ///\r | |
166 | /// Legacy Oprom extended data\r | |
167 | ///\r | |
168 | typedef struct {\r | |
169 | EFI_HANDLE DeviceHandle;\r | |
170 | EFI_PHYSICAL_ADDRESS RomImageBase;\r | |
171 | } REPORT_STATUS_CODE_LIBRARY_LEGACY_OPROM_EXTENDED_DATA;\r | |
172 | \r | |
173 | //\r | |
174 | // Extern for the modules Caller ID GUID\r | |
175 | //\r | |
176 | extern EFI_GUID gEfiCallerIdGuid;\r | |
177 | \r | |
178 | /**\r | |
179 | Converts a status code to an 8-bit POST code value.\r | |
180 | \r | |
181 | Converts the status code specified by CodeType and Value to an 8-bit POST code \r | |
182 | and returns the 8-bit POST code in PostCode. If CodeType is an \r | |
183 | EFI_PROGRESS_CODE or CodeType is an EFI_ERROR_CODE, then bits 0..4 of PostCode \r | |
184 | are set to bits 16..20 of Value, and bits 5..7 of PostCode are set to bits \r | |
185 | 24..26 of Value., and TRUE is returned. Otherwise, FALSE is returned. \r | |
186 | \r | |
187 | If PostCode is NULL, then ASSERT().\r | |
188 | \r | |
189 | @param CodeType The type of status code being converted.\r | |
190 | @param Value The status code value being converted.\r | |
191 | @param PostCode A pointer to the 8-bit POST code value to return. \r | |
192 | \r | |
193 | @retval TRUE The status code specified by CodeType and Value was converted \r | |
194 | to an 8-bit POST code and returned in PostCode.\r | |
195 | @retval FALSE The status code specified by CodeType and Value could not be \r | |
196 | converted to an 8-bit POST code value.\r | |
197 | \r | |
198 | **/\r | |
199 | BOOLEAN\r | |
200 | EFIAPI\r | |
201 | CodeTypeToPostCode (\r | |
202 | IN EFI_STATUS_CODE_TYPE CodeType,\r | |
203 | IN EFI_STATUS_CODE_VALUE Value,\r | |
204 | OUT UINT8 *PostCode\r | |
205 | );\r | |
206 | \r | |
207 | \r | |
208 | /**\r | |
209 | Extracts ASSERT() information from a status code structure.\r | |
210 | \r | |
211 | Converts the status code specified by CodeType, Value, and Data to the ASSERT()\r | |
212 | arguments specified by Filename, Description, and LineNumber. If CodeType is \r | |
213 | an EFI_ERROR_CODE, and CodeType has a severity of EFI_ERROR_UNRECOVERED, and \r | |
214 | Value has an operation mask of EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, extract \r | |
215 | Filename, Description, and LineNumber from the optional data area of the \r | |
216 | status code buffer specified by Data. The optional data area of Data contains \r | |
217 | a Null-terminated ASCII string for the FileName, followed by a Null-terminated \r | |
218 | ASCII string for the Description, followed by a 32-bit LineNumber. If the \r | |
219 | ASSERT() information could be extracted from Data, then return TRUE. \r | |
220 | Otherwise, FALSE is returned. \r | |
221 | \r | |
222 | If Data is NULL, then ASSERT().\r | |
223 | If Filename is NULL, then ASSERT().\r | |
224 | If Description is NULL, then ASSERT().\r | |
225 | If LineNumber is NULL, then ASSERT().\r | |
226 | \r | |
227 | @param CodeType The type of status code being converted.\r | |
228 | @param Value The status code value being converted.\r | |
229 | @param Data Pointer to status code data buffer. \r | |
230 | @param Filename Pointer to the source file name that generated the ASSERT().\r | |
231 | @param Description Pointer to the description of the ASSERT().\r | |
232 | @param LineNumber Pointer to source line number that generated the ASSERT().\r | |
233 | \r | |
234 | @retval TRUE The status code specified by CodeType, Value, and Data was \r | |
235 | converted ASSERT() arguments specified by Filename, Description, \r | |
236 | and LineNumber.\r | |
237 | @retval FALSE The status code specified by CodeType, Value, and Data could \r | |
238 | not be converted to ASSERT() arguments.\r | |
239 | \r | |
240 | **/\r | |
241 | BOOLEAN\r | |
242 | EFIAPI\r | |
243 | ReportStatusCodeExtractAssertInfo (\r | |
8960cdeb | 244 | IN EFI_STATUS_CODE_TYPE CodeType,\r |
245 | IN EFI_STATUS_CODE_VALUE Value, \r | |
246 | IN CONST EFI_STATUS_CODE_DATA *Data, \r | |
247 | OUT CHAR8 **Filename,\r | |
248 | OUT CHAR8 **Description,\r | |
249 | OUT UINT32 *LineNumber\r | |
878ddf1f | 250 | );\r |
251 | \r | |
252 | \r | |
253 | /**\r | |
254 | Extracts DEBUG() information from a status code structure.\r | |
255 | \r | |
256 | Converts the status code specified by Data to the DEBUG() arguments specified \r | |
257 | by ErrorLevel, Marker, and Format. If type GUID in Data is \r | |
258 | EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID, then extract ErrorLevel, Marker, and \r | |
259 | Format from the optional data area of the status code buffer specified by Data. \r | |
260 | The optional data area of Data contains a 32-bit ErrorLevel followed by Marker \r | |
261 | which is 12 UINTN parameters, followed by a Null-terminated ASCII string for \r | |
262 | the Format. If the DEBUG() information could be extracted from Data, then \r | |
263 | return TRUE. Otherwise, FALSE is returned.\r | |
264 | \r | |
265 | If Data is NULL, then ASSERT().\r | |
266 | If ErrorLevel is NULL, then ASSERT().\r | |
267 | If Marker is NULL, then ASSERT().\r | |
268 | If Format is NULL, then ASSERT().\r | |
269 | \r | |
270 | @param Data Pointer to status code data buffer. \r | |
271 | @param ErrorLevel Pointer to error level mask for a debug message.\r | |
272 | @param Marker Pointer to the variable argument list associated with Format.\r | |
273 | @param Format Pointer to a Null-terminated ASCII format string of a \r | |
274 | debug message.\r | |
275 | \r | |
276 | @retval TRUE The status code specified by Data was converted DEBUG() arguments \r | |
277 | specified by ErrorLevel, Marker, and Format.\r | |
278 | @retval FALSE The status code specified by Data could not be converted to \r | |
279 | DEBUG() arguments.\r | |
280 | \r | |
281 | **/\r | |
282 | BOOLEAN\r | |
283 | EFIAPI\r | |
284 | ReportStatusCodeExtractDebugInfo (\r | |
8960cdeb | 285 | IN CONST EFI_STATUS_CODE_DATA *Data, \r |
286 | OUT UINT32 *ErrorLevel,\r | |
287 | OUT VA_LIST *Marker,\r | |
288 | OUT CHAR8 **Format\r | |
878ddf1f | 289 | );\r |
290 | \r | |
291 | \r | |
292 | /**\r | |
293 | Reports a status code.\r | |
294 | \r | |
295 | Reports the status code specified by the parameters Type and Value. Status \r | |
296 | code also require an instance, caller ID, and extended data. This function \r | |
297 | passed in a zero instance, NULL extended data, and a caller ID of \r | |
298 | gEfiCallerIdGuid, which is the GUID for the module. \r | |
299 | \r | |
300 | ReportStatusCode()must actively prevent recusrsion. If ReportStatusCode() \r | |
301 | is called while processing another any other Report Status Code Library function,\r | |
302 | then ReportStatusCode() must return immediately.\r | |
303 | \r | |
304 | @param Type Status code type. \r | |
305 | @param Value Status code value.\r | |
306 | \r | |
307 | @retval EFI_SUCCESS The status code was reported.\r | |
308 | @retval EFI_DEVICE_ERROR There status code could not be reported due to a \r | |
309 | device error.\r | |
310 | @retval EFI_UNSUPPORTED Report status code is not supported\r | |
311 | \r | |
312 | **/\r | |
313 | EFI_STATUS\r | |
314 | EFIAPI\r | |
315 | ReportStatusCode (\r | |
316 | IN EFI_STATUS_CODE_TYPE Type,\r | |
317 | IN EFI_STATUS_CODE_VALUE Value\r | |
318 | );\r | |
319 | \r | |
320 | \r | |
321 | /**\r | |
322 | Reports a status code with a Device Path Protocol as the extended data.\r | |
323 | \r | |
324 | Allocates and fills in the extended data section of a status code with the \r | |
325 | Device Path Protocol specified by DevicePath. This function is responsible \r | |
326 | for allocating a buffer large enough for the standard header and the device \r | |
327 | path. The standard header is filled in with a GUID of \r | |
328 | gEfiStatusCodeSpecificDataGuid. The status code is reported with a zero \r | |
329 | instance and a caller ID of gEfiCallerIdGuid.\r | |
330 | \r | |
331 | ReportStatusCodeWithDevicePath()must actively prevent recursion. If \r | |
332 | ReportStatusCodeWithDevicePath() is called while processing another any other \r | |
333 | Report Status Code Library function, then ReportStatusCodeWithDevicePath() \r | |
334 | must return EFI_DEVICE_ERROR immediately.\r | |
335 | \r | |
336 | If DevicePath is NULL, then ASSERT().\r | |
337 | \r | |
338 | @param Type Status code type. \r | |
339 | @param Value Status code value.\r | |
340 | @param DevicePath Pointer to the Device Path Protocol to be reported.\r | |
341 | \r | |
342 | @retval EFI_SUCCESS The status code was reported with the extended \r | |
343 | data specified by DevicePath.\r | |
344 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the \r | |
345 | extended data section.\r | |
346 | @retval EFI_UNSUPPORTED Report status code is not supported\r | |
347 | \r | |
348 | **/\r | |
349 | EFI_STATUS\r | |
350 | EFIAPI\r | |
351 | ReportStatusCodeWithDevicePath (\r | |
8960cdeb | 352 | IN EFI_STATUS_CODE_TYPE Type,\r |
353 | IN EFI_STATUS_CODE_VALUE Value,\r | |
354 | IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r | |
878ddf1f | 355 | );\r |
356 | \r | |
357 | \r | |
358 | /**\r | |
359 | Reports a status code with an extended data buffer.\r | |
360 | \r | |
361 | Allocates and fills in the extended data section of a status code with the \r | |
362 | extended data specified by ExtendedData and ExtendedDataSize. ExtendedData \r | |
363 | is assumed to be one of the data structures specified in Related Definitions. \r | |
364 | These data structure do not have the standard header, so this function is \r | |
365 | responsible for allocating a buffer large enough for the standard header and \r | |
366 | the extended data passed into this function. The standard header is filled \r | |
367 | in with a GUID of gEfiStatusCodeSpecificDataGuid. The status code is reported \r | |
368 | with a zero instance and a caller ID of gEfiCallerIdGuid.\r | |
369 | \r | |
370 | ReportStatusCodeWithExtendedData()must actively prevent recursion. If \r | |
371 | ReportStatusCodeWithExtendedData() is called while processing another any other \r | |
372 | Report Status Code Library function, then ReportStatusCodeWithExtendedData() \r | |
373 | must return EFI_DEVICE_ERROR immediately.\r | |
374 | \r | |
375 | If ExtendedData is NULL, then ASSERT().\r | |
376 | If ExtendedDataSize is 0, then ASSERT().\r | |
377 | \r | |
378 | @param Type Status code type. \r | |
379 | @param Value Status code value.\r | |
380 | @param ExtendedData Pointer to the extended data buffer to be reported.\r | |
381 | @param ExtendedDataSize The size, in bytes, of the extended data buffer to \r | |
382 | be reported.\r | |
383 | \r | |
384 | @retval EFI_SUCCESS The status code was reported with the extended \r | |
385 | data specified by ExtendedData and ExtendedDataSize.\r | |
386 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the \r | |
387 | extended data section.\r | |
388 | @retval EFI_UNSUPPORTED Report status code is not supported\r | |
389 | \r | |
390 | **/\r | |
391 | EFI_STATUS\r | |
392 | EFIAPI\r | |
393 | ReportStatusCodeWithExtendedData (\r | |
394 | IN EFI_STATUS_CODE_TYPE Type,\r | |
395 | IN EFI_STATUS_CODE_VALUE Value,\r | |
8960cdeb | 396 | IN CONST VOID *ExtendedData,\r |
878ddf1f | 397 | IN UINTN ExtendedDataSize\r |
398 | );\r | |
399 | \r | |
400 | \r | |
401 | /**\r | |
402 | Reports a status code with full parameters.\r | |
403 | \r | |
404 | The function reports a status code. If ExtendedData is NULL and ExtendedDataSize \r | |
405 | is 0, then an extended data buffer is not reported. If ExtendedData is not \r | |
406 | NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated. \r | |
407 | ExtendedData is assumed not have the standard status code header, so this function \r | |
408 | is responsible for allocating a buffer large enough for the standard header and \r | |
409 | the extended data passed into this function. The standard header is filled in \r | |
410 | with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a \r | |
411 | GUID of gEfiStatusCodeSpecificDatauid is used. The status code is reported with \r | |
412 | an instance specified by Instance and a caller ID specified by CallerId. If \r | |
413 | CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.\r | |
414 | \r | |
415 | ReportStatusCodeEx()must actively prevent recursion. If ReportStatusCodeEx() \r | |
416 | is called while processing another any other Report Status Code Library function, \r | |
417 | then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.\r | |
418 | \r | |
419 | If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().\r | |
420 | If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().\r | |
421 | \r | |
422 | @param Type Status code type. \r | |
423 | @param Value Status code value.\r | |
424 | @param Instance Status code instance number.\r | |
425 | @param CallerId Pointer to a GUID that identifies the caller of this \r | |
426 | function. If this parameter is NULL, then a caller \r | |
427 | ID of gEfiCallerIdGuid is used.\r | |
428 | @param ExtendedDataGuid Pointer to the GUID for the extended data buffer. \r | |
429 | If this parameter is NULL, then a the status code \r | |
430 | standard header is filled in with \r | |
431 | gEfiStatusCodeSpecificDataGuid.\r | |
432 | @param ExtendedData Pointer to the extended data buffer. This is an \r | |
433 | optional parameter that may be NULL.\r | |
434 | @param ExtendedDataSize The size, in bytes, of the extended data buffer.\r | |
435 | \r | |
436 | @retval EFI_SUCCESS The status code was reported.\r | |
437 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate \r | |
438 | the extended data section if it was specified.\r | |
439 | @retval EFI_UNSUPPORTED Report status code is not supported\r | |
440 | \r | |
441 | **/\r | |
442 | EFI_STATUS\r | |
443 | EFIAPI\r | |
444 | ReportStatusCodeEx (\r | |
445 | IN EFI_STATUS_CODE_TYPE Type,\r | |
446 | IN EFI_STATUS_CODE_VALUE Value,\r | |
447 | IN UINT32 Instance,\r | |
8960cdeb | 448 | IN CONST EFI_GUID *CallerId OPTIONAL,\r |
449 | IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL,\r | |
450 | IN CONST VOID *ExtendedData OPTIONAL,\r | |
878ddf1f | 451 | IN UINTN ExtendedDataSize\r |
452 | );\r | |
453 | \r | |
454 | \r | |
878ddf1f | 455 | /**\r |
456 | Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled\r | |
457 | \r | |
458 | This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED \r | |
459 | bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.\r | |
460 | \r | |
461 | @retval TRUE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of \r | |
462 | PcdReportStatusCodeProperyMask is set.\r | |
463 | @retval FALSE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of \r | |
464 | PcdReportStatusCodeProperyMask is clear.\r | |
465 | \r | |
466 | **/\r | |
467 | BOOLEAN\r | |
468 | EFIAPI\r | |
469 | ReportProgressCodeEnabled (\r | |
470 | VOID\r | |
471 | );\r | |
472 | \r | |
473 | \r | |
474 | /**\r | |
475 | Returns TRUE if status codes of type EFI_ERROR_CODE are enabled\r | |
476 | \r | |
477 | This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED \r | |
478 | bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.\r | |
479 | \r | |
480 | @retval TRUE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of \r | |
481 | PcdReportStatusCodeProperyMask is set.\r | |
482 | @retval FALSE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of \r | |
483 | PcdReportStatusCodeProperyMask is clear.\r | |
484 | \r | |
485 | **/\r | |
486 | BOOLEAN\r | |
487 | EFIAPI\r | |
488 | ReportErrorCodeEnabled (\r | |
489 | VOID\r | |
490 | );\r | |
491 | \r | |
492 | \r | |
493 | /**\r | |
494 | Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled\r | |
495 | \r | |
496 | This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED \r | |
497 | bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.\r | |
498 | \r | |
499 | @retval TRUE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of \r | |
500 | PcdReportStatusCodeProperyMask is set.\r | |
501 | @retval FALSE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of \r | |
502 | PcdReportStatusCodeProperyMask is clear.\r | |
503 | \r | |
504 | **/\r | |
505 | BOOLEAN\r | |
506 | EFIAPI\r | |
507 | ReportDebugCodeEnabled (\r | |
508 | VOID\r | |
509 | );\r | |
510 | \r | |
511 | \r | |
878ddf1f | 512 | /**\r |
513 | Reports a status code with minimal parameters if the status code type is enabled.\r | |
514 | \r | |
515 | If the status code type specified by Type is enabled in \r | |
516 | PcdReportStatusCodeProperyMask, then call ReportStatusCode() passing in Type \r | |
517 | and Value.\r | |
518 | \r | |
519 | @param Type Status code type. \r | |
520 | @param Value Status code value.\r | |
521 | \r | |
522 | @retval EFI_SUCCESS The status code was reported.\r | |
523 | @retval EFI_DEVICE_ERROR There status code could not be reported due to a device error.\r | |
524 | @retval EFI_UNSUPPORTED Report status code is not supported\r | |
525 | \r | |
526 | **/\r | |
527 | #define REPORT_STATUS_CODE(Type,Value) \\r | |
528 | (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \\r | |
529 | ReportStatusCode(Type,Value) : \\r | |
530 | (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \\r | |
531 | ReportStatusCode(Type,Value) : \\r | |
532 | (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \\r | |
533 | ReportStatusCode(Type,Value) : \\r | |
534 | EFI_UNSUPPORTED\r | |
535 | \r | |
536 | \r | |
537 | /**\r | |
538 | Reports a status code with a Device Path Protocol as the extended data if the \r | |
539 | status code type is enabled.\r | |
540 | \r | |
541 | If the status code type specified by Type is enabled in \r | |
542 | PcdReportStatusCodeProperyMask, then call ReportStatusCodeWithDevicePath() \r | |
543 | passing in Type, Value, and DevicePath.\r | |
544 | \r | |
545 | @param Type Status code type. \r | |
546 | @param Value Status code value.\r | |
547 | @param DevicePath Pointer to the Device Path Protocol to be reported.\r | |
548 | \r | |
549 | @retval EFI_SUCCESS The status code was reported with the extended \r | |
550 | data specified by DevicePath.\r | |
551 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the \r | |
552 | extended data section.\r | |
553 | @retval EFI_UNSUPPORTED Report status code is not supported\r | |
554 | \r | |
555 | **/\r | |
556 | #define REPORT_STATUS_CODE_WITH_DEVICE_PATH(Type,Value,DevicePathParameter) \\r | |
557 | (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \\r | |
558 | ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \\r | |
559 | (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \\r | |
560 | ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \\r | |
561 | (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \\r | |
562 | ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \\r | |
563 | EFI_UNSUPPORTED\r | |
564 | \r | |
565 | \r | |
566 | /**\r | |
567 | Reports a status code with an extended data buffer if the status code type \r | |
568 | is enabled.\r | |
569 | \r | |
570 | If the status code type specified by Type is enabled in \r | |
571 | PcdReportStatusCodeProperyMask, then call ReportStatusCodeWithExtendedData() \r | |
572 | passing in Type, Value, ExtendedData, and ExtendedDataSize.\r | |
573 | \r | |
574 | @param Type Status code type. \r | |
575 | @param Value Status code value.\r | |
576 | @param ExtendedData Pointer to the extended data buffer to be reported.\r | |
577 | @param ExtendedDataSize The size, in bytes, of the extended data buffer to\r | |
578 | be reported.\r | |
579 | \r | |
580 | @retval EFI_SUCCESS The status code was reported with the extended \r | |
581 | data specified by ExtendedData and ExtendedDataSize.\r | |
582 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the \r | |
583 | extended data section.\r | |
584 | @retval EFI_UNSUPPORTED Report status code is not supported\r | |
585 | \r | |
586 | **/\r | |
587 | #define REPORT_STATUS_CODE_WITH_EXTENDED_DATA(Type,Value,ExtendedData,ExtendedDataSize) \\r | |
588 | (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \\r | |
589 | ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \\r | |
590 | (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \\r | |
591 | ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \\r | |
592 | (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \\r | |
593 | ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \\r | |
594 | EFI_UNSUPPORTED\r | |
595 | \r | |
596 | /**\r | |
597 | Reports a status code specifying all parameters if the status code type is enabled.\r | |
598 | \r | |
599 | If the status code type specified by Type is enabled in \r | |
600 | PcdReportStatusCodeProperyMask, then call ReportStatusCodeEx() passing in Type, \r | |
601 | Value, Instance, CallerId, ExtendedDataGuid, ExtendedData, and ExtendedDataSize.\r | |
602 | \r | |
603 | @param Type Status code type. \r | |
604 | @param Value Status code value.\r | |
605 | @param Instance Status code instance number.\r | |
606 | @param CallerId Pointer to a GUID that identifies the caller of this \r | |
607 | function. If this parameter is NULL, then a caller \r | |
608 | ID of gEfiCallerIdGuid is used.\r | |
609 | @param ExtendedDataGuid Pointer to the GUID for the extended data buffer. \r | |
610 | If this parameter is NULL, then a the status code \r | |
611 | standard header is filled in with \r | |
612 | gEfiStatusCodeSpecificDataGuid.\r | |
613 | @param ExtendedData Pointer to the extended data buffer. This is an \r | |
614 | optional parameter that may be NULL.\r | |
615 | @param ExtendedDataSize The size, in bytes, of the extended data buffer.\r | |
616 | \r | |
617 | @retval EFI_SUCCESS The status code was reported.\r | |
618 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the \r | |
619 | extended data section if it was specified.\r | |
620 | @retval EFI_UNSUPPORTED Report status code is not supported\r | |
621 | \r | |
622 | **/\r | |
623 | #define REPORT_STATUS_CODE_EX(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) \\r | |
624 | (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \\r | |
625 | ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \\r | |
626 | (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \\r | |
627 | ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \\r | |
628 | (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \\r | |
629 | ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \\r | |
630 | EFI_UNSUPPORTED\r | |
631 | \r | |
878ddf1f | 632 | #endif\r |