diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/compiler-gcc4.h | 8 | ||||
-rw-r--r-- | include/linux/compiler.h | 11 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index ab3af40a53c6..94dea3ffbfa1 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
@@ -51,3 +51,11 @@ | |||
51 | #endif | 51 | #endif |
52 | 52 | ||
53 | #endif | 53 | #endif |
54 | |||
55 | #if __GNUC_MINOR__ > 0 | ||
56 | #define __compiletime_object_size(obj) __builtin_object_size(obj, 0) | ||
57 | #endif | ||
58 | #if __GNUC_MINOR__ >= 4 | ||
59 | #define __compiletime_warning(message) __attribute__((warning(message))) | ||
60 | #define __compiletime_error(message) __attribute__((error(message))) | ||
61 | #endif | ||
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index acbd654cc850..5be3dab4a695 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -275,6 +275,17 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
275 | # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) | 275 | # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) |
276 | #endif | 276 | #endif |
277 | 277 | ||
278 | /* Compile time object size, -1 for unknown */ | ||
279 | #ifndef __compiletime_object_size | ||
280 | # define __compiletime_object_size(obj) -1 | ||
281 | #endif | ||
282 | #ifndef __compiletime_warning | ||
283 | # define __compiletime_warning(message) | ||
284 | #endif | ||
285 | #ifndef __compiletime_error | ||
286 | # define __compiletime_error(message) | ||
287 | #endif | ||
288 | |||
278 | /* | 289 | /* |
279 | * Prevent the compiler from merging or refetching accesses. The compiler | 290 | * Prevent the compiler from merging or refetching accesses. The compiler |
280 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), | 291 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), |