1 #ifndef __ASM_SH_SMPLOCK_H
2 #define __ASM_SH_SMPLOCK_H
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
10 #include <linux/config.h>
14 #define lock_kernel() do { } while(0)
15 #define unlock_kernel() do { } while(0)
16 #define release_kernel_lock(task, cpu, depth) ((depth) = 1)
17 #define reacquire_kernel_lock(task, cpu, depth) do { } while(0)
21 #error "We do not support SMP on SH yet"
23 * Default SMP lock implementation
26 #include <linux/interrupt.h>
27 #include <asm/spinlock.h>
29 extern spinlock_t kernel_flag
;
32 * Getting the big kernel lock.
34 * This cannot happen asynchronously,
35 * so we only need to worry about other
38 extern __inline__
void lock_kernel(void)
40 if (!++current
->lock_depth
)
41 spin_lock(&kernel_flag
);
44 extern __inline__
void unlock_kernel(void)
46 if (--current
->lock_depth
< 0)
47 spin_unlock(&kernel_flag
);
51 * Release global kernel lock and global interrupt lock
53 #define release_kernel_lock(task, cpu) \
55 if (task->lock_depth >= 0) \
56 spin_unlock(&kernel_flag); \
57 release_irqlock(cpu); \
62 * Re-acquire the kernel lock
64 #define reacquire_kernel_lock(task) \
66 if (task->lock_depth >= 0) \
67 spin_lock(&kernel_flag); \
70 #endif /* CONFIG_SMP */
72 #endif /* __ASM_SH_SMPLOCK_H */