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