diff options
author | Andreas Färber <afaerber@suse.de> | 2012-05-03 05:43:05 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2012-06-04 23:00:43 +0200 |
commit | 397b457d869fbd5bbe2793c3066bb6bc92845932 (patch) | |
tree | 9e36cc219a88f03ca9a271f72d49f294b62370b5 /target-ppc/cpu.h | |
parent | fa156e5127d367987289e90563cad4c4ca83a2d8 (diff) | |
download | qemu-397b457d869fbd5bbe2793c3066bb6bc92845932.zip qemu-397b457d869fbd5bbe2793c3066bb6bc92845932.tar.gz qemu-397b457d869fbd5bbe2793c3066bb6bc92845932.tar.bz2 |
target-ppc: Let cpu_ppc_init() return PowerPCCPU
Adapt e500 mpc8544ds machine accordingly.
Turn cpu_init() into a static inline function returning CPUPPCState for
backwards compatibility.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'target-ppc/cpu.h')
-rw-r--r-- | target-ppc/cpu.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h index 84c9674..77a2858 100644 --- a/target-ppc/cpu.h +++ b/target-ppc/cpu.h @@ -1099,7 +1099,7 @@ struct mmu_ctx_t { #include "cpu-qom.h" /*****************************************************************************/ -CPUPPCState *cpu_ppc_init (const char *cpu_model); +PowerPCCPU *cpu_ppc_init(const char *cpu_model); void ppc_translate_init(void); int cpu_ppc_exec (CPUPPCState *s); /* you can call this signal handler from your SIGBUS and SIGSEGV @@ -1214,7 +1214,15 @@ static inline uint64_t ppc_dump_gpr(CPUPPCState *env, int gprn) int ppc_dcr_read (ppc_dcr_t *dcr_env, int dcrn, uint32_t *valp); int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, uint32_t val); -#define cpu_init cpu_ppc_init +static inline CPUPPCState *cpu_init(const char *cpu_model) +{ + PowerPCCPU *cpu = cpu_ppc_init(cpu_model); + if (cpu == NULL) { + return NULL; + } + return &cpu->env; +} + #define cpu_exec cpu_ppc_exec #define cpu_gen_code cpu_ppc_gen_code #define cpu_signal_handler cpu_ppc_signal_handler |