From patchwork Sun Dec 2 04:50:47 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: 1830011 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 236B3DF254 for ; Sun, 2 Dec 2012 04:51:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753859Ab2LBEvQ (ORCPT ); Sat, 1 Dec 2012 23:51:16 -0500 Received: from cantor2.suse.de ([195.135.220.15]:39299 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753876Ab2LBEvP (ORCPT ); Sat, 1 Dec 2012 23:51:15 -0500 Received: from relay2.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 8DB17A3E1C; Sun, 2 Dec 2012 05:51:14 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Cc: anthony@codemonkey.ws, mtosatti@redhat.com, kvm@vger.kernel.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [PATCH qom-cpu 07/11] ppc_booke: Pass PowerPCCPU to {decr, fit, wdt} timer callbacks Date: Sun, 2 Dec 2012 05:50:47 +0100 Message-Id: <1354423851-24818-8-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1354423851-24818-1-git-send-email-afaerber@suse.de> References: <1354423851-24818-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 booke_update_irq(). Signed-off-by: Andreas Färber --- hw/ppc_booke.c | 23 ++++++++++------------- 1 Datei geändert, 10 Zeilen hinzugefügt(+), 13 Zeilen entfernt(-) diff --git a/hw/ppc_booke.c b/hw/ppc_booke.c index da6bc4a..5748063 100644 --- a/hw/ppc_booke.c +++ b/hw/ppc_booke.c @@ -155,8 +155,8 @@ static void booke_update_fixed_timer(CPUPPCState *env, static void booke_decr_cb(void *opaque) { - CPUPPCState *env = opaque; - PowerPCCPU *cpu = ppc_env_get_cpu(env); + PowerPCCPU *cpu = opaque; + CPUPPCState *env = &cpu->env; env->spr[SPR_BOOKE_TSR] |= TSR_DIS; booke_update_irq(cpu); @@ -169,13 +169,11 @@ static void booke_decr_cb(void *opaque) static void booke_fit_cb(void *opaque) { - PowerPCCPU *cpu; - CPUPPCState *env; + PowerPCCPU *cpu = opaque; + CPUPPCState *env = &cpu->env; ppc_tb_t *tb_env; booke_timer_t *booke_timer; - env = opaque; - cpu = ppc_env_get_cpu(env); tb_env = env->tb_env; booke_timer = tb_env->opaque; env->spr[SPR_BOOKE_TSR] |= TSR_FIS; @@ -190,13 +188,11 @@ static void booke_fit_cb(void *opaque) static void booke_wdt_cb(void *opaque) { - PowerPCCPU *cpu; - CPUPPCState *env; + PowerPCCPU *cpu = opaque; + CPUPPCState *env = &cpu->env; ppc_tb_t *tb_env; booke_timer_t *booke_timer; - env = opaque; - cpu = ppc_env_get_cpu(env); tb_env = env->tb_env; booke_timer = tb_env->opaque; @@ -243,6 +239,7 @@ void store_booke_tcr(CPUPPCState *env, target_ulong val) void ppc_booke_timers_init(CPUPPCState *env, uint32_t freq, uint32_t flags) { + PowerPCCPU *cpu = ppc_env_get_cpu(env); ppc_tb_t *tb_env; booke_timer_t *booke_timer; @@ -255,10 +252,10 @@ void ppc_booke_timers_init(CPUPPCState *env, uint32_t freq, uint32_t flags) tb_env->tb_freq = freq; tb_env->decr_freq = freq; tb_env->opaque = booke_timer; - tb_env->decr_timer = qemu_new_timer_ns(vm_clock, &booke_decr_cb, env); + tb_env->decr_timer = qemu_new_timer_ns(vm_clock, &booke_decr_cb, cpu); booke_timer->fit_timer = - qemu_new_timer_ns(vm_clock, &booke_fit_cb, env); + qemu_new_timer_ns(vm_clock, &booke_fit_cb, cpu); booke_timer->wdt_timer = - qemu_new_timer_ns(vm_clock, &booke_wdt_cb, env); + qemu_new_timer_ns(vm_clock, &booke_wdt_cb, cpu); }