From patchwork Wed May 23 03:07: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: 160806 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6F3ACB7015 for ; Wed, 23 May 2012 14:31:04 +1000 (EST) Received: from localhost ([::1]:38171 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SX1yc-0003UF-8b for incoming@patchwork.ozlabs.org; Tue, 22 May 2012 23:11:06 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SX1wk-0000T5-Kr for qemu-devel@nongnu.org; Tue, 22 May 2012 23:09:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SX1wh-0005f6-Ly for qemu-devel@nongnu.org; Tue, 22 May 2012 23:09:10 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35582 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SX1wh-0005dy-AM for qemu-devel@nongnu.org; Tue, 22 May 2012 23:09:07 -0400 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 48A799735A for ; Wed, 23 May 2012 05:09:06 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Wed, 23 May 2012 05:07:47 +0200 Message-Id: <1337742502-28565-25-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1337742502-28565-1-git-send-email-afaerber@suse.de> References: <1337742502-28565-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH qom-next 24/59] ppc: Pass PowerPCCPU to ppce500_set_irq() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Needed for consistency with preceding _set_irq() functions. Signed-off-by: Andreas Färber --- hw/ppc.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/ppc.c b/hw/ppc.c index fc3a65c..ada100b 100644 --- a/hw/ppc.c +++ b/hw/ppc.c @@ -365,9 +365,10 @@ void ppc40x_irq_init(CPUPPCState *env) } /* PowerPC E500 internal IRQ controller */ -static void ppce500_set_irq (void *opaque, int pin, int level) +static void ppce500_set_irq(void *opaque, int pin, int level) { - CPUPPCState *env = opaque; + PowerPCCPU *cpu = opaque; + CPUPPCState *env = &cpu->env; int cur_level; LOG_IRQ("%s: env %p pin %d level %d\n", __func__, @@ -419,10 +420,12 @@ static void ppce500_set_irq (void *opaque, int pin, int level) } } -void ppce500_irq_init (CPUPPCState *env) +void ppce500_irq_init(CPUPPCState *env) { + PowerPCCPU *cpu = ppc_env_get_cpu(env); + env->irq_inputs = (void **)qemu_allocate_irqs(&ppce500_set_irq, - env, PPCE500_INPUT_NB); + cpu, PPCE500_INPUT_NB); } /*****************************************************************************/ /* PowerPC time base and decrementer emulation */