aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh/spinlock.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sh/spinlock.h')
-rw-r--r--include/asm-sh/spinlock.h8
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 @@
11#define __ASM_SH_SPINLOCK_H 11#define __ASM_SH_SPINLOCK_H
12 12
13#include <asm/atomic.h> 13#include <asm/atomic.h>
14#include <asm/spinlock_types.h>
14 15
15/* 16/*
16 * Your basic SMP spinlocks, allowing only a single CPU anywhere 17 * Your basic SMP spinlocks, allowing only a single CPU anywhere
@@ -42,7 +43,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock)
42 43
43static inline void __raw_spin_unlock(raw_spinlock_t *lock) 44static inline void __raw_spin_unlock(raw_spinlock_t *lock)
44{ 45{
45 assert_spin_locked(lock); 46 //assert_spin_locked(lock);
46 47
47 lock->lock = 0; 48 lock->lock = 0;
48} 49}
@@ -88,6 +89,11 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
88 __raw_spin_unlock(&rw->lock); 89 __raw_spin_unlock(&rw->lock);
89} 90}
90 91
92static inline int __raw_write_can_lock(raw_rwlock_t *rw)
93{
94 return (atomic_read(&rw->counter) == RW_LOCK_BIAS);
95}
96
91static inline int __raw_read_trylock(raw_rwlock_t *lock) 97static inline int __raw_read_trylock(raw_rwlock_t *lock)
92{ 98{
93 atomic_t *count = (atomic_t*)lock; 99 atomic_t *count = (atomic_t*)lock;