[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 32/33] hw/isa/piix: Consolidate IRQ triggering
From: |
Bernhard Beschow |
Subject: |
[PATCH v6 32/33] hw/isa/piix: Consolidate IRQ triggering |
Date: |
Mon, 9 Jan 2023 18:23:45 +0100 |
Speeds up PIIX4 which resolves an old TODO.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20221022150508.26830-41-shentey@gmail.com>
---
hw/isa/piix.c | 26 +++-----------------------
1 file changed, 3 insertions(+), 23 deletions(-)
diff --git a/hw/isa/piix.c b/hw/isa/piix.c
index 33ea5275ec..f125a6175f 100644
--- a/hw/isa/piix.c
+++ b/hw/isa/piix.c
@@ -83,27 +83,6 @@ static void piix_set_irq(void *opaque, int pirq, int level)
piix_set_irq_level(piix, pirq, level);
}
-static void piix4_set_irq(void *opaque, int irq_num, int level)
-{
- int i, pic_irq, pic_level;
- PIIXState *s = opaque;
- PCIBus *bus = pci_get_bus(&s->dev);
-
- /* now we change the pic irq level according to the piix irq mappings */
- /* XXX: optimize */
- pic_irq = s->dev.config[PIIX_PIRQCA + irq_num];
- if (pic_irq < ISA_NUM_IRQS) {
- /* The pic level is the logical OR of all the PCI irqs mapped to it. */
- pic_level = 0;
- for (i = 0; i < PIIX_NUM_PIRQS; i++) {
- if (pic_irq == s->dev.config[PIIX_PIRQCA + i]) {
- pic_level |= pci_bus_get_irq_level(bus, i);
- }
- }
- qemu_set_irq(s->pic.in_irqs[pic_irq], pic_level);
- }
-}
-
static PCIINTxRoute piix3_route_intx_pin_to_irq(void *opaque, int pin)
{
PIIXState *piix3 = opaque;
@@ -239,7 +218,7 @@ static int piix4_post_load(void *opaque, int version_id)
s->rcr = 0;
}
- return 0;
+ return piix3_post_load(opaque, version_id);
}
static int piix3_pre_save(void *opaque)
@@ -554,7 +533,7 @@ static void piix4_realize(PCIDevice *dev, Error **errp)
/* RTC */
s->rtc.irq = qdev_get_gpio_in(DEVICE(&s->pic), s->rtc.isairq);
- pci_bus_irqs(pci_bus, piix4_set_irq, s, PIIX_NUM_PIRQS);
+ pci_bus_irqs(pci_bus, piix_set_irq, s, PIIX_NUM_PIRQS);
}
static void piix4_init(Object *obj)
@@ -571,6 +550,7 @@ static void piix4_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+ k->config_write = piix_write_config;
k->realize = piix4_realize;
k->vendor_id = PCI_VENDOR_ID_INTEL;
k->device_id = PCI_DEVICE_ID_INTEL_82371AB_0;
--
2.39.0
- Re: [PATCH v6 15/33] hw/isa/piix3: Create power management controller in host device, (continued)
- [PATCH v6 23/33] hw/isa/piix4: Make PIIX4's ACPI and USB functions optional, Bernhard Beschow, 2023/01/09
- [PATCH v6 24/33] hw/isa/piix4: Remove unused inbound ISA interrupt lines, Bernhard Beschow, 2023/01/09
- [PATCH v6 19/33] hw/isa/piix3: Resolve redundant PIIX_NUM_PIC_IRQS, Bernhard Beschow, 2023/01/09
- [PATCH v6 25/33] hw/isa/piix4: Use TYPE_ISA_PIC device, Bernhard Beschow, 2023/01/09
- [PATCH v6 22/33] hw/isa/piix3: Drop the "3" from PIIX base class, Bernhard Beschow, 2023/01/09
- [PATCH v6 27/33] hw/isa/piix4: Rename reset control operations to match PIIX3, Bernhard Beschow, 2023/01/09
- [PATCH v6 32/33] hw/isa/piix: Consolidate IRQ triggering,
Bernhard Beschow <=
- [PATCH v6 33/33] hw/isa/piix: Share PIIX3's base class with PIIX4, Bernhard Beschow, 2023/01/09
- [PATCH v6 28/33] hw/isa/piix3: Merge hw/isa/piix4.c, Bernhard Beschow, 2023/01/09
- Re: [PATCH v6 28/33] hw/isa/piix3: Merge hw/isa/piix4.c, Philippe Mathieu-Daudé, 2023/01/12
- Re: [PATCH v6 28/33] hw/isa/piix3: Merge hw/isa/piix4.c, Philippe Mathieu-Daudé, 2023/01/12