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