CVS commit: src/sys/kern

2014-07-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Jul 22 07:38:41 UTC 2014

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

Log Message:
Enable KMEM_REDZONE on DIAGNOSTIC. It will try to catch overflows.

No comment on tech-kern@


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/kern/subr_kmem.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/subr_kmem.c
diff -u src/sys/kern/subr_kmem.c:1.59 src/sys/kern/subr_kmem.c:1.60
--- src/sys/kern/subr_kmem.c:1.59	Thu Jul  3 08:43:49 2014
+++ src/sys/kern/subr_kmem.c	Tue Jul 22 07:38:41 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kmem.c,v 1.59 2014/07/03 08:43:49 maxv Exp $	*/
+/*	$NetBSD: subr_kmem.c,v 1.60 2014/07/22 07:38:41 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -65,13 +65,23 @@
  *	Prefix each allocations with a fixed-sized, aligned header and record
  *	the exact user-requested allocation size in it. When freeing, compare
  *	it with kmem_free's size argument.
- */
-
-/*
+ *
  * KMEM_REDZONE: detect overrun bugs.
  *	Add a 2-byte pattern (allocate one more memory chunk if needed) at the
  *	end of each allocated buffer. Check this pattern on kmem_free.
  *
+ * These options are enabled on DIAGNOSTIC.
+ *
+ *  |CHUNK|CHUNK|CHUNK|CHUNK|CHUNK|CHUNK|CHUNK|CHUNK|CHUNK|CHUNK|CHUNK|
+ *  +-+-+-+-+-+-+-+-+-+---+-+--+--+
+ *  |/| | | | | | | | |   |*|**|UU|
+ *  |/HSZ/| | | | | | | | |   |*|**|UU|
+ *  |/| | | | | | | | |   |*|**|UU|
+ *  +-+-+-+-+-+-+-+-+-+---+-+--+--+
+ *  |Size |Buffer usable by the caller (requested size)   |RedZ|Unused\
+ */
+
+/*
  * KMEM_POISON: detect modify-after-free bugs.
  *	Fill freed (in the sense of kmem_free) memory with a garbage pattern.
  *	Check the pattern on allocation.
@@ -90,7 +100,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_kmem.c,v 1.59 2014/07/03 08:43:49 maxv Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_kmem.c,v 1.60 2014/07/22 07:38:41 maxv Exp $);
 
 #include sys/param.h
 #include sys/callback.h
@@ -168,11 +178,11 @@ static size_t kmem_cache_big_maxidx __re
 
 #if defined(DIAGNOSTIC)  defined(_HARDKERNEL)
 #define	KMEM_SIZE
+#define	KMEM_REDZONE
 #endif /* defined(DIAGNOSTIC) */
 
 #if defined(DEBUG)  defined(_HARDKERNEL)
 #define	KMEM_POISON
-#define	KMEM_REDZONE
 #define	KMEM_GUARD
 #endif /* defined(DEBUG) */
 



CVS commit: src/sys

2014-07-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Jul 22 08:18:33 UTC 2014

Modified Files:
src/sys/compat/linux32/common: linux32_mod.c
src/sys/compat/netbsd32: netbsd32_mod.c
src/sys/kern: exec_elf32.c exec_elf64.c

Log Message:
1) On 64bit systems, don't add the 32bit execsw[] to the global exec array.
   exec_elf32 works on 32bit systems only, and will crash 32bit binaries on
   64bit systems.
2) Now that exec_elf32 is dormant, we can give the native ELF loaders the
   highest priority.

Binaries will load faster now (system boot, compilation, etc.).

With the help of njloy@. Discussed a bit on tech-kern@, no disagreement.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/linux32/common/linux32_mod.c
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/netbsd32/netbsd32_mod.c
cvs rdiff -u -r1.140 -r1.141 src/sys/kern/exec_elf32.c
cvs rdiff -u -r1.5 -r1.6 src/sys/kern/exec_elf64.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/compat/linux32/common/linux32_mod.c
diff -u src/sys/compat/linux32/common/linux32_mod.c:1.5 src/sys/compat/linux32/common/linux32_mod.c:1.6
--- src/sys/compat/linux32/common/linux32_mod.c:1.5	Fri Mar  7 01:33:43 2014
+++ src/sys/compat/linux32/common/linux32_mod.c	Tue Jul 22 08:18:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_mod.c,v 1.5 2014/03/07 01:33:43 christos Exp $	*/
+/*	$NetBSD: linux32_mod.c,v 1.6 2014/07/22 08:18:33 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: linux32_mod.c,v 1.5 2014/03/07 01:33:43 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: linux32_mod.c,v 1.6 2014/07/22 08:18:33 maxv Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_execfmt.h
@@ -67,7 +67,7 @@ static struct execsw linux32_execsw[] = 
 			.elf_probe_func = linux32_elf32_probe, 
 		},
 		.es_emul = emul_linux32,
-		.es_prio = EXECSW_PRIO_FIRST, 
+		.es_prio = EXECSW_PRIO_ANY, 
 		.es_arglen = LINUX32_ELF_AUX_ARGSIZ,
 		.es_copyargs = linux32_elf32_copyargs,
 		.es_setregs = NULL,

Index: src/sys/compat/netbsd32/netbsd32_mod.c
diff -u src/sys/compat/netbsd32/netbsd32_mod.c:1.4 src/sys/compat/netbsd32/netbsd32_mod.c:1.5
--- src/sys/compat/netbsd32/netbsd32_mod.c:1.4	Fri Jul 11 16:22:49 2014
+++ src/sys/compat/netbsd32/netbsd32_mod.c	Tue Jul 22 08:18:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_mod.c,v 1.4 2014/07/11 16:22:49 maxv Exp $	*/
+/*	$NetBSD: netbsd32_mod.c,v 1.5 2014/07/22 08:18:33 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netbsd32_mod.c,v 1.4 2014/07/11 16:22:49 maxv Exp $);
+__KERNEL_RCSID(0, $NetBSD: netbsd32_mod.c,v 1.5 2014/07/22 08:18:33 maxv Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_execfmt.h
@@ -87,7 +87,7 @@ static struct execsw netbsd32_execsw[] =
 			.elf_probe_func = netbsd32_elf32_probe,
 		},
 		.es_emul = emul_netbsd32,
-		.es_prio = EXECSW_PRIO_FIRST,
+		.es_prio = EXECSW_PRIO_ANY,
 		.es_arglen = ELF32_AUXSIZE,
 		.es_copyargs = netbsd32_elf32_copyargs,
 		.es_setregs = NULL,

Index: src/sys/kern/exec_elf32.c
diff -u src/sys/kern/exec_elf32.c:1.140 src/sys/kern/exec_elf32.c:1.141
--- src/sys/kern/exec_elf32.c:1.140	Mon Apr  7 17:02:15 2014
+++ src/sys/kern/exec_elf32.c	Tue Jul 22 08:18:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_elf32.c,v 1.140 2014/04/07 17:02:15 rjs Exp $	*/
+/*	$NetBSD: exec_elf32.c,v 1.141 2014/07/22 08:18:33 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: exec_elf32.c,v 1.140 2014/04/07 17:02:15 rjs Exp $);
+__KERNEL_RCSID(0, $NetBSD: exec_elf32.c,v 1.141 2014/07/22 08:18:33 maxv Exp $);
 
 #define	ELFSIZE	32
 
@@ -59,7 +59,7 @@ static struct execsw exec_elf32_execsw[]
 			.elf_probe_func = netbsd_elf32_probe,
 		},
 		.es_emul = emul_netbsd,
-		.es_prio = EXECSW_PRIO_ANY,
+		.es_prio = EXECSW_PRIO_FIRST,
 		.es_arglen = ELF32_AUXSIZE,
 		.es_copyargs = elf32_copyargs,
 		.es_setregs = NULL,
@@ -87,7 +87,28 @@ static struct execsw exec_elf32_execsw[]
 static int
 exec_elf32_modcmd(modcmd_t cmd, void *arg)
 {
+#if ARCH_ELFSIZE == 64
+	/*
+	 * If we are on a 64bit system, we don't want the 32bit execsw[] to be
+	 * added in the global array, because the exec_elf32 module only works
+	 * on 32bit systems.
+	 *
+	 * However, we need the exec_elf32 module, because it will make the 32bit
+	 * functions available for netbsd32 and linux32.
+	 *
+	 * Therefore, allow this module on 64bit systems, but make it dormant.
+	 */
 
