File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -489,12 +489,6 @@ enum {
489489 static WC_INLINE WARN_UNUSED_RESULT int WC_WUR_INT (int x) { return x; }
490490#endif
491491
492- /* XFENCE() is a no-op on some targets. WC_BARRIER() uses C89 intrinsics as an
493- * additional portable barrier.
494- */
495- #define WC_BARRIER () do { volatile byte _xfence = 0 ; (void )_xfence; XFENCE (); \
496- } while (0 )
497-
498492#ifdef WORD64_AVAILABLE
499493 #define WC_MAX_UINT_OF (x ) \
500494 ((x)((((word64)1 << ((sizeof (x) * (word64)CHAR_BIT) - \
Original file line number Diff line number Diff line change @@ -1808,6 +1808,18 @@ WOLFSSL_ABI WOLFSSL_API int wolfCrypt_Cleanup(void);
18081808 #define XFENCE () WC_DO_NOTHING
18091809#endif
18101810
1811+ #ifdef WC_BARRIER
1812+ /* use user-supplied WC_BARRIER() definition. */
1813+ #elif defined(__GNUC__ ) && !defined(WOLFSSL_NO_ASM )
1814+ #define WC_BARRIER () __asm__ __volatile__("" ::: "memory")
1815+ #else
1816+ /* XFENCE() is a no-op on some targets. The fallback construct uses C89
1817+ * intrinsics as an additional (but weak) portable barrier.
1818+ */
1819+ #define WC_BARRIER () do { volatile byte _xfence = 0; (void)_xfence; XFENCE(); \
1820+ } while(0)
1821+ #endif
1822+
18111823
18121824 /* AFTER user_settings.h is loaded,
18131825 ** determine if POSIX multi-threaded: HAVE_PTHREAD */
You can’t perform that action at this time.
0 commit comments