blob: c6dfb254b5e4c61692215467b0da414d5bc81ce0 [file] [log] [blame]
wdenk81da3632002-08-15 09:39:42 +00001#ifndef __ASM_ARM_STRING_H
2#define __ASM_ARM_STRING_H
3
Matthias Weisserd8834a12011-03-10 21:36:32 +00004#include <config.h>
5
wdenk81da3632002-08-15 09:39:42 +00006/*
7 * We don't do inline string functions, since the
8 * optimised inline asm versions are not small.
9 */
10
wdenkb2184c32002-11-19 23:01:07 +000011#undef __HAVE_ARCH_STRRCHR
wdenk81da3632002-08-15 09:39:42 +000012extern char * strrchr(const char * s, int c);
13
wdenkb2184c32002-11-19 23:01:07 +000014#undef __HAVE_ARCH_STRCHR
wdenk81da3632002-08-15 09:39:42 +000015extern char * strchr(const char * s, int c);
16
Matthias Weisserd8834a12011-03-10 21:36:32 +000017#ifdef CONFIG_USE_ARCH_MEMCPY
18#define __HAVE_ARCH_MEMCPY
19#endif
wdenk81da3632002-08-15 09:39:42 +000020extern void * memcpy(void *, const void *, __kernel_size_t);
21
wdenkb2184c32002-11-19 23:01:07 +000022#undef __HAVE_ARCH_MEMMOVE
wdenk81da3632002-08-15 09:39:42 +000023extern void * memmove(void *, const void *, __kernel_size_t);
24
wdenkb2184c32002-11-19 23:01:07 +000025#undef __HAVE_ARCH_MEMCHR
wdenk81da3632002-08-15 09:39:42 +000026extern void * memchr(const void *, int, __kernel_size_t);
27
wdenkb2184c32002-11-19 23:01:07 +000028#undef __HAVE_ARCH_MEMZERO
Matthias Weisserd8834a12011-03-10 21:36:32 +000029#ifdef CONFIG_USE_ARCH_MEMSET
30#define __HAVE_ARCH_MEMSET
31#endif
wdenk81da3632002-08-15 09:39:42 +000032extern void * memset(void *, int, __kernel_size_t);
33
34#if 0
35extern void __memzero(void *ptr, __kernel_size_t n);
36
37#define memset(p,v,n) \
38 ({ \
39 if ((n) != 0) { \
40 if (__builtin_constant_p((v)) && (v) == 0) \
41 __memzero((p),(n)); \
42 else \
43 memset((p),(v),(n)); \
44 } \
45 (p); \
46 })
47
48#define memzero(p,n) ({ if ((n) != 0) __memzero((p),(n)); (p); })
49#else
50extern void memzero(void *ptr, __kernel_size_t n);
51#endif
52
53#endif