aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips/spinlock.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-mips/spinlock.h')
-rw-r--r--include/asm-mips/spinlock.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/asm-mips/spinlock.h b/include/asm-mips/spinlock.h
index 4d0135b11156..075e9701d6bc 100644
--- a/include/asm-mips/spinlock.h
+++ b/include/asm-mips/spinlock.h
@@ -119,6 +119,18 @@ static inline unsigned int __raw_spin_trylock(raw_spinlock_t *lock)
119 * read-locks. 119 * read-locks.
120 */ 120 */
121 121
122/*
123 * read_can_lock - would read_trylock() succeed?
124 * @lock: the rwlock in question.
125 */
126#define __raw_read_can_lock(rw) ((rw)->lock >= 0)
127
128/*
129 * write_can_lock - would write_trylock() succeed?
130 * @lock: the rwlock in question.
131 */
132#define __raw_write_can_lock(rw) (!(rw)->lock)
133
122static inline void __raw_read_lock(raw_rwlock_t *rw) 134static inline void __raw_read_lock(raw_rwlock_t *rw)
123{ 135{
124 unsigned int tmp; 136 unsigned int tmp;