CVS commit: src/sys/arch/xen/include

2016-10-15 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Oct 16 06:40:44 UTC 2016

Modified Files:
src/sys/arch/xen/include: intr.h

Log Message:
This should return the amd64 build to a working state (and hopefully
i386 as well) - but this is a hideous hack, and should be reverted
as soon as a better (which means any) alternative is available.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/xen/include/intr.h

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

Modified files:

Index: src/sys/arch/xen/include/intr.h
diff -u src/sys/arch/xen/include/intr.h:1.37 src/sys/arch/xen/include/intr.h:1.38
--- src/sys/arch/xen/include/intr.h:1.37	Thu Jul  7 06:55:40 2016
+++ src/sys/arch/xen/include/intr.h	Sun Oct 16 06:40:43 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.37 2016/07/07 06:55:40 msaitoh Exp $	*/
+/*	$NetBSD: intr.h,v 1.38 2016/10/16 06:40:43 kre Exp $	*/
 /*	NetBSD intr.h,v 1.15 2004/10/31 10:39:34 yamt Exp	*/
 
 /*-
@@ -185,6 +185,14 @@ void xen_broadcast_ipi(uint32_t);
 #define xen_broadcast_ipi(_i1) ((void) 0) /* nothing */
 #endif /* MULTIPROCESSOR */
 
+/*
+ * XXX Hack: allow xen kernels to build with recent (Oct 2016) changes
+ *	 to acpi interrupt establishment (until a better solution)
+ */
+#define intr_establish_xname(a,b,c,d,e,f,g,h,i) intr_establish(a,b,c,d,e,f,g,h)
+#define isa_intr_establish_xname(a,b,c,d,e,f,g) isa_intr_establish(a,b,c,d,e,f)
+/* kcaH XXX */
+
 #endif /* !_LOCORE */
 
 #endif /* _XEN_INTR_H_ */



CVS commit: src/external/mit/xorg/server/drivers

2016-10-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct 16 06:23:48 UTC 2016

Modified Files:
src/external/mit/xorg/server/drivers: Makefile

Log Message:
begin to get alpha to xorg-server 1.18 - disable the known problematic
drivers.


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/external/mit/xorg/server/drivers/Makefile

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

Modified files:

Index: src/external/mit/xorg/server/drivers/Makefile
diff -u src/external/mit/xorg/server/drivers/Makefile:1.90 src/external/mit/xorg/server/drivers/Makefile:1.91
--- src/external/mit/xorg/server/drivers/Makefile:1.90	Tue Oct  4 21:37:10 2016
+++ src/external/mit/xorg/server/drivers/Makefile	Sun Oct 16 06:23:48 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.90 2016/10/04 21:37:10 mrg Exp $
+#	$NetBSD: Makefile,v 1.91 2016/10/16 06:23:48 mrg Exp $
 
 .include 
 
@@ -93,15 +93,12 @@ SUBDIR+= \
 
 .if ${MACHINE} == "alpha"
 SUBDIR+= \
-	xf86-video-apm \
-	xf86-video-ark \
 	xf86-video-ast \
 	xf86-video-ati \
 	xf86-video-chips \
 	xf86-video-cirrus \
 	xf86-video-cirrus_alpine \
 	xf86-video-cirrus_laguna \
-	xf86-video-glint \
 	xf86-video-i128 \
 	xf86-video-i740 \
 	xf86-video-mach64 \
@@ -120,6 +117,13 @@ SUBDIR+= \
 	xf86-video-tseng \
 	xf86-video-wsfb
 #	xf86-video-imstt
+# needs porting for xorg-server 1.18
+.if ${XORG_SERVER_SUBDIR} == "xorg-server.old"
+SUBDIR+= \
+	xf86-video-apm \
+	xf86-video-ark \
+	xf86-video-glint
+.endif	# ${XORG_SERVER_SUBDIR} == "xorg-server.old"
 .endif	# ${MACHINE} == "alpha"
 
 .if ${MACHINE} == "amiga"



CVS commit: src/usr.bin/uniq

2016-10-15 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Sun Oct 16 06:17:52 UTC 2016

Modified Files:
src/usr.bin/uniq: uniq.c

Log Message:
Fix the bug introduced in the previous commit.

The lengths of the lines being compared were not correct. Essentially, we
were comparing the length of the buffers instead of the length of the strings.

This patch also avoids calling skip() twice for the same line.

Thanks to Rin Okuyama for the patch.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/uniq/uniq.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.bin/uniq/uniq.c
diff -u src/usr.bin/uniq/uniq.c:1.19 src/usr.bin/uniq/uniq.c:1.20
--- src/usr.bin/uniq/uniq.c:1.19	Fri Oct 14 19:43:59 2016
+++ src/usr.bin/uniq/uniq.c	Sun Oct 16 06:17:51 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: uniq.c,v 1.19 2016/10/14 19:43:59 abhinav Exp $	*/
+/*	$NetBSD: uniq.c,v 1.20 2016/10/16 06:17:51 abhinav Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = "@(#)uniq.c	8.3 (Berkeley) 5/4/95";
 #endif
-__RCSID("$NetBSD: uniq.c,v 1.19 2016/10/14 19:43:59 abhinav Exp $");
+__RCSID("$NetBSD: uniq.c,v 1.20 2016/10/16 06:17:51 abhinav Exp $");
 #endif /* not lint */
 
 #include 
@@ -65,12 +65,12 @@ static void usage(void) __dead;
 int
 main (int argc, char *argv[])
 {
-	const char *t1, *t2;
+	const char *prevp, *thisp;
 	FILE *ifp, *ofp;
 	int ch;
 	char *prevline, *thisline, *p;
 	size_t prevlinesize, thislinesize, psize;
-	size_t prevlinecompsize, thislinecompsize;
+	size_t prevlen, thislen;
 
 	setprogname(argv[0]);
 	ifp = ofp = NULL;
@@ -127,11 +127,16 @@ done:	argc -= optind;
 
 	if ((p = fgetln(ifp, &psize)) == NULL)
 		return 0;
-	prevlinesize = psize;
+	prevlinesize = prevlen = psize;
 	if ((prevline = malloc(prevlinesize + 1)) == NULL)
 		err(1, "malloc");
 	(void)memcpy(prevline, p, prevlinesize);
 	prevline[prevlinesize] = '\0';
+	
+	if (numfields || numchars)
+		prevp = skip(prevline, &prevlen);
+	else
+		prevp = prevline;
 
 	thislinesize = psize;
 	if ((thisline = malloc(thislinesize + 1)) == NULL)
@@ -143,22 +148,19 @@ done:	argc -= optind;
 err(1, "realloc");
 			thislinesize = psize;
 		}
+		thislen = psize;
 		(void)memcpy(thisline, p, psize);
 		thisline[psize] = '\0';
-		thislinecompsize = thislinesize;
-		prevlinecompsize = prevlinesize;
 
 		/* If requested get the chosen fields + character offsets. */
 		if (numfields || numchars) {
-			t1 = skip(thisline, &thislinecompsize);
-			t2 = skip(prevline, &prevlinecompsize);
+			thisp = skip(thisline, &thislen);
 		} else {
-			t1 = thisline;
-			t2 = prevline;
+			thisp = thisline;
 		}
 
 		/* If different, print; set previous to new value. */
