]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c
MdeModulePkg: Apply uncrustify changes
[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 //
95 // If mReportStatusCodeLibStatusCodeProtocol is NULL, then check if Report Status Code Protocol is available in system.
96 //
97 InternalGetReportStatusCode ();
98 if (mReportStatusCodeLibStatusCodeProtocol == NULL) {
99 return EFI_UNSUPPORTED;
100 }
101
102 //
103 // A Report Status Code Protocol is present in system, so pass in all the parameters to the service.
104 //
105 return mReportStatusCodeLibStatusCodeProtocol->ReportStatusCode (Type, Value, Instance, (EFI_GUID *)CallerId, Data);
106 }
107
108 return EFI_UNSUPPORTED;
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 {
151 *PostCode = (UINT8)((((Value & EFI_STATUS_CODE_CLASS_MASK) >> 24) << 5) |
152 (((Value & EFI_STATUS_CODE_SUBCLASS_MASK) >> 16) & 0x1f));
153 return TRUE;
154 }
155
156 return FALSE;
157 }
158
159 /**
160 Extracts ASSERT() information from a status code structure.
161
162 Converts the status code specified by CodeType, Value, and Data to the ASSERT()
163 arguments specified by Filename, Description, and LineNumber. If CodeType is
164 an EFI_ERROR_CODE, and CodeType has a severity of EFI_ERROR_UNRECOVERED, and
165 Value has an operation mask of EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, extract
166 Filename, Description, and LineNumber from the optional data area of the
167 status code buffer specified by Data. The optional data area of Data contains
168 a Null-terminated ASCII string for the FileName, followed by a Null-terminated
169 ASCII string for the Description, followed by a 32-bit LineNumber. If the
170 ASSERT() information could be extracted from Data, then return TRUE.
171 Otherwise, FALSE is returned.
172
173 If Data is NULL, then ASSERT().
174 If Filename is NULL, then ASSERT().
175 If Description is NULL, then ASSERT().
176 If LineNumber is NULL, then ASSERT().
177
178 @param CodeType The type of status code being converted.
179 @param Value The status code value being converted.
180 @param Data Pointer to status code data buffer.
181 @param Filename Pointer to the source file name that generated the ASSERT().
182 @param Description Pointer to the description of the ASSERT().
183 @param LineNumber Pointer to source line number that generated the ASSERT().
184
185 @retval TRUE The status code specified by CodeType, Value, and Data was
186 converted ASSERT() arguments specified by Filename, Description,
187 and LineNumber.
188 @retval FALSE The status code specified by CodeType, Value, and Data could
189 not be converted to ASSERT() arguments.
190
191 **/
192 BOOLEAN
193 EFIAPI
194 ReportStatusCodeExtractAssertInfo (
195 IN EFI_STATUS_CODE_TYPE CodeType,
196 IN EFI_STATUS_CODE_VALUE Value,
197 IN CONST EFI_STATUS_CODE_DATA *Data,
198 OUT CHAR8 **Filename,
199 OUT CHAR8 **Description,
200 OUT UINT32 *LineNumber
201 )
202 {
203 EFI_DEBUG_ASSERT_DATA *AssertData;
204
205 ASSERT (Data != NULL);
206 ASSERT (Filename != NULL);
207 ASSERT (Description != NULL);
208 ASSERT (LineNumber != NULL);
209
210 if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) &&
211 ((CodeType & EFI_STATUS_CODE_SEVERITY_MASK) == EFI_ERROR_UNRECOVERED) &&
212 ((Value & EFI_STATUS_CODE_OPERATION_MASK) == EFI_SW_EC_ILLEGAL_SOFTWARE_STATE))
213 {
214 AssertData = (EFI_DEBUG_ASSERT_DATA *)(Data + 1);
215 *Filename = (CHAR8 *)(AssertData + 1);
216 *Description = *Filename + AsciiStrLen (*Filename) + 1;
217 *LineNumber = AssertData->LineNumber;
218 return TRUE;
219 }
220
221 return FALSE;
222 }
223
224 /**
225 Extracts DEBUG() information from a status code structure.
226
227 Converts the status code specified by Data to the DEBUG() arguments specified
228 by ErrorLevel, Marker, and Format. If type GUID in Data is
229 EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID, then extract ErrorLevel, Marker, and
230 Format from the optional data area of the status code buffer specified by Data.
231 The optional data area of Data contains a 32-bit ErrorLevel followed by Marker
232 which is 12 UINTN parameters, followed by a Null-terminated ASCII string for
233 the Format. If the DEBUG() information could be extracted from Data, then
234 return TRUE. Otherwise, FALSE is returned.
235
236 If Data is NULL, then ASSERT().
237 If ErrorLevel is NULL, then ASSERT().
238 If Marker is NULL, then ASSERT().
239 If Format is NULL, then ASSERT().
240
241 @param Data Pointer to status code data buffer.
242 @param ErrorLevel Pointer to error level mask for a debug message.
243 @param Marker Pointer to the variable argument list associated with Format.
244 @param Format Pointer to a Null-terminated ASCII format string of a
245 debug message.
246
247 @retval TRUE The status code specified by Data was converted DEBUG() arguments
248 specified by ErrorLevel, Marker, and Format.
249 @retval FALSE The status code specified by Data could not be converted to
250 DEBUG() arguments.
251
252 **/
253 BOOLEAN
254 EFIAPI
255 ReportStatusCodeExtractDebugInfo (
256 IN CONST EFI_STATUS_CODE_DATA *Data,
257 OUT UINT32 *ErrorLevel,
258 OUT BASE_LIST *Marker,
259 OUT CHAR8 **Format
260 )
261 {
262 EFI_DEBUG_INFO *DebugInfo;
263
264 ASSERT (Data != NULL);
265 ASSERT (ErrorLevel != NULL);
266 ASSERT (Marker != NULL);
267 ASSERT (Format != NULL);
268
269 //
270 // If the GUID type is not EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID then return FALSE
271 //
272 if (!CompareGuid (&Data->Type, &gEfiStatusCodeDataTypeDebugGuid)) {
273 return FALSE;
274 }
275
276 //
277 // Retrieve the debug information from the status code record
278 //
279 DebugInfo = (EFI_DEBUG_INFO *)(Data + 1);
280
281 *ErrorLevel = DebugInfo->ErrorLevel;
282
283 //
284 // The first 12 * sizeof (UINT64) bytes following EFI_DEBUG_INFO are for variable arguments
285 // of format in DEBUG string. Its address is returned in Marker and has to be 64-bit aligned.
286 // It must be noticed that EFI_DEBUG_INFO follows EFI_STATUS_CODE_DATA, whose size is
287 // 20 bytes. The size of EFI_DEBUG_INFO is 4 bytes, so we can ensure that Marker
288 // returned is 64-bit aligned.
289 // 64-bit aligned is a must, otherwise retrieving 64-bit parameter from BASE_LIST will
290 // cause unalignment exception.
291 //
292 *Marker = (BASE_LIST)(DebugInfo + 1);
293 *Format = (CHAR8 *)(((UINT64 *)*Marker) + 12);
294
295 return TRUE;
296 }
297
298 /**
299 Reports a status code.
300
301 Reports the status code specified by the parameters Type and Value. Status
302 code also require an instance, caller ID, and extended data. This function
303 passed in a zero instance, NULL extended data, and a caller ID of
304 gEfiCallerIdGuid, which is the GUID for the module.
305
306 ReportStatusCode()must actively prevent recusrsion. If ReportStatusCode()
307 is called while processing another any other Report Status Code Library function,
308 then ReportStatusCode() must return immediately.
309
310 @param Type Status code type.
311 @param Value Status code value.
312
313 @retval EFI_SUCCESS The status code was reported.
314 @retval EFI_DEVICE_ERROR There status code could not be reported due to a
315 device error.
316 @retval EFI_UNSUPPORTED Report status code is not supported
317
318 **/
319 EFI_STATUS
320 EFIAPI
321 ReportStatusCode (
322 IN EFI_STATUS_CODE_TYPE Type,
323 IN EFI_STATUS_CODE_VALUE Value
324 )
325 {
326 return InternalReportStatusCode (Type, Value, 0, &gEfiCallerIdGuid, NULL);
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 Reports a status code with an extended data buffer.
376
377 Allocates and fills in the extended data section of a status code with the
378 extended data specified by ExtendedData and ExtendedDataSize. ExtendedData
379 is assumed to be one of the data structures specified in Related Definitions.
380 These data structure do not have the standard header, so this function is
381 responsible for allocating a buffer large enough for the standard header and
382 the extended data passed into this function. The standard header is filled
383 in with a GUID of gEfiStatusCodeSpecificDataGuid. The status code is reported
384 with a zero instance and a caller ID of gEfiCallerIdGuid.
385
386 ReportStatusCodeWithExtendedData()must actively prevent recursion. If
387 ReportStatusCodeWithExtendedData() is called while processing another any other
388 Report Status Code Library function, then ReportStatusCodeWithExtendedData()
389 must return EFI_DEVICE_ERROR immediately.
390
391 If ExtendedData is NULL, then ASSERT().
392 If ExtendedDataSize is 0, then ASSERT().
393
394 @param Type Status code type.
395 @param Value Status code value.
396 @param ExtendedData Pointer to the extended data buffer to be reported.
397 @param ExtendedDataSize The size, in bytes, of the extended data buffer to
398 be reported.
399
400 @retval EFI_SUCCESS The status code was reported with the extended
401 data specified by ExtendedData and ExtendedDataSize.
402 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
403 extended data section.
404 @retval EFI_UNSUPPORTED Report status code is not supported
405
406 **/
407 EFI_STATUS
408 EFIAPI
409 ReportStatusCodeWithExtendedData (
410 IN EFI_STATUS_CODE_TYPE Type,
411 IN EFI_STATUS_CODE_VALUE Value,
412 IN CONST VOID *ExtendedData,
413 IN UINTN ExtendedDataSize
414 )
415 {
416 ASSERT (ExtendedData != NULL);
417 ASSERT (ExtendedDataSize != 0);
418 return ReportStatusCodeEx (
419 Type,
420 Value,
421 0,
422 NULL,
423 NULL,
424 ExtendedData,
425 ExtendedDataSize
426 );
427 }
428
429 /**
430 Reports a status code with full parameters.
431
432 The function reports a status code. If ExtendedData is NULL and ExtendedDataSize
433 is 0, then an extended data buffer is not reported. If ExtendedData is not
434 NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.
435 ExtendedData is assumed not have the standard status code header, so this function
436 is responsible for allocating a buffer large enough for the standard header and
437 the extended data passed into this function. The standard header is filled in
438 with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a
439 GUID of gEfiStatusCodeSpecificDataGuid is used. The status code is reported with
440 an instance specified by Instance and a caller ID specified by CallerId. If
441 CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.
442
443 ReportStatusCodeEx()must actively prevent recursion. If
444 ReportStatusCodeEx() is called while processing another any
445 other Report Status Code Library function, then
446 ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.
447
448 If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().
449 If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().
450
451 @param Type Status code type.
452 @param Value Status code value.
453 @param Instance Status code instance number.
454 @param CallerId Pointer to a GUID that identifies the caller of this
455 function. If this parameter is NULL, then a caller
456 ID of gEfiCallerIdGuid is used.
457 @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.
458 If this parameter is NULL, then a the status code
459 standard header is filled in with
460 gEfiStatusCodeSpecificDataGuid.
461 @param ExtendedData Pointer to the extended data buffer. This is an
462 optional parameter that may be NULL.
463 @param ExtendedDataSize The size, in bytes, of the extended data buffer.
464
465 @retval EFI_SUCCESS The status code was reported.
466 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate
467 the extended data section if it was specified.
468 @retval EFI_UNSUPPORTED Report status code is not supported
469
470 **/
471 EFI_STATUS
472 EFIAPI
473 ReportStatusCodeEx (
474 IN EFI_STATUS_CODE_TYPE Type,
475 IN EFI_STATUS_CODE_VALUE Value,
476 IN UINT32 Instance,
477 IN CONST EFI_GUID *CallerId OPTIONAL,
478 IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL,
479 IN CONST VOID *ExtendedData OPTIONAL,
480 IN UINTN ExtendedDataSize
481 )
482 {
483 EFI_STATUS Status;
484 EFI_STATUS_CODE_DATA *StatusCodeData;
485 EFI_TPL Tpl;
486 UINT64 Buffer[(MAX_EXTENDED_DATA_SIZE / sizeof (UINT64)) + 1];
487
488 ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0)));
489 ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0)));
490
491 if (ExtendedDataSize <= (MAX_EXTENDED_DATA_SIZE - sizeof (EFI_STATUS_CODE_DATA))) {
492 //
493 // Use Buffer instead of allocating if possible.
494 //
495 StatusCodeData = (EFI_STATUS_CODE_DATA *)Buffer;
496 } else {
497 if ((gBS == NULL) || (gBS->AllocatePool == NULL) || (gBS->FreePool == NULL)) {
498 return EFI_UNSUPPORTED;
499 }
500
501 //
502 // Retrieve the current TPL
503 //
504 Tpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);
505 gBS->RestoreTPL (Tpl);
506
507 if (Tpl > TPL_NOTIFY) {
508 return EFI_OUT_OF_RESOURCES;
509 }
510
511 //
512 // Allocate space for the Status Code Header and its buffer
513 //
514 StatusCodeData = NULL;
515 gBS->AllocatePool (EfiBootServicesData, sizeof (EFI_STATUS_CODE_DATA) + ExtendedDataSize, (VOID **)&StatusCodeData);
516 if (StatusCodeData == NULL) {
517 return EFI_OUT_OF_RESOURCES;
518 }
519 }
520
521 //
522 // Fill in the extended data header
523 //
524 StatusCodeData->HeaderSize = (UINT16)sizeof (EFI_STATUS_CODE_DATA);
525 StatusCodeData->Size = (UINT16)ExtendedDataSize;
526 if (ExtendedDataGuid == NULL) {
527 ExtendedDataGuid = &gEfiStatusCodeSpecificDataGuid;
528 }
529
530 CopyGuid (&StatusCodeData->Type, ExtendedDataGuid);
531
532 //
533 // Fill in the extended data buffer
534 //
535 if (ExtendedData != NULL) {
536 CopyMem (StatusCodeData + 1, ExtendedData, ExtendedDataSize);
537 }
538
539 //
540 // Report the status code
541 //
542 if (CallerId == NULL) {
543 CallerId = &gEfiCallerIdGuid;
544 }
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 Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled
560
561 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED
562 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
563
564 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
565 PcdReportStatusCodeProperyMask is set.
566 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
567 PcdReportStatusCodeProperyMask is clear.
568
569 **/
570 BOOLEAN
571 EFIAPI
572 ReportProgressCodeEnabled (
573 VOID
574 )
575 {
576 return (BOOLEAN)((PcdGet8 (PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED) != 0);
577 }
578
579 /**
580 Returns TRUE if status codes of type EFI_ERROR_CODE are enabled
581
582 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED
583 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
584
585 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
586 PcdReportStatusCodeProperyMask is set.
587 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
588 PcdReportStatusCodeProperyMask is clear.
589
590 **/
591 BOOLEAN
592 EFIAPI
593 ReportErrorCodeEnabled (
594 VOID
595 )
596 {
597 return (BOOLEAN)((PcdGet8 (PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED) != 0);
598 }
599
600 /**
601 Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled
602
603 This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED
604 bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
605
606 @retval TRUE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
607 PcdReportStatusCodeProperyMask is set.
608 @retval FALSE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
609 PcdReportStatusCodeProperyMask is clear.
610
611 **/
612 BOOLEAN
613 EFIAPI
614 ReportDebugCodeEnabled (
615 VOID
616 )
617 {
618 return (BOOLEAN)((PcdGet8 (PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED) != 0);
619 }