Patchwork [RFC,07/20] target-unicore32: convert cpu_init to QOM

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

Comments

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

Patch

diff --git a/target-unicore32/cpu.h b/target-unicore32/cpu.h
index 86a6959..43bdd84 100644
--- a/target-unicore32/cpu.h
+++ b/target-unicore32/cpu.h
@@ -122,13 +122,11 @@  void cpu_asr_write(CPUUniCore32State *env1, target_ulong val, target_ulong mask)
 #define UC32_HWCAP_CMOV                 4 /* 1 << 2 */
 #define UC32_HWCAP_UCF64                8 /* 1 << 3 */
 
-#define cpu_init(m) ENV_GET_CPU(old_cpu_init(m))
-#define old_cpu_init                    uc32_cpu_init
+#define cpu_init                        uc32_cpu_init
 #define cpu_exec                        uc32_cpu_exec
 #define cpu_signal_handler              uc32_cpu_signal_handler
 #define cpu_handle_mmu_fault            uc32_cpu_handle_mmu_fault
 
-CPUUniCore32State *uc32_cpu_init(const char *cpu_model);
 int uc32_cpu_exec(CPUUniCore32State *s);
 int uc32_cpu_signal_handler(int host_signum, void *pinfo, void *puc);
 int uc32_cpu_handle_mmu_fault(CPUUniCore32State *env, target_ulong address, int rw,
@@ -162,6 +160,8 @@  static inline void cpu_set_tls(CPUUniCore32State *env, target_ulong newtls)
 #include "cpu-qom.h"
 #include "exec-all.h"
 
+CPUState *uc32_cpu_init(const char *cpu_model);
+
 static inline void cpu_pc_from_tb(CPUUniCore32State *env, TranslationBlock *tb)
 {
     env->regs[31] = tb->pc;
diff --git a/target-unicore32/helper.c b/target-unicore32/helper.c
index a9e226b..dc7b0b3 100644
--- a/target-unicore32/helper.c
+++ b/target-unicore32/helper.c
@@ -23,7 +23,7 @@ 
 #define DPRINTF(fmt, ...) do {} while (0)
 #endif
 
-CPUUniCore32State *uc32_cpu_init(const char *cpu_model)
+CPUState *uc32_cpu_init(const char *cpu_model)
 {
     UniCore32CPU *cpu;
     CPUUniCore32State *env;
@@ -41,7 +41,7 @@  CPUUniCore32State *uc32_cpu_init(const char *cpu_model)
     }
 
     qemu_init_vcpu(env);
-    return env;
+    return CPU(cpu);
 }
 
 uint32_t HELPER(clo)(uint32_t x)