Patchwork [RFC,06/20] m68k: convert cpu_init to QOM

login
register
mail settings
Submitter Eduardo Habkost
Date Dec. 18, 2012, 8:03 p.m.
Message ID <1355861053-11460-7-git-send-email-ehabkost@redhat.com>
Download mbox | patch
Permalink /patch/207192/
State New
Headers show

Comments

Eduardo Habkost - Dec. 18, 2012, 8:03 p.m.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target-m68k/cpu.h    | 5 ++---
 target-m68k/helper.c | 4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)

Patch

diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h
index fbb35dc..9823267 100644
--- a/target-m68k/cpu.h
+++ b/target-m68k/cpu.h
@@ -116,7 +116,7 @@  typedef struct CPUM68KState {
 #include "cpu-qom.h"
 
 void m68k_tcg_init(void);
-CPUM68KState *cpu_m68k_init(const char *cpu_model);
+CPUState *cpu_m68k_init(const char *cpu_model);
 int cpu_m68k_exec(CPUM68KState *s);
 void do_interrupt(CPUM68KState *env1);
 void do_interrupt_m68k_hardirq(CPUM68KState *env1);
@@ -214,8 +214,7 @@  void register_m68k_insns (CPUM68KState *env);
 #define TARGET_PHYS_ADDR_SPACE_BITS 32
 #define TARGET_VIRT_ADDR_SPACE_BITS 32
 
-#define cpu_init(m) ENV_GET_CPU(old_cpu_init(m))
-#define old_cpu_init cpu_m68k_init
+#define cpu_init cpu_m68k_init
 #define cpu_exec cpu_m68k_exec
 #define cpu_gen_code cpu_m68k_gen_code
 #define cpu_signal_handler cpu_m68k_signal_handler
diff --git a/target-m68k/helper.c b/target-m68k/helper.c
index a5d0100..6b6f5dd 100644
--- a/target-m68k/helper.c
+++ b/target-m68k/helper.c
@@ -98,7 +98,7 @@  static int fpu_gdb_set_reg(CPUM68KState *env, uint8_t *mem_buf, int n)
     return 0;
 }
 
-CPUM68KState *cpu_m68k_init(const char *cpu_model)
+CPUState *cpu_m68k_init(const char *cpu_model)
 {
     M68kCPU *cpu;
     CPUM68KState *env;
@@ -126,7 +126,7 @@  CPUM68KState *cpu_m68k_init(const char *cpu_model)
 
     cpu_reset(ENV_GET_CPU(env));
     qemu_init_vcpu(env);
-    return env;
+    return CPU(cpu);
 }
 
 void cpu_m68k_flush_flags(CPUM68KState *env, int cc_op)