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