]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c
Reviewed the code comments in the Include/Protocol directory for typos, grammar issue...
[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
262 //\r
263 // The first 12 * UINTN bytes of the string are really an\r
264 // argument stack to support varargs on the Format string.\r
265 //\r
ca9938b8 266 *Marker = (BASE_LIST) (DebugInfo + 1);\r
2287f237 267 *Format = (CHAR8 *)(((UINT64 *)*Marker) + 12);\r
268\r
269 return TRUE;\r
270}\r
271\r
272\r
273/**\r
274 Reports a status code.\r
275\r
276 Reports the status code specified by the parameters Type and Value. Status\r
277 code also require an instance, caller ID, and extended data. This function\r
278 passed in a zero instance, NULL extended data, and a caller ID of\r
279 gEfiCallerIdGuid, which is the GUID for the module.\r
280\r
281 ReportStatusCode()must actively prevent recusrsion. If ReportStatusCode()\r
282 is called while processing another any other Report Status Code Library function,\r
283 then ReportStatusCode() must return immediately.\r
284\r
285 @param Type Status code type.\r
286 @param Value Status code value.\r
287\r
288 @retval EFI_SUCCESS The status code was reported.\r
289 @retval EFI_DEVICE_ERROR There status code could not be reported due to a\r
290 device error.\r
291 @retval EFI_UNSUPPORTED Report status code is not supported\r
292\r
293**/\r
294EFI_STATUS\r
295EFIAPI\r
296ReportStatusCode (\r
297 IN EFI_STATUS_CODE_TYPE Type,\r
298 IN EFI_STATUS_CODE_VALUE Value\r
299 )\r
300{\r
301 return InternalReportStatusCode (Type, Value, 0, &gEfiCallerIdGuid, NULL);\r
302}\r
303\r
304\r
305/**\r
306 Reports a status code with a Device Path Protocol as the extended data.\r
307\r
308 Allocates and fills in the extended data section of a status code with the\r
309 Device Path Protocol specified by DevicePath. This function is responsible\r
310 for allocating a buffer large enough for the standard header and the device\r
311 path. The standard header is filled in with a GUID of\r
312 gEfiStatusCodeSpecificDataGuid. The status code is reported with a zero\r
313 instance and a caller ID of gEfiCallerIdGuid.\r
314\r
315 ReportStatusCodeWithDevicePath()must actively prevent recursion. If\r
316 ReportStatusCodeWithDevicePath() is called while processing another any other\r
317 Report Status Code Library function, then ReportStatusCodeWithDevicePath()\r
318 must return EFI_DEVICE_ERROR immediately.\r
319\r
320 If DevicePath is NULL, then ASSERT().\r
321\r
322 @param Type Status code type.\r
323 @param Value Status code value.\r
324 @param DevicePath Pointer to the Device Path Protocol to be reported.\r
325\r
326 @retval EFI_SUCCESS The status code was reported with the extended\r
327 data specified by DevicePath.\r
328 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the\r
329 extended data section.\r
330 @retval EFI_UNSUPPORTED Report status code is not supported\r
331\r
332**/\r
333EFI_STATUS\r
334EFIAPI\r
335ReportStatusCodeWithDevicePath (\r
336 IN EFI_STATUS_CODE_TYPE Type,\r
337 IN EFI_STATUS_CODE_VALUE Value,\r
338 IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
339 )\r
340{\r
341 ASSERT (DevicePath != NULL);\r
0ad78d07 342 //\r
343 // EFI_UNSUPPORTED is returned for device path is not supported in PEI phase.\r
344 //\r
2287f237 345 return EFI_UNSUPPORTED;\r
346}\r
347\r
348\r
349/**\r
350 Reports a status code with an extended data buffer.\r
351\r
352 Allocates and fills in the extended data section of a status code with the\r
353 extended data specified by ExtendedData and ExtendedDataSize. ExtendedData\r
354 is assumed to be one of the data structures specified in Related Definitions.\r
355 These data structure do not have the standard header, so this function is\r
356 responsible for allocating a buffer large enough for the standard header and\r
357 the extended data passed into this function. The standard header is filled\r
358 in with a GUID of gEfiStatusCodeSpecificDataGuid. The status code is reported\r
359 with a zero instance and a caller ID of gEfiCallerIdGuid.\r
360\r
361 ReportStatusCodeWithExtendedData()must actively prevent recursion. If\r
362 ReportStatusCodeWithExtendedData() is called while processing another any other\r
363 Report Status Code Library function, then ReportStatusCodeWithExtendedData()\r
364 must return EFI_DEVICE_ERROR immediately.\r
365\r
366 If ExtendedData is NULL, then ASSERT().\r
367 If ExtendedDataSize is 0, then ASSERT().\r
368\r
369 @param Type Status code type.\r
370 @param Value Status code value.\r
371 @param ExtendedData Pointer to the extended data buffer to be reported.\r
372 @param ExtendedDataSize The size, in bytes, of the extended data buffer to\r
373 be reported.\r
374\r
375 @retval EFI_SUCCESS The status code was reported with the extended\r
376 data specified by ExtendedData and ExtendedDataSize.\r
377 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the\r
378 extended data section.\r
379 @retval EFI_UNSUPPORTED Report status code is not supported\r
380\r
381**/\r
382EFI_STATUS\r
383EFIAPI\r
384ReportStatusCodeWithExtendedData (\r
385 IN EFI_STATUS_CODE_TYPE Type,\r
386 IN EFI_STATUS_CODE_VALUE Value,\r
387 IN CONST VOID *ExtendedData,\r
388 IN UINTN ExtendedDataSize\r
389 )\r
390{\r
391 ASSERT (ExtendedData != NULL);\r
392 ASSERT (ExtendedDataSize != 0);\r
393 return ReportStatusCodeEx (\r
394 Type,\r
395 Value,\r
396 0,\r
397 NULL,\r
398 NULL,\r
399 ExtendedData,\r
400 ExtendedDataSize\r
401 );\r
402}\r
403\r
404\r
405/**\r
406 Reports a status code with full parameters.\r
407\r
408 The function reports a status code. If ExtendedData is NULL and ExtendedDataSize\r
409 is 0, then an extended data buffer is not reported. If ExtendedData is not\r
410 NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.\r
411 ExtendedData is assumed not have the standard status code header, so this function\r
412 is responsible for allocating a buffer large enough for the standard header and\r
413 the extended data passed into this function. The standard header is filled in\r
414 with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a\r
415 GUID of gEfiStatusCodeSpecificDatauid is used. The status code is reported with\r
416 an instance specified by Instance and a caller ID specified by CallerId. If\r
417 CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.\r
418\r
419 ReportStatusCodeEx()must actively prevent recursion. If ReportStatusCodeEx()\r
420 is called while processing another any other Report Status Code Library function,\r
421 then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.\r
422\r
423 If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().\r
424 If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().\r
425\r
426 @param Type Status code type.\r
427 @param Value Status code value.\r
428 @param Instance Status code instance number.\r
429 @param CallerId Pointer to a GUID that identifies the caller of this\r
430 function. If this parameter is NULL, then a caller\r
431 ID of gEfiCallerIdGuid is used.\r
432 @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.\r
433 If this parameter is NULL, then a the status code\r
434 standard header is filled in with\r
435 gEfiStatusCodeSpecificDataGuid.\r
436 @param ExtendedData Pointer to the extended data buffer. This is an\r
437 optional parameter that may be NULL.\r
438 @param ExtendedDataSize The size, in bytes, of the extended data buffer.\r
439\r
440 @retval EFI_SUCCESS The status code was reported.\r
441 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate\r
442 the extended data section if it was specified.\r
443 @retval EFI_UNSUPPORTED Report status code is not supported\r
444\r
445**/\r
446EFI_STATUS\r
447EFIAPI\r
448ReportStatusCodeEx (\r
449 IN EFI_STATUS_CODE_TYPE Type,\r
450 IN EFI_STATUS_CODE_VALUE Value,\r
451 IN UINT32 Instance,\r
452 IN CONST EFI_GUID *CallerId OPTIONAL,\r
453 IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL,\r
454 IN CONST VOID *ExtendedData OPTIONAL,\r
455 IN UINTN ExtendedDataSize\r
456 )\r
457{\r
458 EFI_STATUS_CODE_DATA *StatusCodeData;\r
459 UINT64 Buffer[MAX_EXTENDED_DATA_SIZE / sizeof (UINT64)];\r
460\r
0ad78d07 461 //\r
462 // If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().\r
463 //\r
2287f237 464 ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0)));\r
0ad78d07 465 //\r
466 // If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().\r
467 //\r
2287f237 468 ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0)));\r
469\r
470 if (ExtendedDataSize > (MAX_EXTENDED_DATA_SIZE - sizeof (EFI_STATUS_CODE_DATA))) {\r
471 return EFI_OUT_OF_RESOURCES;\r
472 }\r
473 StatusCodeData = (EFI_STATUS_CODE_DATA *)Buffer;\r
474 StatusCodeData->HeaderSize = sizeof (EFI_STATUS_CODE_DATA);\r
475 StatusCodeData->Size = (UINT16)ExtendedDataSize;\r
476 if (ExtendedDataGuid == NULL) {\r
477 ExtendedDataGuid = &gEfiStatusCodeSpecificDataGuid;\r
478 }\r
479 CopyGuid (&StatusCodeData->Type, ExtendedDataGuid);\r
261136bc 480 if (ExtendedData != NULL) {\r
481 CopyMem (StatusCodeData + 1, ExtendedData, ExtendedDataSize);\r
482 }\r
2287f237 483 if (CallerId == NULL) {\r
484 CallerId = &gEfiCallerIdGuid;\r
485 }\r
486 return InternalReportStatusCode (Type, Value, Instance, CallerId, StatusCodeData);\r
487}\r
488\r
489\r
490/**\r
491 Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled\r
492\r
493 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED\r
494 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.\r
495\r
496 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of\r
497 PcdReportStatusCodeProperyMask is set.\r
498 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of\r
499 PcdReportStatusCodeProperyMask is clear.\r
500\r
501**/\r
502BOOLEAN\r
503EFIAPI\r
504ReportProgressCodeEnabled (\r
505 VOID\r
506 )\r
507{\r
0ad78d07 508 return (BOOLEAN) ((PcdGet8 (PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED) != 0);\r
2287f237 509}\r
510\r
511\r
512/**\r
513 Returns TRUE if status codes of type EFI_ERROR_CODE are enabled\r
514\r
515 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED\r
516 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.\r
517\r
518 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of\r
519 PcdReportStatusCodeProperyMask is set.\r
520 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of\r
521 PcdReportStatusCodeProperyMask is clear.\r
522\r
523**/\r
524BOOLEAN\r
525EFIAPI\r
526ReportErrorCodeEnabled (\r
527 VOID\r
528 )\r
529{\r
0ad78d07 530 return (BOOLEAN) ((PcdGet8 (PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED) != 0);\r
2287f237 531}\r
532\r
533\r
534/**\r
535 Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled\r
536\r
537 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED\r
538 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.\r
539\r
540 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of\r
541 PcdReportStatusCodeProperyMask is set.\r
542 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of\r
543 PcdReportStatusCodeProperyMask is clear.\r
544\r
545**/\r
546BOOLEAN\r
547EFIAPI\r
548ReportDebugCodeEnabled (\r
549 VOID\r
550 )\r
551{\r
0ad78d07 552 return (BOOLEAN) ((PcdGet8 (PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED) != 0);\r
2287f237 553}\r