| @@ -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 |
125 | The module provides miscellaneous kernel services | | 125 | The module provides miscellaneous kernel services |
126 | .El | | 126 | .El |
127 | .Pp | | 127 | .Pp |
128 | The | | 128 | The |
129 | .Fa name | | 129 | .Fa name |
130 | argument provides the name of the module. | | 130 | argument provides the name of the module. |
131 | Loaded modules, including those that are built-in to the kernel, must all | | 131 | Loaded modules, including those that are built-in to the kernel, must all |
132 | have unique names. | | 132 | have unique names. |
133 | .Pp | | 133 | .Pp |
134 | The | | 134 | The |
135 | .Fa required | | 135 | .Fa required |
136 | argument contains a comma-separated list of module names that are required | | 136 | argument is a quoted string containing a comma-separated list of module |
137 | by this module. | | 137 | names that are required by this module. |
138 | The list must not contain any white-space. | | 138 | The list must not contain any white-space. |
139 | When a module is loaded, all of its required modules are auto-loaded and | | 139 | When a module is loaded, all of its required modules are auto-loaded and |
140 | initialized before the module itself is loaded. | | 140 | initialized before the module itself is loaded. |
141 | Loading of required modules is a recursive operation. | | 141 | Loading of required modules is a recursive operation. |
142 | .Pp | | 142 | .Pp |
| | | 143 | If there are no required modules, this argument should be specified as |
| | | 144 | .Dv NULL . |
| | | 145 | .Pp |
143 | In addition to the explicit arguments, the | | 146 | In addition to the explicit arguments, the |
144 | .Fn MODULE | | 147 | .Fn MODULE |
145 | macro creates a reference to the module's | | 148 | macro creates a reference to the module's |
146 | .Fn modcmd | | 149 | .Fn modcmd |
147 | function. | | 150 | function. |
148 | This function is defined as: | | 151 | This 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 |
| | | 159 | macro). |
| | | 160 | .Pp |
154 | The | | 161 | The |
155 | .Fa cmd | | 162 | .Fa cmd |
156 | argument requests one of the following operations: | | 163 | argument 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 |
159 | Perform module-specific initialization when the module is loaded. | | 166 | Perform module-specific initialization when the module is loaded. |
160 | .It Dv MODULE_CMD_FINI | | 167 | .It Dv MODULE_CMD_FINI |
161 | Perform module-specific clean-up before the module is unloaded. | | 168 | Perform module-specific clean-up before the module is unloaded. |
162 | .It Dv MODULE_CMD_AUTOUNLOAD | | 169 | .It Dv MODULE_CMD_AUTOUNLOAD |
163 | Notify the module that it is about to be unloaded. | | 170 | Notify the module that it is about to be unloaded. |
164 | .It Dv MODULE_CMD_STAT | | 171 | .It Dv MODULE_CMD_STAT |
165 | Request the module to provide status information (not currently implemented). | | 172 | Request the module to provide status information (not currently implemented). |
166 | .El | | 173 | .El |