Sat Dec 16 21:13:07 2017 UTC ()
Explicitly note that the required argument to the MODULE() macro is
a quoted string, or NULL.


(pgoyette)
diff -r1.39 -r1.40 src/share/man/man9/module.9

cvs diff -r1.39 -r1.40 src/share/man/man9/module.9 (expand / switch to unified diff)

--- src/share/man/man9/module.9 2017/12/16 12:40:30 1.39
+++ src/share/man/man9/module.9 2017/12/16 21:13:07 1.40
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: module.9,v 1.39 2017/12/16 12:40:30 pgoyette Exp $ 1.\" $NetBSD: module.9,v 1.40 2017/12/16 21:13:07 pgoyette Exp $
2.\" 2.\"
3.\" Copyright (c) 2010 The NetBSD Foundation, Inc. 3.\" Copyright (c) 2010 The NetBSD Foundation, Inc.
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation 6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Andrew Doran. 7.\" by Andrew Doran.
8.\" 8.\"
9.\" Redistribution and use in source and binary forms, with or without 9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions 10.\" modification, are permitted provided that the following conditions
11.\" are met: 11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright 12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer. 13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" 2. Redistributions in binary form must reproduce the above copyright
@@ -123,44 +123,51 @@ The module provides a buffer queue strat @@ -123,44 +123,51 @@ The module provides a buffer queue strat
123.Xr bufq 9 123.Xr bufq 9
124.It Dv MODULE_CLASS_MISC 124.It Dv MODULE_CLASS_MISC
125The module provides miscellaneous kernel services 125The module provides miscellaneous kernel services
126.El 126.El
127.Pp 127.Pp
128The 128The
129.Fa name 129.Fa name
130argument provides the name of the module. 130argument provides the name of the module.
131Loaded modules, including those that are built-in to the kernel, must all 131Loaded modules, including those that are built-in to the kernel, must all
132have unique names. 132have unique names.
133.Pp 133.Pp
134The 134The
135.Fa required 135.Fa required
136argument contains a comma-separated list of module names that are required 136argument is a quoted string containing a comma-separated list of module
137by this module. 137names that are required by this module.
138The list must not contain any white-space. 138The list must not contain any white-space.
139When a module is loaded, all of its required modules are auto-loaded and 139When a module is loaded, all of its required modules are auto-loaded and
140initialized before the module itself is loaded. 140initialized before the module itself is loaded.
141Loading of required modules is a recursive operation. 141Loading of required modules is a recursive operation.
142.Pp 142.Pp
 143If there are no required modules, this argument should be specified as
 144.Dv NULL .
 145.Pp
143In addition to the explicit arguments, the 146In addition to the explicit arguments, the
144.Fn MODULE 147.Fn MODULE
145macro creates a reference to the module's 148macro creates a reference to the module's
146.Fn modcmd 149.Fn modcmd
147function. 150function.
148This function is defined as: 151This function is defined as:
149.Bl -tag -width modcmd -offset indent 152.Bl -tag -width modcmd -offset indent
150.It Ft int 153.It Ft int
151.Fn modcmd "modcmd_t cmd" "void *data" 154.Fn xxx_modcmd "modcmd_t cmd" "void *data"
152.El 155.El
153.Pp 156.Pp
 157(where xxx is the name of the module, from the
 158.Dv MODULE
 159macro).
 160.Pp
154The 161The
155.Fa cmd 162.Fa cmd
156argument requests one of the following operations: 163argument requests one of the following operations:
157.Bl -tag -width MODULE_CMD_AUTOUNLOAD -offset indent 164.Bl -tag -width MODULE_CMD_AUTOUNLOAD -offset indent
158.It Dv MODULE_CMD_INIT 165.It Dv MODULE_CMD_INIT
159Perform module-specific initialization when the module is loaded. 166Perform module-specific initialization when the module is loaded.
160.It Dv MODULE_CMD_FINI 167.It Dv MODULE_CMD_FINI
161Perform module-specific clean-up before the module is unloaded. 168Perform module-specific clean-up before the module is unloaded.
162.It Dv MODULE_CMD_AUTOUNLOAD 169.It Dv MODULE_CMD_AUTOUNLOAD
163Notify the module that it is about to be unloaded. 170Notify the module that it is about to be unloaded.
164.It Dv MODULE_CMD_STAT 171.It Dv MODULE_CMD_STAT
165Request the module to provide status information (not currently implemented). 172Request the module to provide status information (not currently implemented).
166.El 173.El