Patchwork [for-next,38/74] target-sh4: Let cpu_sh4_init() return SuperHCPU

login
register
mail settings
Submitter Andreas Färber
Date May 6, 2012, 3:34 p.m.
Message ID <1336318514-30906-39-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/157173/
State New
Headers show

Comments

Andreas Färber - May 6, 2012, 3:34 p.m.
Let cpu_init() return CPUSH4State for backwards compatibility.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 target-sh4/cpu.h       |    4 ++--
 target-sh4/translate.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Patch

diff --git a/target-sh4/cpu.h b/target-sh4/cpu.h
index b6768f1..1bee13c 100644
--- a/target-sh4/cpu.h
+++ b/target-sh4/cpu.h
@@ -191,7 +191,7 @@  typedef struct CPUSH4State {
 
 #include "cpu-qom.h"
 
-CPUSH4State *cpu_sh4_init(const char *cpu_model);
+SuperHCPU *cpu_sh4_init(const char *cpu_model);
 int cpu_sh4_exec(CPUSH4State * s);
 int cpu_sh4_signal_handler(int host_signum, void *pinfo,
                            void *puc);
@@ -232,7 +232,7 @@  void cpu_load_tlb(CPUSH4State * env);
 
 #include "softfloat.h"
 
-#define cpu_init cpu_sh4_init
+#define cpu_init(model) (&cpu_sh4_init(model)->env)
 #define cpu_exec cpu_sh4_exec
 #define cpu_gen_code cpu_sh4_gen_code
 #define cpu_signal_handler cpu_sh4_signal_handler
diff --git a/target-sh4/translate.c b/target-sh4/translate.c
index d25f0c5..7d35b84 100644
--- a/target-sh4/translate.c
+++ b/target-sh4/translate.c
@@ -247,7 +247,7 @@  static void cpu_register(CPUSH4State *env, const sh4_def_t *def)
     env->id = def->id;
 }
 
-CPUSH4State *cpu_sh4_init(const char *cpu_model)
+SuperHCPU *cpu_sh4_init(const char *cpu_model)
 {
     SuperHCPU *cpu;
     CPUSH4State *env;
@@ -264,7 +264,7 @@  CPUSH4State *cpu_sh4_init(const char *cpu_model)
     cpu_reset(CPU(cpu));
     cpu_register(env, def);
     qemu_init_vcpu(env);
-    return env;
+    return cpu;
 }
 
 static void gen_goto_tb(DisasContext * ctx, int n, target_ulong dest)