Skip to content

Commit a4d65b7

Browse files
zbalatonphilmd
authored andcommitted
vt82c686: Add a method to VIA_ISA to raise ISA interrupts
Other functions in the VT82xx chips need to raise ISA interrupts. Keep a reference to them in the device state and add via_isa_set_irq() to allow setting their state. Signed-off-by: BALATON Zoltan <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Jiaxun Yang <[email protected]> Message-Id: <778c04dc2c8affac060b8edf9e8d7dab3c3e04eb.1634259980.git.balaton@eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
1 parent 3a2f166 commit a4d65b7

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

hw/isa/vt82c686.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(ViaISAState, VIA_ISA)
542542
struct ViaISAState {
543543
PCIDevice dev;
544544
qemu_irq cpu_intr;
545+
qemu_irq *isa_irqs;
545546
ISABus *isa_bus;
546547
ViaSuperIOState *via_sio;
547548
};
@@ -567,6 +568,12 @@ static const TypeInfo via_isa_info = {
567568
},
568569
};
569570

571+
void via_isa_set_irq(PCIDevice *d, int n, int level)
572+
{
573+
ViaISAState *s = VIA_ISA(d);
574+
qemu_set_irq(s->isa_irqs[n], level);
575+
}
576+
570577
static void via_isa_request_i8259_irq(void *opaque, int irq, int level)
571578
{
572579
ViaISAState *s = opaque;
@@ -584,7 +591,8 @@ static void via_isa_realize(PCIDevice *d, Error **errp)
584591
isa_irq = qemu_allocate_irqs(via_isa_request_i8259_irq, s, 1);
585592
s->isa_bus = isa_bus_new(dev, get_system_memory(), pci_address_space_io(d),
586593
&error_fatal);
587-
isa_bus_irqs(s->isa_bus, i8259_init(s->isa_bus, *isa_irq));
594+
s->isa_irqs = i8259_init(s->isa_bus, *isa_irq);
595+
isa_bus_irqs(s->isa_bus, s->isa_irqs);
588596
i8254_pit_init(s->isa_bus, 0x40, 0, NULL);
589597
i8257_dma_init(s->isa_bus, 0);
590598
mc146818_rtc_init(s->isa_bus, 2000, NULL);

include/hw/isa/vt82c686.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
#ifndef HW_VT82C686_H
22
#define HW_VT82C686_H
33

4+
#include "hw/pci/pci.h"
5+
46
#define TYPE_VT82C686B_ISA "vt82c686b-isa"
57
#define TYPE_VT82C686B_PM "vt82c686b-pm"
68
#define TYPE_VT8231_ISA "vt8231-isa"
79
#define TYPE_VT8231_PM "vt8231-pm"
810
#define TYPE_VIA_AC97 "via-ac97"
911
#define TYPE_VIA_MC97 "via-mc97"
1012

13+
void via_isa_set_irq(PCIDevice *d, int n, int level);
14+
1115
#endif

0 commit comments

Comments
 (0)