aboutsummaryrefslogtreecommitdiff
path: root/gdbstub.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-02-28 22:37:42 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-02-28 22:37:42 +0000
commit36d239587370c6ccfc53d7f6acc624ce5d61fe84 (patch)
tree43d11aaf52a198b5544bbb7e878c6cb633dec299 /gdbstub.c
parent54d43f70e3b003b5f24ef30ea361e034c2813d9f (diff)
MIPS FPU dynamic activation, part 1, by Herve Poussineau.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2463 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'gdbstub.c')
-rw-r--r--gdbstub.c50
1 files changed, 26 insertions, 24 deletions
diff --git a/gdbstub.c b/gdbstub.c
index 324af4d194..d1f1044894 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -568,19 +568,20 @@ static int cpu_gdb_read_registers(CPUState *env, uint8_t *mem_buf)
*(uint32_t *)ptr = tswapl(env->PC);
ptr += 4;
-#ifdef MIPS_USES_FPU
- for (i = 0; i < 32; i++)
+ if (env->CP0_Config1 & (1 << CP0C1_FP))
{
- *(uint32_t *)ptr = tswapl(FPR_W (env, i));
- ptr += 4;
- }
+ for (i = 0; i < 32; i++)
+ {
+ *(uint32_t *)ptr = tswapl(FPR_W (env, i));
+ ptr += 4;
+ }
- *(uint32_t *)ptr = tswapl(env->fcr31);
- ptr += 4;
+ *(uint32_t *)ptr = tswapl(env->fcr31);
+ ptr += 4;
- *(uint32_t *)ptr = tswapl(env->fcr0);
- ptr += 4;
-#endif
+ *(uint32_t *)ptr = tswapl(env->fcr0);
+ ptr += 4;
+ }
/* 32 FP registers, fsr, fir, fp. Not yet implemented. */
/* what's 'fp' mean here? */
@@ -629,27 +630,28 @@ static void cpu_gdb_write_registers(CPUState *env, uint8_t *mem_buf, int size)
env->PC = tswapl(*(uint32_t *)ptr);
ptr += 4;
-#ifdef MIPS_USES_FPU
- for (i = 0; i < 32; i++)
+ if (env->CP0_Config1 & (1 << CP0C1_FP))
{
- FPR_W (env, i) = tswapl(*(uint32_t *)ptr);
- ptr += 4;
- }
+ for (i = 0; i < 32; i++)
+ {
+ FPR_W (env, i) = tswapl(*(uint32_t *)ptr);
+ ptr += 4;
+ }
- env->fcr31 = tswapl(*(uint32_t *)ptr) & 0x0183FFFF;
- ptr += 4;
+ env->fcr31 = tswapl(*(uint32_t *)ptr) & 0x0183FFFF;
+ ptr += 4;
- env->fcr0 = tswapl(*(uint32_t *)ptr);
- ptr += 4;
+ env->fcr0 = tswapl(*(uint32_t *)ptr);
+ ptr += 4;
- /* set rounding mode */
- RESTORE_ROUNDING_MODE;
+ /* set rounding mode */
+ RESTORE_ROUNDING_MODE;
#ifndef CONFIG_SOFTFLOAT
- /* no floating point exception for native float */
- SET_FP_ENABLE(env->fcr31, 0);
-#endif
+ /* no floating point exception for native float */
+ SET_FP_ENABLE(env->fcr31, 0);
#endif
+ }
}
#elif defined (TARGET_SH4)
static int cpu_gdb_read_registers(CPUState *env, uint8_t *mem_buf)