toolchain: xtensa: Define __sync_synchronize

This builtin gcc function is not available in xcc compiler.

Adding a memory compiler barrier as it is done in compiler_barrier.
compiler_barrier() and __sync_synchronize() are not the same, the
former is a sw barrier while the latter can be a hw barrier
like (mfence/sfence) in X86.

I didn't find anything equivalent for xtensa so just implementing a
SW barrier.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2022-05-11 22:14:38 -07:00 committed by Anas Nashif
parent ffa1532be2
commit 87b4759663

View file

@ -144,6 +144,10 @@
#define __builtin_unreachable() do { __ASSERT(false, "Unreachable code"); } \
while (true)
/* Not a full barrier, just a SW barrier */
#define __sync_synchronize() do { __asm__ __volatile__ ("" ::: "memory"); } \
while (false)
#ifdef __deprecated
/*
* XCC does not support using deprecated attribute in enum,