Ok. I didn't make 2.4.0 in 2000. Tough. I tried, but we had some
[davej-history.git] / include / asm-mips / smplock.h
blob188c4b4c9eb3c2683bfb3e493bb4c5aec0d082df
1 /* $Id: smplock.h,v 1.2 1999/10/09 00:01:43 ralf Exp $
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
7 * Default SMP lock implementation
8 */
9 #include <linux/interrupt.h>
10 #include <linux/spinlock.h>
12 extern spinlock_t kernel_flag;
14 #define kernel_locked() spin_is_locked(&kernel_flag)
17 * Release global kernel lock and global interrupt lock
19 #define release_kernel_lock(task, cpu) \
20 do { \
21 if (task->lock_depth >= 0) \
22 spin_unlock(&kernel_flag); \
23 release_irqlock(cpu); \
24 __sti(); \
25 } while (0)
28 * Re-acquire the kernel lock
30 #define reacquire_kernel_lock(task) \
31 do { \
32 if (task->lock_depth >= 0) \
33 spin_lock(&kernel_flag); \
34 } while (0)
38 * Getting the big kernel lock.
40 * This cannot happen asynchronously,
41 * so we only need to worry about other
42 * CPU's.
44 extern __inline__ void lock_kernel(void)
46 if (!++current->lock_depth)
47 spin_lock(&kernel_flag);
50 extern __inline__ void unlock_kernel(void)
52 if (--current->lock_depth < 0)
53 spin_unlock(&kernel_flag);