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