aboutsummaryrefslogtreecommitdiff
path: root/tcg/tcg.h
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2015-05-13 11:25:20 -0700
committerRichard Henderson <rth@twiddle.net>2015-05-14 12:15:18 -0700
commitdfb36305626636e2e07e0c5acd3a002a5419399e (patch)
tree5fb7817c8d37d5a0c22316ee398749ef244ce881 /tcg/tcg.h
parent3972ef6f830d65e9bacbd31257abedc055fd6dc8 (diff)
tcg: Add MO_ALIGN, MO_UNALN
These modifiers control, on a per-memory-op basis, whether unaligned memory accesses are allowed. The default setting reflects the target's definition of ALIGNED_ONLY. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'tcg/tcg.h')
-rw-r--r--tcg/tcg.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/tcg/tcg.h b/tcg/tcg.h
index f9fb3809bd..8098f824b3 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -241,6 +241,19 @@ typedef enum TCGMemOp {
MO_TE = MO_LE,
#endif
+ /* MO_UNALN accesses are never checked for alignment.
+ MO_ALIGN accesses will result in a call to the CPU's
+ do_unaligned_access hook if the guest address is not aligned.
+ The default depends on whether the target CPU defines ALIGNED_ONLY. */
+ MO_AMASK = 16,
+#ifdef ALIGNED_ONLY
+ MO_ALIGN = 0,
+ MO_UNALN = MO_AMASK,
+#else
+ MO_ALIGN = MO_AMASK,
+ MO_UNALN = 0,
+#endif
+
/* Combinations of the above, for ease of use. */
MO_UB = MO_8,
MO_UW = MO_16,