summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg/PrePi/Arm
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2016-08-05 16:41:32 +0200
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2016-08-10 13:15:15 +0200
commit298f83612375bda69e8a7230dfea036e85eda553 (patch)
tree594a01caa68b6219f366cb1b7ef8b3233fb7a0a3 /ArmVirtPkg/PrePi/Arm
parentaf90df3cb099ed8e009579b7b55e7142dc0fc410 (diff)
downloadedk2-298f83612375bda69e8a7230dfea036e85eda553.tar.gz
edk2-298f83612375bda69e8a7230dfea036e85eda553.tar.bz2
edk2-298f83612375bda69e8a7230dfea036e85eda553.zip
ArmVirtPkg/PrePi: use correct callee saved regs
Both the ARM and the AARCH64 versions of the PrePi code (shared between ArmVirtQemuKernel and ArmVirtXen) 'preserve' values across a function call using registers that are not in fact callee saved. So fix that. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'ArmVirtPkg/PrePi/Arm')
-rw-r--r--ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S10
1 files changed, 5 insertions, 5 deletions
diff --git a/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S b/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S
index 441db36857..3215c7d558 100644
--- a/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S
+++ b/ArmVirtPkg/PrePi/Arm/ModuleEntryPoint.S
@@ -154,17 +154,17 @@ _GetStackBase:
// r1 = The top of the Mpcore Stacks
// Stack for the primary core = PrimaryCoreStack
LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)
- sub r12, r1, r2
+ sub r9, 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
- sub r12, r12, r1
+ sub r9, r9, r1
- // r12 = The base of the MpCore Stacks (primary stack & secondary stacks)
- mov r0, r12
+ // r9 = The base of the MpCore Stacks (primary stack & secondary stacks)
+ mov r0, r9
mov r1, r10
//ArmPlatformStackSet(StackBase, MpId, PrimaryStackSize, SecondaryStackSize)
LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)
@@ -180,7 +180,7 @@ _GetStackBase:
_PrepareArguments:
mov r0, r10
mov r1, r11
- mov r2, r12
+ mov r2, r9
// Move sec startup address into a data register
// Ensure we're jumping to FV version of the code (not boot remapped alias)