string.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * U-boot - string.h String functions
  3. *
  4. * Copyright (c) 2005 blackfin.uclinux.org
  5. *
  6. * See file CREDITS for list of people who contributed to this
  7. * project.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of
  12. * the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  22. * MA 02111-1307 USA
  23. */
  24. /* Changed by Lineo Inc. May 2001 */
  25. #ifndef _BLACKFINNOMMU_STRING_H_
  26. #define _BLACKFINNOMMU_STRING_H_
  27. #ifdef __KERNEL__ /* only set these up for kernel code */
  28. #include <asm/setup.h>
  29. #include <asm/page.h>
  30. #include <config.h>
  31. #include <asm/blackfin.h>
  32. #define __HAVE_ARCH_STRCPY
  33. #define __HAVE_ARCH_STRNCPY
  34. #define __HAVE_ARCH_STRCMP
  35. #define __HAVE_ARCH_STRNCMP
  36. #define __HAVE_ARCH_MEMCPY
  37. #define __HAVE_ARCH_MEMCMP
  38. #define __HAVE_ARCH_MEMSET
  39. #define __HAVE_ARCH_MEMMOVE
  40. extern char *strcpy(char *dest, const char *src);
  41. extern char *strncpy(char *dest, const char *src, size_t n);
  42. extern int strcmp(const char *cs, const char *ct);
  43. extern int strncmp(const char *cs, const char *ct, size_t count);
  44. extern void *memcpy(void *dest, const void *src, size_t count);
  45. extern void *memset(void *s, int c, size_t count);
  46. extern int memcmp(const void *, const void *, __kernel_size_t);
  47. extern void *memmove(void *dest, const void *src, size_t count);
  48. #else /* KERNEL */
  49. /*
  50. * let user libraries deal with these,
  51. * IMHO the kernel has no place defining these functions for user apps
  52. */
  53. #define __HAVE_ARCH_STRCPY 1
  54. #define __HAVE_ARCH_STRNCPY 1
  55. #define __HAVE_ARCH_STRCAT 1
  56. #define __HAVE_ARCH_STRNCAT 1
  57. #define __HAVE_ARCH_STRCMP 1
  58. #define __HAVE_ARCH_STRNCMP 1
  59. #define __HAVE_ARCH_STRNICMP 1
  60. #define __HAVE_ARCH_STRCHR 1
  61. #define __HAVE_ARCH_STRRCHR 1
  62. #define __HAVE_ARCH_STRSTR 1
  63. #define __HAVE_ARCH_STRLEN 1
  64. #define __HAVE_ARCH_STRNLEN 1
  65. #define __HAVE_ARCH_MEMSET 1
  66. #define __HAVE_ARCH_MEMCPY 1
  67. #define __HAVE_ARCH_MEMMOVE 1
  68. #define __HAVE_ARCH_MEMSCAN 1
  69. #define __HAVE_ARCH_MEMCMP 1
  70. #define __HAVE_ARCH_MEMCHR 1
  71. #define __HAVE_ARCH_STRTOK 1
  72. #endif /* KERNEL */
  73. #endif /* _BLACKFIN_STRING_H_ */