From patchwork Wed Mar 16 09:29:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 87195 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 ozlabs.org (Postfix) with ESMTPS id 7BED3B6FF4 for ; Wed, 16 Mar 2011 20:40:34 +1100 (EST) Received: from localhost ([127.0.0.1]:49174 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PznDR-0002e5-Sf for incoming@patchwork.ozlabs.org; Wed, 16 Mar 2011 05:40:29 -0400 Received: from [140.186.70.92] (port=34367 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pzn33-0006Dd-Fv for qemu-devel@nongnu.org; Wed, 16 Mar 2011 05:29:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pzn30-0006Db-Ms for qemu-devel@nongnu.org; Wed, 16 Mar 2011 05:29:44 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:37356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pzn30-0006BY-AR for qemu-devel@nongnu.org; Wed, 16 Mar 2011 05:29:42 -0400 Received: from ps.local.valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with SMTP id 2819018937; Wed, 16 Mar 2011 18:29:41 +0900 (JST) Received: (nullmailer pid 18371 invoked by uid 1000); Wed, 16 Mar 2011 09:29:37 -0000 From: Isaku Yamahata To: qemu-devel@nongnu.org Date: Wed, 16 Mar 2011 18:29:29 +0900 Message-Id: <4415909b2174db3315cc4253936123cfb46c55b5.1300266238.git.yamahata@valinux.co.jp> X-Mailer: git-send-email 1.7.1.1 In-Reply-To: References: In-Reply-To: References: X-Virus-Scanned: clamav-milter 0.95.2 at va-mail.local.valinux.co.jp X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 210.128.90.3 Cc: yamahata@valinux.co.jp Subject: [Qemu-devel] [PATCH 18/26] ioapic: move ioapic_init() from pc_piix.c to pc.c 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 ioapic isn't piix specific. And q35 pc will use it. So move ioapic_init() from pc_piix.c to common place, pc.c. Signed-off-by: Isaku Yamahata --- hw/pc.c | 16 ++++++++++++++++ hw/pc.h | 2 ++ hw/pc_piix.c | 16 ---------------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index dc771a6..97d383d 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -1192,3 +1192,19 @@ void pc_pci_device_init(PCIBus *pci_bus) pci_create_simple(pci_bus, -1, "lsi53c895a"); } } + +void ioapic_init(IsaIrqState *isa_irq_state) +{ + DeviceState *dev; + SysBusDevice *d; + unsigned int i; + + dev = qdev_create(NULL, "ioapic"); + qdev_init_nofail(dev); + d = sysbus_from_qdev(dev); + sysbus_mmio_map(d, 0, 0xfec00000); + + for (i = 0; i < IOAPIC_NUM_PINS; i++) { + isa_irq_state->ioapic[i] = qdev_get_gpio_in(dev, i); + } +} diff --git a/hw/pc.h b/hw/pc.h index b70c5f4..598747d 100644 --- a/hw/pc.h +++ b/hw/pc.h @@ -150,6 +150,8 @@ void pc_pci_device_init(PCIBus *pci_bus); typedef void (*cpu_set_smm_t)(int smm, void *arg); void cpu_smm_register(cpu_set_smm_t callback, void *arg); +void ioapic_init(IsaIrqState *isa_irq_state); + /* acpi.c */ extern int acpi_enabled; extern char *acpi_tables; diff --git a/hw/pc_piix.c b/hw/pc_piix.c index 8ee7cab..f04d58b 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -45,22 +45,6 @@ static const int ide_iobase[MAX_IDE_BUS] = { 0x1f0, 0x170 }; static const int ide_iobase2[MAX_IDE_BUS] = { 0x3f6, 0x376 }; static const int ide_irq[MAX_IDE_BUS] = { 14, 15 }; -static void ioapic_init(IsaIrqState *isa_irq_state) -{ - DeviceState *dev; - SysBusDevice *d; - unsigned int i; - - dev = qdev_create(NULL, "ioapic"); - qdev_init_nofail(dev); - d = sysbus_from_qdev(dev); - sysbus_mmio_map(d, 0, 0xfec00000); - - for (i = 0; i < IOAPIC_NUM_PINS; i++) { - isa_irq_state->ioapic[i] = qdev_get_gpio_in(dev, i); - } -} - /* PC hardware initialisation */ static void pc_init1(ram_addr_t ram_size, const char *boot_device,