1 #ifndef __ASM_SH64_SMPLOCK_H
2 #define __ASM_SH64_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
9 * include/asm-sh64/smplock.h
11 * Copyright (C) 2000, 2001 Paolo Alberelli
15 #include <linux/config.h>
19 #define lock_kernel() do { } while(0)
20 #define unlock_kernel() do { } while(0)
21 #define release_kernel_lock(task, cpu, depth) ((depth) = 1)
22 #define reacquire_kernel_lock(task, cpu, depth) do { } while(0)
26 #error "We do not support SMP on SH64 yet"
28 * Default SMP lock implementation
31 #include <linux/interrupt.h>
32 #include <asm/spinlock.h>
34 extern spinlock_t kernel_flag;
37 * Getting the big kernel lock.
39 * This cannot happen asynchronously,
40 * so we only need to worry about other
43 extern __inline__ void lock_kernel(void)
45 if (!++current->lock_depth)
46 spin_lock(&kernel_flag);
49 extern __inline__ void unlock_kernel(void)
51 if (--current->lock_depth < 0)
52 spin_unlock(&kernel_flag);
56 * Release global kernel lock and global interrupt lock
58 #define release_kernel_lock(task, cpu) \
60 if (task->lock_depth >= 0) \
61 spin_unlock(&kernel_flag); \
62 release_irqlock(cpu); \
67 * Re-acquire the kernel lock
69 #define reacquire_kernel_lock(task) \
71 if (task->lock_depth >= 0) \
72 spin_lock(&kernel_flag); \
75 #endif /* CONFIG_SMP */
77 #endif /* __ASM_SH64_SMPLOCK_H */