• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This header was generated from the Linux kernel headers by update_headers.py,
3  * to provide necessary information from kernel to userspace, such as constants,
4  * structures, and macros, and thus, contains no copyrightable information.
5  */
6 #ifndef __LINUX_COMPILER_TYPES_H
7 #define __LINUX_COMPILER_TYPES_H
8 #ifndef __ASSEMBLY__
9 #if 0
10 # define __user		__attribute__((noderef, address_space(1)))
11 # define __kernel	__attribute__((address_space(0)))
12 # define __safe		__attribute__((safe))
13 # define __force	__attribute__((force))
14 # define __nocast	__attribute__((nocast))
15 # define __iomem	__attribute__((noderef, address_space(2)))
16 # define __must_hold(x)	__attribute__((context(x,1,1)))
17 # define __acquires(x)	__attribute__((context(x,0,1)))
18 # define __releases(x)	__attribute__((context(x,1,0)))
19 # define __acquire(x)	__context__(x,1)
20 # define __release(x)	__context__(x,-1)
21 # define __cond_lock(x,c)	((c) ? ({ __acquire(x); 1; }) : 0)
22 # define __percpu	__attribute__((noderef, address_space(3)))
23 # define __rcu		__attribute__((noderef, address_space(4)))
24 # define __private	__attribute__((noderef))
25 extern void __chk_user_ptr(const volatile void __user *);
26 extern void __chk_io_ptr(const volatile void __iomem *);
27 # define ACCESS_PRIVATE(p, member) (*((typeof((p)->member) __force *) &(p)->member))
28 #else
29 # ifdef STRUCTLEAK_PLUGIN
30 #  define __user __attribute__((user))
31 # else
32 #  define __user
33 # endif
34 # define __kernel
35 # define __safe
36 # define __force
37 # define __nocast
38 # define __iomem
39 # define __chk_user_ptr(x) (void)0
40 # define __chk_io_ptr(x) (void)0
41 # define __builtin_warning(x, y...) (1)
42 # define __must_hold(x)
43 # define __acquires(x)
44 # define __releases(x)
45 # define __acquire(x) (void)0
46 # define __release(x) (void)0
47 # define __cond_lock(x,c) (c)
48 # define __percpu
49 # define __rcu
50 # define __private
51 # define ACCESS_PRIVATE(p, member) ((p)->member)
52 #endif
53 #define ___PASTE(a,b) a##b
54 #define __PASTE(a,b) ___PASTE(a,b)
55 #ifdef __KERNEL__
56 #ifdef __clang__
57 #include <linux/compiler-clang.h>
58 #elif defined(__INTEL_COMPILER)
59 #include <linux/compiler-intel.h>
60 #elif defined(__GNUC__)
61 #include <linux/compiler-gcc.h>
62 #else
63 #error "Unknown compiler"
64 #endif
65 #ifdef CONFIG_HAVE_ARCH_COMPILER_H
66 #include <asm/compiler.h>
67 #endif
68 struct ftrace_branch_data {
69 	const char *func;
70 	const char *file;
71 	unsigned line;
72 	union {
73 		struct {
74 			unsigned long correct;
75 			unsigned long incorrect;
76 		};
77 		struct {
78 			unsigned long miss;
79 			unsigned long hit;
80 		};
81 		unsigned long miss_hit[2];
82 	};
83 };
84 struct ftrace_likely_data {
85 	struct ftrace_branch_data	data;
86 	unsigned long			constant;
87 };
88 #define __deprecated
89 #define __deprecated_for_modules
90 #endif
91 #endif
92 #ifndef __designated_init
93 # define __designated_init
94 #endif
95 #ifndef __latent_entropy
96 # define __latent_entropy
97 #endif
98 #ifndef __randomize_layout
99 # define __randomize_layout __designated_init
100 #endif
101 #ifndef __no_randomize_layout
102 # define __no_randomize_layout
103 #endif
104 #ifndef randomized_struct_fields_start
105 # define randomized_struct_fields_start
106 # define randomized_struct_fields_end
107 #endif
108 #ifndef __visible
109 #define __visible
110 #endif
111 #ifndef __assume_aligned
112 #define __assume_aligned(a, ...)
113 #endif
114 #ifndef asm_volatile_goto
115 #define asm_volatile_goto(x...) asm goto(x)
116 #endif
117 #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
118 #define __native_word(t) \
119 	(sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \
120 	 sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long))
121 #ifndef __attribute_const__
122 #define __attribute_const__	__attribute__((__const__))
123 #endif
124 #ifndef __noclone
125 #define __noclone
126 #endif
127 #ifndef __diag
128 #define __diag(string)
129 #endif
130 #ifndef __diag_GCC
131 #define __diag_GCC(version, severity, string)
132 #endif
133 #ifndef __MUSL__
134 #ifndef __copy
135 # define __copy(symbol)
136 #endif
137 #endif
138 #define __diag_push()	__diag(push)
139 #define __diag_pop()	__diag(pop)
140 #define __diag_ignore(compiler, version, option, comment) \
141 	__diag_ ## compiler(version, ignore, option)
142 #define __diag_warn(compiler, version, option, comment) \
143 	__diag_ ## compiler(version, warn, option)
144 #define __diag_error(compiler, version, option, comment) \
145 	__diag_ ## compiler(version, error, option)
146 #define __pure			__attribute__((pure))
147 #define __aligned(x)		__attribute__((aligned(x)))
148 #define __aligned_largest	__attribute__((aligned))
149 #define __printf(a, b)		__attribute__((format(printf, a, b)))
150 #define __scanf(a, b)		__attribute__((format(scanf, a, b)))
151 #define __maybe_unused		__attribute__((unused))
152 #define __always_unused		__attribute__((unused))
153 #define __mode(x)		__attribute__((mode(x)))
154 #define __malloc		__attribute__((__malloc__))
155 #define __used			__attribute__((__used__))
156 #define __noreturn		__attribute__((noreturn))
157 #define __packed		__attribute__((packed))
158 #define __weak			__attribute__((weak))
159 #define __alias(symbol)		__attribute__((alias(#symbol)))
160 #define __cold			__attribute__((cold))
161 #define __section(S)		__attribute__((__section__(#S)))
162 #ifdef CONFIG_ENABLE_MUST_CHECK
163 #define __must_check		__attribute__((warn_unused_result))
164 #else
165 #define __must_check
166 #endif
167 #if defined(CC_USING_HOTPATCH) && !defined(__CHECKER__)
168 #define notrace			__attribute__((hotpatch(0, 0)))
169 #else
170 #define notrace			__attribute__((no_instrument_function))
171 #endif
172 #define __naked			__attribute__((naked)) notrace
173 #define __compiler_offsetof(a, b)	__builtin_offsetof(a, b)
174 #ifdef __GNUC_STDC_INLINE__
175 # define __gnu_inline	__attribute__((gnu_inline))
176 #else
177 # define __gnu_inline
178 #endif
179 #ifndef __MUSL__
180 #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
181 	!defined(CONFIG_OPTIMIZE_INLINING)
182 #define inline \
183 	inline __attribute__((always_inline, unused)) notrace __gnu_inline
184 #else
185 #define inline inline	__attribute__((unused)) notrace __gnu_inline
186 #endif
187 #endif
188 #define __inline__ inline
189 #define __inline inline
190 #ifndef __MUSL__
191 #define noinline	__attribute__((noinline))
192 #endif
193 #ifndef __always_inline
194 #define __always_inline inline __attribute__((always_inline))
195 #endif
196 #define noinline_for_stack noinline
197 #endif
198