diff options
author | Andreas Färber <afaerber@suse.de> | 2012-05-06 12:40:55 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2012-06-04 23:00:41 +0200 |
commit | 0347d689f7339ec925f3a2dcb2c3bcad4d6ef315 (patch) | |
tree | 7d745d1e4af78f817dba3aca8fb36d0f59bde74d /target-lm32/cpu.h | |
parent | 351d56662175bd00473326b0460516c94a427876 (diff) | |
download | hqemu-0347d689f7339ec925f3a2dcb2c3bcad4d6ef315.zip hqemu-0347d689f7339ec925f3a2dcb2c3bcad4d6ef315.tar.gz |
target-lm32: Let cpu_lm32_init() return LM32CPU
Make the include paths for cpu-qom.h consistent to allow using LM32CPU
in cpu.h.
Turn cpu_init macro into a static inline function returning CPULM32State
for backwards compatibility.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Michael Walle <michael@walle.cc>
Diffstat (limited to 'target-lm32/cpu.h')
-rw-r--r-- | target-lm32/cpu.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/target-lm32/cpu.h b/target-lm32/cpu.h index 422a55b..da80469 100644 --- a/target-lm32/cpu.h +++ b/target-lm32/cpu.h @@ -186,7 +186,7 @@ struct CPULM32State { #include "cpu-qom.h" -CPULM32State *cpu_lm32_init(const char *cpu_model); +LM32CPU *cpu_lm32_init(const char *cpu_model); void cpu_lm32_list(FILE *f, fprintf_function cpu_fprintf); int cpu_lm32_exec(CPULM32State *s); void cpu_lm32_close(CPULM32State *s); @@ -199,8 +199,16 @@ int cpu_lm32_signal_handler(int host_signum, void *pinfo, void lm32_translate_init(void); void cpu_lm32_set_phys_msb_ignore(CPULM32State *env, int value); +static inline CPULM32State *cpu_init(const char *cpu_model) +{ + LM32CPU *cpu = cpu_lm32_init(cpu_model); + if (cpu == NULL) { + return NULL; + } + return &cpu->env; +} + #define cpu_list cpu_lm32_list -#define cpu_init cpu_lm32_init #define cpu_exec cpu_lm32_exec #define cpu_gen_code cpu_lm32_gen_code #define cpu_signal_handler cpu_lm32_signal_handler |