aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2010-10-12 09:18:17 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2010-10-12 09:18:17 +0000
commit78ae4338a24933c8a64094600625385b46688891 (patch)
tree49b23685ac60a1e49a5edfa5657f8d82d84b941d
parent96f231fde99166a377ca359e1cd52e386137dd2c (diff)
downloadsrc-78ae4338a24933c8a64094600625385b46688891.tar.gz
src-78ae4338a24933c8a64094600625385b46688891.zip
Add macro DECLARE_MODULE_TIED to denote a module as requiring the
kernel of exactly the same __FreeBSD_version as the headers module was compiled against. Mark our in-tree ABI emulators with DECLARE_MODULE_TIED. The modules use kernel interfaces that the Release Engineering Team feel are not stable enough to guarantee they will not change during the life cycle of a STABLE branch. In particular, the layout of struct sysentvec is declared to be not part of the STABLE KBI. Discussed with: bz, rwatson Approved by: re (bz, kensmith) MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=213716
-rw-r--r--sys/amd64/linux32/linux32_sysvec.c2
-rw-r--r--sys/compat/svr4/svr4_sysvec.c2
-rw-r--r--sys/i386/ibcs2/ibcs2_sysvec.c2
-rw-r--r--sys/i386/linux/linux_sysvec.c2
-rw-r--r--sys/sys/exec.h3
-rw-r--r--sys/sys/module.h17
6 files changed, 21 insertions, 7 deletions
diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c
index b9b182ed0e7c..f8719c40ce28 100644
--- a/sys/amd64/linux32/linux32_sysvec.c
+++ b/sys/amd64/linux32/linux32_sysvec.c
@@ -1210,4 +1210,4 @@ static moduledata_t linux_elf_mod = {
0
};
-DECLARE_MODULE(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);
+DECLARE_MODULE_TIED(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);
diff --git a/sys/compat/svr4/svr4_sysvec.c b/sys/compat/svr4/svr4_sysvec.c
index e15232b5e3c4..b6ff15316af5 100644
--- a/sys/compat/svr4/svr4_sysvec.c
+++ b/sys/compat/svr4/svr4_sysvec.c
@@ -309,5 +309,5 @@ static moduledata_t svr4_elf_mod = {
svr4_elf_modevent,
0
};
-DECLARE_MODULE(svr4elf, svr4_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);
+DECLARE_MODULE_TIED(svr4elf, svr4_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);
MODULE_DEPEND(svr4elf, streams, 1, 1, 1);
diff --git a/sys/i386/ibcs2/ibcs2_sysvec.c b/sys/i386/ibcs2/ibcs2_sysvec.c
index 71d48a3dbc02..d69a24464f83 100644
--- a/sys/i386/ibcs2/ibcs2_sysvec.c
+++ b/sys/i386/ibcs2/ibcs2_sysvec.c
@@ -134,4 +134,4 @@ static moduledata_t ibcs2_mod = {
ibcs2_modevent,
0
};
-DECLARE_MODULE(ibcs2, ibcs2_mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
+DECLARE_MODULE_TIED(ibcs2, ibcs2_mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c
index 56582119e775..61e5ccef95a0 100644
--- a/sys/i386/linux/linux_sysvec.c
+++ b/sys/i386/linux/linux_sysvec.c
@@ -1179,4 +1179,4 @@ static moduledata_t linux_elf_mod = {
0
};
-DECLARE_MODULE(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);
+DECLARE_MODULE_TIED(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);
diff --git a/sys/sys/exec.h b/sys/sys/exec.h
index 8c95c36e6874..140ab2e6df51 100644
--- a/sys/sys/exec.h
+++ b/sys/sys/exec.h
@@ -115,7 +115,8 @@ int exec_unregister(const struct execsw *);
__CONCAT(name,_modevent), \
(void *)& execsw_arg \
}; \
- DECLARE_MODULE(name, __CONCAT(name,_mod), SI_SUB_EXEC, SI_ORDER_ANY)
+ DECLARE_MODULE_TIED(name, __CONCAT(name,_mod), SI_SUB_EXEC, \
+ SI_ORDER_ANY)
#endif
#endif
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 \