We use local_bh_disable() to mean that we don't want to get
preempted or interrupted and normally it covers both situations.
However, on RT kernels local_bh_disable() becomes a no-op because
bottom halves aren't interrupts any more. We still want the
behavior of disabling preemption so #define them to be the same
on these kernels.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
openvswitch_headers += \
linux-2.6/compat-2.6/compat26.h \
linux-2.6/compat-2.6/include/asm-generic/bug.h \
+ linux-2.6/compat-2.6/include/linux/bottom_half.h \
linux-2.6/compat-2.6/include/linux/cpumask.h \
linux-2.6/compat-2.6/include/linux/dmi.h \
linux-2.6/compat-2.6/include/linux/err.h \
--- /dev/null
+#ifndef __LINUX_BH_WRAPPER_H
+#define __LINUX_BH_WRAPPER_H 1
+
+#include_next <linux/bottom_half.h>
+
+/* This is not, strictly speaking, compatibility code in the sense that it is
+ * not needed by older kernels. However, it is used on kernels with the
+ * realtime patchset applied to create an environment more similar to what we
+ * would see on normal kernels.
+ */
+
+#ifdef CONFIG_PREEMPT_HARDIRQS
+#undef local_bh_disable
+#define local_bh_disable preempt_disable
+#undef local_bh_enable
+#define local_bh_enable preempt_enable
+#endif
+
+#endif