string.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef ___ASM_SPARC_STRING_H
  2. #define ___ASM_SPARC_STRING_H
  3. #if defined(__sparc__) && defined(__arch64__)
  4. #include <asm/string_64.h>
  5. #else
  6. #include <asm/string_32.h>
  7. #endif
  8. /* First the mem*() things. */
  9. #define __HAVE_ARCH_MEMMOVE
  10. void *memmove(void *, const void *, __kernel_size_t);
  11. #define __HAVE_ARCH_MEMCPY
  12. #define memcpy(t, f, n) __builtin_memcpy(t, f, n)
  13. #define __HAVE_ARCH_MEMSET
  14. #define memset(s, c, count) __builtin_memset(s, c, count)
  15. #define __HAVE_ARCH_MEMSCAN
  16. #define memscan(__arg0, __char, __arg2) \
  17. ({ \
  18. void *__memscan_zero(void *, size_t); \
  19. void *__memscan_generic(void *, int, size_t); \
  20. void *__retval, *__addr = (__arg0); \
  21. size_t __size = (__arg2); \
  22. \
  23. if(__builtin_constant_p(__char) && !(__char)) \
  24. __retval = __memscan_zero(__addr, __size); \
  25. else \
  26. __retval = __memscan_generic(__addr, (__char), __size); \
  27. \
  28. __retval; \
  29. })
  30. #define __HAVE_ARCH_MEMCMP
  31. int memcmp(const void *,const void *,__kernel_size_t);
  32. #define __HAVE_ARCH_STRNCMP
  33. int strncmp(const char *, const char *, __kernel_size_t);
  34. #endif