]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/PrePi: Removed the dependency on 'PcdCPUCoresNonSecStackBase'
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 22 Sep 2011 23:07:55 +0000 (23:07 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 22 Sep 2011 23:07:55 +0000 (23:07 +0000)
In PrePi the StackBase is automatically calculated from the top of the memory.
The information is now passed from the assembly files to the C code.

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

ArmPlatformPkg/PrePi/MainMPCore.c
ArmPlatformPkg/PrePi/MainUniCore.c
ArmPlatformPkg/PrePi/ModuleEntryPoint.S
ArmPlatformPkg/PrePi/ModuleEntryPoint.asm
ArmPlatformPkg/PrePi/PrePi.c
ArmPlatformPkg/PrePi/PrePi.h
BeagleBoardPkg/BeagleBoardPkg-next.dsc

index 2f1f86a4b72783dce1f51c8fc2c3445453a72773..139b60289eee749a31cb4ae3bffea919860f629b 100644 (file)
@@ -21,6 +21,8 @@
 VOID\r
 PrimaryMain (\r
   IN  UINTN                     UefiMemoryBase,\r
+  IN  UINTN                     StacksBase,\r
+  IN  UINTN                     GlobalVariableBase,\r
   IN  UINT64                    StartTimeStamp\r
   )\r
 {\r
@@ -33,7 +35,7 @@ PrimaryMain (
     ArmGicSendSgiTo (PcdGet32(PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E);\r
   }\r
 \r
-  PrePiMain (UefiMemoryBase, StartTimeStamp);\r
+  PrePiMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp);\r
 \r
   // We must never return\r
   ASSERT(FALSE);\r
index f1dff8af37916bb731789856f2533025a2cff098..e56697ca5088be6b164b83e2b0f083033c82539b 100644 (file)
 VOID\r
 PrimaryMain (\r
   IN  UINTN                     UefiMemoryBase,\r
+  IN  UINTN                     StacksBase,\r
+  IN  UINTN                     GlobalVariableBase,\r
   IN  UINT64                    StartTimeStamp\r
   )\r
 {\r
-  PrePiMain (UefiMemoryBase, StartTimeStamp);\r
+  PrePiMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp);\r
 \r
   // We must never return\r
   ASSERT(FALSE);\r
index 601128b12f2eedcbef0b27551b65a7376bb537b0..d7c4e2e00d34ec097b9e7363e61f07cfcec4d946 100755 (executable)
@@ -133,14 +133,21 @@ _InitGlobals:
 \r
 \r
 _PrepareArguments:\r
+  mov   r0, r5\r
+  mov   r1, r6\r
+  mov   r2, r7\r
+  mov   r3, sp\r
+\r
   // Move sec startup address into a data register\r
   // Ensure we're jumping to FV version of the code (not boot remapped alias)\r
-  ldr   r2, StartupAddr\r
+  ldr   r4, StartupAddr\r
 \r
   // Jump to PrePiCore C code\r
   //    r0 = MpId\r
   //    r1 = UefiMemoryBase\r
-  blx   r2\r
+  //    r2 = StacksBase\r
+  //    r3 = GlobalVariableBase\r
+  blx   r4\r
 \r
 _NeverReturn:\r
   b _NeverReturn\r
index 2c798d09d7b853062cb2ed057628e015365575ca..5b56e66b9bba3478053c10536301870863969974 100644 (file)
@@ -134,14 +134,21 @@ _InitGlobals
 \r
 \r
 _PrepareArguments\r
+  mov   r0, r5\r
+  mov   r1, r6\r
+  mov   r2, r7\r
+  mov   r3, sp\r
+\r
   // Move sec startup address into a data register\r
   // Ensure we're jumping to FV version of the code (not boot remapped alias)\r
-  ldr   r2, StartupAddr\r
+  ldr   r4, StartupAddr\r
 \r
   // Jump to PrePiCore C code\r
   //    r0 = MpId\r
   //    r1 = UefiMemoryBase\r
-  blx   r2\r
+  //    r2 = StacksBase\r
+  //    r3 = GlobalVariableBase\r
+  blx   r4\r
 \r
 _NeverReturn\r
   b _NeverReturn\r
index 64c371c8037d12641cdb6aac3f3df260c3370653..2ca9c3b8fda6f5b6d5f3d99cec58357992f76da2 100755 (executable)
@@ -51,6 +51,8 @@ LzmaDecompressLibConstructor (
 VOID\r
 PrePiMain (\r
   IN  UINTN                     UefiMemoryBase,\r
+  IN  UINTN                     StacksBase,\r
+  IN  UINTN                     GlobalVariableBase,\r
   IN  UINT64                    StartTimeStamp\r
   )\r
 {\r
@@ -58,9 +60,7 @@ PrePiMain (
   EFI_STATUS                    Status;\r
   CHAR8                         Buffer[100];\r
   UINTN                         CharCount;\r
-  UINTN                         UefiMemoryTop;\r
   UINTN                         StacksSize;\r
-  UINTN                         StacksBase;\r
 \r
   // Enable program flow prediction, if supported.\r
   ArmEnableBranchPrediction ();\r
@@ -77,12 +77,6 @@ PrePiMain (
   // Initialize the Debug Agent for Source Level Debugging\r
   InitializeDebugAgent (DEBUG_AGENT_INIT_POSTMEM_SEC, NULL, NULL);\r
   SaveAndSetDebugTimerInterrupt (TRUE);\r
-\r
-  UefiMemoryTop = UefiMemoryBase + FixedPcdGet32 (PcdSystemMemoryUefiRegionSize);\r
-  StacksBase = UefiMemoryTop - StacksSize;\r
-\r
-  // Check the PcdCPUCoresNonSecStackBase match with the calculated StackBase\r
-  ASSERT (StacksBase == PcdGet32 (PcdCPUCoresNonSecStackBase));\r
   \r
   // Declare the PI/UEFI memory region\r
   HobList = HobConstructor (\r
@@ -137,7 +131,9 @@ PrePiMain (
 VOID\r
 CEntryPoint (\r
   IN  UINTN                     MpId,\r
-  IN  UINTN                     UefiMemoryBase\r
+  IN  UINTN                     UefiMemoryBase,\r
+  IN  UINTN                     StacksBase,\r
+  IN  UINTN                     GlobalVariableBase\r
   )\r
 {\r
   UINT64   StartTimeStamp;\r
@@ -170,7 +166,7 @@ CEntryPoint (
   // If not primary Jump to Secondary Main\r
   if (IS_PRIMARY_CORE(MpId)) {\r
     // Goto primary Main.\r
-    PrimaryMain (UefiMemoryBase, StartTimeStamp);\r
+    PrimaryMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp);\r
   } else {\r
     SecondaryMain (MpId);\r
   }\r
index 9cf953a7966e096eefcbf50dc49f45ed11ba18bb..59f597123169dad595a3073c6ae0a5e950fd8341 100644 (file)
@@ -44,6 +44,8 @@ TimerConstructor (
 VOID\r
 PrePiMain (\r
   IN  UINTN                     UefiMemoryBase,\r
+  IN  UINTN                     StacksBase,\r
+  IN  UINTN                     GlobalVariableBase,\r
   IN  UINT64                    StartTimeStamp\r
   );\r
 \r
@@ -63,6 +65,8 @@ PlatformPeim (
 VOID\r
 PrimaryMain (\r
   IN  UINTN                     UefiMemoryBase,\r
+  IN  UINTN                     StacksBase,\r
+  IN  UINTN                     GlobalVariableBase,\r
   IN  UINT64                    StartTimeStamp\r
   );\r
 \r
index 65974d82628c328fa50dcbaea4180a6aa5ed1260..fd9cb5b9a6ffadaacebf356a745c9e5b75a2bb24 100755 (executable)
 \r
 [LibraryClasses.common.SEC]\r
   ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibPrePi.inf\r
+  \r
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
   ReportStatusCodeLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf\r
   UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf\r
 #  DEBUG_LOADFILE  0x00020000  // UNDI Driver\r
 #  DEBUG_EVENT     0x00080000  // Event messages\r
 #  DEBUG_ERROR     0x80000000  // Error\r
-\r
   gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000000F\r
 \r
   gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07\r
 #\r
   gArmTokenSpaceGuid.PcdVFPEnabled|1\r
   \r
-  gArmPlatformTokenSpaceGuid.PcdCPUCoresNonSecStackBase|0x87FE0000 # stack at top of memory\r
-  gArmPlatformTokenSpaceGuid.PcdCPUCoresNonSecStackSize|0x20000  # 128K stack\r
-\r
   gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000\r
   gArmTokenSpaceGuid.PcdSystemMemorySize|0x08000000\r
 \r
   gEmbeddedTokenSpaceGuid.PcdMemoryBase|0x80000000\r
   gEmbeddedTokenSpaceGuid.PcdMemorySize|0x10000000\r
 \r
-\r
   gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x80008000\r
   gArmTokenSpaceGuid.PcdCpuResetAddress|0x80008000\r
   \r