summaryrefslogtreecommitdiffstats
path: root/target-arm/op_helper.c
diff options
context:
space:
mode:
authorSoren Brinkmann2015-11-03 14:49:41 +0100
committerPeter Maydell2015-11-03 14:49:41 +0100
commit99a99c1fc8e9bfec1656ac5916c53977a93d3581 (patch)
tree061b54dc59630c9633ca671867d75975f1948d52 /target-arm/op_helper.c
parentMerge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20151103-1' into st... (diff)
downloadqemu-99a99c1fc8e9bfec1656ac5916c53977a93d3581.tar.gz
qemu-99a99c1fc8e9bfec1656ac5916c53977a93d3581.tar.xz
qemu-99a99c1fc8e9bfec1656ac5916c53977a93d3581.zip
target-arm: Add and use symbolic names for register banks
Add BANK_<cpumode> #defines to index banked registers. Suggested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target-arm/op_helper.c')
-rw-r--r--target-arm/op_helper.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c
index a4c4ebf9cd..b5db345ccd 100644
--- a/target-arm/op_helper.c
+++ b/target-arm/op_helper.c
@@ -392,9 +392,9 @@ uint32_t HELPER(get_user_reg)(CPUARMState *env, uint32_t regno)
uint32_t val;
if (regno == 13) {
- val = env->banked_r13[0];
+ val = env->banked_r13[BANK_USRSYS];
} else if (regno == 14) {
- val = env->banked_r14[0];
+ val = env->banked_r14[BANK_USRSYS];
} else if (regno >= 8
&& (env->uncached_cpsr & 0x1f) == ARM_CPU_MODE_FIQ) {
val = env->usr_regs[regno - 8];
@@ -407,9 +407,9 @@ uint32_t HELPER(get_user_reg)(CPUARMState *env, uint32_t regno)
void HELPER(set_user_reg)(CPUARMState *env, uint32_t regno, uint32_t val)
{
if (regno == 13) {
- env->banked_r13[0] = val;
+ env->banked_r13[BANK_USRSYS] = val;
} else if (regno == 14) {
- env->banked_r14[0] = val;
+ env->banked_r14[BANK_USRSYS] = val;
} else if (regno >= 8
&& (env->uncached_cpsr & 0x1f) == ARM_CPU_MODE_FIQ) {
env->usr_regs[regno - 8] = val;