aboutsummaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-08-30 00:38:24 +0200
committerAvi Kivity <avi@redhat.com>2011-08-30 11:20:18 +0300
commit021d26d161bac89235eb79126996825221cf9f10 (patch)
tree6bfb839c497fe2add3d246bffc8b078114f5e552 /memory.c
parent950c671df1078f4505d1b8461620f48aa91a9fda (diff)
memory: Fix memory_region_get_ram_ptr for ROM devices
Mask out the sub-page bits that are used by ROM device for storing the io-index and the IO_MEM_ROMD flag. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/memory.c b/memory.c
index eb31fa8e58..57f0fa44ff 100644
--- a/memory.c
+++ b/memory.c
@@ -1063,7 +1063,7 @@ void *memory_region_get_ram_ptr(MemoryRegion *mr)
assert(mr->terminates);
- return qemu_get_ram_ptr(mr->ram_addr);
+ return qemu_get_ram_ptr(mr->ram_addr & TARGET_PAGE_MASK);
}
static void memory_region_update_coalesced_range(MemoryRegion *mr)