Partial update for new module interfaces. This update addresses the

new accessor functions and changes to module_hold() and module_rele(),
and fixes the prototype of each module's xxx_modcmd() function.

We still need updates related to the "specificdata" and callback
changes:

    specificdata_key_t module_specific_key_create(specificdata_key_t *,
						specificdata_dtor_t);
    void   module_specific_key_delete(specificdata_key_t);
    void   *module_getspecific(module_t *, specificdata_key_t);
    void   module_setspecific(module_t *, specificdata_key_t, void *);
    void   *module_register_callbacks(void (*)(struct module *),
	                                     void (*)(struct module *));
    void   module_unregister_callbacks(void *);

XXX The various functions listed in the man page should grouped into a
XXX few logical sub-sets.
This commit is contained in:
pgoyette 2018-05-28 22:22:54 +00:00
parent 239071d590
commit 4351800068

View File

@ -1,4 +1,4 @@
.\" $NetBSD: module.9,v 1.42 2017/12/20 10:01:38 wiz Exp $
.\" $NetBSD: module.9,v 1.43 2018/05/28 22:22:54 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 December 16, 2017
.Dd May 29, 2018
.Dt MODULE 9
.Os
.Sh NAME
@ -38,7 +38,10 @@
.Nm module_init_class ,
.Nm module_hold ,
.Nm module_rele ,
.Nm module_find_section
.Nm module_find_section ,
.Nm module_kernel ,
.Nm module_name ,
.Nm module_source
.Nd kernel module loader
.Sh SYNOPSIS
.In sys/module.h
@ -53,11 +56,17 @@
.Ft void
.Fn module_init_class "modclass_t class"
.Ft int
.Fn module_hold "const char *name"
.Fn module_hold "module_t *module"
.Ft void
.Fn module_rele "const char *"
.Fn module_rele "module_t *module"
.Ft int
.Fn module_find_section "const char *" "void **" "size_t *"
.Ft "module_t *"
.Fn module_kernel "void"
.Ft "const char *"
.Fn module_name "struct module *module"
.Ft modsrc_t
.Fn module_source "struct module *module"
.Ft void
.Fn module_init "void"
.Ft void
@ -150,7 +159,7 @@ macro creates a reference to the module's
function.
This function is defined as:
.Bl -tag -width modcmd -offset indent
.It Ft int
.It Ft modcmd_t
.Fn xxx_modcmd "modcmd_t cmd" "void *data"
.El
.Pp
@ -383,10 +392,10 @@ Load and initialize all available modules of the specified
.Fa class .
Any built-in modules that have not been disabled, and any modules provided
by the boot loader are loaded.
.It Fn module_hold "name"
.It Fn module_hold "module"
Increment the reference count of a module.
A module cannot be unloaded if its reference count is non-zero.
.It Fn module_rele "name"
.It Fn module_rele "module"
Decrement the reference count of a module.
.It Fn module_find_section "name" "addr" "size"
Find the start address and size of linker section
@ -396,6 +405,18 @@ The miniroot module uses this routine to find the address and size of the
embedded file system image.
This routine can only examine the linker data for the module that is
currently being initialized; it cannot examine data for any other module.
.It Fn module_kernel "void"
Returns a pointer to a
.Ft module_t
structure describing the kernel module.
.It Fn module_name module
Returns a pointer to the module's name.
.It Fn module_source module
Returns the source of the module, one of
.Dv MODULE_SOURCE_KERNEL ,
.Dv MODULE_SOURCE_BOOT ,
or
.Dv MODULE_SOURCE_FILESYS .
.It Fn module_init "void"
Initialize the module subsystem.
Creates and initializes various data structures, locates all built-in