4 * i386 SMP lock implementation
6 #include <linux/interrupt.h>
7 #include <asm/spinlock.h>
9 extern spinlock_t kernel_flag
;
12 * Release global kernel lock and global interrupt lock
14 #define release_kernel_lock(task, cpu) \
16 if (task->lock_depth >= 0) \
17 spin_unlock(&kernel_flag); \
18 release_irqlock(cpu); \
23 * Re-acquire the kernel lock
25 #define reacquire_kernel_lock(task) \
27 if (task->lock_depth >= 0) \
28 spin_lock(&kernel_flag); \
33 * Getting the big kernel lock.
35 * This cannot happen asynchronously,
36 * so we only need to worry about other
39 extern __inline__
void lock_kernel(void)
46 :"=m" (__dummy_lock(&kernel_flag
)),
47 "=m" (current
->lock_depth
));
50 extern __inline__
void unlock_kernel(void)
57 :"=m" (__dummy_lock(&kernel_flag
)),
58 "=m" (current
->lock_depth
));