patch-2.1.127 linux/include/asm-sparc64/smplock.h

Next file: linux/include/asm-sparc64/softirq.h
Previous file: linux/include/asm-sparc64/smp.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.126/linux/include/asm-sparc64/smplock.h linux/include/asm-sparc64/smplock.h
@@ -3,6 +3,7 @@
  *
  * Default SMP lock implementation
  */
+#include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <asm/spinlock.h>
 
@@ -36,14 +37,14 @@
  * so we only need to worry about other
  * CPU's.
  */
-extern __inline__ void lock_kernel(void)
-{
-	if (!++current->lock_depth)
-		spin_lock(&kernel_flag);
-}
-
-extern __inline__ void unlock_kernel(void)
-{
-	if (--current->lock_depth < 0)
-		spin_unlock(&kernel_flag);
-}
+#define lock_kernel() \
+do { \
+	if (!++current->lock_depth) \
+		spin_lock(&kernel_flag); \
+} while(0)
+
+#define unlock_kernel() \
+do { \
+	if (--current->lock_depth < 0) \
+		spin_unlock(&kernel_flag); \
+} while(0)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov