aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha/include/asm/string.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/alpha/include/asm/string.h')
-rw-r--r--arch/alpha/include/asm/string.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/arch/alpha/include/asm/string.h b/arch/alpha/include/asm/string.h
index b02b8a282940..c2911f591704 100644
--- a/arch/alpha/include/asm/string.h
+++ b/arch/alpha/include/asm/string.h
@@ -22,15 +22,27 @@ extern void * __memcpy(void *, const void *, size_t);
22 22
23#define __HAVE_ARCH_MEMSET 23#define __HAVE_ARCH_MEMSET
24extern void * __constant_c_memset(void *, unsigned long, size_t); 24extern void * __constant_c_memset(void *, unsigned long, size_t);
25extern void * ___memset(void *, int, size_t);
25extern void * __memset(void *, int, size_t); 26extern void * __memset(void *, int, size_t);
26extern void * memset(void *, int, size_t); 27extern void * memset(void *, int, size_t);
27 28
28#define memset(s, c, n) \ 29/* For gcc 3.x, we cannot have the inline function named "memset" because
29(__builtin_constant_p(c) \ 30 the __builtin_memset will attempt to resolve to the inline as well,
30 ? (__builtin_constant_p(n) && (c) == 0 \ 31 leading to a "sorry" about unimplemented recursive inlining. */
31 ? __builtin_memset((s),0,(n)) \ 32extern inline void *__memset(void *s, int c, size_t n)
32 : __constant_c_memset((s),0x0101010101010101UL*(unsigned char)(c),(n))) \ 33{
33 : __memset((s),(c),(n))) 34 if (__builtin_constant_p(c)) {
35 if (__builtin_constant_p(n)) {
36 return __builtin_memset(s, c, n);
37 } else {
38 unsigned long c8 = (c & 0xff) * 0x0101010101010101UL;
39 return __constant_c_memset(s, c8, n);
40 }
41 }
42 return ___memset(s, c, n);
43}
44
45#define memset __memset
34 46
35#define __HAVE_ARCH_STRCPY 47#define __HAVE_ARCH_STRCPY
36extern char * strcpy(char *,const char *); 48extern char * strcpy(char *,const char *);