4 * Default SMP lock implementation
6 #include <linux/sched.h>
7 #include <linux/interrupt.h>
8 #include <linux/spinlock.h>
10 extern spinlock_t kernel_flag
;
13 * Release global kernel lock and global interrupt lock
15 #define release_kernel_lock(task, cpu) \
17 if (task->lock_depth >= 0) \
18 spin_unlock(&kernel_flag); \
19 release_irqlock(cpu); \
24 * Re-acquire the kernel lock
26 #define reacquire_kernel_lock(task) \
28 if (task->lock_depth >= 0) \
29 spin_lock(&kernel_flag); \
34 * Getting the big kernel lock.
36 * This cannot happen asynchronously,
37 * so we only need to worry about other
40 #define lock_kernel() \
42 if (!++current->lock_depth) \
43 spin_lock(&kernel_flag); \
46 #define unlock_kernel() \
48 if (--current->lock_depth < 0) \
49 spin_unlock(&kernel_flag); \