]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add a feature flag to allow platform developer to decide if TE or PE32 section should...
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 15 Nov 2007 09:00:14 +0000 (09:00 +0000)
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 15 Nov 2007 09:00:14 +0000 (09:00 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4298 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Pei/Image/Image.c
MdeModulePkg/Core/Pei/PeiMain.inf
MdeModulePkg/MdeModulePkg.dec

index ecb9de7684445f283f56ca0d29dc9c154b3fbd50..0c627c17b436c4e4b36f34da88301a00dbba3f56 100644 (file)
@@ -326,25 +326,35 @@ Returns:
   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
index 392a548e248097937c78533e30ea67cf73fd4f54..b9787f81e8d4e0c0aec75207f42a3a70da7daad7 100644 (file)
   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
index c7ed1b2daa4436ff5ace6b17d2726f56e81f6c68..a4a74cbf5bb825a4b5430b7b5abe9cdefad6cec2 100644 (file)
   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