summaryrefslogtreecommitdiff
path: root/memory.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2012-03-05 17:40:12 +0200
committerAvi Kivity <avi@redhat.com>2012-03-05 17:40:12 +0200
commita2d335214a53b0cc6f7a4a2009d842bea1958085 (patch)
tree51adcaa66db1f5f2f19e59d0c600aa2f6adc9a4c /memory.h
parentc5b703ac2073de8b968ef058793db0294f6a2979 (diff)
memory: fix I/O port aliases
Commit e58ac72b6a0 ("ioport: change portio_list not to use memory_region_set_offset()") started using aliases of I/O memory regions. Since the IORange used for the I/O was contained in the target region, the alias information (specifically, the offset into the region) was lost. This broke -vga std. Fix by allocating an independent object to hold the IORange and also the new offset. Note that I/O memory regions were conceptually broken wrt aliases in a different way: an alias can cause the same region to appear twice in an address space, but we had just one IORange to service it. This patch fixes that problem as well, since we can now have multiple IORange/MemoryRegion associations. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'memory.h')
-rw-r--r--memory.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/memory.h b/memory.h
index b7bccd196..53ff62b6c 100644
--- a/memory.h
+++ b/memory.h
@@ -43,6 +43,14 @@ struct MemoryRegionMmio {
CPUWriteMemoryFunc *write[3];
};
+/* Internal use; thunks between old-style IORange and MemoryRegions. */
+typedef struct MemoryRegionIORange MemoryRegionIORange;
+struct MemoryRegionIORange {
+ IORange iorange;
+ MemoryRegion *mr;
+ target_phys_addr_t offset;
+};
+
/*
* Memory region callbacks
*/
@@ -117,7 +125,6 @@ struct MemoryRegion {
target_phys_addr_t addr;
void (*destructor)(MemoryRegion *mr);
ram_addr_t ram_addr;
- IORange iorange;
bool subpage;
bool terminates;
bool readable;