CVS commit: src/sbin/mount_procfs

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug 28 05:58:08 UTC 2017

Modified Files:
src/sbin/mount_procfs: mount_procfs.8

Log Message:
Bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sbin/mount_procfs/mount_procfs.8

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

Modified files:

Index: src/sbin/mount_procfs/mount_procfs.8
diff -u src/sbin/mount_procfs/mount_procfs.8:1.36 src/sbin/mount_procfs/mount_procfs.8:1.37
--- src/sbin/mount_procfs/mount_procfs.8:1.36	Mon Aug 28 00:46:07 2017
+++ src/sbin/mount_procfs/mount_procfs.8	Mon Aug 28 05:58:08 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mount_procfs.8,v 1.36 2017/08/28 00:46:07 kamil Exp $
+.\"	$NetBSD: mount_procfs.8,v 1.37 2017/08/28 05:58:08 wiz Exp $
 .\"
 .\" Copyright (c) 1992, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -34,7 +34,7 @@
 .\"	@(#)mount_procfs.8	8.3 (Berkeley) 6/1/94
 .\"
 .\"
-.Dd February 24, 2009
+.Dd August 28, 2017
 .Dt MOUNT_PROCFS 8
 .Os
 .Sh NAME



CVS commit: src/sbin/mount_procfs

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug 28 05:58:08 UTC 2017

Modified Files:
src/sbin/mount_procfs: mount_procfs.8

Log Message:
Bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sbin/mount_procfs/mount_procfs.8

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

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug 28 05:58:30 UTC 2017

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

Log Message:
Bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/share/man/man9/kauth.9

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



CVS commit: src/share/man/man9

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug 28 05:58:30 UTC 2017

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

Log Message:
Bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/share/man/man9/kauth.9

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

Modified files:

Index: src/share/man/man9/kauth.9
diff -u src/share/man/man9/kauth.9:1.109 src/share/man/man9/kauth.9:1.110
--- src/share/man/man9/kauth.9:1.109	Mon Aug 28 00:46:07 2017
+++ src/share/man/man9/kauth.9	Mon Aug 28 05:58:30 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: kauth.9,v 1.109 2017/08/28 00:46:07 kamil Exp $
+.\" $NetBSD: kauth.9,v 1.110 2017/08/28 05:58:30 wiz Exp $
 .\"
 .\" Copyright (c) 2005, 2006 Elad Efrat 
 .\" All rights reserved.
@@ -25,7 +25,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd July 4, 2012
+.Dd August 28, 2017
 .Dt KAUTH 9
 .Os
 .Sh NAME



CVS commit: src/bin/ps

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug 28 05:57:37 UTC 2017

Modified Files:
src/bin/ps: ps.1

Log Message:
Bump date for previous. Remove/replace bogus Tn uses.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/bin/ps/ps.1

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



CVS commit: src/bin/ps

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug 28 05:57:37 UTC 2017

Modified Files:
src/bin/ps: ps.1

Log Message:
Bump date for previous. Remove/replace bogus Tn uses.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/bin/ps/ps.1

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

Modified files:

Index: src/bin/ps/ps.1
diff -u src/bin/ps/ps.1:1.108 src/bin/ps/ps.1:1.109
--- src/bin/ps/ps.1:1.108	Mon Aug 28 00:46:06 2017
+++ src/bin/ps/ps.1	Mon Aug 28 05:57:37 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ps.1,v 1.108 2017/08/28 00:46:06 kamil Exp $
+.\"	$NetBSD: ps.1,v 1.109 2017/08/28 05:57:37 wiz Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1991, 1993, 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)ps.1	8.3 (Berkeley) 4/18/94
 .\"
-.Dd December 2, 2016
+.Dd August 28, 2017
 .Dt PS 1
 .Os
 .Sh NAME
@@ -56,8 +56,7 @@ running processes.
 By default, the display includes only processes that have
 controlling terminals and are owned by your uid.
 The default sort order of controlling terminal and
-(among processes with the same controlling terminal) process
-.Tn ID
+(among processes with the same controlling terminal) process ID
 may be changed using the
 .Fl k , Fl m ,
 or
@@ -71,8 +70,7 @@ is selected based on a set of keywords (
 and
 .Fl o
 options).
-The default output format includes, for each process, the process'
-.Tn ID ,
+The default output format includes, for each process, the process' ID,
 controlling terminal, CPU time (including both user and system time),
 state, and associated command.
 .Pp
@@ -204,8 +202,7 @@ If all the keywords to be displayed have
 and all the customised headers are entirely empty,
 then the header line is not printed at all.
 .It Fl p Ar pid
-Display information associated with the specified process
-.Tn ID .
+Display information associated with the specified process ID.
 .It Fl r
 Sort by current CPU usage.
 This is equivalent to
@@ -282,9 +279,7 @@ Some of these keywords are further speci
 The CPU utilization of the process; this is a decaying average over up to
 a minute of previous (real) time.
 Since the time base over which this is computed varies (since processes may
-be very young) it is possible for the sum of all
-.Tn %CPU
-fields to exceed 100%.
+be very young) it is possible for the sum of all %CPU fields to exceed 100%.
 .It Ar %mem
 The percentage of real memory used by this process.
 .It Ar flags
@@ -342,7 +337,7 @@ Otherwise, the start time is displayed u
 format.
 .It Ar state
 The state is given by a sequence of letters, for example,
-.Dq Tn RNs .
+.Dq RNs .
 The first letter indicates the run state of the process:
 .Pp
 .Bl -tag -width indent -compact
@@ -378,9 +373,7 @@ The process is in the foreground process
 .It -
 The LWP is detached (can't be waited for).
 .It <
-The process has raised
-.Tn CPU
-scheduling priority.
+The process has raised CPU scheduling priority.
 .It a
 The process is using scheduler activations (deprecated).
 .It E
@@ -390,9 +383,7 @@ The process is a kernel thread or system
 .It l
 The process has multiple LWPs.
 .It N
-The process is niced (has reduced
-.Tn CPU
-scheduling priority) (see
+The process is niced (has reduced CPU scheduling priority) (see
 .Xr setpriority 2 ) .
 .It s
 The process is a session leader.
@@ -533,7 +524,7 @@ tracing flags
 tracing vnode
 .It Ar laddr
 kernel virtual address of the
-.Tn "struct lwp"
+.Ft "struct lwp"
 belonging to the LWP.
 .It Ar lid
 ID of the LWP
@@ -579,25 +570,22 @@ total blocks written (alias
 resource usage pointer (valid only for zombie)
 .It Ar paddr
 kernel virtual address of the
-.Tn "struct proc"
+.Ft "struct proc"
 belonging to the process.
 .It Ar pagein
 pageins (same as majflt)
 .It Ar pgid
 process group number
 .It Ar pid
-process
-.Tn ID
+process ID
 .It Ar ppid
-parent process
-.Tn ID
+parent process ID
 .It Ar pri
 scheduling priority
 .It Ar re
 core residency time (in seconds; 127 = infinity)
 .It Ar rgid
-real group
-.Tn ID
+real group ID
 .It Ar rlink
 reverse link on run queue, or 0
 .It Ar rlwp
@@ -608,15 +596,13 @@ resident set size
 resident set size + (text size / text use count) (alias
 .Ar rssize )
 .It Ar ruid
-real user
-.Tn ID
+real user ID
 .It Ar ruser
 user name (from ruid)
 .It Ar sess
 session pointer
 .It Ar sid
-session
-.Tn ID
+session ID
 .It Ar sig
 pending signals (alias
 .Ar pending )
@@ -652,8 +638,7 @@ control terminal device number
 accumulated CPU time, user + system (alias
 .Ar cputime )
 .It Ar tpgid
-control terminal process group
-.Tn ID
+control terminal process group ID
 .It Ar tsess
 control terminal session pointer
 .It Ar tsiz
@@ -664,13 +649,12 @@ control terminal name (two letter abbrev
 full name of control terminal
 .It Ar uaddr
 kernel virtual address of the
-.Tn "struct user"
+.Ft "struct user"
 belonging to the LWP.
 .It Ar ucomm
 name to be used for 

CVS commit: src/sys/kern

2017-08-27 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Aug 28 04:57:11 UTC 2017

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

Log Message:
If we go to allocate and find someone else has at the same time, don't
trigger a refcount leak of the other guy's object. From mjg@freebsd.

While here also remove a bogus use of lbolt on the same path.


To generate a diff of this commit:
cvs rdiff -u -r1.171 -r1.172 src/sys/kern/kern_ktrace.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/kern_ktrace.c
diff -u src/sys/kern/kern_ktrace.c:1.171 src/sys/kern/kern_ktrace.c:1.172
--- src/sys/kern/kern_ktrace.c:1.171	Fri Jul 28 15:16:39 2017
+++ src/sys/kern/kern_ktrace.c	Mon Aug 28 04:57:11 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_ktrace.c,v 1.171 2017/07/28 15:16:39 riastradh Exp $	*/
+/*	$NetBSD: kern_ktrace.c,v 1.172 2017/08/28 04:57:11 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_ktrace.c,v 1.171 2017/07/28 15:16:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_ktrace.c,v 1.172 2017/08/28 04:57:11 dholland Exp $");
 
 #include 
 #include 
@@ -985,7 +985,7 @@ ktrace_common(lwp_t *curl, int ops, int 
 {
 	struct proc *p;
 	struct pgrp *pg;
-	struct ktr_desc *ktd = NULL;
+	struct ktr_desc *ktd = NULL, *nktd;
 	file_t *fp = *fpp;
 	int ret = 0;
 	int error = 0;
@@ -1015,22 +1015,22 @@ ktrace_common(lwp_t *curl, int ops, int 
 		ktd = ktd_lookup(fp);
 		mutex_exit(_lock);
 		if (ktd == NULL) {
-			ktd = kmem_alloc(sizeof(*ktd), KM_SLEEP);
-			TAILQ_INIT(>ktd_queue);
-			callout_init(>ktd_wakch, CALLOUT_MPSAFE);
-			cv_init(>ktd_cv, "ktrwait");
-			cv_init(>ktd_sync_cv, "ktrsync");
-			ktd->ktd_flags = 0;
-			ktd->ktd_qcount = 0;
-			ktd->ktd_error = 0;
-			ktd->ktd_errcnt = 0;
-			ktd->ktd_delayqcnt = ktd_delayqcnt;
-			ktd->ktd_wakedelay = mstohz(ktd_wakedelay);
-			ktd->ktd_intrwakdl = mstohz(ktd_intrwakdl);
-			ktd->ktd_ref = 0;
-			ktd->ktd_fp = fp;
+			nktd = kmem_alloc(sizeof(*nktd), KM_SLEEP);
+			TAILQ_INIT(>ktd_queue);
+			callout_init(>ktd_wakch, CALLOUT_MPSAFE);
+			cv_init(>ktd_cv, "ktrwait");
+			cv_init(>ktd_sync_cv, "ktrsync");
+			nktd->ktd_flags = 0;
+			nktd->ktd_qcount = 0;
+			nktd->ktd_error = 0;
+			nktd->ktd_errcnt = 0;
+			nktd->ktd_delayqcnt = ktd_delayqcnt;
+			nktd->ktd_wakedelay = mstohz(ktd_wakedelay);
+			nktd->ktd_intrwakdl = mstohz(ktd_intrwakdl);
+			nktd->ktd_ref = 0;
+			nktd->ktd_fp = fp;
 			mutex_enter(_lock);
-			ktdref(ktd);
+			ktdref(nktd);
 			mutex_exit(_lock);
 
 			/*
@@ -1038,16 +1038,16 @@ ktrace_common(lwp_t *curl, int ops, int 
 			 * whether ktruss or ktrace.
 			 */
 			if (fp->f_type == DTYPE_PIPE)
-ktd->ktd_flags |= KTDF_INTERACTIVE;
+nktd->ktd_flags |= KTDF_INTERACTIVE;
 
 			mutex_enter(>f_lock);
 			fp->f_count++;
 			mutex_exit(>f_lock);
 			error = kthread_create(PRI_NONE, KTHREAD_MPSAFE, NULL,
-			ktrace_thread, ktd, >ktd_lwp, "ktrace");
+			ktrace_thread, nktd, >ktd_lwp, "ktrace");
 			if (error != 0) {
-kmem_free(ktd, sizeof(*ktd));
-ktd = NULL;
+kmem_free(nktd, sizeof(*nktd));
+nktd = NULL;
 mutex_enter(>f_lock);
 fp->f_count--;
 mutex_exit(>f_lock);
@@ -1055,16 +1055,15 @@ ktrace_common(lwp_t *curl, int ops, int 
 			}
 
 			mutex_enter(_lock);
-			if (ktd_lookup(fp) != NULL) {
-ktdrel(ktd);
-ktd = NULL;
-			} else
-TAILQ_INSERT_TAIL(, ktd, ktd_list);
-			if (ktd == NULL)
-cv_wait(, _lock);
+			ktd = ktd_lookup(fp);
+			if (ktd != NULL) {
+ktdrel(nktd);
+nktd = NULL;
+			} else {
+TAILQ_INSERT_TAIL(, nktd, ktd_list);
+ktd = nktd;
+			}
 			mutex_exit(_lock);
-			if (ktd == NULL)
-goto done;
 		}
 		break;
 



CVS commit: src/sys/kern

2017-08-27 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Aug 28 04:57:11 UTC 2017

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

Log Message:
If we go to allocate and find someone else has at the same time, don't
trigger a refcount leak of the other guy's object. From mjg@freebsd.

While here also remove a bogus use of lbolt on the same path.


To generate a diff of this commit:
cvs rdiff -u -r1.171 -r1.172 src/sys/kern/kern_ktrace.c

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



CVS commit: src/etc

2017-08-27 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Mon Aug 28 01:34:52 UTC 2017

Modified Files:
src/etc: MAKEDEV.tmpl

Log Message:
veriexec is enabled by default in most kernel configs but the lack of device
node results in a non working config, despite following manual to get setup.
Remove a step for the user by creating a device node for veriexec by default.

ok mrg jakllsch


To generate a diff of this commit:
cvs rdiff -u -r1.185 -r1.186 src/etc/MAKEDEV.tmpl

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



CVS commit: src/etc

2017-08-27 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Mon Aug 28 01:34:52 UTC 2017

Modified Files:
src/etc: MAKEDEV.tmpl

Log Message:
veriexec is enabled by default in most kernel configs but the lack of device
node results in a non working config, despite following manual to get setup.
Remove a step for the user by creating a device node for veriexec by default.

ok mrg jakllsch


To generate a diff of this commit:
cvs rdiff -u -r1.185 -r1.186 src/etc/MAKEDEV.tmpl

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

Modified files:

Index: src/etc/MAKEDEV.tmpl
diff -u src/etc/MAKEDEV.tmpl:1.185 src/etc/MAKEDEV.tmpl:1.186
--- src/etc/MAKEDEV.tmpl:1.185	Sat Aug 12 11:41:21 2017
+++ src/etc/MAKEDEV.tmpl	Mon Aug 28 01:34:52 2017
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$NetBSD: MAKEDEV.tmpl,v 1.185 2017/08/12 11:41:21 jmcneill Exp $
+#	$NetBSD: MAKEDEV.tmpl,v 1.186 2017/08/28 01:34:52 sevan Exp $
 #
 # Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -841,6 +841,7 @@ all)
 	makedev lua
 	makedev hdmicec0
 	makedev dtrace
+	makedev veriexec
 	makedev local # do this last
 	;;
 



CVS commit: src/sys/sys

2017-08-27 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Aug 28 01:27:34 UTC 2017

Modified Files:
src/sys/sys: param.h

Log Message:
Welcome to 8.99.2!

mount_procfs(8): removal of /proc/#/ctl and filesystem tracing feature


To generate a diff of this commit:
cvs rdiff -u -r1.544 -r1.545 src/sys/sys/param.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/sys/param.h
diff -u src/sys/sys/param.h:1.544 src/sys/sys/param.h:1.545
--- src/sys/sys/param.h:1.544	Tue Jul 11 15:39:31 2017
+++ src/sys/sys/param.h	Mon Aug 28 01:27:34 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.544 2017/07/11 15:39:31 dholland Exp $	*/
+/*	$NetBSD: param.h,v 1.545 2017/08/28 01:27:34 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	899000100	/* NetBSD 8.99.1 */
+#define	__NetBSD_Version__	899000200	/* NetBSD 8.99.2 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys/sys

2017-08-27 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Aug 28 01:27:34 UTC 2017

Modified Files:
src/sys/sys: param.h

Log Message:
Welcome to 8.99.2!

mount_procfs(8): removal of /proc/#/ctl and filesystem tracing feature


To generate a diff of this commit:
cvs rdiff -u -r1.544 -r1.545 src/sys/sys/param.h

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



Re: CVS commit: src

2017-08-27 Thread Paul Goyette

Shouldn't this require a system version bump?

On Mon, 28 Aug 2017, Kamil Rytarowski wrote:


Module Name:src
Committed By:   kamil
Date:   Mon Aug 28 00:46:07 UTC 2017

Modified Files:
src/bin/ps: ps.1
src/doc: TODO.ptrace
src/sbin/mount_procfs: mount_procfs.8
src/share/man/man9: kauth.9
src/sys/compat/linux/arch/arm: linux_ptrace.c
src/sys/compat/linux/arch/i386: linux_ptrace.c
src/sys/compat/linux/arch/powerpc: linux_ptrace.c
src/sys/kern: kern_exit.c kern_proc.c kern_sig.c sys_ptrace_common.c
src/sys/miscfs/procfs: files.procfs procfs.h procfs_subr.c
procfs_vfsops.c procfs_vnops.c
src/sys/modules/procfs: Makefile
src/sys/sys: kauth.h proc.h sysctl.h
Removed Files:
src/sys/miscfs/procfs: procfs_ctl.c

Log Message:
Remove the filesystem tracing feature

This is a legacy interface from 4.4BSD, and it was
introduced to overcome shortcomings of ptrace(2) at that time, which are
no longer relevant (performance). Today /proc/#/ctl offers a narrow
subset of ptrace(2) commands and is not applicable for modern
applications use beyond simplistic tracing scenarios.

This removal will simplify kernel internals. Users will still be able to
use all the other /proc files.

This change won't affect other procfs files neither Linux compat
features within mount_procfs(8). /proc/#/ctl isn't available on Linux.

Remove:
- /proc/#/ctl from mount_procfs(8)
- P_FSTRACE note from the documentation of ps(1)
- /proc/#/ctl and filesystem tracing documentation from mount_procfs(8)
- KAUTH_REQ_PROCESS_PROCFS_CTL documentation from kauth(9)
- source code file miscfs/procfs/procfs_ctl.c
- PFSctl and procfs_doctl() from sys/miscfs/procfs/procfs.h
- KAUTH_REQ_PROCESS_PROCFS_CTL from sys/sys/kauth.h
- PSL_FSTRACE (0x0001) from sys/sys/proc.h
- P_FSTRACE (0x0001) from sys/sys/sysctl.h

Reduce code complexity after removal of this functionality.

Update TODO.ptrace accordingly: remove two entries about /proc tracing.

Do not keep legacy notes as comments in the headers about removed
PSL_FSTRACE / P_FSTRACE, as this interface had little number of users
(close or equal to zero).

Proposed on tech-kern@.

All filesystem tracing utility users are encouraged to switch to ptrace(2).

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/bin/ps/ps.1
cvs rdiff -u -r1.28 -r1.29 src/doc/TODO.ptrace
cvs rdiff -u -r1.35 -r1.36 src/sbin/mount_procfs/mount_procfs.8
cvs rdiff -u -r1.108 -r1.109 src/share/man/man9/kauth.9
cvs rdiff -u -r1.19 -r1.20 src/sys/compat/linux/arch/arm/linux_ptrace.c
cvs rdiff -u -r1.31 -r1.32 src/sys/compat/linux/arch/i386/linux_ptrace.c
cvs rdiff -u -r1.29 -r1.30 src/sys/compat/linux/arch/powerpc/linux_ptrace.c
cvs rdiff -u -r1.268 -r1.269 src/sys/kern/kern_exit.c
cvs rdiff -u -r1.206 -r1.207 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.336 -r1.337 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.22 -r1.23 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.11 -r1.12 src/sys/miscfs/procfs/files.procfs
cvs rdiff -u -r1.71 -r1.72 src/sys/miscfs/procfs/procfs.h
cvs rdiff -u -r1.48 -r0 src/sys/miscfs/procfs/procfs_ctl.c
cvs rdiff -u -r1.108 -r1.109 src/sys/miscfs/procfs/procfs_subr.c
cvs rdiff -u -r1.97 -r1.98 src/sys/miscfs/procfs/procfs_vfsops.c
cvs rdiff -u -r1.197 -r1.198 src/sys/miscfs/procfs/procfs_vnops.c
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/procfs/Makefile
cvs rdiff -u -r1.74 -r1.75 src/sys/sys/kauth.h
cvs rdiff -u -r1.341 -r1.342 src/sys/sys/proc.h
cvs rdiff -u -r1.223 -r1.224 src/sys/sys/sysctl.h

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


!DSPAM:59a367f5130345948688372!




+--+--++
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:  |
| (Retired)| FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+--+--++


CVS commit: src

2017-08-27 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Aug 28 00:46:07 UTC 2017

Modified Files:
src/bin/ps: ps.1
src/doc: TODO.ptrace
src/sbin/mount_procfs: mount_procfs.8
src/share/man/man9: kauth.9
src/sys/compat/linux/arch/arm: linux_ptrace.c
src/sys/compat/linux/arch/i386: linux_ptrace.c
src/sys/compat/linux/arch/powerpc: linux_ptrace.c
src/sys/kern: kern_exit.c kern_proc.c kern_sig.c sys_ptrace_common.c
src/sys/miscfs/procfs: files.procfs procfs.h procfs_subr.c
procfs_vfsops.c procfs_vnops.c
src/sys/modules/procfs: Makefile
src/sys/sys: kauth.h proc.h sysctl.h
Removed Files:
src/sys/miscfs/procfs: procfs_ctl.c

Log Message:
Remove the filesystem tracing feature

This is a legacy interface from 4.4BSD, and it was
introduced to overcome shortcomings of ptrace(2) at that time, which are
no longer relevant (performance). Today /proc/#/ctl offers a narrow
subset of ptrace(2) commands and is not applicable for modern
applications use beyond simplistic tracing scenarios.

This removal will simplify kernel internals. Users will still be able to
use all the other /proc files.

This change won't affect other procfs files neither Linux compat
features within mount_procfs(8). /proc/#/ctl isn't available on Linux.

Remove:
 - /proc/#/ctl from mount_procfs(8)
 - P_FSTRACE note from the documentation of ps(1)
 - /proc/#/ctl and filesystem tracing documentation from mount_procfs(8)
 - KAUTH_REQ_PROCESS_PROCFS_CTL documentation from kauth(9)
 - source code file miscfs/procfs/procfs_ctl.c
 - PFSctl and procfs_doctl() from sys/miscfs/procfs/procfs.h
 - KAUTH_REQ_PROCESS_PROCFS_CTL from sys/sys/kauth.h
 - PSL_FSTRACE (0x0001) from sys/sys/proc.h
 - P_FSTRACE (0x0001) from sys/sys/sysctl.h

Reduce code complexity after removal of this functionality.

Update TODO.ptrace accordingly: remove two entries about /proc tracing.

Do not keep legacy notes as comments in the headers about removed
PSL_FSTRACE / P_FSTRACE, as this interface had little number of users
(close or equal to zero).

Proposed on tech-kern@.

All filesystem tracing utility users are encouraged to switch to ptrace(2).

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/bin/ps/ps.1
cvs rdiff -u -r1.28 -r1.29 src/doc/TODO.ptrace
cvs rdiff -u -r1.35 -r1.36 src/sbin/mount_procfs/mount_procfs.8
cvs rdiff -u -r1.108 -r1.109 src/share/man/man9/kauth.9
cvs rdiff -u -r1.19 -r1.20 src/sys/compat/linux/arch/arm/linux_ptrace.c
cvs rdiff -u -r1.31 -r1.32 src/sys/compat/linux/arch/i386/linux_ptrace.c
cvs rdiff -u -r1.29 -r1.30 src/sys/compat/linux/arch/powerpc/linux_ptrace.c
cvs rdiff -u -r1.268 -r1.269 src/sys/kern/kern_exit.c
cvs rdiff -u -r1.206 -r1.207 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.336 -r1.337 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.22 -r1.23 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.11 -r1.12 src/sys/miscfs/procfs/files.procfs
cvs rdiff -u -r1.71 -r1.72 src/sys/miscfs/procfs/procfs.h
cvs rdiff -u -r1.48 -r0 src/sys/miscfs/procfs/procfs_ctl.c
cvs rdiff -u -r1.108 -r1.109 src/sys/miscfs/procfs/procfs_subr.c
cvs rdiff -u -r1.97 -r1.98 src/sys/miscfs/procfs/procfs_vfsops.c
cvs rdiff -u -r1.197 -r1.198 src/sys/miscfs/procfs/procfs_vnops.c
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/procfs/Makefile
cvs rdiff -u -r1.74 -r1.75 src/sys/sys/kauth.h
cvs rdiff -u -r1.341 -r1.342 src/sys/sys/proc.h
cvs rdiff -u -r1.223 -r1.224 src/sys/sys/sysctl.h

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

Modified files:

Index: src/bin/ps/ps.1
diff -u src/bin/ps/ps.1:1.107 src/bin/ps/ps.1:1.108
--- src/bin/ps/ps.1:1.107	Mon Jul  3 21:33:23 2017
+++ src/bin/ps/ps.1	Mon Aug 28 00:46:06 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ps.1,v 1.107 2017/07/03 21:33:23 wiz Exp $
+.\"	$NetBSD: ps.1,v 1.108 2017/08/28 00:46:06 kamil Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1991, 1993, 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -308,7 +308,6 @@ the include file
 .It Dv "P_EXEC" Ta No "0x4000	process called" Xr execve 2
 .It Dv "P_OWEUPC" Ta No "0x8000	owe process an addupc() call at next ast"
 .\" the routine addupc is not documented in the man pages
-.It Dv "P_FSTRACE" Ta No "0x0001	tracing via file system"
 .It Dv "P_NOCLDWAIT" Ta No "0x0002	no zombies when children die"
 .It Dv "P_32" Ta No "0x0004	32-bit process (used on 64-bit kernels)"
 .It Dv "P_BIGLOCK" Ta No "0x0008	process needs kernel ``big lock'' to run"

Index: src/doc/TODO.ptrace
diff -u src/doc/TODO.ptrace:1.28 src/doc/TODO.ptrace:1.29
--- src/doc/TODO.ptrace:1.28	Sat Apr  8 01:08:36 2017
+++ src/doc/TODO.ptrace	Mon Aug 28 00:46:07 2017
@@ -1,4 +1,4 @@
-$NetBSD: TODO.ptrace,v 1.28 2017/04/08 01:08:36 kamil Exp $
+$NetBSD: TODO.ptrace,v 1.29 2017/08/28 00:46:07 kamil Exp $
 
 Items we (currently) plan to finish in the ptrace(2) field:
 
@@ -8,11 +8,6 

CVS commit: src

2017-08-27 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Aug 28 00:46:07 UTC 2017

Modified Files:
src/bin/ps: ps.1
src/doc: TODO.ptrace
src/sbin/mount_procfs: mount_procfs.8
src/share/man/man9: kauth.9
src/sys/compat/linux/arch/arm: linux_ptrace.c
src/sys/compat/linux/arch/i386: linux_ptrace.c
src/sys/compat/linux/arch/powerpc: linux_ptrace.c
src/sys/kern: kern_exit.c kern_proc.c kern_sig.c sys_ptrace_common.c
src/sys/miscfs/procfs: files.procfs procfs.h procfs_subr.c
procfs_vfsops.c procfs_vnops.c
src/sys/modules/procfs: Makefile
src/sys/sys: kauth.h proc.h sysctl.h
Removed Files:
src/sys/miscfs/procfs: procfs_ctl.c

Log Message:
Remove the filesystem tracing feature

This is a legacy interface from 4.4BSD, and it was
introduced to overcome shortcomings of ptrace(2) at that time, which are
no longer relevant (performance). Today /proc/#/ctl offers a narrow
subset of ptrace(2) commands and is not applicable for modern
applications use beyond simplistic tracing scenarios.

This removal will simplify kernel internals. Users will still be able to
use all the other /proc files.

This change won't affect other procfs files neither Linux compat
features within mount_procfs(8). /proc/#/ctl isn't available on Linux.

Remove:
 - /proc/#/ctl from mount_procfs(8)
 - P_FSTRACE note from the documentation of ps(1)
 - /proc/#/ctl and filesystem tracing documentation from mount_procfs(8)
 - KAUTH_REQ_PROCESS_PROCFS_CTL documentation from kauth(9)
 - source code file miscfs/procfs/procfs_ctl.c
 - PFSctl and procfs_doctl() from sys/miscfs/procfs/procfs.h
 - KAUTH_REQ_PROCESS_PROCFS_CTL from sys/sys/kauth.h
 - PSL_FSTRACE (0x0001) from sys/sys/proc.h
 - P_FSTRACE (0x0001) from sys/sys/sysctl.h

Reduce code complexity after removal of this functionality.

Update TODO.ptrace accordingly: remove two entries about /proc tracing.

Do not keep legacy notes as comments in the headers about removed
PSL_FSTRACE / P_FSTRACE, as this interface had little number of users
(close or equal to zero).

Proposed on tech-kern@.

All filesystem tracing utility users are encouraged to switch to ptrace(2).

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/bin/ps/ps.1
cvs rdiff -u -r1.28 -r1.29 src/doc/TODO.ptrace
cvs rdiff -u -r1.35 -r1.36 src/sbin/mount_procfs/mount_procfs.8
cvs rdiff -u -r1.108 -r1.109 src/share/man/man9/kauth.9
cvs rdiff -u -r1.19 -r1.20 src/sys/compat/linux/arch/arm/linux_ptrace.c
cvs rdiff -u -r1.31 -r1.32 src/sys/compat/linux/arch/i386/linux_ptrace.c
cvs rdiff -u -r1.29 -r1.30 src/sys/compat/linux/arch/powerpc/linux_ptrace.c
cvs rdiff -u -r1.268 -r1.269 src/sys/kern/kern_exit.c
cvs rdiff -u -r1.206 -r1.207 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.336 -r1.337 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.22 -r1.23 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.11 -r1.12 src/sys/miscfs/procfs/files.procfs
cvs rdiff -u -r1.71 -r1.72 src/sys/miscfs/procfs/procfs.h
cvs rdiff -u -r1.48 -r0 src/sys/miscfs/procfs/procfs_ctl.c
cvs rdiff -u -r1.108 -r1.109 src/sys/miscfs/procfs/procfs_subr.c
cvs rdiff -u -r1.97 -r1.98 src/sys/miscfs/procfs/procfs_vfsops.c
cvs rdiff -u -r1.197 -r1.198 src/sys/miscfs/procfs/procfs_vnops.c
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/procfs/Makefile
cvs rdiff -u -r1.74 -r1.75 src/sys/sys/kauth.h
cvs rdiff -u -r1.341 -r1.342 src/sys/sys/proc.h
cvs rdiff -u -r1.223 -r1.224 src/sys/sys/sysctl.h

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



CVS commit: src/share/man/man8

2017-08-27 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Aug 27 23:20:54 UTC 2017

Modified Files:
src/share/man/man8: veriexec.8

Log Message:
The bogus number police


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man8/veriexec.8

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/man8/veriexec.8
diff -u src/share/man/man8/veriexec.8:1.4 src/share/man/man8/veriexec.8:1.5
--- src/share/man/man8/veriexec.8:1.4	Tue Mar 18 18:20:40 2014
+++ src/share/man/man8/veriexec.8	Sun Aug 27 23:20:54 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: veriexec.8,v 1.4 2014/03/18 18:20:40 riastradh Exp $
+.\" $NetBSD: veriexec.8,v 1.5 2017/08/27 23:20:54 sevan Exp $
 .\"
 .\" Copyright (c) 2008 Elad Efrat 
 .\" All rights reserved.
@@ -25,7 +25,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 18, 2008
+.Dd August 28, 2017
 .Dt VERIEXEC 8
 .Os
 .Sh NAME
@@ -67,7 +67,7 @@ below), this list can be loaded manually
 .Em Veriexec
 requires a pseudo-device to run:
 .Bd -literal -offset indent
-pseudo-device veriexec 1
+pseudo-device veriexec
 .Ed
 .Pp
 Additionally, one or more options for digital fingerprint algorithm support:



CVS commit: src/share/man/man8

2017-08-27 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Aug 27 23:20:54 UTC 2017

Modified Files:
src/share/man/man8: veriexec.8

Log Message:
The bogus number police


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man8/veriexec.8

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



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

2017-08-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 27 22:22:33 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: sun4i_a10_codec.c

Log Message:
Setup routing at init and toggle PA mute pin (if available) for mute.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sun4i_a10_codec.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/sunxi/sun4i_a10_codec.c
diff -u src/sys/arch/arm/sunxi/sun4i_a10_codec.c:1.1 src/sys/arch/arm/sunxi/sun4i_a10_codec.c:1.2
--- src/sys/arch/arm/sunxi/sun4i_a10_codec.c:1.1	Sun Aug 27 16:05:26 2017
+++ src/sys/arch/arm/sunxi/sun4i_a10_codec.c	Sun Aug 27 22:22:32 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sun4i_a10_codec.c,v 1.1 2017/08/27 16:05:26 jmcneill Exp $ */
+/* $NetBSD: sun4i_a10_codec.c,v 1.2 2017/08/27 22:22:32 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sun4i_a10_codec.c,v 1.1 2017/08/27 16:05:26 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sun4i_a10_codec.c,v 1.2 2017/08/27 22:22:32 jmcneill Exp $");
 
 #include 
 #include 
@@ -120,9 +120,17 @@ a10_codec_init(struct sunxi_codec_softc 
 
 	/* Unmute PA */
 	SET4(sc, A10_DAC_ACTRL, A10_PAMUTE);
+
 	/* Set initial volume */
 	CLR4(sc, A10_DAC_ACTRL, A10_PAVOL);
 	SET4(sc, A10_DAC_ACTRL, __SHIFTIN(A10_DEFAULT_PAVOL, A10_PAVOL));
+
+	/* Enable DAC analog l/r channels and output mixer */
+	SET4(sc, A10_DAC_ACTRL, A10_DACAREN | A10_DACALEN | A10_DACPAS);
+
+	/* Enable ADC analog l/r channels */
+	SET4(sc, A10_ADC_ACTRL, A10_ADCREN | A10_ADCLEN);
+
 	/* Enable PA */
 	SET4(sc, A10_ADC_ACTRL, A10_PA_EN);
 
@@ -133,23 +141,8 @@ static void
 a10_codec_mute(struct sunxi_codec_softc *sc, int mute, u_int mode)
 {
 	if (mode == AUMODE_PLAY) {
-		const uint32_t pmask = A10_DACAREN|A10_DACALEN|A10_DACPAS;
-		if (mute) {
-			/* Mute DAC l/r channels to output mixer */
-			CLR4(sc, A10_DAC_ACTRL, pmask);
-		} else {
-			/* Enable DAC analog l/r channels and output mixer */
-			SET4(sc, A10_DAC_ACTRL, pmask);
-		}
-	} else {
-		const uint32_t rmask = A10_ADCREN|A10_ADCLEN;
-		if (mute) {
-			/* Disable ADC analog l/r channels */
-			CLR4(sc, A10_ADC_ACTRL, rmask);
-		} else {
-			/* Enable ADC analog l/r channels */
-			SET4(sc, A10_ADC_ACTRL, rmask);
-		}
+		if (sc->sc_pin_pa != NULL)
+			fdtbus_gpio_write(sc->sc_pin_pa, !mute);
 	}
 }
 



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

2017-08-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 27 22:22:33 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: sun4i_a10_codec.c

Log Message:
Setup routing at init and toggle PA mute pin (if available) for mute.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sun4i_a10_codec.c

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



re: CVS commit: src/sys/arch/sparc64/sparc64

2017-08-27 Thread matthew green
"Palle Lyckegaard" writes:
> Module Name:  src
> Committed By: palle
> Date: Sun Aug 27 19:31:44 UTC 2017
> 
> Modified Files:
>   src/sys/arch/sparc64/sparc64: cpu.c
> 
> Log Message:
> sun4v: Change clk and sclk variables to unsigned type so modern faster
> systems with CPU frequencies above 2 Ghz are shown correctly. Example
> is a 3599.910 MHz SPARC T5-2 system that otherwise is shown
> incorrectly as -695.-57 MHz. Based on code from OpenBSD cpu.c rev.
> 1.41. Verified on sun4u using qemu and sun4v on SPARC T5-2

cool :)

shouldn't we move to a 64 bit value?  4.3ghz isn't far away from 3.6..


.mrg.


CVS commit: src/usr.sbin/rdate

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:45:47 UTC 2017

Modified Files:
src/usr.sbin/rdate: rdate.8

Log Message:
New sentence, new line. Remove superfluous Pp.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/rdate/rdate.8

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

Modified files:

Index: src/usr.sbin/rdate/rdate.8
diff -u src/usr.sbin/rdate/rdate.8:1.13 src/usr.sbin/rdate/rdate.8:1.14
--- src/usr.sbin/rdate/rdate.8:1.13	Sat Aug 26 19:26:32 2017
+++ src/usr.sbin/rdate/rdate.8	Sun Aug 27 20:45:47 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rdate.8,v 1.13 2017/08/26 19:26:32 ginsbach Exp $
+.\"	$NetBSD: rdate.8,v 1.14 2017/08/27 20:45:47 wiz Exp $
 .\"
 .\" Copyright (c) 1994 Christos Zoulas
 .\" All rights reserved.
@@ -36,12 +36,12 @@
 .Sh DESCRIPTION
 .Nm
 displays and sets the local date and time from the
-host name or address given as the argument. It uses the RFC 868
-protocol which is usually implemented as a built-in service of
+host name or address given as the argument.
+It uses the RFC 868 protocol which is usually implemented as a
+built-in service of
 .Xr inetd 8 .
 .Pp
 Available options:
-.Pp
 .Bl -tag -width indent
 .It Fl 4
 Forces



CVS commit: src/usr.sbin/rdate

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:45:47 UTC 2017

Modified Files:
src/usr.sbin/rdate: rdate.8

Log Message:
New sentence, new line. Remove superfluous Pp.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/rdate/rdate.8

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

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:44:42 UTC 2017

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

Log Message:
Bump date for psref, localcount changes.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man9/locking.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/locking.9
diff -u src/share/man/man9/locking.9:1.7 src/share/man/man9/locking.9:1.8
--- src/share/man/man9/locking.9:1.7	Sun Aug 27 20:43:37 2017
+++ src/share/man/man9/locking.9	Sun Aug 27 20:44:42 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: locking.9,v 1.7 2017/08/27 20:43:37 wiz Exp $
+.\"	$NetBSD: locking.9,v 1.8 2017/08/27 20:44:42 wiz 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 April 15, 2017
+.Dd August 23, 2017
 .Dt LOCKING 9
 .Os
 .Sh NAME



CVS commit: src/share/man/man9

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:44:42 UTC 2017

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

Log Message:
Bump date for psref, localcount changes.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man9/locking.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

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:43:38 UTC 2017

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

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/share/man/man9/locking.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

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:43:38 UTC 2017

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

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/share/man/man9/locking.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/locking.9
diff -u src/share/man/man9/locking.9:1.6 src/share/man/man9/locking.9:1.7
--- src/share/man/man9/locking.9:1.6	Wed Aug 23 22:27:55 2017
+++ src/share/man/man9/locking.9	Sun Aug 27 20:43:37 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: locking.9,v 1.6 2017/08/23 22:27:55 pgoyette Exp $
+.\"	$NetBSD: locking.9,v 1.7 2017/08/27 20:43:37 wiz Exp $
 .\"
 .\" Copyright (c) 2015 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -215,21 +215,23 @@ See
 .Ss Passive reference mechanism
 Passive references allow CPUs to cheaply acquire and release passive
 references to a resource, which guarantee the resource will not be
-destroyed until the reference is released.  Acquiring and releasing
-passive references requires no interprocessor synchronization, except
-when the resource is pending destruction.
+destroyed until the reference is released.
+Acquiring and releasing passive references requires no interprocessor
+synchronization, except when the resource is pending destruction.
 .Pp
 See
 .Xr psref 9 .
 .Ss Localcount mechanism
 Localcounts are used in the kernel to implement a medium-weight reference
-counting mechanism.  During normal operations, localcounts do not need
+counting mechanism.
+During normal operations, localcounts do not need
 the interprocessor synchronization associated with
 .Xr atomic_ops 3
 atomic memory operations, and (unlike
 .Xr psref 9 )
 localcount references can be held across sleeps and can migrate between
-CPUs.  Draining a localcount requires more expensive interprocessor
+CPUs.
+Draining a localcount requires more expensive interprocessor
 synchronization than
 .Xr atomic_ops 3
 (similar to



CVS commit: src/share/man/man4

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:42:55 UTC 2017

Modified Files:
src/share/man/man4: cfb.4 mfb.4 sfb.4 tfb.4

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/share/man/man4/cfb.4 src/share/man/man4/mfb.4
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/sfb.4 src/share/man/man4/tfb.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/cfb.4
diff -u src/share/man/man4/cfb.4:1.6 src/share/man/man4/cfb.4:1.7
--- src/share/man/man4/cfb.4:1.6	Tue Aug 22 15:56:46 2017
+++ src/share/man/man4/cfb.4	Sun Aug 27 20:42:55 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: cfb.4,v 1.6 2017/08/22 15:56:46 maya Exp $
+.\" $NetBSD: cfb.4,v 1.7 2017/08/27 20:42:55 wiz Exp $
 .\"
 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -41,7 +41,8 @@ PMAG-B CX colour unaccelerated 2-D frame
 The
 .Nm
 driver provides support for the PMAG-B CX colour framebuffer for the
-TURBOchannel bus.  The PMAG-B is an 8 bpp colour framebuffer capable
+TURBOchannel bus.
+The PMAG-B is an 8 bpp colour framebuffer capable
 of running at a resolution of 1024-by-864 at 60 Hz.
 .Sh SEE ALSO
 .Xr mfb 4 ,
Index: src/share/man/man4/mfb.4
diff -u src/share/man/man4/mfb.4:1.6 src/share/man/man4/mfb.4:1.7
--- src/share/man/man4/mfb.4:1.6	Tue Aug 22 15:56:46 2017
+++ src/share/man/man4/mfb.4	Sun Aug 27 20:42:55 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: mfb.4,v 1.6 2017/08/22 15:56:46 maya Exp $
+.\" $NetBSD: mfb.4,v 1.7 2017/08/27 20:42:55 wiz Exp $
 .\"
 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -41,7 +41,8 @@ PMAG-A MX monochrome unaccelerated 2-D f
 The
 .Nm
 driver provides support for the PMAG-A MX monochrome framebuffer for
-the TURBOchannel bus.  The PMAG-A is a monochrome framebuffer capable
+the TURBOchannel bus.
+The PMAG-A is a monochrome framebuffer capable
 of running at a resolution of 1280-by-1024 at 72 Hz.
 .Sh SEE ALSO
 .Xr cfb 4 ,

Index: src/share/man/man4/sfb.4
diff -u src/share/man/man4/sfb.4:1.5 src/share/man/man4/sfb.4:1.6
--- src/share/man/man4/sfb.4:1.5	Tue Aug 22 15:56:46 2017
+++ src/share/man/man4/sfb.4	Sun Aug 27 20:42:55 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: sfb.4,v 1.5 2017/08/22 15:56:46 maya Exp $
+.\" $NetBSD: sfb.4,v 1.6 2017/08/27 20:42:55 wiz Exp $
 .\"
 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -41,9 +41,9 @@ PMAGB-B HX colour/grayscale accelerated 
 The
 .Nm
 driver provides support for the PMAGB-B HX colour/grayscale 2-D
-framebuffer for the TURBOchannel bus.  The PMAGB-B is an 8 bpp
-colour/grayscale framebuffer capable of running at a resolution of
-1280-by-1024 at 66 or 72 Hz.
+framebuffer for the TURBOchannel bus.
+The PMAGB-B is an 8 bpp colour/grayscale framebuffer capable of
+running at a resolution of 1280-by-1024 at 66 or 72 Hz.
 .Sh SEE ALSO
 .Xr cfb 4 ,
 .Xr mfb 4 ,
Index: src/share/man/man4/tfb.4
diff -u src/share/man/man4/tfb.4:1.5 src/share/man/man4/tfb.4:1.6
--- src/share/man/man4/tfb.4:1.5	Tue Aug 22 15:56:46 2017
+++ src/share/man/man4/tfb.4	Sun Aug 27 20:42:55 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: tfb.4,v 1.5 2017/08/22 15:56:46 maya Exp $
+.\" $NetBSD: tfb.4,v 1.6 2017/08/27 20:42:55 wiz Exp $
 .\"
 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -41,9 +41,10 @@ PMAG-J and PMAGB-J TX colour unaccelerat
 The
 .Nm
 driver provides support for the PMAG-J and PMAGB-J TX colour
-framebuffer for the TURBOchannel bus.  The PMAG-J is an 8 bpp or 24
-bpp colour framebuffer capable of running at a resolution of
-1280-by-1024 at 66 Hz.  The PMAGB-J is an 8 bpp or 24 bpp colour
+framebuffer for the TURBOchannel bus.
+The PMAG-J is an 8 bpp or 24 bpp colour framebuffer capable of
+running at a resolution of 1280-by-1024 at 66 Hz.
+The PMAGB-J is an 8 bpp or 24 bpp colour
 framebuffer capable of running at a resolution of 1280-by-1024 at 72
 Hz.
 .Sh SEE ALSO



CVS commit: src/share/man/man4

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:42:55 UTC 2017

Modified Files:
src/share/man/man4: cfb.4 mfb.4 sfb.4 tfb.4

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/share/man/man4/cfb.4 src/share/man/man4/mfb.4
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/sfb.4 src/share/man/man4/tfb.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

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:42:18 UTC 2017

Modified Files:
src/share/man/man4: px.4 pxaip.4 pxg.4

Log Message:
Remove unnecessary Tn macro.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man4/px.4 src/share/man/man4/pxg.4
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/pxaip.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/px.4
diff -u src/share/man/man4/px.4:1.7 src/share/man/man4/px.4:1.8
--- src/share/man/man4/px.4:1.7	Tue Aug 22 15:56:46 2017
+++ src/share/man/man4/px.4	Sun Aug 27 20:42:18 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: px.4,v 1.7 2017/08/22 15:56:46 maya Exp $
+.\"	$NetBSD: px.4,v 1.8 2017/08/27 20:42:18 wiz Exp $
 .\"
 .\" Copyright (c) 1997 Jonathan Stone.
 .\" All rights reserved.
@@ -40,9 +40,7 @@
 .Sh DESCRIPTION
 The
 .Nm
-driver provides support for the 2D
-.Tn DEC
-.Tn PixelStamp
+driver provides support for the 2D DEC PixelStamp
 video display option card (PMAG-C).
 .Sh SEE ALSO
 .Xr pxg 4 ,
Index: src/share/man/man4/pxg.4
diff -u src/share/man/man4/pxg.4:1.7 src/share/man/man4/pxg.4:1.8
--- src/share/man/man4/pxg.4:1.7	Tue Aug 22 16:02:16 2017
+++ src/share/man/man4/pxg.4	Sun Aug 27 20:42:18 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: pxg.4,v 1.7 2017/08/22 16:02:16 maya Exp $
+.\"	$NetBSD: pxg.4,v 1.8 2017/08/27 20:42:18 wiz Exp $
 .\"
 .\" Copyright (c) 1997 Jonathan Stone.
 .\" All rights reserved.
@@ -40,9 +40,7 @@
 .Sh DESCRIPTION
 The
 .Nm
-driver provides support for the 3D
-.Tn DEC
-.Tn PixelStamp
+driver provides support for the 3D DEC PixelStamp
 video display option cards (PMAG-D, PMAG-E, and PMAG-F).
 .Sh SEE ALSO
 .Xr px 4 ,

Index: src/share/man/man4/pxaip.4
diff -u src/share/man/man4/pxaip.4:1.4 src/share/man/man4/pxaip.4:1.5
--- src/share/man/man4/pxaip.4:1.4	Thu Apr  6 14:35:15 2017
+++ src/share/man/man4/pxaip.4	Sun Aug 27 20:42:18 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: pxaip.4,v 1.4 2017/04/06 14:35:15 wiz Exp $
+.\"	$NetBSD: pxaip.4,v 1.5 2017/08/27 20:42:18 wiz Exp $
 .\"
 .\" Copyright (c) 2017 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -58,13 +58,13 @@ Intel Xscale PXA250/270 AC'97 audio devi
 .It pxadmac
 Intel XScale PXA250/270 DMA controller.
 .It pxagpio0
-Intel XScale PXA250/270 .Tn GPIO controller.
+Intel XScale PXA250/270 GPIO controller.
 .It pxaintc
 Intel XScale PXA250/270 interrupt controller.
 .It pxamci
 Intel XScale PXA250/270 SD/MMC card controller.
 .It pxapcic
-Intel XScale PXA250/270 .Tn PCMCIA controller.
+Intel XScale PXA250/270 PCMCIA controller.
 .It pxartc
 Intel XScale PXA250/270 real time clock.
 .It saost



CVS commit: src/share/man/man4

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:42:18 UTC 2017

Modified Files:
src/share/man/man4: px.4 pxaip.4 pxg.4

Log Message:
Remove unnecessary Tn macro.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man4/px.4 src/share/man/man4/pxg.4
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/pxaip.4

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



CVS commit: src/usr.bin/sys_info

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:40:22 UTC 2017

Modified Files:
src/usr.bin/sys_info: sys_info.sh

Log Message:
Sync usage with man page.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/sys_info/sys_info.sh

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

Modified files:

Index: src/usr.bin/sys_info/sys_info.sh
diff -u src/usr.bin/sys_info/sys_info.sh:1.12 src/usr.bin/sys_info/sys_info.sh:1.13
--- src/usr.bin/sys_info/sys_info.sh:1.12	Thu Aug 24 01:43:42 2017
+++ src/usr.bin/sys_info/sys_info.sh	Sun Aug 27 20:40:22 2017
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: sys_info.sh,v 1.12 2017/08/24 01:43:42 kre Exp $
+# $NetBSD: sys_info.sh,v 1.13 2017/08/27 20:40:22 wiz Exp $
 
 # Copyright (c) 2016 Alistair Crooks 
 # All rights reserved.
@@ -244,7 +244,7 @@ while getopts "L:P:v" a; do
 	L)	LIBRARY_PATH=${OPTARG};;
 	P)	PATH=${OPTARG};;
 	\?)	printf >&2 '%s\n' \
-		"Usage: $0 [-P path] [-L libdirs] [-v] [system...]"
+		"Usage: $0 [-v] [-L lib-path] [-P path] [component ...]"
 		exit 2
 	esac
 done



CVS commit: src/usr.bin/sys_info

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:40:22 UTC 2017

Modified Files:
src/usr.bin/sys_info: sys_info.sh

Log Message:
Sync usage with man page.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/sys_info/sys_info.sh

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



CVS commit: src/usr.bin/sys_info

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:39:27 UTC 2017

Modified Files:
src/usr.bin/sys_info: sys_info.1

Log Message:
Use Nm.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/sys_info/sys_info.1

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

Modified files:

Index: src/usr.bin/sys_info/sys_info.1
diff -u src/usr.bin/sys_info/sys_info.1:1.5 src/usr.bin/sys_info/sys_info.1:1.6
--- src/usr.bin/sys_info/sys_info.1:1.5	Sun Aug 27 20:38:39 2017
+++ src/usr.bin/sys_info/sys_info.1	Sun Aug 27 20:39:26 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: sys_info.1,v 1.5 2017/08/27 20:38:39 wiz Exp $
+.\" $NetBSD: sys_info.1,v 1.6 2017/08/27 20:39:26 wiz Exp $
 .\"
 .\" Copyright (c) 2016 Alistair Crooks 
 .\" All rights reserved.
