PageRenderTime 46ms CodeModel.GetById 39ms RepoModel.GetById 0ms app.codeStats 0ms

/arch/sparc/include/asm/string_64.h

https://bitbucket.org/cresqo/cm7-p500-kernel
C Header | 62 lines | 36 code | 16 blank | 10 comment | 2 complexity | 35d379a0abdffef84e89e0004fe90d3b MD5 | raw file
Possible License(s): LGPL-2.0, AGPL-1.0, GPL-2.0
  1. /*
  2. * string.h: External definitions for optimized assembly string
  3. * routines for the Linux Kernel.
  4. *
  5. * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu)
  6. * Copyright (C) 1996,1997,1999 Jakub Jelinek (jakub@redhat.com)
  7. */
  8. #ifndef __SPARC64_STRING_H__
  9. #define __SPARC64_STRING_H__
  10. /* Really, userland/ksyms should not see any of this stuff. */
  11. #ifdef __KERNEL__
  12. #include <asm/asi.h>
  13. #ifndef EXPORT_SYMTAB_STROPS
  14. /* First the mem*() things. */
  15. #define __HAVE_ARCH_MEMMOVE
  16. extern void *memmove(void *, const void *, __kernel_size_t);
  17. #define __HAVE_ARCH_MEMCPY
  18. #define memcpy(t, f, n) __builtin_memcpy(t, f, n)
  19. #define __HAVE_ARCH_MEMSET
  20. #define memset(s, c, count) __builtin_memset(s, c, count)
  21. #define __HAVE_ARCH_MEMSCAN
  22. #undef memscan
  23. #define memscan(__arg0, __char, __arg2) \
  24. ({ \
  25. extern void *__memscan_zero(void *, size_t); \
  26. extern void *__memscan_generic(void *, int, size_t); \
  27. void *__retval, *__addr = (__arg0); \
  28. size_t __size = (__arg2); \
  29. \
  30. if(__builtin_constant_p(__char) && !(__char)) \
  31. __retval = __memscan_zero(__addr, __size); \
  32. else \
  33. __retval = __memscan_generic(__addr, (__char), __size); \
  34. \
  35. __retval; \
  36. })
  37. #define __HAVE_ARCH_MEMCMP
  38. extern int memcmp(const void *,const void *,__kernel_size_t);
  39. /* Now the str*() stuff... */
  40. #define __HAVE_ARCH_STRLEN
  41. extern __kernel_size_t strlen(const char *);
  42. #define __HAVE_ARCH_STRNCMP
  43. extern int strncmp(const char *, const char *, __kernel_size_t);
  44. #endif /* !EXPORT_SYMTAB_STROPS */
  45. #endif /* __KERNEL__ */
  46. #endif /* !(__SPARC64_STRING_H__) */