CVS commit: [netbsd-7] src/sys/net

2015-02-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 16 20:48:40 UTC 2015

Modified Files:
src/sys/net [netbsd-7]: bpfjit.c

Log Message:
Pull up following revision(s) (requested by alnsn in ticket #519):
sys/net/bpfjit.c: revision 1.39-1.41
Fix bugs found by afl fuzzer http://lcamtuf.coredump.cx/afl/.
-
Don't emit wrapped-around reads. They're dead code but dead code elimination
logic isn't smart enough to figure it out.
-
Properly track initialisation of registers for BPF_JMP instructions.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.32.2.1 src/sys/net/bpfjit.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/net/bpfjit.c
diff -u src/sys/net/bpfjit.c:1.32 src/sys/net/bpfjit.c:1.32.2.1
--- src/sys/net/bpfjit.c:1.32	Sat Jul 26 11:23:46 2014
+++ src/sys/net/bpfjit.c	Mon Feb 16 20:48:40 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpfjit.c,v 1.32 2014/07/26 11:23:46 alnsn Exp $	*/
+/*	$NetBSD: bpfjit.c,v 1.32.2.1 2015/02/16 20:48:40 martin Exp $	*/
 
 /*-
  * Copyright (c) 2011-2014 Alexander Nasonov.
@@ -31,9 +31,9 @@
 
 #include sys/cdefs.h
 #ifdef _KERNEL
-__KERNEL_RCSID(0, $NetBSD: bpfjit.c,v 1.32 2014/07/26 11:23:46 alnsn Exp $);
+__KERNEL_RCSID(0, $NetBSD: bpfjit.c,v 1.32.2.1 2015/02/16 20:48:40 martin Exp $);
 #else
-__RCSID($NetBSD: bpfjit.c,v 1.32 2014/07/26 11:23:46 alnsn Exp $);
+__RCSID($NetBSD: bpfjit.c,v 1.32.2.1 2015/02/16 20:48:40 martin Exp $);
 #endif
 
 #include sys/types.h
@@ -290,15 +290,10 @@ read_width(const struct bpf_insn *pc)
 {
 
 	switch (BPF_SIZE(pc-code)) {
-	case BPF_W:
-		return 4;
-	case BPF_H:
-		return 2;
-	case BPF_B:
-		return 1;
-	default:
-		BJ_ASSERT(false);
-		return 0;
+	case BPF_W: return 4;
+	case BPF_H: return 2;
+	case BPF_B: return 1;
+	default:return 0;
 	}
 }
 
@@ -839,6 +834,8 @@ emit_pkt_read(struct sljit_compiler *com
 
 	ld_reg = BJ_BUF;
 	width = read_width(pc);
+	if (width == 0)
+		return SLJIT_ERR_ALLOC_FAILED;
 
 	if (BPF_MODE(pc-code) == BPF_IND) {
 		/* tmp1 = buflen - (pc-k + width); */
@@ -871,20 +868,27 @@ emit_pkt_read(struct sljit_compiler *com
 			return SLJIT_ERR_ALLOC_FAILED;
 	}
 
-	switch (width) {
-	case 4:
-		status = emit_read32(compiler, ld_reg, k);
-		break;
-	case 2:
-		status = emit_read16(compiler, ld_reg, k);
-		break;
-	case 1:
-		status = emit_read8(compiler, ld_reg, k);
-		break;
-	}
+	/*
+	 * Don't emit wrapped-around reads. They're dead code but
+	 * dead code elimination logic isn't smart enough to figure
+	 * it out.
+	 */
+	if (k = UINT32_MAX - width + 1) {
+		switch (width) {
+		case 4:
+			status = emit_read32(compiler, ld_reg, k);
+			break;
+		case 2:
+			status = emit_read16(compiler, ld_reg, k);
+			break;
+		case 1:
+			status = emit_read8(compiler, ld_reg, k);
+			break;
+		}
 
-	if (status != SLJIT_SUCCESS)
-		return status;
+		if (status != SLJIT_SUCCESS)
+			return status;
+	}
 
 #ifdef _KERNEL
 	over_mchain_jump = sljit_emit_jump(compiler, SLJIT_JUMP);
@@ -1195,12 +1199,15 @@ read_pkt_insn(const struct bpf_insn *pc,
 	case BPF_LD:
 		rv = BPF_MODE(pc-code) == BPF_ABS ||
 		 BPF_MODE(pc-code) == BPF_IND;
-		if (rv)
+		if (rv) {
 			width = read_width(pc);
+			rv = (width != 0);
+		}
 		break;
 
 	case BPF_LDX:
-		rv = pc-code == (BPF_LDX|BPF_B|BPF_MSH);
+		rv = BPF_MODE(pc-code) == BPF_MSH 
+		 BPF_SIZE(pc-code) == BPF_B;
 		width = 1;
 		break;
 	}
@@ -1372,6 +1379,13 @@ optimize_pass1(const bpf_ctx_t *bc, cons
 			/* Initialize abc_length for ABC pass. */
 			insn_dat[i].u.jdata.abc_length = MAX_ABC_LENGTH;
 
+			*initmask |= invalid  BJ_INIT_ABIT;
+
+			if (BPF_SRC(insns[i].code) == BPF_X) {
+*hints |= BJ_HINT_XREG;
+*initmask |= invalid  BJ_INIT_XBIT;
+			}
+
 			if (BPF_OP(insns[i].code) == BPF_JA) {
 jt = jf = insns[i].k;
 			} else {
@@ -1550,6 +1564,7 @@ optimize(const bpf_ctx_t *bc, const stru
 static int
 bpf_alu_to_sljit_op(const struct bpf_insn *pc)
 {
+	const int bad = SLJIT_UNUSED;
 
 	/*
 	 * Note: all supported 64bit arches have 32bit multiply
@@ -1561,11 +1576,10 @@ bpf_alu_to_sljit_op(const struct bpf_ins
 	case BPF_MUL: return SLJIT_MUL|SLJIT_INT_OP;
 	case BPF_OR:  return SLJIT_OR;
 	case BPF_AND: return SLJIT_AND;
-	case BPF_LSH: return SLJIT_SHL;
-	case BPF_RSH: return SLJIT_LSHR|SLJIT_INT_OP;
+	case BPF_LSH: return (pc-k  31) ? bad : SLJIT_SHL;
+	case BPF_RSH: return (pc-k  31) ? bad : SLJIT_LSHR|SLJIT_INT_OP;
 	default:
-		BJ_ASSERT(false);
-		return 0;
+		return bad;
 	}
 }
 
@@ -1885,10 +1899,12 @@ generate_insn_code(struct sljit_compiler
 			}
 
 			if (BPF_OP(pc-code) != BPF_DIV) {
+const int op2 = bpf_alu_to_sljit_op(pc);
+
+if (op2 == SLJIT_UNUSED)
+	goto fail;
 status = sljit_emit_op2(compiler,
-bpf_alu_to_sljit_op(pc),
-BJ_AREG, 0,
-BJ_AREG, 0,
+op2, BJ_AREG, 0, BJ_AREG, 0,
 kx_to_reg(pc), kx_to_reg_arg(pc));
 if (status != SLJIT_SUCCESS)
 	goto fail;



CVS commit: [netbsd-7] src/sys/arch/arm

2015-02-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 16 21:33:13 UTC 2015

Modified Files:
src/sys/arch/arm/arm [netbsd-7]: cpu_in_cksum.S
src/sys/arch/arm/conf [netbsd-7]: std.arm

Log Message:
Pull up following revision(s) (requested by skrll in ticket #522):
sys/arch/arm/conf/std.arm: revision 1.3
sys/arch/arm/arm/cpu_in_cksum.S: revision 1.9
sys/arch/arm/arm/cpu_in_cksum.S: revision 1.10
sys/arch/arm/arm/cpu_in_cksum.S: revision 1.11
Fix conditional; makes 0 len mbuf, 0 offset, 0 len test work.
-
Correct arm_cksumdata for 4 bytes of data
Really fix arm_cksumdata for 4 bytes of data
-
Re-enable CPU_IN_CKSUM now the bugs are fixed.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.4.1 src/sys/arch/arm/arm/cpu_in_cksum.S
cvs rdiff -u -r1.1.82.1 -r1.1.82.2 src/sys/arch/arm/conf/std.arm

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

Modified files:

Index: src/sys/arch/arm/arm/cpu_in_cksum.S
diff -u src/sys/arch/arm/arm/cpu_in_cksum.S:1.8 src/sys/arch/arm/arm/cpu_in_cksum.S:1.8.4.1
--- src/sys/arch/arm/arm/cpu_in_cksum.S:1.8	Sun Dec 22 16:29:42 2013
+++ src/sys/arch/arm/arm/cpu_in_cksum.S	Mon Feb 16 21:33:13 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_in_cksum.S,v 1.8 2013/12/22 16:29:42 matt Exp $	*/
+/*	$NetBSD: cpu_in_cksum.S,v 1.8.4.1 2015/02/16 21:33:13 martin Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include machine/asm.h
-RCSID($NetBSD: cpu_in_cksum.S,v 1.8 2013/12/22 16:29:42 matt Exp $)
+RCSID($NetBSD: cpu_in_cksum.S,v 1.8.4.1 2015/02/16 21:33:13 martin Exp $)
 	
 #include assym.h
 
@@ -72,7 +72,7 @@ ENTRY(cpu_in_cksum)
 	ldr	ip, [ip, #(M_NEXT)]
 .Lin_cksum_skip_entry:
 	subs	r2, r2, r1		/* offset = offset - mbuf length */
-	blt	.Lin_cksum_skip_done	/* if offset has gone negative start with this mbuf */
+	ble	.Lin_cksum_skip_done	/* if offset has gone negative start with this mbuf */
 	cmp	ip, #0x00
 	bne	.Lin_cksum_skip_loop
 	b	.Lin_cksum_whoops
@@ -191,8 +191,7 @@ ASENTRY_NP(arm_cksumdata)
 	RETc(eq)			/* done */
 #endif
 	adds	r7, r7, r1		/* undo sub */
-	adds	r7, r7, r1		/* r7 = offset + len */
-	rsb	r7, r7, #4
+	subs	r7, r7, r1
 	lsls	r7, r7, #3
 #if defined(__ARMEB__)
 	lsrs	r2, r2, r7

Index: src/sys/arch/arm/conf/std.arm
diff -u src/sys/arch/arm/conf/std.arm:1.1.82.1 src/sys/arch/arm/conf/std.arm:1.1.82.2
--- src/sys/arch/arm/conf/std.arm:1.1.82.1	Wed Feb  4 06:36:44 2015
+++ src/sys/arch/arm/conf/std.arm	Mon Feb 16 21:33:13 2015
@@ -1,5 +1,5 @@
-#	$NetBSD: std.arm,v 1.1.82.1 2015/02/04 06:36:44 snj Exp $
+#	$NetBSD: std.arm,v 1.1.82.2 2015/02/16 21:33:13 martin Exp $
 #
 # standard NetBSD/arm options
 
-#options		CPU_IN_CKSUM
+options		CPU_IN_CKSUM



CVS commit: src/distrib/evbarm/instkernel/sshramdisk

2015-02-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Feb 16 21:48:48 UTC 2015

Modified Files:
src/distrib/evbarm/instkernel/sshramdisk: Makefile

Log Message:
Bump size to fix build.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/distrib/evbarm/instkernel/sshramdisk/Makefile

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

Modified files:

Index: src/distrib/evbarm/instkernel/sshramdisk/Makefile
diff -u src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.6 src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.7
--- src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.6	Fri Oct 31 08:43:24 2014
+++ src/distrib/evbarm/instkernel/sshramdisk/Makefile	Mon Feb 16 21:48:48 2015
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.6 2014/10/31 08:43:24 uebayasi Exp $
+#	$NetBSD: Makefile,v 1.7 2015/02/16 21:48:48 skrll Exp $
 
 .include bsd.own.mk
 .include ${NETBSDSRCDIR}/distrib/common/Makefile.distrib
 
 IMAGE=		sshramdisk.fs
-IMAGESIZE=	13m
+IMAGESIZE=	14m
 MAKEFS_FLAGS=	-f 15
 
 WARNS=		1



CVS commit: [netbsd-7] src/doc

2015-02-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 16 21:38:38 UTC 2015

Modified Files:
src/doc [netbsd-7]: CHANGES-7.0

Log Message:
Tickets #519, #520, #522


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.205 -r1.1.2.206 src/doc/CHANGES-7.0

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-7.0
diff -u src/doc/CHANGES-7.0:1.1.2.205 src/doc/CHANGES-7.0:1.1.2.206
--- src/doc/CHANGES-7.0:1.1.2.205	Mon Feb 16 14:09:50 2015
+++ src/doc/CHANGES-7.0	Mon Feb 16 21:38:38 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.205 2015/02/16 14:09:50 martin Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.206 2015/02/16 21:38:38 martin Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -15852,3 +15852,27 @@ usr.sbin/sysinst/arch/i386/md.c			1.4
 	bp.bp_consdev.
 	[snj, ticket #518]
 
+sys/net/bpfjit.c1.39-1.41 (via patch)
+
+	Fix asserts and possible kernel crashes when some malformed or
+	unusual filter program is passed to the kernel.
+	[alnsn, ticket #519]
+
+sys/dev/ic/aic7xxx.c1.132
+sys/dev/ic/an.c	1.62
+sys/dev/sdmmc/sdmmc_mem.c			1.33
+sys/fs/nfs/common/krpc_subr.c			1.2
+sys/fs/udf/udf_subr.c1.128
+sys/modules/lua/lua.c1.16
+sys/ufs/chfs/chfs_scan.c			1.6
+sys/ufs/chfs/ebh.c1.6
+
+	Fix six memory leaks and two inconsistencies.
+	[maxv, ticket #520]
+
+sys/arch/arm/arm/cpu_in_cksum.S			1.9-1.11
+sys/arch/arm/conf/std.arm			1.3
+
+	Fix checksum calculation and re-enable it by default.
+	[skrll, ticket #522]
+



CVS commit: [netbsd-7] src/sys

2015-02-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 16 21:25:35 UTC 2015

Modified Files:
src/sys/dev/ic [netbsd-7]: aic7xxx.c an.c
src/sys/dev/sdmmc [netbsd-7]: sdmmc_mem.c
src/sys/fs/nfs/common [netbsd-7]: krpc_subr.c
src/sys/fs/udf [netbsd-7]: udf_subr.c
src/sys/modules/lua [netbsd-7]: lua.c
src/sys/ufs/chfs [netbsd-7]: chfs_scan.c ebh.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #520):
sys/ufs/chfs/ebh.c: revision 1.6
sys/dev/sdmmc/sdmmc_mem.c: revision 1.33
sys/dev/ic/aic7xxx.c: revision 1.132
sys/fs/nfs/common/krpc_subr.c: revision 1.2
sys/modules/lua/lua.c: revision 1.16
sys/fs/udf/udf_subr.c: revision 1.128
sys/ufs/chfs/chfs_scan.c: revision 1.6
sys/dev/ic/an.c: revision 1.62

Fix six memory leaks and two inconsistencies.


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.131.4.1 src/sys/dev/ic/aic7xxx.c
cvs rdiff -u -r1.61 -r1.61.4.1 src/sys/dev/ic/an.c
cvs rdiff -u -r1.31 -r1.31.4.1 src/sys/dev/sdmmc/sdmmc_mem.c
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.8.1 src/sys/fs/nfs/common/krpc_subr.c
cvs rdiff -u -r1.125 -r1.125.2.1 src/sys/fs/udf/udf_subr.c
cvs rdiff -u -r1.13.2.1 -r1.13.2.2 src/sys/modules/lua/lua.c
cvs rdiff -u -r1.4.12.1 -r1.4.12.2 src/sys/ufs/chfs/chfs_scan.c
cvs rdiff -u -r1.3.14.1 -r1.3.14.2 src/sys/ufs/chfs/ebh.c

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

Modified files:

Index: src/sys/dev/ic/aic7xxx.c
diff -u src/sys/dev/ic/aic7xxx.c:1.131 src/sys/dev/ic/aic7xxx.c:1.131.4.1
--- src/sys/dev/ic/aic7xxx.c:1.131	Thu Mar 27 18:28:26 2014
+++ src/sys/dev/ic/aic7xxx.c	Mon Feb 16 21:25:34 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic7xxx.c,v 1.131 2014/03/27 18:28:26 christos Exp $	*/
+/*	$NetBSD: aic7xxx.c,v 1.131.4.1 2015/02/16 21:25:34 martin Exp $	*/
 
 /*
  * Core routines and tables shareable across OS platforms.
@@ -39,7 +39,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: aic7xxx.c,v 1.131 2014/03/27 18:28:26 christos Exp $
+ * $Id: aic7xxx.c,v 1.131.4.1 2015/02/16 21:25:34 martin Exp $
  *
  * //depot/aic7xxx/aic7xxx/aic7xxx.c#112 $
  *
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: aic7xxx.c,v 1.131 2014/03/27 18:28:26 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: aic7xxx.c,v 1.131.4.1 2015/02/16 21:25:34 martin Exp $);
 
 #include dev/ic/aic7xxx_osm.h
 #include dev/ic/aic7xxx_inline.h
@@ -4372,8 +4372,10 @@ ahc_alloc_scbs(struct ahc_softc *ahc)
 			  AHC_MAXTRANSFER_SIZE, AHC_NSEG, MAXPHYS, 0,
 			  BUS_DMA_WAITOK|BUS_DMA_ALLOCNOW|ahc-sc_dmaflags,
 			  next_scb-dmamap);
-		if (error != 0)
+		if (error != 0) {
+			free(pdata, M_DEVBUF);
 			break;
+		}
 
 		next_scb-hscb = scb_data-hscbs[scb_data-numscbs];
 		next_scb-hscb-tag = ahc-scb_data-numscbs;

Index: src/sys/dev/ic/an.c
diff -u src/sys/dev/ic/an.c:1.61 src/sys/dev/ic/an.c:1.61.4.1
--- src/sys/dev/ic/an.c:1.61	Tue Feb 25 18:30:09 2014
+++ src/sys/dev/ic/an.c	Mon Feb 16 21:25:34 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: an.c,v 1.61 2014/02/25 18:30:09 pooka Exp $	*/
+/*	$NetBSD: an.c,v 1.61.4.1 2015/02/16 21:25:34 martin Exp $	*/
 /*
  * Copyright (c) 1997, 1998, 1999
  *	Bill Paul wp...@ctr.columbia.edu.  All rights reserved.
@@ -77,7 +77,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: an.c,v 1.61 2014/02/25 18:30:09 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: an.c,v 1.61.4.1 2015/02/16 21:25:34 martin Exp $);
 
 
 #include sys/param.h
@@ -569,8 +569,8 @@ an_init(struct ifnet *ifp)
 	if (ic-ic_des_esslen)
 		memcpy(sc-sc_buf.sc_ssidlist.an_entry[0].an_ssid,
 		ic-ic_des_essid, ic-ic_des_esslen);
-	if (an_write_rid(sc, AN_RID_SSIDLIST, sc-sc_buf,
-	sizeof(sc-sc_buf.sc_ssidlist)) != 0) {
+	if ((error = an_write_rid(sc, AN_RID_SSIDLIST, sc-sc_buf,
+	sizeof(sc-sc_buf.sc_ssidlist))) != 0) {
 		printf(%s: failed to write ssid list\n, ifp-if_xname);
 		an_stop(ifp, 1);
 		return error;
@@ -604,8 +604,8 @@ an_init(struct ifnet *ifp)
 		printf(\n);
 	}
 #endif
-	if (an_write_rid(sc, AN_RID_GENCONFIG, sc-sc_config,
-	sizeof(sc-sc_config)) != 0) {
+	if ((error = an_write_rid(sc, AN_RID_GENCONFIG, sc-sc_config,
+	sizeof(sc-sc_config))) != 0) {
 		printf(%s: failed to write config\n, ifp-if_xname);
 		an_stop(ifp, 1);
 		return error;

Index: src/sys/dev/sdmmc/sdmmc_mem.c
diff -u src/sys/dev/sdmmc/sdmmc_mem.c:1.31 src/sys/dev/sdmmc/sdmmc_mem.c:1.31.4.1
--- src/sys/dev/sdmmc/sdmmc_mem.c:1.31	Wed Mar 19 15:26:42 2014
+++ src/sys/dev/sdmmc/sdmmc_mem.c	Mon Feb 16 21:25:34 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdmmc_mem.c,v 1.31 2014/03/19 15:26:42 nonaka Exp $	*/
+/*	$NetBSD: sdmmc_mem.c,v 1.31.4.1 2015/02/16 21:25:34 martin Exp $	*/
 /*	$OpenBSD: sdmmc_mem.c,v 1.10 2009/01/09 10:55:22 jsg Exp $	*/
 
 /*
@@ -45,7 +45,7 @@
 /* Routines for SD/MMC memory cards. */
 
 #include sys/cdefs.h

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

2015-02-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Feb 16 22:50:02 UTC 2015

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

Log Message:
Bump memory disk size to fix build.


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

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/RPI_INSTALL
diff -u src/sys/arch/evbarm/conf/RPI_INSTALL:1.6 src/sys/arch/evbarm/conf/RPI_INSTALL:1.7
--- src/sys/arch/evbarm/conf/RPI_INSTALL:1.6	Fri Oct 31 16:28:56 2014
+++ src/sys/arch/evbarm/conf/RPI_INSTALL	Mon Feb 16 22:50:02 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: RPI_INSTALL,v 1.6 2014/10/31 16:28:56 uebayasi Exp $
+#	$NetBSD: RPI_INSTALL,v 1.7 2015/02/16 22:50:02 skrll Exp $
 #
 #	RPI_INSTALL -- RPI kernel with installation-sized
 #	ramdisk
@@ -8,7 +8,7 @@ include arch/evbarm/conf/RPI
 include arch/evbarm/conf/INSTALL
 
 no options	MEMORY_DISK_ROOT_SIZE
-options 	MEMORY_DISK_ROOT_SIZE=26624
+options 	MEMORY_DISK_ROOT_SIZE=28672
 
 makeoptions	RAMDISKNAME=sshramdisk
 no makeoptions	DEBUG



CVS commit: src/sys/arch/powerpc

2015-02-16 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Tue Feb 17 01:53:21 UTC 2015

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c
src/sys/arch/powerpc/include/booke: etsecreg.h

Log Message:
Added Interrupt coalescing support.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/booke/dev/pq3etsec.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/include/booke/etsecreg.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/powerpc/booke/dev/pq3etsec.c
diff -u src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.24 src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.25
--- src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.24	Fri Jan 23 06:58:32 2015
+++ src/sys/arch/powerpc/booke/dev/pq3etsec.c	Tue Feb 17 01:53:21 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3etsec.c,v 1.24 2015/01/23 06:58:32 nonaka Exp $	*/
+/*	$NetBSD: pq3etsec.c,v 1.25 2015/02/17 01:53:21 nonaka Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -41,7 +41,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pq3etsec.c,v 1.24 2015/01/23 06:58:32 nonaka Exp $);
+__KERNEL_RCSID(0, $NetBSD: pq3etsec.c,v 1.25 2015/02/17 01:53:21 nonaka Exp $);
 
 #include sys/param.h
 #include sys/cpu.h
@@ -55,6 +55,7 @@ __KERNEL_RCSID(0, $NetBSD: pq3etsec.c,v
 #include sys/proc.h
 #include sys/atomic.h
 #include sys/callout.h
+#include sys/sysctl.h
 
 #include net/if.h
 #include net/if_dl.h
@@ -77,7 +78,6 @@ __KERNEL_RCSID(0, $NetBSD: pq3etsec.c,v
 #endif
 #include netinet6/in6_offload.h
 
-
 #include powerpc/spr.h
 #include powerpc/booke/spr.h
 
@@ -232,8 +232,19 @@ struct pq3etsec_softc {
 	struct ifqueue sc_rx_bufcache;
 	struct pq3etsec_mapcache *sc_rx_mapcache; 
 	struct pq3etsec_mapcache *sc_tx_mapcache; 
+
+	/* Interrupt Coalescing parameters */
+	int sc_ic_rx_time;
+	int sc_ic_rx_count;
+	int sc_ic_tx_time;
+	int sc_ic_tx_count;
 };
 
+#define	ETSEC_IC_RX_ENABLED(sc)		\
+	((sc)-sc_ic_rx_time != 0  (sc)-sc_ic_rx_count != 0)
+#define	ETSEC_IC_TX_ENABLED(sc)		\
+	((sc)-sc_ic_tx_time != 0  (sc)-sc_ic_tx_count != 0)
+
 struct pq3mdio_softc {
 	device_t mdio_dev;
 
@@ -294,6 +305,11 @@ static int pq3etsec_tx_intr(void *);
 static int pq3etsec_error_intr(void *);
 static void pq3etsec_soft_intr(void *);
 
+static void pq3etsec_set_ic_rx(struct pq3etsec_softc *);
+static void pq3etsec_set_ic_tx(struct pq3etsec_softc *);
+
+static void pq3etsec_sysctl_setup(struct sysctllog **, struct pq3etsec_softc *);
+
 CFATTACH_DECL_NEW(pq3etsec, sizeof(struct pq3etsec_softc),
 pq3etsec_match, pq3etsec_attach, NULL, NULL);
 
@@ -711,6 +727,15 @@ pq3etsec_attach(device_t parent, device_
 	etsec_write(sc, ATTR, ATTR_DEFAULT);
 	etsec_write(sc, ATTRELI, ATTRELI_DEFAULT);
 
+	/* Enable interrupt coalesing */
+	sc-sc_ic_rx_time = 768;
+	sc-sc_ic_rx_count = 16;
+	sc-sc_ic_tx_time = 768;
+	sc-sc_ic_tx_count = 16;
+	pq3etsec_set_ic_rx(sc);
+	pq3etsec_set_ic_tx(sc);
+	pq3etsec_sysctl_setup(NULL, sc);
+
 	char enaddr[ETHER_ADDR_LEN] = {
 	[0] = sc-sc_macstnaddr2  16,
 	[1] = sc-sc_macstnaddr2  24,
@@ -1874,7 +1899,8 @@ pq3etsec_txq_produce(
 	 * we need to ask for an interrupt to reclaim some.
 	 */
 	txq-txq_lastintr += map-dm_nsegs;
-	if (txq-txq_lastintr = txq-txq_threshold
+	if (ETSEC_IC_TX_ENABLED(sc)
+	|| txq-txq_lastintr = txq-txq_threshold
 	|| txq-txq_mbufs.ifq_len + 1 == txq-txq_mbufs.ifq_maxlen) {
 		txq-txq_lastintr = 0;
 		last_flags |= TXBD_I;
@@ -2529,3 +2555,189 @@ pq3etsec_mii_tick(void *arg)
 #endif
 	mutex_exit(sc-sc_lock);
 }
+
+static void
+pq3etsec_set_ic_rx(struct pq3etsec_softc *sc)
+{
+	uint32_t reg;
+
+	if (ETSEC_IC_RX_ENABLED(sc)) {
+		reg = RXIC_ICEN;
+		reg |= RXIC_ICFT_SET(sc-sc_ic_rx_count);
+		reg |= RXIC_ICTT_SET(sc-sc_ic_rx_time);
+	} else {
+		/* Disable RX interrupt coalescing */
+		reg = 0;
+	}
+
+	etsec_write(sc, RXIC, reg);
+}
+
+static void
+pq3etsec_set_ic_tx(struct pq3etsec_softc *sc)
+{
+	uint32_t reg;
+
+	if (ETSEC_IC_TX_ENABLED(sc)) {
+		reg = TXIC_ICEN;
+		reg |= TXIC_ICFT_SET(sc-sc_ic_tx_count);
+		reg |= TXIC_ICTT_SET(sc-sc_ic_tx_time);
+	} else {
+		/* Disable TX interrupt coalescing */
+		reg = 0;
+	}
+
+	etsec_write(sc, TXIC, reg);
+}
+
+/*
+ * sysctl
+ */
+static int
+pq3etsec_sysctl_ic_time_helper(SYSCTLFN_ARGS, int *valuep)
+{
+	struct sysctlnode node = *rnode;
+	struct pq3etsec_softc *sc = rnode-sysctl_data;
+	int value = *valuep;
+	int error;
+
+	node.sysctl_data = value;
+	error = sysctl_lookup(SYSCTLFN_CALL(node));
+	if (error != 0 || newp == NULL)
+		return error;
+
+	if (value  0 || value  65535)
+		return EINVAL;
+
+	mutex_enter(sc-sc_lock);
+	*valuep = value;
+	if (valuep == sc-sc_ic_rx_time)
+		pq3etsec_set_ic_rx(sc);
+	else
+		pq3etsec_set_ic_tx(sc);
+	mutex_exit(sc-sc_lock);
+
+	return 0;
+}
+
+static int
+pq3etsec_sysctl_ic_count_helper(SYSCTLFN_ARGS, int *valuep)
+{
+	struct sysctlnode node = *rnode;
+	

CVS commit: [netbsd-7] src/sys/arch/amiga/dev

2015-02-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 16 12:48:32 UTC 2015

Modified Files:
src/sys/arch/amiga/dev [netbsd-7]: gayle_pcmcia.c

Log Message:
Pull up following revision(s) (requested by jandberg in ticket #516):
sys/arch/amiga/dev/gayle_pcmcia.c: revision 1.31
Add a delay between the recently added new PCMCIA reset method and
the old reset method to get the card reset work reliably on my
A1200 model and network cards.
Discussed on port-amiga.


To generate a diff of this commit:
cvs rdiff -u -r1.29.4.1 -r1.29.4.2 src/sys/arch/amiga/dev/gayle_pcmcia.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/amiga/dev/gayle_pcmcia.c
diff -u src/sys/arch/amiga/dev/gayle_pcmcia.c:1.29.4.1 src/sys/arch/amiga/dev/gayle_pcmcia.c:1.29.4.2
--- src/sys/arch/amiga/dev/gayle_pcmcia.c:1.29.4.1	Thu Sep 11 12:14:00 2014
+++ src/sys/arch/amiga/dev/gayle_pcmcia.c	Mon Feb 16 12:48:32 2015
@@ -1,9 +1,9 @@
-/*	$NetBSD: gayle_pcmcia.c,v 1.29.4.1 2014/09/11 12:14:00 martin Exp $ */
+/*	$NetBSD: gayle_pcmcia.c,v 1.29.4.2 2015/02/16 12:48:32 martin Exp $ */
 
 /* public domain */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: gayle_pcmcia.c,v 1.29.4.1 2014/09/11 12:14:00 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: gayle_pcmcia.c,v 1.29.4.2 2015/02/16 12:48:32 martin Exp $);
 
 /* PCMCIA front-end driver for A1200's and A600's. */
 
@@ -211,6 +211,8 @@ pccard_attach(device_t parent, device_t 
 		delay(500);
 		gayle_intr_ack(0xfc);
 
+		delay(100*1000);
+
 		*reset_card_reg = 0x0;
 		delay(1000);
 		x = *reset_card_reg;



CVS commit: src/sys/dev/pci

2015-02-16 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Mon Feb 16 13:16:00 UTC 2015

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

Log Message:
Fix compile failure with clang.
Pointed out by Herbert J. Skuhra.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/if_iwm.c

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

Modified files:

Index: src/sys/dev/pci/if_iwm.c
diff -u src/sys/dev/pci/if_iwm.c:1.6 src/sys/dev/pci/if_iwm.c:1.7
--- src/sys/dev/pci/if_iwm.c:1.6	Sat Feb 14 05:00:23 2015
+++ src/sys/dev/pci/if_iwm.c	Mon Feb 16 13:16:00 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwm.c,v 1.6 2015/02/14 05:00:23 nonaka Exp $	*/
+/*	$NetBSD: if_iwm.c,v 1.7 2015/02/16 13:16:00 nonaka Exp $	*/
 /*	OpenBSD: if_iwm.c,v 1.18 2015/02/11 01:12:42 brad Exp	*/
 
 /*
@@ -105,7 +105,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_iwm.c,v 1.6 2015/02/14 05:00:23 nonaka Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_iwm.c,v 1.7 2015/02/16 13:16:00 nonaka Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -1800,6 +1800,7 @@ iwm_nic_init(struct iwm_softc *sc)
 return 0;
 }
 
+#if 0
 enum iwm_mvm_tx_fifo {
 	IWM_MVM_TX_FIFO_BK = 0,
 	IWM_MVM_TX_FIFO_BE,
@@ -1814,6 +1815,7 @@ static const uint8_t iwm_mvm_ac_to_tx_fi
 IWM_MVM_TX_FIFO_BE,
 IWM_MVM_TX_FIFO_BK,
 };
+#endif
 
 static void
 iwm_enable_txq(struct iwm_softc *sc, int qid, int fifo)



CVS commit: [netbsd-7] xsrc/external/mit/glu/dist/src/libtess

2015-02-16 Thread Martin Husemann
Module Name:xsrc
Committed By:   martin
Date:   Mon Feb 16 13:30:46 UTC 2015

Modified Files:
xsrc/external/mit/glu/dist/src/libtess [netbsd-7]: sweep.c

Log Message:
Pull up following revision(s) (requested by snj in ticket #517):
external/mit/glu/dist/src/libtess/sweep.c: revision 1.2
Fixes segfaults and crashing in applications that use libGLU.
This commit was approved by wiz@


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1.2.2 -r1.1.1.1.2.3 \
xsrc/external/mit/glu/dist/src/libtess/sweep.c

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

Modified files:

Index: xsrc/external/mit/glu/dist/src/libtess/sweep.c
diff -u xsrc/external/mit/glu/dist/src/libtess/sweep.c:1.1.1.1.2.2 xsrc/external/mit/glu/dist/src/libtess/sweep.c:1.1.1.1.2.3
--- xsrc/external/mit/glu/dist/src/libtess/sweep.c:1.1.1.1.2.2	Tue Dec 23 02:55:00 2014
+++ xsrc/external/mit/glu/dist/src/libtess/sweep.c	Mon Feb 16 13:30:46 2015
@@ -546,7 +546,9 @@ static int CheckForRightSplice( GLUtesse
 if( EdgeSign( eUp-Dst, eLo-Org, eUp-Org )  0 ) return FALSE;
 
 /* eLo-Org appears to be above eUp, so splice eLo-Org into eUp */
-RegionAbove(regUp)-dirty = regUp-dirty = TRUE;
+if (RegionAbove(regUp))
+RegionAbove(regUp)-dirty = TRUE;
+regUp-dirty = TRUE;
 if (__gl_meshSplitEdge( eUp-Sym ) == NULL) longjmp(tess-env,1);
 if ( !__gl_meshSplice( eLo-Oprev, eUp ) ) longjmp(tess-env,1);
   }
@@ -584,7 +586,9 @@ static int CheckForLeftSplice( GLUtessel
 if( EdgeSign( eUp-Dst, eLo-Dst, eUp-Org )  0 ) return FALSE;
 
 /* eLo-Dst is above eUp, so splice eLo-Dst into eUp */
-RegionAbove(regUp)-dirty = regUp-dirty = TRUE;
+if (RegionAbove(regUp))
+RegionAbove(regUp)-dirty = TRUE;
+regUp-dirty = TRUE;
 e = __gl_meshSplitEdge( eUp );
 if (e == NULL) longjmp(tess-env,1);
 if ( !__gl_meshSplice( eLo-Sym, e ) ) longjmp(tess-env,1);
@@ -718,7 +722,9 @@ static int CheckForIntersect( GLUtessela
  * (and wait for ConnectRightVertex to splice it appropriately).
  */
 if( EdgeSign( dstUp, tess-event, isect ) = 0 ) {
-  RegionAbove(regUp)-dirty = regUp-dirty = TRUE;
+  if (RegionAbove(regUp))
+  RegionAbove(regUp)-dirty = TRUE;
+  regUp-dirty = TRUE;
   if (__gl_meshSplitEdge( eUp-Sym ) == NULL) longjmp(tess-env,1);
   eUp-Org-s = tess-event-s;
   eUp-Org-t = tess-event-t;
@@ -753,7 +759,9 @@ static int CheckForIntersect( GLUtessela
  longjmp(tess-env,1);
   }
   GetIntersectData( tess, eUp-Org, orgUp, dstUp, orgLo, dstLo );
-  RegionAbove(regUp)-dirty = regUp-dirty = regLo-dirty = TRUE;
+  if (RegionAbove(regUp))
+  RegionAbove(regUp)-dirty = TRUE;
+  regUp-dirty = regLo-dirty = TRUE;
   return FALSE;
 }
 



CVS commit: src/sys/external/bsd/sljit/dist/test_src

2015-02-16 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Mon Feb 16 13:30:15 UTC 2015

Modified Files:
src/sys/external/bsd/sljit/dist/test_src: sljitTest.c

Log Message:
Backport a new testcase from r282 (registers are renamed in the new version).
http://sourceforge.net/p/sljit/code/282/.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/sljit/dist/test_src/sljitTest.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/sljit/dist/test_src/sljitTest.c
diff -u src/sys/external/bsd/sljit/dist/test_src/sljitTest.c:1.4 src/sys/external/bsd/sljit/dist/test_src/sljitTest.c:1.5
--- src/sys/external/bsd/sljit/dist/test_src/sljitTest.c:1.4	Tue Jun 17 19:37:03 2014
+++ src/sys/external/bsd/sljit/dist/test_src/sljitTest.c	Mon Feb 16 13:30:15 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sljitTest.c,v 1.4 2014/06/17 19:37:03 alnsn Exp $	*/
+/*	$NetBSD: sljitTest.c,v 1.5 2015/02/16 13:30:15 alnsn Exp $	*/
 
 /*
  *Stack-less Just-In-Time compiler
@@ -733,7 +733,7 @@ static void test10(void)
 	/* Test multiplications. */
 	executable_code code;
 	struct sljit_compiler* compiler = sljit_create_compiler();
-	sljit_sw buf[6];
+	sljit_sw buf[7];
 
 	if (verbose)
 		printf(Run test10\n);
@@ -745,6 +745,7 @@ static void test10(void)
 	buf[3] = 6;
 	buf[4] = -10;
 	buf[5] = 0;
+	buf[6] = 0;
 
 	sljit_emit_enter(compiler, 1, 3, 1, 0);
 
@@ -764,6 +765,11 @@ static void test10(void)
 	sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_SCRATCH_REG1, 0, SLJIT_IMM, 9);
 	sljit_emit_op2(compiler, SLJIT_MUL, SLJIT_SCRATCH_REG1, 0, SLJIT_SCRATCH_REG1, 0, SLJIT_SCRATCH_REG1, 0);
 	sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_MEM1(SLJIT_SAVED_REG1), sizeof(sljit_sw) * 5, SLJIT_SCRATCH_REG1, 0);
+#if (defined SLJIT_64BIT_ARCHITECTURE  SLJIT_64BIT_ARCHITECTURE)
+	sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_SCRATCH_REG2, 0, SLJIT_IMM, 3);
+	sljit_emit_op2(compiler, SLJIT_MUL, SLJIT_SCRATCH_REG1, 0, SLJIT_SCRATCH_REG2, 0, SLJIT_IMM, SLJIT_W(0x123456789));
+	sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_MEM1(SLJIT_SAVED_REG1), sizeof(sljit_sw) * 6, SLJIT_SCRATCH_REG1, 0);
+#endif
 	sljit_emit_op2(compiler, SLJIT_MUL, SLJIT_RETURN_REG, 0, SLJIT_IMM, 11, SLJIT_IMM, 10);
 	sljit_emit_return(compiler, SLJIT_MOV, SLJIT_RETURN_REG, 0);
 
@@ -778,6 +784,9 @@ static void test10(void)
 	FAILED(buf[3] != -12, test10 case 5 failed\n);
 	FAILED(buf[4] != 100, test10 case 6 failed\n);
 	FAILED(buf[5] != 81, test10 case 7 failed\n);
+#if (defined SLJIT_64BIT_ARCHITECTURE  SLJIT_64BIT_ARCHITECTURE)
+	FAILED(buf[6] != SLJIT_W(0x123456789) * 3, test10 case 8 failed\n);
+#endif
 
 	sljit_free_code(code.code);
 	successful_tests++;



CVS commit: src/sys/arch/mips/mips

2015-02-16 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Mon Feb 16 14:10:00 UTC 2015

Modified Files:
src/sys/arch/mips/mips: bus_dma.c

Log Message:
mmap() DMA buffers uncached if we know how.
From sgimips, needed for X on O2.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/mips/mips/bus_dma.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/mips/mips/bus_dma.c
diff -u src/sys/arch/mips/mips/bus_dma.c:1.32 src/sys/arch/mips/mips/bus_dma.c:1.33
--- src/sys/arch/mips/mips/bus_dma.c:1.32	Fri Feb 13 17:19:23 2015
+++ src/sys/arch/mips/mips/bus_dma.c	Mon Feb 16 14:10:00 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.32 2015/02/13 17:19:23 skrll Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.33 2015/02/16 14:10:00 macallan Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.32 2015/02/13 17:19:23 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.33 2015/02/16 14:10:00 macallan Exp $);
 
 #define _MIPS_BUS_DMA_PRIVATE
 
@@ -1162,7 +1162,16 @@ _bus_dmamem_mmap(bus_dma_tag_t t, bus_dm
 
 		pa = (paddr_t)segs[i].ds_addr + off;
 
+/*
+ * This is for machines which use normal RAM as video memory, so userland can
+ * mmap() it and treat it like device memory, which is normally uncached.
+ * Needed for X11 on SGI O2, will likely be needed on things like CI20.
+ */
+#if defined(_MIPS_PADDR_T_64BIT) || defined(_LP64)
+		return (mips_btop(pa | PGC_NOCACHE));
+#else
 		return mips_btop(pa);
+#endif
 	}
 
 	/* Page not found. */



CVS commit: [netbsd-7] src/doc

2015-02-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 16 14:09:50 UTC 2015

Modified Files:
src/doc [netbsd-7]: CHANGES-7.0

Log Message:
Tickets #515 - #518


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.204 -r1.1.2.205 src/doc/CHANGES-7.0

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-7.0
diff -u src/doc/CHANGES-7.0:1.1.2.204 src/doc/CHANGES-7.0:1.1.2.205
--- src/doc/CHANGES-7.0:1.1.2.204	Sat Feb 14 08:15:50 2015
+++ src/doc/CHANGES-7.0	Mon Feb 16 14:09:50 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.204 2015/02/14 08:15:50 snj Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.205 2015/02/16 14:09:50 martin Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -15828,3 +15828,27 @@ external/mit/MesaLib/dist/src/mapi/entry
 	Disable broken 32 bit x86 asm code.
 	[mrg, ticket #514]
 
+sys/arch/mips/mips/bus_dma.c			1.32
+
+	Deal with 64-bit fallout from previous.
+	[skrll, ticket #515]
+
+sys/arch/amiga/dev/gayle_pcmcia.c		1.31
+
+	Add a delay between the recently added new PCMCIA reset method and
+	the old reset method to get card reset work reliably on A1200
+	and network cards.
+	[jandberg, ticket #516]
+
+xsrc/external/mit/glu/dist/src/libtess/sweep.c	1.2
+
+	Fixes segfaults and crashing in applications that use libGLU.
+	[snj, ticket #517]
+
+usr.sbin/sysinst/arch/i386/md.c			1.4
+
+	When checking if the user chose to use the existing bootblocks, use
+	the appropriate variable, boottype.bp_consdev, not the uninitialized
+	bp.bp_consdev.
+	[snj, ticket #518]
+



CVS commit: src/sys/external/bsd/drm2/radeon

2015-02-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Feb 16 12:17:57 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/radeon: radeon_pci.c

Log Message:
fix the previous.  bus_space_map() returns *zero* on success.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/radeon/radeon_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/external/bsd/drm2/radeon/radeon_pci.c
diff -u src/sys/external/bsd/drm2/radeon/radeon_pci.c:1.5 src/sys/external/bsd/drm2/radeon/radeon_pci.c:1.6
--- src/sys/external/bsd/drm2/radeon/radeon_pci.c:1.5	Sat Feb 14 06:58:12 2015
+++ src/sys/external/bsd/drm2/radeon/radeon_pci.c	Mon Feb 16 12:17:57 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_pci.c,v 1.5 2015/02/14 06:58:12 mrg Exp $	*/
+/*	$NetBSD: radeon_pci.c,v 1.6 2015/02/16 12:17:57 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: radeon_pci.c,v 1.5 2015/02/14 06:58:12 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: radeon_pci.c,v 1.6 2015/02/16 12:17:57 mrg Exp $);
 
 #ifdef _KERNEL_OPT
 #include vga.h
@@ -178,8 +178,12 @@ radeon_attach(device_t parent, device_t 
 	 * think they can.  This stops vga@isa or pcdisplay@isa
 	 * attaching, and stealing wsdisplay0.  Yuck.
 	 */
-	sc-sc_temp_set = bus_space_map(pa-pa_memt, 0xb, 0x1, 0,
-	sc-sc_temp_memh);
+	int rv = bus_space_map(pa-pa_memt, 0xb, 0x1, 0,
+			   sc-sc_temp_memh);
+	sc-sc_temp_set = rv == 0;
+	if (rv != 0)
+		aprint_error_dev(self, unable to reserve VGA registers for 
+   i386 radeondrmkms hack\n);
 #endif
 
 	config_mountroot(self, radeon_attach_real);



CVS commit: src/sys/external/bsd/sljit/dist/sljit_src

2015-02-16 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Mon Feb 16 13:33:24 UTC 2015

Modified Files:
src/sys/external/bsd/sljit/dist/sljit_src: sljitNativeX86_common.c

Log Message:
Apply a bugfix from r282 http://sourceforge.net/p/sljit/code/282/.

The bug was originally reported by me in a newer upstream version.
American fuzzy lop rediscovered it for the version of sljit in the
NetBSD tree.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeX86_common.c

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

Modified files:

Index: src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeX86_common.c
diff -u src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeX86_common.c:1.6 src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeX86_common.c:1.7
--- src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeX86_common.c:1.6	Tue Jun 17 19:33:20 2014
+++ src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeX86_common.c	Mon Feb 16 13:33:24 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sljitNativeX86_common.c,v 1.6 2014/06/17 19:33:20 alnsn Exp $	*/
+/*	$NetBSD: sljitNativeX86_common.c,v 1.7 2015/02/16 13:33:24 alnsn Exp $	*/
 
 /*
  *Stack-less Just-In-Time compiler
@@ -1749,7 +1749,7 @@ static sljit_si emit_mul(struct sljit_co
 			*(sljit_si*)inst = (sljit_si)src2w;
 		}
 		else {
-			EMIT_MOV(compiler, TMP_REG2, 0, SLJIT_IMM, src1w);
+			EMIT_MOV(compiler, TMP_REG2, 0, SLJIT_IMM, src2w);
 			if (dst_r != src1)
 EMIT_MOV(compiler, dst_r, 0, src1, src1w);
 			inst = emit_x86_instruction(compiler, 2, dst_r, 0, TMP_REG2, 0);



CVS commit: src/sys/dev/pci

2015-02-16 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Mon Feb 16 13:22:19 UTC 2015

Modified Files:
src/sys/dev/pci: if_iwm.c if_iwmreg.h if_iwmvar.h

Log Message:
whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/if_iwm.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/if_iwmreg.h
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/if_iwmvar.h

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

Modified files:

Index: src/sys/dev/pci/if_iwm.c
diff -u src/sys/dev/pci/if_iwm.c:1.7 src/sys/dev/pci/if_iwm.c:1.8
--- src/sys/dev/pci/if_iwm.c:1.7	Mon Feb 16 13:16:00 2015
+++ src/sys/dev/pci/if_iwm.c	Mon Feb 16 13:22:19 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwm.c,v 1.7 2015/02/16 13:16:00 nonaka Exp $	*/
+/*	$NetBSD: if_iwm.c,v 1.8 2015/02/16 13:22:19 nonaka Exp $	*/
 /*	OpenBSD: if_iwm.c,v 1.18 2015/02/11 01:12:42 brad Exp	*/
 
 /*
@@ -105,7 +105,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_iwm.c,v 1.7 2015/02/16 13:16:00 nonaka Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_iwm.c,v 1.8 2015/02/16 13:22:19 nonaka Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -222,7 +222,7 @@ static int	iwm_poll_bit(struct iwm_softc
 static int	iwm_nic_lock(struct iwm_softc *);
 static void	iwm_nic_unlock(struct iwm_softc *);
 static void	iwm_set_bits_mask_prph(struct iwm_softc *, uint32_t, uint32_t,
-		uint32_t); 
+		uint32_t);
 static void	iwm_set_bits_prph(struct iwm_softc *, uint32_t, uint32_t);
 static void	iwm_clear_bits_prph(struct iwm_softc *, uint32_t, uint32_t);
 static int	iwm_dma_contig_alloc(bus_dma_tag_t, struct iwm_dma_info *,
@@ -614,8 +614,8 @@ static int
 iwm_read_firmware(struct iwm_softc *sc)
 {
 	struct iwm_fw_info *fw = sc-sc_fw;
-struct iwm_tlv_ucode_header *uhdr;
-struct iwm_ucode_tlv tlv;
+	struct iwm_tlv_ucode_header *uhdr;
+	struct iwm_ucode_tlv tlv;
 	enum iwm_ucode_tlv_type tlv_type;
 	uint8_t *data;
 	int error, status;
@@ -1296,7 +1296,7 @@ iwm_check_rfkill(struct iwm_softc *sc)
 	uint32_t v;
 	int s;
 	int rv;
-	
+
 	s = splnet();
 
 	/*
@@ -1376,7 +1376,7 @@ iwm_set_hw_ready(struct iwm_softc *sc)
 	IWM_SETBITS(sc, IWM_CSR_HW_IF_CONFIG_REG,
 	IWM_CSR_HW_IF_CONFIG_REG_BIT_NIC_READY);
 
-return iwm_poll_bit(sc, IWM_CSR_HW_IF_CONFIG_REG,
+	return iwm_poll_bit(sc, IWM_CSR_HW_IF_CONFIG_REG,
 	IWM_CSR_HW_IF_CONFIG_REG_BIT_NIC_READY,
 	IWM_CSR_HW_IF_CONFIG_REG_BIT_NIC_READY,
 	IWM_HW_READY_TIMEOUT);
@@ -1556,7 +1556,7 @@ iwm_start_hw(struct iwm_softc *sc)
 	if ((error = iwm_prepare_card_hw(sc)) != 0)
 		return error;
 
-/* Reset the entire device */
+	/* Reset the entire device */
 	IWM_WRITE(sc, IWM_CSR_RESET,
 	IWM_CSR_RESET_REG_FLAG_SW_RESET |
 	IWM_CSR_RESET_REG_FLAG_NEVO_RESET);
@@ -1627,9 +1627,9 @@ iwm_stop_device(struct iwm_softc *sc)
 	/* Stop the device, and put it in low power state */
 	iwm_apm_stop(sc);
 
-/* Upon stop, the APM issues an interrupt if HW RF kill is set.
- * Clean again the interrupt here
- */
+	/* Upon stop, the APM issues an interrupt if HW RF kill is set.
+	 * Clean again the interrupt here
+	 */
 	iwm_disable_interrupts(sc);
 	/* stop and reset the on-board processor */
 	IWM_WRITE(sc, IWM_CSR_RESET, IWM_CSR_RESET_REG_FLAG_NEVO_RESET);
@@ -1677,8 +1677,8 @@ iwm_mvm_nic_config(struct iwm_softc *sc)
 
 	IWM_WRITE(sc, IWM_CSR_HW_IF_CONFIG_REG, reg_val);
 
-DPRINTF((Radio type=0x%x-0x%x-0x%x\n, radio_cfg_type,
-   radio_cfg_step, radio_cfg_dash));
+	DPRINTF((Radio type=0x%x-0x%x-0x%x\n, radio_cfg_type,
+	radio_cfg_step, radio_cfg_dash));
 
 	/*
 	 * W/A : NIC is stuck in a reset state after Early PCIe power off
@@ -1797,7 +1797,7 @@ iwm_nic_init(struct iwm_softc *sc)
 	DPRINTF((shadow registers enabled\n));
 	IWM_SETBITS(sc, IWM_CSR_MAC_SHADOW_REG_CTRL, 0x800f);
 
-return 0;
+	return 0;
 }
 
 #if 0
@@ -1810,10 +1810,10 @@ enum iwm_mvm_tx_fifo {
 };
 
 static const uint8_t iwm_mvm_ac_to_tx_fifo[] = {
-IWM_MVM_TX_FIFO_VO,
-IWM_MVM_TX_FIFO_VI,
-IWM_MVM_TX_FIFO_BE,
-IWM_MVM_TX_FIFO_BK,
+	IWM_MVM_TX_FIFO_VO,
+	IWM_MVM_TX_FIFO_VI,
+	IWM_MVM_TX_FIFO_BE,
+	IWM_MVM_TX_FIFO_BK,
 };
 #endif
 
@@ -1907,7 +1907,7 @@ iwm_post_alive(struct iwm_softc *sc)
 	IWM_SETBITS(sc, IWM_FH_TX_CHICKEN_BITS_REG,
 	IWM_FH_TX_CHICKEN_BITS_SCD_AUTO_RETRY_EN);
 
-/* Enable L1-Active */
+	/* Enable L1-Active */
 	iwm_clear_bits_prph(sc, IWM_APMG_PCIDEV_STT_REG,
 	IWM_APMG_PCIDEV_STT_VAL_L1_ACT_DIS);
 
@@ -2665,8 +2665,8 @@ iwm_parse_nvm_data(struct iwm_softc *sc,
  */
 
 struct iwm_nvm_section {
-uint16_t length;
-const uint8_t *data;
+	uint16_t length;
+	const uint8_t *data;
 };
 
 #define IWM_FW_VALID_TX_ANT(sc) \
@@ -2757,7 +2757,7 @@ iwm_firmware_load_chunk(struct iwm_softc
 	IWM_WRITE(sc, IWM_FH_TFDIB_CTRL0_REG(IWM_FH_SRVC_CHNL),
 	dma-paddr  IWM_FH_MEM_TFDIB_DRAM_ADDR_LSB_MSK);
 	IWM_WRITE(sc, 

CVS commit: [netbsd-7] src/usr.sbin/sysinst/arch/i386

2015-02-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 16 13:52:43 UTC 2015

Modified Files:
src/usr.sbin/sysinst/arch/i386 [netbsd-7]: md.c

Log Message:
Pull up following revision(s) (requested by snj in ticket #518):
usr.sbin/sysinst/arch/i386/md.c: revision 1.4
When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev.  Also remove bp and bootxx since their only use was in
the incorrect check.  This should fix the problem of sysinst segfaulting
when you choose Use existing bootblocks on amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.3.2.1 -r1.3.2.2 src/usr.sbin/sysinst/arch/i386/md.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/sysinst/arch/i386/md.c
diff -u src/usr.sbin/sysinst/arch/i386/md.c:1.3.2.1 src/usr.sbin/sysinst/arch/i386/md.c:1.3.2.2
--- src/usr.sbin/sysinst/arch/i386/md.c:1.3.2.1	Sun Jan 11 04:32:38 2015
+++ src/usr.sbin/sysinst/arch/i386/md.c	Mon Feb 16 13:52:43 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.3.2.1 2015/01/11 04:32:38 snj Exp $ */
+/*	$NetBSD: md.c,v 1.3.2.2 2015/02/16 13:52:43 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -298,7 +298,6 @@ md_post_newfs(void)
 {
 	int ret;
 	size_t len;
-	char bootxx[8192 + 4];
 	char boot_options[1024];
 	char *bootxx_filename;
 	/*
@@ -321,7 +320,6 @@ md_post_newfs(void)
 	static int conmib[] = {CTL_MACHDEP, CPU_CONSDEV};
 	struct termios t;
 	dev_t condev;
-#define bp (*(struct x86_boot_params *)(bootxx + 512 * 2 + 8))
 
 	/*
 	 * Get console device, should either be ttyE0 or tty0n.
@@ -339,7 +337,8 @@ md_post_newfs(void)
 
 	process_menu(MENU_getboottype, boottype);
 	msg_display(MSG_dobootblks, pm-diskdev);
-	if (bp.bp_consdev == ~0u)
+	if (boottype.bp_consdev == ~0u)
+		/* Use existing bootblocks */
 		return 0;
 
 	ret = cp_to_target(/usr/mdec/boot, /boot);



CVS commit: [netbsd-7] src/sys/arch/mips/mips

2015-02-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 16 10:42:26 UTC 2015

Modified Files:
src/sys/arch/mips/mips [netbsd-7]: bus_dma.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #515):
sys/arch/mips/mips/bus_dma.c: revision 1.32
Deal with 64-bit fallout from previous.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.31.2.1 src/sys/arch/mips/mips/bus_dma.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/mips/mips/bus_dma.c
diff -u src/sys/arch/mips/mips/bus_dma.c:1.31 src/sys/arch/mips/mips/bus_dma.c:1.31.2.1
--- src/sys/arch/mips/mips/bus_dma.c:1.31	Tue May 27 15:56:18 2014
+++ src/sys/arch/mips/mips/bus_dma.c	Mon Feb 16 10:42:26 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.31 2014/05/27 15:56:18 skrll Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.31.2.1 2015/02/16 10:42:26 martin Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.31 2014/05/27 15:56:18 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.31.2.1 2015/02/16 10:42:26 martin Exp $);
 
 #define _MIPS_BUS_DMA_PRIVATE
 
@@ -861,11 +861,11 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 			vaddr_t start = vaddr;
 			vaddr_t end = vaddr + minlen;
 			vaddr_t preboundary, firstboundary, lastboundary;
+			vaddr_t mask = mci-mci_dcache_align_mask;
 
-			preboundary = start  ~mci-mci_dcache_align_mask;
-			firstboundary = (start + mci-mci_dcache_align_mask)
-			 ~mci-mci_dcache_align_mask;
-			lastboundary = end  ~mci-mci_dcache_align_mask;
+			preboundary = start  ~mask;
+			firstboundary = (start + mask)  ~mask;
+			lastboundary = end  ~mask;
 			if (preboundary  start  preboundary  lastboundary)
 mips_dcache_wbinv_range(preboundary,
 mci-mci_dcache_align);



CVS commit: src/lib/libpuffs

2015-02-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Feb 16 10:48:50 UTC 2015

Modified Files:
src/lib/libpuffs: puffs_framebuf.3

Log Message:
Sort sections.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libpuffs/puffs_framebuf.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/libpuffs/puffs_framebuf.3
diff -u src/lib/libpuffs/puffs_framebuf.3:1.29 src/lib/libpuffs/puffs_framebuf.3:1.30
--- src/lib/libpuffs/puffs_framebuf.3:1.29	Thu Apr  1 09:57:00 2010
+++ src/lib/libpuffs/puffs_framebuf.3	Mon Feb 16 10:48:50 2015
@@ -1,4 +1,4 @@
-.\	$NetBSD: puffs_framebuf.3,v 1.29 2010/04/01 09:57:00 pooka Exp $
+.\	$NetBSD: puffs_framebuf.3,v 1.30 2015/02/16 10:48:50 wiz Exp $
 .\
 .\ Copyright (c) 2007 Antti Kantee.  All rights reserved.
 .\
@@ -584,6 +584,10 @@ It is useful for file systems such as
 .Xr mount_psshfs 8
 which depend on a single connection.
 .El
+.Sh RETURN VALUES
+These functions generally return \-1 to signal error and set
+.Er errno
+to indicate the type of error.
 .Sh CODE REFERENCES
 The current users of
 .Nm
@@ -596,10 +600,6 @@ See
 and
 .Pa src/usr.sbin/puffs/mount_9p
 for the respective usage examples.
-.Sh RETURN VALUES
-These functions generally return \-1 to signal error and set
-.Er errno
-to indicate the type of error.
 .Sh SEE ALSO
 .Xr puffs 3 ,
 .Xr puffs_cc 3 ,



CVS commit: src/lib/libpuffs

2015-02-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Feb 16 10:48:34 UTC 2015

Modified Files:
src/lib/libpuffs: puffs.3

Log Message:
Bump date for previous.
filesystem - file system


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/lib/libpuffs/puffs.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/libpuffs/puffs.3
diff -u src/lib/libpuffs/puffs.3:1.60 src/lib/libpuffs/puffs.3:1.61
--- src/lib/libpuffs/puffs.3:1.60	Sun Feb 15 20:21:29 2015
+++ src/lib/libpuffs/puffs.3	Mon Feb 16 10:48:34 2015
@@ -1,4 +1,4 @@
-.\	$NetBSD: puffs.3,v 1.60 2015/02/15 20:21:29 manu Exp $
+.\	$NetBSD: puffs.3,v 1.61 2015/02/16 10:48:34 wiz Exp $
 .\
 .\ Copyright (c) 2006, 2007, 2008 Antti Kantee.  All rights reserved.
 .\
@@ -23,7 +23,7 @@
 .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\ SUCH DAMAGE.
 .\
-.Dd August 16, 2012
+.Dd February 15, 2015
 .Dt PUFFS 3
 .Os
 .Sh NAME
@@ -261,10 +261,10 @@ and
 .It Dv PUFFS_KFLAG_CACHE_DOTDOT
 Never send lookups for
 .Dq ..
-to the filesystem.
+to the file system.
 Parent vnodes are all kept active until their children are reclaimed.
 .It Dv PUFFS_KFLAG_NOFLUSH_META
-Do not send metadata cache flushes for time and size to the filesystem,
+Do not send metadata cache flushes for time and size to the file system,
 which should take care of updating the values on its own.
 .It Dv PUFFS_FLAG_OPDUMP
 This option makes the framework dump a textual representation of



CVS commit: src/sys/fs/puffs

2015-02-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 16 10:49:39 UTC 2015

Modified Files:
src/sys/fs/puffs: puffs_vfsops.c

Log Message:
Remove debug printf


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/sys/fs/puffs/puffs_vfsops.c

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

Modified files:

Index: src/sys/fs/puffs/puffs_vfsops.c
diff -u src/sys/fs/puffs/puffs_vfsops.c:1.116 src/sys/fs/puffs/puffs_vfsops.c:1.117
--- src/sys/fs/puffs/puffs_vfsops.c:1.116	Sun Feb 15 20:21:29 2015
+++ src/sys/fs/puffs/puffs_vfsops.c	Mon Feb 16 10:49:39 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_vfsops.c,v 1.116 2015/02/15 20:21:29 manu Exp $	*/
+/*	$NetBSD: puffs_vfsops.c,v 1.117 2015/02/16 10:49:39 martin Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: puffs_vfsops.c,v 1.116 2015/02/15 20:21:29 manu Exp $);
+__KERNEL_RCSID(0, $NetBSD: puffs_vfsops.c,v 1.117 2015/02/16 10:49:39 martin Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -124,7 +124,6 @@ puffs_vfsop_mount(struct mount *mp, cons
 		goto out;
 	}
 
-printf(args-pa_flags = 0x%x\n, args-pa_flags);
 	if ((args-pa_flags  ~PUFFS_KFLAG_MASK) != 0) {
 		printf(puffs_mount: invalid KFLAGs 0x%x\n, args-pa_flags);
 		error = EINVAL;



CVS commit: src/lib/libpuffs

2015-02-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Feb 16 10:48:57 UTC 2015

Modified Files:
src/lib/libpuffs: puffs_ops.3

Log Message:
filesystem - file system


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/lib/libpuffs/puffs_ops.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/libpuffs/puffs_ops.3
diff -u src/lib/libpuffs/puffs_ops.3:1.41 src/lib/libpuffs/puffs_ops.3:1.42
--- src/lib/libpuffs/puffs_ops.3:1.41	Fri Oct 31 14:01:16 2014
+++ src/lib/libpuffs/puffs_ops.3	Mon Feb 16 10:48:56 2015
@@ -1,4 +1,4 @@
-.\	$NetBSD: puffs_ops.3,v 1.41 2014/10/31 14:01:16 wiz Exp $
+.\	$NetBSD: puffs_ops.3,v 1.42 2015/02/16 10:48:56 wiz Exp $
 .\
 .\ Copyright (c) 2007 Antti Kantee.  All rights reserved.
 .\
@@ -508,7 +508,7 @@ was called with, e.g.
 and
 .Dv O_NONBLOCK .
 .Fn puffs_node_open2
-allows the filesystem to pass back information for the file in
+allows the file system to pass back information for the file in
 .Fa oflags .
 The only implemented flag for now is
 .Dv PUFFS_OPEN_IO_DIRECT
@@ -838,13 +838,13 @@ Same as
 .Fn puffs_node_reclaim
 with an addditional argument for the number of lookups that have been done
 on the node (Node creation is counted as a lookup). This can be used by the
-filesystem to avoid a race condition, where the kernel sends a reclaim
+file system to avoid a race condition, where the kernel sends a reclaim
 while it does not have received the reply for a lookup.
-If the filesystem tracks lookup count, and compares to
+If the file system tracks lookup count, and compares to
 .Fa nlookup
 it can detect this situation and ignore the reclaim.
 .Pp
-If the filesystem maps cookies to
+If the file system maps cookies to
 .Vt struct puffs_node
 then the framework will do that work, and
 .Fn puffs_node_reclaim



CVS commit: [netbsd-6] src/sys/dev/pci

2015-02-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 16 08:32:33 UTC 2015

Modified Files:
src/sys/dev/pci [netbsd-6]: if_bge.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1256):
sys/dev/pci/if_bge.c: revision 1.278
Fix three bugs reported by enami@:
  - bge_miibus_writereg(): Fix a bug that BCM5906 may leave an APE lock.
  - Fix hwcfg4 isn't printed correctly.
  - Fix a bug that BGE_PHY_TEST_CTRL_REG isn't set correctly on some PCIe 
devices.


To generate a diff of this commit:
cvs rdiff -u -r1.200.2.4 -r1.200.2.5 src/sys/dev/pci/if_bge.c

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

Modified files:

Index: src/sys/dev/pci/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.200.2.4 src/sys/dev/pci/if_bge.c:1.200.2.5
--- src/sys/dev/pci/if_bge.c:1.200.2.4	Sun Dec  7 16:39:55 2014
+++ src/sys/dev/pci/if_bge.c	Mon Feb 16 08:32:33 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.200.2.4 2014/12/07 16:39:55 martin Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.200.2.5 2015/02/16 08:32:33 martin Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_bge.c,v 1.200.2.4 2014/12/07 16:39:55 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_bge.c,v 1.200.2.5 2015/02/16 08:32:33 martin Exp $);
 
 #include vlan.h
 
@@ -1399,13 +1399,13 @@ bge_miibus_writereg(device_t dev, int ph
 	uint32_t autopoll;
 	int i;
 
-	if (bge_ape_lock(sc, sc-bge_phy_ape_lock) != 0)
-		return;
-
 	if (BGE_ASICREV(sc-bge_chipid) == BGE_ASICREV_BCM5906 
 	(reg == BRGPHY_MII_1000CTL || reg == BRGPHY_MII_AUXCTL))
 		return;
 
+	if (bge_ape_lock(sc, sc-bge_phy_ape_lock) != 0)
+		return;
+
 	/* Reading with autopolling on may trigger PCI errors */
 	autopoll = CSR_READ_4(sc, BGE_MI_MODE);
 	if (autopoll  BGE_MIMODE_AUTOPOLL) {
@@ -3743,7 +3743,7 @@ bge_attach(device_t parent, device_t sel
 			hwcfg2 = bge_readmem_ind(sc, BGE_SRAM_DATA_CFG_2);
 		if (sc-bge_flags  BGEF_PCIE)
 			hwcfg3 = bge_readmem_ind(sc, BGE_SRAM_DATA_CFG_3);
-		if (BGE_ASICREV(sc-bge_chipid == BGE_ASICREV_BCM5785))
+		if (BGE_ASICREV(sc-bge_chipid) == BGE_ASICREV_BCM5785)
 			hwcfg4 = bge_readmem_ind(sc, BGE_SRAM_DATA_CFG_4);
 		if (BGE_IS_5717_PLUS(sc))
 			hwcfg5 = bge_readmem_ind(sc, BGE_SRAM_DATA_CFG_5);
@@ -4171,7 +4171,7 @@ bge_reset(struct bge_softc *sc)
 	 * XXX: from FreeBSD/Linux; no documentation
 	 */
 	if (sc-bge_flags  BGEF_PCIE) {
-		if (BGE_ASICREV(sc-bge_chipid != BGE_ASICREV_BCM5785) 
+		if ((BGE_ASICREV(sc-bge_chipid) != BGE_ASICREV_BCM5785) 
 		!BGE_IS_57765_PLUS(sc) 
 		(CSR_READ_4(sc, BGE_PHY_TEST_CTRL_REG) ==
 			(BGE_PHY_PCIE_LTASS_MODE | BGE_PHY_PCIE_SCRAM_MODE))) {



CVS commit: [netbsd-6] src/doc

2015-02-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 16 08:33:39 UTC 2015

Modified Files:
src/doc [netbsd-6]: CHANGES-6.2

Log Message:
Tickets #1254-#1256


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.195 -r1.1.2.196 src/doc/CHANGES-6.2

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-6.2
diff -u src/doc/CHANGES-6.2:1.1.2.195 src/doc/CHANGES-6.2:1.1.2.196
--- src/doc/CHANGES-6.2:1.1.2.195	Fri Feb 13 09:22:07 2015
+++ src/doc/CHANGES-6.2	Mon Feb 16 08:33:39 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.195 2015/02/13 09:22:07 snj Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.196 2015/02/16 08:33:39 martin Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -9589,3 +9589,24 @@ usr.bin/finger/lprint.c1.23
 	- The actual code is now smaller and does error checking and encoding
 	[martin, ticket #1247]
 
+sys/arch/sh3/sh3/locore_subr.S			1.55
+
+	Branch to correct point when a system call returns an error.
+	[skrll, ticket #1254]
+
+external/bsd/wpa/dist/src/drivers/driver_bsd.c	1.8-1.9
+
+	Avoid dereferencing a NULL pointer.
+	Pass the scan result RSSI to the WPA code in a way that it understands.
+	[khorben, ticket #1255]
+
+sys/dev/pci/if_bge.c1.278
+
+	Fix three bugs reported by enami@:
+	  - bge_miibus_writereg(): Fix a bug that BCM5906 may leave an APE
+	lock.
+	  - Fix hwcfg4 isn't printed correctly.
+	  - Fix a bug that BGE_PHY_TEST_CTRL_REG isn't set correctly on some
+	PCIe devices.
+	[msaitoh, ticket #1256]
+



CVS commit: [netbsd-6] src/sys/arch/sh3/sh3

2015-02-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 16 08:14:34 UTC 2015

Modified Files:
src/sys/arch/sh3/sh3 [netbsd-6]: locore_subr.S

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1254):
sys/arch/sh3/sh3/locore_subr.S: revision 1.55
port-sh3/49613: errno does not set by some systemcall at error case
Branch to correct point when error detected.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.54.10.1 src/sys/arch/sh3/sh3/locore_subr.S

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/sh3/sh3/locore_subr.S
diff -u src/sys/arch/sh3/sh3/locore_subr.S:1.54 src/sys/arch/sh3/sh3/locore_subr.S:1.54.10.1
--- src/sys/arch/sh3/sh3/locore_subr.S:1.54	Tue Feb  1 01:54:14 2011
+++ src/sys/arch/sh3/sh3/locore_subr.S	Mon Feb 16 08:14:34 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore_subr.S,v 1.54 2011/02/01 01:54:14 uwe Exp $	*/
+/*	$NetBSD: locore_subr.S,v 1.54.10.1 2015/02/16 08:14:34 martin Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #include sh3/mmu_sh3.h
 #include sh3/mmu_sh4.h
 
-__KERNEL_RCSID(0, $NetBSD: locore_subr.S,v 1.54 2011/02/01 01:54:14 uwe Exp $)
+__KERNEL_RCSID(0, $NetBSD: locore_subr.S,v 1.54.10.1 2015/02/16 08:14:34 martin Exp $)
 
 
 /*
@@ -645,7 +645,7 @@ ENTRY(copyinstr)
 
 	mov.l	.L_copyinstr_VM_MAXUSER_ADDRESS, r3
 	cmp/hi	r3,	r4		/* bomb if usrc isn't in user space */
-	bt	4f
+	bt	5f
 	mov	r3,	r0
 	sub	r4,	r0
 	cmp/hi	r6,	r0		/* don't beyond user space */



CVS commit: [netbsd-6] src/external/bsd/wpa/dist/src/drivers

2015-02-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 16 08:25:31 UTC 2015

Modified Files:
src/external/bsd/wpa/dist/src/drivers [netbsd-6]: driver_bsd.c

Log Message:
Pull up following revision(s) (requested by khorben in ticket #1255):
external/bsd/wpa/dist/src/drivers/driver_bsd.c: revision 1.8
external/bsd/wpa/dist/src/drivers/driver_bsd.c: revision 1.9
CID 272959: NULL deref
Pass the scan result RSSI to the WPA code in a way that it understands.


To generate a diff of this commit:
cvs rdiff -u -r1.4.8.1 -r1.4.8.2 \
src/external/bsd/wpa/dist/src/drivers/driver_bsd.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/bsd/wpa/dist/src/drivers/driver_bsd.c
diff -u src/external/bsd/wpa/dist/src/drivers/driver_bsd.c:1.4.8.1 src/external/bsd/wpa/dist/src/drivers/driver_bsd.c:1.4.8.2
--- src/external/bsd/wpa/dist/src/drivers/driver_bsd.c:1.4.8.1	Sat May 19 15:32:37 2012
+++ src/external/bsd/wpa/dist/src/drivers/driver_bsd.c	Mon Feb 16 08:25:31 2015
@@ -828,12 +828,13 @@ bsd_init(struct hostapd_data *hapd, stru
 
 	return drv;
 bad:
-	if (drv-sock_xmit != NULL)
-		l2_packet_deinit(drv-sock_xmit);
-	if (drv-sock = 0)
-		close(drv-sock);
-	if (drv != NULL)
+	if (drv != NULL) {
+		if (drv-sock_xmit != NULL)
+			l2_packet_deinit(drv-sock_xmit);
+		if (drv-sock = 0)
+			close(drv-sock);
 		os_free(drv);
+	}
 	return NULL;
 }
 
@@ -1331,7 +1332,7 @@ wpa_driver_bsd_add_scan_entry(struct wpa
 	result-freq = sr-isr_freq;
 	result-beacon_int = sr-isr_intval;
 	result-caps = sr-isr_capinfo;
-	result-qual = sr-isr_rssi;
+	result-level = sr-isr_rssi;
 	result-noise = sr-isr_noise;
 
 	pos = (u8 *)(result + 1);



CVS commit: src/sys/fs/union

2015-02-16 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Feb 16 10:21:25 UTC 2015

Modified Files:
src/sys/fs/union: union.h union_subr.c

Log Message:
Add reference count to union node.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/fs/union/union.h
cvs rdiff -u -r1.68 -r1.69 src/sys/fs/union/union_subr.c

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

Modified files:

Index: src/sys/fs/union/union.h
diff -u src/sys/fs/union/union.h:1.26 src/sys/fs/union/union.h:1.27
--- src/sys/fs/union/union.h:1.26	Fri Feb 14 08:50:27 2014
+++ src/sys/fs/union/union.h	Mon Feb 16 10:21:25 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: union.h,v 1.26 2014/02/14 08:50:27 hannken Exp $	*/
+/*	$NetBSD: union.h,v 1.27 2015/02/16 10:21:25 hannken Exp $	*/
 
 /*
  * Copyright (c) 1994 The Regents of the University of California.
@@ -120,6 +120,7 @@ struct union_mount {
 struct union_node {
 	kmutex_t		un_lock;
 	LIST_ENTRY(union_node)	un_cache;	/* c: Hash chain */
+	int			un_refs;	/* c: Reference counter */
 	struct vnode		*un_vnode;	/* :: Back pointer */
 	struct vnode	*un_uppervp;	/* m: overlaying object */
 	struct vnode	*un_lowervp;	/* v: underlying object */

Index: src/sys/fs/union/union_subr.c
diff -u src/sys/fs/union/union_subr.c:1.68 src/sys/fs/union/union_subr.c:1.69
--- src/sys/fs/union/union_subr.c:1.68	Mon Feb 16 10:20:57 2015
+++ src/sys/fs/union/union_subr.c	Mon Feb 16 10:21:25 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_subr.c,v 1.68 2015/02/16 10:20:57 hannken Exp $	*/
+/*	$NetBSD: union_subr.c,v 1.69 2015/02/16 10:21:25 hannken Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -72,7 +72,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: union_subr.c,v 1.68 2015/02/16 10:20:57 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: union_subr.c,v 1.69 2015/02/16 10:21:25 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -105,6 +105,8 @@ static u_long uhash_mask;		/* size of ha
 static kmutex_t uhash_lock;
 
 void union_updatevp(struct union_node *, struct vnode *, struct vnode *);
+static void union_ref(struct union_node *);
+static void union_rele(struct union_node *);
 static int union_do_lookup(struct vnode *, struct componentname *, kauth_cred_t,const char *);
 int union_vn_close(struct vnode *, int, kauth_cred_t, struct lwp *);
 static void union_dircache_r(struct vnode *, struct vnode ***, int *);
@@ -289,6 +291,45 @@ union_newsize(struct vnode *vp, off_t up
 	}
 }
 
+static void
+union_ref(struct union_node *un)
+{
+
+	KASSERT(mutex_owned(uhash_lock));
+	un-un_refs++;
+}
+
+static void
+union_rele(struct union_node *un)
+{
+
+	mutex_enter(uhash_lock);
+	un-un_refs--;
+	if (un-un_refs  0) {
+		mutex_exit(uhash_lock);
+		return;
+	}
+	if (un-un_cflags  UN_CACHED) {
+		un-un_cflags = ~UN_CACHED;
+		LIST_REMOVE(un, un_cache);
+	}
+	mutex_exit(uhash_lock);
+
+	if (un-un_pvp != NULLVP)
+		vrele(un-un_pvp);
+	if (un-un_uppervp != NULLVP)
+		vrele(un-un_uppervp);
+	if (un-un_lowervp != NULLVP)
+		vrele(un-un_lowervp);
+	if (un-un_dirvp != NULLVP)
+		vrele(un-un_dirvp);
+	if (un-un_path)
+		free(un-un_path, M_TEMP);
+	mutex_destroy(un-un_lock);
+
+	free(un, M_TEMP);
+}
+
 /*
  * allocate a union_node/vnode pair.  the vnode is
  * referenced and unlocked.  the new vnode is returned
@@ -397,9 +438,12 @@ loop:
 continue;
 
 			vp = UNIONTOV(un);
+			union_ref(un);
 			mutex_enter(vp-v_interlock);
 			mutex_exit(uhash_lock);
-			if (vget(vp, 0))
+			error = vget(vp, 0);
+			union_rele(un);
+			if (error)
 goto loop;
 			goto found;
 		}
@@ -517,6 +561,7 @@ found:
 
 	un = VTOUNION(*vpp);
 	mutex_init(un-un_lock, MUTEX_DEFAULT, IPL_NONE);
+	un-un_refs = 1;
 	un-un_vnode = *vpp;
 	un-un_uppervp = uppervp;
 	un-un_lowervp = lowervp;
@@ -562,29 +607,11 @@ union_freevp(struct vnode *vp)
 {
 	struct union_node *un = VTOUNION(vp);
 
-	mutex_enter(uhash_lock);
-	if (un-un_cflags  UN_CACHED) {
-		un-un_cflags = ~UN_CACHED;
-		LIST_REMOVE(un, un_cache);
-	}
-	mutex_exit(uhash_lock);
-
-	if (un-un_pvp != NULLVP)
-		vrele(un-un_pvp);
-	if (un-un_uppervp != NULLVP)
-		vrele(un-un_uppervp);
-	if (un-un_lowervp != NULLVP)
-		vrele(un-un_lowervp);
-	if (un-un_dirvp != NULLVP)
-		vrele(un-un_dirvp);
-	if (un-un_path)
-		free(un-un_path, M_TEMP);
-	mutex_destroy(un-un_lock);
+	union_rele(un);
 
-	free(vp-v_data, M_TEMP);
 	vp-v_data = NULL;
 
-	return (0);
+	return 0;
 }
 
 /*



CVS commit: src/sys/fs/union

2015-02-16 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Feb 16 10:20:57 UTC 2015

Modified Files:
src/sys/fs/union: union_subr.c

Log Message:
Remove a superfluous vref(), VOP_CREATE() was changed to
keep dvp referenced and locked some time ago.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/fs/union/union_subr.c

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

Modified files:

Index: src/sys/fs/union/union_subr.c
diff -u src/sys/fs/union/union_subr.c:1.67 src/sys/fs/union/union_subr.c:1.68
--- src/sys/fs/union/union_subr.c:1.67	Fri Sep  5 09:26:16 2014
+++ src/sys/fs/union/union_subr.c	Mon Feb 16 10:20:57 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_subr.c,v 1.67 2014/09/05 09:26:16 matt Exp $	*/
+/*	$NetBSD: union_subr.c,v 1.68 2015/02/16 10:20:57 hannken Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -72,7 +72,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: union_subr.c,v 1.67 2014/09/05 09:26:16 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: union_subr.c,v 1.68 2015/02/16 10:20:57 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -889,7 +889,6 @@ union_vn_create(struct vnode **vpp, stru
 	vattr_null(vap);
 	vap-va_type = VREG;
 	vap-va_mode = cmode;
-	vref(un-un_dirvp);
 	vp = NULL;
 	error = VOP_CREATE(un-un_dirvp, vp, cn, vap);
 	if (error) {



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

2015-02-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Feb 16 10:19:29 UTC 2015

Modified Files:
src/sys/arch/arm/conf: std.arm

Log Message:
Re-enable CPI_IN_CKSUM now the bugs are fixed.


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

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/conf/std.arm
diff -u src/sys/arch/arm/conf/std.arm:1.2 src/sys/arch/arm/conf/std.arm:1.3
--- src/sys/arch/arm/conf/std.arm:1.2	Fri Jan 30 14:32:19 2015
+++ src/sys/arch/arm/conf/std.arm	Mon Feb 16 10:19:29 2015
@@ -1,5 +1,5 @@
-#	$NetBSD: std.arm,v 1.2 2015/01/30 14:32:19 joerg Exp $
+#	$NetBSD: std.arm,v 1.3 2015/02/16 10:19:29 skrll Exp $
 #
 # standard NetBSD/arm options
 
-#options		CPU_IN_CKSUM
+options		CPU_IN_CKSUM



CVS commit: src/sys/fs/union

2015-02-16 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Feb 16 10:22:00 UTC 2015

Modified Files:
src/sys/fs/union: union.h union_subr.c union_vfsops.c

Log Message:
Change union to vcache.  Use address of the union node as key.

It would be better to use (uppervp, lowervp) as key, but either
may be NULL and may change any time.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/fs/union/union.h
cvs rdiff -u -r1.69 -r1.70 src/sys/fs/union/union_subr.c
cvs rdiff -u -r1.73 -r1.74 src/sys/fs/union/union_vfsops.c

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

Modified files:

Index: src/sys/fs/union/union.h
diff -u src/sys/fs/union/union.h:1.27 src/sys/fs/union/union.h:1.28
--- src/sys/fs/union/union.h:1.27	Mon Feb 16 10:21:25 2015
+++ src/sys/fs/union/union.h	Mon Feb 16 10:22:00 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: union.h,v 1.27 2015/02/16 10:21:25 hannken Exp $	*/
+/*	$NetBSD: union.h,v 1.28 2015/02/16 10:22:00 hannken Exp $	*/
 
 /*
  * Copyright (c) 1994 The Regents of the University of California.
@@ -121,6 +121,7 @@ struct union_node {
 	kmutex_t		un_lock;
 	LIST_ENTRY(union_node)	un_cache;	/* c: Hash chain */
 	int			un_refs;	/* c: Reference counter */
+	struct mount		*un_mount;	/* c: union mount */
 	struct vnode		*un_vnode;	/* :: Back pointer */
 	struct vnode	*un_uppervp;	/* m: overlaying object */
 	struct vnode	*un_lowervp;	/* v: underlying object */
@@ -162,6 +163,8 @@ extern void union_newupper(struct union_
 extern void union_newsize(struct vnode *, off_t, off_t);
 int union_readdirhook(struct vnode **, struct file *, struct lwp *);
 
+VFS_PROTOS(union);
+
 #define	MOUNTTOUNIONMOUNT(mp) ((struct union_mount *)((mp)-mnt_data))
 #define	VTOUNION(vp) ((struct union_node *)(vp)-v_data)
 #define	UNIONTOV(un) ((un)-un_vnode)

Index: src/sys/fs/union/union_subr.c
diff -u src/sys/fs/union/union_subr.c:1.69 src/sys/fs/union/union_subr.c:1.70
--- src/sys/fs/union/union_subr.c:1.69	Mon Feb 16 10:21:25 2015
+++ src/sys/fs/union/union_subr.c	Mon Feb 16 10:22:00 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_subr.c,v 1.69 2015/02/16 10:21:25 hannken Exp $	*/
+/*	$NetBSD: union_subr.c,v 1.70 2015/02/16 10:22:00 hannken Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -72,7 +72,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: union_subr.c,v 1.69 2015/02/16 10:21:25 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: union_subr.c,v 1.70 2015/02/16 10:22:00 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -344,22 +344,12 @@ union_rele(struct union_node *un)
  * the reference is either maintained in the new union_node
  * object which is allocated, or they are vrele'd.
  *
- * all union_nodes are maintained on a singly-linked
+ * all union_nodes are maintained on a hash
  * list.  new nodes are only allocated when they cannot
  * be found on this list.  entries on the list are
  * removed when the vfs reclaim entry is called.
  *
- * a single lock is kept for the entire list.  this is
- * needed because the getnewvnode() function can block
- * waiting for a vnode to become free, in which case there
- * may be more than one process trying to get the same
- * vnode.  this lock is only taken if we are going to
- * call getnewvnode, since the kernel itself is single-threaded.
- *
- * if an entry is found on the list, then call vget() to
- * take a reference.  this is done because there may be
- * zero references to it and so it needs to removed from
- * the vnode free list.
+ * the vnode gets attached or referenced with vcache_get().
  */
 int
 union_allocvp(
@@ -373,14 +363,9 @@ union_allocvp(
 	int docache)
 {
 	int error;
-	struct vattr va;
 	struct union_node *un = NULL, *un1;
 	struct vnode *vp, *xlowervp = NULLVP;
-	struct union_mount *um = MOUNTTOUNIONMOUNT(mp);
-	voff_t uppersz, lowersz;
-	dev_t rdev;
 	u_long hash[3];
-	int vflag, iflag;
 	int try;
 	bool is_dotdot;
 
@@ -394,20 +379,6 @@ union_allocvp(
 		lowervp = NULLVP;
 	}
 
-	/* detect the root vnode (and aliases) */
-	iflag = VI_LAYER;
-	vflag = 0;
-	if ((uppervp == um-um_uppervp) 
-	((lowervp == NULLVP) || lowervp == um-um_lowervp)) {
-		if (lowervp == NULLVP) {
-			lowervp = um-um_lowervp;
-			if (lowervp != NULLVP)
-vref(lowervp);
-		}
-		iflag = 0;
-		vflag = VV_ROOT;
-	}
-
 	if (!docache) {
 		un = NULL;
 		goto found;
@@ -434,17 +405,18 @@ loop:
 		LIST_FOREACH(un, uhashtbl[hash[try]], un_cache) {
 			if ((un-un_lowervp  un-un_lowervp != lowervp) ||
 			(un-un_uppervp  un-un_uppervp != uppervp) ||
-			UNIONTOV(un)-v_mount != mp)
+			un-un_mount != mp)
 continue;
 
-			vp = UNIONTOV(un);
 			union_ref(un);
-			mutex_enter(vp-v_interlock);
 			mutex_exit(uhash_lock);
-			error = vget(vp, 0);
+			error = vcache_get(mp, un, sizeof(un), vp);
+			KASSERT(error != 0 || UNIONTOV(un) == vp);
 			union_rele(un);
-			if (error)
+			if (error == ENOENT)
 goto loop;
+			else if (error)
+goto out;
 			goto