1 #ifndef __ARM_STRING_H__ 2 #define __ARM_STRING_H__ 3 4 5 /* 6 * We don't do inline string functions, since the 7 * optimised inline asm versions are not small. 8 */ 9 10 #define __HAVE_ARCH_STRRCHR 11 char *strrchr(const char *s, int c); 12 13 #define __HAVE_ARCH_STRCHR 14 char *strchr(const char *s, int c); 15 16 #if defined(CONFIG_ARM_64) 17 #define __HAVE_ARCH_STRCMP 18 int strcmp(const char *, const char *); 19 20 #define __HAVE_ARCH_STRNCMP 21 int strncmp(const char *, const char *, size_t); 22 23 #define __HAVE_ARCH_STRLEN 24 size_t strlen(const char *); 25 26 #define __HAVE_ARCH_STRNLEN 27 size_t strnlen(const char *, size_t); 28 #endif 29 30 #define __HAVE_ARCH_MEMCPY 31 void *memcpy(void *, const void *, size_t); 32 33 #if defined(CONFIG_ARM_64) 34 #define __HAVE_ARCH_MEMCMP 35 int memcmp(const void *, const void *, size_t); 36 #endif 37 38 #define __HAVE_ARCH_MEMMOVE 39 void *memmove(void *dest, const void *src, size_t n); 40 41 #define __HAVE_ARCH_MEMSET 42 void *memset(void *, int, size_t); 43 44 #define __HAVE_ARCH_MEMCHR 45 void *memchr(const void *, int, size_t); 46 47 #if defined(CONFIG_ARM_32) 48 49 void __memzero(void *ptr, size_t n); 50 51 #define memset(p, v, n) \ 52 ({ \ 53 void *__p = (p); size_t __n = n; \ 54 if ((__n) != 0) { \ 55 if (__builtin_constant_p((v)) && (v) == 0) \ 56 __memzero((__p),(__n)); \ 57 else \ 58 memset((__p),(v),(__n)); \ 59 } \ 60 (__p); \ 61 }) 62 63 #endif 64 65 #endif /* __ARM_STRING_H__ */ 66 /* 67 * Local variables: 68 * mode: C 69 * c-file-style: "BSD" 70 * c-basic-offset: 4 71 * indent-tabs-mode: nil 72 * End: 73 */ 74