]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg RVCT: drop dependency on GCC macro library
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 10 Aug 2016 13:50:25 +0000 (15:50 +0200)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 11 Aug 2016 10:29:31 +0000 (12:29 +0200)
The RVCT .asm files include AsmMacroIoLib.h only for the definition of
LoadConstantToReg (), which makes it tedious to make change to that file
without the risk of making the RVCT assembler unhappy. So simply replace
LoadConstantToReg() with mov32, which does the right thing in all cases.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Helper.asm
ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Helper.asm
ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/Arm/RTSMHelper.asm
ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibCTA9x4/CTA9x4Boot.asm
ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.asm
ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.asm
ArmPlatformPkg/PrePeiCore/Arm/Exception.asm
ArmPlatformPkg/PrePeiCore/Arm/PrePeiCoreEntryPoint.asm
ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.asm

index f377cf2e72c62cde3dd05711a15678da6f95444a..c035843da078a41e71eac1e9242627778907ac7d 100644 (file)
@@ -11,7 +11,6 @@
 //\r
 //\r
 \r
-#include <AsmMacroIoLib.h>\r
 #include <Library/ArmLib.h>\r
 \r
 #include <ArmPlatform.h>\r
@@ -48,7 +47,7 @@ ArmPlatformGetCorePosition FUNCTION
 ArmPlatformIsPrimaryCore FUNCTION\r
   // Extract cpu_id and cluster_id from ARM_SCC_CFGREG48\r
   // with cpu_id[0:3] and cluster_id[4:7]\r
-  LoadConstantToReg (ARM_CTA15A7_SCC_CFGREG48, r1)\r
+  mov32 r1, ARM_CTA15A7_SCC_CFGREG48\r
   ldr   r1, [r1]\r
   lsr   r1, #24\r
 \r
@@ -62,7 +61,7 @@ ArmPlatformIsPrimaryCore FUNCTION
   orr   r1, r1, r2\r
 \r
   // Keep the Cluster ID and Core ID from the MPID\r
-  LoadConstantToReg (ARM_CLUSTER_MASK :OR: ARM_CORE_MASK, r2)\r
+  mov32 r2, ARM_CLUSTER_MASK :OR: ARM_CORE_MASK\r
   and   r0, r0, r2\r
 \r
   // Compare mpid and boot cpu from ARM_SCC_CFGREG48\r
@@ -79,7 +78,7 @@ ArmPlatformIsPrimaryCore FUNCTION
 ArmPlatformGetPrimaryCoreMpId FUNCTION\r
   // Extract cpu_id and cluster_id from ARM_SCC_CFGREG48\r
   // with cpu_id[0:3] and cluster_id[4:7]\r
-  LoadConstantToReg (ARM_CTA15A7_SCC_CFGREG48, r0)\r
+  mov32 r0, ARM_CTA15A7_SCC_CFGREG48\r
   ldr   r0, [r0]\r
   lsr   r0, #24\r
 \r
index aa48ed730e169b3140a6d0b4bdd2c82347b65d6c..877b4b4a1e55ce9bbf20e22f71c54eeadd6b5e67 100644 (file)
@@ -11,7 +11,6 @@
 //\r
 //\r
 \r
-#include <AsmMacroIoLib.h>\r
 #include <Library/ArmLib.h>\r
 \r
 #include <AutoGen.h>\r
@@ -23,9 +22,6 @@
   EXPORT  ArmPlatformGetPrimaryCoreMpId\r
   EXPORT  ArmPlatformGetCorePosition\r
 \r
-  IMPORT  _gPcd_FixedAtBuild_PcdArmPrimaryCore\r
-  IMPORT  _gPcd_FixedAtBuild_PcdArmPrimaryCoreMask\r
-\r
   AREA CTA9x4Helper, CODE, READONLY\r
 \r
 //UINTN\r
@@ -33,8 +29,7 @@
 //  VOID\r
 //  );\r
 ArmPlatformGetPrimaryCoreMpId FUNCTION\r
-  LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r0)\r
-  ldr     r0, [r0]\r
+  mov32 r0, FixedPcdGet32(PcdArmPrimaryCore)\r
   bx      lr\r
   ENDFUNC\r
 \r
@@ -43,11 +38,9 @@ ArmPlatformGetPrimaryCoreMpId FUNCTION
 //  IN UINTN MpId\r
 //  );\r
 ArmPlatformIsPrimaryCore FUNCTION\r
-  LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask, r1)\r
-  ldr   r1, [r1]\r
+  mov32 r1, FixedPcdGet32(PcdArmPrimaryCoreMask)\r
   and   r0, r0, r1\r
-  LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r1)\r
-  ldr   r1, [r1]\r
+  mov32 r1, FixedPcdGet32(PcdArmPrimaryCore)\r
   cmp   r0, r1\r
   moveq r0, #1\r
   movne r0, #0\r
index f4ad51d36e0685099cd8c74beb69f4d2895812ee..66068e6595db4452db4d754b199f7782ed0525bf 100644 (file)
@@ -11,7 +11,6 @@
 //\r
 //\r
 \r
-#include <AsmMacroIoLib.h>\r
 #include <Base.h>\r
 #include <Library/ArmLib.h>\r
 #include <Library/PcdLib.h>\r
@@ -28,9 +27,6 @@
   EXPORT    ArmPlatformGetPrimaryCoreMpId\r
   EXPORT    ArmPlatformGetCorePosition\r
 \r
-  IMPORT    _gPcd_FixedAtBuild_PcdArmPrimaryCore\r
-  IMPORT    _gPcd_FixedAtBuild_PcdArmPrimaryCoreMask\r
-\r
   AREA RTSMHelper, CODE, READONLY\r
 \r
 ArmPlatformPeiBootAction FUNCTION\r
@@ -52,8 +48,7 @@ ArmGetScuBaseAddress FUNCTION
 //  VOID\r
 //  );\r
 ArmPlatformGetPrimaryCoreMpId FUNCTION\r
-  LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r0)\r
-  ldr   r0, [r0]\r
+  mov32 r0, FixedPcdGet32(PcdArmPrimaryCore)\r
   bx    lr\r
   ENDFUNC\r
 \r
@@ -99,10 +94,9 @@ _Return
 //  IN UINTN MpId\r
 //  );\r
 ArmPlatformIsPrimaryCore FUNCTION\r
-  LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask, r1)\r
-  ldr   r1, [r1]\r
+  mov32 r1, FixedPcdGet32(PcdArmPrimaryCoreMask)\r
   and   r0, r0, r1\r
-  LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r1)\r
+  mov32 r1, FixedPcdGet32(PcdArmPrimaryCore)\r
   ldr   r1, [r1]\r
   cmp   r0, r1\r
   moveq r0, #1\r
index 16fab1605ba10b550a50c6413bf55da7e4ecfbf3..06ce3776fce9e85d1a97383d694787c65d35a139 100644 (file)
@@ -11,7 +11,6 @@
 //\r
 //\r
 \r
-#include <AsmMacroIoLib.h>\r
 #include <Base.h>\r
 #include <Library/ArmPlatformLib.h>\r
 #include <Drivers/PL35xSmc.h>\r
@@ -90,7 +89,7 @@ ArmPlatformSecBootMemoryInit
   //\r
   // Initialize PL354 SMC\r
   //\r
-  LoadConstantToReg (ARM_VE_SMC_CTRL_BASE, r1)\r
+  mov32 r1, ARM_VE_SMC_CTRL_BASE\r
   ldr   r2, =VersatileExpressSmcConfiguration\r
   ldr   r3, =VersatileExpressSmcConfigurationEnd\r
   blx   PL35xSmcInitialize\r
@@ -98,7 +97,7 @@ ArmPlatformSecBootMemoryInit
   //\r
   // Page mode setup for VRAM\r
   //\r
-  LoadConstantToReg (VRAM_MOTHERBOARD_BASE, r2)\r
+  mov32 r2, VRAM_MOTHERBOARD_BASE\r
 \r
   // Read current state\r
   ldr     r0, [r2, #0]\r
index 95704c100a7ad4ab5fc4bc8dcf4fdfd1c21b8b40..c0f9a60dc836ff58c69732017b77770503fc6a25 100644 (file)
@@ -11,7 +11,6 @@
 //\r
 //\r
 \r
-#include <AsmMacroIoLib.h>\r
 #include <Library/ArmLib.h>\r
 \r
   INCLUDE AsmMacroIoLib.inc\r
@@ -47,8 +46,7 @@ ArmPlatformGetCorePosition FUNCTION
 //  VOID\r
 //  );\r
 ArmPlatformGetPrimaryCoreMpId FUNCTION\r
-  LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r0)\r
-  ldr   r0, [r0]\r
+  mov32 r0, FixedPcdGet32(PcdArmPrimaryCore)\r
   bx    lr\r
   ENDFUNC\r
 \r
@@ -57,11 +55,9 @@ ArmPlatformGetPrimaryCoreMpId FUNCTION
 //  IN UINTN MpId\r
 //  );\r
 ArmPlatformIsPrimaryCore FUNCTION\r
-  LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask, r1)\r
-  ldr   r1, [r1]\r
+  mov32 r1, FixedPcdGet32(PcdArmPrimaryCoreMask)\r
   and   r0, r0, r1\r
-  LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r1)\r
-  ldr   r1, [r1]\r
+  mov32 r1, FixedPcdGet32(PcdArmPrimaryCore)\r
   cmp   r0, r1\r
   moveq r0, #1\r
   movne r0, #0\r
index 99218cd10adee69c2a9d7b569be7b1b487006466..9fd8e8e6fa0136daf1b46762bcf907e973218a03 100644 (file)
@@ -11,8 +11,6 @@
 //\r
 //\r
 \r
-#include <AsmMacroIoLib.h>\r
-#include <Base.h>\r
 #include <AutoGen.h>\r
 \r
   INCLUDE AsmMacroIoLib.inc\r
@@ -79,8 +77,7 @@ ArmPlatformStackSetPrimary FUNCTION
   add   r0, r0, r2\r
 \r
   // Compute SecondaryCoresCount * SecondaryCoreStackSize\r
-  LoadConstantToReg (_gPcd_FixedAtBuild_PcdCoreCount, r1)\r
-  ldr   r1, [r1]\r
+  mov32 r1, FixedPcdGet32 (PcdCoreCount)\r
   sub   r1, #1\r
   mul   r3, r3, r1\r
 \r
index de438f913ae1953e3651d64212aedccd9314937b..4ffe2589976cf030f2ac360f6143ba4a2fd8a2c9 100644 (file)
@@ -11,8 +11,6 @@
 //\r
 //\r
 \r
-#include <AsmMacroIoLib.h>\r
-#include <Base.h>\r
 #include <AutoGen.h>\r
 \r
   IMPORT  PeiCommonExceptionEntry\r
index 9a8ca0b1748e606574b0f2ea732ecf38ec311685..abea675828dff7e75a91a8a3d84461949570a0e7 100644 (file)
@@ -11,9 +11,6 @@
 //\r
 //\r
 \r
-#include <AsmMacroIoLib.h>\r
-#include <Base.h>\r
-#include <Library/PcdLib.h>\r
 #include <AutoGen.h>\r
 \r
   INCLUDE AsmMacroIoLib.inc\r
@@ -43,9 +40,7 @@ _ModuleEntryPoint
   bl    ArmPlatformIsPrimaryCore\r
 \r
   // Get the top of the primary stacks (and the base of the secondary stacks)\r
-  LoadConstantToReg (FixedPcdGet64(PcdCPUCoresStackBase), r1)\r
-  LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)\r
-  add   r1, r1, r2\r
+  mov32 r1, FixedPcdGet64(PcdCPUCoresStackBase) + FixedPcdGet32(PcdCPUCorePrimaryStackSize)\r
 \r
   // r0 is equal to 1 if I am the primary core\r
   cmp   r0, #1\r
@@ -62,16 +57,15 @@ _SetupSecondaryCoreStack
   add   r0, r0, #1\r
 \r
   // StackOffset = CorePos * StackSize\r
-  LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r2)\r
+  mov32 r2, FixedPcdGet32(PcdCPUCoreSecondaryStackSize)\r
   mul   r0, r0, r2\r
   // SP = StackBase + StackOffset\r
   add   sp, r6, r0\r
 \r
 _PrepareArguments\r
   // The PEI Core Entry Point has been computed by GenFV and stored in the second entry of the Reset Vector\r
-  LoadConstantToReg (FixedPcdGet32(PcdFvBaseAddress), r2)\r
-  add   r2, r2, #4\r
-  ldr   r1, [r2]\r
+  mov32 r2, FixedPcdGet32(PcdFvBaseAddress)\r
+  ldr   r1, [r2, #4]\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
index a20e3fde0bda5febe4746f68cc8aa8e7670bc4a9..023339841f7529fedc6cdef465ad8261df03ec02 100644 (file)
 //\r
 //\r
 \r
-#include <AsmMacroIoLib.h>\r
-#include <Base.h>\r
-#include <Library/PcdLib.h>\r
 #include <AutoGen.h>\r
-\r
 #include <Chipset/ArmV7.h>\r
 \r
   INCLUDE AsmMacroIoLib.inc\r
@@ -59,8 +55,8 @@ _SystemMemoryEndInit
   cmp   r1, #0\r
   bne   _SetupStackPosition\r
 \r
-  LoadConstantToReg (FixedPcdGet32(PcdSystemMemoryBase), r1)\r
-  LoadConstantToReg (FixedPcdGet32(PcdSystemMemorySize), r2)\r
+  mov32 r1, FixedPcdGet32(PcdSystemMemoryBase)\r
+  mov32 r2, FixedPcdGet32(PcdSystemMemorySize)\r
   sub   r2, r2, #1\r
   add   r1, r1, r2\r
   // Update the global variable\r
@@ -71,13 +67,13 @@ _SetupStackPosition
   // r1 = SystemMemoryTop\r
 \r
   // Calculate Top of the Firmware Device\r
-  LoadConstantToReg (FixedPcdGet32(PcdFdBaseAddress), r2)\r
-  LoadConstantToReg (FixedPcdGet32(PcdFdSize), r3)\r
+  mov32 r2, FixedPcdGet32(PcdFdBaseAddress)\r
+  mov32 r3, FixedPcdGet32(PcdFdSize)\r
   sub   r3, r3, #1\r
   add   r3, r3, r2      // r3 = FdTop = PcdFdBaseAddress + PcdFdSize\r
 \r
   // UEFI Memory Size (stacks are allocated in this region)\r
-  LoadConstantToReg (FixedPcdGet32(PcdSystemMemoryUefiRegionSize), r4)\r
+  mov32 r4, FixedPcdGet32(PcdSystemMemoryUefiRegionSize)\r
 \r
   //\r
   // Reserve the memory for the UEFI region (contain stacks on its top)\r
@@ -108,7 +104,7 @@ _SetupAlignedStack
 _SetupOverflowStack\r
   // Case memory at the top of the address space. Ensure the top of the stack is EFI_PAGE_SIZE\r
   // aligned (4KB)\r
-  LoadConstantToReg (EFI_PAGE_MASK, r9)\r
+  mov32 r9, EFI_PAGE_MASK\r
   and   r9, r9, r1\r
   sub   r1, r1, r9\r
 \r
@@ -119,22 +115,19 @@ _GetBaseUefiMemory
 _GetStackBase\r
   // r1 = The top of the Mpcore Stacks\r
   // Stack for the primary core = PrimaryCoreStack\r
-  LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)\r
+  mov32 r2, FixedPcdGet32(PcdCPUCorePrimaryStackSize)\r
   sub   r10, r1, r2\r
 \r
   // Stack for the secondary core = Number of Cores - 1\r
-  LoadConstantToReg (FixedPcdGet32(PcdCoreCount), r0)\r
-  sub   r0, r0, #1\r
-  LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r1)\r
-  mul   r1, r1, r0\r
+  mov32 r1, (FixedPcdGet32(PcdCoreCount) - 1) * FixedPcdGet32(PcdCPUCoreSecondaryStackSize)\r
   sub   r10, r10, r1\r
 \r
   // r10 = The base of the MpCore Stacks (primary stack & secondary stacks)\r
   mov   r0, r10\r
   mov   r1, r8\r
   //ArmPlatformStackSet(StackBase, MpId, PrimaryStackSize, SecondaryStackSize)\r
-  LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)\r
-  LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r3)\r
+  mov32 r2, FixedPcdGet32(PcdCPUCorePrimaryStackSize)\r
+  mov32 r3, FixedPcdGet32(PcdCPUCoreSecondaryStackSize)\r
   bl    ArmPlatformStackSet\r
 \r
   // Is it the Primary Core ?\r