diff --git a/include/ck_cc.h b/include/ck_cc.h index c5f17a4..fc75025 100644 --- a/include/ck_cc.h +++ b/include/ck_cc.h @@ -45,6 +45,10 @@ #define CK_CC_PAD(x) union { char pad[x]; } +#ifndef CK_CC_BARRIER +#define CK_CC_BARRIER() +#endif + #ifndef CK_CC_ALIASED #define CK_CC_ALIASED #endif diff --git a/include/gcc/ck_cc.h b/include/gcc/ck_cc.h index f7b13a7..0712a86 100644 --- a/include/gcc/ck_cc.h +++ b/include/gcc/ck_cc.h @@ -68,6 +68,11 @@ */ #define CK_CC_CACHELINE CK_CC_ALIGN(CK_MD_CACHELINE) +/* + * Compiler barrier. + */ +#define CK_CC_BARRIER() __asm__ __volatile__("" ::: "memory") + /* * These are functions which should be avoided. */