[Top][All Lists]
[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
- [Qemu-devel] [PATCH 10/26] ide/ahci/ich: use qdev.reset, (continued)
- [Qemu-devel] [PATCH 10/26] ide/ahci/ich: use qdev.reset, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 06/26] pci_bridge: add helper function to convert PCIBridge into PCIDevice, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 25/26] pci_ids: add intel 82801BA pci-to-pci bridge id and PCI_CLASS_SERIAL_SMBUS, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 13/26] usb/uhci: add ich9 usb uhci id's device, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 01/26] pci: replace the magic, 256, for the maximum of slot, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 17/26] pc, pc_piix: split out pc nic initialization, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 16/26] pc, pc_piix: split out allocating isa irqs, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 14/26] ide: consolidate drive_get(IF_IDE), Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 11/26] ahci: add ide device initialization helper, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 18/26] ioapic: move ioapic_init() from pc_piix.c to pc.c,
Isaku Yamahata <=
- [Qemu-devel] [PATCH 02/26] pci: add opaque argument to pci_map_irq_fn, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 03/26] pci: introduce pci_swizzle_map_irq_fn() for standardized interrupt pin swizzle, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 20/26] pc, i440fx: simply i440fx initialization, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 21/26] acpi, acpi_piix: factor out PM_TMR logic, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 24/26] acpi, acpi_piix: factor out GPE logic, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 09/26] dec_pci: simplify dec_pci.c by using pci_p2pbr, Isaku Yamahata, 2011/03/16