wdenk | 81da363 | 2002-08-15 09:39:42 +0000 | [diff] [blame] | 1 | #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 | |
wdenk | 67ff36c | 2002-11-19 23:01:07 +0000 | [diff] [blame] | 9 | #undef __HAVE_ARCH_STRRCHR |
wdenk | 81da363 | 2002-08-15 09:39:42 +0000 | [diff] [blame] | 10 | extern char * strrchr(const char * s, int c); |
| 11 | |
wdenk | 67ff36c | 2002-11-19 23:01:07 +0000 | [diff] [blame] | 12 | #undef __HAVE_ARCH_STRCHR |
wdenk | 81da363 | 2002-08-15 09:39:42 +0000 | [diff] [blame] | 13 | extern char * strchr(const char * s, int c); |
| 14 | |
Masahiro Yamada | e55f146 | 2016-12-19 19:31:02 +0900 | [diff] [blame] | 15 | #if CONFIG_IS_ENABLED(USE_ARCH_MEMCPY) |
Matthias Weisser | 93416c1 | 2011-03-10 21:36:32 +0000 | [diff] [blame] | 16 | #define __HAVE_ARCH_MEMCPY |
| 17 | #endif |
wdenk | 81da363 | 2002-08-15 09:39:42 +0000 | [diff] [blame] | 18 | extern void * memcpy(void *, const void *, __kernel_size_t); |
| 19 | |
Stefan Roese | 330807f | 2021-09-02 17:00:19 +0200 | [diff] [blame] | 20 | #if CONFIG_IS_ENABLED(USE_ARCH_MEMMOVE) |
| 21 | #define __HAVE_ARCH_MEMMOVE |
| 22 | #else |
wdenk | 67ff36c | 2002-11-19 23:01:07 +0000 | [diff] [blame] | 23 | #undef __HAVE_ARCH_MEMMOVE |
Stefan Roese | 330807f | 2021-09-02 17:00:19 +0200 | [diff] [blame] | 24 | #endif |
wdenk | 81da363 | 2002-08-15 09:39:42 +0000 | [diff] [blame] | 25 | extern void * memmove(void *, const void *, __kernel_size_t); |
| 26 | |
wdenk | 67ff36c | 2002-11-19 23:01:07 +0000 | [diff] [blame] | 27 | #undef __HAVE_ARCH_MEMCHR |
wdenk | 81da363 | 2002-08-15 09:39:42 +0000 | [diff] [blame] | 28 | extern void * memchr(const void *, int, __kernel_size_t); |
| 29 | |
wdenk | 67ff36c | 2002-11-19 23:01:07 +0000 | [diff] [blame] | 30 | #undef __HAVE_ARCH_MEMZERO |
Masahiro Yamada | e55f146 | 2016-12-19 19:31:02 +0900 | [diff] [blame] | 31 | #if CONFIG_IS_ENABLED(USE_ARCH_MEMSET) |
Matthias Weisser | 93416c1 | 2011-03-10 21:36:32 +0000 | [diff] [blame] | 32 | #define __HAVE_ARCH_MEMSET |
| 33 | #endif |
wdenk | 81da363 | 2002-08-15 09:39:42 +0000 | [diff] [blame] | 34 | extern void * memset(void *, int, __kernel_size_t); |
| 35 | |
| 36 | #if 0 |
| 37 | extern 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 |
| 52 | extern void memzero(void *ptr, __kernel_size_t n); |
| 53 | #endif |
| 54 | |
| 55 | #endif |