wdenk | 81da363 | 2002-08-15 09:39:42 +0000 | [diff] [blame] | 1 | #ifndef __ASM_ARM_STRING_H |
| 2 | #define __ASM_ARM_STRING_H |
| 3 | |
Matthias Weisser | 93416c1 | 2011-03-10 21:36:32 +0000 | [diff] [blame] | 4 | #include <config.h> |
| 5 | |
wdenk | 81da363 | 2002-08-15 09:39:42 +0000 | [diff] [blame] | 6 | /* |
| 7 | * We don't do inline string functions, since the |
| 8 | * optimised inline asm versions are not small. |
| 9 | */ |
| 10 | |
wdenk | 67ff36c | 2002-11-19 23:01:07 +0000 | [diff] [blame] | 11 | #undef __HAVE_ARCH_STRRCHR |
wdenk | 81da363 | 2002-08-15 09:39:42 +0000 | [diff] [blame] | 12 | extern char * strrchr(const char * s, int c); |
| 13 | |
wdenk | 67ff36c | 2002-11-19 23:01:07 +0000 | [diff] [blame] | 14 | #undef __HAVE_ARCH_STRCHR |
wdenk | 81da363 | 2002-08-15 09:39:42 +0000 | [diff] [blame] | 15 | extern char * strchr(const char * s, int c); |
| 16 | |
Masahiro Yamada | e55f146 | 2016-12-19 19:31:02 +0900 | [diff] [blame] | 17 | #if CONFIG_IS_ENABLED(USE_ARCH_MEMCPY) |
Matthias Weisser | 93416c1 | 2011-03-10 21:36:32 +0000 | [diff] [blame] | 18 | #define __HAVE_ARCH_MEMCPY |
| 19 | #endif |
wdenk | 81da363 | 2002-08-15 09:39:42 +0000 | [diff] [blame] | 20 | extern void * memcpy(void *, const void *, __kernel_size_t); |
| 21 | |
Stefan Roese | 330807f | 2021-09-02 17:00:19 +0200 | [diff] [blame] | 22 | #if CONFIG_IS_ENABLED(USE_ARCH_MEMMOVE) |
| 23 | #define __HAVE_ARCH_MEMMOVE |
| 24 | #else |
wdenk | 67ff36c | 2002-11-19 23:01:07 +0000 | [diff] [blame] | 25 | #undef __HAVE_ARCH_MEMMOVE |
Stefan Roese | 330807f | 2021-09-02 17:00:19 +0200 | [diff] [blame] | 26 | #endif |
wdenk | 81da363 | 2002-08-15 09:39:42 +0000 | [diff] [blame] | 27 | extern void * memmove(void *, const void *, __kernel_size_t); |
| 28 | |
wdenk | 67ff36c | 2002-11-19 23:01:07 +0000 | [diff] [blame] | 29 | #undef __HAVE_ARCH_MEMCHR |
wdenk | 81da363 | 2002-08-15 09:39:42 +0000 | [diff] [blame] | 30 | extern void * memchr(const void *, int, __kernel_size_t); |
| 31 | |
wdenk | 67ff36c | 2002-11-19 23:01:07 +0000 | [diff] [blame] | 32 | #undef __HAVE_ARCH_MEMZERO |
Masahiro Yamada | e55f146 | 2016-12-19 19:31:02 +0900 | [diff] [blame] | 33 | #if CONFIG_IS_ENABLED(USE_ARCH_MEMSET) |
Matthias Weisser | 93416c1 | 2011-03-10 21:36:32 +0000 | [diff] [blame] | 34 | #define __HAVE_ARCH_MEMSET |
| 35 | #endif |
wdenk | 81da363 | 2002-08-15 09:39:42 +0000 | [diff] [blame] | 36 | extern void * memset(void *, int, __kernel_size_t); |
| 37 | |
| 38 | #if 0 |
| 39 | extern 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 |
| 54 | extern void memzero(void *ptr, __kernel_size_t n); |
| 55 | #endif |
| 56 | |
| 57 | #endif |