summaryrefslogtreecommitdiffstats
path: root/include/asm-arm/string.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-arm/string.h')
-rw-r--r--include/asm-arm/string.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/include/asm-arm/string.h b/include/asm-arm/string.h
index 9c72b0173..5d631341e 100644
--- a/include/asm-arm/string.h
+++ b/include/asm-arm/string.h
@@ -2,7 +2,8 @@
#define __ASM_ARM_STRING_H
/*
- * inline versions, hmm...
+ * We don't do inline string functions, since the
+ * optimised inline asm versions are not small.
*/
#define __HAVE_ARCH_STRRCHR
@@ -13,13 +14,25 @@ extern char * strchr(const char * s, int c);
#define __HAVE_ARCH_MEMCPY
#define __HAVE_ARCH_MEMMOVE
-#define __HAVE_ARCH_MEMSET
#define __HAVE_ARCH_MEMCHR
-
#define __HAVE_ARCH_MEMZERO
-extern void memzero(void *ptr, int n);
+#define __HAVE_ARCH_MEMSET
+
+extern void __memzero(void *ptr, __kernel_size_t n);
+extern void __memset(void *ptr, int v, __kernel_size_t n);
+
+#define memset(p,v,n) \
+ ({ \
+ if ((n) != 0) { \
+ if (__builtin_constant_p((v)) && (v) == 0) \
+ __memzero((p),(n)); \
+ else \
+ __memset((p),(v),(n)); \
+ } \
+ (p); \
+ })
-extern void memsetl (unsigned long *, unsigned long, int n);
+#define memzero(p,n) ({ if ((n) != 0) __memzero((p),(n)); (p); })
#endif