summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2013-06-24 10:45:09 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2013-07-04 17:42:44 +0200
commitb40acf99bef69fa8ab0f9092ff162fde945eec12 (patch)
tree3be0e88794cb67e6e20aa78580572f3babd1d54c /include
parent962b03fcf509db25c847aa67c4eff574c240dcfe (diff)
downloadhqemu-b40acf99bef69fa8ab0f9092ff162fde945eec12.zip
hqemu-b40acf99bef69fa8ab0f9092ff162fde945eec12.tar.gz
ioport: Switch dispatching to memory core layer
The current ioport dispatcher is a complex beast, mostly due to the need to deal with old portio interface users. But we can overcome it without converting all portio users by embedding the required base address of a MemoryRegionPortio access into that data structure. That removes the need to have the additional MemoryRegionIORange structure in the loop on every access. To handle old portio memory ops, we simply install dispatching handlers for portio memory regions when registering them with the memory core. This removes the need for the old_portio field. We can drop the additional aliasing of ioport regions and also the special address space listener. cpu_in and cpu_out now simply call address_space_read/write. And we can concentrate portio handling in a single source file. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/exec/ioport.h1
-rw-r--r--include/exec/memory-internal.h2
-rw-r--r--include/exec/memory.h5
3 files changed, 1 insertions, 7 deletions
diff --git a/include/exec/ioport.h b/include/exec/ioport.h
index eb99ffe..b476857 100644
--- a/include/exec/ioport.h
+++ b/include/exec/ioport.h
@@ -56,7 +56,6 @@ typedef struct PortioList {
struct MemoryRegion *address_space;
unsigned nr;
struct MemoryRegion **regions;
- struct MemoryRegion **aliases;
void *opaque;
const char *name;
} PortioList;
diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h
index 26689fe..d0e0633 100644
--- a/include/exec/memory-internal.h
+++ b/include/exec/memory-internal.h
@@ -119,8 +119,6 @@ static inline void cpu_physical_memory_mask_dirty_range(ram_addr_t start,
void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t end,
int dirty_flags);
-extern const IORangeOps memory_region_iorange_ops;
-
#endif
#endif
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 2ddc3c5..cfdda3c 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -126,10 +126,6 @@ struct MemoryRegionOps {
bool unaligned;
} impl;
- /* If .read and .write are not present, old_portio may be used for
- * backwards compatibility with old portio registration
- */
- const MemoryRegionPortio *old_portio;
/* If .read and .write are not present, old_mmio may be used for
* backwards compatibility with old mmio registration
*/
@@ -185,6 +181,7 @@ struct MemoryRegionPortio {
unsigned size;
IOPortReadFunc *read;
IOPortWriteFunc *write;
+ uint32_t base; /* private field */
};
#define PORTIO_END_OF_LIST() { }
OpenPOWER on IntegriCloud