Patchwork [for-next,61/74] target-mips: Let cpu_mips_init() return MIPSCPU

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

Comments

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

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

Patch

diff --git a/target-mips/cpu.h b/target-mips/cpu.h
index 44c1152..a6961f8 100644
--- a/target-mips/cpu.h
+++ b/target-mips/cpu.h
@@ -496,7 +496,7 @@  void cpu_unassigned_access(CPUMIPSState *env, target_phys_addr_t addr,
 
 void mips_cpu_list (FILE *f, fprintf_function cpu_fprintf);
 
-#define cpu_init cpu_mips_init
+#define cpu_init(model) (&cpu_mips_init(model)->env)
 #define cpu_exec cpu_mips_exec
 #define cpu_gen_code cpu_mips_gen_code
 #define cpu_signal_handler cpu_mips_signal_handler
@@ -626,7 +626,7 @@  enum {
 #define CPU_INTERRUPT_WAKE CPU_INTERRUPT_TGT_INT_0
 
 int cpu_mips_exec(CPUMIPSState *s);
-CPUMIPSState *cpu_mips_init(const char *cpu_model);
+MIPSCPU *cpu_mips_init(const char *cpu_model);
 int cpu_mips_signal_handler(int host_signum, void *pinfo, void *puc);
 
 /* mips_timer.c */
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 58e044b..2d56f46 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -12689,7 +12689,7 @@  static void mips_tcg_init(void)
 
 #include "translate_init.c"
 
-CPUMIPSState *cpu_mips_init (const char *cpu_model)
+MIPSCPU *cpu_mips_init(const char *cpu_model)
 {
     MIPSCPU *cpu;
     CPUMIPSState *env;
@@ -12711,7 +12711,7 @@  CPUMIPSState *cpu_mips_init (const char *cpu_model)
     mips_tcg_init();
     cpu_reset(CPU(cpu));
     qemu_init_vcpu(env);
-    return env;
+    return cpu;
 }
 
 void cpu_state_reset(CPUMIPSState *env)