summaryrefslogtreecommitdiff
path: root/backport-include/linux/nospec.h
diff options
context:
space:
mode:
Diffstat (limited to 'backport-include/linux/nospec.h')
-rw-r--r--backport-include/linux/nospec.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/backport-include/linux/nospec.h b/backport-include/linux/nospec.h
new file mode 100644
index 0000000..50cf467
--- /dev/null
+++ b/backport-include/linux/nospec.h
@@ -0,0 +1,12 @@
+#ifndef _BACKPORT_LINUX_NOSPEC_H
+#define _BACKPORT_LINUX_NOSPEC_H
+
+#if LINUX_VERSION_IS_GEQ(4,14,18) || \
+ LINUX_VERSION_IN_RANGE(4,9,81, 4,10,0) || \
+ LINUX_VERSION_IN_RANGE(4,4,118, 4,5,0)
+#include_next <linux/nospec.h>
+#else
+#define array_index_nospec(index, size) (index)
+#endif
+
+#endif /* _BACKPORT_LINUX_NOSPEC_H */