summaryrefslogtreecommitdiffstats
path: root/include/asm-mips/spinlock.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2005-02-03 14:34:45 +0100
committerRalf Baechle <ralf@linux-mips.org>2005-10-29 20:30:22 +0200
commite3c4807825501f0b445fe34b627669be24b59320 (patch)
tree438898b7a348ca7b4a452d4f7c143dc1a694c60e /include/asm-mips/spinlock.h
parentUpdate descriptions for MIPS Technologies evaluation boards. (diff)
downloadlinux-e3c4807825501f0b445fe34b627669be24b59320.tar.xz
linux-e3c4807825501f0b445fe34b627669be24b59320.zip
Define __raw_read_can_lock / __raw_write_can_lock.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
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)
* 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;