projects
/
GitHub
/
MotorolaMobilityLLC
/
kernel-slsi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f638d19
)
Define __raw_read_can_lock / __raw_write_can_lock.
author
Ralf Baechle
<ralf@linux-mips.org>
Thu, 3 Feb 2005 13:34:45 +0000
(13:34 +0000)
committer
Ralf Baechle
<ralf@linux-mips.org>
Sat, 29 Oct 2005 18:30:22 +0000
(19:30 +0100)
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
include/asm-mips/spinlock.h
patch
|
blob
|
blame
|
history
diff --git
a/include/asm-mips/spinlock.h
b/include/asm-mips/spinlock.h
index 4d0135b111567e5e59956a3bd30bf7b58f86debe..075e9701d6bc2de571a028592bb943968d1563d3 100644
(file)
--- 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;