diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2013-05-07 19:04:25 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-05-24 18:42:46 +0200 |
commit | 5f9a5ea1c0a8391033e7d33abd335dd804a1001a (patch) | |
tree | d2c1c997858117b0156b80d54a31280d25c886b3 /include | |
parent | 4b81126e3399bfbcc47a4d696902c93401169f72 (diff) |
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 'include')
-rw-r--r-- | include/exec/memory.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h index 329ffb191d..e1208e476f 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -126,7 +126,7 @@ struct MemoryRegion { ram_addr_t ram_addr; bool subpage; bool terminates; - bool readable; + bool romd_mode; bool ram; bool readonly; /* For RAM regions */ bool enabled; @@ -355,16 +355,16 @@ uint64_t memory_region_size(MemoryRegion *mr); bool memory_region_is_ram(MemoryRegion *mr); /** - * memory_region_is_romd: check whether a memory region is ROMD + * memory_region_is_romd: check whether a memory region is in ROMD mode * - * Returns %true is a memory region is ROMD and currently set to allow + * Returns %true if a memory region is a ROM device and currently set to allow * direct reads. * * @mr: the memory region being queried */ static inline bool memory_region_is_romd(MemoryRegion *mr) { - return mr->rom_device && mr->readable; + return mr->rom_device && mr->romd_mode; } /** @@ -502,18 +502,18 @@ void memory_region_reset_dirty(MemoryRegion *mr, hwaddr addr, void memory_region_set_readonly(MemoryRegion *mr, bool readonly); /** - * memory_region_rom_device_set_readable: enable/disable ROM readability + * memory_region_rom_device_set_romd: enable/disable ROMD mode * * Allows a ROM device (initialized with memory_region_init_rom_device() to - * to be marked as readable (default) or not readable. When it is readable, - * the device is mapped to guest memory. When not readable, reads are - * forwarded to the #MemoryRegion.read function. + * set to ROMD mode (default) or MMIO mode. When it is in ROMD mode, the + * device is mapped to guest memory and satisfies read access directly. + * When in MMIO mode, reads are forwarded to the #MemoryRegion.read function. + * Writes are always handled by the #MemoryRegion.write function. * * @mr: the memory region to be updated - * @readable: whether reads are satisified directly (%true) or via callbacks - * (%false) + * @romd_mode: %true to put the region into ROMD mode */ -void memory_region_rom_device_set_readable(MemoryRegion *mr, bool readable); +void memory_region_rom_device_set_romd(MemoryRegion *mr, bool romd_mode); /** * memory_region_set_coalescing: Enable memory coalescing for the region. |