diff options
author | David S. Miller <davem@davemloft.net> | 2009-12-11 02:32:10 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-11 02:32:10 -0500 |
commit | 4d14a459857bd151ecbd14bcd37b4628da00792b (patch) | |
tree | f713e8292ef84bfcc5ba4f3c7cd19aa4ce908bd5 /arch/sparc/include/asm/string_64.h | |
parent | fb34035e7b4bb3edc7c2dc0683cfe21f57a9574d (diff) |
sparc: Stop trying to be so fancy and use __builtin_{memcpy,memset}()
This mirrors commit ff60fab71bb3b4fdbf8caf57ff3739ffd0887396
(x86: Use __builtin_memset and __builtin_memcpy for memset/memcpy)
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/include/asm/string_64.h')
-rw-r--r-- | arch/sparc/include/asm/string_64.h | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/arch/sparc/include/asm/string_64.h b/arch/sparc/include/asm/string_64.h index 43161f2d17eb..9623bc213158 100644 --- a/arch/sparc/include/asm/string_64.h +++ b/arch/sparc/include/asm/string_64.h | |||
@@ -15,8 +15,6 @@ | |||
15 | 15 | ||
16 | #include <asm/asi.h> | 16 | #include <asm/asi.h> |
17 | 17 | ||
18 | extern void *__memset(void *,int,__kernel_size_t); | ||
19 | |||
20 | #ifndef EXPORT_SYMTAB_STROPS | 18 | #ifndef EXPORT_SYMTAB_STROPS |
21 | 19 | ||
22 | /* First the mem*() things. */ | 20 | /* First the mem*() things. */ |
@@ -24,29 +22,10 @@ extern void *__memset(void *,int,__kernel_size_t); | |||
24 | extern void *memmove(void *, const void *, __kernel_size_t); | 22 | extern void *memmove(void *, const void *, __kernel_size_t); |
25 | 23 | ||
26 | #define __HAVE_ARCH_MEMCPY | 24 | #define __HAVE_ARCH_MEMCPY |
27 | extern void *memcpy(void *, const void *, __kernel_size_t); | 25 | #define memcpy(t, f, n) __builtin_memcpy(t, f, n) |
28 | 26 | ||
29 | #define __HAVE_ARCH_MEMSET | 27 | #define __HAVE_ARCH_MEMSET |
30 | extern void *__builtin_memset(void *,int,__kernel_size_t); | 28 | #define memset(s, c, count) __builtin_memset(s, c, count) |
31 | |||
32 | static inline void *__constant_memset(void *s, int c, __kernel_size_t count) | ||
33 | { | ||
34 | extern __kernel_size_t __bzero(void *, __kernel_size_t); | ||
35 | |||
36 | if (!c) { | ||
37 | __bzero(s, count); | ||
38 | return s; | ||
39 | } else | ||
40 | return __memset(s, c, count); | ||
41 | } | ||
42 | |||
43 | #undef memset | ||
44 | #define memset(s, c, count) \ | ||
45 | ((__builtin_constant_p(count) && (count) <= 32) ? \ | ||
46 | __builtin_memset((s), (c), (count)) : \ | ||
47 | (__builtin_constant_p(c) ? \ | ||
48 | __constant_memset((s), (c), (count)) : \ | ||
49 | __memset((s), (c), (count)))) | ||
50 | 29 | ||
51 | #define __HAVE_ARCH_MEMSCAN | 30 | #define __HAVE_ARCH_MEMSCAN |
52 | 31 | ||