]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1) If PeiLoadImage fails, the section extraction PPI or Decompress PPI may not be...
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 8 Nov 2007 03:50:37 +0000 (03:50 +0000)
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 8 Nov 2007 03:50:37 +0000 (03:50 +0000)
2) Set the stack to be cacheable before the stack switch occurs so that IPF recovery path will be run from cacheble memory for code, data and stack.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4288 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
MdeModulePkg/Core/Pei/Ipf/SwitchToCacheMode.c
MdeModulePkg/Core/Pei/Memory/MemoryServices.c
MdeModulePkg/Core/Pei/PeiMain/PeiMain.c

index 8fccf3413e0bdca119345ab3d316297ec8e08875..164c2c874623e38db06fe367dbe6aed80031ddd4 100644 (file)
@@ -372,6 +372,12 @@ Returns:
                 );\r
               PERF_END (0, "PEIM", NULL, 0);\r
 \r
+            } else {\r
+              //\r
+              // If PeiLoadImage fails, the section extraction PPI or Decompress PPI may not be ready,\r
+              // we flag that more Peims need to be dispatched.\r
+              //\r
+              PeimNeedingDispatch = TRUE;\r
             }\r
 \r
             //\r
index 45676f0e4907857a65bcc78978631f54d89d0f6f..1f261af5cb503978aa2f764f4a073a4f9181fcfa 100644 (file)
@@ -44,13 +44,6 @@ Returns:
 {\r
   EFI_HOB_HANDOFF_INFO_TABLE    *Phit;\r
 \r
-  if (CoreData == NULL) {\r
-    //\r
-    // the first call with CoreData as NULL.\r
-    //\r
-    return;\r
-  }\r
-  \r
   if ((GetHandOffStatus().r10 & 0xFF) == RecoveryFn) {\r
     CoreData->StackBase = CoreData->StackBase &  CACHE_MODE_ADDRESS_MASK;\r
     CoreData->HobList.Raw = (UINT8 *)((UINTN)CoreData->HobList.Raw & CACHE_MODE_ADDRESS_MASK);\r
index 728b963afafd2e9bbd6fa4ff1bdb3edf720069f7..e2b2ccc30f273a2a997705cb3c7862a476380643 100644 (file)
@@ -114,6 +114,8 @@ Returns:
   UINT64                                PeiStackSize;\r
   UINT64                                EfiFreeMemorySize;\r
   EFI_PHYSICAL_ADDRESS                  PhysicalAddressOfOldHob;\r
+\r
+  DEBUG ((EFI_D_INFO, "PeiInstallPeiMemory MemoryBegin 0x%LX, MemoryLength 0x%LX\n", MemoryBegin, MemoryLength));\r
   \r
   PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS (PeiServices);\r
 \r
@@ -137,8 +139,8 @@ Returns:
 \r
   EfiFreeMemorySize = OldHandOffHob->EfiFreeMemoryBottom - PhysicalAddressOfOldHob;\r
   \r
-  DEBUG ((EFI_D_INFO, "HOBLIST address before memory init = 0x%08x\n", OldHandOffHob));\r
-  DEBUG ((EFI_D_INFO, "HOBLIST address after memory init = 0x%08x\n", NewHandOffHob));\r
+  DEBUG ((EFI_D_INFO, "HOBLIST address before memory init = 0x%p\n",  OldHandOffHob));\r
+  DEBUG ((EFI_D_INFO, "HOBLIST address after memory init = 0x%p\n", NewHandOffHob));\r
 \r
   CopyMem (\r
     NewHandOffHob,\r
@@ -155,7 +157,13 @@ Returns:
   NewHandOffHob->EfiEndOfHobList     = (UINTN)NewHandOffHob +\r
                                        (OldHandOffHob->EfiEndOfHobList -\r
                                         PhysicalAddressOfOldHob);\r
-\r
+  \r
+  //\r
+  // For IPF in CAR mode the real memory access is uncached,in InstallPeiMemory()\r
+  //  the 63-bit of address is set to 1.\r
+  //\r
+  SWITCH_TO_CACHE_MODE (PrivateData);\r
+  \r
   ConvertPpiPointers (PeiServices, OldHandOffHob, NewHandOffHob);\r
 \r
   BuildStackHob (PrivateData->StackBase, PrivateData->StackSize);\r
@@ -223,6 +231,7 @@ Returns:
     Hob.HandoffInformationTable->EfiFreeMemoryTop -= Offset;\r
   }\r
 \r
+  ASSERT (Hob.HandoffInformationTable->EfiFreeMemoryTop >= Hob.HandoffInformationTable->EfiFreeMemoryBottom);\r
   //\r
   // Verify that there is sufficient memory to satisfy the allocation\r
   //\r
index 5c6efb95c0013f718ae40300f943dc5dc04408d4..7f7a8cf670e3c2c47856bd31de112807d0c4f0de 100644 (file)
@@ -135,12 +135,6 @@ Returns:
     }\r
   }\r
 \r
-  //\r
-  // For IPF in CAR mode the real memory access is uncached,in InstallPeiMemory()\r
-  //  the 63-bit of address is set to 1.\r
-  //\r
-  SWITCH_TO_CACHE_MODE (OldCoreData);\r
-\r
   if (OldCoreData != NULL) {\r
     CopyMem (&PrivateData, OldCoreData, sizeof (PEI_CORE_INSTANCE));\r
     \r
@@ -312,3 +306,4 @@ Returns:
   return EFI_NOT_FOUND;\r
 }\r
 \r
+\r