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