diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-24 15:08:09 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-24 15:08:09 +0000 |
commit | b4f8d821e5211bbb51a278ba0fc4a4db2d581221 (patch) | |
tree | a65b12f3f18e1fc5f137cc17ae994c49ccc903f7 /target-ppc/translate_init.c | |
parent | 2495152227b73a277019453990eac4025220156b (diff) | |
download | hqemu-b4f8d821e5211bbb51a278ba0fc4a4db2d581221.zip hqemu-b4f8d821e5211bbb51a278ba0fc4a4db2d581221.tar.gz |
target-ppc: Add Altivec register read/write using XML
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6424 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/translate_init.c')
-rw-r--r-- | target-ppc/translate_init.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index 21cb894..c90ae19 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -9299,6 +9299,52 @@ static int gdb_set_float_reg(CPUState *env, uint8_t *mem_buf, int n) return 0; } +static int gdb_get_avr_reg(CPUState *env, uint8_t *mem_buf, int n) +{ + if (n < 32) { +#ifdef WORDS_BIGENDIAN + stq_p(mem_buf, env->avr[n].u64[0]); + stq_p(mem_buf+8, env->avr[n].u64[1]); +#else + stq_p(mem_buf, env->avr[n].u64[1]); + stq_p(mem_buf+8, env->avr[n].u64[0]); +#endif + return 16; + } + if (n == 33) { + stl_p(mem_buf, env->vscr); + return 4; + } + if (n == 34) { + stl_p(mem_buf, (uint32_t)env->spr[SPR_VRSAVE]); + return 4; + } + return 0; +} + +static int gdb_set_avr_reg(CPUState *env, uint8_t *mem_buf, int n) +{ + if (n < 32) { +#ifdef WORDS_BIGENDIAN + env->avr[n].u64[0] = ldq_p(mem_buf); + env->avr[n].u64[1] = ldq_p(mem_buf+8); +#else + env->avr[n].u64[1] = ldq_p(mem_buf); + env->avr[n].u64[0] = ldq_p(mem_buf+8); +#endif + return 16; + } + if (n == 33) { + env->vscr = ldl_p(mem_buf); + return 4; + } + if (n == 34) { + env->spr[SPR_VRSAVE] = (target_ulong)ldl_p(mem_buf); + return 4; + } + return 0; +} + int cpu_ppc_register_internal (CPUPPCState *env, const ppc_def_t *def) { env->msr_mask = def->msr_mask; @@ -9316,6 +9362,10 @@ int cpu_ppc_register_internal (CPUPPCState *env, const ppc_def_t *def) gdb_register_coprocessor(env, gdb_get_float_reg, gdb_set_float_reg, 33, "power-fpu.xml", 0); } + if (def->insns_flags & PPC_ALTIVEC) { + gdb_register_coprocessor(env, gdb_get_avr_reg, gdb_set_avr_reg, + 34, "power-altivec.xml", 0); + } #if defined(PPC_DUMP_CPU) { const char *mmu_model, *excp_model, *bus_model; |