aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/bit_spinlock.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /include/linux/bit_spinlock.h
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'include/linux/bit_spinlock.h')
-rw-r--r--include/linux/bit_spinlock.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/bit_spinlock.h b/include/linux/bit_spinlock.h
index 7113a32a86ea..b4326bfa684f 100644
--- a/include/linux/bit_spinlock.h
+++ b/include/linux/bit_spinlock.h
@@ -1,6 +1,10 @@
1#ifndef __LINUX_BIT_SPINLOCK_H 1#ifndef __LINUX_BIT_SPINLOCK_H
2#define __LINUX_BIT_SPINLOCK_H 2#define __LINUX_BIT_SPINLOCK_H
3 3
4#include <linux/kernel.h>
5#include <linux/preempt.h>
6#include <asm/atomic.h>
7
4/* 8/*
5 * bit-based spin_lock() 9 * bit-based spin_lock()
6 * 10 *
@@ -19,11 +23,11 @@ static inline void bit_spin_lock(int bitnum, unsigned long *addr)
19 preempt_disable(); 23 preempt_disable();
20#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) 24#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
21 while (unlikely(test_and_set_bit_lock(bitnum, addr))) { 25 while (unlikely(test_and_set_bit_lock(bitnum, addr))) {
22 while (test_bit(bitnum, addr)) { 26 preempt_enable();
23 preempt_enable(); 27 do {
24 cpu_relax(); 28 cpu_relax();
25 preempt_disable(); 29 } while (test_bit(bitnum, addr));
26 } 30 preempt_disable();
27 } 31 }
28#endif 32#endif
29 __acquire(bitlock); 33 __acquire(bitlock);