]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Remove extra #includes where possible to make build more efficient
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 11 Jul 2009 23:29:23 +0000 (23:29 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 11 Jul 2009 23:29:23 +0000 (23:29 +0000)
If module really is a Framework module and not a PI module, then use FrameworkDxe.h instead of PeDxe.h and FrameworkPei.h instead of PiPei.h

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8902 6f19259b-4bc3-4df7-8a09-765794883524

UnixPkg/CpuRuntimeDxe/Cpu.c
UnixPkg/CpuRuntimeDxe/CpuIo.c
UnixPkg/Library/DxeUnixOemHookStatusCodeLib/UnixOemHookStatusCodeLib.c
UnixPkg/Library/DxeUnixPeCoffExtraActionLib/DxeUnixPeCoffExtraActionLib.c
UnixPkg/Library/PeiUnixOemHookStatusCodeLib/UnixOemHookStatusCodeLib.c
UnixPkg/Sec/SecMain.c
UnixPkg/Sec/SecMain.h

index 689a50a704fb403b7d7a22c75d967480f42c4a69..dc25d4d8124f10b0f40d0673fbc53af066105c32 100644 (file)
@@ -21,7 +21,7 @@ Abstract:
   in this driver.\r
 \r
 --*/\r
-#include "PiDxe.h"\r
+#include <FrameworkDxe.h>\r
 #include <Protocol/Cpu.h>\r
 #include <Protocol/DataHub.h>\r
 #include <Guid/DataHubRecords.h>\r
@@ -36,7 +36,6 @@ Abstract:
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
-#include <Framework/DataHubRecords.h>\r
 #include "CpuDriver.h"\r
 #include "UnixDxe.h"\r
 #include <Protocol/UnixIo.h>\r
index 5c3ebb2f38c2d5dee65e350fc11c0104eb05588f..5980a03d4417f497ce055db1b34516d7abac5876 100644 (file)
@@ -22,7 +22,7 @@ Abstract:
   Bridge I/O Protocol.\r
 \r
 --*/\r
-#include "PiDxe.h"\r
+#include <FrameworkDxe.h>\r
 #include <Protocol/Cpu.h>\r
 #include <Protocol/DataHub.h>\r
 #include <Guid/DataHubRecords.h>\r
index 17b40fdb320da00ace65654d56aaf6fd23a442ba..d9c27b15a653659edd2f1a5b11452827680abd75 100644 (file)
@@ -13,7 +13,7 @@
   Module Name:  UnixOemHookStatusCodeLib.c\r
 \r
 **/\r
-#include "PiDxe.h"\r
+#include <FrameworkDxe.h>\r
 #include <Guid/StatusCodeDataTypeId.h>\r
 #include <Guid/StatusCodeDataTypeDebug.h>\r
 #include "UnixDxe.h"\r
index 7a4e670e3705db3bf79cd7e92c4a69efdfd6bfb2..c04a27e722fce4d00f34ca6b4d01fd04e77261fe 100644 (file)
@@ -1,59 +1,59 @@
-/**@file
-
-Copyright (c) 2006 - 2009, Intel Corporation
-All rights reserved. This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution.  The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
-
-  PeiUnixPeCoffExtraActionLib.c
-
-Abstract:
-
-  Provides services to perform additional actions to relocate and unload
-  PE/Coff image for Unix environment specific purpose such as souce level debug.
-  This version only works for DXE phase  
-
-
-**/
-
-#include <PiDxe.h>\r
+/**@file\r
+\r
+Copyright (c) 2006 - 2009, Intel Corporation\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
+Module Name:\r
+\r
+  PeiUnixPeCoffExtraActionLib.c\r
+\r
+Abstract:\r
+\r
+  Provides services to perform additional actions to relocate and unload\r
+  PE/Coff image for Unix environment specific purpose such as souce level debug.\r
+  This version only works for DXE phase  \r
+\r
+\r
+**/\r
+\r
+#include <FrameworkDxe.h>\r
 #include <Guid/StatusCodeDataTypeId.h>\r
-#include <UnixDxe.h>
-#include <Library/PeCoffLib.h>
-#include <Library/PeiServicesLib.h>
-
-#include <Library/BaseLib.h>
-#include <Library/DebugLib.h>
-#include <Library/HobLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/PeCoffExtraActionLib.h>
-
+#include <UnixDxe.h>\r
+#include <Library/PeCoffLib.h>\r
+#include <Library/PeiServicesLib.h>\r
+\r
+#include <Library/BaseLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/HobLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/PeCoffExtraActionLib.h>\r
+\r
 //\r
 // Cache of UnixThunk protocol \r
 //\r
-EFI_UNIX_THUNK_PROTOCOL   *mUnix;
-
-
-/**
-  The constructor function gets  the pointer of the WinNT thunk functions
-  It will ASSERT() if Unix thunk protocol is not installed.
-
-  @retval EFI_SUCCESS   Unix thunk protocol is found and cached.
-
-**/
-EFI_STATUS
-EFIAPI
-DxeUnixPeCoffLibExtraActionConstructor (
-  IN EFI_HANDLE        ImageHandle,
-  IN EFI_SYSTEM_TABLE  *SystemTable
-  )
-{
+EFI_UNIX_THUNK_PROTOCOL   *mUnix;\r
+\r
+\r
+/**\r
+  The constructor function gets  the pointer of the WinNT thunk functions\r
+  It will ASSERT() if Unix thunk protocol is not installed.\r
+\r
+  @retval EFI_SUCCESS   Unix thunk protocol is found and cached.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+DxeUnixPeCoffLibExtraActionConstructor (\r
+  IN EFI_HANDLE        ImageHandle,\r
+  IN EFI_SYSTEM_TABLE  *SystemTable\r
+  )\r
+{\r
         EFI_HOB_GUID_TYPE        *GuidHob;\r
 \r
   //\r
@@ -64,32 +64,32 @@ DxeUnixPeCoffLibExtraActionConstructor (
   mUnix = (EFI_UNIX_THUNK_PROTOCOL *)(*(UINTN *)(GET_GUID_HOB_DATA (GuidHob)));\r
   ASSERT (mUnix != NULL);\r
 \r
-  return EFI_SUCCESS;
-}
-
-/**
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
   Performs additional actions after a PE/COFF image has been loaded and relocated.\r
 \r
   If ImageContext is NULL, then ASSERT().\r
 \r
   @param  ImageContext  Pointer to the image context structure that describes the\r
                         PE/COFF image that has already been loaded and relocated.\r
-
-**/
-VOID
-EFIAPI
-PeCoffLoaderRelocateImageExtraAction (
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext
-  )
-{
+\r
+**/\r
+VOID\r
+EFIAPI\r
+PeCoffLoaderRelocateImageExtraAction (\r
+  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
+  )\r
+{\r
   VOID * Handle;\r
   VOID * Entry;\r
 \r
   ASSERT (ImageContext != NULL);\r
 \r
   Handle = NULL;\r
-  Entry  = NULL;
-  
+  Entry  = NULL;\r
+  \r
   DEBUG ((EFI_D_ERROR, "Loading %a 0x%08lx - entry point 0x%08lx\n",\r
           ImageContext->PdbPointer,\r
           (UINTN)ImageContext->ImageAddress,\r
@@ -99,20 +99,20 @@ PeCoffLoaderRelocateImageExtraAction (
   \r
   if (Handle) {\r
     Entry = mUnix->Dlsym(Handle, "_ModuleEntryPoint");\r
-  } else {
+  } else {\r
        DEBUG ((EFI_D_ERROR, "%a\n", mUnix->Dlerror()));\r
   }\r
   \r
   if (Entry != NULL) {\r
-    ImageContext->EntryPoint = Entry;
+    ImageContext->EntryPoint = Entry;\r
     DEBUG ((EFI_D_ERROR, "Change %a Entrypoint to :0x%08lx\n", ImageContext->PdbPointer, Entry));\r
   }\r
 \r
 \r
-  return;
- }  
-
-/**
+  return;\r
+ }  \r
+\r
+/**\r
   Performs additional actions just before a PE/COFF image is unloaded.  Any resources\r
   that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.\r
   \r
@@ -120,13 +120,13 @@ PeCoffLoaderRelocateImageExtraAction (
   \r
   @param  ImageContext  Pointer to the image context structure that describes the\r
                         PE/COFF image that is being unloaded.\r
-
-**/
-VOID
-EFIAPI
-PeCoffLoaderUnloadImageExtraAction (
-  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext
-  )
-{
+\r
+**/\r
+VOID\r
+EFIAPI\r
+PeCoffLoaderUnloadImageExtraAction (\r
+  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
+  )\r
+{\r
   ASSERT (ImageContext != NULL);\r
-}
+}\r
index 4d4056af701b6978d254fa198c006cc7ec1acd8f..ad68d51c7290787d9f3e06b9bedcb1562ff7dea8 100644 (file)
-/** @file
-  OEM hook status code library functions with no library constructor/destructor
-
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
-
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-  Module Name:  UnixOemHookStatusCodeLib.c
-
-**/
-#include "PiPei.h"
-#include <Guid/StatusCodeDataTypeId.h>
+/** @file\r
+  OEM hook status code library functions with no library constructor/destructor\r
+\r
+  Copyright (c) 2006 - 2008, Intel Corporation\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
+  Module Name:  UnixOemHookStatusCodeLib.c\r
+\r
+**/\r
+#include <FrameworkPei.h>\r
+#include <Guid/StatusCodeDataTypeId.h>\r
 #include <Guid/StatusCodeDataTypeDebug.h>\r
-#include <Ppi/UnixThunk.h>
-#include <Library/OemHookStatusCodeLib.h>
-#include <Library/DebugLib.h>
-#include <Library/PrintLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/ReportStatusCodeLib.h>
-#include <Library/PeiServicesLib.h>
-
-//
-// Cache of UnixThunk protocol 
-//
-EFI_UNIX_THUNK_PROTOCOL   *mUnix;
-
-//
-// Cache of standard output handle . 
-//
-int                      mStdOut;
-
-/**
-
-  Initialize OEM status code device .
-
-  @return    Always return EFI_SUCCESS.
-
-**/
-EFI_STATUS
-EFIAPI
-OemHookStatusCodeInitialize (
-  VOID
-  )
-{
-  PEI_UNIX_THUNK_PPI  *UnixThunkPpi;
-  EFI_STATUS        Status;
-
-  
-  //
-  // Locate Unix ThunkPpi for retrieving standard output handle
-  //
-  Status = PeiServicesLocatePpi (
-              &gPeiUnixThunkPpiGuid,
-              0,
-              NULL,
-              (VOID **) &UnixThunkPpi
-              );
-
-  ASSERT_EFI_ERROR (Status);
-
-  mUnix  = (EFI_UNIX_THUNK_PROTOCOL *) UnixThunkPpi->UnixThunk ();
-  
-  //
-  // Cache standard output handle.
-  //
-  mStdOut = 1;
-
-  return EFI_SUCCESS;
-}
-
-/**
-  Report status code to OEM device.
-  @param  CodeType      Indicates the type of status code being reported.  Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
-  @param  Value         Describes the current status of a hardware or software entity.  
-                        This included information about the class and subclass that is used to classify the entity 
-                        as well as an operation.  For progress codes, the operation is the current activity. 
-                        For error codes, it is the exception.  For debug codes, it is not defined at this time. 
-                        Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.  
-                        Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
-  @param  Instance      The enumeration of a hardware or software entity within the system.  
-                        A system may contain multiple entities that match a class/subclass pairing. 
-                        The instance differentiates between them.  An instance of 0 indicates that instance information is unavailable, 
-                        not meaningful, or not relevant.  Valid instance numbers start with 1.
-
-
-  @param  CallerId      This optional parameter may be used to identify the caller. 
-                        This parameter allows the status code driver to apply different rules to different callers. 
-                        Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.
-
-
-  @param  Data          This optional parameter may be used to pass additional data
-  @return               The function always return EFI_SUCCESS.
-
-**/
-EFI_STATUS
-EFIAPI
-OemHookStatusCodeReport (
-  IN EFI_STATUS_CODE_TYPE     CodeType,
-  IN EFI_STATUS_CODE_VALUE    Value,
-  IN UINT32                   Instance,
-  IN EFI_GUID                 *CallerId, OPTIONAL
-  IN EFI_STATUS_CODE_DATA     *Data      OPTIONAL
-  )
-{
-  CHAR8           *Filename;
-  CHAR8           *Description;
-  CHAR8           *Format;
-  CHAR8           Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];
-  UINT32          ErrorLevel;
-  UINT32          LineNumber;
-  UINTN           CharCount;
-  BASE_LIST       Marker;
-
-  Buffer[0] = '\0';
-
-  if (Data != NULL &&
-      ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) {
-    //
-    // Print ASSERT() information into output buffer.
-    //
-    CharCount = AsciiSPrint (
-                  Buffer,
-                  sizeof (Buffer),
-                  "\n\rASSERT!: %a (%d): %a\n\r",
-                  Filename,
-                  LineNumber,
-                  Description
-                  );
-
-    //
-    // Callout to standard output.
-    //
-    mUnix->Write (
-              mStdOut,
-              Buffer,
-              CharCount
-             );
-
-    return EFI_SUCCESS;
-
-  } else if (Data != NULL &&
-             ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {
-    //
-    // Print DEBUG() information into output buffer.
-    //
-    CharCount = AsciiBSPrint (
-                  Buffer, 
-                  sizeof (Buffer), 
-                  Format, 
-                  Marker
-                  );
-  } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {
-    //
-    // Print ERROR information into output buffer.
-    //
-    CharCount = AsciiSPrint (
-                  Buffer, 
-                  sizeof (Buffer), 
-                  "ERROR: C%x:V%x I%x", 
-                  CodeType, 
-                  Value, 
-                  Instance
-                  );
-
-    //
-    // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.
-    //
-    
-    if (CallerId != NULL) {
-      CharCount += AsciiSPrint (
-                     &Buffer[CharCount - 1],
-                     (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
-                     " %g",
-                     CallerId
-                     );
-    }
-
-    if (Data != NULL) {
-      CharCount += AsciiSPrint (
-                     &Buffer[CharCount - 1],
-                     (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
-                     " %x",
-                     Data
-                     );
-    }
-
-    CharCount += AsciiSPrint (
-                   &Buffer[CharCount - 1],
-                   (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
-                   "\n\r"
-                   );
-  } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {
-    CharCount = AsciiSPrint (
-                  Buffer, 
-                  sizeof (Buffer), 
-                  "PROGRESS CODE: V%x I%x\n\r", 
-                  Value, 
-                  Instance
-                  );
-  } else {
-    CharCount = AsciiSPrint (
-                  Buffer, 
-                  sizeof (Buffer), 
-                  "Undefined: C%x:V%x I%x\n\r", 
-                  CodeType, 
-                  Value, 
-                  Instance
-                  );
-  }
-
-  //
-  // Callout to standard output.
-  //
-  mUnix->Write (
-            mStdOut,
-            Buffer,
-            CharCount
-            );
-
-  return EFI_SUCCESS;
-}
-
+#include <Ppi/UnixThunk.h>\r
+#include <Library/OemHookStatusCodeLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/PrintLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/ReportStatusCodeLib.h>\r
+#include <Library/PeiServicesLib.h>\r
+\r
+//\r
+// Cache of UnixThunk protocol \r
+//\r
+EFI_UNIX_THUNK_PROTOCOL   *mUnix;\r
+\r
+//\r
+// Cache of standard output handle . \r
+//\r
+int                      mStdOut;\r
+\r
+/**\r
+\r
+  Initialize OEM status code device .\r
+\r
+  @return    Always return EFI_SUCCESS.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+OemHookStatusCodeInitialize (\r
+  VOID\r
+  )\r
+{\r
+  PEI_UNIX_THUNK_PPI  *UnixThunkPpi;\r
+  EFI_STATUS        Status;\r
+\r
+  \r
+  //\r
+  // Locate Unix ThunkPpi for retrieving standard output handle\r
+  //\r
+  Status = PeiServicesLocatePpi (\r
+              &gPeiUnixThunkPpiGuid,\r
+              0,\r
+              NULL,\r
+              (VOID **) &UnixThunkPpi\r
+              );\r
+\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  mUnix  = (EFI_UNIX_THUNK_PROTOCOL *) UnixThunkPpi->UnixThunk ();\r
+  \r
+  //\r
+  // Cache standard output handle.\r
+  //\r
+  mStdOut = 1;\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  Report status code to OEM device.\r
\r
+  @param  CodeType      Indicates the type of status code being reported.  Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
\r
+  @param  Value         Describes the current status of a hardware or software entity.  \r
+                        This included information about the class and subclass that is used to classify the entity \r
+                        as well as an operation.  For progress codes, the operation is the current activity. \r
+                        For error codes, it is the exception.  For debug codes, it is not defined at this time. \r
+                        Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.  \r
+                        Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
\r
+  @param  Instance      The enumeration of a hardware or software entity within the system.  \r
+                        A system may contain multiple entities that match a class/subclass pairing. \r
+                        The instance differentiates between them.  An instance of 0 indicates that instance information is unavailable, \r
+                        not meaningful, or not relevant.  Valid instance numbers start with 1.\r
+\r
+\r
+  @param  CallerId      This optional parameter may be used to identify the caller. \r
+                        This parameter allows the status code driver to apply different rules to different callers. \r
+                        Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.\r
+\r
+\r
+  @param  Data          This optional parameter may be used to pass additional data\r
\r
+  @return               The function always return EFI_SUCCESS.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+OemHookStatusCodeReport (\r
+  IN EFI_STATUS_CODE_TYPE     CodeType,\r
+  IN EFI_STATUS_CODE_VALUE    Value,\r
+  IN UINT32                   Instance,\r
+  IN EFI_GUID                 *CallerId, OPTIONAL\r
+  IN EFI_STATUS_CODE_DATA     *Data      OPTIONAL\r
+  )\r
+{\r
+  CHAR8           *Filename;\r
+  CHAR8           *Description;\r
+  CHAR8           *Format;\r
+  CHAR8           Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];\r
+  UINT32          ErrorLevel;\r
+  UINT32          LineNumber;\r
+  UINTN           CharCount;\r
+  BASE_LIST       Marker;\r
+\r
+  Buffer[0] = '\0';\r
+\r
+  if (Data != NULL &&\r
+      ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) {\r
+    //\r
+    // Print ASSERT() information into output buffer.\r
+    //\r
+    CharCount = AsciiSPrint (\r
+                  Buffer,\r
+                  sizeof (Buffer),\r
+                  "\n\rASSERT!: %a (%d): %a\n\r",\r
+                  Filename,\r
+                  LineNumber,\r
+                  Description\r
+                  );\r
+\r
+    //\r
+    // Callout to standard output.\r
+    //\r
+    mUnix->Write (\r
+              mStdOut,\r
+              Buffer,\r
+              CharCount\r
+             );\r
+\r
+    return EFI_SUCCESS;\r
+\r
+  } else if (Data != NULL &&\r
+             ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {\r
+    //\r
+    // Print DEBUG() information into output buffer.\r
+    //\r
+    CharCount = AsciiBSPrint (\r
+                  Buffer, \r
+                  sizeof (Buffer), \r
+                  Format, \r
+                  Marker\r
+                  );\r
+  } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {\r
+    //\r
+    // Print ERROR information into output buffer.\r
+    //\r
+    CharCount = AsciiSPrint (\r
+                  Buffer, \r
+                  sizeof (Buffer), \r
+                  "ERROR: C%x:V%x I%x", \r
+                  CodeType, \r
+                  Value, \r
+                  Instance\r
+                  );\r
+\r
+    //\r
+    // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.\r
+    //\r
+    \r
+    if (CallerId != NULL) {\r
+      CharCount += AsciiSPrint (\r
+                     &Buffer[CharCount - 1],\r
+                     (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
+                     " %g",\r
+                     CallerId\r
+                     );\r
+    }\r
+\r
+    if (Data != NULL) {\r
+      CharCount += AsciiSPrint (\r
+                     &Buffer[CharCount - 1],\r
+                     (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
+                     " %x",\r
+                     Data\r
+                     );\r
+    }\r
+\r
+    CharCount += AsciiSPrint (\r
+                   &Buffer[CharCount - 1],\r
+                   (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),\r
+                   "\n\r"\r
+                   );\r
+  } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {\r
+    CharCount = AsciiSPrint (\r
+                  Buffer, \r
+                  sizeof (Buffer), \r
+                  "PROGRESS CODE: V%x I%x\n\r", \r
+                  Value, \r
+                  Instance\r
+                  );\r
+  } else {\r
+    CharCount = AsciiSPrint (\r
+                  Buffer, \r
+                  sizeof (Buffer), \r
+                  "Undefined: C%x:V%x I%x\n\r", \r
+                  CodeType, \r
+                  Value, \r
+                  Instance\r
+                  );\r
+  }\r
+\r
+  //\r
+  // Callout to standard output.\r
+  //\r
+  mUnix->Write (\r
+            mStdOut,\r
+            Buffer,\r
+            CharCount\r
+            );\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
index ae5b1fb306cdef32fdddad67611f485be57099d2..4e09ddc3e137ea843768cc0da564e6131f0387ee 100644 (file)
@@ -35,7 +35,6 @@ Abstract:
 #include "SecMain.h"
 #include <sys/mman.h>
 #include <Ppi/UnixPeiLoadFile.h>
-#include <Framework/StatusCode.h>
 #include <Ppi/TemporaryRamSupport.h>
 #include <dlfcn.h>
 //
index d80d6b44b4362cf0fb7bf2813aef2bd25dd650f6..236a50ee43bfb04eb832612647df1404fbdc1185 100644 (file)
@@ -17,11 +17,9 @@ Abstract:
   Include file for host API based SEC\r
 \r
 --*/\r
-#include "PiPei.h"\r
-#include "Uefi/UefiSpec.h"\r
+#include <FrameworkPei.h>\r
 \r
 #include <Protocol/UnixThunk.h>\r
-#include <Pi/PiFirmwareVolume.h>\r
 #include <Ppi/StatusCode.h>\r
 \r
 #include <Library/PeCoffLib.h>\r