Ok. I didn't make 2.4.0 in 2000. Tough. I tried, but we had some
[davej-history.git] / include / asm-sparc64 / smplock.h
blob6b3c900de906da6a429fe7b010a2f5083c25cc20
1 /*
2 * <asm/smplock.h>
4 * Default SMP lock implementation
5 */
6 #include <linux/sched.h>
7 #include <linux/interrupt.h>
8 #include <linux/spinlock.h>
10 extern spinlock_t kernel_flag;
12 #define kernel_locked() spin_is_locked(&kernel_flag)
15 * Release global kernel lock and global interrupt lock
17 #define release_kernel_lock(task, cpu) \
18 do { \
19 if (task->lock_depth >= 0) \
20 spin_unlock(&kernel_flag); \
21 release_irqlock(cpu); \
22 __sti(); \
23 } while (0)
26 * Re-acquire the kernel lock
28 #define reacquire_kernel_lock(task) \
29 do { \
30 if (task->lock_depth >= 0) \
31 spin_lock(&kernel_flag); \
32 } while (0)
36 * Getting the big kernel lock.
38 * This cannot happen asynchronously,
39 * so we only need to worry about other
40 * CPU's.
42 #define lock_kernel() \
43 do { \
44 if (!++current->lock_depth) \
45 spin_lock(&kernel_flag); \
46 } while(0)
48 #define unlock_kernel() \
49 do { \
50 if (--current->lock_depth < 0) \
51 spin_unlock(&kernel_flag); \
52 } while(0)