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