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