summaryrefslogtreecommitdiff
path: root/target-arm/gdbstub64.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2013-12-17 19:42:30 +0000
committerPeter Maydell <peter.maydell@linaro.org>2013-12-17 19:42:30 +0000
commitd356312fdc8640af929e0dbab61c6e514d47feb8 (patch)
treeef3cdeaf3ef2e87cb21cc42199f2fe5188f82ae9 /target-arm/gdbstub64.c
parentb197ebd410f0298ec078c3048f9cfb9f6bfc3b3c (diff)
target-arm: Clean up handling of AArch64 PSTATE
The env->pstate field is a little odd since it doesn't strictly speaking represent an architectural register. However it's convenient for QEMU to use it to hold the various PSTATE architectural bits in the same format the architecture specifies for SPSR registers (since this is the same format the kernel uses for signal handlers and the KVM register). Add some structure to how we deal with it: * document what env->pstate is * add some #defines for various bits in it * add helpers for reading/writing it taking account of caching of NZCV, and use them where appropriate * reset it on startup Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1385645602-18662-3-git-send-email-peter.maydell@linaro.org Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'target-arm/gdbstub64.c')
-rw-r--r--target-arm/gdbstub64.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target-arm/gdbstub64.c b/target-arm/gdbstub64.c
index 7cb6a7c0e0..e8a82952a4 100644
--- a/target-arm/gdbstub64.c
+++ b/target-arm/gdbstub64.c
@@ -37,7 +37,7 @@ int aarch64_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
return gdb_get_reg64(mem_buf, env->pc);
break;
case 33:
- return gdb_get_reg32(mem_buf, env->pstate);
+ return gdb_get_reg32(mem_buf, pstate_read(env));
}
/* Unknown register. */
return 0;
@@ -65,7 +65,7 @@ int aarch64_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
return 8;
case 33:
/* CPSR */
- env->pstate = tmp;
+ pstate_write(env, tmp);
return 4;
}
/* Unknown register. */