diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-05 18:32:03 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-05 18:32:03 -0500 |
commit | ef26b1691d11e17af205a4ff9c91458d931d11db (patch) | |
tree | 5db199f404ca18f6c9e8617b684e9165ca365e30 /include | |
parent | a77d2e081bbbccb38f42da45500dd089756efdfb (diff) | |
parent | 7cff7ce94a7df2ccf5ac76b48ee0995fee2060df (diff) |
Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
include/linux/compiler-gcc4.h: Fix build bug - gcc-4.0.2 doesn't understand __builtin_object_size
x86/alternatives: No need for alternatives-asm.h to re-invent stuff already in asm.h
x86/alternatives: Check replacementlen <= instrlen at build time
x86, 64-bit: Set data segments to null after switching to 64-bit mode
x86: Clean up the loadsegment() macro
x86: Optimize loadsegment()
x86: Add missing might_fault() checks to copy_{to,from}_user()
x86-64: __copy_from_user_inatomic() adjustments
x86: Remove unused thread_return label from switch_to()
x86, 64-bit: Fix bstep_iret jump
x86: Don't use the strict copy checks when branch profiling is in use
x86, 64-bit: Move K8 B step iret fixup to fault entry asm
x86: Generate cmpxchg build failures
x86: Add a Kconfig option to turn the copy_from_user warnings into errors
x86: Turn the copy_from_user check into an (optional) compile time warning
x86: Use __builtin_memset and __builtin_memcpy for memset/memcpy
x86: Use __builtin_object_size() to validate the buffer size for copy_from_user()
Diffstat (limited to 'include')
-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(), |