]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/PrePi: remove global variable allocation from lowlevel init
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 27 Nov 2015 17:07:06 +0000 (17:07 +0000)
committerabiesheuvel <abiesheuvel@Edk2>
Fri, 27 Nov 2015 17:07:06 +0000 (17:07 +0000)
Now that we dropped all ArmPlatformGlobalVariableLib dependencies,
there is no longer a need to allocate and clear out the global
variable region in the PrePi init code. So remove it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18992 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S
ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.S
ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.asm
ArmPlatformPkg/PrePi/MainMPCore.c
ArmPlatformPkg/PrePi/MainUniCore.c
ArmPlatformPkg/PrePi/PeiMPCore.inf
ArmPlatformPkg/PrePi/PeiUniCore.inf
ArmPlatformPkg/PrePi/PrePi.c
ArmPlatformPkg/PrePi/PrePi.h

index 0d0e3e17c170eea5db2771791d89db7d67aeb4a4..f63fd44067fc782c21e8df54df440f1e21c13d82 100644 (file)
@@ -133,16 +133,10 @@ _GetStackBase:
   cmp   x0, #1\r
   bne   _PrepareArguments\r
 \r
-_ReserveGlobalVariable:\r
-  LoadConstantToReg (FixedPcdGet32(PcdPeiGlobalVariableSize), x0)\r
-  // InitializePrimaryStack($GlobalVariableSize, $Tmp1, $Tmp2)\r
-  InitializePrimaryStack(x0, x1, x2)\r
-\r
 _PrepareArguments:\r
   mov   x0, x10\r
   mov   x1, x11\r
   mov   x2, x12\r
-  mov   x3, 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
@@ -152,7 +146,6 @@ _PrepareArguments:
   //    x0 = MpId\r
   //    x1 = UefiMemoryBase\r
   //    x2 = StacksBase\r
-  //    x3 = GlobalVariableBase\r
   blr   x4\r
 \r
 _NeverReturn:\r
index f64934480ff4fabc6c43a02c30e06a0ac27cc5ac..1311efc5cb2cabd40129671b6865c0c84244aeb4 100644 (file)
@@ -141,11 +141,6 @@ _GetStackBase:
   cmp   r0, #1\r
   bne   _PrepareArguments\r
 \r
-_ReserveGlobalVariable:\r
-  LoadConstantToReg (FixedPcdGet32(PcdPeiGlobalVariableSize), r0)\r
-  // InitializePrimaryStack($GlobalVariableSize, $Tmp1)\r
-  InitializePrimaryStack(r0, r1)\r
-\r
 _PrepareArguments:\r
   mov   r0, r8\r
   mov   r1, r9\r
@@ -160,7 +155,6 @@ _PrepareArguments:
   //    r0 = MpId\r
   //    r1 = UefiMemoryBase\r
   //    r2 = StacksBase\r
-  //    r3 = GlobalVariableBase\r
   blx   r4\r
 \r
 _NeverReturn:\r
index f73c56850d99b455848f97d5741beb7253a22d91..a20e3fde0bda5febe4746f68cc8aa8e7670bc4a9 100644 (file)
@@ -143,16 +143,10 @@ _GetStackBase
   cmp   r0, #1\r
   bne   _PrepareArguments\r
 \r
-_ReserveGlobalVariable\r
-  LoadConstantToReg (FixedPcdGet32(PcdPeiGlobalVariableSize), r0)\r
-  // InitializePrimaryStack($GlobalVariableSize, $Tmp1)\r
-  InitializePrimaryStack r0, r1\r
-\r
 _PrepareArguments\r
   mov   r0, r8\r
   mov   r1, r9\r
   mov   r2, r10\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
@@ -162,7 +156,6 @@ _PrepareArguments
   //    r0 = MpId\r
   //    r1 = UefiMemoryBase\r
   //    r2 = StacksBase\r
-  //    r3 = GlobalVariableBase\r
   blx   r4\r
 \r
 _NeverReturn\r
