From b0903ee8e4853eea35cb24cfb4dda1b60c7948dc Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Mon, 8 Jun 2009 13:04:43 +0200 Subject: CRIS: assignment/is equal confusion Somehow, the assignments of rw->lock got written as comparisons. The effect probably was that the read-write spinlocks never locked. However, since the locks are only used in CONFIG_SMP and SMP CRIS is experimental, it has never been identified as a problem. Signed-off-by: Roel Kluin Acked-by: Jesper Nilsson --- arch/cris/include/arch-v32/arch/spinlock.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/cris/include') diff --git a/arch/cris/include/arch-v32/arch/spinlock.h b/arch/cris/include/arch-v32/arch/spinlock.h index 129756b9666..367a53ea10c 100644 --- a/arch/cris/include/arch-v32/arch/spinlock.h +++ b/arch/cris/include/arch-v32/arch/spinlock.h @@ -78,7 +78,7 @@ static inline void __raw_write_lock(raw_rwlock_t *rw) { __raw_spin_lock(&rw->slock); while (rw->lock != RW_LOCK_BIAS); - rw->lock == 0; + rw->lock = 0; __raw_spin_unlock(&rw->slock); } @@ -93,7 +93,7 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw) { __raw_spin_lock(&rw->slock); while (rw->lock != RW_LOCK_BIAS); - rw->lock == RW_LOCK_BIAS; + rw->lock = RW_LOCK_BIAS; __raw_spin_unlock(&rw->slock); } @@ -114,7 +114,7 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw) int ret = 0; __raw_spin_lock(&rw->slock); if (rw->lock == RW_LOCK_BIAS) { - rw->lock == 0; + rw->lock = 0; ret = 1; } __raw_spin_unlock(&rw->slock); -- cgit v1.2.3 From 7f2ff23db1de53ea8695bb4a7c1cfab88886e3fd Mon Sep 17 00:00:00 2001 From: Jesper Nilsson Date: Wed, 10 Jun 2009 15:06:55 +0200 Subject: CRISv32: Add arch optimized strcmp. Add an optimized strcmp for CRISv32. This improves strcmp performance with about 25% when comparing a 55 character string with itself. Signed-off-by: Edgar Iglesias Acked-by: Jesper Nilsson --- arch/cris/include/asm/string.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/cris/include') diff --git a/arch/cris/include/asm/string.h b/arch/cris/include/asm/string.h index 691190e99a2..d5db39f9eea 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); #define __HAVE_ARCH_MEMSET extern void *memset(void *, int, size_t); +#ifdef CONFIG_ETRAX_ARCH_V32 +/* For v32 we provide strcmp. */ +#define __HAVE_ARCH_STRCMP +extern int strcmp(const char *s1, const char *s2); +#endif + #endif -- cgit v1.2.3