Skip to content

Commit d0475de

Browse files
authored
Merge pull request #7906 from douzzer/20240827-XFENCE-all-disable-asm-assert
20240827-XFENCE-all-disable-asm-assert
2 parents e164bcb + 349e06a commit d0475de

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

wolfssl/wolfcrypt/wc_port.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,11 @@ WOLFSSL_ABI WOLFSSL_API int wolfCrypt_Cleanup(void);
12641264
#endif
12651265

12661266
#ifndef WOLFSSL_NO_FENCE
1267-
#if defined (__i386__) || defined(__x86_64__)
1267+
#ifdef XFENCE
1268+
/* use user-supplied XFENCE definition. */
1269+
#elif defined(__GNUC__) && (__GNUC__ >= 4)
1270+
#define XFENCE() __sync_synchronize()
1271+
#elif defined (__i386__) || defined(__x86_64__)
12681272
#define XFENCE() XASM_VOLATILE("lfence")
12691273
#elif (defined (__arm__) && (__ARM_ARCH > 6)) || defined(__aarch64__)
12701274
#define XFENCE() XASM_VOLATILE("isb")
@@ -1273,10 +1277,10 @@ WOLFSSL_ABI WOLFSSL_API int wolfCrypt_Cleanup(void);
12731277
#elif defined(__PPC__)
12741278
#define XFENCE() XASM_VOLATILE("isync; sync")
12751279
#else
1276-
#define XFENCE() do{}while(0)
1280+
#define XFENCE() WC_DO_NOTHING
12771281
#endif
12781282
#else
1279-
#define XFENCE() do{}while(0)
1283+
#define XFENCE() WC_DO_NOTHING
12801284
#endif
12811285

12821286

0 commit comments

Comments
 (0)