summaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2012-01-02 00:32:15 +0200
committerAvi Kivity <avi@redhat.com>2012-01-04 13:34:50 +0200
commit0e0df1e24de709016c42164d9b22b981a04e4696 (patch)
tree1e5751eef8d10f4ce3ebc841062ddfee376288a3 /memory.c
parentd39e822265e56af761cc506ac45768ab8af940b4 (diff)
downloadqemu-0e0df1e24de709016c42164d9b22b981a04e4696.tar.gz
Convert IO_MEM_{RAM,ROM,UNASSIGNED,NOTDIRTY} to MemoryRegions
Convert the fixed-address IO_MEM_RAM, IO_MEM_ROM, IO_MEM_UNASSIGNED, and IO_MEM_NOTDIRTY io handlers to MemoryRegions. These aren't real regions, since they are never added to the memory hierarchy, but they allow reuse of the dispatch functionality. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/memory.c b/memory.c
index 66accba608..a6c37c9518 100644
--- a/memory.c
+++ b/memory.c
@@ -312,8 +312,7 @@ static void as_memory_range_add(AddressSpace *as, FlatRange *fr)
/* cpu_register_physical_memory_log() wants region_offset for
* mmio, but prefers offseting phys_offset for RAM. Humour it.
*/
- if ((phys_offset & ~TARGET_PAGE_MASK) == IO_MEM_RAM
- || (phys_offset & ~TARGET_PAGE_MASK) == IO_MEM_ROM) {
+ if (memory_region_is_ram(fr->mr)) {
phys_offset += region_offset;
region_offset = 0;
}
@@ -323,7 +322,7 @@ static void as_memory_range_add(AddressSpace *as, FlatRange *fr)
}
if (fr->readonly) {
- phys_offset |= IO_MEM_ROM;
+ phys_offset |= io_mem_rom.ram_addr;
}
cpu_register_physical_memory_log(int128_get64(fr->addr.start),
@@ -337,7 +336,7 @@ static void as_memory_range_del(AddressSpace *as, FlatRange *fr)
{
cpu_register_physical_memory(int128_get64(fr->addr.start),
int128_get64(fr->addr.size),
- IO_MEM_UNASSIGNED);
+ io_mem_unassigned.ram_addr);
}
static void as_memory_log_start(AddressSpace *as, FlatRange *fr)