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
- Lines: 34
- Date:
Tue Oct 27 09:52:21 1998
- Orig file:
v2.1.126/linux/include/asm-sparc64/smplock.h
- Orig date:
Mon Aug 3 17:48:28 1998
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