aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2012-10-02 13:21:54 -0600
committerMichael S. Tsirkin <mst@redhat.com>2012-10-29 17:59:06 +0200
commitd6e65d54f0fa980f891aa3166d85b6ffd7d541eb (patch)
tree81f1baf5d1bb6e87ac56e827f03b8425c3343786
parentd262cb02861dd33375c08fc798930653b14769e9 (diff)
downloadqemu-d6e65d54f0fa980f891aa3166d85b6ffd7d541eb.zip
qemu-d6e65d54f0fa980f891aa3166d85b6ffd7d541eb.tar.gz
qemu-d6e65d54f0fa980f891aa3166d85b6ffd7d541eb.tar.bz2
pci: Helper function for testing if an INTx route changed
Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--hw/pci.c5
-rw-r--r--hw/pci.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/hw/pci.c b/hw/pci.c
index d44fd0e..8c6b3d1 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -1121,6 +1121,11 @@ PCIINTxRoute pci_device_route_intx_to_irq(PCIDevice *dev, int pin)
return bus->route_intx_to_irq(bus->irq_opaque, pin);
}
+bool pci_intx_route_changed(PCIINTxRoute *old, PCIINTxRoute *new)
+{
+ return old->mode != new->mode || old->irq != new->irq;
+}
+
void pci_bus_fire_intx_routing_notifier(PCIBus *bus)
{
PCIDevice *dev;
diff --git a/hw/pci.h b/hw/pci.h
index 1f902f5..a852941 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -326,6 +326,7 @@ PCIBus *pci_register_bus(DeviceState *parent, const char *name,
uint8_t devfn_min, int nirq);
void pci_bus_set_route_irq_fn(PCIBus *, pci_route_irq_fn);
PCIINTxRoute pci_device_route_intx_to_irq(PCIDevice *dev, int pin);
+bool pci_intx_route_changed(PCIINTxRoute *old, PCIINTxRoute *new);
void pci_bus_fire_intx_routing_notifier(PCIBus *bus);
void pci_device_set_intx_routing_notifier(PCIDevice *dev,
PCIINTxRoutingNotifier notifier);