aboutsummaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
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);