]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
MdeModulePkg DxeIpl: remove the hard code alignment adjustment in Decompress()
[mirror_edk2.git] / MdeModulePkg / Core / DxeIplPeim / DxeLoad.c
index f4d752898554b199a2b05791eb368cf4e0c0475f..178bac47e4d2c35b75a82a0d0efd514759cd7032 100644 (file)
@@ -708,18 +708,13 @@ Decompress (
         return EFI_OUT_OF_RESOURCES;\r
       }\r
       //\r
-      // Allocate destination buffer, extra one page for adjustment \r
+      // Allocate destination buffer\r
       //\r
-      DstBuffer = AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize) + 1);\r
+      DstBuffer = AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize));\r
       if (DstBuffer == NULL) {\r
         return EFI_OUT_OF_RESOURCES;\r
       }\r
       //\r
-      // DstBuffer still is one section. Adjust DstBuffer offset, skip EFI section header\r
-      // to make section data at page alignment.\r
-      //\r
-      DstBuffer = DstBuffer + EFI_PAGE_SIZE - sizeof (EFI_COMMON_SECTION_HEADER);\r
-      //\r
       // Call decompress function\r
       //\r
       Status = UefiDecompress (\r
@@ -749,16 +744,11 @@ Decompress (
     // Allocate destination buffer\r
     //\r
     DstBufferSize = UncompressedLength;\r
-    DstBuffer     = AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize) + 1);\r
+    DstBuffer     = AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize));\r
     if (DstBuffer == NULL) {\r
       return EFI_OUT_OF_RESOURCES;\r
     }\r
     //\r
-    // Adjust DstBuffer offset, skip EFI section header\r
-    // to make section data at page alignment.\r
-    //\r
-    DstBuffer = DstBuffer + EFI_PAGE_SIZE - sizeof (EFI_COMMON_SECTION_HEADER);\r
-    //\r
     // stream is not actually compressed, just encapsulated.  So just copy it.\r
     //\r
     CopyMem (DstBuffer, CompressionSource, DstBufferSize);\r