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