aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/include/asm/string_64.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/include/asm/string_64.h')
-rw-r--r--arch/sparc/include/asm/string_64.h25
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
18extern 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);
24extern void *memmove(void *, const void *, __kernel_size_t); 22extern void *memmove(void *, const void *, __kernel_size_t);
25 23
26#define __HAVE_ARCH_MEMCPY 24#define __HAVE_ARCH_MEMCPY
27extern 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
30extern void *__builtin_memset(void *,int,__kernel_size_t); 28#define memset(s, c, count) __builtin_memset(s, c, count)
31
32static 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