UINT16 Machine;\r
PEI_CORE_INSTANCE *Private;\r
VOID *EntryPointArg;\r
+ EFI_SECTION_TYPE SearchType1;\r
+ EFI_SECTION_TYPE SearchType2;\r
\r
*EntryPoint = 0;\r
ImageSize = 0;\r
*AuthenticationState = 0;\r
\r
+ if (FeaturePcdGet (PcdPeiCoreImageLoaderSearchTeSectionFirst)) {\r
+ SearchType1 = EFI_SECTION_TE;\r
+ SearchType2 = EFI_SECTION_PE32;\r
+ } else {\r
+ SearchType1 = EFI_SECTION_PE32;\r
+ SearchType2 = EFI_SECTION_TE;\r
+ }\r
//\r
- // Try to find a TE section.\r
+ // Try to find a first exe section (if PcdPeiCoreImageLoaderSearchTeSectionFirst \r
+ // is true, TE will be searched first).\r
//\r
Status = PeiServicesFfsFindSectionData (\r
- EFI_SECTION_TE,\r
+ SearchType1,\r
FileHandle,\r
&Pe32Data\r
);\r
//\r
- // If we didn't find a TE section, try to find a PE32 section.\r
+ // If we didn't find a first exe section, try to find the second exe section.\r
//\r
if (EFI_ERROR (Status)) {\r
Status = PeiServicesFfsFindSectionData (\r
- EFI_SECTION_PE32,\r
+ SearchType2,\r
FileHandle,\r
&Pe32Data\r
);\r
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported\r
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv\r
\r
-[BuildOptions.common]\r
- MSFT:DEBUG_*_IA32_CC_FLAGS = /FAcs\r
+[FeaturePcd.common]\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst\r
+\r
+\r
\r
gEfiMdeModulePkgTokenSpaceGuid.PcdUnicodeCollation2Support|TRUE|BOOLEAN|0x00010041\r
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE|BOOLEAN|0x00010042\r
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|TRUE|BOOLEAN|0x00010043\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst|TRUE|BOOLEAN|0x00010044\r
\r
[PcdsFixedAtBuild.common]\r
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPcdCallBackNumberPerPcdEntry|0x08|UINT32|0x0001000f\r