From 0878d0e11ba8013dd759c6921cbf05ba6a41bd71 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 22 Feb 2016 11:02:12 +0100 Subject: exec: hide mr->ram_addr from qemu_get_ram_ptr users Let users of qemu_get_ram_ptr and qemu_ram_ptr_length pass in an address that is relative to the MemoryRegion. This basically means what address_space_translate returns. Because the semantics of the second parameter change, rename the function to qemu_map_ram_ptr. Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini --- memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'memory.c') diff --git a/memory.c b/memory.c index f8085eab87..8ba496dc7b 100644 --- a/memory.c +++ b/memory.c @@ -1657,10 +1657,10 @@ void *memory_region_get_ram_ptr(MemoryRegion *mr) mr = mr->alias; } assert(mr->ram_block); - ptr = qemu_get_ram_ptr(mr->ram_block, memory_region_get_ram_addr(mr)); + ptr = qemu_map_ram_ptr(mr->ram_block, offset); rcu_read_unlock(); - return ptr + offset; + return ptr; } MemoryRegion *memory_region_from_host(void *ptr, ram_addr_t *offset) -- cgit v1.2.3