diff options
author | Avi Kivity <avi@redhat.com> | 2012-02-08 17:01:23 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-02-29 13:44:41 +0200 |
commit | 7a8499e88bffff66d90300d4f2018c938543b1cf (patch) | |
tree | 122dff224622832fc30fd57608d43f536542f8f7 /memory.c | |
parent | 80a1ea3748203b840d8bad488ada4d6f5bb66c9d (diff) |
memory: add a readonly attribute to MemoryRegionSection
.readonly cannot be obtained from the MemoryRegion, since it is
inherited from aliases (so you can have a MemoryRegion mapped RW
at one address and RO at another). Record it in a MemoryRegionSection
for listeners.
Signed-off-by: Avi Kivity <avi@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'memory.c')
-rw-r--r-- | memory.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -112,6 +112,7 @@ enum ListenerDirection { Forward, Reverse }; .offset_within_region = (fr)->offset_in_region, \ .size = int128_get64((fr)->addr.size), \ .offset_within_address_space = int128_get64((fr)->addr.start), \ + .readonly = (fr)->readonly, \ }) struct CoalescedMemoryRange { @@ -342,6 +343,7 @@ static void as_memory_range_add(AddressSpace *as, FlatRange *fr) .offset_within_address_space = int128_get64(fr->addr.start), .offset_within_region = fr->offset_in_region, .size = int128_get64(fr->addr.size), + .readonly = fr->readonly, }; cpu_register_physical_memory_log(§ion, fr->readable, fr->readonly); @@ -354,6 +356,7 @@ static void as_memory_range_del(AddressSpace *as, FlatRange *fr) .offset_within_address_space = int128_get64(fr->addr.start), .offset_within_region = int128_get64(fr->addr.start), .size = int128_get64(fr->addr.size), + .readonly = fr->readonly, }; cpu_register_physical_memory_log(§ion, true, false); @@ -1437,6 +1440,7 @@ MemoryRegionSection memory_region_find(MemoryRegion *address_space, fr->addr.start)); ret.size = int128_get64(range.size); ret.offset_within_address_space = int128_get64(range.start); + ret.readonly = fr->readonly; return ret; } @@ -1479,6 +1483,7 @@ static void listener_add_address_space(MemoryListener *listener, .offset_within_region = fr->offset_in_region, .size = int128_get64(fr->addr.size), .offset_within_address_space = int128_get64(fr->addr.start), + .readonly = fr->readonly, }; listener->region_add(listener, §ion); } |