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