aboutsummaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-05-24 12:54:01 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2013-05-29 16:27:22 +0200
commit08521e28c7e6e8cc1f53424a0f845f58d2ed9546 (patch)
treecabda847a709c91d2d2f10514e73b813705ffe38 /memory.c
parenta014ed07bd5a93950fe12c88ed5faf188a22ee01 (diff)
memory: add big endian support to access_with_adjusted_size
This will be used to split 8-byte access down to two four-byte accesses. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/memory.c b/memory.c
index c72f56d472..679bd8d8b0 100644
--- a/memory.c
+++ b/memory.c
@@ -362,8 +362,12 @@ static void access_with_adjusted_size(hwaddr addr,
access_size = MAX(MIN(size, access_size_max), access_size_min);
access_mask = -1ULL >> (64 - access_size * 8);
for (i = 0; i < size; i += access_size) {
- /* FIXME: big-endian support */
+#ifdef TARGET_WORDS_BIGENDIAN
+ access(opaque, addr + i, value, access_size,
+ (size - access_size - i) * 8, access_mask);
+#else
access(opaque, addr + i, value, access_size, i * 8, access_mask);
+#endif
}
}