Skip to content
  • Bernhard Beschow's avatar
    f021f4e9
    hw/pci/pci: Factor out pci_bus_map_irqs() from pci_bus_irqs() · f021f4e9
    Bernhard Beschow authored
    
    
    pci_bus_irqs() coupled together the assignment of pci_set_irq_fn and
    pci_map_irq_fn to a PCI bus. This coupling gets in the way when the
    pci_map_irq_fn is board-specific while the pci_set_irq_fn is device-
    specific.
    
    For example, both of QEMU's PIIX south bridge models have different
    pci_map_irq_fn implementations which are board-specific rather than
    device-specific. These implementations should therefore reside in board
    code. The pci_set_irq_fn's, however, should stay in the device models
    because they access memory internal to the model.
    
    Factoring out pci_bus_map_irqs() from pci_bus_irqs() allows the
    assignments to be decoupled, resolving the problem described above.
    
    Note also how pci_vpb_realize() which gets touched in this commit
    assigns different pci_map_irq_fn's depending on the board.
    
    Signed-off-by: default avatarBernhard Beschow <shentey@gmail.com>
    Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
    Message-Id: <20230109172347.1830-5-shentey@gmail.com>
    [PMD: Factor out in vfu_object_set_bus_irq()]
    Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
    f021f4e9
    hw/pci/pci: Factor out pci_bus_map_irqs() from pci_bus_irqs()
    Bernhard Beschow authored
    
    
    pci_bus_irqs() coupled together the assignment of pci_set_irq_fn and
    pci_map_irq_fn to a PCI bus. This coupling gets in the way when the
    pci_map_irq_fn is board-specific while the pci_set_irq_fn is device-
    specific.
    
    For example, both of QEMU's PIIX south bridge models have different
    pci_map_irq_fn implementations which are board-specific rather than
    device-specific. These implementations should therefore reside in board
    code. The pci_set_irq_fn's, however, should stay in the device models
    because they access memory internal to the model.
    
    Factoring out pci_bus_map_irqs() from pci_bus_irqs() allows the
    assignments to be decoupled, resolving the problem described above.
    
    Note also how pci_vpb_realize() which gets touched in this commit
    assigns different pci_map_irq_fn's depending on the board.
    
    Signed-off-by: default avatarBernhard Beschow <shentey@gmail.com>
    Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
    Message-Id: <20230109172347.1830-5-shentey@gmail.com>
    [PMD: Factor out in vfu_object_set_bus_irq()]
    Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
Loading