提交 5f5e3350 编写于 作者: A Andreas Färber

target-alpha: Let cpu_alpha_init() return AlphaCPU

Replace cpu_init() macro with inline function for backwards
compatibility.
Signed-off-by: NAndreas Färber <afaerber@suse.de>
Acked-by: NRichard Henderson <rth@twiddle.net>
上级 914606d2
......@@ -290,7 +290,6 @@ struct CPUAlphaState {
int implver;
};
#define cpu_init cpu_alpha_init
#define cpu_exec cpu_alpha_exec
#define cpu_gen_code cpu_alpha_gen_code
#define cpu_signal_handler cpu_alpha_signal_handler
......@@ -427,7 +426,17 @@ enum {
IR_ZERO = 31,
};
CPUAlphaState * cpu_alpha_init (const char *cpu_model);
AlphaCPU *cpu_alpha_init(const char *cpu_model);
static inline CPUAlphaState *cpu_init(const char *cpu_model)
{
AlphaCPU *cpu = cpu_alpha_init(cpu_model);
if (cpu == NULL) {
return NULL;
}
return &cpu->env;
}
int cpu_alpha_exec(CPUAlphaState *s);
/* you can call this signal handler from your SIGBUS and SIGSEGV
signal handlers to inform the virtual CPU of exceptions. non zero
......
......@@ -3517,7 +3517,7 @@ static const struct cpu_def_t cpu_defs[] = {
| AMASK_MVI | AMASK_TRAP | AMASK_PREFETCH), }
};
CPUAlphaState * cpu_alpha_init (const char *cpu_model)
AlphaCPU *cpu_alpha_init(const char *cpu_model)
{
AlphaCPU *cpu;
CPUAlphaState *env;
......@@ -3546,7 +3546,7 @@ CPUAlphaState * cpu_alpha_init (const char *cpu_model)
env->cpu_model_str = cpu_model;
qemu_init_vcpu(env);
return env;
return cpu;
}
void restore_state_to_opc(CPUAlphaState *env, TranslationBlock *tb, int pc_pos)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册