Source-Changes-HG archive

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

[src/trunk]: src/share/man/man9 Add documentation on the module_{, un}register...



details:   https://anonhg.NetBSD.org/src/rev/1c6d969a0dfc
branches:  trunk
changeset: 323174:1c6d969a0dfc
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sun Jun 03 01:50:28 2018 +0000

description:
Add documentation on the module_{,un}register_callbacks() routines.

XXX Still need to document the module_specificdata_* stuff, which
XXX needs to refer to a non-existent specificdata(9) man page!

diffstat:

 share/man/man9/module.9 |  34 ++++++++++++++++++++++++++++++----
 1 files changed, 30 insertions(+), 4 deletions(-)

diffs (68 lines):

diff -r 87ce965149dd -r 1c6d969a0dfc share/man/man9/module.9
--- a/share/man/man9/module.9   Sun Jun 03 01:08:55 2018 +0000
+++ b/share/man/man9/module.9   Sun Jun 03 01:50:28 2018 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: module.9,v 1.43 2018/05/28 22:22:54 pgoyette Exp $
+.\"    $NetBSD: module.9,v 1.44 2018/06/03 01:50:28 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 May 29, 2018
+.Dd June 3, 2018
 .Dt MODULE 9
 .Os
 .Sh NAME
@@ -75,6 +75,11 @@
 .Fn module_builtin_require_force "void"
 .Ft void
 .Fn module_load_vfs_init "void"
+.Ft "void *"
+.Fn module_register_callbacks "void (*)(struct module *)" \
+"void (*unload)(struct module *)"
+.Ft void
+.Fn module_unregister_callbacks "void *"
 .Sh DESCRIPTION
 Modules are sections of code that can be independently linked and selectively
 loaded into or unloaded from a running kernel.
@@ -443,14 +448,35 @@
 is called near the end of system initialization, after the
 .Xr init 8
 process is created.
-.It Fn module_load_vfs_init
+.It Fn module_load_vfs_init "void"
 The module subsystem is initialized early, long before any file systems
 are available.
 After the root file system is mounted,
-.Fn module_load_vfs_init
+.Fn module_load_vfs_init "void"
 is used to enable loading modules from the file system.
 Until this routine is called, modules can only be loaded if they were
 built-in to the kernel image or provided by the boot loader.
+.It Fn module_register_callbacks "void (*load)(struct module *)" \
+"void (*unload)(struct module *)"
+Register a new set of callbacks.
+The
+.Fa load
+callback is invoked after any module (including this module) is
+successfully loaded; the
+.Fa unload
+callback is invoked before any module is unloaded.
+Each load or unload event can result in multiple invocations of the
+callback routines.
+An opaque cookie is returned which can be passed to
+.Fn module_unregister_callbacks .
+.It Fn module_unregister_callbacks "void *opaque"
+Unregister a set of callback routines previously registered with
+.Fn module_register_callbacks .
+The
+.Fa opaque
+argument should be the return value from the previous
+.Fn module_register_callbacks
+call.
 .El
 .Sh PROGRAMMING CONSIDERATIONS
 The module subsystem is designed to be called recursively, but only within



Home | Main Index | Thread Index | Old Index