From patchwork Mon Aug 24 14:16:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 31950 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id C473EB7257 for ; Tue, 25 Aug 2009 00:50:52 +1000 (EST) Received: from localhost ([127.0.0.1]:54226 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mfash-0006yO-3v for incoming@patchwork.ozlabs.org; Mon, 24 Aug 2009 10:50:47 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MfaOc-0007gU-3a for qemu-devel@nongnu.org; Mon, 24 Aug 2009 10:19:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MfaOV-0007Vu-Fd for qemu-devel@nongnu.org; Mon, 24 Aug 2009 10:19:39 -0400 Received: from [199.232.76.173] (port=41046 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfaOV-0007VU-1r for qemu-devel@nongnu.org; Mon, 24 Aug 2009 10:19:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25515) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MfaOU-0000Hz-02 for qemu-devel@nongnu.org; Mon, 24 Aug 2009 10:19:34 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7OEJXBk026582 for ; Mon, 24 Aug 2009 10:19:33 -0400 Received: from localhost.localdomain (vpn1-4-157.ams2.redhat.com [10.36.4.157]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7OEJJYF029317; Mon, 24 Aug 2009 10:19:32 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 24 Aug 2009 16:16:55 +0200 Message-Id: <97f6b3d2fd7c231e1420356a8fd6205e8271d86e.1251122302.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 10/13] We can add piix3_dev now to PIIX3IrqState X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Juan Quintela --- hw/piix_pci.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/piix_pci.c b/hw/piix_pci.c index 66aeb72..d77c6e6 100644 --- a/hw/piix_pci.c +++ b/hw/piix_pci.c @@ -38,6 +38,7 @@ typedef struct PIIX3State { } PIIX3State; typedef struct PIIX3IrqState { + PIIX3State *piix3; qemu_irq *pic; } PIIX3IrqState; @@ -215,8 +216,6 @@ static void i440fx_initfn(PCIDevice *dev) register_savevm("I440FX", 0, 2, i440fx_save, i440fx_load, d); } -static PIIX3State *piix3_dev; - PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn, qemu_irq *pic) { DeviceState *dev; @@ -236,8 +235,9 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn, qemu_irq * d = pci_create_simple(b, 0, "i440FX"); *pi440fx_state = DO_UPCAST(PCII440FXState, dev, d); - piix3_dev = DO_UPCAST(PIIX3State, dev, pci_create_simple(b, -1, "PIIX3")); - *piix3_devfn = piix3_dev->dev.devfn; + irq_state->piix3 = DO_UPCAST(PIIX3State, dev, + pci_create_simple(b, -1, "PIIX3")); + *piix3_devfn = irq_state->piix3->dev.devfn; return b; } @@ -253,13 +253,13 @@ static void piix3_set_irq(void *opaque, int irq_num, int level) /* now we change the pic irq level according to the piix irq mappings */ /* XXX: optimize */ - pic_irq = piix3_dev->dev.config[0x60 + irq_num]; + pic_irq = irq_state->piix3->dev.config[0x60 + irq_num]; if (pic_irq < 16) { /* The pic level is the logical OR of all the PCI irqs mapped to it */ pic_level = 0; for (i = 0; i < 4; i++) { - if (pic_irq == piix3_dev->dev.config[0x60 + i]) + if (pic_irq == irq_state->piix3->dev.config[0x60 + i]) pic_level |= pci_irq_levels[i]; } qemu_set_irq(irq_state->pic[pic_irq], pic_level);