CopyMem(&DxeCoreFileName, &(((EFI_FFS_FILE_HEADER*)FileHandle)->Name), sizeof (EFI_GUID));\r
\r
//\r
- // Load the DXE Core from a Firmware Volume\r
+ // Load the DXE Core from a Firmware Volume, may use LoadFile ppi to do this for save code size.\r
//\r
Status = PeiLoadFile (\r
FileHandle,\r
PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;\r
VOID *Pe32Data;\r
//\r
- // First try to find the required section in this ffs file.\r
+ // First try to find the PE32 section in this ffs file.\r
//\r
Status = PeiServicesFfsFindSectionData (\r
EFI_SECTION_PE32,\r
FileHandle,\r
&Pe32Data\r
);\r
-\r
- if (EFI_ERROR (Status)) {\r
- Status = PeiServicesFfsFindSectionData (\r
- EFI_SECTION_TE,\r
- FileHandle,\r
- &Pe32Data\r
- );\r
- }\r
\r
if (EFI_ERROR (Status)) {\r
//\r
ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)(UINTN) AllocatePages (EFI_SIZE_TO_PAGES ((UINT32) ImageContext.ImageSize));\r
ASSERT (ImageContext.ImageAddress != 0);\r
\r
- //\r
- // Skip the reserved space for the stripped PeHeader when load TeImage into memory.\r
- //\r
- if (ImageContext.IsTeImage) {\r
- ImageContext.ImageAddress = ImageContext.ImageAddress + \r
- ((EFI_TE_IMAGE_HEADER *) Pe32Data)->StrippedSize -\r
- sizeof (EFI_TE_IMAGE_HEADER);\r
- }\r
-\r
//\r
// Load the image to our new buffer\r
//\r