]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Updated to support passing PE/COFF and LZMA decompress up via HOBS. Currently turned...
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 31 Jan 2010 01:39:20 +0000 (01:39 +0000)
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 31 Jan 2010 01:39:20 +0000 (01:39 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9887 6f19259b-4bc3-4df7-8a09-765794883524

13 files changed:
BeagleBoardPkg/BeagleBoardPkg.dsc
BeagleBoardPkg/BeagleBoardPkg.fdf
BeagleBoardPkg/Sec/Sec.c
BeagleBoardPkg/Sec/Sec.inf
BeagleBoardPkg/build.sh
EmbeddedPkg/Include/Guid/ExtractSection.h
EmbeddedPkg/Include/Library/PrePiLib.h
EmbeddedPkg/Include/Protocol/ExtractSection.h [deleted file]
EmbeddedPkg/Include/Protocol/PeCoffLoader.h
EmbeddedPkg/Library/DxeHobPeCoffLib/DxeHobPeCoff.c
EmbeddedPkg/Library/DxeHobPeCoffLib/DxeHobPeCoffLib.inf
EmbeddedPkg/Library/LzmaHobCustomDecompressLib/LzmaHobCustomDecompressLib.c
EmbeddedPkg/Library/PrePiLib/Hob.c

index 7679216a29d4e40c45d3942a0848c1a2d33d87fd..f9b1d2ef7bab5fbe972d29df78b95beaea99f717 100644 (file)
@@ -57,7 +57,6 @@
   
   
   PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
   
   
   PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
-  PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
   
   #
   # Uncomment (and comment out the next line) For RealView Debugger. The Standard IO window 
   
   #
   # Uncomment (and comment out the next line) For RealView Debugger. The Standard IO window 
   UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
   ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
   LzmaDecompressLib|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
   UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
   ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
   LzmaDecompressLib|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
+  PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
 
 [LibraryClasses.common.PEI_CORE]
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
 
 [LibraryClasses.common.PEI_CORE]
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
   ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
   UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
   DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
   ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
   UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
   DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
+  PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
+#  PeCoffLib|EmbeddedPkg/Library/DxeHobPeCoffLib/DxeHobPeCoffLib.inf
 
 [LibraryClasses.common.DXE_DRIVER]
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
 
 [LibraryClasses.common.DXE_DRIVER]
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
+  PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
+#  PeCoffLib|EmbeddedPkg/Library/DxeHobPeCoffLib/DxeHobPeCoffLib.inf
 
 
 [LibraryClasses.ARM]
 
 
 [LibraryClasses.ARM]
   gBeagleBoardTokenSpaceGuid.PcdBeagleConsoleUart|3
   
   # Timers
   gBeagleBoardTokenSpaceGuid.PcdBeagleConsoleUart|3
   
   # Timers
-#  gBeagleBoardTokenSpaceGuid.PcdBeagleArchTimer|OMAP3530_GPTIMER3
   gBeagleBoardTokenSpaceGuid.PcdBeagleArchTimer|3
   gBeagleBoardTokenSpaceGuid.PcdBeagleArchTimer|3
-#  gBeagleBoardTokenSpaceGuid.PcdBeagleFreeTimer|OMAP3530_GPTIMER4
   gBeagleBoardTokenSpaceGuid.PcdBeagleFreeTimer|4
   gEmbeddedTokenSpaceGuid.PcdTimerPeriod|100000
   gEmbeddedTokenSpaceGuid.PcdEmbeddedFdPerformanceCounterPeriodInNanoseconds|77
   gBeagleBoardTokenSpaceGuid.PcdBeagleFreeTimer|4
   gEmbeddedTokenSpaceGuid.PcdTimerPeriod|100000
   gEmbeddedTokenSpaceGuid.PcdEmbeddedFdPerformanceCounterPeriodInNanoseconds|77
       PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
       NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
       NULL|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
       PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
       NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
       NULL|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
+#      NULL|EmbeddedPkg/Library/LzmaHobCustomDecompressLib/LzmaHobCustomDecompressLib.inf    
   }
 
   ArmPkg/Drivers/CpuDxe/CpuDxe.inf
   }
 
   ArmPkg/Drivers/CpuDxe/CpuDxe.inf
