mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
Route IOAPIC interrupts via ISA bus
Instead of calling the IOAPIC from the PIC, raise IOAPIC irqs via the ISA bus. As a side effect, IOAPIC lines 16-23 are enabled. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
1452411b25
commit
1632dc6a8f
4 changed files with 13 additions and 26 deletions
16
hw/pc.c
16
hw/pc.c
|
@ -61,7 +61,6 @@
|
|||
static fdctrl_t *floppy_controller;
|
||||
static RTCState *rtc_state;
|
||||
static PITState *pit;
|
||||
static IOAPICState *ioapic;
|
||||
static PCIDevice *i440fx_state;
|
||||
|
||||
typedef struct rom_reset_data {
|
||||
|
@ -90,14 +89,18 @@ static void option_rom_setup_reset(target_phys_addr_t addr, unsigned size)
|
|||
|
||||
typedef struct isa_irq_state {
|
||||
qemu_irq *i8259;
|
||||
qemu_irq *ioapic;
|
||||
} IsaIrqState;
|
||||
|
||||
static void isa_irq_handler(void *opaque, int n, int level)
|
||||
{
|
||||
IsaIrqState *isa = (IsaIrqState *)opaque;
|
||||
|
||||
qemu_set_irq(isa->i8259[n], level);
|
||||
}
|
||||
if (n < 16) {
|
||||
qemu_set_irq(isa->i8259[n], level);
|
||||
}
|
||||
qemu_set_irq(isa->ioapic[n], level);
|
||||
};
|
||||
|
||||
static void ioport80_write(void *opaque, uint32_t addr, uint32_t data)
|
||||
{
|
||||
|
@ -1282,7 +1285,7 @@ static void pc_init1(ram_addr_t ram_size,
|
|||
i8259 = i8259_init(cpu_irq[0]);
|
||||
isa_irq_state = qemu_mallocz(sizeof(*isa_irq_state));
|
||||
isa_irq_state->i8259 = i8259;
|
||||
isa_irq = qemu_allocate_irqs(isa_irq_handler, isa_irq_state, 16);
|
||||
isa_irq = qemu_allocate_irqs(isa_irq_handler, isa_irq_state, 24);
|
||||
ferr_irq = isa_irq[13];
|
||||
|
||||
if (pci_enabled) {
|
||||
|
@ -1324,16 +1327,13 @@ static void pc_init1(ram_addr_t ram_size,
|
|||
register_ioport_write(0x92, 1, 1, ioport92_write, NULL);
|
||||
|
||||
if (pci_enabled) {
|
||||
ioapic = ioapic_init();
|
||||
isa_irq_state->ioapic = ioapic_init();
|
||||
}
|
||||
pit = pit_init(0x40, isa_irq[0]);
|
||||
pcspk_init(pit);
|
||||
if (!no_hpet) {
|
||||
hpet_init(isa_irq);
|
||||
}
|
||||
if (pci_enabled) {
|
||||
pic_set_alt_irq_func(isa_pic, ioapic_set_irq, ioapic);
|
||||
}
|
||||
|
||||
for(i = 0; i < MAX_SERIAL_PORTS; i++) {
|
||||
if (serial_hds[i]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue