aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-09-18 14:51:58 +0200
committerAvi Kivity <avi@redhat.com>2011-10-11 15:57:09 +0200
commit03808f58e4399a7e1c85bd4ea535fafdf592246c (patch)
tree9a65b1668d1ebb15f3164215b2540d6782e4a904
parent6bf9fd43cfc10022670d1135711d6952d98bcb02 (diff)
memory: Fix old portio word accesses
As we register old portio regions via ioport_register, we are also responsible for providing the word access wrapper. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--memory.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/memory.c b/memory.c
index 27abd3e8fe..dc5e35d667 100644
--- a/memory.c
+++ b/memory.c
@@ -404,6 +404,11 @@ static void memory_region_iorange_read(IORange *iorange,
*data = ((uint64_t)1 << (width * 8)) - 1;
if (mrp) {
*data = mrp->read(mr->opaque, offset + mr->offset);
+ } else if (width == 2) {
+ mrp = find_portio(mr, offset, 1, false);
+ assert(mrp);
+ *data = mrp->read(mr->opaque, offset + mr->offset) |
+ (mrp->read(mr->opaque, offset + mr->offset + 1) << 8);
}
return;
}
@@ -426,6 +431,11 @@ static void memory_region_iorange_write(IORange *iorange,
if (mrp) {
mrp->write(mr->opaque, offset + mr->offset, data);
+ } else if (width == 2) {
+ mrp = find_portio(mr, offset, 1, false);
+ assert(mrp);
+ mrp->write(mr->opaque, offset + mr->offset, data & 0xff);
+ mrp->write(mr->opaque, offset + mr->offset + 1, data >> 8);
}
return;
}