index d85a3896292c6fc2c9445e3e563378954d466834..5747ec154796d679471605375061e1931bdc1aa9 100644 (file)
@@ -156,9 +156,9 @@ READ_LOCK_STATUS   = TRUE
 
   #NOTE: Open source EHCI stack doesn't work on Beagleboard.
   #NOTE: UsbBus and UsbMassStorage don't work using iPhond SDK tool chain.
 
   #NOTE: Open source EHCI stack doesn't work on Beagleboard.
   #NOTE: UsbBus and UsbMassStorage don't work using iPhond SDK tool chain.
-  INF MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf
-  INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
-  INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
+  #INF MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf
+  #INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
+  #INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
 
   #
   # UEFI application (Shell Embedded Boot Loader) 
 
   #
   # UEFI application (Shell Embedded Boot Loader) 
index a87ff6d65dc64d1fed27ef2ef6b2bcb0f2fbfa6d..448a713f4d41c475564e0a5fb053ccc1ba12d9fb 100755 (executable)
 #include <Library/PeCoffGetEntryPointLib.h>\r
 \r
 #include <Ppi/GuidedSectionExtraction.h>\r
 #include <Library/PeCoffGetEntryPointLib.h>\r
 \r
 #include <Ppi/GuidedSectionExtraction.h>\r
-\r
+#include <Guid/LzmaDecompress.h>\r
 #include <Omap3530/Omap3530.h>\r
 \r
 #include <Omap3530/Omap3530.h>\r
 \r
