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 | |
wdenk | 67ff36c | 2002-11-19 23:01:07 +0000 | [diff] [blame] | 22 | #undef __HAVE_ARCH_MEMMOVE |
wdenk | 81da363 | 2002-08-15 09:39:42 +0000 | [diff] [blame] | 23 | extern void * memmove(void *, const void *, __kernel_size_t); |
| 24 | |
wdenk | 67ff36c | 2002-11-19 23:01:07 +0000 | [diff] [blame] | 25 | #undef __HAVE_ARCH_MEMCHR |
wdenk | 81da363 | 2002-08-15 09:39:42 +0000 | [diff] [blame] | 26 | extern void * memchr(const void *, int, __kernel_size_t); |
| 27 | |
wdenk | 67ff36c | 2002-11-19 23:01:07 +0000 | [diff] [blame] | 28 | #undef __HAVE_ARCH_MEMZERO |
Masahiro Yamada | e55f146 | 2016-12-19 19:31:02 +0900 | [diff] [blame] | 29 | #if CONFIG_IS_ENABLED(USE_ARCH_MEMSET) |
Matthias Weisser | 93416c1 | 2011-03-10 21:36:32 +0000 | [diff] [blame] | 30 | #define __HAVE_ARCH_MEMSET |
| 31 | #endif |
wdenk | 81da363 | 2002-08-15 09:39:42 +0000 | [diff] [blame] | 32 | extern void * memset(void *, int, __kernel_size_t); |
| 33 | |
| 34 | #if 0 |
| 35 | extern 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 |
| 50 | extern void memzero(void *ptr, __kernel_size_t n); |
| 51 | #endif |
| 52 | |
| 53 | #endif |