aboutsummaryrefslogtreecommitdiff
path: root/target/xtensa/overlay_tool.h
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2019-04-18 16:37:00 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2019-05-15 10:31:52 -0700
commitb345e140534ea17814b02bdf8798f18db6295304 (patch)
treef9320a22da357d31ad10e17a340300b02a389b98 /target/xtensa/overlay_tool.h
parent98736654f3dfbf984d9e26c9be0480b0560c1067 (diff)
downloadqemu-b345e140534ea17814b02bdf8798f18db6295304.zip
qemu-b345e140534ea17814b02bdf8798f18db6295304.tar.gz
qemu-b345e140534ea17814b02bdf8798f18db6295304.tar.bz2
target/xtensa: implement exclusive access option
The Exclusive Instructions provide a general-purpose mechanism for atomic updates of memory-based synchronization variables that can be used for exclusion algorithms. Use cmpxchg-based implementation that is sufficient for the typical use of exclusive access in atomic operations. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'target/xtensa/overlay_tool.h')
-rw-r--r--target/xtensa/overlay_tool.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/target/xtensa/overlay_tool.h b/target/xtensa/overlay_tool.h
index 4925b21..f0cc33a 100644
--- a/target/xtensa/overlay_tool.h
+++ b/target/xtensa/overlay_tool.h
@@ -76,6 +76,10 @@
#define XCHAL_HAVE_MPU 0
#endif
+#ifndef XCHAL_HAVE_EXCLUSIVE
+#define XCHAL_HAVE_EXCLUSIVE 0
+#endif
+
#define XCHAL_OPTION(xchal, qemu) ((xchal) ? XTENSA_OPTION_BIT(qemu) : 0)
#define XTENSA_OPTIONS ( \
@@ -96,8 +100,8 @@
XCHAL_OPTION(XCHAL_HAVE_FP, XTENSA_OPTION_FP_COPROCESSOR) | \
XCHAL_OPTION(XCHAL_HAVE_RELEASE_SYNC, XTENSA_OPTION_MP_SYNCHRO) | \
XCHAL_OPTION(XCHAL_HAVE_S32C1I, XTENSA_OPTION_CONDITIONAL_STORE) | \
- XCHAL_OPTION(XCHAL_HAVE_S32C1I && XCHAL_HW_MIN_VERSION >= 230000, \
- XTENSA_OPTION_ATOMCTL) | \
+ XCHAL_OPTION(((XCHAL_HAVE_S32C1I && XCHAL_HW_MIN_VERSION >= 230000) || \
+ XCHAL_HAVE_EXCLUSIVE), XTENSA_OPTION_ATOMCTL) | \
XCHAL_OPTION(XCHAL_HAVE_DEPBITS, XTENSA_OPTION_DEPBITS) | \
/* Interrupts and exceptions */ \
XCHAL_OPTION(XCHAL_HAVE_EXCEPTIONS, XTENSA_OPTION_EXCEPTION) | \