]> git.proxmox.com Git - mirror_edk2.git/commit
ArmPlatformPkg/ArmPlatformStackLib: use callee preserved registers
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 22 Feb 2017 09:38:18 +0000 (09:38 +0000)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 22 Feb 2017 13:22:41 +0000 (13:22 +0000)
commit91231b55d5302065fac71bf5040809aec65bb2f7
tree89fa4a1e535c8aca08e2181e69c1234ae9d0f7e9
parent88dab294d249f2cc22a72a0c2aa307d8432492b9
ArmPlatformPkg/ArmPlatformStackLib: use callee preserved registers

The entry code in ArmPlatformStackSet () is a 1:1 transliteration of the
ARM version, which uses the callee preserved registers r3 - r7 (*) to
preserve the function arguments and the link register across a call to
ArmPlatformIsPrimaryCore ().

However, x3 - x7 are not callee preserved on AARCH64, and so we should use
registers >= x19 instead. While we're at it, drop an unnecessary preserve
of the link register, and simplify/deobfuscate the calculation of the
secondary stack position.

(*) Note that r3 is not actually a callee saved register even on ARM.

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/Library/ArmPlatformStackLib/AArch64/ArmPlatformStackLib.S