|
|
7d975d |
From: Greg Kurz <gkurz@linux.vnet.ibm.com>
|
|
|
7d975d |
Date: Fri, 15 Jan 2016 16:00:18 +0100
|
|
|
7d975d |
Subject: [PATCH] target-ppc: rename and export maybe_bswap_register()
|
|
|
7d975d |
|
|
|
7d975d |
This helper will be used to support FP, Altivec and VSX registers when
|
|
|
7d975d |
the guest is little-endian.
|
|
|
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 376dbce0e3abe456fb8c7a3cd40dc369f8b33d30)
|
|
|
7d975d |
---
|
|
|
7d975d |
target-ppc/cpu.h | 1 +
|
|
|
7d975d |
target-ppc/gdbstub.c | 10 +++++-----
|
|
|
7d975d |
2 files changed, 6 insertions(+), 5 deletions(-)
|
|
|
7d975d |
|
|
|
7d975d |
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
|
|
|
7d975d |
index 9706000..1e2516e 100644
|
|
|
7d975d |
--- a/target-ppc/cpu.h
|
|
|
7d975d |
+++ b/target-ppc/cpu.h
|
|
|
7d975d |
@@ -2355,4 +2355,5 @@ int ppc_get_vcpu_dt_id(PowerPCCPU *cpu);
|
|
|
7d975d |
*/
|
|
|
7d975d |
PowerPCCPU *ppc_get_vcpu_by_dt_id(int cpu_dt_id);
|
|
|
7d975d |
|
|
|
7d975d |
+void ppc_maybe_bswap_register(CPUPPCState *env, uint8_t *mem_buf, int len);
|
|
|
7d975d |
#endif /* !defined (__CPU_PPC_H__) */
|
|
|
7d975d |
diff --git a/target-ppc/gdbstub.c b/target-ppc/gdbstub.c
|
|
|
7d975d |
index 14675f4..b20bb0c 100644
|
|
|
7d975d |
--- a/target-ppc/gdbstub.c
|
|
|
7d975d |
+++ b/target-ppc/gdbstub.c
|
|
|
7d975d |
@@ -88,7 +88,7 @@ static int ppc_gdb_register_len(int n)
|
|
|
7d975d |
the proper ordering for the binary, and cannot be changed.
|
|
|
7d975d |
For system mode, TARGET_WORDS_BIGENDIAN is always set, and we must check
|
|
|
7d975d |
the current mode of the chip to see if we're running in little-endian. */
|
|
|
7d975d |
-static void maybe_bswap_register(CPUPPCState *env, uint8_t *mem_buf, int len)
|
|
|
7d975d |
+void ppc_maybe_bswap_register(CPUPPCState *env, uint8_t *mem_buf, int len)
|
|
|
7d975d |
{
|
|
|
7d975d |
#ifndef CONFIG_USER_ONLY
|
|
|
7d975d |
if (!msr_le) {
|
|
|
7d975d |
@@ -158,7 +158,7 @@ int ppc_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
|
|
|
7d975d |
break;
|
|
|
7d975d |
}
|
|
|
7d975d |
}
|
|
|
7d975d |
- maybe_bswap_register(env, mem_buf, r);
|
|
|
7d975d |
+ ppc_maybe_bswap_register(env, mem_buf, r);
|
|
|
7d975d |
return r;
|
|
|
7d975d |
}
|
|
|
7d975d |
|
|
|
7d975d |
@@ -214,7 +214,7 @@ int ppc_cpu_gdb_read_register_apple(CPUState *cs, uint8_t *mem_buf, int n)
|
|
|
7d975d |
break;
|
|
|
7d975d |
}
|
|
|
7d975d |
}
|
|
|
7d975d |
- maybe_bswap_register(env, mem_buf, r);
|
|
|
7d975d |
+ ppc_maybe_bswap_register(env, mem_buf, r);
|
|
|
7d975d |
return r;
|
|
|
7d975d |
}
|
|
|
7d975d |
|
|
|
7d975d |
@@ -227,7 +227,7 @@ int ppc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
|
|
|
7d975d |
if (!r) {
|
|
|
7d975d |
return r;
|
|
|
7d975d |
}
|
|
|
7d975d |
- maybe_bswap_register(env, mem_buf, r);
|
|
|
7d975d |
+ ppc_maybe_bswap_register(env, mem_buf, r);
|
|
|
7d975d |
if (n < 32) {
|
|
|
7d975d |
/* gprs */
|
|
|
7d975d |
env->gpr[n] = ldtul_p(mem_buf);
|
|
|
7d975d |
@@ -277,7 +277,7 @@ int ppc_cpu_gdb_write_register_apple(CPUState *cs, uint8_t *mem_buf, int n)
|
|
|
7d975d |
if (!r) {
|
|
|
7d975d |
return r;
|
|
|
7d975d |
}
|
|
|
7d975d |
- maybe_bswap_register(env, mem_buf, r);
|
|
|
7d975d |
+ ppc_maybe_bswap_register(env, mem_buf, r);
|
|
|
7d975d |
if (n < 32) {
|
|
|
7d975d |
/* gprs */
|
|
|
7d975d |
env->gpr[n] = ldq_p(mem_buf);
|