From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ82X-0004bw-DA for qemu-devel@nongnu.org; Tue, 02 Oct 2012 15:22:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJ82W-0002AM-5o for qemu-devel@nongnu.org; Tue, 02 Oct 2012 15:21:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22534) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ82V-0002AI-Tm for qemu-devel@nongnu.org; Tue, 02 Oct 2012 15:21:56 -0400 From: Alex Williamson Date: Tue, 02 Oct 2012 13:21:54 -0600 Message-ID: <20121002192153.31100.60641.stgit@bling.home> In-Reply-To: <20121002191609.31100.77382.stgit@bling.home> References: <20121002191609.31100.77382.stgit@bling.home> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 3/6] pci: Helper function for testing if an INTx route changed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: mst@redhat.com, qemu-devel@nongnu.org Cc: jan.kiszka@siemens.com, alex.williamson@redhat.com Signed-off-by: Alex Williamson --- hw/pci.c | 5 +++++ hw/pci.h | 1 + 2 files changed, 6 insertions(+) diff --git a/hw/pci.c b/hw/pci.c index 9cb0ad4..6adb3b7 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -1102,6 +1102,11 @@ PCIINTxRoute pci_device_route_intx_to_irq(PCIDevice *dev, int pin) return (PCIINTxRoute) { PCI_INTX_NOROUTE, -1 }; } +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 ed1a372..14ebb57 100644 --- a/hw/pci.h +++ b/hw/pci.h @@ -325,6 +325,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);