@@ -71,7 +71,8 @@ Show the commands used to obtain the ver
 for each component
 .El
 .Pp
-Arguments may be given to sys_info.
+Arguments may be given to
+.Nm .
 If any arguments are specified, they are assumed
 to be names of programs, or shared libraries,
 installed on the system.



CVS commit: src/usr.bin/sys_info

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:39:27 UTC 2017

Modified Files:
src/usr.bin/sys_info: sys_info.1

Log Message:
Use Nm.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/sys_info/sys_info.1

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



CVS commit: src/bin/sh

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:37:59 UTC 2017

Modified Files:
src/bin/sh: sh.1

Log Message:
Whitespace fixes. Fix a typo. Refer to emacs using Ic, since emacs(1)
does not exist in the base system.


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/bin/sh/sh.1

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

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.165 src/bin/sh/sh.1:1.166
--- src/bin/sh/sh.1:1.165	Sun Aug 27 20:32:20 2017
+++ src/bin/sh/sh.1	Sun Aug 27 20:37:59 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.165 2017/08/27 20:32:20 wiz Exp $
+.\"	$NetBSD: sh.1,v 1.166 2017/08/27 20:37:59 wiz Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -630,7 +630,7 @@ In addition to those there are 5 forms t
 data, which is obtained from the subsequent characters.
 An escape
 .Pq \e
-followed by one, two or three, octal digits 
+followed by one, two or three, octal digits
 .Po So 0 Sc Ns \&.. Ns So 7 Sc Ns Pc
 is processed to form an 8 bit character value.
 If only one or two digits are present, the following
@@ -644,7 +644,7 @@ An escape followed by
 .Sq x
 (lower case only) can be followed by one or two
 hexadecimal digits
-.Po So 0 Sc Ns \&.. Ns So 9 Sc Ns , So A Sc Ns \&.. Ns So F Sc Ns , or So a Sc Ns \&.. Ns So f Sc Ns . Pc
+.Po So 0 Sc Ns \&.. Ns So 9 Sc , So A Sc Ns \&.. Ns So F Sc , or So a Sc Ns \&.. Ns So f Sc . Pc
 As with octal, if only one hex digit is present, the following
 character must be something other than a hex digit,
 so always giving 2 hex digits is best.
@@ -3073,9 +3073,8 @@ key while in command mode will pass the 
 .Pp
 The
 .Ar emacs
