From patchwork Mon Dec 19 14:13:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 132248 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 B7B11B7001 for ; Tue, 20 Dec 2011 01:47:32 +1100 (EST) Received: from localhost ([::1]:53251 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rcdzv-0005tJ-H1 for incoming@patchwork.ozlabs.org; Mon, 19 Dec 2011 09:15:23 -0500 Received: from eggs.gnu.org ([140.186.70.92]:48591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rcdym-0002wZ-H3 for qemu-devel@nongnu.org; Mon, 19 Dec 2011 09:14:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rcdyi-0001v0-0M for qemu-devel@nongnu.org; Mon, 19 Dec 2011 09:14:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rcdyh-0001uN-JJ for qemu-devel@nongnu.org; Mon, 19 Dec 2011 09:14:07 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pBJEE4Df004323 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 19 Dec 2011 09:14:04 -0500 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pBJEE0hI006981; Mon, 19 Dec 2011 09:14:03 -0500 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id B8FF3250BAF; Mon, 19 Dec 2011 16:13:54 +0200 (IST) From: Avi Kivity To: Stefano Stabellini , qemu-devel@nongnu.org, "Michael S. Tsirkin" Date: Mon, 19 Dec 2011 16:13:37 +0200 Message-Id: <1324304024-11220-17-git-send-email-avi@redhat.com> In-Reply-To: <1324304024-11220-1-git-send-email-avi@redhat.com> References: <1324304024-11220-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: xen-devel@lists.xensource.com, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 16/23] memory: temporarily add memory_region_get_ram_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 a layering violation, but needed while the code contains naked calls to qemu_get_ram_ptr() and the like. Signed-off-by: Avi Kivity --- memory.c | 6 ++++++ memory.h | 10 ++++++++++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/memory.c b/memory.c index 2dcbf80..41a106a 100644 --- a/memory.c +++ b/memory.c @@ -1376,6 +1376,12 @@ void memory_region_del_subregion(MemoryRegion *mr, memory_region_update_topology(); } +ram_addr_t memory_region_get_ram_addr(MemoryRegion *mr) +{ + assert(mr->backend_registered); + return mr->ram_addr; +} + static int cmp_flatrange_addr(const void *_addr, const void *_fr) { const AddrRange *addr = _addr; diff --git a/memory.h b/memory.h index b7d39ed..1e44d86 100644 --- a/memory.h +++ b/memory.h @@ -557,6 +557,16 @@ void memory_region_add_subregion_overlap(MemoryRegion *mr, target_phys_addr_t offset, MemoryRegion *subregion, unsigned priority); + +/** + * memory_region_get_ram_addr: Get the ram address associated with a memory + * region + * + * DO NOT USE THIS FUCNTION. This is a temporary workaround while the Xen + * code is being reworked. + */ +ram_addr_t memory_region_get_ram_addr(MemoryRegion *mr); + /** * memory_region_del_subregion: Remove a subregion. *