diff options
author | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-11-15 09:00:14 +0000 |
---|---|---|
committer | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-11-15 09:00:14 +0000 |
commit | 3076397e4b8f6baaea994da79b3c4e934a5f31d7 (patch) | |
tree | 55dd04975139c7e74f3f717feaa5132d885b41dc /MdeModulePkg/Core | |
parent | 8ae0b360f5463e666cf5b1c93b7693ac7ad9a312 (diff) | |
download | edk2-platforms-3076397e4b8f6baaea994da79b3c4e934a5f31d7.tar.xz |
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
Diffstat (limited to 'MdeModulePkg/Core')
-rw-r--r-- | MdeModulePkg/Core/Pei/Image/Image.c | 18 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/PeiMain.inf | 6 |
2 files changed, 18 insertions, 6 deletions
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
);
diff --git a/MdeModulePkg/Core/Pei/PeiMain.inf b/MdeModulePkg/Core/Pei/PeiMain.inf index 392a548e24..b9787f81e8 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.inf +++ b/MdeModulePkg/Core/Pei/PeiMain.inf @@ -102,6 +102,8 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv
-[BuildOptions.common]
- MSFT:DEBUG_*_IA32_CC_FLAGS = /FAcs
+[FeaturePcd.common]
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst
+
+
|