[RFC v5 07/86] memory: rename MemoryRegion::has_ram_addr to ::terminates

Avi Kivity
2011-07-20T16:50:44Z

I/O regions will not have ram_addrs, so this is a better name.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
memory.c | 18 +++++++++---------
memory.h | 2 +-
2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/memory.c b/memory.c
index 7187223..5fda4a0 100644
--- a/memory.c
+++ b/memory.c
@@ -244,7 +244,7 @@ static void render_memory_region(FlatView *view,
render_memory_region(view, subregion, base, clip);
}

- if (!mr->has_ram_addr) {
+ if (!mr->terminates) {
return;
}

@@ -366,7 +366,7 @@ void memory_region_init(MemoryRegion *mr,
mr->size = size;
mr->addr = 0;
mr->offset = 0;
- mr->has_ram_addr = false;
+ mr->terminates = false;
mr->priority = 0;
mr->may_overlap = false;
mr->alias = NULL;
@@ -521,7 +521,7 @@ void memory_region_init_io(MemoryRegion *mr,
memory_region_init(mr, name, size);
mr->ops = ops;
mr->opaque = opaque;
- mr->has_ram_addr = true;
+ mr->terminates = true;
mr->ram_addr = cpu_register_io_memory(memory_region_read_thunk,
memory_region_write_thunk,
mr,
@@ -534,7 +534,7 @@ void memory_region_init_ram(MemoryRegion *mr,
uint64_t size)
{
memory_region_init(mr, name, size);
- mr->has_ram_addr = true;
+ mr->terminates = true;
mr->ram_addr = qemu_ram_alloc(dev, name, size);
}

@@ -545,7 +545,7 @@ void memory_region_init_ram_ptr(MemoryRegion *mr,
void *ptr)
{
memory_region_init(mr, name, size);
- mr->has_ram_addr = true;
+ mr->terminates = true;
mr->ram_addr = qemu_ram_alloc_from_ptr(dev, name, size, ptr);
}

@@ -588,13 +588,13 @@ void memory_region_set_log(MemoryRegion *mr, bool log, unsigned client)
bool memory_region_get_dirty(MemoryRegion *mr, target_phys_addr_t addr,
unsigned client)
{
- assert(mr->has_ram_addr);
+ assert(mr->terminates);
return cpu_physical_memory_get_dirty(mr->ram_addr + addr, 1 << client);
}

void memory_region_set_dirty(MemoryRegion *mr, target_phys_addr_t addr)
{
- assert(mr->has_ram_addr);
+ assert(mr->terminates);
return cpu_physical_memory_set_dirty(mr->ram_addr + addr);
}

@@ -618,7 +618,7 @@ void memory_region_set_readonly(MemoryRegion *mr, bool readonly)
void memory_region_reset_dirty(MemoryRegion *mr, target_phys_addr_t addr,
target_phys_addr_t size, unsigned client)
{
- assert(mr->has_ram_addr);
+ assert(mr->terminates);
cpu_physical_memory_reset_dirty(mr->ram_addr + addr,
mr->ram_addr + addr + size,
1 << client);
@@ -630,7 +630,7 @@ void *memory_region_get_ram_ptr(MemoryRegion *mr)
return memory_region_get_ram_ptr(mr->alias) + mr->alias_offset;
}

- if (!mr->has_ram_addr) {
+ if (!mr->terminates) {
abort();
}

diff --git a/memory.h b/memory.h
index 8873f75..2ad7202 100644
--- a/memory.h
+++ b/memory.h
@@ -77,7 +77,7 @@ struct MemoryRegion {
target_phys_addr_t addr;
target_phys_addr_t offset;
ram_addr_t ram_addr;
- bool has_ram_addr;
+ bool terminates;
MemoryRegion *alias;
target_phys_addr_t alias_offset;
unsigned priority;
--
1.7.5.3