]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Core/DxeIplX64Peim/DxeLoadX64.c
Add PCD Feature Flags to control which decompression method(s) are included in the...
[mirror_edk2.git] / EdkModulePkg / Core / DxeIplX64Peim / DxeLoadX64.c
index 4015222036eee951fa1f98689c90a58a6495d85f..d01daafbe2deace2d88a7e154f2b06f6f6d81b1a 100644 (file)
@@ -62,17 +62,17 @@ static EFI_PEI_PPI_DESCRIPTOR     mPpiSignal = {
   NULL\r
 };\r
 \r
-DECOMPRESS_LIBRARY  gEfiDecompress = {\r
+GLOBAL_REMOVE_IF_UNREFERENCED DECOMPRESS_LIBRARY  gEfiDecompress = {\r
   UefiDecompressGetInfo,\r
   UefiDecompress\r
 };\r
 \r
-DECOMPRESS_LIBRARY  gTianoDecompress = {\r
+GLOBAL_REMOVE_IF_UNREFERENCED DECOMPRESS_LIBRARY  gTianoDecompress = {\r
   TianoDecompressGetInfo,\r
   TianoDecompress\r
 };\r
 \r
-DECOMPRESS_LIBRARY  gCustomDecompress = {\r
+GLOBAL_REMOVE_IF_UNREFERENCED DECOMPRESS_LIBRARY  gCustomDecompress = {\r
   CustomDecompressGetInfo,\r
   CustomDecompress\r
 };\r
@@ -842,14 +842,24 @@ Returns:
 \r
         switch (CompressionSection->CompressionType) {\r
         case EFI_STANDARD_COMPRESSION:\r
-          DecompressLibrary = &gTianoDecompress;\r
+          if (FeaturePcdGet (PcdDxeIplSupportTianoDecompress)) {\r
+            DecompressLibrary = &gTianoDecompress;\r
+          } else {\r
+            ASSERT (FALSE);\r
+            return EFI_NOT_FOUND;\r
+          }\r
           break;\r
 \r
         case EFI_CUSTOMIZED_COMPRESSION:\r
           //\r
           // Load user customized compression protocol.\r
           //\r
-          DecompressLibrary = &gCustomDecompress;\r
+          if (FeaturePcdGet (PcdDxeIplSupportCustomDecompress)) {\r
+            DecompressLibrary = &gCustomDecompress;\r
+          } else {\r
+            ASSERT (FALSE);\r
+            return EFI_NOT_FOUND;\r
+          }\r
           break;\r
 \r
         case EFI_NOT_COMPRESSED:\r