diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2016-08-10 16:55:23 +0200 |
---|---|---|
committer | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2016-08-11 13:25:06 +0200 |
commit | 926059304e8377fc37bb848d06d9419f419d93ff (patch) | |
tree | f75bb437f33a71d6fa21fe85efdc3c917ca95ad8 /ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S | |
parent | c17ae4cf8e07b2a6bbaef787d511dee81f3115fe (diff) | |
download | edk2-926059304e8377fc37bb848d06d9419f419d93ff.tar.gz edk2-926059304e8377fc37bb848d06d9419f419d93ff.tar.bz2 edk2-926059304e8377fc37bb848d06d9419f419d93ff.zip |
ArmPlatformPkg/ArmPlatformStackLib: switch to ASM_FUNC() asm macro
Annotate functions with ASM_FUNC() so that they are emitted into
separate sections.
While we're at it, replace some inefficient uses of LoadConstantToReg(),
and remove the workaround that was added to allow conditional branches
to functions with external linkage.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S')
-rw-r--r-- | ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S b/ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S index 96e925981f..bdd7a27b7c 100644 --- a/ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S +++ b/ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S @@ -12,21 +12,6 @@ //
#include <AsmMacroIoLib.h>
-#include <Base.h>
-#include <AutoGen.h>
-
-.text
-.align 3
-
-GCC_ASM_EXPORT(ArmPlatformStackSet)
-GCC_ASM_EXPORT(ArmPlatformStackSetPrimary)
-GCC_ASM_EXPORT(ArmPlatformStackSetSecondary)
-
-GCC_ASM_IMPORT(ArmPlatformIsPrimaryCore)
-GCC_ASM_IMPORT(ArmPlatformGetCorePosition)
-GCC_ASM_IMPORT(ArmPlatformGetPrimaryCoreMpId)
-
-GCC_ASM_IMPORT(gPcd_FixedAtBuild_PcdCoreCount)
//VOID
//ArmPlatformStackSet (
@@ -35,7 +20,7 @@ GCC_ASM_IMPORT(gPcd_FixedAtBuild_PcdCoreCount) // IN UINTN PrimaryStackSize,
// IN UINTN SecondaryStackSize
// );
-ASM_PFX(ArmPlatformStackSet):
+ASM_FUNC(ArmPlatformStackSet)
// Save parameters
mov r6, r3
mov r5, r2
@@ -69,16 +54,14 @@ ASM_PFX(ArmPlatformStackSet): // IN UINTN PrimaryStackSize,
// IN UINTN SecondaryStackSize
// );
-ASM_PFX(ArmPlatformStackSetPrimary):
+ASM_FUNC(ArmPlatformStackSetPrimary)
mov r4, lr
// Add stack of primary stack to StackBase
add r0, r0, r2
// Compute SecondaryCoresCount * SecondaryCoreStackSize
- LoadConstantToReg (_gPcd_FixedAtBuild_PcdCoreCount, r1)
- ldr r1, [r1]
- sub r1, #1
+ MOV32 (r1, FixedPcdGet32(PcdCoreCount) - 1)
mul r3, r3, r1
// Set Primary Stack ((StackBase + PrimaryStackSize) + (SecondaryCoresCount * SecondaryCoreStackSize))
@@ -93,7 +76,7 @@ ASM_PFX(ArmPlatformStackSetPrimary): // IN UINTN PrimaryStackSize,
// IN UINTN SecondaryStackSize
// );
-ASM_PFX(ArmPlatformStackSetSecondary):
+ASM_FUNC(ArmPlatformStackSetSecondary)
mov r4, lr
mov sp, r0
|