mirror of https://github.com/acidanthera/audk.git
Fix alignment requirement when Load IPF TeImage into memory.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4197 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
8e5b17b25e
commit
4e844595f2
|
@ -482,6 +482,15 @@ PeiLoadFile (
|
|||
ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)(UINTN) AllocatePages (EFI_SIZE_TO_PAGES ((UINT32) ImageContext.ImageSize));
|
||||
ASSERT (ImageContext.ImageAddress != 0);
|
||||
|
||||
//
|
||||
// Skip the reserved space for the stripped PeHeader when load TeImage into memory.
|
||||
//
|
||||
if (ImageContext.IsTeImage) {
|
||||
ImageContext.ImageAddress = ImageContext.ImageAddress +
|
||||
((EFI_TE_IMAGE_HEADER *) Pe32Data)->StrippedSize -
|
||||
sizeof (EFI_TE_IMAGE_HEADER);
|
||||
}
|
||||
|
||||
//
|
||||
// Load the image to our new buffer
|
||||
//
|
||||
|
|
|
@ -242,6 +242,15 @@ Returns:
|
|||
//
|
||||
ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)(UINTN) AllocatePages (EFI_SIZE_TO_PAGES ((UINT32) ImageContext.ImageSize));
|
||||
ASSERT (ImageContext.ImageAddress != 0);
|
||||
|
||||
//
|
||||
// Skip the reserved space for the stripped PeHeader when load TeImage into memory.
|
||||
//
|
||||
if (ImageContext.IsTeImage) {
|
||||
ImageContext.ImageAddress = ImageContext.ImageAddress +
|
||||
((EFI_TE_IMAGE_HEADER *) Pe32Data)->StrippedSize -
|
||||
sizeof (EFI_TE_IMAGE_HEADER);
|
||||
}
|
||||
|
||||
//
|
||||
// Load the image to our new buffer
|
||||
|
|
Loading…
Reference in New Issue