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>
(cherry picked from commit d40695ad82
)
This commit is contained in:
@ -708,18 +708,13 @@ Decompress (
|
|||||||
return EFI_OUT_OF_RESOURCES;
|
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) {
|
if (DstBuffer == NULL) {
|
||||||
return EFI_OUT_OF_RESOURCES;
|
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
|
// Call decompress function
|
||||||
//
|
//
|
||||||
Status = UefiDecompress (
|
Status = UefiDecompress (
|
||||||
@ -749,16 +744,11 @@ Decompress (
|
|||||||
// Allocate destination buffer
|
// Allocate destination buffer
|
||||||
//
|
//
|
||||||
DstBufferSize = UncompressedLength;
|
DstBufferSize = UncompressedLength;
|
||||||
DstBuffer = AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize) + 1);
|
DstBuffer = AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize));
|
||||||
if (DstBuffer == NULL) {
|
if (DstBuffer == NULL) {
|
||||||
return EFI_OUT_OF_RESOURCES;
|
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.
|
// stream is not actually compressed, just encapsulated. So just copy it.
|
||||||
//
|
//
|
||||||
CopyMem (DstBuffer, CompressionSource, DstBufferSize);
|
CopyMem (DstBuffer, CompressionSource, DstBufferSize);
|
||||||
|
Reference in New Issue
Block a user