qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 18/26] ioapic: move ioapic_init() from pc_piix.c to


From: Isaku Yamahata
Subject: [Qemu-devel] [PATCH 18/26] ioapic: move ioapic_init() from pc_piix.c to pc.c
Date: Wed, 16 Mar 2011 18:29:29 +0900

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 <address@hidden>
---
 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,
-- 
1.7.1.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]