From patchwork Sat Jul 23 19:17:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 106476 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9A06DB6F76 for ; Sun, 24 Jul 2011 05:18:05 +1000 (EST) Received: from localhost ([::1]:44332 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qkhi5-00032P-Hr for incoming@patchwork.ozlabs.org; Sat, 23 Jul 2011 15:18:01 -0400 Received: from eggs.gnu.org ([140.186.70.92]:60370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qkhhv-0002xL-Np for qemu-devel@nongnu.org; Sat, 23 Jul 2011 15:17:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qkhhu-0004sk-Cv for qemu-devel@nongnu.org; Sat, 23 Jul 2011 15:17:51 -0400 Received: from mail-vx0-f173.google.com ([209.85.220.173]:37275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qkhhu-0004sf-9y for qemu-devel@nongnu.org; Sat, 23 Jul 2011 15:17:50 -0400 Received: by vxi29 with SMTP id 29so2635039vxi.4 for ; Sat, 23 Jul 2011 12:17:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; bh=gNTFxNLIHejPcZrkRhoIOyf22oc34b0c0mfS5QZSpNc=; b=lxSdV8Bdaj7B8ovx/cD0rzCC8fCtNcEf3t/ZjyLMyJgW6K9fBq6XIlrPkngHQ5XB4R oZAohUqfspKXlgDlGFvuWbcaJvA2r6MPfkCsbgKyn18jCynZ9iqxQKysI5EerKHo9dev JduEr5h/tD2t9pGcEVX8l63WxrMHkitTbZq/o= Received: by 10.52.68.240 with SMTP id z16mr2995444vdt.175.1311448669910; Sat, 23 Jul 2011 12:17:49 -0700 (PDT) Received: from localhost.localdomain (c-71-227-161-214.hsd1.wa.comcast.net [71.227.161.214]) by mx.google.com with ESMTPS id z4sm1361183vcd.11.2011.07.23.12.17.49 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 23 Jul 2011 12:17:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 23 Jul 2011 12:17:34 -0700 Message-Id: <1311448659-17424-3-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1311448659-17424-1-git-send-email-rth@twiddle.net> References: <1311448659-17424-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.220.173 Subject: [Qemu-devel] [PATCH 2/7] pci: Export pci_to_cpu_addr. 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 This is, more or less, the read accessor to pci_bus_set_mem_base as a write accessor. It will be needed for implementing sparse memory spaces for Alpha. Signed-off-by: Richard Henderson --- hw/pci.c | 3 +-- hw/pci.h | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index b904a4e..68e18d3 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -820,8 +820,7 @@ PCIDevice *pci_register_device(PCIBus *bus, const char *name, return pci_dev; } -static target_phys_addr_t pci_to_cpu_addr(PCIBus *bus, - target_phys_addr_t addr) +target_phys_addr_t pci_to_cpu_addr(PCIBus *bus, target_phys_addr_t addr) { return addr + bus->mem_base; } diff --git a/hw/pci.h b/hw/pci.h index c220745..458be00 100644 --- a/hw/pci.h +++ b/hw/pci.h @@ -246,6 +246,7 @@ void pci_device_reset(PCIDevice *dev); void pci_bus_reset(PCIBus *bus); void pci_bus_set_mem_base(PCIBus *bus, target_phys_addr_t base); +target_phys_addr_t pci_to_cpu_addr(PCIBus *bus, target_phys_addr_t addr); PCIDevice *pci_nic_init(NICInfo *nd, const char *default_model, const char *default_devaddr);