blob: ead3f2c356438e70f69c9f7b5cdf13077ede532f [file] [log] [blame]
wdenk81da3632002-08-15 09:39:42 +00001#ifndef __ASM_ARM_STRING_H
2#define __ASM_ARM_STRING_H
3
Matthias Weisser93416c12011-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
wdenk67ff36c2002-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
wdenk67ff36c2002-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
Masahiro Yamadae55f1462016-12-19 19:31:02 +090017#if CONFIG_IS_ENABLED(USE_ARCH_MEMCPY)
Matthias Weisser93416c12011-03-10 21:36:32 +000018#define __HAVE_ARCH_MEMCPY
19#endif
wdenk81da3632002-08-15 09:39:42 +000020extern void * memcpy(void *, const void *, __kernel_size_t);
21
Stefan Roese330807f2021-09-02 17:00:19 +020022#if CONFIG_IS_ENABLED(USE_ARCH_MEMMOVE)
23#define __HAVE_ARCH_MEMMOVE
24#else
wdenk67ff36c2002-11-19 23:01:07 +000025#undef __HAVE_ARCH_MEMMOVE
Stefan Roese330807f2021-09-02 17:00:19 +020026#endif
wdenk81da3632002-08-15 09:39:42 +000027extern void * memmove(void *, const void *, __kernel_size_t);
28
wdenk67ff36c2002-11-19 23:01:07 +000029#undef __HAVE_ARCH_MEMCHR
wdenk81da3632002-08-15 09:39:42 +000030extern void * memchr(const void *, int, __kernel_size_t);
31
wdenk67ff36c2002-11-19 23:01:07 +000032#undef __HAVE_ARCH_MEMZERO
Masahiro Yamadae55f1462016-12-19 19:31:02 +090033#if CONFIG_IS_ENABLED(USE_ARCH_MEMSET)
Matthias Weisser93416c12011-03-10 21:36:32 +000034#define __HAVE_ARCH_MEMSET
35#endif
wdenk81da3632002-08-15 09:39:42 +000036extern void * memset(void *, int, __kernel_size_t);
37
38#if 0
39extern void __memzero(void *ptr, __kernel_size_t n);
40
41#define memset(p,v,n) \
42 ({ \
43 if ((n) != 0) { \
44 if (__builtin_constant_p((v)) && (v) == 0) \
45 __memzero((p),(n)); \
46 else \
47 memset((p),(v),(n)); \
48 } \
49 (p); \
50 })
51
52#define memzero(p,n) ({ if ((n) != 0) __memzero((p),(n)); (p); })
53#else
54extern void memzero(void *ptr, __kernel_size_t n);
55#endif
56
57#endif