lkml.org 
[lkml]   [2006]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectDefine __raw_read_lock etc for uniprocessor builds

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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-01-24 19:13    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site