aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/module.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/sys/module.h')
-rw-r--r--sys/sys/module.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/sys/module.h b/sys/sys/module.h
index 2abad63f9ecb..782770a73df9 100644
--- a/sys/sys/module.h
+++ b/sys/sys/module.h
@@ -125,13 +125,26 @@ struct mod_metadata {
*/
#define MODULE_KERNEL_MAXVER (roundup(__FreeBSD_version, 100000) - 1)
-#define DECLARE_MODULE(name, data, sub, order) \
+#define DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, maxver) \
MODULE_DEPEND(name, kernel, __FreeBSD_version, \
- __FreeBSD_version, MODULE_KERNEL_MAXVER); \
+ __FreeBSD_version, maxver); \
MODULE_METADATA(_md_##name, MDT_MODULE, &data, #name); \
SYSINIT(name##module, sub, order, module_register_init, &data); \
struct __hack
+#define DECLARE_MODULE(name, data, sub, order) \
+ DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, MODULE_KERNEL_MAXVER)
+
+/*
+ * The module declared with DECLARE_MODULE_TIED can only be loaded
+ * into the kernel with exactly the same __FreeBSD_version.
+ *
+ * Use it for modules that use kernel interfaces that are not stable
+ * even on STABLE/X branches.
+ */
+#define DECLARE_MODULE_TIED(name, data, sub, order) \
+ DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, __FreeBSD_version)
+
#define MODULE_VERSION(module, version) \
static struct mod_version _##module##_version = { \
version \