diff options
| -rw-r--r-- | arch/cris/arch-v32/lib/Makefile | 2 | ||||
| -rw-r--r-- | arch/cris/arch-v32/lib/strcmp.S | 21 | ||||
| -rw-r--r-- | arch/cris/include/asm/string.h | 6 |
3 files changed, 28 insertions, 1 deletions
diff --git a/arch/cris/arch-v32/lib/Makefile b/arch/cris/arch-v32/lib/Makefile index eb4aad1f1158..dd296b9db034 100644 --- a/arch/cris/arch-v32/lib/Makefile +++ b/arch/cris/arch-v32/lib/Makefile | |||
| @@ -3,5 +3,5 @@ | |||
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | lib-y = checksum.o checksumcopy.o string.o usercopy.o memset.o \ | 5 | lib-y = checksum.o checksumcopy.o string.o usercopy.o memset.o \ |
| 6 | csumcpfruser.o spinlock.o delay.o | 6 | csumcpfruser.o spinlock.o delay.o strcmp.o |
| 7 | 7 | ||
diff --git a/arch/cris/arch-v32/lib/strcmp.S b/arch/cris/arch-v32/lib/strcmp.S new file mode 100644 index 000000000000..8f7a1ee62591 --- /dev/null +++ b/arch/cris/arch-v32/lib/strcmp.S | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | ; strcmp.S -- CRISv32 version. | ||
| 2 | ; Copyright (C) 2008 AXIS Communications AB | ||
| 3 | ; Written by Edgar E. Iglesias | ||
| 4 | ; | ||
| 5 | ; This source code is licensed under the GNU General Public License, | ||
| 6 | ; Version 2. See the file COPYING for more details. | ||
| 7 | |||
| 8 | .global strcmp | ||
| 9 | .type strcmp,@function | ||
| 10 | strcmp: | ||
| 11 | 1: | ||
| 12 | move.b [$r10+], $r12 | ||
| 13 | seq $r13 | ||
| 14 | sub.b [$r11+], $r12 | ||
| 15 | or.b $r12, $r13 | ||
| 16 | beq 1b | ||
| 17 | nop | ||
| 18 | |||
| 19 | ret | ||
| 20 | movs.b $r12, $r10 | ||
| 21 | .size strcmp, . - strcmp | ||
diff --git a/arch/cris/include/asm/string.h b/arch/cris/include/asm/string.h index 691190e99a27..d5db39f9eea1 100644 --- a/arch/cris/include/asm/string.h +++ b/arch/cris/include/asm/string.h | |||
| @@ -11,4 +11,10 @@ extern void *memcpy(void *, const void *, size_t); | |||
| 11 | #define __HAVE_ARCH_MEMSET | 11 | #define __HAVE_ARCH_MEMSET |
| 12 | extern void *memset(void *, int, size_t); | 12 | extern void *memset(void *, int, size_t); |
| 13 | 13 | ||
| 14 | #ifdef CONFIG_ETRAX_ARCH_V32 | ||
| 15 | /* For v32 we provide strcmp. */ | ||
| 16 | #define __HAVE_ARCH_STRCMP | ||
| 17 | extern int strcmp(const char *s1, const char *s2); | ||
| 18 | #endif | ||
| 19 | |||
| 14 | #endif | 20 | #endif |
