aboutsummaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2016-03-01 14:18:20 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2016-03-07 13:18:28 +0100
commit7ebb2745acbb8d910eab07dc5f0aa01a4457703c (patch)
tree21d2d2e71f7ee7ae47f83e2eff24d0a9a8cfa4de /memory.c
parent0a75601853c00f3729fa62c49ec0d4bb1e3d9bc1 (diff)
memory: Implement memory_region_get_ram_addr with mr->ram_block
Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <1456813104-25902-4-git-send-email-famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/memory.c b/memory.c
index 1aa777da7f..d83405b176 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);