From mboxrd@z Thu Jan 1 00:00:00 1970 From: muli@il.ibm.com Subject: [PATCH 2/6] device assignment: introduce pci_map_irq to get irq nr from pin number Date: Tue, 28 Oct 2008 12:06:46 +0200 Message-ID: <1225188410-2222-3-git-send-email-muli@il.ibm.com> References: <1225188410-2222-1-git-send-email-muli@il.ibm.com> <1225188410-2222-2-git-send-email-muli@il.ibm.com> Cc: kvm@vger.kernel.org, anthony@codemonkey.ws, weidong.han@intel.com, benami@il.ibm.com, muli@il.ibm.com, amit.shah@redhat.com, allen.m.kay@intel.com To: avi@redhat.com Return-path: Received: from mtagate1.uk.ibm.com ([194.196.100.161]:44199 "EHLO mtagate1.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752562AbYJ1KH5 (ORCPT ); Tue, 28 Oct 2008 06:07:57 -0400 Received: from d06nrmr1307.portsmouth.uk.ibm.com (d06nrmr1307.portsmouth.uk.ibm.com [9.149.38.129]) by mtagate1.uk.ibm.com (8.13.1/8.13.1) with ESMTP id m9SA7uMu029604 for ; Tue, 28 Oct 2008 10:07:56 GMT Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id m9SA7sTA999622 for ; Tue, 28 Oct 2008 10:07:55 GMT Received: from d06av01.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m9SA6rkX015189 for ; Tue, 28 Oct 2008 10:06:54 GMT In-Reply-To: <1225188410-2222-2-git-send-email-muli@il.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: From: Amit Shah Signed-off-by: Amit Shah Signed-off-by: Muli Ben-Yehuda --- qemu/hw/pci.c | 5 +++++ qemu/hw/pci.h | 1 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/qemu/hw/pci.c b/qemu/hw/pci.c index 512dbea..c82cd20 100644 --- a/qemu/hw/pci.c +++ b/qemu/hw/pci.c @@ -560,6 +560,11 @@ static void pci_set_irq(void *opaque, int irq_num, int level) bus->set_irq(bus->irq_opaque, irq_num, bus->irq_count[irq_num] != 0); } +int pci_map_irq(PCIDevice *pci_dev, int pin) +{ + return pci_dev->bus->map_irq(pci_dev, pin); +} + /***********************************************************/ /* monitor info on PCI */ diff --git a/qemu/hw/pci.h b/qemu/hw/pci.h index 60e4094..e11fbbf 100644 --- a/qemu/hw/pci.h +++ b/qemu/hw/pci.h @@ -81,6 +81,7 @@ void pci_register_io_region(PCIDevice *pci_dev, int region_num, uint32_t size, int type, PCIMapIORegionFunc *map_func); +int pci_map_irq(PCIDevice *pci_dev, int pin); uint32_t pci_default_read_config(PCIDevice *d, uint32_t address, int len); void pci_default_write_config(PCIDevice *d, -- 1.5.6.5