All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manish Lachwani <mlachwani@mvista.com>
To: linux-mips@linux-mips.org
Cc: ralf@linux-mips.org
Subject: [PATCH] read_can_lock and write_can_lock for MIPS
Date: Tue, 1 Feb 2005 13:26:03 -0800	[thread overview]
Message-ID: <20050201212603.GA24787@prometheus.mvista.com> (raw)

[-- 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;

             reply	other threads:[~2005-02-01 21:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-01 21:26 Manish Lachwani [this message]
2005-02-03 13:35 ` [PATCH] read_can_lock and write_can_lock for MIPS Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050201212603.GA24787@prometheus.mvista.com \
    --to=mlachwani@mvista.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.