diff options
author | Andreas Färber <afaerber@suse.de> | 2012-10-15 17:52:00 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2012-12-19 01:01:36 +0100 |
commit | 5f5e335088925cedc5b912fd8bb4e1e933094d56 (patch) | |
tree | 85a41b32d46987029c7b2f7e5e1a587d0e3c32bd /target-alpha/cpu.h | |
parent | 914606d26e654d4c01bd5186f4d05e3fd445e219 (diff) |
target-alpha: Let cpu_alpha_init() return AlphaCPU
Replace cpu_init() macro with inline function for backwards
compatibility.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-alpha/cpu.h')
-rw-r--r-- | target-alpha/cpu.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h index 9939d61ca8..32e3777cdc 100644 --- a/target-alpha/cpu.h +++ b/target-alpha/cpu.h @@ -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 |