Blame 0014-target-ppc-gdbstub-fix-float-registers-for-little-en.patch

7d975d
From: Greg Kurz <gkurz@linux.vnet.ibm.com>
7d975d
Date: Fri, 15 Jan 2016 16:00:25 +0100
7d975d
Subject: [PATCH] target-ppc: gdbstub: fix float registers for little-endian
7d975d
 guests
7d975d
7d975d
Let's reuse the ppc_maybe_bswap_register() helper, like we already do
7d975d
with the general registers.
7d975d
7d975d
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
7d975d
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
7d975d
(cherry picked from commit 385abeb3e356452eace44f3fe15e18c2532dcaa7)
7d975d
---
7d975d
 target-ppc/translate_init.c | 4 ++++
7d975d
 1 file changed, 4 insertions(+)
7d975d
7d975d
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
7d975d
index e88dc7f..d31d7f6 100644
7d975d
--- a/target-ppc/translate_init.c
7d975d
+++ b/target-ppc/translate_init.c
7d975d
@@ -8755,10 +8755,12 @@ static int gdb_get_float_reg(CPUPPCState *env, uint8_t *mem_buf, int n)
7d975d
 {
7d975d
     if (n < 32) {
7d975d
         stfq_p(mem_buf, env->fpr[n]);
7d975d
+        ppc_maybe_bswap_register(env, mem_buf, 8);
7d975d
         return 8;
7d975d
     }
7d975d
     if (n == 32) {
7d975d
         stl_p(mem_buf, env->fpscr);
7d975d
+        ppc_maybe_bswap_register(env, mem_buf, 4);
7d975d
         return 4;
7d975d
     }
7d975d
     return 0;
7d975d
@@ -8767,10 +8769,12 @@ static int gdb_get_float_reg(CPUPPCState *env, uint8_t *mem_buf, int n)
7d975d
 static int gdb_set_float_reg(CPUPPCState *env, uint8_t *mem_buf, int n)
7d975d
 {
7d975d
     if (n < 32) {
7d975d
+        ppc_maybe_bswap_register(env, mem_buf, 8);
7d975d
         env->fpr[n] = ldfq_p(mem_buf);
7d975d
         return 8;
7d975d
     }
7d975d
     if (n == 32) {
7d975d
+        ppc_maybe_bswap_register(env, mem_buf, 4);
7d975d
         helper_store_fpscr(env, ldl_p(mem_buf), 0xffffffff);
7d975d
         return 4;
7d975d
     }