Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Oct 2010 15:57:17 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r214421 - in stable/8/sys: amd64/linux32 compat/svr4 i386/ibcs2 i386/linux sys
Message-ID:  <201010271557.o9RFvHju013016@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Oct 27 15:57:17 2010
New Revision: 214421
URL: http://svn.freebsd.org/changeset/base/214421

Log:
  MFC r213716:
  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.

Modified:
  stable/8/sys/amd64/linux32/linux32_sysvec.c
  stable/8/sys/compat/svr4/svr4_sysvec.c
  stable/8/sys/i386/ibcs2/ibcs2_sysvec.c
  stable/8/sys/i386/linux/linux_sysvec.c
  stable/8/sys/sys/exec.h
  stable/8/sys/sys/module.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- stable/8/sys/amd64/linux32/linux32_sysvec.c	Wed Oct 27 15:44:49 2010	(r214420)
+++ stable/8/sys/amd64/linux32/linux32_sysvec.c	Wed Oct 27 15:57:17 2010	(r214421)
@@ -1205,4 +1205,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);

Modified: stable/8/sys/compat/svr4/svr4_sysvec.c
==============================================================================
--- stable/8/sys/compat/svr4/svr4_sysvec.c	Wed Oct 27 15:44:49 2010	(r214420)
+++ stable/8/sys/compat/svr4/svr4_sysvec.c	Wed Oct 27 15:57:17 2010	(r214421)
@@ -306,5 +306,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);

Modified: stable/8/sys/i386/ibcs2/ibcs2_sysvec.c
==============================================================================
--- stable/8/sys/i386/ibcs2/ibcs2_sysvec.c	Wed Oct 27 15:44:49 2010	(r214420)
+++ stable/8/sys/i386/ibcs2/ibcs2_sysvec.c	Wed Oct 27 15:57:17 2010	(r214421)
@@ -131,4 +131,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);

Modified: stable/8/sys/i386/linux/linux_sysvec.c
==============================================================================
--- stable/8/sys/i386/linux/linux_sysvec.c	Wed Oct 27 15:44:49 2010	(r214420)
+++ stable/8/sys/i386/linux/linux_sysvec.c	Wed Oct 27 15:57:17 2010	(r214421)
@@ -1167,4 +1167,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);

Modified: stable/8/sys/sys/exec.h
==============================================================================
--- stable/8/sys/sys/exec.h	Wed Oct 27 15:44:49 2010	(r214420)
+++ stable/8/sys/sys/exec.h	Wed Oct 27 15:57:17 2010	(r214421)
@@ -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

Modified: stable/8/sys/sys/module.h
==============================================================================
--- stable/8/sys/sys/module.h	Wed Oct 27 15:44:49 2010	(r214420)
+++ stable/8/sys/sys/module.h	Wed Oct 27 15:57:17 2010	(r214421)
@@ -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							\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010271557.o9RFvHju013016>