patch-2.3.41 linux/include/asm-sparc/semaphore.h

Next file: linux/include/asm-sparc/sembuf.h
Previous file: linux/include/asm-sparc/sbus.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.40/linux/include/asm-sparc/semaphore.h linux/include/asm-sparc/semaphore.h
@@ -250,10 +250,17 @@
 #define __RWSEM_DEBUG_INIT	/* */
 #endif
 
-#define __RWSEM_INITIALIZER(name) \
-{ RW_LOCK_BIAS, 0, 0xff, 0xff, __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \
+#define __RWSEM_INITIALIZER(name,count) \
+{ (count), 0, 0xff, 0xff, __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \
   __WAIT_QUEUE_HEAD_INITIALIZER((name).write_bias_wait) \
   __SEM_DEBUG_INIT(name) __RWSEM_DEBUG_INIT }
+
+#define __DECLARE_RWSEM_GENERIC(name,count) \
+	struct rw_semaphore name = __RWSEM_INITIALIZER(name,count)
+
+#define DECLARE_RWSEM(name) __DECLARE_RWSEM_GENERIC(name,RW_LOCK_BIAS)
+#define DECLARE_RWSEM_READ_LOCKED(name) __DECLARE_RWSEM_GENERIC(name,RW_LOCK_BIAS-1)
+#define DECLARE_RWSEM_WRITE_LOCKED(name) __DECLARE_RWSEM_GENERIC(name,0)
 
 extern inline void init_rwsem(struct rw_semaphore *sem)
 {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)