include/asm-generic/smplock.h
10142 /*
10143 * <asm/smplock.h>
10144 *
10145 * Default SMP lock implementation
10146 */
10147 #include <linux/interrupt.h>
10148 #include <asm/spinlock.h>
10149
10150 extern spinlock_t kernel_flag;
10151
10152 /* Release global kernel lock and global interrupt lock
10153 */
10154 #define release_kernel_lock(task, cpu) \
10155 do { \
10156 if (task->lock_depth >= 0) \
10157 spin_unlock(&kernel_flag); \
10158 release_irqlock(cpu); \
10159 __sti(); \
10160 } while (0)
10161
10162 /* Re-acquire the kernel lock */
10163 #define reacquire_kernel_lock(task) \
10164 do { \
10165 if (task->lock_depth >= 0) \
10166 spin_lock(&kernel_flag); \
10167 } while (0)
10168
10169
10170 /* Getting the big kernel lock.
10171 *
10172 * This cannot happen asynchronously, so we only need to
10173 * worry about other CPUs. */
10174 extern __inline__ void lock_kernel(void)
10175 {
10176 if (!++current->lock_depth)
10177 spin_lock(&kernel_flag);
10178 }
10179
10180 extern __inline__ void unlock_kernel(void)
10181 {
10182 if (--current->lock_depth < 0)
10183 spin_unlock(&kernel_flag);
10184 }
Сайт управляется системой
uCoz