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