]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg/PrePi: don't export PE/COFF and LZMA libraries via HOBs
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 24 Nov 2017 09:43:50 +0000 (09:43 +0000)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 27 Nov 2017 18:22:35 +0000 (18:22 +0000)
The PrePi code we inherited from ArmPlatformPkg contains a rather
obscure optimization, where entry points of the PE/COFF and LZMA
handling routines are recorded in special HOBs, allowing DXE core
to call into that code directly rather than carry its own copy of
these libraries.

Given that no ArmVirtPkg platforms actually include the library
resolutions* that take advantage of these optimizations, let's not
bother with them, and remove the associated code.

* EmbeddedPkg/Library/LzmaHobCustomDecompressLib/LzmaHobCustomDecompressLib.inf
  EmbeddedPkg/Library/DxeHobPeCoffLib/DxeHobPeCoffLib.inf

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf
ArmVirtPkg/PrePi/LzmaDecompress.h [deleted file]
ArmVirtPkg/PrePi/PrePi.c

index 58290d2d1b766dee11e622ff34b6c73d53532df3..b3a3f5da065ee67a538721e1cc12b86ed106cde1 100755 (executable)
@@ -51,7 +51,6 @@
   SerialPortLib\r
   ExtractGuidedSectionLib\r
   LzmaDecompressLib\r
   SerialPortLib\r
   ExtractGuidedSectionLib\r
   LzmaDecompressLib\r
-  PeCoffGetEntryPointLib\r
   PrePiLib\r
   MemoryAllocationLib\r
   HobLib\r
   PrePiLib\r
   MemoryAllocationLib\r
   HobLib\r
diff --git a/ArmVirtPkg/PrePi/LzmaDecompress.h b/ArmVirtPkg/PrePi/LzmaDecompress.h
deleted file mode 100644 (file)
index a79ff34..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/** @file\r
-  LZMA Decompress Library header file\r
-\r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-  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 __LZMA_DECOMPRESS_H___\r
-#define __LZMA_DECOMPRESS_H___\r
-\r
-/**\r
-  Examines a GUIDed section and returns the size of the decoded buffer and the\r
-  size of an scratch buffer required to actually decode the data in a GUIDed section.\r
-\r
-  Examines a GUIDed section specified by InputSection.\r
-  If GUID for InputSection does not match the GUID that this handler supports,\r
-  then RETURN_UNSUPPORTED is returned.\r
-  If the required information can not be retrieved from InputSection,\r
-  then RETURN_INVALID_PARAMETER is returned.\r
-  If the GUID of InputSection does match the GUID that this handler supports,\r
-  then the size required to hold the decoded buffer is returned in OututBufferSize,\r
-  the size of an optional scratch buffer is returned in ScratchSize, and the Attributes field\r
-  from EFI_GUID_DEFINED_SECTION header of InputSection is returned in SectionAttribute.\r
-\r
-  If InputSection is NULL, then ASSERT().\r
-  If OutputBufferSize is NULL, then ASSERT().\r
-  If ScratchBufferSize is NULL, then ASSERT().\r
-  If SectionAttribute is NULL, then ASSERT().\r
-\r
-\r
-  @param[in]  InputSection       A pointer to a GUIDed section of an FFS formatted file.\r
-  @param[out] OutputBufferSize   A pointer to the size, in bytes, of an output buffer required\r
-                                 if the buffer specified by InputSection were decoded.\r
-  @param[out] ScratchBufferSize  A pointer to the size, in bytes, required as scratch space\r
-                                 if the buffer specified by InputSection were decoded.\r
-  @param[out] SectionAttribute   A pointer to the attributes of the GUIDed section. See the Attributes\r
-                                 field of EFI_GUID_DEFINED_SECTION in the PI Specification.\r
-\r
-  @retval  RETURN_SUCCESS            The information about InputSection was returned.\r
-  @retval  RETURN_UNSUPPORTED        The section specified by InputSection does not match the GUID this handler supports.\r
-  @retval  RETURN_INVALID_PARAMETER  The information can not be retrieved from the section specified by InputSection.\r
-\r
-**/\r
-RETURN_STATUS\r
-EFIAPI\r
-LzmaGuidedSectionGetInfo (\r
-  IN  CONST VOID  *InputSection,\r
-  OUT UINT32      *OutputBufferSize,\r
-  OUT UINT32      *ScratchBufferSize,\r
-  OUT UINT16      *SectionAttribute\r
-  );\r
-\r
-/**\r
-  Decompress a LZAM compressed GUIDed section into a caller allocated output buffer.\r
-\r
-  Decodes the GUIDed section specified by InputSection.\r
-  If GUID for InputSection does not match the GUID that this handler supports, then RETURN_UNSUPPORTED is returned.\r
-  If the data in InputSection can not be decoded, then RETURN_INVALID_PARAMETER is returned.\r
-  If the GUID of InputSection does match the GUID that this handler supports, then InputSection\r
-  is decoded into the buffer specified by OutputBuffer and the authentication status of this\r
-  decode operation is returned in AuthenticationStatus.  If the decoded buffer is identical to the\r
-  data in InputSection, then OutputBuffer is set to point at the data in InputSection.  Otherwise,\r
-  the decoded data will be placed in caller allocated buffer specified by OutputBuffer.\r
-\r
-  If InputSection is NULL, then ASSERT().\r
-  If OutputBuffer is NULL, then ASSERT().\r
-  If ScratchBuffer is NULL and this decode operation requires a scratch buffer, then ASSERT().\r
-  If AuthenticationStatus is NULL, then ASSERT().\r
-\r
-\r
-  @param[in]  InputSection  A pointer to a GUIDed section of an FFS formatted file.\r
-  @param[out] OutputBuffer  A pointer to a buffer that contains the result of a decode operation.\r
-  @param[out] ScratchBuffer A caller allocated buffer that may be required by this function\r
-                            as a scratch buffer to perform the decode operation.\r
-  @param[out] AuthenticationStatus\r
-                            A pointer to the authentication status of the decoded output buffer.\r
-                            See the definition of authentication status in the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI\r
-                            section of the PI Specification. EFI_AUTH_STATUS_PLATFORM_OVERRIDE must\r
-                            never be set by this handler.\r
-\r
-  @retval  RETURN_SUCCESS            The buffer specified by InputSection was decoded.\r
-  @retval  RETURN_UNSUPPORTED        The section specified by InputSection does not match the GUID this handler supports.\r
-  @retval  RETURN_INVALID_PARAMETER  The section specified by InputSection can not be decoded.\r
-\r
-**/\r
-RETURN_STATUS\r
-EFIAPI\r
-LzmaGuidedSectionExtraction (\r
-  IN CONST  VOID    *InputSection,\r
-  OUT       VOID    **OutputBuffer,\r
-  OUT       VOID    *ScratchBuffer,        OPTIONAL\r
-  OUT       UINT32  *AuthenticationStatus\r
-  );\r
-\r
-#endif // __LZMADECOMPRESS_H__\r
-\r
index fce4ab9428a578d45a73b19a47b9828aa9c7a5c4..f6abe2f2016bd654726f36d0b4a1ae9c22b89f5e 100755 (executable)
@@ -17,7 +17,6 @@
 \r
 #include <Library/PrePiLib.h>\r
 #include <Library/PrintLib.h>\r
 \r
 #include <Library/PrePiLib.h>\r
 #include <Library/PrintLib.h>\r
