]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLib.c
Add conditional check before output status code.
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / DxeReportStatusCodeLibFramework / ReportStatusCodeLib.c
CommitLineData
2287f237 1/** @file\r
2 Report Status Code Library for DXE Phase.\r
3\r
4 Copyright (c) 2006 - 2007, Intel Corporation<BR>\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
e5516b49 15#include "ReportStatusCodeLibInternal.h"\r
e5516b49 16 \r
17EFI_REPORT_STATUS_CODE mReportStatusCode = NULL;\r
2287f237 18\r
19/**\r
20 Internal worker function that reports a status code through the Status Code Protocol\r
21\r
22 This function checks to see if a Status Code Protocol is present in the handle\r
23 database. If a Status Code Protocol is not present, then EFI_UNSUPPORTED is\r
24 returned. If a Status Code Protocol is present, then it is cached in gStatusCode,\r
25 and the ReportStatusCode() service of the Status Code Protocol is called passing in\r
26 Type, Value, Instance, CallerId, and Data. The result of this call is returned.\r
27\r
28 @param Type Status code type.\r
29 @param Value Status code value.\r
30 @param Instance Status code instance number.\r
31 @param CallerId Pointer to a GUID that identifies the caller of this\r
32 function. This is an optional parameter that may be\r
33 NULL.\r
34 @param Data Pointer to the extended data buffer. This is an\r
35 optional parameter that may be NULL.\r
36\r
37 @retval EFI_SUCCESS The status code was reported.\r
38 @retval EFI_OUT_OF_RESOURCES There were not enough resources to report the status code.\r
39 @retval EFI_UNSUPPORTED Status Code Protocol is not available.\r
40\r
41**/\r
2287f237 42EFI_STATUS\r
43InternalReportStatusCode (\r
44 IN EFI_STATUS_CODE_TYPE Type,\r
45 IN EFI_STATUS_CODE_VALUE Value,\r
46 IN UINT32 Instance,\r
47 IN CONST EFI_GUID *CallerId OPTIONAL,\r
48 IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
49 )\r
50{\r
15cd6a82
LG
51 if ((ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ||\r
52 (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ||\r
53 (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE)) {\r
54 //\r
55 // If gStatusCode is NULL, then see if a Status Code Protocol instance is present\r
56 // in the handle database.\r
57 //\r
e5516b49 58 if (mReportStatusCode == NULL) {\r
15cd6a82
LG
59 mReportStatusCode = InternalGetReportStatusCode ();\r
60 if (mReportStatusCode == NULL) {\r
61 return EFI_UNSUPPORTED;\r
62 }\r
2287f237 63 }\r
15cd6a82
LG
64 \r
65 //\r
66 // A Status Code Protocol is present in the handle database, so pass in all the\r
67 // parameters to the ReportStatusCode() service of the Status Code Protocol\r
68 //\r
69 return (*mReportStatusCode) (Type, Value, Instance, (EFI_GUID *)CallerId, Data);\r
2287f237 70 }\r
15cd6a82
LG
71 \r
72 return EFI_UNSUPPORTED;\r
2287f237 73}\r
74\r
75\r
76/**\r
77 Computes and returns the size, in bytes, of a device path.\r
78\r
79 @param DevicePath A pointer to a device path.\r
80\r
81 @return The size, in bytes, of DevicePath.\r
82\r
83**/\r
2287f237 84UINTN\r
85InternalReportStatusCodeDevicePathSize (\r
86 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
87 )\r
88{\r
89 CONST EFI_DEVICE_PATH_PROTOCOL *Start;\r
90\r
91 //\r
92 // Search for the end of the device path structure\r
93 //\r
94 Start = DevicePath;\r
2067710d 95 while (!IsDevicePathEnd (DevicePath)) {\r
96 DevicePath = NextDevicePathNode (DevicePath);\r
2287f237 97 }\r
98\r
99 //\r
100 // Subtract the start node from the end node and add in the size of the end node\r
101 //\r
102 return ((UINTN) DevicePath - (UINTN) Start) + DevicePathNodeLength (DevicePath);\r
103}\r
104\r
105\r
106/**\r
107 Converts a status code to an 8-bit POST code value.\r
108\r
109 Converts the status code specified by CodeType and Value to an 8-bit POST code\r
110 and returns the 8-bit POST code in PostCode. If CodeType is an\r
111 EFI_PROGRESS_CODE or CodeType is an EFI_ERROR_CODE, then bits 0..4 of PostCode\r
112 are set to bits 16..20 of Value, and bits 5..7 of PostCode are set to bits\r
113 24..26 of Value., and TRUE is returned. Otherwise, FALSE is returned.\r
114\r
115 If PostCode is NULL, then ASSERT().\r
116\r
117 @param CodeType The type of status code being converted.\r
118 @param Value The status code value being converted.\r
119 @param PostCode A pointer to the 8-bit POST code value to return.\r
120\r
121 @retval TRUE The status code specified by CodeType and Value was converted\r
122 to an 8-bit POST code and returned in PostCode.\r
123 @retval FALSE The status code specified by CodeType and Value could not be\r
124 converted to an 8-bit POST code value.\r
125\r
126**/\r
127BOOLEAN\r
128EFIAPI\r
129CodeTypeToPostCode (\r
130 IN EFI_STATUS_CODE_TYPE CodeType,\r
131 IN EFI_STATUS_CODE_VALUE Value,\r
132 OUT UINT8 *PostCode\r
133 )\r
134{\r
135 //\r
136 // If PostCode is NULL, then ASSERT()\r
137 //\r
138 ASSERT (PostCode != NULL);\r
139\r
140 //\r
141 // Convert Value to an 8 bit post code\r
142 //\r
143 if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ||\r
144 ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ) {\r
145 *PostCode = (UINT8) ((((Value & EFI_STATUS_CODE_CLASS_MASK) >> 24) << 5) |\r
146 (((Value & EFI_STATUS_CODE_SUBCLASS_MASK) >> 16) & 0x1f));\r
147 return TRUE;\r
148 }\r
149 return FALSE;\r
150}\r
151\r
152\r
153/**\r
154 Extracts ASSERT() information from a status code structure.\r
155\r
156 Converts the status code specified by CodeType, Value, and Data to the ASSERT()\r
157 arguments specified by Filename, Description, and LineNumber. If CodeType is\r
158 an EFI_ERROR_CODE, and CodeType has a severity of EFI_ERROR_UNRECOVERED, and\r
159 Value has an operation mask of EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, extract\r
160 Filename, Description, and LineNumber from the optional data area of the\r
161 status code buffer specified by Data. The optional data area of Data contains\r
162 a Null-terminated ASCII string for the FileName, followed by a Null-terminated\r
163 ASCII string for the Description, followed by a 32-bit LineNumber. If the\r
164 ASSERT() information could be extracted from Data, then return TRUE.\r
165 Otherwise, FALSE is returned.\r
166\r
167 If Data is NULL, then ASSERT().\r
168 If Filename is NULL, then ASSERT().\r
169 If Description is NULL, then ASSERT().\r
170 If LineNumber is NULL, then ASSERT().\r
171\r
172 @param CodeType The type of status code being converted.\r
173 @param Value The status code value being converted.\r
174 @param Data Pointer to status code data buffer.\r
175 @param Filename Pointer to the source file name that generated the ASSERT().\r
176 @param Description Pointer to the description of the ASSERT().\r
177 @param LineNumber Pointer to source line number that generated the ASSERT().\r
178\r
179 @retval TRUE The status code specified by CodeType, Value, and Data was\r
180 converted ASSERT() arguments specified by Filename, Description,\r
181 and LineNumber.\r
182 @retval FALSE The status code specified by CodeType, Value, and Data could\r
183 not be converted to ASSERT() arguments.\r
184\r
185**/\r
186BOOLEAN\r
187EFIAPI\r
188ReportStatusCodeExtractAssertInfo (\r
189 IN EFI_STATUS_CODE_TYPE CodeType,\r
190 IN EFI_STATUS_CODE_VALUE Value,\r
191 IN CONST EFI_STATUS_CODE_DATA *Data,\r
192 OUT CHAR8 **Filename,\r
193 OUT CHAR8 **Description,\r
194 OUT UINT32 *LineNumber\r
195 )\r
196{\r
197 EFI_DEBUG_ASSERT_DATA *AssertData;\r
198\r
199 ASSERT (Data != NULL);\r
200 ASSERT (Filename != NULL);\r
201 ASSERT (Description != NULL);\r
202 ASSERT (LineNumber != NULL);\r
203\r
204 if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) &&\r
205 ((CodeType & EFI_STATUS_CODE_SEVERITY_MASK) == EFI_ERROR_UNRECOVERED) &&\r
206 ((Value & EFI_STATUS_CODE_OPERATION_MASK) == EFI_SW_EC_ILLEGAL_SOFTWARE_STATE)) {\r
207 AssertData = (EFI_DEBUG_ASSERT_DATA *)(Data + 1);\r
208 *Filename = (CHAR8 *)(AssertData + 1);\r
209 *Description = *Filename + AsciiStrLen (*Filename) + 1;\r
210 *LineNumber = AssertData->LineNumber;\r
211 return TRUE;\r
212 }\r
213 return FALSE;\r
214}\r
215\r
216\r
217/**\r
218 Extracts DEBUG() information from a status code structure.\r
219\r
220 Converts the status code specified by Data to the DEBUG() arguments specified\r
221 by ErrorLevel, Marker, and Format. If type GUID in Data is\r
222 EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID, then extract ErrorLevel, Marker, and\r
223 Format from the optional data area of the status code buffer specified by Data.\r
224 The optional data area of Data contains a 32-bit ErrorLevel followed by Marker\r
225 which is 12 UINTN parameters, followed by a Null-terminated ASCII string for\r
226 the Format. If the DEBUG() information could be extracted from Data, then\r
227 return TRUE. Otherwise, FALSE is returned.\r
228\r
229 If Data is NULL, then ASSERT().\r
230 If ErrorLevel is NULL, then ASSERT().\r
231 If Marker is NULL, then ASSERT().\r
232 If Format is NULL, then ASSERT().\r
233\r
234 @param Data Pointer to status code data buffer.\r
235 @param ErrorLevel Pointer to error level mask for a debug message.\r
236 @param Marker Pointer to the variable argument list associated with Format.\r
237 @param Format Pointer to a Null-terminated ASCII format string of a\r
238 debug message.\r
239\r
240 @retval TRUE The status code specified by Data was converted DEBUG() arguments\r
241 specified by ErrorLevel, Marker, and Format.\r
242 @retval FALSE The status code specified by Data could not be converted to\r
243 DEBUG() arguments.\r
244\r
245**/\r
246BOOLEAN\r
247EFIAPI\r
248ReportStatusCodeExtractDebugInfo (\r
249 IN CONST EFI_STATUS_CODE_DATA *Data,\r
250 OUT UINT32 *ErrorLevel,\r
251 OUT VA_LIST *Marker,\r
252 OUT CHAR8 **Format\r
253 )\r
254{\r
255 EFI_DEBUG_INFO *DebugInfo;\r
256\r
257 ASSERT (Data != NULL);\r
258 ASSERT (ErrorLevel != NULL);\r
259 ASSERT (Marker != NULL);\r
260 ASSERT (Format != NULL);\r
261\r
262 //\r
263 // If the GUID type is not EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID then return FALSE\r
264 //\r
265 if (!CompareGuid (&Data->Type, &gEfiStatusCodeDataTypeDebugGuid)) {\r
266 return FALSE;\r
267 }\r
268\r
269 //\r
270 // Retrieve the debug information from the status code record\r
271 //\r
272 DebugInfo = (EFI_DEBUG_INFO *)(Data + 1);\r
273\r
274 *ErrorLevel = DebugInfo->ErrorLevel;\r
275\r
276 //\r
277 // The first 12 * UINTN bytes of the string are really an\r
278 // argument stack to support varargs on the Format string.\r
279 //\r
280 *Marker = (VA_LIST) (DebugInfo + 1);\r
281 *Format = (CHAR8 *)(((UINT64 *)*Marker) + 12);\r
282\r
283 return TRUE;\r
284}\r
285\r
286\r
287/**\r
288 Reports a status code.\r
289\r
290 Reports the status code specified by the parameters Type and Value. Status\r
291 code also require an instance, caller ID, and extended data. This function\r
292 passed in a zero instance, NULL extended data, and a caller ID of\r
293 gEfiCallerIdGuid, which is the GUID for the module.\r
294\r
295 ReportStatusCode()must actively prevent recusrsion. If ReportStatusCode()\r
296 is called while processing another any other Report Status Code Library function,\r
297 then ReportStatusCode() must return immediately.\r
298\r
299 @param Type Status code type.\r
300 @param Value Status code value.\r
301\r
302 @retval EFI_SUCCESS The status code was reported.\r
303 @retval EFI_DEVICE_ERROR There status code could not be reported due to a\r
304 device error.\r
305 @retval EFI_UNSUPPORTED Report status code is not supported\r
306\r
307**/\r
308EFI_STATUS\r
309EFIAPI\r
310ReportStatusCode (\r
311 IN EFI_STATUS_CODE_TYPE Type,\r
312 IN EFI_STATUS_CODE_VALUE Value\r
313 )\r
314{\r
315 return InternalReportStatusCode (Type, Value, 0, &gEfiCallerIdGuid, NULL);\r
316}\r
317\r
318\r
319/**\r
320 Reports a status code with a Device Path Protocol as the extended data.\r
321\r
322 Allocates and fills in the extended data section of a status code with the\r
323 Device Path Protocol specified by DevicePath. This function is responsible\r
324 for allocating a buffer large enough for the standard header and the device\r
325 path. The standard header is filled in with a GUID of\r
326 gEfiStatusCodeSpecificDataGuid. The status code is reported with a zero\r
327 instance and a caller ID of gEfiCallerIdGuid.\r
328\r
329 ReportStatusCodeWithDevicePath()must actively prevent recursion. If\r
330 ReportStatusCodeWithDevicePath() is called while processing another any other\r
331 Report Status Code Library function, then ReportStatusCodeWithDevicePath()\r
332 must return EFI_DEVICE_ERROR immediately.\r
333\r
334 If DevicePath is NULL, then ASSERT().\r
335\r
336 @param Type Status code type.\r
337 @param Value Status code value.\r
338 @param DevicePath Pointer to the Device Path Protocol to be reported.\r
339\r
340 @retval EFI_SUCCESS The status code was reported with the extended\r
341 data specified by DevicePath.\r
342 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the\r
343 extended data section.\r
344 @retval EFI_UNSUPPORTED Report status code is not supported\r
345\r
346**/\r
347EFI_STATUS\r
348EFIAPI\r
349ReportStatusCodeWithDevicePath (\r
350 IN EFI_STATUS_CODE_TYPE Type,\r
351 IN EFI_STATUS_CODE_VALUE Value,\r
352 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
353 )\r
354{\r
355 ASSERT (DevicePath != NULL);\r
356 return ReportStatusCodeWithExtendedData (\r
357 Type,\r
358 Value,\r
359 (VOID *)DevicePath,\r
360 InternalReportStatusCodeDevicePathSize (DevicePath)\r
361 );\r
362}\r
363\r
364\r
365/**\r
366 Reports a status code with an extended data buffer.\r
367\r
368 Allocates and fills in the extended data section of a status code with the\r
369 extended data specified by ExtendedData and ExtendedDataSize. ExtendedData\r
370 is assumed to be one of the data structures specified in Related Definitions.\r
371 These data structure do not have the standard header, so this function is\r
372 responsible for allocating a buffer large enough for the standard header and\r
373 the extended data passed into this function. The standard header is filled\r
374 in with a GUID of gEfiStatusCodeSpecificDataGuid. The status code is reported\r
375 with a zero instance and a caller ID of gEfiCallerIdGuid.\r
376\r
377 ReportStatusCodeWithExtendedData()must actively prevent recursion. If\r
378 ReportStatusCodeWithExtendedData() is called while processing another any other\r
379 Report Status Code Library function, then ReportStatusCodeWithExtendedData()\r
380 must return EFI_DEVICE_ERROR immediately.\r
381\r
382 If ExtendedData is NULL, then ASSERT().\r
383 If ExtendedDataSize is 0, then ASSERT().\r
384\r
385 @param Type Status code type.\r
386 @param Value Status code value.\r
387 @param ExtendedData Pointer to the extended data buffer to be reported.\r
388 @param ExtendedDataSize The size, in bytes, of the extended data buffer to\r
389 be reported.\r
390\r
391 @retval EFI_SUCCESS The status code was reported with the extended\r
392 data specified by ExtendedData and ExtendedDataSize.\r
393 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the\r
394 extended data section.\r
395 @retval EFI_UNSUPPORTED Report status code is not supported\r
396\r
397**/\r
398EFI_STATUS\r
399EFIAPI\r
400ReportStatusCodeWithExtendedData (\r
401 IN EFI_STATUS_CODE_TYPE Type,\r
402 IN EFI_STATUS_CODE_VALUE Value,\r
403 IN CONST VOID *ExtendedData,\r
404 IN UINTN ExtendedDataSize\r
405 )\r
406{\r
407 ASSERT (ExtendedData != NULL);\r
408 ASSERT (ExtendedDataSize != 0);\r
409 return ReportStatusCodeEx (\r
410 Type,\r
411 Value,\r
412 0,\r
413 NULL,\r
414 NULL,\r
415 ExtendedData,\r
416 ExtendedDataSize\r
417 );\r
418}\r
419\r
420\r
421/**\r
422 Reports a status code with full parameters.\r
423\r
424 The function reports a status code. If ExtendedData is NULL and ExtendedDataSize\r
425 is 0, then an extended data buffer is not reported. If ExtendedData is not\r
426 NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.\r
427 ExtendedData is assumed not have the standard status code header, so this function\r
428 is responsible for allocating a buffer large enough for the standard header and\r
429 the extended data passed into this function. The standard header is filled in\r
430 with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a\r
8191cd5e 431 GUID of gEfiStatusCodeSpecificDataGuid is used. The status code is reported with\r
2287f237 432 an instance specified by Instance and a caller ID specified by CallerId. If\r
433 CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.\r
434\r
e5516b49 435 ReportStatusCodeEx()must actively prevent recursion. If\r
436 ReportStatusCodeEx() is called while processing another any\r
437 other Report Status Code Library function, then\r
438 ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.\r
2287f237 439\r
440 If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().\r
441 If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().\r
442\r
443 @param Type Status code type.\r
444 @param Value Status code value.\r
445 @param Instance Status code instance number.\r
446 @param CallerId Pointer to a GUID that identifies the caller of this\r
447 function. If this parameter is NULL, then a caller\r
448 ID of gEfiCallerIdGuid is used.\r
449 @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.\r
450 If this parameter is NULL, then a the status code\r
451 standard header is filled in with\r
452 gEfiStatusCodeSpecificDataGuid.\r
453 @param ExtendedData Pointer to the extended data buffer. This is an\r
454 optional parameter that may be NULL.\r
455 @param ExtendedDataSize The size, in bytes, of the extended data buffer.\r
456\r
457 @retval EFI_SUCCESS The status code was reported.\r
458 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate\r
459 the extended data section if it was specified.\r
460 @retval EFI_UNSUPPORTED Report status code is not supported\r
461\r
462**/\r
463EFI_STATUS\r
464EFIAPI\r
465ReportStatusCodeEx (\r
466 IN EFI_STATUS_CODE_TYPE Type,\r
467 IN EFI_STATUS_CODE_VALUE Value,\r
468 IN UINT32 Instance,\r
469 IN CONST EFI_GUID *CallerId OPTIONAL,\r
470 IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL,\r
471 IN CONST VOID *ExtendedData OPTIONAL,\r
472 IN UINTN ExtendedDataSize\r
473 )\r
474{\r
e5516b49 475 EFI_STATUS Status;\r
476\r
477 Status = InternalReportStatusCodeEx (\r
478 Type,\r
479 Value,\r
480 Instance,\r
481 CallerId,\r
482 ExtendedDataGuid,\r
483 ExtendedData,\r
484 ExtendedDataSize\r
485 );\r
2287f237 486\r
487 return Status;\r
488}\r
489\r
490\r
491/**\r
492 Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled\r
493\r
494 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED\r
495 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.\r
496\r
497 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of\r
498 PcdReportStatusCodeProperyMask is set.\r
499 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of\r
500 PcdReportStatusCodeProperyMask is clear.\r
501\r
502**/\r
503BOOLEAN\r
504EFIAPI\r
505ReportProgressCodeEnabled (\r
506 VOID\r
507 )\r
508{\r
509 return (BOOLEAN) ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED) != 0);\r
510}\r
511\r
512\r
513/**\r
514 Returns TRUE if status codes of type EFI_ERROR_CODE are enabled\r
515\r
516 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED\r
517 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.\r
518\r
519 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of\r
520 PcdReportStatusCodeProperyMask is set.\r
521 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of\r
522 PcdReportStatusCodeProperyMask is clear.\r
523\r
524**/\r
525BOOLEAN\r
526EFIAPI\r
527ReportErrorCodeEnabled (\r
528 VOID\r
529 )\r
530{\r
531 return (BOOLEAN) ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED) != 0);\r
532}\r
533\r
534\r
535/**\r
536 Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled\r
537\r
538 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED\r
539 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.\r
540\r
541 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of\r
542 PcdReportStatusCodeProperyMask is set.\r
543 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of\r
544 PcdReportStatusCodeProperyMask is clear.\r
545\r
546**/\r
547BOOLEAN\r
548EFIAPI\r
549ReportDebugCodeEnabled (\r
550 VOID\r
551 )\r
552{\r
553 return (BOOLEAN) ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED) != 0);\r
554}\r