string.h 986 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef __ASM_ARM_STRING_H
  2. #define __ASM_ARM_STRING_H
  3. /*
  4. * We don't do inline string functions, since the
  5. * optimised inline asm versions are not small.
  6. */
  7. #define __HAVE_ARCH_STRRCHR
  8. extern char * strrchr(const char * s, int c);
  9. #define __HAVE_ARCH_STRCHR
  10. extern char * strchr(const char * s, int c);
  11. #define __HAVE_ARCH_MEMCPY
  12. extern void * memcpy(void *, const void *, __kernel_size_t);
  13. #define __HAVE_ARCH_MEMMOVE
  14. extern void * memmove(void *, const void *, __kernel_size_t);
  15. #define __HAVE_ARCH_MEMCHR
  16. extern void * memchr(const void *, int, __kernel_size_t);
  17. #define __HAVE_ARCH_MEMSET
  18. extern void * memset(void *, int, __kernel_size_t);
  19. extern void __memzero(void *ptr, __kernel_size_t n);
  20. #define memset(p,v,n) \
  21. ({ \
  22. void *__p = (p); size_t __n = n; \
  23. if ((__n) != 0) { \
  24. if (__builtin_constant_p((v)) && (v) == 0) \
  25. __memzero((__p),(__n)); \
  26. else \
  27. memset((__p),(v),(__n)); \
  28. } \
  29. (__p); \
  30. })
  31. #endif