summaryrefslogtreecommitdiff
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
commit5a3b4a21d9a02828fdca9ecfdda57716b6896ab7 (patch)
tree6bfb839c497fe2add3d246bffc8b078114f5e552
parent615b32541696d3e8518bbe6f243dd2bf94c7d5f2 (diff)
downloadqemu-5a3b4a21d9a02828fdca9ecfdda57716b6896ab7.tar.gz
qemu-5a3b4a21d9a02828fdca9ecfdda57716b6896ab7.tar.bz2
qemu-5a3b4a21d9a02828fdca9ecfdda57716b6896ab7.zip
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>
-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)