+	(void)exec_elf32_execsw; /* unused */
+
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+	case MODULE_CMD_FINI:
+		return 0;
+	default:
+		return ENOTTY;
+	}
+#else /* ARCH_ELFSIZE == 64 */
 	switch (cmd) {
 	case MODULE_CMD_INIT:
 		return exec_add(exec_elf32_execsw,
@@ -100,4 +121,5 @@ 

CVS commit: src/sys/net

2014-07-22 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Tue Jul 22 08:20:08 UTC 2014

Modified Files:
src/sys/net: bpfjit.c

Log Message:
Don't use scratch registers for X and to restore A after BPF_COPX call.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 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.28 src/sys/net/bpfjit.c:1.29
--- src/sys/net/bpfjit.c:1.28	Sun Jul 13 21:54:46 2014
+++ src/sys/net/bpfjit.c	Tue Jul 22 08:20:08 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpfjit.c,v 1.28 2014/07/13 21:54:46 alnsn Exp $	*/
+/*	$NetBSD: bpfjit.c,v 1.29 2014/07/22 08:20:08 alnsn 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.28 2014/07/13 21:54:46 alnsn Exp $);
+__KERNEL_RCSID(0, $NetBSD: bpfjit.c,v 1.29 2014/07/22 08:20:08 alnsn Exp $);
 #else
-__RCSID($NetBSD: bpfjit.c,v 1.28 2014/07/13 21:54:46 alnsn Exp $);
+__RCSID($NetBSD: bpfjit.c,v 1.29 2014/07/22 08:20:08 alnsn Exp $);
 #endif
 
 #include sys/types.h
@@ -89,11 +89,12 @@ __RCSID($NetBSD: bpfjit.c,v 1.28 2014/0
 #define BJ_BUF		SLJIT_SAVED_REG1
 //#define BJ_ARGS	SLJIT_SAVED_REG2
 #define BJ_BUFLEN	SLJIT_SAVED_REG3
+#define BJ_XREG		SLJIT_SAVED_EREG1
+#define BJ_ASAVE	SLJIT_SAVED_EREG2
 #define BJ_AREG		SLJIT_SCRATCH_REG1
 #define BJ_TMP1REG	SLJIT_SCRATCH_REG2
 #define BJ_TMP2REG	SLJIT_SCRATCH_REG3
-#define BJ_XREG		SLJIT_TEMPORARY_EREG1
-#define BJ_TMP3REG	SLJIT_TEMPORARY_EREG2
+#define BJ_TMP3REG	SLJIT_TEMPORARY_EREG1
 
 #ifdef _KERNEL
 #define MAX_MEMWORDS BPF_MAX_MEMWORDS
@@ -118,11 +119,12 @@ __RCSID($NetBSD: bpfjit.c,v 1.28 2014/0
 typedef unsigned int bpfjit_hint_t;
 #define BJ_HINT_ABS  0x01 /* packet read at absolute offset   */
 #define BJ_HINT_IND  0x02 /* packet read at variable offset   */
-#define BJ_HINT_COP  0x04 /* BPF_COP or BPF_COPX instruction  */
-#define BJ_HINT_COPX 0x08 /* BPF_COPX instruction */
-#define BJ_HINT_XREG 0x10 /* BJ_XREG is needed*/
-#define BJ_HINT_LDX  0x20 /* BPF_LDX instruction  */
-#define BJ_HINT_PKT  (BJ_HINT_ABS|BJ_HINT_IND) /* packet read */
+#define BJ_HINT_MSH  0x04 /* BPF_MSH instruction  */
+#define BJ_HINT_COP  0x08 /* BPF_COP or BPF_COPX instruction  */
+#define BJ_HINT_COPX 0x10 /* BPF_COPX instruction */
+#define BJ_HINT_XREG 0x20 /* BJ_XREG is needed*/
+#define BJ_HINT_LDX  0x40 /* BPF_LDX instruction  */
+#define BJ_HINT_PKT  (BJ_HINT_ABS|BJ_HINT_IND|BJ_HINT_MSH)
 
 /*
  * Datatype for Array Bounds Check Elimination (ABC) pass.
@@ -257,17 +259,29 @@ nscratches(bpfjit_hint_t hints)
 	if (hints  BJ_HINT_COP)
 		rv = 3; /* calls copfunc with three arguments */
 
+	if (hints  BJ_HINT_COPX)
+		rv = 4; /* uses BJ_TMP3REG */
+
+	return rv;
+}
+
+/*
+ * Return a number of saved registers to pass
+ * to sljit_emit_enter() function.
+ */
+static sljit_si
+nsaveds(bpfjit_hint_t hints)
+{
+	sljit_si rv = 3;
+
 	if (hints  BJ_HINT_XREG)
 		rv = 4; /* uses BJ_XREG */
 
 #ifdef _KERNEL
 	if (hints  BJ_HINT_LDX)
-		rv = 5; /* uses BJ_TMP3REG */
+		rv = 5; /* uses BJ_ASAVE */
 #endif
 
-	if (hints  BJ_HINT_COPX)
-		rv = 5; /* uses BJ_TMP3REG */
-
 	return rv;
 }
 
@@ -518,26 +532,16 @@ emit_xcall(struct sljit_compiler *compil
 int dst, struct sljit_jump ***ret0, size_t *ret0_size, size_t *ret0_maxsize,
 uint32_t (*fn)(const struct mbuf *, uint32_t, int *))
 {
-#if BJ_XREG== SLJIT_RETURN_REG   || \
-BJ_XREG== SLJIT_SCRATCH_REG1 || \
-BJ_XREG== SLJIT_SCRATCH_REG2 || \
-BJ_XREG== SLJIT_SCRATCH_REG3 || \
-BJ_TMP3REG == SLJIT_RETURN_REG   || \
-BJ_TMP3REG == SLJIT_SCRATCH_REG1 || \
-BJ_TMP3REG == SLJIT_SCRATCH_REG2 || \
-BJ_TMP3REG == SLJIT_SCRATCH_REG3
-#error Not supported assignment of registers.
-#endif
 	struct sljit_jump *jump;
 	int status;
 
-	BJ_ASSERT(dst != BJ_TMP2REG  dst != BJ_TMP3REG);
+	BJ_ASSERT(dst != BJ_ASAVE);
 
 	if (BPF_CLASS(pc-code) == BPF_LDX) {
 		/* save A */
 		status = sljit_emit_op1(compiler,
 		SLJIT_MOV,
-		BJ_TMP3REG, 0,
+		BJ_ASAVE, 0,
 		BJ_AREG, 0);
 		if (status != SLJIT_SUCCESS)
 			return status;
@@ -633,7 +637,7 @@ emit_xcall(struct sljit_compiler *compil
 		status = sljit_emit_op1(compiler,
 		SLJIT_MOV,
 		BJ_AREG, 0,
-		BJ_TMP3REG, 0);
+		BJ_ASAVE, 0);
 		if (status != SLJIT_SUCCESS)
 			return status;
 	}
@@ -650,11 +654,7 @@ emit_cop(struct sljit_compiler *compiler
 const bpf_ctx_t *bc, const struct bpf_insn *pc,
 struct sljit_jump ***ret0, size_t *ret0_size, size_t *ret0_maxsize)
 {
-#if BJ_XREG== SLJIT_RETURN_REG   || \
-BJ_XREG== SLJIT_SCRATCH_REG1 || \
-BJ_XREG== SLJIT_SCRATCH_REG2 || \
-BJ_XREG== SLJIT_SCRATCH_REG3 || \
-BJ_TMP3REG == SLJIT_SCRATCH_REG1 || \
+#if 

CVS commit: src/sys/net

2014-07-22 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Tue Jul 22 08:29:51 UTC 2014

Modified Files:
src/sys/net: bpfjit.c

Log Message:
Two tweaks: don't use a temporary register to dereference the err agrument
after xcall and don't generate ((tmp1  0xf)  2) twice in emit_msh().


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 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.29 src/sys/net/bpfjit.c:1.30
--- src/sys/net/bpfjit.c:1.29	Tue Jul 22 08:20:08 2014
+++ src/sys/net/bpfjit.c	Tue Jul 22 08:29:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpfjit.c,v 1.29 2014/07/22 08:20:08 alnsn Exp $	*/
+/*	$NetBSD: bpfjit.c,v 1.30 2014/07/22 08:29:51 alnsn 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.29 2014/07/22 08:20:08 alnsn Exp $);
+__KERNEL_RCSID(0, $NetBSD: bpfjit.c,v 1.30 2014/07/22 08:29:51 alnsn Exp $);
 #else
-__RCSID($NetBSD: bpfjit.c,v 1.29 2014/07/22 08:20:08 alnsn Exp $);
+__RCSID($NetBSD: bpfjit.c,v 1.30 2014/07/22 08:29:51 alnsn Exp $);
 #endif
 
 #include sys/types.h
@@ -612,19 +612,11 @@ emit_xcall(struct sljit_compiler *compil
 			return status;
 	}
 
-	/* tmp2 = *err; */
-	status = sljit_emit_op1(compiler,
-	SLJIT_MOV_UI,
-	BJ_TMP2REG, 0,
-	SLJIT_MEM1(SLJIT_LOCALS_REG),
-	offsetof(struct bpfjit_stack, err));
-	if (status != SLJIT_SUCCESS)
-		return status;
-
-	/* if (tmp2 != 0) return 0; */
+	/* if (*err != 0) return 0; */
 	jump = sljit_emit_cmp(compiler,
-	SLJIT_C_NOT_EQUAL,
-	BJ_TMP2REG, 0,
+	SLJIT_C_NOT_EQUAL|SLJIT_INT_OP,
+	SLJIT_MEM1(SLJIT_LOCALS_REG),
+	offsetof(struct bpfjit_stack, err),
 	SLJIT_IMM, 0);
 	if (jump == NULL)
 		return SLJIT_ERR_ALLOC_FAILED;
@@ -989,24 +981,6 @@ emit_msh(struct sljit_compiler *compiler
 	if (status != SLJIT_SUCCESS)
 		return status;
 
-	/* tmp1 = 0xf */
-	status = sljit_emit_op2(compiler,
-	SLJIT_AND,
-	BJ_TMP1REG, 0,
-	BJ_TMP1REG, 0,
-	SLJIT_IMM, 0xf);
-	if (status != SLJIT_SUCCESS)
-		return status;
-
-	/* tmp1 = tmp1  2 */
-	status = sljit_emit_op2(compiler,
-	SLJIT_SHL,
-	BJ_XREG, 0,
-	BJ_TMP1REG, 0,
-	SLJIT_IMM, 2);
-	if (status != SLJIT_SUCCESS)
-		return status;
-
 #ifdef _KERNEL
 	over_mchain_jump = sljit_emit_jump(compiler, SLJIT_JUMP);
 	if (over_mchain_jump == NULL)
@@ -1035,6 +1009,12 @@ emit_msh(struct sljit_compiler *compiler
 	if (status != SLJIT_SUCCESS)
 		return status;
 
+	label = sljit_emit_label(compiler);
+	if (label == NULL)
+		return SLJIT_ERR_ALLOC_FAILED;
+	sljit_set_label(over_mchain_jump, label);
+#endif
+
 	/* tmp1 = 0xf */
 	status = sljit_emit_op2(compiler,
 	SLJIT_AND,
@@ -1044,7 +1024,7 @@ emit_msh(struct sljit_compiler *compiler
 	if (status != SLJIT_SUCCESS)
 		return status;
 
-	/* tmp1 = tmp1  2 */
+	/* X = tmp1  2 */
 	status = sljit_emit_op2(compiler,
 	SLJIT_SHL,
 	BJ_XREG, 0,
@@ -1053,13 +1033,6 @@ emit_msh(struct sljit_compiler *compiler
 	if (status != SLJIT_SUCCESS)
 		return status;
 
-
-	label = sljit_emit_label(compiler);
-	if (label == NULL)
-		return SLJIT_ERR_ALLOC_FAILED;
-	sljit_set_label(over_mchain_jump, label);
-#endif
-
 	return SLJIT_SUCCESS;
 }
 
@@ -2107,8 +2080,8 @@ bpfjit_generate_code(const bpf_ctx_t *bc
 	sljit_compiler_verbose(compiler, stderr);
 #endif
 
-	status = sljit_emit_enter(compiler, 2, nscratches(hints),
-	nsaveds(hints), sizeof(struct bpfjit_stack));
+	status = sljit_emit_enter(compiler,
+	2, nscratches(hints), nsaveds(hints), sizeof(struct bpfjit_stack));
 	if (status != SLJIT_SUCCESS)
 		goto fail;
 



CVS commit: src/sys/dev

2014-07-22 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Jul 22 13:32:59 UTC 2014

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

Log Message:
Fix MODULE() dependencies to account for VND_COMPRESSION


To generate a diff of this commit:
cvs rdiff -u -r1.229 -r1.230 src/sys/dev/vnd.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/vnd.c
diff -u src/sys/dev/vnd.c:1.229 src/sys/dev/vnd.c:1.230
--- src/sys/dev/vnd.c:1.229	Sat Mar 22 16:08:51 2014
+++ src/sys/dev/vnd.c	Tue Jul 22 13:32:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.229 2014/03/22 16:08:51 prlw1 Exp $	*/
+/*	$NetBSD: vnd.c,v 1.230 2014/07/22 13:32:59 pooka Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vnd.c,v 1.229 2014/03/22 16:08:51 prlw1 Exp $);
+__KERNEL_RCSID(0, $NetBSD: vnd.c,v 1.230 2014/07/22 13:32:59 pooka Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_vnd.h
@@ -2039,7 +2039,13 @@ vnd_set_geometry(struct vnd_softc *vnd)
 
 #include sys/module.h
 
-MODULE(MODULE_CLASS_DRIVER, vnd, zlib);
+#ifdef VND_COMPRESSION
+#define VND_DEPENDS zlib
+#else
+#define VND_DEPENDS NULL
+#endif
+
+MODULE(MODULE_CLASS_DRIVER, vnd, VND_DEPENDS);
 CFDRIVER_DECL(vnd, DV_DISK, NULL);
 
 static int



CVS commit: src/sys/external/bsd/drm2/dist/drm/ttm

2014-07-22 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jul 22 15:15:22 UTC 2014

Modified Files:
src/sys/external/bsd/drm2/dist/drm/ttm: ttm_tt.c

Log Message:
Fix ttm swap storage destruction.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.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/dist/drm/ttm/ttm_tt.c
diff -u src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c:1.3 src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c:1.4
--- src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c:1.3	Thu Jul 17 17:19:42 2014
+++ src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c	Tue Jul 22 15:15:22 2014
@@ -181,11 +181,9 @@ void ttm_tt_destroy(struct ttm_tt *ttm)
 	if (ttm-state == tt_unbound)
 		ttm_tt_unpopulate(ttm);
 
+#ifndef __NetBSD__
 	if (!(ttm-page_flags  TTM_PAGE_FLAG_PERSISTENT_SWAP) 
 	ttm-swap_storage)
-#ifdef __NetBSD__
-		uao_detach(ttm-swap_storage);
-#else
 		fput(ttm-swap_storage);
 #endif
 
@@ -224,8 +222,10 @@ EXPORT_SYMBOL(ttm_tt_init);
 
 void ttm_tt_fini(struct ttm_tt *ttm)
 {
+#ifdef __NetBSD__
 	uao_detach(ttm-swap_storage);
 	ttm-swap_storage = NULL;
+#endif
 	drm_free_large(ttm-pages);
 	ttm-pages = NULL;
 }
@@ -297,7 +297,10 @@ void ttm_dma_tt_fini(struct ttm_dma_tt *
 {
 	struct ttm_tt *ttm = ttm_dma-ttm;
 
+#ifdef __NetBSD__
 	uao_detach(ttm-swap_storage);
+	ttm-swap_storage = NULL;
+#endif
 	drm_free_large(ttm-pages);
 	ttm-pages = NULL;
 #ifdef __NetBSD__



CVS commit: src/sys/dev

2014-07-22 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jul 22 15:42:59 UTC 2014

Modified Files:
src/sys/dev/pci: radeonfb.c
src/sys/dev/wsfb: genfb.c

Log Message:
Do not printf(foobar()).  Bad bad bad bad bad!


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/dev/pci/radeonfb.c
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/wsfb/genfb.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/radeonfb.c
diff -u src/sys/dev/pci/radeonfb.c:1.83 src/sys/dev/pci/radeonfb.c:1.84
--- src/sys/dev/pci/radeonfb.c:1.83	Thu Feb 20 01:41:28 2014
+++ src/sys/dev/pci/radeonfb.c	Tue Jul 22 15:42:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeonfb.c,v 1.83 2014/02/20 01:41:28 joerg Exp $ */
+/*	$NetBSD: radeonfb.c,v 1.84 2014/07/22 15:42:59 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: radeonfb.c,v 1.83 2014/02/20 01:41:28 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: radeonfb.c,v 1.84 2014/07/22 15:42:59 riastradh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -464,7 +464,7 @@ radeonfb_attach(device_t parent, device_
 
 	pci_aprint_devinfo(pa, NULL);
 
-	DPRINTF((prop_dictionary_externalize(device_properties(dev;
+	DPRINTF((%s, prop_dictionary_externalize(device_properties(dev;
 
 	KASSERT(radeonfb_devices[i].devid != 0);
 	sc-sc_pt = pa-pa_tag;

Index: src/sys/dev/wsfb/genfb.c
diff -u src/sys/dev/wsfb/genfb.c:1.53 src/sys/dev/wsfb/genfb.c:1.54
--- src/sys/dev/wsfb/genfb.c:1.53	Tue Mar 18 18:20:42 2014
+++ src/sys/dev/wsfb/genfb.c	Tue Jul 22 15:42:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfb.c,v 1.53 2014/03/18 18:20:42 riastradh Exp $ */
+/*	$NetBSD: genfb.c,v 1.54 2014/07/22 15:42:59 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: genfb.c,v 1.53 2014/03/18 18:20:42 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: genfb.c,v 1.54 2014/07/22 15:42:59 riastradh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -100,7 +100,7 @@ genfb_init(struct genfb_softc *sc)
 
 	dict = device_properties(sc-sc_dev);
 #ifdef GENFB_DEBUG
-	printf(prop_dictionary_externalize(dict));
+	printf(%s, prop_dictionary_externalize(dict));
 #endif
 	prop_dictionary_get_bool(dict, is_console, console);
 



CVS commit: src/etc

2014-07-22 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Jul 22 17:11:09 UTC 2014

Modified Files:
src/etc: daily locate.conf rc.subr services
src/etc/defaults: rc.conf
src/etc/rc.d: mountall mountcritlocal mountcritremote random_seed

Log Message:
'file system' for consistency with documentation (instead of 'filesystem').


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/etc/daily
cvs rdiff -u -r1.1 -r1.2 src/etc/locate.conf
cvs rdiff -u -r1.92 -r1.93 src/etc/rc.subr
cvs rdiff -u -r1.97 -r1.98 src/etc/services
cvs rdiff -u -r1.122 -r1.123 src/etc/defaults/rc.conf
cvs rdiff -u -r1.8 -r1.9 src/etc/rc.d/mountall src/etc/rc.d/mountcritremote
cvs rdiff -u -r1.13 -r1.14 src/etc/rc.d/mountcritlocal
cvs rdiff -u -r1.6 -r1.7 src/etc/rc.d/random_seed

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

Modified files:

Index: src/etc/daily
diff -u src/etc/daily:1.90 src/etc/daily:1.91
--- src/etc/daily:1.90	Sun Sep  8 08:19:40 2013
+++ src/etc/daily	Tue Jul 22 17:11:09 2014
@@ -1,6 +1,6 @@
 #!/bin/sh -
 #
-#	$NetBSD: daily,v 1.90 2013/09/08 08:19:40 prlw1 Exp $
+#	$NetBSD: daily,v 1.91 2014/07/22 17:11:09 wiz Exp $
 #	@(#)daily	8.2 (Berkeley) 1/25/94
 #
 
@@ -248,7 +248,7 @@ fi
 
 if checkyesno run_fsck; then
 	echo 
-	echo Checking filesystems:
+	echo Checking file systems:
 	fsck -n -f ${run_fsck_flags} | grep -v '^\*\* Phase'
 fi
 

Index: src/etc/locate.conf
diff -u src/etc/locate.conf:1.1 src/etc/locate.conf:1.2
--- src/etc/locate.conf:1.1	Fri Feb  6 15:24:25 2004
+++ src/etc/locate.conf	Tue Jul 22 17:11:09 2014
@@ -1,11 +1,11 @@
-#	$NetBSD: locate.conf,v 1.1 2004/02/06 15:24:25 itohy Exp $
+#	$NetBSD: locate.conf,v 1.2 2014/07/22 17:11:09 wiz Exp $
 #
 # This file is read by /usr/libexec/locate.updatedb when building locate(1)
 # database.
 #
 #		 argumentdescription			default
 # searchpath	 paths search path			/
-# ignorefs	 fs types  ignore filesystems of the types	!local cd9660
+# ignorefs	 fs types  ignore file systems of the types	!local cd9660
 #			Setting fs types to none		fdesc kernfs
 #			disables it (search everything).	procfs
 #			Prepending ! negates the meaning

Index: src/etc/rc.subr
diff -u src/etc/rc.subr:1.92 src/etc/rc.subr:1.93
--- src/etc/rc.subr:1.92	Mon Dec 17 18:17:27 2012
+++ src/etc/rc.subr	Tue Jul 22 17:11:09 2014
@@ -1,4 +1,4 @@
-# $NetBSD: rc.subr,v 1.92 2012/12/17 18:17:27 apb Exp $
+# $NetBSD: rc.subr,v 1.93 2014/07/22 17:11:09 wiz Exp $
 #
 # Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -112,7 +112,7 @@ stop_boot()
 
 #
 # mount_critical_filesystems type
-#	Go through the list of critical filesystems as provided in
+#	Go through the list of critical file systems as provided in
 #	the rc.conf(5) variable $critical_filesystems_${type}, checking
 #	each one to see if it is mounted, and if it is not, mounting it.
 #	It's not an error if file systems prefixed with OPTIONAL:
@@ -1047,7 +1047,7 @@ handle_fsck_error()
 		echo File system still has errors; re-run fsck manually!
 		;;
 	4)	# Root modified
-		echo Root filesystem was modified, rebooting ...
+		echo Root file system was modified, rebooting ...
 		reboot -n
 		echo Reboot failed; help!
 		;;

Index: src/etc/services
diff -u src/etc/services:1.97 src/etc/services:1.98
--- src/etc/services:1.97	Thu Mar 21 17:45:03 2013
+++ src/etc/services	Tue Jul 22 17:11:09 2014
@@ -1,4 +1,4 @@
-# $NetBSD: services,v 1.97 2013/03/21 17:45:03 christos Exp $
+# $NetBSD: services,v 1.98 2014/07/22 17:11:09 wiz Exp $
 # See also: services(5), http://www.sethwklein.net/projects/iana-etc/
 #
 #  Last Updated
@@ -19742,7 +19742,7 @@ chat		531/udp
 uucpd		540/tcp
 uucpd		540/udp
 rdist		541/tcp	rdistd
-rfs_server	556/tcp	rfs		# Brunhoff remote filesystem
+rfs_server	556/tcp	rfs		# Brunhoff remote file system
 smtps		465/tcp			# smtp protocol over TLS/SSL
 smtps		465/udp			# smtp protocol over TLS/SSL
 kdc		750/tcp	kerberos4

Index: src/etc/defaults/rc.conf
diff -u src/etc/defaults/rc.conf:1.122 src/etc/defaults/rc.conf:1.123
--- src/etc/defaults/rc.conf:1.122	Sun Jan 13 18:47:57 2013
+++ src/etc/defaults/rc.conf	Tue Jul 22 17:11:09 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: rc.conf,v 1.122 2013/01/13 18:47:57 prlw1 Exp $
+#	$NetBSD: rc.conf,v 1.123 2014/07/22 17:11:09 wiz Exp $
 #
 # /etc/defaults/rc.conf --
 #	default configuration of /etc/rc.conf
@@ -42,7 +42,7 @@ rc_silent_cmd=twiddle
 rc_rcorder_flags=
 
 # The directories searched for rc scripts.
-# These directories must be part of the root filesystem.
+# These directories must be part of the root file system.
 rc_directories=/etc/rc.d 
 
 # If this is set to NO, shutdown(8) will not run /etc/rc.shutdown.
@@ -140,7 +140,7 @@ rtclocaltime=NO
 # NOTE: default coredump name now set in /etc/sysctl.conf
 
 #
-# File system check flags; default to preen mode, checking filesystems
+# File system check flags; default to preen mode, checking file systems
 # that are 

CVS commit: src/sys/dev/pci

2014-07-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jul 22 17:25:19 UTC 2014

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

Log Message:
 Add workaround for PR#48451. Some BCM5717-5720 based systems get NMI on boot.
This problem doesn't occur when we don't use prefetchable memory in the APE
area. I don't know the reason...  The way to not to use prefetchable memory
was adviced by Riastradh. Tested with HP MicroServer Gen8.


To generate a diff of this commit:
cvs rdiff -u -r1.272 -r1.273 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.272 src/sys/dev/pci/if_bge.c:1.273
--- src/sys/dev/pci/if_bge.c:1.272	Wed Jul  2 22:25:14 2014
+++ src/sys/dev/pci/if_bge.c	Tue Jul 22 17:25:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.272 2014/07/02 22:25:14 msaitoh Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.273 2014/07/22 17:25:19 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_bge.c,v 1.272 2014/07/02 22:25:14 msaitoh Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_bge.c,v 1.273 2014/07/22 17:25:19 msaitoh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -3313,6 +3313,7 @@ bge_attach(device_t parent, device_t sel
 	bool			no_seeprom;
 	int			capmask;
 	int			mii_flags;
+	int			map_flags;
 	char intrbuf[PCI_INTRSTR_LEN];
 
 	bp = bge_lookup(pa);
@@ -3490,6 +3491,7 @@ bge_attach(device_t parent, device_t sel
 	/* Chips with APE need BAR2 access for APE registers/memory. */
 	if ((sc-bge_flags  BGEF_APE) != 0) {
 		memtype = pci_mapreg_type(pa-pa_pc, pa-pa_tag, BGE_PCI_BAR2);
+#if 0
 		if (pci_mapreg_map(pa, BGE_PCI_BAR2, memtype, 0,
 			sc-bge_apetag, sc-bge_apehandle, NULL,
 			sc-bge_apesize)) {
@@ -3497,6 +3499,29 @@ bge_attach(device_t parent, device_t sel
 			couldn't map BAR2 memory\n);
 			return;
 		}
+#else
+		/*
+		 * Workaround for PCI prefetchable bit. Some BCM5717-5720 based
+		 * system get NMI on boot (PR#48451). This problem might not be
+		 * the driver's bug but our PCI common part's bug. Until we
+		 * find a real reason, we ignore the prefetchable bit.
+		 */
+		if (pci_mapreg_info(pa-pa_pc, pa-pa_tag, BGE_PCI_BAR2,
+		memtype, memaddr, sc-bge_apesize, map_flags) != 0) {
+			aprint_error_dev(sc-bge_dev,
+			couldn't map BAR2 memory\n);
+			return;
+		}
+
+		map_flags = ~BUS_SPACE_MAP_PREFETCHABLE;
+		if (bus_space_map(pa-pa_memt, memaddr,
+		sc-bge_apesize, map_flags, sc-bge_apehandle) != 0) {
+			aprint_error_dev(sc-bge_dev,
+			couldn't map BAR2 memory\n);
+			return;
+		}
+		sc-bge_apetag = pa-pa_memt;
+#endif
 
 		/* Enable APE register/memory access by host driver. */
 		reg = pci_conf_read(pa-pa_pc, pa-pa_tag, BGE_PCI_PCISTATE);



CVS commit: src/sys/arch/evbarm/stand/bootimx23

2014-07-22 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Jul 22 17:46:59 UTC 2014

Modified Files:
src/sys/arch/evbarm/stand/bootimx23: Makefile

Log Message:
Override CPUFLAGS for compiler cpu-specific options, instead of appening
to CFLAGS. This allows the user to define CPUFLAGS without breaking the
build.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/stand/bootimx23/Makefile

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

Modified files:

Index: src/sys/arch/evbarm/stand/bootimx23/Makefile
diff -u src/sys/arch/evbarm/stand/bootimx23/Makefile:1.13 src/sys/arch/evbarm/stand/bootimx23/Makefile:1.14
--- src/sys/arch/evbarm/stand/bootimx23/Makefile:1.13	Sun Jan 12 15:26:29 2014
+++ src/sys/arch/evbarm/stand/bootimx23/Makefile	Tue Jul 22 17:46:59 2014
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.13 2014/01/12 15:26:29 tsutsui Exp $
+# $Id: Makefile,v 1.14 2014/07/22 17:46:59 bouyer Exp $
 
 S=		${.CURDIR}/../../../../
 PROG=		bootimx23
@@ -8,7 +8,7 @@ SRCS=		bootimx23.c power_prep.c clock_pr
 
 CLEANFILES+=	${PROG}
 CFLAGS+=	-Wall -Wno-main -ffreestanding -fno-unwind-tables
-CFLAGS+=	-march=armv5te -mtune=arm926ej-s
+CPUFLAGS=	-march=armv5te -mtune=arm926ej-s
 CPPFLAGS+=	-D_STANDALONE -DMEMSIZE=64
 CPPFLAGS+=	-DKERNEL_BOOT_ARGS=\root=ld0a\
 CPPFLAGS+=	-nostdinc -I. -I${.CURDIR} -I${.OBJDIR} -I${S} -I${S}/arch



CVS commit: src/external/mit/xorg/lib/dri

2014-07-22 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jul 22 18:14:25 UTC 2014

Modified Files:
src/external/mit/xorg/lib/dri/r200: Makefile
src/external/mit/xorg/lib/dri/r300: Makefile
src/external/mit/xorg/lib/dri/r600: Makefile

Log Message:
Fix source lists for radeon dri modules.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/mit/xorg/lib/dri/r200/Makefile
cvs rdiff -u -r1.9 -r1.10 src/external/mit/xorg/lib/dri/r300/Makefile
cvs rdiff -u -r1.6 -r1.7 src/external/mit/xorg/lib/dri/r600/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/lib/dri/r200/Makefile
diff -u src/external/mit/xorg/lib/dri/r200/Makefile:1.9 src/external/mit/xorg/lib/dri/r200/Makefile:1.10
--- src/external/mit/xorg/lib/dri/r200/Makefile:1.9	Wed Jul  9 20:22:55 2014
+++ src/external/mit/xorg/lib/dri/r200/Makefile	Tue Jul 22 18:14:25 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2014/07/09 20:22:55 riastradh Exp $
+# $NetBSD: Makefile,v 1.10 2014/07/22 18:14:25 riastradh Exp $
 
 MODULE=	r200
 
@@ -12,6 +12,7 @@ CPPFLAGS+=	-I${X11SRCDIR.MesaLib}/src/me
 DRI_EXTRA_PATHS=	${X11SRCDIR.MesaLib}/src/mesa/drivers/dri/radeon
 SRCS=	\
 	radeon_bo_legacy.c \
+	radeon_buffer_objects.c \
 	radeon_common_context.c \
 	radeon_common.c \
 	radeon_cs_legacy.c \
@@ -20,25 +21,30 @@ SRCS=	\
 	radeon_fbo.c \
 	radeon_lock.c \
 	radeon_mipmap_tree.c \
+	radeon_pixel_read.c \
 	radeon_queryobj.c \
 	radeon_span.c \
-	radeon_tex_copy.c \
 	radeon_texture.c \
-	r200_blit.c \
-	r200_context.c \
-	r200_ioctl.c \
-	r200_state.c \
-	r200_state_init.c \
-	r200_cmdbuf.c \
-	r200_tex.c \
-	r200_texstate.c \
-	r200_tcl.c \
-	r200_swtcl.c \
-	r200_maos.c \
-	r200_sanity.c \
-	r200_fragshader.c \
-	r200_vertprog.c \
-	radeon_screen.c
+	radeon_tex_copy.c \
+	radeon_tex_getimage.c \
+	radeon_tile.c
+
+SRCS+=	\
+		 r200_context.c \
+		 r200_ioctl.c \
+		 r200_state.c \
+		 r200_state_init.c \
+		 r200_cmdbuf.c \
+		 r200_tex.c \
+		 r200_texstate.c \
+		 r200_tcl.c \
+		 r200_swtcl.c \
+		 r200_maos.c \
+		 r200_sanity.c \
+		 r200_fragshader.c \
+		 r200_vertprog.c \
+		 r200_blit.c \
+		 radeon_screen.c
 
 SRCS+= \
 	radeon_cs_space_drm.c \

Index: src/external/mit/xorg/lib/dri/r300/Makefile
diff -u src/external/mit/xorg/lib/dri/r300/Makefile:1.9 src/external/mit/xorg/lib/dri/r300/Makefile:1.10
--- src/external/mit/xorg/lib/dri/r300/Makefile:1.9	Wed Jul  9 20:22:55 2014
+++ src/external/mit/xorg/lib/dri/r300/Makefile	Tue Jul 22 18:14:25 2014
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2014/07/09 20:22:55 riastradh Exp $
+# $NetBSD: Makefile,v 1.10 2014/07/22 18:14:25 riastradh Exp $
 
 MODULE=	r300
 
@@ -14,7 +14,10 @@ CPPFLAGS+=	-I${X11SRCDIR.MesaLib}/src/me
 		-I${X11SRCDIR.MesaLib}/src/glsl
 
 DRI_EXTRA_PATHS=	${X11SRCDIR.MesaLib}/src/mesa/drivers/dri/radeon \
-			${X11SRCDIR.MesaLib}/src/mesa/drivers/dri/r300/compiler
+			${X11SRCDIR.MesaLib}/src/mesa/drivers/dri/r300/compiler \
+			${X11SRCDIR.MesaLib}/src/glsl \
+			${X11SRCDIR.MesaLib}/src/mesa/program
+
 SRCS=	\
 	radeon_bo_legacy.c \
 	radeon_buffer_objects.c \
@@ -26,25 +29,30 @@ SRCS=	\
 	radeon_fbo.c \
 	radeon_lock.c \
 	radeon_mipmap_tree.c \
-	radeon_span.c \
+	radeon_pixel_read.c \
 	radeon_queryobj.c \
-	radeon_tex_copy.c \
+	radeon_span.c \
 	radeon_texture.c \
-	radeon_screen.c \
-	r300_blit.c \
-	r300_context.c \
-	r300_draw.c \
-	r300_cmdbuf.c \
-	r300_state.c \
-	r300_render.c \
-	r300_tex.c \
-	r300_texstate.c \
-	r300_vertprog.c \
-	r300_fragprog_common.c \
-	r300_shader.c \
-	radeon_mesa_to_rc.c \
-	r300_emit.c \
-	r300_swtcl.c
+	radeon_tex_copy.c \
+	radeon_tex_getimage.c \
+	radeon_tile.c
+
+SRCS+=	\
+		 radeon_screen.c \
+		 r300_blit.c \
+		 r300_context.c \
+		 r300_draw.c \
+		 r300_cmdbuf.c \
+		 r300_state.c \
+		 r300_render.c \
+		 r300_tex.c \
+		 r300_texstate.c \
+		 r300_vertprog.c \
+		 r300_fragprog_common.c \
+		 r300_shader.c \
+		 radeon_mesa_to_rc.c \
+		 r300_emit.c \
+		 r300_swtcl.c
 
 SRCS+= \
 	radeon_cs_space_drm.c \
@@ -53,28 +61,44 @@ SRCS+= \
 
 # r300/compiler
 SRCS+= \
-	radeon_code.c \
-	radeon_compiler.c \
-	radeon_program.c \
-	radeon_program_print.c \
-	radeon_opcodes.c \
-	radeon_program_alu.c \
-	radeon_program_pair.c \
-	radeon_pair_translate.c \
-	radeon_pair_schedule.c \
-	radeon_pair_regalloc.c \
-	radeon_dataflow.c \
-	radeon_dataflow_deadcode.c \
-	radeon_dataflow_swizzles.c \
-	r3xx_fragprog.c \
-	r300_fragprog.c \
-	r300_fragprog_swizzle.c \
-	r300_fragprog_emit.c \
-	r500_fragprog.c \
-	r500_fragprog_emit.c \
-	r3xx_vertprog.c \
-	r3xx_vertprog_dump.c \
-	memory_pool.c
+		radeon_code.c \
+		radeon_compiler.c \
+		radeon_compiler_util.c \
+		radeon_emulate_branches.c \
+		radeon_emulate_loops.c \
+		radeon_program.c \
+		radeon_program_print.c \
+		radeon_opcodes.c \
+		radeon_program_alu.c \
+		radeon_program_pair.c \
+		radeon_program_tex.c \
+		

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

2014-07-22 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Tue Jul 22 19:54:55 UTC 2014

Modified Files:
src/sys/arch/mips/include: sljitarch.h

Log Message:
Define SLJIT_CACHE_FLUSH() for mips.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/include/sljitarch.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/mips/include/sljitarch.h
diff -u src/sys/arch/mips/include/sljitarch.h:1.3 src/sys/arch/mips/include/sljitarch.h:1.4
--- src/sys/arch/mips/include/sljitarch.h:1.3	Sun Nov 17 12:01:58 2013
+++ src/sys/arch/mips/include/sljitarch.h	Tue Jul 22 19:54:55 2014
@@ -1,7 +1,7 @@
-/*	$NetBSD: sljitarch.h,v 1.3 2013/11/17 12:01:58 alnsn Exp $	*/
+/*	$NetBSD: sljitarch.h,v 1.4 2014/07/22 19:54:55 alnsn Exp $	*/
 
 /*-
- * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * Copyright (c) 2012,2014 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -29,8 +29,24 @@
 #ifndef _MIPS_SLJITARCH_H
 #define _MIPS_SLJITARCH_H
 
-#ifndef _LP64
+#ifdef _LP64
+#define SLJIT_CONFIG_MIPS_64 1
+#else
 #define SLJIT_CONFIG_MIPS_32 1
 #endif
 
+#include sys/types.h
+
+#ifdef _KERNEL
+#include mips/cache.h
+
+#define SLJIT_CACHE_FLUSH(from, to) mips_icache_sync_range( \
+	(vaddr_t)(from), (vsize_t)((const char *)(to) - (const char *)(from)))
+#else
+#include mips/cachectl.h
+
+#define SLJIT_CACHE_FLUSH(from, to) \
+	(void)_cacheflush((void*)(from), (size_t)((to) - (from)), ICACHE)
+#endif
+
 #endif



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

2014-07-22 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Tue Jul 22 20:16:39 UTC 2014

Modified Files:
src/sys/arch/arm/include: sljitarch.h

Log Message:
Add parentheses around macro arguments.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/include/sljitarch.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/include/sljitarch.h
diff -u src/sys/arch/arm/include/sljitarch.h:1.1 src/sys/arch/arm/include/sljitarch.h:1.2
--- src/sys/arch/arm/include/sljitarch.h:1.1	Tue Jun 17 06:36:39 2014
+++ src/sys/arch/arm/include/sljitarch.h	Tue Jul 22 20:16:39 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sljitarch.h,v 1.1 2014/06/17 06:36:39 alnsn Exp $	*/
+/*	$NetBSD: sljitarch.h,v 1.2 2014/07/22 20:16:39 alnsn Exp $	*/
 
 /*-
  * Copyright (c) 2014 Alexander Nasonov.
@@ -53,7 +53,7 @@
 	cpu_icache_sync_range((vaddr_t)(from), (vsize_t)((to) - (from)))
 #else
 #define SLJIT_CACHE_FLUSH(from, to) \
-	(void)arm_sync_icache((uintptr_t)(from), (size_t)(to - from))
+	(void)arm_sync_icache((uintptr_t)(from), (size_t)((to) - (from)))
 #endif
 
 #endif



CVS commit: src

2014-07-22 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Tue Jul 22 20:19:57 UTC 2014

Modified Files:
src/distrib/sets/lists/comp: md.cobalt md.pmax
src/sys/arch/cobalt/include: Makefile
src/sys/arch/pmax/include: Makefile
Added Files:
src/sys/arch/cobalt/include: sljitarch.h
src/sys/arch/pmax/include: sljitarch.h

Log Message:
Add sljitarch.h to cobalt and pmax.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/distrib/sets/lists/comp/md.cobalt
cvs rdiff -u -r1.63 -r1.64 src/distrib/sets/lists/comp/md.pmax
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/cobalt/include/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/arch/cobalt/include/sljitarch.h
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/pmax/include/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/arch/pmax/include/sljitarch.h

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.cobalt
diff -u src/distrib/sets/lists/comp/md.cobalt:1.24 src/distrib/sets/lists/comp/md.cobalt:1.25
--- src/distrib/sets/lists/comp/md.cobalt:1.24	Sun Jul 17 20:54:31 2011
+++ src/distrib/sets/lists/comp/md.cobalt	Tue Jul 22 20:19:57 2014
@@ -1,4 +1,4 @@
-# $NetBSD: md.cobalt,v 1.24 2011/07/17 20:54:31 joerg Exp $
+# $NetBSD: md.cobalt,v 1.25 2014/07/22 20:19:57 alnsn Exp $
 ./usr/include/cobaltcomp-c-include
 ./usr/include/cobalt/_G_config.h		comp-obsolete		obsolete
 ./usr/include/cobalt/ansi.h			comp-c-include
@@ -52,6 +52,7 @@
 ./usr/include/cobalt/rwlock.h			comp-c-include
 ./usr/include/cobalt/setjmp.h			comp-c-include
 ./usr/include/cobalt/signal.h			comp-c-include
+./usr/include/cobalt/sljitarch.h		comp-c-include
 ./usr/include/cobalt/stdarg.h			comp-obsolete		obsolete
 ./usr/include/cobalt/trap.h			comp-c-include
 ./usr/include/cobalt/types.h			comp-c-include

Index: src/distrib/sets/lists/comp/md.pmax
diff -u src/distrib/sets/lists/comp/md.pmax:1.63 src/distrib/sets/lists/comp/md.pmax:1.64
--- src/distrib/sets/lists/comp/md.pmax:1.63	Sun Jul 17 20:54:31 2011
+++ src/distrib/sets/lists/comp/md.pmax	Tue Jul 22 20:19:57 2014
@@ -1,4 +1,4 @@
-# $NetBSD: md.pmax,v 1.63 2011/07/17 20:54:31 joerg Exp $
+# $NetBSD: md.pmax,v 1.64 2014/07/22 20:19:57 alnsn Exp $
 ./usr/include/ieeefp.hcomp-c-include
 ./usr/include/pmaxcomp-c-include
 ./usr/include/pmax/_G_config.h			comp-obsolete		obsolete
@@ -58,6 +58,7 @@
 ./usr/include/pmax/rwlock.h			comp-c-include
 ./usr/include/pmax/setjmp.h			comp-c-include
 ./usr/include/pmax/signal.h			comp-c-include
+./usr/include/pmax/sljitarch.h			comp-c-include
 ./usr/include/pmax/stdarg.h			comp-obsolete		obsolete
 ./usr/include/pmax/tc_machdep.h			comp-c-include
 ./usr/include/pmax/trap.h			comp-c-include

Index: src/sys/arch/cobalt/include/Makefile
diff -u src/sys/arch/cobalt/include/Makefile:1.20 src/sys/arch/cobalt/include/Makefile:1.21
--- src/sys/arch/cobalt/include/Makefile:1.20	Sun Jul 17 20:54:38 2011
+++ src/sys/arch/cobalt/include/Makefile	Tue Jul 22 20:19:57 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.20 2011/07/17 20:54:38 joerg Exp $
+#	$NetBSD: Makefile,v 1.21 2014/07/22 20:19:57 alnsn Exp $
 
 INCSDIR= /usr/include/cobalt
 
@@ -17,7 +17,7 @@ INCS=	ansi.h asm.h autoconf.h \
 	nvram.h \
 	param.h pcb.h pmap.h pmc.h proc.h profile.h psl.h pte.h ptrace.h \
 	reg.h regdef.h regnum.h reloc.h rwlock.h \
-	setjmp.h signal.h \
+	setjmp.h signal.h sljitarch.h \
 	trap.h types.h \
 	vmparam.h \
 	wchar_limits.h

Index: src/sys/arch/pmax/include/Makefile
diff -u src/sys/arch/pmax/include/Makefile:1.35 src/sys/arch/pmax/include/Makefile:1.36
--- src/sys/arch/pmax/include/Makefile:1.35	Sun Jul 17 20:54:45 2011
+++ src/sys/arch/pmax/include/Makefile	Tue Jul 22 20:19:57 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.35 2011/07/17 20:54:45 joerg Exp $
+#	$NetBSD: Makefile,v 1.36 2014/07/22 20:19:57 alnsn Exp $
 
 INCSDIR= /usr/include/pmax
 
@@ -17,7 +17,7 @@ INCS=	ansi.h asm.h autoconf.h \
 	param.h pcb.h pmap.h pmc.h \
 	proc.h profile.h psl.h pte.h ptrace.h \
 	reg.h regdef.h regnum.h reloc.h rwlock.h \
-	setjmp.h signal.h \
+	setjmp.h signal.h sljitarch.h \
 	tc_machdep.h trap.h types.h \
 	vmparam.h \
 	wchar_limits.h

Added files:

Index: src/sys/arch/cobalt/include/sljitarch.h
diff -u /dev/null src/sys/arch/cobalt/include/sljitarch.h:1.1
--- /dev/null	Tue Jul 22 20:19:57 2014
+++ src/sys/arch/cobalt/include/sljitarch.h	Tue Jul 22 20:19:57 2014
@@ -0,0 +1,3 @@
+/*	$NetBSD: sljitarch.h,v 1.1 2014/07/22 20:19:57 alnsn Exp $	*/
+
+#include mips/sljitarch.h

Index: src/sys/arch/pmax/include/sljitarch.h
diff -u /dev/null src/sys/arch/pmax/include/sljitarch.h:1.1
--- /dev/null	Tue Jul 22 20:19:57 2014
+++ src/sys/arch/pmax/include/sljitarch.h	Tue Jul 22 20:19:57 2014
@@ -0,0 +1,3 @@
+/*	$NetBSD: sljitarch.h,v 1.1 2014/07/22 20:19:57 alnsn Exp $	*/
+
+#include mips/sljitarch.h



CVS commit: src/sys/rump

2014-07-22 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Tue Jul 22 20:25:13 UTC 2014

Modified Files:
src/sys/rump: Makefile.rump
src/sys/rump/kern/lib/libsljit: Makefile
Added Files:
src/sys/rump/kern/lib/libsljit: sljit_rump.h
src/sys/rump/kern/lib/libsljit/arch/mips: cache.c sljit_rump.c

Log Message:
Implement rumpcomp_sync_icache() hyprecall for mips and add
a barebone implementation if mips cache ops to librumpkern_sljit.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/rump/Makefile.rump
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/kern/lib/libsljit/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/rump/kern/lib/libsljit/sljit_rump.h
cvs rdiff -u -r0 -r1.1 src/sys/rump/kern/lib/libsljit/arch/mips/cache.c \
src/sys/rump/kern/lib/libsljit/arch/mips/sljit_rump.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/rump/Makefile.rump
diff -u src/sys/rump/Makefile.rump:1.98 src/sys/rump/Makefile.rump:1.99
--- src/sys/rump/Makefile.rump:1.98	Fri Jun 20 11:57:56 2014
+++ src/sys/rump/Makefile.rump	Tue Jul 22 20:25:13 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rump,v 1.98 2014/06/20 11:57:56 pooka Exp $
+#	$NetBSD: Makefile.rump,v 1.99 2014/07/22 20:25:13 alnsn Exp $
 #
 
 .if !defined(_RUMP_MK)
@@ -20,6 +20,16 @@ CPPFLAGS:=	-I${RUMPTOP}/include ${CPPFLA
 CPPFLAGS+=	-D_RUMPKERNEL -I${RUMPTOP}/librump/rumpkern
 .endif
 
+# Define baseline cpu for mips ports, required for
+# rumpcomp_sync_icache() hypercall.
+.if !empty(MACHINE_ARCH:Mmips*)
+.if !empty(MACHINE_ARCH:Mmips64*)
+CPPFLAGS+=	-DMIPS64=1
+.else
+CPPFLAGS+=	-DMIPS1=1
+.endif
+.endif
+
 CPPFLAGS+=	-DMAXUSERS=32
 CPPFLAGS+=	-DCOMPAT_50=1 -DCOMPAT_60=1
 

Index: src/sys/rump/kern/lib/libsljit/Makefile
diff -u src/sys/rump/kern/lib/libsljit/Makefile:1.1 src/sys/rump/kern/lib/libsljit/Makefile:1.2
--- src/sys/rump/kern/lib/libsljit/Makefile:1.1	Sat Nov 16 01:23:37 2013
+++ src/sys/rump/kern/lib/libsljit/Makefile	Tue Jul 22 20:25:13 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2013/11/16 01:23:37 rmind Exp $
+#	$NetBSD: Makefile,v 1.2 2014/07/22 20:25:13 alnsn Exp $
 #
 # Public Domain.
 #
@@ -10,5 +10,18 @@ LIB=	rumpkern_sljit
 
 SRCS=	sljitLir.c sljit_mod.c
 
+# NOTE This is not the best place for icache sync routine but only
+# sljit uses it at the moment.
+# XXX Think about a good hypercall interface (hi, pooka!) and move
+# this stuff to rumpuser.
+.if !empty(MACHINE_ARCH:Mmips*)
+SRCS+=			cache.c
+RUMPCOMP_USER_SRCS=	sljit_rump.c
+.PATH:			${.CURDIR}/arch/mips
+
+RUMPCOMP_INCS_DIR:=	${.PARSEDIR}
+RUMPCOMP_USER_CPPFLAGS=-I${RUMPCOMP_INCS_DIR}
+.endif
+
 .include bsd.lib.mk
 .include bsd.klinks.mk

Added files:

Index: src/sys/rump/kern/lib/libsljit/sljit_rump.h
diff -u /dev/null src/sys/rump/kern/lib/libsljit/sljit_rump.h:1.1
--- /dev/null	Tue Jul 22 20:25:13 2014
+++ src/sys/rump/kern/lib/libsljit/sljit_rump.h	Tue Jul 22 20:25:13 2014
@@ -0,0 +1,29 @@
+/*  $NetBSD: sljit_rump.h,v 1.1 2014/07/22 20:25:13 alnsn Exp $	*/
+
+/*-
+ * Copyright (c) 2014 Alexander Nasonov.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+int rumpcomp_sync_icache(void *, uint64_t);

Index: src/sys/rump/kern/lib/libsljit/arch/mips/cache.c
diff -u /dev/null src/sys/rump/kern/lib/libsljit/arch/mips/cache.c:1.1
--- /dev/null	Tue Jul 22 20:25:13 2014
+++ src/sys/rump/kern/lib/libsljit/arch/mips/cache.c	Tue Jul 22 20:25:13 2014
@@ -0,0 +1,52 @@
+/*  $NetBSD: cache.c,v 1.1 2014/07/22 20:25:13 alnsn Exp $	*/
+
+/*-
+ * Copyright (c) 2014 Alexander Nasonov.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted 

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

2014-07-22 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Tue Jul 22 20:41:37 UTC 2014

Modified Files:
src/sys/arch/sparc/include: sljitarch.h

Log Message:
Cast to sparc_cache_flush() argument types. This change makes it clear
thatr sparc_cache_flush() is defined by sljit (unlike other ports).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sparc/include/sljitarch.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/sparc/include/sljitarch.h
diff -u src/sys/arch/sparc/include/sljitarch.h:1.2 src/sys/arch/sparc/include/sljitarch.h:1.3
--- src/sys/arch/sparc/include/sljitarch.h:1.2	Sun Nov 17 12:01:58 2013
+++ src/sys/arch/sparc/include/sljitarch.h	Tue Jul 22 20:41:37 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sljitarch.h,v 1.2 2013/11/17 12:01:58 alnsn Exp $	*/
+/*	$NetBSD: sljitarch.h,v 1.3 2014/07/22 20:41:37 alnsn Exp $	*/
 
 /*-
  * Copyright (c) 2012-2013 The NetBSD Foundation, Inc.
@@ -34,6 +34,6 @@
 #endif
 
 #define SLJIT_CACHE_FLUSH(from, to) \
-	sparc_cache_flush((from), (to))
+	sparc_cache_flush((sljit_ins *)(from), (sljit_ins *)(to))
 
 #endif



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

2014-07-22 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Tue Jul 22 20:38:55 UTC 2014

Modified Files:
src/sys/arch/powerpc/include: sljitarch.h

Log Message:
Cast to __syncicache() argument types.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/powerpc/include/sljitarch.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/include/sljitarch.h
diff -u src/sys/arch/powerpc/include/sljitarch.h:1.2 src/sys/arch/powerpc/include/sljitarch.h:1.3
--- src/sys/arch/powerpc/include/sljitarch.h:1.2	Mon Nov 25 23:53:44 2013
+++ src/sys/arch/powerpc/include/sljitarch.h	Tue Jul 22 20:38:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sljitarch.h,v 1.2 2013/11/25 23:53:44 alnsn Exp $	*/
+/*	$NetBSD: sljitarch.h,v 1.3 2014/07/22 20:38:55 alnsn Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -39,6 +39,6 @@
 #endif
 
 #define SLJIT_CACHE_FLUSH(from, to) \
-	__syncicache((from), (to)-(from))
+	__syncicache((void *)(from), (size_t)((to) - (from)))
 
 #endif



CVS commit: src/sys/external/bsd/drm2/include/drm

2014-07-22 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jul 22 22:14:22 UTC 2014

Modified Files:
src/sys/external/bsd/drm2/include/drm: bus_dma_hacks.h

Log Message:
Free temporary segs on the way out of bus_dmamap_load_pglist.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.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/external/bsd/drm2/include/drm/bus_dma_hacks.h
diff -u src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h:1.5 src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h:1.6
--- src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h:1.5	Wed Jul 16 20:59:58 2014
+++ src/sys/external/bsd/drm2/include/drm/bus_dma_hacks.h	Tue Jul 22 22:14:22 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma_hacks.h,v 1.5 2014/07/16 20:59:58 riastradh Exp $	*/
+/*	$NetBSD: bus_dma_hacks.h,v 1.6 2014/07/22 22:14:22 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -162,12 +162,13 @@ bus_dmamap_load_pglist(bus_dma_tag_t tag
 		goto fail0;
 
 	/* Success!  */
-	return 0;
+	error = 0;
+	goto out;
 
 fail1: __unused
 	bus_dmamap_unload(tag, map);
 fail0:	KASSERT(error);
-	kmem_free(segs, (nsegs * sizeof(segs[0])));
+out:	kmem_free(segs, (nsegs * sizeof(segs[0])));
 	return error;
 }
 



CVS commit: src/lib/libnpf

2014-07-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jul 22 22:28:47 UTC 2014

Modified Files:
src/lib/libnpf: Makefile
Added Files:
src/lib/libnpf: libnpf.3
Removed Files:
src/lib/libnpf: npf.3

Log Message:
rename npf.3 - libnpf.3 per rmind@'s request


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libnpf/Makefile
cvs rdiff -u -r0 -r1.1 src/lib/libnpf/libnpf.3
cvs rdiff -u -r1.15 -r0 src/lib/libnpf/npf.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/libnpf/Makefile
diff -u src/lib/libnpf/Makefile:1.4 src/lib/libnpf/Makefile:1.5
--- src/lib/libnpf/Makefile:1.4	Thu Nov 29 11:17:14 2012
+++ src/lib/libnpf/Makefile	Tue Jul 22 18:28:47 2014
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.4 2012/11/29 16:17:14 christos Exp $
+# $NetBSD: Makefile,v 1.5 2014/07/22 22:28:47 christos Exp $
 
 .include bsd.own.mk
 
 USE_SHLIBDIR=   yes
 
 LIB=		npf
-MAN=		npf.3
+MAN=		libnpf.3
 
 SRCS=		npf.c
 

Added files:

Index: src/lib/libnpf/libnpf.3
diff -u /dev/null src/lib/libnpf/libnpf.3:1.1
--- /dev/null	Tue Jul 22 18:28:47 2014
+++ src/lib/libnpf/libnpf.3	Tue Jul 22 18:28:47 2014
@@ -0,0 +1,303 @@
+.\	$NetBSD: libnpf.3,v 1.1 2014/07/22 22:28:47 christos Exp $
+.\
+.\ Copyright (c) 2011-2013 The NetBSD Foundation, Inc.
+.\ All rights reserved.
+.\
+.\ This material is based upon work partially supported by The
+.\ NetBSD Foundation under a contract with Mindaugas Rasiukevicius.
+.\
+.\ Redistribution and use in source and binary forms, with or without
+.\ modification, are permitted provided that the following conditions
+.\ are met:
+.\ 1. Redistributions of source code must retain the above copyright
+.\notice, this list of conditions and the following disclaimer.
+.\ 2. Redistributions in binary form must reproduce the above copyright
+.\notice, this list of conditions and the following disclaimer in the
+.\documentation and/or other materials provided with the distribution.
+.\
+.\ THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\ POSSIBILITY OF SUCH DAMAGE.
+.\
+.Dd July 22, 2014
+.Dt LIBNPF 3
+.Os
+.Sh NAME
+.Nm libnpf
+.Nd NPF packet filter library
+.Sh LIBRARY
+.Lb libnpf
+.Sh SYNOPSIS
+.In npf.h
+.\ ---
+.Ft nl_config_t *
+.Fn npf_config_create void
+.Ft int
+.Fn npf_config_submit nl_config_t *ncf int fd
+.Ft void
+.Fn npf_config_destroy nl_config_t *ncf
+.Ft int
+.Fn npf_config_flush int fd
+.\ ---
+.Ft nl_rule_t *
+.Fn npf_rule_create char *name uint32_t attr const char *ifname
+.Ft int
+.Fn npf_rule_setcode nl_rule_t *rl int type const void *code size_t len
+.Ft int
+.Fn npf_rule_setkey nl_rule_t *rl int type const void *code size_t len
+.Ft bool
+.Fn npf_rule_exists_p nl_config_t *ncf const char *name
+.Ft int
+.Fn npf_rule_insert nl_config_t *ncf nl_rule_t *parent nl_rule_t *rl
+.Ft int
+.Fn npf_rule_setprio nl_rule_t *rl pri_t pri
+.Ft int
+.Fn npf_rule_setproc nl_config_t *ncf nl_rule_t *rl const char *name
+.Ft void
+.Fn npf_rule_destroy nl_rule_t *rl
+.\ ---
+.Ft nl_rproc_t *
+.Fn npf_rproc_create char *name
+.Ft bool
+.Fn npf_rproc_exists_p nl_config_t *ncf const char *name
+.Ft int
+.Fn npf_rproc_insert nl_config_t *ncf nl_rproc_t *rp
+.\ ---
+.Ft nl_nat_t *
+.Fn npf_nat_create int type u_int flags const char *ifname \
+npf_addr_t *addr int af in_port_t port
+.Ft int
+.Fn npf_nat_insert nl_config_t *ncf nl_nat_t *nt pri_t pri
+.\ ---
+.Ft nl_table_t *
+.Fn npf_table_create const char *name u_int id int type
+.Ft int
+.Fn npf_table_add_entry nl_table_t *tl int af \
+in_addr_t addr in_addr_t mask
+.Ft int
+.Fn npf_table_insert nl_config_t *ncf nl_table_t *tl
+.Ft void
+.Fn npf_table_destroy nl_table_t *tl
+.\ -
+.Sh DESCRIPTION
+The
+.Nm
+library provides an interface to create an NPF configuration having rules,
+tables, procedures, or translation policies.
+The configuration can be submitted to the kernel.
+.\ -
+.Sh FUNCTIONS
+.Ss Configuration
+.Bl -tag -width 4n
+.It Fn npf_config_create
+Create a configuration.
+.It Fn npf_config_submit ncf fd
+Submit configuration
+.Fa ncf
+to the kernel.
+.It Fn npf_config_destroy ncf
+Destroy the configuration
+.Fa ncf .
+.It Fn npf_config_flush fd
+Flush the current configuration.

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

2014-07-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jul 22 22:35:03 UTC 2014

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
rename npf man pages to libnpf.


To generate a diff of this commit:
cvs rdiff -u -r1.1899 -r1.1900 src/distrib/sets/lists/comp/mi

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.1899 src/distrib/sets/lists/comp/mi:1.1900
--- src/distrib/sets/lists/comp/mi:1.1899	Sun Jul 20 09:38:19 2014
+++ src/distrib/sets/lists/comp/mi	Tue Jul 22 18:35:03 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1899 2014/07/20 13:38:19 christos Exp $
+#	$NetBSD: mi,v 1.1900 2014/07/22 22:35:03 christos Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -7812,6 +7812,7 @@
 ./usr/share/man/cat3/libmj.0			comp-c-catman		crypto,.cat
 ./usr/share/man/cat3/libnetpgp.0		comp-c-catman		crypto,.cat
 ./usr/share/man/cat3/libnetpgpverify.0		comp-c-catman		crypto,.cat
+./usr/share/man/cat3/libnpf.0			comp-npf-catman		npf,.cat
 ./usr/share/man/cat3/libperfuse.0		comp-perfuse-catman	.cat
 ./usr/share/man/cat3/libquota.0			comp-c-catman		.cat
 ./usr/share/man/cat3/libradius.0		comp-c-catman		.cat
@@ -8064,7 +8065,7 @@
 ./usr/share/man/cat3/noqiflush.0		comp-c-catman		.cat
 ./usr/share/man/cat3/noraw.0			comp-c-catman		.cat
 ./usr/share/man/cat3/notimeout.0		comp-c-catman		.cat
-./usr/share/man/cat3/npf.0			comp-npf-catman		.cat,npf
+./usr/share/man/cat3/npf.0			comp-obsolete		obsolete
 ./usr/share/man/cat3/nrand48.0			comp-c-catman		.cat
 ./usr/share/man/cat3/ns.0			comp-obsolete		obsolete
 ./usr/share/man/cat3/ns_addr.0			comp-obsolete		obsolete
@@ -14617,6 +14618,7 @@
 ./usr/share/man/html3/libmj.html		comp-c-htmlman		crypto,html
 ./usr/share/man/html3/libnetpgp.html		comp-c-htmlman		crypto,html
 ./usr/share/man/html3/libnetpgpverify.html	comp-c-htmlman		crypto,html
+./usr/share/man/html3/libnpf.html		comp-npf-htmlman	npf,html
 ./usr/share/man/html3/libperfuse.html		comp-perfuse-htmlman	html
 ./usr/share/man/html3/libquota.html		comp-c-htmlman		html
 ./usr/share/man/html3/libradius.html		comp-c-htmlman		html
@@ -14856,7 +14858,7 @@
 ./usr/share/man/html3/noqiflush.html		comp-c-htmlman		html
 ./usr/share/man/html3/noraw.html		comp-c-htmlman		html
 ./usr/share/man/html3/notimeout.html		comp-c-htmlman		html
-./usr/share/man/html3/npf.html			comp-npf-htmlman	html,npf
+./usr/share/man/html3/npf.html			comp-obsolete		obsolete
 ./usr/share/man/html3/nrand48.html		comp-c-htmlman		html
 ./usr/share/man/html3/nsdispatch.html		comp-c-htmlman		html
 ./usr/share/man/html3/ntoa.html			comp-c-htmlman		html
@@ -21382,6 +21384,7 @@
 ./usr/share/man/man3/libmj.3			comp-c-man		crypto,.man
 ./usr/share/man/man3/libnetpgp.3		comp-c-man		crypto,.man
 ./usr/share/man/man3/libnetpgpverify.3		comp-c-man		crypto,.man
+./usr/share/man/man3/libnpf.3			comp-npf-man		npf,.man
 ./usr/share/man/man3/libperfuse.3		comp-perfuse-man	.man
 ./usr/share/man/man3/libquota.3			comp-c-man		.man
 ./usr/share/man/man3/libradius.3		comp-c-man		.man
@@ -21634,7 +21637,7 @@
 ./usr/share/man/man3/noqiflush.3		comp-c-man		.man
 ./usr/share/man/man3/noraw.3			comp-c-man		.man
 ./usr/share/man/man3/notimeout.3		comp-c-man		.man
-./usr/share/man/man3/npf.3			comp-npf-man		.man,npf
+./usr/share/man/man3/npf.3			comp-obsolete		obsolete
 ./usr/share/man/man3/nrand48.3			comp-c-man		.man
 ./usr/share/man/man3/ns.3			comp-obsolete		obsolete
 ./usr/share/man/man3/ns_addr.3			comp-obsolete		obsolete



CVS commit: src/lib/librumpuser

2014-07-22 Thread Justin Cormack
Module Name:src
Committed By:   justin
Date:   Tue Jul 22 22:41:58 UTC 2014

Modified Files:
src/lib/librumpuser: Makefile rumpfiber.c rumpuser.c rumpuser_int.h
rumpuser_port.h
Added Files:
src/lib/librumpuser: rumpuser_random.c

Log Message:
Clean up random implementation for librumpuser

Use /dev/urandom for platforms without arc4random, not srandom(),
deduplicate code, do not read excessive random bytes

Reviewed by pooka@


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/librumpuser/Makefile
cvs rdiff -u -r1.1 -r1.2 src/lib/librumpuser/rumpfiber.c
cvs rdiff -u -r1.61 -r1.62 src/lib/librumpuser/rumpuser.c
cvs rdiff -u -r1.9 -r1.10 src/lib/librumpuser/rumpuser_int.h
cvs rdiff -u -r1.33 -r1.34 src/lib/librumpuser/rumpuser_port.h
cvs rdiff -u -r0 -r1.1 src/lib/librumpuser/rumpuser_random.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/librumpuser/Makefile
diff -u src/lib/librumpuser/Makefile:1.20 src/lib/librumpuser/Makefile:1.21
--- src/lib/librumpuser/Makefile:1.20	Fri Jul 11 20:26:31 2014
+++ src/lib/librumpuser/Makefile	Tue Jul 22 22:41:58 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.20 2014/07/11 20:26:31 justin Exp $
+#	$NetBSD: Makefile,v 1.21 2014/07/22 22:41:58 justin Exp $
 #
 
 .include bsd.own.mk
@@ -41,7 +41,7 @@ SRCS+=		rumpfiber_sp.c
 .error Unsupported rumpuser threading type: ${RUMPUSER_THREADS}
 .endif
 
-SRCS+=		rumpuser_component.c
+SRCS+=		rumpuser_component.c rumpuser_random.c
 SRCS+=		rumpuser_file.c rumpuser_mem.c
 
 SRCS+=		rumpuser_errtrans.c rumpuser_sigtrans.c

Index: src/lib/librumpuser/rumpfiber.c
diff -u src/lib/librumpuser/rumpfiber.c:1.1 src/lib/librumpuser/rumpfiber.c:1.2
--- src/lib/librumpuser/rumpfiber.c:1.1	Fri Jul 11 20:26:31 2014
+++ src/lib/librumpuser/rumpfiber.c	Tue Jul 22 22:41:58 2014
@@ -66,7 +66,7 @@
 #include rumpuser_port.h
 
 #if !defined(lint)
-__RCSID($NetBSD: rumpfiber.c,v 1.1 2014/07/11 20:26:31 justin Exp $);
+__RCSID($NetBSD: rumpfiber.c,v 1.2 2014/07/22 22:41:58 justin Exp $);
 #endif /* !lint */
 
 #include sys/ioctl.h
@@ -416,20 +416,9 @@ rumpuser_init(int version, const struct 
 		return 1;
 	}
 
-#ifdef RUMPUSER_USE_DEVRANDOM
-	uint32_t rv;
-	int fd;
-
-	if ((fd = open(/dev/urandom, O_RDONLY)) == -1) {
-		srandom(time(NULL));
-	} else {
-		if (read(fd, rv, sizeof(rv)) != sizeof(rv))
-			srandom(time(NULL));
-		else
-			srandom(rv);
-		close(fd);
+	if (rumpuser__random_init() != 0) {
+		return 1;
 	}
-#endif
 
 rumpuser__hyp = *hyp;
 
@@ -570,26 +559,6 @@ rumpuser_kill(int64_t pid, int rumpsig)
 	return 0;
 }
 
-int
-rumpuser_getrandom(void *buf, size_t buflen, int flags, size_t *retp)
-{
-	size_t origlen = buflen;
-	uint32_t *p = buf;
-	uint32_t tmp;
-	int chunk;
-
-	do {
-		chunk = buflen  4 ? buflen : 4; /* portable MIN ... */
-		tmp = RUMPUSER_RANDOM();
-		memcpy(p, tmp, chunk);
-		p++;
-		buflen -= chunk;
-	} while (chunk);
-
-	*retp = origlen;
-	ET(0);
-}
-
 /* thread functions */
 
 TAILQ_HEAD(waithead, waiter);

Index: src/lib/librumpuser/rumpuser.c
diff -u src/lib/librumpuser/rumpuser.c:1.61 src/lib/librumpuser/rumpuser.c:1.62
--- src/lib/librumpuser/rumpuser.c:1.61	Thu Jul 10 08:17:43 2014
+++ src/lib/librumpuser/rumpuser.c	Tue Jul 22 22:41:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpuser.c,v 1.61 2014/07/10 08:17:43 justin Exp $	*/
+/*	$NetBSD: rumpuser.c,v 1.62 2014/07/22 22:41:58 justin Exp $	*/
 
 /*
  * Copyright (c) 2007-2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
 #include rumpuser_port.h
 
 #if !defined(lint)
-__RCSID($NetBSD: rumpuser.c,v 1.61 2014/07/10 08:17:43 justin Exp $);
+__RCSID($NetBSD: rumpuser.c,v 1.62 2014/07/22 22:41:58 justin Exp $);
 #endif /* !lint */
 
 #include sys/stat.h
@@ -64,20 +64,9 @@ rumpuser_init(int version, const struct 
 		return 1;
 	}
 
-#ifdef RUMPUSER_USE_DEVRANDOM
-	uint32_t rv;
-	int fd;
-
-	if ((fd = open(/dev/urandom, O_RDONLY)) == -1) {
-		srandom(time(NULL));
-	} else {
-		if (read(fd, rv, sizeof(rv)) != sizeof(rv))
-			srandom(time(NULL));
-		else
-			srandom(rv);
-		close(fd);
+	if (rumpuser__random_init() != 0) {
+		return 1;
 	}
-#endif
 
 	rumpuser__thrinit();
 	rumpuser__hyp = *hyp;
@@ -276,23 +265,3 @@ rumpuser_kill(int64_t pid, int rumpsig)
 		raise(sig);
 	return 0;
 }
-
-int
-rumpuser_getrandom(void *buf, size_t buflen, int flags, size_t *retp)
-{
-	size_t origlen = buflen;
-	uint32_t *p = buf;
-	uint32_t tmp;
-	int chunk;
-
-	do {
-		chunk = buflen  4 ? buflen : 4; /* portable MIN ... */
-		tmp = RUMPUSER_RANDOM();
-		memcpy(p, tmp, chunk);
-		p++;
-		buflen -= chunk;
-	} while (chunk);
-
-	*retp = origlen;
-	ET(0);
-}

Index: src/lib/librumpuser/rumpuser_int.h
diff -u src/lib/librumpuser/rumpuser_int.h:1.9 src/lib/librumpuser/rumpuser_int.h:1.10
--- src/lib/librumpuser/rumpuser_int.h:1.9	Thu Feb 20 01:24:49 2014
+++ src/lib/librumpuser/rumpuser_int.h	Tue Jul 22 22:41:58 2014
@@ -1,4 +1,4 @@
-/*	

CVS commit: src/sys/dev/usb

2014-07-22 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jul 22 23:06:29 UTC 2014

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

Log Message:
Remove (harmless) redundant assignment of task-queue in usb_add_task.


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.153 src/sys/dev/usb/usb.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/usb.c
diff -u src/sys/dev/usb/usb.c:1.152 src/sys/dev/usb/usb.c:1.153
--- src/sys/dev/usb/usb.c:1.152	Thu Jul 17 19:23:40 2014
+++ src/sys/dev/usb/usb.c	Tue Jul 22 23:06:29 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb.c,v 1.152 2014/07/17 19:23:40 riastradh Exp $	*/
+/*	$NetBSD: usb.c,v 1.153 2014/07/22 23:06:29 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1998, 2002, 2008, 2012 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: usb.c,v 1.152 2014/07/17 19:23:40 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: usb.c,v 1.153 2014/07/22 23:06:29 riastradh Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_compat_netbsd.h
@@ -364,7 +364,6 @@ usb_add_task(usbd_device_handle dev, str
 	USB_NUM_TASKQS) {
 		DPRINTFN(2,(usb_add_task: task=%p\n, task));
 		TAILQ_INSERT_TAIL(taskq-tasks, task, next);
-		task-queue = queue;
 		cv_signal(taskq-cv);
 	} else {
 		DPRINTFN(3,(usb_add_task: task=%p on q\n, task));



CVS commit: src/sys/net/npf

2014-07-22 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Wed Jul 23 01:48:05 UTC 2014

Modified Files:
src/sys/net/npf: npf.h

Log Message:
npf_iscached: add an assert.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/net/npf/npf.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/net/npf/npf.h
diff -u src/sys/net/npf/npf.h:1.45 src/sys/net/npf/npf.h:1.46
--- src/sys/net/npf/npf.h:1.45	Wed Jul 23 01:25:34 2014
+++ src/sys/net/npf/npf.h	Wed Jul 23 01:48:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf.h,v 1.45 2014/07/23 01:25:34 rmind Exp $	*/
+/*	$NetBSD: npf.h,v 1.46 2014/07/23 01:48:05 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2009-2014 The NetBSD Foundation, Inc.
@@ -172,6 +172,7 @@ typedef struct {
 static inline bool
 npf_iscached(const npf_cache_t *npc, const int inf)
 {
+	KASSERT(npc-npc_nbuf != NULL);
 	return __predict_true((npc-npc_info  inf) != 0);
 }
 



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

2014-07-22 Thread Lourival Pereira Vieira Neto
Module Name:src
Committed By:   lneto
Date:   Wed Jul 23 02:42:56 UTC 2014

Modified Files:
src/distrib/sets/lists/base: ad.arm ad.mips ad.powerpc md.amd64
md.sparc64 mi shl.mi

Log Message:
fixed removal of Lua 5.1 entries from distrib/sets/lists


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/distrib/sets/lists/base/ad.arm
cvs rdiff -u -r1.44 -r1.45 src/distrib/sets/lists/base/ad.mips
cvs rdiff -u -r1.13 -r1.14 src/distrib/sets/lists/base/ad.powerpc
cvs rdiff -u -r1.238 -r1.239 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.225 -r1.226 src/distrib/sets/lists/base/md.sparc64
cvs rdiff -u -r1.1075 -r1.1076 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.708 -r1.709 src/distrib/sets/lists/base/shl.mi

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/base/ad.arm
diff -u src/distrib/sets/lists/base/ad.arm:1.48 src/distrib/sets/lists/base/ad.arm:1.49
--- src/distrib/sets/lists/base/ad.arm:1.48	Sat Jul 19 18:38:33 2014
+++ src/distrib/sets/lists/base/ad.arm	Wed Jul 23 02:42:56 2014
@@ -1,4 +1,4 @@
-# $NetBSD: ad.arm,v 1.48 2014/07/19 18:38:33 lneto Exp $
+# $NetBSD: ad.arm,v 1.49 2014/07/23 02:42:56 lneto Exp $
 ./lib/oabi	base-compat-shlib	compat
 ./lib/oabi/npf	base-npf-shlib		compat
 ./lib/oabi/npf/ext_log.so			base-npf-shlib		compat,pic
@@ -333,6 +333,10 @@
 ./usr/lib/oabi/libz.so.1			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libz.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/oabi/luabase-compat-shlib	compat
+./usr/lib/oabi/lua/5.1base-obsolete		obsolete
+./usr/lib/oabi/lua/5.1/gpio.so			base-obsolete		obsolete
+./usr/lib/oabi/lua/5.1/sqlite.so		base-obsolete		obsolete
+./usr/lib/oabi/lua/5.1/syslog.so		base-obsolete		obsolete
 ./usr/lib/oabi/lua/5.3base-compat-shlib	compat
 ./usr/lib/oabi/lua/5.3/gpio.so			base-compat-shlib	compat,pic
 ./usr/lib/oabi/lua/5.3/sqlite.so		base-compat-shlib	compat,pic

Index: src/distrib/sets/lists/base/ad.mips
diff -u src/distrib/sets/lists/base/ad.mips:1.44 src/distrib/sets/lists/base/ad.mips:1.45
--- src/distrib/sets/lists/base/ad.mips:1.44	Sat Jul 19 18:38:33 2014
+++ src/distrib/sets/lists/base/ad.mips	Wed Jul 23 02:42:56 2014
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips,v 1.44 2014/07/19 18:38:33 lneto Exp $
+# $NetBSD: ad.mips,v 1.45 2014/07/23 02:42:56 lneto Exp $
 ./lib/64	base-compat-shlib	compat,arch64
 ./lib/64/npf	base-npf-shlib		compat,arch64
 ./lib/64/npf/ext_log.sobase-npf-shlib		compat,pic,arch64
@@ -329,6 +329,10 @@
 ./usr/lib/64/libz.so.1base-compat-shlib	compat,pic,arch64
 ./usr/lib/64/libz.so.1.0			base-compat-shlib	compat,pic,arch64
 ./usr/lib/64/luabase-compat-shlib	compat,arch64
+./usr/lib/64/lua/5.1base-obsolete		obsolete
+./usr/lib/64/lua/5.1/gpio.so			base-obsolete		obsolete
+./usr/lib/64/lua/5.1/sqlite.so			base-obsolete		obsolete
+./usr/lib/64/lua/5.1/syslog.so			base-obsolete		obsolete
 ./usr/lib/64/lua/5.3base-compat-shlib	compat,arch64
 ./usr/lib/64/lua/5.3/gpio.so			base-compat-shlib	compat,pic,arch64
 ./usr/lib/64/lua/5.3/sqlite.so			base-compat-shlib	compat,pic,arch64
@@ -664,6 +668,10 @@
 ./usr/lib/o32/libz.so.1base-compat-shlib	compat,pic,arch64
 ./usr/lib/o32/libz.so.1.0			base-compat-shlib	compat,pic,arch64
 ./usr/lib/o32/luabase-compat-shlib	compat,arch64
+./usr/lib/o32/lua/5.1base-obsolete		obsolete
+./usr/lib/o32/lua/5.1/gpio.so			base-obsolete		obsolete
+./usr/lib/o32/lua/5.1/sqlite.so			base-obsolete		obsolete
+./usr/lib/o32/lua/5.1/syslog.so			base-obsolete		obsolete
 ./usr/lib/o32/lua/5.3base-compat-shlib	compat,arch64
 ./usr/lib/o32/lua/5.3/gpio.so			base-compat-shlib	compat,pic,arch64
 ./usr/lib/o32/lua/5.3/sqlite.so			base-compat-shlib	compat,pic,arch64

Index: src/distrib/sets/lists/base/ad.powerpc
diff -u src/distrib/sets/lists/base/ad.powerpc:1.13 src/distrib/sets/lists/base/ad.powerpc:1.14
--- src/distrib/sets/lists/base/ad.powerpc:1.13	Sat Jul 19 18:38:33 2014
+++ src/distrib/sets/lists/base/ad.powerpc	Wed Jul 23 02:42:56 2014
@@ -1,4 +1,4 @@
-# $NetBSD: ad.powerpc,v 1.13 2014/07/19 18:38:33 lneto Exp $
+# $NetBSD: ad.powerpc,v 1.14 2014/07/23 02:42:56 lneto Exp $
 ./lib/powerpc	base-npf-shlib		compat,arch64
 ./lib/powerpc/npfbase-npf-shlib		compat,arch64
 ./lib/powerpc/npf/ext_log.so			base-npf-shlib		compat,arch64,pic
@@ -301,6 +301,10 @@
 ./usr/lib/powerpc/libz.so.1			base-compat-shlib	compat,arch64,pic
 ./usr/lib/powerpc/libz.so.1.0			base-compat-shlib	compat,arch64,pic
 ./usr/lib/powerpc/luabase-compat-shlib	compat,arch64
+./usr/lib/powerpc/lua/5.1			base-obsolete		obsolete
+./usr/lib/powerpc/lua/5.1/gpio.so		base-obsolete		obsolete
+./usr/lib/powerpc/lua/5.1/sqlite.so		base-obsolete		obsolete
+./usr/lib/powerpc/lua/5.1/syslog.so		base-obsolete		obsolete
 ./usr/lib/powerpc/lua/5.3			base-compat-shlib	compat,arch64
 ./usr/lib/powerpc/lua/5.3/gpio.so		base-compat-shlib	

CVS commit: src/sys/net

2014-07-22 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Jul 23 04:09:48 UTC 2014

Modified Files:
src/sys/net: if_bridge.c

Log Message:
Add missing unlock


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/net/if_bridge.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/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.88 src/sys/net/if_bridge.c:1.89
--- src/sys/net/if_bridge.c:1.88	Sun Jul 20 16:40:34 2014
+++ src/sys/net/if_bridge.c	Wed Jul 23 04:09:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.88 2014/07/20 16:40:34 ozaki-r Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.89 2014/07/23 04:09:48 ozaki-r Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_bridge.c,v 1.88 2014/07/20 16:40:34 ozaki-r Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_bridge.c,v 1.89 2014/07/23 04:09:48 ozaki-r Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_bridge_ipf.h
@@ -989,6 +989,7 @@ bridge_ioctl_gifs(struct bridge_softc *s
 		count++;
 
 	if (bifc-ifbic_len == 0) {
+		BRIDGE_UNLOCK(sc);
 		bifc-ifbic_len = sizeof(breq) * count;
 		return (0);
 	}



CVS commit: src

2014-07-22 Thread Hisashi T Fujinaka
Module Name:src
Committed By:   htodd
Date:   Wed Jul 23 05:00:39 UTC 2014

Modified Files:
src/lib/libnpf: npf.c
src/usr.sbin/npf/npfctl: npfctl.c

Log Message:
Build fix (use error when defined).


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/lib/libnpf/npf.c
cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/npf/npfctl/npfctl.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/libnpf/npf.c
diff -u src/lib/libnpf/npf.c:1.30 src/lib/libnpf/npf.c:1.31
--- src/lib/libnpf/npf.c:1.30	Wed Jul 23 01:25:34 2014
+++ src/lib/libnpf/npf.c	Wed Jul 23 05:00:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf.c,v 1.30 2014/07/23 01:25:34 rmind Exp $	*/
+/*	$NetBSD: npf.c,v 1.31 2014/07/23 05:00:38 htodd Exp $	*/
 
 /*-
  * Copyright (c) 2010-2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: npf.c,v 1.30 2014/07/23 01:25:34 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: npf.c,v 1.31 2014/07/23 05:00:38 htodd Exp $);
 
 #include sys/types.h
 #include netinet/in_systm.h
@@ -227,7 +227,7 @@ npf_config_export(const nl_config_t *ncf
 	if (!prop_dictionary_externalize_to_file(npf_dict, path)) {
 		error = errno;
 	}
-	return 0;
+	return error;
 }
 
 nl_config_t *

Index: src/usr.sbin/npf/npfctl/npfctl.c
diff -u src/usr.sbin/npf/npfctl/npfctl.c:1.41 src/usr.sbin/npf/npfctl/npfctl.c:1.42
--- src/usr.sbin/npf/npfctl/npfctl.c:1.41	Wed Jul 23 01:25:34 2014
+++ src/usr.sbin/npf/npfctl/npfctl.c	Wed Jul 23 05:00:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: npfctl.c,v 1.41 2014/07/23 01:25:34 rmind Exp $	*/
+/*	$NetBSD: npfctl.c,v 1.42 2014/07/23 05:00:38 htodd Exp $	*/
 
 /*-
  * Copyright (c) 2009-2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: npfctl.c,v 1.41 2014/07/23 01:25:34 rmind Exp $);
+__RCSID($NetBSD: npfctl.c,v 1.42 2014/07/23 05:00:38 htodd Exp $);
 
 #include sys/ioctl.h
 #include sys/stat.h
@@ -493,7 +493,7 @@ npfctl_save(int fd)
 	}
 	error = npf_config_export(ncf, NPF_DB_PATH);
 	npf_config_destroy(ncf);
-	return 0;
+	return error;
 }
 
 static int



CVS commit: src/sys/net

2014-07-22 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Jul 23 05:32:23 UTC 2014

Modified Files:
src/sys/net: if_bridge.c

Log Message:
Avoid calling copyout with holding mutex(IPL_NET)

Because copyout may lead a page fault that may sleep, we have to pull it
out from the critical section of mutex(IPL_NET) in bridge_ioctl_gifs.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/net/if_bridge.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/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.89 src/sys/net/if_bridge.c:1.90
--- src/sys/net/if_bridge.c:1.89	Wed Jul 23 04:09:48 2014
+++ src/sys/net/if_bridge.c	Wed Jul 23 05:32:23 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.89 2014/07/23 04:09:48 ozaki-r Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.90 2014/07/23 05:32:23 ozaki-r Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_bridge.c,v 1.89 2014/07/23 04:09:48 ozaki-r Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_bridge.c,v 1.90 2014/07/23 05:32:23 ozaki-r Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_bridge_ipf.h
@@ -979,8 +979,8 @@ bridge_ioctl_gifs(struct bridge_softc *s
 {
 	struct ifbifconf *bifc = arg;
 	struct bridge_iflist *bif;
-	struct ifbreq breq;
-	int count, len, error = 0;
+	struct ifbreq *breqs;
+	int i, count, error = 0;
 
 	BRIDGE_LOCK(sc);
 
@@ -988,37 +988,42 @@ bridge_ioctl_gifs(struct bridge_softc *s
 	LIST_FOREACH(bif, sc-sc_iflist, bif_next)
 		count++;
 
-	if (bifc-ifbic_len == 0) {
+	if (bifc-ifbic_len == 0 || bifc-ifbic_len  (sizeof(*breqs) * count)) {
 		BRIDGE_UNLOCK(sc);
-		bifc-ifbic_len = sizeof(breq) * count;
-		return (0);
+		/* Tell that a larger buffer is needed */
+		bifc-ifbic_len = sizeof(*breqs) * count;
+		return 0;
 	}
 
-	count = 0;
-	len = bifc-ifbic_len;
-	memset(breq, 0, sizeof breq);
+	breqs = malloc(sizeof(*breqs) * count, M_DEVBUF, M_NOWAIT);
+
+	i = 0;
 	LIST_FOREACH(bif, sc-sc_iflist, bif_next) {
-		if (len  sizeof(breq))
-			break;
+		struct ifbreq *breq = breqs[i++];
+		memset(breq, 0, sizeof(*breq));
+
+		strlcpy(breq-ifbr_ifsname, bif-bif_ifp-if_xname,
+		sizeof(breq-ifbr_ifsname));
+		breq-ifbr_ifsflags = bif-bif_flags;
+		breq-ifbr_state = bif-bif_state;
+		breq-ifbr_priority = bif-bif_priority;
+		breq-ifbr_path_cost = bif-bif_path_cost;
+		breq-ifbr_portno = bif-bif_ifp-if_index  0xff;
+	}
 
-		strlcpy(breq.ifbr_ifsname, bif-bif_ifp-if_xname,
-		sizeof(breq.ifbr_ifsname));
-		breq.ifbr_ifsflags = bif-bif_flags;
-		breq.ifbr_state = bif-bif_state;
-		breq.ifbr_priority = bif-bif_priority;
-		breq.ifbr_path_cost = bif-bif_path_cost;
-		breq.ifbr_portno = bif-bif_ifp-if_index  0xff;
-		error = copyout(breq, bifc-ifbic_req + count, sizeof(breq));
+	/* Don't call copyout with holding the mutex */
+	BRIDGE_UNLOCK(sc);
+
+	for (i = 0; i  count; i++) {
+		error = copyout(breqs[i], bifc-ifbic_req + i, sizeof(*breqs));
 		if (error)
 			break;
-		count++;
-		len -= sizeof(breq);
 	}
+	bifc-ifbic_len = sizeof(*breqs) * i;
 
-	BRIDGE_UNLOCK(sc);
+	free(breqs, M_DEVBUF);
 
-	bifc-ifbic_len = sizeof(breq) * count;
-	return (error);
+	return error;
 }
 
 static int