hw/isa/i82378: Remove intermediate IRQ forwarder
When the i82378 model was added in commita04ff94097
("prep: Add i82378 PCI-to-ISA bridge emulation") the i8259 model was not yet QOM'ified. This happened later in commit747c70af78
("i8259: Convert to qdev"). Directly dispatch ISA IRQs to 'cpu_intr' output IRQ by removing the intermediate i82378_request_out0_irq() handler. Rename ISA IRQs array as 'isa_irqs_in' to emphasize these are input IRQs. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230210163744.32182-4-philmd@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
08d8bf4fe3
commit
cef2e7148e
@ -33,7 +33,7 @@ struct I82378State {
|
|||||||
PCIDevice parent_obj;
|
PCIDevice parent_obj;
|
||||||
|
|
||||||
qemu_irq cpu_intr;
|
qemu_irq cpu_intr;
|
||||||
qemu_irq *i8259;
|
qemu_irq *isa_irqs_in;
|
||||||
MemoryRegion io;
|
MemoryRegion io;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -47,18 +47,12 @@ static const VMStateDescription vmstate_i82378 = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static void i82378_request_out0_irq(void *opaque, int irq, int level)
|
|
||||||
{
|
|
||||||
I82378State *s = opaque;
|
|
||||||
qemu_set_irq(s->cpu_intr, level);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void i82378_request_pic_irq(void *opaque, int irq, int level)
|
static void i82378_request_pic_irq(void *opaque, int irq, int level)
|
||||||
{
|
{
|
||||||
DeviceState *dev = opaque;
|
DeviceState *dev = opaque;
|
||||||
I82378State *s = I82378(dev);
|
I82378State *s = I82378(dev);
|
||||||
|
|
||||||
qemu_set_irq(s->i8259[irq], level);
|
qemu_set_irq(s->isa_irqs_in[irq], level);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void i82378_realize(PCIDevice *pci, Error **errp)
|
static void i82378_realize(PCIDevice *pci, Error **errp)
|
||||||
@ -94,9 +88,8 @@ static void i82378_realize(PCIDevice *pci, Error **errp)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* 2 82C59 (irq) */
|
/* 2 82C59 (irq) */
|
||||||
s->i8259 = i8259_init(isabus,
|
s->isa_irqs_in = i8259_init(isabus, s->cpu_intr);
|
||||||
qemu_allocate_irq(i82378_request_out0_irq, s, 0));
|
isa_bus_irqs(isabus, s->isa_irqs_in);
|
||||||
isa_bus_irqs(isabus, s->i8259);
|
|
||||||
|
|
||||||
/* 1 82C54 (pit) */
|
/* 1 82C54 (pit) */
|
||||||
pit = i8254_pit_init(isabus, 0x40, 0, NULL);
|
pit = i8254_pit_init(isabus, 0x40, 0, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user