Wolfgang Denk | 97caf67 | 2006-03-12 02:12:27 +0100 | [diff] [blame] | 1 | /* |
| 2 | * U-boot - string.h String functions |
| 3 | * |
Aubrey Li | 314d22f | 2007-04-05 18:31:18 +0800 | [diff] [blame^] | 4 | * Copyright (c) 2005-2007 Analog Devices Inc. |
Wolfgang Denk | 97caf67 | 2006-03-12 02:12:27 +0100 | [diff] [blame] | 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 |
Aubrey Li | 314d22f | 2007-04-05 18:31:18 +0800 | [diff] [blame^] | 21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, |
| 22 | * MA 02110-1301 USA |
Wolfgang Denk | 97caf67 | 2006-03-12 02:12:27 +0100 | [diff] [blame] | 23 | */ |
| 24 | |
| 25 | /* Changed by Lineo Inc. May 2001 */ |
| 26 | |
| 27 | #ifndef _BLACKFINNOMMU_STRING_H_ |
| 28 | #define _BLACKFINNOMMU_STRING_H_ |
| 29 | |
| 30 | #ifdef __KERNEL__ /* only set these up for kernel code */ |
| 31 | |
| 32 | #include <asm/setup.h> |
Aubrey.Li | 9da597f | 2007-03-09 13:38:44 +0800 | [diff] [blame] | 33 | #include <config.h> |
| 34 | #include <asm/blackfin.h> |
Wolfgang Denk | 97caf67 | 2006-03-12 02:12:27 +0100 | [diff] [blame] | 35 | |
| 36 | #define __HAVE_ARCH_STRCPY |
| 37 | #define __HAVE_ARCH_STRNCPY |
| 38 | #define __HAVE_ARCH_STRCMP |
| 39 | #define __HAVE_ARCH_STRNCMP |
| 40 | #define __HAVE_ARCH_MEMCPY |
Aubrey.Li | 9da597f | 2007-03-09 13:38:44 +0800 | [diff] [blame] | 41 | #define __HAVE_ARCH_MEMCMP |
| 42 | #define __HAVE_ARCH_MEMSET |
| 43 | #define __HAVE_ARCH_MEMMOVE |
Wolfgang Denk | 97caf67 | 2006-03-12 02:12:27 +0100 | [diff] [blame] | 44 | |
| 45 | extern char *strcpy(char *dest, const char *src); |
| 46 | extern char *strncpy(char *dest, const char *src, size_t n); |
| 47 | extern int strcmp(const char *cs, const char *ct); |
| 48 | extern int strncmp(const char *cs, const char *ct, size_t count); |
Aubrey.Li | 9da597f | 2007-03-09 13:38:44 +0800 | [diff] [blame] | 49 | extern void *memcpy(void *dest, const void *src, size_t count); |
Wolfgang Denk | 97caf67 | 2006-03-12 02:12:27 +0100 | [diff] [blame] | 50 | extern void *memset(void *s, int c, size_t count); |
| 51 | extern int memcmp(const void *, const void *, __kernel_size_t); |
Aubrey.Li | 9da597f | 2007-03-09 13:38:44 +0800 | [diff] [blame] | 52 | extern void *memmove(void *dest, const void *src, size_t count); |
Wolfgang Denk | 97caf67 | 2006-03-12 02:12:27 +0100 | [diff] [blame] | 53 | |
| 54 | #else /* KERNEL */ |
| 55 | |
| 56 | /* |
| 57 | * let user libraries deal with these, |
| 58 | * IMHO the kernel has no place defining these functions for user apps |
| 59 | */ |
| 60 | |
| 61 | #define __HAVE_ARCH_STRCPY 1 |
| 62 | #define __HAVE_ARCH_STRNCPY 1 |
| 63 | #define __HAVE_ARCH_STRCAT 1 |
| 64 | #define __HAVE_ARCH_STRNCAT 1 |
| 65 | #define __HAVE_ARCH_STRCMP 1 |
| 66 | #define __HAVE_ARCH_STRNCMP 1 |
| 67 | #define __HAVE_ARCH_STRNICMP 1 |
| 68 | #define __HAVE_ARCH_STRCHR 1 |
| 69 | #define __HAVE_ARCH_STRRCHR 1 |
| 70 | #define __HAVE_ARCH_STRSTR 1 |
| 71 | #define __HAVE_ARCH_STRLEN 1 |
| 72 | #define __HAVE_ARCH_STRNLEN 1 |
| 73 | #define __HAVE_ARCH_MEMSET 1 |
| 74 | #define __HAVE_ARCH_MEMCPY 1 |
| 75 | #define __HAVE_ARCH_MEMMOVE 1 |
| 76 | #define __HAVE_ARCH_MEMSCAN 1 |
| 77 | #define __HAVE_ARCH_MEMCMP 1 |
| 78 | #define __HAVE_ARCH_MEMCHR 1 |
| 79 | #define __HAVE_ARCH_STRTOK 1 |
| 80 | |
| 81 | #endif /* KERNEL */ |
| 82 | |
| 83 | #endif /* _BLACKFIN_STRING_H_ */ |