aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include/linux/compiler.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/include/linux/compiler.h')
-rw-r--r--tools/include/linux/compiler.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h
new file mode 100644
index 000000000000..fbc6665c6d53
--- /dev/null
+++ b/tools/include/linux/compiler.h
@@ -0,0 +1,38 @@
1#ifndef _TOOLS_LINUX_COMPILER_H_
2#define _TOOLS_LINUX_COMPILER_H_
3
4#ifndef __always_inline
5# define __always_inline inline __attribute__((always_inline))
6#endif
7
8#define __user
9
10#ifndef __attribute_const__
11# define __attribute_const__
12#endif
13
14#ifndef __maybe_unused
15# define __maybe_unused __attribute__((unused))
16#endif
17
18#ifndef __packed
19# define __packed __attribute__((__packed__))
20#endif
21
22#ifndef __force
23# define __force
24#endif
25
26#ifndef __weak
27# define __weak __attribute__((weak))
28#endif
29
30#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
38#endif /* _TOOLS_LINUX_COMPILER_H */