datapath: Rename linux-2.6 and compat-2.6 directories.
[sliver-openvswitch.git] / datapath / linux / compat / include / linux / bottom_half.h
diff --git a/datapath/linux/compat/include/linux/bottom_half.h b/datapath/linux/compat/include/linux/bottom_half.h
new file mode 100644 (file)
index 0000000..59eb4bc
--- /dev/null
@@ -0,0 +1,19 @@
+#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