aboutsummaryrefslogtreecommitdiff
path: root/target-sh4/cpu.h
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-05-04 18:35:09 +0200
committerAndreas Färber <afaerber@suse.de>2012-06-04 23:00:42 +0200
commit445e957194807aa9eb1d02c23430dbb0c6bac34e (patch)
tree22a68ba7fcfb505729989f08ced42d9e0d0bc8ff /target-sh4/cpu.h
parente5fe7a34d421eb97fc3b69f58d8e91f4679ffb41 (diff)
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: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-sh4/cpu.h')
-rw-r--r--target-sh4/cpu.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/target-sh4/cpu.h b/target-sh4/cpu.h
index b6768f1648..bf592227ee 100644
--- a/target-sh4/cpu.h
+++ b/target-sh4/cpu.h
@@ -191,7 +191,7 @@ typedef struct CPUSH4State {
#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_signal_handler(int host_signum, void *pinfo,
void *puc);
@@ -232,7 +232,15 @@ void cpu_load_tlb(CPUSH4State * env);
#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_gen_code cpu_sh4_gen_code
#define cpu_signal_handler cpu_sh4_signal_handler