Define __raw_read_lock etc for uniprocessor builds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux