Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] read_can_lock and write_can_lock for MIPS
@ 2005-02-01 21:26 Manish Lachwani
  2005-02-03 13:35 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Manish Lachwani @ 2005-02-01 21:26 UTC (permalink / raw)
  To: linux-mips; +Cc: ralf

[-- Attachment #1: Type: text/plain, Size: 150 bytes --]

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

[-- Attachment #2: common_mips_locks_preempt.patch --]
[-- Type: text/plain, Size: 441 bytes --]

Index: linux/include/asm-mips/spinlock.h
===================================================================
--- linux.orig/include/asm-mips/spinlock.h
+++ 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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] read_can_lock and write_can_lock for MIPS
  2005-02-01 21:26 [PATCH] read_can_lock and write_can_lock for MIPS Manish Lachwani
@ 2005-02-03 13:35 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2005-02-03 13:35 UTC (permalink / raw)
  To: Manish Lachwani; +Cc: linux-mips

On Tue, Feb 01, 2005 at 01:26:03PM -0800, Manish Lachwani wrote:

> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-02-03 13:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-01 21:26 [PATCH] read_can_lock and write_can_lock for MIPS Manish Lachwani
2005-02-03 13:35 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox