From 66edb631f8a284a9a0884eb6a41a603112dbff52 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Wed, 10 Aug 2016 15:50:25 +0200 Subject: ArmPlatformPkg RVCT: drop dependency on GCC macro library 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 Reviewed-by: Leif Lindholm --- ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.asm | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'ArmPlatformPkg/PrePi') diff --git a/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.asm b/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.asm index a20e3fd..0233398 100644 --- a/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.asm +++ b/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.asm @@ -11,11 +11,7 @@ // // -#include -#include -#include #include - #include INCLUDE AsmMacroIoLib.inc @@ -59,8 +55,8 @@ _SystemMemoryEndInit cmp r1, #0 bne _SetupStackPosition - LoadConstantToReg (FixedPcdGet32(PcdSystemMemoryBase), r1) - LoadConstantToReg (FixedPcdGet32(PcdSystemMemorySize), r2) + mov32 r1, FixedPcdGet32(PcdSystemMemoryBase) + mov32 r2, FixedPcdGet32(PcdSystemMemorySize) sub r2, r2, #1 add r1, r1, r2 // Update the global variable @@ -71,13 +67,13 @@ _SetupStackPosition // r1 = SystemMemoryTop // Calculate Top of the Firmware Device - LoadConstantToReg (FixedPcdGet32(PcdFdBaseAddress), r2) - LoadConstantToReg (FixedPcdGet32(PcdFdSize), r3) + mov32 r2, FixedPcdGet32(PcdFdBaseAddress) + mov32 r3, FixedPcdGet32(PcdFdSize) sub r3, r3, #1 add r3, r3, r2 // r3 = FdTop = PcdFdBaseAddress + PcdFdSize // UEFI Memory Size (stacks are allocated in this region) - LoadConstantToReg (FixedPcdGet32(PcdSystemMemoryUefiRegionSize), r4) + mov32 r4, FixedPcdGet32(PcdSystemMemoryUefiRegionSize) // // Reserve the memory for the UEFI region (contain stacks on its top) @@ -108,7 +104,7 @@ _SetupAlignedStack _SetupOverflowStack // Case memory at the top of the address space. Ensure the top of the stack is EFI_PAGE_SIZE // aligned (4KB) - LoadConstantToReg (EFI_PAGE_MASK, r9) + mov32 r9, EFI_PAGE_MASK and r9, r9, r1 sub r1, r1, r9 @@ -119,22 +115,19 @@ _GetBaseUefiMemory _GetStackBase // r1 = The top of the Mpcore Stacks // Stack for the primary core = PrimaryCoreStack - LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2) + mov32 r2, FixedPcdGet32(PcdCPUCorePrimaryStackSize) sub r10, r1, r2 // Stack for the secondary core = Number of Cores - 1 - LoadConstantToReg (FixedPcdGet32(PcdCoreCount), r0) - sub r0, r0, #1 - LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r1) - mul r1, r1, r0 + mov32 r1, (FixedPcdGet32(PcdCoreCount) - 1) * FixedPcdGet32(PcdCPUCoreSecondaryStackSize) sub r10, r10, r1 // r10 = The base of the MpCore Stacks (primary stack & secondary stacks) mov r0, r10 mov r1, r8 //ArmPlatformStackSet(StackBase, MpId, PrimaryStackSize, SecondaryStackSize) - LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2) - LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r3) + mov32 r2, FixedPcdGet32(PcdCPUCorePrimaryStackSize) + mov32 r3, FixedPcdGet32(PcdCPUCoreSecondaryStackSize) bl ArmPlatformStackSet // Is it the Primary Core ? -- cgit v1.1