From 0e0df1e24de709016c42164d9b22b981a04e4696 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Mon, 2 Jan 2012 00:32:15 +0200 Subject: 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 Reviewed-by: Richard Henderson --- memory.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'memory.c') diff --git a/memory.c b/memory.c index 66accba..a6c37c9 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) -- cgit v1.1