-mode uses commands similar to a subset available in
-the
-.Xr emacs 1
+mode uses commands similar to a subset available in the
+.Ic emacs
 editor.
 With emacs-mode enabled, special keys can be used to modify the text
 in the buffer using the control key.
@@ -3188,7 +3187,7 @@ To allow smooth use of prompts, without 
 .Xr editline 7
 is disabled, the character chosen should be one which will be
 ignored by the terminal if received, as when
-.Xr edlitline 7
+.Xr editline 7
 is not in use, the prompt strings are simply written to the terminal.
 For example, setting:
 .Bd -compact -literal -offset left



CVS commit: src/bin/sh

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:37:59 UTC 2017

Modified Files:
src/bin/sh: sh.1

Log Message:
Whitespace fixes. Fix a typo. Refer to emacs using Ic, since emacs(1)
does not exist in the base system.


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/bin/sh/sh.1

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



CVS commit: src/usr.bin/sys_info

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:38:39 UTC 2017

Modified Files:
src/usr.bin/sys_info: sys_info.1

Log Message:
Fix xref.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/sys_info/sys_info.1

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



CVS commit: src/usr.bin/sys_info

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:38:39 UTC 2017

Modified Files:
src/usr.bin/sys_info: sys_info.1

Log Message:
Fix xref.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/sys_info/sys_info.1

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

Modified files:

Index: src/usr.bin/sys_info/sys_info.1
diff -u src/usr.bin/sys_info/sys_info.1:1.4 src/usr.bin/sys_info/sys_info.1:1.5
--- src/usr.bin/sys_info/sys_info.1:1.4	Thu Aug 24 01:43:42 2017
+++ src/usr.bin/sys_info/sys_info.1	Sun Aug 27 20:38:39 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: sys_info.1,v 1.4 2017/08/24 01:43:42 kre Exp $
+.\" $NetBSD: sys_info.1,v 1.5 2017/08/27 20:38:39 wiz Exp $
 .\"
 .\" Copyright (c) 2016 Alistair Crooks 
 .\" All rights reserved.
@@ -62,7 +62,7 @@ Set
 If not given, the system default path, as obtained from
 .Ic user.cs_path
 via
-.Xr sysctl 1
+.Xr sysctl 8
 is used.
 To use the current value of $PATH from the caller, use:
 .Dl -P \*q$PATH\*q
@@ -88,8 +88,8 @@ otherwise, with status 0.
 .Xr awk 1 ,
 .Xr sed 1 ,
 .Xr strings 1 ,
-.Xr sysctl 1 ,
-.Xr uname 1
+.Xr uname 1 ,
+.Xr sysctl 8
 .Sh HISTORY
 The
 .Nm



CVS commit: src/bin/sh

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:32:20 UTC 2017

Modified Files:
src/bin/sh: sh.1

Log Message:
Remove unnecessary Tn macro.


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/bin/sh/sh.1

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

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.164 src/bin/sh/sh.1:1.165
--- src/bin/sh/sh.1:1.164	Mon Aug 21 13:20:49 2017
+++ src/bin/sh/sh.1	Sun Aug 27 20:32:20 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.164 2017/08/21 13:20:49 kre Exp $
+.\"	$NetBSD: sh.1,v 1.165 2017/08/27 20:32:20 wiz Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -86,8 +86,7 @@ is the standard command interpreter for 
 The current version of
 .Nm
 is in the process of being changed to conform more closely to the
-.Tn POSIX
-1003.2 and 1003.2a specifications for the shell.
+POSIX 1003.2 and 1003.2a specifications for the shell.
 This version has many
 features which make it appear similar in some respects to the Korn shell,
 but it is not a Korn shell clone (see
@@ -562,9 +561,7 @@ Otherwise it remains literal.
 .Bd -filled -offset indent
 .Bf Em
 Note: this form of quoting is still somewhat experimental,
-and yet to be included in the
-.Tn POSIX
-standard.
+and yet to be included in the POSIX standard.
 This implementation is based upon the current proposals for
 standardization, and is subject to change should the eventual
 adopted text differ.
@@ -610,7 +607,7 @@ manner similar to the way they would be 
 An escaped
 .Sq a
 generates an alert (or
-.Sq Tn BEL )
+.Sq BEL )
 character, that is, control-G, or 0x07.
 In a similar way,
 .Sq b
@@ -703,8 +700,7 @@ be an alphabetic character (a letter), o
 Other than
 .Sq \ec?
 the value obtained is the least significant 5 bits of the
-.Tn ASCII
-value of the character following the
+ASCII value of the character following the
 .Sq \ec
 escape sequence.
 That is what is commonly known as the
@@ -712,14 +708,8 @@ That is what is commonly known as the
 character obtained from the given character.
 The escape sequence
 .Sq \ec?
-yields the
-.Tn ASCII
-.Tn DEL
-character (0x7F).
-Note that to obtain the
-.Tn ASCII
-.Tn FS
-character (0x1C) this way,
+yields the ASCII DEL character (0x7F).
+Note that to obtain the ASCII FS character (0x1C) this way,
 .Pq "that is control-\e"
 the trailing
 .Sq \e
@@ -784,9 +774,7 @@ This use is strongly discouraged.
 .Ss Commands
 The shell interprets the words it reads according to a language, the
 specification of which is outside the scope of this man page (refer to the
-BNF in the
-.Tn POSIX
-1003.2 document).
+BNF in the POSIX 1003.2 document).
 Essentially though, a line is read and if the first
 word of the line (or after a control operator) is not a reserved word,
 then the shell has recognized a simple command.
@@ -957,9 +945,7 @@ described in the next section).
 When a normal program is executed, the shell runs the program,
 passing the arguments and the environment to the program.
 If the program is not a normal executable file, and if it does
-not begin with the "magic number" whose
-.Tn ASCII
-representation is "#!", so
+not begin with the "magic number" whose ASCII representation is "#!", so
 .Xr execve 2
 returns
 .Er ENOEXEC
@@ -1754,9 +1740,7 @@ and substitutes the calculated value of 
 Arithmetic expressions use a syntax similar to that
 of the C language, and are evaluated using the
 .Ql intmax_t
