From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acz5k-0003eT-81 for qemu-devel@nongnu.org; Mon, 07 Mar 2016 12:37:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1acz5j-0003IS-AI for qemu-devel@nongnu.org; Mon, 07 Mar 2016 12:37:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acz5j-0003IM-5k for qemu-devel@nongnu.org; Mon, 07 Mar 2016 12:37:11 -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 (Postfix) with ESMTPS id CD4F964D2C for ; Mon, 7 Mar 2016 17:37:10 +0000 (UTC) From: Paolo Bonzini Date: Mon, 7 Mar 2016 18:36:51 +0100 Message-Id: <1457372221-19285-6-git-send-email-pbonzini@redhat.com> In-Reply-To: <1457372221-19285-1-git-send-email-pbonzini@redhat.com> References: <1457372221-19285-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 05/15] memory: Implement memory_region_get_ram_addr with mr->ram_block List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Fam Zheng From: Fam Zheng Signed-off-by: Fam Zheng Message-Id: <1456813104-25902-4-git-send-email-famz@redhat.com> Signed-off-by: Paolo Bonzini --- include/exec/memory.h | 8 +------- memory.c | 5 +++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index d5284c2..810d2c0 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -978,14 +978,8 @@ void memory_region_add_subregion_overlap(MemoryRegion *mr, /** * memory_region_get_ram_addr: Get the ram address associated with a memory * region - * - * DO NOT USE THIS FUNCTION. This is a temporary workaround while the Xen - * code is being reworked. */ -static inline ram_addr_t memory_region_get_ram_addr(MemoryRegion *mr) -{ - return mr->ram_addr; -} +ram_addr_t memory_region_get_ram_addr(MemoryRegion *mr); uint64_t memory_region_get_alignment(const MemoryRegion *mr); /** diff --git a/memory.c b/memory.c index 1aa777d..d83405b 100644 --- a/memory.c +++ b/memory.c @@ -1640,6 +1640,11 @@ void *memory_region_get_ram_ptr(MemoryRegion *mr) return ptr + offset; } +ram_addr_t memory_region_get_ram_addr(MemoryRegion *mr) +{ + return mr->ram_block ? mr->ram_block->offset : RAM_ADDR_INVALID; +} + void memory_region_ram_resize(MemoryRegion *mr, ram_addr_t newsize, Error **errp) { assert(mr->ram_addr != RAM_ADDR_INVALID); -- 2.5.0