2014-01-09 14:00:52 +00:00
|
|
|
#ifndef _TOOLS_LINUX_COMPILER_H_
|
|
|
|
#define _TOOLS_LINUX_COMPILER_H_
|
2009-10-17 15:12:33 +00:00
|
|
|
|
|
|
|
#ifndef __always_inline
|
2013-10-07 09:26:18 +00:00
|
|
|
# define __always_inline inline __attribute__((always_inline))
|
2009-10-17 15:12:33 +00:00
|
|
|
#endif
|
2013-10-07 09:26:18 +00:00
|
|
|
|
2009-10-17 15:12:33 +00:00
|
|
|
#define __user
|
2013-10-07 09:26:18 +00:00
|
|
|
|
2011-08-18 11:37:21 +00:00
|
|
|
#ifndef __attribute_const__
|
2013-10-07 09:26:18 +00:00
|
|
|
# define __attribute_const__
|
2011-08-18 11:37:21 +00:00
|
|
|
#endif
|
2009-10-17 15:12:33 +00:00
|
|
|
|
2012-09-10 22:15:03 +00:00
|
|
|
#ifndef __maybe_unused
|
2013-10-07 09:26:18 +00:00
|
|
|
# define __maybe_unused __attribute__((unused))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __packed
|
|
|
|
# define __packed __attribute__((__packed__))
|
2012-09-10 22:15:03 +00:00
|
|
|
#endif
|
2010-03-25 22:58:59 +00:00
|
|
|
|
2012-09-10 22:14:59 +00:00
|
|
|
#ifndef __force
|
2013-10-07 09:26:18 +00:00
|
|
|
# define __force
|
2012-09-10 22:14:59 +00:00
|
|
|
#endif
|
|
|
|
|
2013-10-01 11:26:13 +00:00
|
|
|
#ifndef __weak
|
|
|
|
# define __weak __attribute__((weak))
|
|
|
|
#endif
|
|
|
|
|
2014-01-09 14:00:53 +00:00
|
|
|
#ifndef likely
|
|
|
|
# define likely(x) __builtin_expect(!!(x), 1)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef unlikely
|
|
|
|
# define unlikely(x) __builtin_expect(!!(x), 0)
|
|
|
|
#endif
|
|
|
|
|
2014-05-05 11:16:41 +00:00
|
|
|
#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
|
|
|
|
|
2014-01-09 14:00:52 +00:00
|
|
|
#endif /* _TOOLS_LINUX_COMPILER_H */
|