blob: c9ecdde0d3d8cabce0d9ad8a604f2d38c8bb9180 [file] [log] [blame]
wdenk81da3632002-08-15 09:39:42 +00001#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
wdenk67ff36c2002-11-19 23:01:07 +00009#undef __HAVE_ARCH_STRRCHR
wdenk81da3632002-08-15 09:39:42 +000010extern char * strrchr(const char * s, int c);
11
wdenk67ff36c2002-11-19 23:01:07 +000012#undef __HAVE_ARCH_STRCHR
wdenk81da3632002-08-15 09:39:42 +000013extern char * strchr(const char * s, int c);
14
Masahiro Yamadae55f1462016-12-19 19:31:02 +090015#if CONFIG_IS_ENABLED(USE_ARCH_MEMCPY)
Matthias Weisser93416c12011-03-10 21:36:32 +000016#define __HAVE_ARCH_MEMCPY
17#endif
wdenk81da3632002-08-15 09:39:42 +000018extern void * memcpy(void *, const void *, __kernel_size_t);
19
Stefan Roese330807f2021-09-02 17:00:19 +020020#if CONFIG_IS_ENABLED(USE_ARCH_MEMMOVE)
21#define __HAVE_ARCH_MEMMOVE
22#else
wdenk67ff36c2002-11-19 23:01:07 +000023#undef __HAVE_ARCH_MEMMOVE
Stefan Roese330807f2021-09-02 17:00:19 +020024#endif
wdenk81da3632002-08-15 09:39:42 +000025extern void * memmove(void *, const void *, __kernel_size_t);
26
wdenk67ff36c2002-11-19 23:01:07 +000027#undef __HAVE_ARCH_MEMCHR
wdenk81da3632002-08-15 09:39:42 +000028extern void * memchr(const void *, int, __kernel_size_t);
29
wdenk67ff36c2002-11-19 23:01:07 +000030#undef __HAVE_ARCH_MEMZERO
Masahiro Yamadae55f1462016-12-19 19:31:02 +090031#if CONFIG_IS_ENABLED(USE_ARCH_MEMSET)
Matthias Weisser93416c12011-03-10 21:36:32 +000032#define __HAVE_ARCH_MEMSET
33#endif
wdenk81da3632002-08-15 09:39:42 +000034extern void * memset(void *, int, __kernel_size_t);
35
36#if 0
37extern void __memzero(void *ptr, __kernel_size_t n);
38
39#define memset(p,v,n) \
40 ({ \
41 if ((n) != 0) { \
42 if (__builtin_constant_p((v)) && (v) == 0) \
43 __memzero((p),(n)); \
44 else \
45 memset((p),(v),(n)); \
46 } \
47 (p); \
48 })
49
50#define memzero(p,n) ({ if ((n) != 0) __memzero((p),(n)); (p); })
51#else
52extern void memzero(void *ptr, __kernel_size_t n);
53#endif
54
55#endif