aboutsummaryrefslogtreecommitdiff
path: root/include/linux/preempt_mask.h
diff options
context:
space:
mode:
authorGary S. Robertson <gary.robertson@linaro.org>2016-01-20 15:36:59 -0600
committerGary S. Robertson <gary.robertson@linaro.org>2016-01-20 15:36:59 -0600
commit370e05d463d66eaada3b4bb9266f019563920eb0 (patch)
tree348834a36436338eea1e9f17f1823cae213f92fc /include/linux/preempt_mask.h
parentf93328edc6d139b9b1b5ed6944f7b80b8699cdf7 (diff)
parent906d9eadd3b6698fa6ceb9bcdf41da6aa56d0a24 (diff)
Merge tag 'lsk-v4.1-15.12-rt' of http://git.linaro.org/kernel/linux-linaro-stable into linux-linaro-lng-v4.1-rtlinux-lng-preempt-rt-4.1.14-2016.03linux-lng-preempt-rt-4.1.14-2016.02linux-lng-preempt-rt-4.1.14-2016.01linux-linaro-lng-v4.1-rt
LSK RT 15.12 v4.1 Conflicts: linaro/configs/linaro-base.conf linaro/configs/preempt-rt.conf linaro/configs/vexpress64.conf
Diffstat (limited to 'include/linux/preempt_mask.h')
-rw-r--r--include/linux/preempt_mask.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/include/linux/preempt_mask.h b/include/linux/preempt_mask.h
index c7e373dc7314..26a33802dae2 100644
--- a/include/linux/preempt_mask.h
+++ b/include/linux/preempt_mask.h
@@ -80,10 +80,22 @@ extern int in_serving_softirq(void);
*/
#define in_nmi() (preempt_count() & NMI_MASK)
+/*
+ * The preempt_count offset after preempt_disable();
+ */
#if defined(CONFIG_PREEMPT_COUNT)
-# define PREEMPT_CHECK_OFFSET 1
+# define PREEMPT_DISABLE_OFFSET PREEMPT_OFFSET
+#else
+# define PREEMPT_DISABLE_OFFSET 0
+#endif
+
+/*
+ * The preempt_count offset after spin_lock()
+ */
+#if !defined(CONFIG_PREEMPT_RT_FULL)
+#define PREEMPT_LOCK_OFFSET PREEMPT_DISABLE_OFFSET
#else
-# define PREEMPT_CHECK_OFFSET 0
+#define PREEMPT_LOCK_OFFSET 0
#endif
/*
@@ -99,7 +111,7 @@ extern int in_serving_softirq(void);
*
* Work as expected.
*/
-#define SOFTIRQ_LOCK_OFFSET (SOFTIRQ_DISABLE_OFFSET + PREEMPT_CHECK_OFFSET)
+#define SOFTIRQ_LOCK_OFFSET (SOFTIRQ_DISABLE_OFFSET + PREEMPT_LOCK_OFFSET)
/*
* Are we running in atomic context? WARNING: this macro cannot
@@ -115,7 +127,7 @@ extern int in_serving_softirq(void);
* (used by the scheduler, *after* releasing the kernel lock)
*/
#define in_atomic_preempt_off() \
- ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET)
+ ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_DISABLE_OFFSET)
#ifdef CONFIG_PREEMPT_COUNT
# define preemptible() (preempt_count() == 0 && !irqs_disabled())