[PATCH 4/5] backports: add OPTIMIZER_HIDE_VAR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Johannes Berg <johannes.berg@xxxxxxxxx>

Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
---
 backport/backport-include/linux/compiler-gccN.h | 4 ++++
 backport/backport-include/linux/compiler.h      | 4 ++++
 2 files changed, 8 insertions(+)

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 */
-- 
2.14.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux