@@ -297,7 +297,6 @@ struct CPUAlphaState {
int implver;
};
-#define cpu_init cpu_alpha_init
#define cpu_list alpha_cpu_list
#define cpu_exec cpu_alpha_exec
#define cpu_gen_code cpu_alpha_gen_code
@@ -435,7 +434,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;
+}
+
void alpha_cpu_list(FILE *f, fprintf_function cpu_fprintf);
int cpu_alpha_exec(CPUAlphaState *s);
/* you can call this signal handler from your SIGBUS and SIGSEGV
@@ -3493,7 +3493,7 @@ void gen_intermediate_code_pc (CPUAlphaState *env, struct TranslationBlock *tb)
gen_intermediate_code_internal(env, tb, 1);
}
-CPUAlphaState *cpu_alpha_init(const char *cpu_model)
+AlphaCPU *cpu_alpha_init(const char *cpu_model)
{
AlphaCPU *cpu;
CPUAlphaState *env;
@@ -3511,7 +3511,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)
Replace cpu_init() macro with inline function for backwards compatibility. Signed-off-by: Andreas Färber <afaerber@suse.de> --- target-alpha/cpu.h | 13 +++++++++++-- target-alpha/translate.c | 4 ++-- 2 Dateien geändert, 13 Zeilen hinzugefügt(+), 4 Zeilen entfernt(-)