blob: fbc6665c6d53e8f8c9f9caf91e32d48a35277573 [file] [log] [blame]
Namhyung Kim8a625c12014-01-09 23:00:52 +09001#ifndef _TOOLS_LINUX_COMPILER_H_
2#define _TOOLS_LINUX_COMPILER_H_
Frederic Weisbecker5a116dd2009-10-17 17:12:33 +02003
4#ifndef __always_inline
Ingo Molnar7a108222013-10-07 11:26:18 +02005# define __always_inline inline __attribute__((always_inline))
Frederic Weisbecker5a116dd2009-10-17 17:12:33 +02006#endif
Ingo Molnar7a108222013-10-07 11:26:18 +02007
Frederic Weisbecker5a116dd2009-10-17 17:12:33 +02008#define __user
Ingo Molnar7a108222013-10-07 11:26:18 +02009
Josh Boyer195bcbf2011-08-18 07:37:21 -040010#ifndef __attribute_const__
Ingo Molnar7a108222013-10-07 11:26:18 +020011# define __attribute_const__
Josh Boyer195bcbf2011-08-18 07:37:21 -040012#endif
Frederic Weisbecker5a116dd2009-10-17 17:12:33 +020013
Irina Tirdea1d037ca2012-09-11 01:15:03 +030014#ifndef __maybe_unused
Ingo Molnar7a108222013-10-07 11:26:18 +020015# define __maybe_unused __attribute__((unused))
Irina Tirdea1d037ca2012-09-11 01:15:03 +030016#endif
Ingo Molnar7a108222013-10-07 11:26:18 +020017
18#ifndef __packed
19# define __packed __attribute__((__packed__))
20#endif
Arnaldo Carvalho de Melo618038d2010-03-25 19:58:59 -030021
Irina Tirdea86d5a702012-09-11 01:14:59 +030022#ifndef __force
Ingo Molnar7a108222013-10-07 11:26:18 +020023# define __force
Irina Tirdea86d5a702012-09-11 01:14:59 +030024#endif
25
Ingo Molnarfb1c9182013-10-01 13:26:13 +020026#ifndef __weak
27# define __weak __attribute__((weak))
28#endif
29
Namhyung Kim835d44b2014-01-09 23:00:53 +090030#ifndef likely
31# define likely(x) __builtin_expect(!!(x), 1)
32#endif
33
34#ifndef unlikely
35# define unlikely(x) __builtin_expect(!!(x), 0)
36#endif
37
Namhyung Kim8a625c12014-01-09 23:00:52 +090038#endif /* _TOOLS_LINUX_COMPILER_H */