summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2013-08-20 14:54:31 +0100
committerPeter Maydell <peter.maydell@linaro.org>2013-08-20 14:54:31 +0100
commit22d9e1a986a671ebfacb21555b7533336f3e8259 (patch)
tree5429ecb3e5ccf7a88a64192e2c91312f5bd39dbf
parentb643e4b90bb0b70adde97a09349d8ca7067309d9 (diff)
downloadqemu-22d9e1a986a671ebfacb21555b7533336f3e8259.tar.gz
qemu-22d9e1a986a671ebfacb21555b7533336f3e8259.tar.bz2
qemu-22d9e1a986a671ebfacb21555b7533336f3e8259.zip
target-arm: Allow raw_read() and raw_write() to handle 64 bit regs
Extend the raw_read() and raw_write() helper accessors so that they can be used for 64 bit registers as well as 32 bit registers. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Laurent Desnogues <laurent.desnogues@gmail.com> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> Message-id: 1376065080-26661-2-git-send-email-peter.maydell@linaro.org
-rw-r--r--target-arm/helper.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/target-arm/helper.c b/target-arm/helper.c
index 6d9026d04c..f8689e2e23 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -67,14 +67,22 @@ static int vfp_gdb_set_reg(CPUARMState *env, uint8_t *buf, int reg)
static int raw_read(CPUARMState *env, const ARMCPRegInfo *ri,
uint64_t *value)
{
- *value = CPREG_FIELD32(env, ri);
+ if (ri->type & ARM_CP_64BIT) {
+ *value = CPREG_FIELD64(env, ri);
+ } else {
+ *value = CPREG_FIELD32(env, ri);
+ }
return 0;
}
static int raw_write(CPUARMState *env, const ARMCPRegInfo *ri,
uint64_t value)
{
- CPREG_FIELD32(env, ri) = value;
+ if (ri->type & ARM_CP_64BIT) {
+ CPREG_FIELD64(env, ri) = value;
+ } else {
+ CPREG_FIELD32(env, ri) = value;
+ }
return 0;
}