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:
lgao4 2007-10-22 10:41:03 +00:00
parent 8e5b17b25e
commit 4e844595f2
2 changed files with 18 additions and 0 deletions

View File

@ -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
//

View File

@ -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