[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 30/32] hw/isa/piix: Consolidate IRQ triggering
From: |
Bernhard Beschow |
Subject: |
[PATCH 30/32] hw/isa/piix: Consolidate IRQ triggering |
Date: |
Sun, 4 Dec 2022 20:05:51 +0100 |
Speeds up PIIX4 which resolves an old TODO.
Signed-off-by: Bernhard Beschow <shentey@gmail.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 3d1659e5fd..d05f1aa4ff 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);
- }
-}
-
/*
* Return the global irq number corresponding to a given device irq
* pin. We could also use the bus number to have a more precise mapping.
@@ -275,7 +254,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)
@@ -592,7 +571,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, piix4_pci_slot_get_pirq, s,
+ pci_bus_irqs(pci_bus, piix_set_irq, piix4_pci_slot_get_pirq, s,
PIIX_NUM_PIRQS);
}
@@ -610,6 +589,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.38.1
- [PATCH 22/32] hw/isa/piix4: Use Proxy PIC device, (continued)
- [PATCH 22/32] hw/isa/piix4: Use Proxy PIC device, Bernhard Beschow, 2022/12/04
- [PATCH 19/32] hw/isa/piix3: Rename typedef PIIX3State to PIIXState, Bernhard Beschow, 2022/12/04
- [PATCH 23/32] hw/isa/piix4: Reuse struct PIIXState from PIIX3, Bernhard Beschow, 2022/12/04
- [PATCH 24/32] hw/isa/piix4: Rename reset control operations to match PIIX3, Bernhard Beschow, 2022/12/04
- [PATCH 25/32] hw/isa/piix4: Prefix pci_slot_get_pirq() with "piix4_", Bernhard Beschow, 2022/12/04
- [PATCH 26/32] hw/isa/piix3: Merge hw/isa/piix4.c, Bernhard Beschow, 2022/12/04
- [PATCH 27/32] hw/isa/piix: Harmonize names of reset control memory regions, Bernhard Beschow, 2022/12/04
- [PATCH 28/32] hw/isa/piix: Reuse PIIX3 base class' realize method in PIIX4, Bernhard Beschow, 2022/12/04
- [PATCH 29/32] hw/isa/piix: Rename functions to be shared for interrupt triggering, Bernhard Beschow, 2022/12/04
- [PATCH 31/32] hw/isa/piix: Share PIIX3 base class with PIIX4, Bernhard Beschow, 2022/12/04
- [PATCH 30/32] hw/isa/piix: Consolidate IRQ triggering,
Bernhard Beschow <=
- [PATCH 32/32] hw/isa/piix: Drop the "3" from the PIIX base class, Bernhard Beschow, 2022/12/04
- Re: [PATCH 00/32] Consolidate PIIX south bridges, Bernhard Beschow, 2022/12/04
- Re: [PATCH 00/32] Consolidate PIIX south bridges, Bernhard Beschow, 2022/12/18
- Re: [PATCH 00/32] Consolidate PIIX south bridges, Michael S. Tsirkin, 2022/12/20