summaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2013-05-07 19:04:25 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2013-05-24 18:42:46 +0200
commit5f9a5ea1c0a8391033e7d33abd335dd804a1001a (patch)
treed2c1c997858117b0156b80d54a31280d25c886b3 /memory.c
parent4b81126e3399bfbcc47a4d696902c93401169f72 (diff)
downloadqemu-5f9a5ea1c0a8391033e7d33abd335dd804a1001a.tar.gz
qemu-5f9a5ea1c0a8391033e7d33abd335dd804a1001a.tar.bz2
qemu-5f9a5ea1c0a8391033e7d33abd335dd804a1001a.zip
memory: Rename readable flag to romd_mode
"Readable" is a very unfortunate name for this flag because even a rom_device region will always be readable from the guest POV. What differs is the mapping, just like the comments had to explain already. Also, readable could currently be understood as being a generic region flag, but it only applies to rom_device regions. So rename the flag and the function to modify it after the original term "ROMD" which could also be interpreted as "ROM direct", i.e. ROM mode with direct access. In any case, the scope of the flag is clearer now. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/memory.c b/memory.c
index 34bfb13894..013464b107 100644
--- a/memory.c
+++ b/memory.c
@@ -213,7 +213,7 @@ struct FlatRange {
hwaddr offset_in_region;
AddrRange addr;
uint8_t dirty_log_mask;
- bool readable;
+ bool romd_mode;
bool readonly;
};
@@ -236,7 +236,7 @@ static bool flatrange_equal(FlatRange *a, FlatRange *b)
return a->mr == b->mr
&& addrrange_equal(a->addr, b->addr)
&& a->offset_in_region == b->offset_in_region
- && a->readable == b->readable
+ && a->romd_mode == b->romd_mode
&& a->readonly == b->readonly;
}
@@ -276,7 +276,7 @@ static bool can_merge(FlatRange *r1, FlatRange *r2)
r1->addr.size),
int128_make64(r2->offset_in_region))
&& r1->dirty_log_mask == r2->dirty_log_mask
- && r1->readable == r2->readable
+ && r1->romd_mode == r2->romd_mode
&& r1->readonly == r2->readonly;
}
@@ -532,7 +532,7 @@ static void render_memory_region(FlatView *view,
fr.offset_in_region = offset_in_region;
fr.addr = addrrange_make(base, now);
fr.dirty_log_mask = mr->dirty_log_mask;
- fr.readable = mr->readable;
+ fr.romd_mode = mr->romd_mode;
fr.readonly = readonly;
flatview_insert(view, i, &fr);
++i;
@@ -552,7 +552,7 @@ static void render_memory_region(FlatView *view,
fr.offset_in_region = offset_in_region;
fr.addr = addrrange_make(base, remain);
fr.dirty_log_mask = mr->dirty_log_mask;
- fr.readable = mr->readable;
+ fr.romd_mode = mr->romd_mode;
fr.readonly = readonly;
flatview_insert(view, i, &fr);
}
@@ -801,7 +801,7 @@ void memory_region_init(MemoryRegion *mr,
mr->enabled = true;
mr->terminates = false;
mr->ram = false;
- mr->readable = true;
+ mr->romd_mode = true;
mr->readonly = false;
mr->rom_device = false;
mr->destructor = memory_region_destructor_none;
@@ -1121,11 +1121,11 @@ void memory_region_set_readonly(MemoryRegion *mr, bool readonly)
}
}
-void memory_region_rom_device_set_readable(MemoryRegion *mr, bool readable)
+void memory_region_rom_device_set_romd(MemoryRegion *mr, bool romd_mode)
{
- if (mr->readable != readable) {
+ if (mr->romd_mode != romd_mode) {
memory_region_transaction_begin();
- mr->readable = readable;
+ mr->romd_mode = romd_mode;
memory_region_update_pending |= mr->enabled;
memory_region_transaction_commit();
}
@@ -1659,9 +1659,9 @@ static void mtree_print_mr(fprintf_function mon_printf, void *f,
base + mr->addr
+ (hwaddr)int128_get64(mr->size) - 1,
mr->priority,
- mr->readable ? 'R' : '-',
- !mr->readonly && !(mr->rom_device && mr->readable) ? 'W'
- : '-',
+ mr->romd_mode ? 'R' : '-',
+ !mr->readonly && !(mr->rom_device && mr->romd_mode) ? 'W'
+ : '-',
mr->name,
mr->alias->name,
mr->alias_offset,
@@ -1674,9 +1674,9 @@ static void mtree_print_mr(fprintf_function mon_printf, void *f,
base + mr->addr
+ (hwaddr)int128_get64(mr->size) - 1,
mr->priority,
- mr->readable ? 'R' : '-',
- !mr->readonly && !(mr->rom_device && mr->readable) ? 'W'
- : '-',
+ mr->romd_mode ? 'R' : '-',
+ !mr->readonly && !(mr->rom_device && mr->romd_mode) ? 'W'
+ : '-',
mr->name);
}