summaryrefslogtreecommitdiff
path: root/backport-include/linux/moduleparam.h
diff options
context:
space:
mode:
authorDominik Sliwa <dominik.sliwa@toradex.com>2017-07-02 16:41:37 +0200
committerDominik Sliwa <dominik.sliwa@toradex.com>2017-07-02 16:41:37 +0200
commit52409fae3e4b8d16b68b61902fc09075cd97b75d (patch)
treee67110145c5843b3f199d872ae285e2546c9ebe2 /backport-include/linux/moduleparam.h
Backports generated from 4.11 kernel
Initial commit. Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Diffstat (limited to 'backport-include/linux/moduleparam.h')
-rw-r--r--backport-include/linux/moduleparam.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/backport-include/linux/moduleparam.h b/backport-include/linux/moduleparam.h
new file mode 100644
index 0000000..1c7dfad
--- /dev/null
+++ b/backport-include/linux/moduleparam.h
@@ -0,0 +1,39 @@
+#ifndef __BACKPORT_LINUX_MODULEPARAM_H
+#define __BACKPORT_LINUX_MODULEPARAM_H
+#include_next <linux/moduleparam.h>
+
+#if LINUX_VERSION_IS_LESS(4,2,0)
+#define kernel_param_lock LINUX_BACKPORT(kernel_param_lock)
+static inline void kernel_param_lock(struct module *mod)
+{
+ __kernel_param_lock();
+}
+#define kernel_param_unlock LINUX_BACKPORT(kernel_param_unlock)
+static inline void kernel_param_unlock(struct module *mod)
+{
+ __kernel_param_unlock();
+}
+#endif
+
+#if LINUX_VERSION_IS_LESS(3,8,0)
+#undef __MODULE_INFO
+#ifdef MODULE
+#define __MODULE_INFO(tag, name, info) \
+static const char __UNIQUE_ID(name)[] \
+ __used __attribute__((section(".modinfo"), unused, aligned(1))) \
+ = __stringify(tag) "=" info
+#else /* !MODULE */
+/* This struct is here for syntactic coherency, it is not used */
+#define __MODULE_INFO(tag, name, info) \
+ struct __UNIQUE_ID(name) {}
+#endif
+#endif /* < 3.8 */
+
+#if LINUX_VERSION_IS_LESS(3,17,0)
+extern struct kernel_param_ops param_ops_ullong;
+extern int param_set_ullong(const char *val, const struct kernel_param *kp);
+extern int param_get_ullong(char *buffer, const struct kernel_param *kp);
+#define param_check_ullong(name, p) __param_check(name, p, unsigned long long)
+#endif
+
+#endif /* __BACKPORT_LINUX_MODULEPARAM_H */