@@ -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);
+ }
+}
@@ -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;
@@ -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,
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 <yamahata@valinux.co.jp> --- hw/pc.c | 16 ++++++++++++++++ hw/pc.h | 2 ++ hw/pc_piix.c | 16 ---------------- 3 files changed, 18 insertions(+), 16 deletions(-)