CVS commit: src/share/man/man2

2019-05-24 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat May 25 05:11:14 UTC 2019

Modified Files:
src/share/man/man2: siginfo.2

Log Message:
Document TRAP_SCE and TRAP_SCX in siginfo(2)


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/share/man/man2/siginfo.2

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/man2/siginfo.2
diff -u src/share/man/man2/siginfo.2:1.22 src/share/man/man2/siginfo.2:1.23
--- src/share/man/man2/siginfo.2:1.22	Fri Feb 17 01:14:31 2017
+++ src/share/man/man2/siginfo.2	Sat May 25 05:11:14 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: siginfo.2,v 1.22 2017/02/17 01:14:31 kamil Exp $
+.\"	$NetBSD: siginfo.2,v 1.23 2019/05/25 05:11:14 kamil Exp $
 .\"
 .\" Copyright (c) 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 January 14, 2017
+.Dd May 25, 2019
 .Dt SIGINFO 2
 .Os
 .Sh NAME
@@ -237,6 +237,10 @@ Process hardware debug register trap
 Process exec trap
 .It TRAP_LWP
 Process LWP trap
+.It TRAP_SCE
+Process syscall entry trap
+.It TRAP_SCX
+Process syscall exit trap
 .It TRAP_TRACE
 Process trace trap
 .El
@@ -273,9 +277,11 @@ High priority input available
 .El
 .Pp
 For
-.Dv SIGILL , SIGFPE ,
+.Dv SIGILL ,
+.Dv SIGFPE , 
+.Dv SIGBUS
 and
-.Dv SIGTRAP
+.Dv SIGSEGV
 the
 .Nm
 structure contains the following additional members:
@@ -285,14 +291,17 @@ int si_trap;
 .Ed
 .Pp
 .Fa si_addr
-contains the address of the faulting instruction and
+contains the address of the faulting instruction or data and
 .Fa si_trap
 contains a hardware specific reason.
 .Pp
 For
-.Dv SIGBUS
+.Dv SIGTRAP
 and
-.Dv SIGSEGV
+.Dv TRAP_BRKPT ,
+.Dv TRAP_TRACE
+or
+.Dv TRAP_DBREG
 the
 .Nm
 structure contains the following additional members:
@@ -306,10 +315,34 @@ contains the address of the faulting dat
 .Fa si_trap
 contains a hardware specific reason.
 .Pp
-For some architectures
-the value of
-.Fa si_addr
-may be inaccurate.
+For
+.Dv SIGTRAP
+and
+.Dv TRAP_SCE
+or
+.Dv TRAP_SCX
+the
+.Nm
+structure contains the following additional members:
+.Bd -literal -offset indent
+int si_sysnum;
+int si_retval[2];
+int si_error;
+uint64_t si_args[8];
+.Ed
+.Pp
+.Fa si_sysnum
+contains the syscall number,
+.Fa si_retval
+contains the syscall return value (meaningful for
+.Dv TRAP_SCX
+only),
+.Fa si_error
+contains the syscall error value (meaningful for
+.Dv TRAP_SCX
+only) and
+.Fa si_args[8]
+contains the syscall arguments,
 .Pp
 For
 .Dv SIGIO
@@ -374,9 +407,11 @@ extensions.
 The
 .Dv TRAP_CHLD ,
 .Dv TRAP_DBREG ,
-.Dv TRAP_EXEC
+.Dv TRAP_EXEC ,
+.Dv TRAP_LWP ,
+.Dv TRAP_SCE
 and
-.Dv TRAP_LWP
+.Dv TRAP_SCX
 signal specific reasons of
 .Dv SIGTRAP
 are
@@ -390,9 +425,18 @@ functionality first appeared in
 .Pp
 .Dv TRAP_CHLD ,
 .Dv TRAP_DBREG ,
-.Dv TRAP_EXEC
+.Dv TRAP_EXEC ,
+.Dv TRAP_LWP ,
+.Dv TRAP_SCE
 and
-.Dv TRAP_LWP
+.Dv TRAP_SCX
 first appeared
 in
 .Nx 8 .
+.Pp
+The additional parameters with syscall information in
+.Dv TRAP_SCE
+and
+.Dv TRAP_SCX
+first appeared in
+.Nx 9 .



CVS commit: src/sys

2019-05-24 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat May 25 04:41:53 UTC 2019

Modified Files:
src/sys/arch/sgimips/hpc: haltwo.c
src/sys/dev/bluetooth: btsco.c

Log Message:
Make it compilable even with debug option.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/sgimips/hpc/haltwo.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/bluetooth/btsco.c

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



CVS commit: src/sys

2019-05-24 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat May 25 04:41:53 UTC 2019

Modified Files:
src/sys/arch/sgimips/hpc: haltwo.c
src/sys/dev/bluetooth: btsco.c

Log Message:
Make it compilable even with debug option.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/sgimips/hpc/haltwo.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/bluetooth/btsco.c

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

Modified files:

Index: src/sys/arch/sgimips/hpc/haltwo.c
diff -u src/sys/arch/sgimips/hpc/haltwo.c:1.25 src/sys/arch/sgimips/hpc/haltwo.c:1.26
--- src/sys/arch/sgimips/hpc/haltwo.c:1.25	Wed May  8 13:40:16 2019
+++ src/sys/arch/sgimips/hpc/haltwo.c	Sat May 25 04:41:53 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: haltwo.c,v 1.25 2019/05/08 13:40:16 isaki Exp $ */
+/* $NetBSD: haltwo.c,v 1.26 2019/05/25 04:41:53 isaki Exp $ */
 
 /*
  * Copyright (c) 2003 Ilpo Ruotsalainen
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: haltwo.c,v 1.25 2019/05/08 13:40:16 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: haltwo.c,v 1.26 2019/05/25 04:41:53 isaki Exp $");
 
 #include 
 #include 
@@ -695,7 +695,7 @@ haltwo_trigger_output(void *v, void *sta
 	fifoend = (param->channels * 8) >> 3;
 
 	DPRINTF(("haltwo_trigger_output: hw_channels = %d highwater = %d"
-	" fifobeg = %d fifoend = %d\n", param->hw_channels, highwater,
+	" fifobeg = %d fifoend = %d\n", param->channels, highwater,
 	fifobeg, fifoend));
 
 	ctrl = HPC3_PBUS_DMACTL_RT

Index: src/sys/dev/bluetooth/btsco.c
diff -u src/sys/dev/bluetooth/btsco.c:1.39 src/sys/dev/bluetooth/btsco.c:1.40
--- src/sys/dev/bluetooth/btsco.c:1.39	Wed May  8 13:40:17 2019
+++ src/sys/dev/bluetooth/btsco.c	Sat May 25 04:41:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: btsco.c,v 1.39 2019/05/08 13:40:17 isaki Exp $	*/
+/*	$NetBSD: btsco.c,v 1.40 2019/05/25 04:41:53 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: btsco.c,v 1.39 2019/05/08 13:40:17 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btsco.c,v 1.40 2019/05/25 04:41:53 isaki Exp $");
 
 #include 
 #include 
@@ -961,7 +961,7 @@ btsco_allocm(void *hdl, int direction, s
 	struct btsco_softc *sc = hdl;
 	void *addr;
 
-	DPRINTF("%s: size %d direction %d\n", sc->sc_name, size, direction);
+	DPRINTF("%s: size %zd direction %d\n", sc->sc_name, size, direction);
 
 	addr = kmem_alloc(size, KM_SLEEP);
 



CVS commit: src/sys/dev/pci

2019-05-24 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat May 25 04:25:30 UTC 2019

Modified Files:
src/sys/dev/pci: yds.c

Log Message:
Fix yds_intr.  It has not worked well since netbsd-8.
- Read data offset before set ACTV2.
- The interrupts occur every hardware block, not blocksize specified
  by round_blocksize.  The hardware block may span (upper layer's)
  two blocks.  So bus_dmamap_sync'ing each (upper layer's) block is
  not enough.
  XXX To fix this, Use only 48kHz and drop other frequencies. It can
  make blocksize fixed.  Then the hardware block aligns to upper layer's
  block alignment.
Analyzed by Y.Sugahara.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/pci/yds.c

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

Modified files:

Index: src/sys/dev/pci/yds.c
diff -u src/sys/dev/pci/yds.c:1.62 src/sys/dev/pci/yds.c:1.63
--- src/sys/dev/pci/yds.c:1.62	Wed May  8 13:40:19 2019
+++ src/sys/dev/pci/yds.c	Sat May 25 04:25:30 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: yds.c,v 1.62 2019/05/08 13:40:19 isaki Exp $	*/
+/*	$NetBSD: yds.c,v 1.63 2019/05/25 04:25:30 isaki Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001 Kazuki Sakamoto and Minoura Makoto.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: yds.c,v 1.62 2019/05/08 13:40:19 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: yds.c,v 1.63 2019/05/25 04:25:30 isaki Exp $");
 
 #include "mpu.h"
 
@@ -1065,19 +1065,32 @@ yds_intr(void *p)
 		printf ("yds_intr: timeout!\n");
 	}
 
+	/*
+	 * XXX
+	 * An interrupt in YMF754 occurs when next hardware frame is
+	 * requested, not when current hardware frame processing is
+	 * completed.  According to the datasheet, only access to the
+	 * inactive bank is permitted, but in fact, fields in inactive
+	 * bank that the chip should write to may or may not be filled
+	 * at that time.  On the other hand, both the CPU and the device
+	 * must guarantee that the fields in active bank are determined
+	 * at the beginning of the interrupt.
+	 * Therefore, we read active bank.
+	 */
+
 	if (status & YDS_STAT_INT) {
 		int nbank;
+		u_int pdma = 0;
+		u_int rdma = 0;
+
+		/* nbank is bank number that YDS is processing now. */
+		nbank = YREAD4(sc, YDS_CONTROL_SELECT) & 1;
 
-		nbank = (YREAD4(sc, YDS_CONTROL_SELECT) == 0);
 		/* Clear interrupt flag */
 		YWRITE4(sc, YDS_STATUS, YDS_STAT_INT);
 
-		/* Buffer for the next frame is always ready. */
-		YWRITE4(sc, YDS_MODE, YREAD4(sc, YDS_MODE) | YDS_MODE_ACTV2);
-
+		/* Read current data offset before ACTV2 */
 		if (sc->sc_play.intr) {
-			u_int dma, ccpu, blk, len;
-
 			/* Sync play slot control data */
 			bus_dmamap_sync(sc->sc_dmatag, sc->sc_ctrldata.map,
 	sc->pbankoff,
@@ -1086,23 +1099,42 @@ yds_intr(void *p)
 	N_PLAY_SLOT_CTRL_BANK,
 	BUS_DMASYNC_POSTWRITE|
 	BUS_DMASYNC_POSTREAD);
-			dma = le32toh(sc->pbankp[nbank]->pgstart) * sc->sc_play.factor;
-			ccpu = sc->sc_play.offset;
-			blk = sc->sc_play.blksize;
-			len = sc->sc_play.length;
+			/* start offset of current processing bank */
+			pdma = le32toh(sc->pbankp[nbank]->pgstart) *
+			sc->sc_play.factor;
+		}
+
+		if (sc->sc_rec.intr) {
+			/* Sync rec slot control data */
+			bus_dmamap_sync(sc->sc_dmatag, sc->sc_ctrldata.map,
+	sc->rbankoff,
+	sizeof(struct rec_slot_ctrl_bank)*
+	N_REC_SLOT_CTRL*
+	N_REC_SLOT_CTRL_BANK,
+	BUS_DMASYNC_POSTWRITE|
+	BUS_DMASYNC_POSTREAD);
+			/* start offset of current processing bank */
+			rdma = le32toh(
+			sc->rbank[YDS_INPUT_SLOT * 2 + nbank].pgstartadr);
+		}
 
-			if (((dma > ccpu) && (dma - ccpu > blk * 2)) ||
-			((ccpu > dma) && (dma + len - ccpu > blk * 2))) {
+		/* Buffer for the next frame is always ready. */
+		YWRITE4(sc, YDS_MODE, YREAD4(sc, YDS_MODE) | YDS_MODE_ACTV2);
+
+		if (sc->sc_play.intr) {
+			if (pdma < sc->sc_play.offset)
+pdma += sc->sc_play.length;
+			if (pdma >= sc->sc_play.offset + sc->sc_play.blksize) {
 /* We can fill the next block */
 /* Sync ring buffer for previous write */
 bus_dmamap_sync(sc->sc_dmatag,
 		sc->sc_play.dma->map,
-		ccpu, blk,
+		0, sc->sc_play.length,
 		BUS_DMASYNC_POSTWRITE);
 sc->sc_play.intr(sc->sc_play.intr_arg);
-sc->sc_play.offset += blk;
-if (sc->sc_play.offset >= len) {
-	sc->sc_play.offset -= len;
+sc->sc_play.offset += sc->sc_play.blksize;
+if (sc->sc_play.offset >= sc->sc_play.length) {
+	sc->sc_play.offset -= sc->sc_play.length;
 #ifdef DIAGNOSTIC
 	if (sc->sc_play.offset != 0)
 		printf ("Audio ringbuffer botch\n");
@@ -,38 +1143,24 @@ yds_intr(void *p)
 /* Sync ring buffer for next write */
 bus_dmamap_sync(sc->sc_dmatag,
 		sc->sc_play.dma->map,
-		ccpu, blk,
+		0, sc->sc_play.length,
 		BUS_DMASYNC_PREWRITE);
 			}
 		}
 		if (sc->sc_rec.intr) {
-			u_int dma, ccpu, blk, len;
-
-			/* Sync rec slot control data */
-			

CVS commit: src/sys/dev/pci

2019-05-24 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat May 25 04:25:30 UTC 2019

Modified Files:
src/sys/dev/pci: yds.c

Log Message:
Fix yds_intr.  It has not worked well since netbsd-8.
- Read data offset before set ACTV2.
- The interrupts occur every hardware block, not blocksize specified
  by round_blocksize.  The hardware block may span (upper layer's)
  two blocks.  So bus_dmamap_sync'ing each (upper layer's) block is
  not enough.
  XXX To fix this, Use only 48kHz and drop other frequencies. It can
  make blocksize fixed.  Then the hardware block aligns to upper layer's
  block alignment.
Analyzed by Y.Sugahara.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/pci/yds.c

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



CVS commit: src/lib/libc/sys

2019-05-24 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat May 25 04:25:14 UTC 2019

Modified Files:
src/lib/libc/sys: ptrace.2

Log Message:
Update the ptrace(2) documentation

Document that TRAP_EXEC can be returned for PT_SYSCALL.
Document truncated byte transfers.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/lib/libc/sys/ptrace.2

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



CVS commit: src/lib/libc/sys

2019-05-24 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat May 25 04:25:14 UTC 2019

Modified Files:
src/lib/libc/sys: ptrace.2

Log Message:
Update the ptrace(2) documentation

Document that TRAP_EXEC can be returned for PT_SYSCALL.
Document truncated byte transfers.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/lib/libc/sys/ptrace.2

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

Modified files:

Index: src/lib/libc/sys/ptrace.2
diff -u src/lib/libc/sys/ptrace.2:1.69 src/lib/libc/sys/ptrace.2:1.70
--- src/lib/libc/sys/ptrace.2:1.69	Tue May  1 16:37:23 2018
+++ src/lib/libc/sys/ptrace.2	Sat May 25 04:25:14 2019
@@ -1,7 +1,7 @@
-.\"	$NetBSD: ptrace.2,v 1.69 2018/05/01 16:37:23 kamil Exp $
+.\"	$NetBSD: ptrace.2,v 1.70 2019/05/25 04:25:14 kamil Exp $
 .\"
 .\" This file is in the public domain.
-.Dd May 1, 2018
+.Dd May 25, 2019
 .Dt PTRACE 2
 .Os
 .Sh NAME
@@ -56,10 +56,6 @@ with
 .Dv si_code
 set to
 .Dv TRAP_EXEC .
-If a program is traced with the
-.Dv PT_SYSCALL
-option enabled,
-this event notifier is disabled.
 If a traced program calls
 .Xr execve 2
 any setuid or setgid bits on the executable being executed will be ignored.
@@ -220,6 +216,11 @@ The value read is returned as the return
 .Eo \&
 .Fn ptrace
 .Ec .
+.Pp
+These operations return success on incomplete and cancelled byte transfers.
+New software shall use
+.Dv PT_IO
+as it allows to check whether a byte transfer was completed.
 .It Dv PT_WRITE_I , Dv PT_WRITE_D
 These requests parallel
 .Dv PT_READ_I
@@ -229,6 +230,10 @@ except that they write rather than read.
 The
 .Fa data
 argument supplies the value to be written.
+.Pp
+New software shall use
+.Dv PT_IO
+as it allows to check whether an operation was completed.
 .It Dv PT_CONTINUE
 The traced process continues execution.
 .Fa addr
@@ -349,6 +354,15 @@ will return
 .Li \-1
 and set
 .Va errno .
+.Pp
+This interface returns success for partial and cancelled byte transfers.
+For an interrupted transfer, a user shall check whether occurred at least
+a single of the following two conditions:
+.Dv piod_len == 0
+and set
+.Va errno .
+Successful but incomplete byte transfers shall be restarted in the place
+where they were stopped.
 .It Dv PT_DUMPCORE
 Makes the process specified in the
 .Fa pid
@@ -799,6 +813,15 @@ or
 .Dv PT_SETFPREGS
 was attempted on a process with no valid register set.
 (This is normally true only of system processes.)
+.It
+A process attempted to set Program Counter to 0 in
+.Dv PT_CONTINUE ,
+.Dv PT_SYSCALL
+or
+.Dv PT_DETACH
+with
+.Dv vm.user_va0_disable
+set to 1.
 .El
 .It Bq Er EPERM
 .Bl -bullet -compact



Re: CVS commit: src/sys/arch

2019-05-24 Thread Tetsuya Isaki
# Sorry for too delayed response..

At Mon, 6 May 2019 19:33:43 +0100,
Sevan Janiyan wrote:
> > What is the difference in m68k family?
> >  Enabled: amiga, cesfic, hp300, mac68k, news68k, next68k
> >  Disabled: atari, luna68k, mvme68k, sun3, x68k
> 
> You can have systems with more than 32MB RAM on the ones which I enabled
> (excluding mvme68k, sun3, x68k)
> 
> I omitted atari because I thought it was only MILAN which supported high
> memory (I was changing GENERIC, unless GENERIC wasn't present).
> 
> I omitted luna68k because I didn't realise it can take more than 32MB
> and didn't want to upset anyone.
> 
> Do you think I should enable on the atari & luna68k ports?

No, I don't think so either.
Thank you for explanation.
---
Tetsuya Isaki 


CVS commit: src/tests/lib/libc/sys

2019-05-24 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat May 25 03:25:08 UTC 2019

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Add new user_va0_disable* tests in t_ptrace_wait*

Add tests:
 - user_va0_disable_pt_continue
 - user_va0_disable_pt_syscall
 - user_va0_disable_pt_detach

Assert that setting PC to 0x0 in PT_CONTINUE/PT_SYSCALL/PT_DETACH for
vm.user_va0_disable==0 is disallowed.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/tests/lib/libc/sys/t_ptrace_wait.c

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



CVS commit: src/tests/lib/libc/sys

2019-05-24 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat May 25 03:25:08 UTC 2019

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Add new user_va0_disable* tests in t_ptrace_wait*

Add tests:
 - user_va0_disable_pt_continue
 - user_va0_disable_pt_syscall
 - user_va0_disable_pt_detach

Assert that setting PC to 0x0 in PT_CONTINUE/PT_SYSCALL/PT_DETACH for
vm.user_va0_disable==0 is disallowed.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/tests/lib/libc/sys/t_ptrace_wait.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.121 src/tests/lib/libc/sys/t_ptrace_wait.c:1.122
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.121	Thu May  9 13:07:35 2019
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Sat May 25 03:25:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.121 2019/05/09 13:07:35 mgorny Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.122 2019/05/25 03:25:08 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.121 2019/05/09 13:07:35 mgorny Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.122 2019/05/25 03:25:08 kamil Exp $");
 
 #include 
 #include 
@@ -7438,6 +7438,94 @@ TRACEME_VFORK_CLONE_TEST(traceme_vfork_c
 
 /// 
 
+static void
+user_va0_disable(int operation)
+{
+	pid_t child, wpid;
+#if defined(TWAIT_HAVE_STATUS)
+	int status;
+#endif
+	const int sigval = SIGSTOP;
+	int rv;
+
+	struct ptrace_siginfo info;
+
+	if (get_user_va0_disable() == 0)
+		atf_tc_skip("vm.user_va0_disable is set to 0");
+
+	memset(, 0, sizeof(info));
+
+	DPRINTF("Before forking process PID=%d\n", getpid());
+	SYSCALL_REQUIRE((child = fork()) != -1);
+	if (child == 0) {
+		DPRINTF("Before calling PT_TRACE_ME from child %d\n", getpid());
+		FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1);
+
+		DPRINTF("Before raising %s from child\n", strsignal(sigval));
+		FORKEE_ASSERT(raise(sigval) == 0);
+
+		/* NOTREACHED */
+		FORKEE_ASSERTX(0 && "This shall not be reached");
+		__unreachable();
+	}
+	DPRINTF("Parent process PID=%d, child's PID=%d\n", getpid(), child);
+
+	DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);
+	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0), child);
+
+	validate_status_stopped(status, sigval);
+
+	DPRINTF("Before calling ptrace(2) with PT_GET_SIGINFO for "
+		"child\n");
+	SYSCALL_REQUIRE(ptrace(PT_GET_SIGINFO, child, ,
+		sizeof(info)) != -1);
+
+	DPRINTF("Signal traced to lwpid=%d\n", info.psi_lwpid);
+	DPRINTF("Signal properties: si_signo=%#x si_code=%#x "
+		"si_errno=%#x\n",
+		info.psi_siginfo.si_signo, info.psi_siginfo.si_code,
+		info.psi_siginfo.si_errno);
+
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, sigval);
+	ATF_REQUIRE_EQ(info.psi_siginfo.si_code, SI_LWP);
+
+	DPRINTF("Before resuming the child process in PC=0x0 "
+	"and without signal to be sent\n");
+	errno = 0;
+	rv = ptrace(operation, child, (void *)0, 0);
+	ATF_REQUIRE_EQ(errno, EINVAL);
+	ATF_REQUIRE_EQ(rv, -1);
+
+	SYSCALL_REQUIRE(ptrace(PT_KILL, child, NULL, 0) != -1);
+
+	DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);
+	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0), child);
+	validate_status_signaled(status, SIGKILL, 0);
+
+	DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);
+	TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, , 0));
+}
+
+#define USER_VA0_DISABLE(test, operation)\
+ATF_TC(test);\
+ATF_TC_HEAD(test, tc)			\
+{	\
+	atf_tc_set_md_var(tc, "descr",	\
+	"Verify behavior of " #operation " with PC set to 0x0");	\
+}	\
+	\
+ATF_TC_BODY(test, tc)			\
+{	\
+	\
+	user_va0_disable(operation);	\
+}
+
+USER_VA0_DISABLE(user_va0_disable_pt_continue, PT_CONTINUE)
+USER_VA0_DISABLE(user_va0_disable_pt_syscall, PT_SYSCALL)
+USER_VA0_DISABLE(user_va0_disable_pt_detach, PT_DETACH)
+
+/// 
+
 #include "t_ptrace_amd64_wait.h"
 #include "t_ptrace_i386_wait.h"
 #include "t_ptrace_x86_wait.h"
@@ -7886,6 +7974,10 @@ ATF_TP_ADD_TCS(tp)
 	ATF_TP_ADD_TC_HAVE_PID(tp, traceme_vfork_clone_vfork);
 #endif
 
+	ATF_TP_ADD_TC(tp, user_va0_disable_pt_continue);
+	ATF_TP_ADD_TC(tp, user_va0_disable_pt_syscall);
+	ATF_TP_ADD_TC(tp, user_va0_disable_pt_detach);
+
 	ATF_TP_ADD_TCS_PTRACE_WAIT_AMD64();
 	ATF_TP_ADD_TCS_PTRACE_WAIT_I386();
 	ATF_TP_ADD_TCS_PTRACE_WAIT_X86();



CVS commit: src/tests/lib/libc/sys

2019-05-24 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat May 25 03:22:53 UTC 2019

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.h

Log Message:
Add get_user_va0_disable() in t_ptrace_wait.h

Add a utility function to check vm.user_va0_disable.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/tests/lib/libc/sys/t_ptrace_wait.h

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



CVS commit: src/tests/lib/libc/sys

2019-05-24 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat May 25 03:22:53 UTC 2019

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.h

Log Message:
Add get_user_va0_disable() in t_ptrace_wait.h

Add a utility function to check vm.user_va0_disable.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/tests/lib/libc/sys/t_ptrace_wait.h

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.h
diff -u src/tests/lib/libc/sys/t_ptrace_wait.h:1.16 src/tests/lib/libc/sys/t_ptrace_wait.h:1.17
--- src/tests/lib/libc/sys/t_ptrace_wait.h:1.16	Thu Apr 25 19:15:23 2019
+++ src/tests/lib/libc/sys/t_ptrace_wait.h	Sat May 25 03:22:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.h,v 1.16 2019/04/25 19:15:23 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.h,v 1.17 2019/05/25 03:22:53 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -553,6 +553,26 @@ can_we_set_dbregs(void)
 #endif
 
 static bool __used
+get_user_va0_disable(void)
+{
+	static int user_va0_disable = -1;
+	size_t user_va0_disable_len = sizeof(user_va0_disable);
+
+	if (user_va0_disable == -1) {
+		if (sysctlbyname("vm.user_va0_disable",
+			_va0_disable, _va0_disable_len, NULL, 0)
+			== -1) {
+			return true;
+		}
+	}
+
+	if (user_va0_disable > 0)
+		return true;
+	else
+		return false;
+}
+
+static bool __used
 can_we_write_to_text(pid_t pid)
 {
 	int mib[3];



CVS commit: src/sys/kern

2019-05-24 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat May 25 03:20:43 UTC 2019

Modified Files:
src/sys/kern: sys_ptrace_common.c

Log Message:
Relax prohibition of Program Counter set to 0x0 in ptrace(2)

In PT_CONTINUE, PT_SYSCALL and PT_DETACH the 3rd argument of ptrace(2)
allows to set PC. It used to be allowed to set PC to 0x0 without
restrictions, later prohibited unconditionally.

Change the condition and make it depending on vm.user_va0_disable. Whenever
the VA 0 mapping is disallowed, reject setting PC to 0x0.

While there comment truncated and empty transfers in PT_READ/PT_WRITE
and PT_IO.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/kern/sys_ptrace_common.c

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



CVS commit: src/sys/kern

2019-05-24 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat May 25 03:20:43 UTC 2019

Modified Files:
src/sys/kern: sys_ptrace_common.c

Log Message:
Relax prohibition of Program Counter set to 0x0 in ptrace(2)

In PT_CONTINUE, PT_SYSCALL and PT_DETACH the 3rd argument of ptrace(2)
allows to set PC. It used to be allowed to set PC to 0x0 without
restrictions, later prohibited unconditionally.

Change the condition and make it depending on vm.user_va0_disable. Whenever
the VA 0 mapping is disallowed, reject setting PC to 0x0.

While there comment truncated and empty transfers in PT_READ/PT_WRITE
and PT_IO.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/kern/sys_ptrace_common.c

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

Modified files:

Index: src/sys/kern/sys_ptrace_common.c
diff -u src/sys/kern/sys_ptrace_common.c:1.53 src/sys/kern/sys_ptrace_common.c:1.54
--- src/sys/kern/sys_ptrace_common.c:1.53	Fri May 10 21:08:26 2019
+++ src/sys/kern/sys_ptrace_common.c	Sat May 25 03:20:43 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_ptrace_common.c,v 1.53 2019/05/10 21:08:26 mgorny Exp $	*/
+/*	$NetBSD: sys_ptrace_common.c,v 1.54 2019/05/25 03:20:43 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.53 2019/05/10 21:08:26 mgorny Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.54 2019/05/25 03:20:43 kamil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -163,6 +163,8 @@ __KERNEL_RCSID(0, "$NetBSD: sys_ptrace_c
 static kauth_listener_t ptrace_listener;
 static int process_auxv_offset(struct proc *, struct uio *);
 
+extern int user_va0_disable;
+
 #if 0
 static int ptrace_cbref;
 static kmutex_t ptrace_mtx;
@@ -1106,12 +1108,15 @@ do_ptrace(struct ptrace_methods *ptm, st
 		piod.piod_op = write ? PIOD_WRITE_D : PIOD_READ_D;
 		if ((error = ptrace_doio(l, t, lt, , addr, true)) != 0)
 			break;
-#if 0 // XXX: GDB depends on it
-		if (piod.piod_len < sizeof(tmp)) {
-			error = EIO;
-			break;
-		}
-#endif
+		/*
+		 * For legacy reasons we treat here two results as success:
+		 *  - incomplete transfer  piod.piod_len < sizeof(tmp)
+		 *  - no transfer  piod.piod_len == 0
+		 *
+		 * This means that there is no way to determine whether
+		 * transfer operation was performed in PT_WRITE and PT_READ
+		 * calls.
+		 */
 		if (!write)
 			*retval = tmp;
 		break;
@@ -1125,12 +1130,11 @@ do_ptrace(struct ptrace_methods *ptm, st
 		}
 		if ((error = ptrace_doio(l, t, lt, , addr, false)) != 0)
 			break;
-#if 0 // XXX: GDB depends on it
-		if (piod.piod_len < 1) {
-			error = EIO;
-			break;
-		}
-#endif
+		/*
+		 * For legacy reasons we treat here two results as success:
+		 *  - incomplete transfer  piod.piod_len < sizeof(tmp)
+		 *  - no transfer  piod.piod_len == 0
+		 */
 		error = ptm->ptm_copyout_piod(, addr, data);
 		break;
 
@@ -1251,16 +1255,15 @@ do_ptrace(struct ptrace_methods *ptm, st
 		}
 
 		/*
-		 * If the address parameter is 0, report error.
-		 *
-		 * It's a popular mistake to set Program Counter to 0x0.
-		 * In certain kernels this is allowable parameter and causes
-		 * portability issue.
+		 * Reject setting program cunter to 0x0 if VA0 is disabled.
 		 *
-		 * Disallow explicitly zeroed PC, instead of triggering
-		 * a harder to debug crash later.
+		 * Not all kernels implement this feature to set Program
+		 * Counter in one go in PT_CONTINUE and similar operations.
+		 * This causes portability issues as passing address 0x0
+		 * on these kernels is no-operation, but can cause failure
+		 * in most cases on NetBSD.
 		 */
-		if (addr == 0) {
+		if (user_va0_disable && addr == 0) {
 			error = EINVAL;
 			break;
 		}



CVS commit: src/doc

2019-05-24 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat May 25 02:49:26 UTC 2019

Modified Files:
src/doc: BRANCHES

Log Message:
isaki-audio2 branch is terminated (merged to -current).


To generate a diff of this commit:
cvs rdiff -u -r1.349 -r1.350 src/doc/BRANCHES

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

Modified files:

Index: src/doc/BRANCHES
diff -u src/doc/BRANCHES:1.349 src/doc/BRANCHES:1.350
--- src/doc/BRANCHES:1.349	Sat May  4 04:54:15 2019
+++ src/doc/BRANCHES	Sat May 25 02:49:26 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: BRANCHES,v 1.349 2019/05/04 04:54:15 isaki Exp $
+#	$NetBSD: BRANCHES,v 1.350 2019/05/25 02:49:26 isaki Exp $
 #
 # This file contains a list of branches that exist in the NetBSD CVS
 # tree and their current state.
@@ -459,17 +459,6 @@ Maintainer:	Robert Swindells 
-Scope:		src/sys
-Notes:		Rework audio subsystem, including multiple streaming,
-		filter pipeline.
-
 Branch:		itohy-usb1
 Description:	USB stack overhaul, mostly DMA related
 Status:		Terminated
@@ -1107,6 +1096,17 @@ Maintainer:	Ignatios Souvatzis 
+Scope:		src/sys
+Notes:		Rework audio subsystem, including multiple streaming,
+		filter pipeline.
+
 Branch:		jmcneill-pm
 Description:	Power management framework overhaul, ACPI improvements
 Status:		Terminated; merged before NetBSD 5.0



CVS commit: src/doc

2019-05-24 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat May 25 02:49:26 UTC 2019

Modified Files:
src/doc: BRANCHES

Log Message:
isaki-audio2 branch is terminated (merged to -current).


To generate a diff of this commit:
cvs rdiff -u -r1.349 -r1.350 src/doc/BRANCHES

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



CVS commit: src/sys/dev/audio

2019-05-24 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat May 25 02:42:04 UTC 2019

Modified Files:
src/sys/dev/audio: audio.c

Log Message:
Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/audio/audio.c

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

Modified files:

Index: src/sys/dev/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.9 src/sys/dev/audio/audio.c:1.10
--- src/sys/dev/audio/audio.c:1.9	Thu May 23 12:20:27 2019
+++ src/sys/dev/audio/audio.c	Sat May 25 02:42:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.9 2019/05/23 12:20:27 isaki Exp $	*/
+/*	$NetBSD: audio.c,v 1.10 2019/05/25 02:42:03 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -142,7 +142,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.9 2019/05/23 12:20:27 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.10 2019/05/25 02:42:03 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -5678,7 +5678,7 @@ audio_track_drain(struct audio_softc *sc
 	track->pstate = AUDIO_STATE_DRAINING;
 
 	for (;;) {
-		/* I want to display it bofore condition evaluation. */
+		/* I want to display it before condition evaluation. */
 		TRACET(3, track, "pid=%d.%d trkseq=%d hwseq=%d out=%d/%d/%d",
 		(int)curproc->p_pid, (int)curlwp->l_lid,
 		(int)track->seq, (int)mixer->hwseq,



CVS commit: src/sys/dev/audio

2019-05-24 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat May 25 02:42:04 UTC 2019

Modified Files:
src/sys/dev/audio: audio.c

Log Message:
Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/audio/audio.c

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



CVS commit: src/share/installboot/evbarm

2019-05-24 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat May 25 01:37:55 UTC 2019

Modified Files:
src/share/installboot/evbarm: boards.plist

Log Message:
Add the Lamobo R1 board.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/installboot/evbarm/boards.plist

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

Modified files:

Index: src/share/installboot/evbarm/boards.plist
diff -u src/share/installboot/evbarm/boards.plist:1.1 src/share/installboot/evbarm/boards.plist:1.2
--- src/share/installboot/evbarm/boards.plist:1.1	Tue May  7 05:02:42 2019
+++ src/share/installboot/evbarm/boards.plist	Sat May 25 01:37:54 2019
@@ -1,4 +1,4 @@
-
+
 
 	
+	lamobo,lamobo-r1
+	
+		description
+		Lamobo R1
+		u-boot-pkg
+		lamobo-r1
+	
 	lemaker,bananapi
 	
 		description



CVS commit: src/share/installboot/evbarm

2019-05-24 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat May 25 01:37:55 UTC 2019

Modified Files:
src/share/installboot/evbarm: boards.plist

Log Message:
Add the Lamobo R1 board.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/installboot/evbarm/boards.plist

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



CVS commit: src/share/man/man3

2019-05-24 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri May 24 21:32:06 UTC 2019

Modified Files:
src/share/man/man3: tree.3

Log Message:
Remove empty line.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/share/man/man3/tree.3

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



CVS commit: src/share/man/man3

2019-05-24 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri May 24 21:32:06 UTC 2019

Modified Files:
src/share/man/man3: tree.3

Log Message:
Remove empty line.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/share/man/man3/tree.3

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/man3/tree.3
diff -u src/share/man/man3/tree.3:1.13 src/share/man/man3/tree.3:1.14
--- src/share/man/man3/tree.3:1.13	Fri May 24 15:50:59 2019
+++ src/share/man/man3/tree.3	Fri May 24 21:32:05 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: tree.3,v 1.13 2019/05/24 15:50:59 ryoon Exp $
+.\"	$NetBSD: tree.3,v 1.14 2019/05/24 21:32:05 wiz Exp $
 .\"	$OpenBSD: tree.3,v 1.23 2011/07/09 08:43:01 jmc Exp $
 .\"/*
 .\" * Copyright 2002 Niels Provos 
@@ -605,7 +605,6 @@ for (var = SPLAY_MIN(NAME, ); var !
 .\"to indicate an error.
 .Sh SEE ALSO
 .Xr rbtree 3
-
 .Sh AUTHORS
 The author of the tree macros is
 .An Niels Provos .



CVS commit: src/share/man/man4

2019-05-24 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Fri May 24 16:02:08 UTC 2019

Modified Files:
src/share/man/man4: acpipmtr.4

Log Message:
Add <> for e-mail address


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/acpipmtr.4

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



CVS commit: src/share/man/man4

2019-05-24 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Fri May 24 16:02:08 UTC 2019

Modified Files:
src/share/man/man4: acpipmtr.4

Log Message:
Add <> for e-mail address


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/acpipmtr.4

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/man4/acpipmtr.4
diff -u src/share/man/man4/acpipmtr.4:1.1 src/share/man/man4/acpipmtr.4:1.2
--- src/share/man/man4/acpipmtr.4:1.1	Wed Jan  5 20:08:13 2011
+++ src/share/man/man4/acpipmtr.4	Fri May 24 16:02:08 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: acpipmtr.4,v 1.1 2011/01/05 20:08:13 jruoho Exp $
+.\" $NetBSD: acpipmtr.4,v 1.2 2019/05/24 16:02:08 ryoon Exp $
 .\"
 .\" Copyright (c) 2010 Jukka Ruohonen 
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 22, 2010
+.Dd May 25, 2019
 .Dt ACPIPMTR 4
 .Os
 .Sh NAME
@@ -59,7 +59,7 @@ device driver appeared in
 .Nx 6.0 .
 .Sh AUTHORS
 .An Jukka Ruohonen
-.Aq jruoho...@iki.fi
+.Aq Mt jruoho...@iki.fi
 .Sh CAVEATS
 The
 .Nm



CVS commit: src/sys/arch/luna68k/stand/boot

2019-05-24 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri May 24 15:52:36 UTC 2019

Modified Files:
src/sys/arch/luna68k/stand/boot: Makefile

Log Message:
LUNA's firmware requires OMAGIC a.out.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/luna68k/stand/boot/Makefile

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

Modified files:

Index: src/sys/arch/luna68k/stand/boot/Makefile
diff -u src/sys/arch/luna68k/stand/boot/Makefile:1.16 src/sys/arch/luna68k/stand/boot/Makefile:1.17
--- src/sys/arch/luna68k/stand/boot/Makefile:1.16	Wed Jan  2 00:50:02 2019
+++ src/sys/arch/luna68k/stand/boot/Makefile	Fri May 24 15:52:35 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.16 2019/01/02 00:50:02 christos Exp $
+#	$NetBSD: Makefile,v 1.17 2019/05/24 15:52:35 tsutsui Exp $
 #	@(#)Makefile	8.2 (Berkeley) 8/15/93
 
 NOMAN= # defined
@@ -32,6 +32,8 @@ TEXTADDR=	70
 LDSCRIPT=	${.CURDIR}/boot.ldscript
 LINKFORMAT=	-static -N -Ttext ${TEXTADDR} -T ${LDSCRIPT}
 
+ELF2AOUT_OPTS=	-O	# LUNA's firmware requires OMAGIC a.out
+
 SRCS=	locore.S
 SRCS+=	init_main.c autoconf.c
 SRCS+=	trap.c
@@ -80,7 +82,7 @@ LIBS=	${SALIB} ${ZLIB} ${KERNLIB}
 ${PROG}: ${LDSCRIPT} ${OBJS} ${LIBS}
 	${_MKTARGET_LINK}
 	${LD} ${LINKFORMAT} -x -o ${PROG}.elf ${OBJS} ${LIBS}
-	${M68K_ELF2AOUT} ${PROG}.elf ${PROG}.aout
+	${M68K_ELF2AOUT} ${ELF2AOUT_OPTS} ${PROG}.elf ${PROG}.aout
 	mv ${PROG}.aout ${PROG}
 
 CLEANFILES+=	${PROG}.aout ${PROG}.elf



CVS commit: src/sys/arch/luna68k/stand/boot

2019-05-24 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri May 24 15:52:36 UTC 2019

Modified Files:
src/sys/arch/luna68k/stand/boot: Makefile

Log Message:
LUNA's firmware requires OMAGIC a.out.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/luna68k/stand/boot/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/man3

2019-05-24 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Fri May 24 15:51:00 UTC 2019

Modified Files:
src/share/man/man3: tree.3

Log Message:
Add rbtree(3) to SEE ALSO


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/share/man/man3/tree.3

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/man3/tree.3
diff -u src/share/man/man3/tree.3:1.12 src/share/man/man3/tree.3:1.13
--- src/share/man/man3/tree.3:1.12	Mon Jul  3 21:30:58 2017
+++ src/share/man/man3/tree.3	Fri May 24 15:50:59 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: tree.3,v 1.12 2017/07/03 21:30:58 wiz Exp $
+.\"	$NetBSD: tree.3,v 1.13 2019/05/24 15:50:59 ryoon Exp $
 .\"	$OpenBSD: tree.3,v 1.23 2011/07/09 08:43:01 jmc Exp $
 .\"/*
 .\" * Copyright 2002 Niels Provos 
@@ -24,7 +24,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 9, 2011
+.Dd May 25, 2019
 .Dt TREE 3
 .Os
 .Sh NAME
@@ -603,6 +603,9 @@ for (var = SPLAY_MIN(NAME, ); var !
 .\"return the pointer to the removed element, otherwise they return
 .\".Dv NULL
 .\"to indicate an error.
+.Sh SEE ALSO
+.Xr rbtree 3
+
 .Sh AUTHORS
 The author of the tree macros is
 .An Niels Provos .



CVS commit: src/share/man/man3

2019-05-24 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Fri May 24 15:51:00 UTC 2019

Modified Files:
src/share/man/man3: tree.3

Log Message:
Add rbtree(3) to SEE ALSO


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/share/man/man3/tree.3

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



CVS commit: src/sys

2019-05-24 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Fri May 24 14:28:49 UTC 2019

Modified Files:
src/sys/arch/amd64/conf: GENERIC
src/sys/arch/i386/conf: GENERIC
src/sys/arch/x86/include: autoconf.h
src/sys/arch/x86/pci: pci_machdep.c
src/sys/arch/x86/x86: consinit.c hyperv.c identcpu.c x86_autoconf.c
src/sys/arch/xen/x86: autoconf.c
src/sys/dev/acpi: vmbus_acpi.c
src/sys/dev/hyperv: files.hyperv hypervvar.h vmbus.c vmbusvar.h
src/sys/dev/wscons: wsconsio.h
Added Files:
src/sys/arch/x86/x86: hypervvar.h
src/sys/dev/hyperv: genfb_vmbus.c genfb_vmbusvar.h hvkbd.c hvkbdvar.h

Log Message:
Added drivers for Hyper-V Synthetic Keyboard and Video device.


To generate a diff of this commit:
cvs rdiff -u -r1.527 -r1.528 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.1206 -r1.1207 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/include/autoconf.h
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/x86/pci/pci_machdep.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/x86/consinit.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/x86/hyperv.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/x86/x86/hypervvar.h
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/x86/x86/identcpu.c
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/x86/x86/x86_autoconf.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/xen/x86/autoconf.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/acpi/vmbus_acpi.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/hyperv/files.hyperv \
src/sys/dev/hyperv/hypervvar.h src/sys/dev/hyperv/vmbusvar.h
cvs rdiff -u -r0 -r1.1 src/sys/dev/hyperv/genfb_vmbus.c \
src/sys/dev/hyperv/genfb_vmbusvar.h src/sys/dev/hyperv/hvkbd.c \
src/sys/dev/hyperv/hvkbdvar.h
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hyperv/vmbus.c
cvs rdiff -u -r1.122 -r1.123 src/sys/dev/wscons/wsconsio.h

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



CVS commit: src/sys

2019-05-24 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Fri May 24 14:28:49 UTC 2019

Modified Files:
src/sys/arch/amd64/conf: GENERIC
src/sys/arch/i386/conf: GENERIC
src/sys/arch/x86/include: autoconf.h
src/sys/arch/x86/pci: pci_machdep.c
src/sys/arch/x86/x86: consinit.c hyperv.c identcpu.c x86_autoconf.c
src/sys/arch/xen/x86: autoconf.c
src/sys/dev/acpi: vmbus_acpi.c
src/sys/dev/hyperv: files.hyperv hypervvar.h vmbus.c vmbusvar.h
src/sys/dev/wscons: wsconsio.h
Added Files:
src/sys/arch/x86/x86: hypervvar.h
src/sys/dev/hyperv: genfb_vmbus.c genfb_vmbusvar.h hvkbd.c hvkbdvar.h

Log Message:
Added drivers for Hyper-V Synthetic Keyboard and Video device.


To generate a diff of this commit:
cvs rdiff -u -r1.527 -r1.528 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.1206 -r1.1207 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/include/autoconf.h
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/x86/pci/pci_machdep.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/x86/consinit.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/x86/hyperv.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/x86/x86/hypervvar.h
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/x86/x86/identcpu.c
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/x86/x86/x86_autoconf.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/xen/x86/autoconf.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/acpi/vmbus_acpi.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/hyperv/files.hyperv \
src/sys/dev/hyperv/hypervvar.h src/sys/dev/hyperv/vmbusvar.h
cvs rdiff -u -r0 -r1.1 src/sys/dev/hyperv/genfb_vmbus.c \
src/sys/dev/hyperv/genfb_vmbusvar.h src/sys/dev/hyperv/hvkbd.c \
src/sys/dev/hyperv/hvkbdvar.h
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hyperv/vmbus.c
cvs rdiff -u -r1.122 -r1.123 src/sys/dev/wscons/wsconsio.h

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

Modified files:

Index: src/sys/arch/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.527 src/sys/arch/amd64/conf/GENERIC:1.528
--- src/sys/arch/amd64/conf/GENERIC:1.527	Mon May  6 02:24:37 2019
+++ src/sys/arch/amd64/conf/GENERIC	Fri May 24 14:28:48 2019
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.527 2019/05/06 02:24:37 sevan Exp $
+# $NetBSD: GENERIC,v 1.528 2019/05/24 14:28:48 nonaka Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.527 $"
+#ident		"GENERIC-$Revision: 1.528 $"
 
 maxusers	64		# estimated number of users
 
@@ -1067,6 +1067,9 @@ vioscsi* at virtio?			# Virtio SCSI devi
 
 # Hyper-V devices
 vmbus*		at acpi?		# Hyper-V VMBus
+genfb*		at vmbus?		# Hyper-V Synthetic Video Framebuffer
+hvkbd*		at vmbus?		# Hyper-V Synthetic Keyboard
+wskbd*		at hvkbd? console ? mux 1
 hvn*		at vmbus?		# Hyper-V NetVSC
 hvs*		at vmbus?		# Hyper-V StorVSC
 hvheartbeat*	at vmbus?		# Hyper-V Heartbeat Service

Index: src/sys/arch/i386/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.1206 src/sys/arch/i386/conf/GENERIC:1.1207
--- src/sys/arch/i386/conf/GENERIC:1.1206	Mon May  6 02:24:37 2019
+++ src/sys/arch/i386/conf/GENERIC	Fri May 24 14:28:48 2019
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1206 2019/05/06 02:24:37 sevan Exp $
+# $NetBSD: GENERIC,v 1.1207 2019/05/24 14:28:48 nonaka Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.1206 $"
+#ident		"GENERIC-$Revision: 1.1207 $"
 
 maxusers	64		# estimated number of users
 
@@ -1406,6 +1406,9 @@ vioscsi* at virtio?			# Virtio SCSI devi
 
 # Hyper-V devices
 vmbus*		at acpi?		# Hyper-V VMBus
+genfb*		at vmbus?		# Hyper-V Synthetic Video Framebuffer
+hvkbd*		at vmbus?		# Hyper-V Synthetic Keyboard
+wskbd*		at hvkbd? console ? mux 1
 hvn*		at vmbus?		# Hyper-V NetVSC
 hvs*		at vmbus?		# Hyper-V StorVSC
 hvheartbeat*	at vmbus?		# Hyper-V Heartbeat Service

Index: src/sys/arch/x86/include/autoconf.h
diff -u src/sys/arch/x86/include/autoconf.h:1.5 src/sys/arch/x86/include/autoconf.h:1.6
--- src/sys/arch/x86/include/autoconf.h:1.5	Sat Dec 22 07:45:58 2018
+++ src/sys/arch/x86/include/autoconf.h	Fri May 24 14:28:48 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.h,v 1.5 2018/12/22 07:45:58 cherry Exp $ */
+/* $NetBSD: autoconf.h,v 1.6 2019/05/24 14:28:48 nonaka Exp $ */
 #ifndef _X86_AUTOCONF_H_
 #define _X86_AUTOCONF_H_
 
@@ -20,6 +20,8 @@ struct mainbus_softc {
 #endif
 };
 
+extern int x86_found_console;
+
 void device_pci_props_register(device_t, void *);
 device_t device_pci_register(device_t, void *);
 device_t device_isa_register(device_t, void *);

Index: src/sys/arch/x86/pci/pci_machdep.c
diff -u src/sys/arch/x86/pci/pci_machdep.c:1.85 src/sys/arch/x86/pci/pci_machdep.c:1.86
--- src/sys/arch/x86/pci/pci_machdep.c:1.85	Fri May 17 18:34:33 2019

Re: audio2

2019-05-24 Thread Tetsuya Isaki
At Fri, 24 May 2019 07:01:56 +,
m...@netbsd.org wrote:
> 
> we don't have anyone using the non-__GNUC__ case

This is C specification matter.  It's not important whether
such compiler really exist.

Thanks,
---
Tetsuya Isaki 



Re: audio2

2019-05-24 Thread Tetsuya Isaki
At Thu, 23 May 2019 17:08:42 +0300,
Valery Ushakov wrote:
> > +#if defined(__GNUC__)
> > +/* gcc defines '>>' as ASR. */
> > +#define AUDIO_ASR(value, shift)((value) >> (shift))
> > +#else
> > +#define AUDIO_ASR(value, shift)((value) / (1 << (shift)))
> > +#endif
> 
> This feels inverted.  The mathematically correct operation required
> here is symmetric division (that rounds towards zero).  Arithmetic
> shift is flooring division (that rounds towards minus infinity).

Both are not correct but are acceptable.

# I also used to feel that division is the correct operation.
# But I don't think so now.

For example, let's consider to convert 16bits to 15bits.
In case of round-to-zero,
 32767, 32766   => 16383
  :
 3, 2   => 1
 1, 0   => 0   < *1
 -1 => 0   < *1
 -2, -3 => -1
  :
 -32766, -32767 => -16383
 -32768 => -16384  < *2

In case of round-to-minus-inf,
 32767, 32766   => 16383
  :
 3, 2   => 1
 1, 0   => 0
 -1, -2 => -1
  :
 -32767, -32768 => -16384

As above, in round-to-zero, there are three inputs that output 0
(*1) and there are only one input that output -16384 (*2).
In contrast, in round-to-minus-inf, all outputs correspond to two
input values.

Which is "correct"?

The correct operation is not exist whenever rounding to integer
occurs.  And in audio area, we need to understand that both rounding
are not correct but are acceptable.

Furthermore, we have to consider that this operation is performed
in the bottom of loop in realtime mixing.  If both rounding are
acceptable, I'd like to use faster one.  Of course, unless it is
"undefined".

> So
> it feels confusing and wrong to *name* the operation the opposite of
> what it really is.

What I want to do here is arithmetic right shift operation and 2nd
argument in this macro indicates shift count.  So I named it ASR.

Thanks,
---
Tetsuya Isaki 



CVS commit: src/sys/arch/arm/altera

2019-05-24 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri May 24 10:37:39 UTC 2019

Modified Files:
src/sys/arch/arm/altera: cycv_dwcmmc.c

Log Message:
Use standard DT bindings for card detect


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/altera/cycv_dwcmmc.c

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

Modified files:

Index: src/sys/arch/arm/altera/cycv_dwcmmc.c
diff -u src/sys/arch/arm/altera/cycv_dwcmmc.c:1.2 src/sys/arch/arm/altera/cycv_dwcmmc.c:1.3
--- src/sys/arch/arm/altera/cycv_dwcmmc.c:1.2	Mon May 20 20:14:08 2019
+++ src/sys/arch/arm/altera/cycv_dwcmmc.c	Fri May 24 10:37:39 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: cycv_dwcmmc.c,v 1.2 2019/05/20 20:14:08 aymeric Exp $ */
+/* $NetBSD: cycv_dwcmmc.c,v 1.3 2019/05/24 10:37:39 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cycv_dwcmmc.c,v 1.2 2019/05/20 20:14:08 aymeric Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cycv_dwcmmc.c,v 1.3 2019/05/24 10:37:39 jmcneill Exp $");
 
 #include 
 #include 
@@ -47,8 +47,15 @@ __KERNEL_RCSID(0, "$NetBSD: cycv_dwcmmc.
 static int	cycv_dwcmmc_match(device_t, cfdata_t, void *);
 static void	cycv_dwcmmc_attach(device_t, device_t, void *);
 
+static int	cycv_dwcmmc_card_detect(struct dwc_mmc_softc *);
+
 struct cycv_dwcmmc_softc {
 	struct dwc_mmc_softc	sc;
+	int			sc_phandle;
+	bool			sc_non_removable;
+	bool			sc_broken_cd;
+	struct fdtbus_gpio_pin	*sc_gpio_cd;
+	bool			sc_gpio_cd_inverted;
 	struct clk		*sc_clk_biu;
 	struct clk		*sc_clk_ciu;
 };
@@ -128,9 +135,16 @@ cycv_dwcmmc_attach(device_t parent, devi
 	sc->sc_fifo_reg = FIFO_REG;
 	sc->sc_flags = DWC_MMC_F_USE_HOLD_REG | DWC_MMC_F_DMA;
 
-	sc->sc_card_detect = NULL;
+	sc->sc_card_detect = cycv_dwcmmc_card_detect;
 	sc->sc_write_protect = NULL;
 
+	esc->sc_phandle = phandle;
+	esc->sc_gpio_cd = fdtbus_gpio_acquire(phandle, "cd-gpios", GPIO_PIN_INPUT);
+	esc->sc_gpio_cd_inverted = of_hasprop(phandle, "cd-inverted") ? 0 : 1;
+
+	esc->sc_non_removable = of_hasprop(phandle, "non-removable");
+	esc->sc_broken_cd = of_hasprop(phandle, "broken-cd");
+
 	aprint_naive("\n");
 	aprint_normal(": MHS (%u Hz)\n", sc->sc_clock_freq);
 
@@ -151,3 +165,21 @@ cycv_dwcmmc_attach(device_t parent, devi
 	}
 	aprint_normal_dev(self, "interrupting on %s\n", intrstr);
 }
+
+static int
+cycv_dwcmmc_card_detect(struct dwc_mmc_softc *sc)
+{
+	struct cycv_dwcmmc_softc *esc = device_private(sc->sc_dev);
+	int val;
+
+	if (esc->sc_non_removable || esc->sc_broken_cd) {
+		return 1;
+	} else if (esc->sc_gpio_cd != NULL) {
+		val = fdtbus_gpio_read(esc->sc_gpio_cd);
+		if (esc->sc_gpio_cd_inverted)
+			val = !val;
+		return val;
+	} else {
+		return 1;
+	}
+}



CVS commit: src/share/misc

2019-05-24 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Fri May 24 10:08:46 UTC 2019

Modified Files:
src/share/misc: acronyms

Log Message:
ALPR ANPR AVI CPR LPR MLPR VLPR VRI


To generate a diff of this commit:
cvs rdiff -u -r1.281 -r1.282 src/share/misc/acronyms

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

Modified files:

Index: src/share/misc/acronyms
diff -u src/share/misc/acronyms:1.281 src/share/misc/acronyms:1.282
--- src/share/misc/acronyms:1.281	Wed Apr 17 17:44:51 2019
+++ src/share/misc/acronyms	Fri May 24 10:08:46 2019
@@ -1,4 +1,4 @@
-$NetBSD: acronyms,v 1.281 2019/04/17 17:44:51 sevan Exp $
+$NetBSD: acronyms,v 1.282 2019/05/24 10:08:46 sevan Exp $
 10Q	thank you
 10X	thanks
 1337	elite ("leet")
@@ -31,9 +31,11 @@ AISE	as I see it
 AIU	as I understand
 AIUI	as I understand it
 AKA	also known as
+ALPR	automatic license plate recognition
 AM	ante meridiem
 AMA	ask me anything
 AMOL	a mountain of love
+ANPR	automatic number plate recognition
 APM	alternative payment model
 ASAIC	as soon as I can
 ASAP	as soon as possible
@@ -42,6 +44,7 @@ ATEOTD	at the end of the day
 ATM	at the moment
 ATM	{automated,automatic} teller machine
 ATW	around the world
+AVI	automatic vehicle identification
 AWK	Aho, Weinberger, [and] Kernighan
 AWOL	absent without official leave
 AYBABTU	all your base are belong to us
@@ -97,6 +100,7 @@ COB	close of business [day]
 COTS	commercial off-the-shelf
 CPC	cost per click
 CPE	customer premises equipment
+CPR	car plate recognition
 CRM	customer relationship management
 CTF	capture the flag
 CTN	can't talk now
@@ -329,6 +333,7 @@ LMSO	laughing my socks off
 LOIC	low orbit ion cannon
 LOL	laughing out loud
 LP	long playing [record]
+LPR	license plate recognition
 LTNS	long time no see
 LWYL	laugh with you later
 M	management & operations
@@ -337,6 +342,7 @@ MAD	mutually assured destruction
 MBA	master of business administration
 MFW	my face when
 MIA	missing in action
+MLPR	mobile license plate reader
 MMB	message me back
 MO	modus operandi
 MOTAS	member of the appropriate sex
@@ -567,6 +573,8 @@ VCR	video cassette recorder
 VEG	very evil grin
 VIP	very important person
 VLA	variable length array
+VLPR	vehicle license plate recognition
+VRI	vehicle recognition identification
 W/	with
 W/E	whatever
 W/O	without



CVS commit: src/share/misc

2019-05-24 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Fri May 24 10:08:46 UTC 2019

Modified Files:
src/share/misc: acronyms

Log Message:
ALPR ANPR AVI CPR LPR MLPR VLPR VRI


To generate a diff of this commit:
cvs rdiff -u -r1.281 -r1.282 src/share/misc/acronyms

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



CVS commit: src/sys/arch/vax/conf

2019-05-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri May 24 08:30:26 UTC 2019

Modified Files:
src/sys/arch/vax/conf: GENERIC

Log Message:
 Add il(4). Commented out.


To generate a diff of this commit:
cvs rdiff -u -r1.210 -r1.211 src/sys/arch/vax/conf/GENERIC

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

Modified files:

Index: src/sys/arch/vax/conf/GENERIC
diff -u src/sys/arch/vax/conf/GENERIC:1.210 src/sys/arch/vax/conf/GENERIC:1.211
--- src/sys/arch/vax/conf/GENERIC:1.210	Fri Apr 26 21:40:32 2019
+++ src/sys/arch/vax/conf/GENERIC	Fri May 24 08:30:26 2019
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.210 2019/04/26 21:40:32 sevan Exp $
+# $NetBSD: GENERIC,v 1.211 2019/05/24 08:30:26 msaitoh Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include 	"arch/vax/conf/std.vax"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.210 $"
+#ident 		"GENERIC-$Revision: 1.211 $"
 
 # Here are all different supported CPU types listed.
 #options 	VAX8800		# VAX 8500, 8530, 8550, 8700, 8800
@@ -230,6 +230,7 @@ hp*		at mba? drive?		# RM/RP disk drives
 # Devices on Unibus/Qbus adapters
 uda*		at uba?	csr 0172150	# UDA50/RQDX?
 uda*		at uba?	csr 0160334
+#il*		at uba?	csr 0164000	# NI1010
 mtc*		at uba? csr 0174500	# Tape MSCP ctlr
 ts0		at uba? csr 0172520	# TS11/TSV05 tape.
 #qd0		at uba? csr 0177400	# 4- or 8-bitplans color graphics



CVS commit: src/sys/arch/vax/conf

2019-05-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri May 24 08:30:26 UTC 2019

Modified Files:
src/sys/arch/vax/conf: GENERIC

Log Message:
 Add il(4). Commented out.


To generate a diff of this commit:
cvs rdiff -u -r1.210 -r1.211 src/sys/arch/vax/conf/GENERIC

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



CVS commit: src/sys/dev/qbus

2019-05-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri May 24 08:29:17 UTC 2019

Modified Files:
src/sys/dev/qbus: if_il.c

Log Message:
 Make if_il.c compilable again.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/qbus/if_il.c

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

Modified files:

Index: src/sys/dev/qbus/if_il.c
diff -u src/sys/dev/qbus/if_il.c:1.33 src/sys/dev/qbus/if_il.c:1.34
--- src/sys/dev/qbus/if_il.c:1.33	Fri May 24 08:27:44 2019
+++ src/sys/dev/qbus/if_il.c	Fri May 24 08:29:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_il.c,v 1.33 2019/05/24 08:27:44 msaitoh Exp $	*/
+/*	$NetBSD: if_il.c,v 1.34 2019/05/24 08:29:17 msaitoh Exp $	*/
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_il.c,v 1.33 2019/05/24 08:27:44 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_il.c,v 1.34 2019/05/24 08:29:17 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -116,7 +116,7 @@ static	void ilattach(device_t, device_t,
 static	void ilcint(void *);
 static	void ilrint(void *);
 static	void ilreset(device_t);
-static	int ilwait(struct il_softc *, char *);
+static	int ilwait(struct il_softc *, const char *);
 static	int ilinit(struct ifnet *);
 static	void ilstart(struct ifnet *);
 static	void ilwatch(struct ifnet *);
@@ -137,12 +137,11 @@ int
 ilmatch(device_t parent, cfdata_t cf, void *aux)
 {
 	struct uba_attach_args *ua = aux;
-	volatile int i;
 
 	bus_space_write_2(ua->ua_iot, ua->ua_ioh, IL_CSR,
 	ILC_OFFLINE | IL_CIE);
 	DELAY(10);
-	i = bus_space_read_2(ua->ua_iot, ua->ua_ioh, IL_CSR); /* clear CDONE */
+	bus_space_read_2(ua->ua_iot, ua->ua_ioh, IL_CSR); /* clear CDONE */
 
 	return 1;
 }
@@ -202,7 +201,7 @@ ilattach(device_t parent, device_t self,
 
 	strlcpy(ifp->if_xname, device_xname(sc->sc_dev), IFNAMSIZ);
 	ifp->if_softc = sc;
-	ifp->if_flags = IFF_BROADCAST;
+	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
 	ifp->if_init = ilinit;
 	ifp->if_stop = ilstop;
 	ifp->if_ioctl = ether_ioctl;
@@ -224,7 +223,7 @@ ilstop(struct ifnet *ifp, int a)
 
 
 int
-ilwait(struct il_softc *sc, char *op)
+ilwait(struct il_softc *sc, const char *op)
 {
 
 	while ((IL_RCSR(IL_CSR)_CDONE) == 0)
@@ -325,19 +324,18 @@ ilinit(struct ifnet *ifp)
 			goto out;
 		}
 	}
-#ifdef MULTICAST
-	if (is->is_if.if_flags & IFF_PROMISC) {
-		addr->il_csr = ILC_PRMSC;
-		if (ilwait(ui, "all multi"))
+	if (sc->sc_if.if_flags & IFF_PROMISC) {
+		IL_WCSR(IL_CSR, ILC_PRMSC);
+		if (ilwait(sc, "all multi"))
 			goto out;
-	} else if (is->is_if.if_flags & IFF_ALLMULTI) {
-	too_many_multis:
-		addr->il_csr = ILC_ALLMC;
-		if (ilwait(ui, "all multi"))
+	} else if (sc->sc_if.if_flags & IFF_ALLMULTI) {
+too_many_multis:
+		IL_WCSR(IL_CSR, ILC_ALLMC);
+		if (ilwait(sc, "all multi"))
 			goto out;
 	} else {
 		int i;
-		register struct ether_addr *ep = is->is_maddrs;
+		register struct ether_addr *ep = sc->sc_maddrs;
 		struct ether_multi *enm;
 		struct ether_multistep step;
 		/*
@@ -347,29 +345,28 @@ ilinit(struct ifnet *ifp)
 		 * multicasts.
 		 */
 		i = 0;
-		ETHER_FIRST_MULTI(step, >is_ac, enm);
+		ETHER_FIRST_MULTI(step, >sc_ec, enm);
 		while (enm != NULL) {
-			if (++i > 63 && k != 0) {
+			if (++i > 63 /* && k != 0 */) {
 break;
 			}
 			*ep++ = *(struct ether_addr *)enm->enm_addrlo;
 			ETHER_NEXT_MULTI(step, enm);
 		}
-		if (i = 0) {
+		if (i == 0) {
 			/* no multicasts! */
 		} else if (i <= 63) {
-			addr->il_bar = is->is_ubaddr & 0x;
-			addr->il_bcr = i * sizeof (struct ether_addr);
-			addr->il_csr = ((is->is_ubaddr >> 2) & IL_EUA)|
-		LC_LDGRPS;
-			if (ilwait(ui, "load multi"))
+			IL_WCSR(IL_BAR, sc->sc_ubaddr & 0x);
+			IL_WCSR(IL_BCR, i * sizeof(struct ether_addr));
+			IL_WCSR(IL_CSR,
+			((sc->sc_ubaddr >> 2) & IL_EUA) | ILC_LDGRPS);
+			if (ilwait(sc, "load multi"))
 goto out;
 		} else {
-		is->is_if.if_flags |= IFF_ALLMULTI;
-		goto too_many_multis;
+			sc->sc_if.if_flags |= IFF_ALLMULTI;
+			goto too_many_multis;
 		}
 	}
-#endif /* MULTICAST */
 	/*
 	 * Set board online.
 	 * Hang receive buffer and start any pending



CVS commit: src/sys/dev/qbus

2019-05-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri May 24 08:29:17 UTC 2019

Modified Files:
src/sys/dev/qbus: if_il.c

Log Message:
 Make if_il.c compilable again.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/qbus/if_il.c

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



CVS commit: src/sys/dev/qbus

2019-05-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri May 24 08:27:44 UTC 2019

Modified Files:
src/sys/dev/qbus: if_il.c

Log Message:
 Revert previous.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/qbus/if_il.c

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

Modified files:

Index: src/sys/dev/qbus/if_il.c
diff -u src/sys/dev/qbus/if_il.c:1.32 src/sys/dev/qbus/if_il.c:1.33
--- src/sys/dev/qbus/if_il.c:1.32	Fri May 24 08:22:05 2019
+++ src/sys/dev/qbus/if_il.c	Fri May 24 08:27:44 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_il.c,v 1.32 2019/05/24 08:22:05 msaitoh Exp $	*/
+/*	$NetBSD: if_il.c,v 1.33 2019/05/24 08:27:44 msaitoh Exp $	*/
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_il.c,v 1.32 2019/05/24 08:22:05 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_il.c,v 1.33 2019/05/24 08:27:44 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -202,7 +202,7 @@ ilattach(device_t parent, device_t self,
 
 	strlcpy(ifp->if_xname, device_xname(sc->sc_dev), IFNAMSIZ);
 	ifp->if_softc = sc;
-	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
+	ifp->if_flags = IFF_BROADCAST;
 	ifp->if_init = ilinit;
 	ifp->if_stop = ilstop;
 	ifp->if_ioctl = ether_ioctl;
@@ -325,20 +325,19 @@ ilinit(struct ifnet *ifp)
 			goto out;
 		}
 	}
-
-	if (sc->sc_if.if_flags & IFF_PROMISC) {
+#ifdef MULTICAST
+	if (is->is_if.if_flags & IFF_PROMISC) {
 		addr->il_csr = ILC_PRMSC;
 		if (ilwait(ui, "all multi"))
 			goto out;
-	} else if (sc->sc_if.if_flags & IFF_ALLMULTI) {
-too_many_multis:
+	} else if (is->is_if.if_flags & IFF_ALLMULTI) {
+	too_many_multis:
 		addr->il_csr = ILC_ALLMC;
 		if (ilwait(ui, "all multi"))
 			goto out;
 	} else {
 		int i;
-		struct ethercom *ec = >sc_ec;
-		register struct ether_addr *ep = sc->sc_maddrs;
+		register struct ether_addr *ep = is->is_maddrs;
 		struct ether_multi *enm;
 		struct ether_multistep step;
 		/*
@@ -348,8 +347,7 @@ too_many_multis:
 		 * multicasts.
 		 */
 		i = 0;
-		ETHER_LOCK(ec);
-		ETHER_FIRST_MULTI(step, ec, enm);
+		ETHER_FIRST_MULTI(step, >is_ac, enm);
 		while (enm != NULL) {
 			if (++i > 63 && k != 0) {
 break;
@@ -357,22 +355,21 @@ too_many_multis:
 			*ep++ = *(struct ether_addr *)enm->enm_addrlo;
 			ETHER_NEXT_MULTI(step, enm);
 		}
-		ETHER_UNLOCK(ec);
 		if (i = 0) {
 			/* no multicasts! */
 		} else if (i <= 63) {
-			addr->il_bar = sc->sc_ubaddr & 0x;
+			addr->il_bar = is->is_ubaddr & 0x;
 			addr->il_bcr = i * sizeof (struct ether_addr);
-			addr->il_csr = ((sc->sc_ubaddr >> 2) & IL_EUA) |
+			addr->il_csr = ((is->is_ubaddr >> 2) & IL_EUA)|
 		LC_LDGRPS;
 			if (ilwait(ui, "load multi"))
 goto out;
 		} else {
-			sc->sc_if.if_flags |= IFF_ALLMULTI;
-			goto too_many_multis;
+		is->is_if.if_flags |= IFF_ALLMULTI;
+		goto too_many_multis;
 		}
 	}
-
+#endif /* MULTICAST */
 	/*
 	 * Set board online.
 	 * Hang receive buffer and start any pending



CVS commit: src/sys/dev/qbus

2019-05-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri May 24 08:27:44 UTC 2019

Modified Files:
src/sys/dev/qbus: if_il.c

Log Message:
 Revert previous.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/qbus/if_il.c

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



CVS commit: src/sys/dev/qbus

2019-05-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri May 24 08:22:05 UTC 2019

Modified Files:
src/sys/dev/qbus: if_il.c

Log Message:
 Make it compilable. Not tested.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/qbus/if_il.c

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



CVS commit: src/sys/dev/qbus

2019-05-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri May 24 08:22:05 UTC 2019

Modified Files:
src/sys/dev/qbus: if_il.c

Log Message:
 Make it compilable. Not tested.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/qbus/if_il.c

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

Modified files:

Index: src/sys/dev/qbus/if_il.c
diff -u src/sys/dev/qbus/if_il.c:1.31 src/sys/dev/qbus/if_il.c:1.32
--- src/sys/dev/qbus/if_il.c:1.31	Thu May 23 13:10:52 2019
+++ src/sys/dev/qbus/if_il.c	Fri May 24 08:22:05 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_il.c,v 1.31 2019/05/23 13:10:52 msaitoh Exp $	*/
+/*	$NetBSD: if_il.c,v 1.32 2019/05/24 08:22:05 msaitoh Exp $	*/
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_il.c,v 1.31 2019/05/23 13:10:52 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_il.c,v 1.32 2019/05/24 08:22:05 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -202,7 +202,7 @@ ilattach(device_t parent, device_t self,
 
 	strlcpy(ifp->if_xname, device_xname(sc->sc_dev), IFNAMSIZ);
 	ifp->if_softc = sc;
-	ifp->if_flags = IFF_BROADCAST;
+	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
 	ifp->if_init = ilinit;
 	ifp->if_stop = ilstop;
 	ifp->if_ioctl = ether_ioctl;
@@ -325,19 +325,20 @@ ilinit(struct ifnet *ifp)
 			goto out;
 		}
 	}
-#ifdef MULTICAST
-	if (is->is_if.if_flags & IFF_PROMISC) {
+
+	if (sc->sc_if.if_flags & IFF_PROMISC) {
 		addr->il_csr = ILC_PRMSC;
 		if (ilwait(ui, "all multi"))
 			goto out;
-	} else if (is->is_if.if_flags & IFF_ALLMULTI) {
-	too_many_multis:
+	} else if (sc->sc_if.if_flags & IFF_ALLMULTI) {
+too_many_multis:
 		addr->il_csr = ILC_ALLMC;
 		if (ilwait(ui, "all multi"))
 			goto out;
 	} else {
 		int i;
-		register struct ether_addr *ep = is->is_maddrs;
+		struct ethercom *ec = >sc_ec;
+		register struct ether_addr *ep = sc->sc_maddrs;
 		struct ether_multi *enm;
 		struct ether_multistep step;
 		/*
@@ -347,7 +348,8 @@ ilinit(struct ifnet *ifp)
 		 * multicasts.
 		 */
 		i = 0;
-		ETHER_FIRST_MULTI(step, >is_ac, enm);
+		ETHER_LOCK(ec);
+		ETHER_FIRST_MULTI(step, ec, enm);
 		while (enm != NULL) {
 			if (++i > 63 && k != 0) {
 break;
@@ -355,21 +357,22 @@ ilinit(struct ifnet *ifp)
 			*ep++ = *(struct ether_addr *)enm->enm_addrlo;
 			ETHER_NEXT_MULTI(step, enm);
 		}
+		ETHER_UNLOCK(ec);
 		if (i = 0) {
 			/* no multicasts! */
 		} else if (i <= 63) {
-			addr->il_bar = is->is_ubaddr & 0x;
+			addr->il_bar = sc->sc_ubaddr & 0x;
 			addr->il_bcr = i * sizeof (struct ether_addr);
-			addr->il_csr = ((is->is_ubaddr >> 2) & IL_EUA)|
+			addr->il_csr = ((sc->sc_ubaddr >> 2) & IL_EUA) |
 		LC_LDGRPS;
 			if (ilwait(ui, "load multi"))
 goto out;
 		} else {
-		is->is_if.if_flags |= IFF_ALLMULTI;
-		goto too_many_multis;
+			sc->sc_if.if_flags |= IFF_ALLMULTI;
+			goto too_many_multis;
 		}
 	}
-#endif /* MULTICAST */
+
 	/*
 	 * Set board online.
 	 * Hang receive buffer and start any pending



CVS commit: src/sys/dev/ic

2019-05-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri May 24 07:34:51 UTC 2019

Modified Files:
src/sys/dev/ic: athn.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/ic/athn.c

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



CVS commit: src/sys/dev/ic

2019-05-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri May 24 07:34:51 UTC 2019

Modified Files:
src/sys/dev/ic: athn.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/ic/athn.c

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

Modified files:

Index: src/sys/dev/ic/athn.c
diff -u src/sys/dev/ic/athn.c:1.18 src/sys/dev/ic/athn.c:1.19
--- src/sys/dev/ic/athn.c:1.18	Tue Jun 26 06:48:00 2018
+++ src/sys/dev/ic/athn.c	Fri May 24 07:34:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: athn.c,v 1.18 2018/06/26 06:48:00 msaitoh Exp $	*/
+/*	$NetBSD: athn.c,v 1.19 2019/05/24 07:34:51 msaitoh Exp $	*/
 /*	$OpenBSD: athn.c,v 1.83 2014/07/22 13:12:11 mpi Exp $	*/
 
 /*-
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: athn.c,v 1.18 2018/06/26 06:48:00 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: athn.c,v 1.19 2019/05/24 07:34:51 msaitoh Exp $");
 
 #ifndef _MODULE
 #include "athn_usb.h"		/* for NATHN_USB */
@@ -249,8 +249,7 @@ athn_attach(struct athn_softc *sc)
 		sc->sc_mac_rev,
 		sc->sc_ntxchains, sc->sc_nrxchains, sc->sc_eep_rev,
 		ether_sprintf(ic->ic_myaddr));
-	}
-	else {
+	} else {
 		aprint_normal(": Atheros %s, RF %s\n", athn_get_mac_name(sc),
 		athn_get_rf_name(sc));
 		aprint_verbose_dev(sc->sc_dev,
@@ -612,8 +611,7 @@ athn_get_chipid(struct athn_softc *sc)
 		sc->sc_mac_rev = MS(reg, AR_SREV_REVISION2);
 		if (!(reg & AR_SREV_TYPE2_HOST_MODE))
 			sc->sc_flags |= ATHN_FLAG_PCIE;
-	}
-	else {
+	} else {
 		sc->sc_mac_ver = MS(reg, AR_SREV_VERSION);
 		sc->sc_mac_rev = MS(reg, AR_SREV_REVISION);
 		if (sc->sc_mac_ver == AR_SREV_VERSION_5416_PCIE)
@@ -721,8 +719,7 @@ athn_reset(struct athn_softc *sc, int co
 		AR_WRITE(sc, AR_INTR_SYNC_ENABLE, 0);
 		AR_WRITE(sc, AR_RC, AR_RC_HOSTIF |
 		(!AR_SREV_9380_10_OR_LATER(sc) ? AR_RC_AHB : 0));
-	}
-	else if (!AR_SREV_9380_10_OR_LATER(sc))
+	} else if (!AR_SREV_9380_10_OR_LATER(sc))
 		AR_WRITE(sc, AR_RC, AR_RC_AHB);
 
 	AR_WRITE(sc, AR_RTC_RC, AR_RTC_RC_MAC_WARM |
@@ -808,8 +805,7 @@ athn_init_pll(struct athn_softc *sc, con
 			AR_WRITE(sc, AR_RTC_PLL_CONTROL2, 0x88);
 		pll = SM(AR_RTC_9160_PLL_REFDIV, 0x5);
 		pll |= SM(AR_RTC_9160_PLL_DIV, 0x2c);
-	}
-	else if (AR_SREV_9280_10_OR_LATER(sc)) {
+	} else if (AR_SREV_9280_10_OR_LATER(sc)) {
 		pll = SM(AR_RTC_9160_PLL_REFDIV, 0x05);
 		if (c != NULL && IEEE80211_IS_CHAN_5GHZ(c)) {
 			if (sc->sc_flags & ATHN_FLAG_FAST_PLL_CLOCK)
@@ -818,18 +814,15 @@ athn_init_pll(struct athn_softc *sc, con
 		 		pll = 0x2850;
 			else
 pll |= SM(AR_RTC_9160_PLL_DIV, 0x28);
-		}
-		else
+		} else
 			pll |= SM(AR_RTC_9160_PLL_DIV, 0x2c);
-	}
-	else if (AR_SREV_9160_10_OR_LATER(sc)) {
+	} else if (AR_SREV_9160_10_OR_LATER(sc)) {
 		pll = SM(AR_RTC_9160_PLL_REFDIV, 0x05);
 		if (c != NULL && IEEE80211_IS_CHAN_5GHZ(c))
 			pll |= SM(AR_RTC_9160_PLL_DIV, 0x50);
 		else
 			pll |= SM(AR_RTC_9160_PLL_DIV, 0x58);
-	}
-	else {
+	} else {
 		pll = AR_RTC_PLL_REFDIV_5 | AR_RTC_PLL_DIV2;
 		if (c != NULL && IEEE80211_IS_CHAN_5GHZ(c))
 			pll |= SM(AR_RTC_PLL_DIV, 0x0a);
@@ -1105,8 +1098,7 @@ athn_set_key(struct ieee80211com *ic, st
 		if (ic->ic_opmode == IEEE80211_M_HOSTAP) {
 			txmic = [16];
 			rxmic = [24];
-		}
-		else
+		} else
 #endif
 		{
 			rxmic = [16];
@@ -1138,8 +1130,7 @@ athn_set_key(struct ieee80211com *ic, st
 		hi = LE_READ_2([4]);
 		lo = lo >> 1 | hi << 31;
 		hi = hi >> 1;
-	}
-	else
+	} else
 		lo = hi = 0;
 	AR_WRITE(sc, AR_KEYTABLE_MAC0(entry), lo);
 	AR_WRITE(sc, AR_KEYTABLE_MAC1(entry), hi | AR_KEYTABLE_VALID);
@@ -1214,8 +1205,7 @@ athn_btcoex_init(struct athn_softc *sc)
 		AR_WRITE_BARRIER(sc);
 
 		ops->gpio_config_input(sc, AR_GPIO_BTACTIVE_PIN);
-	}
-	else {	/* 3-wire. */
+	} else {	/* 3-wire. */
 		AR_SETBITS(sc, sc->sc_gpio_input_en_off,
 		AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB |
 		AR_GPIO_INPUT_EN_VAL_BT_ACTIVE_BB);
@@ -1261,8 +1251,7 @@ athn_btcoex_enable(struct athn_softc *sc
 		ops->gpio_config_output(sc, AR_GPIO_WLANACTIVE_PIN,
 		AR_GPIO_OUTPUT_MUX_AS_RX_CLEAR_EXTERNAL);
 
-	}
-	else {	/* 2-wire. */
+	} else {	/* 2-wire. */
 		ops->gpio_config_output(sc, AR_GPIO_WLANACTIVE_PIN,
 		AR_GPIO_OUTPUT_MUX_AS_TX_FRAME);
 	}
@@ -1390,8 +1379,7 @@ athn_init_calib(struct athn_softc *sc, s
 		if (AR_SREV_9380_10_OR_LATER(sc)) {
 			/* Support temperature compensation calibration. */
 			sc->sc_sup_calib_mask |= ATHN_CAL_TEMP;
-		}
-		else if (IEEE80211_IS_CHAN_5GHZ(curchan) || extchan != NULL) {
+		} else if (IEEE80211_IS_CHAN_5GHZ(curchan) || extchan != NULL) {
 			/*
 			 * ADC gain calibration causes uplink throughput
 			 * drops in HT40 mode on AR9287.
@@ -1461,13 +1449,11 @@ athn_ani_ofdm_err_trigger(struct athn_so
 			ops->disable_ofdm_weak_signal(sc);
 			ani->spur_immunity_level = 0;
 			ops->set_spur_immunity_level(sc, 0);
-		}
-		else if (ani->firstep_level < 2) {
+		} else if (ani->firstep_level < 2) {
 			

Re: audio2

2019-05-24 Thread maya
we don't have anyone using the non-__GNUC__ case


CVS commit: src/sys/dev

2019-05-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri May 24 06:26:39 UTC 2019

Modified Files:
src/sys/dev/ic: elink3.c gem.c
src/sys/dev/marvell: if_mvxpe.c
src/sys/dev/pci: if_bnxreg.h

Log Message:
 Whilespace fix. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/sys/dev/ic/elink3.c
cvs rdiff -u -r1.117 -r1.118 src/sys/dev/ic/gem.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/marvell/if_mvxpe.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/if_bnxreg.h

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

Modified files:

Index: src/sys/dev/ic/elink3.c
diff -u src/sys/dev/ic/elink3.c:1.147 src/sys/dev/ic/elink3.c:1.148
--- src/sys/dev/ic/elink3.c:1.147	Mon Apr 22 07:51:16 2019
+++ src/sys/dev/ic/elink3.c	Fri May 24 06:26:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: elink3.c,v 1.147 2019/04/22 07:51:16 msaitoh Exp $	*/
+/*	$NetBSD: elink3.c,v 1.148 2019/05/24 06:26:38 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: elink3.c,v 1.147 2019/04/22 07:51:16 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: elink3.c,v 1.148 2019/05/24 06:26:38 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -363,7 +363,7 @@ epconfig(struct ep_softc *sc, u_short ch
 	GO_WINDOW(5);
 	i = bus_space_read_2(iot, ioh, ELINK_W5_TX_AVAIL_THRESH);
 	GO_WINDOW(1);
-	switch (i)  {
+	switch (i) {
 	case ELINK_LARGEWIN_PROBE:
 	case (ELINK_LARGEWIN_PROBE & ELINK_LARGEWIN_MASK):
 		sc->ep_pktlenshift = 0;
@@ -1179,9 +1179,9 @@ startagain:
 	bus_space_write_2(iot, ioh, txreg, 0x); /* Second is meaningless */
 	if (ELINK_IS_BUS_32(sc->bustype)) {
 		for (m = m0; m;) {
-			if (m->m_len > 3)  {
+			if (m->m_len > 3) {
 /* align our reads from core */
-if (mtod(m, u_long) & 3)  {
+if (mtod(m, u_long) & 3) {
 	u_long count =
 	4 - (mtod(m, u_long) & 3);
 	bus_space_write_multi_1(iot, ioh,
@@ -1196,7 +1196,7 @@ startagain:
 	(u_long)(m->m_len & ~3));
 m->m_len -= m->m_len & ~3;
 			}
-			if (m->m_len)  {
+			if (m->m_len) {
 bus_space_write_multi_1(iot, ioh,
 txreg, mtod(m, u_int8_t *), m->m_len);
 			}
@@ -1204,8 +1204,8 @@ startagain:
 		}
 	} else {
 		for (m = m0; m;) {
-			if (m->m_len > 1)  {
-if (mtod(m, u_long) & 1)  {
+			if (m->m_len > 1) {
+if (mtod(m, u_long) & 1) {
 	bus_space_write_1(iot, ioh,
 	txreg, *(mtod(m, u_int8_t *)));
 	m->m_data =
@@ -1216,7 +1216,7 @@ startagain:
 txreg, mtod(m, u_int16_t *),
 m->m_len >> 1);
 			}
-			if (m->m_len & 1)  {
+			if (m->m_len & 1) {
 bus_space_write_1(iot, ioh, txreg,
  *(mtod(m, u_int8_t *) + m->m_len - 1));
 			}
@@ -1614,7 +1614,7 @@ epget(struct ep_softc *sc, int totlen)
 		 * (We can align to 4 bytes, rather than ALIGNBYTES,
 		 * here because we're later reading 4-byte chunks.)
 		 */
-		if ((remaining > 3) && (offset & 3))  {
+		if ((remaining > 3) && (offset & 3)) {
 			int count = (4 - (offset & 3));
 			bus_space_read_multi_1(iot, ioh,
 			rxreg, (u_int8_t *) offset, count);
@@ -1628,12 +1628,12 @@ epget(struct ep_softc *sc, int totlen)
 			offset += remaining & ~3;
 			remaining &= 3;
 		}
-		if (remaining)  {
+		if (remaining) {
 			bus_space_read_multi_1(iot, ioh,
 			rxreg, (u_int8_t *) offset, remaining);
 		}
 	} else {
-		if ((remaining > 1) && (offset & 1))  {
+		if ((remaining > 1) && (offset & 1)) {
 			bus_space_read_multi_1(iot, ioh,
 			rxreg, (u_int8_t *) offset, 1);
 			remaining -= 1;
@@ -1645,7 +1645,7 @@ epget(struct ep_softc *sc, int totlen)
 			remaining >> 1);
 			offset += remaining & ~1;
 		}
-		if (remaining & 1)  {
+		if (remaining & 1) {
 bus_space_read_multi_1(iot, ioh,
 			rxreg, (u_int8_t *) offset, remaining & 1);
 		}

Index: src/sys/dev/ic/gem.c
diff -u src/sys/dev/ic/gem.c:1.117 src/sys/dev/ic/gem.c:1.118
--- src/sys/dev/ic/gem.c:1.117	Thu May 23 10:51:39 2019
+++ src/sys/dev/ic/gem.c	Fri May 24 06:26:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: gem.c,v 1.117 2019/05/23 10:51:39 msaitoh Exp $ */
+/*	$NetBSD: gem.c,v 1.118 2019/05/24 06:26:38 msaitoh Exp $ */
 
 /*
  *
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.117 2019/05/23 10:51:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.118 2019/05/24 06:26:38 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -1326,7 +1326,7 @@ gem_init_regs(struct gem_softc *sc)
 	 */
 	sc->sc_mif_config = bus_space_read_4(t, h, GEM_MIF_CONFIG);
 	v = GEM_MAC_XIF_TX_MII_ENA;
-	if ((sc->sc_flags & (GEM_SERDES | GEM_SERIAL)) == 0)  {
+	if ((sc->sc_flags & (GEM_SERDES | GEM_SERIAL)) == 0) {
 		if (sc->sc_mif_config & GEM_MIF_CONFIG_MDI1) {
 			v |= GEM_MAC_XIF_FDPLX_LED;
 if (sc->sc_flags & GEM_GIGABIT)

Index: src/sys/dev/marvell/if_mvxpe.c
diff -u src/sys/dev/marvell/if_mvxpe.c:1.25 src/sys/dev/marvell/if_mvxpe.c:1.26
--- src/sys/dev/marvell/if_mvxpe.c:1.25	

CVS commit: src/sys/dev

2019-05-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri May 24 06:26:39 UTC 2019

Modified Files:
src/sys/dev/ic: elink3.c gem.c
src/sys/dev/marvell: if_mvxpe.c
src/sys/dev/pci: if_bnxreg.h

Log Message:
 Whilespace fix. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/sys/dev/ic/elink3.c
cvs rdiff -u -r1.117 -r1.118 src/sys/dev/ic/gem.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/marvell/if_mvxpe.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/if_bnxreg.h

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



CVS commit: src/sys/dev/ata

2019-05-24 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri May 24 06:01:06 UTC 2019

Modified Files:
src/sys/dev/ata: wd.c

Log Message:
Also schedule timeouts when all openings are in use.


To generate a diff of this commit:
cvs rdiff -u -r1.449 -r1.450 src/sys/dev/ata/wd.c

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

Modified files:

Index: src/sys/dev/ata/wd.c
diff -u src/sys/dev/ata/wd.c:1.449 src/sys/dev/ata/wd.c:1.450
--- src/sys/dev/ata/wd.c:1.449	Sun Apr  7 13:00:00 2019
+++ src/sys/dev/ata/wd.c	Fri May 24 06:01:05 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: wd.c,v 1.449 2019/04/07 13:00:00 bouyer Exp $ */
+/*	$NetBSD: wd.c,v 1.450 2019/05/24 06:01:05 mlelstv Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.449 2019/04/07 13:00:00 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.450 2019/05/24 06:01:05 mlelstv Exp $");
 
 #include "opt_ata.h"
 #include "opt_wd.h"
@@ -757,6 +757,7 @@ wd_diskstart(device_t dev, struct buf *b
 	struct ata_xfer *xfer;
 	struct ata_channel *chp;
 	unsigned openings;
+	int ticks;
 
 	mutex_enter(>sc_lock);
 
@@ -769,22 +770,37 @@ wd_diskstart(device_t dev, struct buf *b
 	openings = uimin(openings, wd->drvp->drv_openings);
 
 	if (wd->inflight >= openings) {
-		mutex_exit(>sc_lock);
-		return EAGAIN;
+		/*
+		 * pretend we run out of memory when the queue is full,
+		 * so that the operation is retried after a minimal
+		 * delay.
+		 */
+		xfer = NULL;
+		ticks = 1;
+	} else {
+		/*
+		 * If there is no available memory, retry later. This
+		 * happens very rarely and only under memory pressure,
+		 * so wait relatively long before retry.
+		 */
+		xfer = ata_get_xfer(chp, false);
+		ticks = hz/2;
 	}
 
-	xfer = ata_get_xfer(chp, false);
 	if (xfer == NULL) {
 		ATADEBUG_PRINT(("wd_diskstart %s no xfer\n",
 		dksc->sc_xname), DEBUG_XFERS);
 
 		/*
-		 * No available memory, retry later. This happens very rarely
-		 * and only under memory pressure, so wait relatively long
-		 * before retry.
+		 * The disk queue is pushed automatically when an I/O
+		 * operation finishes or another one is queued. We
+		 * need this extra timeout because an ATA channel
+		 * might be shared by more than one disk queue and
+		 * all queues need to be restarted when another slot
+		 * becomes available.
 		 */
 		if (!callout_pending(>sc_restart_diskqueue)) {
-			callout_reset(>sc_restart_diskqueue, hz / 2,
+			callout_reset(>sc_restart_diskqueue, ticks,
 			wdrestart, dev);
 		}
 



CVS commit: src/sys/dev/ata

2019-05-24 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri May 24 06:01:06 UTC 2019

Modified Files:
src/sys/dev/ata: wd.c

Log Message:
Also schedule timeouts when all openings are in use.


To generate a diff of this commit:
cvs rdiff -u -r1.449 -r1.450 src/sys/dev/ata/wd.c

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