mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Korty <joe.korty@ccur.com>
To: mingo@elte.hu
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Define __raw_read_lock etc for uniprocessor builds
Date: Tue, 24 Jan 2006 13:09:54 -0500	[thread overview]
Message-ID: <20060124180954.GA14506@tsunami.ccur.com> (raw)


Make NOPed versions of __raw_read_lock and family available
under uniprocessor kernels.

Discovered when compiling a uniprocessor kernel with the
fusyn patch applied.

The standard kernel does not use __raw_read_lock etc
outside of spinlock.c, which may account for this bug
being undiscovered until now.


 2.6.16-rc1-git4-jak/include/linux/spinlock_up.h |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff -puNa include/linux/spinlock_up.h~define.__raw_read_lock.and.family.for.uniproc-nodebug.combo include/linux/spinlock_up.h
--- 2.6.16-rc1-git4/include/linux/spinlock_up.h~define.__raw_read_lock.and.family.for.uniproc-nodebug.combo	2006-01-24 12:57:15.000000000 -0500
+++ 2.6.16-rc1-git4-jak/include/linux/spinlock_up.h	2006-01-24 12:58:51.000000000 -0500
@@ -47,16 +47,6 @@ static inline void __raw_spin_unlock(raw
 	lock->slock = 1;
 }
 
-/*
- * Read-write spinlocks. No debug version.
- */
-#define __raw_read_lock(lock)		do { (void)(lock); } while (0)
-#define __raw_write_lock(lock)		do { (void)(lock); } while (0)
-#define __raw_read_trylock(lock)	({ (void)(lock); 1; })
-#define __raw_write_trylock(lock)	({ (void)(lock); 1; })
-#define __raw_read_unlock(lock)		do { (void)(lock); } while (0)
-#define __raw_write_unlock(lock)	do { (void)(lock); } while (0)
-
 #else /* DEBUG_SPINLOCK */
 #define __raw_spin_is_locked(lock)	((void)(lock), 0)
 /* for sched.c and kernel_lock.c: */
@@ -71,4 +61,14 @@ static inline void __raw_spin_unlock(raw
 #define __raw_spin_unlock_wait(lock) \
 		do { cpu_relax(); } while (__raw_spin_is_locked(lock))
 
+/*
+ * Read-write spinlocks. Only non-debug versions available.
+ */
+#define __raw_read_lock(lock)		do { (void)(lock); } while (0)
+#define __raw_write_lock(lock)		do { (void)(lock); } while (0)
+#define __raw_read_trylock(lock)	({ (void)(lock); 1; })
+#define __raw_write_trylock(lock)	({ (void)(lock); 1; })
+#define __raw_read_unlock(lock)		do { (void)(lock); } while (0)
+#define __raw_write_unlock(lock)	do { (void)(lock); } while (0)
+
 #endif /* __LINUX_SPINLOCK_UP_H */

_

             reply	other threads:[~2006-01-24 18:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-24 18:09 Joe Korty [this message]
2006-01-24 18:17 ` Christoph Hellwig
2006-01-24 18:29   ` Joe Korty
2006-01-24 18:32     ` Arjan van de Ven
2006-01-24 18:38       ` Joe Korty
2006-01-24 18:42         ` Arjan van de Ven
2006-01-24 18:59           ` Joe Korty
2006-01-24 21:05           ` Ingo Molnar
2006-01-24 21:12 ` Ingo Molnar

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=20060124180954.GA14506@tsunami.ccur.com \
    --to=joe.korty@ccur.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®