mirror of https://github.com/acidanthera/audk.git
To find DxeCore by PE32 section is enough, DxeCore can't be wrapped TE section.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4274 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
2b993c56f7
commit
6b978d166b
|
@ -207,7 +207,7 @@ DxeLoadCore (
|
||||||
CopyMem(&DxeCoreFileName, &(((EFI_FFS_FILE_HEADER*)FileHandle)->Name), sizeof (EFI_GUID));
|
CopyMem(&DxeCoreFileName, &(((EFI_FFS_FILE_HEADER*)FileHandle)->Name), sizeof (EFI_GUID));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Load the DXE Core from a Firmware Volume
|
// Load the DXE Core from a Firmware Volume, may use LoadFile ppi to do this for save code size.
|
||||||
//
|
//
|
||||||
Status = PeiLoadFile (
|
Status = PeiLoadFile (
|
||||||
FileHandle,
|
FileHandle,
|
||||||
|
@ -457,7 +457,7 @@ PeiLoadFile (
|
||||||
PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
|
PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
|
||||||
VOID *Pe32Data;
|
VOID *Pe32Data;
|
||||||
//
|
//
|
||||||
// First try to find the required section in this ffs file.
|
// First try to find the PE32 section in this ffs file.
|
||||||
//
|
//
|
||||||
Status = PeiServicesFfsFindSectionData (
|
Status = PeiServicesFfsFindSectionData (
|
||||||
EFI_SECTION_PE32,
|
EFI_SECTION_PE32,
|
||||||
|
@ -465,14 +465,6 @@ PeiLoadFile (
|
||||||
&Pe32Data
|
&Pe32Data
|
||||||
);
|
);
|
||||||
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
Status = PeiServicesFfsFindSectionData (
|
|
||||||
EFI_SECTION_TE,
|
|
||||||
FileHandle,
|
|
||||||
&Pe32Data
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
//
|
//
|
||||||
// NO image types we support so exit.
|
// NO image types we support so exit.
|
||||||
|
@ -496,15 +488,6 @@ PeiLoadFile (
|
||||||
ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)(UINTN) AllocatePages (EFI_SIZE_TO_PAGES ((UINT32) ImageContext.ImageSize));
|
ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)(UINTN) AllocatePages (EFI_SIZE_TO_PAGES ((UINT32) ImageContext.ImageSize));
|
||||||
ASSERT (ImageContext.ImageAddress != 0);
|
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
|
// Load the image to our new buffer
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue