From patchwork Sun Dec 16 00:13:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 1884251 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 6EEA7DFF39 for ; Sun, 16 Dec 2012 00:14:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754182Ab2LPAON (ORCPT ); Sat, 15 Dec 2012 19:14:13 -0500 Received: from cantor2.suse.de ([195.135.220.15]:33042 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752144Ab2LPAOJ (ORCPT ); Sat, 15 Dec 2012 19:14:09 -0500 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 43CC6A38EA; Sun, 16 Dec 2012 01:14:07 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Cc: Marcelo Tosatti , kvm@vger.kernel.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= , Alexander Graf (supporter:e500), Scott Wood (supporter:e500), "Edgar E. Iglesias" (odd fixer:virtex_ml507), qemu-ppc@nongnu.org (open list:e500) Subject: [PATCH v2 09/11] ppc_booke: Pass PowerPCCPU to ppc_booke_timers_init() Date: Sun, 16 Dec 2012 01:13:35 +0100 Message-Id: <1355616817-1260-10-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1355616817-1260-1-git-send-email-afaerber@suse.de> References: <1355616817-1260-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Cleans up after passing PowerPCCPU to timer callbacks. Signed-off-by: Andreas Färber --- hw/ppc.h | 2 +- hw/ppc/e500.c | 2 +- hw/ppc405_uc.c | 2 +- hw/ppc440_bamboo.c | 2 +- hw/ppc_booke.c | 5 ++--- hw/virtex_ml507.c | 2 +- 6 Dateien geändert, 7 Zeilen hinzugefügt(+), 8 Zeilen entfernt(-) diff --git a/hw/ppc.h b/hw/ppc.h index 64463ad..ec33f9c 100644 --- a/hw/ppc.h +++ b/hw/ppc.h @@ -89,4 +89,4 @@ enum { #define PPC_SERIAL_MM_BAUDBASE 399193 /* ppc_booke.c */ -void ppc_booke_timers_init(CPUPPCState *env, uint32_t freq, uint32_t flags); +void ppc_booke_timers_init(PowerPCCPU *cpu, uint32_t freq, uint32_t flags); diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index af6b671..5592359 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -495,7 +495,7 @@ void ppce500_init(PPCE500Params *params) env->mpic_cpu_base = MPC8544_CCSRBAR_BASE + MPC8544_MPIC_REGS_OFFSET + 0x20000; - ppc_booke_timers_init(env, 400000000, PPC_TIMER_E500); + ppc_booke_timers_init(cpu, 400000000, PPC_TIMER_E500); /* Register reset handler */ if (!i) { diff --git a/hw/ppc405_uc.c b/hw/ppc405_uc.c index 373b8f3..fe71784 100644 --- a/hw/ppc405_uc.c +++ b/hw/ppc405_uc.c @@ -2482,7 +2482,7 @@ CPUPPCState *ppc405ep_init(MemoryRegion *address_space_mem, /* OBP arbitrer */ ppc4xx_opba_init(0xef600600); /* Initialize timers */ - ppc_booke_timers_init(env, sysclk, 0); + ppc_booke_timers_init(cpu, sysclk, 0); /* Universal interrupt controller */ irqs = g_malloc0(sizeof(qemu_irq) * PPCUIC_OUTPUT_NB); irqs[PPCUIC_OUTPUT_INT] = diff --git a/hw/ppc440_bamboo.c b/hw/ppc440_bamboo.c index cc85607..d9f0f81 100644 --- a/hw/ppc440_bamboo.c +++ b/hw/ppc440_bamboo.c @@ -195,7 +195,7 @@ static void bamboo_init(QEMUMachineInitArgs *args) env = &cpu->env; qemu_register_reset(main_cpu_reset, cpu); - ppc_booke_timers_init(env, 400000000, 0); + ppc_booke_timers_init(cpu, 400000000, 0); ppc_dcr_init(env, NULL, NULL); /* interrupt controller */ diff --git a/hw/ppc_booke.c b/hw/ppc_booke.c index 5748063..f2c0409 100644 --- a/hw/ppc_booke.c +++ b/hw/ppc_booke.c @@ -237,16 +237,15 @@ void store_booke_tcr(CPUPPCState *env, target_ulong val) } -void ppc_booke_timers_init(CPUPPCState *env, uint32_t freq, uint32_t flags) +void ppc_booke_timers_init(PowerPCCPU *cpu, uint32_t freq, uint32_t flags) { - PowerPCCPU *cpu = ppc_env_get_cpu(env); ppc_tb_t *tb_env; booke_timer_t *booke_timer; tb_env = g_malloc0(sizeof(ppc_tb_t)); booke_timer = g_malloc0(sizeof(booke_timer_t)); - env->tb_env = tb_env; + cpu->env.tb_env = tb_env; tb_env->flags = flags | PPC_TIMER_BOOKE | PPC_DECR_ZERO_TRIGGERED; tb_env->tb_freq = freq; diff --git a/hw/virtex_ml507.c b/hw/virtex_ml507.c index 6ab8fee..1a19cd2 100644 --- a/hw/virtex_ml507.c +++ b/hw/virtex_ml507.c @@ -94,7 +94,7 @@ static PowerPCCPU *ppc440_init_xilinx(ram_addr_t *ram_size, } env = &cpu->env; - ppc_booke_timers_init(env, sysclk, 0/* no flags */); + ppc_booke_timers_init(cpu, sysclk, 0/* no flags */); ppc_dcr_init(env, NULL, NULL);