+#include "LzmaDecompress.h"\r
+\r
 VOID\r
 EFIAPI \r
 _ModuleEntryPoint(\r
 VOID\r
 EFIAPI \r
 _ModuleEntryPoint(\r
@@ -260,6 +262,16 @@ CEntryPoint (
   ExtractGuidedSectionLibConstructor();\r
   LzmaDecompressLibConstructor();\r
 \r
   ExtractGuidedSectionLibConstructor();\r
   LzmaDecompressLibConstructor();\r
 \r
+  // Build HOBs to pass up our version of stuff the DXE Core needs to save space\r
+#if 0\r
+  BuildPeCoffLoaderHob ();\r
+  BuildExtractSectionHob (\r
+    &gLzmaCustomDecompressGuid,\r
+    LzmaGuidedSectionGetInfo,\r
+    LzmaGuidedSectionExtraction\r
+    );\r
+#endif\r
+\r
   DecompressFirstFv ();\r
 \r
   // Load the DXE Core and transfer control to it\r
   DecompressFirstFv ();\r
 \r
   // Load the DXE Core and transfer control to it\r
index 58acf9ef4eff46ab4c6cffe7a6714f83a0d3231a..87394504ac48ab6893792e0f6e8b498fdc5c84ba 100755 (executable)
@@ -37,6 +37,7 @@
   EmbeddedPkg/EmbeddedPkg.dec
   ArmPkg/ArmPkg.dec
   Omap35xxPkg/Omap35xxPkg.dec
   EmbeddedPkg/EmbeddedPkg.dec
   ArmPkg/ArmPkg.dec
   Omap35xxPkg/Omap35xxPkg.dec
+  IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
 
 [LibraryClasses]
   BaseLib
 
 [LibraryClasses]
   BaseLib
index 85ce46eb14ec7b19dd4c4636a2144fa0221fd04b..928d3151ee73888fc4491e1f3ae225f4b5830cd2 100755 (executable)
@@ -99,7 +99,7 @@ fi
 # Build the edk2 BeagleBoard code
 #
 if [[ $TARGET == RELEASE ]]; then
 # Build the edk2 BeagleBoard code
 #
 if [[ $TARGET == RELEASE ]]; then
-  build -p $WORKSPACE/BeagleBoardPkg/BeagleBoardPkg.dsc -a ARM -t $TARGET_TOOLS -b -D DEBUG_TARGET=RELEASE $1 $2 $3 $4 $5 $6 $7 $8
+  build -p $WORKSPACE/BeagleBoardPkg/BeagleBoardPkg.dsc -a ARM -t $TARGET_TOOLS -b $TARGET -D DEBUG_TARGET=RELEASE $2 $3 $4 $5 $6 $7 $8
 else
   build -p $WORKSPACE/BeagleBoardPkg/BeagleBoardPkg.dsc -a ARM -t $TARGET_TOOLS -b $TARGET $1 $2 $3 $4 $5 $6 $7 $8
 fi
 else
   build -p $WORKSPACE/BeagleBoardPkg/BeagleBoardPkg.dsc -a ARM -t $TARGET_TOOLS -b $TARGET $1 $2 $3 $4 $5 $6 $7 $8
 fi
index 4dedb60b10e7c83c72261c25624ebc81d4dac4b9..5d337d470cdf563236c0ad3c6e2f1485e85b97d6 100755 (executable)
 // The GUID for this protocol mathes the Decompression scheme being used\r
 // So for example LZMA would be gLzmaCustomDecompressGuid\r
 //\r
 // The GUID for this protocol mathes the Decompression scheme being used\r
 // So for example LZMA would be gLzmaCustomDecompressGuid\r
 //\r
-\r
 typedef struct {\r
 typedef struct {\r
-  EFI_HOB_GUID_TYPE                         Hob;                             \r
   EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER   SectionGetInfo;\r
   EXTRACT_GUIDED_SECTION_DECODE_HANDLER     SectionExtraction;\r
   EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER   SectionGetInfo;\r
   EXTRACT_GUIDED_SECTION_DECODE_HANDLER     SectionExtraction;\r
+} EXTRACT_SECTION_DATA;\r
+\r
+typedef struct {\r
+  EFI_HOB_GUID_TYPE     Hob;     \r
+  EXTRACT_SECTION_DATA  Data;\r
 } EXTRACT_SECTION_HOB;\r
 \r
 #endif\r
 } EXTRACT_SECTION_HOB;\r
 \r
 #endif\r
index 3e4e6c023d4f7cfaaba1467cd998759b4fbdd7a2..647cd0cb7eb4879b11a06d2bf482174b01436c90 100644 (file)
@@ -678,6 +678,7 @@ BuildExtractSectionHob (
 VOID
 EFIAPI
 BuildPeCoffLoaderHob (
 VOID
 EFIAPI
 BuildPeCoffLoaderHob (
+  VOID
   );
 
 
   );
 
 
diff --git a/EmbeddedPkg/Include/Protocol/ExtractSection.h b/EmbeddedPkg/Include/Protocol/ExtractSection.h
deleted file mode 100755 (executable)
index 2860472..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/** @file\r
-\r
-  Copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>\r
-\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
-#ifndef __EXTRACT_SECTION_PROTOCOL_H__\r
-#define __EXTRACT_SECTION_PROTOCOL_H__\r
-\r
-\r
-//\r
-// The GUID for this protocol mathes the Decompression scheme being used\r
-// So for example LZMA would be gLzmaCustomDecompressGuid\r
-//\r
-\r
-typedef struct {\r
-  EFI_HOB_GUID_TYPE                         Hob;\r
-  EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER   SectionGetInfo;\r
-  EXTRACT_GUIDED_SECTION_DECODE_HANDLER     SectionExtraction;\r
-} PROTOCOL_HOB;\r
-\r
-\r
-#endif\r
-\r
-\r
index d6b4c03bd8da623907fc376e7202f62b213b1289..aa600122ed8026fe7f1aefec8bd04ae471641fcc 100755 (executable)
@@ -15,6 +15,9 @@
 #ifndef __PE_COFF_LOADER_H__\r
 #define __PE_COFF_LOADER_H__\r
 \r
 #ifndef __PE_COFF_LOADER_H__\r
 #define __PE_COFF_LOADER_H__\r
 \r
+// Needed for PE_COFF_LOADER_IMAGE_CONTEXT\r
+#include <Library/PeCoffLib.h>\r
+\r
 // B323179B-97FB-477E-B0FE-D88591FA11AB\r
 #define PE_COFF_LOADER_PROTOCOL_GUID \\r
   { 0xB323179B, 0x97FB, 0x477E, { 0xB0, 0xFE, 0xD8, 0x85, 0x91, 0xFA, 0x11, 0xAB } }\r
 // B323179B-97FB-477E-B0FE-D88591FA11AB\r
 #define PE_COFF_LOADER_PROTOCOL_GUID \\r
   { 0xB323179B, 0x97FB, 0x477E, { 0xB0, 0xFE, 0xD8, 0x85, 0x91, 0xFA, 0x11, 0xAB } }\r
index 68bc2bf224643f01045458b46bb7ab660cad785c..fdd20032642eb064b6859a742e09521ff3be2fd2 100755 (executable)
@@ -21,6 +21,9 @@
 #include <Protocol/PeCoffLoader.h>\r
 \r
 \r
 #include <Protocol/PeCoffLoader.h>\r
 \r
 \r
+PE_COFF_LOADER_PROTOCOL  *gPeCoffLoader = NULL;\r
+\r
+\r
 /**\r
   Retrieves information about a PE/COFF image.\r
 \r
 /**\r
   Retrieves information about a PE/COFF image.\r
 \r
@@ -167,11 +170,11 @@ PeCoffLoaderImageReadFromMemory (
   OUT    VOID    *Buffer\r
   )\r
 {\r
   OUT    VOID    *Buffer\r
   )\r
 {\r
-  return gPeCoffLoader->RelocateImageForRuntime (\r
-                          *FileHandle,\r
+  return gPeCoffLoader->ReadFromMemory (\r
+                          FileHandle,\r
                           FileOffset,\r
                           FileOffset,\r
-                          *ReadSize,\r
-                          *Buffer\r
+                          ReadSize,\r
+                          Buffer\r
                           );\r
                           \r
 }\r
                           );\r
                           \r
 }\r
@@ -214,7 +217,7 @@ PeCoffLoaderRelocateImageForRuntime (
                           ImageBase,\r
                           VirtImageBase,\r
                           ImageSize,\r
                           ImageBase,\r
                           VirtImageBase,\r
                           ImageSize,\r
-                          *RelocationData\r
+                          RelocationData\r
                           );\r
 }\r
 \r
                           );\r
 }\r
 \r
@@ -244,27 +247,42 @@ PeCoffLoaderUnloadImage (
   return gPeCoffLoader->UnloadImage (ImageContext);\r
 }\r
 \r
   return gPeCoffLoader->UnloadImage (ImageContext);\r
 }\r
 \r
+typedef struct {\r
+  EFI_HOB_GUID_TYPE             Hob;\r
+  VOID                          *Interface;\r
+} PROTOCOL_HOB;\r
 \r
 \r
 /**\r
 \r
 \r
 /**\r
-  Register LzmaDecompress and LzmaDecompressGetInfo handlers with LzmaCustomerDecompressGuid.\r
+  The constructor function caches the pointer of DXE Services Table.\r
+\r
+  The constructor function caches the pointer of DXE Services Table.\r
+  It will ASSERT() if that operation fails.\r
+  It will ASSERT() if the pointer of DXE Services Table is NULL.\r
+  It will always return EFI_SUCCESS.\r
+\r
+  @param  ImageHandle   The firmware allocated handle for the EFI image.\r
+  @param  SystemTable   A pointer to the EFI System Table.\r
+\r
+  @retval EFI_SUCCESS   The constructor always returns EFI_SUCCESS.\r
 \r
 \r
-  @retval  RETURN_SUCCESS            Register successfully.\r
-  @retval  RETURN_OUT_OF_RESOURCES   No enough memory to store this handler.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 DxeHobPeCoffLibConstructor (\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 DxeHobPeCoffLibConstructor (\r
+  IN EFI_HANDLE        ImageHandle,\r
+  IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
 {\r
   PROTOCOL_HOB   *Hob;\r
   )\r
 {\r
   PROTOCOL_HOB   *Hob;\r
-  \r
+\r
   Hob = GetFirstGuidHob (&gPeCoffLoaderProtocolGuid);\r
   if (Hob == NULL) {\r
     return EFI_NOT_FOUND;\r
   }\r
   \r
   gPeCoffLoader = Hob->Interface;\r
   Hob = GetFirstGuidHob (&gPeCoffLoaderProtocolGuid);\r
   if (Hob == NULL) {\r
     return EFI_NOT_FOUND;\r
   }\r
   \r
   gPeCoffLoader = Hob->Interface;\r
+  return EFI_SUCCESS;\r
 }\r
 \r
 \r
 }\r
 \r
 \r
index 576af471bb0472b0c46b17b09588b33aa230b83e..59f0f7fb9047824f007b98947026c388405dd896 100755 (executable)
@@ -16,7 +16,7 @@
 \r
 [Defines]\r
   INF_VERSION                    = 0x00010005\r
 \r
 [Defines]\r
   INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = BasePeCoffLib\r
+  BASE_NAME                      = DxeHobPeCoffLib\r
   FILE_GUID                      = 671C6FD7-99FB-4EE3-B640-4B1D463BC3B5\r
   MODULE_TYPE                    = DXE_DRIVER\r
   VERSION_STRING                 = 1.0\r
   FILE_GUID                      = 671C6FD7-99FB-4EE3-B640-4B1D463BC3B5\r
   MODULE_TYPE                    = DXE_DRIVER\r
   VERSION_STRING                 = 1.0\r
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
+  EmbeddedPkg/EmbeddedPkg.dec\r
 \r
 [LibraryClasses]\r
   DebugLib\r
 \r
 [LibraryClasses]\r
   DebugLib\r
+  HobLib\r
 \r
 \r
+[Protocols]\r
+  gPeCoffLoaderProtocolGuid\r
index fe5fd8383635a4db807127138e2063cedb093752..82e7654ff2320fc52a1dd75e74bedef08c86c5fe 100755 (executable)
@@ -44,7 +44,7 @@ LzmaDecompressLibConstructor (
 \r
   return ExtractGuidedSectionRegisterHandlers (\r
           &gLzmaCustomDecompressGuid,\r
 \r
   return ExtractGuidedSectionRegisterHandlers (\r
           &gLzmaCustomDecompressGuid,\r
-          Hob->SectionGetInfo,\r
-          Hob->SectionExtraction\r
+          Hob->Data.SectionGetInfo,\r
+          Hob->Data.SectionExtraction\r
           );      \r
 }\r
           );      \r
 }\r
index 04b49bb044be1623c1b4dc0d9e409d18a5ee6241..d0553149159dfecb7e9c6e53ca23d1adcef25e76 100644 (file)
@@ -818,11 +818,11 @@ BuildExtractSectionHob (
   IN  EXTRACT_GUIDED_SECTION_DECODE_HANDLER     SectionExtraction
   )
 {
   IN  EXTRACT_GUIDED_SECTION_DECODE_HANDLER     SectionExtraction
   )
 {
-  EXTRACT_SECTION_HOB  Hob;
+  EXTRACT_SECTION_DATA Data;
   
   
-  Hob.SectionGetInfo    = SectionGetInfo;
-  Hob.SectionExtraction = SectionExtraction;
-  BuildGuidDataHob (Guid, &Hob, sizeof (EXTRACT_SECTION_HOB));
+  Data.SectionGetInfo    = SectionGetInfo;
+  Data.SectionExtraction = SectionExtraction;
+  BuildGuidDataHob (Guid, &Data, sizeof (Data));
 }
 
 PE_COFF_LOADER_PROTOCOL gPeCoffProtocol = {
 }
 
 PE_COFF_LOADER_PROTOCOL gPeCoffProtocol = {
@@ -834,22 +834,18 @@ PE_COFF_LOADER_PROTOCOL gPeCoffProtocol = {
   PeCoffLoaderUnloadImage
 };
 
   PeCoffLoaderUnloadImage
 };
 
-typedef struct {
-  EFI_HOB_GUID_TYPE             Hob;
-  VOID                          *Interface;
-} PROTOCOL_HOB;
-
 
 
 VOID
 EFIAPI
 BuildPeCoffLoaderHob (
 
 
 VOID
 EFIAPI
 BuildPeCoffLoaderHob (
+  VOID
   )
 {
   )
 {
-  PROTOCOL_HOB  Hob;      
+  VOID  *Ptr;      
   
   
-  Hob.Interface = &gPeCoffProtocol;
-  BuildGuidDataHob (&gPeCoffLoaderProtocolGuid, &Hob, sizeof (PROTOCOL_HOB));  
+  Ptr = &gPeCoffProtocol;
+  BuildGuidDataHob (&gPeCoffLoaderProtocolGuid, &Ptr, sizeof (VOID *));  
 }
 
 
 }