Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178092753
D48674.1795938075.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D48674.1795938075.diff
View Options
diff --git a/sys/sys/module.h b/sys/sys/module.h
--- a/sys/sys/module.h
+++ b/sys/sys/module.h
@@ -153,11 +153,35 @@
#endif
/*
- * The module declared with DECLARE_MODULE_TIED can only be loaded
+ * Modules declared with DECLARE_MODULE_RELENG can only be loaded into
+ * a kernel built on the same releng/X.Y branch. This is useful for
+ * modules that use kernel interfaces that are not stable on stable/X
+ * branches but are stable on release branches.
+ *
+ * Note that releng/X.Y versions have values 0..499 in the low three
+ * digits and stable/X versions have 500..999 in the low three digits.
+ * This macro requires an exact match like DECLARE_MODULE_TIED for
+ * stable/X but permits loading on newer kernels on the same
+ * releng/X.Y branch.
+ *
+ * This isn't quite right for main prior to X.0 whose low three digits
+ * also fall in the 0..499 range.
+ */
+#define MODULE_KERNEL_RELENG_MAXVER \
+ ((__FreeBSD_version % 1000 <= 500) ? \
+ (roundup(__FreeBSD_version, 500) - 1) : \
+ __FreeBSD_version)
+
+#define DECLARE_MODULE_RELENG(name, data, sub, order) \
+ DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, \
+ MODULE_KERNEL_RELENG_MAXVER)
+
+/*
+ * Modules 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.
+ * even on stable/X branches.
*/
#define DECLARE_MODULE_TIED(name, data, sub, order) \
DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, __FreeBSD_version)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 29, 7:41 AM (1 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42086244
Default Alt Text
D48674.1795938075.diff (1 KB)
Attached To
Mode
D48674: sys: Add DECLARE_MODULE_RELENG for use by external kernel modules
Attached
Detach File
Event Timeline