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