linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Define __raw_read_lock etc for uniprocessor builds
@ 2006-01-24 18:09 Joe Korty
  2006-01-24 18:17 ` Christoph Hellwig
  2006-01-24 21:12 ` Ingo Molnar
  0 siblings, 2 replies; 9+ messages in thread
From: Joe Korty @ 2006-01-24 18:09 UTC (permalink / raw)
  To: mingo; +Cc: akpm, linux-kernel


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 */

_

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

end of thread, other threads:[~2006-01-24 21:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-24 18:09 Define __raw_read_lock etc for uniprocessor builds Joe Korty
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).