]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Code scrub for DxeReportStatusCodeLib.
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 11 Jun 2009 07:22:06 +0000 (07:22 +0000)
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 11 Jun 2009 07:22:06 +0000 (07:22 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8528 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeSupport.c [deleted file]
IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLib.c
IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h [deleted file]

index 773db9b7230d80cc0bc45e932429cc37b4678de0..7a92877c0712a0da415a508272934c401042a16a 100644 (file)
@@ -21,7 +21,6 @@
   MODULE_TYPE                    = DXE_DRIVER\r
   VERSION_STRING                 = 1.0\r
   LIBRARY_CLASS                  = ReportStatusCodeLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER\r
-  EFI_SPECIFICATION_VERSION      = 0x00020000\r
 \r
 #\r
 # The following information is for reference only and not required by the build tools.\r
@@ -31,9 +30,6 @@
 \r
 [Sources.common]\r
   ReportStatusCodeLib.c\r
-  DxeSupport.c\r
-\r
-\r
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
 [LibraryClasses]\r
   PcdLib\r
   BaseMemoryLib\r
-  BaseLib\r
+  MemoryAllocationLib\r
   UefiBootServicesTableLib\r
   DebugLib\r
   UefiRuntimeServicesTableLib\r
   DevicePathLib\r
 \r
 [Guids]\r
-  gEfiStatusCodeSpecificDataGuid                # ALWAYS_CONSUMED\r
-  gEfiStatusCodeDataTypeDebugGuid               # ALWAYS_CONSUMED\r
-\r
+  gEfiStatusCodeSpecificDataGuid                ## CONSUMES\r
+  gEfiStatusCodeDataTypeDebugGuid               ## CONSUMES\r
 \r
 [Protocols]\r
-  gEfiStatusCodeRuntimeProtocolGuid             # PROTOCOL ALWAYS_CONSUMED\r
-\r
+  gEfiStatusCodeRuntimeProtocolGuid             ## SOMETIMES_CONSUMES (Used if revision of the EFI Specification is not less than 0x20000)\r
 \r
 [Pcd.common]\r
   gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask\r
diff --git a/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeSupport.c b/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeSupport.c
deleted file mode 100644 (file)
index bfa5e51..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/** @file\r
-  Report Status Code Library for DXE Phase.\r
-\r
-  Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "ReportStatusCodeLibInternal.h"\r
-\r
-/**\r
-  Locate he report status code service.\r
-\r
-  @return     EFI_REPORT_STATUS_CODE    function point to\r
-              ReportStatusCode.\r
-**/\r
-EFI_REPORT_STATUS_CODE\r
-InternalGetReportStatusCode (\r
-  VOID\r
-  )\r
-{\r
-  EFI_STATUS_CODE_PROTOCOL  *StatusCodeProtocol;\r
-  EFI_STATUS                Status;\r
-\r
-  if (gRT->Hdr.Revision < 0x20000) {\r
-    return ((FRAMEWORK_EFI_RUNTIME_SERVICES*)gRT)->ReportStatusCode;\r
-  } else if (gBS != NULL && gBS->LocateProtocol != NULL) {\r
-    Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID**)&StatusCodeProtocol);\r
-    if (!EFI_ERROR (Status) && StatusCodeProtocol != NULL) {\r
-      return StatusCodeProtocol->ReportStatusCode;\r
-    }\r
-  }\r
-\r
-  return NULL;\r
-}\r
-\r
-/**\r
-  Reports a status code with full parameters.\r
-\r
-  The function reports a status code.  If ExtendedData is NULL and ExtendedDataSize\r
-  is 0, then an extended data buffer is not reported.  If ExtendedData is not\r
-  NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.\r
-  ExtendedData is assumed not have the standard status code header, so this function\r
-  is responsible for allocating a buffer large enough for the standard header and\r
-  the extended data passed into this function.  The standard header is filled in\r
-  with a GUID specified by ExtendedDataGuid.  If ExtendedDataGuid is NULL, then a\r
-  GUID of gEfiStatusCodeSpecificDatauid is used.  The status code is reported with\r
-  an instance specified by Instance and a caller ID specified by CallerId.  If\r
-  CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.\r
-\r
-  ReportStatusCodeEx()must actively prevent recursion.  If ReportStatusCodeEx()\r
-  is called while processing another any other Report Status Code Library function,\r
-  then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.\r
-\r
-  If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().\r
-  If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().\r
-\r
-  @param  Type              Status code type.\r
-  @param  Value             Status code value.\r
-  @param  Instance          Status code instance number.\r
-  @param  CallerId          Pointer to a GUID that identifies the caller of this\r
-                            function.  If this parameter is NULL, then a caller\r
-                            ID of gEfiCallerIdGuid is used.\r
-  @param  ExtendedDataGuid  Pointer to the GUID for the extended data buffer.\r
-                            If this parameter is NULL, then a the status code\r
-                            standard header is filled in with\r
-                            gEfiStatusCodeSpecificDataGuid.\r
-  @param  ExtendedData      Pointer to the extended data buffer.  This is an\r
-                            optional parameter that may be NULL.\r
-  @param  ExtendedDataSize  The size, in bytes, of the extended data buffer.\r
-\r
-  @retval  EFI_SUCCESS           The status code was reported.\r
-  @retval  EFI_OUT_OF_RESOURCES  There were not enough resources to allocate\r
-                                 the extended data section if it was specified.\r
-  @retval  EFI_UNSUPPORTED       Report status code is not supported\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-InternalReportStatusCodeEx (\r
-  IN EFI_STATUS_CODE_TYPE   Type,\r
-  IN EFI_STATUS_CODE_VALUE  Value,\r
-  IN UINT32                 Instance,\r
-  IN CONST EFI_GUID         *CallerId          OPTIONAL,\r
-  IN CONST EFI_GUID         *ExtendedDataGuid  OPTIONAL,\r
-  IN CONST VOID             *ExtendedData      OPTIONAL,\r
-  IN UINTN                  ExtendedDataSize\r
-  )\r
-{\r
-  EFI_STATUS            Status;\r
-  EFI_STATUS_CODE_DATA  *StatusCodeData;\r
-\r
-  ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0)));\r
-  ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0)));\r
-\r
-  if (gBS == NULL || gBS->AllocatePool == NULL || gBS->FreePool == NULL) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  //\r
-  // Allocate space for the Status Code Header and its buffer\r
-  //\r
-  StatusCodeData = NULL;\r
-  gBS->AllocatePool (EfiBootServicesData, sizeof (EFI_STATUS_CODE_DATA) + ExtendedDataSize, (VOID **)&StatusCodeData);\r
-  if (StatusCodeData == NULL) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-\r
-  //\r
-  // Fill in the extended data header\r
-  //\r
-  StatusCodeData->HeaderSize = sizeof (EFI_STATUS_CODE_DATA);\r
-  StatusCodeData->Size = (UINT16)ExtendedDataSize;\r
-  if (ExtendedDataGuid == NULL) {\r
-    ExtendedDataGuid = &gEfiStatusCodeSpecificDataGuid;\r
-  }\r
-  CopyGuid (&StatusCodeData->Type, ExtendedDataGuid);\r
-\r
-  //\r
-  // Fill in the extended data buffer\r
-  //\r
-  if (ExtendedData != NULL) {\r
-    CopyMem (StatusCodeData + 1, ExtendedData, ExtendedDataSize);\r
-  }\r
-\r
-  //\r
-  // Report the status code\r
-  //\r
-  if (CallerId == NULL) {\r
-    CallerId = &gEfiCallerIdGuid;\r
-  }\r
-  Status = InternalReportStatusCode (Type, Value, Instance, CallerId, StatusCodeData);\r
-\r
-  //\r
-  // Free the allocated buffer\r
-  //\r
-  gBS->FreePool (StatusCodeData);\r
-\r
-  return Status;\r
-}\r
-\r
index 0dd2990e75175b6dffda871771ee7bacdbe71bce..941d01f92bdd55f8954adcd7fdf4eb6681152a0a 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Report Status Code Library for DXE Phase.\r
 \r
-  Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
+  Copyright (c) 2006 - 2009, Intel Corporation<BR>\r
   All rights reserved. This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
 \r
 **/\r
 \r
