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/Pei/Image/Image.c | |
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/Pei/Image/Image.c')
-rw-r--r-- | MdeModulePkg/Core/Pei/Image/Image.c | 18 |
1 files changed, 14 insertions, 4 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
);
|