[CRIU] [crtools-bot for Cyrill Gorcunov ] compiler: Add compiler noinline attribute and barrier helper

Cyrill Gorcunov gorcunov at openvz.org
Tue Feb 14 08:18:09 EST 2012


The commit is pushed to "master" and will appear on git://github.com/cyrillos/crtools.git
------>
commit 86392b7f2f60f18f69587b8403cdc31ad3606db3
Author: Cyrill Gorcunov <gorcunov at openvz.org>
Date:   Mon Feb 13 21:37:18 2012 +0400

    compiler: Add compiler noinline attribute and barrier helper
    
    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>
    Acked-by: Pavel Emelyanov <xemul at parallels.com>
---
 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) );})


More information about the CRIU mailing list