CVS commit: src/share/man/man9

2021-10-11 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Mon Oct 11 18:19:27 UTC 2021

Modified Files:
src/share/man/man9: wsmouse.9

Log Message:
wsmouse.9: document scrolling bits


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 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.18 src/share/man/man9/wsmouse.9:1.19
--- src/share/man/man9/wsmouse.9:1.18	Fri Dec 18 02:29:50 2020
+++ src/share/man/man9/wsmouse.9	Mon Oct 11 18:19:27 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: wsmouse.9,v 1.18 2020/12/18 02:29:50 pgoyette Exp $
+.\" $NetBSD: wsmouse.9,v 1.19 2021/10/11 18:19:27 nia 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 November 12, 2006
+.Dd October 11, 2021
 .Dt WSMOUSE 9
 .Os
 .Sh NAME
@@ -171,6 +171,30 @@ Absolute mode in
 axis.
 .El
 .El
+.It Fn wsmouse_precision_scroll "msdev" "x" "y"
+Callback from the mouse driver to the wsmouse interface driver.
+.Pp
+This is used when higher precision scrolling events are required
+than what can be provided by a typical scroll wheel.
+This function generates
+.Dv WSCONS_EVENT_HSCROLL
+(for scrolling on the X axis) and
+.Dv WSCONS_EVENT_VSCROLL
+(for scrolling on the X axis) events.
+.Pp
+The coordinates are adjusted for speed according to the formula:
+.Li x * 4096 / scroll_unit
+.Pp
+The
+.Dv scroll_unit
+is configured through the
+.Xr wsmouse 4
+ioctl interface, specifically the
+.Dv WSMOUSEIO_SETPARAMS
+keys
+.Dv WSMOUSECFG_HORIZSCROLLDIST
+and
+.Dv WSMOUSECFG_VERTSCROLLDIST .
 .It Fn wsmousedevprint "aux" "pnp"
 The default wsmouse printing routine used by
 .Fn config_found .



CVS commit: src/share/man/man9

2021-10-11 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Mon Oct 11 18:19:27 UTC 2021

Modified Files:
src/share/man/man9: wsmouse.9

Log Message:
wsmouse.9: document scrolling bits


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 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.



CVS commit: src/share/man/man9

2021-09-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep 18 18:01:18 UTC 2021

Modified Files:
src/share/man/man9: timecounter.9

Log Message:
Update description of struct timecounter (u_int64_t -> uint64_t).

It has been changed since src/sys/sys/timetc.h rev 1.8.
Bump date.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/share/man/man9/timecounter.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/timecounter.9
diff -u src/share/man/man9/timecounter.9:1.10 src/share/man/man9/timecounter.9:1.11
--- src/share/man/man9/timecounter.9:1.10	Thu Aug 27 14:14:00 2020
+++ src/share/man/man9/timecounter.9	Sat Sep 18 18:01:18 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: timecounter.9,v 1.10 2020/08/27 14:14:00 fcambus Exp $
+.\"	$NetBSD: timecounter.9,v 1.11 2021/09/18 18:01:18 tsutsui Exp $
 .\"	$OpenBSD: tc_init.9,v 1.4 2007/05/31 19:20:01 jmc Exp $
 .\"
 .\" Copyright (c) 2004 Alexander Yurchenko 
@@ -37,7 +37,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 June 8, 2010
+.Dd September 18, 2021
 .Dt TIMECOUNTER 9
 .Os
 .Sh NAME
@@ -74,7 +74,7 @@ struct timecounter {
 	timecounter_get_t	*tc_get_timecount;
 	timecounter_pps_t	*tc_poll_pps;
 	u_int 			tc_counter_mask;
-	u_int64_t		tc_frequency;
+	uint64_t		tc_frequency;
 	const char		*tc_name;
 	int			tc_quality;
 	void			*tc_priv;



CVS commit: src/share/man/man9

2021-09-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep 18 18:01:18 UTC 2021

Modified Files:
src/share/man/man9: timecounter.9

Log Message:
Update description of struct timecounter (u_int64_t -> uint64_t).

It has been changed since src/sys/sys/timetc.h rev 1.8.
Bump date.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/share/man/man9/timecounter.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/share/man/man9

2021-02-08 Thread Tetsuya Isaki
At Sun, 7 Feb 2021 09:22:39 +,
nia wrote:
> > > -It is called at any time.
> > > +It can be called at any time.
> > 
> > The later sounds to me "You(developer of MD driver) can call
> > it at any time".  If so, it's incorrect.
> 
> Maybe "it can be called by the MI layer at any time" is clearer
> here, then? I can change it to that.

That's true, but sounds a bit redundant.
Because these all are callback functions called by the MI layer.

Is there any better text?
The MI layer can(will?) call this in the Opened phase or in the
Closed phase, or even in the Attach phase.  This means, for example,
that you (MD driver) cannot assume that you can prepare(initialize)
something in open() before this (since this can be called in the
Closed phase), and you cannot assume that it has returned from MI
attach (since this can be called in the Attach phase).

> > Is "only" a typo?  or is it better to remove it in English?
> 
> I think it's clear that conversion of other formats is not
> supported by the rest of the paragraph, so it doesn't need to
> be mentioned here, where the primary purpose of the sentence
> is to explain why you don't need to handle conversion in that
> case yourself.

If it's clear for readers, no problem to me.

Thanks,
---
Tetsuya Isaki 


Re: CVS commit: src/share/man/man9

2021-02-07 Thread nia
On Sun, Feb 07, 2021 at 12:43:40PM +0900, Tetsuya Isaki wrote:
> > @@ -175,9 +175,9 @@
> >  .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.
> 
> The later sounds to me "You(developer of MD driver) can call
> it at any time".  If so, it's incorrect.

Maybe "it can be called by the MI layer at any time" is clearer
here, then? I can change it to that.

> 
> >  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
> 
> Is "only" a typo?  or is it better to remove it in English?
> 
> Thanks,
> ---
> Tetsuya Isaki 

I think it's clear that conversion of other formats is not
supported by the rest of the paragraph, so it doesn't need to
be mentioned here, where the primary purpose of the sentence
is to explain why you don't need to handle conversion in that
case yourself.

That's just my opinion, though - I'm not an English expert, there's
lots of rules I know but cannot explain.

Thanks,

Nia


Re: CVS commit: src/share/man/man9

2021-02-06 Thread Tetsuya Isaki
Hello,

At Sat, 6 Feb 2021 13:55:40 +,
Nia Alarie wrote:
> 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

> @@ -175,9 +175,9 @@
>  .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.

The later sounds to me "You(developer of MD driver) can call
it at any time".  If so, it's incorrect.

>  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

Is "only" a typo?  or is it better to remove it in English?

Thanks,
---
Tetsuya Isaki 


Re: CVS commit: src/share/man/man9

2020-02-23 Thread Andrew Doran
On Sun, Feb 23, 2020 at 08:57:44AM +, matthew green wrote:
> 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.

Oops, forgot to commit the Makefile.  Thank you.

Andrew


Re: CVS commit: src/share/man/man9

2019-12-07 Thread Valery Ushakov
On Sat, Dec 07, 2019 at 12:22:19 +, Thomas Klausner wrote:

> 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

This breaks formatting, adding spaces between function names and the
opening parens - though, please, don't fix that, the original markup
is way overcomplicated anyway, I'll work with riastradh@ on
improvments.

-uwe


CVS commit: src/share/man/man9

2019-11-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Nov 30 02:38:44 UTC 2019

Modified Files:
src/share/man/man9: atomic_loadstore.9

Log Message:
Document relation to atomic_ops(3) and membar_ops(3).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 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.1 src/share/man/man9/atomic_loadstore.9:1.2
--- src/share/man/man9/atomic_loadstore.9:1.1	Fri Nov 29 22:17:23 2019
+++ src/share/man/man9/atomic_loadstore.9	Sat Nov 30 02:38:44 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: atomic_loadstore.9,v 1.1 2019/11/29 22:17:23 riastradh Exp $
+.\"	$NetBSD: atomic_loadstore.9,v 1.2 2019/11/30 02:38:44 riastradh Exp $
 .\"
 .\" Copyright (c) 2019 The NetBSD Foundation
 .\" All rights reserved.
@@ -621,6 +621,60 @@ They do not require
 to be at most the largest size of available atomic loads and stores on
 the host architecture.
 .El
+.Sh MEMORY BARRIERS AND ATOMIC READ/MODIFY/WRITE
+The atomic read/modify/write operations in
+.Xr atomic_ops 3
+have relaxed ordering by default, but can be combined with the memory
+barriers in
+.Xr membar_ops 3
+for the same effect as an acquire operation and a release operation for
+the purposes of pairing with
+.Fn atomic_store_release
+and
+.Fn atomic_load_acquire
+or
+.Fn atomic_load_consume :
+If
+.Fn atomic_r/m/w
+is an atomic read/modify/write operation in
+.Xr atomic_ops 3 ,
+then
+.Bd -literal
+	membar_exit();
+	atomic_r/m/w(obj, ...);
+.Ed
+.Pp
+functions like a release operation on
+.Fa obj ,
+and
+.Bd -literal
+	atomic_r/m/w(obj, ...);
+	membar_enter();
+.Ed
+.Pp
+functions like a acquire operation on
+.Fa obj .
+.Pp
+.Em WARNING :
+The combination of
+.Fn atomic_load_relaxed
+and
+.Xr membar_enter 3
+.Em does not
+make an acquire operation; only read/modify/write atomics may be
+combined with
+.Xr membar_enter 3
+this way.
+.Pp
+On architectures where
+.Dv __HAVE_ATOMIC_AS_MEMBAR
+is defined, all the
+.Xr atomic_ops 3
+imply release and acquire operations, so the
+.Xr membar_enter 3
+and
+.Xr membar_exit 3
+are redundant.
 .Sh EXAMPLES
 Maintaining lossy counters.
 These may lose some counts, because the read/modify/write cycle as a



CVS commit: src/share/man/man9

2019-11-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Nov 30 02:38:44 UTC 2019

Modified Files:
src/share/man/man9: atomic_loadstore.9

Log Message:
Document relation to atomic_ops(3) and membar_ops(3).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 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.



CVS commit: src/share/man/man9

2019-11-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Nov 30 02:22:23 UTC 2019

Modified Files:
src/share/man/man9: xcall.9

Log Message:
Document xc_barrier.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 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.



CVS commit: src/share/man/man9

2019-11-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Nov 30 02:22:23 UTC 2019

Modified Files:
src/share/man/man9: xcall.9

Log Message:
Document xc_barrier.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 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.15 src/share/man/man9/xcall.9:1.16
--- src/share/man/man9/xcall.9:1.15	Sun Oct  6 17:21:28 2019
+++ src/share/man/man9/xcall.9	Sat Nov 30 02:22:23 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: xcall.9,v 1.15 2019/10/06 17:21:28 uwe Exp $
+.\" $NetBSD: xcall.9,v 1.16 2019/11/30 02:22:23 riastradh Exp $
 .\"
 .\" Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,14 +27,15 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 1, 2018
+.Dd November 29, 2019
 .Dt XCALL 9
 .Os
 .Sh NAME
 .Nm xcall ,
 .Nm xc_broadcast ,
 .Nm xc_unicast ,
-.Nm xc_wait
+.Nm xc_wait ,
+.Nm xc_barrier
 .Nd cross-call interface
 .Sh SYNOPSIS
 .In sys/xcall.h
@@ -45,6 +46,8 @@
 .Fn xc_unicast "u_int flags" "xcfunc_t func" "void *arg1" "void *arg2" "struct cpu_info *ci"
 .Ft void
 .Fn xc_wait "uint64_t where"
+.Ft void
+.Fn xc_barrier "u_int flags"
 .Sh DESCRIPTION
 The machine-independent
 .Nm
@@ -143,6 +146,29 @@ or
 for the corresponding cross-call to complete.
 .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 ,
+and wait for it to complete.
+This has two effects:
+.Bl -dash -compact
+.It
+This waits for the interrupt priority level to transition to
+.Dv IPL_NONE
+at least once 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.
+.El
+.Pp
+.Fn xc_barrier
+is much more expensive than
+.Xr membar_ops 3 ,
+so it should be used sparingly, only to publish information
+infrequently \(em for example, during module load and unload \(em when
+the cost of a memory barrier on the consumer side would be
+prohibitive.
 .El
 .Sh CODE REFERENCES
 The
@@ -151,6 +177,7 @@ interface is implemented within the file
 .Pa sys/kern/subr_xcall.c .
 .\" .Sh EXAMPLES
 .Sh SEE ALSO
+.Xr membar_ops 3 ,
 .Xr kpreempt 9 ,
 .Xr percpu 9 ,
 .Xr softint 9



CVS commit: src/share/man/man9

2019-11-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Nov 29 22:38:28 UTC 2019

Modified Files:
src/share/man/man9: Makefile

Log Message:
Missed a spot: delete mb.9 from MLINKS too.


To generate a diff of this commit:
cvs rdiff -u -r1.443 -r1.444 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.443 src/share/man/man9/Makefile:1.444
--- src/share/man/man9/Makefile:1.443	Fri Nov 29 22:17:23 2019
+++ src/share/man/man9/Makefile	Fri Nov 29 22:38:28 2019
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.443 2019/11/29 22:17:23 riastradh Exp $
+#   $NetBSD: Makefile,v 1.444 2019/11/29 22:38:28 riastradh Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -494,7 +494,6 @@ MLINKS+=malloc.9 malloc_type_attach.9
 MLINKS+=malloc.9 malloc_type_detach.9
 MLINKS+=malloc.9 MALLOC_DEFINE.9
 MLINKS+=malloc.9 MALLOC_DECLARE.9
-MLINKS+=mb.9 mb_memory.9 mb.9 mb_read.9 mb.9 mb_write.9
 MLINKS+=mbuf.9 m_get.9 mbuf.9 m_gethdr.9 mbuf.9 m_devget.9 \
 	mbuf.9 m_copym.9 mbuf.9 m_copypacket.9 mbuf.9 m_copydata.9 \
 	mbuf.9 m_copyback.9 mbuf.9 m_cat.9 mbuf.9 m_dup.9 mbuf.9 m_prepend.9 \



CVS commit: src/share/man/man9

2019-11-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Nov 29 22:38:28 UTC 2019

Modified Files:
src/share/man/man9: Makefile

Log Message:
Missed a spot: delete mb.9 from MLINKS too.


To generate a diff of this commit:
cvs rdiff -u -r1.443 -r1.444 src/share/man/man9/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-11-23 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Nov 23 19:46:38 UTC 2019

Modified Files:
src/share/man/man9: cpu_need_resched.9

Log Message:
Update to match recent changes.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/share/man/man9/cpu_need_resched.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/cpu_need_resched.9
diff -u src/share/man/man9/cpu_need_resched.9:1.9 src/share/man/man9/cpu_need_resched.9:1.10
--- src/share/man/man9/cpu_need_resched.9:1.9	Mon Oct 24 07:30:29 2011
+++ src/share/man/man9/cpu_need_resched.9	Sat Nov 23 19:46:38 2019
@@ -1,10 +1,10 @@
-.\" $NetBSD: cpu_need_resched.9,v 1.9 2011/10/24 07:30:29 yamt Exp $
+.\" $NetBSD: cpu_need_resched.9,v 1.10 2019/11/23 19:46:38 ad Exp $
 .\"
-.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
+.\" Copyright (c) 2002, 2019 The NetBSD Foundation, Inc.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to The NetBSD Foundation
-.\" by Gregory McGarry.
+.\" by Gregory McGarry, and Andrew Doran.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
@@ -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 31, 2010
+.Dd November 17, 2019
 .Dt CPU_NEED_RESCHED 9
 .Os
 .Sh NAME
@@ -36,19 +36,26 @@
 .Sh SYNOPSIS
 .In sys/cpu.h
 .Ft void
-.Fn cpu_need_resched "struct cpu_info *ci" "int flags"
+.Fn cpu_need_resched "struct cpu_info *ci" "struct lwp *l" "int flags"
 .Sh DESCRIPTION
 The
 .Fn cpu_need_resched
 function is the machine-independent interface for the scheduler to
 notify machine-dependent code that a context switch from the current
-LWP, on the cpu
+LWP
+.Fa l ,
+on the cpu
 .Fa ci ,
 is required.
 This event may occur if a higher priority LWP appears on the run
 queue or if the current LWP has exceeded its time slice.
+.Fa l
+is the last LWP observed running on the CPU.
+It may no longer be running, as
+.Fn cpu_need_resched
+can be called without holding scheduler locks.
 .Pp
-If
+If the
 .Dv RESCHED_KPREEMPT
 flag is specified in
 .Fa flags
@@ -57,20 +64,35 @@ and
 C pre-processor macro is defined in
 .In machine/intr.h ,
 machine-dependent code should make a context switch happen as soon as possible
-even if the cpu is running the kernel code.
+even if the CPU is running in kernel mode.
+If the
+.Dv RESCHED_KPREEMPT
+flag is not specified, then
+.Dv RESCHED_UPREEMPT
+is specified instead.
+.Pp
+If the
+.Dv RESCHED_IDLE
+flag is specified in
+.Fa flags ,
+the last thread observed running on the CPU was the idle LWP.
 .Pp
 If
-.Dv RESCHED_IMMED
+.Dv RESCHED_REMOTE
 flag is specified in
 .Fa flags ,
-machine-dependent code should make a context switch happen as soon as possible.
-In that case, for example, if
+the request is not for the current CPU.
+The opposite also holds true.
+If
 .Fa ci
 is not the current processor,
 .Fn cpu_need_resched
 typically issues an inter processor call to the processor to make it
 notice the need of a context switch as soon as possible.
 .Pp
+.Fn cpu_need_resched
+is always called with kernel preemption disabled.
+.Pp
 Typically, the
 .Fn cpu_need_resched
 function will perform the following operations:
@@ -84,7 +106,10 @@ Post an asynchronous software trap
 .Pq Tn AST .
 .It
 Send an inter processor interrupt to wake up
-.Xr cpu_idle 9 .
+.Xr cpu_idle 9
+and/or force an user process across the user/kernel boundary, thus making a
+trip through
+.Fn userret .
 .El
 .Sh SEE ALSO
 .Xr sched_4bsd 9 ,



CVS commit: src/share/man/man9

2019-11-17 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Nov 17 11:46:39 UTC 2019

Modified Files:
src/share/man/man9: vnsubr.9

Log Message:
file system police. New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/share/man/man9/vnsubr.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/vnsubr.9
diff -u src/share/man/man9/vnsubr.9:1.46 src/share/man/man9/vnsubr.9:1.47
--- src/share/man/man9/vnsubr.9:1.46	Sat Nov 16 22:09:56 2019
+++ src/share/man/man9/vnsubr.9	Sun Nov 17 11:46:38 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: vnsubr.9,v 1.46 2019/11/16 22:09:56 mlelstv Exp $
+.\" $NetBSD: vnsubr.9,v 1.47 2019/11/17 11:46:38 wiz Exp $
 .\"
 .\" Copyright (c) 2001, 2005, 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -185,12 +185,13 @@ stores the vnode pointer into
 .Fa *vpp .
 The argument
 .Fa l
-is the calling process. The vnode can be closed and freed with
+is the calling process.
+The vnode can be closed and freed with
 .Fa vn_close .
 .It Fn vn_bdev_openpath "pb" "vpp" "l"
 Works like
 .Fn vn_bdev_open
-but looks up a filesystem path
+but looks up a file system path
 .Fa pb
 to determine the device ID.
 .It Fn vn_rdwr "rw" "vp" "base" "len" "offset" "segflg" "ioflg" "cred" "aresid" "l"



CVS commit: src/share/man/man9

2019-11-17 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Nov 17 11:46:39 UTC 2019

Modified Files:
src/share/man/man9: vnsubr.9

Log Message:
file system police. New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/share/man/man9/vnsubr.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-11-16 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Nov 16 22:09:56 UTC 2019

Modified Files:
src/share/man/man9: vnsubr.9

Log Message:
Document new functions vn_bdev_open and vn_bdev_openpath.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/share/man/man9/vnsubr.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/vnsubr.9
diff -u src/share/man/man9/vnsubr.9:1.45 src/share/man/man9/vnsubr.9:1.46
--- src/share/man/man9/vnsubr.9:1.45	Thu Jan  5 09:54:03 2017
+++ src/share/man/man9/vnsubr.9	Sat Nov 16 22:09:56 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: vnsubr.9,v 1.45 2017/01/05 09:54:03 wiz Exp $
+.\" $NetBSD: vnsubr.9,v 1.46 2019/11/16 22:09:56 mlelstv Exp $
 .\"
 .\" Copyright (c) 2001, 2005, 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -41,6 +41,8 @@
 .Nm vn_marktext ,
 .Nm vn_rdwr ,
 .Nm vn_open ,
+.Nm vn_bdev_open ,
+.Nm vn_bdev_openpath ,
 .Nm vn_stat ,
 .Nm vn_writechk
 .Nd high-level convenience functions for vnode operations
@@ -65,6 +67,10 @@
 .Ft int
 .Fn vn_open "struct nameidata *ndp" "int fmode" "int cmode"
 .Ft int
+.Fn vn_bdev_open "dev_t dev" "struct vnode **vpp" "struct lwp *l"
+.Ft int
+.Fn vn_bdev_openpath "struct pathbuf *pb" "struct vnode **vpp" "struct lwp *l"
+.Ft int
 .Fo vn_rdwr
 .Fa "enum uio_rw rw" "struct vnode *vp" "void *base"
 .Fa "int len" "off_t offset" "enum uio_seg segflg" "int ioflg"
@@ -173,6 +179,20 @@ or
 vnode operations.
 If the operation is successful zero is returned and the vnode is locked,
 otherwise an appropriate error code is returned.
+.It Fn vn_bdev_open "dev" "vpp" "l"
+Opens a block device by its device number for reading and writing, and
+stores the vnode pointer into
+.Fa *vpp .
+The argument
+.Fa l
+is the calling process. The vnode can be closed and freed with
+.Fa vn_close .
+.It Fn vn_bdev_openpath "pb" "vpp" "l"
+Works like
+.Fn vn_bdev_open
+but looks up a filesystem path
+.Fa pb
+to determine the device ID.
 .It Fn vn_rdwr "rw" "vp" "base" "len" "offset" "segflg" "ioflg" "cred" "aresid" "l"
 Common code to package up an I/O request on a vnode into a uio and
 then perform the I/O.



CVS commit: src/share/man/man9

2019-11-16 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Nov 16 22:09:56 UTC 2019

Modified Files:
src/share/man/man9: vnsubr.9

Log Message:
Document new functions vn_bdev_open and vn_bdev_openpath.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/share/man/man9/vnsubr.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-11-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Nov  6 11:55:18 UTC 2019

Modified Files:
src/share/man/man9: vmem.9

Log Message:
Remove superfluous Pp.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/share/man/man9/vmem.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/vmem.9
diff -u src/share/man/man9/vmem.9:1.18 src/share/man/man9/vmem.9:1.19
--- src/share/man/man9/vmem.9:1.18	Tue Nov  5 22:19:43 2019
+++ src/share/man/man9/vmem.9	Wed Nov  6 11:55:18 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: vmem.9,v 1.18 2019/11/05 22:19:43 dyoung Exp $
+.\"	$NetBSD: vmem.9,v 1.19 2019/11/06 11:55:18 wiz Exp $
 .\"
 .\" Copyright (c)2006 YAMAMOTO Takashi,
 .\" All rights reserved.
@@ -82,7 +82,6 @@ other than virtual memory.
 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 .Fn vmem_create
 creates a new vmem arena.
-.Pp
 .Bl -tag -offset indent -width qcache_max
 .It Fa name
 The string to describe the vmem.
@@ -184,7 +183,6 @@ Interrupt level to be blocked for alloca
 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 .Fn vmem_xcreate
 creates a new vmem arena.
-.Pp
 .Bl -tag -offset indent -width qcache_max
 .It Fa name
 The string to describe the vmem.
@@ -317,7 +315,6 @@ if there are not enough resources availa
 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 .Fn vmem_xalloc
 allocates a resource from the arena.
-.Pp
 .Bl -tag -offset indent -width nocross
 .It Fa vm
 The arena which we allocate from.
@@ -391,7 +388,6 @@ overwrites it with the start address of 
 frees resource allocated by
 .Fn vmem_xalloc
 to the arena.
-.Pp
 .Bl -tag -offset indent -width addr
 .It Fa vm
 The arena which we free to.
@@ -413,7 +409,6 @@ argument used for
 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 .Fn vmem_alloc
 allocates a resource from the arena.
-.Pp
 .Bl -tag -offset indent -width flags
 .It Fa vm
 The arena which we allocate from.
@@ -455,7 +450,6 @@ overwrites it with the start address of 
 frees resource allocated by
 .Fn vmem_alloc
 to the arena.
-.Pp
 .Bl -tag -offset indent -width addr
 .It Fa vm
 The arena which we free to.
@@ -477,7 +471,6 @@ argument used for
 .\" 
 .Fn vmem_destroy
 destroys a vmem arena.
-.Pp
 .Bl -tag -offset indent -width vm
 .It Fa vm
 The vmem arena being destroyed.
@@ -524,7 +517,6 @@ This implementation of
 was written by
 .An YAMAMOTO Takashi .
 .Sh BUGS
-.Pp
 .Nm
 relies on
 .Xr malloc 9 ,



CVS commit: src/share/man/man9

2019-11-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Nov  6 11:55:18 UTC 2019

Modified Files:
src/share/man/man9: vmem.9

Log Message:
Remove superfluous Pp.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/share/man/man9/vmem.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-11-05 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue Nov  5 22:19:43 UTC 2019

Modified Files:
src/share/man/man9: vmem.9

Log Message:
Fix typo: vmem_add(9) does not actually take an `addrp` argument.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/share/man/man9/vmem.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/vmem.9
diff -u src/share/man/man9/vmem.9:1.17 src/share/man/man9/vmem.9:1.18
--- src/share/man/man9/vmem.9:1.17	Mon Jul  3 21:28:48 2017
+++ src/share/man/man9/vmem.9	Tue Nov  5 22:19:43 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: vmem.9,v 1.17 2017/07/03 21:28:48 wiz Exp $
+.\"	$NetBSD: vmem.9,v 1.18 2019/11/05 22:19:43 dyoung Exp $
 .\"
 .\" Copyright (c)2006 YAMAMOTO Takashi,
 .\" All rights reserved.
@@ -25,7 +25,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" 
-.Dd February 28, 2016
+.Dd November 5, 2019
 .Dt VMEM 9
 .Os
 .\" 
@@ -52,7 +52,7 @@
 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 .Ft int
 .Fn vmem_add \
-"vmem_t *vm" "vmem_addr_t addr" "vmem_size_t size" "vm_flag_t flags" "vmem_addr_t *addrp"
+"vmem_t *vm" "vmem_addr_t addr" "vmem_size_t size" "vm_flag_t flags"
 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 .Ft int
 .Fn vmem_xalloc \



CVS commit: src/share/man/man9

2019-11-05 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue Nov  5 22:19:43 UTC 2019

Modified Files:
src/share/man/man9: vmem.9

Log Message:
Fix typo: vmem_add(9) does not actually take an `addrp` argument.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/share/man/man9/vmem.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-10-06 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Oct  6 17:21:28 UTC 2019

Modified Files:
src/share/man/man9: xcall.9

Log Message:
Use .Bl -tag -width Fn.  There's no such thing as -width compact
or, rather, there is, but the width specified is that of the word
"compact".


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 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.14 src/share/man/man9/xcall.9:1.15
--- src/share/man/man9/xcall.9:1.14	Sun Oct  6 17:14:18 2019
+++ src/share/man/man9/xcall.9	Sun Oct  6 17:21:28 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: xcall.9,v 1.14 2019/10/06 17:14:18 uwe Exp $
+.\" $NetBSD: xcall.9,v 1.15 2019/10/06 17:21:28 uwe Exp $
 .\"
 .\" Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -94,7 +94,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 compact
+.Bl -tag -width Fn
 .It Fn xc_broadcast "flags" "func" "arg1" "arg2"
 Call
 .Pf (* Fa func\| ) Ns Fo ""



CVS commit: src/share/man/man9

2019-10-06 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Oct  6 17:21:28 UTC 2019

Modified Files:
src/share/man/man9: xcall.9

Log Message:
Use .Bl -tag -width Fn.  There's no such thing as -width compact
or, rather, there is, but the width specified is that of the word
"compact".


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 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.



CVS commit: src/share/man/man9

2019-10-06 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Oct  6 17:14:18 UTC 2019

Modified Files:
src/share/man/man9: xcall.9

Log Message:
Avoid using .Fn for XC_HIGHPRI_IPL as it looks inconsistent with
.Dv XC_HIGHPRI


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 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.13 src/share/man/man9/xcall.9:1.14
--- src/share/man/man9/xcall.9:1.13	Sun Oct  6 17:01:15 2019
+++ src/share/man/man9/xcall.9	Sun Oct  6 17:14:18 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: xcall.9,v 1.13 2019/10/06 17:01:15 uwe Exp $
+.\" $NetBSD: xcall.9,v 1.14 2019/10/06 17:14:18 uwe Exp $
 .\"
 .\" Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -112,15 +112,13 @@ on for the cross-call to complete.
 should be
 .Dv XC_HIGHPRI
 or
-.Fo XC_HIGHPRI_IPL
-.Fa ipl
-.Fc
+.Dv XC_HIGHPRI_IPL\| Ns Fn "" ipl
 for a "high priority" call, and 0 for a "low priority" call.
 .Dv XC_HIGHPRI
 uses an
 .Dv IPL_SOFTSERIAL
 software interrupt while
-.Fn XC_HIGHPRI_IPL
+.Dv XC_HIGHPRI_IPL
 uses a software interrupt with an IPL specified by
 .Fa ipl .
 .Fn xc_broadcast



CVS commit: src/share/man/man9

2019-10-06 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Oct  6 17:14:18 UTC 2019

Modified Files:
src/share/man/man9: xcall.9

Log Message:
Avoid using .Fn for XC_HIGHPRI_IPL as it looks inconsistent with
.Dv XC_HIGHPRI


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 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.



CVS commit: src/share/man/man9

2019-10-06 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Oct  6 17:01:16 UTC 2019

Modified Files:
src/share/man/man9: xcall.9

Log Message:
Format (*func)(arg1, arg2) so that "func" too is formatted as an
argument (the incantation is, admittedly, rather baroque and kludgy).


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 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.



CVS commit: src/share/man/man9

2019-10-06 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Oct  6 17:01:16 UTC 2019

Modified Files:
src/share/man/man9: xcall.9

Log Message:
Format (*func)(arg1, arg2) so that "func" too is formatted as an
argument (the incantation is, admittedly, rather baroque and kludgy).


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 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.12 src/share/man/man9/xcall.9:1.13
--- src/share/man/man9/xcall.9:1.12	Thu Feb  1 03:15:28 2018
+++ src/share/man/man9/xcall.9	Sun Oct  6 17:01:15 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: xcall.9,v 1.12 2018/02/01 03:15:28 ozaki-r Exp $
+.\" $NetBSD: xcall.9,v 1.13 2019/10/06 17:01:15 uwe Exp $
 .\"
 .\" Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -97,7 +97,7 @@ with other cross calls in the system.
 .Bl -tag -width compact
 .It Fn xc_broadcast "flags" "func" "arg1" "arg2"
 Call
-.Fo "(*func)"
+.Pf (* Fa func\| ) Ns Fo ""
 .Fa "arg1"
 .Fa "arg2"
 .Fc
@@ -129,7 +129,7 @@ should not be called from interrupt cont
 Like
 .Fn xc_broadcast ,
 but call
-.Fn "(*func)"
+.Fa func
 on only the CPU indicated by
 .Fa ci .
 .Fn xc_unicast



CVS commit: src/share/man/man9

2019-10-04 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Fri Oct  4 21:55:00 UTC 2019

Modified Files:
src/share/man/man9: panic.9

Log Message:
panic.9: add xrefs to printf(3) and printf(9)

printf(3) fmt strings are referenced in the body, and there might as
well be a cross-reference to other kernel message output functions.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/share/man/man9/panic.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-10-04 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Fri Oct  4 21:55:00 UTC 2019

Modified Files:
src/share/man/man9: panic.9

Log Message:
panic.9: add xrefs to printf(3) and printf(9)

printf(3) fmt strings are referenced in the body, and there might as
well be a cross-reference to other kernel message output functions.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/share/man/man9/panic.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/panic.9
diff -u src/share/man/man9/panic.9:1.22 src/share/man/man9/panic.9:1.23
--- src/share/man/man9/panic.9:1.22	Sun Jul 15 05:16:41 2018
+++ src/share/man/man9/panic.9	Fri Oct  4 21:55:00 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: panic.9,v 1.22 2018/07/15 05:16:41 maxv Exp $
+.\" $NetBSD: panic.9,v 1.23 2019/10/04 21:55:00 gutteridge Exp $
 .\"
 .\" Copyright (c) 1996 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, 2018
+.Dd October 4, 2019
 .Dt PANIC 9
 .Os
 .Sh NAME
@@ -104,9 +104,11 @@ The
 .Fn panic
 function never returns.
 .Sh SEE ALSO
+.Xr printf 3 ,
 .Xr sysctl 3 ,
 .Xr ddb 4 ,
 .Xr options 4 ,
 .Xr savecore 8 ,
 .Xr swapctl 8 ,
-.Xr sysctl 8
+.Xr sysctl 8 ,
+.Xr printf 9



CVS commit: src/share/man/man9

2019-09-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 28 15:11:20 UTC 2019

Modified Files:
src/share/man/man9: mstohz.9

Log Message:
document that mstohz take and return unsigned int


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/share/man/man9/mstohz.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-09-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 28 15:11:20 UTC 2019

Modified Files:
src/share/man/man9: mstohz.9

Log Message:
document that mstohz take and return unsigned int


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/share/man/man9/mstohz.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/mstohz.9
diff -u src/share/man/man9/mstohz.9:1.11 src/share/man/man9/mstohz.9:1.12
--- src/share/man/man9/mstohz.9:1.11	Thu Oct 20 06:36:42 2011
+++ src/share/man/man9/mstohz.9	Sat Sep 28 11:11:19 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mstohz.9,v 1.11 2011/10/20 10:36:42 wiz Exp $
+.\"	$NetBSD: mstohz.9,v 1.12 2019/09/28 15:11:19 christos Exp $
 .\"
 .\" Copyright (c) 2002 Manuel Bouyer.
 .\"
@@ -24,7 +24,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"
-.Dd October 20, 2011
+.Dd September 28, 2019
 .Dt MSTOHZ 9
 .Os
 .Sh NAME
@@ -33,10 +33,10 @@
 .Nd convert between milliseconds and system clock ticks
 .Sh SYNOPSIS
 .In sys/param.h
-.Ft int
-.Fn mstohz "int ms"
-.Ft int
-.Fn hztoms "int hz"
+.Ft unsigned int
+.Fn mstohz "unsigned int ms"
+.Ft unsigned int
+.Fn hztoms "unsigned int hz"
 .Sh DESCRIPTION
 The
 .Fn mstohz



CVS commit: src/share/man/man9

2019-09-12 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Sep 12 21:08:35 UTC 2019

Modified Files:
src/share/man/man9: bufferio.9

Log Message:
struct buf is typedefed to buf_t
specify the width argument for Bl


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/share/man/man9/bufferio.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-09-12 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Sep 12 21:08:35 UTC 2019

Modified Files:
src/share/man/man9: bufferio.9

Log Message:
struct buf is typedefed to buf_t
specify the width argument for Bl


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/share/man/man9/bufferio.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/bufferio.9
diff -u src/share/man/man9/bufferio.9:1.17 src/share/man/man9/bufferio.9:1.18
--- src/share/man/man9/bufferio.9:1.17	Sat Mar 18 19:01:01 2017
+++ src/share/man/man9/bufferio.9	Thu Sep 12 21:08:35 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: bufferio.9,v 1.17 2017/03/18 19:01:01 riastradh Exp $
+.\"	$NetBSD: bufferio.9,v 1.18 2019/09/12 21:08:35 sevan Exp $
 .\"
 .\" Copyright (c) 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 29, 2015
+.Dd September 12, 2019
 .Dt BUFFERIO 9
 .Os
 .Sh NAME
@@ -42,18 +42,18 @@
 .Sh SYNOPSIS
 .In sys/buf.h
 .Ft void
-.Fn biodone "struct buf *bp"
+.Fn biodone "buf_t *bp"
 .Ft int
-.Fn biowait "struct buf *bp"
-.Ft struct buf *
+.Fn biowait "buf_t *bp"
+.Ft buf_t *
 .Fn getiobuf "struct vnode *vp" "bool waitok"
 .Ft void
-.Fn putiobuf "struct buf *bp"
+.Fn putiobuf "buf_t *bp"
 .Ft void
-.Fn nestiobuf_setup "struct buf *mbp" "struct buf *bp" "int offset" \
+.Fn nestiobuf_setup "buf_t *mbp" "buf_t *bp" "int offset" \
 "size_t size"
 .Ft void
-.Fn nestiobuf_done "struct buf *mbp" "int donebytes" "int error"
+.Fn nestiobuf_done "buf_t *mbp" "int donebytes" "int error"
 .Sh DESCRIPTION
 The
 .Nm
@@ -82,10 +82,10 @@ The parameters to an I/O transfer descri
 are specified by the following
 .Vt "struct buf"
 fields:
-.Bl -tag -offset abcd
+.Bl -tag -width 6n -offset abcd
 .It Fa bp Ns Li "->b_flags"
 Flags specifying the type of transfer.
-.Bl -tag -compact
+.Bl -tag -width 6n -compact
 .It Dv B_READ
 Transfer is read from device.
 If not set, transfer is write to device.
@@ -283,10 +283,10 @@ member of
 .Pq Xr driver 9 ,
 to queue a buffer for disk I/O.
 The inputs to the strategy method are:
-.Bl -tag -offset abcd
+.Bl -tag -width 6n -offset abcd
 .It Fa bp Ns Li "->b_flags"
 Flags specifying the type of transfer.
-.Bl -tag -compact
+.Bl -tag -width 6n -compact
 .It Dv B_READ
 Transfer is read from device.
 If not set, transfer is write to device.
@@ -305,7 +305,7 @@ it must additionally initialize the foll
 .Fa bp
 with
 .Xr bufq_put 9 :
-.Bl -tag -offset abcd
+.Bl -tag -width 6n -offset abcd
 .It Fa bp Ns Li "->b_rawblkno"
 Block number relative to volume start.
 .El



CVS commit: src/share/man/man9

2019-09-12 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Sep 12 20:32:31 UTC 2019

Modified Files:
src/share/man/man9: physio.9

Log Message:
Update parameter list, struct buf is typedefed to buf_t


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/share/man/man9/physio.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-09-12 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Sep 12 20:32:31 UTC 2019

Modified Files:
src/share/man/man9: physio.9

Log Message:
Update parameter list, struct buf is typedefed to buf_t


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/share/man/man9/physio.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/physio.9
diff -u src/share/man/man9/physio.9:1.11 src/share/man/man9/physio.9:1.12
--- src/share/man/man9/physio.9:1.11	Tue Apr 13 10:06:43 2010
+++ src/share/man/man9/physio.9	Thu Sep 12 20:32:30 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: physio.9,v 1.11 2010/04/13 10:06:43 jruoho Exp $
+.\"	$NetBSD: physio.9,v 1.12 2019/09/12 20:32:30 sevan Exp $
 .\"
 .\" Copyright (c) 1996 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 13, 2010
+.Dd September 12, 2019
 .Dt PHYSIO 9
 .Os
 .Sh NAME
@@ -36,11 +36,11 @@
 .Sh SYNOPSIS
 .Ft int
 .Fo "physio"
-.Fa "(*strategy)(struct buf *)"
-.Fa "struct buf *bp"
+.Fa "void (*strategy)(buf_t *)"
+.Fa "buf_t *bp"
 .Fa "dev_t dev"
 .Fa "int flags"
-.Fa "(*minphys)(struct buf *)"
+.Fa "void (*minphys)(buf_t *)"
 .Fa "struct uio *uio"
 .Fc
 .Sh DESCRIPTION



CVS commit: src/share/man/man9

2019-09-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Sep  1 19:09:00 UTC 2019

Modified Files:
src/share/man/man9: intro.9

Log Message:
fetch(9) -> ufetch(9). Remove reference to unimplemented ppi(9).


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/share/man/man9/intro.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/intro.9
diff -u src/share/man/man9/intro.9:1.25 src/share/man/man9/intro.9:1.26
--- src/share/man/man9/intro.9:1.25	Sun Sep  1 17:50:32 2019
+++ src/share/man/man9/intro.9	Sun Sep  1 19:09:00 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: intro.9,v 1.25 2019/09/01 17:50:32 oster Exp $
+.\" $NetBSD: intro.9,v 1.26 2019/09/01 19:09:00 wiz Exp $
 .\"
 .\" Copyright (c) 1997, 2007 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -326,7 +326,7 @@ See
 .Pp
 Fetch data from user-space.
 See
-.Xr fetch 9 .
+.Xr ufetch 9 .
 .Pp
 Move data described by a struct uio.
 See
@@ -495,10 +495,6 @@ Support for PCMCIA PC-Card devices.
 See
 .Xr pcmcia 9 .
 .Pp
-User-space interface to ppbus parallel port.
-See
-.Xr ppi 9 .
-.Pp
 Interface between low and high level radio drivers.
 See
 .Xr radio 9 .



CVS commit: src/share/man/man9

2019-09-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Sep  1 19:09:00 UTC 2019

Modified Files:
src/share/man/man9: intro.9

Log Message:
fetch(9) -> ufetch(9). Remove reference to unimplemented ppi(9).


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/share/man/man9/intro.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-09-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Sep  1 19:08:23 UTC 2019

Modified Files:
src/share/man/man9: copy.9

Log Message:
fetch(9) -> ufetch(9)


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/share/man/man9/copy.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/copy.9
diff -u src/share/man/man9/copy.9:1.21 src/share/man/man9/copy.9:1.22
--- src/share/man/man9/copy.9:1.21	Sun Sep  1 17:50:32 2019
+++ src/share/man/man9/copy.9	Sun Sep  1 19:08:22 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: copy.9,v 1.21 2019/09/01 17:50:32 oster Exp $
+.\"	$NetBSD: copy.9,v 1.22 2019/09/01 19:08:22 wiz Exp $
 .\"
 .\" Copyright (c) 1996, 2002 Jason R. Thorpe.
 .\" All rights reserved.
@@ -176,5 +176,5 @@ if the string is longer than
 .Fa len
 bytes.
 .Sh SEE ALSO
-.Xr fetch 9 ,
+.Xr ufetch 9 ,
 .Xr ustore 9



CVS commit: src/share/man/man9

2019-09-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Sep  1 19:08:36 UTC 2019

Modified Files:
src/share/man/man9: uiomove.9

Log Message:
fetch(9) -> ufetch(9). Remove superfluous Pp.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/share/man/man9/uiomove.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/uiomove.9
diff -u src/share/man/man9/uiomove.9:1.19 src/share/man/man9/uiomove.9:1.20
--- src/share/man/man9/uiomove.9:1.19	Sun Sep  1 17:50:32 2019
+++ src/share/man/man9/uiomove.9	Sun Sep  1 19:08:35 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: uiomove.9,v 1.19 2019/09/01 17:50:32 oster Exp $
+.\"	$NetBSD: uiomove.9,v 1.20 2019/09/01 19:08:35 wiz Exp $
 .\"
 .\" Copyright (c) 1996 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -67,7 +67,6 @@ A
 .Va struct uio
 typically describes data in motion.
 Several of the fields described below reflect that expectation.
-.Pp
 .Bl -tag -width "uio_vmspace "
 .It Va uio_iov
 Pointer to array of
@@ -150,5 +149,5 @@ If a bad address is encountered,
 is returned.
 .Sh SEE ALSO
 .Xr copy 9 ,
-.Xr fetch 9 ,
+.Xr ufetch 9 ,
 .Xr ustore 9



CVS commit: src/share/man/man9

2019-09-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Sep  1 19:08:23 UTC 2019

Modified Files:
src/share/man/man9: copy.9

Log Message:
fetch(9) -> ufetch(9)


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/share/man/man9/copy.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-09-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Sep  1 19:08:36 UTC 2019

Modified Files:
src/share/man/man9: uiomove.9

Log Message:
fetch(9) -> ufetch(9). Remove superfluous Pp.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/share/man/man9/uiomove.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-09-01 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Sun Sep  1 17:50:32 UTC 2019

Modified Files:
src/share/man/man9: copy.9 intro.9 uiomove.9

Log Message:
s/Xr store/Xr ustore/ to fix cross-references in these man-pages.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/share/man/man9/copy.9
cvs rdiff -u -r1.24 -r1.25 src/share/man/man9/intro.9
cvs rdiff -u -r1.18 -r1.19 src/share/man/man9/uiomove.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-09-01 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Sun Sep  1 17:50:32 UTC 2019

Modified Files:
src/share/man/man9: copy.9 intro.9 uiomove.9

Log Message:
s/Xr store/Xr ustore/ to fix cross-references in these man-pages.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/share/man/man9/copy.9
cvs rdiff -u -r1.24 -r1.25 src/share/man/man9/intro.9
cvs rdiff -u -r1.18 -r1.19 src/share/man/man9/uiomove.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/copy.9
diff -u src/share/man/man9/copy.9:1.20 src/share/man/man9/copy.9:1.21
--- src/share/man/man9/copy.9:1.20	Thu Feb  8 09:03:23 2018
+++ src/share/man/man9/copy.9	Sun Sep  1 17:50:32 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: copy.9,v 1.20 2018/02/08 09:03:23 dholland Exp $
+.\"	$NetBSD: copy.9,v 1.21 2019/09/01 17:50:32 oster Exp $
 .\"
 .\" Copyright (c) 1996, 2002 Jason R. Thorpe.
 .\" All rights reserved.
@@ -177,4 +177,4 @@ if the string is longer than
 bytes.
 .Sh SEE ALSO
 .Xr fetch 9 ,
-.Xr store 9
+.Xr ustore 9

Index: src/share/man/man9/intro.9
diff -u src/share/man/man9/intro.9:1.24 src/share/man/man9/intro.9:1.25
--- src/share/man/man9/intro.9:1.24	Wed May  8 14:25:39 2019
+++ src/share/man/man9/intro.9	Sun Sep  1 17:50:32 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: intro.9,v 1.24 2019/05/08 14:25:39 isaki Exp $
+.\" $NetBSD: intro.9,v 1.25 2019/09/01 17:50:32 oster Exp $
 .\"
 .\" Copyright (c) 1997, 2007 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -322,7 +322,7 @@ See
 .Pp
 Store data to user-space.
 See
-.Xr store 9 .
+.Xr ustore 9 .
 .Pp
 Fetch data from user-space.
 See

Index: src/share/man/man9/uiomove.9
diff -u src/share/man/man9/uiomove.9:1.18 src/share/man/man9/uiomove.9:1.19
--- src/share/man/man9/uiomove.9:1.18	Mon Jul  3 21:28:48 2017
+++ src/share/man/man9/uiomove.9	Sun Sep  1 17:50:32 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: uiomove.9,v 1.18 2017/07/03 21:28:48 wiz Exp $
+.\"	$NetBSD: uiomove.9,v 1.19 2019/09/01 17:50:32 oster Exp $
 .\"
 .\" Copyright (c) 1996 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -151,4 +151,4 @@ is returned.
 .Sh SEE ALSO
 .Xr copy 9 ,
 .Xr fetch 9 ,
-.Xr store 9
+.Xr ustore 9



CVS commit: src/share/man/man9

2019-09-01 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Sep  1 14:49:11 UTC 2019

Modified Files:
src/share/man/man9: arp.9

Log Message:
Update arpresolve arguments


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/share/man/man9/arp.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-09-01 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Sep  1 14:49:11 UTC 2019

Modified Files:
src/share/man/man9: arp.9

Log Message:
Update arpresolve arguments


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/share/man/man9/arp.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/arp.9
diff -u src/share/man/man9/arp.9:1.26 src/share/man/man9/arp.9:1.27
--- src/share/man/man9/arp.9:1.26	Tue Sep 17 19:58:03 2013
+++ src/share/man/man9/arp.9	Sun Sep  1 14:49:11 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: arp.9,v 1.26 2013/09/17 19:58:03 wiz Exp $
+.\"	$NetBSD: arp.9,v 1.27 2019/09/01 14:49:11 sevan Exp $
 .\"
 .\" Copyright (c) 1997 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -28,7 +28,7 @@
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\"
-.Dd March 3, 1997
+.Dd September 1, 2019
 .Dt ARP 9
 .Os
 .Sh NAME
@@ -42,7 +42,7 @@
 .Ft void
 .Fn arp_ifinit "struct ifnet *ifp" "struct ifaddr *ifa"
 .Ft int
-.Fn arpresolve "struct ifnet *ifp" "struct rtentry *rt" "struct mbuf *m" "struct sockaddr *dst" "u_char *desten"
+.Fn arpresolve "struct ifnet *ifp" "const struct rtentry *rt" "struct mbuf *m" "const struct sockaddr *dst" "void *desten" "size_t destlen"
 .Ft void
 .Fn arpintr
 .Sh DESCRIPTION



CVS commit: src/share/man/man9

2019-08-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Aug 28 22:11:25 UTC 2019

Modified Files:
src/share/man/man9: thmap.9

Log Message:
Add RCS Id, sort sections.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 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.1 src/share/man/man9/thmap.9:1.2
--- src/share/man/man9/thmap.9:1.1	Wed Aug 28 20:08:11 2019
+++ src/share/man/man9/thmap.9	Wed Aug 28 22:11:25 2019
@@ -1,3 +1,4 @@
+.\" $NetBSD: thmap.9,v 1.2 2019/08/28 22:11:25 wiz Exp $
 .\"
 .\" Copyright (c) 2018 Mindaugas Rasiukevicius 
 .\" All rights reserved.
@@ -195,24 +196,6 @@ are
 void  (*free)(uintptr_t addr, size_t len);
 .Ed
 .\" -
-.Sh CAVEATS
-The implementation uses pointer tagging and atomic operations.
-This requires the base address and the allocations to provide at least word
-alignment.
-.Pp
-While the
-.Dv NULL
-values may be inserted,
-.Fn thmap_get
-and
-.Fn thmap_del
-cannot indicate whether the key was not found or a key with a
-.Dv NULL
-value was found.
-If the caller needs to indicate an "empty" value, it can use a
-special pointer value, such as
-.Li (void *)(uintptr_t)0x1 .
-.\" -
 .Sh EXAMPLES
 Simple case backed by
 .Xr malloc 3 ,
@@ -234,3 +217,21 @@ which could be used in multi-threaded en
 .\" -
 .Sh AUTHORS
 .An Mindaugas Rasiukevicius Aq Mt rm...@noxt.eu
+.Sh CAVEATS
+The implementation uses pointer tagging and atomic operations.
+This requires the base address and the allocations to provide at least word
+alignment.
+.Pp
+While the
+.Dv NULL
+values may be inserted,
+.Fn thmap_get
+and
+.Fn thmap_del
+cannot indicate whether the key was not found or a key with a
+.Dv NULL
+value was found.
+If the caller needs to indicate an "empty" value, it can use a
+special pointer value, such as
+.Li (void *)(uintptr_t)0x1 .
+.\" -



CVS commit: src/share/man/man9

2019-08-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Aug 28 22:11:25 UTC 2019

Modified Files:
src/share/man/man9: thmap.9

Log Message:
Add RCS Id, sort sections.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 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.



CVS commit: src/share/man/man9

2019-08-28 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Wed Aug 28 20:08:11 UTC 2019

Added Files:
src/share/man/man9: thmap.9

Log Message:
Add thmap(9) man page.  Reviewed by wiz@.
Forgot to commit it half a year ago.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 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.

Added files:

Index: src/share/man/man9/thmap.9
diff -u /dev/null src/share/man/man9/thmap.9:1.1
--- /dev/null	Wed Aug 28 20:08:11 2019
+++ src/share/man/man9/thmap.9	Wed Aug 28 20:08:11 2019
@@ -0,0 +1,236 @@
+.\"
+.\" Copyright (c) 2018 Mindaugas Rasiukevicius 
+.\" 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.
+.\"
+.Dd December 11, 2018
+.Dt THMAP 9
+.Os
+.Sh NAME
+.Nm thmap
+.Nd concurrent trie-hash map
+.Sh SYNOPSIS
+.In thmap.h
+.\" -
+.Ft thmap_t *
+.Fn thmap_create "uintptr_t baseptr" "const thmap_ops_t *ops" "unsigned flags"
+.Ft void
+.Fn thmap_destroy "thmap_t *hmap"
+.Ft void *
+.Fn thmap_get "thmap_t *hmap" "const void *key" "size_t len"
+.Ft void *
+.Fn thmap_put "thmap_t *hmap" "const void *key" "size_t len" "void *val"
+.Ft void *
+.Fn thmap_del "thmap_t *hmap" "const void *key" "size_t len"
+.Ft void *
+.Fn thmap_stage_gc "thmap_t *hmap"
+.Ft void
+.Fn thmap_gc "thmap_t *hmap" "void *ref"
+.Ft void
+.Fn thmap_setroot "thmap_t *thmap" "uintptr_t root_offset"
+.Ft uintptr_t
+.Fn thmap_getroot "const thmap_t *thmap"
+.\" -
+.Sh DESCRIPTION
+Concurrent trie-hash map \(em a general purpose associative array,
+combining the elements of hashing and radix trie.
+Highlights:
+.Pp
+.Bl -hyphen -compact
+.It
+Very competitive performance, with logarithmic time complexity on average.
+.It
+Lookups are lock-free and inserts/deletes are using fine-grained locking.
+.It
+Incremental growth of the data structure (no large resizing/rehashing).
+.It
+Optional support for use with shared memory, e.g. memory-mapped file.
+.El
+.Pp
+Delete operations (the key/data destruction) must be synchronized with
+the readers using some reclamation mechanism.
+.\" -
+.Sh FUNCTIONS
+.Bl -tag -width thmap_create
+.It Fn thmap_create
+Construct a new trie-hash map.
+The optional
+.Fa ops
+parameter can
+used to set the custom allocate/free operations (see the description of
+.Vt thmap_ops_t
+below).
+In such case, the
+.Fa baseptr
+is the base (start) address of the address space mapping (it must be
+word-aligned).
+If
+.Fa ops
+is set to
+.Dv NULL ,
+then
+.Xr malloc 3
+and
+.Xr free 3
+will be used as the default operations and
+.Fa baseptr
+should be set to zero.
+Currently, the supported
+.Fa flags
+are:
+.Bl -tag -width THMAP_NOCOPY
+.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;
+by default, the put operation will make a copy of the key.
+.It Dv THMAP_SETROOT
+Indicate that the root of the map will be manually set using the
+.Fn thmap_setroot
+routine;
+by default, the map is initialized and the root node is set on
+.Fn thmap_create .
+.El
+.\" ---
+.It Fn thmap_destroy
+Destroy the map, freeing the memory it uses.
+.\" ---
+.It Fn thmap_get
+Lookup the key (of a given length) and return the value associated with it.
+Return
+.Dv NULL
+if the key is not found (see the
+.Sx CAVEATS
+section).
+.\" ---
+.It Fn thmap_put
+Insert the key with an arbitrary value.
+If the key is already present, return the already existing associated value
+without changing it.
+Otherwise, on a successful insert, return the given value.
+Just compare the result against
+.Fa val
+to test whether the insert 

CVS commit: src/share/man/man9

2019-08-28 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Wed Aug 28 20:08:11 UTC 2019

Added Files:
src/share/man/man9: thmap.9

Log Message:
Add thmap(9) man page.  Reviewed by wiz@.
Forgot to commit it half a year ago.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 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.



CVS commit: src/share/man/man9

2019-08-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Aug 23 07:14:35 UTC 2019

Modified Files:
src/share/man/man9: usbnet.9

Log Message:
Mark up NULL. Capitalize NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 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.



CVS commit: src/share/man/man9

2019-08-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Aug 23 07:14:35 UTC 2019

Modified Files:
src/share/man/man9: usbnet.9

Log Message:
Mark up NULL. Capitalize NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 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.8 src/share/man/man9/usbnet.9:1.9
--- src/share/man/man9/usbnet.9:1.8	Fri Aug 23 05:37:05 2019
+++ src/share/man/man9/usbnet.9	Fri Aug 23 07:14:35 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: usbnet.9,v 1.8 2019/08/23 05:37:05 mrg Exp $
+.\"	$NetBSD: usbnet.9,v 1.9 2019/08/23 07:14:35 wiz Exp $
 .\"
 .\" Copyright (c) 2019 Matthew R. Green
 .\" All rights reserved.
@@ -399,7 +399,9 @@ will be used while waiting for final ref
 Final stage attach of usb network device.
 If the passed in
 .Fa unm
-is non-NULL then an MII interface will be created using the values
+is
+.Pf non- Dv NULL
+then an MII interface will be created using the values
 provided in the
 .Fa struct usbnet_mii
 structure, which has these members passed to
@@ -887,6 +889,6 @@ This
 interface first appeared in
 .Nx 9.0 .
 Portions of the original design are based upon ideas from
-.An Nick Hudson Aq Mt sk...@netbsd.org .
+.An Nick Hudson Aq Mt sk...@netbsd.org .
 .Sh AUTHORS
 .An Matthew R. Green Aq Mt m...@eterna.com.au



CVS commit: src/share/man/man9

2019-08-22 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 23 05:37:05 UTC 2019

Modified Files:
src/share/man/man9: usbnet.9

Log Message:
update for usbnet_mii and read/write reg return change.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 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.7 src/share/man/man9/usbnet.9:1.8
--- src/share/man/man9/usbnet.9:1.7	Thu Aug 15 08:37:13 2019
+++ src/share/man/man9/usbnet.9	Fri Aug 23 05:37:05 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: usbnet.9,v 1.7 2019/08/15 08:37:13 wiz Exp $
+.\"	$NetBSD: usbnet.9,v 1.8 2019/08/23 05:37:05 mrg 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 14, 2019
+.Dd August 22, 2019
 .Dt USBNET 9
 .Os
 .Sh NAME
@@ -104,7 +104,7 @@
 .Ft void
 .Fn usbnet_attach "struct usbnet *un" "const char *detname"
 .Ft void
-.Fn usbnet_attach_ifp "struct usbnet *un" "bool have_mii" "unsigned if_flags" "unsigned if_extflags" "int mii_flags"
+.Fn usbnet_attach_ifp "struct usbnet *un" "unsigned if_flags" "unsigned if_extflags" "const struct usbnet_mii *unm"
 .Ft int
 .Fn usbnet_detach "device_t dev" "int flags"
 .Ft int
@@ -395,13 +395,31 @@ Initial stage attach of a usb network de
 The
 .Fa detachname
 will be used while waiting for final references to drain when detaching.
-.It Fn usbnet_attach_ifp un have_mii if_flags if_extflags mii_flags
+.It Fn usbnet_attach_ifp un if_flags if_extflags unm
 Final stage attach of usb network device.
-If
-.Fa have_mii
-is true then an MII interface will be created and
-.Fa mii_flags
-added.
+If the passed in
+.Fa unm
+is non-NULL then an MII interface will be created using the values
+provided in the
+.Fa struct usbnet_mii
+structure, which has these members passed to
+.Fn mii_attach :
+.Bl -tag -width 4n
+.It un_mii_flags
+Flags.
+.It un_mii_capmask
+Capability mask.
+.It un_mii_phyloc
+PHY location.
+.It un_mii_offset
+PHY offset.
+.El
+.Pp
+A default
+.Fa unm
+can be set using the
+.Fn USBNET_MII_DECL_DEFAULT
+macro.
 The
 .Fa if_flags
 and
@@ -449,19 +467,19 @@ Initialize (bring up) interface.
 Required.
 Must call
 .Fn usbnet_rx_tx_init .
-.It Ft usbd_status Fn (*uno_read_reg) "struct usbnet *un" "int phy" "int reg" "uint16_t *val"
+.It Ft int Fn (*uno_read_reg) "struct usbnet *un" "int phy" "int reg" "uint16_t *val"
 Read MII register.
 Required with MII.
-.It Ft usbd_status Fn (*uno_write_reg) "struct usbnet *un" "int phy" "int reg" "uint16_t val"
+.It Ft int Fn (*uno_write_reg) "struct usbnet *un" "int phy" "int reg" "uint16_t val"
 Write MII register.
 Required with MII.
 .It Ft usbd_status Fn (*uno_statchg) "struct ifnet *ifp"
 Handle MII status change.
 Required with MII.
-.It Ft usbd_status Fn (*uno_tx_prepare) "struct usbnet *un" "struct mbuf *m" "struct usbnet_chain *c"
+.It Ft unsigned Fn (*uno_tx_prepare) "struct usbnet *un" "struct mbuf *m" "struct usbnet_chain *c"
 Prepare an mbuf for transmit.
 Required.
-.It Ft usbd_status Fn (*uno_rx_loop) "struct usbnet *un" "struct usbnet_chain *c" "uint32_t total_len"
+.It Ft void Fn (*uno_rx_loop) "struct usbnet *un" "struct usbnet_chain *c" "uint32_t total_len"
 Prepare one or more chain for enqueue.
 Required.
 .It Ft void Fn (*uno_intr) "struct usbnet *un" "usbd_status status"
@@ -495,6 +513,8 @@ and
 The Rx and Tx endpoints are required.
 .It un_phyno
 MII phy number.
+Not used by
+.Nm .
 .It un_eaddr
 6 bytes of Ethernet address that must be provided before calling
 .Fn usbnet_attach_ifp
@@ -594,8 +614,13 @@ enqueued with the higher layers using ei
 .Fn usbnet_enqueue
 (for most devices) or
 .Fn usbnet_input
-for devices that currently use
-.Fn if_input .
+for devices that use
+.Fn if_input
+(this currently relies upon the
+.Va struct ifnet
+having the
+.Dq _if_input
+member set as well, which is true for current consumers.)
 The Rx lock will be held during this call, see
 .Fn usbnet_lock_rx
 and
@@ -637,12 +662,12 @@ must be provided:
 .Bl -tag -width 4n
 .It uno_read_reg
 Read an MII register for a particular PHY.
-Returns
-.Xr usbd_status 9 .
+Returns standard
+.Xr errno 2 .
 .It uno_write_reg
 Write an MII register for a particular PHY.
-Returns
-.Xr usbd_status 9 .
+Returns standard
+.Xr errno 2 .
 .It uno_statchg
 Handle a status change event for this interface.
 .El
@@ -789,13 +814,6 @@ These functions are called with the MII 
 .Dq Fn usbnet_isowned_mii ) ,
 and do not require any checking for running, or up, or dying devices
 unless they drop and retake the MII lock.
-Their return value is changed from
-.Vt int
-to
-.Vt usbd_status
-and should use
-.Dv USBD_NORMAL_COMPLETION
-for success.
 Local
 .Dq link
 variables need to be replaced with accesses to
@@ -868,5 +886,7 @@ This
 .Nm
 interface 

CVS commit: src/share/man/man9

2019-08-22 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 23 05:37:05 UTC 2019

Modified Files:
src/share/man/man9: usbnet.9

Log Message:
update for usbnet_mii and read/write reg return change.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 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.



CVS commit: src/share/man/man9

2019-08-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Aug 15 08:37:13 UTC 2019

Modified Files:
src/share/man/man9: usbnet.9

Log Message:
Fix Xr usage.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 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.



CVS commit: src/share/man/man9

2019-08-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Aug 15 08:37:13 UTC 2019

Modified Files:
src/share/man/man9: usbnet.9

Log Message:
Fix Xr usage.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 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.6 src/share/man/man9/usbnet.9:1.7
--- src/share/man/man9/usbnet.9:1.6	Thu Aug 15 08:33:14 2019
+++ src/share/man/man9/usbnet.9	Thu Aug 15 08:37:13 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: usbnet.9,v 1.6 2019/08/15 08:33:14 mrg Exp $
+.\"	$NetBSD: usbnet.9,v 1.7 2019/08/15 08:37:13 wiz Exp $
 .\"
 .\" Copyright (c) 2019 Matthew R. Green
 .\" All rights reserved.
@@ -442,7 +442,7 @@ structure which contains these members:
 Stop interface (optional.)
 .It Ft int Fn (*uno_ioctl) "struct ifnet *ifp" "u_long cmd" "void *data"
 Simple ioctl callback (optional.)
-.It Ft int Fn (*uno_override_ioctl "struct ifnet *ifp" "u_long cmd" "void *data"
+.It Ft int Fn (*uno_override_ioctl) "struct ifnet *ifp" "u_long cmd" "void *data"
 Full ioctl callback (optional.)
 .It Ft int Fn (*uno_init) "struct ifnet *ifp"
 Initialize (bring up) interface.
@@ -597,9 +597,9 @@ enqueued with the higher layers using ei
 for devices that currently use
 .Fn if_input .
 The Rx lock will be held during this call, see
-.Xr Fn usbnet_lock_rx
+.Fn usbnet_lock_rx
 and
-.Xr Fn usbnet_unlock_rx .
+.Fn usbnet_unlock_rx .
 .Pp
 The
 .Fn uno_tx_prepare
@@ -615,9 +615,9 @@ more than the chain buffer size, as set 
 member.
 This callback is only called once per packet.
 The Tx lock will be held during this call, see
-.Xr Fn usbnet_lock_tx
+.Fn usbnet_lock_tx
 and
-.Xr Fn usbnet_unlock_tx .
+.Fn usbnet_unlock_tx .
 .Pp
 The
 .Fa struct usbnet_chain
@@ -648,9 +648,9 @@ Handle a status change event for this in
 .El
 The read and write callbacks are called with the MII lock held.
 See
-.Xr usbnet_lock_mii
+.Fn usbnet_lock_mii
 and
-.Xr usbnet_unlock_mii .
+.Fn usbnet_unlock_mii .
 .Sh INTERRUPT PIPE
 The interrupt specific callback,
 .Dq uno_intr ,



CVS commit: src/share/man/man9

2019-08-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug 15 08:33:14 UTC 2019

Modified Files:
src/share/man/man9: usbnet.9

Log Message:
- document locking requirements more
- expand uno_foo() docs to include return type and parameters
- expand uno_intr() docs
- add uno_tick()
- fix various typoes


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 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.



CVS commit: src/share/man/man9

2019-08-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug 15 08:33:14 UTC 2019

Modified Files:
src/share/man/man9: usbnet.9

Log Message:
- document locking requirements more
- expand uno_foo() docs to include return type and parameters
- expand uno_intr() docs
- add uno_tick()
- fix various typoes


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 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.5 src/share/man/man9/usbnet.9:1.6
--- src/share/man/man9/usbnet.9:1.5	Mon Aug 12 00:01:23 2019
+++ src/share/man/man9/usbnet.9	Thu Aug 15 08:33:14 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: usbnet.9,v 1.5 2019/08/12 00:01:23 mrg Exp $
+.\"	$NetBSD: usbnet.9,v 1.6 2019/08/15 08:33:14 mrg 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 11, 2019
+.Dd August 14, 2019
 .Dt USBNET 9
 .Os
 .Sh NAME
@@ -346,6 +346,7 @@ on PHY number
 .Fa phy
 and return the value in
 .Fa valp .
+Called with the MII lock held.
 .It Fn usbnet_mii_writereg dev phy reg val
 Write register
 .Fa reg
@@ -353,9 +354,11 @@ on PHY number
 .Fa phy
 with
 .Fa val .
+Called with the MII lock held.
 .It Fn usbnet_mii_statchg ifp
 Trigger a status change update for interface
-.Fa ifp
+.Fa ifp .
+Unlike register access, called with the MII lock not held.
 .El
 .Pp
 Buffer enqueue handling for
@@ -435,34 +438,36 @@ Points to a
 .Va struct usbnet_ops
 structure which contains these members:
 .Bl -tag -width 4n
-.It uno_stop
+.It Ft void Fn (*uno_stop) "struct ifnet *ifp" "int disable"
 Stop interface (optional.)
-.It uno_ioctl
+.It Ft int Fn (*uno_ioctl) "struct ifnet *ifp" "u_long cmd" "void *data"
 Simple ioctl callback (optional.)
-.It uno_override_ioctl
+.It Ft int Fn (*uno_override_ioctl "struct ifnet *ifp" "u_long cmd" "void *data"
 Full ioctl callback (optional.)
-.It uno_init
+.It Ft int Fn (*uno_init) "struct ifnet *ifp"
 Initialize (bring up) interface.
 Required.
 Must call
 .Fn usbnet_rx_tx_init .
-.It uno_read_reg
+.It Ft usbd_status Fn (*uno_read_reg) "struct usbnet *un" "int phy" "int reg" "uint16_t *val"
 Read MII register.
 Required with MII.
-.It uno_write_reg
+.It Ft usbd_status Fn (*uno_write_reg) "struct usbnet *un" "int phy" "int reg" "uint16_t val"
 Write MII register.
 Required with MII.
-.It uno_statchg
+.It Ft usbd_status Fn (*uno_statchg) "struct ifnet *ifp"
 Handle MII status change.
 Required with MII.
-.It uno_tx_prepare
+.It Ft usbd_status Fn (*uno_tx_prepare) "struct usbnet *un" "struct mbuf *m" "struct usbnet_chain *c"
 Prepare an mbuf for transmit.
 Required.
-.It uno_rx_loop
+.It Ft usbd_status Fn (*uno_rx_loop) "struct usbnet *un" "struct usbnet_chain *c" "uint32_t total_len"
 Prepare one or more chain for enqueue.
 Required.
-.It uno_intr
+.It Ft void Fn (*uno_intr) "struct usbnet *un" "usbd_status status"
 Process periodic interrupt (optional.)
+.It Ft void Fn (*uno_tick) "struct usbnet *un"
+Called every second with USB task thread context (optional.)
 .El
 .It un_intr
 Points to a
@@ -473,7 +478,7 @@ structure which should have these member
 If
 .Pf non- Dv NULL ,
 points to a buffer passed to
-Fn usbd_open_pipe_intr
+.Fn usbd_open_pipe_intr
 in the device init callback, along with the size and interval.
 .It uni_intr_bufsz
 Size of interrupt pipe buffer.
@@ -483,10 +488,10 @@ Frequency of the interrupt in millisecon
 .It un_ed
 Array of endpoint descriptors.
 There indexes are provided:
-.Dq USBNET_ENDPT_RX ,
-.Dq USBNET_ENDPT_TX ,
+.Dv USBNET_ENDPT_RX ,
+.Dv USBNET_ENDPT_TX ,
 and
-.Dq USBNET_ENDPT_INTR .
+.Dv USBNET_ENDPT_INTR .
 The Rx and Tx endpoints are required.
 .It un_phyno
 MII phy number.
@@ -567,6 +572,8 @@ The optional
 .Fn uno_stop
 callback performs device-specific operations to shutdown the
 transmit or receive handling.
+.Fn uno_stop
+will be called with the usbnet lock held.
 .Pp
 The
 .Fn uno_init
@@ -589,6 +596,10 @@ enqueued with the higher layers using ei
 .Fn usbnet_input
 for devices that currently use
 .Fn if_input .
+The Rx lock will be held during this call, see
+.Xr Fn usbnet_lock_rx
+and
+.Xr Fn usbnet_unlock_rx .
 .Pp
 The
 .Fn uno_tx_prepare
@@ -603,6 +614,10 @@ more than the chain buffer size, as set 
 .Dq un_tx_bufsz
 member.
 This callback is only called once per packet.
+The Tx lock will be held during this call, see
+.Xr Fn usbnet_lock_tx
+and
+.Xr Fn usbnet_unlock_tx .
 .Pp
 The
 .Fa struct usbnet_chain
@@ -631,6 +646,11 @@ Returns
 .It uno_statchg
 Handle a status change event for this interface.
 .El
+The read and write callbacks are called with the MII lock held.
+See
+.Xr usbnet_lock_mii
+and
+.Xr usbnet_unlock_mii .
 .Sh INTERRUPT PIPE
 The interrupt specific callback,
 .Dq uno_intr ,
@@ -641,6 +661,10 @@ using the
 

CVS commit: src/share/man/man9

2019-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 12 00:01:23 UTC 2019

Modified Files:
src/share/man/man9: usbnet.9

Log Message:
remove mention of dv_private and note that usbnet must be first.
fix Ethernet capitalisation in one place.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 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.



CVS commit: src/share/man/man9

2019-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 12 00:01:23 UTC 2019

Modified Files:
src/share/man/man9: usbnet.9

Log Message:
remove mention of dv_private and note that usbnet must be first.
fix Ethernet capitalisation in one place.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 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.4 src/share/man/man9/usbnet.9:1.5
--- src/share/man/man9/usbnet.9:1.4	Sun Aug 11 22:03:16 2019
+++ src/share/man/man9/usbnet.9	Mon Aug 12 00:01:23 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: usbnet.9,v 1.4 2019/08/11 22:03:16 wiz Exp $
+.\"	$NetBSD: usbnet.9,v 1.5 2019/08/12 00:01:23 mrg Exp $
 .\"
 .\" Copyright (c) 2019 Matthew R. Green
 .\" All rights reserved.
@@ -152,11 +152,9 @@ that will be described below.
 For autoconfiguration the device attach routine is expected to
 ensure that this device's
 .Va struct usbnet
-is set to the device
-.Fa dv_private ,
-if it can not be used directly as the device softc, as well as set
-up the necessary structure members, find end-points, find the
-Ethernet address if relevant, call
+is the first member of the device softc, if it can not be used directly
+as the device softc, as well as set up the necessary structure members,
+find end-points, find the Ethernet address if relevant, call
 .Fn usbnet_attach ,
 set up interface, Ethernet, and MII capabilities, and finally call
 .Fn usbnet_attach_ifp .
@@ -682,7 +680,7 @@ The majority of the driver's existing
 structure can likely be replaced with usage of
 .Va struct usbnet
 and its related functionality.
-This includes at least the device_t pointer, ethernet address, the
+This includes at least the device_t pointer, Ethernet address, the
 ethercom and mii_data structures, end point descriptors, usbd device,
 interface, and task and callout structures (both these probably go
 away entirely) and all the associated watchdog handling,



CVS commit: src/share/man/man9

2019-08-11 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 11 22:03:16 UTC 2019

Modified Files:
src/share/man/man9: usbnet.9

Log Message:
Minor fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 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.



CVS commit: src/share/man/man9

2019-08-11 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 11 22:03:16 UTC 2019

Modified Files:
src/share/man/man9: usbnet.9

Log Message:
Minor fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 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.3 src/share/man/man9/usbnet.9:1.4
--- src/share/man/man9/usbnet.9:1.3	Sun Aug 11 21:33:08 2019
+++ src/share/man/man9/usbnet.9	Sun Aug 11 22:03:16 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: usbnet.9,v 1.3 2019/08/11 21:33:08 mrg Exp $
+.\"	$NetBSD: usbnet.9,v 1.4 2019/08/11 22:03:16 wiz Exp $
 .\"
 .\" Copyright (c) 2019 Matthew R. Green
 .\" All rights reserved.
@@ -755,7 +755,8 @@ framework handles pipes and transfers an
 The
 .Nm
 framework provides four locks for the system: normal device/softc lock,
-receive and transmit locks, and the MII lock.  The normal locking order
+receive and transmit locks, and the MII lock.
+The normal locking order
 for these locks is ifnet lock -> usbnet lock -> usbnet rxlock -> usbne
 txlock, or, ifnet lock -> usbnet lock -> MII lock.
 .It MII handling
@@ -767,9 +768,9 @@ These functions are called with the MII 
 and do not require any checking for running, or up, or dying devices
 unless they drop and retake the MII lock.
 Their return value is changed from
-.Fr int
+.Vt int
 to
-.Fr usbd_status
+.Vt usbd_status
 and should use
 .Dv USBD_NORMAL_COMPLETION
 for success.
@@ -781,7 +782,7 @@ and
 .Fn usbnet_havelink .
 Other ifmedia callbacks that were passed to
 .Fn ifmedia_init
-should be deleted and any work moved into 
+should be deleted and any work moved into
 .Dq uno_statchg .
 .It Receive and Transmit
 The
@@ -816,8 +817,11 @@ Be sure to call
 .Fn usbent_set_link
 during any status change event.
 .Pp
-Many locking issues are hidden without LOCKDEBUG, including hard-hangs.
-It's highly recommended to develop with LOCKDEBUG.
+Many locking issues are hidden without
+.Dv LOCKDEBUG ,
+including hard-hangs.
+It's highly recommended to develop with
+.Dv LOCKDEBUG .
 .Pp
 The
 .Va usbnet
@@ -826,7 +830,6 @@ array is unsigned and should use
 .Dq 0
 as the no-endpoint value.
 .El
-.Pp
 .Sh SEE ALSO
 .Xr usb 4 ,
 .Xr driver 9 ,



CVS commit: src/share/man/man9

2019-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 11 21:33:09 UTC 2019

Modified Files:
src/share/man/man9: usbnet.9

Log Message:
minor rewording of a few places and add a new section to describe
the type of changes required to port a driver to usbnet interfaces.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 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.



CVS commit: src/share/man/man9

2019-08-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 11 21:33:09 UTC 2019

Modified Files:
src/share/man/man9: usbnet.9

Log Message:
minor rewording of a few places and add a new section to describe
the type of changes required to port a driver to usbnet interfaces.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 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.2 src/share/man/man9/usbnet.9:1.3
--- src/share/man/man9/usbnet.9:1.2	Sun Aug 11 08:26:46 2019
+++ src/share/man/man9/usbnet.9	Sun Aug 11 21:33:08 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: usbnet.9,v 1.2 2019/08/11 08:26:46 wiz Exp $
+.\"	$NetBSD: usbnet.9,v 1.3 2019/08/11 21:33:08 mrg 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 10, 2019
+.Dd August 11, 2019
 .Dt USBNET 9
 .Os
 .Sh NAME
@@ -599,6 +599,11 @@ callback must convert the provided
 into the provided
 .Va struct usbnet_chain
 performing any device-specific padding, checksum, header or other.
+Note that this callback must check that it is not attempting to copy
+more than the chain buffer size, as set in the
+.Va usbnet
+.Dq un_tx_bufsz
+member.
 This callback is only called once per packet.
 .Pp
 The
@@ -638,16 +643,190 @@ using the
 function (instead of the
 .Fn usbd_open_pipe
 function.)
-To enable the
-.Dq uno_intr
-callback the
+To enable the this callback point the
 .Va struct usbnet
 member
 .Dq un_intr
-must point to a
+to a
 .Va struct usbnet_intr
-structure that has the data buffer, size and interval to be passed to
+structure with these members set:
+.Bl -tag -width 4n
+.It uni_buf
+Data buffer for interrupt status relies.
+.It uni_bufsz
+Size of the above buffer.
+.It uni_interval
+Interval in millieconds.
+.El
+.Pp
+These values will be passed to
 .Fn usbd_open_pipe_intr .
+.Sh CONVERTING OLD-STYLE DRIVERS
+The porting of an older driver to the
+.Nm
+framework is largely an effort in deleting code.
+The process involves making these changes:
+.Bl -tag -width 4n
+.It Headers
+Many headers are included in
+.Pa usbnet.h
+and can be removed from the driver, as well as headers no longer used,
+such as
+.Pa callout.h
+and
+.Pa rndsource.h ,
+etc.
+.It Device softc
+The majority of the driver's existing
+.Dq softc
+structure can likely be replaced with usage of
+.Va struct usbnet
+and its related functionality.
+This includes at least the device_t pointer, ethernet address, the
+ethercom and mii_data structures, end point descriptors, usbd device,
+interface, and task and callout structures (both these probably go
+away entirely) and all the associated watchdog handling,
+timevals, list size, buffer size and xfer flags for
+both Rx, and Tx, and interrupt notices, interface flags, device link,
+PHY number, chain data, locks including Rx, Tx, MII, and the
+base softc lock.
+There is a driver-only
+.Dq un_flags
+in the
+.Va usbnet
+structure available for drivers to use.
+.Pp
+Many drivers can use the
+.Va usbnet
+structure as the device private storage passed to
+.Dv CFATTACH_DECL_NEW .
+Many internal functions to the driver may look better if switched to
+operate on the device's
+.Va usbnet
+as, for example, the
+.Va usbd_device
+value is now available (and must be set by the driver) in the
+.Va usbnet ,
+which may be needed for any call to
+.Fn usbd_do_request .
+The standard endpoint values must be stored in the
+.Nm
+.Dq un_ed[]
+array.
+.Pp
+As
+.Nm
+manages xfer chains all code related to the opening, closing, aborting
+and transferring of data on pipes is performed by the framework based
+upon the buffer size and more provided in
+.Va subnet ,
+so all code related to them should be deleted.
+.It Interface setup
+The vast majority of interface specific code should be deleted.
+For device-specific interface values, the
+.Va ifnet
+flags and exflags can be set, as well as the
+.Va ethercom
+.Dq ec_capabilities
+member, before calling
+.Fn usbnet_attach_ifp .
+All calls to
+.Fn ifmedia_init ,
+.Fn mii_attach ,
+.Fn ifmedia_add ,
+.Fn ifmedia_set ,
+.Fn if_attach ,
+.Fn ether_ifattach ,
+.Fn rnd_attach_source ,
+and
+.Fn usbd_add_drv_event
+should be eliminated.
+The device
+.Dq ioctl
+routine can use the default handling with a callback for additional
+device specific programming (multicast filters, etc.), which can be
+empty, or, the override ioctl can be used for heavier requirements.
+The device
+.Dq stop
+routine is replaced with a simple call that turns off the
+device-specific transmitter and receiver if necessary, as the
+framework handles pipes and transfers and buffers.
+.It Device locking
+The
+.Nm
+framework provides four locks for the system: normal device/softc lock,
+receive and transmit locks, and the 

CVS commit: src/share/man/man9

2019-08-11 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 11 08:26:46 UTC 2019

Modified Files:
src/share/man/man9: usbnet.9

Log Message:
Various fixes: Pp cleanup, use more macros, sort sections,
fix typos, Americanize spelling (like other man pages), fix macro arguments.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 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.1 src/share/man/man9/usbnet.9:1.2
--- src/share/man/man9/usbnet.9:1.1	Sat Aug 10 20:35:35 2019
+++ src/share/man/man9/usbnet.9	Sun Aug 11 08:26:46 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: usbnet.9,v 1.1 2019/08/10 20:35:35 mrg Exp $
+.\"	$NetBSD: usbnet.9,v 1.2 2019/08/11 08:26:46 wiz Exp $
 .\"
 .\" Copyright (c) 2019 Matthew R. Green
 .\" All rights reserved.
@@ -31,7 +31,7 @@
 .Os
 .Sh NAME
 .Nm usbnet
-.Nd common USB ethernet driver framework
+.Nd common USB Ethernet driver framework
 .Sh SYNOPSIS
 .In dev/usb/usbnet.h
 .Ss Functions offered by usbnet.h
@@ -114,10 +114,9 @@
 .Sh DESCRIPTION
 The
 .Nm
-framework provides methods usable for USB ethernet drivers.
+framework provides methods usable for USB Ethernet drivers.
 The framework has support for these features:
-.Pp
-.Bl -tag -width "123456"
+.Bl -bullet -offset 8n
 .It
 Partial autoconf handling
 .It
@@ -129,7 +128,7 @@ Generic handlers or support for several 
 .It
 MII bus locking
 .It
-Interrupt handling  
+Interrupt handling
 .El
 .Pp
 .Nm
@@ -139,7 +138,7 @@ members inside
 .Va struct usbnet ,
 which can be used directly as the device softc structure if
 no additional storage is required.
-An structure exists for receive and transmit chain management,
+A structure exists for receive and transmit chain management,
 .Va struct usbnet_chain ,
 that tracks the metadata for each transfer descriptor available,
 minimum of one each for Rx and Tx slot, and will be passed
@@ -157,9 +156,9 @@ is set to the device
 .Fa dv_private ,
 if it can not be used directly as the device softc, as well as set
 up the necessary structure members, find end-points, find the
-ethernet address if relevant, call
+Ethernet address if relevant, call
 .Fn usbnet_attach ,
-setup interface, ethernet, and MII capabilities, and finally call
+set up interface, Ethernet, and MII capabilities, and finally call
 .Fn usbnet_attach_ifp .
 The device detach routine should free any resources allocated
 by attach and then call
@@ -177,9 +176,9 @@ To manage all Rx and Tx chains the
 .Dq uno_init
 callback of
 .Va struct usbnet_ops
-should perform any device specific initialisation and then call
+should perform any device specific initialization and then call
 .Fn usbnet_init_rx_tx
-which will allocate chains, setup and open pipes, and start the
+which will allocate chains, set up and open pipes, and start the
 Rx transfers so that packets can arrived.
 These allocations and pipes can be closed and destroyed by calling
 .Fn usbnet_stop .
@@ -191,7 +190,7 @@ must be called with the
 .Nm
 lock held, see
 .Fn usbnet_lock
-and 
+and
 .Fn usbnet_unlock .
 See the
 .Sx RECEIVE AND SEND
@@ -199,11 +198,11 @@ section for details on using the chains.
 .Pp
 The interface init, ioctl, start, and stop, routines are handled by the
 framework with callbacks for device-specific handling.
-For interface init (ie, when bringing the interface up), the
+For interface init (i.e., when bringing the interface up), the
 .Dq uno_init
-callback should perform any device specific initialisation and then call
+callback should perform any device specific initialization and then call
 .Fn usbnet_init_rx_tx
-to finalise Rx and Tx queue initialisation.
+to finalize Rx and Tx queue initialization.
 For interface ioctl, most of the handling is in the framework and the
 optional
 .Dq uno_ioctl
@@ -228,11 +227,11 @@ For devices requiring MII handling there
 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
-internal code that also requires serialised access to registers with the 
+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 ,
-and 
+and
 .Fn usbnet_unlock_mii_un_locked
 functions.
 These functions handle device detach events safely, and as such take
@@ -252,7 +251,7 @@ the network frame up the stack via eithe
 .Fn usbnet_enqueue
 or
 .Fn usbnet_input .
-Typically ethernet devices prefer
+Typically Ethernet devices prefer
 .Fn usbnet_enqueue .
 .Pp
 General accessor functions for
@@ -295,11 +294,10 @@ Returns true if device is dying (has bee
 pending detach.)
 .El
 .Pp
-
 Lock handling functions for
 .Fa struct usbnet :
 .Pp
-.Bl -compact -tag -width 4n
+.Bl -tag -width 4n -compact
 .It Fn usbnet_lock un
 .It Fn 

CVS commit: src/share/man/man9

2019-08-11 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 11 08:26:46 UTC 2019

Modified Files:
src/share/man/man9: usbnet.9

Log Message:
Various fixes: Pp cleanup, use more macros, sort sections,
fix typos, Americanize spelling (like other man pages), fix macro arguments.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 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.



CVS commit: src/share/man/man9

2019-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Aug 10 23:33:10 UTC 2019

Modified Files:
src/share/man/man9: Makefile

Log Message:
oops. i must have deleted the 'u' in 'ustore.9' when partially
fixing the alphabeta ordering here.  fixes build.


To generate a diff of this commit:
cvs rdiff -u -r1.438 -r1.439 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.438 src/share/man/man9/Makefile:1.439
--- src/share/man/man9/Makefile:1.438	Sat Aug 10 20:35:35 2019
+++ src/share/man/man9/Makefile	Sat Aug 10 23:33:10 2019
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.438 2019/08/10 20:35:35 mrg Exp $
+#   $NetBSD: Makefile,v 1.439 2019/08/10 23:33:10 mrg Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -53,14 +53,13 @@ MAN=	accept_filter.9 accf_data.9 accf_ht
 	SET.9 setbit.9 setjmp.9 shutdownhook_establish.9 \
 	signal.9 skpc.9 sockopt.9 softintr.9 spl.9 specificdata.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 \
 	ts2timo.9 tvtohz.9 \
 	ubc.9 ucas.9 ucom.9 ufetch.9 uiomove.9 \
 	usbd_status.9 usbdi.9 usbnet.9 \
-	userret.9 \
+	userret.9 ustore.9 \
 	uvm.9 uvm_hotplug.9 uvm_km.9 uvm_map.9 \
 	vattr.9 veriexec.9 vcons.9 vfs.9 vfs_hooks.9 vfsops.9 vfssubr.9 \
 	video.9 vme.9 vnfileops.9 vnode.9 vnodeops.9 vnsubr.9 vmem.9  \



CVS commit: src/share/man/man9

2019-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Aug 10 23:33:10 UTC 2019

Modified Files:
src/share/man/man9: Makefile

Log Message:
oops. i must have deleted the 'u' in 'ustore.9' when partially
fixing the alphabeta ordering here.  fixes build.


To generate a diff of this commit:
cvs rdiff -u -r1.438 -r1.439 src/share/man/man9/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-08-07 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Aug  8 00:20:54 UTC 2019

Modified Files:
src/share/man/man9: rasops.9

Log Message:
Try to improve formatting and naration.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/share/man/man9/rasops.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/rasops.9
diff -u src/share/man/man9/rasops.9:1.18 src/share/man/man9/rasops.9:1.19
--- src/share/man/man9/rasops.9:1.18	Wed Aug  7 13:46:02 2019
+++ src/share/man/man9/rasops.9	Thu Aug  8 00:20:54 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: rasops.9,v 1.18 2019/08/07 13:46:02 rin Exp $
+.\" $NetBSD: rasops.9,v 1.19 2019/08/08 00:20:54 uwe Exp $
 .\"
 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -42,6 +42,9 @@
 .Fn rasops_init "struct rasops_info *ri" "int wantrows" "int wantcols"
 .Ft int
 .Fn rasops_reconfig "struct rasops_info *ri" "int wantrows" "int wantcols"
+.Pp
+.Cd options RASOPS_DEFAULT_WIDTH=80
+.Cd options RASOPS_DEFAULT_HEIGHT=25
 .Sh DESCRIPTION
 The
 .Nm
@@ -49,15 +52,15 @@ subsystem is a set of raster operations 
 .Xr wscons 9 .
 .Pp
 The primary data type for using the raster operations is the
-.Em rasops_info
+.Vt rasops_info
 structure in
-.Pa dev/rasops/rasops.h .
+.In dev/rasops/rasops.h .
 .Pp
 Valid values for the
-.Em ri_flg
+.Fa ri_flg
 member are:
 .Pp
-.Bl -tag -offset indent -width RI_ENABLE_ALPHA_XX -compact
+.Bl -tag -width ".Dv RI_ENABLE_ALPHA" -offset indent -compact
 .It Dv RI_FULLCLEAR
 .Fn eraserows
 hack to clear full screen
@@ -81,56 +84,47 @@ do not generate box drawing characters f
 Use this when it is not safe to allocate memory, for example when setting up
 an early console.
 .It Dv RI_ENABLE_ALPHA
-set this if the caller supports anti-aliased fonts in the given colour depth.
+the caller supports anti-aliased fonts in the given colour depth.
 Without this flag
 .Fn rasops_init
 will only pick bitmap fonts.
 .It Dv RI_8BIT_IS_RGB
-set this if the caller uses an R3G3B2 colour map in 8 bit.
+the caller uses an R3G3B2 colour map in 8 bit.
 .Fn rasops_init
-will generate an appropriate ri_devcmap[] but the caller still needs to set up
-the actual colour map.
+will generate an appropriate
+.Fa ri_devcmap Ns Li []
+but the caller still needs to set up the actual colour map.
 .El
 .Sh FUNCTIONS
-.Bl -tag -width compact
-.It Fn rasops_init "ri" "wantrows" "wantcols"
-Initialise a
-.Em rasops_info
+.Fn rasops_init
+initialises a
+.Vt rasops_info
 descriptor.
+.Fn rasops_reconfig
+is used to reconfigure it if parameters have changed in some way.
+.Pp
 The arguments
 .Fa wantrows
 and
 .Fa wantcols
 are the number of rows and columns we'd like.
-In terms of optimization, bitmap fonts of width
-.Bl -item -offset indent -compact
-.It
-8 or 16 (all depths)
-.It
-12 (depths other than 1)
-.El
-work the best.
-.It Fn rasops_reconfig "ri" "wantrows" "wantcols"
-Reconfigure a
-.Em rasops_info
-descriptor because parameters have changed in some way.
-The arguments
-.Fa wantrows
+Passing zero for either one of them uses the default \(em normally
+80 by 25 but it can be changed with config options
+.Dv RASOPS_DEFAULT_WIDTH
 and
-.Fa wantcols
-are the number of rows and columns we'd like.
-Passing zero for either one of
-them uses the default - normally 80x25 but it can be changed with
-.Bd -literal -offset indent -compact
-options RASOPS_DEFAULT_WIDTH=80
-options RASOPS_DEFAULT_HEIGHT=25
-.Ed
+.Dv RASOPS_DEFAULT_HEIGHT .
+.Pp
+In terms of optimization, bitmap fonts of width 8 or 16 work the best
+for all depths.
+For depths other than 1 the fonts of width 12 are also optimized.
+.Pp
 If calling
 .Fn rasops_reconfig
-to change the font and ri_wsfcookie \*[Ge] 0, you must call
+to change the font and
+.Fa ri_wsfcookie
+is non-negative, you must call
 .Fn wsfont_unlock
-on it, and reset it to -1 (or a new, valid cookie).
-.El
+on it, and reset it to \-1 or a new, valid cookie.
 .Sh CODE REFERENCES
 The rasops subsystem is implemented within the directory
 .Pa sys/dev/rasops .



CVS commit: src/share/man/man9

2019-08-07 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Aug  8 00:20:54 UTC 2019

Modified Files:
src/share/man/man9: rasops.9

Log Message:
Try to improve formatting and naration.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/share/man/man9/rasops.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-08-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Aug  7 19:58:50 UTC 2019

Modified Files:
src/share/man/man9: sysctl.9

Log Message:
Fix previous: Link to module(9). Suggested by pgoyette.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/share/man/man9/sysctl.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-08-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Aug  7 19:58:50 UTC 2019

Modified Files:
src/share/man/man9: sysctl.9

Log Message:
Fix previous: Link to module(9). Suggested by pgoyette.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/share/man/man9/sysctl.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/sysctl.9
diff -u src/share/man/man9/sysctl.9:1.22 src/share/man/man9/sysctl.9:1.23
--- src/share/man/man9/sysctl.9:1.22	Wed Aug  7 19:16:36 2019
+++ src/share/man/man9/sysctl.9	Wed Aug  7 19:58:50 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysctl.9,v 1.22 2019/08/07 19:16:36 wiz Exp $
+.\"	$NetBSD: sysctl.9,v 1.23 2019/08/07 19:58:50 wiz Exp $
 .\"
 .\" Copyright (c) 2004 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -564,7 +564,7 @@ The address of the function is added to 
 .Fn sysctl_init
 traverses during initialization.
 For loadable kernel modules (see
-.Xr module 7 ) ,
+.Xr module 9 ) ,
 the list of functions is called from the module loader after the module's
 initialization routine.
 Any sysctl nodes created for the loadable module are removed using



CVS commit: src/share/man/man9

2019-08-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Aug  7 19:16:36 UTC 2019

Modified Files:
src/share/man/man9: sysctl.9

Log Message:
Remove Pp in wrong places. Fix Xref.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/share/man/man9/sysctl.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/sysctl.9
diff -u src/share/man/man9/sysctl.9:1.21 src/share/man/man9/sysctl.9:1.22
--- src/share/man/man9/sysctl.9:1.21	Wed Aug  7 13:22:00 2019
+++ src/share/man/man9/sysctl.9	Wed Aug  7 19:16:36 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysctl.9,v 1.21 2019/08/07 13:22:00 pgoyette Exp $
+.\"	$NetBSD: sysctl.9,v 1.22 2019/08/07 19:16:36 wiz Exp $
 .\"
 .\" Copyright (c) 2004 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -164,7 +164,6 @@ which function to call to handle the spe
 The following algorithm is used by
 .Fn sysctl_dispatch
 to determine the function to call:
-.Pp
 .Bl -bullet -offset indent
 .It
 Scan the tree using
@@ -189,7 +188,6 @@ call the appropriate function.
 If none of these options applies and no other error was yet recorded,
 return
 .Er EOPNOTSUPP .
-.Pp
 .El
 The
 .Fa oldp
@@ -566,7 +564,7 @@ The address of the function is added to 
 .Fn sysctl_init
 traverses during initialization.
 For loadable kernel modules (see
-.Xr modules 9 ) ,
+.Xr module 7 ) ,
 the list of functions is called from the module loader after the module's
 initialization routine.
 Any sysctl nodes created for the loadable module are removed using



CVS commit: src/share/man/man9

2019-08-07 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Aug  7 19:16:36 UTC 2019

Modified Files:
src/share/man/man9: sysctl.9

Log Message:
Remove Pp in wrong places. Fix Xref.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/share/man/man9/sysctl.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-08-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Aug  7 13:46:02 UTC 2019

Modified Files:
src/share/man/man9: rasops.9

Log Message:
- Stop showing struct rasops_info; readers can read the header itself.
- Correct description for optimized font widths.
- Remove strange blank line.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/share/man/man9/rasops.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-08-07 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Aug  7 13:22:00 UTC 2019

Modified Files:
src/share/man/man9: sysctl.9

Log Message:
Document interaction of SYSCTL_SETUP functions and the module loader.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/share/man/man9/sysctl.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/sysctl.9
diff -u src/share/man/man9/sysctl.9:1.20 src/share/man/man9/sysctl.9:1.21
--- src/share/man/man9/sysctl.9:1.20	Mon Jul  3 21:28:48 2017
+++ src/share/man/man9/sysctl.9	Wed Aug  7 13:22:00 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysctl.9,v 1.20 2017/07/03 21:28:48 wiz Exp $
+.\"	$NetBSD: sysctl.9,v 1.21 2019/08/07 13:22:00 pgoyette Exp $
 .\"
 .\" Copyright (c) 2004 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 4, 2011
+.Dd August 7, 2019
 .Dt SYSCTL 9
 .Os
 .Sh NAME
@@ -547,7 +547,7 @@ specifically ignores any arguments given
 .Fa oldlenp
 to zero, and returns success.
 .Sh SETUP FUNCTIONS
-Though nodes can be added to the SYSCTL tree at any time, in order to
+Although nodes can be added to the SYSCTL tree at any time, in order to
 add nodes during the kernel bootstrap phase, a proper
 .Dq setup
 function must be used.
@@ -561,9 +561,17 @@ See the
 kernel configuration in
 .Xr options 4 .
 .Pc
+.Pp
 The address of the function is added to a list of functions that
 .Fn sysctl_init
 traverses during initialization.
+For loadable kernel modules (see
+.Xr modules 9 ) ,
+the list of functions is called from the module loader after the module's
+initialization routine.
+Any sysctl nodes created for the loadable module are removed using
+.Fn sysctl_teardown
+before calling the module's termination code.
 .Pp
 Setup functions do not have to add nodes to the main tree, but can set
 up their own trees for emulation or other purposes.



CVS commit: src/share/man/man9

2019-08-07 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Aug  7 13:22:00 UTC 2019

Modified Files:
src/share/man/man9: sysctl.9

Log Message:
Document interaction of SYSCTL_SETUP functions and the module loader.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/share/man/man9/sysctl.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-07-07 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Sun Jul  7 21:24:20 UTC 2019

Modified Files:
src/share/man/man9: cnmagic.9

Log Message:
cnmagic.9: add xref to ddb(4), and minor grammatical fixes


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/share/man/man9/cnmagic.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-07-07 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Sun Jul  7 21:24:20 UTC 2019

Modified Files:
src/share/man/man9: cnmagic.9

Log Message:
cnmagic.9: add xref to ddb(4), and minor grammatical fixes


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/share/man/man9/cnmagic.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/cnmagic.9
diff -u src/share/man/man9/cnmagic.9:1.15 src/share/man/man9/cnmagic.9:1.16
--- src/share/man/man9/cnmagic.9:1.15	Mon Jul  3 21:28:48 2017
+++ src/share/man/man9/cnmagic.9	Sun Jul  7 21:24:20 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: cnmagic.9,v 1.15 2017/07/03 21:28:48 wiz Exp $
+.\" $NetBSD: cnmagic.9,v 1.16 2019/07/07 21:24:20 gutteridge Exp $
 .\"
 .\" Copyright (c) 2000 Eduardo Horvath
 .\" All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\" --(license Id: LICENSE.proto,v 1.1 2000/06/13 21:40:26 cgd Exp )--
 .\"
-.Dd June 8, 2010
+.Dd July 7, 2019
 .Dt CNMAGIC 9
 .Os
 .Sh NAME
@@ -73,7 +73,7 @@ A different
 .Va cnm_state_t
 should be used for each separate input stream.
 Multiple devices that share the same input stream, such as USB
-keyboards can share the same
+keyboards, can share the same
 .Va cnm_state_t .
 Once a
 .Va cnm_state_t
@@ -145,7 +145,7 @@ points to is no longer needed.
 .Fn cn_set_magic
 encodes a
 .Li nul
-terminated string arbitrary string into values that can be used by
+terminated arbitrary string into values that can be used by
 the state machine and installs it as the global magic sequence.
 The escape sequence is character value
 .Li 0x27
@@ -180,6 +180,7 @@ Returns
 on success or a non-zero error value.
 .El
 .Sh SEE ALSO
+.Xr ddb 4 ,
 .Xr sysctl 8 ,
 .Xr cons 9
 .Sh HISTORY



CVS commit: src/share/man/man9

2019-06-12 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jun 12 13:53:25 UTC 2019

Modified Files:
src/share/man/man9: audio.9

Log Message:
Remove superfluous Pp.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 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.55 src/share/man/man9/audio.9:1.56
--- src/share/man/man9/audio.9:1.55	Wed Jun 12 13:14:31 2019
+++ src/share/man/man9/audio.9	Wed Jun 12 13:53:25 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: audio.9,v 1.55 2019/06/12 13:14:31 isaki Exp $
+.\"	$NetBSD: audio.9,v 1.56 2019/06/12 13:53:25 wiz Exp $
 .\"
 .\" Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -514,7 +514,6 @@ Don't set it if the device is unidirecti
 is handled in the upper layer, so new drivers should not return this property.
 .El
 It is called in the Attach phase.
-.Pp
 .It Dv int trigger_output(void *hdl, void *start, void *end,
 .Dv "int blksize, void (*intr)(void*), void *intrarg,"
 .Pp



CVS commit: src/share/man/man9

2019-06-12 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jun 12 13:53:25 UTC 2019

Modified Files:
src/share/man/man9: audio.9

Log Message:
Remove superfluous Pp.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 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.



CVS commit: src/share/man/man9

2019-06-12 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Wed Jun 12 13:14:32 UTC 2019

Modified Files:
src/share/man/man9: audio.9

Log Message:
Describe about get_props() properties.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 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.54 src/share/man/man9/audio.9:1.55
--- src/share/man/man9/audio.9:1.54	Thu May  9 09:35:18 2019
+++ src/share/man/man9/audio.9	Wed Jun 12 13:14:31 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: audio.9,v 1.54 2019/05/09 09:35:18 wiz Exp $
+.\"	$NetBSD: audio.9,v 1.55 2019/06/12 13:14:31 isaki Exp $
 .\"
 .\" Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -496,12 +496,25 @@ which the hardware driver can then chang
 E.g., DMA on the ISA bus cannot exceed 65536 bytes.
 It is called in the Attached or Closed phases.
 .It Dv int get_props(void *hdl)
-Should return the device properties; i.e., a combination of
-AUDIO_PROP_xxx.
-It is called at any time.
+Should return the device properties in a combination of following flags:
+.Pp
+.Bl -tag -width AUDIO_PROP_INDEPENDENT -compact
+.It Dv AUDIO_PROP_PLAYBACK
+the device is capable of audio playback.
+.It Dv AUDIO_PROP_CAPTURE
+the device is capable of audio capture.
+.It Dv AUDIO_PROP_FULLDUPLEX
+the device admits full duplex operation.
+Don't set it if the device is unidirectional.
+.It Dv AUDIO_PROP_INDEPENDENT
+the device can set the playing and recording encoding parameters
+independently.
+Don't set it if the device is unidirectional.
+.It Dv AUDIO_PROP_MMAP
+is handled in the upper layer, so new drivers should not return this property.
+.El
+It is called in the Attach phase.
 .Pp
-.Dv AUDIO_PROP_MMAP
-is acceptable but obsolete, so new drivers should not return this property.
 .It Dv int trigger_output(void *hdl, void *start, void *end,
 .Dv "int blksize, void (*intr)(void*), void *intrarg,"
 .Pp



CVS commit: src/share/man/man9

2019-06-12 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Wed Jun 12 13:14:32 UTC 2019

Modified Files:
src/share/man/man9: audio.9

Log Message:
Describe about get_props() properties.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 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.



CVS commit: src/share/man/man9

2019-05-21 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue May 21 09:24:21 UTC 2019

Modified Files:
src/share/man/man9: kprintf.9

Log Message:
Fix some typos and remove cargo-cult quoting.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/share/man/man9/kprintf.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/kprintf.9
diff -u src/share/man/man9/kprintf.9:1.38 src/share/man/man9/kprintf.9:1.39
--- src/share/man/man9/kprintf.9:1.38	Mon May 20 20:25:09 2019
+++ src/share/man/man9/kprintf.9	Tue May 21 09:24:21 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: kprintf.9,v 1.38 2019/05/20 20:25:09 christos Exp $
+.\" $NetBSD: kprintf.9,v 1.39 2019/05/21 09:24:21 wiz Exp $
 .\"
 .\" Copyright (c) 1998, 2002, 2007, 2011 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -35,7 +35,7 @@
 .Nm printf ,
 .Nm printf_nolog ,
 .Nm snprintf ,
-.Nm vasrintf ,
+.Nm vasprintf ,
 .Nm vprintf ,
 .Nm vsnprintf ,
 .Nm uprintf ,
@@ -63,62 +63,62 @@
 .Sh SYNOPSIS
 .In sys/systm.h
 .Ft void
-.Fn "device_printf" "device_t" "const char *format" "..."
+.Fn device_printf "device_t" "const char *format" "..."
 .Ft void
-.Fn "printf" "const char *format" "..."
+.Fn printf "const char *format" "..."
 .Ft void
-.Fn "printf_nolog" "const char *format" "..."
+.Fn printf_nolog "const char *format" "..."
 .Ft int
-.Fn "snprintf" "char *buf" "size_t size" "const char *format" "..."
+.Fn snprintf "char *buf" "size_t size" "const char *format" "..."
 .Ft int
-.Fn "vasprintf" "char **buf" "const char *format" "va_list ap"
+.Fn vasprintf "char **buf" "const char *format" "va_list ap"
 .Ft void
-.Fn "vprintf" "const char *format" "va_list ap"
+.Fn vprintf "const char *format" "va_list ap"
 .Ft int
-.Fn "vsnprintf" "char *buf" "size_t size" "const char *format" "va_list ap"
+.Fn vsnprintf "char *buf" "size_t size" "const char *format" "va_list ap"
 .Ft void
-.Fn "uprintf" "const char *format" "..."
+.Fn uprintf "const char *format" "..."
 .Ft void
-.Fn "ttyprintf" "struct tty *tty" "const char *format" "..."
+.Fn ttyprintf "struct tty *tty" "const char *format" "..."
 .In sys/tprintf.h
 .Ft tpr_t
-.Fn "tprintf_open" "struct proc *p"
+.Fn tprintf_open "struct proc *p"
 .Ft void
-.Fn "tprintf" "tpr_t tpr" "const char *format" "..."
+.Fn tprintf "tpr_t tpr" "const char *format" "..."
 .Ft void
-.Fn "tprintf_close" "tpr_t tpr"
+.Fn tprintf_close "tpr_t tpr"
 .Ft void
-.Fn "aprint_normal" "const char *format" "..."
+.Fn aprint_normal "const char *format" "..."
 .Ft void
-.Fn "aprint_naive" "const char *format" "..."
+.Fn aprint_naive "const char *format" "..."
 .Ft void
-.Fn "aprint_verbose" "const char *format" "..."
+.Fn aprint_verbose "const char *format" "..."
 .Ft void
-.Fn "aprint_debug" "const char *format" "..."
+.Fn aprint_debug "const char *format" "..."
 .Ft void
-.Fn "aprint_error" "const char *format" "..."
+.Fn aprint_error "const char *format" "..."
 .Ft void
-.Fn "aprint_normal_dev" "device_t" "const char *format" "..."
+.Fn aprint_normal_dev "device_t" "const char *format" "..."
 .Ft void
-.Fn "aprint_naive_dev" "device_t" "const char *format" "..."
+.Fn aprint_naive_dev "device_t" "const char *format" "..."
 .Ft void
-.Fn "aprint_verbose_dev" "device_t" "const char *format" "..."
+.Fn aprint_verbose_dev "device_t" "const char *format" "..."
 .Ft void
-.Fn "aprint_debug_dev" "device_t" "const char *format" "..."
+.Fn aprint_debug_dev "device_t" "const char *format" "..."
 .Ft void
-.Fn "aprint_error_dev" "device_t" "const char *format" "..."
+.Fn aprint_error_dev "device_t" "const char *format" "..."
 .Ft void
-.Fn "aprint_normal_ifnet" "struct ifnet *" "const char *format" "..."
+.Fn aprint_normal_ifnet "struct ifnet *" "const char *format" "..."
 .Ft void
-.Fn "aprint_naive_ifnet" "struct ifnet *" "const char *format" "..."
+.Fn aprint_naive_ifnet "struct ifnet *" "const char *format" "..."
 .Ft void
-.Fn "aprint_verbose_ifnet" "struct ifnet *" "const char *format" "..."
+.Fn aprint_verbose_ifnet "struct ifnet *" "const char *format" "..."
 .Ft void
-.Fn "aprint_debug_ifnet" "struct ifnet *" "const char *format" "..."
+.Fn aprint_debug_ifnet "struct ifnet *" "const char *format" "..."
 .Ft void
-.Fn "aprint_error_ifnet" "struct ifnet *" "const char *format" "..."
+.Fn aprint_error_ifnet "struct ifnet *" "const char *format" "..."
 .Ft int
-.Fn "aprint_get_error_count" "void"
+.Fn aprint_get_error_count "void"
 .Sh DESCRIPTION
 The
 .Fn printf
@@ -142,7 +142,7 @@ function is identical to
 except it does not send the data to the system log.
 The functions
 .Fn snprintf ,
-.Fn vasprintf
+.Fn vasprintf ,
 and
 .Fn vsnprintf
 write output to a string buffer.
@@ -152,8 +152,8 @@ The
 .Fn vasprintf
 function allocates memory with
 .Xr kmem_alloc 9
-and it is the callers responsibility to free the returned string with
-.Cr kmem_free .
+and it is the caller's responsibility to free the returned string with

CVS commit: src/share/man/man9

2019-05-21 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue May 21 09:24:21 UTC 2019

Modified Files:
src/share/man/man9: kprintf.9

Log Message:
Fix some typos and remove cargo-cult quoting.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/share/man/man9/kprintf.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-05-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May 20 20:25:09 UTC 2019

Modified Files:
src/share/man/man9: kprintf.9

Log Message:
document vasprintf


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/share/man/man9/kprintf.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-05-18 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Sat May 18 10:21:03 UTC 2019

Modified Files:
src/share/man/man9: secmodel_securelevel.9

Log Message:
Don't mention SVS because it can't be changed anymore.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/share/man/man9/secmodel_securelevel.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man/man9

2019-05-18 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Sat May 18 10:21:03 UTC 2019

Modified Files:
src/share/man/man9: secmodel_securelevel.9

Log Message:
Don't mention SVS because it can't be changed anymore.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/share/man/man9/secmodel_securelevel.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/secmodel_securelevel.9
diff -u src/share/man/man9/secmodel_securelevel.9:1.18 src/share/man/man9/secmodel_securelevel.9:1.19
--- src/share/man/man9/secmodel_securelevel.9:1.18	Sun Jul 15 05:16:41 2018
+++ src/share/man/man9/secmodel_securelevel.9	Sat May 18 10:21:03 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: secmodel_securelevel.9,v 1.18 2018/07/15 05:16:41 maxv Exp $
+.\" $NetBSD: secmodel_securelevel.9,v 1.19 2019/05/18 10:21:03 alnsn Exp $
 .\"
 .\" Copyright (c) 2006 Elad Efrat 
 .\" Copyright (c) 2000 Hugh Graham
@@ -26,7 +26,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 May 18, 2019
 .Dt SECMODEL_SECURELEVEL 9
 .Os
 .Sh NAME
@@ -132,8 +132,6 @@ Access to unmanaged memory is denied.
 Only GPIO pins that have been set at
 .Em securelevel
 0 can be accessed.
-.It
-SVS (Separate Virtual Space) may not be disabled on platforms that support it.
 .El
 .It \ 2 Em Highly secure mode
 .Bl -bullet



Re: CVS commit: src/share/man/man9

2018-09-20 Thread Rin Okuyama

- pci_intr_setattr() is in pci_intr(9)


Sorry it should be pci_intr_disestablish(), not pci_intr_setattr()...

rin

On 2018/09/20 16:08, Rin Okuyama wrote:

Module Name:src
Committed By:   rin
Date:   Thu Sep 20 07:08:00 UTC 2018

Modified Files:
src/share/man/man9: pci.9

Log Message:
- pci_intr_setattr() is in pci_intr(9)
- pci_intr_type() is in pci_msi(9)


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/share/man/man9/pci.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.9
diff -u src/share/man/man9/pci.9:1.47 src/share/man/man9/pci.9:1.48
--- src/share/man/man9/pci.9:1.47   Wed Sep 12 09:45:59 2018
+++ src/share/man/man9/pci.9Thu Sep 20 07:08:00 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: pci.9,v 1.47 2018/09/12 09:45:59 mrg Exp $
+.\" $NetBSD: pci.9,v 1.48 2018/09/20 07:08:00 rin Exp $
  .\"
  .\" Copyright (c) 2001, 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 September 12, 2018
+.Dd September 20, 2018
  .Dt PCI 9
  .Os
  .Sh NAME
@@ -689,10 +689,10 @@ See
  .Xr pci_intr 9 .
  .It Fn pci_intr_disestablish "pc" "ih"
  See
-.Xr pci_msi 9 .
+.Xr pci_intr 9 .
  .It Fn pci_intr_type "pc" "ih"
  See
-.Xr pci_intr 9 .
+.Xr pci_msi 9 .
  .It Fn pci_intr_setattr "pc" "ih" "attr" "data"
  See
  .Xr pci_intr 9 .



Re: CVS commit: src/share/man/man9

2017-12-08 Thread David Holland
On Fri, Dec 08, 2017 at 03:52:01PM +, Taylor R Campbell wrote:
 > Modified Files:
 >  src/share/man/man9: mutex.9
 > 
 > Log Message:
 > Specify memory ordering implied by mutex_(spin_)enter/exit.
 > 
 > I'm hesitant to just say `implies membar_enter/exit' -- that may be a
 > little stronger than we intend, since we don't really mean to
 > guarantee anything about loads and stores before the mutex_enter or
 > after the mutex_exit.  But we probably end up implementing the
 > semantics that we imply membar_enter/exit on all CPUs.

The definition of membar_enter and membar_exit is the way it is to
make the stores involved in *doing* the enter and exit work. This
should not really be exposed outside the mutex code... on some
processors it's possible to order those stores with the ones "inside"
without affecting anyone else.

So I would say that the problem here is in the way membar_enter/exit
are defined; or rather, that they're called that (which is confusing
anyway) rather than e.g. membar_store_any() and membar_any_store().

-- 
David A. Holland
dholl...@netbsd.org


Re: CVS commit: src/share/man/man9

2017-10-16 Thread Valery Ushakov
On Mon, Oct 16, 2017 at 18:40:19 +, co...@sdf.org wrote:

> On Mon, Oct 16, 2017 at 04:53:17PM +0300, Valery Ushakov wrote:
> > On Mon, Oct 16, 2017 at 11:53:00 +, Maya Rashish wrote:
> > > Modified Files:
> > >   src/share/man/man9: byteorder.9
> > > 
> > > Log Message:
> > > Suggest to include the POSIX  rather than BSD 
> > 
> > Section 9 is kernel internals, so  is the correct header.
> > Please revert.
> 
> It's also in the wrong section.

It's not.  Userland functions have their own man page in section 3.

-uwe


Re: CVS commit: src/share/man/man9

2017-10-16 Thread coypu
On Mon, Oct 16, 2017 at 04:53:17PM +0300, Valery Ushakov wrote:
> On Mon, Oct 16, 2017 at 11:53:00 +, Maya Rashish wrote:
> > Modified Files:
> > src/share/man/man9: byteorder.9
> > 
> > Log Message:
> > Suggest to include the POSIX  rather than BSD 
> 
> Section 9 is kernel internals, so  is the correct header.
> Please revert.

It's also in the wrong section.


Re: CVS commit: src/share/man/man9

2017-10-16 Thread Valery Ushakov
On Mon, Oct 16, 2017 at 11:53:00 +, Maya Rashish wrote:
> Modified Files:
>   src/share/man/man9: byteorder.9
> 
> Log Message:
> Suggest to include the POSIX  rather than BSD 

Section 9 is kernel internals, so  is the correct header.
Please revert.

-uwe


Re: CVS commit: src/share/man/man9

2016-07-06 Thread Kengo NAKAHARA
Hi,

On 2016/07/06 18:20, Abhinav Upadhyay wrote:
> Module Name:  src
> Committed By: abhinav
> Date: Wed Jul  6 09:20:42 UTC 2016
> 
> Modified Files:
>   src/share/man/man9: interrupt_distribute.9
> 
> Log Message:
> Add missing .Nd
> 
> ok wiz@, knakaraha@
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.1 -r1.2 src/share/man/man9/interrupt_distribute.9

Thank you for your fixes.


Thanks,

-- 
//
Internet Initiative Japan Inc.

Device Engineering Section,
IoT Platform Development Department,
Network Division,
Technology Unit

Kengo NAKAHARA 


Re: CVS commit: src/share/man/man9

2015-04-20 Thread Taylor R Campbell
   Date: Mon, 20 Apr 2015 16:14:08 +0200
   From: Thomas Klausner w...@netbsd.org

   On Mon, Apr 20, 2015 at 02:09:14PM +, Taylor R Campbell wrote:
Module Name:   src
Committed By:  riastradh
Date:  Mon Apr 20 14:09:14 UTC 2015

Modified Files:
   src/share/man/man9: vnode.9

Log Message:
Use Dv, not Li, for EBUSY/ENOENT.

   Actually, there even is a separate 'Er' macro for error codes.

Ah, thanks.  I'll apply that when I finish some other reworking of
vnode(9).


Re: CVS commit: src/share/man/man9

2015-04-20 Thread Thomas Klausner
On Mon, Apr 20, 2015 at 02:09:14PM +, Taylor R Campbell wrote:
 Module Name:  src
 Committed By: riastradh
 Date: Mon Apr 20 14:09:14 UTC 2015
 
 Modified Files:
   src/share/man/man9: vnode.9
 
 Log Message:
 Use Dv, not Li, for EBUSY/ENOENT.

Actually, there even is a separate 'Er' macro for error codes.
 Thomas


Re: CVS commit: src/share/man/man9

2014-07-25 Thread David Holland
On Fri, Jul 25, 2014 at 08:38:29AM +, Thomas Klausner wrote:
  Modified Files:
   src/share/man/man9: vnodeops.9
  
  Log Message:
  New sentence, new line. Punctuation formatting nits.

Woops, sorry about that.

-- 
David A. Holland
dholl...@netbsd.org


Re: CVS commit: src/share/man/man9

2012-10-01 Thread David Holland
On Mon, Oct 01, 2012 at 06:16:36PM +, Nicolas Joly wrote:
  Modified Files:
   src/share/man/man9: vnodeops.9
  
  Log Message:
  Update _PC_NO_TRUNC description to add the returned value, and
  replace non-existant KERN_NAME_MAX with {NAME_MAX}.

It is not nonexistent, it's KERNEL_NAME_MAX.

-- 
David A. Holland
dholl...@netbsd.org


  1   2   >