[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v8 27/29] hw/isa/piix: Resolve duplicate code regarding PCI inter
From: |
Bernhard Beschow |
Subject: |
[PATCH v8 27/29] hw/isa/piix: Resolve duplicate code regarding PCI interrupt wiring |
Date: |
Sat, 7 Oct 2023 14:38:35 +0200 |
Now that both PIIX3 and PIIX4 use piix_set_irq() to trigger PCI IRQs the wiring
in the respective realize methods can be shared, too.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/isa/piix.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/hw/isa/piix.c b/hw/isa/piix.c
index 17677c2126..cba2098ca2 100644
--- a/hw/isa/piix.c
+++ b/hw/isa/piix.c
@@ -372,6 +372,8 @@ static void pci_piix_realize(PCIDevice *dev, const char
*uhci_type,
}
qdev_connect_gpio_out(DEVICE(&d->pm), 0, d->isa_irqs_in[9]);
}
+
+ pci_bus_irqs(pci_bus, piix_set_pci_irq, d, PIIX_NUM_PIRQS);
}
static void build_pci_isa_aml(AcpiDevAmlIf *adev, Aml *scope)
@@ -453,7 +455,6 @@ static const TypeInfo piix_pci_type_info = {
static void piix3_realize(PCIDevice *dev, Error **errp)
{
ERRP_GUARD();
- PIIXState *piix3 = PIIX_PCI_DEVICE(dev);
PCIBus *pci_bus = pci_get_bus(dev);
pci_piix_realize(dev, TYPE_PIIX3_USB_UHCI, errp);
@@ -461,7 +462,6 @@ static void piix3_realize(PCIDevice *dev, Error **errp)
return;
}
- pci_bus_irqs(pci_bus, piix_set_pci_irq, piix3, PIIX_NUM_PIRQS);
pci_bus_set_route_irq_fn(pci_bus, piix_route_intx_pin_to_irq);
}
@@ -492,16 +492,7 @@ static const TypeInfo piix3_info = {
static void piix4_realize(PCIDevice *dev, Error **errp)
{
- ERRP_GUARD();
- PIIXState *s = PIIX_PCI_DEVICE(dev);
- PCIBus *pci_bus = pci_get_bus(dev);
-
pci_piix_realize(dev, TYPE_PIIX4_USB_UHCI, errp);
- if (*errp) {
- return;
- }
-
- pci_bus_irqs(pci_bus, piix_set_pci_irq, s, PIIX_NUM_PIRQS);
}
static void piix4_init(Object *obj)
--
2.42.0
- [PATCH v8 25/29] hw/isa/piix: Rename functions to be shared for PCI interrupt triggering, (continued)
- [PATCH v8 25/29] hw/isa/piix: Rename functions to be shared for PCI interrupt triggering, Bernhard Beschow, 2023/10/07
- [PATCH v8 12/29] hw/isa/piix3: Create USB controller in host device, Bernhard Beschow, 2023/10/07
- [PATCH v8 26/29] hw/isa/piix: Reuse PIIX3's PCI interrupt triggering in PIIX4, Bernhard Beschow, 2023/10/07
- [PATCH v8 22/29] hw/isa/piix: Harmonize names of reset control memory regions, Bernhard Beschow, 2023/10/07
- [PATCH v8 28/29] hw/isa/piix: Implement multi-process QEMU support also for PIIX4, Bernhard Beschow, 2023/10/07
- [PATCH v8 19/29] hw/isa/piix3: Merge hw/isa/piix4.c, Bernhard Beschow, 2023/10/07
- [PATCH v8 20/29] hw/isa/piix: Allow for optional PIC creation in PIIX3, Bernhard Beschow, 2023/10/07
- [PATCH v8 29/29] hw/i386/pc_piix: Make PIIX4 south bridge usable in PC machine, Bernhard Beschow, 2023/10/07
- [PATCH v8 17/29] hw/isa/piix4: Rename reset control operations to match PIIX3, Bernhard Beschow, 2023/10/07
- [PATCH v8 15/29] hw/isa/piix4: Remove unused inbound ISA interrupt lines, Bernhard Beschow, 2023/10/07
- [PATCH v8 27/29] hw/isa/piix: Resolve duplicate code regarding PCI interrupt wiring,
Bernhard Beschow <=
- Re: [PATCH v8 00/29] Consolidate PIIX south bridges, Chuck Zmudzinski, 2023/10/08