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