X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvppinfra%2Fclib.h;h=0d059a0778bed52b6baeb3048fe23ebd9b40838c;hb=bc27d1be24815e1371dcce3bff2d3075a532acba;hp=0386c75683399fe504a05706e618d313394a98af;hpb=7cd468a3d7dee7d6c92f69a0bb7061ae208ec727;p=vpp.git diff --git a/src/vppinfra/clib.h b/src/vppinfra/clib.h index 0386c756833..0d059a0778b 100644 --- a/src/vppinfra/clib.h +++ b/src/vppinfra/clib.h @@ -78,6 +78,14 @@ #define CLIB_PACKED(x) x __attribute__ ((packed)) #define CLIB_UNUSED(x) x __attribute__ ((unused)) +/* Make a string from the macro's argument */ +#define CLIB_STRING_MACRO(x) #x + +#define __clib_unused __attribute__ ((unused)) +#define __clib_weak __attribute__ ((weak)) +#define __clib_packed __attribute__ ((packed)) +#define __clib_constructor __attribute__ ((constructor)) + #define never_inline __attribute__ ((__noinline__)) #if CLIB_DEBUG > 0 @@ -100,6 +108,12 @@ /* Full memory barrier (read and write). */ #define CLIB_MEMORY_BARRIER() __sync_synchronize () +#if __x86_64__ +#define CLIB_MEMORY_STORE_BARRIER() __builtin_ia32_sfence () +#else +#define CLIB_MEMORY_STORE_BARRIER() __sync_synchronize () +#endif + /* Arranges for function to be called before main. */ #define INIT_FUNCTION(decl) \ decl __attribute ((constructor)); \