Module Name: src Committed By: pgoyette Date: Sun Jun 3 10:34:59 UTC 2018
Modified Files: src/share/man/man9: Makefile module.9 Log Message: Finish documenting the new modules(9) interfaces by adding the module specificdata routines. To generate a diff of this commit: cvs rdiff -u -r1.425 -r1.426 src/share/man/man9/Makefile cvs rdiff -u -r1.45 -r1.46 src/share/man/man9/module.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/share/man/man9/Makefile diff -u src/share/man/man9/Makefile:1.425 src/share/man/man9/Makefile:1.426 --- src/share/man/man9/Makefile:1.425 Sun Jun 3 09:22:34 2018 +++ src/share/man/man9/Makefile Sun Jun 3 10:34:59 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.425 2018/06/03 09:22:34 pgoyette Exp $ +# $NetBSD: Makefile,v 1.426 2018/06/03 10:34:59 pgoyette Exp $ # Makefile for section 9 (kernel function and variable) manual pages. @@ -522,6 +522,7 @@ MLINKS+=microuptime.9 binuptime.9 \ MLINKS+=module.9 module_autoload.9 \ module.9 module_builtin_require_force.9 \ module.9 module_find_section.9 \ + module.9 module_getspecific.9 \ module.9 module_hold.9 \ module.9 module_init.9 \ module.9 module_init_class.9 \ @@ -530,7 +531,10 @@ MLINKS+=module.9 module_autoload.9 \ module.9 module_load_vfs_init.9 \ module.9 module_name.9 \ module.9 module_rele.9 \ + module.9 module_setspecific.9 \ module.9 module_source.9 \ + module.9 module_specific_key_create.9 \ + module.9 module_specific_key_delete.9 \ module.9 module_start_unload_thread.9 \ module.9 module_unload.9 \ module.9 module_register_callbacks.9 \ Index: src/share/man/man9/module.9 diff -u src/share/man/man9/module.9:1.45 src/share/man/man9/module.9:1.46 --- src/share/man/man9/module.9:1.45 Sun Jun 3 01:52:47 2018 +++ src/share/man/man9/module.9 Sun Jun 3 10:34:59 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: module.9,v 1.45 2018/06/03 01:52:47 pgoyette Exp $ +.\" $NetBSD: module.9,v 1.46 2018/06/03 10:34:59 pgoyette Exp $ .\" .\" Copyright (c) 2010 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -43,7 +43,11 @@ .Nm module_name , .Nm module_source , .Nm module_register_callbacks , -.Nm module_unregister_callbacks +.Nm module_unregister_callbacks , +.Nm module_specific_key_create , +.Nm module_specific_key_delete , +.Nm module_getspecific , +.Nm module_setspecific .Nd kernel module loader .Sh SYNOPSIS .In sys/module.h @@ -82,6 +86,15 @@ "void (*unload)(struct module *)" .Ft void .Fn module_unregister_callbacks "void *" +.Ft specificdata_key_t +.Fn module_specific_key_create "specificdata_key_t *keyp" \ +"specificdata_dtor_t dtor" +.Ft void +.Fn module_specific_key_delete "specificdata_key_t key" +.Ft "void *" +.Fn module_getspecific "module_t *mod" "specificdata_key_t key" +.Ft "void *" +.Fn module_setspecific "module_t *mod" "specificdata_key_t key" "void *data" .Sh DESCRIPTION Modules are sections of code that can be independently linked and selectively loaded into or unloaded from a running kernel. @@ -479,6 +492,31 @@ The argument should be the return value from the previous .Fn module_register_callbacks call. +.It module_specific_key_create "specificdata_key_t *keyp" \ +"specificdata_dtor_t dtor" +Creates a new specificdata_key for use within the +.Nm +domain. +The key identifier is returned in +.Fa keyp . +.It module_specific_key_delete "specificdata_key_t key" +Deletes the specified specificdata_key +.Fa key +from the +.Nm domain. +.It module_getspecific "module_t *mod" "specificdata_key_t key" +Retrieves the value associated with +.Fa key +from module +.Fa mod . +.It module_setspecific "module_t *mod" "specificdata_key_t key" "void *data" +Stores +.Fa data +as the value associated with +.Fa key +for module +.Fa mod . + .El .Sh PROGRAMMING CONSIDERATIONS The module subsystem is designed to be called recursively, but only within