blob: cf4f3aad0fc1c2154c6cf3839ff21bb1c46d6499 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __ASM_ARM_STRING_H
2#define __ASM_ARM_STRING_H
3
4/*
5 * We don't do inline string functions, since the
6 * optimised inline asm versions are not small.
7 */
8
9#define __HAVE_ARCH_STRRCHR
10extern char * strrchr(const char * s, int c);
11
12#define __HAVE_ARCH_STRCHR
13extern char * strchr(const char * s, int c);
14
15#define __HAVE_ARCH_MEMCPY
16extern void * memcpy(void *, const void *, __kernel_size_t);
17
18#define __HAVE_ARCH_MEMMOVE
19extern void * memmove(void *, const void *, __kernel_size_t);
20
21#define __HAVE_ARCH_MEMCHR
22extern void * memchr(const void *, int, __kernel_size_t);
23
Linus Torvalds1da177e2005-04-16 15:20:36 -070024#define __HAVE_ARCH_MEMSET
25extern void * memset(void *, int, __kernel_size_t);
26
27extern void __memzero(void *ptr, __kernel_size_t n);
28
29#define memset(p,v,n) \
30 ({ \
Deepak Saxena2fac6f32005-04-25 23:40:05 +010031 void *__p = (p); size_t __n = n; \
32 if ((__n) != 0) { \
Linus Torvalds1da177e2005-04-16 15:20:36 -070033 if (__builtin_constant_p((v)) && (v) == 0) \
Deepak Saxena2fac6f32005-04-25 23:40:05 +010034 __memzero((__p),(__n)); \
Linus Torvalds1da177e2005-04-16 15:20:36 -070035 else \
Deepak Saxena2fac6f32005-04-25 23:40:05 +010036 memset((__p),(v),(__n)); \
Linus Torvalds1da177e2005-04-16 15:20:36 -070037 } \
Deepak Saxena2fac6f32005-04-25 23:40:05 +010038 (__p); \
Linus Torvalds1da177e2005-04-16 15:20:36 -070039 })
40
Linus Torvalds1da177e2005-04-16 15:20:36 -070041#endif