diff options
author | Evgeniy Polyakov <johnpol@2ka.mipt.ru> | 2007-05-31 08:46:21 +0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2007-05-31 08:46:21 +0400 |
commit | 66c5227ecd3041b0467a091ad81b8d312e572ea8 (patch) | |
tree | 8d910d8f45c498c4d4f66694ff425f4b7d90d114 /include/asm-sh/spinlock.h | |
parent | f75522cea12fe1ed9336c1a02b170bd06383e8a3 (diff) | |
download | linux-66c5227ecd3041b0467a091ad81b8d312e572ea8.tar.xz |
sh: trivial build cleanups.
Several errors were spotted during building for custom config (SMP
included). Although SMP still does not compile (no ipi and
__smp_call_function) and does not work, this looks a bit cleaner.
Some other errors obtained via gcc-4.1.0 build.
Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh/spinlock.h')
-rw-r--r-- | include/asm-sh/spinlock.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/asm-sh/spinlock.h b/include/asm-sh/spinlock.h index 2586eef07d57..92f6e2008b2e 100644 --- a/include/asm-sh/spinlock.h +++ b/include/asm-sh/spinlock.h @@ -11,6 +11,7 @@ #define __ASM_SH_SPINLOCK_H #include <asm/atomic.h> +#include <asm/spinlock_types.h> /* * Your basic SMP spinlocks, allowing only a single CPU anywhere @@ -42,7 +43,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock) static inline void __raw_spin_unlock(raw_spinlock_t *lock) { - assert_spin_locked(lock); + //assert_spin_locked(lock); lock->lock = 0; } @@ -88,6 +89,11 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw) __raw_spin_unlock(&rw->lock); } +static inline int __raw_write_can_lock(raw_rwlock_t *rw) +{ + return (atomic_read(&rw->counter) == RW_LOCK_BIAS); +} + static inline int __raw_read_trylock(raw_rwlock_t *lock) { atomic_t *count = (atomic_t*)lock; |