[PATCH] [RT] preempt_disable_rt for CONFIG_PREEMPT_RT

From: Tim Blechmann
Date: Thu Dec 11 2008 - 14:06:32 EST


in some cases, spinlocks are used to avoid preemption. does not work
correctly, when CONFIG_PREEMPT_RT is enabled.

therefore two new macros are introduced:
preempt_disable_rt/preempt_disable_rt behave like their equivalents, if
CONFIG_PREEMPT_RT is enabled, and as noops otherwise.

Signed-off-by: Tim Blechmann <tim@xxxxxxxxxx>
---
include/linux/preempt.h | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index 72b1a10..2526170 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -93,6 +93,16 @@ do { \

#endif

+#ifdef CONFIG_PREEMPT_RT
+#define preempt_disable_rt preempt_disable
+#define preempt_enable_rt preempt_enable
+#else
+#define
+#define preempt_disable_rt do { } while (0)
+#define preempt_enable_rt do { } while (0)
+#endif
+
+
#ifdef CONFIG_PREEMPT_NOTIFIERS

struct preempt_notifier;
--
1.5.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/