diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-alpha/compiler.h | 2 | ||||
-rw-r--r-- | include/asm-alpha/processor.h | 21 | ||||
-rw-r--r-- | include/asm-ia64/bug.h | 6 | ||||
-rw-r--r-- | include/asm-ia64/spinlock.h | 2 | ||||
-rw-r--r-- | include/asm-sparc64/system.h | 4 | ||||
-rw-r--r-- | include/asm-um/rwsem.h | 4 | ||||
-rw-r--r-- | include/asm-v850/unistd.h | 18 | ||||
-rw-r--r-- | include/linux/byteorder/generic.h | 2 | ||||
-rw-r--r-- | include/linux/byteorder/swab.h | 2 | ||||
-rw-r--r-- | include/linux/byteorder/swabb.h | 2 | ||||
-rw-r--r-- | include/linux/compiler-gcc.h | 9 | ||||
-rw-r--r-- | include/linux/compiler-gcc3.h | 17 | ||||
-rw-r--r-- | include/linux/compiler-gcc4.h | 7 | ||||
-rw-r--r-- | include/linux/kernel.h | 2 | ||||
-rw-r--r-- | include/linux/seccomp.h | 6 | ||||
-rw-r--r-- | include/linux/spinlock_types_up.h | 14 |
16 files changed, 15 insertions, 103 deletions
diff --git a/include/asm-alpha/compiler.h b/include/asm-alpha/compiler.h index 0a4a8b40dfcd..00c6f57ad9a7 100644 --- a/include/asm-alpha/compiler.h +++ b/include/asm-alpha/compiler.h | |||
@@ -98,9 +98,7 @@ | |||
98 | #undef inline | 98 | #undef inline |
99 | #undef __inline__ | 99 | #undef __inline__ |
100 | #undef __inline | 100 | #undef __inline |
101 | #if __GNUC__ == 3 && __GNUC_MINOR__ >= 1 || __GNUC__ > 3 | ||
102 | #undef __always_inline | 101 | #undef __always_inline |
103 | #define __always_inline inline __attribute__((always_inline)) | 102 | #define __always_inline inline __attribute__((always_inline)) |
104 | #endif | ||
105 | 103 | ||
106 | #endif /* __ALPHA_COMPILER_H */ | 104 | #endif /* __ALPHA_COMPILER_H */ |
diff --git a/include/asm-alpha/processor.h b/include/asm-alpha/processor.h index 059780a7d3d7..bb1a7a3abb8b 100644 --- a/include/asm-alpha/processor.h +++ b/include/asm-alpha/processor.h | |||
@@ -77,7 +77,6 @@ unsigned long get_wchan(struct task_struct *p); | |||
77 | #define spin_lock_prefetch(lock) do { } while (0) | 77 | #define spin_lock_prefetch(lock) do { } while (0) |
78 | #endif | 78 | #endif |
79 | 79 | ||
80 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) | ||
81 | extern inline void prefetch(const void *ptr) | 80 | extern inline void prefetch(const void *ptr) |
82 | { | 81 | { |
83 | __builtin_prefetch(ptr, 0, 3); | 82 | __builtin_prefetch(ptr, 0, 3); |
@@ -95,24 +94,4 @@ extern inline void spin_lock_prefetch(const void *ptr) | |||
95 | } | 94 | } |
96 | #endif | 95 | #endif |
97 | 96 | ||
98 | #else | ||
99 | extern inline void prefetch(const void *ptr) | ||
100 | { | ||
101 | __asm__ ("ldl $31,%0" : : "m"(*(char *)ptr)); | ||
102 | } | ||
103 | |||
104 | extern inline void prefetchw(const void *ptr) | ||
105 | { | ||
106 | __asm__ ("ldq $31,%0" : : "m"(*(char *)ptr)); | ||
107 | } | ||
108 | |||
109 | #ifdef CONFIG_SMP | ||
110 | extern inline void spin_lock_prefetch(const void *ptr) | ||
111 | { | ||
112 | __asm__ ("ldq $31,%0" : : "m"(*(char *)ptr)); | ||
113 | } | ||
114 | #endif | ||
115 | |||
116 | #endif /* GCC 3.1 */ | ||
117 | |||
118 | #endif /* __ASM_ALPHA_PROCESSOR_H */ | 97 | #endif /* __ASM_ALPHA_PROCESSOR_H */ |
diff --git a/include/asm-ia64/bug.h b/include/asm-ia64/bug.h index 3aa0a0a5474b..823616b5020b 100644 --- a/include/asm-ia64/bug.h +++ b/include/asm-ia64/bug.h | |||
@@ -2,11 +2,7 @@ | |||
2 | #define _ASM_IA64_BUG_H | 2 | #define _ASM_IA64_BUG_H |
3 | 3 | ||
4 | #ifdef CONFIG_BUG | 4 | #ifdef CONFIG_BUG |
5 | #if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) | 5 | #define ia64_abort() __builtin_trap() |
6 | # define ia64_abort() __builtin_trap() | ||
7 | #else | ||
8 | # define ia64_abort() (*(volatile int *) 0 = 0) | ||
9 | #endif | ||
10 | #define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); ia64_abort(); } while (0) | 6 | #define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); ia64_abort(); } while (0) |
11 | 7 | ||
12 | /* should this BUG be made generic? */ | 8 | /* should this BUG be made generic? */ |
diff --git a/include/asm-ia64/spinlock.h b/include/asm-ia64/spinlock.h index 0c91a76c5ea3..9e83210dc312 100644 --- a/include/asm-ia64/spinlock.h +++ b/include/asm-ia64/spinlock.h | |||
@@ -34,7 +34,7 @@ __raw_spin_lock_flags (raw_spinlock_t *lock, unsigned long flags) | |||
34 | { | 34 | { |
35 | register volatile unsigned int *ptr asm ("r31") = &lock->lock; | 35 | register volatile unsigned int *ptr asm ("r31") = &lock->lock; |
36 | 36 | ||
37 | #if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | 37 | #if (__GNUC__ == 3 && __GNUC_MINOR__ < 3) |
38 | # ifdef CONFIG_ITANIUM | 38 | # ifdef CONFIG_ITANIUM |
39 | /* don't use brl on Itanium... */ | 39 | /* don't use brl on Itanium... */ |
40 | asm volatile ("{\n\t" | 40 | asm volatile ("{\n\t" |
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h index b5417529f6f1..309f1466b6fa 100644 --- a/include/asm-sparc64/system.h +++ b/include/asm-sparc64/system.h | |||
@@ -193,11 +193,7 @@ do { \ | |||
193 | * not preserve it's value. Hairy, but it lets us remove 2 loads | 193 | * not preserve it's value. Hairy, but it lets us remove 2 loads |
194 | * and 2 stores in this critical code path. -DaveM | 194 | * and 2 stores in this critical code path. -DaveM |
195 | */ | 195 | */ |
196 | #if __GNUC__ >= 3 | ||
197 | #define EXTRA_CLOBBER ,"%l1" | 196 | #define EXTRA_CLOBBER ,"%l1" |
198 | #else | ||
199 | #define EXTRA_CLOBBER | ||
200 | #endif | ||
201 | #define switch_to(prev, next, last) \ | 197 | #define switch_to(prev, next, last) \ |
202 | do { if (test_thread_flag(TIF_PERFCTR)) { \ | 198 | do { if (test_thread_flag(TIF_PERFCTR)) { \ |
203 | unsigned long __tmp; \ | 199 | unsigned long __tmp; \ |
diff --git a/include/asm-um/rwsem.h b/include/asm-um/rwsem.h index 661c0e54702b..b5fc449dc86b 100644 --- a/include/asm-um/rwsem.h +++ b/include/asm-um/rwsem.h | |||
@@ -1,10 +1,6 @@ | |||
1 | #ifndef __UM_RWSEM_H__ | 1 | #ifndef __UM_RWSEM_H__ |
2 | #define __UM_RWSEM_H__ | 2 | #define __UM_RWSEM_H__ |
3 | 3 | ||
4 | #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96) | ||
5 | #define __builtin_expect(exp,c) (exp) | ||
6 | #endif | ||
7 | |||
8 | #include "asm/arch/rwsem.h" | 4 | #include "asm/arch/rwsem.h" |
9 | 5 | ||
10 | #endif | 6 | #endif |
diff --git a/include/asm-v850/unistd.h b/include/asm-v850/unistd.h index 5a86f8e976ec..82460a7bb233 100644 --- a/include/asm-v850/unistd.h +++ b/include/asm-v850/unistd.h | |||
@@ -241,9 +241,6 @@ | |||
241 | /* User programs sometimes end up including this header file | 241 | /* User programs sometimes end up including this header file |
242 | (indirectly, via uClibc header files), so I'm a bit nervous just | 242 | (indirectly, via uClibc header files), so I'm a bit nervous just |
243 | including <linux/compiler.h>. */ | 243 | including <linux/compiler.h>. */ |
244 | #if !defined(__builtin_expect) && __GNUC__ == 2 && __GNUC_MINOR__ < 96 | ||
245 | #define __builtin_expect(x, expected_value) (x) | ||
246 | #endif | ||
247 | 244 | ||
248 | #define __syscall_return(type, res) \ | 245 | #define __syscall_return(type, res) \ |
249 | do { \ | 246 | do { \ |
@@ -346,20 +343,6 @@ type name (atype a, btype b, ctype c, dtype d, etype e) \ | |||
346 | __syscall_return (type, __ret); \ | 343 | __syscall_return (type, __ret); \ |
347 | } | 344 | } |
348 | 345 | ||
349 | #if __GNUC__ < 3 | ||
350 | /* In older versions of gcc, `asm' statements with more than 10 | ||
351 | input/output arguments produce a fatal error. To work around this | ||
352 | problem, we use two versions, one for gcc-3.x and one for earlier | ||
353 | versions of gcc (the `earlier gcc' version doesn't work with gcc-3.x | ||
354 | because gcc-3.x doesn't allow clobbers to also be input arguments). */ | ||
355 | #define __SYSCALL6_TRAP(syscall, ret, a, b, c, d, e, f) \ | ||
356 | __asm__ __volatile__ ("trap " SYSCALL_LONG_TRAP \ | ||
357 | : "=r" (ret), "=r" (syscall) \ | ||
358 | : "1" (syscall), \ | ||
359 | "r" (a), "r" (b), "r" (c), "r" (d), \ | ||
360 | "r" (e), "r" (f) \ | ||
361 | : SYSCALL_CLOBBERS, SYSCALL_ARG4, SYSCALL_ARG5); | ||
362 | #else /* __GNUC__ >= 3 */ | ||
363 | #define __SYSCALL6_TRAP(syscall, ret, a, b, c, d, e, f) \ | 346 | #define __SYSCALL6_TRAP(syscall, ret, a, b, c, d, e, f) \ |
364 | __asm__ __volatile__ ("trap " SYSCALL_LONG_TRAP \ | 347 | __asm__ __volatile__ ("trap " SYSCALL_LONG_TRAP \ |
365 | : "=r" (ret), "=r" (syscall), \ | 348 | : "=r" (ret), "=r" (syscall), \ |
@@ -368,7 +351,6 @@ type name (atype a, btype b, ctype c, dtype d, etype e) \ | |||
368 | "r" (a), "r" (b), "r" (c), "r" (d), \ | 351 | "r" (a), "r" (b), "r" (c), "r" (d), \ |
369 | "2" (e), "3" (f) \ | 352 | "2" (e), "3" (f) \ |
370 | : SYSCALL_CLOBBERS); | 353 | : SYSCALL_CLOBBERS); |
371 | #endif | ||
372 | 354 | ||
373 | #define _syscall6(type, name, atype, a, btype, b, ctype, c, dtype, d, etype, e, ftype, f) \ | 355 | #define _syscall6(type, name, atype, a, btype, b, ctype, c, dtype, d, etype, e, ftype, f) \ |
374 | type name (atype a, btype b, ctype c, dtype d, etype e, ftype f) \ | 356 | type name (atype a, btype b, ctype c, dtype d, etype e, ftype f) \ |
diff --git a/include/linux/byteorder/generic.h b/include/linux/byteorder/generic.h index 04bd756efc67..e86e4a938373 100644 --- a/include/linux/byteorder/generic.h +++ b/include/linux/byteorder/generic.h | |||
@@ -156,7 +156,7 @@ extern __be32 htonl(__u32); | |||
156 | extern __u16 ntohs(__be16); | 156 | extern __u16 ntohs(__be16); |
157 | extern __be16 htons(__u16); | 157 | extern __be16 htons(__u16); |
158 | 158 | ||
159 | #if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) | 159 | #if defined(__GNUC__) && defined(__OPTIMIZE__) |
160 | 160 | ||
161 | #define ___htonl(x) __cpu_to_be32(x) | 161 | #define ___htonl(x) __cpu_to_be32(x) |
162 | #define ___htons(x) __cpu_to_be16(x) | 162 | #define ___htons(x) __cpu_to_be16(x) |
diff --git a/include/linux/byteorder/swab.h b/include/linux/byteorder/swab.h index 2f1cb775125a..25f7f32883ec 100644 --- a/include/linux/byteorder/swab.h +++ b/include/linux/byteorder/swab.h | |||
@@ -110,7 +110,7 @@ | |||
110 | /* | 110 | /* |
111 | * Allow constant folding | 111 | * Allow constant folding |
112 | */ | 112 | */ |
113 | #if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) | 113 | #if defined(__GNUC__) && defined(__OPTIMIZE__) |
114 | # define __swab16(x) \ | 114 | # define __swab16(x) \ |
115 | (__builtin_constant_p((__u16)(x)) ? \ | 115 | (__builtin_constant_p((__u16)(x)) ? \ |
116 | ___swab16((x)) : \ | 116 | ___swab16((x)) : \ |
diff --git a/include/linux/byteorder/swabb.h b/include/linux/byteorder/swabb.h index d5f2a3205109..ae5e5f914bf4 100644 --- a/include/linux/byteorder/swabb.h +++ b/include/linux/byteorder/swabb.h | |||
@@ -77,7 +77,7 @@ | |||
77 | /* | 77 | /* |
78 | * Allow constant folding | 78 | * Allow constant folding |
79 | */ | 79 | */ |
80 | #if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) | 80 | #if defined(__GNUC__) && defined(__OPTIMIZE__) |
81 | # define __swahw32(x) \ | 81 | # define __swahw32(x) \ |
82 | (__builtin_constant_p((__u32)(x)) ? \ | 82 | (__builtin_constant_p((__u32)(x)) ? \ |
83 | ___swahw32((x)) : \ | 83 | ___swahw32((x)) : \ |
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 152734055403..2e05e1e6b0e6 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
@@ -15,3 +15,12 @@ | |||
15 | ({ unsigned long __ptr; \ | 15 | ({ unsigned long __ptr; \ |
16 | __asm__ ("" : "=g"(__ptr) : "0"(ptr)); \ | 16 | __asm__ ("" : "=g"(__ptr) : "0"(ptr)); \ |
17 | (typeof(ptr)) (__ptr + (off)); }) | 17 | (typeof(ptr)) (__ptr + (off)); }) |
18 | |||
19 | |||
20 | #define inline inline __attribute__((always_inline)) | ||
21 | #define __inline__ __inline__ __attribute__((always_inline)) | ||
22 | #define __inline __inline __attribute__((always_inline)) | ||
23 | #define __deprecated __attribute__((deprecated)) | ||
24 | #define noinline __attribute__((noinline)) | ||
25 | #define __attribute_pure__ __attribute__((pure)) | ||
26 | #define __attribute_const__ __attribute__((__const__)) | ||
diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h index a6fa615afab5..4209082ee934 100644 --- a/include/linux/compiler-gcc3.h +++ b/include/linux/compiler-gcc3.h | |||
@@ -3,29 +3,12 @@ | |||
3 | /* These definitions are for GCC v3.x. */ | 3 | /* These definitions are for GCC v3.x. */ |
4 | #include <linux/compiler-gcc.h> | 4 | #include <linux/compiler-gcc.h> |
5 | 5 | ||
6 | #if __GNUC_MINOR__ >= 1 | ||
7 | # define inline inline __attribute__((always_inline)) | ||
8 | # define __inline__ __inline__ __attribute__((always_inline)) | ||
9 | # define __inline __inline __attribute__((always_inline)) | ||
10 | #endif | ||
11 | |||
12 | #if __GNUC_MINOR__ > 0 | ||
13 | # define __deprecated __attribute__((deprecated)) | ||
14 | #endif | ||
15 | |||
16 | #if __GNUC_MINOR__ >= 3 | 6 | #if __GNUC_MINOR__ >= 3 |
17 | # define __attribute_used__ __attribute__((__used__)) | 7 | # define __attribute_used__ __attribute__((__used__)) |
18 | #else | 8 | #else |
19 | # define __attribute_used__ __attribute__((__unused__)) | 9 | # define __attribute_used__ __attribute__((__unused__)) |
20 | #endif | 10 | #endif |
21 | 11 | ||
22 | #define __attribute_pure__ __attribute__((pure)) | ||
23 | #define __attribute_const__ __attribute__((__const__)) | ||
24 | |||
25 | #if __GNUC_MINOR__ >= 1 | ||
26 | #define noinline __attribute__((noinline)) | ||
27 | #endif | ||
28 | |||
29 | #if __GNUC_MINOR__ >= 4 | 12 | #if __GNUC_MINOR__ >= 4 |
30 | #define __must_check __attribute__((warn_unused_result)) | 13 | #define __must_check __attribute__((warn_unused_result)) |
31 | #endif | 14 | #endif |
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 53686c037a06..e913e9beaf69 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
@@ -3,14 +3,7 @@ | |||
3 | /* These definitions are for GCC v4.x. */ | 3 | /* These definitions are for GCC v4.x. */ |
4 | #include <linux/compiler-gcc.h> | 4 | #include <linux/compiler-gcc.h> |
5 | 5 | ||
6 | #define inline inline __attribute__((always_inline)) | ||
7 | #define __inline__ __inline__ __attribute__((always_inline)) | ||
8 | #define __inline __inline __attribute__((always_inline)) | ||
9 | #define __deprecated __attribute__((deprecated)) | ||
10 | #define __attribute_used__ __attribute__((__used__)) | 6 | #define __attribute_used__ __attribute__((__used__)) |
11 | #define __attribute_pure__ __attribute__((pure)) | ||
12 | #define __attribute_const__ __attribute__((__const__)) | ||
13 | #define noinline __attribute__((noinline)) | ||
14 | #define __must_check __attribute__((warn_unused_result)) | 7 | #define __must_check __attribute__((warn_unused_result)) |
15 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) | 8 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) |
16 | 9 | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index b1e407a4fbda..ca7ff8fdd090 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -316,8 +316,6 @@ extern int randomize_va_space; | |||
316 | #endif | 316 | #endif |
317 | 317 | ||
318 | /* Trap pasters of __FUNCTION__ at compile-time */ | 318 | /* Trap pasters of __FUNCTION__ at compile-time */ |
319 | #if __GNUC__ > 2 || __GNUC_MINOR__ >= 95 | ||
320 | #define __FUNCTION__ (__func__) | 319 | #define __FUNCTION__ (__func__) |
321 | #endif | ||
322 | 320 | ||
323 | #endif | 321 | #endif |
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h index dc89116bb1ca..cd2773b29a64 100644 --- a/include/linux/seccomp.h +++ b/include/linux/seccomp.h | |||
@@ -26,11 +26,7 @@ static inline int has_secure_computing(struct thread_info *ti) | |||
26 | 26 | ||
27 | #else /* CONFIG_SECCOMP */ | 27 | #else /* CONFIG_SECCOMP */ |
28 | 28 | ||
29 | #if (__GNUC__ > 2) | 29 | typedef struct { } seccomp_t; |
30 | typedef struct { } seccomp_t; | ||
31 | #else | ||
32 | typedef struct { int gcc_is_buggy; } seccomp_t; | ||
33 | #endif | ||
34 | 30 | ||
35 | #define secure_computing(x) do { } while (0) | 31 | #define secure_computing(x) do { } while (0) |
36 | /* static inline to preserve typechecking */ | 32 | /* static inline to preserve typechecking */ |
diff --git a/include/linux/spinlock_types_up.h b/include/linux/spinlock_types_up.h index def2d173a8db..04135b0e198e 100644 --- a/include/linux/spinlock_types_up.h +++ b/include/linux/spinlock_types_up.h | |||
@@ -22,30 +22,16 @@ typedef struct { | |||
22 | 22 | ||
23 | #else | 23 | #else |
24 | 24 | ||
25 | /* | ||
26 | * All gcc 2.95 versions and early versions of 2.96 have a nasty bug | ||
27 | * with empty initializers. | ||
28 | */ | ||
29 | #if (__GNUC__ > 2) | ||
30 | typedef struct { } raw_spinlock_t; | 25 | typedef struct { } raw_spinlock_t; |
31 | 26 | ||
32 | #define __RAW_SPIN_LOCK_UNLOCKED { } | 27 | #define __RAW_SPIN_LOCK_UNLOCKED { } |
33 | #else | ||
34 | typedef struct { int gcc_is_buggy; } raw_spinlock_t; | ||
35 | #define __RAW_SPIN_LOCK_UNLOCKED (raw_spinlock_t) { 0 } | ||
36 | #endif | ||
37 | 28 | ||
38 | #endif | 29 | #endif |
39 | 30 | ||
40 | #if (__GNUC__ > 2) | ||
41 | typedef struct { | 31 | typedef struct { |
42 | /* no debug version on UP */ | 32 | /* no debug version on UP */ |
43 | } raw_rwlock_t; | 33 | } raw_rwlock_t; |
44 | 34 | ||
45 | #define __RAW_RW_LOCK_UNLOCKED { } | 35 | #define __RAW_RW_LOCK_UNLOCKED { } |
46 | #else | ||
47 | typedef struct { int gcc_is_buggy; } raw_rwlock_t; | ||
48 | #define __RAW_RW_LOCK_UNLOCKED (raw_rwlock_t) { 0 } | ||
49 | #endif | ||
50 | 36 | ||
51 | #endif /* __LINUX_SPINLOCK_TYPES_UP_H */ | 37 | #endif /* __LINUX_SPINLOCK_TYPES_UP_H */ |