From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SR3V8-0000IU-K3 for qemu-devel@nongnu.org; Sun, 06 May 2012 11:35:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SR3V4-0000eE-79 for qemu-devel@nongnu.org; Sun, 06 May 2012 11:35:58 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 6 May 2012 17:34:15 +0200 Message-Id: <1336318514-30906-16-git-send-email-afaerber@suse.de> In-Reply-To: <1336318514-30906-1-git-send-email-afaerber@suse.de> References: <1336318514-30906-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH for-next 15/74] target-ppc: Let cpu_ppc_init() return PowerPCCPU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , "open list:PowerPC" , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Anthony Liguori , Alexander Graf Adapt e500 mpc8544ds machine accordingly. Let cpu_init() return CPUPPCState for backwards compatibility. Signed-off-by: Andreas F=C3=A4rber --- hw/ppce500_mpc8544ds.c | 7 +++++-- target-ppc/cpu.h | 4 ++-- target-ppc/helper.c | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/hw/ppce500_mpc8544ds.c b/hw/ppce500_mpc8544ds.c index f1dfbe1..88a2767 100644 --- a/hw/ppce500_mpc8544ds.c +++ b/hw/ppce500_mpc8544ds.c @@ -254,12 +254,15 @@ static void mpc8544ds_init(ram_addr_t ram_size, irqs =3D g_malloc0(smp_cpus * sizeof(qemu_irq *)); irqs[0] =3D g_malloc0(smp_cpus * sizeof(qemu_irq) * OPENPIC_OUTPUT_N= B); for (i =3D 0; i < smp_cpus; i++) { + PowerPCCPU *cpu; qemu_irq *input; - env =3D cpu_ppc_init(cpu_model); - if (!env) { + + cpu =3D cpu_ppc_init(cpu_model); + if (cpu =3D=3D NULL) { fprintf(stderr, "Unable to initialize CPU!\n"); exit(1); } + env =3D &cpu->env; =20 if (!firstenv) { firstenv =3D env; diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h index 84c9674..8ca6c54 100644 --- a/target-ppc/cpu.h +++ b/target-ppc/cpu.h @@ -1099,7 +1099,7 @@ struct mmu_ctx_t { #include "cpu-qom.h" =20 /***********************************************************************= ******/ -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,7 @@ static inline uint64_t ppc_dump_gpr(CPUPPCState *en= v, 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); =20 -#define cpu_init cpu_ppc_init +#define cpu_init(model) (&cpu_ppc_init(model)->env) #define cpu_exec cpu_ppc_exec #define cpu_gen_code cpu_ppc_gen_code #define cpu_signal_handler cpu_ppc_signal_handler diff --git a/target-ppc/helper.c b/target-ppc/helper.c index e97e496..42f66e8 100644 --- a/target-ppc/helper.c +++ b/target-ppc/helper.c @@ -3191,7 +3191,7 @@ void cpu_state_reset(CPUPPCState *env) cpu_reset(ENV_GET_CPU(env)); } =20 -CPUPPCState *cpu_ppc_init (const char *cpu_model) +PowerPCCPU *cpu_ppc_init(const char *cpu_model) { PowerPCCPU *cpu; CPUPPCState *env; @@ -3213,5 +3213,5 @@ CPUPPCState *cpu_ppc_init (const char *cpu_model) =20 qemu_init_vcpu(env); =20 - return env; + return cpu; } --=20 1.7.7