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