Skip to contentSkip to conversation

read_can_lock and write_can_lock for MIPS

PATCH Applied Manish Lachwani 2 participants 2 messages Feb 1, 2005 – Feb 3, 2005 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 read_can_lock and write_can_lock for MIPS

Hi Ralf,

With SMP+PREEMPT, read_can_lock() and write_can_lock() need to be defined. Attached patch does this. Please review.

Thanks
Manish Lachwani

include/asm-mips/spinlock.h +3 -0
Index: linux/include/asm-mips/spinlock.h
===================================================================
@@ -140,6 +140,9 @@
 
 #define rwlock_init(x)  do { *(x) = RW_LOCK_UNLOCKED; } while(0)
 
+#define read_can_lock(rw)	((rw)->lock >= 0)
+#define write_can_lock(rw)	(!(rw)->lock)
+
 static inline void _raw_read_lock(rwlock_t *rw)
 {
 	unsigned int tmp;
Applied
#1 lore raw
Quoted 4 lines · Manish Lachwani

Hi Ralf,

With SMP+PREEMPT, read_can_lock() and write_can_lock() need to be defined. Attached patch does this. Please review.

Thanks, applied. In addition I copied the comments from the i386 code into the spinlocks.h.

Ralf