index bf813730d341aef0bcc65339f92aee49f92b1f04..603f4bb8be3f934b399df4615f5f3b5a3702048b 100644 (file)
@@ -22,7 +22,6 @@ VOID
 PrimaryMain (\r
   IN  UINTN                     UefiMemoryBase,\r
   IN  UINTN                     StacksBase,\r
-  IN  UINTN                     GlobalVariableBase,\r
   IN  UINT64                    StartTimeStamp\r
   )\r
 {\r
@@ -35,7 +34,7 @@ PrimaryMain (
     ArmGicSendSgiTo (PcdGet32(PcdGicDistributorBase), ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE, 0x0E, PcdGet32 (PcdGicSgiIntId));\r
   }\r
 \r
-  PrePiMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp);\r
+  PrePiMain (UefiMemoryBase, StacksBase, StartTimeStamp);\r
 \r
   // We must never return\r
   ASSERT(FALSE);\r
index 43588a50ddb5f5622c7028e1ad846e6ed0118aa0..49b02338ebc2f44433649d69f177a34808040152 100644 (file)
@@ -18,7 +18,6 @@ VOID
 PrimaryMain (\r
   IN  UINTN                     UefiMemoryBase,\r
   IN  UINTN                     StacksBase,\r
-  IN  UINTN                     GlobalVariableBase,\r
   IN  UINT64                    StartTimeStamp\r
   )\r
 {\r
@@ -27,7 +26,7 @@ PrimaryMain (
     ASSERT(ArmIsMpCore() == 0);\r
   DEBUG_CODE_END();\r
 \r
-  PrePiMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp);\r
+  PrePiMain (UefiMemoryBase, StacksBase, StartTimeStamp);\r
 \r
   // We must never return\r
   ASSERT(FALSE);\r
index ac1f8d0391c00fd5ba393898480ecb0d5932a51a..4ce4a52784726a89fd09228fcd52aa1e6f87c85f 100755 (executable)
@@ -67,7 +67,6 @@
   gArmMpCoreInfoPpiGuid\r
 \r
 [Guids]\r
-  gArmGlobalVariableGuid\r
   gArmMpCoreInfoGuid\r
 \r
 [FeaturePcd]\r
@@ -89,8 +88,6 @@
   gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize\r
   gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize\r
 \r
-  gArmPlatformTokenSpaceGuid.PcdPeiGlobalVariableSize\r
-\r
   gArmTokenSpaceGuid.PcdGicDistributorBase\r
   gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase\r
   gArmTokenSpaceGuid.PcdGicSgiIntId\r
index c5663901c93ec83824106d6ccb2c02d0117f297e..85114af7d1a8c37ea941a0714de697dc2bef754d 100755 (executable)
@@ -66,7 +66,6 @@
   gArmMpCoreInfoPpiGuid\r
 \r
 [Guids]\r
-  gArmGlobalVariableGuid\r
   gArmMpCoreInfoGuid\r
 \r
 [FeaturePcd]\r
@@ -88,8 +87,6 @@
   gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize\r
   gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize\r
 \r
-  gArmPlatformTokenSpaceGuid.PcdPeiGlobalVariableSize\r
-\r
   gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize\r
 \r
   gArmPlatformTokenSpaceGuid.PcdCoreCount\r
index 99afe6fa9064b6b2dc055ff168277c7560757e15..b563b5ee3a8f6009cecbb3fd907366a7e7d6f3ed 100755 (executable)
@@ -25,7 +25,6 @@
 #include <Ppi/GuidedSectionExtraction.h>\r
 #include <Ppi/ArmMpCoreInfo.h>\r
 #include <Guid/LzmaDecompress.h>\r
-#include <Guid/ArmGlobalVariableHob.h>\r
 \r
 #include "PrePi.h"\r
 #include "LzmaDecompress.h"\r
@@ -33,9 +32,6 @@
 #define IS_XIP() (((UINT32)FixedPcdGet32 (PcdFdBaseAddress) > mSystemMemoryEnd) || \\r
                   ((FixedPcdGet32 (PcdFdBaseAddress) + FixedPcdGet32 (PcdFdSize)) < FixedPcdGet64 (PcdSystemMemoryBase)))\r
 \r
