From: mdkinney Date: Tue, 19 Sep 2006 19:10:41 +0000 (+0000) Subject: Add PCD Feature Flags to control which decompression method(s) are included in the... X-Git-Tag: edk2-stable201903~24305 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=e29d70965dbc1e5ab3ed744e05413304ae0f059a Add PCD Feature Flags to control which decompression method(s) are included in the DXE IPL. The choices are any combination of EFI, Tiano, and Custom decompression. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1569 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/EdkModulePkg/Core/DxeIplX64Peim/DxeIplX64.msa b/EdkModulePkg/Core/DxeIplX64Peim/DxeIplX64.msa index 1712b8c2c1..40ea70b2e2 100644 --- a/EdkModulePkg/Core/DxeIplX64Peim/DxeIplX64.msa +++ b/EdkModulePkg/Core/DxeIplX64Peim/DxeIplX64.msa @@ -1,13 +1,5 @@ - - + DxeIplX64 PEIM @@ -72,6 +64,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.--> MemoryAllocationLib + + PcdLib + DxeIpl.dxs @@ -136,4 +131,24 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.--> PeimInitializeDxeIpl - \ No newline at end of file + + + PcdDxeIplSupportEfiDecompress + gEfiEdkModulePkgTokenSpaceGuid + TRUE + If this feature is enabled, then the DXE IPL must support decompressing files compressed with the EFI Compression algorithm + + + PcdDxeIplSupportTianoDecompress + gEfiEdkModulePkgTokenSpaceGuid + TRUE + If this feature is enabled, then the DXE IPL must support decompressing files compressed with the Tiano Compression algorithm + + + PcdDxeIplSupportCustomDecompress + gEfiEdkModulePkgTokenSpaceGuid + TRUE + If this feature is enabled, then the DXE IPL must support decompressing files compressed with the Custom Compression algorithm + + + diff --git a/EdkModulePkg/Core/DxeIplX64Peim/DxeLoadX64.c b/EdkModulePkg/Core/DxeIplX64Peim/DxeLoadX64.c index 4015222036..d01daafbe2 100644 --- a/EdkModulePkg/Core/DxeIplX64Peim/DxeLoadX64.c +++ b/EdkModulePkg/Core/DxeIplX64Peim/DxeLoadX64.c @@ -62,17 +62,17 @@ static EFI_PEI_PPI_DESCRIPTOR mPpiSignal = { NULL }; -DECOMPRESS_LIBRARY gEfiDecompress = { +GLOBAL_REMOVE_IF_UNREFERENCED DECOMPRESS_LIBRARY gEfiDecompress = { UefiDecompressGetInfo, UefiDecompress }; -DECOMPRESS_LIBRARY gTianoDecompress = { +GLOBAL_REMOVE_IF_UNREFERENCED DECOMPRESS_LIBRARY gTianoDecompress = { TianoDecompressGetInfo, TianoDecompress }; -DECOMPRESS_LIBRARY gCustomDecompress = { +GLOBAL_REMOVE_IF_UNREFERENCED DECOMPRESS_LIBRARY gCustomDecompress = { CustomDecompressGetInfo, CustomDecompress }; @@ -842,14 +842,24 @@ Returns: switch (CompressionSection->CompressionType) { case EFI_STANDARD_COMPRESSION: - DecompressLibrary = &gTianoDecompress; + if (FeaturePcdGet (PcdDxeIplSupportTianoDecompress)) { + DecompressLibrary = &gTianoDecompress; + } else { + ASSERT (FALSE); + return EFI_NOT_FOUND; + } break; case EFI_CUSTOMIZED_COMPRESSION: // // Load user customized compression protocol. // - DecompressLibrary = &gCustomDecompress; + if (FeaturePcdGet (PcdDxeIplSupportCustomDecompress)) { + DecompressLibrary = &gCustomDecompress; + } else { + ASSERT (FALSE); + return EFI_NOT_FOUND; + } break; case EFI_NOT_COMPRESSED: