diff options
author | Oleksandr Suvorov <oleksandr.suvorov@toradex.com> | 2020-03-26 12:44:27 +0200 |
---|---|---|
committer | Oleksandr Suvorov <oleksandr.suvorov@toradex.com> | 2020-03-26 12:46:50 +0200 |
commit | 87d308708712ff6075c4dd54b0519b47fdad8816 (patch) | |
tree | 2fb6458b1db7dd21be2648f42412dd2485846c76 /backport-include/linux/moduleparam.h |
Backports v5.4.27
Backports generated by toradex backports f6e8852f1ef28e6d3c9bae8400eb6a87a6b0c3e7
against mainline kernel tag v5.4.27
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Diffstat (limited to 'backport-include/linux/moduleparam.h')
-rw-r--r-- | backport-include/linux/moduleparam.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/backport-include/linux/moduleparam.h b/backport-include/linux/moduleparam.h new file mode 100644 index 0000000..914baad --- /dev/null +++ b/backport-include/linux/moduleparam.h @@ -0,0 +1,44 @@ +#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 + +#ifndef module_param_hw_array +#define module_param_hw_array(name, type, hwtype, nump, perm) \ + module_param_array(name, type, nump, perm) +#endif + +#endif /* __BACKPORT_LINUX_MODULEPARAM_H */ |