CVS commit: src/share/man/man9
Module Name:src Committed By: andvar Date: Sun Aug 8 16:12:10 UTC 2021 Modified Files: src/share/man/man9: autoconf.9 Log Message: change othersize to otherwise. I believe this is what was meant in the context. To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/share/man/man9/autoconf.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/autoconf.9 diff -u src/share/man/man9/autoconf.9:1.34 src/share/man/man9/autoconf.9:1.35 --- src/share/man/man9/autoconf.9:1.34 Sat Aug 7 20:41:17 2021 +++ src/share/man/man9/autoconf.9 Sun Aug 8 16:12:10 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: autoconf.9,v 1.34 2021/08/07 20:41:17 uwe Exp $ +.\" $NetBSD: autoconf.9,v 1.35 2021/08/08 16:12:10 andvar Exp $ .\" .\" Copyright (c) 2001, 2002, 2021 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -334,7 +334,7 @@ Invokes the driver's match function acco The .Fn config_probe function returns a nonzero integer to indicate a successful probe -and a value of 0 othersize. +and a value of 0 otherwise. Unlike .Fn config_match , the return value of
CVS commit: src/share/man/man9
Module Name:src Committed By: uwe Date: Sat Aug 7 20:41:17 UTC 2021 Modified Files: src/share/man/man9: autoconf.9 Log Message: autoconf(9) - Improve formatting. Don't hide consumed cfargs in the second sentence of a function's description, they ends up hidden towards the right margin and that sentence is guaranteed to get a line break further reducing its readability. Instead make that the first sentence and start the description with a new paragraph. That makes it looks like part of the signature and is much more prominent. Various markup improvements while here. Bump date for thorpej-cfargs2 changes. To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/share/man/man9/autoconf.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/autoconf.9 diff -u src/share/man/man9/autoconf.9:1.33 src/share/man/man9/autoconf.9:1.34 --- src/share/man/man9/autoconf.9:1.33 Sat Aug 7 19:41:13 2021 +++ src/share/man/man9/autoconf.9 Sat Aug 7 20:41:17 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: autoconf.9,v 1.33 2021/08/07 19:41:13 andvar Exp $ +.\" $NetBSD: autoconf.9,v 1.34 2021/08/07 20:41:17 uwe Exp $ .\" .\" Copyright (c) 2001, 2002, 2021 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 April 28, 2021 +.Dd August 7, 2021 .Dt AUTOCONF 9 .Os .Sh NAME @@ -126,42 +126,51 @@ This list is constructed using the .Fn CFARGS macro, like this example: .Bd -literal -offset indent -config_search(self, NULL, -CFARGS(.search = mainbus_search, - .iattr = "mainbus")); +config_search(self, NULL, +CFARGS(.search = mainbus_search, + .iattr = "mainbus")); .Ed .Pp Each tag is followed by a tag-specific value. -.Bl -tag -width ".devhandle" -.It Dv .submatch +.Bl -tag -offset indent -width ".Fa devhandle" +.It Fa submatch A pointer to a .Sq submatch -function used in direct configuration. -.It Dv .search +function used in +.Em direct +configuration. +.\" +.It Fa search A pointer to a .Sq search -function used in indirect configuration. -.It Dv .iattr -A pointer to a constant C string -.Pq const char * +function used in +.Em indirect +configuration. +.\" +.It Fa iattr +A pointer to a constant +.Tn C +string +.Pq Vt "const char *" specifying an interface attribute. If a parent device carries only a single interface attribute, then this argument may be omitted. If an interface attribute is specified that the parent device does not -carry, or no interface attribute is specifies and the parent device carries +carry, or no interface attribute is specified and the parent device carries more than one, behavior is undefined. On kernels built with the .Dv DIAGNOSTIC option, this may result in an assertion panic. -.It Dv .locators -A pointer an a constant array of type -.Sq int -.Pq const int * +.\" +.It Fa locators +A pointer to a constant array of integers +.Pq Vt "const int *" containing interface attribute-specific locators. -.It Dv .devhandle -A devhandle_t -.Pq passed by value -corresponding to the device being attached. +.\" +.It Fa devhandle +A +.Vt devhandle_t +(passed by value) corresponding to the device being attached. .El .Pp If no arguments are to be passed, the special value @@ -170,13 +179,17 @@ may be used in place of the .Fn CFARGS macro. .Sh FUNCTIONS -.Bl -tag -width compact +.Bl -tag -width ".Fn config" +.\" +.\" .It Fn config_search "parent" "aux" "cfargs" -Performs indirect configuration of physical devices. Cfargs consumed: -.Em .search , -.Em .iattr , -.Em .locators . +.Fa search , +.Fa iattr , +.Fa locators . +.\" +.Pp +Performs indirect configuration of physical devices. .Fn config_search iterates over all potential children, calling the given search function @@ -216,13 +229,17 @@ itself. Note that this function is designed so that it can be used to apply an arbitrary function to all potential children. In this case callers may choose to ignore the return value. +.\" +.\" .It Fn config_found "parent" "aux" "print" "cfargs" -Performs direct configuration on a physical device. Cfargs consumed: -.Em .submatch , -.Em .iattr , -.Em .locators , -.Em .devhandle . +.Fa submatch , +.Fa iattr , +.Fa locators , +.Fa devhandle . +.\" +.Pp +Performs direct configuration on a physical device. .Fn config_found is called by the parent and in turn calls the specified submatch function as determined by the configuration table. @@ -249,7 +266,7 @@ argument describes the device that has b internally uses .Fn config_search . The -.Em softc +.Vt softc structure for the matched device will be allocated, and the appropriate driver attach function will be called. If the device is matched, the system prints the name of the child and @@ -277,20 +294,28 @@ and unsupported
CVS commit: src/share/man/man9
Module Name:src Committed By: thorpej Date: Sat Aug 7 16:20:02 UTC 2021 Modified Files: src/share/man/man9: autoconf.9 Log Message: Update for thorpej-cfargs2. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/share/man/man9/autoconf.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/autoconf.9 diff -u src/share/man/man9/autoconf.9:1.31 src/share/man/man9/autoconf.9:1.32 --- src/share/man/man9/autoconf.9:1.31 Wed Apr 28 00:49:22 2021 +++ src/share/man/man9/autoconf.9 Sat Aug 7 16:20:02 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: autoconf.9,v 1.31 2021/04/28 00:49:22 thorpej Exp $ +.\" $NetBSD: autoconf.9,v 1.32 2021/08/07 16:20:02 thorpej Exp $ .\" .\" Copyright (c) 2001, 2002, 2021 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -52,17 +52,17 @@ .In sys/device.h .In sys/errno.h .Ft cfdata_t -.Fn config_search "device_t parent" "void *aux" "cfarg_t tag" "..." +.Fn config_search "device_t parent" "void *aux" "const struct cfargs *" .Ft device_t .Fn config_found "device_t parent" "void *aux" "cfprint_t print" \ -"cfarg_t tag" "..." +"const struct cfargs *" .Ft int .Fn config_match "device_t parent" "cfdata_t cf" "void *aux" .Ft int .Fn config_probe "device_t parent" "cfdata_t cf" "void *aux" .Ft device_t .Fn config_attach "device_t parent" "cfdata_t cf" "void *aux" \ -"cfprint_t print" "cfarg_t tag" "..." +"cfprint_t print" "const struct cfargs *" .Ft device_t .Fn config_attach_pseudo "cfdata_t cf" .Ft int @@ -119,53 +119,64 @@ The unit number identifies an instance o Device data structures are allocated dynamically during autoconfiguration, giving a unique address for each instance. .Pp -Several of the autoconfiguration functions take a variadic list of -tag-value arguments to pass information from driver autoconfiguration +Several of the autoconfiguration functions take a strongly-typed variadic +list of arguments to pass information from driver autoconfiguration functions to the kernel's autoconfiguration system. +This list is constructed using the +.Fn CFARGS +macro, like this example: +.Bd -literal -offset indent +config_search(self, NULL, +CFARGS(.search = mainbus_search, + .iattr = "mainbus")); +.Ed +.Pp Each tag is followed by a tag-specific value. -The end of the argument list must be terminated with the tag -.Dv CFARG_EOL . -Passing an invalid tag or an inappropriate value for a tag results -in undefined behavior and may cause a kernel panic. -.Bl -tag -width "CFARG_DEVHANDLE" -.It Dv CFARG_SUBMATCH +.Bl -tag -width ".devhandle" +.It Dv .submatch A pointer to a .Sq submatch function used in direct configuration. -.It Dv CFARG_SEARCH +.It Dv .search A pointer to a .Sq search function used in indirect configuration. -.It Dv CFARG_IATTR +.It Dv .iattr A pointer to a constant C string .Pq const char * specifying an interface attribute. If a parent device carries only a single interface attribute, then this -tag-value pair may be omitted. +argument may be omitted. If an interface attribute is specified that the parent device does not carry, or no interface attribute is specifies and the parent device carries more than one, behavior is undefined. On kernels built with the .Dv DIAGNOSTIC option, this may result in an assertion panic. -.It Dv CFARG_LOCATORS +.It Dv .locators A pointer an a constant array of type .Sq int .Pq const int * containing interface attribute-specific locators. -.It Dv CFARG_DEVHANDLE +.It Dv .devhandle A devhandle_t .Pq passed by value corresponding to the device being attached. .El +.Pp +If no arguments are to be passed, the special value +.Dv CFARGS_NONE +may be used in place of the +.Fn CFARGS +macro. .Sh FUNCTIONS .Bl -tag -width compact -.It Fn config_search "parent" "aux" "tag" "..." +.It Fn config_search "parent" "aux" "cfargs" Performs indirect configuration of physical devices. -Tag-value arguments consumed: -.Dv CFARG_SEARCH , -.Dv CFARG_IATTR , -.Dv CFARG_LOCATORS . +Cfargs consumed: +.Em .search , +.Em .iattr , +.Em .locators . .Fn config_search iterates over all potential children, calling the given search function @@ -205,13 +216,13 @@ itself. Note that this function is designed so that it can be used to apply an arbitrary function to all potential children. In this case callers may choose to ignore the return value. -.It Fn config_found "parent" "aux" "print" "tag" "..." +.It Fn config_found "parent" "aux" "print" "cfargs" Performs direct configuration on a physical device. -Tag-value arguments consumed: -.Dv CFARG_SUBMATCH , -.Dv CFARG_IATTR , -.Dv CFARG_LOCATORS , -.Dv CFARG_DEVHANDLE . +Cfargs consumed: +.Em .submatch , +.Em .iattr , +.Em .locators , +.Em .devhandle . .Fn config_found is called by the parent and in turn calls the specified submatch function as determined by the configuration table. @@ -301,11 +312,11 @@
CVS commit: src/share/man/man9
Module Name:src Committed By: isaki Date: Sat Aug 7 03:28:42 UTC 2021 Modified Files: src/share/man/man9: kauth.9 Log Message: x68k now uses KAUTH_MACHDEP_UNMANAGEDMEM. To generate a diff of this commit: cvs rdiff -u -r1.112 -r1.113 src/share/man/man9/kauth.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/kauth.9 diff -u src/share/man/man9/kauth.9:1.112 src/share/man/man9/kauth.9:1.113 --- src/share/man/man9/kauth.9:1.112 Sun Jul 15 05:16:41 2018 +++ src/share/man/man9/kauth.9 Sat Aug 7 03:28:42 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: kauth.9,v 1.112 2018/07/15 05:16:41 maxv Exp $ +.\" $NetBSD: kauth.9,v 1.113 2021/08/07 03:28:42 isaki Exp $ .\" .\" Copyright (c) 2005, 2006 Elad Efrat .\" All rights reserved. @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd July 14, 2018 +.Dd August 7, 2021 .Dt KAUTH 9 .Os .Sh NAME @@ -1061,6 +1061,7 @@ Affects .Em powerpc , .Em sh3 , .Em vax , +.Em x68k , .Em xen . .El .Ss Device Scope
CVS commit: src/share/man/man9
Module Name:src Committed By: pgoyette Date: Thu Jul 22 01:38:45 UTC 2021 Modified Files: src/share/man/man9: module.9 Log Message: module_hold() returns void, not int XXX module_hold() and module_rele() should probably not be exposed, since XXX they really aren't MP-safe. To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 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/module.9 diff -u src/share/man/man9/module.9:1.52 src/share/man/man9/module.9:1.53 --- src/share/man/man9/module.9:1.52 Sun Apr 7 22:32:10 2019 +++ src/share/man/man9/module.9 Thu Jul 22 01:38:45 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: module.9,v 1.52 2019/04/07 22:32:10 pgoyette Exp $ +.\" $NetBSD: module.9,v 1.53 2021/07/22 01:38:45 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 April 8, 2019 +.Dd July 21, 2021 .Dt MODULE 9 .Os .Sh NAME @@ -61,7 +61,7 @@ .Fn module_unload "const char *name" .Ft void .Fn module_init_class "modclass_t class" -.Ft int +.Ft void .Fn module_hold "module_t *module" .Ft void .Fn module_rele "module_t *module"
CVS commit: src/share/man/man9
Module Name:src Committed By: simonb Date: Mon May 31 12:24:15 UTC 2021 Modified Files: src/share/man/man9: delay.9 Log Message: Use in the synopsis rather than ; an MI interface should be pulled in via . To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/share/man/man9/delay.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/delay.9 diff -u src/share/man/man9/delay.9:1.7 src/share/man/man9/delay.9:1.8 --- src/share/man/man9/delay.9:1.7 Wed Jul 20 05:20:54 2011 +++ src/share/man/man9/delay.9 Mon May 31 12:24:15 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: delay.9,v 1.7 2011/07/20 05:20:54 jruoho Exp $ +.\" $NetBSD: delay.9,v 1.8 2021/05/31 12:24:15 simonb Exp $ .\" .\" Copyright (c) 2002 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -35,7 +35,7 @@ .Nm DELAY .Nd microsecond delay .Sh SYNOPSIS -.In machine/param.h +.In sys/param.h .Ft void .Fn delay "unsigned int us" .Ft void
CVS commit: src/share/man/man9
Module Name:src Committed By: isaki Date: Sun Mar 28 07:42:06 UTC 2021 Modified Files: src/share/man/man9: audio.9 Log Message: Update documents. - query_format has been mandatory (since at least Feb 2020). - set_params has been replaced to set_format (since May 2019). To generate a diff of this commit: cvs rdiff -u -r1.60 -r1.61 src/share/man/man9/audio.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/audio.9 diff -u src/share/man/man9/audio.9:1.60 src/share/man/man9/audio.9:1.61 --- src/share/man/man9/audio.9:1.60 Sat Feb 6 13:55:40 2021 +++ src/share/man/man9/audio.9 Sun Mar 28 07:42:06 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: audio.9,v 1.60 2021/02/06 13:55:40 nia Exp $ +.\" $NetBSD: audio.9,v 1.61 2021/03/28 07:42:06 isaki Exp $ .\" .\" Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -241,17 +241,13 @@ The and .Va rec structures contain the encoding parameters that should be set to the hardware. -If the driver has query_format, all parameters on -.Va play -and/or -.Va rec -are chosen from formats returned by query_format. +All of these parameters are chosen from formats returned by +.Va query_format . Therefore .Va play and/or .Va rec are always settable. -If the driver does not have query_format, the driver has to validate the format. If the hardware does not support .Dv AUDIO_ENCODING_SLINEAR_{NE,OE}:16 , conversion information should be filled the @@ -355,7 +351,7 @@ The return value also must be non-zero a It is called in the Attach or Closed phases. .It Dv int commit_settings(void *hdl) optional, is called after all calls to -.Va set_params , +.Va set_format , and .Va set_port , are done.
CVS commit: src/share/man/man9
Module Name:src Committed By: rin Date: Sat Mar 6 14:44:02 UTC 2021 Modified Files: src/share/man/man9: kmem.9 Log Message: Fix trivial typo. No need to bump date. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/share/man/man9/kmem.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/kmem.9 diff -u src/share/man/man9/kmem.9:1.27 src/share/man/man9/kmem.9:1.28 --- src/share/man/man9/kmem.9:1.27 Sun Jan 24 17:29:11 2021 +++ src/share/man/man9/kmem.9 Sat Mar 6 14:44:02 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: kmem.9,v 1.27 2021/01/24 17:29:11 thorpej Exp $ +.\" $NetBSD: kmem.9,v 1.28 2021/03/06 14:44:02 rin Exp $ .\" .\" Copyright (c)2006 YAMAMOTO Takashi, .\" All rights reserved. @@ -78,7 +78,7 @@ "size_t size" "void *stackbuf" "size_t stackbufsize" "km_flag_t kmflags" .Ft void .Fn kmem_tmpbuf_free \ -"void *p" "size_t size" "void *stsackbuf" +"void *p" "size_t size" "void *stackbuf" .\" .Pp .Cd "options KMEM_SIZE"
CVS commit: src/share/man/man9
Module Name:src Committed By: nia Date: Sat Feb 6 13:55:40 UTC 2021 Modified Files: src/share/man/man9: audio.9 Log Message: Fix various typos, etc To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/share/man/man9/audio.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/audio.9 diff -u src/share/man/man9/audio.9:1.59 src/share/man/man9/audio.9:1.60 --- src/share/man/man9/audio.9:1.59 Sat Feb 6 06:15:13 2021 +++ src/share/man/man9/audio.9 Sat Feb 6 13:55:40 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: audio.9,v 1.59 2021/02/06 06:15:13 isaki Exp $ +.\" $NetBSD: audio.9,v 1.60 2021/02/06 13:55:40 nia Exp $ .\" .\" Copyright (c) 1999, 2000 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 9, 2019 +.Dd February 2, 2021 .Dt AUDIO 9 .Os .Sh NAME @@ -175,9 +175,9 @@ It should fill the .Vt audio_format_t structure according to given number .Va afp->index . -If there is no format with given number, return +If there is no format with the given number, return .Er EINVAL . -It is called at any time. +It can be called at any time. .Bd -literal typedef struct audio_format_query { u_int index; @@ -185,8 +185,7 @@ typedef struct audio_format_query { } audio_format_query_t; .Ed .Pp -It is also used to determine the default format. -The upper layer chooses the most preferred one as default format by following: +It is also used by the upper layer to determine the default format, as follows: .Bl -enum .It Higher priority is preferred (normally 0, the highest is 3, the lowest is 0). @@ -197,19 +196,19 @@ is preferred if exists. .Dv AUDIO_ENCODING_SLINEAR_OE:16 is preferred if exists. .It -More channels is preferred. +The format with more channels is preferred. .El .Pp If the driver supports .Dv SLINEAR_NE:16 and the upper layer chooses it, -the driver does not need to provide conversion function in +the driver does not need to provide a conversion function in .Va set_format . Similarly, if the driver supports .Dv SLINEAR_OE:16 and the upper layer chooses it, -the driver does not need to provide a conversion function. -Because the upper layer only supports conversion between +the driver does not need to provide a conversion function, +because the upper layer supports conversion between .Dv SLINEAR_NE:16 and .Dv SLINEAR_OE:16 @@ -224,7 +223,7 @@ If the driver can not provide the conver set priority to \-1. It means that the hardware supports this format but the driver does not (e.g. AC3), and it will never be chosen. -.It Dv int set_foramt(void *hdl, int setmode, +.It Dv int set_format(void *hdl, int setmode, .Dv "const audio_params_t *play, const audio_params_t *rec," .Dv "audio_filter_reg_t *pfil, audio_filter_reg_t *rfil)" .Pp @@ -242,8 +241,7 @@ The and .Va rec structures contain the encoding parameters that should be set to the hardware. -If the driver has query_format interface, -all parameters on +If the driver has query_format, all parameters on .Va play and/or .Va rec @@ -253,8 +251,7 @@ Therefore and/or .Va rec are always settable. -If the driver does not have query_format interface, -the driver has to validate the format. +If the driver does not have query_format, the driver has to validate the format. If the hardware does not support .Dv AUDIO_ENCODING_SLINEAR_{NE,OE}:16 , conversion information should be filled the @@ -312,7 +309,7 @@ are guaranteed to be able to consecutive specified by .Va count. .Va codec -must fill entire +must fill the entirety of .Va dst . For example, let count = 100, srcfmt is { precision = 16, channels = 3 }, dstfmt is { precision = 8, channels = 4 }, @@ -334,7 +331,7 @@ property the same value is passed in bot .Va play and .Va rec . -Return 0 on success, otherwise an error code. +Returns 0 on success, otherwise an error code. It is called in the Attach or Closed phases. .It Dv int round_blocksize(void *hdl, int bs, int mode, .Dv "const audio_params_t *param)" @@ -365,7 +362,7 @@ are done. A hardware driver that needs to get the hardware in and out of command mode for each change can save all the changes during previous calls and do them all here. -Return 0 on success, otherwise an error code. +Returns 0 on success, otherwise an error code. It is called in the Attach or Closed phases. .It Dv int init_output(void *hdl, void *buffer, int size) optional, is called before any output starts, but when the total @@ -383,7 +380,7 @@ of the input .Va buffer has been determined. It can be used to initialize looping DMA for hardware that needs that. -Return 0 on success, otherwise an error code. +Returns 0 on success, otherwise an error code. It is called in the Attach or Closed phases. .It Dv int start_output(void *hdl, void *block, int
CVS commit: src/share/man/man9
Module Name:src Committed By: isaki Date: Sat Feb 6 06:15:13 UTC 2021 Modified Files: src/share/man/man9: audio.9 Log Message: Add a description to close(). > Before call to this, halt_input and halt_output are called if necessary. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/share/man/man9/audio.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/audio.9 diff -u src/share/man/man9/audio.9:1.58 src/share/man/man9/audio.9:1.59 --- src/share/man/man9/audio.9:1.58 Sat Feb 29 05:39:03 2020 +++ src/share/man/man9/audio.9 Sat Feb 6 06:15:13 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: audio.9,v 1.58 2020/02/29 05:39:03 isaki Exp $ +.\" $NetBSD: audio.9,v 1.59 2021/02/06 06:15:13 isaki Exp $ .\" .\" Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -163,6 +163,11 @@ It is called in the Closed phase. .It Dv void close(void *hdl) optional, is called when the last audio device combining playback and recording is closed. +Before call to this, +.Va halt_input +and +.Va halt_output +are called if necessary. It is called in the Opened phase. .It Dv int query_format(void *hdl, audio_format_query_t *afp) is called to enumerate formats supported by the hardware.
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Thu Jan 21 17:05:51 UTC 2021 Modified Files: src/share/man/man9: strlist.9 Log Message: Quote minus. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/share/man/man9/strlist.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/strlist.9 diff -u src/share/man/man9/strlist.9:1.2 src/share/man/man9/strlist.9:1.3 --- src/share/man/man9/strlist.9:1.2 Thu Jan 21 16:57:52 2021 +++ src/share/man/man9/strlist.9 Thu Jan 21 17:05:50 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: strlist.9,v 1.2 2021/01/21 16:57:52 wiz Exp $ +.\" $NetBSD: strlist.9,v 1.3 2021/01/21 17:05:50 wiz Exp $ .\" .\" Copyright (c) 2021 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -122,7 +122,7 @@ to compare strings, allowing for wildcar .Fa pattern . .It Fn strlist_index "const char *sl" "size_t slsize" "const char *str" Returns the index of the specified string if it appears in the -string list, or -1 if the string does not appear in the string list. +string list, or \-1 if the string does not appear in the string list. .It Fn strlist_append "char **slp" "size_t *slsizep" "const char *str" Appends a copy of the specified string to the stringlist. Begin by initializing
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Thu Jan 21 16:57:53 UTC 2021 Modified Files: src/share/man/man9: strlist.9 Log Message: Use Nm instead of xref to itself. Fix typo. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/share/man/man9/strlist.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/strlist.9 diff -u src/share/man/man9/strlist.9:1.1 src/share/man/man9/strlist.9:1.2 --- src/share/man/man9/strlist.9:1.1 Thu Jan 21 15:53:16 2021 +++ src/share/man/man9/strlist.9 Thu Jan 21 16:57:52 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: strlist.9,v 1.1 2021/01/21 15:53:16 thorpej Exp $ +.\" $NetBSD: strlist.9,v 1.2 2021/01/21 16:57:52 wiz Exp $ .\" .\" Copyright (c) 2021 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -186,7 +186,7 @@ is_pc_printer_port(const char *pnp_id_li } .Ed .Pp -The folowing example converts an array of strings to a string list using +The following example converts an array of strings to a string list using .Fn strlist_append : .Bd -literal char * @@ -213,6 +213,6 @@ string_array_to_string_list(const char * .Xr pmatch 9 .Sh HISTORY The -.Xr strlist 9 +.Nm functions first appeared in .Nx 10.0 .
CVS commit: src/share/man/man9
Module Name:src Committed By: knakahara Date: Tue Jan 12 05:08:50 UTC 2021 Modified Files: src/share/man/man9: pci_msi.9 Log Message: Fix PR kern/55920 . Add pci_msi_count() and pci_msix_count() description. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/share/man/man9/pci_msi.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/pci_msi.9 diff -u src/share/man/man9/pci_msi.9:1.17 src/share/man/man9/pci_msi.9:1.18 --- src/share/man/man9/pci_msi.9:1.17 Tue Nov 27 20:13:43 2018 +++ src/share/man/man9/pci_msi.9 Tue Jan 12 05:08:50 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: pci_msi.9,v 1.17 2018/11/27 20:13:43 jdolecek Exp $ +.\" $NetBSD: pci_msi.9,v 1.18 2021/01/12 05:08:50 knakahara Exp $ .\" .\" Copyright (c) 2015 Internet Initiative Japan Inc. .\" All rights reserved. @@ -24,7 +24,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 27, 2018 +.Dd January 12, 2021 .Dt PCI_MSI 9 .Os .Sh NAME @@ -96,6 +96,14 @@ which contains, among other things, info of the device in the PCI bus topology sufficient to allow interrupts from the device to be handled. .Pp +.Fn pci_msi_count +returns the max number of the device's MSI. +If the device can not use MSI, +.Fn pci_msi_count +returns zero. +.Fn pci_msix_count +works in the same manner for MSI-X. +.Pp If a driver wishes to establish an MSI handler for the device, it should pass the .Ft struct pci_attach_args *
CVS commit: src/share/man/man9
Module Name:src Committed By: pgoyette Date: Mon Jan 4 18:27:47 UTC 2021 Modified Files: src/share/man/man9: malloc.9 Log Message: Better grammar. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/share/man/man9/malloc.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/malloc.9 diff -u src/share/man/man9/malloc.9:1.58 src/share/man/man9/malloc.9:1.59 --- src/share/man/man9/malloc.9:1.58 Thu Jun 4 13:45:19 2020 +++ src/share/man/man9/malloc.9 Mon Jan 4 18:27:46 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: malloc.9,v 1.58 2020/06/04 13:45:19 wiz Exp $ +.\" $NetBSD: malloc.9,v 1.59 2021/01/04 18:27:46 pgoyette Exp $ .\" .\" Copyright (c) 1996, 2003 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 30, 2020 +.Dd January 4, 2021 .Dt MALLOC 9 .Os .Sh NAME @@ -227,7 +227,7 @@ Misc temporary data buffers. .El .Pp Other malloc types are defined by the corresponding subsystem; see the -documentation for that subsystem for information its available malloc +documentation for that subsystem for information about its available malloc types. .Sh NOTES The malloc type argument is actually unused on
CVS commit: src/share/man/man9
Module Name:src Committed By: pgoyette Date: Fri Dec 18 02:29:50 UTC 2020 Modified Files: src/share/man/man9: wsmouse.9 Log Message: Minor typo - do I really need to bump the date for this? :) To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/share/man/man9/wsmouse.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/wsmouse.9 diff -u src/share/man/man9/wsmouse.9:1.17 src/share/man/man9/wsmouse.9:1.18 --- src/share/man/man9/wsmouse.9:1.17 Thu Dec 2 12:54:13 2010 +++ src/share/man/man9/wsmouse.9 Fri Dec 18 02:29:50 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: wsmouse.9,v 1.17 2010/12/02 12:54:13 wiz Exp $ +.\" $NetBSD: wsmouse.9,v 1.18 2020/12/18 02:29:50 pgoyette Exp $ .\" .\" Copyright (c) 2001 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -223,7 +223,7 @@ The wscons subsystem is implemented with .Pa sys/dev/wscons . The .Nm -module itself is implement within the file +module itself is implemented within the file .Pa sys/dev/wscons/wsmouse.c . .Xr ioctl 2 operations are listed in
CVS commit: src/share/man/man9
Module Name:src Committed By: christos Date: Sat Oct 31 16:03:01 UTC 2020 Modified Files: src/share/man/man9: kfilter_register.9 Log Message: document f_touch To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/share/man/man9/kfilter_register.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/kfilter_register.9 diff -u src/share/man/man9/kfilter_register.9:1.10 src/share/man/man9/kfilter_register.9:1.11 --- src/share/man/man9/kfilter_register.9:1.10 Wed Apr 30 09:10:58 2008 +++ src/share/man/man9/kfilter_register.9 Sat Oct 31 12:03:01 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: kfilter_register.9,v 1.10 2008/04/30 13:10:58 martin Exp $ +.\" $NetBSD: kfilter_register.9,v 1.11 2020/10/31 16:03:01 christos Exp $ .\" .\" Copyright (c) 2001, 2002 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 October 23, 2002 +.Dd October 31, 2020 .Dt KFILTER_REGISTER 9 .Os .Sh NAME @@ -97,6 +97,11 @@ struct filterops { /* called when knote is DELETEd */ int (*f_event)(struct knote *kn, long hint); /* called when event is triggered */ + void (*f_touch)(struct knote *kn, struct kevent *kev, long hint); +/* called during registration and event + * processing to provide custom handling + * of event fflags and data + */ }; .Ed .Pp
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Sat Oct 31 10:48:17 UTC 2020 Modified Files: src/share/man/man9: ddb.9 Log Message: Improve wording. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/share/man/man9/ddb.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/ddb.9 diff -u src/share/man/man9/ddb.9:1.2 src/share/man/man9/ddb.9:1.3 --- src/share/man/man9/ddb.9:1.2 Fri Oct 30 22:29:30 2020 +++ src/share/man/man9/ddb.9 Sat Oct 31 10:48:17 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: ddb.9,v 1.2 2020/10/30 22:29:30 uwe Exp $ +.\" $NetBSD: ddb.9,v 1.3 2020/10/31 10:48:17 wiz Exp $ .\" .\" Copyright (c) 2020 Valery Ushakov .\" All rights reserved. @@ -95,7 +95,7 @@ command. .Pp The .Fa commands -is an array of +argument is an array of .Vt struct db_command\| entries. The initializer list for the array should use the @@ -103,7 +103,7 @@ The initializer list for the array shoul macro for its entries. The .Fa name -is the name of the debugger command. +argument is the name of the debugger command. An entry with .Dv NULL .Fa name
CVS commit: src/share/man/man9
Module Name:src Committed By: uwe Date: Fri Oct 30 22:29:30 UTC 2020 Modified Files: src/share/man/man9: ddb.9 Log Message: Add a few missing articles. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/share/man/man9/ddb.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/ddb.9 diff -u src/share/man/man9/ddb.9:1.1 src/share/man/man9/ddb.9:1.2 --- src/share/man/man9/ddb.9:1.1 Fri Oct 30 22:14:03 2020 +++ src/share/man/man9/ddb.9 Fri Oct 30 22:29:30 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: ddb.9,v 1.1 2020/10/30 22:14:03 uwe Exp $ +.\" $NetBSD: ddb.9,v 1.2 2020/10/30 22:29:30 uwe Exp $ .\" .\" Copyright (c) 2020 Valery Ushakov .\" All rights reserved. @@ -132,7 +132,7 @@ remainder of its command line. .It Dv CS_NOREPEAT The command should not be automatically repeated by the .Tn REPL -when user enters an empty command after it. +when the user enters an empty command after it. .\" .It Dv CS_OWN The command doesn't follow the normal @@ -152,9 +152,9 @@ The command sets the .Pp The remaining parameters are strings that provide documentation for the command and its arguments. -That documentation is available to the user via +That documentation is available to the user via the .Ic help -command if the kernel was compiled with +command if the kernel was compiled with the .Dv DDB_VERBOSE_HELP option. .\"
CVS commit: src/share/man/man9
Module Name:src Committed By: uwe Date: Fri Oct 30 22:14:03 UTC 2020 Added Files: src/share/man/man9: ddb.9 Log Message: ddb(9) - first cut at the documentation for writing and adding new DDB commands. Not yet complete and not hooked into the build. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/share/man/man9/ddb.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/share/man/man9/ddb.9 diff -u /dev/null src/share/man/man9/ddb.9:1.1 --- /dev/null Fri Oct 30 22:14:03 2020 +++ src/share/man/man9/ddb.9 Fri Oct 30 22:14:03 2020 @@ -0,0 +1,162 @@ +.\" $NetBSD: ddb.9,v 1.1 2020/10/30 22:14:03 uwe Exp $ +.\" +.\" Copyright (c) 2020 Valery Ushakov +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd October 30, 2020 +.Dt DDB 9 +.Os +.\" +.\" +.Sh NAME +.Nm ddb +.Nd in-kernel debugger +.\" +.\" +.Sh SYNOPSIS +.\" +.In ddb/ddb.h +.\" +.Ft int +.Fn db_register_tbl "uint8_t type" "const struct db_command *commands" +.\" +.Ft int +.Fn db_unregister_tbl "uint8_t type" "const struct db_command *commands" +.\" +.\" XXX: there's no typedef defined for this +.Ft void +.Fo "(*pf)" \" it seems there's no way to format this differently +.Fa "db_expr_t addr" +.Fa "bool have_addr" +.Fa "db_expr_t count" +.Fa "const char *modif" +.Fc +.\" +.\" - a macro, but document the types here +.Fo DDB_ADD_CMD +.Fa "const char *name" +.Fa "void (*pf)(db_expr_t, bool, db_expr_t, const char *)" +.Fa "uint16_t flags" +.Fa "const char *cmd_descr" +.Fa "const char *cmd_arg" +.Fa "const char *arg_desc" +.Fc +.\" +.Sh DESCRIPTION +Devices and kernel modules can add new commands to the +.Xr ddb 4 +in-kernel debugger with +.Fn db_register_tbl +and remove previously added commands with +.Fn db_unregister_tbl +respectively. +.Pp +The +.Fa type +argument is one of: +.Bl -tag -offset indent -width Dv +.\" +.It Dv DDB_BASE_CMD +top-level commands; +.\" +.It Dv DDB_MACH_CMD +sub-commands of the top-level +.Ic mach +command; +.\" +.It Dv DDB_SHOW_CMD +sub-commands of the top-level +.Ic show +command. +.\" +.El +.\" +.Pp +The +.Fa commands +is an array of +.Vt struct db_command\| +entries. +The initializer list for the array should use the +.Fn DDB_ADD_CMD +macro for its entries. +The +.Fa name +is the name of the debugger command. +An entry with +.Dv NULL +.Fa name +terminates the array. +.Pp +The +.Fa pf +argument is the function that implements the command. +The debugger's +.Tn REPL +parses the usual command format documented in +.Xr ddb 4 +and invokes the implementation with the values obtained. +.Pp +The +.Fa flags +argument is a bitwise +.Tn OR +of the following values: +.Bl -tag -offset indent -width Dv +.\" +.It Dv CS_MORE +The command takes the usual arguments but may additionally parse the +remainder of its command line. +.\" +.It Dv CS_NOREPEAT +The command should not be automatically repeated by the +.Tn REPL +when user enters an empty command after it. +.\" +.It Dv CS_OWN +The command doesn't follow the normal +.Xr ddb 4 +conventions and parses its command line itself. +The +.Tn REPL +doesn't try to parse the command line. +The values passed to its implementation are dummies. +.\" +.It Dv CS_SET_DOT +The command sets the +.Va dot . +.\" +.El +.\" +.Pp +The remaining parameters are strings that provide documentation for +the command and its arguments. +That documentation is available to the user via +.Ic help +command if the kernel was compiled with +.Dv DDB_VERBOSE_HELP +option. +.\" +.Sh SEE ALSO +.Xr ddb 4
CVS commit: src/share/man/man9
Module Name:src Committed By: riastradh Date: Mon Sep 7 01:07:38 UTC 2020 Modified Files: src/share/man/man9: threadpool.9 Log Message: threadpool: Fix man page for threadpool_job_init. This is threadpool_job_init(job, fn, interlock, fmt, args...), not just threadpool_job_init(job, fn, interlock). To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/share/man/man9/threadpool.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/threadpool.9 diff -u src/share/man/man9/threadpool.9:1.3 src/share/man/man9/threadpool.9:1.4 --- src/share/man/man9/threadpool.9:1.3 Wed Dec 26 21:48:55 2018 +++ src/share/man/man9/threadpool.9 Mon Sep 7 01:07:38 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: threadpool.9,v 1.3 2018/12/26 21:48:55 thorpej Exp $ +.\" $NetBSD: threadpool.9,v 1.4 2020/09/07 01:07:38 riastradh Exp $ .\" .\" Copyright (c) 2014 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -59,7 +59,7 @@ .Fn threadpool_percpu_ref_remote "struct threadpool_percpu *pool" "struct cpu_info *ci" .\ .Ft void -.Fn threadpool_job_init "struct threadpool_job *job" "threadpool_job_fn_t fn" "kmutex_t *interlock" +.Fn threadpool_job_init "struct threadpool_job *job" "threadpool_job_fn_t fn" "kmutex_t *interlock" "const char *fmt" "..." .\" .Ft void .Fn threadpool_job_destroy "struct threadpool_job *job" @@ -214,13 +214,18 @@ Do not use with thread pools obtained from .Fn threadpool_percpu_ref_remote . .\ -.It Fn threadpool_job_init "job" "fn" "interlock" +.It Fn threadpool_job_init "job" "fn" "interlock" "fmt" "..." Initialize the threadpool job .Fa job to run .Fa fn when scheduled and to interlock with .Fa interlock . +The argument +.Fa fmt +is a +.Xr printf 9 +format string for the job's name. .Pp The mutex .Fa interlock
CVS commit: src/share/man/man9
Module Name:src Committed By: riastradh Date: Thu Sep 3 00:23:57 UTC 2020 Modified Files: src/share/man/man9: atomic_loadstore.9 Log Message: atomic_load/store_* appeared in NetBSD 9, not 10. Pullup preceded release of 9.0. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/share/man/man9/atomic_loadstore.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/atomic_loadstore.9 diff -u src/share/man/man9/atomic_loadstore.9:1.5 src/share/man/man9/atomic_loadstore.9:1.6 --- src/share/man/man9/atomic_loadstore.9:1.5 Sun Dec 8 00:00:59 2019 +++ src/share/man/man9/atomic_loadstore.9 Thu Sep 3 00:23:57 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: atomic_loadstore.9,v 1.5 2019/12/08 00:00:59 uwe Exp $ +.\" $NetBSD: atomic_loadstore.9,v 1.6 2020/09/03 00:23:57 riastradh Exp $ .\" .\" Copyright (c) 2019 The NetBSD Foundation .\" All rights reserved. @@ -766,7 +766,7 @@ or similar to enable resource reclamatio .Xr pserialize 9 .Sh HISTORY These atomic operations first appeared in -.Nx 10.0 . +.Nx 9.0 . .Sh CAVEATS C11 formally specifies that all subexpressions, except the left operands of the
CVS commit: src/share/man/man9
Module Name:src Committed By: riastradh Date: Wed Sep 2 19:04:05 UTC 2020 Modified Files: src/share/man/man9: ipi.9 Log Message: Spell out acronyms in title for clarity. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/share/man/man9/ipi.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/ipi.9 diff -u src/share/man/man9/ipi.9:1.4 src/share/man/man9/ipi.9:1.5 --- src/share/man/man9/ipi.9:1.4 Sat Apr 6 07:57:04 2019 +++ src/share/man/man9/ipi.9 Wed Sep 2 19:04:05 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: ipi.9,v 1.4 2019/04/06 07:57:04 wiz Exp $ +.\" $NetBSD: ipi.9,v 1.5 2020/09/02 19:04:05 riastradh Exp $ .\" .\" Copyright (c) 2014, 2019 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -32,7 +32,7 @@ .Os .Sh NAME .Nm ipi -.Nd MI IPI interface +.Nd machine-independent interprocessor interrupts .Sh SYNOPSIS .In sys/ipi.h .Vt typedef void (*ipi_func_t)(void *);
CVS commit: src/share/man/man9
Module Name:src Committed By: hannken Date: Fri Aug 28 07:29:00 UTC 2020 Modified Files: src/share/man/man9: vfsops.9 Log Message: Another typo -- its vfs_newvnode(). To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/share/man/man9/vfsops.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/vfsops.9 diff -u src/share/man/man9/vfsops.9:1.52 src/share/man/man9/vfsops.9:1.53 --- src/share/man/man9/vfsops.9:1.52 Thu Aug 27 14:14:00 2020 +++ src/share/man/man9/vfsops.9 Fri Aug 28 07:28:59 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: vfsops.9,v 1.52 2020/08/27 14:14:00 fcambus Exp $ +.\" $NetBSD: vfsops.9,v 1.53 2020/08/28 07:28:59 hannken Exp $ .\" .\" Copyright (c) 2001 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -142,7 +142,7 @@ Ta Get vnode from file id Ta Dv VFS_LOADVNODE \ Ta Initialize vnode with file .\" -.It int (*vfs_loadvnode)() \ +.It int (*vfs_newvnode)() \ Ta Dv VFS_NEWVNODE \ Ta Initialize vnode with new file .\"
CVS commit: src/share/man/man9
Module Name:src Committed By: riastradh Date: Fri Aug 28 07:03:41 UTC 2020 Modified Files: src/share/man/man9: thmap.9 Log Message: thmap(9): Minor readability and style tweaks. - Fix typo: hmap -> thmap - Reduce excessive indentation. - Specify largest entry width for flag name table. - Include parameter names in function descriptions for easier reference. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/share/man/man9/thmap.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/thmap.9 diff -u src/share/man/man9/thmap.9:1.2 src/share/man/man9/thmap.9:1.3 --- src/share/man/man9/thmap.9:1.2 Wed Aug 28 22:11:25 2019 +++ src/share/man/man9/thmap.9 Fri Aug 28 07:03:41 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: thmap.9,v 1.2 2019/08/28 22:11:25 wiz Exp $ +.\" $NetBSD: thmap.9,v 1.3 2020/08/28 07:03:41 riastradh Exp $ .\" .\" Copyright (c) 2018 Mindaugas Rasiukevicius .\" All rights reserved. @@ -36,17 +36,17 @@ .Ft thmap_t * .Fn thmap_create "uintptr_t baseptr" "const thmap_ops_t *ops" "unsigned flags" .Ft void -.Fn thmap_destroy "thmap_t *hmap" +.Fn thmap_destroy "thmap_t *thmap" .Ft void * -.Fn thmap_get "thmap_t *hmap" "const void *key" "size_t len" +.Fn thmap_get "thmap_t *thmap" "const void *key" "size_t len" .Ft void * -.Fn thmap_put "thmap_t *hmap" "const void *key" "size_t len" "void *val" +.Fn thmap_put "thmap_t *thmap" "const void *key" "size_t len" "void *val" .Ft void * -.Fn thmap_del "thmap_t *hmap" "const void *key" "size_t len" +.Fn thmap_del "thmap_t *thmap" "const void *key" "size_t len" .Ft void * -.Fn thmap_stage_gc "thmap_t *hmap" +.Fn thmap_stage_gc "thmap_t *thmap" .Ft void -.Fn thmap_gc "thmap_t *hmap" "void *ref" +.Fn thmap_gc "thmap_t *thmap" "void *ref" .Ft void .Fn thmap_setroot "thmap_t *thmap" "uintptr_t root_offset" .Ft uintptr_t @@ -72,8 +72,8 @@ Delete operations (the key/data destruct the readers using some reclamation mechanism. .\" - .Sh FUNCTIONS -.Bl -tag -width thmap_create -.It Fn thmap_create +.Bl -tag -width abcd +.It Fn thmap_create baseptr ops flags Construct a new trie-hash map. The optional .Fa ops @@ -99,7 +99,7 @@ should be set to zero. Currently, the supported .Fa flags are: -.Bl -tag -width THMAP_NOCOPY +.Bl -tag -width THMAP_SETROOT .It Dv THMAP_NOCOPY The keys on insert will not be copied and the given pointers to them will be expected to be valid and the values constant until the key is deleted; @@ -112,10 +112,10 @@ by default, the map is initialized and t .Fn thmap_create . .El .\" --- -.It Fn thmap_destroy +.It Fn thmap_destroy thmap Destroy the map, freeing the memory it uses. .\" --- -.It Fn thmap_get +.It Fn thmap_get thmap key len Lookup the key (of a given length) and return the value associated with it. Return .Dv NULL @@ -123,7 +123,7 @@ if the key is not found (see the .Sx CAVEATS section). .\" --- -.It Fn thmap_put +.It Fn thmap_put thmap key len val Insert the key with an arbitrary value. If the key is already present, return the already existing associated value without changing it. @@ -132,7 +132,7 @@ Just compare the result against .Fa val to test whether the insert was successful. .\" --- -.It Fn thmap_del +.It Fn thmap_del thmap key len Remove the given key. If the key was present, return the associated value; otherwise return @@ -146,7 +146,7 @@ and .Fn thmap_gc routines. .\" --- -.It Fn thmap_stage_gc +.It Fn thmap_stage_gc thmap Stage the currently pending entries (the memory not yet released after the deletion) for reclamation (G/C). This operation should be called @@ -158,7 +158,7 @@ Returns a reference which must be passed Not calling the G/C function for the returned reference would result in a memory leak. .\" --- -.It Fn thmap_gc +.It Fn thmap_gc thmap ref Reclaim (G/C) the staged entries i.e. release any memory associated with the deleted keys. The reference must be the value returned by the call to @@ -175,14 +175,14 @@ If the map is created using the .Fa THMAP_SETROOT flag, then the following functions are applicable: .\" --- -.Bl -tag -width thmap_setroot -.It Fn thmap_setroot +.Bl -tag -width abcd +.It Fn thmap_setroot thmap root_offset Set the root node. The address must be relative to the base address, as if allocated by the .Fn thmap_ops_t::alloc routine. Return 0 on success and \-1 on failure (if already set). -.It Fn thmap_getroot +.It Fn thmap_getroot thmap Get the root node address. The returned address will be relative to the base address. .El
CVS commit: src/share/man/man9
Module Name:src Committed By: fcambus Date: Thu Aug 27 14:14:00 UTC 2020 Modified Files: src/share/man/man9: condvar.9 ltsleep.9 pci_configure_bus.9 pci_intr.9 timecounter.9 usbdi.9 uvm_map.9 vfsops.9 Log Message: Fix a bunch of typos in various kernel man pages. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/share/man/man9/condvar.9 cvs rdiff -u -r1.18 -r1.19 src/share/man/man9/ltsleep.9 cvs rdiff -u -r1.19 -r1.20 src/share/man/man9/pci_configure_bus.9 cvs rdiff -u -r1.26 -r1.27 src/share/man/man9/pci_intr.9 cvs rdiff -u -r1.9 -r1.10 src/share/man/man9/timecounter.9 cvs rdiff -u -r1.34 -r1.35 src/share/man/man9/usbdi.9 cvs rdiff -u -r1.11 -r1.12 src/share/man/man9/uvm_map.9 cvs rdiff -u -r1.51 -r1.52 src/share/man/man9/vfsops.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/condvar.9 diff -u src/share/man/man9/condvar.9:1.29 src/share/man/man9/condvar.9:1.30 --- src/share/man/man9/condvar.9:1.29 Wed Aug 19 02:19:07 2020 +++ src/share/man/man9/condvar.9 Thu Aug 27 14:14:00 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: condvar.9,v 1.29 2020/08/19 02:19:07 msaitoh Exp $ +.\" $NetBSD: condvar.9,v 1.30 2020/08/27 14:14:00 fcambus Exp $ .\" .\" Copyright (c) 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -310,7 +310,7 @@ Consuming a resource: /* * Wait for the resource to become available. Timeout after * five seconds. If the resource is not available within the - * alloted time, return an error. + * allotted time, return an error. */ struct bintime timeout = { .sec = 5, .frac = 0 }; while (res->state == BUSY) { Index: src/share/man/man9/ltsleep.9 diff -u src/share/man/man9/ltsleep.9:1.18 src/share/man/man9/ltsleep.9:1.19 --- src/share/man/man9/ltsleep.9:1.18 Sat Mar 18 19:01:01 2017 +++ src/share/man/man9/ltsleep.9 Thu Aug 27 14:14:00 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: ltsleep.9,v 1.18 2017/03/18 19:01:01 riastradh Exp $ +.\" $NetBSD: ltsleep.9,v 1.19 2020/08/27 14:14:00 fcambus Exp $ .\" .\" Copyright (c) 1996, 2002, 2007 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -223,7 +223,7 @@ and pairs. The .Fn cv_wait* -variant to use can be determinded from looking at the corresponding +variant to use can be determined from looking at the corresponding .Fn tsleep usage. .Pp Index: src/share/man/man9/pci_configure_bus.9 diff -u src/share/man/man9/pci_configure_bus.9:1.19 src/share/man/man9/pci_configure_bus.9:1.20 --- src/share/man/man9/pci_configure_bus.9:1.19 Fri Jul 10 06:28:49 2020 +++ src/share/man/man9/pci_configure_bus.9 Thu Aug 27 14:14:00 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: pci_configure_bus.9,v 1.19 2020/07/10 06:28:49 wiz Exp $ +.\" $NetBSD: pci_configure_bus.9,v 1.20 2020/08/27 14:14:00 fcambus Exp $ .\" .\" Copyright 2001 Wasabi Systems, Inc. .\" All rights reserved. @@ -192,7 +192,7 @@ address, and size of the resource being The following resource types are supported: .Bl -tag -width PCICONF_RESOURCE_PREFETCHABLE_MEM -offset indent .It Dv PCICONF_RESOURCE_IO -An adddress region used for PCI I/O accesses. +An address region used for PCI I/O accesses. .It Dv PCICONF_RESOURCE_MEM An address region used for PCI memory accesses where reads may have side effects. Index: src/share/man/man9/pci_intr.9 diff -u src/share/man/man9/pci_intr.9:1.26 src/share/man/man9/pci_intr.9:1.27 --- src/share/man/man9/pci_intr.9:1.26 Thu Sep 20 06:48:53 2018 +++ src/share/man/man9/pci_intr.9 Thu Aug 27 14:14:00 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: pci_intr.9,v 1.26 2018/09/20 06:48:53 rin Exp $ +.\" $NetBSD: pci_intr.9,v 1.27 2020/08/27 14:14:00 fcambus Exp $ .\" .\" Copyright (c) 2000 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -132,7 +132,7 @@ function sets an attribute .Fa attr of the interrupt handler to .Fa data . -Currenty, only the following attribute is supported: +Currently, only the following attribute is supported: .Bl -tag -width PCI_INTR_MPSAFE .It Dv PCI_INTR_MPSAFE If this attribute is set to Index: src/share/man/man9/timecounter.9 diff -u src/share/man/man9/timecounter.9:1.9 src/share/man/man9/timecounter.9:1.10 --- src/share/man/man9/timecounter.9:1.9 Tue Jun 8 05:50:01 2010 +++ src/share/man/man9/timecounter.9 Thu Aug 27 14:14:00 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: timecounter.9,v 1.9 2010/06/08 05:50:01 jruoho Exp $ +.\" $NetBSD: timecounter.9,v 1.10 2020/08/27 14:14:00 fcambus Exp $ .\" $OpenBSD: tc_init.9,v 1.4 2007/05/31 19:20:01 jmc Exp $ .\" .\" Copyright (c) 2004 Alexander Yurchenko @@ -163,7 +163,7 @@ The .Va bintime format is a binary number, not a pseudo-decimal number, so it can be used as a simple binary counter -without expensive 64 bit arithmetics. +without expensive 64 bit arithmetic. .Sh CODE REFERENCES The timecounter framework is implemented in the file .Pa sys/kern/kern_tc.c . Index: src/share/man/man9/usbdi.9 diff -u
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Mon Aug 17 06:07:53 UTC 2020 Modified Files: src/share/man/man9: cprng.9 Log Message: cprng(9): Remove trailing comma. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/share/man/man9/cprng.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/cprng.9 diff -u src/share/man/man9/cprng.9:1.13 src/share/man/man9/cprng.9:1.14 --- src/share/man/man9/cprng.9:1.13 Mon Aug 17 00:55:05 2020 +++ src/share/man/man9/cprng.9 Mon Aug 17 06:07:53 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: cprng.9,v 1.13 2020/08/17 00:55:05 riastradh Exp $ +.\" $NetBSD: cprng.9,v 1.14 2020/08/17 06:07:53 wiz Exp $ .\" .\" Copyright (c) 2011-2015 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -39,7 +39,7 @@ .Nm cprng_strong64 , .Nm cprng_fast , .Nm cprng_fast32 , -.Nm cprng_fast64 , +.Nm cprng_fast64 .Nd cryptographic pseudorandom number generators .Sh SYNOPSIS .In sys/cprng.h
CVS commit: src/share/man/man9
Module Name:src Committed By: riastradh Date: Mon Aug 17 00:55:05 UTC 2020 Modified Files: src/share/man/man9: cprng.9 Log Message: Update cprng_strong API documentation. Should maybe just get rid of the flags arguments. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/share/man/man9/cprng.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/cprng.9 diff -u src/share/man/man9/cprng.9:1.12 src/share/man/man9/cprng.9:1.13 --- src/share/man/man9/cprng.9:1.12 Mon Aug 17 00:49:53 2020 +++ src/share/man/man9/cprng.9 Mon Aug 17 00:55:05 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: cprng.9,v 1.12 2020/08/17 00:49:53 riastradh Exp $ +.\" $NetBSD: cprng.9,v 1.13 2020/08/17 00:55:05 riastradh Exp $ .\" .\" Copyright (c) 2011-2015 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -137,33 +137,7 @@ and must be no higher than .Pp The .Fa flags -argument controls the behavior of the generator: -.Bl -tag -width CPRNG_REKEY_ANY -.It Dv CPRNG_INIT_ANY -Suppress a warning message to the console if, during -.Fn cprng_strong_create , -only partial entropy for the generator is available from the entropy -pool. -.It Dv CPRNG_REKEY_ANY -Suppress a warning message to the console if, during -.Fn cprng_strong -after the generator has been exhausted and must be reseeded, only -partial entropy for the generator is available from the entropy pool. -.It Dv CPRNG_USE_CV -Make -.Fn cprng_strong -sleep if the generator has not been seeded with full entropy until full -entropy is available. -Otherwise, -.Fn cprng_strong -will never sleep when passed this generator. -.It Dv CPRNG_HARD -Limit the number of bits of output from the generator before reseeding -to the number of bits in its seed, so that it approximates the -information-theoretic entropy of its seed. -Otherwise, the generator may provide many more bits of output than it -was seeded with. -.El +argument must be zero. .Pp Creation will succeed even if full entropy for the generator is not available. @@ -189,43 +163,8 @@ and return the number of bytes. .Fa len must be at most .Dv CPRNG_MAX_LEN . -.Pp -If -.Fa cprng -was created with the -.Dv CPRNG_USE_CV -flag and has been exhausted, then -.Fn cprng_strong -may sleep until full entropy can be obtained from the entropy pool to -reseed it. -However, if .Fa flags -includes the -.Dv FNONBLOCK -flag, then -.Fn cprng_strong -will immediately return zero in this case instead. -.Pp -If -.Fa cprng -was created with the -.Dv CPRNG_HARD -flag, then -.Fn cprng_strong -will return at most as many bytes as are left from its seed size since -the last reseeding. -.Pp -If -.Fa cprng -was created with neither the -.Dv CPRNG_USE_CV -flag nor the -.Dv CPRNG_HARD -flag, then -.Fn cprng_strong -is guaranteed to return as many bytes as requested, up to -.Dv CPRNG_MAX_LEN , -without sleeping. +must be zero. .It Fn cprng_strong32 Generate 32 bits using the .Dv kern_cprng
CVS commit: src/share/man/man9
Module Name:src Committed By: riastradh Date: Mon Aug 17 00:49:53 UTC 2020 Modified Files: src/share/man/man9: cprng.9 Log Message: Update cprng(9) man page for CTR_DRBG -> Hash_DRBG change last year. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/share/man/man9/cprng.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/cprng.9 diff -u src/share/man/man9/cprng.9:1.11 src/share/man/man9/cprng.9:1.12 --- src/share/man/man9/cprng.9:1.11 Tue Mar 24 08:48:31 2020 +++ src/share/man/man9/cprng.9 Mon Aug 17 00:49:53 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: cprng.9,v 1.11 2020/03/24 08:48:31 skrll Exp $ +.\" $NetBSD: cprng.9,v 1.12 2020/08/17 00:49:53 riastradh Exp $ .\" .\" Copyright (c) 2011-2015 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 March 24, 2020 +.Dd August 16, 2020 .Dt CPRNG 9 .Os .Sh NAME @@ -116,14 +116,14 @@ functions. .Bl -tag -width abcd .It Fn cprng_strong_create "name" "ipl" "flags" Create an instance of the cprng_strong generator. -This generator currently implements the NIST SP 800-90A CTR_DRBG with -AES-128 as the block transform. +This generator currently implements the NIST SP 800-90A Hash_DRBG with +SHA-256 as the hash function. .Pp The .Fa name argument is used to .Dq personalize -the CTR_DRBG according to the standard, so that its initial state will +the Hash_DRBG according to the standard, so that its initial state will depend both on seed material from the entropy pool and also on the personalization string (name). .Pp @@ -296,8 +296,8 @@ The .Nm cprng_strong functions are implemented in .Pa sys/kern/subr_cprng.c , -and use the NIST SP 800-90A CTR_DRBG implementation in -.Pa sys/crypto/nist_ctr_drbg . +and use the NIST SP 800-90A Hash_DRBG implementation in +.Pa sys/crypto/nist_hash_drbg . The .Nm cprng_fast functions are implemented in
CVS commit: src/share/man/man9
Module Name:src Committed By: thorpej Date: Sun Aug 16 16:48:08 UTC 2020 Modified Files: src/share/man/man9: pmap.9 Log Message: Be explcit that all calls to pmap_activate() and pmap_deactivate() from MI code are made with preemption disabled and with l == curlwp. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/share/man/man9/pmap.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/pmap.9 diff -u src/share/man/man9/pmap.9:1.47 src/share/man/man9/pmap.9:1.48 --- src/share/man/man9/pmap.9:1.47 Sat Mar 14 14:05:42 2020 +++ src/share/man/man9/pmap.9 Sun Aug 16 16:48:08 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: pmap.9,v 1.47 2020/03/14 14:05:42 ad Exp $ +.\" $NetBSD: pmap.9,v 1.48 2020/08/16 16:48:08 thorpej Exp $ .\" .\" Copyright (c) 2000, 2001, 2002, 2020 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 March 14, 2020 +.Dd August 16, 2020 .Dt PMAP 9 .Os .Sh NAME @@ -766,18 +766,16 @@ In this case, the call may be deleted us .It void Fn "pmap_activate" "struct lwp *l" Activate the physical map used by the process behind lwp .Fa l . +on the current CPU. This is called by the virtual memory system when the virtual memory context for a process is changed, and is also -often used by machine-dependent context switch code to program -the memory management hardware with the process's page table -base, etc. -Note that +used by the context switch code to program the memory management hardware +with the process's page table base, etc. +All calls to .Fn pmap_activate -may not always be called when +from machine-independent code are made with preemption disabled and with .Fa l -is the current lwp. -.Fn pmap_activate -must be able to handle this scenario. +as the current lwp. .Pp The .Fn pmap_activate @@ -792,9 +790,9 @@ It is generally used in conjunction with Like .Fn pmap_activate , .Fn pmap_deactivate -may not always be called when +is called by machine-independent code with preemption disabled and with .Fa l -is the current lwp. +as the current lwp. .Pp As above, .Fn pmap_deactivate
CVS commit: src/share/man/man9
Module Name:src Committed By: rin Date: Mon Aug 10 09:30:21 UTC 2020 Modified Files: src/share/man/man9: ucas.9 Log Message: Fix typo: than --> then. Probably not worth bumping date. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/share/man/man9/ucas.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/ucas.9 diff -u src/share/man/man9/ucas.9:1.4 src/share/man/man9/ucas.9:1.5 --- src/share/man/man9/ucas.9:1.4 Sat Apr 6 07:56:49 2019 +++ src/share/man/man9/ucas.9 Mon Aug 10 09:30:21 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: ucas.9,v 1.4 2019/04/06 07:56:49 wiz Exp $ +.\" $NetBSD: ucas.9,v 1.5 2020/08/10 09:30:21 rin Exp $ .\" .\" Copyright (c) 2019 Jason R. Thorpe. .\" Copyright (c) 2011 YAMAMOTO Takashi, @@ -110,7 +110,7 @@ Can operate across the kernel-userpsace .Pp If .Dv __HAVE_UCAS_FULL -is not defined, than a generic implementation will be provided by +is not defined, then a generic implementation will be provided by machine-dependent code. This generic implementation is suitable for uniprocessor and multiprocessor systems, but works on a
CVS commit: src/share/man/man9
Module Name:src Committed By: mrg Date: Sun Aug 9 09:20:30 UTC 2020 Modified Files: src/share/man/man9: usbnet.9 Log Message: fix a couple of minor issues: - un_ed is not a function, but an array - fix a typo - add a blank line after a list To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/share/man/man9/usbnet.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/usbnet.9 diff -u src/share/man/man9/usbnet.9:1.11 src/share/man/man9/usbnet.9:1.12 --- src/share/man/man9/usbnet.9:1.11 Fri Mar 20 08:02:55 2020 +++ src/share/man/man9/usbnet.9 Sun Aug 9 09:20:30 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: usbnet.9,v 1.11 2020/03/20 08:02:55 wiz Exp $ +.\" $NetBSD: usbnet.9,v 1.12 2020/08/09 09:20:30 mrg Exp $ .\" .\" Copyright (c) 2019 Matthew R. Green .\" All rights reserved. @@ -580,8 +580,8 @@ Typically, the device attach routine wil structure, as listed in .Sx AUTOCONFIGURATION . The -.Fn un_ed -member should have the +.Dv un_ed +array should have the .Dv USBNET_ENDPT_RX and .Dv USBNET_ENDPT_TX @@ -672,6 +672,7 @@ Returns standard .It uno_statchg Handle a status change event for this interface. .El +.Pp The read and write callbacks are called with the core lock held. See .Fn usbnet_lock_mii @@ -805,7 +806,7 @@ The framework provides three locks for the system: core lock, receive lock, and transmit lock. The normal locking order -for these locks is ifnet lock -> usbnet core lock -> usbnet rxlock -> usbne +for these locks is ifnet lock -> usbnet core lock -> usbnet rxlock -> usbnet txlock, or, ifnet lock -> usbnet core lock. Also note that the core lock may be taken when the ifnet lock is not held.
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Fri Aug 7 20:17:59 UTC 2020 Modified Files: src/share/man/man9: genfs.9 Log Message: Remove trailing whitespace. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/share/man/man9/genfs.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/genfs.9 diff -u src/share/man/man9/genfs.9:1.5 src/share/man/man9/genfs.9:1.6 --- src/share/man/man9/genfs.9:1.5 Fri Aug 7 18:13:19 2020 +++ src/share/man/man9/genfs.9 Fri Aug 7 20:17:59 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: genfs.9,v 1.5 2020/08/07 18:13:19 christos Exp $ +.\" $NetBSD: genfs.9,v 1.6 2020/08/07 20:17:59 wiz Exp $ .\" .\" Copyright 2012 Elad Efrat .\" All rights reserved. @@ -36,7 +36,7 @@ .In miscfs/genfs/genfs.h .Ft int .Fn genfs_can_access "vnode_t *vp" "kauth_cred_t cred" "uid_t uid" \ -"gid_t gid" "mode_t file_mode" "struct acl *acl" "accmode_t accmode" +"gid_t gid" "mode_t file_mode" "struct acl *acl" "accmode_t accmode" .Ft int .Fn genfs_can_chflags "vnode_t *vp" kauth_cred_t cred" "uid_t owner_uid" \ "bool changing_sysflags" @@ -80,7 +80,7 @@ error = kauth_authorize_vnode(..., genfs .Sh FUNCTIONS .Bl -tag -width compact .It Fn genfs_can_access "vnode_t *vp" "kauth_cred_t cred" "uid_t uid" \ -"gid_t gid" "mode_t file_mode" "struct acl *" "accmode_t accmode" +"gid_t gid" "mode_t file_mode" "struct acl *" "accmode_t accmode" Implements file access checking based on traditional Unix permissions. .It Fn genfs_can_chflags "vnode_t *vp" "kauth_cred_t cred" "uid_t owner_uid" "bool changing_sysflags"
CVS commit: src/share/man/man9
Module Name:src Committed By: christos Date: Fri Aug 7 18:13:19 UTC 2020 Modified Files: src/share/man/man9: genfs.9 Log Message: Catch up with genfs_can argument changes To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/share/man/man9/genfs.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/genfs.9 diff -u src/share/man/man9/genfs.9:1.4 src/share/man/man9/genfs.9:1.5 --- src/share/man/man9/genfs.9:1.4 Tue Mar 18 14:20:40 2014 +++ src/share/man/man9/genfs.9 Fri Aug 7 14:13:19 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: genfs.9,v 1.4 2014/03/18 18:20:40 riastradh Exp $ +.\" $NetBSD: genfs.9,v 1.5 2020/08/07 18:13:19 christos Exp $ .\" .\" Copyright 2012 Elad Efrat .\" All rights reserved. @@ -26,7 +26,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd March 1, 2012 +.Dd August 7, 2020 .Dt GENFS 9 .Os .Sh NAME @@ -35,25 +35,26 @@ .Sh SYNOPSIS .In miscfs/genfs/genfs.h .Ft int -.Fn genfs_can_access "enum vtype type" "mode_t file_mode" "uid_t uid" \ -"gid_t gid" "mode_t acc_mode" "kauth_cred_t cred" +.Fn genfs_can_access "vnode_t *vp" "kauth_cred_t cred" "uid_t uid" \ +"gid_t gid" "mode_t file_mode" "struct acl *acl" "accmode_t accmode" .Ft int -.Fn genfs_can_chflags "kauth_cred_t cred" "enum vtype type" "uid_t owner_uid" \ +.Fn genfs_can_chflags "vnode_t *vp" kauth_cred_t cred" "uid_t owner_uid" \ "bool changing_sysflags" .Ft int -.Fn genfs_can_chmod "enum vtype type" "kauth_cred_t cred" "uid_t cur_uid" \ +.Fn genfs_can_chmod "vnode_t *vp" "kauth_cred_t cred" "uid_t cur_uid" \ "gid_t cur_gid" "mode_t new_mode" .Ft int -.Fn genfs_can_chown "kauth_cred_t cred" "uid_t cur_uid" "gid_t cur_gid" \ -"uid_t new_uid" "gid_t new_gid" +.Fn genfs_can_chown "vnode_t *vp" "kauth_cred_t cred" "uid_t cur_uid" \ +"gid_t cur_gid" "uid_t new_uid" "gid_t new_gid" .Ft int -.Fn genfs_can_chtimes "vnode_t *vp" "u_int vaflags" "uid_t owner_uid" \ -"kauth_cred_t cred" +.Fn genfs_can_chtimes "vnode_t *vp" "kauth_cred_t cred" "uid_t owner_uid" \ +"u_int vaflags" .Ft int -.Fn genfs_can_extattr "kauth_cred_t cred" "int access_mode" "vnode_t *vp" \ -"const char *attr" +.Fn genfs_can_extattr "vnode_t *vp" "kauth_cred_t cred" "accmode_t accmode" \ +"int attrnamespace" .Ft int -.Fn genfs_can_sticky "kauth_cred_t cred" "uid_t dir_uid" "uid_t file_uid" +.Fn genfs_can_sticky "vnode_t *vp" "kauth_cred_t cred" "uid_t dir_uid" \ +"uid_t file_uid" .Sh DESCRIPTION The functions documented here are general routines for internal use in file systems to implement common policies for performing various operations. @@ -78,33 +79,34 @@ error = kauth_authorize_vnode(..., genfs .Ed .Sh FUNCTIONS .Bl -tag -width compact -.It Fn genfs_can_access "enum vtype type" "mode_t file_mode" "uid_t uid" \ -"gid_t gid" "mode_t acc_mode" "kauth_cred_t cred" +.It Fn genfs_can_access "vnode_t *vp" "kauth_cred_t cred" "uid_t uid" \ +"gid_t gid" "mode_t file_mode" "struct acl *" "accmode_t accmode" Implements file access checking based on traditional Unix permissions. -.It Fn genfs_can_chflags "kauth_cred_t cred" "enum vtype type" \ +.It Fn genfs_can_chflags "vnode_t *vp" "kauth_cred_t cred" "uid_t owner_uid" "bool changing_sysflags" Implements .Xr chflags 2 policy. -.It Fn genfs_can_chmod "enum vtype type" "kauth_cred_t cred" "uid_t cur_uid" \ +.It Fn genfs_can_chmod "vnode_t *vp" "kauth_cred_t cred" "uid_t cur_uid" \ "gid_t cur_gid" "mode_t new_mode" Implements .Xr chmod 2 policy. -.It Fn genfs_can_chown "kauth_cred_t cred" "uid_t cur_uid" "gid_t cur_gid" \ -"uid_t new_uid" "gid_t new_gid" +.It Fn genfs_can_chown "vnode_t *vp" "kauth_cred_t cred" "uid_t cur_uid" \ +"gid_t cur_gid" "uid_t new_uid" "gid_t new_gid" Implements .Xr chown 2 policy. -.It Fn genfs_can_chtimes "vnode_t *vp" "u_int vaflags" "uid_t owner_uid" \ -"kauth_cred_t cred" +.It Fn genfs_can_chtimes "vnode_t *vp" "kauth_cred_t cred" "uid_t owner_uid" \ +"u_int vaflags" Implements .Xr utimes 2 policy. -.It Fn genfs_can_extattr "kauth_cred_t cred" "int access_mode" "vnode_t *vp" \ -"const char *attr" +.It Fn genfs_can_extattr "vnode_t *vp" "kauth_cred_t cred" "accmode_t accmode" \ +"int attrnamespace" Implements extended attributes access policy. -.It Fn genfs_can_sticky "kauth_cred_t cred" "uid_t dir_uid" "uid_t file_uid" +.It Fn genfs_can_sticky "vnode_t *vp" "kauth_cred_t cred" "uid_t dir_uid" \ +"uid_t file_uid" Implements rename and delete policy from sticky directories. .El .Sh SEE ALSO
CVS commit: src/share/man/man9
Module Name:src Committed By: christos Date: Fri Aug 7 17:59:32 UTC 2020 Modified Files: src/share/man/man9: vfsops.9 Log Message: Catch up with lktype addition. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/share/man/man9/vfsops.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/vfsops.9 diff -u src/share/man/man9/vfsops.9:1.50 src/share/man/man9/vfsops.9:1.51 --- src/share/man/man9/vfsops.9:1.50 Sat Jul 4 17:07:29 2020 +++ src/share/man/man9/vfsops.9 Fri Aug 7 13:59:32 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: vfsops.9,v 1.50 2020/07/04 21:07:29 christos Exp $ +.\" $NetBSD: vfsops.9,v 1.51 2020/08/07 17:59:32 christos Exp $ .\" .\" Copyright (c) 2001 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 July 4, 2020 +.Dd August 7, 2020 .Dt VFSOPS 9 .Os .Sh NAME @@ -60,7 +60,7 @@ .Ft int .Fn VFS_UNMOUNT "struct mount *mp" "int mntflags" .Ft int -.Fn VFS_ROOT "struct mount *mp" "struct vnode **vpp" +.Fn VFS_ROOT "struct mount *mp" "int lktype" "struct vnode **vpp" .Ft int .Fn VFS_QUOTACTL "struct mount *mp" "struct quotactl_args *args" .Ft int @@ -68,13 +68,13 @@ .Ft int .Fn VFS_SYNC "struct mount *mp" "int waitfor" "kauth_cred_t cred" .Ft int -.Fn VFS_VGET "struct mount *mp" "ino_t ino" "struct vnode **vpp" +.Fn VFS_VGET "struct mount *mp" "ino_t ino" "int lktype" "struct vnode **vpp" .Ft int .Fn VFS_LOADVNODE "struct mount *mp" "struct vnode *vp" "const void *key" "size_t key_len" "const void **new_key" .Ft int .Fn VFS_NEWVNODE "struct mount *mp" "struct vnode *dvp" "struct vnode *vp" "struct vattr *vap" "kauth_cred_t cred" "void *extra" "size_t *key_len" "const void **new_key" .Ft int -.Fn VFS_FHTOVP "struct mount *mp" "struct fid *fhp" "struct vnode **vpp" +.Fn VFS_FHTOVP "struct mount *mp" "struct fid *fhp" "int lktype" "struct vnode **vpp" .Ft int .Fn VFS_VPTOFH "struct vnode *vp" "struct fid *fhp" "size_t *fh_size" .Ft int @@ -282,12 +282,21 @@ is specified in the flags then open files are forcibly closed. The function also deallocates space associated with data structure that were allocated for the file system when it was mounted. -.It Fn VFS_ROOT "mp" "vpp" +.It Fn VFS_ROOT "mp" "lktype" "vpp" Get the root vnode of the file system specified by the mount structure .Fa mp . The vnode is returned in the address given by -.Fa vpp . +.Fa vpp , +with lock type +.Fa lktype . +.Fa lktype +can be +.Dv LK_NONE , +or +.Dv LK_SHARED , +or +.Dv LK_EXCLUSIVE . This function is used by the pathname translation algorithms when a vnode that has been covered by a mounted file system is encountered. While resolving the pathname, the pathname translation algorithm will @@ -333,11 +342,20 @@ The argument specifies the calling credentials. .Fn VFS_SYNC does not provide any return value since the operation can never fail. -.It Fn VFS_VGET "mp" "ino" "vpp" +.It Fn VFS_VGET "mp" "ino" "lktype" "vpp" Get vnode for a file system type specific file id .Fa ino for the file system specified by the mount structure -.Fa mp . +.Fa mp , +with lock type +.Fa lktype . +.Fa lktype +can be +.Dv LK_NONE , +or +.Dv LK_SHARED , +or +.Dv LK_EXCLUSIVE . The vnode is returned in the address specified .Fa vpp . The function is optional for file systems which have a unique id @@ -386,11 +404,20 @@ The key for the file is returned in the .Fa key_len and .Fa new_key . -.It Fn VFS_FHTOVP "mp" "fhp" "vpp" +.It Fn VFS_FHTOVP "mp" "fhp" "lktype" "vpp" Get the vnode for the file handle .Fa fhp in the file system specified by the mount structure -.Fa mp . +.Fa mp , +with lock type +.Fa lktype . +.Fa lktype +can be +.Dv LK_NONE , +or +.Dv LK_SHARED , +or +.Dv LK_EXCLUSIVE . The locked vnode is returned in .Fa vpp . .Pp
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Sat Aug 1 09:51:06 UTC 2020 Modified Files: src/share/man/man9: workqueue.9 Log Message: Fix typo. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/share/man/man9/workqueue.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/workqueue.9 diff -u src/share/man/man9/workqueue.9:1.13 src/share/man/man9/workqueue.9:1.14 --- src/share/man/man9/workqueue.9:1.13 Sat Aug 1 02:14:43 2020 +++ src/share/man/man9/workqueue.9 Sat Aug 1 09:51:06 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: workqueue.9,v 1.13 2020/08/01 02:14:43 riastradh Exp $ +.\" $NetBSD: workqueue.9,v 1.14 2020/08/01 09:51:06 wiz Exp $ .\" .\" Copyright (c)2005 YAMAMOTO Takashi, .\" All rights reserved. @@ -87,7 +87,7 @@ flags may be bitwise ORed together: Specifies that the kthread must be allowed to use any machine-dependent per-CPU floating-point units or SIMD vector units, as in .Xr kthread_fpu_enter 9 / Xr kthread_fpu_exit 9 , -when it executes the worker function.u +when it executes the worker function. .It Dv WQ_MPSAFE Specifies that the workqueue is multiprocessor safe and does its own locking; otherwise the kernel lock will be held while processing work.
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Sat Aug 1 09:50:43 UTC 2020 Modified Files: src/share/man/man9: kthread.9 Log Message: Fix typo in macro and merge to error descriptions for the same error To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/share/man/man9/kthread.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/kthread.9 diff -u src/share/man/man9/kthread.9:1.29 src/share/man/man9/kthread.9:1.30 --- src/share/man/man9/kthread.9:1.29 Sat Aug 1 02:04:55 2020 +++ src/share/man/man9/kthread.9 Sat Aug 1 09:50:42 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: kthread.9,v 1.29 2020/08/01 02:04:55 riastradh Exp $ +.\" $NetBSD: kthread.9,v 1.30 2020/08/01 09:50:42 wiz Exp $ .\" .\" Copyright (c) 2000, 2007, 2008 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -63,7 +63,7 @@ units that are normally available to use kthreads between .Fn kthread_fpu_enter and -.fn kthread_fpu_exit . +.Fn kthread_fpu_exit . .Sh FUNCTIONS .Bl -tag -width compact .It Fn kthread_create "pri" "flags" "ci" "func" "arg" "newlp" "fmt" "..." @@ -201,9 +201,8 @@ returns 0. Otherwise, the following error values are returned: .Bl -tag -width [EAGAIN] .It Bq Er EAGAIN -The limit on the total number of system processes would be exceeded. -.It Bq Er EAGAIN -The limit +The limit on the total number of system processes would be exceeded; +or the limit .Dv RLIMIT_NPROC on the total number of processes under execution by this user id would be exceeded.
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Fri Jul 10 06:28:49 UTC 2020 Modified Files: src/share/man/man9: pci_configure_bus.9 Log Message: Remove trailing comma. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/share/man/man9/pci_configure_bus.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/pci_configure_bus.9 diff -u src/share/man/man9/pci_configure_bus.9:1.18 src/share/man/man9/pci_configure_bus.9:1.19 --- src/share/man/man9/pci_configure_bus.9:1.18 Fri Jul 10 02:27:13 2020 +++ src/share/man/man9/pci_configure_bus.9 Fri Jul 10 06:28:49 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: pci_configure_bus.9,v 1.18 2020/07/10 02:27:13 thorpej Exp $ +.\" $NetBSD: pci_configure_bus.9,v 1.19 2020/07/10 06:28:49 wiz Exp $ .\" .\" Copyright 2001 Wasabi Systems, Inc. .\" All rights reserved. @@ -296,7 +296,7 @@ This configuration example is taken from Note that this must be called before the PCI bus is attached during autoconfiguration. .Sh SEE ALSO -.Xr pci 4 , +.Xr pci 4 .Sh HISTORY .Fn pci_configure_bus was added in
CVS commit: src/share/man/man9
Module Name:src Committed By: christos Date: Sat Jul 4 21:07:29 UTC 2020 Modified Files: src/share/man/man9: vfsops.9 Log Message: add missing arg To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/share/man/man9/vfsops.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/vfsops.9 diff -u src/share/man/man9/vfsops.9:1.49 src/share/man/man9/vfsops.9:1.50 --- src/share/man/man9/vfsops.9:1.49 Tue Jan 1 05:06:54 2019 +++ src/share/man/man9/vfsops.9 Sat Jul 4 17:07:29 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: vfsops.9,v 1.49 2019/01/01 10:06:54 hannken Exp $ +.\" $NetBSD: vfsops.9,v 1.50 2020/07/04 21:07:29 christos Exp $ .\" .\" Copyright (c) 2001 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 January 1, 2019 +.Dd July 4, 2020 .Dt VFSOPS 9 .Os .Sh NAME @@ -360,7 +360,7 @@ The new key is returned in the address s .Fa new_key . .Pp Caller of this function assures no other thread will try to load this file. -.It Fn VFS_NEWVNODE "mp" "dvp" "vp" "vap" "cred" "key_len" "new_key" +.It Fn VFS_NEWVNODE "mp" "dvp" "vp" "vap" "cred" "extra" "key_len" "new_key" Initialise the vnode .Fa vp with a new file for the file system specified by the mount structure
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Fri Jun 19 07:25:20 UTC 2020 Modified Files: src/share/man/man9: kmem.9 Log Message: Remove trailing whitespace. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/share/man/man9/kmem.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/kmem.9 diff -u src/share/man/man9/kmem.9:1.25 src/share/man/man9/kmem.9:1.26 --- src/share/man/man9/kmem.9:1.25 Thu Jun 18 23:30:51 2020 +++ src/share/man/man9/kmem.9 Fri Jun 19 07:25:20 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: kmem.9,v 1.25 2020/06/18 23:30:51 kamil Exp $ +.\" $NetBSD: kmem.9,v 1.26 2020/06/19 07:25:20 wiz Exp $ .\" .\" Copyright (c)2006 YAMAMOTO Takashi, .\" All rights reserved. @@ -195,7 +195,7 @@ function is a simplified version of .Fn kmem_strdupsize that does not return the size of the allocation. .Pp -The +The .Fn kmem_strndup function is variation of .Fn kmem_strdup
CVS commit: src/share/man/man9
Module Name:src Committed By: kamil Date: Thu Jun 18 23:30:51 UTC 2020 Modified Files: src/share/man/man9: kmem.9 Log Message: Document kmem_strdup() and kmem_strndup() Added in 2018 by christos@ in sys/sys/kmem.h r. 1.11. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/share/man/man9/kmem.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/kmem.9 diff -u src/share/man/man9/kmem.9:1.24 src/share/man/man9/kmem.9:1.25 --- src/share/man/man9/kmem.9:1.24 Thu Aug 15 12:24:08 2019 +++ src/share/man/man9/kmem.9 Thu Jun 18 23:30:51 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: kmem.9,v 1.24 2019/08/15 12:24:08 maxv Exp $ +.\" $NetBSD: kmem.9,v 1.25 2020/06/18 23:30:51 kamil Exp $ .\" .\" Copyright (c)2006 YAMAMOTO Takashi, .\" All rights reserved. @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" -.Dd August 15, 2019 +.Dd June 19, 2020 .Dt KMEM 9 .Os .\" @@ -63,6 +63,12 @@ .Ft char * .Fn kmem_strdupsize \ "const char *str" "size_t *size" "km_flag_t kmflags" +.Ft char * +.Fn kmem_strdup \ +"const char *str" "km_flag_t kmflags" +.Ft char * +.Fn kmem_strndup \ +"const char *str" "size_t manxlen" "km_flag_t kmflags" .Ft void .Fn kmem_strfree \ "char *str" @@ -184,6 +190,22 @@ argument if that is not .Dv NULL . .Pp The +.Fn kmem_strdup +function is a simplified version of +.Fn kmem_strdupsize +that does not return the size of the allocation. +.Pp +The +.Fn kmem_strndup +function is variation of +.Fn kmem_strdup +that copies at most +.Fa maxlen +characters from the string +.Fa str +always NUL terminating the copied string. +.Pp +The .Fn kmem_strfree function can be used to free a .Dv NUL
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Thu Jun 18 20:38:42 UTC 2020 Added Files: src/share/man/man9: acl.9 Log Message: Add acl(9) from FreeBSD. Needs work before it should be added to the build. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/share/man/man9/acl.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/share/man/man9/acl.9 diff -u /dev/null src/share/man/man9/acl.9:1.1 --- /dev/null Thu Jun 18 20:38:42 2020 +++ src/share/man/man9/acl.9 Thu Jun 18 20:38:42 2020 @@ -0,0 +1,226 @@ +.\" $NetBSD: acl.9,v 1.1 2020/06/18 20:38:42 wiz Exp $ +.\"- +.\" Copyright (c) 1999-2001 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD: head/share/man/man9/acl.9 287445 2015-09-04 00:14:20Z delphij $ +.\" +.Dd September 4, 2015 +.Dt ACL 9 +.Os +.Sh NAME +.Nm acl +.Nd virtual file system access control lists +.Sh SYNOPSIS +.In sys/param.h +.In sys/vnode.h +.In sys/acl.h +.Pp +In the kernel configuration file: +.Cd "options UFS_ACL" +.Sh DESCRIPTION +Access control lists, or ACLs, +allow fine-grained specification of rights +for vnodes representing files and directories. +However, as there are a plethora of file systems with differing ACL semantics, +the vnode interface is aware only of the syntax of ACLs, +relying on the underlying file system to implement the details. +Depending on the underlying file system, each file or directory +may have zero or more ACLs associated with it, named using the +.Fa type +field of the appropriate vnode ACL calls: +.Xr VOP_ACLCHECK 9 , +.Xr VOP_GETACL 9 , +and +.Xr VOP_SETACL 9 . +.Pp +Currently, each ACL is represented in-kernel by a fixed-size +.Vt acl +structure, defined as follows: +.Bd -literal -offset indent +struct acl { +unsigned intacl_maxcnt; +unsigned intacl_cnt; +int acl_spare[4]; +struct acl_entryacl_entry[ACL_MAX_ENTRIES]; +}; +.Ed +.Pp +An ACL is constructed from a fixed size array of ACL entries, +each of which consists of a set of permissions, principal namespace, +and principal identifier. +In this implementation, the +.Vt acl_maxcnt +field is always set to +.Dv ACL_MAX_ENTRIES . +.Pp +Each individual ACL entry is of the type +.Vt acl_entry_t , +which is a structure with the following members: +.Bl -tag -width 2n +.It Vt acl_tag_t Va ae_tag +The following is a list of definitions of ACL types +to be set in +.Va ae_tag : +.Pp +.Bl -tag -width ".Dv ACL_UNDEFINED_FIELD" -offset indent -compact +.It Dv ACL_UNDEFINED_FIELD +Undefined ACL type. +.It Dv ACL_USER_OBJ +Discretionary access rights for processes whose effective user ID +matches the user ID of the file's owner. +.It Dv ACL_USER +Discretionary access rights for processes whose effective user ID +matches the ACL entry qualifier. +.It Dv ACL_GROUP_OBJ +Discretionary access rights for processes whose effective group ID +or any supplemental groups +match the group ID of the file's owner. +.It Dv ACL_GROUP +Discretionary access rights for processes whose effective group ID +or any supplemental groups +match the ACL entry qualifier. +.It Dv ACL_MASK +The maximum discretionary access rights that can be granted +to a process in the file group class. +This is only valid for POSIX.1e ACLs. +.It Dv ACL_OTHER +Discretionary access rights for processes not covered by any other ACL +entry. +This is only valid for POSIX.1e ACLs. +.It Dv ACL_OTHER_OBJ +Same as +.Dv ACL_OTHER . +.It Dv ACL_EVERYONE +Discretionary access rights for all users. +This is only valid for NFSv4 ACLs. +.El +.Pp +Each
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Thu Jun 4 13:45:19 UTC 2020 Modified Files: src/share/man/man9: malloc.9 Log Message: Add missing comma. To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/share/man/man9/malloc.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/malloc.9 diff -u src/share/man/man9/malloc.9:1.57 src/share/man/man9/malloc.9:1.58 --- src/share/man/man9/malloc.9:1.57 Sat May 30 17:18:22 2020 +++ src/share/man/man9/malloc.9 Thu Jun 4 13:45:19 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: malloc.9,v 1.57 2020/05/30 17:18:22 jdolecek Exp $ +.\" $NetBSD: malloc.9,v 1.58 2020/06/04 13:45:19 wiz Exp $ .\" .\" Copyright (c) 1996, 2003 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -238,7 +238,7 @@ with and .Ox . Likewise calls to -.Fn MALLOC_DECLARE +.Fn MALLOC_DECLARE , .Fn MALLOC_DEFINE , .Fn malloc_type_attach , and
CVS commit: src/share/man/man9
Module Name:src Committed By: jdolecek Date: Sat May 30 17:18:22 UTC 2020 Modified Files: src/share/man/man9: malloc.9 Log Message: slightly improve sentence, no need to 'Note' when in NOTES section To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/share/man/man9/malloc.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/malloc.9 diff -u src/share/man/man9/malloc.9:1.56 src/share/man/man9/malloc.9:1.57 --- src/share/man/man9/malloc.9:1.56 Sat May 30 17:12:01 2020 +++ src/share/man/man9/malloc.9 Sat May 30 17:18:22 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: malloc.9,v 1.56 2020/05/30 17:12:01 jdolecek Exp $ +.\" $NetBSD: malloc.9,v 1.57 2020/05/30 17:18:22 jdolecek Exp $ .\" .\" Copyright (c) 1996, 2003 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -230,7 +230,7 @@ Other malloc types are defined by the co documentation for that subsystem for information its available malloc types. .Sh NOTES -Note that the malloc type argument is actually unused on +The malloc type argument is actually unused on .Nx , the argument is only supported for easier source compatibility with
CVS commit: src/share/man/man9
Module Name:src Committed By: jdolecek Date: Sat May 30 17:12:01 UTC 2020 Modified Files: src/share/man/man9: malloc.9 Log Message: remove M_SOFTDEP from list of supported malloc types, it's long gone also remove M_PCB - while it is used by SCTP, it's actually not defined anywhere in fact add new NOTES section explaining that the malloc types are actually not used on NetBSD To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/share/man/man9/malloc.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/malloc.9 diff -u src/share/man/man9/malloc.9:1.55 src/share/man/man9/malloc.9:1.56 --- src/share/man/man9/malloc.9:1.55 Sun Oct 14 17:40:28 2018 +++ src/share/man/man9/malloc.9 Sat May 30 17:12:01 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: malloc.9,v 1.55 2018/10/14 17:40:28 jdolecek Exp $ +.\" $NetBSD: malloc.9,v 1.56 2020/05/30 17:12:01 jdolecek Exp $ .\" .\" Copyright (c) 1996, 2003 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 October 14, 2018 +.Dd May 30, 2020 .Dt MALLOC 9 .Os .Sh NAME @@ -222,10 +222,6 @@ Device driver memory. structures. .It Dv M_FREE Should be on free list. -.It Dv M_PCB -Protocol control block. -.It Dv M_SOFTINTR -Softinterrupt structures. .It Dv M_TEMP Misc temporary data buffers. .El @@ -233,6 +229,22 @@ Misc temporary data buffers. Other malloc types are defined by the corresponding subsystem; see the documentation for that subsystem for information its available malloc types. +.Sh NOTES +Note that the malloc type argument is actually unused on +.Nx , +the argument is only supported for easier source compatibility +with +.Fx +and +.Ox . +Likewise calls to +.Fn MALLOC_DECLARE +.Fn MALLOC_DEFINE , +.Fn malloc_type_attach , +and +.Fn malloc_type_detach +are defined out and have no effect on +.Nx . .Sh RETURN VALUES .Fn malloc returns a kernel virtual address that is suitably aligned for storage of
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Mon May 4 15:13:46 UTC 2020 Modified Files: src/share/man/man9: rnd.9 Log Message: Improve markup. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/share/man/man9/rnd.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/rnd.9 diff -u src/share/man/man9/rnd.9:1.28 src/share/man/man9/rnd.9:1.29 --- src/share/man/man9/rnd.9:1.28 Thu Apr 30 03:28:18 2020 +++ src/share/man/man9/rnd.9 Mon May 4 15:13:45 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: rnd.9,v 1.28 2020/04/30 03:28:18 riastradh Exp $ +.\" $NetBSD: rnd.9,v 1.29 2020/05/04 15:13:45 wiz Exp $ .\" .\" Copyright (c) 1997 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -275,7 +275,7 @@ but may be used in a callback as set wit .Fn rndsource_setcb . .It Fn rnd_add_uint32 "rnd_source" "datum" Equivalent to -.Li "rnd_add_data(" Ns Fa rnd_source Ns Li ", &" Ns datum Ns Li ", 4, 0)" . +.Li rnd_add_data Ns ( Ns Fa rnd_source , Li & Ns Fa datum , Li 4 , 0 ) . .Pp .Fn rnd_add_uint32 .Em must not
CVS commit: src/share/man/man9
Module Name:src Committed By: riastradh Date: Sun May 3 04:06:15 UTC 2020 Modified Files: src/share/man/man9: condvar.9 Log Message: Bump date. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/share/man/man9/condvar.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/condvar.9 diff -u src/share/man/man9/condvar.9:1.26 src/share/man/man9/condvar.9:1.27 --- src/share/man/man9/condvar.9:1.26 Sun May 3 04:05:50 2020 +++ src/share/man/man9/condvar.9 Sun May 3 04:06:15 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: condvar.9,v 1.26 2020/05/03 04:05:50 riastradh Exp $ +.\" $NetBSD: condvar.9,v 1.27 2020/05/03 04:06:15 riastradh Exp $ .\" .\" Copyright (c) 2006, 2007, 2008, 2020 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 April 9, 2020 +.Dd May 2, 2020 .Dt CONDVAR 9 .Os .Sh NAME
CVS commit: src/share/man/man9
Module Name:src Committed By: riastradh Date: Sun May 3 04:05:29 UTC 2020 Modified Files: src/share/man/man9: condvar.9 Log Message: Add a note about setting the timeout to zero _and_ returning success. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/share/man/man9/condvar.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/condvar.9 diff -u src/share/man/man9/condvar.9:1.24 src/share/man/man9/condvar.9:1.25 --- src/share/man/man9/condvar.9:1.24 Sun May 3 04:05:00 2020 +++ src/share/man/man9/condvar.9 Sun May 3 04:05:28 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: condvar.9,v 1.24 2020/05/03 04:05:00 riastradh Exp $ +.\" $NetBSD: condvar.9,v 1.25 2020/05/03 04:05:28 riastradh Exp $ .\" .\" Copyright (c) 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -230,6 +230,19 @@ subtract the time elapsed from .Fa bt in place, or set it to zero if there is no time remaining. .Pp +Note that +.Fn cv_timedwaitbt +and +.Fn cv_timedwaitbt_sig +may return zero indicating success, rather than +.Er EWOULDBLOCK , +even if they set the timeout to zero; this means that the caller must +re-check the condition in order to avoid potentially losing a +.Fn cv_signal , +but the +.Em next +wait will time out immediately. +.Pp The hint .Fa epsilon , which can be
CVS commit: src/share/man/man9
Module Name:src Committed By: riastradh Date: Sun May 3 04:05:50 UTC 2020 Modified Files: src/share/man/man9: condvar.9 Log Message: Document cv_timedwaitclock. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/share/man/man9/condvar.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/condvar.9 diff -u src/share/man/man9/condvar.9:1.25 src/share/man/man9/condvar.9:1.26 --- src/share/man/man9/condvar.9:1.25 Sun May 3 04:05:28 2020 +++ src/share/man/man9/condvar.9 Sun May 3 04:05:50 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: condvar.9,v 1.25 2020/05/03 04:05:28 riastradh Exp $ +.\" $NetBSD: condvar.9,v 1.26 2020/05/03 04:05:50 riastradh Exp $ .\" .\" Copyright (c) 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -65,6 +65,13 @@ .Ft int .Fn cv_timedwaitbt_sig "kcondvar_t *cv" "kmutex_t *mtx" "struct bintime *bt" \ "const struct bintime *epsilon" +.Ft int +.Fn cv_timedwaitclock "kcondvar_t *cv" "kmutex_t *mtx" \ +"struct timespec *timeout" "clockid_t clockid" "int flags" \ +"const struct bintime *epsilon" +.Fn cv_timedwaitclock_sig "kcondvar_t *cv" "kmutex_t *mtx" \ +"struct timespec *timeout" "clockid_t clockid" "int flags" \ +"const struct bintime *epsilon" .Ft void .Fn cv_signal "kcondvar_t *cv" .Ft void @@ -257,6 +264,47 @@ However, the system is still limited by resolution and by scheduling competition, which may delay the wakeup by more than .Fa bt Li "+" Fa epsilon . +.It Fn cv_timedwaitclock "cv" "lock" "timeout" "clockid" "flags" "epsilon" +.It Fn cv_timedwaitclock_sig "cv" "lock" "timeout" "clockid" "flags" "epsilon" +As per +.Fn cv_wait +and +.Fn cv_wait_sig , +but will return early in case of timeout. +The timeout is measured by the clock +.Fa clockid ; +see +.Xr clock_settime 2 +for the supported options. +The +.Fa flags +may be +.Dv TIMER_RELTIME +for a relative duration or +.Dv TIMER_ABSTIME +for an absolute time on the clock. +For relative timeouts, +.Fn cv_timedwaitclock +and +.Fn cv_timedwaitclock_sig +subtract the elapsed time from +.Fa timeout +in place, or set it to zero if there is no time remaining. +The hint +.Fa epsilon +requests a maximum delay after the timeout before wakeup. +.Pp +It is safe to pass in values of +.Fa clockid +and +.Fa flags +from userland, and timeouts copied in from userland; if anything is +wrong with them, +.Fn cv_timedwaitclock +or +.Fn cv_timedwaitclock_sig +will return +.Er EINVAL . .It Fn cv_signal "cv" .Pp Awaken one LWP waiting on the specified condition variable. @@ -332,6 +380,29 @@ Consuming a resource: consume(res); .Ed .Pp +Consuming a resource using a timeout specified in a syscall by +userland: +.Bd -literal + struct timespec timeout; + + error = copyin(SCARG(uap, timeout), , sizeof timeout); + if (error) + return error; + + mutex_enter(>mutex); + while (res->state == BUSY) { + error = cv_timedwaitclock_sig(>condvar, + >mutex, , SCARG(uap, clock_id), + SCARG(uap, flags), DEFAULT_TIMEOUT_EPSILON); + if (error) + break; + } + mutex_exit(>mutex); + if (error) + return error; + consume(res); +.Ed +.Pp Releasing a resource for the next consumer to use: .Bd -literal mutex_enter(>mutex); @@ -371,3 +442,9 @@ and .Fn cv_timedwaitbt_sig primitives first appeared in .Nx 9.0 . +The +.Fn cv_timedwaitclock +and +.Fn cv_timedwaitclock_sig +primitives first appeared in +.Nx 10.0 .
CVS commit: src/share/man/man9
Module Name:src Committed By: riastradh Date: Sun May 3 04:04:32 UTC 2020 Modified Files: src/share/man/man9: condvar.9 Log Message: Update cv_timedwaitbt documentation to reflect useful reality. Previously, a negative timeout was forbidden (kassert), a zero or maybe even just a sufficiently small timeout would block forever, and we would subtract the time elapsed -- possibly longer than the timeout, leading to a negative updated timeout, which would trip the kassert the next time around if used as advertised. DERP. Now negative timeouts are still forbidden in order to detect usage mistakes, but a zero timeout fails immediately and we clamp the subtracted time to be at least zero so you can always safely call cv_timedwaitbt in a loop. (An alternative would be to fail immediately for all nonpositive timeouts, and to leave in the timespec the negative time we overshot, but it's not clear this would be useful.) To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/share/man/man9/condvar.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/condvar.9 diff -u src/share/man/man9/condvar.9:1.22 src/share/man/man9/condvar.9:1.23 --- src/share/man/man9/condvar.9:1.22 Fri Apr 10 17:16:21 2020 +++ src/share/man/man9/condvar.9 Sun May 3 04:04:32 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: condvar.9,v 1.22 2020/04/10 17:16:21 ad Exp $ +.\" $NetBSD: condvar.9,v 1.23 2020/05/03 04:04:32 riastradh Exp $ .\" .\" Copyright (c) 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -213,19 +213,28 @@ if the timeout expires. .It Fn cv_timedwaitbt "cv" "mtx" "bt" "epsilon" .It Fn cv_timedwaitbt_sig "cv" "mtx" "bt" "epsilon" .Pp -Similar to -.Fn cv_timedwait +As per +.Fn cv_wait and -.Fn cv_timedwait_sig , -but +.Fn cv_wait_sig , +but will return early if the duration +.Fa bt +has elapsed, immediately if +.Fa bt +is zero. +On return, +.Fn cv_timedwaitbt +and +.Fn cv_timedwaitbt_sig +subtract the time elapsed from .Fa bt -is decremented in place with the amount of time actually waited, and on -return contains the amount of time remaining, possibly negative if the -timeout expired. +in place, or set it to zero if there is no time remaining. .Pp The hint -.Fa epsilon -requests that the wakeup not be delayed more than +.Fa epsilon , +which can be +.Dv DEFAULT_TIMEOUT_EPSILON +if in doubt, requests that the wakeup not be delayed more than .Fa bt Li "+" Fa epsilon , so that the system can coalesce multiple wakeups within their respective epsilons into a single high-resolution clock interrupt or @@ -291,10 +300,9 @@ Consuming a resource: * alloted time, return an error. */ struct bintime timeout = { .sec = 5, .frac = 0 }; - const struct bintime epsilon = { .sec = 1, .frac = 0 }; while (res->state == BUSY) { - error = cv_timedwaitbt(>condvar, \\ - >mutex, , ); + error = cv_timedwaitbt(>condvar, + >mutex, , DEFAULT_TIMEOUT_EPSILON); if (error) { KASSERT(error == EWOULDBLOCK); if (res->state != BUSY)
CVS commit: src/share/man/man9
Module Name:src Committed By: riastradh Date: Sun May 3 04:05:00 UTC 2020 Modified Files: src/share/man/man9: condvar.9 Log Message: Simplify example of cv_timedwaitbt. It is simpler if there is only one place we check the condition. That said, there are cases where the caller needs to re-check before choosing to fail (e.g., futex_wait in kern/sys_futex.c, which must verify the condition before taking destructive steps to abort the wait). But it's not clear that that's the norm. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/share/man/man9/condvar.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/condvar.9 diff -u src/share/man/man9/condvar.9:1.23 src/share/man/man9/condvar.9:1.24 --- src/share/man/man9/condvar.9:1.23 Sun May 3 04:04:32 2020 +++ src/share/man/man9/condvar.9 Sun May 3 04:05:00 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: condvar.9,v 1.23 2020/05/03 04:04:32 riastradh Exp $ +.\" $NetBSD: condvar.9,v 1.24 2020/05/03 04:05:00 riastradh Exp $ .\" .\" Copyright (c) 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -305,8 +305,6 @@ Consuming a resource: >mutex, , DEFAULT_TIMEOUT_EPSILON); if (error) { KASSERT(error == EWOULDBLOCK); - if (res->state != BUSY) -break; mutex_exit(>mutex); return ETIMEDOUT; }
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Sat Apr 18 18:55:20 UTC 2020 Modified Files: src/share/man/man9: time_second.9 Log Message: Remove trailing comma. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/share/man/man9/time_second.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/time_second.9 diff -u src/share/man/man9/time_second.9:1.8 src/share/man/man9/time_second.9:1.9 --- src/share/man/man9/time_second.9:1.8 Fri Apr 17 17:43:38 2020 +++ src/share/man/man9/time_second.9 Sat Apr 18 18:55:20 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: time_second.9,v 1.8 2020/04/17 17:43:38 jdolecek Exp $ +.\" $NetBSD: time_second.9,v 1.9 2020/04/18 18:55:20 wiz Exp $ .\" .\" Copyright (c) 1994 Christopher G. Demetriou .\" All rights reserved. @@ -37,7 +37,7 @@ .Os .Sh NAME .Nm time_second , -.Nm time_uptime , +.Nm time_uptime .Nd system time variables .Sh SYNOPSIS .In sys/time.h
CVS commit: src/share/man/man9
Module Name:src Committed By: jdolecek Date: Fri Apr 17 17:43:38 UTC 2020 Modified Files: src/share/man/man9: time_second.9 Log Message: remove documentation for (non-atomic) boottime, it was eliminated from kernel in 2020-01-02 by thorpej@ To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/share/man/man9/time_second.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/time_second.9 diff -u src/share/man/man9/time_second.9:1.7 src/share/man/man9/time_second.9:1.8 --- src/share/man/man9/time_second.9:1.7 Tue Oct 30 20:10:23 2018 +++ src/share/man/man9/time_second.9 Fri Apr 17 17:43:38 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: time_second.9,v 1.7 2018/10/30 20:10:23 kre Exp $ +.\" $NetBSD: time_second.9,v 1.8 2020/04/17 17:43:38 jdolecek Exp $ .\" .\" Copyright (c) 1994 Christopher G. Demetriou .\" All rights reserved. @@ -32,20 +32,17 @@ .\" .\" <> .\" -.Dd October 30, 2018 +.Dd April 17, 2020 .Dt TIME_SECOND 9 .Os .Sh NAME .Nm time_second , .Nm time_uptime , -.Nm boottime .Nd system time variables .Sh SYNOPSIS .In sys/time.h .Vt extern time_t time_second; .Vt extern time_t time_uptime; -.In sys/kernel.h -.Vt extern struct timespec boottime; .Sh DESCRIPTION The .Va time_second @@ -67,18 +64,8 @@ It is set at boot, and is updated period (It is not updated by .Xr settimeofday 2 . ) .Pp -The -.Va boottime -variable holds the system boot time. -It is set at system boot, and is updated when the system time is adjusted -with -.Xr settimeofday 2 . -The variable may be read and written without special precautions. -.Pp All of these variables contain times -expressed in seconds (and for -.Va boottime , -nanoseconds) since midnight (0 hour), +expressed in seconds since midnight (0 hour), January 1, 1970, UTC. .Pp The
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Mon Apr 13 08:59:14 UTC 2020 Modified Files: src/share/man/man9: pool.9 pool_cache.9 Log Message: Remove superfluous whitespace & macros. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/share/man/man9/pool.9 cvs rdiff -u -r1.21 -r1.22 src/share/man/man9/pool_cache.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/pool.9 diff -u src/share/man/man9/pool.9:1.48 src/share/man/man9/pool.9:1.49 --- src/share/man/man9/pool.9:1.48 Mon Apr 13 00:27:16 2020 +++ src/share/man/man9/pool.9 Mon Apr 13 08:59:14 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: pool.9,v 1.48 2020/04/13 00:27:16 chs Exp $ +.\" $NetBSD: pool.9,v 1.49 2020/04/13 08:59:14 wiz Exp $ .\" .\" Copyright (c) 1997, 1998, 2007 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -193,7 +193,6 @@ The handle identifying the pool resource A pointer to a pool item previously obtained by .Fn pool_get . .El -.Pp .Ss SETTING POOL RESOURCE WATERMARKS AND LIMITS A pool will attempt to increase its resource usage to keep up with the demand for its items. @@ -218,7 +217,7 @@ and respectively. The defaults for these limits are .Dv 0 -and +and .Dv UINT_MAX , respectively. Changing these limits will cause memory to be immediately allocated to the pool Index: src/share/man/man9/pool_cache.9 diff -u src/share/man/man9/pool_cache.9:1.21 src/share/man/man9/pool_cache.9:1.22 --- src/share/man/man9/pool_cache.9:1.21 Mon Apr 13 00:27:16 2020 +++ src/share/man/man9/pool_cache.9 Mon Apr 13 08:59:14 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: pool_cache.9,v 1.21 2020/04/13 00:27:16 chs Exp $ +.\" $NetBSD: pool_cache.9,v 1.22 2020/04/13 08:59:14 wiz Exp $ .\" .\" Copyright (c)2003 YAMAMOTO Takashi, .\" All rights reserved. @@ -152,7 +152,6 @@ cache locality in multiprocessor systems .Pp Allocate and initialize a pool cache. The arguments are: -.Pp .Bl -tag -width four .It Fa size .Pp
CVS commit: src/share/man/man9
Module Name:src Committed By: jdolecek Date: Tue Apr 7 07:25:09 UTC 2020 Modified Files: src/share/man/man9: spl.9 Log Message: bring the section on automatic acquisition of kernel_lock up-to-date To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/share/man/man9/spl.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/spl.9 diff -u src/share/man/man9/spl.9:1.41 src/share/man/man9/spl.9:1.42 --- src/share/man/man9/spl.9:1.41 Thu Apr 6 03:00:13 2017 +++ src/share/man/man9/spl.9 Tue Apr 7 07:25:09 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: spl.9,v 1.41 2017/04/06 03:00:13 pgoyette Exp $ +.\" $NetBSD: spl.9,v 1.42 2020/04/07 07:25:09 jdolecek Exp $ .\" .\" Copyright (c) 2000, 2001 Jason R. Thorpe. All rights reserved. .\" Copyright (c) 1997 Michael Long. @@ -27,7 +27,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 6, 2017 +.Dd April 7, 2020 .Dt SPL 9 .Os .Sh NAME @@ -169,14 +169,17 @@ or endorsed .Xr pool_cache 9 interfaces to allocate memory. .Pp -At the time of writing, the global +The global .Dv kernel_lock -is automatically acquired for interrupts at this level, in order to +is automatically acquired for interrupts at this level by default, +in order to support device drivers that do not provide their own multiprocessor synchronization. -A future release of the system may allow the automatic acquisition of +The automatic acquisition of .Dv kernel_lock -to be disabled for individual interrupt handlers. +can be disabled for individual interrupt handlers by device drivers +if supported by subsystem, see e.g. +.Xr pci_intr_establish 9 . .Pp .Fn splbio , .Fn splnet ,
CVS commit: src/share/man/man9
Module Name:src Committed By: rin Date: Mon Apr 6 08:26:34 UTC 2020 Modified Files: src/share/man/man9: pool_cache.9 Log Message: Remove copy-paste garbage. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/share/man/man9/pool_cache.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/pool_cache.9 diff -u src/share/man/man9/pool_cache.9:1.19 src/share/man/man9/pool_cache.9:1.20 --- src/share/man/man9/pool_cache.9:1.19 Tue Nov 15 00:32:34 2011 +++ src/share/man/man9/pool_cache.9 Mon Apr 6 08:26:33 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: pool_cache.9,v 1.19 2011/11/15 00:32:34 jym Exp $ +.\" $NetBSD: pool_cache.9,v 1.20 2020/04/06 08:26:33 rin Exp $ .\" .\" Copyright (c)2003 YAMAMOTO Takashi, .\" All rights reserved. @@ -274,7 +274,6 @@ should be physical address of the object .Fa object or .Dv POOL_PADDR_INVALID . -.Fa pp . If the number of available items in the backing pool exceeds the maximum pool size set by .Fn pool_cache_sethiwat
CVS commit: src/share/man/man9
Module Name:src Committed By: skrll Date: Tue Mar 24 08:48:32 UTC 2020 Modified Files: src/share/man/man9: cprng.9 Log Message: Fix cprng_fast64 return type to match code To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/share/man/man9/cprng.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/cprng.9 diff -u src/share/man/man9/cprng.9:1.10 src/share/man/man9/cprng.9:1.11 --- src/share/man/man9/cprng.9:1.10 Thu Feb 19 15:38:30 2015 +++ src/share/man/man9/cprng.9 Tue Mar 24 08:48:31 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: cprng.9,v 1.10 2015/02/19 15:38:30 riastradh Exp $ +.\" $NetBSD: cprng.9,v 1.11 2020/03/24 08:48:31 skrll Exp $ .\" .\" Copyright (c) 2011-2015 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 February 19, 2015 +.Dd March 24, 2020 .Dt CPRNG 9 .Os .Sh NAME @@ -57,7 +57,7 @@ .Fn cprng_fast "void *buf" "size_t len" .Ft uint32_t .Fn cprng_fast32 "void" -.Ft uint32_t +.Ft uint64_t .Fn cprng_fast64 "void" .Bd -literal #define CPRNG_MAX_LEN 524288
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Fri Mar 20 08:02:55 UTC 2020 Modified Files: src/share/man/man9: usbnet.9 Log Message: Fix some typos, remove unnecessary Pp To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/share/man/man9/usbnet.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/usbnet.9 diff -u src/share/man/man9/usbnet.9:1.10 src/share/man/man9/usbnet.9:1.11 --- src/share/man/man9/usbnet.9:1.10 Fri Mar 20 01:15:05 2020 +++ src/share/man/man9/usbnet.9 Fri Mar 20 08:02:55 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: usbnet.9,v 1.10 2020/03/20 01:15:05 thorpej Exp $ +.\" $NetBSD: usbnet.9,v 1.11 2020/03/20 08:02:55 wiz Exp $ .\" .\" Copyright (c) 2019 Matthew R. Green .\" All rights reserved. @@ -279,9 +279,8 @@ Returns true if device is dying (has bee pending detach.) .El .Pp -Refrence counting functions for +Reference counting functions for .Fa struct usbnet : -.Pp .Bl -tag -width 4n .It Fn usbnet_busy un Increases the reference count on the driver instance, preventing @@ -289,7 +288,7 @@ detach from occurring while the driver i device. Must be called with the core lock held. .It Fn usbnet_unbusy un -Decreses the reference count on the driver instance. +Decreases the reference count on the driver instance. Once the final reference has been dropped, if a detach event is pending, it is allowed to proceed. Must be called with the core lock held.
CVS commit: src/share/man/man9
Module Name:src Committed By: thorpej Date: Fri Mar 20 01:15:05 UTC 2020 Modified Files: src/share/man/man9: usbnet.9 Log Message: Update for recent locking changes. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/share/man/man9/usbnet.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/usbnet.9 diff -u src/share/man/man9/usbnet.9:1.9 src/share/man/man9/usbnet.9:1.10 --- src/share/man/man9/usbnet.9:1.9 Fri Aug 23 07:14:35 2019 +++ src/share/man/man9/usbnet.9 Fri Mar 20 01:15:05 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: usbnet.9,v 1.9 2019/08/23 07:14:35 wiz Exp $ +.\" $NetBSD: usbnet.9,v 1.10 2020/03/20 01:15:05 thorpej Exp $ .\" .\" Copyright (c) 2019 Matthew R. Green .\" All rights reserved. @@ -26,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 22, 2019 +.Dd March 15, 2020 .Dt USBNET 9 .Os .Sh NAME @@ -54,13 +54,13 @@ .Ft bool .Fn usbnet_isdying "struct usbnet *un" .Ft void -.Fn usbnet_lock "struct usbnet *un" +.Fn usbnet_lock_core "struct usbnet *un" .Ft void -.Fn usbnet_unlock "struct usbnet *un" +.Fn usbnet_unlock_core "struct usbnet *un" .Ft kmutex_t * -.Fn usbnet_mutex "struct usbnet *un" +.Fn usbnet_mutex_core "struct usbnet *un" .Ft void -.Fn usbnet_isowned "struct usbnet *un" +.Fn usbnet_isowned_core "struct usbnet *un" .Ft void .Fn usbnet_lock_rx "struct usbnet *un" .Ft void @@ -79,18 +79,6 @@ .Fn usbnet_isowned_tx "struct usbnet *un" .Ft int .Fn usbnet_init_rx_tx "struct usbnet *un" "unsigned rxflags" "unsigned txflags" -.Ft void -.Fn usbnet_lock_mii "struct usbnet *un" -.Ft void -.Fn usbnet_lock_mii_un_locked "struct usbnet *un" -.Ft void -.Fn usbnet_unlock_mii "struct usbnet *un" -.Ft void -.Fn usbnet_unlock_mii_un_locked "struct usbnet *un" -.Ft kmutex_t * -.Fn usbnet_mutex_mii "struct usbnet *un" -.Ft void -.Fn usbnet_isowned_mii "struct usbnet *un" .Ft int .Fn usbnet_miibus_readreg "device_t dev" "int phy" "int reg" "uint16_t *val" .Ft int @@ -98,6 +86,10 @@ .Ft void .Fn usbnet_miibus_statchg "struct ifnet *" .Ft void +.Fn usbnet_busy "struct usbnet *un" +.Ft void +.Fn usbnet_unbusy "struct usbnet *un" +.Ft void .Fn usbnet_enqueue "struct usbnet *un" "uint8_t *buf" "size_t buflen" "int csum_flags" "uint32_t csum_data" "int mbuf_flags" .Ft void .Fn usbnet_input "struct usbnet *un" "uint8_t *buf" "size_t buflen" @@ -126,7 +118,7 @@ Rx and Tx chain handling .It Generic handlers or support for several struct ifnet callbacks .It -MII bus locking +Network stack locking protocol .It Interrupt handling .El @@ -223,21 +215,16 @@ callback to turn off any chipset specifi .Pp For devices requiring MII handling there are callbacks for reading and writing registers, and for status change events. -The framework provides an MII-specific lock per interface which will be -held when calling these functions, and these locks should be used by +The framework serializes MII access with the core lock, which will be +held when calling these functions, and this lock should be used by internal code that also requires serialized access to registers with the -.Fn usbnet_lock_mii , -.Fn usbnet_unlock_mii , -.Fn usbnet_lock_mii_un_locked , +.Fn usbnet_lock_core and -.Fn usbnet_unlock_mii_un_locked +.Fn usbnet_unlock_core functions. -These functions handle device detach events safely, and as such take -and release a reference on this device and use the usbnet lock for -this. -Sometimes the usbnet lock is already held and instead the -.Dq un_locked -versions should be used. +The MII callbacks handle device detach events safely; a reference count +is taken and released around calls to the callbacks as the MII callbacks +usually block. .Pp As receive must handle the case of multiple packets in one buffer, the support is split between the driver and the framework. @@ -285,55 +272,52 @@ Returns pointer to this Returns pointer to this .Fa un's device softc. -.It Fn bool usbnet_havelink un +.It Fn usbnet_havelink un Returns true if link is active. -.It Fn bool usbnet_isdying un +.It Fn usbnet_isdying un Returns true if device is dying (has been pulled or deactivated, pending detach.) .El .Pp +Refrence counting functions for +.Fa struct usbnet : +.Pp +.Bl -tag -width 4n +.It Fn usbnet_busy un +Increases the reference count on the driver instance, preventing +detach from occurring while the driver is blocked accessing the +device. +Must be called with the core lock held. +.It Fn usbnet_unbusy un +Decreses the reference count on the driver instance. +Once the final reference has been dropped, if a detach event +is pending, it is allowed to proceed. +Must be called with the core lock held. +.El +.Pp Lock handling functions for .Fa struct usbnet : .Pp .Bl -tag -width 4n -compact -.It Fn usbnet_lock un -.It Fn usbnet_unlock un -.It Fn usbnet_isowned un +.It Fn
CVS commit: src/share/man/man9
Module Name:src Committed By: isaki Date: Sat Feb 29 05:39:03 UTC 2020 Modified Files: src/share/man/man9: audio.9 Log Message: Describe about (existing) constraints on round_blocksize(). To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/share/man/man9/audio.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/audio.9 diff -u src/share/man/man9/audio.9:1.57 src/share/man/man9/audio.9:1.58 --- src/share/man/man9/audio.9:1.57 Sun Feb 23 04:02:45 2020 +++ src/share/man/man9/audio.9 Sat Feb 29 05:39:03 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: audio.9,v 1.57 2020/02/23 04:02:45 isaki Exp $ +.\" $NetBSD: audio.9,v 1.58 2020/02/29 05:39:03 isaki Exp $ .\" .\" Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -344,8 +344,12 @@ or and .Va param , encoding parameters for the hardware. +.Va bs +passed is always non-zero and a multiple of the frame size represented by +param->channels * param->precision / 8. It should return a block size, possibly changed according to the needs of the hardware driver. +The return value also must be non-zero and a multiple of the frame size. It is called in the Attach or Closed phases. .It Dv int commit_settings(void *hdl) optional, is called after all calls to
CVS commit: src/share/man/man9
Module Name:src Committed By: mrg Date: Sun Feb 23 08:57:44 UTC 2020 Modified Files: src/share/man/man9: Makefile Log Message: install rw_lock_op link too. To generate a diff of this commit: cvs rdiff -u -r1.447 -r1.448 src/share/man/man9/Makefile 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.447 src/share/man/man9/Makefile:1.448 --- src/share/man/man9/Makefile:1.447 Fri Feb 7 13:02:35 2020 +++ src/share/man/man9/Makefile Sun Feb 23 08:57:44 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.447 2020/02/07 13:02:35 thorpej Exp $ +# $NetBSD: Makefile,v 1.448 2020/02/23 08:57:44 mrg Exp $ # Makefile for section 9 (kernel function and variable) manual pages. @@ -808,7 +808,8 @@ MLINKS+=rwlock.9 rw.9 rwlock.9 rw_init.9 rwlock.9 rw_enter.9 rwlock.9 rw_exit.9 \ rwlock.9 rw_tryenter.9 rwlock.9 rw_tryupgrade.9 \ rwlock.9 rw_downgrade.9 rwlock.9 rw_read_held.9 \ - rwlock.9 rw_write_held.9 rwlock.9 rw_lock_held.9 + rwlock.9 rw_write_held.9 rwlock.9 rw_lock_held.9 \ + rwlock.9 rw_lock_op.9 MLINKS+=STACK.9 STACK_ALLOC.9 \ STACK.9 STACK_MAX.9 \ STACK.9 STACK_ALIGN.9 \
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Fri Feb 7 15:11:46 UTC 2020 Modified Files: src/share/man/man9: percpu.9 Log Message: Remove duplicate word. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/share/man/man9/percpu.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/percpu.9 diff -u src/share/man/man9/percpu.9:1.14 src/share/man/man9/percpu.9:1.15 --- src/share/man/man9/percpu.9:1.14 Fri Feb 7 13:02:35 2020 +++ src/share/man/man9/percpu.9 Fri Feb 7 15:11:46 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: percpu.9,v 1.14 2020/02/07 13:02:35 thorpej Exp $ +.\" $NetBSD: percpu.9,v 1.15 2020/02/07 15:11:46 wiz Exp $ .\" .\" Copyright (c) 2010 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -175,7 +175,7 @@ The call to .Fa cb runs in the current thread; use .Fn percpu_foreach_xcall -to to execute the call to +to execute the call to .Fa cb on the remote CPUs. .Pp
CVS commit: src/share/man/man9
Module Name:src Committed By: thorpej Date: Fri Feb 7 13:02:35 UTC 2020 Modified Files: src/share/man/man9: Makefile percpu.9 Log Message: Document percpu_foreach_xcall(). To generate a diff of this commit: cvs rdiff -u -r1.446 -r1.447 src/share/man/man9/Makefile cvs rdiff -u -r1.13 -r1.14 src/share/man/man9/percpu.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.446 src/share/man/man9/Makefile:1.447 --- src/share/man/man9/Makefile:1.446 Sat Feb 1 12:49:02 2020 +++ src/share/man/man9/Makefile Fri Feb 7 13:02:35 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.446 2020/02/01 12:49:02 riastradh Exp $ +# $NetBSD: Makefile,v 1.447 2020/02/07 13:02:35 thorpej Exp $ # Makefile for section 9 (kernel function and variable) manual pages. @@ -667,7 +667,8 @@ MLINKS+=percpu.9 percpu_alloc.9 \ percpu.9 percpu_free.9 \ percpu.9 percpu_getref.9 \ percpu.9 percpu_putref.9 \ - percpu.9 percpu_foreach.9 + percpu.9 percpu_foreach.9 \ + percpu.9 percpu_foreach_xcall.9 MLINKS+=pfil.9 pfil_hook_get.9 \ pfil.9 pfil_add_hook.9 \ pfil.9 pfil_remove_hook.9 \ Index: src/share/man/man9/percpu.9 diff -u src/share/man/man9/percpu.9:1.13 src/share/man/man9/percpu.9:1.14 --- src/share/man/man9/percpu.9:1.13 Sat Feb 1 12:49:02 2020 +++ src/share/man/man9/percpu.9 Fri Feb 7 13:02:35 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: percpu.9,v 1.13 2020/02/01 12:49:02 riastradh Exp $ +.\" $NetBSD: percpu.9,v 1.14 2020/02/07 13:02:35 thorpej 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 January 29, 2020 +.Dd February 7, 2020 .Dt PERCPU 9 .Os .Sh NAME @@ -37,7 +37,8 @@ .Nm percpu_free , .Nm percpu_getref , .Nm percpu_putref , -.Nm percpu_foreach +.Nm percpu_foreach , +.Nm percpu_foreach_xcall .Nd per-CPU storage allocator .Sh SYNOPSIS .In sys/percpu.h @@ -54,6 +55,8 @@ .Fn percpu_putref "percpu_t *pc" .Ft void .Fn percpu_foreach "percpu_t *pc" "percpu_callback_t cb" "void *arg" +.Ft void +.Fn percpu_foreach_xcall "percpu_t *pc" "u_int xcflags" "percpu_callback_t cb" "void *arg" .Sh DESCRIPTION The machine-independent .Nm @@ -171,14 +174,30 @@ run The call to .Fa cb runs in the current thread; use -.Xr xcall 9 -for cross-calls to run logic on other CPUs. +.Fn percpu_foreach_xcall +to to execute the call to +.Fa cb +on the remote CPUs. .Pp Must be used in thread context. .Fa cb .Em MUST NOT sleep except on adaptive locks, and should be fast. Do not rely on any particular order of iteration over the CPUs. +.It Fn percpu_foreach_xcall "pc" "xcflags" "cb" "arg" +Like +.Fn percpu_foreach , +except the call to +.Fa cb +executes on the remote CPUs. +The +.Fa xcflags +argument specifies how the cross calls are invoked; see +.Xr xc_broadcast 9 . +The same caveats and restrictions that apply to +.Fn percpu_foreach +also apply to +.Fn percpu_foreach_xcall . .El .Sh CODE REFERENCES The
CVS commit: src/share/man/man9
Module Name:src Committed By: riastradh Date: Sat Feb 1 13:35:12 UTC 2020 Modified Files: src/share/man/man9: xcall.9 Log Message: Redocument xc_barrier. Be more clearer, and more correcter, about what it does. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/share/man/man9/xcall.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/xcall.9 diff -u src/share/man/man9/xcall.9:1.16 src/share/man/man9/xcall.9:1.17 --- src/share/man/man9/xcall.9:1.16 Sat Nov 30 02:22:23 2019 +++ src/share/man/man9/xcall.9 Sat Feb 1 13:35:11 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: xcall.9,v 1.16 2019/11/30 02:22:23 riastradh Exp $ +.\" $NetBSD: xcall.9,v 1.17 2020/02/01 13:35:11 riastradh 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 November 29, 2019 +.Dd February 1, 2020 .Dt XCALL 9 .Os .Sh NAME @@ -97,7 +97,7 @@ Functions being called should be relativ They may block on locks, but carefully and minimally, to not interfere with other cross calls in the system. .Sh FUNCTIONS -.Bl -tag -width Fn +.Bl -tag -width abcd .It Fn xc_broadcast "flags" "func" "arg1" "arg2" Call .Pf (* Fa func\| ) Ns Fo "" @@ -147,19 +147,33 @@ for the corresponding cross-call to comp .Fn xc_wait should be called from a thread context. .It Fn xc_barrier "flags" -Issue a broadcast cross-call that does nothing, using -.Fa flags , +Issue a broadcast cross-call that does nothing, and wait for it to complete. -This has two effects: +.Pp +This functions like a memory barrier that forces all prior operations +in program order to globally happen before all subsequent operations in +program order, as witnessed by every CPU. +.Pp +This additionally waits for all higher-priority activity on the CPU to +complete, according to +.Fa flags : .Bl -dash -compact .It -This waits for the interrupt priority level to transition to +.Fo xc_barrier +.Li 0 +.Fc +waits for any pending +.Xr kpreempt_disable 9 +sections or activity at interrupt priority level above .Dv IPL_NONE -at least once on all CPUs. +to finish on all CPUs. .It -This functions like a memory barrier that forces all prior operations -in program order to globally happen before all subsequent operations in -program order, as witnessed by every CPU. +.Fo xc_barrier +.Dv XC_HIGHPRI_IPL\| Ns Fn "" ipl +.Fc +waits for any pending activity at the software interrupt priority level +.Fa ipl +or higher to finish on all CPUs. .El .Pp .Fn xc_barrier
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Tue Jan 21 07:53:51 UTC 2020 Modified Files: src/share/man/man9: in_getifa.9 Log Message: Remove superfluous Pp. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/share/man/man9/in_getifa.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/in_getifa.9 diff -u src/share/man/man9/in_getifa.9:1.10 src/share/man/man9/in_getifa.9:1.11 --- src/share/man/man9/in_getifa.9:1.10 Mon Jan 20 13:08:40 2020 +++ src/share/man/man9/in_getifa.9 Tue Jan 21 07:53:51 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: in_getifa.9,v 1.10 2020/01/20 13:08:40 nia Exp $ +.\" $NetBSD: in_getifa.9,v 1.11 2020/01/21 07:53:51 wiz Exp $ .\" .\" Copyright (c) 2006 David Young. All rights reserved. .\" @@ -160,7 +160,6 @@ The operator may also set a global polic interfaces whose policy they do not set individually. .Pp Here is the sysctl tree for the policy at system startup: -.Pp .Bd -literal -offset indent net.inet.ip.selectsrc.default = index net.inet.ip.interfaces.ath0.selectsrc =
CVS commit: src/share/man/man9
Module Name:src Committed By: skrll Date: Fri Jan 17 12:34:55 UTC 2020 Modified Files: src/share/man/man9: uvm_hotplug.9 Log Message: Add '_p' to uvm_physseg_valid to match the function. Bump date. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/share/man/man9/uvm_hotplug.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/uvm_hotplug.9 diff -u src/share/man/man9/uvm_hotplug.9:1.5 src/share/man/man9/uvm_hotplug.9:1.6 --- src/share/man/man9/uvm_hotplug.9:1.5 Sat Nov 30 02:47:14 2019 +++ src/share/man/man9/uvm_hotplug.9 Fri Jan 17 12:34:55 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: uvm_hotplug.9,v 1.5 2019/11/30 02:47:14 riastradh Exp $ +.\" $NetBSD: uvm_hotplug.9,v 1.6 2020/01/17 12:34:55 skrll Exp $ .\" .\" Copyright (c) 2016 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,12 +27,12 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd November 20, 2016 +.Dd January 17, 2020 .Dt UVM_HOTPLUG 9 .Os .Sh NAME .Nm uvm_physseg_init , -.Nm uvm_physseg_valid , +.Nm uvm_physseg_valid_p , .Nm uvm_physseg_get_start , .Nm uvm_physseg_get_end , .Nm uvm_physseg_get_avail_start , @@ -280,7 +280,7 @@ depending on success or failure respecti .Sh UTILITY FUNCTIONS .Bl -ohang .It Ft bool -.Fn uvm_physseg_valid "uvm_physseg_t upm" +.Fn uvm_physseg_valid_p "uvm_physseg_t upm" .It Ft paddr_t .Fn uvm_physseg_get_start "uvm_physseg_t upm" .It Ft paddr_t @@ -317,7 +317,7 @@ depending on success or failure respecti .Fn uvm_physseg_set_avail_end "uvm_physseg_t upm" "paddr_t avail_end" .El .Pp -.Fn uvm_physseg_valid +.Fn uvm_physseg_valid_p validates a handle that is passed in, returns .Fa true if the given handle is valid,
CVS commit: src/share/man/man9
Module Name:src Committed By: sevan Date: Sun Jan 12 20:49:21 UTC 2020 Modified Files: src/share/man/man9: callout.9 Log Message: Update callout_halt() to match src/sys/sys/callout.h To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/share/man/man9/callout.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/callout.9 diff -u src/share/man/man9/callout.9:1.28 src/share/man/man9/callout.9:1.29 --- src/share/man/man9/callout.9:1.28 Thu Nov 20 15:43:52 2014 +++ src/share/man/man9/callout.9 Sun Jan 12 20:49:21 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: callout.9,v 1.28 2014/11/20 15:43:52 ozaki-r Exp $ +.\" $NetBSD: callout.9,v 1.29 2020/01/12 20:49:21 sevan Exp $ .\" .\" Copyright (c) 2000, 2003, 2009 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 November 21, 2014 +.Dd January 12, 2020 .Dt CALLOUT 9 .Os .Sh NAME @@ -59,7 +59,7 @@ .Ft bool .Fn "callout_stop" "callout_t *c" .Ft bool -.Fn "callout_halt" "callout_t *c" "kmutex_t *interlock" +.Fn "callout_halt" "callout_t *c" "void *interlock" .Ft bool .Fn "callout_pending" "callout_t *c" .Ft bool
CVS commit: src/share/man/man9
Module Name:src Committed By: pgoyette Date: Thu Dec 12 02:34:55 UTC 2019 Modified Files: src/share/man/man9: condvar.9 Log Message: Point out that spurious wake-ups are possible, and that an LWP should check for resource availability after being awoken. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/share/man/man9/condvar.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/condvar.9 diff -u src/share/man/man9/condvar.9:1.20 src/share/man/man9/condvar.9:1.21 --- src/share/man/man9/condvar.9:1.20 Fri Apr 12 11:02:22 2019 +++ src/share/man/man9/condvar.9 Thu Dec 12 02:34:55 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: condvar.9,v 1.20 2019/04/12 11:02:22 abhinav Exp $ +.\" $NetBSD: condvar.9,v 1.21 2019/12/12 02:34:55 pgoyette Exp $ .\" .\" Copyright (c) 2006, 2007, 2008 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 November 12, 2017 +.Dd December 12, 2019 .Dt CONDVAR 9 .Os .Sh NAME @@ -144,6 +144,13 @@ as available until the calling LWP has b .Pp Non-interruptable waits have the potential to deadlock the system, and so must be kept short (typically, under one second). +.Pp +Upon being awakened, the calling LWP should verify the availability +of the resource (or other condition). +It should not blindly assume that the resource is now available. +If the resource is still not available, the calling LWP may call +.Fn cv_wait +again to continue waiting. .It Fn cv_wait_sig "cv" "mtx" .Pp As per
CVS commit: src/share/man/man9
Module Name:src Committed By: mlelstv Date: Sun Dec 8 12:23:00 UTC 2019 Modified Files: src/share/man/man9: dksubr.9 Log Message: Drop comment about dk_lookup being in the wrong place. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/share/man/man9/dksubr.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/dksubr.9 diff -u src/share/man/man9/dksubr.9:1.6 src/share/man/man9/dksubr.9:1.7 --- src/share/man/man9/dksubr.9:1.6 Sat Oct 21 21:18:33 2017 +++ src/share/man/man9/dksubr.9 Sun Dec 8 12:23:00 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: dksubr.9,v 1.6 2017/10/21 21:18:33 wiz Exp $ +.\" $NetBSD: dksubr.9,v 1.7 2019/12/08 12:23:00 mlelstv Exp $ .\" .\" Copyright (c) 2016 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -307,11 +307,3 @@ to support other disk drivers. The callback interface used by the .Xr disk 9 framework has been merged as well. -.Sh BUGS -The framework includes a -.Nm dk_lookup -helper function, that is used by the -.Xr cgd 4 -driver to open a vnode for a block device. -This looks too generic -and should be put somewhere better (and be renamed).
CVS commit: src/share/man/man9
Module Name:src Committed By: uwe Date: Sun Dec 8 00:00:59 UTC 2019 Modified Files: src/share/man/man9: atomic_loadstore.9 Log Message: Simplify markup for inline code to plain .Li in most places. Use backslashes to protetect embedded spaces in inline code to prevent filling from stretching them. Use .Fn and .Fa to refer only to things this manual page documents, they are not to be used for "a function" or "a function argument" in general. In code examples drop the empty line at the beginning of a function (mandated by the KNF when there are no variables) - it doesn't help readability here. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/share/man/man9/atomic_loadstore.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/atomic_loadstore.9 diff -u src/share/man/man9/atomic_loadstore.9:1.4 src/share/man/man9/atomic_loadstore.9:1.5 --- src/share/man/man9/atomic_loadstore.9:1.4 Sat Dec 7 12:22:19 2019 +++ src/share/man/man9/atomic_loadstore.9 Sun Dec 8 00:00:59 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: atomic_loadstore.9,v 1.4 2019/12/07 12:22:19 wiz Exp $ +.\" $NetBSD: atomic_loadstore.9,v 1.5 2019/12/08 00:00:59 uwe Exp $ .\" .\" Copyright (c) 2019 The NetBSD Foundation .\" All rights reserved. @@ -77,7 +77,7 @@ or is combining multiple memory operations on a single object into one memory operation, such as replacing .Bd -literal -compact -*p = v; + *p = v; x = *p; .Ed by @@ -86,11 +86,11 @@ by x = v; .Ed since the compiler can prove that -.Li * Ns Fa p +.Li \&*p will yield -.Fa v +.Li v after -.Li * Ns Fa p Li = Fa v . +.Li \&*p\ =\ v . For .Em atomic memory operations, the implementation @@ -142,13 +142,17 @@ Thus, as far as any interrupt, other thr atomic memory operation is issued either all at once or not at all. .Pp For example, if a 32-bit word -.Fa w +.Va w is written with -.Li atomic_store_relaxed ( & Ns Fa w , 0x00010002 ) , +.Pp +.Dl atomic_store_relaxed(,\ 0x00010002); +.Pp then an interrupt, other thread, or other CPU reading it with -.Li atomic_load_relaxed ( & Ns Fa w ) +.Li atomic_load_relaxed() will never witness it partially written, whereas -.Fa w Li = 0x00010002 +.Pp +.Dl w\ =\ 0x00010002; +.Pp might be compiled into a pair of separate 16-bit store instructions instead of one single word-sized store instruction, in which case other threads may see the intermediate state with only one of the halves @@ -178,9 +182,9 @@ No ordering relative to memory operation guaranteed. Relaxed ordering is the default for ordinary non-atomic memory operations like -.Li * Ns Fa p +.Li "*p" and -.Li * Ns Fa p Li = Fa v . +.Li "*p = v" . .Pp Atomic operations with relaxed ordering are cheap: they are not read/modify/write atomic operations, and they do not involve any kind @@ -403,7 +407,7 @@ between the memory operations in steps\~ In fact, without .Em both release and acquire/consume, even the assignment -.Li m->z = m->x + m->y +.Li m->z\ =\ m->x\ +\ m->y in step\~1 might read values of .Li m->x and @@ -527,9 +531,13 @@ usually implies an expensive memory barr The pointer .Fa p must be aligned \(em that is, if the object it points to is -.No 2^ Ns Fa n +.\" +2\c +.ie t \s-2\v'-0.4m'n\v'+0.4m'\s+2 +.el ^n +.\" bytes long, then the low-order -.Fa n +.Ar n bits of .Fa p must be zero. @@ -583,9 +591,9 @@ must be conditional on These macros are meant to follow .Tn C11 semantics, in terms of -.Fn atomic_load_explicit +.Li atomic_load_explicit() and -.Fn atomic_store_explicit +.Li atomic_store_explicit() with the appropriate memory order specifiers, and are meant to make future adoption of the .Tn C11 @@ -596,28 +604,28 @@ Eventually it may be mandatory to use th type qualifier or equivalent for the operands. .Sh LINUX ANALOGUES The Linux kernel provides two macros -.Fn READ_ONCE x +.Li READ_ONCE(x) and -.Fn WRITE_ONCE x v +.Li WRITE_ONCE(x,\ v) which are similar to -.Li atomic_load_consume ( & Ns Fa x ) +.Li atomic_load_consume() and -.Li atomic_store_relaxed ( & Ns Fa x , Fa v ) , +.Li atomic_store_relaxed(,\ v) , respectively. However, while Linux's -.Fn READ_ONCE +.Li READ_ONCE and -.Fn WRITE_ONCE +.Li WRITE_ONCE prevent fusing, they may in some cases be torn \(em and therefore fail to guarantee atomicity \(em because: .Bl -bullet .It They do not require the address -.Li & Ns Fa x +.Li "" to be aligned. .It They do not require -.Li sizeof ( Fa x ) +.Li sizeof(x) to be at most the largest size of available atomic loads and stores on the host architecture. .El @@ -633,9 +641,9 @@ the purposes of pairing with and .Fn atomic_load_acquire or -.Fn atomic_load_consume : +.Fn atomic_load_consume . If -.Fn atomic_r/m/w +.Li atomic_r/m/w() is an atomic read/modify/write operation in .Xr atomic_ops 3 , then @@ -645,7 +653,7 @@ then .Ed .Pp functions like a release operation on -.Fa
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Sat Dec 7 12:26:05 UTC 2019 Modified Files: src/share/man/man9: rnd.9 Log Message: Simplify macro usage. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/share/man/man9/rnd.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/rnd.9 diff -u src/share/man/man9/rnd.9:1.26 src/share/man/man9/rnd.9:1.27 --- src/share/man/man9/rnd.9:1.26 Wed Dec 4 03:04:43 2019 +++ src/share/man/man9/rnd.9 Sat Dec 7 12:26:05 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: rnd.9,v 1.26 2019/12/04 03:04:43 riastradh Exp $ +.\" $NetBSD: rnd.9,v 1.27 2019/12/07 12:26:05 wiz Exp $ .\" .\" Copyright (c) 1997 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -78,7 +78,6 @@ to each .Fa rnd_source , for example with .Xr mutex 9 . -.Pp .Bl -tag -width 8n .It Fn rndsource_setcb "krndsource_t *rnd_source" "void (*callback)(size_t, void *)" "void *cookie" This function sets a callback to be invoked when the kernel entropy @@ -92,7 +91,7 @@ to .Fn rnd_attach_source in order for the callback to be used. The callback is invoked as -.Fa callback Ns Li "(" Ns Fa nbytes Ns Li "," Fa cookie Ns Li ")" , +.Fa callback ( Fa nbytes , Fa cookie ) , where .Fa nbytes is the number of bytes requested for the entropy pool, and @@ -167,7 +166,7 @@ the pool estimate) towards the pool estimate) .Dv RND_FLAG_HASCB (caller specified a callback with -.Fn rndsource_setcb Ns ). +.Fn rndsource_setcb ) . For many devices, .Dv RND_FLAG_DEFAULT .Dv ( RND_FLAG_COLLECT_VALUE | RND_FLAG_COLLECT_TIME | RND_FLAG_ESTIMATE_TIME )
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Sat Dec 7 12:22:19 UTC 2019 Modified Files: src/share/man/man9: atomic_loadstore.9 Log Message: Simplify macro usage. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/share/man/man9/atomic_loadstore.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/atomic_loadstore.9 diff -u src/share/man/man9/atomic_loadstore.9:1.3 src/share/man/man9/atomic_loadstore.9:1.4 --- src/share/man/man9/atomic_loadstore.9:1.3 Sat Nov 30 02:47:14 2019 +++ src/share/man/man9/atomic_loadstore.9 Sat Dec 7 12:22:19 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: atomic_loadstore.9,v 1.3 2019/11/30 02:47:14 riastradh Exp $ +.\" $NetBSD: atomic_loadstore.9,v 1.4 2019/12/07 12:22:19 wiz Exp $ .\" .\" Copyright (c) 2019 The NetBSD Foundation .\" All rights reserved. @@ -144,9 +144,9 @@ atomic memory operation is issued either For example, if a 32-bit word .Fa w is written with -.Li atomic_store_relaxed(& Ns Fa w Ns Li "," 0x00010002) , +.Li atomic_store_relaxed ( & Ns Fa w , 0x00010002 ) , then an interrupt, other thread, or other CPU reading it with -.Li atomic_load_relaxed(& Ns Fa w Ns Li ")" +.Li atomic_load_relaxed ( & Ns Fa w ) will never witness it partially written, whereas .Fa w Li = 0x00010002 might be compiled into a pair of separate 16-bit store instructions @@ -600,9 +600,9 @@ The Linux kernel provides two macros and .Fn WRITE_ONCE x v which are similar to -.Li atomic_load_consume(& Ns Fa x Ns Li ")" +.Li atomic_load_consume ( & Ns Fa x ) and -.Li atomic_store_relaxed(& Ns Fa x Ns Li "," Fa v Ns Li ")" , +.Li atomic_store_relaxed ( & Ns Fa x , Fa v ) , respectively. However, while Linux's .Fn READ_ONCE @@ -617,7 +617,7 @@ They do not require the address to be aligned. .It They do not require -.Li sizeof( Ns Fa x Ns Li ")" +.Li sizeof ( Fa x ) to be at most the largest size of available atomic loads and stores on the host architecture. .El @@ -766,7 +766,7 @@ C11 formally specifies that all subexpre operands of the .Li "&&" , "||" , "?:" , and -.Li "," +.Li \&, operators and the .Fn kill_dependency macro, carry dependencies for which
CVS commit: src/share/man/man9
Module Name:src Committed By: riastradh Date: Wed Dec 4 03:04:43 UTC 2019 Modified Files: src/share/man/man9: rnd.9 Log Message: Update rnd(9) man page to reflect reality since netbsd-7. - Note rndsource_setcb, RND_FLAG_HASCB, and rnd_add_data_sync. - Note user's obligation to serialize access to each rndsource. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/share/man/man9/rnd.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/rnd.9 diff -u src/share/man/man9/rnd.9:1.25 src/share/man/man9/rnd.9:1.26 --- src/share/man/man9/rnd.9:1.25 Mon Apr 13 22:23:54 2015 +++ src/share/man/man9/rnd.9 Wed Dec 4 03:04:43 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: rnd.9,v 1.25 2015/04/13 22:23:54 riastradh Exp $ +.\" $NetBSD: rnd.9,v 1.26 2019/12/04 03:04:43 riastradh Exp $ .\" .\" Copyright (c) 1997 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -35,17 +35,22 @@ .Nm rnd_attach_source , .Nm rnd_detach_source , .Nm rnd_add_data , +.Nm rnd_add_data_sync , .Nm rnd_add_uint32 .Nd functions to make a device available for entropy collection .Sh SYNOPSIS .In sys/rndsource.h .Ft void +.Fn rndsource_setcb "krndsource_t *rnd_source" "void (*callback)(size_t, void *)" "void *cookie" +.Ft void .Fn rnd_attach_source "krndsource_t *rnd_source" "char *devname" "uint32_t source_type" "uint32_t flags" .Ft void .Fn rnd_detach_source "krndsource_t *rnd_source" .Ft void .Fn rnd_add_data "krndsource_t *rnd_source" "void *data" "uint32_t len" "uint32_t entropy" .Ft void +.Fn rnd_add_data_sync "krndsource_t *rnd_source" "void *data" "uint32_t len" "uint32_t entropy" +.Ft void .Fn rnd_add_uint32 "krndsource_t *rnd_source" "uint32_t datum" .Sh DESCRIPTION These @@ -58,6 +63,9 @@ and .Pa ( /dev/random ) interfaces. .Pp +The caller must zero an +.Fa rnd_source +object before using it. Ideally the first argument .Fa rnd_source of these functions gets included in the devices' entity struct, @@ -65,9 +73,56 @@ but any means to permanently (statically to one incarnation of the device is ok. Do not share .Fa rnd_source -structures between two devices. +structures between two devices, and make sure to serialize all access +to each +.Fa rnd_source , +for example with +.Xr mutex 9 . .Pp .Bl -tag -width 8n +.It Fn rndsource_setcb "krndsource_t *rnd_source" "void (*callback)(size_t, void *)" "void *cookie" +This function sets a callback to be invoked when the kernel entropy +pool is hungry. +It is optional; if used, it must be used +.Em before +.Fn rnd_attach_source , +and the caller must pass +.Dv RND_FLAG_HASCB +to +.Fn rnd_attach_source +in order for the callback to be used. +The callback is invoked as +.Fa callback Ns Li "(" Ns Fa nbytes Ns Li "," Fa cookie Ns Li ")" , +where +.Fa nbytes +is the number of bytes requested for the entropy pool, and +.Fa cookie +is the cookie that was passed to +.Fn rndsource_setcb . +The callback normally does one of two things: +.Bl -dash +.It +Sends a request to a hardware device for entropy and returns. +The hardware will later return data asynchronously by an interrupt, and +the callback will use +.Fn rnd_add_data +or +.Fn rnd_add_uint32 +to add the data to the pool. +.It +Synchronously gathers entropy from hardware \(em for example, by a CPU +instruction like Intel RDSEED. +In this case, in order to add data to the pool +.Em before +returning, the callback +.Em must +use +.Fn rnd_add_data_sync , +not +.Fn rnd_add_data +or +.Fn rnd_add_uint32 . +.El .It Fn rnd_attach_source "krndsource_t *rnd_source" "char *devname" "uint32_t source_type" "uint32_t flags" This function announces the availability of a device for entropy collection. It must be called before the source struct pointed to by @@ -109,7 +164,10 @@ are the logical OR of the pool estimate) .Dv RND_FLAG_ESTIMATE_TIME (use a delta estimator to count bits of entropy from this source's timestamps -towards the pool estimate). +towards the pool estimate) +.Dv RND_FLAG_HASCB +(caller specified a callback with +.Fn rndsource_setcb Ns ). For many devices, .Dv RND_FLAG_DEFAULT .Dv ( RND_FLAG_COLLECT_VALUE | RND_FLAG_COLLECT_TIME | RND_FLAG_ESTIMATE_TIME ) @@ -119,7 +177,6 @@ Note that devices of type default to .Dv RND_FLAG_COLLECT_VALUE | RND_FLAG_COLLECT_TIME (no entropy counted). -.Pp .It Fn rnd_detach_source "krndsource_t *rnd_source" This function disconnects the device from entropy collection. .It Fn rnd_add_uint32 "krndsource_t *rnd_source" "uint32_t datum" @@ -155,6 +212,14 @@ of randomness, passing for .Va rnd_source is permitted, and the device does not need to be attached. +.Pp +.Fn rnd_add_uint32 +.Em must not +be used during a callback as set with +.Fn rndsource_setcb ; +use +.Fn rnd_add_data_sync +instead. .It Fn rnd_add_data "krndsource_t *rnd_source" "void *data" "uint32_t len" "uint32_t entropy" adds (hopefully) random .Fa data @@ -183,6 +248,14 @@
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Thu May 9 09:35:18 UTC 2019 Modified Files: src/share/man/man9: audio.9 Log Message: Bump date. To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/share/man/man9/audio.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/audio.9 diff -u src/share/man/man9/audio.9:1.53 src/share/man/man9/audio.9:1.54 --- src/share/man/man9/audio.9:1.53 Thu May 9 09:32:26 2019 +++ src/share/man/man9/audio.9 Thu May 9 09:35:18 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: audio.9,v 1.53 2019/05/09 09:32:26 wiz Exp $ +.\" $NetBSD: audio.9,v 1.54 2019/05/09 09:35:18 wiz Exp $ .\" .\" Copyright (c) 1999, 2000 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 15, 2018 +.Dd May 9, 2019 .Dt AUDIO 9 .Os .Sh NAME
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Thu May 9 09:32:26 UTC 2019 Modified Files: src/share/man/man9: audio.9 Log Message: Improve wording, add more formatting. To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/share/man/man9/audio.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/audio.9 diff -u src/share/man/man9/audio.9:1.52 src/share/man/man9/audio.9:1.53 --- src/share/man/man9/audio.9:1.52 Wed May 8 14:25:39 2019 +++ src/share/man/man9/audio.9 Thu May 9 09:32:26 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: audio.9,v 1.52 2019/05/08 14:25:39 isaki Exp $ +.\" $NetBSD: audio.9,v 1.53 2019/05/09 09:32:26 wiz Exp $ .\" .\" Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -147,7 +147,7 @@ if not needed. optional, is called when the first device combining playback and recording is opened. On a full duplex hardware, -.Dv (FREAD | FWRITE) +.Dv ( FREAD | FWRITE ) is passed to flags. On a half duplex hardware, .Dv FWRITE @@ -159,16 +159,19 @@ Every successful call to is matched by a call to .Va close . Return 0 on success, otherwise an error code. -It is called at Closed phase. +It is called in the Closed phase. .It Dv void close(void *hdl) optional, is called when the last audio device combining playback and recording is closed. -It is called at Opened phase. +It is called in the Opened phase. .It Dv int query_format(void *hdl, audio_format_query_t *afp) is called to enumerate formats supported by the hardware. -It should fill the audio_format_t structure according to given number -afp->index. -If there is no format with given number, return EINVAL. +It should fill the +.Vt audio_format_t +structure according to given number +.Va afp->index . +If there is no format with given number, return +.Er EINVAL . It is called at any time. .Bd -literal typedef struct audio_format_query { @@ -179,26 +182,41 @@ typedef struct audio_format_query { .Pp It is also used to determine the default format. The upper layer chooses the most preferred one as default format by following: -.\" XXX I don't know syntax to represent in html -1. Higher priority is preferred (normally 0, the highest is 3, the lowest is 0). -2. AUDIO_ENCODING_SLINEAR_NE:16 is preferred if exists. -3. AUDIO_ENCODING_SLINEAR_OE:16 is preferred if exists. -4. More channels is preferred. +.Bl -enum +.It +Higher priority is preferred (normally 0, the highest is 3, the lowest is 0). +.It +.Dv AUDIO_ENCODING_SLINEAR_NE:16 +is preferred if exists. +.It +.Dv AUDIO_ENCODING_SLINEAR_OE:16 +is preferred if exists. +.It +More channels is preferred. +.El .Pp -If the driver supports SLINEAR_NE:16 and the upper layer chooses it, +If the driver supports +.Dv SLINEAR_NE:16 +and the upper layer chooses it, the driver does not need to provide conversion function in .Va set_format . -Similarly, if the driver supports SLINEAR_OE:16 and the upper layer chooses it, -the driver does not need to provide conversion function. +Similarly, if the driver supports +.Dv SLINEAR_OE:16 +and the upper layer chooses it, +the driver does not need to provide a conversion function. Because the upper layer only supports conversion between -SLINEAR_NE:16 and SLINEAR_OE:16 for convenience. -If the upper layer chooses other format, -the driver needs to provide conversion function in +.Dv SLINEAR_NE:16 +and +.Dv SLINEAR_OE:16 +for convenience. +If the upper layer chooses another format, +the driver needs to provide a conversion function in .Va set_format . See also .Va set_format . -If the driver can not provide the conversion from/to SLINEAR_NE:16, -set priority to -1. +If the driver can not provide the conversion from/to +.Dv SLINEAR_NE:16 , +set priority to \-1. It means that the hardware supports this format but the driver does not (e.g. AC3), and it will never be chosen. .It Dv int set_foramt(void *hdl, int setmode, @@ -239,7 +257,9 @@ conversion information should be filled for playing or .Va rfil for recording. -The definition of audio_filter_reg_t and related structure follow: +The definition of +.Vt audio_filter_reg_t +and a related structure follow: .Bd -literal typedef struct { const void *src; @@ -259,9 +279,9 @@ typedef struct { .Ed .Pp .Va codec -is conversion function and +is a conversion function and .Va context -is optional opaque pointer passed to +is an optional opaque pointer passed to .Va codec . .Pp When @@ -271,13 +291,13 @@ is called, all parameters required by are contained in .Va arg . .Va src -points input buffer block, +points to the input buffer block, .Va srcfmt -contains input encoding parameter, +contains the input encoding parameters, .Va dst -points output buffer block and +points to the output buffer block and .Va dstfmt -contains output encoding parameter. +contains the output encoding parameters. .Va count represents the number of
CVS commit: src/share/man/man9
Module Name:src Committed By: christos Date: Sun May 5 20:10:57 UTC 2019 Modified Files: src/share/man/man9: namei.9 Log Message: sync with reality To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/share/man/man9/namei.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/namei.9 diff -u src/share/man/man9/namei.9:1.50 src/share/man/man9/namei.9:1.51 --- src/share/man/man9/namei.9:1.50 Mon Jul 3 17:28:48 2017 +++ src/share/man/man9/namei.9 Sun May 5 16:10:57 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: namei.9,v 1.50 2017/07/03 21:28:48 wiz Exp $ +.\" $NetBSD: namei.9,v 1.51 2019/05/05 20:10:57 christos Exp $ .\" .\" Copyright (c) 2001, 2005, 2006, 2017 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 March 18, 2017 +.Dd May 5, 2019 .Dt NAMEI 9 .Os .Sh NAME @@ -57,12 +57,12 @@ "struct vnode **ret" .Ft int .Fn relookup "struct vnode *dvp" "struct vnode **vpp" \ -"struct componentname *cnp" +"struct componentname *cnp" "int dummy" .Ft int .Fn lookup_for_nfsd "struct nameidata *ndp" "struct vnode *startdir" \ "int neverfollow" .Ft int -.Fn lookup_for_nfsd_index "struct nameidata *ndp" +.Fn lookup_for_nfsd_index "struct nameidata *ndp" "struct vnode *startdir" .Sh DESCRIPTION The .Nm @@ -647,7 +647,7 @@ except that the argument shall be a user pointer .Pq Dv UIO_USERSPACE rather than a kernel pointer. -.It Fn relookup "dvp" "vpp" "cnp" +.It Fn relookup "dvp" "vpp" "cnp" "dummy" Reacquire a path name component is a directory. This is a quicker way to lookup a pathname component when the parent directory is known. @@ -657,6 +657,9 @@ and the pathname component by .Fa cnp . The vnode of the pathname is returned in the address specified by .Fa vpp . +The +.Fa dummy +argument is unused. Note that one may only use .Fn relookup to repeat a lookup of a final path component previously done by @@ -678,11 +681,12 @@ is set, symbolic link (not just at the end of the path) will cause an error. Otherwise, it follows symlinks normally. It should not be used by new code. -.It Fn lookup_for_nfsd_index "ndp" +.It Fn lookup_for_nfsd_index "ndp" "startdir" This is a (second) private entry point into .Nm used by the NFS server code. -It looks up a single path component. +It looks up a single path component starting from +.Fa startdir . It should not be used by new code. .El .Sh INTERNALS
CVS commit: src/share/man/man9
Module Name:src Committed By: abhinav Date: Fri Apr 12 11:02:22 UTC 2019 Modified Files: src/share/man/man9: condvar.9 Log Message: Split the examples into two separate literal sections ok wiz@ To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/share/man/man9/condvar.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/condvar.9 diff -u src/share/man/man9/condvar.9:1.19 src/share/man/man9/condvar.9:1.20 --- src/share/man/man9/condvar.9:1.19 Mon Nov 13 09:09:28 2017 +++ src/share/man/man9/condvar.9 Fri Apr 12 11:02:22 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: condvar.9,v 1.19 2017/11/13 09:09:28 wiz Exp $ +.\" $NetBSD: condvar.9,v 1.20 2019/04/12 11:02:22 abhinav Exp $ .\" .\" Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -263,9 +263,8 @@ be called while holding the interlocking .Fn cv_wait . .El .Sh EXAMPLES -.Bd -literal Consuming a resource: - +.Bd -literal /* * Lock the resource. Its mutex will also serve as the * interlock. @@ -298,9 +297,10 @@ Consuming a resource: res->state = BUSY; mutex_exit(>mutex); consume(res); - +.Ed +.Pp Releasing a resource for the next consumer to use: - +.Bd -literal mutex_enter(>mutex); res->state = IDLE; cv_signal(>condvar);
CVS commit: src/share/man/man9
Module Name:src Committed By: sevan Date: Tue Apr 9 13:53:52 UTC 2019 Modified Files: src/share/man/man9: sched_4bsd.9 sched_m2.9 Log Message: Add instructions on how to determine the scheduler in use. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/share/man/man9/sched_4bsd.9 cvs rdiff -u -r1.3 -r1.4 src/share/man/man9/sched_m2.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/sched_4bsd.9 diff -u src/share/man/man9/sched_4bsd.9:1.8 src/share/man/man9/sched_4bsd.9:1.9 --- src/share/man/man9/sched_4bsd.9:1.8 Thu Dec 2 12:54:13 2010 +++ src/share/man/man9/sched_4bsd.9 Tue Apr 9 13:53:52 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: sched_4bsd.9,v 1.8 2010/12/02 12:54:13 wiz Exp $ +.\" $NetBSD: sched_4bsd.9,v 1.9 2019/04/09 13:53:52 sevan Exp $ .\" .\" Copyright (c) 2002 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 July 14, 2007 +.Dd April 9, 2019 .Dt SCHED_4BSD 9 .Os .Sh NAME @@ -78,6 +78,12 @@ every Hz ticks in order to recompute the checks if an LWP has slept for more than one second. If so, its priority is updated by .Fn updatepri . +.Sh EXAMPLES +To determine the scheduler currently in use +.Bd -literal -offset indent +$ sysctl kern.sched.name +kern.sched.name = 4.4BSD +.Ed .Sh CODE REFERENCES The .Bx 4.4 Index: src/share/man/man9/sched_m2.9 diff -u src/share/man/man9/sched_m2.9:1.3 src/share/man/man9/sched_m2.9:1.4 --- src/share/man/man9/sched_m2.9:1.3 Thu Dec 2 12:54:13 2010 +++ src/share/man/man9/sched_m2.9 Tue Apr 9 13:53:52 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: sched_m2.9,v 1.3 2010/12/02 12:54:13 wiz Exp $ +.\" $NetBSD: sched_m2.9,v 1.4 2019/04/09 13:53:52 sevan 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 March 5, 2010 +.Dd April 9, 2019 .Dt SCHED_M2 9 .Os .Sh NAME @@ -38,6 +38,12 @@ .Sh DESCRIPTION The M2 scheduler implements a scheduling algorithm similar to the scheduler implementations of UNIX System V Release 4 and Solaris. +.Sh EXAMPLES +To determine the scheduler currently in use +.Bd -literal -offset indent +$ sysctl kern.sched.name +kern.sched.name = M2 +.Ed .Sh CODE REFERENCES The M2 scheduler is implemented within the file .Pa sys/kern/sched_m2.c .
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Mon Apr 8 13:30:46 UTC 2019 Modified Files: src/share/man/man9: filedesc.9 Log Message: Remove superfluous comma. Try improving a sentence. Remove duplicate sentence. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/share/man/man9/filedesc.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/filedesc.9 diff -u src/share/man/man9/filedesc.9:1.17 src/share/man/man9/filedesc.9:1.18 --- src/share/man/man9/filedesc.9:1.17 Mon Apr 8 13:04:54 2019 +++ src/share/man/man9/filedesc.9 Mon Apr 8 13:30:46 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: filedesc.9,v 1.17 2019/04/08 13:04:54 maya Exp $ +.\" $NetBSD: filedesc.9,v 1.18 2019/04/08 13:30:46 wiz Exp $ .\" .\" Copyright (c) 2002, 2005, 2006 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -44,7 +44,7 @@ .Nm fd_init , .Nm fd_getfile , .Nm fd_share , -.Nm fd_tryexpand , +.Nm fd_tryexpand .Nd file descriptor tables and operations .Sh SYNOPSIS .In sys/file.h @@ -129,10 +129,9 @@ allocate a file descriptor for the proce .Fa p . The credential on the file entry are inherited from process .Fa p . -The caller to the +Calling the .Fn fd_alloc -function is responsible for expanding the file descriptor table when -necessary. +function expands the file descriptor table when necessary. .Pp The index of the file entry is returned in .Fa *result . @@ -190,7 +189,6 @@ fills with the given parameters. It always returns the in-kernel errno .Er EMOVEFD . -This special value is meant to be returned from the device open routine; This special return value is interpreted by the caller of the device open routine. .It Fn fd_closeexec "void"
CVS commit: src/share/man/man9
Module Name:src Committed By: maya Date: Mon Apr 8 13:04:54 UTC 2019 Modified Files: src/share/man/man9: filedesc.9 Log Message: Update to reference the newer (committed long ago) API. With comments from Rocky Hotas on netbsd-docs, thanks. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/share/man/man9/filedesc.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/filedesc.9 diff -u src/share/man/man9/filedesc.9:1.16 src/share/man/man9/filedesc.9:1.17 --- src/share/man/man9/filedesc.9:1.16 Thu Dec 2 12:54:13 2010 +++ src/share/man/man9/filedesc.9 Mon Apr 8 13:04:54 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: filedesc.9,v 1.16 2010/12/02 12:54:13 wiz Exp $ +.\" $NetBSD: filedesc.9,v 1.17 2019/04/08 13:04:54 maya Exp $ .\" .\" Copyright (c) 2002, 2005, 2006 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,63 +27,54 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd July 24, 2006 +.Dd April 8, 2019 .Dt FILEDESC 9 .Os .Sh NAME .Nm filedesc , -.Nm dupfdopen , -.Nm falloc , +.Nm fd_alloc , +.Nm fd_checkstd , +.Nm fd_clone , +.Nm fd_closeexec , +.Nm fd_copy , +.Nm fd_dup , +.Nm fd_dup2 , +.Nm fd_dupopen , +.Nm fd_free , +.Nm fd_init , .Nm fd_getfile , -.Nm fdalloc , -.Nm fdcheckstd , -.Nm fdclear , -.Nm fdclone , -.Nm fdcloseexec , -.Nm fdcopy , -.Nm fdexpand , -.Nm fdfree , -.Nm fdinit , -.Nm fdrelease , -.Nm fdremove , -.Nm fdshare , -.Nm fdunshare +.Nm fd_share , +.Nm fd_tryexpand , .Nd file descriptor tables and operations .Sh SYNOPSIS .In sys/file.h .In sys/filedesc.h .Ft int -.Fn falloc "struct lwp *l" "struct file **resultfp" "int *resultfd" -.Ft struct file * -.Fn fd_getfile "struct filedesc *fdp" "int fd" +.Fn fd_alloc "proc_t *p" "int want" "int *result" .Ft int -.Fn dupfdopen "struct lwp *l" "int indx" "int dfd" "int mode" "int error" +.Fn fd_checkstd "void" .Ft int -.Fn fdalloc "struct proc *p" "int want" "int *result" -.Ft int -.Fn fdcheckstd "struct lwp *l" +.Fn fd_clone "file_t *fp" "int fd" "int flag" "const struct fileops *fops" "void *data" +.Ft filedesc_t * +.Fn fd_copy "void" .Ft void -.Fn fdclear "struct lwp *l" +.Fn fd_closeexec "void" .Ft int -.Fn fdclone "struct lwp *l" "struct file *fp" "int fd" "int flag" "const struct fileops *fops" "void *data" -.Ft void -.Fn fdcloseexec "struct lwp *l" -.Ft struct filedesc * -.Fn fdcopy "struct proc *p" -.Ft void -.Fn fdexpand "struct proc *p" -.Ft void -.Fn fdfree "struct lwp *l" -.Ft struct filedesc * -.Fn fdinit "struct proc *p" +.Fn fd_dup "file_t *fp" "int minfd" "int *newp" "bool exclose" .Ft int -.Fn fdrelease "struct lwp *l" "int fd" +.Fn fd_dup2 "file_t *fp" "unsigned newfd" "int flags" +.Ft int +.Fn fd_dupopen "int old" "int *newp" "int error" .Ft void -.Fn fdremove "struct filedesc *fdp" "int fd" +.Fn fd_free "void" +.Ft filedesc_t * +.Fn fd_init "filedesc_t *fdp" +.Ft file_t * +.Fn fd_getfile "unsigned fd" .Ft void -.Fn fdshare "struct proc *p1" "struct proc *p2" +.Fn fd_share "proc_t *p" .Ft void -.Fn fdunshare "struct lwp *l" +.Fn fd_tryexpand "proc_t *p" .Sh DESCRIPTION For user processes, all I/O is done through file descriptors. These file descriptors represent underlying objects supported by the kernel @@ -97,7 +88,7 @@ The kernel maintains a descriptor table to translate the external representation of a file descriptor into an internal representation. The file descriptor is merely an index into this table. -The file descriptor table maintains the following information: +The table maintains the following information: .Pp .Bl -bullet -compact .It @@ -114,67 +105,72 @@ On creation of the file descriptor table entries are created. It is the responsibility of the file descriptor operations to expand the available number of entries if more are required. -Each file entry in the descriptor table contains the information necessary +Each file entry in the descriptor table contains the information needed to access the underlying object and to maintain common information. See .Xr file 9 for details of operations on the file entries. .Pp New file descriptors are generally allocated by -.Fn falloc +.Fn fd_alloc and freed by -.Fn fdrelease . +.Fn fd_free . File entries are extracted from the file descriptor table by .Fn fd_getfile . -Most of the remaining functions in the interface are purpose specific +Most of the remaining functions in the interface are purpose-specific and perform lower-level file descriptor operations. .Sh FUNCTIONS The following functions are high-level interface routines to access the file descriptor table for a process and its file entries. -.Pp .Bl -tag -width compact -.It Fn falloc "p" "*resultfp" "*resultfd" -Create a new open file entry and allocate a file descriptor for -process +.It Fn fd_alloc "p" "want" "*result" +Create a new open
CVS commit: src/share/man/man9
Module Name:src Committed By: pgoyette Date: Sun Apr 7 22:32:10 UTC 2019 Modified Files: src/share/man/man9: module.9 Log Message: Make explicit note that MODULE_CLASS_ANY should note be used as the class of a MODULE(). MODULE_CLASS_ANY is intended only to indicate a "wildcard" match when (auto)loading modules. To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 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/module.9 diff -u src/share/man/man9/module.9:1.51 src/share/man/man9/module.9:1.52 --- src/share/man/man9/module.9:1.51 Sun Jan 27 17:44:02 2019 +++ src/share/man/man9/module.9 Sun Apr 7 22:32:10 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: module.9,v 1.51 2019/01/27 17:44:02 wiz Exp $ +.\" $NetBSD: module.9,v 1.52 2019/04/07 22:32:10 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 September 8, 2018 +.Dd April 8, 2019 .Dt MODULE 9 .Os .Sh NAME @@ -131,7 +131,10 @@ macro creates and initializes a structure. The .Fa class -argument identifies the class of module, and must be one of the following: +argument identifies the class of module, and must be one of the following +(note that +.Dv MODULE_CLASS_ANY +should not be used here): .Bl -tag -width MODULE_CLASS_SECMODEL -offset indent .It Dv MODULE_CLASS_VFS The module provide a virtual file system - see
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Sat Apr 6 07:57:04 UTC 2019 Modified Files: src/share/man/man9: ipi.9 Log Message: Remove superfluous Pp. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/share/man/man9/ipi.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/ipi.9 diff -u src/share/man/man9/ipi.9:1.3 src/share/man/man9/ipi.9:1.4 --- src/share/man/man9/ipi.9:1.3 Sat Apr 6 03:06:24 2019 +++ src/share/man/man9/ipi.9 Sat Apr 6 07:57:04 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: ipi.9,v 1.3 2019/04/06 03:06:24 thorpej Exp $ +.\" $NetBSD: ipi.9,v 1.4 2019/04/06 07:57:04 wiz Exp $ .\" .\" Copyright (c) 2014, 2019 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -145,7 +145,6 @@ The member specifies a function to invoke and .Ar arg is the argument to be passed to the function. -.Pp .Bl -tag -width compact .It Fn ipi_unicast "msg" "ci" Send an IPI to a remote CPU specified by
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Sat Apr 6 07:56:49 UTC 2019 Modified Files: src/share/man/man9: ucas.9 Log Message: Sort sections. Fix typo. Remove superfluous Pp. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/share/man/man9/ucas.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/ucas.9 diff -u src/share/man/man9/ucas.9:1.3 src/share/man/man9/ucas.9:1.4 --- src/share/man/man9/ucas.9:1.3 Sat Apr 6 03:06:24 2019 +++ src/share/man/man9/ucas.9 Sat Apr 6 07:56:49 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: ucas.9,v 1.3 2019/04/06 03:06:24 thorpej Exp $ +.\" $NetBSD: ucas.9,v 1.4 2019/04/06 07:56:49 wiz Exp $ .\" .\" Copyright (c) 2019 Jason R. Thorpe. .\" Copyright (c) 2011 YAMAMOTO Takashi, @@ -52,7 +52,6 @@ user-space address. Except that they can be safely used for the kernel to access user-space address, they are semantically equivalents of .Xr atomic_cas 3 . -.Pp .Bl -tag -width uptr .It Fa uptr The pointer to the variable. @@ -65,16 +64,6 @@ The value to store to the variable. The pointer to the memory to store the old value of the variable. .El .\" -.Sh RETURN VALUES -On success, these functions return 0. -In that case, the caller can consult the value returned via -.Fa retp -to check the result of the CAS operation. -Otherwise, these functions return an appropriate -.Xr errno 9 -error code, typically -.Dv EFAULT . -.\" .Sh IMPLEMENTATION NOTES The .Nm ucas @@ -87,7 +76,6 @@ primitives have the following signatures the implementation and are not to be called by consumers of the .Nm ucas API: -.Pp .Bl -tag -width _ucas_32 .It Ft int Fn _ucas_32 \ "volatile uint32_t *uptr" "uint32_t old" "uint32_t new" "uint32_t *retp" ; @@ -139,7 +127,7 @@ operations and the multiprocessor implementation synchronizes with other CPUs using interprocessor interrupts. .Pp -If a particular platform wishes ro use the generic implementation on +If a particular platform wishes to use the generic implementation on uniprocessors but an optimized implementation on multiprocessors, the the platform should define .Dv __HAVE_UCAS_MP @@ -155,6 +143,16 @@ if an platform .Pc . .\" +.Sh RETURN VALUES +On success, these functions return 0. +In that case, the caller can consult the value returned via +.Fa retp +to check the result of the CAS operation. +Otherwise, these functions return an appropriate +.Xr errno 9 +error code, typically +.Dv EFAULT . +.\" .Sh SEE ALSO .Xr atomic_cas 3 , .Xr intro 9
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Sat Apr 6 07:56:19 UTC 2019 Modified Files: src/share/man/man9: ustore.9 Log Message: Fix short description. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/share/man/man9/ustore.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/ustore.9 diff -u src/share/man/man9/ustore.9:1.1 src/share/man/man9/ustore.9:1.2 --- src/share/man/man9/ustore.9:1.1 Sat Apr 6 03:06:24 2019 +++ src/share/man/man9/ustore.9 Sat Apr 6 07:56:19 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: ustore.9,v 1.1 2019/04/06 03:06:24 thorpej Exp $ +.\" $NetBSD: ustore.9,v 1.2 2019/04/06 07:56:19 wiz Exp $ .\" .\" Copyright (c) 2019 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -41,7 +41,7 @@ .Nm ustore_int , .Nm ustore_long , .Nm ustore_ptr -.Nd fetch data from user-space +.Nd store data in user-space .Sh SYNOPSIS .In sys/systm.h .Ft int
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Tue Mar 19 10:17:35 UTC 2019 Modified Files: src/share/man/man9: RUN_ONCE.9 Log Message: New sentence, new line. Fix Dd argument. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/share/man/man9/RUN_ONCE.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/RUN_ONCE.9 diff -u src/share/man/man9/RUN_ONCE.9:1.10 src/share/man/man9/RUN_ONCE.9:1.11 --- src/share/man/man9/RUN_ONCE.9:1.10 Tue Mar 19 08:16:51 2019 +++ src/share/man/man9/RUN_ONCE.9 Tue Mar 19 10:17:35 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: RUN_ONCE.9,v 1.10 2019/03/19 08:16:51 ryo Exp $ +.\" $NetBSD: RUN_ONCE.9,v 1.11 2019/03/19 10:17:35 wiz Exp $ .\" .\" Copyright (c)2005 YAMAMOTO Takashi, .\" All rights reserved. @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" -.Dd Mar 19, 2019 +.Dd March 19, 2019 .Dt RUN_ONCE 9 .Os .\" @@ -33,7 +33,7 @@ .Nm RUN_ONCE , .Nm INIT_ONCE , .Nm FINI_ONCE -.Nd Run a function exactly once +.Nd run a function exactly once .\" .Sh SYNOPSIS .In sys/once.h @@ -72,7 +72,7 @@ can sleep if it's called concurrently. is used in pair with .Fn FINI_ONCE . .Fn INIT_ONCE -will only be run once similar with +will only be run once similar to .Fn RUN_ONCE . .Fn FINI_ONCE will only be run at last time if it is called as many times as calling @@ -81,7 +81,8 @@ When .Fn FINI_ONCE is executed, the next call to .Fn INIT_ONCE -will be executed again. That is, +will be executed again. +That is, .Fn INIT_ONCE and .Fn FINI_ONCE
CVS commit: src/share/man/man9
Module Name:src Committed By: pgoyette Date: Mon Feb 25 21:43:00 UTC 2019 Modified Files: src/share/man/man9: localcount.9 Log Message: Add explicit cross-references to pserialize(9) for the sections about ensuring that a localcount doesn't disappear while in the process of being referenced, in the same manner as psref(9). To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/share/man/man9/localcount.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/localcount.9 diff -u src/share/man/man9/localcount.9:1.6 src/share/man/man9/localcount.9:1.7 --- src/share/man/man9/localcount.9:1.6 Fri Jun 2 00:32:12 2017 +++ src/share/man/man9/localcount.9 Mon Feb 25 21:43:00 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: localcount.9,v 1.6 2017/06/02 00:32:12 chs Exp $ +.\" $NetBSD: localcount.9,v 1.7 2019/02/25 21:43:00 pgoyette Exp $ .\" .\" Copyright (c) 2016 The NetBSD Foundation .\" 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 June 1, 2017 +.Dd February 25, 2019 .Dt LOCALCOUNT 9 .Os .Sh NAME @@ -86,7 +86,7 @@ network flows) and on which there may be such as xyzread for a device xyz(4), and short-term fast operations, such as .Dv xyzioctl(IOC_READ_A_CPU_REG) . .Sh FUNCTIONS -.Bl -tag -width 32n +.Bl -tag -width abcd .It Fn localcount_init "lc" Dynamically initialize localcount .Ar lc @@ -106,6 +106,13 @@ has been called until it has been re-ini .It Fn localcount_acquire "lc" Acquire a reference to the localcount .Ar lc . +.Pp +The caller must ensure by some other mechanism that the localcount will +not be destroyed before the call to +.Fn localcount_acquire ; +typically this will be via a +.Xr pserialize 9 +read section. .It Fn localcount_release "lc" "cv" "mtx" Release a reference to the localcount .Ar lc . @@ -140,7 +147,13 @@ before calling .Fn localcount_drain . For example, any object that may be found in a list and acquired must be removed from the list before calling -.Fn localcount_drain . +.Fn localcount_drain ; +removal from the list would typically be protected by calling +.Xr pserialize_perform 9 +to wait for any +.Xr pserialize 9 +readers to complete. +.Pp Once the localcount object .Ar lc is passed to
CVS commit: src/share/man/man9
Module Name:src Committed By: rin Date: Sun Feb 24 02:29:56 UTC 2019 Modified Files: src/share/man/man9: Makefile Log Message: Install spi.9 and friends. To generate a diff of this commit: cvs rdiff -u -r1.434 -r1.435 src/share/man/man9/Makefile 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.434 src/share/man/man9/Makefile:1.435 --- src/share/man/man9/Makefile:1.434 Mon Dec 24 16:58:54 2018 +++ src/share/man/man9/Makefile Sun Feb 24 02:29:56 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.434 2018/12/24 16:58:54 thorpej Exp $ +# $NetBSD: Makefile,v 1.435 2019/02/24 02:29:56 rin Exp $ # Makefile for section 9 (kernel function and variable) manual pages. @@ -52,7 +52,7 @@ MAN= accept_filter.9 accf_data.9 accf_ht secmodel_overlay.9 secmodel_securelevel.9 secmodel_suser.9 \ SET.9 setbit.9 setjmp.9 shutdownhook_establish.9 \ signal.9 skpc.9 sockopt.9 softintr.9 spl.9 specificdata.9 \ - splraiseipl.9 \ + spi.9 splraiseipl.9 \ store.9 suspendsched.9 \ sysctl.9 sysmon_envsys.9 sysmon_pswitch.9 sysmon_taskq.9 tc.9 \ tcp_congctl.9 threadpool.9 timecounter.9 time_second.9 todr.9 \
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Sat Feb 23 17:37:11 UTC 2019 Modified Files: src/share/man/man9: spi.9 Log Message: New sentence, new line. Add missing Nd. Remove superfluous Rs. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/share/man/man9/spi.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/spi.9 diff -u src/share/man/man9/spi.9:1.1 src/share/man/man9/spi.9:1.2 --- src/share/man/man9/spi.9:1.1 Sat Feb 23 10:43:25 2019 +++ src/share/man/man9/spi.9 Sat Feb 23 17:37:10 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: spi.9,v 1.1 2019/02/23 10:43:25 mlelstv Exp $ +.\" $NetBSD: spi.9,v 1.2 2019/02/23 17:37:10 wiz Exp $ .\" .\" Copyright (c) 2019 The NetBSD Foundation .\" All rights reserved. @@ -40,6 +40,7 @@ .Nm spi_send , .Nm spi_recv , .Nm spi_send_recv +.Nd Serial Peripheral Interface (SPI) kernel interface .Sh SYNOPSIS .In dev/spi/spivar.h .Ft int @@ -128,8 +129,8 @@ of bytes is shifted in and out. .It Fn spi_transfer_add "st" "chunk" Append a chunk to transfer structure. .It Fn spi_wait "st" -Wait for a transfer to complete. When the transfer has failed -for some reason, the field +Wait for a transfer to complete. +When the transfer has failed for some reason, the field .Va st->st_errno is set to a non-zero value. .It Fn spi_done "st" "err" @@ -149,13 +150,11 @@ Prepares a chunk for sending data, queue waits for it to complete. .It Fn spi_send_recv "sh" "scnt" "snd" "rcnt" "rcv" Prepares two chunks for sending data first and then receiving -an answer, -queues a transfer and waits for it to complete. +an answer, queues a transfer and waits for it to complete. This is not a full-duplex operation. .El .Sh SEE ALSO .Xr spi 4 -.Rs .Sh HISTORY The .Nm spi
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Sat Feb 16 07:00:56 UTC 2019 Modified Files: src/share/man/man9: audio.9 Log Message: Mark up NULL with Dv. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/share/man/man9/audio.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/audio.9 diff -u src/share/man/man9/audio.9:1.50 src/share/man/man9/audio.9:1.51 --- src/share/man/man9/audio.9:1.50 Sat Feb 16 06:51:04 2019 +++ src/share/man/man9/audio.9 Sat Feb 16 07:00:56 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: audio.9,v 1.50 2019/02/16 06:51:04 isaki Exp $ +.\" $NetBSD: audio.9,v 1.51 2019/02/16 07:00:56 wiz Exp $ .\" .\" Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -133,7 +133,9 @@ recording data will be thrown away. The fields of .Va audio_hw_if are described in some more detail below. -Some fields are optional and can be set to NULL if not needed. +Some fields are optional and can be set to +.Dv NULL +if not needed. .Bl -tag -width indent .It Dv int open(void *hdl, int flags) optional, is called when the audio device is opened. @@ -414,7 +416,9 @@ is used instead (with the same arguments The reason for using a device dependent routine instead of .Xr malloc 9 is that some buses need special allocation to do DMA. -Returns the address of the buffer, or NULL on failure. +Returns the address of the buffer, or +.Dv NULL +on failure. .It Dv void freem(void *hdl, void *addr, size_t size) optional, is called to free memory allocated by .Va allocm .
CVS commit: src/share/man/man9
Module Name:src Committed By: isaki Date: Sat Feb 16 06:51:05 UTC 2019 Modified Files: src/share/man/man9: audio.9 Log Message: Two minor fixes. - 0 -> NULL. - avoid K and sync with reality. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/share/man/man9/audio.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/audio.9 diff -u src/share/man/man9/audio.9:1.49 src/share/man/man9/audio.9:1.50 --- src/share/man/man9/audio.9:1.49 Sun Dec 2 09:22:30 2018 +++ src/share/man/man9/audio.9 Sat Feb 16 06:51:04 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: audio.9,v 1.49 2018/12/02 09:22:30 isaki Exp $ +.\" $NetBSD: audio.9,v 1.50 2019/02/16 06:51:04 isaki Exp $ .\" .\" Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -104,11 +104,8 @@ when the latter calls .Va audio_attach_mi . This call should be .Bd -literal -void -audio_attach_mi(ahwp, hdl, dev) - struct audio_hw_if *ahwp; - void *hdl; - struct device *dev; +device_t +audio_attach_mi(const struct audio_hw_if *ahwp, void *hdl, device_t dev); .Ed .Pp The @@ -136,7 +133,7 @@ recording data will be thrown away. The fields of .Va audio_hw_if are described in some more detail below. -Some fields are optional and can be set to 0 if not needed. +Some fields are optional and can be set to NULL if not needed. .Bl -tag -width indent .It Dv int open(void *hdl, int flags) optional, is called when the audio device is opened. @@ -417,7 +414,7 @@ is used instead (with the same arguments The reason for using a device dependent routine instead of .Xr malloc 9 is that some buses need special allocation to do DMA. -Returns the address of the buffer, or 0 on failure. +Returns the address of the buffer, or NULL on failure. .It Dv void freem(void *hdl, void *addr, size_t size) optional, is called to free memory allocated by .Va allocm .
CVS commit: src/share/man/man9
Module Name:src Committed By: christos Date: Sun Feb 10 17:15:45 UTC 2019 Modified Files: src/share/man/man9: pool.9 Log Message: document PR_ZERO To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/share/man/man9/pool.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/pool.9 diff -u src/share/man/man9/pool.9:1.46 src/share/man/man9/pool.9:1.47 --- src/share/man/man9/pool.9:1.46 Sat Dec 24 09:04:10 2016 +++ src/share/man/man9/pool.9 Sun Feb 10 12:15:45 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: pool.9,v 1.46 2016/12/24 14:04:10 abhinav Exp $ +.\" $NetBSD: pool.9,v 1.47 2019/02/10 17:15:45 christos Exp $ .\" .\" Copyright (c) 1997, 1998, 2007 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 August 15, 2015 +.Dd February 10, 2019 .Dt POOL 9 .Os .Sh NAME @@ -167,6 +167,10 @@ will return .Dv NULL without waiting, allowing the caller to do its own garbage collection; however, it will still wait if the pool is not yet at its hard limit. +If the +.Dv PR_ZERO +flag is specified, then the memory returned will be zeroed first using +.Xr memset 3 . .El .Ss RETURNING ITEMS TO A POOL .Fn pool_put
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Sun Jan 27 17:44:02 UTC 2019 Modified Files: src/share/man/man9: module.9 Log Message: Grammar fix. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 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/module.9 diff -u src/share/man/man9/module.9:1.50 src/share/man/man9/module.9:1.51 --- src/share/man/man9/module.9:1.50 Sun Jan 27 02:08:36 2019 +++ src/share/man/man9/module.9 Sun Jan 27 17:44:02 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: module.9,v 1.50 2019/01/27 02:08:36 pgoyette Exp $ +.\" $NetBSD: module.9,v 1.51 2019/01/27 17:44:02 wiz Exp $ .\" .\" Copyright (c) 2010 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -126,7 +126,7 @@ The module subsystem is protected by the .It Fn MODULE "class" "name" "required" The .Fn MODULE -macro creates and initialize a +macro creates and initializes a .Vt modinfo_t structure. The
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Mon Jan 14 15:56:06 UTC 2019 Modified Files: src/share/man/man9: pmap.9 Log Message: Remove Pp before It, where it has no effect. To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/share/man/man9/pmap.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/pmap.9 diff -u src/share/man/man9/pmap.9:1.45 src/share/man/man9/pmap.9:1.46 --- src/share/man/man9/pmap.9:1.45 Sun Jan 13 06:59:15 2019 +++ src/share/man/man9/pmap.9 Mon Jan 14 15:56:06 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: pmap.9,v 1.45 2019/01/13 06:59:15 mrg Exp $ +.\" $NetBSD: pmap.9,v 1.46 2019/01/14 15:56:06 wiz Exp $ .\" .\" Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -581,7 +581,6 @@ mappings immediately in or to use the knowledge of the upcoming .Fn pmap_remove calls to optimize the removals (or to just ignore this call). -.Pp .It void Fn "pmap_protect" "pmap_t pmap" "vaddr_t sva" "vaddr_t eva" \ "vm_prot_t prot" Set the protection of the mappings in the virtual address range @@ -1117,7 +1116,6 @@ The use of .Fn PMAP_PREFER is enabled by defining it as a C pre-processor macro in .In machine/pmap.h . -.Pp .It void Fn "pmap_procwr" "struct proc *p" "vaddr_t va" "vsize_t size" Synchronize CPU instruction caches of the specified range. The address space is designated by
CVS commit: src/share/man/man9
Module Name:src Committed By: mrg Date: Sun Jan 13 06:59:15 UTC 2019 Modified Files: src/share/man/man9: pmap.9 Log Message: add a note about pmap_activate() and pmap_deactivate() not being allow to block. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/share/man/man9/pmap.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/pmap.9 diff -u src/share/man/man9/pmap.9:1.44 src/share/man/man9/pmap.9:1.45 --- src/share/man/man9/pmap.9:1.44 Thu Feb 16 12:10:10 2012 +++ src/share/man/man9/pmap.9 Sun Jan 13 06:59:15 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: pmap.9,v 1.44 2012/02/16 12:10:10 yamt Exp $ +.\" $NetBSD: pmap.9,v 1.45 2019/01/13 06:59:15 mrg Exp $ .\" .\" Copyright (c) 2000, 2001, 2002 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 February 16, 2012 +.Dd January 13, 2019 .Dt PMAP 9 .Os .Sh NAME @@ -764,6 +764,12 @@ may not always be called when is the current lwp. .Fn pmap_activate must be able to handle this scenario. +.Pp +The +.Fn pmap_activate +call, like +.Fn pmap_deactivate , +must never block, as it is used for context switching. .It void Fn "pmap_deactivate" "struct lwp *l" Deactivate the physical map used by the process behind lwp .Fa l . @@ -775,6 +781,10 @@ Like may not always be called when .Fa l is the current lwp. +.Pp +As above, +.Fn pmap_deactivate +must never block. .It void Fn "pmap_zero_page" "paddr_t pa" Zero the PAGE_SIZE sized region starting at physical address .Fa pa .
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Wed Jan 9 09:48:44 UTC 2019 Modified Files: src/share/man/man9: crashme.9 Log Message: More markup. Add missing El. Fix typo. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/share/man/man9/crashme.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/crashme.9 diff -u src/share/man/man9/crashme.9:1.1 src/share/man/man9/crashme.9:1.2 --- src/share/man/man9/crashme.9:1.1 Wed Jan 9 04:02:26 2019 +++ src/share/man/man9/crashme.9 Wed Jan 9 09:48:44 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: crashme.9,v 1.1 2019/01/09 04:02:26 mrg Exp $ +.\" $NetBSD: crashme.9,v 1.2 2019/01/09 09:48:44 wiz Exp $ .\" .\" Copyright (c) 2019 Matthew R. Green .\" All rights reserved. @@ -52,8 +52,9 @@ The crashme functionality is only availa .Dv DEBUG option set. .Pp -Each crashme node is maintained in a crashme_node structure which -has the following public members: +Each crashme node is maintained in a +.Vt crashme_node +structure which has the following public members: .Bd -literal typedef int (*crashme_fn)(int); @@ -90,15 +91,17 @@ node to be executed. .It Ic debug.crashme.panic Basic panic node. .It Ic debug.crashme.null_deref -Derefence NULL node. +Dereference +.Dv NULL +node. +.El .Sh SEE ALSO .Xr options 4 , .Xr panic 9 .Sh HISTORY The .Nm -driver -appeared in +driver appeared in .Nx 9.0 . .Sh AUTHORS -.An Matthew R. Green . +.An Matthew R. Green
CVS commit: src/share/man/man9
Module Name:src Committed By: mrg Date: Wed Jan 9 04:02:26 UTC 2019 Added Files: src/share/man/man9: crashme.9 Log Message: document crashme(9) functionality. XXX: install me To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/share/man/man9/crashme.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/share/man/man9/crashme.9 diff -u /dev/null src/share/man/man9/crashme.9:1.1 --- /dev/null Wed Jan 9 04:02:26 2019 +++ src/share/man/man9/crashme.9 Wed Jan 9 04:02:26 2019 @@ -0,0 +1,104 @@ +.\" $NetBSD: crashme.9,v 1.1 2019/01/09 04:02:26 mrg Exp $ +.\" +.\" Copyright (c) 2019 Matthew R. Green +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote products +.\"derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd January 7, 2019 +.Dt CRASHME 9 +.Os +.Sh NAME +.Nm crashme , +.Nm crashme_add , +.Nm crashme_remove +.Nd in-kernel testing of crash handling +.Sh SYNOPSIS +.In sys/crashme.h +.Ft int +.Fn crashme_add "crashme_node *cn" +.Ft int +.Fn crashme_remove "crashme_node *cn" +.Sh DESCRIPTION +The +.Nm +functions provide access to dynamically add and remove crashme nodes. +These nodes are simply named callbacks that are expected to cause the +system to crash. +.Pp +The crashme functionality is only available in kernels with the +.Xr options 4 +.Dv DEBUG +option set. +.Pp +Each crashme node is maintained in a crashme_node structure which +has the following public members: +.Bd -literal +typedef int (*crashme_fn)(int); + +typedef struct crashme_node { + const char *cn_name; + const char *cn_longname; + crashme_fn cn_fn; +} crashme_node; +.Ed +.Pp +The +caller must fill in the +.Fa cn_name , +.Fa cn_longname , +and +.Fa cn_fn +members. +.Pp +The +.Ar flags +parameter is passed from sysctl. +The return value is 0 upon success or non zero for failure. +.Sh SYSCTL SUPPORT +The following +.Xr sysctl 8 +variables are provided by the +.Nm +subsystem: +.Bl -tag -width "123456" -offset indent +.It Ic debug.crashme_enable +Must be set to 1 for any +.Nm +node to be executed. +.It Ic debug.crashme.panic +Basic panic node. +.It Ic debug.crashme.null_deref +Derefence NULL node. +.Sh SEE ALSO +.Xr options 4 , +.Xr panic 9 +.Sh HISTORY +The +.Nm +driver +appeared in +.Nx 9.0 . +.Sh AUTHORS +.An Matthew R. Green .
CVS commit: src/share/man/man9
Module Name:src Committed By: thorpej Date: Wed Dec 26 21:48:55 UTC 2018 Modified Files: src/share/man/man9: threadpool.9 Log Message: Document the threadpool_job_fn_t type and its use. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/share/man/man9/threadpool.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/threadpool.9 diff -u src/share/man/man9/threadpool.9:1.2 src/share/man/man9/threadpool.9:1.3 --- src/share/man/man9/threadpool.9:1.2 Wed Dec 26 18:54:19 2018 +++ src/share/man/man9/threadpool.9 Wed Dec 26 21:48:55 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: threadpool.9,v 1.2 2018/12/26 18:54:19 thorpej Exp $ +.\" $NetBSD: threadpool.9,v 1.3 2018/12/26 21:48:55 thorpej Exp $ .\" .\" Copyright (c) 2014 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 24, 2018 +.Dd December 26, 2018 .Dt THREADPOOL 9 .Os .\" @@ -38,6 +38,8 @@ .Sh SYNOPSIS .In sys/threadpool.h .\ +.Vt typedef void threadpool_job_fn_t(struct threadpool_job *); +.\ .Ft int .Fn threadpool_get "struct threadpool **poolp" "pri_t pri" .\" @@ -57,7 +59,7 @@ .Fn threadpool_percpu_ref_remote "struct threadpool_percpu *pool" "struct cpu_info *ci" .\ .Ft void -.Fn threadpool_job_init "struct threadpool_job *job" "void (*fn)(struct threadpool_job *)" "kmutex_t *interlock" +.Fn threadpool_job_init "struct threadpool_job *job" "threadpool_job_fn_t fn" "kmutex_t *interlock" .\" .Ft void .Fn threadpool_job_destroy "struct threadpool_job *job"
CVS commit: src/share/man/man9
Module Name:src Committed By: jdolecek Date: Mon Dec 10 20:12:36 UTC 2018 Modified Files: src/share/man/man9: rwlock.9 Log Message: upon further reflection, rw_write_held() actually seems to be safe for check that the write lock is not currently held by current lwp - current lwp can't acquire the rwlock even when preempted To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/share/man/man9/rwlock.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/rwlock.9 diff -u src/share/man/man9/rwlock.9:1.18 src/share/man/man9/rwlock.9:1.19 --- src/share/man/man9/rwlock.9:1.18 Mon Dec 10 19:21:56 2018 +++ src/share/man/man9/rwlock.9 Mon Dec 10 20:12:36 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: rwlock.9,v 1.18 2018/12/10 19:21:56 jdolecek Exp $ +.\" $NetBSD: rwlock.9,v 1.19 2018/12/10 20:12:36 jdolecek Exp $ .\" .\" Copyright (c) 2006, 2007, 2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -188,6 +188,10 @@ must never be used to make locking decis they are provided only for diagnostic purposes. They are also not atomic, hence they should only be used to assert that lock is held. +The only exception is +.Fn rw_write_held , +which can be also used safely to assert that write lock is NOT currently +held by current lwp. .El .Sh PERFORMANCE CONSIDERATIONS RW locks are subject to high cache contention on multiprocessor systems,
CVS commit: src/share/man/man9
Module Name:src Committed By: jdolecek Date: Mon Dec 10 19:21:56 UTC 2018 Modified Files: src/share/man/man9: rwlock.9 Log Message: clarify how rw_{write,read,lock}_held() work; rw_write_held() actually returns non-zero only if current lwp is the owner, the other two don't care about owner; also warn that functions are not atomic, and thus should only ever be used to assert that the lock is held To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/share/man/man9/rwlock.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/rwlock.9 diff -u src/share/man/man9/rwlock.9:1.17 src/share/man/man9/rwlock.9:1.18 --- src/share/man/man9/rwlock.9:1.17 Sun Nov 12 21:14:33 2017 +++ src/share/man/man9/rwlock.9 Mon Dec 10 19:21:56 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: rwlock.9,v 1.17 2017/11/12 21:14:33 riastradh Exp $ +.\" $NetBSD: rwlock.9,v 1.18 2018/12/10 19:21:56 jdolecek Exp $ .\" .\" Copyright (c) 2006, 2007, 2009 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 November 22, 2009 +.Dd December 10, 2018 .Dt RWLOCK 9 .Os .Sh NAME @@ -168,15 +168,26 @@ Otherwise, returns zero. .Pp Downgrade a lock from a write hold to a read hold. .It Fn rw_write_held "rw" +.Pp +Return non-zero if write lock is held by current lwp. +Otherwise, return zero. .It Fn rw_read_held "rw" +Returns non-zero if read lock is held by any lwp. +Otherwise, return zero. .It Fn rw_lock_held "rw" .Pp -Test the lock's condition and return non-zero if the lock is held -(potentially by the current LWP) and matches the specified condition. +Returns non-zero if either read or write lock is held by any lwp. Otherwise, return zero. .Pp -These functions must never be used to make locking decisions at run time: +Functions +.Fn rw_write_held , +.Fn rw_read_held , +and +.Fn rw_lock_held +must never be used to make locking decisions at run time: they are provided only for diagnostic purposes. +They are also not atomic, hence they should only be used to assert +that lock is held. .El .Sh PERFORMANCE CONSIDERATIONS RW locks are subject to high cache contention on multiprocessor systems,
CVS commit: src/share/man/man9
Module Name:src Committed By: isaki Date: Sun Dec 2 09:22:30 UTC 2018 Modified Files: src/share/man/man9: audio.9 Log Message: Correct function name. freem is used to free memory allocated by allocm. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/share/man/man9/audio.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/audio.9 diff -u src/share/man/man9/audio.9:1.48 src/share/man/man9/audio.9:1.49 --- src/share/man/man9/audio.9:1.48 Sun Dec 2 09:18:26 2018 +++ src/share/man/man9/audio.9 Sun Dec 2 09:22:30 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: audio.9,v 1.48 2018/12/02 09:18:26 isaki Exp $ +.\" $NetBSD: audio.9,v 1.49 2018/12/02 09:22:30 isaki Exp $ .\" .\" Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -420,7 +420,7 @@ is that some buses need special allocati Returns the address of the buffer, or 0 on failure. .It Dv void freem(void *hdl, void *addr, size_t size) optional, is called to free memory allocated by -.Va alloc . +.Va allocm . If not supplied .Xr free 9 is used.
CVS commit: src/share/man/man9
Module Name:src Committed By: isaki Date: Sun Dec 2 09:18:26 UTC 2018 Modified Files: src/share/man/man9: audio.9 Log Message: Sync prototypes with reality. These have been changed in 2011. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/share/man/man9/audio.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/audio.9 diff -u src/share/man/man9/audio.9:1.47 src/share/man/man9/audio.9:1.48 --- src/share/man/man9/audio.9:1.47 Mon May 28 00:18:06 2018 +++ src/share/man/man9/audio.9 Sun Dec 2 09:18:26 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: audio.9,v 1.47 2018/05/28 00:18:06 nat Exp $ +.\" $NetBSD: audio.9,v 1.48 2018/12/02 09:18:26 isaki Exp $ .\" .\" Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -75,8 +75,8 @@ struct audio_hw_if { int (*query_devinfo)(void *, mixer_devinfo_t *); - void *(*allocm)(void *, int, size_t, struct malloc_type *, int); - void (*freem)(void *, void *, struct malloc_type *); + void *(*allocm)(void *, int, size_t); + void (*freem)(void *, void *, size_t); size_t (*round_buffersize)(void *, int, size_t); paddr_t (*mappage)(void *, void *, off_t, int); @@ -409,8 +409,7 @@ It should fill the .Va mixer_devinfo_t struct. Return 0 on success, otherwise an error code. -.It Dv "void *allocm(void *hdl, int direction, size_t size, struct malloc_type *type, int flags)" -.Pp +.It Dv "void *allocm(void *hdl, int direction, size_t size)" optional, is called to allocate the device buffers. If not present .Xr malloc 9 @@ -419,7 +418,7 @@ The reason for using a device dependent .Xr malloc 9 is that some buses need special allocation to do DMA. Returns the address of the buffer, or 0 on failure. -.It Dv void freem(void *hdl, void *addr, struct malloc_type *type) +.It Dv void freem(void *hdl, void *addr, size_t size) optional, is called to free memory allocated by .Va alloc . If not supplied