aboutsummaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2011-11-21 12:27:03 +0200
committerAvi Kivity <avi@redhat.com>2012-01-04 13:34:49 +0200
commitacbbec5d438dcf04234519bac53e1f5263572d76 (patch)
tree3ea3252affc27c0c6c8818c45e94374724411f44 /memory.c
parentf1f6e3b86e0a73e0946f27ecb2b0a86e4665501c (diff)
memory: move mmio access to functions
Currently mmio access goes directly to the io_mem_{read,write} arrays. In preparation for eliminating them, add indirection via a function. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/memory.c b/memory.c
index 6f9fea15ad..5c468332ba 100644
--- a/memory.c
+++ b/memory.c
@@ -1580,6 +1580,19 @@ void set_system_io_map(MemoryRegion *mr)
memory_region_update_topology(NULL);
}
+uint64_t io_mem_read(int io_index, target_phys_addr_t addr, unsigned size)
+{
+ return _io_mem_read[io_index][bitops_ffsl(size)](io_mem_opaque[io_index],
+ addr);
+}
+
+void io_mem_write(int io_index, target_phys_addr_t addr,
+ uint64_t val, unsigned size)
+{
+ _io_mem_write[io_index][bitops_ffsl(size)](io_mem_opaque[io_index],
+ addr, val);
+}
+
typedef struct MemoryRegionList MemoryRegionList;
struct MemoryRegionList {