aboutsummaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2012-01-02 15:40:52 +0200
committerAvi Kivity <avi@redhat.com>2012-01-04 13:34:50 +0200
commit75c578dcaae48f239fc87b545022efa8fa13f455 (patch)
treee3a7182da298ce03bb894fa166c236fb6689a5d4 /memory.c
parentb3b00c78d8247cdffc25839d4b8ff0310a889480 (diff)
Drop IO_MEM_ROMD
Unlike ->readonly, ->readable is not inherited from aliase, so we can simply query the memory region. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/memory.c b/memory.c
index 24b6b6f8f3..394cbab10e 100644
--- a/memory.c
+++ b/memory.c
@@ -838,7 +838,7 @@ static void memory_region_destructor_iomem(MemoryRegion *mr)
static void memory_region_destructor_rom_device(MemoryRegion *mr)
{
qemu_ram_free(mr->ram_addr & TARGET_PAGE_MASK);
- cpu_unregister_io_memory(mr->ram_addr & ~(TARGET_PAGE_MASK | IO_MEM_ROMD));
+ cpu_unregister_io_memory(mr->ram_addr & ~TARGET_PAGE_MASK);
}
static bool memory_region_wrong_endianness(MemoryRegion *mr)
@@ -868,6 +868,7 @@ void memory_region_init(MemoryRegion *mr,
mr->ram = false;
mr->readable = true;
mr->readonly = false;
+ mr->rom_device = false;
mr->destructor = memory_region_destructor_none;
mr->priority = 0;
mr->may_overlap = false;
@@ -1039,10 +1040,10 @@ void memory_region_init_rom_device(MemoryRegion *mr,
mr->ops = ops;
mr->opaque = opaque;
mr->terminates = true;
+ mr->rom_device = true;
mr->destructor = memory_region_destructor_rom_device;
mr->ram_addr = qemu_ram_alloc(size, mr);
mr->ram_addr |= cpu_register_io_memory(mr);
- mr->ram_addr |= IO_MEM_ROMD;
}
void memory_region_destroy(MemoryRegion *mr)