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