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