diff options
| -rw-r--r-- | arch/x86/include/asm/bitops.h | 6 | ||||
| -rw-r--r-- | arch/x86/include/asm/string_32.h | 20 | ||||
| -rw-r--r-- | arch/x86/include/asm/string_64.h | 15 |
3 files changed, 0 insertions, 41 deletions
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h index ad7b210aa3f6..d153d570bb04 100644 --- a/arch/x86/include/asm/bitops.h +++ b/arch/x86/include/asm/bitops.h | |||
| @@ -36,13 +36,7 @@ | |||
| 36 | * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1). | 36 | * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1). |
| 37 | */ | 37 | */ |
| 38 | 38 | ||
| 39 | #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 1) | ||
| 40 | /* Technically wrong, but this avoids compilation errors on some gcc | ||
| 41 | versions. */ | ||
| 42 | #define BITOP_ADDR(x) "=m" (*(volatile long *) (x)) | ||
| 43 | #else | ||
| 44 | #define BITOP_ADDR(x) "+m" (*(volatile long *) (x)) | 39 | #define BITOP_ADDR(x) "+m" (*(volatile long *) (x)) |
| 45 | #endif | ||
| 46 | 40 | ||
| 47 | #define ADDR BITOP_ADDR(addr) | 41 | #define ADDR BITOP_ADDR(addr) |
| 48 | 42 | ||
diff --git a/arch/x86/include/asm/string_32.h b/arch/x86/include/asm/string_32.h index 55d392c6bd29..2fd165f1cffa 100644 --- a/arch/x86/include/asm/string_32.h +++ b/arch/x86/include/asm/string_32.h | |||
| @@ -179,14 +179,7 @@ static inline void *__memcpy3d(void *to, const void *from, size_t len) | |||
| 179 | * No 3D Now! | 179 | * No 3D Now! |
| 180 | */ | 180 | */ |
| 181 | 181 | ||
| 182 | #if (__GNUC__ >= 4) | ||
| 183 | #define memcpy(t, f, n) __builtin_memcpy(t, f, n) | 182 | #define memcpy(t, f, n) __builtin_memcpy(t, f, n) |
| 184 | #else | ||
| 185 | #define memcpy(t, f, n) \ | ||
| 186 | (__builtin_constant_p((n)) \ | ||
| 187 | ? __constant_memcpy((t), (f), (n)) \ | ||
| 188 | : __memcpy((t), (f), (n))) | ||
| 189 | #endif | ||
| 190 | 183 | ||
| 191 | #endif | 184 | #endif |
| 192 | #endif /* !CONFIG_FORTIFY_SOURCE */ | 185 | #endif /* !CONFIG_FORTIFY_SOURCE */ |
| @@ -282,12 +275,7 @@ void *__constant_c_and_count_memset(void *s, unsigned long pattern, | |||
| 282 | 275 | ||
| 283 | { | 276 | { |
| 284 | int d0, d1; | 277 | int d0, d1; |
| 285 | #if __GNUC__ == 4 && __GNUC_MINOR__ == 0 | ||
| 286 | /* Workaround for broken gcc 4.0 */ | ||
| 287 | register unsigned long eax asm("%eax") = pattern; | ||
| 288 | #else | ||
| 289 | unsigned long eax = pattern; | 278 | unsigned long eax = pattern; |
| 290 | #endif | ||
| 291 | 279 | ||
| 292 | switch (count % 4) { | 280 | switch (count % 4) { |
| 293 | case 0: | 281 | case 0: |
| @@ -321,15 +309,7 @@ void *__constant_c_and_count_memset(void *s, unsigned long pattern, | |||
| 321 | #define __HAVE_ARCH_MEMSET | 309 | #define __HAVE_ARCH_MEMSET |
| 322 | extern void *memset(void *, int, size_t); | 310 | extern void *memset(void *, int, size_t); |
| 323 | #ifndef CONFIG_FORTIFY_SOURCE | 311 | #ifndef CONFIG_FORTIFY_SOURCE |
| 324 | #if (__GNUC__ >= 4) | ||
| 325 | #define memset(s, c, count) __builtin_memset(s, c, count) | 312 | #define memset(s, c, count) __builtin_memset(s, c, count) |
| 326 | #else | ||
| 327 | #define memset(s, c, count) \ | ||
| 328 | (__builtin_constant_p(c) \ | ||
| 329 | ? __constant_c_x_memset((s), (0x01010101UL * (unsigned char)(c)), \ | ||
| 330 | (count)) \ | ||
| 331 | : __memset((s), (c), (count))) | ||
| 332 | #endif | ||
| 333 | #endif /* !CONFIG_FORTIFY_SOURCE */ | 313 | #endif /* !CONFIG_FORTIFY_SOURCE */ |
| 334 | 314 | ||
| 335 | #define __HAVE_ARCH_MEMSET16 | 315 | #define __HAVE_ARCH_MEMSET16 |
diff --git a/arch/x86/include/asm/string_64.h b/arch/x86/include/asm/string_64.h index 4e4194e21a09..75314c3dbe47 100644 --- a/arch/x86/include/asm/string_64.h +++ b/arch/x86/include/asm/string_64.h | |||
| @@ -14,21 +14,6 @@ | |||
| 14 | extern void *memcpy(void *to, const void *from, size_t len); | 14 | extern void *memcpy(void *to, const void *from, size_t len); |
| 15 | extern void *__memcpy(void *to, const void *from, size_t len); | 15 | extern void *__memcpy(void *to, const void *from, size_t len); |
| 16 | 16 | ||
| 17 | #ifndef CONFIG_FORTIFY_SOURCE | ||
| 18 | #if (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || __GNUC__ < 4 | ||
| 19 | #define memcpy(dst, src, len) \ | ||
| 20 | ({ \ | ||
| 21 | size_t __len = (len); \ | ||
| 22 | void *__ret; \ | ||
| 23 | if (__builtin_constant_p(len) && __len >= 64) \ | ||
| 24 | __ret = __memcpy((dst), (src), __len); \ | ||
| 25 | else \ | ||
| 26 | __ret = __builtin_memcpy((dst), (src), __len); \ | ||
| 27 | __ret; \ | ||
| 28 | }) | ||
| 29 | #endif | ||
| 30 | #endif /* !CONFIG_FORTIFY_SOURCE */ | ||
| 31 | |||
| 32 | #define __HAVE_ARCH_MEMSET | 17 | #define __HAVE_ARCH_MEMSET |
| 33 | void *memset(void *s, int c, size_t n); | 18 | void *memset(void *s, int c, size_t n); |
| 34 | void *__memset(void *s, int c, size_t n); | 19 | void *__memset(void *s, int c, size_t n); |
