diff options
Diffstat (limited to 'include/lib')
| -rw-r--r-- | include/lib/utils_def.h | 7 | 
1 files changed, 7 insertions, 0 deletions
| diff --git a/include/lib/utils_def.h b/include/lib/utils_def.h index 02963ac5..2b489675 100644 --- a/include/lib/utils_def.h +++ b/include/lib/utils_def.h @@ -162,4 +162,11 @@  #define COMPILER_BARRIER() __asm__ volatile ("" ::: "memory") +/* Compiler builtin of GCC >= 9 and planned in llvm */ +#ifdef __HAVE_SPECULATION_SAFE_VALUE +# define SPECULATION_SAFE_VALUE(var) __builtin_speculation_safe_value(var) +#else +# define SPECULATION_SAFE_VALUE(var) var +#endif +  #endif /* UTILS_DEF_H */ | 