-// Not used when PrePi in run in XIP mode\r
-UINTN mGlobalVariableBase = 0;\r
-\r
 EFI_STATUS\r
 EFIAPI\r
 ExtractGuidedSectionLibConstructor (\r
@@ -48,23 +44,6 @@ LzmaDecompressLibConstructor (
   VOID\r
   );\r
 \r
-VOID\r
-EFIAPI\r
-BuildGlobalVariableHob (\r
-  IN EFI_PHYSICAL_ADDRESS         GlobalVariableBase,\r
-  IN UINT32                       GlobalVariableSize\r
-  )\r
-{\r
-  ARM_HOB_GLOBAL_VARIABLE  *Hob;\r
-\r
-  Hob = CreateHob (EFI_HOB_TYPE_GUID_EXTENSION, sizeof (ARM_HOB_GLOBAL_VARIABLE));\r
-  ASSERT(Hob != NULL);\r
-\r
-  CopyGuid (&(Hob->Header.Name), &gArmGlobalVariableGuid);\r
-  Hob->GlobalVariableBase = GlobalVariableBase;\r
-  Hob->GlobalVariableSize = GlobalVariableSize;\r
-}\r
-\r
 EFI_STATUS\r
 GetPlatformPpi (\r
   IN  EFI_GUID  *PpiGuid,\r
@@ -93,7 +72,6 @@ VOID
 PrePiMain (\r
   IN  UINTN                     UefiMemoryBase,\r
   IN  UINTN                     StacksBase,\r
-  IN  UINTN                     GlobalVariableBase,\r
   IN  UINT64                    StartTimeStamp\r
   )\r
 {\r
@@ -146,9 +124,6 @@ PrePiMain (
   }\r
   BuildStackHob (StacksBase, StacksSize);\r
 \r
-  // Declare the Global Variable HOB\r
-  BuildGlobalVariableHob (GlobalVariableBase, FixedPcdGet32 (PcdPeiGlobalVariableSize));\r
-\r
   //TODO: Call CpuPei as a library\r
   BuildCpuHob (PcdGet8 (PcdPrePiCpuMemorySize), PcdGet8 (PcdPrePiCpuIoSize));\r
 \r
@@ -203,8 +178,7 @@ VOID
 CEntryPoint (\r
   IN  UINTN                     MpId,\r
   IN  UINTN                     UefiMemoryBase,\r
-  IN  UINTN                     StacksBase,\r
-  IN  UINTN                     GlobalVariableBase\r
+  IN  UINTN                     StacksBase\r
   )\r
 {\r
   UINT64   StartTimeStamp;\r
@@ -235,7 +209,6 @@ CEntryPoint (
   // Define the Global Variable region when we are not running in XIP\r
   if (!IS_XIP()) {\r
     if (ArmPlatformIsPrimaryCore (MpId)) {\r
-      mGlobalVariableBase = GlobalVariableBase;\r
       if (ArmIsMpCore()) {\r
         // Signal the Global Variable Region is defined (event: ARM_CPU_EVENT_DEFAULT)\r
         ArmCallSEV ();\r
@@ -249,7 +222,7 @@ CEntryPoint (
   // If not primary Jump to Secondary Main\r
   if (ArmPlatformIsPrimaryCore (MpId)) {\r
     // Goto primary Main.\r
-    PrimaryMain (UefiMemoryBase, StacksBase, GlobalVariableBase, StartTimeStamp);\r
+    PrimaryMain (UefiMemoryBase, StacksBase, StartTimeStamp);\r
   } else {\r
     SecondaryMain (MpId);\r
   }\r
index 6e90c2afc89a8bd407adfee63b98b4740e8f1b86..e7f58e59240c92dd13c4bf7b36143d4b71d21455 100644 (file)
@@ -41,7 +41,6 @@ VOID
 PrePiMain (\r
   IN  UINTN                     UefiMemoryBase,\r
   IN  UINTN                     StacksBase,\r
-  IN  UINTN                     GlobalVariableBase,\r
   IN  UINT64                    StartTimeStamp\r
   );\r
 \r
@@ -62,7 +61,6 @@ VOID
 PrimaryMain (\r
   IN  UINTN                     UefiMemoryBase,\r
   IN  UINTN                     StacksBase,\r
-  IN  UINTN                     GlobalVariableBase,\r
   IN  UINT64                    StartTimeStamp\r
   );\r
 \r