-#include "ReportStatusCodeLibInternal.h"\r
\r
+#include <FrameworkDxe.h>\r
+\r
+#include <Library/ReportStatusCodeLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/UefiRuntimeServicesTableLib.h>\r
+#include <Library/DevicePathLib.h>\r
+\r
+#include <Guid/StatusCodeDataTypeId.h>\r
+#include <Guid/StatusCodeDataTypeDebug.h>\r
+#include <Protocol/StatusCode.h>\r
+\r
 EFI_REPORT_STATUS_CODE  mReportStatusCode = NULL;\r
 \r
 /**\r
-  Internal worker function that reports a status code through the Status Code Protocol\r
+  Locate the report status code service.\r
+\r
+  @return   Function pointer to the report status code service.\r
+\r
+**/\r
+EFI_REPORT_STATUS_CODE\r
+InternalGetReportStatusCode (\r
+  VOID\r
+  )\r
+{\r
+  EFI_STATUS_CODE_PROTOCOL  *StatusCodeProtocol;\r
+  EFI_STATUS                Status;\r
+\r
+  if (gRT != NULL && gRT->Hdr.Revision < 0x20000) {\r
+    return ((FRAMEWORK_EFI_RUNTIME_SERVICES*)gRT)->ReportStatusCode;\r
+  } else if (gBS != NULL && gBS->LocateProtocol != NULL) {\r
+    Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID**)&StatusCodeProtocol);\r
+    if (!EFI_ERROR (Status) && StatusCodeProtocol != NULL) {\r
+      return StatusCodeProtocol->ReportStatusCode;\r
+    }\r
+  }\r
+\r
+  return NULL;\r
+}\r
+\r
+/**\r
+  Internal worker function that reports a status code through the status code service.\r
 \r
-  This function checks to see if a Status Code Protocol is present in the handle\r
-  database.  If a Status Code Protocol is not present, then EFI_UNSUPPORTED is\r
-  returned.  If a Status Code Protocol is present, then it is cached in gStatusCode,\r
-  and the ReportStatusCode() service of the Status Code Protocol is called passing in\r
-  Type, Value, Instance, CallerId, and Data.  The result of this call is returned.\r
+  If status code service is not cached, then this function checks if status code service is\r
+  available in system.  If status code service is not available, then EFI_UNSUPPORTED is\r
+  returned.  If status code service is present, then it is cached in mReportStatusCode.\r
+  Finally this function reports status code through the status code service.\r
 \r
   @param  Type              Status code type.\r
   @param  Value             Status code value.\r
@@ -34,9 +73,9 @@ EFI_REPORT_STATUS_CODE  mReportStatusCode = NULL;
   @param  Data              Pointer to the extended data buffer.  This is an\r
                             optional parameter that may be NULL.\r
 \r
-  @retval  EFI_SUCCESS           The status code was reported.\r
-  @retval  EFI_OUT_OF_RESOURCES  There were not enough resources to report the status code.\r
-  @retval  EFI_UNSUPPORTED       Status Code Protocol is not available.\r
+  @retval EFI_SUCCESS       The status code was reported.\r
+  @retval EFI_UNSUPPORTED   Status code service is not available.\r
+  @retval EFI_UNSUPPORTED   Status code type is not supported.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -49,11 +88,10 @@ InternalReportStatusCode (
   )\r
 {\r
   if ((ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ||\r
-    (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ||\r
-    (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE)) {\r
+      (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ||\r
+      (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE)) {\r
     //\r
-    // If gStatusCode is NULL, then see if a Status Code Protocol instance is present\r
-    // in the handle database.\r
+    // If mReportStatusCode is NULL, then check if status code service is available in system.\r
     //\r
     if (mReportStatusCode == NULL) {\r
       mReportStatusCode = InternalGetReportStatusCode ();\r
@@ -63,8 +101,7 @@ InternalReportStatusCode (
     }\r
   \r
     //\r
-    // A Status Code Protocol is present in the handle database, so pass in all the\r
-    // parameters to the ReportStatusCode() service of the Status Code Protocol\r
+    // A status code service is present in system, so pass in all the parameters to the service.\r
     //\r
     return (*mReportStatusCode) (Type, Value, Instance, (EFI_GUID *)CallerId, Data);\r
   }\r
@@ -73,36 +110,6 @@ InternalReportStatusCode (
 }\r
 \r
 \r
-/**\r
-  Computes and returns the size, in bytes, of a device path.\r
-\r
-  @param  DevicePath  A pointer to a device path.\r
-\r
-  @return  The size, in bytes, of DevicePath.\r
-\r
-**/\r
-UINTN\r
-InternalReportStatusCodeDevicePathSize (\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
-  )\r
-{\r
-  CONST EFI_DEVICE_PATH_PROTOCOL  *Start;\r
-\r
-  //\r
-  // Search for the end of the device path structure\r
-  //\r
-  Start = DevicePath;\r
-  while (!IsDevicePathEnd (DevicePath)) {\r
-    DevicePath = NextDevicePathNode (DevicePath);\r
-  }\r
-\r
-  //\r
-  // Subtract the start node from the end node and add in the size of the end node\r
-  //\r
-  return ((UINTN) DevicePath - (UINTN) Start) + DevicePathNodeLength (DevicePath);\r
-}\r
-\r
-\r
 /**\r
   Converts a status code to an 8-bit POST code value.\r
 \r
@@ -273,11 +280,19 @@ ReportStatusCodeExtractDebugInfo (
 \r
   *ErrorLevel = DebugInfo->ErrorLevel;\r
 \r
+  //\r
+  // Here the address returned in Marker is 64-bit aligned.\r
+  // It must be noticed that EFI_DEBUG_INFO follows EFI_STATUS_CODE_DATA, whose size is\r
+  // 20 bytes. The size of EFI_DEBUG_INFO is 4 bytes, so we can ensure that Marker\r
+  // returned is 64-bit aligned.\r
+  // 64-bit aligned is a must, otherwise retrieving 64-bit parameter from BASE_LIST will\r
+  // cause unalignment exception.\r
+  //\r
+  *Marker = (BASE_LIST) (DebugInfo + 1);\r
   //\r
   // The first 12 * UINTN bytes of the string are really an\r
   // argument stack to support varargs on the Format string.\r
   //\r
-  *Marker = (BASE_LIST) (DebugInfo + 1);\r
   *Format = (CHAR8 *)(((UINT64 *)*Marker) + 12);\r
 \r
   return TRUE;\r
@@ -357,7 +372,7 @@ ReportStatusCodeWithDevicePath (
            Type,\r
            Value,\r
            (VOID *)DevicePath,\r
-           InternalReportStatusCodeDevicePathSize (DevicePath)\r
+           GetDevicePathSize (DevicePath)\r
            );\r
 }\r
 \r
@@ -472,17 +487,50 @@ ReportStatusCodeEx (
   IN UINTN                  ExtendedDataSize\r
   )\r
 {\r
-  EFI_STATUS  Status;\r
-\r
-  Status = InternalReportStatusCodeEx (\r
-             Type,\r
-             Value,\r
-             Instance,\r
-             CallerId,\r
-             ExtendedDataGuid,\r
-             ExtendedData,\r
-             ExtendedDataSize\r
-             );\r
+  EFI_STATUS            Status;\r
+  EFI_STATUS_CODE_DATA  *StatusCodeData;\r
+\r
+  ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0)));\r
+  ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0)));\r
+\r
+  //\r
+  // Allocate space for the Status Code Header and its buffer\r
+  //\r
+  StatusCodeData = NULL;\r
+  StatusCodeData = AllocatePool (sizeof (EFI_STATUS_CODE_DATA) + ExtendedDataSize);\r
+  if (StatusCodeData == NULL) {\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+\r
+  //\r
+  // Fill in the extended data header\r
+  //\r
+  StatusCodeData->HeaderSize = sizeof (EFI_STATUS_CODE_DATA);\r
+  StatusCodeData->Size = (UINT16)ExtendedDataSize;\r
+  if (ExtendedDataGuid == NULL) {\r
+    ExtendedDataGuid = &gEfiStatusCodeSpecificDataGuid;\r
+  }\r
+  CopyGuid (&StatusCodeData->Type, ExtendedDataGuid);\r
+\r
+  //\r
+  // Fill in the extended data buffer\r
+  //\r
+  if (ExtendedData != NULL) {\r
+    CopyMem (StatusCodeData + 1, ExtendedData, ExtendedDataSize);\r
+  }\r
+\r
+  //\r
+  // Report the status code\r
+  //\r
+  if (CallerId == NULL) {\r
+    CallerId = &gEfiCallerIdGuid;\r
+  }\r
+  Status = InternalReportStatusCode (Type, Value, Instance, CallerId, StatusCodeData);\r
+\r
+  //\r
+  // Free the allocated buffer\r
+  //\r
+  FreePool (StatusCodeData);\r
 \r
   return Status;\r
 }\r
@@ -506,7 +554,7 @@ ReportProgressCodeEnabled (
   VOID\r
   )\r
 {\r
-  return (BOOLEAN) ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED) != 0);\r
+  return (BOOLEAN) ((PcdGet8 (PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED) != 0);\r
 }\r
 \r
 \r
@@ -528,7 +576,7 @@ ReportErrorCodeEnabled (
   VOID\r
   )\r
 {\r
-  return (BOOLEAN) ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED) != 0);\r
+  return (BOOLEAN) ((PcdGet8 (PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED) != 0);\r
 }\r
 \r
 \r
@@ -550,5 +598,5 @@ ReportDebugCodeEnabled (
   VOID\r
   )\r
 {\r
-  return (BOOLEAN) ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED) != 0);\r
+  return (BOOLEAN) ((PcdGet8 (PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED) != 0);\r
 }\r
diff --git a/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h b/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h
deleted file mode 100644 (file)
index f5d9da3..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/** @file\r
-  Internal Header file of Report Status Code Library for RUNTIME\r
-  DXE Phase.\r
-\r
-  Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-#ifndef __REPORT_STATUS_CODE_LIB_INTERNAL__H\r
-#define __REPORT_STATUS_CODE_LIB_INTERNAL__H\r
-\r
-#include <FrameworkDxe.h>\r
-\r
-#include <Library/ReportStatusCodeLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/UefiRuntimeServicesTableLib.h>\r
-#include <Library/DevicePathLib.h>\r
-\r
-#include <Guid/StatusCodeDataTypeId.h>\r
-#include <Guid/StatusCodeDataTypeDebug.h>\r
-#include <Protocol/StatusCode.h>\r
-\r
-extern EFI_REPORT_STATUS_CODE  mReportStatusCode;\r
-\r
-/**\r
-  Locate he report status code service.\r
-\r
-  @return     EFI_REPORT_STATUS_CODE    function point to\r
-              ReportStatusCode.\r
-**/\r
-EFI_REPORT_STATUS_CODE\r
-InternalGetReportStatusCode (\r
-  VOID\r
-  );\r
-\r
-/**\r
-  Internal worker function that reports a status code through the Status Code Protocol\r
-\r
-  This function checks to see if a Status Code Protocol is present in the handle\r
-  database.  If a Status Code Protocol is not present, then EFI_UNSUPPORTED is\r
-  returned.  If a Status Code Protocol is present, then it is cached in gStatusCode,\r
-  and the ReportStatusCode() service of the Status Code Protocol is called passing in\r
-  Type, Value, Instance, CallerId, and Data.  The result of this call is returned.\r
-\r
-  @param  Type              Status code type.\r
-  @param  Value             Status code value.\r
-  @param  Instance          Status code instance number.\r
-  @param  CallerId          Pointer to a GUID that identifies the caller of this\r
-                            function.  This is an optional parameter that may be\r
-                            NULL.\r
-  @param  Data              Pointer to the extended data buffer.  This is an\r
-                            optional parameter that may be NULL.\r
-\r
-  @retval  EFI_SUCCESS           The status code was reported.\r
-  @retval  EFI_OUT_OF_RESOURCES  There were not enough resources to report the status code.\r
-  @retval  EFI_UNSUPPORTED       Status Code Protocol is not available.\r
-\r
-**/\r
-EFI_STATUS\r
-InternalReportStatusCode (\r
-  IN EFI_STATUS_CODE_TYPE     Type,\r
-  IN EFI_STATUS_CODE_VALUE    Value,\r
-  IN UINT32                   Instance,\r
-  IN CONST EFI_GUID           *CallerId OPTIONAL,\r
-  IN EFI_STATUS_CODE_DATA     *Data     OPTIONAL\r
-  );\r
-\r
-/**\r
-  Reports a status code with full parameters.\r
-\r
-  The function reports a status code.  If ExtendedData is NULL and ExtendedDataSize\r
-  is 0, then an extended data buffer is not reported.  If ExtendedData is not\r
-  NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.\r
-  ExtendedData is assumed not have the standard status code header, so this function\r
-  is responsible for allocating a buffer large enough for the standard header and\r
-  the extended data passed into this function.  The standard header is filled in\r
-  with a GUID specified by ExtendedDataGuid.  If ExtendedDataGuid is NULL, then a\r
-  GUID of gEfiStatusCodeSpecificDatauid is used.  The status code is reported with\r
-  an instance specified by Instance and a caller ID specified by CallerId.  If\r
-  CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.\r
-\r
-  ReportStatusCodeEx()must actively prevent recursion.  If ReportStatusCodeEx()\r
-  is called while processing another any other Report Status Code Library function,\r
-  then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.\r
-\r
-  If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().\r
-  If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().\r
-\r
-  @param  Type              Status code type.\r
-  @param  Value             Status code value.\r
-  @param  Instance          Status code instance number.\r
-  @param  CallerId          Pointer to a GUID that identifies the caller of this\r
-                            function.  If this parameter is NULL, then a caller\r
-                            ID of gEfiCallerIdGuid is used.\r
-  @param  ExtendedDataGuid  Pointer to the GUID for the extended data buffer.\r
-                            If this parameter is NULL, then a the status code\r
-                            standard header is filled in with\r
-                            gEfiStatusCodeSpecificDataGuid.\r
-  @param  ExtendedData      Pointer to the extended data buffer.  This is an\r
-                            optional parameter that may be NULL.\r
-  @param  ExtendedDataSize  The size, in bytes, of the extended data buffer.\r
-\r
-  @retval  EFI_SUCCESS           The status code was reported.\r
-  @retval  EFI_OUT_OF_RESOURCES  There were not enough resources to allocate\r
-                                 the extended data section if it was specified.\r
-  @retval  EFI_UNSUPPORTED       Report status code is not supported\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-InternalReportStatusCodeEx (\r
-  IN EFI_STATUS_CODE_TYPE   Type,\r
-  IN EFI_STATUS_CODE_VALUE  Value,\r
-  IN UINT32                 Instance,\r
-  IN CONST EFI_GUID         *CallerId          OPTIONAL,\r
-  IN CONST EFI_GUID         *ExtendedDataGuid  OPTIONAL,\r
-  IN CONST VOID             *ExtendedData      OPTIONAL,\r
-  IN UINTN                  ExtendedDataSize\r
-  );\r
-\r
-#endif // __REPORT_STATUS_CODE_LIB_INTERNAL__H\r
-\r