[PATCH] remove gcc-2 checks
Remove various things which were checking for gcc-1.x and gcc-2.x compilers. From: Adrian Bunk <bunk@stusta.de> Some documentation updates and removes some code paths for gcc < 3.2. Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
fd285bb54d
commit
a136564702
@@ -98,9 +98,7 @@
|
||||
#undef inline
|
||||
#undef __inline__
|
||||
#undef __inline
|
||||
#if __GNUC__ == 3 && __GNUC_MINOR__ >= 1 || __GNUC__ > 3
|
||||
#undef __always_inline
|
||||
#define __always_inline inline __attribute__((always_inline))
|
||||
#endif
|
||||
|
||||
#endif /* __ALPHA_COMPILER_H */
|
||||
|
||||
@@ -77,7 +77,6 @@ unsigned long get_wchan(struct task_struct *p);
|
||||
#define spin_lock_prefetch(lock) do { } while (0)
|
||||
#endif
|
||||
|
||||
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
|
||||
extern inline void prefetch(const void *ptr)
|
||||
{
|
||||
__builtin_prefetch(ptr, 0, 3);
|
||||
@@ -95,24 +94,4 @@ extern inline void spin_lock_prefetch(const void *ptr)
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
extern inline void prefetch(const void *ptr)
|
||||
{
|
||||
__asm__ ("ldl $31,%0" : : "m"(*(char *)ptr));
|
||||
}
|
||||
|
||||
extern inline void prefetchw(const void *ptr)
|
||||
{
|
||||
__asm__ ("ldq $31,%0" : : "m"(*(char *)ptr));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
extern inline void spin_lock_prefetch(const void *ptr)
|
||||
{
|
||||
__asm__ ("ldq $31,%0" : : "m"(*(char *)ptr));
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* GCC 3.1 */
|
||||
|
||||
#endif /* __ASM_ALPHA_PROCESSOR_H */
|
||||
|
||||
@@ -2,11 +2,7 @@
|
||||
#define _ASM_IA64_BUG_H
|
||||
|
||||
#ifdef CONFIG_BUG
|
||||
#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
|
||||
# define ia64_abort() __builtin_trap()
|
||||
#else
|
||||
# define ia64_abort() (*(volatile int *) 0 = 0)
|
||||
#endif
|
||||
#define ia64_abort() __builtin_trap()
|
||||
#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); ia64_abort(); } while (0)
|
||||
|
||||
/* should this BUG be made generic? */
|
||||
|
||||
@@ -34,7 +34,7 @@ __raw_spin_lock_flags (raw_spinlock_t *lock, unsigned long flags)
|
||||
{
|
||||
register volatile unsigned int *ptr asm ("r31") = &lock->lock;
|
||||
|
||||
#if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 3)
|
||||
#if (__GNUC__ == 3 && __GNUC_MINOR__ < 3)
|
||||
# ifdef CONFIG_ITANIUM
|
||||
/* don't use brl on Itanium... */
|
||||
asm volatile ("{\n\t"
|
||||
|
||||
@@ -193,11 +193,7 @@ do { \
|
||||
* not preserve it's value. Hairy, but it lets us remove 2 loads
|
||||
* and 2 stores in this critical code path. -DaveM
|
||||
*/
|
||||
#if __GNUC__ >= 3
|
||||
#define EXTRA_CLOBBER ,"%l1"
|
||||
#else
|
||||
#define EXTRA_CLOBBER
|
||||
#endif
|
||||
#define switch_to(prev, next, last) \
|
||||
do { if (test_thread_flag(TIF_PERFCTR)) { \
|
||||
unsigned long __tmp; \
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#ifndef __UM_RWSEM_H__
|
||||
#define __UM_RWSEM_H__
|
||||
|
||||
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
|
||||
#define __builtin_expect(exp,c) (exp)
|
||||
#endif
|
||||
|
||||
#include "asm/arch/rwsem.h"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -241,9 +241,6 @@
|
||||
/* User programs sometimes end up including this header file
|
||||
(indirectly, via uClibc header files), so I'm a bit nervous just
|
||||
including <linux/compiler.h>. */
|
||||
#if !defined(__builtin_expect) && __GNUC__ == 2 && __GNUC_MINOR__ < 96
|
||||
#define __builtin_expect(x, expected_value) (x)
|
||||
#endif
|
||||
|
||||
#define __syscall_return(type, res) \
|
||||
do { \
|
||||
@@ -346,20 +343,6 @@ type name (atype a, btype b, ctype c, dtype d, etype e) \
|
||||
__syscall_return (type, __ret); \
|
||||
}
|
||||
|
||||
#if __GNUC__ < 3
|
||||
/* In older versions of gcc, `asm' statements with more than 10
|
||||
input/output arguments produce a fatal error. To work around this
|
||||
problem, we use two versions, one for gcc-3.x and one for earlier
|
||||
versions of gcc (the `earlier gcc' version doesn't work with gcc-3.x
|
||||
because gcc-3.x doesn't allow clobbers to also be input arguments). */
|
||||
#define __SYSCALL6_TRAP(syscall, ret, a, b, c, d, e, f) \
|
||||
__asm__ __volatile__ ("trap " SYSCALL_LONG_TRAP \
|
||||
: "=r" (ret), "=r" (syscall) \
|
||||
: "1" (syscall), \
|
||||
"r" (a), "r" (b), "r" (c), "r" (d), \
|
||||
"r" (e), "r" (f) \
|
||||
: SYSCALL_CLOBBERS, SYSCALL_ARG4, SYSCALL_ARG5);
|
||||
#else /* __GNUC__ >= 3 */
|
||||
#define __SYSCALL6_TRAP(syscall, ret, a, b, c, d, e, f) \
|
||||
__asm__ __volatile__ ("trap " SYSCALL_LONG_TRAP \
|
||||
: "=r" (ret), "=r" (syscall), \
|
||||
@@ -368,7 +351,6 @@ type name (atype a, btype b, ctype c, dtype d, etype e) \
|
||||
"r" (a), "r" (b), "r" (c), "r" (d), \
|
||||
"2" (e), "3" (f) \
|
||||
: SYSCALL_CLOBBERS);
|
||||
#endif
|
||||
|
||||
#define _syscall6(type, name, atype, a, btype, b, ctype, c, dtype, d, etype, e, ftype, f) \
|
||||
type name (atype a, btype b, ctype c, dtype d, etype e, ftype f) \
|
||||
|
||||
@@ -156,7 +156,7 @@ extern __be32 htonl(__u32);
|
||||
extern __u16 ntohs(__be16);
|
||||
extern __be16 htons(__u16);
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__)
|
||||
#if defined(__GNUC__) && defined(__OPTIMIZE__)
|
||||
|
||||
#define ___htonl(x) __cpu_to_be32(x)
|
||||
#define ___htons(x) __cpu_to_be16(x)
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
/*
|
||||
* Allow constant folding
|
||||
*/
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__)
|
||||
#if defined(__GNUC__) && defined(__OPTIMIZE__)
|
||||
# define __swab16(x) \
|
||||
(__builtin_constant_p((__u16)(x)) ? \
|
||||
___swab16((x)) : \
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
/*
|
||||
* Allow constant folding
|
||||
*/
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__)
|
||||
#if defined(__GNUC__) && defined(__OPTIMIZE__)
|
||||
# define __swahw32(x) \
|
||||
(__builtin_constant_p((__u32)(x)) ? \
|
||||
___swahw32((x)) : \
|
||||
|
||||
@@ -15,3 +15,12 @@
|
||||
({ unsigned long __ptr; \
|
||||
__asm__ ("" : "=g"(__ptr) : "0"(ptr)); \
|
||||
(typeof(ptr)) (__ptr + (off)); })
|
||||
|
||||
|
||||
#define inline inline __attribute__((always_inline))
|
||||
#define __inline__ __inline__ __attribute__((always_inline))
|
||||
#define __inline __inline __attribute__((always_inline))
|
||||
#define __deprecated __attribute__((deprecated))
|
||||
#define noinline __attribute__((noinline))
|
||||
#define __attribute_pure__ __attribute__((pure))
|
||||
#define __attribute_const__ __attribute__((__const__))
|
||||
|
||||
@@ -3,29 +3,12 @@
|
||||
/* These definitions are for GCC v3.x. */
|
||||
#include <linux/compiler-gcc.h>
|
||||
|
||||
#if __GNUC_MINOR__ >= 1
|
||||
# define inline inline __attribute__((always_inline))
|
||||
# define __inline__ __inline__ __attribute__((always_inline))
|
||||
# define __inline __inline __attribute__((always_inline))
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ > 0
|
||||
# define __deprecated __attribute__((deprecated))
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ >= 3
|
||||
# define __attribute_used__ __attribute__((__used__))
|
||||
#else
|
||||
# define __attribute_used__ __attribute__((__unused__))
|
||||
#endif
|
||||
|
||||
#define __attribute_pure__ __attribute__((pure))
|
||||
#define __attribute_const__ __attribute__((__const__))
|
||||
|
||||
#if __GNUC_MINOR__ >= 1
|
||||
#define noinline __attribute__((noinline))
|
||||
#endif
|
||||
|
||||
#if __GNUC_MINOR__ >= 4
|
||||
#define __must_check __attribute__((warn_unused_result))
|
||||
#endif
|
||||
|
||||
@@ -3,14 +3,7 @@
|
||||
/* These definitions are for GCC v4.x. */
|
||||
#include <linux/compiler-gcc.h>
|
||||
|
||||
#define inline inline __attribute__((always_inline))
|
||||
#define __inline__ __inline__ __attribute__((always_inline))
|
||||
#define __inline __inline __attribute__((always_inline))
|
||||
#define __deprecated __attribute__((deprecated))
|
||||
#define __attribute_used__ __attribute__((__used__))
|
||||
#define __attribute_pure__ __attribute__((pure))
|
||||
#define __attribute_const__ __attribute__((__const__))
|
||||
#define noinline __attribute__((noinline))
|
||||
#define __must_check __attribute__((warn_unused_result))
|
||||
#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
|
||||
|
||||
|
||||
@@ -316,8 +316,6 @@ extern int randomize_va_space;
|
||||
#endif
|
||||
|
||||
/* Trap pasters of __FUNCTION__ at compile-time */
|
||||
#if __GNUC__ > 2 || __GNUC_MINOR__ >= 95
|
||||
#define __FUNCTION__ (__func__)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,11 +26,7 @@ static inline int has_secure_computing(struct thread_info *ti)
|
||||
|
||||
#else /* CONFIG_SECCOMP */
|
||||
|
||||
#if (__GNUC__ > 2)
|
||||
typedef struct { } seccomp_t;
|
||||
#else
|
||||
typedef struct { int gcc_is_buggy; } seccomp_t;
|
||||
#endif
|
||||
typedef struct { } seccomp_t;
|
||||
|
||||
#define secure_computing(x) do { } while (0)
|
||||
/* static inline to preserve typechecking */
|
||||
|
||||
@@ -22,30 +22,16 @@ typedef struct {
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* All gcc 2.95 versions and early versions of 2.96 have a nasty bug
|
||||
* with empty initializers.
|
||||
*/
|
||||
#if (__GNUC__ > 2)
|
||||
typedef struct { } raw_spinlock_t;
|
||||
|
||||
#define __RAW_SPIN_LOCK_UNLOCKED { }
|
||||
#else
|
||||
typedef struct { int gcc_is_buggy; } raw_spinlock_t;
|
||||
#define __RAW_SPIN_LOCK_UNLOCKED (raw_spinlock_t) { 0 }
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if (__GNUC__ > 2)
|
||||
typedef struct {
|
||||
/* no debug version on UP */
|
||||
} raw_rwlock_t;
|
||||
|
||||
#define __RAW_RW_LOCK_UNLOCKED { }
|
||||
#else
|
||||
typedef struct { int gcc_is_buggy; } raw_rwlock_t;
|
||||
#define __RAW_RW_LOCK_UNLOCKED (raw_rwlock_t) { 0 }
|
||||
#endif
|
||||
|
||||
#endif /* __LINUX_SPINLOCK_TYPES_UP_H */
|
||||
|
||||
Reference in New Issue
Block a user