diff mbox series

[04/11] target/ppc: moved ppc_store_msr into gdbstub.c

Message ID 20210512140813.112884-5-bruno.larsen@eldorado.org.br
State New
Headers show
Series target/ppc: add support to disable-tcg | expand

Commit Message

Bruno Larsen (billionai) May 12, 2021, 2:08 p.m. UTC
This function is used by !TCG cases, so it was moved to a common code
file. We chose gdbstub.c since it was the one giving us grief over it.

Signed-off-by: Bruno Larsen (billionai) <bruno.larsen@eldorado.org.br>
---
 target/ppc/gdbstub.c     | 7 +++++++
 target/ppc/misc_helper.c | 6 ------
 2 files changed, 7 insertions(+), 6 deletions(-)

Comments

Richard Henderson May 12, 2021, 5:05 p.m. UTC | #1
On 5/12/21 9:08 AM, Bruno Larsen (billionai) wrote:
> This function is used by !TCG cases, so it was moved to a common code
> file. We chose gdbstub.c since it was the one giving us grief over it.
> 
> Signed-off-by: Bruno Larsen (billionai)<bruno.larsen@eldorado.org.br>
> ---
>   target/ppc/gdbstub.c     | 7 +++++++
>   target/ppc/misc_helper.c | 6 ------
>   2 files changed, 7 insertions(+), 6 deletions(-)

gdbstub.c is not the only !tcg user; e.g. machine.c.

I think this should go in cpu.c, next to the other special register read/write 
functions.


r~
David Gibson May 13, 2021, 3:52 a.m. UTC | #2
On Wed, May 12, 2021 at 12:05:04PM -0500, Richard Henderson wrote:
> On 5/12/21 9:08 AM, Bruno Larsen (billionai) wrote:
> > This function is used by !TCG cases, so it was moved to a common code
> > file. We chose gdbstub.c since it was the one giving us grief over it.
> > 
> > Signed-off-by: Bruno Larsen (billionai)<bruno.larsen@eldorado.org.br>
> > ---
> >   target/ppc/gdbstub.c     | 7 +++++++
> >   target/ppc/misc_helper.c | 6 ------
> >   2 files changed, 7 insertions(+), 6 deletions(-)
> 
> gdbstub.c is not the only !tcg user; e.g. machine.c.
> 
> I think this should go in cpu.c, next to the other special register
> read/write functions.

I agree.
diff mbox series

Patch

diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c
index 9339e7eafe..17e41fc113 100644
--- a/target/ppc/gdbstub.c
+++ b/target/ppc/gdbstub.c
@@ -22,6 +22,7 @@ 
 #include "exec/gdbstub.h"
 #include "exec/helper-proto.h"
 #include "internal.h"
+#include "helper_regs.h"
 
 static int ppc_gdb_register_len_apple(int n)
 {
@@ -622,6 +623,12 @@  gchar *ppc_gdb_arch_name(CPUState *cs)
 #endif
 }
 
+/* GDBstub can read and write MSR... */
+void ppc_store_msr(CPUPPCState *env, target_ulong value)
+{
+    hreg_store_msr(env, value, 0);
+}
+
 void ppc_gdb_init(CPUState *cs, PowerPCCPUClass *pcc)
 {
     if (pcc->insns_flags & PPC_FLOAT) {
diff --git a/target/ppc/misc_helper.c b/target/ppc/misc_helper.c
index 08a31da289..b910ac6479 100644
--- a/target/ppc/misc_helper.c
+++ b/target/ppc/misc_helper.c
@@ -255,12 +255,6 @@  target_ulong helper_clcs(CPUPPCState *env, uint32_t arg)
 /*****************************************************************************/
 /* Special registers manipulation */
 
-/* GDBstub can read and write MSR... */
-void ppc_store_msr(CPUPPCState *env, target_ulong value)
-{
-    hreg_store_msr(env, value, 0);
-}
-
 void ppc_store_lpcr(PowerPCCPU *cpu, target_ulong val)
 {
     PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);