提交 445e9571 编写于 作者: A Andreas Färber

target-sh4: Let cpu_sh4_init() return SuperHCPU

Turn cpu_init macro into a static inline function returning
CPUSH4State for backwards compatibility.
Signed-off-by: NAndreas Färber <afaerber@suse.de>
上级 e5fe7a34
...@@ -191,7 +191,7 @@ typedef struct CPUSH4State { ...@@ -191,7 +191,7 @@ typedef struct CPUSH4State {
#include "cpu-qom.h" #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_exec(CPUSH4State * s);
int cpu_sh4_signal_handler(int host_signum, void *pinfo, int cpu_sh4_signal_handler(int host_signum, void *pinfo,
void *puc); void *puc);
...@@ -232,7 +232,15 @@ void cpu_load_tlb(CPUSH4State * env); ...@@ -232,7 +232,15 @@ void cpu_load_tlb(CPUSH4State * env);
#include "softfloat.h" #include "softfloat.h"
#define cpu_init cpu_sh4_init static inline CPUSH4State *cpu_init(const char *cpu_model)
{
SuperHCPU *cpu = cpu_sh4_init(cpu_model);
if (cpu == NULL) {
return NULL;
}
return &cpu->env;
}
#define cpu_exec cpu_sh4_exec #define cpu_exec cpu_sh4_exec
#define cpu_gen_code cpu_sh4_gen_code #define cpu_gen_code cpu_sh4_gen_code
#define cpu_signal_handler cpu_sh4_signal_handler #define cpu_signal_handler cpu_sh4_signal_handler
......
...@@ -247,7 +247,7 @@ static void cpu_register(CPUSH4State *env, const sh4_def_t *def) ...@@ -247,7 +247,7 @@ static void cpu_register(CPUSH4State *env, const sh4_def_t *def)
env->id = def->id; env->id = def->id;
} }
CPUSH4State *cpu_sh4_init(const char *cpu_model) SuperHCPU *cpu_sh4_init(const char *cpu_model)
{ {
SuperHCPU *cpu; SuperHCPU *cpu;
CPUSH4State *env; CPUSH4State *env;
...@@ -264,7 +264,7 @@ CPUSH4State *cpu_sh4_init(const char *cpu_model) ...@@ -264,7 +264,7 @@ CPUSH4State *cpu_sh4_init(const char *cpu_model)
cpu_reset(CPU(cpu)); cpu_reset(CPU(cpu));
cpu_register(env, def); cpu_register(env, def);
qemu_init_vcpu(env); qemu_init_vcpu(env);
return env; return cpu;
} }
static void gen_goto_tb(DisasContext * ctx, int n, target_ulong dest) static void gen_goto_tb(DisasContext * ctx, int n, target_ulong dest)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册