From 3076397e4b8f6baaea994da79b3c4e934a5f31d7 Mon Sep 17 00:00:00 2001 From: qwang12 Date: Thu, 15 Nov 2007 09:00:14 +0000 Subject: Add a feature flag to allow platform developer to decide if TE or PE32 section should be searched in PEI dispatcher. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4298 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/Pei/Image/Image.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'MdeModulePkg/Core/Pei/Image/Image.c') diff --git a/MdeModulePkg/Core/Pei/Image/Image.c b/MdeModulePkg/Core/Pei/Image/Image.c index ecb9de7684..0c627c17b4 100644 --- a/MdeModulePkg/Core/Pei/Image/Image.c +++ b/MdeModulePkg/Core/Pei/Image/Image.c @@ -326,25 +326,35 @@ Returns: UINT16 Machine; PEI_CORE_INSTANCE *Private; VOID *EntryPointArg; + EFI_SECTION_TYPE SearchType1; + EFI_SECTION_TYPE SearchType2; *EntryPoint = 0; ImageSize = 0; *AuthenticationState = 0; + if (FeaturePcdGet (PcdPeiCoreImageLoaderSearchTeSectionFirst)) { + SearchType1 = EFI_SECTION_TE; + SearchType2 = EFI_SECTION_PE32; + } else { + SearchType1 = EFI_SECTION_PE32; + SearchType2 = EFI_SECTION_TE; + } // - // Try to find a TE section. + // Try to find a first exe section (if PcdPeiCoreImageLoaderSearchTeSectionFirst + // is true, TE will be searched first). // Status = PeiServicesFfsFindSectionData ( - EFI_SECTION_TE, + SearchType1, FileHandle, &Pe32Data ); // - // If we didn't find a TE section, try to find a PE32 section. + // If we didn't find a first exe section, try to find the second exe section. // if (EFI_ERROR (Status)) { Status = PeiServicesFfsFindSectionData ( - EFI_SECTION_PE32, + SearchType2, FileHandle, &Pe32Data ); -- cgit v1.2.3