Message ID | 20171011143147.3337-4-johannes@sipsolutions.net (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
diff --git a/backport/backport-include/linux/compiler-gccN.h b/backport/backport-include/linux/compiler-gccN.h index 23ad803dce0b..97e7541d1ab1 100644 --- a/backport/backport-include/linux/compiler-gccN.h +++ b/backport/backport-include/linux/compiler-gccN.h @@ -120,3 +120,7 @@ #endif #endif /* gcc version >= 40000 specific checks */ + +#ifndef OPTIMIZER_HIDE_VAR +#define OPTIMIZER_HIDE_VAR(var) __asm__ ("" : "=r" (var) : "0" (var)) +#endif diff --git a/backport/backport-include/linux/compiler.h b/backport/backport-include/linux/compiler.h index e5af565b13dc..53c069df10a8 100644 --- a/backport/backport-include/linux/compiler.h +++ b/backport/backport-include/linux/compiler.h @@ -88,4 +88,8 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s }) #endif +#ifndef OPTIMIZER_HIDE_VAR +#define OPTIMIZER_HIDE_VAR(var) barrier() +#endif + #endif /* __BACKPORT_LINUX_COMPILER_H */