-#include <Library/PeCoffGetEntryPointLib.h>\r
 #include <Library/PrePiHobListPointerLib.h>\r
 #include <Library/TimerLib.h>\r
 #include <Library/PerformanceLib.h>\r
 #include <Library/PrePiHobListPointerLib.h>\r
 #include <Library/TimerLib.h>\r
 #include <Library/PerformanceLib.h>\r
 \r
 #include <Ppi/GuidedSectionExtraction.h>\r
 #include <Ppi/ArmMpCoreInfo.h>\r
 \r
 #include <Ppi/GuidedSectionExtraction.h>\r
 #include <Ppi/ArmMpCoreInfo.h>\r
-#include <Guid/LzmaDecompress.h>\r
 \r
 #include "PrePi.h"\r
 \r
 #include "PrePi.h"\r
-#include "LzmaDecompress.h"\r
 \r
 VOID\r
 EFIAPI\r
 \r
 VOID\r
 EFIAPI\r
@@ -98,14 +95,6 @@ PrePiMain (
   // SEC phase needs to run library constructors by hand.\r
   ProcessLibraryConstructorList ();\r
 \r
   // SEC phase needs to run library constructors by hand.\r
   ProcessLibraryConstructorList ();\r
 \r
-  // Build HOBs to pass up our version of stuff the DXE Core needs to save space\r
-  BuildPeCoffLoaderHob ();\r
-  BuildExtractSectionHob (\r
-    &gLzmaCustomDecompressGuid,\r
-    LzmaGuidedSectionGetInfo,\r
-    LzmaGuidedSectionExtraction\r
-    );\r
-\r
   // Assume the FV that contains the SEC (our code) also contains a compressed FV.\r
   Status = DecompressFirstFv ();\r
   ASSERT_EFI_ERROR (Status);\r
   // Assume the FV that contains the SEC (our code) also contains a compressed FV.\r
   Status = DecompressFirstFv ();\r
   ASSERT_EFI_ERROR (Status);\r