summaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2011-08-11 10:40:26 +0300
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-21 18:27:33 -0500
commit3a130f4ef07f4532500473aeab43c86a3c2991c8 (patch)
treed79758caafc58a68c4b3a3c1bb882eca7553d6f6 /memory.c
parent164a4dcd8d90a0db5ffa2174f693195744374418 (diff)
downloadqemu-3a130f4ef07f4532500473aeab43c86a3c2991c8.tar.gz
memory: crack wide ioport accesses into smaller ones when needed
The memory API supports cracking wide accesses into narrower ones when needed; but this was no implemented for the pio address space, causing lsi53c895a's IO BAR to malfunction. Fix by correctly cracking wide accesses when needed. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/memory.c b/memory.c
index 8e6dd35cb0..30ba4a4b37 100644
--- a/memory.c
+++ b/memory.c
@@ -400,7 +400,11 @@ static void memory_region_iorange_read(IORange *iorange,
}
return;
}
- *data = mr->ops->read(mr->opaque, offset, width);
+ *data = 0;
+ access_with_adjusted_size(offset, data, width,
+ mr->ops->impl.min_access_size,
+ mr->ops->impl.max_access_size,
+ memory_region_read_accessor, mr);
}
static void memory_region_iorange_write(IORange *iorange,
@@ -418,7 +422,10 @@ static void memory_region_iorange_write(IORange *iorange,
}
return;
}
- mr->ops->write(mr->opaque, offset, data, width);
+ access_with_adjusted_size(offset, &data, width,
+ mr->ops->impl.min_access_size,
+ mr->ops->impl.max_access_size,
+ memory_region_write_accessor, mr);
}
static const IORangeOps memory_region_iorange_ops = {