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