aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/compiler.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/compiler.h')
-rw-r--r--include/linux/compiler.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 04fb5135b4e1..a5a472b10746 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -5,7 +5,7 @@
5 5
6#ifdef __CHECKER__ 6#ifdef __CHECKER__
7# define __user __attribute__((noderef, address_space(1))) 7# define __user __attribute__((noderef, address_space(1)))
8# define __kernel /* default address space */ 8# define __kernel __attribute__((address_space(0)))
9# define __safe __attribute__((safe)) 9# define __safe __attribute__((safe))
10# define __force __attribute__((force)) 10# define __force __attribute__((force))
11# define __nocast __attribute__((nocast)) 11# define __nocast __attribute__((nocast))
@@ -15,6 +15,7 @@
15# define __acquire(x) __context__(x,1) 15# define __acquire(x) __context__(x,1)
16# define __release(x) __context__(x,-1) 16# define __release(x) __context__(x,-1)
17# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) 17# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0)
18# define __percpu __attribute__((noderef, address_space(3)))
18extern void __chk_user_ptr(const volatile void __user *); 19extern void __chk_user_ptr(const volatile void __user *);
19extern void __chk_io_ptr(const volatile void __iomem *); 20extern void __chk_io_ptr(const volatile void __iomem *);
20#else 21#else
@@ -32,6 +33,7 @@ extern void __chk_io_ptr(const volatile void __iomem *);
32# define __acquire(x) (void)0 33# define __acquire(x) (void)0
33# define __release(x) (void)0 34# define __release(x) (void)0
34# define __cond_lock(x,c) (c) 35# define __cond_lock(x,c) (c)
36# define __percpu
35#endif 37#endif
36 38
37#ifdef __KERNEL__ 39#ifdef __KERNEL__
@@ -144,6 +146,11 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
144# define barrier() __memory_barrier() 146# define barrier() __memory_barrier()
145#endif 147#endif
146 148
149/* Unreachable code */
150#ifndef unreachable
151# define unreachable() do { } while (1)
152#endif
153
147#ifndef RELOC_HIDE 154#ifndef RELOC_HIDE
148# define RELOC_HIDE(ptr, off) \ 155# define RELOC_HIDE(ptr, off) \
149 ({ unsigned long __ptr; \ 156 ({ unsigned long __ptr; \
@@ -213,6 +220,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
213# define __maybe_unused /* unimplemented */ 220# define __maybe_unused /* unimplemented */
214#endif 221#endif
215 222
223#ifndef __always_unused
224# define __always_unused /* unimplemented */
225#endif
226
216#ifndef noinline 227#ifndef noinline
217#define noinline 228#define noinline
218#endif 229#endif
@@ -266,6 +277,17 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
266# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) 277# define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
267#endif 278#endif
268 279
280/* Compile time object size, -1 for unknown */
281#ifndef __compiletime_object_size
282# define __compiletime_object_size(obj) -1
283#endif
284#ifndef __compiletime_warning
285# define __compiletime_warning(message)
286#endif
287#ifndef __compiletime_error
288# define __compiletime_error(message)
289#endif
290
269/* 291/*
270 * Prevent the compiler from merging or refetching accesses. The compiler 292 * Prevent the compiler from merging or refetching accesses. The compiler
271 * is also forbidden from reordering successive instances of ACCESS_ONCE(), 293 * is also forbidden from reordering successive instances of ACCESS_ONCE(),