diff options
author | Liming Gao <liming.gao@intel.com> | 2018-01-10 13:45:58 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2018-01-19 13:20:29 +0800 |
commit | d40695ad82a6a9990d4e73bc9cc3de123eda7a90 (patch) | |
tree | a4a7efdfb607a84e7a9f9730ef82424910e7626d /MdeModulePkg/Core | |
parent | 5367f17db4727a4d43ae3ab519c944e61463716d (diff) | |
download | edk2-d40695ad82a6a9990d4e73bc9cc3de123eda7a90.zip edk2-d40695ad82a6a9990d4e73bc9cc3de123eda7a90.tar.gz edk2-d40695ad82a6a9990d4e73bc9cc3de123eda7a90.tar.bz2 |
MdeModulePkg DxeIpl: remove the hard code alignment adjustment in Decompress()
Section data alignment should be made in the build generation.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg/Core')
-rw-r--r-- | MdeModulePkg/Core/DxeIplPeim/DxeLoad.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c index f4d7528..178bac4 100644 --- a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c +++ b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c @@ -708,18 +708,13 @@ Decompress ( return EFI_OUT_OF_RESOURCES;
}
//
- // Allocate destination buffer, extra one page for adjustment
+ // Allocate destination buffer
//
- DstBuffer = AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize) + 1);
+ DstBuffer = AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize));
if (DstBuffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
//
- // DstBuffer still is one section. Adjust DstBuffer offset, skip EFI section header
- // to make section data at page alignment.
- //
- DstBuffer = DstBuffer + EFI_PAGE_SIZE - sizeof (EFI_COMMON_SECTION_HEADER);
- //
// Call decompress function
//
Status = UefiDecompress (
@@ -749,16 +744,11 @@ Decompress ( // Allocate destination buffer
//
DstBufferSize = UncompressedLength;
- DstBuffer = AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize) + 1);
+ DstBuffer = AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize));
if (DstBuffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}
//
- // Adjust DstBuffer offset, skip EFI section header
- // to make section data at page alignment.
- //
- DstBuffer = DstBuffer + EFI_PAGE_SIZE - sizeof (EFI_COMMON_SECTION_HEADER);
- //
// stream is not actually compressed, just encapsulated. So just copy it.
//
CopyMem (DstBuffer, CompressionSource, DstBufferSize);
|