Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/pgoyette-compat]: src At the request of reviewers, remove the module ali...



details:   https://anonhg.NetBSD.org/src/rev/a3e6980434ec
branches:  pgoyette-compat
changeset: 830626:a3e6980434ec
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Fri Sep 07 23:32:29 2018 +0000

description:
At the request of reviewers, remove the module alias functionality.

We will rely only on module names and duplicate-symbol detection to
detect module conflicts.

diffstat:

 doc/COMPAT-branch-notes               |   42 +++++------
 sbin/modstat/main.c                   |    6 +-
 sbin/modstat/modstat.8                |   13 +--
 share/man/man9/module.9               |   35 +--------
 sys/compat/common/compat_mod.c        |   12 +--
 sys/compat/common/compat_sysv_mod.c   |   11 +--
 sys/compat/common/kern_mod_80.c       |   41 +-----------
 sys/compat/netbsd32/netbsd32_module.c |  120 ++++++---------------------------
 sys/kern/kern_module.c                |   62 +-----------------
 sys/kern/sys_module.c                 |   42 +-----------
 sys/sys/module.h                      |   16 +---
 11 files changed, 66 insertions(+), 334 deletions(-)

diffs (truncated from 864 to 300 lines):

diff -r 352fdcb77f95 -r a3e6980434ec doc/COMPAT-branch-notes
--- a/doc/COMPAT-branch-notes   Thu Sep 06 21:37:43 2018 +0000
+++ b/doc/COMPAT-branch-notes   Fri Sep 07 23:32:29 2018 +0000
@@ -1,16 +1,17 @@
-/* $NetBSD: COMPAT-branch-notes,v 1.1.2.22 2018/09/06 08:22:10 pgoyette Exp $ */
+/* $NetBSD: COMPAT-branch-notes,v 1.1.2.23 2018/09/07 23:32:29 pgoyette Exp $ */
 
 DONE
 ----
-1.  Removed linking of the kernel compat object library into all kernels;
-    using the .o library caused some build breakage, and resulted in the
-    bulk of the compat code being included in every kernel, but without
-    any module linkage.  In turn, this caused failure when loading some
-    modules due to symbols already being defined in the kernel.
+1.  Returned the build to use a .a compat library rather than a .o
+    library.  The original method used was .a but that was changed
+    (fairly recently) as a work-around to address some support
+    routines that were not being included when needed.  These support
+    modules are now included in their own module, and the work-around
+    is therefore no longer needed.
 
-2.  Reverted some intentional breakage for loading the sysv_ipc module;
-    the breakage was introduced as the fix for the above-mentioned build
-    breakage.  
+2.  Reverted some intentional auto-load breakage for loading the sysv_ipc
+    module; the breakage was introduced as the fix for the above-mentioned
+    build breakage.  
 
 3.  Split the sysv_ipc compat routines into their own compat_sysv module.
 
@@ -19,34 +20,27 @@
 5.  Extracted some net/if.c compat routines into the compat module, and
     replaced the originals with indirect (vectored) function calls.
 
-6.  Implemented a mechanism for modules to include "aliases", allowing
-    a single module file to declare multiple names.  For example, a
-    single "compat" module could declare compat_80, compat_70, etc, and
-    other modules could depend on specific compat levels rather than on
-    the entirety of compat.
-
-7.  Reconfirmed existing compat-module dependencies, and update the
+6.  Reconfirmed existing compat-module dependencies, and update the
     defopt/defflag lines in the config files* as needed, to insure that
     built-in dependencies get resolved.
 
-8.  Fixed limits on the number of module depedencies and maximum
+7.  Fixed limits on the number of module depedencies and maximum
     recursion level have been removed.  Previous code for reporting
     module status to userland has been versioned and moved to the
     compat_80 module.
 
-9.  The old monolithic compat module has been broken into multiple
+8.  The old monolithic compat module has been broken into multiple
     modules, one for each old NetBSD version.  The monolithic module
-    is still available, and uses the alias mechanism to "advertise"
-    that the component modules are available.
+    is still available.
 
     Similarly, the compat_sysv module has also been split into several
-    version-specific modules.  (A mini-monolithic compat_sysv module
-    is still provided.)
+    version-specific modules, and the mini-monolithic compat_sysv module
+    is still provided.
 
-10. syscalls.master has been updated to autoload the version-specific
+9.  syscalls.master has been updated to autoload the version-specific
     compat modules rather than the monolithic modules.
 
-11. Separated COMPAT_BSDPTY stuff, allowing the COMPAT_60 module to be
+10. Separated COMPAT_BSDPTY stuff, allowing the COMPAT_60 module to be
     built regardless.
 
 
diff -r 352fdcb77f95 -r a3e6980434ec sbin/modstat/main.c
--- a/sbin/modstat/main.c       Thu Sep 06 21:37:43 2018 +0000
+++ b/sbin/modstat/main.c       Fri Sep 07 23:32:29 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.24.12.2 2018/04/03 08:29:44 pgoyette Exp $  */
+/*     $NetBSD: main.c,v 1.24.12.3 2018/09/07 23:32:30 pgoyette Exp $  */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.24.12.2 2018/04/03 08:29:44 pgoyette Exp $");
+__RCSID("$NetBSD: main.c,v 1.24.12.3 2018/09/07 23:32:30 pgoyette Exp $");
 #endif /* !lint */
 
 #include <sys/module.h>
@@ -67,7 +67,7 @@
 const unsigned int source_max = __arraycount(sources);
 
 static const char *modflags[] = {
-       "-", "f", "a", "af", "A", "Af", "Aa", "Aaf"
+       "-", "f", "a", "af"
 };
 
 int
diff -r 352fdcb77f95 -r a3e6980434ec sbin/modstat/modstat.8
--- a/sbin/modstat/modstat.8    Thu Sep 06 21:37:43 2018 +0000
+++ b/sbin/modstat/modstat.8    Fri Sep 07 23:32:29 2018 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: modstat.8,v 1.22.12.2 2018/03/15 10:03:04 pgoyette Exp $
+.\" $NetBSD: modstat.8,v 1.22.12.3 2018/09/07 23:32:30 pgoyette Exp $
 .\"
 .\" Copyright (c) 1993 Christopher G. Demetriou
 .\" All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\" <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
 .\"
-.Dd September 12, 2016
+.Dd September 8, 2018
 .Dt MODSTAT 8
 .Os
 .Sh NAME
@@ -40,8 +40,8 @@
 .Nd display status of loaded kernel modules
 .Sh SYNOPSIS
 .Nm
-.Op Fl Aaen
-.Op Ar name
+.Op Fl Aaek
+.Op Fl n Ar name | name
 .Sh DESCRIPTION
 The
 .Nm
@@ -102,11 +102,6 @@
 flag
 .Fl f
 (force) to be loaded.
-.It Dv A
-The named module is an alias for another module.
-The REQUIRES column contains the
-.Dq real
-module name.
 .El
 .It Li REFS
 Number of references held on the module.
diff -r 352fdcb77f95 -r a3e6980434ec share/man/man9/module.9
--- a/share/man/man9/module.9   Thu Sep 06 21:37:43 2018 +0000
+++ b/share/man/man9/module.9   Fri Sep 07 23:32:29 2018 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: module.9,v 1.42.2.7 2018/06/25 07:25:37 pgoyette Exp $
+.\"    $NetBSD: module.9,v 1.42.2.8 2018/09/07 23:32:30 pgoyette Exp $
 .\"
 .\" Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd June 19, 2018
+.Dd September 8, 2018
 .Dt MODULE 9
 .Os
 .Sh NAME
@@ -52,7 +52,6 @@
 .Sh SYNOPSIS
 .In sys/module.h
 .Fn MODULE "class" "name" "required"
-.Fn MODULE_WITH_ALIASES "class" "name" "required" "aliases"
 .Ft int
 .Fn module_load "const char *name" "int flags" "prop_dictionary_t props" \
 "modclass_t class"
@@ -125,12 +124,9 @@
 .Sh FUNCTIONS
 .Bl -tag -width abcd
 .It Fn MODULE "class" "name" "required"
-.It Fn MODULE_WITH_ALIASES "class" "name" "required" "aliases"
 The
 .Fn MODULE
-and
-.Fn MODULE_WITH_ALIASES
-macros create and initialize a
+macro creates and initialize a
 .Vt modinfo_t
 structure.
 The
@@ -173,30 +169,7 @@
 initialized before the module itself is loaded.
 Loading of required modules is a recursive operation.
 .Pp
-The
-.Fa aliases
-argument is a pointer to a NULL-terminated constant array of constant
-strings.
-Each string in the array is an alternate name (i.e., an alias) of the
-module.
-Module names and aliases must all be unique; a module cannot be loaded
-if its name or any of its aliases matches the name or an alias of any
-already-loaded module.
-(Module names are displayed by the
-.Xr modstat 8
-utility, with an
-.Dv A
-in the flags column.)
-.Pp
-For example,
-.Bd -literal
-       const char * const my_pets[] = { "dog", "cat", "bird", NULL };
-
-       MODULE_WITH_ALIASES(MODULE_CLASS_MISC, pets, NULL, &my_pets);
-.Ed
-.Pp
-If there are no required modules or aliases, these arguments should be
-specified as
+If there are no required modules, this argument should be specified as
 .Dv NULL .
 .Pp
 In addition to the explicit arguments, the
diff -r 352fdcb77f95 -r a3e6980434ec sys/compat/common/compat_mod.c
--- a/sys/compat/common/compat_mod.c    Thu Sep 06 21:37:43 2018 +0000
+++ b/sys/compat/common/compat_mod.c    Fri Sep 07 23:32:29 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_mod.c,v 1.24.14.36 2018/05/21 04:36:03 pgoyette Exp $   */
+/*     $NetBSD: compat_mod.c,v 1.24.14.37 2018/09/07 23:32:30 pgoyette Exp $   */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_mod.c,v 1.24.14.36 2018/05/21 04:36:03 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_mod.c,v 1.24.14.37 2018/09/07 23:32:30 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -53,13 +53,7 @@
 #include <compat/common/compat_util.h>
 #include <compat/common/compat_mod.h>
 
-static const char * const compat_includes[] = {
-       "compat_80", "compat_70", "compat_60", "compat_50", "compat_40",
-       "compat_30", "compat_20", "compat_16", "compat_14", "compat_13",
-       "compat_12", "compat_10", "compat_09", "compat_43", NULL
-};
-
-MODULE_WITH_ALIASES(MODULE_CLASS_EXEC, compat, NULL, &compat_includes);
+MODULE(MODULE_CLASS_EXEC, compat, NULL);
 
 extern krwlock_t ttcompat_lock;
 
diff -r 352fdcb77f95 -r a3e6980434ec sys/compat/common/compat_sysv_mod.c
--- a/sys/compat/common/compat_sysv_mod.c       Thu Sep 06 21:37:43 2018 +0000
+++ b/sys/compat/common/compat_sysv_mod.c       Fri Sep 07 23:32:29 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_sysv_mod.c,v 1.4.10.3 2018/09/04 11:25:53 pgoyette Exp $        */
+/*     $NetBSD: compat_sysv_mod.c,v 1.4.10.4 2018/09/07 23:32:30 pgoyette Exp $        */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_sysv_mod.c,v 1.4.10.3 2018/09/04 11:25:53 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_sysv_mod.c,v 1.4.10.4 2018/09/07 23:32:30 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -46,12 +46,7 @@
 
 #include <compat/common/compat_sysv_mod.h>
 
-static const char * const compat_sysv_includes[] = {
-        "compat_sysv_50", "compat_sysv_14", "compat_sysv_10", NULL
-};
-
-MODULE_WITH_ALIASES(MODULE_CLASS_EXEC, compat_sysv, "sysv_ipc",
-    &compat_sysv_includes);
+MODULE(MODULE_CLASS_EXEC, compat_sysv, "sysv_ipc");
 
 /* Build the syscall package based on options specified */
 
diff -r 352fdcb77f95 -r a3e6980434ec sys/compat/common/kern_mod_80.c
--- a/sys/compat/common/kern_mod_80.c   Thu Sep 06 21:37:43 2018 +0000
+++ b/sys/compat/common/kern_mod_80.c   Fri Sep 07 23:32:29 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_mod_80.c,v 1.1.2.3 2018/09/06 21:37:43 pgoyette Exp $     */
+/*     $NetBSD: kern_mod_80.c,v 1.1.2.4 2018/09/07 23:32:30 pgoyette Exp $     */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_mod_80.c,v 1.1.2.3 2018/09/06 21:37:43 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_mod_80.c,v 1.1.2.4 2018/09/07 23:32:30 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_modular.h"
@@ -51,18 +51,6 @@
 
 #include <compat/common/compat_mod.h>
 



Home | Main Index | Thread Index | Old Index