[CRIU] [PATCH 09/16] compiler: Add compiler noinline attribute and
barrier helper
Cyrill Gorcunov
gorcunov at openvz.org
Mon Feb 13 14:26:32 EST 2012
They are not needed at moment but will be needed at
parasite/restorer code rework time, so add them now
just to not forget.
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
include/compiler.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/include/compiler.h b/include/compiler.h
index 290d5e9..aab5d50 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -27,12 +27,18 @@
# define always_inline __always_inline
#endif
+#ifndef noinline
+# define noinline __attribute__((noinline))
+#endif
+
#define __aligned(x) __attribute__((aligned(x)))
#ifndef offsetof
# define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif
+#define barrier() asm volatile("" ::: "memory")
+
#define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
--
1.7.7.6
More information about the CRIU
mailing list