-data type (this is an extension to
-.Tn POSIX ,
-which requires only
+data type (this is an extension to POSIX, which requires only
 .Ql long
 arithmetic.)
 Shell variables may be referenced by name inside an arithmetic
@@ -2115,9 +2099,7 @@ Traditionally Bourne-like shells
 (except
 .Xr ksh 1 ) ,
 made those file descriptors available to exec'ed processes.
-This behavior is required by the
-.Tn POSIX
-standard, so when the
+This behavior is required by the POSIX standard, so when the
 .Ic posix
 option is set, this shell also acts that way.
 To be assured the close-on-exec setting is off,
@@ -2311,8 +2293,7 @@ and
 .Xr open 2
 for more information.
 .It getopts Ar optstring var
-The
-.Tn POSIX
+The POSIX
 .Ic getopts
 command, not to be confused with the
 .Em Bell Labs



CVS commit: src/bin/sh

2017-08-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Aug 27 20:32:20 UTC 2017

Modified Files:
src/bin/sh: sh.1

Log Message:
Remove unnecessary Tn macro.


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/bin/sh/sh.1

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



CVS commit: src/sys/arch/sparc64/sparc64

2017-08-27 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sun Aug 27 19:31:44 UTC 2017

Modified Files:
src/sys/arch/sparc64/sparc64: cpu.c

Log Message:
sun4v: Change clk and sclk variables to unsigned type so modern faster systems 
with CPU frequencies above 2 Ghz are shown correctly. Example is a 3599.910 MHz 
SPARC T5-2 system that otherwise is shown incorrectly as -695.-57 MHz. Based on 
code from OpenBSD cpu.c rev. 1.41. Verified on sun4u using qemu and sun4v on 
SPARC T5-2


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/sparc64/sparc64/cpu.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/sparc64/sparc64/cpu.c
diff -u src/sys/arch/sparc64/sparc64/cpu.c:1.130 src/sys/arch/sparc64/sparc64/cpu.c:1.131
--- src/sys/arch/sparc64/sparc64/cpu.c:1.130	Fri Feb 10 23:26:23 2017
+++ src/sys/arch/sparc64/sparc64/cpu.c	Sun Aug 27 19:31:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.130 2017/02/10 23:26:23 palle Exp $ */
+/*	$NetBSD: cpu.c,v 1.131 2017/08/27 19:31:43 palle Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.130 2017/02/10 23:26:23 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.131 2017/08/27 19:31:43 palle Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -421,7 +421,7 @@ void
 cpu_attach(device_t parent, device_t dev, void *aux)
 {
 	int node;
-	long clk, sclk = 0;
+	unsigned int clk, sclk = 0;
 	struct mainbus_attach_args *ma = aux;
 	struct cpu_info *ci;
 	const char *sep;



CVS commit: src/sys/arch/sparc64/sparc64

2017-08-27 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sun Aug 27 19:31:44 UTC 2017

Modified Files:
src/sys/arch/sparc64/sparc64: cpu.c

Log Message:
sun4v: Change clk and sclk variables to unsigned type so modern faster systems 
with CPU frequencies above 2 Ghz are shown correctly. Example is a 3599.910 MHz 
SPARC T5-2 system that otherwise is shown incorrectly as -695.-57 MHz. Based on 
code from OpenBSD cpu.c rev. 1.41. Verified on sun4u using qemu and sun4v on 
SPARC T5-2


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/sparc64/sparc64/cpu.c

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



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

2017-08-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 27 19:17:54 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: files.sunxi
Removed Files:
src/sys/arch/arm/sunxi: sunxi_debe.c

Log Message:
Remove the sunxi_debe driver in favour of the more generic simplefb.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r1.1 -r0 src/sys/arch/arm/sunxi/sunxi_debe.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/sunxi/files.sunxi
diff -u src/sys/arch/arm/sunxi/files.sunxi:1.20 src/sys/arch/arm/sunxi/files.sunxi:1.21
--- src/sys/arch/arm/sunxi/files.sunxi:1.20	Sun Aug 27 16:05:26 2017
+++ src/sys/arch/arm/sunxi/files.sunxi	Sun Aug 27 19:17:54 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sunxi,v 1.20 2017/08/27 16:05:26 jmcneill Exp $
+#	$NetBSD: files.sunxi,v 1.21 2017/08/27 19:17:54 jmcneill Exp $
 #
 # Configuration info for Allwinner sunxi family SoCs
 #
@@ -146,8 +146,8 @@ attach	h3codec at fdt with h3_codec
 file	arch/arm/sunxi/sun8i_h3_codec.c		h3_codec needs-flag
 
 # Display controller
-attach	genfb at fdt with sunxi_debe
-file	arch/arm/sunxi/sunxi_debe.c		sunxi_debe
+attach	genfb at fdt with simplefb
+file	dev/fdt/simplefb.c			simplefb
 
 # Touch Screen controller
 device	sunxits: wsmousedev, tpcalib



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

2017-08-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 27 19:17:54 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: files.sunxi
Removed Files:
src/sys/arch/arm/sunxi: sunxi_debe.c

Log Message:
Remove the sunxi_debe driver in favour of the more generic simplefb.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r1.1 -r0 src/sys/arch/arm/sunxi/sunxi_debe.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/fdt

2017-08-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 27 19:14:32 UTC 2017

Added Files:
src/sys/dev/fdt: simplefb.c

Log Message:
Add an FDT "Simple Framebuffer" driver. This lets us take over framebuffers
configured by U-Boot without any knowledge of the underlying hardware.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/simplefb.c

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

Added files:

Index: src/sys/dev/fdt/simplefb.c
diff -u /dev/null src/sys/dev/fdt/simplefb.c:1.1
--- /dev/null	Sun Aug 27 19:14:32 2017
+++ src/sys/dev/fdt/simplefb.c	Sun Aug 27 19:14:32 2017
@@ -0,0 +1,209 @@
+/* $NetBSD: simplefb.c,v 1.1 2017/08/27 19:14:32 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2017 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: simplefb.c,v 1.1 2017/08/27 19:14:32 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+static const char * const compatible[] = {
+	"simple-framebuffer",
+	NULL
+};
+
+struct simplefb_softc {
+	struct genfb_softc sc_gen;
+	bus_space_tag_t sc_bst;
+	bus_space_handle_t sc_bsh;
+	int sc_phandle;
+
+	bus_addr_t sc_paddr;
+};
+
+static bool
+simplefb_shutdown(device_t self, int flags)
+{
+	genfb_enable_polling(self);
+	return true;
+}
+
+static int
+simplefb_ioctl(void *v, void *vs, u_long cmd, void *data, int flag, lwp_t *l)
+{
+	struct simplefb_softc * const sc = v;
+	struct wsdisplayio_bus_id *busid;
+	struct wsdisplayio_fbinfo *fbi;
+	struct rasops_info *ri;
+	int error;
+
+	switch (cmd) {
+	case WSDISPLAYIO_GTYPE:
+		*(u_int *)data = WSDISPLAY_TYPE_GENFB;
+		return 0;
+	case WSDISPLAYIO_GET_BUSID:
+		busid = data;
+		busid->bus_type = WSDISPLAYIO_BUS_SOC;
+		return 0;
+	case WSDISPLAYIO_GET_FBINFO:
+		fbi = data;
+		ri = >sc_gen.vd.active->scr_ri;
+		error = wsdisplayio_get_fbinfo(ri, fbi);
+		if (error == 0)
+			fbi->fbi_flags |= WSFB_VRAM_IS_RAM;
+		return error;
+	default:
+		return EPASSTHROUGH;
+	}
+}
+
+static paddr_t
+simplefb_mmap(void *v, void *vs, off_t off, int prot)
+{
+	struct simplefb_softc * const sc = v;
+
+	if (off < 0 || off >= sc->sc_gen.sc_fbsize)
+		return -1;
+
+	return bus_space_mmap(sc->sc_bst, sc->sc_paddr, off, prot,
+	BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_PREFETCHABLE);
+}
+
+static int
+simplefb_attach_genfb(struct simplefb_softc *sc)
+{
+	device_t dev = sc->sc_gen.sc_dev;
+	prop_dictionary_t dict = device_properties(dev);
+	const int phandle = sc->sc_phandle;
+	struct genfb_ops ops;
+	uint32_t width, height, stride;
+	uint16_t depth;
+	const char *format;
+	bus_addr_t addr;
+	bus_size_t size;
+
+	if (fdtbus_get_reg(phandle, 0, , ) != 0) {
+		aprint_error(": couldn't get registers\n");
+		return ENXIO;
+	}
+
+	if (of_getprop_uint32(phandle, "width", ) != 0 ||
+	of_getprop_uint32(phandle, "height", ) != 0 ||
+	of_getprop_uint32(phandle, "stride", ) != 0 ||
+	(format = fdtbus_get_string(phandle, "format")) == NULL) {
+		aprint_error(": missing property in DT\n");
+		return ENXIO;
+	}
+
+	if (strcmp(format, "a8b8g8r8") == 0 ||
+	strcmp(format, "x8r8g8b8") == 0) {
+		depth = 32;
+	} else if (strcmp(format, "r5g6b5") == 0) {
+		depth = 16;
+	} else {
+		aprint_error(": unsupported format '%s'\n", format);
+		return ENXIO;
+	}
+
+	if (bus_space_map(sc->sc_bst, addr, size, BUS_SPACE_MAP_LINEAR,
+	>sc_bsh) != 0) {
+		aprint_error(": failed to map fb\n");
+		return ENXIO;
+	}
+
+	sc->sc_paddr = addr;
+
+	prop_dictionary_set_uint32(dict, "width", width);
+	prop_dictionary_set_uint32(dict, "height", height);
+	prop_dictionary_set_uint8(dict, "depth", depth);
+	

CVS commit: src/sys/dev/fdt

2017-08-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 27 19:14:32 UTC 2017

Added Files:
src/sys/dev/fdt: simplefb.c

Log Message:
Add an FDT "Simple Framebuffer" driver. This lets us take over framebuffers
configured by U-Boot without any knowledge of the underlying hardware.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/simplefb.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/fdt

2017-08-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 27 19:13:31 UTC 2017

Modified Files:
src/sys/dev/fdt: fdtbus.c

Log Message:
Scan children of the /chosen node to pick up simplefb nodes


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/fdt/fdtbus.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/fdt

2017-08-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 27 19:13:31 UTC 2017

Modified Files:
src/sys/dev/fdt: fdtbus.c

Log Message:
Scan children of the /chosen node to pick up simplefb nodes


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/fdt/fdtbus.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/fdt/fdtbus.c
diff -u src/sys/dev/fdt/fdtbus.c:1.14 src/sys/dev/fdt/fdtbus.c:1.15
--- src/sys/dev/fdt/fdtbus.c:1.14	Wed Jun 28 23:45:20 2017
+++ src/sys/dev/fdt/fdtbus.c	Sun Aug 27 19:13:31 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtbus.c,v 1.14 2017/06/28 23:45:20 jmcneill Exp $ */
+/* $NetBSD: fdtbus.c,v 1.15 2017/08/27 19:13:31 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.14 2017/06/28 23:45:20 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.15 2017/08/27 19:13:31 jmcneill Exp $");
 
 #include 
 #include 
@@ -92,10 +92,13 @@ fdt_match(device_t parent, cfdata_t cf, 
 	if (match)
 		return match;
 
-	/* Some /clocks nodes have no compatible string */
-	if (!of_hasprop(phandle, "compatible") &&
-	OF_finddevice("/clocks") == phandle)
-		return 1;
+	/* Some nodes have no compatible string */
+	if (!of_hasprop(phandle, "compatible")) {
+		if (OF_finddevice("/clocks") == phandle)
+			return 1;
+		if (OF_finddevice("/chosen") == phandle)
+			return 1;
+	}
 
 	/* Always match the root node */
 	return OF_finddevice("/") == phandle;



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

2017-08-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 27 17:53:10 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: sunxi_mmc.c

Log Message:
"ahb" reset is optional


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/sunxi/sunxi_mmc.c

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



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

2017-08-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 27 17:53:10 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: sunxi_mmc.c

Log Message:
"ahb" reset is optional


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/sunxi/sunxi_mmc.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/sunxi/sunxi_mmc.c
diff -u src/sys/arch/arm/sunxi/sunxi_mmc.c:1.4 src/sys/arch/arm/sunxi/sunxi_mmc.c:1.5
--- src/sys/arch/arm/sunxi/sunxi_mmc.c:1.4	Fri Aug 25 00:07:03 2017
+++ src/sys/arch/arm/sunxi/sunxi_mmc.c	Sun Aug 27 17:53:10 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_mmc.c,v 1.4 2017/08/25 00:07:03 jmcneill Exp $ */
+/* $NetBSD: sunxi_mmc.c,v 1.5 2017/08/27 17:53:10 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_mmc.c,v 1.4 2017/08/25 00:07:03 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_mmc.c,v 1.5 2017/08/27 17:53:10 jmcneill Exp $");
 
 #include 
 #include 
@@ -209,10 +209,6 @@ sunxi_mmc_attach(device_t parent, device
 	}
 
 	sc->sc_rst_ahb = fdtbus_reset_get(phandle, "ahb");
-	if (sc->sc_rst_ahb == NULL) {
-		aprint_error(": couldn't get resets\n");
-		return;
-	}
 
 	sc->sc_reg_vqmmc = fdtbus_regulator_acquire(phandle, "vqmmc-supply");
 
@@ -222,9 +218,11 @@ sunxi_mmc_attach(device_t parent, device
 		return;
 	}
 
-	if (fdtbus_reset_deassert(sc->sc_rst_ahb) != 0) {
-		aprint_error(": couldn't de-assert resets\n");
-		return;
+	if (sc->sc_rst_ahb != NULL) {
+		if (fdtbus_reset_deassert(sc->sc_rst_ahb) != 0) {
+			aprint_error(": couldn't de-assert resets\n");
+			return;
+		}
 	}
 
 	sc->sc_dev = self;



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

2017-08-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 27 17:53:31 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: sun5i_a13_ccu.c

Log Message:
Add MMC clocks


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/sunxi/sun5i_a13_ccu.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/sunxi/sun5i_a13_ccu.c
diff -u src/sys/arch/arm/sunxi/sun5i_a13_ccu.c:1.2 src/sys/arch/arm/sunxi/sun5i_a13_ccu.c:1.3
--- src/sys/arch/arm/sunxi/sun5i_a13_ccu.c:1.2	Sun Aug 27 16:05:08 2017
+++ src/sys/arch/arm/sunxi/sun5i_a13_ccu.c	Sun Aug 27 17:53:31 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sun5i_a13_ccu.c,v 1.2 2017/08/27 16:05:08 jmcneill Exp $ */
+/* $NetBSD: sun5i_a13_ccu.c,v 1.3 2017/08/27 17:53:31 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: sun5i_a13_ccu.c,v 1.2 2017/08/27 16:05:08 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun5i_a13_ccu.c,v 1.3 2017/08/27 17:53:31 jmcneill Exp $");
 
 #include 
 #include 
@@ -50,6 +50,9 @@ __KERNEL_RCSID(1, "$NetBSD: sun5i_a13_cc
 #define	AHB_GATING_REG1		0x064
 #define	APB0_GATING_REG		0x068
 #define	APB1_GATING_REG		0x06c
+#define	SD0_SCLK_CFG_REG0x088
+#define	SD1_SCLK_CFG_REG0x08c
+#define	SD2_SCLK_CFG_REG0x090
 #define	USBPHY_CFG_REG		0x0cc
 #define	BE_CFG_REG		0x104
 #define	FE_CFG_REG		0x10c
@@ -95,9 +98,10 @@ static struct sunxi_ccu_reset sun5i_a13_
 
 static const char *cpu_parents[] = { "losc", "osc24m", "pll_core", "pll_periph" };
 static const char *axi_parents[] = { "cpu" };
-static const char *ahb_parents[] = { "axi", "cpu", "pll_periph", NULL };
+static const char *ahb_parents[] = { "axi", "cpu", "pll_periph" };
 static const char *apb0_parents[] = { "ahb" };
-static const char *apb1_parents[] = { "osc24m", "pll_periph", "losc", NULL };
+static const char *apb1_parents[] = { "osc24m", "pll_periph", "losc" };
+static const char *mod_parents[] = { "osc24m", "pll_periph", "pll_ddr" };
 
 static const struct sunxi_ccu_nkmp_tbl sun5i_a13_ac_dig_table[] = {
 	{ 24576000, 86, 0, 21, 3 },
@@ -172,6 +176,28 @@ static struct sunxi_ccu_clk sun5i_a13_cc
 	0,/* enable */
 	SUNXI_CCU_NM_POWER_OF_TWO),
 
+	SUNXI_CCU_NM(A13_CLK_MMC0, "mmc0", mod_parents,
+	SD0_SCLK_CFG_REG,		/* reg */
+	__BITS(17,16),		/* n */
+	__BITS(3,0),		/* m */
+	__BITS(25,24),		/* sel */
+	__BIT(31),			/* enable */
+	SUNXI_CCU_NM_POWER_OF_TWO),
+	SUNXI_CCU_NM(A13_CLK_MMC1, "mmc1", mod_parents,
+	SD1_SCLK_CFG_REG,		/* reg */
+	__BITS(17,16),		/* n */
+	__BITS(3,0),		/* m */
+	__BITS(25,24),		/* sel */
+	__BIT(31),			/* enable */
+	SUNXI_CCU_NM_POWER_OF_TWO),
+	SUNXI_CCU_NM(A13_CLK_MMC2, "mmc2", mod_parents,
+	SD2_SCLK_CFG_REG,		/* reg */
+	__BITS(17,16),		/* n */
+	__BITS(3,0),		/* m */
+	__BITS(25,24),		/* sel */
+	__BIT(31),			/* enable */
+	SUNXI_CCU_NM_POWER_OF_TWO),
+
 	/* AHB_GATING_REG0. Missing: SS, EMAC, TS, GPS */
 	SUNXI_CCU_GATE(A13_CLK_AHB_OTG, "ahb-otg", "ahb",
 	AHB_GATING_REG0, 0),



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

2017-08-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 27 17:53:31 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: sun5i_a13_ccu.c

Log Message:
Add MMC clocks


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

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



CVS commit: src/sys/arch

2017-08-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 27 16:05:26 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: files.sunxi sunxi_codec.c sunxi_codec.h
src/sys/arch/evbarm/conf: SUNXI
Added Files:
src/sys/arch/arm/sunxi: sun4i_a10_codec.c sun4i_dma.c

Log Message:
Add sun4i DMA and audio codec support.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/sunxi/sun4i_a10_codec.c \
src/sys/arch/arm/sunxi/sun4i_dma.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sunxi_codec.c \
src/sys/arch/arm/sunxi/sunxi_codec.h
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/evbarm/conf/SUNXI

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/sunxi/files.sunxi
diff -u src/sys/arch/arm/sunxi/files.sunxi:1.19 src/sys/arch/arm/sunxi/files.sunxi:1.20
--- src/sys/arch/arm/sunxi/files.sunxi:1.19	Sun Aug 27 02:19:46 2017
+++ src/sys/arch/arm/sunxi/files.sunxi	Sun Aug 27 16:05:26 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sunxi,v 1.19 2017/08/27 02:19:46 jmcneill Exp $
+#	$NetBSD: files.sunxi,v 1.20 2017/08/27 16:05:26 jmcneill Exp $
 #
 # Configuration info for Allwinner sunxi family SoCs
 #
@@ -124,7 +124,12 @@ device	sunxiwdt: sysmon_wdog
 attach	sunxiwdt at fdt with sunxi_wdt
 file	arch/arm/sunxi/sunxi_wdt.c		sunxi_wdt
 
-# DMA controller
+# DMA controller (sun4i)
+device	sun4idma
+attach	sun4idma at fdt with sun4i_dma
+file	arch/arm/sunxi/sun4i_dma.c		sun4i_dma
+
+# DMA controller (sun6i)
 device	sun6idma
 attach	sun6idma at fdt with sun6i_dma
 file	arch/arm/sunxi/sun6i_dma.c		sun6i_dma
@@ -133,8 +138,9 @@ file	arch/arm/sunxi/sun6i_dma.c		sun6i_d
 device	sunxicodec: audiobus, auconv, mulaw, aurateconv
 attach	sunxicodec at fdt with sunxi_codec
 file	arch/arm/sunxi/sunxi_codec.c		sunxi_codec
+file	arch/arm/sunxi/sun4i_a10_codec.c	sunxi_codec
 
-# Audio codec (analog part)
+# H3 Audio codec (analog part)
 device	h3codec
 attach	h3codec at fdt with h3_codec
 file	arch/arm/sunxi/sun8i_h3_codec.c		h3_codec needs-flag

Index: src/sys/arch/arm/sunxi/sunxi_codec.c
diff -u src/sys/arch/arm/sunxi/sunxi_codec.c:1.1 src/sys/arch/arm/sunxi/sunxi_codec.c:1.2
--- src/sys/arch/arm/sunxi/sunxi_codec.c:1.1	Sun Aug  6 17:15:45 2017
+++ src/sys/arch/arm/sunxi/sunxi_codec.c	Sun Aug 27 16:05:26 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_codec.c,v 1.1 2017/08/06 17:15:45 jmcneill Exp $ */
+/* $NetBSD: sunxi_codec.c,v 1.2 2017/08/27 16:05:26 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill 
@@ -29,7 +29,7 @@
 #include "opt_ddb.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_codec.c,v 1.1 2017/08/06 17:15:45 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_codec.c,v 1.2 2017/08/27 16:05:26 jmcneill Exp $");
 
 #include 
 #include 
@@ -90,6 +90,7 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_codec.
 #define	AC_ADC_CNT(_sc)		((_sc)->sc_cfg->ADC_CNT)
 
 static const struct of_compat_data compat_data[] = {
+	A10_CODEC_COMPATDATA,
 	H3_CODEC_COMPATDATA,
 	{ NULL }
 };
@@ -626,14 +627,12 @@ sunxi_codec_clock_init(int phandle)
 
 	/* De-assert reset */
 	rst = fdtbus_reset_get_index(phandle, 0);
-	if (rst == NULL) {
-		aprint_error(": couldn't find reset\n");
-		return ENXIO;
-	}
-	error = fdtbus_reset_deassert(rst);
-	if (error != 0) {
-		aprint_error(": couldn't de-assert reset: %d\n", error);
-		return error;
+	if (rst != NULL) {
+		error = fdtbus_reset_deassert(rst);
+		if (error != 0) {
+			aprint_error(": couldn't de-assert reset: %d\n", error);
+			return error;
+		}
 	}
 
 	return 0;
Index: src/sys/arch/arm/sunxi/sunxi_codec.h
diff -u src/sys/arch/arm/sunxi/sunxi_codec.h:1.1 src/sys/arch/arm/sunxi/sunxi_codec.h:1.2
--- src/sys/arch/arm/sunxi/sunxi_codec.h:1.1	Sun Aug  6 17:15:45 2017
+++ src/sys/arch/arm/sunxi/sunxi_codec.h	Sun Aug 27 16:05:26 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_codec.h,v 1.1 2017/08/06 17:15:45 jmcneill Exp $ */
+/* $NetBSD: sunxi_codec.h,v 1.2 2017/08/27 16:05:26 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill 
@@ -126,4 +126,8 @@ extern const struct sunxi_codec_conf sun
 #define	H3_CODEC_COMPATDATA
 #endif
 
+extern const struct sunxi_codec_conf sun4i_a10_codecconf;
+#define	A10_CODEC_COMPATDATA	\
+	{ "allwinner,sun4i-a10-codec",	(uintptr_t)_a10_codecconf }
+
 #endif /* !_ARM_SUNXI_CODEC_H */

Index: src/sys/arch/evbarm/conf/SUNXI
diff -u src/sys/arch/evbarm/conf/SUNXI:1.24 src/sys/arch/evbarm/conf/SUNXI:1.25
--- src/sys/arch/evbarm/conf/SUNXI:1.24	Sun Aug 27 02:22:17 2017
+++ src/sys/arch/evbarm/conf/SUNXI	Sun Aug 27 16:05:26 2017
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: SUNXI,v 1.24 2017/08/27 02:22:17 jmcneill Exp $
+#	$NetBSD: SUNXI,v 1.25 2017/08/27 16:05:26 jmcneill Exp $
 #
 #	Allwinner sunxi family
 #
@@ -114,7 +114,8 @@ sunxiintc*	at fdt? pass 1		# Allwinner I
 # Memory controller
 
 # DMA controller
-sun6idma*	at fdt?			# 

CVS commit: src/sys/arch

2017-08-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 27 16:05:26 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: files.sunxi sunxi_codec.c sunxi_codec.h
src/sys/arch/evbarm/conf: SUNXI
Added Files:
src/sys/arch/arm/sunxi: sun4i_a10_codec.c sun4i_dma.c

Log Message:
Add sun4i DMA and audio codec support.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/sunxi/sun4i_a10_codec.c \
src/sys/arch/arm/sunxi/sun4i_dma.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sunxi_codec.c \
src/sys/arch/arm/sunxi/sunxi_codec.h
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/evbarm/conf/SUNXI

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



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

2017-08-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 27 16:05:08 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: sun5i_a13_ccu.c

Log Message:
Add audio clocks


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sun5i_a13_ccu.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/sunxi/sun5i_a13_ccu.c
diff -u src/sys/arch/arm/sunxi/sun5i_a13_ccu.c:1.1 src/sys/arch/arm/sunxi/sun5i_a13_ccu.c:1.2
--- src/sys/arch/arm/sunxi/sun5i_a13_ccu.c:1.1	Fri Aug 25 00:07:03 2017
+++ src/sys/arch/arm/sunxi/sun5i_a13_ccu.c	Sun Aug 27 16:05:08 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sun5i_a13_ccu.c,v 1.1 2017/08/25 00:07:03 jmcneill Exp $ */
+/* $NetBSD: sun5i_a13_ccu.c,v 1.2 2017/08/27 16:05:08 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: sun5i_a13_ccu.c,v 1.1 2017/08/25 00:07:03 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun5i_a13_ccu.c,v 1.2 2017/08/27 16:05:08 jmcneill Exp $");
 
 #include 
 #include 
@@ -41,6 +41,7 @@ __KERNEL_RCSID(1, "$NetBSD: sun5i_a13_cc
 #include 
 
 #define	PLL1_CFG_REG		0x000
+#define	PLL2_CFG_REG		0x008
 #define	PLL6_CFG_REG		0x028
 #define	OSC24M_CFG_REG		0x050
 #define	CPU_AHB_APB0_CFG_REG	0x054
@@ -54,6 +55,7 @@ __KERNEL_RCSID(1, "$NetBSD: sun5i_a13_cc
 #define	FE_CFG_REG		0x10c
 #define	CSI_CFG_REG		0x134
 #define	VE_CFG_REG		0x13c
+#define	AUDIO_CODEC_SCLK_CFG_REG 0x140
 #define	MALI_CLOCK_CFG_REG	0x154
 #define	IEP_SCLK_CFG_REG	0x160
 
@@ -97,6 +99,11 @@ static const char *ahb_parents[] = { "ax
 static const char *apb0_parents[] = { "ahb" };
 static const char *apb1_parents[] = { "osc24m", "pll_periph", "losc", NULL };
 
+static const struct sunxi_ccu_nkmp_tbl sun5i_a13_ac_dig_table[] = {
+	{ 24576000, 86, 0, 21, 3 },
+	{ 0 }
+};
+
 static struct sunxi_ccu_clk sun5i_a13_ccu_clks[] = {
 	SUNXI_CCU_GATE(A13_CLK_HOSC, "osc24m", "hosc",
 	OSC24M_CFG_REG, 0),
@@ -110,6 +117,17 @@ static struct sunxi_ccu_clk sun5i_a13_cc
 	__BIT(31),			/* enable */
 	SUNXI_CCU_NKMP_FACTOR_P_POW2 | SUNXI_CCU_NKMP_FACTOR_N_EXACT),
 