-		if (thislinecompsize != prevlinecompsize || strcmp(t1, t2)) {
+		if (thislen != prevlen || strcmp(thisp, prevp)) {
 			char *t;
 			size_t ts;
 
@@ -169,6 +171,8 @@ done:	argc -= optind;
 			ts = prevlinesize;
 			prevlinesize = thislinesize;
 			thislinesize = ts;
+			prevp = thisp;
+			prevlen = thislen;
 			repeats = 0;
 		} else
 			++repeats;



CVS commit: src/usr.sbin/arp

2016-10-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Oct 16 05:32:30 UTC 2016

Modified Files:
src/usr.sbin/arp: arp.4

Log Message:
Add missing verb. New sentence, new line.


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

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/arp/arp.4
diff -u src/usr.sbin/arp/arp.4:1.13 src/usr.sbin/arp/arp.4:1.14
--- src/usr.sbin/arp/arp.4:1.13	Wed Oct 12 08:43:17 2016
+++ src/usr.sbin/arp/arp.4	Sun Oct 16 05:32:30 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: arp.4,v 1.13 2016/10/12 08:43:17 roy Exp $
+.\"	$NetBSD: arp.4,v 1.14 2016/10/16 05:32:30 wiz Exp $
 .\"
 .\" Copyright (c) 1985, 1986, 1988, 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -83,10 +83,11 @@ This is no longer supported.
 .Sh DIAGNOSTICS
 .Bl -diag
 ARP implements Address Conflict Detection.
-When an address is first added to the host, it marked tentative and
+When an address is first added to the host, it is marked tentative and
 ARP probes the network to discover if another host has the address.
 If another host replies with the same address, then the local address is
-marked duplicate and the host will not use it. Otherwise the tentative
+marked duplicate and the host will not use it.
+Otherwise the tentative
 mark is removed and the host can start using the address.
 .Pp
 ARP will defend the host's active address when a conflicting message is



CVS commit: src/lib/libc/string

2016-10-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Oct 16 05:28:33 UTC 2016

Modified Files:
src/lib/libc/string: strchr.3

Log Message:
Add missing word.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libc/string/strchr.3

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

Modified files:

Index: src/lib/libc/string/strchr.3
diff -u src/lib/libc/string/strchr.3:1.12 src/lib/libc/string/strchr.3:1.13
--- src/lib/libc/string/strchr.3:1.12	Wed Oct 12 20:01:12 2016
+++ src/lib/libc/string/strchr.3	Sun Oct 16 05:28:33 2016
@@ -30,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" from: @(#)strchr.3	8.2 (Berkeley) 4/19/94
-.\"	$NetBSD: strchr.3,v 1.12 2016/10/12 20:01:12 christos Exp $
+.\"	$NetBSD: strchr.3,v 1.13 2016/10/16 05:28:33 wiz Exp $
 .\"
 .Dd October 12, 2016
 .Dt STRCHR 3
@@ -111,5 +111,5 @@ conforms to
 .St -ansiC .
 .The
 .Fn strchrnul
-appeared in
+function appeared in
 .Nx 8 .



CVS commit: src/share/man/man4

2016-10-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Oct 16 05:26:20 UTC 2016

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

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/share/man/man4/auich.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/auich.4
diff -u src/share/man/man4/auich.4:1.24 src/share/man/man4/auich.4:1.25
--- src/share/man/man4/auich.4:1.24	Thu Oct 13 13:04:02 2016
+++ src/share/man/man4/auich.4	Sun Oct 16 05:26:20 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: auich.4,v 1.24 2016/10/13 13:04:02 pho Exp $
+.\"	$NetBSD: auich.4,v 1.25 2016/10/16 05:26:20 wiz Exp $
 .\"
 .\" Copyright (c) 2000 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -52,12 +52,16 @@ The driver provides the following
 read/write variable (when hardware support is available):
 .Bl -tag -width Ds
 .It Va hw.auich0.ac97rate
-Link rate of the device in Hz. The driver automatically measures and
+Link rate of the device in Hz.
+The driver automatically measures and
 calculates the correct rate so you usually don't need to change
-this. There is, however, a chance that the driver miscalculates the
+this.
+There is, however, a chance that the driver miscalculates the
 rate especially on an emulated hardware, resulting in an incorrect
-playback pitch. When this happens you need to manually set this
-variable to the correct value. Try
+playback pitch.
+When this happens you need to manually set this
+variable to the correct value.
+Try
 .Li 48000
 if you don't know the correct value as it is the default link rate.
 .Sh SEE ALSO



CVS commit: src/share/man/man4

2016-10-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Oct 16 05:25:52 UTC 2016

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

Log Message:
Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man4/tps65217pmic.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/tps65217pmic.4
diff -u src/share/man/man4/tps65217pmic.4:1.7 src/share/man/man4/tps65217pmic.4:1.8
--- src/share/man/man4/tps65217pmic.4:1.7	Sat Oct 15 19:51:48 2016
+++ src/share/man/man4/tps65217pmic.4	Sun Oct 16 05:25:52 2016
@@ -1,4 +1,4 @@
-.\" $NetBSD: tps65217pmic.4,v 1.7 2016/10/15 19:51:48 rkujawa Exp $
+.\" $NetBSD: tps65217pmic.4,v 1.8 2016/10/16 05:25:52 wiz Exp $
 .\"
 .\" Copyright (c) 2013 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -83,7 +83,7 @@ The driver can only report current volta
 It can not measure the real voltage, as the TPS65217 chip lacks hardware to do
 that.
 .Pp
-Modifying voltage regulator parameters from user space was deliberately left 
+Modifying voltage regulator parameters from user space was deliberately left
 unimplemented, as these parameters should only be set at the firmware level.
 Setting wrong parameters may result in permanent hardware damage.
 .Sh BUGS



CVS commit: src/external/gpl3

2016-10-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct 16 05:12:20 UTC 2016

Modified Files:
src/external/gpl3/gdb.old/dist/gdb: ppcnbsd-nat.c
src/external/gpl3/gdb/dist/gdb: ppcnbsd-nat.c

Log Message:
define _KMEMUSER so that necessary things become visible always.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb.old/dist/gdb/ppcnbsd-nat.c
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gdb/dist/gdb/ppcnbsd-nat.c

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

Modified files:

Index: src/external/gpl3/gdb.old/dist/gdb/ppcnbsd-nat.c
diff -u src/external/gpl3/gdb.old/dist/gdb/ppcnbsd-nat.c:1.5 src/external/gpl3/gdb.old/dist/gdb/ppcnbsd-nat.c:1.6
--- src/external/gpl3/gdb.old/dist/gdb/ppcnbsd-nat.c:1.5	Wed Oct 12 15:36:09 2016
+++ src/external/gpl3/gdb.old/dist/gdb/ppcnbsd-nat.c	Sun Oct 16 05:12:20 2016
@@ -19,6 +19,7 @@
You should have received a copy of the GNU General Public License
along with this program.  If not, see .  */
 
+#define _KMEMUSER
 #include "defs.h"
 
 #include 

Index: src/external/gpl3/gdb/dist/gdb/ppcnbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/ppcnbsd-nat.c:1.10 src/external/gpl3/gdb/dist/gdb/ppcnbsd-nat.c:1.11
--- src/external/gpl3/gdb/dist/gdb/ppcnbsd-nat.c:1.10	Wed Oct 12 20:20:33 2016
+++ src/external/gpl3/gdb/dist/gdb/ppcnbsd-nat.c	Sun Oct 16 05:12:20 2016
@@ -19,6 +19,7 @@
You should have received a copy of the GNU General Public License
along with this program.  If not, see .  */
 
+#define _KMEMUSER
 #include "defs.h"
 
 #include 



CVS commit: src/sys/external/bsd/ipf/netinet

2016-10-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct 16 05:11:34 UTC 2016

Modified Files:
src/sys/external/bsd/ipf/netinet: ip_ftp_pxy.c

Log Message:
fix !INET6 builds


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/ipf/netinet/ip_ftp_pxy.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/external/bsd/ipf/netinet/ip_ftp_pxy.c
diff -u src/sys/external/bsd/ipf/netinet/ip_ftp_pxy.c:1.5 src/sys/external/bsd/ipf/netinet/ip_ftp_pxy.c:1.6
--- src/sys/external/bsd/ipf/netinet/ip_ftp_pxy.c:1.5	Thu Mar 20 20:43:12 2014
+++ src/sys/external/bsd/ipf/netinet/ip_ftp_pxy.c	Sun Oct 16 05:11:34 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_ftp_pxy.c,v 1.5 2014/03/20 20:43:12 christos Exp $	*/
+/*	$NetBSD: ip_ftp_pxy.c,v 1.6 2016/10/16 05:11:34 mrg Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -12,7 +12,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: ip_ftp_pxy.c,v 1.5 2014/03/20 20:43:12 christos Exp $");
+__KERNEL_RCSID(1, "$NetBSD: ip_ftp_pxy.c,v 1.6 2016/10/16 05:11:34 mrg Exp $");
 
 #define	IPF_FTP_PROXY
 
@@ -497,8 +497,8 @@ ipf_p_ftp_addport(ipf_ftp_softc_t *softf
 	 * Add skeleton NAT entry for connection which will come back the
 	 * other way.
 	 */
-	if (nat->nat_v[0] == 6) {
 #ifdef USE_INET6
+	if (nat->nat_v[0] == 6) {
 		if (nat->nat_dir == NAT_OUTBOUND) {
 			nat2 = ipf_nat6_outlookup(&fi, IPN_TCP|NAT_SEARCH,
 		  nat->nat_pr[1],
@@ -510,8 +510,9 @@ ipf_p_ftp_addport(ipf_ftp_softc_t *softf
 		 &nat->nat_odst6.in6,
 		 &nat->nat_osrc6.in6);
 		}
+	} else
 #endif
-	} else {
+	{
 		if (nat->nat_dir == NAT_OUTBOUND) {
 			nat2 = ipf_nat_outlookup(&fi, IPN_TCP|NAT_SEARCH,
 		 nat->nat_pr[1],



CVS commit: src/share/mk

2016-10-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct 16 05:08:59 UTC 2016

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
switch sparc, sparc64, arm and powerpc to gdb 7.12.


To generate a diff of this commit:
cvs rdiff -u -r1.971 -r1.972 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.971 src/share/mk/bsd.own.mk:1.972
--- src/share/mk/bsd.own.mk:1.971	Thu Oct 13 11:57:55 2016
+++ src/share/mk/bsd.own.mk	Sun Oct 16 05:08:59 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.971 2016/10/13 11:57:55 joerg Exp $
+#	$NetBSD: bsd.own.mk,v 1.972 2016/10/16 05:08:59 mrg Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -130,7 +130,11 @@ USE_SSP?=	yes
 #
 # What GDB is used?
 #
-.if ${MACHINE} == "amd64" 
+.if ${MACHINE} == "amd64" || \
+${MACHINE} == "sparc" || \
+${MACHINE} == "sparc64" || \
+${MACHINE_CPU} == "powerpc" || \
+${MACHINE_CPU} == "arm"
 HAVE_GDB?=	712
 .else
 HAVE_GDB?=	710



CVS commit: src/tools/gdb

2016-10-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct 16 04:37:42 UTC 2016

Modified Files:
src/tools/gdb: Makefile mknative-gdb

Log Message:
pass GDB_MACHINE_ARCH to mknative-gdb and use that as the subdir.
obtain GDB_MACHINE_ARCH from the new gdb Makefile.gdb_arch.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/tools/gdb/Makefile
cvs rdiff -u -r1.6 -r1.7 src/tools/gdb/mknative-gdb

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

Modified files:

Index: src/tools/gdb/Makefile
diff -u src/tools/gdb/Makefile:1.29 src/tools/gdb/Makefile:1.30
--- src/tools/gdb/Makefile:1.29	Fri Oct 14 14:41:59 2016
+++ src/tools/gdb/Makefile	Sun Oct 16 04:37:42 2016
@@ -1,9 +1,10 @@
-#	$NetBSD: Makefile,v 1.29 2016/10/14 14:41:59 christos Exp $
+#	$NetBSD: Makefile,v 1.30 2016/10/16 04:37:42 mrg Exp $
 
 .include 
 
 MODULE=		gdb
-GNUHOSTDIST=${.CURDIR}/../../external/gpl3/${EXTERNAL_GDB_SUBDIR}/dist
+GDBDIR=		${.CURDIR}/../../external/gpl3/${EXTERNAL_GDB_SUBDIR}
+GNUHOSTDIST=${GDBDIR}/dist
 
 FIND_ARGS=	\! \( -type d -name sim -prune \)
 
@@ -15,6 +16,9 @@ MAKE_ARGS=	MACHINE= MAKEINFO=${TOOL_MAKE
 ALL_TARGET=	all-gdb
 INSTALL_TARGET=	install-gdb
 
+.include "${GDBDIR}/Makefile.gdb_arch"
+#GDB_MACHINE_ARCH=   ${MACHINE_ARCH:C/e?armv[4-7]h?f?/arm/}
+
 .include "${.CURDIR}/../Makefile.gmakehost"
 
 CCADDFLAGS+= --sysroot=${DESTDIR} -B${DESTDIR}/usr/lib/ -I${.OBJDIR}/.native/gcc/include
@@ -60,7 +64,8 @@ CONFIGURE_ARGS_SIM+= --disable-sim
 native-gdb: .native/.configure_done
 	@echo 'Extracting GDB configury for a native toolchain.'
 	MAKE=${MAKE:Q} ${HOST_SH} ${MKNATIVE} gdb \
-		${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
+		${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM} \
+		${GDB_MACHINE_ARCH}
 
 .native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile
 	mkdir ${.OBJDIR}/.native 2>/dev/null || true

Index: src/tools/gdb/mknative-gdb
diff -u src/tools/gdb/mknative-gdb:1.6 src/tools/gdb/mknative-gdb:1.7
--- src/tools/gdb/mknative-gdb:1.6	Thu Oct  3 18:58:37 2013
+++ src/tools/gdb/mknative-gdb	Sun Oct 16 04:37:42 2016
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: mknative-gdb,v 1.6 2013/10/03 18:58:37 christos Exp $
+#	$NetBSD: mknative-gdb,v 1.7 2016/10/16 04:37:42 mrg Exp $
 #
 # Shell script for generating all the constants needed for a native
 # platform build of src/external/gpl3/gdb
@@ -10,6 +10,7 @@
 _TMPDIR=$2
 _TOP=$3
 _PLATFORM=$4
+_MACHINE_SUBDIR=$5
 _VPATH=`grep VPATH ${_TMPDIR}/Makefile | sed 's,^.*=[ 	]*,,'`
 _GDB=external/gpl3/gdb
 
@@ -19,17 +20,17 @@ _GDB=external/gpl3/gdb
 
 get_gdb_libbfd () {
 	local _BFD=$_GDB/lib/libbfd
-	mkdir -p $_TOP/$_BFD/arch/$MACHINE_ARCH
+	mkdir -p $_TOP/$_BFD/arch/$_MACHINE_SUBDIR
 
 	{
 		getvars bfd/Makefile \
 			libbfd_la_DEPENDENCIES libbfd_la_OBJECTS DEFS \
 			INCLUDES TDEFAULTS
-	} | write_mk $_BFD/arch/$MACHINE_ARCH/defs.mk
+	} | write_mk $_BFD/arch/$_MACHINE_SUBDIR/defs.mk
 
 	for i in bfd-in3.h bfd_stdint.h config.h bfd.h bfdver.h targmatch.h 
 	do
-	write_c $_BFD/arch/$MACHINE_ARCH/$i <$_TMPDIR/bfd/$i
+	write_c $_BFD/arch/$_MACHINE_SUBDIR/$i <$_TMPDIR/bfd/$i
 	done
 }
 
@@ -37,29 +38,29 @@ get_gdb_libbfd () {
 
 get_gdb_libopcodes () {
 	local _OPCODES=$_GDB/lib/libopcodes
-	mkdir -p $_TOP/$_OPCODES/arch/$MACHINE_ARCH
+	mkdir -p $_TOP/$_OPCODES/arch/$_MACHINE_SUBDIR
 
 	{
 		getvars opcodes/Makefile \
 			archdefs BFD_MACHINES libopcodes_la_SOURCES
-	} | write_mk $_GDB/lib/libopcodes//arch/$MACHINE_ARCH/defs.mk
+	} | write_mk $_GDB/lib/libopcodes//arch/$_MACHINE_SUBDIR/defs.mk
 
 	{
 		cat $_TMPDIR/opcodes/config.h
-	} | write_c $_OPCODES/arch/$MACHINE_ARCH/config.h
+	} | write_c $_OPCODES/arch/$_MACHINE_SUBDIR/config.h
 }
 
 # gdb/lib/libiberty #
 
 get_gdb_libiberty () {
 	local _IBERTY=$_GDB/lib/libiberty
-	mkdir -p $_TOP/$_IBERTY/arch/$MACHINE_ARCH
+	mkdir -p $_TOP/$_IBERTY/arch/$_MACHINE_SUBDIR
 
 	getvars libiberty/Makefile \
 		ALLOCA EXTRA_OFILES LIBOBJS REQUIRED_OFILES \
-		| write_mk $_IBERTY/arch/$MACHINE_ARCH/defs.mk
+		| write_mk $_IBERTY/arch/$_MACHINE_SUBDIR/defs.mk
 
-	write_c $_IBERTY/arch/$MACHINE_ARCH/config.h \
+	write_c $_IBERTY/arch/$_MACHINE_SUBDIR/config.h \
 		<$_TMPDIR/libiberty/config.h
 }
 
@@ -67,14 +68,14 @@ get_gdb_libiberty () {
 
 get_gdb_libreadline () {
 	local _READLINE=$_GDB/lib/libreadline
-	mkdir -p $_TOP/$_READLINE/arch/$MACHINE_ARCH
+	mkdir -p $_TOP/$_READLINE/arch/$_MACHINE_SUBDIR
 
 	{
 		getvars readline/Makefile \
 			CCFLAGS OBJECTS
-	} | write_mk $_READLINE/arch/$MACHINE_ARCH/defs.mk
+	} | write_mk $_READLINE/arch/$_MACHINE_SUBDIR/defs.mk
 
-	write_c $_READLINE/arch/$MACHINE_ARCH/config.h \
+	write_c $_READLINE/arch/$_MACHINE_SUBDIR/config.h \
 		<$_TMPDIR/readline/config.h
 }
 
@@ -82,17 +83,17 @@ get_gdb_libreadline () {
 
 get_gdb_libdecnumber () {
 	local _DECNUMBER=$_GDB/lib/libdecnumber
-	mkdir -p $_TOP/$_DECNUMBER/arch/$MACHINE_ARCH
+	mkdir -p $_TOP/$_DECNUMBER/arc

CVS commit: src/external/gpl3

2016-10-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct 16 04:36:52 UTC 2016

Modified Files:
src/external/gpl3/gdb: Makefile.inc
src/external/gpl3/gdb.old: Makefile.inc
Added Files:
src/external/gpl3/gdb: Makefile.gdb_arch
src/external/gpl3/gdb.old: Makefile.gdb_arch

Log Message:
move the GDB_MACHINE_ARCH setting into a separate file so tools can
access it.  modify it such that it's "arm" or "armeb" for all arm,
but only in new gdb, not gdb.old (avoid changing gdb.old as much
as possible now.)


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/gpl3/gdb/Makefile.gdb_arch
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gdb/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/external/gpl3/gdb.old/Makefile.gdb_arch
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb.old/Makefile.inc

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

Modified files:

Index: src/external/gpl3/gdb/Makefile.inc
diff -u src/external/gpl3/gdb/Makefile.inc:1.10 src/external/gpl3/gdb/Makefile.inc:1.11
--- src/external/gpl3/gdb/Makefile.inc:1.10	Sat Jan 23 23:02:31 2016
+++ src/external/gpl3/gdb/Makefile.inc	Sun Oct 16 04:36:52 2016
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.10 2016/01/23 23:02:31 christos Exp $
+# $NetBSD: Makefile.inc,v 1.11 2016/10/16 04:36:52 mrg Exp $
 
 USE_LIBEDIT=no
 USE_TUI=yes
@@ -6,7 +6,7 @@ BINDIR=/usr/bin
 WARNS?=		0
 CPPFLAGS+=	-D_KERNTYPES
 
-GDB_MACHINE_ARCH=	${MACHINE_ARCH:C/armv[4-7]/arm/}
+.include "Makefile.gdb_arch"
 
 CWARNFLAGS.clang+=	-Wno-unused-value -Wno-conversion \
 			-Wno-switch-enum -Wno-parentheses -Wno-comment \

Index: src/external/gpl3/gdb.old/Makefile.inc
diff -u src/external/gpl3/gdb.old/Makefile.inc:1.7 src/external/gpl3/gdb.old/Makefile.inc:1.8
--- src/external/gpl3/gdb.old/Makefile.inc:1.7	Wed Oct 12 15:36:05 2016
+++ src/external/gpl3/gdb.old/Makefile.inc	Sun Oct 16 04:36:51 2016
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.7 2016/10/12 15:36:05 christos Exp $
+# $NetBSD: Makefile.inc,v 1.8 2016/10/16 04:36:51 mrg Exp $
 
 USE_LIBEDIT=no
 USE_TUI=yes
@@ -6,7 +6,7 @@ BINDIR=/usr/bin
 WARNS?=		0
 CPPFLAGS+=	-D_KERNTYPES
 
-GDB_MACHINE_ARCH=	${MACHINE_ARCH:C/armv[4-7]/arm/}
+.include "Makefile.gdb_arch"
 
 CWARNFLAGS.clang+=	-Wno-unused-value -Wno-conversion \
 			-Wno-switch-enum -Wno-parentheses -Wno-comment \

Added files:

Index: src/external/gpl3/gdb/Makefile.gdb_arch
diff -u /dev/null src/external/gpl3/gdb/Makefile.gdb_arch:1.1
--- /dev/null	Sun Oct 16 04:36:52 2016
+++ src/external/gpl3/gdb/Makefile.gdb_arch	Sun Oct 16 04:36:51 2016
@@ -0,0 +1,3 @@
+#	$NetBSD#
+
+GDB_MACHINE_ARCH=	${MACHINE_ARCH:C/^e//:C/e?armv[4-7]h?f?/arm/}

Index: src/external/gpl3/gdb.old/Makefile.gdb_arch
diff -u /dev/null src/external/gpl3/gdb.old/Makefile.gdb_arch:1.1
--- /dev/null	Sun Oct 16 04:36:52 2016
+++ src/external/gpl3/gdb.old/Makefile.gdb_arch	Sun Oct 16 04:36:51 2016
@@ -0,0 +1,3 @@
+#	$NetBSD#
+
+GDB_MACHINE_ARCH=	${MACHINE_ARCH:C/armv[4-7]/arm/}



CVS commit: src/usr.sbin/intrctl

2016-10-15 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Oct 15 22:23:50 UTC 2016

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

Log Message:
getopt() result is int; fixes build on arm, pointed out by Rin Okuyama


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/intrctl/intrctl.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/intrctl/intrctl.c
diff -u src/usr.sbin/intrctl/intrctl.c:1.5 src/usr.sbin/intrctl/intrctl.c:1.6
--- src/usr.sbin/intrctl/intrctl.c:1.5	Sat Oct 15 12:14:00 2016
+++ src/usr.sbin/intrctl/intrctl.c	Sat Oct 15 22:23:50 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: intrctl.c,v 1.5 2016/10/15 12:14:00 jdolecek Exp $	*/
+/*	$NetBSD: intrctl.c,v 1.6 2016/10/15 22:23:50 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2015 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: intrctl.c,v 1.5 2016/10/15 12:14:00 jdolecek Exp $");
+__RCSID("$NetBSD: intrctl.c,v 1.6 2016/10/15 22:23:50 jdolecek Exp $");
 
 #include 
 #include 
@@ -118,7 +118,7 @@ intrctl_list(int argc, char **argv)
 	void *handle;
 	size_t intridlen;
 	int compact = 0;
-	char ch;
+	int ch;
 
 	while ((ch = getopt(argc, argv, "c")) != -1) {
 		switch (ch) {



CVS commit: src/sys/dev/raidframe

2016-10-15 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Sat Oct 15 20:31:15 UTC 2016

Modified Files:
src/sys/dev/raidframe: rf_map.c

Log Message:
Cleanup/remove unused asm_count.  Reported by David Binderman in PR#51552.
Thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/raidframe/rf_map.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/raidframe/rf_map.c
diff -u src/sys/dev/raidframe/rf_map.c:1.46 src/sys/dev/raidframe/rf_map.c:1.47
--- src/sys/dev/raidframe/rf_map.c:1.46	Fri Nov 14 14:45:34 2014
+++ src/sys/dev/raidframe/rf_map.c	Sat Oct 15 20:31:15 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_map.c,v 1.46 2014/11/14 14:45:34 oster Exp $	*/
+/*	$NetBSD: rf_map.c,v 1.47 2016/10/15 20:31:15 oster Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -33,7 +33,7 @@
  **/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_map.c,v 1.46 2014/11/14 14:45:34 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_map.c,v 1.47 2016/10/15 20:31:15 oster Exp $");
 
 #include 
 
@@ -557,7 +557,7 @@ rf_FreeAccessStripeMap(RF_AccessStripeMa
 {
 	RF_AccessStripeMap_t *p;
 	RF_PhysDiskAddr_t *pdp, *trailer, *pdaList = NULL, *pdaEnd = NULL;
-	int count = 0, t, asm_count = 0;
+	int count = 0, t;
 
 	for (p = hdr->stripeMap; p; p = p->next) {
 
@@ -598,8 +598,6 @@ rf_FreeAccessStripeMap(RF_AccessStripeMa
 		}
 		if (trailer)
 			pdaEnd = trailer;
-
-		asm_count++;
 	}
 
 	/* debug only */



CVS commit: src/share/man/man4

2016-10-15 Thread Radoslaw Kujawa
Module Name:src
Committed By:   rkujawa
Date:   Sat Oct 15 19:51:48 UTC 2016

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

Log Message:
Note improvements by mbouyer and kiyohara.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/share/man/man4/tps65217pmic.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/tps65217pmic.4
diff -u src/share/man/man4/tps65217pmic.4:1.6 src/share/man/man4/tps65217pmic.4:1.7
--- src/share/man/man4/tps65217pmic.4:1.6	Tue Mar 18 18:20:39 2014
+++ src/share/man/man4/tps65217pmic.4	Sat Oct 15 19:51:48 2016
@@ -1,4 +1,4 @@
-.\" $NetBSD: tps65217pmic.4,v 1.6 2014/03/18 18:20:39 riastradh Exp $
+.\" $NetBSD: tps65217pmic.4,v 1.7 2016/10/15 19:51:48 rkujawa Exp $
 .\"
 .\" Copyright (c) 2013 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -74,13 +74,17 @@ The
 .Nm
 driver was written by
 .An Radoslaw Kujawa Aq Mt radoslaw.kuj...@gmail.com .
+Voltage change callback for AM335x was added by
+.An Manuel Bouyer .
+White LED (backlight) support was added by
+.An KIYOHARA Takashi .
 .Sh CAVEATS
 The driver can only report current voltage regulator settings.
 It can not measure the real voltage, as the TPS65217 chip lacks hardware to do
 that.
 .Pp
-Modifying voltage regulator parameters was deliberately left unimplemented, as
-these parameters should only be set at the firmware level.
+Modifying voltage regulator parameters from user space was deliberately left 
+unimplemented, as these parameters should only be set at the firmware level.
 Setting wrong parameters may result in permanent hardware damage.
 .Sh BUGS
-Battery, interrupt and WLED (backlight) support is not implemented.
+Battery and interrupt support is not implemented.



CVS commit: src/distrib/sets/lists/comp

2016-10-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Oct 15 17:55:28 UTC 2016

Modified Files:
src/distrib/sets/lists/comp: md.evbmips

Log Message:
linkerscripts for mips are built only on mips64*
so file lists should have these files for 64bit only too


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/distrib/sets/lists/comp/md.evbmips

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

Modified files:

Index: src/distrib/sets/lists/comp/md.evbmips
diff -u src/distrib/sets/lists/comp/md.evbmips:1.21 src/distrib/sets/lists/comp/md.evbmips:1.22
--- src/distrib/sets/lists/comp/md.evbmips:1.21	Sat Oct 15 11:44:09 2016
+++ src/distrib/sets/lists/comp/md.evbmips	Sat Oct 15 17:55:28 2016
@@ -1,4 +1,4 @@
-# $NetBSD: md.evbmips,v 1.21 2016/10/15 11:44:09 christos Exp $
+# $NetBSD: md.evbmips,v 1.22 2016/10/15 17:55:28 maya Exp $
 ./usr/include/evbmipscomp-c-include
 ./usr/include/evbmips/_G_config.h		comp-obsolete		obsolete
 ./usr/include/evbmips/ansi.h			comp-c-include
@@ -62,21 +62,21 @@
 ./usr/include/evbmips/vmparam.h			comp-c-include
 ./usr/include/evbmips/wchar_limits.h		comp-c-include
 ./usr/include/ieeefp.hcomp-c-include
-./usr/libdata/ldscripts/elf32btsmip.xd		-unknown-		binutils
-./usr/libdata/ldscripts/elf32btsmip.xdc		-unknown-		binutils
-./usr/libdata/ldscripts/elf32btsmip.xdw		-unknown-		binutils
-./usr/libdata/ldscripts/elf32btsmipn32.xd	-unknown-		binutils
-./usr/libdata/ldscripts/elf32btsmipn32.xdc	-unknown-		binutils
-./usr/libdata/ldscripts/elf32btsmipn32.xdw	-unknown-		binutils
-./usr/libdata/ldscripts/elf32ltsmip.xd		-unknown-		binutils
-./usr/libdata/ldscripts/elf32ltsmip.xdc		-unknown-		binutils
-./usr/libdata/ldscripts/elf32ltsmip.xdw		-unknown-		binutils
-./usr/libdata/ldscripts/elf32ltsmipn32.xd	-unknown-		binutils
-./usr/libdata/ldscripts/elf32ltsmipn32.xdc	-unknown-		binutils
-./usr/libdata/ldscripts/elf32ltsmipn32.xdw	-unknown-		binutils
-./usr/libdata/ldscripts/elf64btsmip.xd		-unknown-		binutils
-./usr/libdata/ldscripts/elf64btsmip.xdc		-unknown-		binutils
-./usr/libdata/ldscripts/elf64btsmip.xdw		-unknown-		binutils
-./usr/libdata/ldscripts/elf64ltsmip.xd		-unknown-		binutils
-./usr/libdata/ldscripts/elf64ltsmip.xdc		-unknown-		binutils
-./usr/libdata/ldscripts/elf64ltsmip.xdw		-unknown-		binutils
+./usr/libdata/ldscripts/elf32btsmip.xd		-unknown-		binutils,arch64
+./usr/libdata/ldscripts/elf32btsmip.xdc		-unknown-		binutils,arch64
+./usr/libdata/ldscripts/elf32btsmip.xdw		-unknown-		binutils,arch64
+./usr/libdata/ldscripts/elf32btsmipn32.xd	-unknown-		binutils,arch64
+./usr/libdata/ldscripts/elf32btsmipn32.xdc	-unknown-		binutils,arch64
+./usr/libdata/ldscripts/elf32btsmipn32.xdw	-unknown-		binutils,arch64
+./usr/libdata/ldscripts/elf32ltsmip.xd		-unknown-		binutils,arch64
+./usr/libdata/ldscripts/elf32ltsmip.xdc		-unknown-		binutils,arch64
+./usr/libdata/ldscripts/elf32ltsmip.xdw		-unknown-		binutils,arch64
+./usr/libdata/ldscripts/elf32ltsmipn32.xd	-unknown-		binutils,arch64
+./usr/libdata/ldscripts/elf32ltsmipn32.xdc	-unknown-		binutils,arch64
+./usr/libdata/ldscripts/elf32ltsmipn32.xdw	-unknown-		binutils,arch64
+./usr/libdata/ldscripts/elf64btsmip.xd		-unknown-		binutils,arch64
+./usr/libdata/ldscripts/elf64btsmip.xdc		-unknown-		binutils,arch64
+./usr/libdata/ldscripts/elf64btsmip.xdw		-unknown-		binutils,arch64
+./usr/libdata/ldscripts/elf64ltsmip.xd		-unknown-		binutils,arch64
+./usr/libdata/ldscripts/elf64ltsmip.xdc		-unknown-		binutils,arch64
+./usr/libdata/ldscripts/elf64ltsmip.xdw		-unknown-		binutils,arch64



CVS commit: src/sys/arch/x86

2016-10-15 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Oct 15 16:46:14 UTC 2016

Modified Files:
src/sys/arch/x86/acpi: acpi_machdep.c
src/sys/arch/x86/include: isa_machdep.h
src/sys/arch/x86/isa: isa_machdep.c
src/sys/arch/x86/pci: pciide_machdep.c

Log Message:
provide intr xname


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/x86/acpi/acpi_machdep.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x86/include/isa_machdep.h
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/x86/isa/isa_machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/x86/pci/pciide_machdep.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/acpi/acpi_machdep.c
diff -u src/sys/arch/x86/acpi/acpi_machdep.c:1.13 src/sys/arch/x86/acpi/acpi_machdep.c:1.14
--- src/sys/arch/x86/acpi/acpi_machdep.c:1.13	Wed Sep 21 00:00:06 2016
+++ src/sys/arch/x86/acpi/acpi_machdep.c	Sat Oct 15 16:46:14 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.c,v 1.13 2016/09/21 00:00:06 jmcneill Exp $ */
+/* $NetBSD: acpi_machdep.c,v 1.14 2016/10/15 16:46:14 jdolecek Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.13 2016/09/21 00:00:06 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.14 2016/10/15 16:46:14 jdolecek Exp $");
 
 #include 
 #include 
@@ -241,8 +241,8 @@ acpi_md_OsInstallInterruptHandler(uint32
 	/*
 	 * XXX probably, IPL_BIO is enough.
 	 */
-	ih = intr_establish(irq, pic, pin, type, IPL_TTY,
-	(int (*)(void *)) ServiceRoutine, Context, false);
+	ih = intr_establish_xname(irq, pic, pin, type, IPL_TTY,
+	(int (*)(void *)) ServiceRoutine, Context, false, "acpi SCI");
 
 #if NIOAPIC > 0
 	if (mipp) {

Index: src/sys/arch/x86/include/isa_machdep.h
diff -u src/sys/arch/x86/include/isa_machdep.h:1.11 src/sys/arch/x86/include/isa_machdep.h:1.12
--- src/sys/arch/x86/include/isa_machdep.h:1.11	Fri Jul  1 18:22:39 2011
+++ src/sys/arch/x86/include/isa_machdep.h	Sat Oct 15 16:46:14 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: isa_machdep.h,v 1.11 2011/07/01 18:22:39 dyoung Exp $	*/
+/*	$NetBSD: isa_machdep.h,v 1.12 2016/10/15 16:46:14 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -105,6 +105,8 @@ int	isa_intr_alloc(isa_chipset_tag_t, in
 const struct evcnt *isa_intr_evcnt(isa_chipset_tag_t ic, int irq);
 void	*isa_intr_establish(isa_chipset_tag_t ic, int irq, int type,
 	int level, int (*ih_fun)(void *), void *ih_arg);
+void	*isa_intr_establish_xname(isa_chipset_tag_t ic, int irq, int type,
+	int level, int (*ih_fun)(void *), void *ih_arg, const char *xname);
 void	isa_intr_disestablish(isa_chipset_tag_t ic, void *handler);
 int	isa_mem_alloc(bus_space_tag_t, bus_size_t, bus_size_t,
 	bus_addr_t, int, bus_addr_t *, bus_space_handle_t *);

Index: src/sys/arch/x86/isa/isa_machdep.c
diff -u src/sys/arch/x86/isa/isa_machdep.c:1.33 src/sys/arch/x86/isa/isa_machdep.c:1.34
--- src/sys/arch/x86/isa/isa_machdep.c:1.33	Mon Apr 27 06:51:40 2015
+++ src/sys/arch/x86/isa/isa_machdep.c	Sat Oct 15 16:46:14 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: isa_machdep.c,v 1.33 2015/04/27 06:51:40 knakahara Exp $	*/
+/*	$NetBSD: isa_machdep.c,v 1.34 2016/10/15 16:46:14 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.33 2015/04/27 06:51:40 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.34 2016/10/15 16:46:14 jdolecek Exp $");
 
 #include 
 #include 
@@ -200,6 +200,14 @@ void *
 isa_intr_establish(isa_chipset_tag_t ic, int irq, int type, int level,
 int (*ih_fun)(void *), void *ih_arg)
 {
+	return isa_intr_establish_xname(ic, irq, type, level,
+	ih_fun, ih_arg, "unknown");
+}
+
+void *
+isa_intr_establish_xname(isa_chipset_tag_t ic, int irq, int type, int level,
+int (*ih_fun)(void *), void *ih_arg, const char *xname)
+{
 	struct pic *pic;
 	int pin;
 #if NIOAPIC > 0
@@ -229,8 +237,8 @@ isa_intr_establish(isa_chipset_tag_t ic,
 			printf("isa_intr_establish: no MP mapping found\n");
 	}
 #endif
-	return intr_establish(irq, pic, pin, type, level, ih_fun, ih_arg,
-	false);
+	return intr_establish_xname(irq, pic, pin, type, level, ih_fun, ih_arg,
+	false, xname);
 }
 
 /* Deregister an interrupt handler. */

Index: src/sys/arch/x86/pci/pciide_machdep.c
diff -u src/sys/arch/x86/pci/pciide_machdep.c:1.15 src/sys/arch/x86/pci/pciide_machdep.c:1.16
--- src/sys/arch/x86/pci/pciide_machdep.c:1.15	Mon Jul 27 15:45:20 2015
+++ src/sys/arch/x86/pci/pciide_machdep.c	Sat Oct 15 16:46:14 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pciide_machdep.c,v 1.15 2015/07/27 15:45:20 msaitoh Exp $	*/
+/*	$NetBSD: pciide_machdep.c,v 1.16 2016/10/15 16:46:14 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1998 Christopher G. Demetriou.  All rights reserved.
@@ -41,7 +41,7

CVS commit: src/sys/arch/evbarm/gumstix

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 16:30:46 UTC 2016

Modified Files:
src/sys/arch/evbarm/gumstix: gumstixreg.h

Log Message:
Add map for DuoVero and Pepper.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/gumstix/gumstixreg.h

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

Modified files:

Index: src/sys/arch/evbarm/gumstix/gumstixreg.h
diff -u src/sys/arch/evbarm/gumstix/gumstixreg.h:1.8 src/sys/arch/evbarm/gumstix/gumstixreg.h:1.9
--- src/sys/arch/evbarm/gumstix/gumstixreg.h:1.8	Thu Mar 31 14:33:17 2016
+++ src/sys/arch/evbarm/gumstix/gumstixreg.h	Sat Oct 15 16:30:46 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstixreg.h,v 1.8 2016/03/31 14:33:17 kiyohara Exp $  */
+/*	$NetBSD: gumstixreg.h,v 1.9 2016/10/15 16:30:46 kiyohara Exp $  */
 /*
  * Copyright (C) 2005, 2006 WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -49,8 +49,16 @@
 
 #define OVERO_L4_CORE_VBASE		0xc000
 #define OVERO_L4_PERIPHERAL_VBASE	0xc010
-#define OVERO_GPMC_VBASE		0xc020
+#define OVERO_L4_WAKEUP_VBASE		0xc020
+#define OVERO_GPMC_VBASE		0xc030
 
+#define DUOVERO_L4_CM_VBASE		0xc000
+#define DUOVERO_L4_PERIPHERAL_VBASE	0xc010
+#define DUOVERO_L4_WAKEUP_VBASE		0xc040
+#define DUOVERO_GPMC_VBASE		0xc050
+
+#define PEPPER_PRCM_VBASE		0xc000
+#define PEPPER_L4_PERIPHERAL_VBASE	0xc010
 
 #define ioreg_read(a)		(*(volatile unsigned *)(a))
 #define ioreg_write(a,v)	(*(volatile unsigned *)(a)=(v))



CVS commit: src/share/man/man3

2016-10-15 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Oct 15 16:31:16 UTC 2016

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

Log Message:
fix tyop


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/share/man/man3/queue.3

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

Modified files:

Index: src/share/man/man3/queue.3
diff -u src/share/man/man3/queue.3:1.53 src/share/man/man3/queue.3:1.54
--- src/share/man/man3/queue.3:1.53	Tue May 31 08:24:43 2016
+++ src/share/man/man3/queue.3	Sat Oct 15 16:31:16 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: queue.3,v 1.53 2016/05/31 08:24:43 wiz Exp $
+.\"	$NetBSD: queue.3,v 1.54 2016/10/15 16:31:16 jdolecek Exp $
 .\"
 .\" Copyright (c) 2000, 2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -53,7 +53,7 @@
 .\"
 .\"	@(#)queue.3	8.1 (Berkeley) 12/13/93
 .\"
-.Dd May 31, 2016
+.Dd October 15, 2016
 .Dt QUEUE 3
 .Os
 .Sh NAME
@@ -812,7 +812,7 @@ removes the first element from the head 
 For optimum efficiency,
 elements being removed from the head of the queue should explicitly use
 this macro instead of the generic
-.Nm SIMPLQ_REMOVE
+.Nm SIMPLEQ_REMOVE
 macro.
 .Pp
 The macro
@@ -821,7 +821,7 @@ removes the element after the one specif
 For optimum efficiency,
 elements being removed after specified elements should explicitly use
 this macro instead of the generic
-.Nm SIMPLQ_REMOVE
+.Nm SIMPLEQ_REMOVE
 macro.
 .Pp
 The macro



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

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 15:33:02 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: README.evbarm

Log Message:
Add Pepper and DuoVero.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbarm/conf/README.evbarm

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/evbarm/conf/README.evbarm
diff -u src/sys/arch/evbarm/conf/README.evbarm:1.12 src/sys/arch/evbarm/conf/README.evbarm:1.13
--- src/sys/arch/evbarm/conf/README.evbarm:1.12	Tue Jul 12 13:32:14 2016
+++ src/sys/arch/evbarm/conf/README.evbarm	Sat Oct 15 15:33:02 2016
@@ -1,4 +1,4 @@
-$NetBSD: README.evbarm,v 1.12 2016/07/12 13:32:14 kiyohara Exp $
+$NetBSD: README.evbarm,v 1.13 2016/10/15 15:33:02 kiyohara Exp $
 
 config		date		boards
 ---
@@ -16,6 +16,7 @@ CUBIETRUCK	2014/04/11	Cubietech Cubietru
 CP3100		2006/11/08	Certance IOP321 CP-3100
 DEVKIT8000	2010/09/08	Embest OMAP3530 DevKit8000 eval Kit 
 DNS323		2010/10/02	D-Link DNS-323 Marvell SoC based NAS
+DUOVERO		2016/10/15	Gumstix Inc. DuoVero COMS boards
 GEMINI		2008/10/24	Cortina Systems SL3516 eval board
 GUMSTIX		2006/10/16	Gumstix Inc. PXA255/270 based boards
 HDL_G		2006/04/16	I-O DATA HDL-G Giga LANDISK
@@ -51,6 +52,7 @@ OSK5912		2007/01/06	TI OMAP 5912 OSK boa
 OVERO		2010/07/10	Gumstix Inc. Overo COMS boards
 PANDABOARD	2012/08/20	TI OMAP4430 PandaBoard
 PARALLELLA	2015/01/23	Xilinx Zynq and Epiphany multi-core chips
+PEPPER		2016/10/15	Gumstix Inc. Pepper SBC(Single Board Computer)
 ROCKCHIP	2014/12/26	Radxa Rock/Lite/Pro, MINIX NEO X7, Rayeager PX2
 SHEEVAPLUG	2010/10/02	Marvell SheevaPlug
 SMDK2410	2003/07/31	Samsung SMDK2410 S3C2410 eval board



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

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 15:29:51 UTC 2016

Added Files:
src/sys/arch/evbarm/conf: DUOVERO PEPPER

Log Message:
Add Gumstix Inc's Pepper and DuoVero.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/conf/DUOVERO \
src/sys/arch/evbarm/conf/PEPPER

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

Added files:

Index: src/sys/arch/evbarm/conf/DUOVERO
diff -u /dev/null src/sys/arch/evbarm/conf/DUOVERO:1.1
--- /dev/null	Sat Oct 15 15:29:51 2016
+++ src/sys/arch/evbarm/conf/DUOVERO	Sat Oct 15 15:29:51 2016
@@ -0,0 +1,336 @@
+#
+#	$NetBSD: DUOVERO,v 1.1 2016/10/15 15:29:51 kiyohara Exp $
+#
+#	DUOOVERO -- Gumstix. Inc. DuoVero COMS platforms kernel
+#
+
+include	"arch/evbarm/conf/std.overo"
+
+#options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
+
+# estimated number of users
+
+maxusers	32
+
+# CPU options
+
+options 	CPU_CORTEXA9
+options 	OMAP_4430
+options 	MULTIPROCESSOR
+options 	FPU_VFP
+options 	PMAPCOUNTERS
+options 	ARM_HAS_VBAR
+options 	__HAVE_MM_MD_DIRECT_MAPPED_PHYS
+makeoptions	CPUFLAGS="-mcpu=cortex-a9 -mfpu=neon"
+
+# Architecture options
+
+makeoptions	BOARDTYPE="duovero"
+options 	EVBARM_BOARDTYPE=duovero
+
+# Gumstix options
+options 	DUOVERO
+# Can specify 'expansion=' in args from u-boot.
+options 	GUMSTIX_NETBSD_ARGS_EXPANSION
+options 	GXIO_DEFAULT_EXPANSION="\"Parlor\""
+
+# Standard system options
+
+options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
+#options 	NTP		# NTP phase/frequency locked loop
+
+# File systems
+
+file-system	FFS		# UFS
+file-system 	EXT2FS		# second extended file system (linux)
+#file-system	LFS		# log-structured file system
+file-system	MFS		# memory file system
+file-system	NFS		# Network file system
+#file-system	NTFS		# Windows/NT file system (experimental)
+#file-system	CD9660		# ISO 9660 + Rock Ridge file system
+file-system	MSDOSFS		# MS-DOS file system
+file-system	FDESC		# /dev/fd
+file-system	KERNFS		# /kern
+#file-system	NULLFS		# loopback file system
+#file-system	OVERLAY		# overlay file system
+#file-system	PROCFS		# /proc
+#file-system	PUFFS		# Userspace file systems (e.g. ntfs-3g & sshfs)
+#file-system	UMAPFS		# NULLFS + uid and gid remapping
+file-system	UNION		# union file system
+#file-system	CODA		# Coda File System; also needs vcoda (below)
+#file-system	SMBFS		# experimental - CIFS; also needs nsmb (below)
+file-system	TMPFS		# memory file system
+file-system	PTYFS		# /dev/pts/N support
+#file-system	UDF		# experimental - OSTA UDF CD/DVD file-system
+#file-system	HFS		# experimental - Apple HFS+ (read-only)
+
+# File system options
+#options 	QUOTA		# legacy UFS quotas
+#options 	QUOTA2		# new, in-filesystem UFS quotas
+#options 	FFS_EI		# FFS Endian Independent support
+options 	WAPBL		# File system journaling support
+#options 	UFS_DIRHASH	# UFS Large Directory Hashing - Experimental
+#options 	NFSSERVER
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
+#options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
+# immutable) behave as system flags.
+
+# Networking options
+
+#options 	GATEWAY		# packet forwarding
+options 	INET		# IP + ICMP + TCP + UDP
+options 	INET6		# IPV6
+#options 	IPSEC		# IP security
+#options 	IPSEC_DEBUG	# debug for IP security
+#options 	MROUTING	# IP multicast routing
+#options 	PIM		# Protocol Independent Multicast
+#options 	NETATALK	# AppleTalk networking
+#options 	PPP_BSDCOMP	# BSD-Compress compression support for PPP
+#options 	PPP_DEFLATE	# Deflate compression support for PPP
+#options 	PPP_FILTER	# Active filter support for PPP (requires bpf)
+#options 	TCP_DEBUG	# Record last TCP_NDEBUG packets with SO_DEBUG
+
+options 	NFS_BOOT_BOOTP
+options 	NFS_BOOT_DHCP
+#options 	NFS_BOOT_BOOTPARAM
+
+# Compatibility options
+
+options		COMPAT_NETBSD32	# allow running arm (e.g. non-earm) binaries
+#options 	COMPAT_09	# NetBSD 0.9,
+#options 	COMPAT_10	# NetBSD 1.0,
+#options 	COMPAT_11	# NetBSD 1.1,
+#options 	COMPAT_12	# NetBSD 1.2,
+#options 	COMPAT_13	# NetBSD 1.3,
+#options 	COMPAT_14	# NetBSD 1.4,
+#options 	COMPAT_15	# NetBSD 1.5,
+#options 	COMPAT_16	# NetBSD 1.6,
+#options 	COMPAT_20	# NetBSD 2.0,
+options 	COMPAT_30	# NetBSD 3.0,
+options 	COMPAT_40	# NetBSD 4.0,
+options 	COMPAT_50	# NetBSD 5.0,
+options 	COMPAT_60	# NetBSD 6.0, and
+options 	COMPAT_70	# NetBSD 7.0 binary compatibility.
+#options 	COMPAT_43	# 4.3BSD compatibility.
+#options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.
+
+options 	COMPAT_OSSAUDIO	# OSS (Voxware) audio driver compatibility
+options 	COMPAT_LINUX	# binary compatibility with Linux
+options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
+
+# Shared memory options
+
+#options 	SYSVMSG		# System V-like message queues
+#options 	SYSVSEM		# System V-like semaphores
+#options 	SYSVSHM		# System V-like memory sharing
+
+# Device options
+
+#options 	MEMORY_DISK_HOOKS	# boottime s

CVS commit: src/sys/arch/evbarm/gumstix

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 15:27:18 UTC 2016

Modified Files:
src/sys/arch/evbarm/gumstix: gumstix_machdep.c gumstix_start.S gxio.c

Log Message:
Support Duovero and Pepper.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/evbarm/gumstix/gumstix_machdep.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/gumstix/gumstix_start.S
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/evbarm/gumstix/gxio.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/evbarm/gumstix/gumstix_machdep.c
diff -u src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.51 src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.52
--- src/sys/arch/evbarm/gumstix/gumstix_machdep.c:1.51	Thu Mar 31 14:33:17 2016
+++ src/sys/arch/evbarm/gumstix/gumstix_machdep.c	Sat Oct 15 15:27:18 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: gumstix_machdep.c,v 1.51 2016/03/31 14:33:17 kiyohara Exp $ */
+/*	$NetBSD: gumstix_machdep.c,v 1.52 2016/10/15 15:27:18 kiyohara Exp $ */
 /*
  * Copyright (C) 2005, 2006, 2007  WIDE Project and SOUM Corporation.
  * All rights reserved.
@@ -137,16 +137,21 @@
  * boards using RedBoot firmware.
  */
 
-#include "opt_evbarm_boardtype.h"
+#include "opt_com.h"
 #include "opt_cputypes.h"
+#include "opt_evbarm_boardtype.h"
 #include "opt_gumstix.h"
-#ifdef OVERO
+#include "opt_kgdb.h"
+#include "opt_multiprocessor.h"
+#include "opt_pmap_debug.h"
+#if defined(OVERO) || defined(DUOVERO) || defined(PEPPER)
 #include "opt_omap.h"
+
+#if defined(DUOVERO)
+#include "arml2cc.h"
+#endif
 #include "prcm.h"
 #endif
-#include "opt_kgdb.h"
-#include "opt_pmap_debug.h"
-#include "opt_com.h"
 
 #include 
 #include 
@@ -159,22 +164,35 @@
 #include 
 #include 
 #include 
+#include 
+
+#include 
 
 #include 
 
-#include 
+#include 	/* don't reorder */
+
+#include 		/* don't reorder */
 #include 
 #include 
 
 #include 
-#ifdef OVERO
-#include 
+#if NARML2CC > 0
+#include 
+#endif
+#include 
 #include 
+#include 
+#include 
+#include 
 #include 
-#include 
+#if defined(OVERO) || defined(DUOVERO) || defined(PEPPER)
+#include 		/* Must required "opt_omap.h" */
+#endif
+#include 
 #include 
 #include 
-#endif
+#include 
 #include 
 #include 
 #include 
@@ -207,8 +225,9 @@ uint32_t system_serial_low;
 /* Prototypes */
 #if defined(GUMSTIX)
 static void	read_system_serial(void);
-#elif defined(OVERO)
-static void	overo_reset(void);
+#endif
+#if defined(OMAP2)
+static void	omap_reset(void);
 static void	find_cpu_clock(void);
 #endif
 static void	process_kernel_args(int, char *[]);
@@ -226,7 +245,7 @@ bs_protos(bs_notimpl);
 #include 
 #endif
 
-#if defined(CPU_XSCALE_PXA250) || defined(CPU_XSCALE_PXA270)
+#if defined(CPU_XSCALE)
 #include "lcd.h"
 #endif
 
@@ -244,7 +263,11 @@ int comcnmode = CONMODE;
 static char console[16];
 #endif
 
-extern void gxio_config_pin(void);
+const struct tifb_panel_info *tifb_panel_info = NULL;
+/* Use TPS65217 White LED Driver */
+bool use_tps65217_wled = false;
+
+extern void gxio_config(void);
 extern void gxio_config_expansion(char *);
 
 
@@ -335,20 +358,27 @@ static const struct pmap_devmap gumstix_
 		PTE_NOCACHE,
 	},
 #elif defined(OVERO)
-	{
+	{	/* SCM, PRCM */
 		OVERO_L4_CORE_VBASE,
 		_A(OMAP3530_L4_CORE_BASE),
 		_S(L1_S_SIZE),		/* No need 16MB.  Use only first 1MB */
 		VM_PROT_READ | VM_PROT_WRITE,
 		PTE_NOCACHE
 	},
-	{
+	{	/* Console, GPIO[2-6] */
 		OVERO_L4_PERIPHERAL_VBASE,
 		_A(OMAP3530_L4_PERIPHERAL_BASE),
 		_S(OMAP3530_L4_PERIPHERAL_SIZE),
 		VM_PROT_READ | VM_PROT_WRITE,
 		PTE_NOCACHE
 	},
+	{	/* GPIO1 */
+		OVERO_L4_WAKEUP_VBASE,
+		_A(OMAP3530_L4_WAKEUP_BASE),
+		_S(OMAP3530_L4_WAKEUP_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
 	{
 		OVERO_GPMC_VBASE,
 		_A(GPMC_BASE),
@@ -356,6 +386,52 @@ static const struct pmap_devmap gumstix_
 		VM_PROT_READ | VM_PROT_WRITE,
 		PTE_NOCACHE
 	},
+#elif defined(DUOVERO)
+	{
+		DUOVERO_L4_CM_VBASE,
+		_A(OMAP4430_L4_CORE_BASE + 0x10),
+		_S(L1_S_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
+	{	/* Console, SCU, L2CC, GPIO[2-6] */
+		DUOVERO_L4_PERIPHERAL_VBASE,
+		_A(OMAP4430_L4_PERIPHERAL_BASE),
+		_S(L1_S_SIZE * 3),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
+	{	/* PRCM, GPIO1 */
+		DUOVERO_L4_WAKEUP_VBASE,
+		_A(OMAP4430_L4_WAKEUP_BASE),
+		_S(OMAP4430_L4_WAKEUP_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
+	{
+		DUOVERO_GPMC_VBASE,
+		_A(GPMC_BASE),
+		_S(GPMC_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
+#elif defined(PEPPER)
+	{
+		/* CM, Control Module, GPIO0, Console */
+		PEPPER_PRCM_VBASE,
+		_A(OMAP2_CM_BASE),
+		_S(L1_S_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
+	{
+		/* GPIO[1-3] */
+		PEPPER_L4_PERIPHERAL_VBASE,
+		_A(TI_AM335X_L4_PERIPHERAL_BASE),
+		_S(L1_S_SIZE),
+		VM_PROT_READ | VM_PROT_WRITE,
+		PTE_NOCACHE
+	},
 #endif
 	{ 0, 0, 0, 0, 0 }
 };
@@ -400,16 +476,22 @@ initarm(void *arg)
 	 * Overo:
 	 

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

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 15:24:00 UTC 2016

Modified Files:
src/sys/arch/evbarm/conf: VTC100

Log Message:
s/at mainbus0/at mainbus?/.  And indent.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/conf/VTC100

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/evbarm/conf/VTC100
diff -u src/sys/arch/evbarm/conf/VTC100:1.7 src/sys/arch/evbarm/conf/VTC100:1.8
--- src/sys/arch/evbarm/conf/VTC100:1.7	Thu Aug  4 06:54:47 2016
+++ src/sys/arch/evbarm/conf/VTC100	Sat Oct 15 15:24:00 2016
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: VTC100,v 1.7 2016/08/04 06:54:47 kiyohara Exp $
+#	$NetBSD: VTC100,v 1.8 2016/10/15 15:24:00 kiyohara Exp $
 #
 #	VTC100 -- NEXCOM VTC100 Kernel
 #
@@ -268,8 +268,8 @@ cpsw*		at obio2 addr 0x4a10 size 0x8
 atphy*		at mii? phy ?		# Attansic/Atheros PHYs
 
 # On-board USB. Experimental
-tiotg* 	at mainbus0 base 0x4740 size 0x5000 intrbase 17
-motg*	at tiotg? port ?
+tiotg*		at mainbus? base 0x4740 size 0x5000 intrbase 17
+motg*		at tiotg? port ?
 usb*		at motg?
 uhub*		at usb?
 uhub*		at uhub? port ?
@@ -277,12 +277,12 @@ uhub*		at uhub? port ?
 uhidev* 	at uhub?
 
 # USB Keyboards
-ukbd*	at uhidev? reportid ?
-wskbd*	at ukbd? console ? mux 1
+ukbd*		at uhidev? reportid ?
+wskbd*		at ukbd? console ? mux 1
 
 # USB Mice
-ums*	at uhidev? reportid ?
-wsmouse* at ums? mux 0
+ums*		at uhidev? reportid ?
+wsmouse*	at ums? mux 0
 
 umass*		at uhub? port ? configuration ? interface ?
 wd*		at umass?



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

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 15:14:20 UTC 2016

Modified Files:
src/sys/arch/arm/omap: omap2_obio.c

Log Message:
Attach icu before attaching gpio.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/arm/omap/omap2_obio.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/omap/omap2_obio.c
diff -u src/sys/arch/arm/omap/omap2_obio.c:1.23 src/sys/arch/arm/omap/omap2_obio.c:1.24
--- src/sys/arch/arm/omap/omap2_obio.c:1.23	Mon Apr 25 13:17:16 2016
+++ src/sys/arch/arm/omap/omap2_obio.c	Sat Oct 15 15:14:20 2016
@@ -1,7 +1,7 @@
-/*	$Id: omap2_obio.c,v 1.23 2016/04/25 13:17:16 kiyohara Exp $	*/
+/*	$Id: omap2_obio.c,v 1.24 2016/10/15 15:14:20 kiyohara Exp $	*/
 
 /* adapted from: */
-/*	$NetBSD: omap2_obio.c,v 1.23 2016/04/25 13:17:16 kiyohara Exp $ */
+/*	$NetBSD: omap2_obio.c,v 1.24 2016/10/15 15:14:20 kiyohara Exp $ */
 
 
 /*
@@ -103,7 +103,7 @@
 
 #include "opt_omap.h"
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap2_obio.c,v 1.23 2016/04/25 13:17:16 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_obio.c,v 1.24 2016/10/15 15:14:20 kiyohara Exp $");
 
 #include "locators.h"
 #include "obio.h"
@@ -378,6 +378,9 @@ static const struct {
 #if defined(OMAP_3530)
 	{ .name = "avic",.addr = INTC_BASE_3530, .required = true },
 #endif
+#if defined(TI_AM335X)
+	{ .name = "omapicu", .addr = 0x4820, .required = true },
+#endif
 	{ .name = "gpio1", .addr = GPIO1_BASE, .required = false },
 	{ .name = "gpio2", .addr = GPIO2_BASE, .required = false },
 	{ .name = "gpio3", .addr = GPIO3_BASE, .required = false },
@@ -400,7 +403,6 @@ static const struct {
 	{ .name = "dmac", .addr = DMAC_BASE, .required = true },
 #endif
 #if defined(TI_AM335X)
-	{ .name = "omapicu", .addr = 0x4820, .required = true },
 	{ .name = "prcm", .addr = 0x44e0, .required = true },
 	{ .name = "sitaracm", .addr = 0x44e1, .required = true },
 	{ .name = "edma", .addr = 0x4900, .required = false },



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

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 15:11:56 UTC 2016

Modified Files:
src/sys/arch/arm/omap: files.omap2 omap2_gpio.c

Log Message:
Support TI_AM335X gpio to omap2_gpio.c.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/omap/files.omap2
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/omap/omap2_gpio.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/omap/files.omap2
diff -u src/sys/arch/arm/omap/files.omap2:1.35 src/sys/arch/arm/omap/files.omap2:1.36
--- src/sys/arch/arm/omap/files.omap2:1.35	Tue Oct  4 16:10:34 2016
+++ src/sys/arch/arm/omap/files.omap2	Sat Oct 15 15:11:56 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: files.omap2,v 1.35 2016/10/04 16:10:34 kiyohara Exp $
+#	$NetBSD: files.omap2,v 1.36 2016/10/15 15:11:56 kiyohara Exp $
 #
 # Configuration info for Texas Instruments OMAP2/OMAP3 CPU support
 # Based on xscale/files.pxa2x0
@@ -59,8 +59,7 @@ file	arch/arm/omap/omap2430_intr.c		omap
 # OMAP2 GPIO controllers
 device	omapgpio: gpiobus
 attach	omapgpio at obio with omap2gpio
-file	arch/arm/omap/omap2_gpio.c		(omap2 | omap3) & !ti_am335x & omapgpio
-file	arch/arm/omap/am335x_gpio.c		ti_am335x & omapgpio
+file	arch/arm/omap/omap2_gpio.c		(omap2 | omap3) & omapgpio
 
 # TI_AM335X (and maybe TI OMAP4) I2C controllers
 device	tiiic: i2cbus, i2cexec

Index: src/sys/arch/arm/omap/omap2_gpio.c
diff -u src/sys/arch/arm/omap/omap2_gpio.c:1.18 src/sys/arch/arm/omap/omap2_gpio.c:1.19
--- src/sys/arch/arm/omap/omap2_gpio.c:1.18	Mon Jul 11 14:53:05 2016
+++ src/sys/arch/arm/omap/omap2_gpio.c	Sat Oct 15 15:11:56 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap2_gpio.c,v 1.18 2016/07/11 14:53:05 kiyohara Exp $	*/
+/*	$NetBSD: omap2_gpio.c,v 1.19 2016/10/15 15:11:56 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -28,7 +28,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c,v 1.18 2016/07/11 14:53:05 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c,v 1.19 2016/10/15 15:11:56 kiyohara Exp $");
 
 #define _INTR_PRIVATE
 
@@ -50,9 +50,13 @@ __KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 #include 
 
 #if NGPIO > 0
@@ -60,6 +64,13 @@ __KERNEL_RCSID(0, "$NetBSD: omap2_gpio.c
 #include 
 #endif
 
+static const struct omap_module gpio_module[] = {
+	{ 0, 0 },
+	{ AM335X_PRCM_CM_PER, CM_PER_GPIO1_CLKCTRL },
+	{ AM335X_PRCM_CM_PER, CM_PER_GPIO2_CLKCTRL },
+	{ AM335X_PRCM_CM_PER, CM_PER_GPIO3_CLKCTRL },
+};
+
 static void gpio_pic_block_irqs(struct pic_softc *, size_t, uint32_t);
 static void gpio_pic_block_irqs2(struct pic_softc *, size_t, uint32_t);
 static void gpio_pic_unblock_irqs(struct pic_softc *, size_t, uint32_t);
@@ -318,16 +329,11 @@ omap2gpio_pin_write(void *arg, int pin, 
 {
 	struct gpio_softc * const gpio = arg;
 	uint32_t mask = 1 << pin;
-	uint32_t old, new;
 
-	old = GPIO_READ(gpio, GPIO_DATAOUT);
 	if (value)
-		new = old | mask;
+		GPIO_WRITE(gpio, GPIO_SETDATAOUT, mask);
 	else
-		new = old & ~mask;
-
-	if (old != new)
-		GPIO_WRITE(gpio, GPIO_DATAOUT, new);
+		GPIO_WRITE(gpio, GPIO_CLEARDATAOUT, mask);
 }
 
 static void
@@ -524,6 +530,23 @@ gpio_attach(device_t parent, device_t se
 		aprint_normal(", intr %d", oa->obio_intr);
 	}
 	aprint_normal("\n");
+
+#ifdef TI_AM335X
+	switch (oa->obio_addr) {
+	case GPIO0_BASE_TI_AM335X:
+		break;
+	case GPIO1_BASE_TI_AM335X:
+		prcm_module_enable(&gpio_module[1]);
+		break;
+	case GPIO2_BASE_TI_AM335X:
+		prcm_module_enable(&gpio_module[2]);
+		break;
+	case GPIO3_BASE_TI_AM335X:
+		prcm_module_enable(&gpio_module[3]);
+		break;
+	}
+#endif
+
 #if NGPIO > 0
 #if 0
 	config_interrupts(self, gpio_attach1);



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

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 15:08:59 UTC 2016

Modified Files:
src/sys/arch/arm/omap: ti_iic.c ti_iicreg.h

Log Message:
Fix broken settings for AM335X's I2C[12].


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/omap/ti_iic.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/omap/ti_iicreg.h

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

Modified files:

Index: src/sys/arch/arm/omap/ti_iic.c
diff -u src/sys/arch/arm/omap/ti_iic.c:1.8 src/sys/arch/arm/omap/ti_iic.c:1.9
--- src/sys/arch/arm/omap/ti_iic.c:1.8	Sat Oct 15 15:00:12 2016
+++ src/sys/arch/arm/omap/ti_iic.c	Sat Oct 15 15:08:59 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: ti_iic.c,v 1.8 2016/10/15 15:00:12 kiyohara Exp $ */
+/* $NetBSD: ti_iic.c,v 1.9 2016/10/15 15:08:59 kiyohara Exp $ */
 
 /*
  * Copyright (c) 2013 Manuel Bouyer.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.8 2016/10/15 15:00:12 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.9 2016/10/15 15:08:59 kiyohara Exp $");
 
 #include "opt_omap.h"
 #include "locators.h"
@@ -163,7 +163,7 @@ struct am335x_iic {
 static const struct am335x_iic am335x_iic[] = {
 	{ "I2C0", OMAP2_I2C0_BASE, 70, { AM335X_PRCM_CM_WKUP, 0xb8 } },
 	{ "I2C1", OMAP2_I2C1_BASE, 71, { AM335X_PRCM_CM_PER, 0x48 } },
-	{ "I2C2", OMAP2_I2C1_BASE, 30, { AM335X_PRCM_CM_PER, 0x44 } },
+	{ "I2C2", OMAP2_I2C2_BASE, 30, { AM335X_PRCM_CM_PER, 0x44 } },
 };
 #endif
 
@@ -199,6 +199,7 @@ ti_iic_attach(device_t parent, device_t 
 {
 	struct ti_iic_softc *sc = device_private(self);
 	struct obio_attach_args *obio = opaque;
+	int scheme, major, minor, fifodepth, fifo;
 	uint16_t rev;
 #ifdef TI_AM335X
 	int i;
@@ -219,8 +220,6 @@ ti_iic_attach(device_t parent, device_t 
 	sc->sc_ic.ic_release_bus = ti_iic_release_bus;
 	sc->sc_ic.ic_exec = ti_iic_exec;
 
-	sc->sc_rxthres = sc->sc_txthres = 4;
-
 	if (bus_space_map(obio->obio_iot, obio->obio_addr, obio->obio_size,
 	0, &sc->sc_ioh) != 0) {
 		aprint_error(": couldn't map address space\n");
@@ -248,27 +247,40 @@ ti_iic_attach(device_t parent, device_t 
 	snprintf(buf, sizeof(buf), "%s_SDA", am335x_iic[i].as_name);
 	if (sitara_cm_padconf_get(buf, &mode, &state) == 0) {
 		aprint_debug(": SDA mode %s state %d ", mode, state);
-	}
-	if (sitara_cm_padconf_set(buf, buf,
-	(0x01 << 4) | (0x01 << 5) | (0x01 << 6)) != 0) {
-		aprint_error(": can't switch %s pad\n", buf);
-		return;
+
+		if (sitara_cm_padconf_set(buf, buf,
+		(0x01 << 4) | (0x01 << 5) | (0x01 << 6)) != 0) {
+			aprint_error(": can't switch %s pad\n", buf);
+			return;
+		}
 	}
 	snprintf(buf, sizeof(buf), "%s_SCL", am335x_iic[i].as_name);
 	if (sitara_cm_padconf_get(buf, &mode, &state) == 0) {
 		aprint_debug(": SCL mode %s state %d ", mode, state);
-	}
-	if (sitara_cm_padconf_set(buf, buf,
-	(0x01 << 4) | (0x01 << 5) | (0x01 << 6)) != 0) {
-		aprint_error(": can't switch %s pad\n", buf);
-		return;
+
+		if (sitara_cm_padconf_set(buf, buf,
+		(0x01 << 4) | (0x01 << 5) | (0x01 << 6)) != 0) {
+			aprint_error(": can't switch %s pad\n", buf);
+			return;
+		}
 	}
 #endif
 
+	scheme = I2C_REVNB_HI_SCHEME(I2C_READ_REG(sc, OMAP2_I2C_REVNB_HI));
 	rev = I2C_READ_REG(sc, OMAP2_I2C_REVNB_LO);
-	aprint_normal(": rev %d.%d\n",
-	(int)I2C_REVNB_LO_MAJOR(rev),
-	(int)I2C_REVNB_LO_MINOR(rev));
+	if (scheme == 0) {
+		major = I2C_REV_SCHEME_0_MAJOR(rev);
+		minor = I2C_REV_SCHEME_0_MINOR(rev);
+	} else {
+		major = I2C_REVNB_LO_MAJOR(rev);
+		minor = I2C_REVNB_LO_MINOR(rev);
+	}
+	aprint_normal(": rev %d.%d, scheme %d\n", major, minor, scheme);
+
+	fifodepth = I2C_BUFSTAT_FIFODEPTH(I2C_READ_REG(sc, OMAP2_I2C_BUFSTAT));
+	fifo = OMAP2_I2C_FIFOBYTES(fifodepth);
+	aprint_normal_dev(self, "%d-bytes FIFO\n", fifo);
+	sc->sc_rxthres = sc->sc_txthres = fifo >> 1;
 
 	ti_iic_reset(sc);
 	ti_iic_flush(sc);
@@ -310,9 +322,9 @@ ti_iic_intr(void *arg)
 	mutex_enter(&sc->sc_mtx);
 	DPRINTF(("ti_iic_intr\n"));
 	stat = I2C_READ_REG(sc, OMAP2_I2C_IRQSTATUS);
-	I2C_WRITE_REG(sc, OMAP2_I2C_IRQSTATUS, stat);
 	DPRINTF(("ti_iic_intr pre handle sc->sc_op eq %#x\n", sc->sc_op));
 	ti_iic_handle_intr(sc, stat);
+	I2C_WRITE_REG(sc, OMAP2_I2C_IRQSTATUS, stat);
 	if (sc->sc_op == TI_I2CERROR || sc->sc_op == TI_I2CDONE) {
 		DPRINTF(("ti_iic_intr post handle sc->sc_op %#x\n", sc->sc_op));
 		cv_signal(&sc->sc_cv);
@@ -418,7 +430,7 @@ ti_iic_reset(struct ti_iic_softc *sc)
 		aprint_error_dev(sc->sc_dev, ": couldn't reset module\n");
 		return 1;
 	}
-			
+
 
 	/* XXX standard speed only */
 	psc = 3;
@@ -451,7 +463,7 @@ ti_iic_op(struct ti_iic_softc *sc, i2c_a
 	int err, retry;
 
 	KASSERT(op == TI_I2CREAD || op == TI_I2CWRITE);
-	DPRINTF(("ti_iic_op: addr %#x op %#x buf %p buflen %#x flags %#x\n", 
+	DPRINTF(("ti_iic_op: addr %#x op %#x buf %p buflen %#x flags %#x\n",
 	addr, op, buf, (unsigned int) buflen, flags));
 
 	mask = I2C_IRQSTATUS_A

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

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 15:00:13 UTC 2016

Modified Files:
src/sys/arch/arm/omap: ti_iic.c

Log Message:
Add support OMAP_4430.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/omap/ti_iic.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/omap/ti_iic.c
diff -u src/sys/arch/arm/omap/ti_iic.c:1.7 src/sys/arch/arm/omap/ti_iic.c:1.8
--- src/sys/arch/arm/omap/ti_iic.c:1.7	Wed Mar 26 11:59:05 2014
+++ src/sys/arch/arm/omap/ti_iic.c	Sat Oct 15 15:00:12 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: ti_iic.c,v 1.7 2014/03/26 11:59:05 ozaki-r Exp $ */
+/* $NetBSD: ti_iic.c,v 1.8 2016/10/15 15:00:12 kiyohara Exp $ */
 
 /*
  * Copyright (c) 2013 Manuel Bouyer.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.7 2014/03/26 11:59:05 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.8 2016/10/15 15:00:12 kiyohara Exp $");
 
 #include "opt_omap.h"
 #include "locators.h"
@@ -183,6 +183,13 @@ ti_iic_match(device_t parent, cfdata_t m
 	obio->obio_addr == OMAP2_I2C2_BASE)
 		return 1;
 #endif
+#if defined(OMAP_4430)
+	if (obio->obio_addr == 0x4807 ||	/* I2C1 */
+	obio->obio_addr == 0x48072000 ||	/* I2C2 */
+	obio->obio_addr == 0x4806 ||	/* I2C3 */
+	obio->obio_addr == 0x4835)	/* I2C4 */
+		return 1;
+#endif
 
 	return 0;
 }



CVS commit: src/sys/dev/i2c

2016-10-15 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 15 14:40:41 UTC 2016

Modified Files:
src/sys/dev/i2c: tps65217pmic.c

Log Message:
Add White LED initialize function.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/i2c/tps65217pmic.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/i2c/tps65217pmic.c
diff -u src/sys/dev/i2c/tps65217pmic.c:1.10 src/sys/dev/i2c/tps65217pmic.c:1.11
--- src/sys/dev/i2c/tps65217pmic.c:1.10	Sun Jul 20 23:01:22 2014
+++ src/sys/dev/i2c/tps65217pmic.c	Sat Oct 15 14:40:41 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: tps65217pmic.c,v 1.10 2014/07/20 23:01:22 bouyer Exp $ */
+/*	$NetBSD: tps65217pmic.c,v 1.11 2016/10/15 14:40:41 kiyohara Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tps65217pmic.c,v 1.10 2014/07/20 23:01:22 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tps65217pmic.c,v 1.11 2016/10/15 14:40:41 kiyohara Exp $");
 
 #include 
 #include 
@@ -154,6 +154,8 @@ static void tps65217pmic_envsys_refresh(
 static void tps65217pmic_power_monitor_init(struct tps65217pmic_softc *);
 static void tps65217pmic_power_monitor(void *);
 
+static void tps65217pmic_wled_init(struct tps65217pmic_softc *, int, int, int);
+
 CFATTACH_DECL_NEW(tps65217pmic, sizeof (struct tps65217pmic_softc),
 tps65217pmic_match, tps65217pmic_attach, NULL, NULL);
 
@@ -291,11 +293,20 @@ tps65217pmic_attach(device_t parent, dev
 {
 	struct tps65217pmic_softc *sc = device_private(self);
 	struct i2c_attach_args *ia = aux;
+	prop_dictionary_t dict;
+	int isel, fdim, brightness;
 
 	sc->sc_dev = self;
 	sc->sc_addr = ia->ia_addr;
 	sc->sc_tag = ia->ia_tag;
 
+	dict = device_properties(self);
+	if (prop_dictionary_get_int32(dict, "isel", &isel)) {
+		prop_dictionary_get_int32(dict, "fdim", &fdim);
+		prop_dictionary_get_int32(dict, "brightness", &brightness);
+	} else
+		isel = -1;
+
 	tps65217pmic_version(sc);
 
 	aprint_normal(": TPS65217");
@@ -333,6 +344,9 @@ tps65217pmic_attach(device_t parent, dev
 
 	tps65217pmic_power_monitor_init(sc);
 
+	if (isel != -1)
+		tps65217pmic_wled_init(sc, isel, fdim, brightness);
+
 	tps65217pmic_envsys_register(sc);
 }
 
@@ -409,6 +423,55 @@ tps65217pmic_power_monitor(void *aux)
 }
 
 static void
+tps65217pmic_wled_init(struct tps65217pmic_softc *sc, int isel, int fdim,
+		   int brightness)
+{
+	uint8_t val = 0;
+
+	switch (isel) {
+	case 1:
+	case 2:
+		val |= ((isel - 1) << TPS65217PMIC_WLEDCTRL1_ISEL);
+		break;
+	default:
+		aprint_error_dev(sc->sc_dev,
+		"WLED ISET selection is 1 or 2: isel %d\n", isel);
+		return;
+	}
+	switch (fdim) {
+	case 100:
+		val |= TPS65217PMIC_WLEDCTRL1_FDIM_100Hz;
+		break;
+	case 200:
+		val |= TPS65217PMIC_WLEDCTRL1_FDIM_200Hz;
+		break;
+	case 500:
+		val |= TPS65217PMIC_WLEDCTRL1_FDIM_500Hz;
+		break;
+	case 1000:
+		val |= TPS65217PMIC_WLEDCTRL1_FDIM_1000Hz;
+		break;
+	default:
+		aprint_error_dev(sc->sc_dev,
+		"WLED PWM dimming frequency is 100, 200, 500 or 1000:"
+		" fdim %d\n", fdim);
+		return;
+	}
+	if (brightness > 100 ||
+	brightness < 0) {
+		aprint_error_dev(sc->sc_dev,
+		"invalid brightness: between 0 and 100: %d\n", brightness);
+		return;
+	}
+
+	tps65217pmic_reg_write(sc, TPS65217PMIC_WLEDCTRL1, val);
+	tps65217pmic_reg_write(sc, TPS65217PMIC_WLEDCTRL2,
+	(brightness - 1) & TPS65217PMIC_WLEDCTRL2_DUTY);
+	val |= TPS65217PMIC_WLEDCTRL1_ISINK_EN;
+	tps65217pmic_reg_write(sc, TPS65217PMIC_WLEDCTRL1, val);
+}
+
+static void
 tps65217pmic_reg_refresh(struct tps65217pmic_softc *sc)
 {
 	int i;



CVS commit: src/lib/libc/string

2016-10-15 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Oct 15 14:30:36 UTC 2016

Modified Files:
src/lib/libc/string: wcsnlen.c

Log Message:
Add NetBSD CVS Id on top of the wcsnlen.c file


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/string/wcsnlen.c

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

Modified files:

Index: src/lib/libc/string/wcsnlen.c
diff -u src/lib/libc/string/wcsnlen.c:1.1 src/lib/libc/string/wcsnlen.c:1.2
--- src/lib/libc/string/wcsnlen.c:1.1	Sat Oct 15 14:22:00 2016
+++ src/lib/libc/string/wcsnlen.c	Sat Oct 15 14:30:36 2016
@@ -1,3 +1,5 @@
+/*	$NetBSD: wcsnlen.c,v 1.2 2016/10/15 14:30:36 kamil Exp $	*/
+
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -28,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: wcsnlen.c,v 1.1 2016/10/15 14:22:00 kamil Exp $");
+__RCSID("$NetBSD: wcsnlen.c,v 1.2 2016/10/15 14:30:36 kamil Exp $");
 
 #include 
 #include 



CVS commit: src/doc

2016-10-15 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Oct 15 14:25:31 UTC 2016

Modified Files:
src/doc: CHANGES

Log Message:
libc: Add the wcsnlen(3) function in .


To generate a diff of this commit:
cvs rdiff -u -r1.2198 -r1.2199 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2198 src/doc/CHANGES:1.2199
--- src/doc/CHANGES:1.2198	Wed Oct 12 20:24:18 2016
+++ src/doc/CHANGES	Sat Oct 15 14:25:31 2016
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2198 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2199 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -383,3 +383,4 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	dhcpcd(8): Import dhcpcd-6.11.4 [roy 20161009]
 	urtwn(4): Add support for Realtek 8192EU [nat 20161012]
 	gdb(1): Updated to 7.12.  [christos 20161012]
+	libc: Add the wcsnlen(3) function in . [kamil 20161015]



CVS commit: src

2016-10-15 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Oct 15 14:22:00 UTC 2016

Modified Files:
src/distrib/sets/lists/comp: mi
src/include: wchar.h
src/lib/libc/string: Makefile.inc wmemchr.3
Added Files:
src/lib/libc/string: wcsnlen.c

Log Message:
Import wcsnlen(3) to libc

The wcsnlen(3) function conforms to POSIX.1-2008 and is an addition to the
ISO C standard.

size_t wcsnlen(const wchar_t *s, size_t maxlen);

The wcsnlen(3) function computes the number of wide-characters in a wide-
-string to which s points, not including NULL terminating wide-character
code and checking no more than maxlen wide-characters. This function never
examines wide-characters beyond a wide-string of maxlen size.

This function is a safer version of wcslen(3):

size_t wcslen(const wchar_t *s);

Update STANDARDS section of wmemchr(3) describing wide-character functions.


To generate a diff of this commit:
cvs rdiff -u -r1.2066 -r1.2067 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.41 -r1.42 src/include/wchar.h
cvs rdiff -u -r1.81 -r1.82 src/lib/libc/string/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/string/wcsnlen.c
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/string/wmemchr.3

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2066 src/distrib/sets/lists/comp/mi:1.2067
--- src/distrib/sets/lists/comp/mi:1.2066	Fri Oct 14 16:09:45 2016
+++ src/distrib/sets/lists/comp/mi	Sat Oct 15 14:21:59 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2066 2016/10/14 16:09:45 spz Exp $
+#	$NetBSD: mi,v 1.2067 2016/10/15 14:21:59 kamil Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -9541,6 +9541,7 @@
 ./usr/share/man/cat3/wcsncat.0			comp-c-catman		.cat
 ./usr/share/man/cat3/wcsncmp.0			comp-c-catman		.cat
 ./usr/share/man/cat3/wcsncpy.0			comp-c-catman		.cat
+./usr/share/man/cat3/wcsnlen.0			comp-c-catman		.cat
 ./usr/share/man/cat3/wcspbrk.0			comp-c-catman		.cat
 ./usr/share/man/cat3/wcsrchr.0			comp-c-catman		.cat
 ./usr/share/man/cat3/wcsrtombs.0		comp-c-catman		.cat
@@ -16790,6 +16791,7 @@
 ./usr/share/man/html3/wcsncat.html		comp-c-htmlman		html
 ./usr/share/man/html3/wcsncmp.html		comp-c-htmlman		html
 ./usr/share/man/html3/wcsncpy.html		comp-c-htmlman		html
+./usr/share/man/html3/wcsnlen.html		comp-c-htmlman		html
 ./usr/share/man/html3/wcspbrk.html		comp-c-htmlman		html
 ./usr/share/man/html3/wcsrchr.html		comp-c-htmlman		html
 ./usr/share/man/html3/wcsrtombs.html		comp-c-htmlman		html
@@ -24110,6 +24112,7 @@
 ./usr/share/man/man3/wcsncat.3			comp-c-man		.man
 ./usr/share/man/man3/wcsncmp.3			comp-c-man		.man
 ./usr/share/man/man3/wcsncpy.3			comp-c-man		.man
+./usr/share/man/man3/wcsnlen.3			comp-c-man		.man
 ./usr/share/man/man3/wcspbrk.3			comp-c-man		.man
 ./usr/share/man/man3/wcsrchr.3			comp-c-man		.man
 ./usr/share/man/man3/wcsrtombs.3		comp-c-man		.man

Index: src/include/wchar.h
diff -u src/include/wchar.h:1.41 src/include/wchar.h:1.42
--- src/include/wchar.h:1.41	Mon Oct 13 00:47:03 2014
+++ src/include/wchar.h	Sat Oct 15 14:22:00 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: wchar.h,v 1.41 2014/10/13 00:47:03 christos Exp $	*/
+/*	$NetBSD: wchar.h,v 1.42 2016/10/15 14:22:00 kamil Exp $	*/
 
 /*-
  * Copyright (c)1999 Citrus Project,
@@ -116,6 +116,7 @@ size_t	wcslen(const wchar_t *);
 wchar_t	*wcsncat(wchar_t * __restrict, const wchar_t * __restrict, size_t);
 int	wcsncmp(const wchar_t *, const wchar_t *, size_t);
 wchar_t	*wcsncpy(wchar_t * __restrict , const wchar_t * __restrict, size_t);
+size_t	wcsnlen(const wchar_t *, size_t);
 wchar_t	*wcspbrk(const wchar_t *, const wchar_t *);
 wchar_t	*wcsrchr(const wchar_t *, wchar_t);
 size_t	wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t,

Index: src/lib/libc/string/Makefile.inc
diff -u src/lib/libc/string/Makefile.inc:1.81 src/lib/libc/string/Makefile.inc:1.82
--- src/lib/libc/string/Makefile.inc:1.81	Wed Oct 12 20:01:12 2016
+++ src/lib/libc/string/Makefile.inc	Sat Oct 15 14:22:00 2016
@@ -1,5 +1,5 @@
 #	from: @(#)Makefile.inc	8.1 (Berkeley) 6/4/93
-#	$NetBSD: Makefile.inc,v 1.81 2016/10/12 20:01:12 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.82 2016/10/15 14:22:00 kamil Exp $
 
 # string sources
 .PATH: ${ARCHDIR}/string ${.CURDIR}/string
@@ -27,7 +27,7 @@ SRCS+=	popcount32.c popcount64.c
 
 # wide char
 SRCS+=	wcscat.c wcschr.c wcscmp.c wcscpy.c wcscspn.c wcslcat.c wcslcpy.c \
-	wcslen.c wcsncat.c wcscasecmp.c wcsdup.c wcsncasecmp.c \
+	wcslen.c wcsncat.c wcsnlen.c wcscasecmp.c wcsdup.c wcsncasecmp.c \
 	wcsncmp.c wcsncpy.c wcspbrk.c wcsrchr.c wcsspn.c wcsstr.c wcstok.c \
 	wcswcs.c wmemchr.c wmemcmp.c wmemcpy.c wmemmove.c wmemset.c
 CPPFLAGS.wcscmp.c+=	-I${LIBCDIR}/locale
@@ -72,8 +72,9 @@ MLINKS+=wmemchr.3 wmemcmp.3 wmemchr.3 wm
 	wmemchr.3 wcscmp.3 wmemchr.3 wcscpy.3 \
 	wmemchr.3 wcscspn.3 wmemchr

CVS commit: src/sys/modules

2016-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 15 12:38:03 UTC 2016

Modified Files:
src/sys/modules: Makefile

Log Message:
Sort entries within conditional blocks


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/sys/modules/Makefile

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

Modified files:

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.179 src/sys/modules/Makefile:1.180
--- src/sys/modules/Makefile:1.179	Tue Sep 27 20:52:43 2016
+++ src/sys/modules/Makefile	Sat Oct 15 12:38:03 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.179 2016/09/27 20:52:43 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.180 2016/10/15 12:38:03 skrll Exp $
 
 .include 
 
@@ -234,16 +234,16 @@ SUBDIR+=	wmimsi
 .if ${MACHINE_CPU} == "arm" \
 || (!empty(MACHINE_ARCH:Mmips64*) && !defined(BSD_MK_COMPAT_FILE))
 SUBDIR+=	compat_netbsd32
-SUBDIR+=	compat_netbsd32_nfssrv
 SUBDIR+=	compat_netbsd32_mqueue
+SUBDIR+=	compat_netbsd32_nfssrv
 SUBDIR+=	compat_netbsd32_sysvipc
 .endif
 
 .if ${MACHINE_ARCH} == "x86_64"
 SUBDIR+=	compat_linux32
 SUBDIR+=	compat_netbsd32
-SUBDIR+=	compat_netbsd32_nfssrv
 SUBDIR+=	compat_netbsd32_mqueue
+SUBDIR+=	compat_netbsd32_nfssrv
 SUBDIR+=	compat_netbsd32_sysvipc
 .endif
 



CVS commit: src/external/gpl3/binutils/usr.bin/ld

2016-10-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Oct 15 12:30:55 UTC 2016

Modified Files:
src/external/gpl3/binutils/usr.bin/ld: Makefile

Log Message:
this rule shouldn't be specific to little endian


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/external/gpl3/binutils/usr.bin/ld/Makefile

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

Modified files:

Index: src/external/gpl3/binutils/usr.bin/ld/Makefile
diff -u src/external/gpl3/binutils/usr.bin/ld/Makefile:1.27 src/external/gpl3/binutils/usr.bin/ld/Makefile:1.28
--- src/external/gpl3/binutils/usr.bin/ld/Makefile:1.27	Fri Oct 14 23:27:00 2016
+++ src/external/gpl3/binutils/usr.bin/ld/Makefile	Sat Oct 15 12:30:55 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.27 2016/10/14 23:27:00 mrg Exp $
+#	$NetBSD: Makefile,v 1.28 2016/10/15 12:30:55 maya Exp $
 
 CPPFLAGS+=	-I${.CURDIR}/arch/${BINUTILS_MACHINE_ARCH} \
 		-I${DIST}/ld \
@@ -70,7 +70,7 @@ EMUL_LIB_PATH.${f}=/usr/lib/i386
 . elif (${BINUTILS_MACHINE_ARCH} == "sparc64" && \
   ("${f}" == "elf32_sparc" || "${f}" == "sparcnbsd"))
 EMUL_LIB_PATH.${f}=/usr/lib/sparc
-. elif ${BINUTILS_MACHINE_ARCH} == "mips64el"
+. elif !empty(BINUTILS_MACHINE_ARCH:Mmips64*)
 .  if "${f}" == "elf32ltsmip" || "${f}" == "elf32btsmip"
 EMUL_LIB_PATH.${f}:=/usr/lib/o32
 .  elif "${f}" == "elf64ltsmip" || "${f}" == "elf64btsmip"



CVS commit: src/usr.sbin/intrctl

2016-10-15 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Oct 15 12:14:00 UTC 2016

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

Log Message:
reduce the affinity column to just 5 chars for compact list


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/intrctl/intrctl.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/intrctl/intrctl.c
diff -u src/usr.sbin/intrctl/intrctl.c:1.4 src/usr.sbin/intrctl/intrctl.c:1.5
--- src/usr.sbin/intrctl/intrctl.c:1.4	Sat Oct 15 12:06:27 2016
+++ src/usr.sbin/intrctl/intrctl.c	Sat Oct 15 12:14:00 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: intrctl.c,v 1.4 2016/10/15 12:06:27 jdolecek Exp $	*/
+/*	$NetBSD: intrctl.c,v 1.5 2016/10/15 12:14:00 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2015 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: intrctl.c,v 1.4 2016/10/15 12:06:27 jdolecek Exp $");
+__RCSID("$NetBSD: intrctl.c,v 1.5 2016/10/15 12:14:00 jdolecek Exp $");
 
 #include 
 #include 
@@ -167,7 +167,7 @@ intrctl_list(int argc, char **argv)
 	printf("%-*s", (int)intridlen, "interrupt id");
 	if (compact) {
 		printf(" %20s ", "total");
-		printf(" %20s ", "affinity");
+		printf(" %5s ", "aff");
 	} else {
 		for (i = 0; i < ncpus; i++) {
 			snprintf(buf, sizeof(buf), "CPU%u", i);
@@ -199,7 +199,7 @@ intrctl_list(int argc, char **argv)
 }
 			}
 			printf("%20" PRIu64 " ", total);
-			printf("%20s ", affinity ? affinity : "none");
+			printf("%5s ", affinity ? affinity : "none");
 			free(affinity);
 		} else {
 			for (i = 0; i < ncpus; i++) {



CVS commit: src/usr.sbin/intrctl

2016-10-15 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Oct 15 12:06:27 UTC 2016

Modified Files:
src/usr.sbin/intrctl: intrctl.8 intrctl.c

Log Message:
add -c option to list command for compact list, it displays totals rather then
per-CPU stats


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/intrctl/intrctl.8 \
src/usr.sbin/intrctl/intrctl.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/intrctl/intrctl.8
diff -u src/usr.sbin/intrctl/intrctl.8:1.3 src/usr.sbin/intrctl/intrctl.8:1.4
--- src/usr.sbin/intrctl/intrctl.8:1.3	Wed Oct 12 21:47:37 2016
+++ src/usr.sbin/intrctl/intrctl.8	Sat Oct 15 12:06:27 2016
@@ -1,4 +1,4 @@
-.\" $NetBSD: intrctl.8,v 1.3 2016/10/12 21:47:37 jdolecek Exp $
+.\" $NetBSD: intrctl.8,v 1.4 2016/10/15 12:06:27 jdolecek Exp $
 .\"
 .\" Copyright (c) 2015 Internet Initiative Japan Inc.
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 12, 2016
+.Dd October 15, 2016
 .Dt INTRCTL 8
 .Os
 .Sh NAME
@@ -56,9 +56,14 @@ enable to set an interrupt's affinity to
 If
 .Ar cpu_index
 is already enabled, this command has no effect.
-.It list
+.It list Op Fl c
 for each intrid in the system, display interrupt counts per CPU.
 The intrid is an interrupt name such as "ioapic0 pin 22" for x86.
+.Pp
+If
+.Fl c
+is specified, display compact list with total counts per interrupt,
+and CPU affinity as comma separated list of CPU indexes.
 .It nointr Fl c Ar cpu_index
 disable to set an interrupt's affinity to
 .Ar cpu_index .
Index: src/usr.sbin/intrctl/intrctl.c
diff -u src/usr.sbin/intrctl/intrctl.c:1.3 src/usr.sbin/intrctl/intrctl.c:1.4
--- src/usr.sbin/intrctl/intrctl.c:1.3	Mon Sep 19 18:46:39 2016
+++ src/usr.sbin/intrctl/intrctl.c	Sat Oct 15 12:06:27 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: intrctl.c,v 1.3 2016/09/19 18:46:39 ryo Exp $	*/
+/*	$NetBSD: intrctl.c,v 1.4 2016/10/15 12:06:27 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 2015 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: intrctl.c,v 1.3 2016/09/19 18:46:39 ryo Exp $");
+__RCSID("$NetBSD: intrctl.c,v 1.4 2016/10/15 12:06:27 jdolecek Exp $");
 
 #include 
 #include 
@@ -99,7 +99,7 @@ usage(void)
 {
 	const char *progname = getprogname();
 
-	fprintf(stderr, "usage: %s list\n", progname);
+	fprintf(stderr, "usage: %s list [-c]\n", progname);
 	fprintf(stderr, "   %s affinity -i interrupt_name -c cpu_index\n", progname);
 	fprintf(stderr, "   %s intr -c cpu_index\n", progname);
 	fprintf(stderr, "   %s nointr -c cpu_index\n", progname);
@@ -117,6 +117,18 @@ intrctl_list(int argc, char **argv)
 	int i, ncpus, *cpucol;
 	void *handle;
 	size_t intridlen;
+	int compact = 0;
+	char ch;
+
+	while ((ch = getopt(argc, argv, "c")) != -1) {
+		switch (ch) {
+		case 'c':
+			compact = 1;
+			break;
+		default:
+			usage();
+		}
+	}
 
 	handle = intrctl_io_alloc(intrctl_io_alloc_retry_count);
 	if (handle == NULL)
@@ -152,21 +164,49 @@ intrctl_list(int argc, char **argv)
 	}
 
 	/* header */
-	printf("%-*s  ", (int)intridlen, "interrupt id");
-	for (i = 0; i < ncpus; i++) {
-		snprintf(buf, sizeof(buf), "CPU%u", i);
-		printf("%*s  ", cpucol[i], buf);
+	printf("%-*s", (int)intridlen, "interrupt id");
+	if (compact) {
+		printf(" %20s ", "total");
+		printf(" %20s ", "affinity");
+	} else {
+		for (i = 0; i < ncpus; i++) {
+			snprintf(buf, sizeof(buf), "CPU%u", i);
+			printf("%*s  ", cpucol[i], buf);
+		}
 	}
 	printf("device name(s)\n");
 
 	/* body */
 	for (illine = intrctl_io_firstline(handle); illine != NULL;
 	illine = intrctl_io_nextline(handle, illine)) {
-		printf("%-*s  ", (int)intridlen, illine->ill_intrid);
-		for (i = 0; i < ncpus; i++) {
-			struct intrio_list_line_cpu *illc = &illine->ill_cpu[i];
-			printf("%*" PRIu64 "%c ", cpucol[i], illc->illc_count,
-			illc->illc_assigned ? '*' : ' ');
+		struct intrio_list_line_cpu *illc;
+
+		printf("%-*s ", (int)intridlen, illine->ill_intrid);
+		if (compact) {
+			uint64_t total = 0;
+			char *affinity, *oaffinity = NULL;
+			for (i = 0; i < ncpus; i++) {
+illc = &illine->ill_cpu[i];
+total += illc->illc_count;
+if (illc->illc_assigned) {
+	asprintf(&affinity, "%s%s%d",
+	oaffinity ? oaffinity : "",
+	oaffinity ? ", " : "",
+	i);
+	if (oaffinity)
+		free(oaffinity);
+	oaffinity = affinity;
+}
+			}
+			printf("%20" PRIu64 " ", total);
+			printf("%20s ", affinity ? affinity : "none");
+			free(affinity);
+		} else {
+			for (i = 0; i < ncpus; i++) {
+illc = &illine->ill_cpu[i];
+printf("%*" PRIu64 "%c ", cpucol[i], illc->illc_count,
+illc->illc_assigned ? '*' : ' ');
+			}
 		}
 		printf("%s\n", illine->ill_xname);
 	}



CVS commit: src/distrib/sets/lists/comp

2016-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 15 11:44:09 UTC 2016

Modified Files:
src/distrib/sets/lists/comp: md.evbmips

Log Message:
add linker scripts


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/distrib/sets/lists/comp/md.evbmips

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

Modified files:

Index: src/distrib/sets/lists/comp/md.evbmips
diff -u src/distrib/sets/lists/comp/md.evbmips:1.20 src/distrib/sets/lists/comp/md.evbmips:1.21
--- src/distrib/sets/lists/comp/md.evbmips:1.20	Mon Dec 21 11:49:37 2015
+++ src/distrib/sets/lists/comp/md.evbmips	Sat Oct 15 07:44:09 2016
@@ -1,4 +1,4 @@
-# $NetBSD: md.evbmips,v 1.20 2015/12/21 16:49:37 christos Exp $
+# $NetBSD: md.evbmips,v 1.21 2016/10/15 11:44:09 christos Exp $
 ./usr/include/evbmipscomp-c-include
 ./usr/include/evbmips/_G_config.h		comp-obsolete		obsolete
 ./usr/include/evbmips/ansi.h			comp-c-include
@@ -62,3 +62,21 @@
 ./usr/include/evbmips/vmparam.h			comp-c-include
 ./usr/include/evbmips/wchar_limits.h		comp-c-include
 ./usr/include/ieeefp.hcomp-c-include
+./usr/libdata/ldscripts/elf32btsmip.xd		-unknown-		binutils
+./usr/libdata/ldscripts/elf32btsmip.xdc		-unknown-		binutils
+./usr/libdata/ldscripts/elf32btsmip.xdw		-unknown-		binutils
+./usr/libdata/ldscripts/elf32btsmipn32.xd	-unknown-		binutils
+./usr/libdata/ldscripts/elf32btsmipn32.xdc	-unknown-		binutils
+./usr/libdata/ldscripts/elf32btsmipn32.xdw	-unknown-		binutils
+./usr/libdata/ldscripts/elf32ltsmip.xd		-unknown-		binutils
+./usr/libdata/ldscripts/elf32ltsmip.xdc		-unknown-		binutils
+./usr/libdata/ldscripts/elf32ltsmip.xdw		-unknown-		binutils
+./usr/libdata/ldscripts/elf32ltsmipn32.xd	-unknown-		binutils
+./usr/libdata/ldscripts/elf32ltsmipn32.xdc	-unknown-		binutils
+./usr/libdata/ldscripts/elf32ltsmipn32.xdw	-unknown-		binutils
+./usr/libdata/ldscripts/elf64btsmip.xd		-unknown-		binutils
+./usr/libdata/ldscripts/elf64btsmip.xdc		-unknown-		binutils
+./usr/libdata/ldscripts/elf64btsmip.xdw		-unknown-		binutils
+./usr/libdata/ldscripts/elf64ltsmip.xd		-unknown-		binutils
+./usr/libdata/ldscripts/elf64ltsmip.xdc		-unknown-		binutils
+./usr/libdata/ldscripts/elf64ltsmip.xdw		-unknown-		binutils



CVS commit: src/distrib/sets/lists/comp

2016-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 15 11:41:54 UTC 2016

Modified Files:
src/distrib/sets/lists/comp: ad.arm

Log Message:
Add more linker scripts


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/distrib/sets/lists/comp/ad.arm

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

Modified files:

Index: src/distrib/sets/lists/comp/ad.arm
diff -u src/distrib/sets/lists/comp/ad.arm:1.73 src/distrib/sets/lists/comp/ad.arm:1.74
--- src/distrib/sets/lists/comp/ad.arm:1.73	Tue Oct 11 03:23:53 2016
+++ src/distrib/sets/lists/comp/ad.arm	Sat Oct 15 07:41:54 2016
@@ -1,4 +1,4 @@
-# $NetBSD: ad.arm,v 1.73 2016/10/11 07:23:53 mrg Exp $
+# $NetBSD: ad.arm,v 1.74 2016/10/15 11:41:54 christos Exp $
 ./usr/include/acorn26comp-c-include
 ./usr/include/acorn26/ansi.h			comp-obsolete		obsolete
 ./usr/include/acorn26/aout_machdep.h		comp-obsolete		obsolete
@@ -670,9 +670,6 @@
 ./usr/lib/oabi/libc_vfp.a			comp-c-lib		compat
 ./usr/lib/oabi/libc_vfp.so			base-sys-shlib		compat,pic
 ./usr/lib/oabi/libc_vfp_p.a			comp-c-proflib		compat,profile
-./usr/libdata/lint/llib-larm.ln			comp-c-lintlib		lint
-./usr/libdata/lint/llib-larm32.ln		comp-obsolete		obsolete
-./usr/libdata/lint/llib-lpmc.ln			comp-c-lintlib		lint
 ./usr/libdata/ldscripts/armelf.x		-unknown-		binutils
 ./usr/libdata/ldscripts/armelf.xbn		-unknown-		binutils
 ./usr/libdata/ldscripts/armelf.xc		-unknown-		binutils
@@ -685,84 +682,139 @@
 ./usr/libdata/ldscripts/armelf.xw		-unknown-		binutils
 ./usr/libdata/ldscripts/armelf_nbsd.x		-unknown-		binutils
 ./usr/libdata/ldscripts/armelf_nbsd.xbn		-unknown-		binutils
-./usr/libdata/ldscripts/armelf_nbsd.xn		-unknown-		binutils
-./usr/libdata/ldscripts/armelf_nbsd.xr		-unknown-		binutils
-./usr/libdata/ldscripts/armelf_nbsd.xu		-unknown-		binutils
-./usr/libdata/ldscripts/armelf_nbsd_eabi.x	-unknown-		binutils
-./usr/libdata/ldscripts/armelf_nbsd_eabi.xbn	-unknown-		binutils
-./usr/libdata/ldscripts/armelf_nbsd_eabi.xn	-unknown-		binutils
-./usr/libdata/ldscripts/armelf_nbsd_eabi.xr	-unknown-		binutils
-./usr/libdata/ldscripts/armelf_nbsd_eabi.xu	-unknown-		binutils
-./usr/libdata/ldscripts/armelf_nbsd_eabihf.x	-unknown-		binutils
-./usr/libdata/ldscripts/armelf_nbsd_eabihf.xbn	-unknown-		binutils
-./usr/libdata/ldscripts/armelf_nbsd_eabihf.xn	-unknown-		binutils
-./usr/libdata/ldscripts/armelf_nbsd_eabihf.xr	-unknown-		binutils
-./usr/libdata/ldscripts/armelf_nbsd_eabihf.xu	-unknown-		binutils
-./usr/libdata/ldscripts/armelfb_nbsd.x		-unknown-		binutils
-./usr/libdata/ldscripts/armelfb_nbsd.xbn	-unknown-		binutils
-./usr/libdata/ldscripts/armelfb_nbsd.xn		-unknown-		binutils
-./usr/libdata/ldscripts/armelfb_nbsd.xr		-unknown-		binutils
-./usr/libdata/ldscripts/armelfb_nbsd.xu		-unknown-		binutils
-./usr/libdata/ldscripts/armelfb_nbsd_eabi.x	-unknown-		binutils
-./usr/libdata/ldscripts/armelfb_nbsd_eabi.xbn	-unknown-		binutils
-./usr/libdata/ldscripts/armelfb_nbsd_eabi.xn	-unknown-		binutils
-./usr/libdata/ldscripts/armelfb_nbsd_eabi.xr	-unknown-		binutils
-./usr/libdata/ldscripts/armelfb_nbsd_eabi.xu	-unknown-		binutils
-./usr/libdata/ldscripts/armelfb_nbsd_eabihf.x	-unknown-		binutils
-./usr/libdata/ldscripts/armelfb_nbsd_eabihf.xbn	-unknown-		binutils
-./usr/libdata/ldscripts/armelfb_nbsd_eabihf.xn	-unknown-		binutils
-./usr/libdata/ldscripts/armelfb_nbsd_eabihf.xr	-unknown-		binutils
-./usr/libdata/ldscripts/armelfb_nbsd_eabihf.xu	-unknown-		binutils
-./usr/libdata/ldscripts/armnbsd.x		-unknown-		binutils
-./usr/libdata/ldscripts/armnbsd.xbn		-unknown-		binutils
-./usr/libdata/ldscripts/armnbsd.xn		-unknown-		binutils
-./usr/libdata/ldscripts/armnbsd.xr		-unknown-		binutils
-./usr/libdata/ldscripts/armnbsd.xu		-unknown-		binutils
 ./usr/libdata/ldscripts/armelf_nbsd.xc		-unknown-		binutils
 ./usr/libdata/ldscripts/armelf_nbsd.xd		-unknown-		binutils
 ./usr/libdata/ldscripts/armelf_nbsd.xdc		-unknown-		binutils
 ./usr/libdata/ldscripts/armelf_nbsd.xdw		-unknown-		binutils
+./usr/libdata/ldscripts/armelf_nbsd.xn		-unknown-		binutils
+./usr/libdata/ldscripts/armelf_nbsd.xr		-unknown-		binutils
 ./usr/libdata/ldscripts/armelf_nbsd.xs		-unknown-		binutils
 ./usr/libdata/ldscripts/armelf_nbsd.xsc		-unknown-		binutils
 ./usr/libdata/ldscripts/armelf_nbsd.xsw		-unknown-		binutils
+./usr/libdata/ldscripts/armelf_nbsd.xu		-unknown-		binutils
 ./usr/libdata/ldscripts/armelf_nbsd.xw		-unknown-		binutils
+./usr/libdata/ldscripts/armelf_nbsd_eabi.x	-unknown-		binutils
+./usr/libdata/ldscripts/armelf_nbsd_eabi.x	-unknown-		binutils
+./usr/libdata/ldscripts/armelf_nbsd_eabi.xbn	-unknown-		binutils
+./usr/libdata/ldscripts/armelf_nbsd_eabi.xbn	-unknown-		binutils
 ./usr/libdata/ldscripts/armelf_nbsd_eabi.xc	-unknown-		binutils
+./usr/libdata/ldscripts/armelf_nbsd_eabi.xc	-unknown-		binutils
+./usr/libdata/ldscripts/armelf_nbsd_eabi.xd	-unknown-		binutils
 ./usr/libdata/ldscripts/armelf_nbsd_eabi.xd	-unknown-		binu

CVS commit: src/distrib/sets/lists/comp

2016-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 15 11:34:31 UTC 2016

Modified Files:
src/distrib/sets/lists/comp: md.i386

Log Message:
adjust for the latest changes


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/distrib/sets/lists/comp/md.i386

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

Modified files:

Index: src/distrib/sets/lists/comp/md.i386
diff -u src/distrib/sets/lists/comp/md.i386:1.158 src/distrib/sets/lists/comp/md.i386:1.159
--- src/distrib/sets/lists/comp/md.i386:1.158	Fri Oct 14 15:28:06 2016
+++ src/distrib/sets/lists/comp/md.i386	Sat Oct 15 07:34:30 2016
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.158 2016/10/14 19:28:06 christos Exp $
+# $NetBSD: md.i386,v 1.159 2016/10/15 11:34:30 christos Exp $
 ./usr/include/clang-3.4/__wmmintrin_aes.h	comp-obsolete		obsolete
 ./usr/include/clang-3.4/__wmmintrin_pclmul.h	comp-obsolete		obsolete
 ./usr/include/clang-3.4/ammintrin.h		comp-obsolete		obsolete
@@ -403,24 +403,5 @@
 ./usr/lib/libpmc.acomp-c-lib
 ./usr/lib/libpmc_p.acomp-c-proflib		profile
 ./usr/lib/libpmc_pic.acomp-c-piclib		pic,picinstall
-./usr/libdata/ldscripts/elf_i386.xw		comp-util-bin		binutils
-./usr/libdata/ldscripts/elf_iamcu.x		comp-util-bin		binutils
-./usr/libdata/ldscripts/elf_iamcu.xbn		comp-util-bin		binutils
-./usr/libdata/ldscripts/elf_iamcu.xc		comp-util-bin		binutils
-./usr/libdata/ldscripts/elf_iamcu.xd		comp-util-bin		binutils
-./usr/libdata/ldscripts/elf_iamcu.xdc		comp-util-bin		binutils
-./usr/libdata/ldscripts/elf_iamcu.xdw		comp-util-bin		binutils
-./usr/libdata/ldscripts/elf_iamcu.xn		comp-util-bin		binutils
-./usr/libdata/ldscripts/elf_iamcu.xr		comp-util-bin		binutils
-./usr/libdata/ldscripts/elf_iamcu.xs		comp-util-bin		binutils
-./usr/libdata/ldscripts/elf_iamcu.xsc		comp-util-bin		binutils
-./usr/libdata/ldscripts/elf_iamcu.xsw		comp-util-bin		binutils
-./usr/libdata/ldscripts/elf_iamcu.xu		comp-util-bin		binutils
-./usr/libdata/ldscripts/elf_iamcu.xw		comp-util-bin		binutils
-./usr/libdata/ldscripts/i386nbsd.x		comp-util-bin		binutils
-./usr/libdata/ldscripts/i386nbsd.xbn		comp-util-bin		binutils
-./usr/libdata/ldscripts/i386nbsd.xn		comp-util-bin		binutils
-./usr/libdata/ldscripts/i386nbsd.xr		comp-util-bin		binutils
-./usr/libdata/ldscripts/i386nbsd.xu		comp-util-bin		binutils
 ./usr/libdata/lint/llib-li386.ln		comp-c-lintlib		lint
 ./usr/libdata/lint/llib-lpmc.ln			comp-c-lintlib		lint



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

2016-10-15 Thread Felix Deichmann
Module Name:src
Committed By:   flxd
Date:   Sat Oct 15 09:57:51 UTC 2016

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

Log Message:
Add tcu and gpio for TC-USB support. OK christos@


To generate a diff of this commit:
cvs rdiff -u -r1.368 -r1.369 src/sys/arch/alpha/conf/GENERIC

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

Modified files:

Index: src/sys/arch/alpha/conf/GENERIC
diff -u src/sys/arch/alpha/conf/GENERIC:1.368 src/sys/arch/alpha/conf/GENERIC:1.369
--- src/sys/arch/alpha/conf/GENERIC:1.368	Sat Mar 19 23:21:02 2016
+++ src/sys/arch/alpha/conf/GENERIC	Sat Oct 15 09:57:51 2016
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.368 2016/03/19 23:21:02 gdt Exp $
+# $NetBSD: GENERIC,v 1.369 2016/10/15 09:57:51 flxd Exp $
 #
 # This machine description file is used to generate the default NetBSD
 # kernel.
@@ -19,7 +19,7 @@ include 	"arch/alpha/conf/std.alpha"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-ident		"GENERIC-$Revision: 1.368 $"
+ident		"GENERIC-$Revision: 1.369 $"
 
 maxusers 32
 
@@ -262,6 +262,8 @@ sfb*	at	tc? slot ? offset ?
 #sfbp*	at	tc? slot ? offset ?
 px*	at	tc? slot ? offset ?
 pxg*	at	tc? slot ? offset ?
+tcu*	at	tc? slot ? offset ?
+slhci*	at	tcu?
 
 # TURBOchannel serial attachments
 zstty0	at	zsc0 channel ?			# serial port on B channels
@@ -400,6 +402,9 @@ ld*	at iop? tid ?			# block devices
 # XXX dpti.c wants a processor type that is not assigned for x86-64
 #dpti*	at iop? tid 0			# DPT/Adaptec control interface
 
+# GPIO devices
+gpio*	at gpiobus?
+
 # MII/PHY support
 brgphy* at mii? phy ?			# Broadcom BCM5400-family PHYs
 exphy*	at mii? phy ?			# 3Com internal PHYs



CVS commit: src/sys/arch/x86/x86

2016-10-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Oct 15 09:50:27 UTC 2016

Modified Files:
src/sys/arch/x86/x86: lapic.c

Log Message:
Instead of setting the TPR to the value that was in the data segment, set
zero directly. On amd64, the data version of lapic_tpr is not explicitly
initialized.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/x86/x86/lapic.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/x86/lapic.c
diff -u src/sys/arch/x86/x86/lapic.c:1.52 src/sys/arch/x86/x86/lapic.c:1.53
--- src/sys/arch/x86/x86/lapic.c:1.52	Mon Jul 25 12:11:40 2016
+++ src/sys/arch/x86/x86/lapic.c	Sat Oct 15 09:50:27 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: lapic.c,v 1.52 2016/07/25 12:11:40 maxv Exp $	*/
+/*	$NetBSD: lapic.c,v 1.53 2016/10/15 09:50:27 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2008 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.52 2016/07/25 12:11:40 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.53 2016/10/15 09:50:27 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"		/* for MPDEBUG */
@@ -92,7 +92,6 @@ struct pic local_pic = {
 static void
 lapic_map(paddr_t lapic_base)
 {
-	int s;
 	pt_entry_t *pte;
 	vaddr_t va = (vaddr_t)&local_apic;
 
@@ -113,7 +112,6 @@ lapic_map(paddr_t lapic_base)
 	}
 
 	x86_disable_intr();
-	s = lapic_tpr;
 
 	/*
 	 * Map local apic.  If we have a local apic, it's safe to assume
@@ -132,7 +130,7 @@ lapic_map(paddr_t lapic_base)
 	cpu_init_first();	/* catch up to changed cpu_number() */
 #endif
 
-	lapic_tpr = s;
+	i82489_writereg(LAPIC_TPRI, 0);
 	x86_enable_intr();
 }
 



CVS commit: src/sys/kern

2016-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 15 09:09:55 UTC 2016

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

Log Message:
KNF


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

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

Modified files:

Index: src/sys/kern/sys_process.c
diff -u src/sys/kern/sys_process.c:1.172 src/sys/kern/sys_process.c:1.173
--- src/sys/kern/sys_process.c:1.172	Fri Oct 14 08:38:31 2016
+++ src/sys/kern/sys_process.c	Sat Oct 15 09:09:55 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_process.c,v 1.172 2016/10/14 08:38:31 skrll Exp $	*/
+/*	$NetBSD: sys_process.c,v 1.173 2016/10/15 09:09:55 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.172 2016/10/14 08:38:31 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.173 2016/10/15 09:09:55 skrll Exp $");
 
 #include "opt_ptrace.h"
 #include "opt_ktrace.h"
@@ -281,7 +281,7 @@ sys_ptrace(struct lwp *l, const struct s
 		t = proc_find(SCARG(uap, pid));
 		if (t == NULL) {
 			mutex_exit(proc_lock);
-			return (ESRCH);
+			return ESRCH;
 		}
 
 		/* XXX-elad */
@@ -291,7 +291,7 @@ sys_ptrace(struct lwp *l, const struct s
 		if (error) {
 			mutex_exit(proc_lock);
 			mutex_exit(t->p_lock);
-			return (ESRCH);
+			return ESRCH;
 		}
 	}
 
@@ -556,7 +556,7 @@ sys_ptrace(struct lwp *l, const struct s
 			 * Can't write to a RAS
 			 */
 			if (ras_lookup(t, SCARG(uap, addr)) != (void *)-1) {
-return (EACCES);
+return EACCES;
 			}
 			uio.uio_rw = UIO_WRITE;
 			break;
@@ -1016,9 +1016,9 @@ process_doregs(struct lwp *curl /*tracer
 	}
 
 	uio->uio_offset = 0;
-	return (error);
+	return error;
 #else
-	return (EINVAL);
+	return EINVAL;
 #endif
 }
 
@@ -1027,9 +1027,9 @@ process_validregs(struct lwp *l)
 {
 
 #if defined(PT_SETREGS) || defined(PT_GETREGS)
-	return ((l->l_flag & LW_SYSTEM) == 0);
+	return (l->l_flag & LW_SYSTEM) == 0;
 #else
-	return (0);
+	return 0;
 #endif
 }
 
@@ -1065,9 +1065,9 @@ process_dofpregs(struct lwp *curl /*trac
 			error = process_write_fpregs(l, &r, kl);
 	}
 	uio->uio_offset = 0;
-	return (error);
+	return error;
 #else
-	return (EINVAL);
+	return EINVAL;
 #endif
 }
 
@@ -1076,9 +1076,9 @@ process_validfpregs(struct lwp *l)
 {
 
 #if defined(PT_SETFPREGS) || defined(PT_GETFPREGS)
-	return ((l->l_flag & LW_SYSTEM) == 0);
+	return (l->l_flag & LW_SYSTEM) == 0;
 #else
-	return (0);
+	return 0;
 #endif
 }
 #endif /* PTRACE */
@@ -1102,7 +1102,7 @@ process_domem(struct lwp *curl /*tracer*
 	len = uio->uio_resid;
 
 	if (len == 0)
-		return (0);
+		return 0;
 
 #ifdef PMAP_NEED_PROCWR
 	addr = uio->uio_offset;
@@ -1117,7 +1117,7 @@ process_domem(struct lwp *curl /*tracer*
 		p->p_vmspace->vm_refcnt++;  /* XXX */
 	mutex_exit(&vm->vm_map.misc_lock);
 	if (error != 0)
-		return (error);
+		return error;
 	error = uvm_io(&vm->vm_map, uio, pax_mprotect_prot(l));
 	uvmspace_free(vm);
 
@@ -1125,7 +1125,7 @@ process_domem(struct lwp *curl /*tracer*
 	if (error == 0 && uio->uio_rw == UIO_WRITE)
 		pmap_procwr(p, addr, len);
 #endif
-	return (error);
+	return error;
 }
 #endif /* KTRACE || PTRACE */
 



CVS commit: src/sys/dev/if_ndis

2016-10-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Oct 15 08:37:55 UTC 2016

Modified Files:
src/sys/dev/if_ndis: if_ndis_pci.c

Log Message:
There are several leaks in here, just fix one that should have been fixed
in rev1.21


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/if_ndis/if_ndis_pci.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/if_ndis/if_ndis_pci.c
diff -u src/sys/dev/if_ndis/if_ndis_pci.c:1.21 src/sys/dev/if_ndis/if_ndis_pci.c:1.22
--- src/sys/dev/if_ndis/if_ndis_pci.c:1.21	Sat Apr  4 15:22:02 2015
+++ src/sys/dev/if_ndis/if_ndis_pci.c	Sat Oct 15 08:37:55 2016
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ndis_pci.c,v 1.21 2015/04/04 15:22:02 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ndis_pci.c,v 1.22 2016/10/15 08:37:55 maxv Exp $");
 #ifdef __FreeBSD__
 __FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis_pci.c,v 1.8.2.3 2005/03/31 04:24:36 wpaul Exp $");
 #endif
@@ -300,7 +300,7 @@ void ndis_attach_pci(device_t parent, de
 	if((sc->ndis_res_altmem = 
 		malloc(sizeof(struct ndis_resource), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL) {
 		sc->error = ENOMEM;
-		return;
+		goto out;
 	}
 	sc->ndis_res_altmem->res_base = base;
 	sc->ndis_res_altmem->res_size = size;



CVS commit: src/sys/dev/fdt

2016-10-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Oct 15 08:30:42 UTC 2016

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

Log Message:
Memory leak, found by mootja; not tested, but obvious enough


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/fdt/fdt_gpio.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/fdt_gpio.c
diff -u src/sys/dev/fdt/fdt_gpio.c:1.3 src/sys/dev/fdt/fdt_gpio.c:1.4
--- src/sys/dev/fdt/fdt_gpio.c:1.3	Tue Dec 22 22:19:07 2015
+++ src/sys/dev/fdt/fdt_gpio.c	Sat Oct 15 08:30:42 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_gpio.c,v 1.3 2015/12/22 22:19:07 jmcneill Exp $ */
+/* $NetBSD: fdt_gpio.c,v 1.4 2016/10/15 08:30:42 maxv Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_gpio.c,v 1.3 2015/12/22 22:19:07 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_gpio.c,v 1.4 2016/10/15 08:30:42 maxv Exp $");
 
 #include 
 #include 
@@ -111,6 +111,7 @@ fdtbus_gpio_acquire(int phandle, const c
 	gp->gp_priv = gc->gc_funcs->acquire(gc->gc_dev, data, len, flags);
 	if (gp->gp_priv == NULL) {
 		kmem_free(data, len);
+		kmem_free(gp, sizeof(*gp));
 		return NULL;
 	}
 



CVS commit: src/sys/dev/usb

2016-10-15 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sat Oct 15 07:10:16 UTC 2016

Modified Files:
src/sys/dev/usb: hid.c

Log Message:
printf -> aprint_normal.

OK christos@


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/usb/hid.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/usb/hid.c
diff -u src/sys/dev/usb/hid.c:1.45 src/sys/dev/usb/hid.c:1.46
--- src/sys/dev/usb/hid.c:1.45	Wed Apr 27 19:35:17 2016
+++ src/sys/dev/usb/hid.c	Sat Oct 15 07:10:15 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: hid.c,v 1.45 2016/04/27 19:35:17 jakllsch Exp $	*/
+/*	$NetBSD: hid.c,v 1.46 2016/10/15 07:10:15 nat Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/hid.c,v 1.11 1999/11/17 22:33:39 n_hibma Exp $ */
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.45 2016/04/27 19:35:17 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.46 2016/10/15 07:10:15 nat Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -192,7 +192,7 @@ hid_get_item(struct hid_data *s, struct 
 			dval = (int32_t)dval;
 			break;
 		default:
-			printf("BAD LENGTH %d\n", bSize);
+			aprint_normal("BAD LENGTH %d\n", bSize);
 			continue;
 		}
 
@@ -260,7 +260,7 @@ hid_get_item(struct hid_data *s, struct 
 s->nu = 0;
 return 1;
 			default:
-printf("Main bTag=%d\n", bTag);
+aprint_normal("Main bTag=%d\n", bTag);
 break;
 			}
 			break;
@@ -312,7 +312,7 @@ hid_get_item(struct hid_data *s, struct 
 kmem_free(hi, sizeof(*hi));
 break;
 			default:
-printf("Global bTag=%d\n", bTag);
+aprint_normal("Global bTag=%d\n", bTag);
 break;
 			}
 			break;
@@ -365,12 +365,12 @@ hid_get_item(struct hid_data *s, struct 
 c->set_delimiter = dval;
 break;
 			default:
-printf("Local bTag=%d\n", bTag);
+aprint_normal("Local bTag=%d\n", bTag);
 break;
 			}
 			break;
 		default:
-			printf("default bType=%d\n", bType);
+			aprint_normal("default bType=%d\n", bType);
 			break;
 		}
 	}
@@ -396,7 +396,8 @@ hid_report_size(const void *buf, int len
 lo = h.loc.pos;
 #ifdef DIAGNOSTIC
 if (lo != 0) {
-	printf("hid_report_size: lo != 0\n");
+	aprint_normal("hid_report_size:"
+	   " lo != 0\n");
 }
 #endif
 			}



CVS commit: src

2016-10-15 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Sat Oct 15 07:08:06 UTC 2016

Modified Files:
src/sys/dev/pad: pad.c
src/tests/dev/audio: h_pad.c

Log Message:
pad(4) must be open before corresponding audio device is opened.

OK christos@


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pad/pad.c
cvs rdiff -u -r1.1 -r1.2 src/tests/dev/audio/h_pad.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/pad/pad.c
diff -u src/sys/dev/pad/pad.c:1.25 src/sys/dev/pad/pad.c:1.26
--- src/sys/dev/pad/pad.c:1.25	Thu Jul  7 06:55:41 2016
+++ src/sys/dev/pad/pad.c	Sat Oct 15 07:08:06 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: pad.c,v 1.25 2016/07/07 06:55:41 msaitoh Exp $ */
+/* $NetBSD: pad.c,v 1.26 2016/10/15 07:08:06 nat Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.25 2016/07/07 06:55:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.26 2016/10/15 07:08:06 nat Exp $");
 
 #include 
 #include 
@@ -74,6 +74,7 @@ static void	pad_attach(device_t, device_
 static int	pad_detach(device_t, int);
 static void	pad_childdet(device_t, device_t);
 
+static int	pad_audio_open(void *, int);
 static int	pad_query_encoding(void *, struct audio_encoding *);
 static int	pad_set_params(void *, int, int,
 audio_params_t *, audio_params_t *,
@@ -99,6 +100,7 @@ static stream_filter_t *pad_swvol_filter
 static void	pad_swvol_dtor(stream_filter_t *);
 
 static const struct audio_hw_if pad_hw_if = {
+	.open = pad_audio_open,
 	.query_encoding = pad_query_encoding,
 	.set_params = pad_set_params,
 	.start_output = pad_start_output,
@@ -341,7 +343,7 @@ pad_close(dev_t dev, int flags, int fmt,
 
 #define PAD_BYTES_PER_SEC (44100 * sizeof(int16_t) * 2)
 #define TIMENEXTREAD	(20 * 1000)
-#define BYTESTOSLEEP (PAD_BYTES_PER_SEC / (100 / TIMENEXTREAD))
+#define BYTESTOSLEEP ((PAD_BYTES_PER_SEC / (100 / TIMENEXTREAD)) + PAD_BLKSIZE)
 
 int
 pad_read(dev_t dev, struct uio *uio, int flags)
@@ -420,6 +422,19 @@ pad_read(dev_t dev, struct uio *uio, int
 }
 
 static int
+pad_audio_open(void *opaque, int flags)
+{
+	pad_softc_t *sc;
+	sc = opaque;
+
+	if (sc->sc_open == 0)
+		return EIO;
+
+	getmicrotime(&sc->sc_last);
+	return 0;
+}
+
+static int
 pad_query_encoding(void *opaque, struct audio_encoding *ae)
 {
 	pad_softc_t *sc;
@@ -477,6 +492,8 @@ pad_start_output(void *opaque, void *blo
 	sc = (pad_softc_t *)opaque;
 
 	KASSERT(mutex_owned(&sc->sc_lock));
+	if (!sc->sc_open)
+		return EIO;
 
 	sc->sc_intr = intr;
 	sc->sc_intrarg = intrarg;

Index: src/tests/dev/audio/h_pad.c
diff -u src/tests/dev/audio/h_pad.c:1.1 src/tests/dev/audio/h_pad.c:1.2
--- src/tests/dev/audio/h_pad.c:1.1	Wed Aug  4 13:15:15 2010
+++ src/tests/dev/audio/h_pad.c	Sat Oct 15 07:08:06 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_pad.c,v 1.1 2010/08/04 13:15:15 pooka Exp $	*/
+/*	$NetBSD: h_pad.c,v 1.2 2016/10/15 07:08:06 nat Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -56,14 +56,14 @@ main(int argc, char *argv[])
 	ssize_t n;
 
 	rump_init();
-	audiofd = rump_sys_open("/dev/audio0", O_RDWR);
-	if (audiofd == -1)
-		err(1, "open audio");
-
 	padfd = rump_sys_open("/dev/pad0", O_RDONLY);
 	if (padfd == -1)
 		err(1, "open pad");
 
+	audiofd = rump_sys_open("/dev/audio0", O_RDWR);
+	if (audiofd == -1)
+		err(1, "open audio");
+
 	if ((n = rump_sys_write(audiofd, musa, sizeof(musa))) != sizeof(musa))
 		err(1, "write");