From d3cb351221ce4b61b0a88c214b25dd6512209e5a Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 3 Feb 2005 13:34:45 +0000 Subject: [PATCH] --- yaml --- r: 10971 b: refs/heads/master c: e3c4807825501f0b445fe34b627669be24b59320 h: refs/heads/master i: 10969: 394d90e80086b7501813888214f538d013bc5c10 10967: 9a3a417b4c4e135e64a1d675b0552d59dd662bae v: v3 --- [refs] | 2 +- trunk/include/asm-mips/spinlock.h | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index f9794caf8639..821ea5f3613b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f638d1971e3135025471c99bf079a24fbb1f3bfa +refs/heads/master: e3c4807825501f0b445fe34b627669be24b59320 diff --git a/trunk/include/asm-mips/spinlock.h b/trunk/include/asm-mips/spinlock.h index 4d0135b11156..075e9701d6bc 100644 --- a/trunk/include/asm-mips/spinlock.h +++ b/trunk/include/asm-mips/spinlock.h @@ -119,6 +119,18 @@ static inline unsigned int __raw_spin_trylock(raw_spinlock_t *lock) * read-locks. */ +/* + * read_can_lock - would read_trylock() succeed? + * @lock: the rwlock in question. + */ +#define __raw_read_can_lock(rw) ((rw)->lock >= 0) + +/* + * write_can_lock - would write_trylock() succeed? + * @lock: the rwlock in question. + */ +#define __raw_write_can_lock(rw) (!(rw)->lock) + static inline void __raw_read_lock(raw_rwlock_t *rw) { unsigned int tmp;