+	SUNXI_CCU_NKMP_TABLE(A13_CLK_PLL_AUDIO_BASE, "pll_audio", "osc24m",
+	PLL2_CFG_REG,		/* reg */
+	__BITS(14,8),		/* n */
+	0,/* k */
+	__BITS(4,0),		/* m */
+	__BITS(29,26),		/* p */
+	__BIT(31),			/* enable */
+	0,/* lock */
+	sun5i_a13_ac_dig_table,	/* table */
+	0),
+
 	SUNXI_CCU_NKMP(A13_CLK_PERIPH, "pll_periph", "osc24m",
 	PLL6_CFG_REG,		/* reg */
 	__BITS(12,8),		/* n */
@@ -220,6 +238,10 @@ static struct sunxi_ccu_clk sun5i_a13_cc
 	SUNXI_CCU_GATE(A13_CLK_APB1_UART3, "apb1-uart3", "apb1",
 	APB1_GATING_REG, 19),
 
+	/* AUDIO_CODEC_SCLK_CFG_REG */
+	SUNXI_CCU_GATE(A13_CLK_CODEC, "codec", "pll_audio",
+	AUDIO_CODEC_SCLK_CFG_REG, 31),
+
 	/* USBPHY_CFG_REG */
 	SUNXI_CCU_GATE(A13_CLK_USB_OHCI, "usb-ohci", "osc24m",
 	USBPHY_CFG_REG, 6),



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

2017-08-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 27 16:05:08 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: sun5i_a13_ccu.c

Log Message:
Add audio clocks


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sun5i_a13_ccu.c

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



CVS commit: src/sys/netinet6

2017-08-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 27 12:34:21 UTC 2017

Modified Files:
src/sys/netinet6: in6_src.c

Log Message:
PR/52382: BERTRAND Joel: Fix mapped IPv4 source selection; this got broken
in the last code refactoring. in6_selectif failing is not fatal.
XXX: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/netinet6/in6_src.c

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



CVS commit: src/sys/netinet6

2017-08-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 27 12:34:21 UTC 2017

Modified Files:
src/sys/netinet6: in6_src.c

Log Message:
PR/52382: BERTRAND Joel: Fix mapped IPv4 source selection; this got broken
in the last code refactoring. in6_selectif failing is not fatal.
XXX: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/netinet6/in6_src.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/netinet6/in6_src.c
diff -u src/sys/netinet6/in6_src.c:1.79 src/sys/netinet6/in6_src.c:1.80
--- src/sys/netinet6/in6_src.c:1.79	Thu Feb 16 22:57:17 2017
+++ src/sys/netinet6/in6_src.c	Sun Aug 27 08:34:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_src.c,v 1.79 2017/02/17 03:57:17 ozaki-r Exp $	*/
+/*	$NetBSD: in6_src.c,v 1.80 2017/08/27 12:34:21 christos Exp $	*/
 /*	$KAME: in6_src.c,v 1.159 2005/10/19 01:40:32 t-momose Exp $	*/
 
 /*
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.79 2017/02/17 03:57:17 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.80 2017/08/27 12:34:21 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -461,7 +461,7 @@ in6_selectsrc(struct sockaddr_in6 *dstso
 	struct in6_ifaddr *ia = NULL;
 	struct in6_pktinfo *pi = NULL;
 	u_int32_t odstzone;
-	int error;
+	int error = 0, iferror;
 #if defined(MIP6) && NMIP > 0
 	u_int8_t ip6po_usecoa = 0;
 #endif /* MIP6 && NMIP > 0 */
@@ -484,7 +484,7 @@ in6_selectsrc(struct sockaddr_in6 *dstso
 	 * to this function (e.g., for identifying the appropriate scope zone
 	 * ID).
 	 */
-	error = in6_selectif(dstsock, opts, mopts, ro, , PSREF);
+	iferror = in6_selectif(dstsock, opts, mopts, ro, , PSREF);
 	if (ifpp != NULL)
 		*ifpp = ifp;
 
@@ -549,8 +549,10 @@ in6_selectsrc(struct sockaddr_in6 *dstso
 	 * The outgoing interface is crucial in the general selection procedure
 	 * below.  If it is not known at this point, we fail.
 	 */
-	if (ifp == NULL)
+	if (ifp == NULL) {
+		error = iferror;
 		goto exit;
+	}
 
 	/*
 	 * If the address is not yet determined, choose the best one based on



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

2017-08-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 27 11:44:49 UTC 2017

Modified Files:
src/sys/arch/arm/arm: cpufunc.c

Log Message:
#ifdef whack-a-mole


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/sys/arch/arm/arm/cpufunc.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/arm/cpufunc.c
diff -u src/sys/arch/arm/arm/cpufunc.c:1.165 src/sys/arch/arm/arm/cpufunc.c:1.166
--- src/sys/arch/arm/arm/cpufunc.c:1.165	Sat Aug 26 07:17:12 2017
+++ src/sys/arch/arm/arm/cpufunc.c	Sun Aug 27 11:44:49 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.c,v 1.165 2017/08/26 07:17:12 skrll Exp $	*/
+/*	$NetBSD: cpufunc.c,v 1.166 2017/08/27 11:44:49 skrll Exp $	*/
 
 /*
  * arm7tdmi support code Copyright (c) 2001 John Fremlin
@@ -49,7 +49,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.165 2017/08/26 07:17:12 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.166 2017/08/27 11:44:49 skrll Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_cpuoptions.h"
@@ -1764,6 +1764,7 @@ get_cachetype_table(void)
 #endif /* ARM2 || ARM250 || ARM3 || ARM6 || ARM7 || SA110 || SA1100 || SA || IXP12X0 */
 
 
+#if defined(CPU_CORTEX) || defined(CPU_PJ4B)
 static inline void
 set_cpufuncs_mpfixup(void)
 {
@@ -1780,6 +1781,7 @@ set_cpufuncs_mpfixup(void)
 	}
 #endif
 }
+#endif
 
 /*
  * Cannot panic here as we may not have a console yet ...



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

2017-08-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 27 11:44:49 UTC 2017

Modified Files:
src/sys/arch/arm/arm: cpufunc.c

Log Message:
#ifdef whack-a-mole


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/sys/arch/arm/arm/cpufunc.c

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



CVS commit: src/usr.sbin/bta2dpd/bta2dpd

2017-08-27 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sun Aug 27 10:39:18 UTC 2017

Modified Files:
src/usr.sbin/bta2dpd/bta2dpd: bta2dpd.c

Log Message:
Connection state machine improvement upon transition from AVDTP_OPEN to
AVDTP_START/SUSPEND.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c

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

Modified files:

Index: src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
diff -u src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c:1.3 src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c:1.4
--- src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c:1.3	Sat May 27 10:04:57 2017
+++ src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c	Sun Aug 27 10:39:18 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: bta2dpd.c,v 1.3 2017/05/27 10:04:57 nat Exp $ */
+/* $NetBSD: bta2dpd.c,v 1.4 2017/08/27 10:39:18 nat Exp $ */
 
 /*-
  * Copyright (c) 2015 - 2016 Nathanial Sloss 
@@ -674,7 +674,8 @@ do_ctlreq(int fd, short ev, void *arg)
 		case AVDTP_SUSPEND:
 		case AVDTP_START:
 			avdtpSendAccept(fd, fd, trans, signal);
-			state = 6;
+			if (state < 6)
+state = 6;
 			break;
 		default:
 			avdtpSendReject(fd, fd, trans, signal);
@@ -717,7 +718,8 @@ do_ctlreq(int fd, short ev, void *arg)
 			break;
 		case AVDTP_SUSPEND:
 		case AVDTP_START:
-			state = 6;
+			if (state < 6)
+state = 6;
 			break;
 		default:
 			avdtpSendReject(fd, fd, trans, signal);
@@ -730,7 +732,7 @@ do_ctlreq(int fd, short ev, void *arg)
 	if (state < 5 || state > 7)
 		return;
 
-	if (asSpeaker) {
+	if (asSpeaker && state == 6) {
 		len = sizeof(addr);
 		if ((sc = accept(orighc,(struct sockaddr*), )) < 0)
 			err(EXIT_FAILURE, "stream accept");



CVS commit: src/usr.sbin/bta2dpd/bta2dpd

2017-08-27 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sun Aug 27 10:39:18 UTC 2017

Modified Files:
src/usr.sbin/bta2dpd/bta2dpd: bta2dpd.c

Log Message:
Connection state machine improvement upon transition from AVDTP_OPEN to
AVDTP_START/SUSPEND.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c

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



CVS commit: src/sys/arch

2017-08-27 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug 27 09:32:13 UTC 2017

Modified Files:
src/sys/arch/i386/i386: machdep.c
src/sys/arch/x86/include: cpu.h
src/sys/arch/x86/x86: cpu.c

Log Message:
style, and move some i386-specific code into i386/


To generate a diff of this commit:
cvs rdiff -u -r1.791 -r1.792 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.133 -r1.134 src/sys/arch/x86/x86/cpu.c

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



CVS commit: src/sys/arch

2017-08-27 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug 27 09:32:13 UTC 2017

Modified Files:
src/sys/arch/i386/i386: machdep.c
src/sys/arch/x86/include: cpu.h
src/sys/arch/x86/x86: cpu.c

Log Message:
style, and move some i386-specific code into i386/


To generate a diff of this commit:
cvs rdiff -u -r1.791 -r1.792 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.133 -r1.134 src/sys/arch/x86/x86/cpu.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/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.791 src/sys/arch/i386/i386/machdep.c:1.792
--- src/sys/arch/i386/i386/machdep.c:1.791	Sat Aug 12 19:06:23 2017
+++ src/sys/arch/i386/i386/machdep.c	Sun Aug 27 09:32:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.791 2017/08/12 19:06:23 kre Exp $	*/
+/*	$NetBSD: machdep.c,v 1.792 2017/08/27 09:32:12 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.791 2017/08/12 19:06:23 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.792 2017/08/27 09:32:12 maxv Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_freebsd.h"
@@ -560,7 +560,80 @@ i386_tls_switch(lwp_t *l)
 }
 #endif /* XEN */
 
+/* XXX */
+#define IDTVEC(name)	__CONCAT(X, name)
+typedef void (vector)(void);
+
 #ifndef XEN
+static void	tss_init(struct i386tss *, void *, void *);
+
+static void
+tss_init(struct i386tss *tss, void *stack, void *func)
+{
+	KASSERT(curcpu()->ci_pmap == pmap_kernel());
+
+	memset(tss, 0, sizeof *tss);
+	tss->tss_esp0 = tss->tss_esp = (int)((char *)stack + USPACE - 16);
+	tss->tss_ss0 = GSEL(GDATA_SEL, SEL_KPL);
+	tss->__tss_cs = GSEL(GCODE_SEL, SEL_KPL);
+	tss->tss_fs = GSEL(GCPU_SEL, SEL_KPL);
+	tss->tss_gs = tss->__tss_es = tss->__tss_ds =
+	tss->__tss_ss = GSEL(GDATA_SEL, SEL_KPL);
+	/* %cr3 contains the value associated to pmap_kernel */
+	tss->tss_cr3 = rcr3();
+	tss->tss_esp = (int)((char *)stack + USPACE - 16);
+	tss->tss_ldt = GSEL(GLDT_SEL, SEL_KPL);
+	tss->__tss_eflags = PSL_MBO | PSL_NT;	/* XXX not needed? */
+	tss->__tss_eip = (int)func;
+}
+
+extern vector IDTVEC(tss_trap08);
+#if defined(DDB) && defined(MULTIPROCESSOR)
+extern vector Xintrddbipi, Xx2apic_intrddbipi;
+extern int ddb_vec;
+#endif
+
+void
+cpu_set_tss_gates(struct cpu_info *ci)
+{
+	struct segment_descriptor sd;
+	void *doubleflt_stack;
+
+	doubleflt_stack = (void *)uvm_km_alloc(kernel_map, USPACE, 0,
+	UVM_KMF_WIRED);
+	tss_init(>ci_doubleflt_tss, doubleflt_stack, IDTVEC(tss_trap08));
+
+	setsegment(, >ci_doubleflt_tss, sizeof(struct i386tss) - 1,
+	SDT_SYS386TSS, SEL_KPL, 0, 0);
+	ci->ci_gdt[GTRAPTSS_SEL].sd = sd;
+
+	setgate([8], NULL, 0, SDT_SYSTASKGT, SEL_KPL,
+	GSEL(GTRAPTSS_SEL, SEL_KPL));
+
+#if defined(DDB) && defined(MULTIPROCESSOR)
+	/*
+	 * Set up separate handler for the DDB IPI, so that it doesn't
+	 * stomp on a possibly corrupted stack.
+	 *
+	 * XXX overwriting the gate set in db_machine_init.
+	 * Should rearrange the code so that it's set only once.
+	 */
+	void *ddbipi_stack;
+
+	ddbipi_stack = (void *)uvm_km_alloc(kernel_map, USPACE, 0,
+	UVM_KMF_WIRED);
+	tss_init(>ci_ddbipi_tss, ddbipi_stack,
+	x2apic_mode ? Xx2apic_intrddbipi : Xintrddbipi);
+
+	setsegment(, >ci_ddbipi_tss, sizeof(struct i386tss) - 1,
+	SDT_SYS386TSS, SEL_KPL, 0, 0);
+	ci->ci_gdt[GIPITSS_SEL].sd = sd;
+
+	setgate([ddb_vec], NULL, 0, SDT_SYSTASKGT, SEL_KPL,
+	GSEL(GIPITSS_SEL, SEL_KPL));
+#endif
+}
+
 /*
  * Set up TSS and I/O bitmap.
  */
@@ -904,8 +977,7 @@ setsegment(struct segment_descriptor *sd
 	sd->sd_hibase = (int)base >> 24;
 }
 
-#define	IDTVEC(name)	__CONCAT(X, name)
-typedef void (vector)(void);
+/* XXX */
 extern vector IDTVEC(syscall);
 extern vector *IDTVEC(exceptions)[];
 #ifdef XEN

Index: src/sys/arch/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.77 src/sys/arch/x86/include/cpu.h:1.78
--- src/sys/arch/x86/include/cpu.h:1.77	Sun Aug 27 08:38:32 2017
+++ src/sys/arch/x86/include/cpu.h	Sun Aug 27 09:32:13 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.77 2017/08/27 08:38:32 maxv Exp $	*/
+/*	$NetBSD: cpu.h,v 1.78 2017/08/27 09:32:13 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -403,6 +403,9 @@ extern void (*x86_cpu_idle)(void);
 #define	cpu_idle() (*x86_cpu_idle)()
 
 /* machdep.c */
+#ifdef i386
+void	cpu_set_tss_gates(struct cpu_info *);
+#endif
 void	cpu_reset(void);
 
 /* longrun.c */
@@ -429,9 +432,6 @@ extern vm_guest_t vm_guest;
 /* cpu_topology.c */
 void	x86_cpu_topology(struct cpu_info *);
 
-/* vm_machdep.c */
-void	cpu_proc_fork(struct proc *, struct proc *);
-
 /* locore.s */
 struct region_descriptor;
 void	lgdt(struct region_descriptor *);
@@ -458,10 +458,10 @@ void	i8254_initclocks(void);
 #endif
 
 /* cpu.c */
-
 

CVS commit: src/sys/arch/x86

2017-08-27 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug 27 08:38:32 UTC 2017

Modified Files:
src/sys/arch/x86/include: cpu.h
src/sys/arch/x86/x86: cpu.c

Log Message:
Localify. By the way, we should use a different stack for NMIs.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.132 -r1.133 src/sys/arch/x86/x86/cpu.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/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.76 src/sys/arch/x86/include/cpu.h:1.77
--- src/sys/arch/x86/include/cpu.h:1.76	Sat Aug 12 07:21:57 2017
+++ src/sys/arch/x86/include/cpu.h	Sun Aug 27 08:38:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.76 2017/08/12 07:21:57 maxv Exp $	*/
+/*	$NetBSD: cpu.h,v 1.77 2017/08/27 08:38:32 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -205,9 +205,6 @@ struct cpu_info {
 #endif /* __x86_64__ */
 #endif /* XEN et.al */
 
-	char *ci_doubleflt_stack;
-	char *ci_ddbipi_stack;
-
 #ifndef XEN
 	struct evcnt ci_ipi_events[X86_NIPI];
 #else   /* XEN */

Index: src/sys/arch/x86/x86/cpu.c
diff -u src/sys/arch/x86/x86/cpu.c:1.132 src/sys/arch/x86/x86/cpu.c:1.133
--- src/sys/arch/x86/x86/cpu.c:1.132	Fri Jul 28 14:12:26 2017
+++ src/sys/arch/x86/x86/cpu.c	Sun Aug 27 08:38:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.132 2017/07/28 14:12:26 riastradh Exp $	*/
+/*	$NetBSD: cpu.c,v 1.133 2017/08/27 08:38:32 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2000-2012 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.132 2017/07/28 14:12:26 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.133 2017/08/27 08:38:32 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"		/* for MPDEBUG */
@@ -977,14 +977,16 @@ static void
 cpu_set_tss_gates(struct cpu_info *ci)
 {
 	struct segment_descriptor sd;
+	void *doubleflt_stack;
 
-	ci->ci_doubleflt_stack = (char *)uvm_km_alloc(kernel_map, USPACE, 0,
+	doubleflt_stack = (void *)uvm_km_alloc(kernel_map, USPACE, 0,
 	UVM_KMF_WIRED);
-	tss_init(>ci_doubleflt_tss, ci->ci_doubleflt_stack,
-	IDTVEC(tss_trap08));
+	tss_init(>ci_doubleflt_tss, doubleflt_stack, IDTVEC(tss_trap08));
+
 	setsegment(, >ci_doubleflt_tss, sizeof(struct i386tss) - 1,
 	SDT_SYS386TSS, SEL_KPL, 0, 0);
 	ci->ci_gdt[GTRAPTSS_SEL].sd = sd;
+
 	setgate([8], NULL, 0, SDT_SYSTASKGT, SEL_KPL,
 	GSEL(GTRAPTSS_SEL, SEL_KPL));
 
@@ -996,9 +998,11 @@ cpu_set_tss_gates(struct cpu_info *ci)
 	 * XXX overwriting the gate set in db_machine_init.
 	 * Should rearrange the code so that it's set only once.
 	 */
-	ci->ci_ddbipi_stack = (char *)uvm_km_alloc(kernel_map, USPACE, 0,
+	void *ddbipi_stack;
+
+	ddbipi_stack = (void *)uvm_km_alloc(kernel_map, USPACE, 0,
 	UVM_KMF_WIRED);
-	tss_init(>ci_ddbipi_tss, ci->ci_ddbipi_stack,
+	tss_init(>ci_ddbipi_tss, ddbipi_stack,
 	x2apic_mode ? Xx2apic_intrddbipi : Xintrddbipi);
 
 	setsegment(, >ci_ddbipi_tss, sizeof(struct i386tss) - 1,



CVS commit: src/sys/arch/x86

2017-08-27 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug 27 08:38:32 UTC 2017

Modified Files:
src/sys/arch/x86/include: cpu.h
src/sys/arch/x86/x86: cpu.c

Log Message:
Localify. By the way, we should use a different stack for NMIs.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.132 -r1.133 src/sys/arch/x86/x86/cpu.c

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



CVS commit: src/sys/fs/v7fs

2017-08-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 27 06:18:16 UTC 2017

Modified Files:
src/sys/fs/v7fs: v7fs_io_kern.c

Log Message:
Remove some unnecessary duplicatioN


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/fs/v7fs/v7fs_io_kern.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/fs/v7fs/v7fs_io_kern.c
diff -u src/sys/fs/v7fs/v7fs_io_kern.c:1.4 src/sys/fs/v7fs/v7fs_io_kern.c:1.5
--- src/sys/fs/v7fs/v7fs_io_kern.c:1.4	Thu Jun  1 02:45:13 2017
+++ src/sys/fs/v7fs/v7fs_io_kern.c	Sun Aug 27 06:18:16 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: v7fs_io_kern.c,v 1.4 2017/06/01 02:45:13 chs Exp $	*/
+/*	$NetBSD: v7fs_io_kern.c,v 1.5 2017/08/27 06:18:16 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2004, 2011 The NetBSD Foundation, Inc.
@@ -30,13 +30,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: v7fs_io_kern.c,v 1.4 2017/06/01 02:45:13 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: v7fs_io_kern.c,v 1.5 2017/08/27 06:18:16 skrll Exp $");
+
 #if defined _KERNEL_OPT
 #include "opt_v7fs.h"
 #endif
-#include 
-
-__KERNEL_RCSID(0, "$NetBSD: v7fs_io_kern.c,v 1.4 2017/06/01 02:45:13 chs Exp $");
 
 #include 
 #include 



CVS commit: src/sys/fs/v7fs

2017-08-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug 27 06:18:16 UTC 2017

Modified Files:
src/sys/fs/v7fs: v7fs_io_kern.c

Log Message:
Remove some unnecessary duplicatioN


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/fs/v7fs/v7fs_io_kern.c

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