diff options
Diffstat (limited to 'include/linux/compiler.h')
-rw-r--r-- | include/linux/compiler.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 4170fcee5adb..18c80cfa4fc4 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -23,8 +23,8 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, | |||
23 | #define __branch_check__(x, expect, is_constant) ({ \ | 23 | #define __branch_check__(x, expect, is_constant) ({ \ |
24 | long ______r; \ | 24 | long ______r; \ |
25 | static struct ftrace_likely_data \ | 25 | static struct ftrace_likely_data \ |
26 | __attribute__((__aligned__(4))) \ | 26 | __aligned(4) \ |
27 | __attribute__((section("_ftrace_annotated_branch"))) \ | 27 | __section("_ftrace_annotated_branch") \ |
28 | ______f = { \ | 28 | ______f = { \ |
29 | .data.func = __func__, \ | 29 | .data.func = __func__, \ |
30 | .data.file = __FILE__, \ | 30 | .data.file = __FILE__, \ |
@@ -59,8 +59,8 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, | |||
59 | ({ \ | 59 | ({ \ |
60 | int ______r; \ | 60 | int ______r; \ |
61 | static struct ftrace_branch_data \ | 61 | static struct ftrace_branch_data \ |
62 | __attribute__((__aligned__(4))) \ | 62 | __aligned(4) \ |
63 | __attribute__((section("_ftrace_branch"))) \ | 63 | __section("_ftrace_branch") \ |
64 | ______f = { \ | 64 | ______f = { \ |
65 | .func = __func__, \ | 65 | .func = __func__, \ |
66 | .file = __FILE__, \ | 66 | .file = __FILE__, \ |
@@ -115,7 +115,10 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, | |||
115 | # define ASM_UNREACHABLE | 115 | # define ASM_UNREACHABLE |
116 | #endif | 116 | #endif |
117 | #ifndef unreachable | 117 | #ifndef unreachable |
118 | # define unreachable() do { annotate_reachable(); do { } while (1); } while (0) | 118 | # define unreachable() do { \ |
119 | annotate_unreachable(); \ | ||
120 | __builtin_unreachable(); \ | ||
121 | } while (0) | ||
119 | #endif | 122 | #endif |
120 | 123 | ||
121 | /* | 124 | /* |
@@ -137,7 +140,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, | |||
137 | extern typeof(sym) sym; \ | 140 | extern typeof(sym) sym; \ |
138 | static const unsigned long __kentry_##sym \ | 141 | static const unsigned long __kentry_##sym \ |
139 | __used \ | 142 | __used \ |
140 | __attribute__((section("___kentry" "+" #sym ), used)) \ | 143 | __section("___kentry" "+" #sym ) \ |
141 | = (unsigned long)&sym; | 144 | = (unsigned long)&sym; |
142 | #endif | 145 | #endif |
143 | 146 | ||
@@ -278,7 +281,7 @@ unsigned long read_word_at_a_time(const void *addr) | |||
278 | * visible to the compiler. | 281 | * visible to the compiler. |
279 | */ | 282 | */ |
280 | #define __ADDRESSABLE(sym) \ | 283 | #define __ADDRESSABLE(sym) \ |
281 | static void * __attribute__((section(".discard.addressable"), used)) \ | 284 | static void * __section(".discard.addressable") __used \ |
282 | __PASTE(__addressable_##sym, __LINE__) = (void *)&sym; | 285 | __PASTE(__addressable_##sym, __LINE__) = (void *)&sym; |
283 | 286 | ||
284 | /** | 287 | /** |
@@ -331,10 +334,6 @@ static inline void *offset_to_ptr(const int *off) | |||
331 | #endif /* __KERNEL__ */ | 334 | #endif /* __KERNEL__ */ |
332 | #endif /* __ASSEMBLY__ */ | 335 | #endif /* __ASSEMBLY__ */ |
333 | 336 | ||
334 | #ifndef __optimize | ||
335 | # define __optimize(level) | ||
336 | #endif | ||
337 | |||
338 | /* Compile time object size, -1 for unknown */ | 337 | /* Compile time object size, -1 for unknown */ |
339 | #ifndef __compiletime_object_size | 338 | #ifndef __compiletime_object_size |
340 | # define __compiletime_object_size(obj) -1 | 339 | # define __compiletime_object_size(obj) -1 |
@@ -376,4 +375,7 @@ static inline void *offset_to_ptr(const int *off) | |||
376 | compiletime_assert(__native_word(t), \ | 375 | compiletime_assert(__native_word(t), \ |
377 | "Need native word sized stores/loads for atomicity.") | 376 | "Need native word sized stores/loads for atomicity.") |
378 | 377 | ||
378 | /* &a[0] degrades to a pointer: a different type from an array */ | ||
379 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) | ||
380 | |||
379 | #endif /* __LINUX_COMPILER_H */ | 381 | #endif /* __LINUX_COMPILER_H */ |