mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
hw/isa/piix3: Decouple INTx-to-LNKx routing which is board-specific
pci_map_irq_fn's in general seem to be board-specific. So move PIIX3's pci_slot_get_pirq() to board code to not have PIIX3 make assuptions about its board. Signed-off-by: Bernhard Beschow <shentey@gmail.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230109172347.1830-6-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
f021f4e9d2
commit
738c2eb47f
2 changed files with 15 additions and 13 deletions
|
@ -79,17 +79,6 @@ static void piix3_set_irq(void *opaque, int pirq, int level)
|
|||
piix3_set_irq_level(piix3, pirq, 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.
|
||||
*/
|
||||
static int pci_slot_get_pirq(PCIDevice *pci_dev, int pci_intx)
|
||||
{
|
||||
int slot_addend;
|
||||
slot_addend = PCI_SLOT(pci_dev->devfn) - 1;
|
||||
return (pci_intx + slot_addend) & 3;
|
||||
}
|
||||
|
||||
static PCIINTxRoute piix3_route_intx_pin_to_irq(void *opaque, int pin)
|
||||
{
|
||||
PIIX3State *piix3 = opaque;
|
||||
|
@ -385,7 +374,6 @@ static void piix3_realize(PCIDevice *dev, Error **errp)
|
|||
}
|
||||
|
||||
pci_bus_irqs(pci_bus, piix3_set_irq, piix3, PIIX_NUM_PIRQS);
|
||||
pci_bus_map_irqs(pci_bus, pci_slot_get_pirq);
|
||||
pci_bus_set_route_irq_fn(pci_bus, piix3_route_intx_pin_to_irq);
|
||||
}
|
||||
|
||||
|
@ -421,7 +409,6 @@ static void piix3_xen_realize(PCIDevice *dev, Error **errp)
|
|||
* These additional routes can be discovered through ACPI.
|
||||
*/
|
||||
pci_bus_irqs(pci_bus, xen_piix3_set_irq, piix3, XEN_PIIX_NUM_PIRQS);
|
||||
pci_bus_map_irqs(pci_bus, xen_pci_slot_get_pirq);
|
||||
}
|
||||
|
||||
static void piix3_xen_class_init(ObjectClass *klass, void *data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue