From patchwork Wed Apr 22 06:28:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 463584 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 471FF140134 for ; Wed, 22 Apr 2015 16:47:52 +1000 (AEST) Received: from localhost ([::1]:33455 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkoRq-0001fg-4s for incoming@patchwork.ozlabs.org; Wed, 22 Apr 2015 02:47:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkoNn-0002a5-Mz for qemu-devel@nongnu.org; Wed, 22 Apr 2015 02:43:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YkoNk-0002Ei-VJ for qemu-devel@nongnu.org; Wed, 22 Apr 2015 02:43:39 -0400 Received: from e19.ny.us.ibm.com ([129.33.205.209]:34590) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkoNk-0002De-Qx for qemu-devel@nongnu.org; Wed, 22 Apr 2015 02:43:36 -0400 Received: from /spool/local by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 22 Apr 2015 02:43:36 -0400 Received: from d01dlp01.pok.ibm.com (9.56.250.166) by e19.ny.us.ibm.com (146.89.104.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 22 Apr 2015 02:43:35 -0400 Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id DEB4B38C8039; Wed, 22 Apr 2015 02:43:34 -0400 (EDT) Received: from d01av05.pok.ibm.com (d01av05.pok.ibm.com [9.56.224.195]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t3M6hY3T63439050; Wed, 22 Apr 2015 06:43:34 GMT Received: from d01av05.pok.ibm.com (localhost [127.0.0.1]) by d01av05.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t3M6hYks010926; Wed, 22 Apr 2015 02:43:34 -0400 Received: from localhost ([9.80.109.219]) by d01av05.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t3M6hXvG010917; Wed, 22 Apr 2015 02:43:33 -0400 From: Michael Roth To: qemu-devel@nongnu.org Date: Wed, 22 Apr 2015 01:28:18 -0500 Message-Id: <1429684100-13354-15-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1429684100-13354-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1429684100-13354-1-git-send-email-mdroth@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15042206-0013-0000-0000-000000718925 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 129.33.205.209 Cc: mst@redhat.com, aik@ozlabs.ru, agraf@suse.de, qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, bharata.rao@gmail.com, nfont@linux.vnet.ibm.com, david@gibson.dropbear.id.au Subject: [Qemu-devel] [PATCH v8 14/16] pci: make pci_bar useable outside pci.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org We need to work with PCI BARs to generate OF properties during PCI hotplug for sPAPR guests. Signed-off-by: Michael Roth Reviewed-by: David Gibson Cc: mst@redhat.com Acked-by: Michael S. Tsirkin --- hw/pci/pci.c | 2 +- include/hw/pci/pci.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 6941a82..7d14657 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -123,7 +123,7 @@ static uint16_t pci_default_sub_device_id = PCI_SUBDEVICE_ID_QEMU; static QLIST_HEAD(, PCIHostState) pci_host_bridges; -static int pci_bar(PCIDevice *d, int reg) +int pci_bar(PCIDevice *d, int reg) { uint8_t type; diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index be2d9b8..1a4e0be 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -332,6 +332,7 @@ void pci_device_save(PCIDevice *s, QEMUFile *f); int pci_device_load(PCIDevice *s, QEMUFile *f); MemoryRegion *pci_address_space(PCIDevice *dev); MemoryRegion *pci_address_space_io(PCIDevice *dev); +int pci_bar(PCIDevice *d, int reg); typedef void (*pci_set_irq_fn)(void *opaque, int irq_num, int level); typedef int (*pci_map_irq_fn)(PCIDevice *pci_dev, int irq_num);