CVS commit: src/lib/libc/citrus

2011-03-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Mar 30 08:22:02 UTC 2011

Modified Files:
src/lib/libc/citrus: citrus_iconv.c citrus_prop.c citrus_prop.h

Log Message:
From Henning Petersen in PR # 44641: C99 primitive type 'bool' used
as a variable name. Also small KNF, as in FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/citrus/citrus_iconv.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/citrus/citrus_prop.c \
src/lib/libc/citrus/citrus_prop.h

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

Modified files:

Index: src/lib/libc/citrus/citrus_iconv.c
diff -u src/lib/libc/citrus/citrus_iconv.c:1.8 src/lib/libc/citrus/citrus_iconv.c:1.9
--- src/lib/libc/citrus/citrus_iconv.c:1.8	Sat Sep  5 06:44:27 2009
+++ src/lib/libc/citrus/citrus_iconv.c	Wed Mar 30 08:22:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_iconv.c,v 1.8 2009/09/05 06:44:27 dholland Exp $	*/
+/*	$NetBSD: citrus_iconv.c,v 1.9 2011/03/30 08:22:01 jruoho Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,22 +28,25 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: citrus_iconv.c,v 1.8 2009/09/05 06:44:27 dholland Exp $);
+__RCSID($NetBSD: citrus_iconv.c,v 1.9 2011/03/30 08:22:01 jruoho Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
 #include reentrant.h
+
+#include sys/types.h
+#include sys/queue.h
+
 #include assert.h
+#include dirent.h
+#include errno.h
+#include limits.h
+#include paths.h
+#include stdbool.h
 #include stdio.h
 #include stdlib.h
 #include string.h
-#include errno.h
-#include limits.h
 #include unistd.h
-#include paths.h
-#include dirent.h
-#include sys/types.h
-#include sys/queue.h
 
 #include citrus_namespace.h
 #include citrus_bcs.h
@@ -65,7 +68,8 @@
 #ifdef _REENTRANT
 static rwlock_t lock = RWLOCK_INITIALIZER;
 #endif
-static int isinit = 0;
+
+static bool isinit = false;
 static _CITRUS_HASH_HEAD(, _citrus_iconv_shared, CI_HASH_SIZE) shared_pool;
 static TAILQ_HEAD(, _citrus_iconv_shared) shared_unused;
 static int shared_num_unused, shared_max_reuse;
@@ -82,7 +86,7 @@
 			shared_max_reuse = atoi(getenv(CI_ENV_MAX_REUSE));
 		if (shared_max_reuse  0)
 			shared_max_reuse = CI_INITIAL_MAX_REUSE;
-		isinit = 1;
+		isinit = true;
 	}
 	rwlock_unlock(lock);
 }

Index: src/lib/libc/citrus/citrus_prop.c
diff -u src/lib/libc/citrus/citrus_prop.c:1.3 src/lib/libc/citrus/citrus_prop.c:1.4
--- src/lib/libc/citrus/citrus_prop.c:1.3	Wed Nov 22 23:47:21 2006
+++ src/lib/libc/citrus/citrus_prop.c	Wed Mar 30 08:22:01 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_prop.c,v 1.3 2006/11/22 23:47:21 tnozaki Exp $ */
+/* $NetBSD: citrus_prop.c,v 1.4 2011/03/30 08:22:01 jruoho Exp $ */
 
 /*-
  * Copyright (c)2006 Citrus Project,
@@ -29,12 +29,13 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: citrus_prop.c,v 1.3 2006/11/22 23:47:21 tnozaki Exp $);
+__RCSID($NetBSD: citrus_prop.c,v 1.4 2011/03/30 08:22:01 jruoho Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include assert.h
-#include limits.h
 #include errno.h
+#include limits.h
+#include stdbool.h
 #include stddef.h
 #include stdio.h
 #include stdint.h
@@ -51,7 +52,8 @@
 	_citrus_prop_type_t type;
 	union {
 		const char *str;
-		int bool, chr;
+		int chr;
+		bool boolean;
 		uint64_t num;
 	} u;
 } _citrus_prop_object_t;
@@ -228,7 +230,7 @@
 		if (_bcs_tolower(_memstream_getc(ms)) == 'r' 
 		_bcs_tolower(_memstream_getc(ms)) == 'u' 
 		_bcs_tolower(_memstream_getc(ms)) == 'e') {
-			obj-u.bool = 1;
+			obj-u.boolean = true;
 			return 0;
 		}
 		break;
@@ -237,7 +239,7 @@
 		_bcs_tolower(_memstream_getc(ms)) == 'l' 
 		_bcs_tolower(_memstream_getc(ms)) == 's' 
 		_bcs_tolower(_memstream_getc(ms)) == 'e') {
-			obj-u.bool = 0;
+			obj-u.boolean = false;
 			return 0;
 		}
 	}
@@ -406,11 +408,25 @@
 	errnum = (*hint-cb._func_.func)(context,	\
 	hint-name,	ostart.u._func_, oend.u._func_);\
 } while (/*CONSTCOND*/0)
+
 		switch (hint-type) {
-		case _CITRUS_PROP_BOOL: CALL0(bool); break;
-		case _CITRUS_PROP_STR : CALL0( str); break;
-		case _CITRUS_PROP_CHR : CALL1( chr); break;
-		case _CITRUS_PROP_NUM : CALL1( num); break;
+
+		case _CITRUS_PROP_BOOL:
+			CALL0(boolean);
+			break;
+
+		case _CITRUS_PROP_STR:
+			CALL0(str);
+			break;
+
+		case _CITRUS_PROP_CHR:
+			CALL1(chr);
+			break;
+
+		case _CITRUS_PROP_NUM:
+			CALL1(num);
+			break;
+
 		default:
 			abort();
 			/*NOTREACHED*/
Index: src/lib/libc/citrus/citrus_prop.h
diff -u src/lib/libc/citrus/citrus_prop.h:1.3 src/lib/libc/citrus/citrus_prop.h:1.4
--- src/lib/libc/citrus/citrus_prop.h:1.3	Thu Nov 23 13:59:03 2006
+++ src/lib/libc/citrus/citrus_prop.h	Wed Mar 30 08:22:01 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_prop.h,v 1.3 2006/11/23 13:59:03 tnozaki Exp $ */
+/* $NetBSD: citrus_prop.h,v 1.4 2011/03/30 08:22:01 jruoho Exp $ */
 
 /*-
  * Copyright (c)2006 Citrus Project,
@@ -45,7 +45,7 @@
 

CVS commit: src/tests

2011-03-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Mar 30 08:34:20 UTC 2011

Modified Files:
src/tests/include/sys: t_bitops.c
src/tests/lib/libc/gen: t_raise.c

Log Message:
Add missing __RCSID(3).


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/include/sys/t_bitops.c
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/gen/t_raise.c

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

Modified files:

Index: src/tests/include/sys/t_bitops.c
diff -u src/tests/include/sys/t_bitops.c:1.6 src/tests/include/sys/t_bitops.c:1.7
--- src/tests/include/sys/t_bitops.c:1.6	Fri Mar 25 10:42:38 2011
+++ src/tests/include/sys/t_bitops.c	Wed Mar 30 08:34:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_bitops.c,v 1.6 2011/03/25 10:42:38 jruoho Exp $ */
+/*	$NetBSD: t_bitops.c,v 1.7 2011/03/30 08:34:20 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -28,6 +28,8 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
+#include sys/cdefs.h
+__RCSID($NetBSD: t_bitops.c,v 1.7 2011/03/30 08:34:20 jruoho Exp $);
 
 #include atf-c.h
 

Index: src/tests/lib/libc/gen/t_raise.c
diff -u src/tests/lib/libc/gen/t_raise.c:1.1 src/tests/lib/libc/gen/t_raise.c:1.2
--- src/tests/lib/libc/gen/t_raise.c:1.1	Thu Mar 24 16:56:38 2011
+++ src/tests/lib/libc/gen/t_raise.c	Wed Mar 30 08:34:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_raise.c,v 1.1 2011/03/24 16:56:38 jruoho Exp $ */
+/*	$NetBSD: t_raise.c,v 1.2 2011/03/30 08:34:19 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -28,6 +28,8 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
+#include sys/cdefs.h
+__RCSID($NetBSD: t_raise.c,v 1.2 2011/03/30 08:34:19 jruoho Exp $);
 
 #include atf-c.h
 



CVS commit: src/libexec/ld.elf_so/arch/sparc64

2011-03-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Mar 30 08:37:52 UTC 2011

Modified Files:
src/libexec/ld.elf_so/arch/sparc64: mdreloc.c

Log Message:
Add support for 64 bit TLS relocations.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/libexec/ld.elf_so/arch/sparc64/mdreloc.c

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

Modified files:

Index: src/libexec/ld.elf_so/arch/sparc64/mdreloc.c
diff -u src/libexec/ld.elf_so/arch/sparc64/mdreloc.c:1.51 src/libexec/ld.elf_so/arch/sparc64/mdreloc.c:1.52
--- src/libexec/ld.elf_so/arch/sparc64/mdreloc.c:1.51	Fri Mar 25 18:07:06 2011
+++ src/libexec/ld.elf_so/arch/sparc64/mdreloc.c	Wed Mar 30 08:37:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mdreloc.c,v 1.51 2011/03/25 18:07:06 joerg Exp $	*/
+/*	$NetBSD: mdreloc.c,v 1.52 2011/03/30 08:37:52 martin Exp $	*/
 
 /*-
  * Copyright (c) 2000 Eduardo Horvath.
@@ -32,7 +32,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: mdreloc.c,v 1.51 2011/03/25 18:07:06 joerg Exp $);
+__RCSID($NetBSD: mdreloc.c,v 1.52 2011/03/30 08:37:52 martin Exp $);
 #endif /* not lint */
 
 #include errno.h
@@ -67,7 +67,7 @@
 #define _RF_U		0x0400		/* Unaligned */
 #define _RF_SZ(s)	(((s)  0xff)  8)	/* memory target size */
 #define _RF_RS(s)	( (s)  0xff)		/* right shift */
-static const int reloc_target_flags[] = {
+static const int reloc_target_flags[R_TYPE(TLS_TPOFF64)+1] = {
 	0,			/* NONE */
 	_RF_S|_RF_A|		_RF_SZ(8)  | _RF_RS(0),		/* RELOC_8 */
 	_RF_S|_RF_A|		_RF_SZ(16) | _RF_RS(0),		/* RELOC_16 */
@@ -125,6 +125,7 @@
 	_RF_S|_RF_A|		_RF_SZ(64) | _RF_RS(0),		/* REGISTER */
 	_RF_S|_RF_A|	_RF_U|	_RF_SZ(64) | _RF_RS(0),		/* UA64 */
 	_RF_S|_RF_A|	_RF_U|	_RF_SZ(16) | _RF_RS(0),		/* UA16 */
+/* TLS relocs not represented here! */
 };
 
 #ifdef RTLD_DEBUG_RELOC
@@ -139,7 +140,13 @@
 	HM10, LM22, PC_HH22, PC_HM10, PC_LM22, 
 	WDISP16, WDISP19, GLOB_JMP, 7, 5, 6,
 	DISP64, PLT64, HIX22, LOX10, H44, M44, 
-	L44, REGISTER, UA64, UA16
+	L44, REGISTER, UA64, UA16,
+	TLS_GD_HI22, TLS_GD_LO10, TLS_GD_ADD, TLS_GD_CALL,
+	TLS_LDM_HI22, TLS_LDM_LO10, TLS_LDM_ADD, TLS_LDM_CALL,
+	TLS_LDO_HIX22, TLS_LDO_LOX10, TLS_LDO_ADD, TLS_IE_HI22, 
+	TLS_IE_LO10, TLS_IE_LD, TLS_IE_LDX, TLS_IE_ADD, TLS_LE_HIX22, 
+	TLS_LE_LOX10, TLS_DTPMOD32, TLS_DTPMOD64, TLS_DTPOFF32, 
+	TLS_DTPOFF64, TLS_TPOFF32, TLS_TPOFF64,
 };
 #endif
 
@@ -150,6 +157,7 @@
 #define RELOC_USE_ADDEND(t)		((reloc_target_flags[t]  _RF_A) != 0)
 #define RELOC_TARGET_SIZE(t)		((reloc_target_flags[t]  8)  0xff)
 #define RELOC_VALUE_RIGHTSHIFT(t)	(reloc_target_flags[t]  0xff)
+#define RELOC_TLS(t)			(t = R_TYPE(TLS_GD_HI22))
 
 static const long reloc_target_bitmask[] = {
 #define _BM(x)	(~(-(1ULL  (x
@@ -325,14 +333,74 @@
 
 		/*
 		 * We use the fact that relocation types are an `enum'
-		 * Note: R_SPARC_UA16 is currently numerically largest.
+		 * Note: R_SPARC_TLS_TPOFF64 is currently numerically largest.
 		 */
-		if (type  R_TYPE(UA16))
+		if (type  R_TYPE(TLS_TPOFF64))
 			return (-1);
 
 		value = rela-r_addend;
 
 		/*
+		 * Handle TLS relocations here, they are different.
+		 */
+		if (RELOC_TLS(type)) {
+			switch (type) {
+case R_TYPE(TLS_DTPMOD64):
+	def = _rtld_find_symdef(symnum, obj,
+	defobj, false);
+	if (def == NULL)
+		return -1;
+
+	*where = (Elf64_Addr)defobj-tlsindex;
+
+	rdbg((TLS_DTPMOD64 %s in %s -- %p,
+	obj-strtab +
+	obj-symtab[symnum].st_name,
+	obj-path, (void *)*where));
+
+	break;
+
+case R_TYPE(TLS_DTPOFF64):
+	def = _rtld_find_symdef(symnum, obj,
+	defobj, false);
+	if (def == NULL)
+		return -1;
+
+	*where = (Elf64_Addr)(def-st_value
+	+ rela-r_addend);
+
+	rdbg((DTPOFF64 %s in %s -- %p,
+	obj-strtab +
+	obj-symtab[symnum].st_name,
+	obj-path, (void *)*where));
+
+	break;
+
+case R_TYPE(TLS_TPOFF64):
+	def = _rtld_find_symdef(symnum, obj,
+	defobj, false);
+	if (def == NULL)
+		return -1;
+
+	if (!defobj-tls_done 
+		_rtld_tls_offset_allocate(obj))
+		 return -1;
+
+	*where = (Elf64_Addr)(def-st_value -
+			defobj-tlsoffset +
+		rela-r_addend);
+
+		rdbg((TLS_TPOFF64 %s in %s -- %p,
+		obj-strtab +
+	obj-symtab[symnum].st_name,
+		obj-path, (void *)*where));
+
+			break;
+			}
+			continue;
+		}
+
+		/*
 		 * Handle relative relocs here, as an optimization.
 		 */
 		if (type == R_TYPE(RELATIVE)) {



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

2011-03-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Mar 30 09:23:26 UTC 2011

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

Log Message:
Enable TLS on sparc and sparc64


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/sparc/include/types.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/types.h
diff -u src/sys/arch/sparc/include/types.h:1.56 src/sys/arch/sparc/include/types.h:1.57
--- src/sys/arch/sparc/include/types.h:1.56	Thu Feb 24 04:28:48 2011
+++ src/sys/arch/sparc/include/types.h	Wed Mar 30 09:23:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.56 2011/02/24 04:28:48 joerg Exp $ */
+/*	$NetBSD: types.h,v 1.57 2011/03/30 09:23:26 martin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -128,8 +128,8 @@
 #endif
 
 #define	__HAVE_CPU_LWP_SETPRIVATE
-#if 0
 #define	__HAVE___LWP_GETPRIVATE_FAST
-#endif
+#define	__HAVE_TLS_VARIANT_II
+#define	__HAVE_COMMON___TLS_GET_ADDR
 
 #endif	/* _MACHTYPES_H_ */



CVS commit: src

2011-03-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Mar 30 09:43:22 UTC 2011

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/include: Makefile
src/tests/syscall: Makefile
Added Files:
src/tests/include: t_paths.c
src/tests/syscall: t_fsync.c

Log Message:
Add some basic tests for fsync(2) and paths.h.


To generate a diff of this commit:
cvs rdiff -u -r1.278 -r1.279 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.1 -r1.2 src/tests/include/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/include/t_paths.c
cvs rdiff -u -r1.9 -r1.10 src/tests/syscall/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/syscall/t_fsync.c

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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.278 src/distrib/sets/lists/tests/mi:1.279
--- src/distrib/sets/lists/tests/mi:1.278	Fri Mar 25 09:34:02 2011
+++ src/distrib/sets/lists/tests/mi	Wed Mar 30 09:43:21 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.278 2011/03/25 09:34:02 jruoho Exp $
+# $NetBSD: mi,v 1.279 2011/03/30 09:43:21 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -286,6 +286,7 @@
 ./usr/libdata/debug/usr/tests/include/t_bitstring.debug			tests-ipf-tests		debug,atf
 ./usr/libdata/debug/usr/tests/include/t_inttypes.debug			tests-ipf-tests		debug,atf
 ./usr/libdata/debug/usr/tests/include/t_limits.debug			tests-ipf-tests		debug,atf
+./usr/libdata/debug/usr/tests/include/t_paths.debug			tests-ipf-tests		debug,atf
 ./usr/libdata/debug/usr/tests/include/t_stdint.debug			tests-ipf-tests		debug,atf
 ./usr/libdata/debug/usr/tests/ipf	tests-ipf-tests
 ./usr/libdata/debug/usr/tests/kernel	tests-kernel-tests
@@ -564,6 +565,7 @@
 ./usr/libdata/debug/usr/tests/sbin/resize_ffstests-sbin-tests
 ./usr/libdata/debug/usr/tests/syscall	tests-syscall-debug
 ./usr/libdata/debug/usr/tests/syscall/t_cmsg.debug			tests-syscall-debug	debug,atf
+./usr/libdata/debug/usr/tests/syscall/t_fsync.debug			tests-syscall-debug	debug,atf
 ./usr/libdata/debug/usr/tests/syscall/t_timer.debug			tests-syscall-debug	debug,atf
 ./usr/libdata/debug/usr/tests/usr.bin	tests-sbin-tests
 ./usr/libdata/debug/usr/tests/usr.sbin	tests-sbin-tests
@@ -1337,6 +1339,7 @@
 ./usr/tests/include/t_bitstring			tests-include-tests	atf
 ./usr/tests/include/t_inttypes			tests-include-tests	atf
 ./usr/tests/include/t_limits			tests-include-tests	atf
+./usr/tests/include/t_paths			tests-include-tests	atf
 ./usr/tests/include/t_stdint			tests-include-tests	atf
 ./usr/tests/ipf	tests-ipf-tests
 ./usr/tests/ipf/Atffiletests-ipf-tests
@@ -2100,6 +2103,7 @@
 ./usr/tests/syscalltests-syscall-tests
 ./usr/tests/syscall/Atffile			tests-syscall-tests	atf
 ./usr/tests/syscall/t_cmsg			tests-syscall-tests	atf
+./usr/tests/syscall/t_fsync			tests-syscall-tests	atf
 ./usr/tests/syscall/t_timer			tests-syscall-tests	atf
 ./usr/tests/toolchain	tests-syscall-tests	atf
 ./usr/tests/toolchain/Atffile	tests-syscall-tests	atf

Index: src/tests/include/Makefile
diff -u src/tests/include/Makefile:1.1 src/tests/include/Makefile:1.2
--- src/tests/include/Makefile:1.1	Sat Jul 17 19:26:27 2010
+++ src/tests/include/Makefile	Wed Mar 30 09:43:22 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2010/07/17 19:26:27 jmmv Exp $
+# $NetBSD: Makefile,v 1.2 2011/03/30 09:43:22 jruoho Exp $
 
 NOMAN=		# defined
 
@@ -10,6 +10,7 @@
 TESTS_C=	t_bitstring
 TESTS_C+=	t_inttypes
 TESTS_C+=	t_limits
+TESTS_C+=	t_paths
 TESTS_C+=	t_stdint
 
 FILESDIR=	${TESTSDIR}

Index: src/tests/syscall/Makefile
diff -u src/tests/syscall/Makefile:1.9 src/tests/syscall/Makefile:1.10
--- src/tests/syscall/Makefile:1.9	Wed May 19 19:17:08 2010
+++ src/tests/syscall/Makefile	Wed Mar 30 09:43:21 2011
@@ -1,13 +1,13 @@
-# $NetBSD: Makefile,v 1.9 2010/05/19 19:17:08 jruoho Exp $
+# $NetBSD: Makefile,v 1.10 2011/03/30 09:43:21 jruoho Exp $
 
 .include bsd.own.mk
 
 TESTSDIR=	${TESTSBASE}/syscall
 
-TESTS_C+=	t_cmsg t_timer
+TESTS_C+=	t_cmsg t_fsync t_timer
 
-LDADD+=	-lrumpnet_local -lrumpnet_net -lrumpnet
-LDADD+=	-lrumpvfs -lrump -lrumpuser -lpthread
+LDADD.t_cmsg+=	-lrumpnet_local -lrumpnet_net -lrumpnet
+LDADD.t_cmsg+=	-lrumpvfs -lrump -lrumpuser -lpthread
 
 WARNS=		4
 

Added files:

Index: src/tests/include/t_paths.c
diff -u /dev/null src/tests/include/t_paths.c:1.1
--- /dev/null	Wed Mar 30 09:43:22 2011
+++ src/tests/include/t_paths.c	Wed Mar 30 09:43:22 2011
@@ -0,0 +1,195 @@
+/*	$NetBSD: t_paths.c,v 1.1 2011/03/30 09:43:22 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * 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 

CVS commit: src/lib/libcurses

2011-03-30 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Mar 30 09:47:03 UTC 2011

Modified Files:
src/lib/libcurses: curs_set.c

Log Message:
fflush the outfd after setting the cursor visibility so it takes effect
immediately.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libcurses/curs_set.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/libcurses/curs_set.c
diff -u src/lib/libcurses/curs_set.c:1.9 src/lib/libcurses/curs_set.c:1.10
--- src/lib/libcurses/curs_set.c:1.9	Wed Feb  3 15:34:40 2010
+++ src/lib/libcurses/curs_set.c	Wed Mar 30 09:47:02 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: curs_set.c,v 1.9 2010/02/03 15:34:40 roy Exp $	*/
+/*	$NetBSD: curs_set.c,v 1.10 2011/03/30 09:47:02 blymn Exp $	*/
 
 /*-
  * Copyright (c) 1998-2000 Brett Lymn
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: curs_set.c,v 1.9 2010/02/03 15:34:40 roy Exp $);
+__RCSID($NetBSD: curs_set.c,v 1.10 2011/03/30 09:47:02 blymn Exp $);
 #endif/* not lint */
 
 #include curses.h
@@ -59,6 +59,7 @@
 #endif
 _cursesi_screen-old_mode = 0;
 tputs(cursor_invisible, 0, __cputchar);
+fflush(_cursesi_screen-outfd);
 return old_one;
 			}
 			break;
@@ -70,6 +71,7 @@
 #endif
 _cursesi_screen-old_mode = 1;
 tputs(cursor_normal, 0, __cputchar);
+fflush(_cursesi_screen-outfd);
 return old_one;
 			}
 			break;
@@ -82,6 +84,7 @@
 #endif
 _cursesi_screen-old_mode = 2;
 tputs(cursor_visible, 0, __cputchar);
+fflush(_cursesi_screen-outfd);
 return old_one;
 			}
 			break;



CVS commit: src

2011-03-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Mar 30 10:06:59 UTC 2011

Modified Files:
src/distrib/sets/lists/comp: mi
src/share/man/man3: Makefile
Added Files:
src/share/man/man3: paths.3

Log Message:
Briefly document paths.h.


To generate a diff of this commit:
cvs rdiff -u -r1.1604 -r1.1605 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.70 -r1.71 src/share/man/man3/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man3/paths.3

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1604 src/distrib/sets/lists/comp/mi:1.1605
--- src/distrib/sets/lists/comp/mi:1.1604	Sat Mar 26 19:55:27 2011
+++ src/distrib/sets/lists/comp/mi	Wed Mar 30 10:06:58 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1604 2011/03/26 19:55:27 christos Exp $
+#	$NetBSD: mi,v 1.1605 2011/03/30 10:06:58 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -7591,6 +7591,7 @@
 ./usr/share/man/cat3/pam_vinfo.0		comp-c-catman		.cat,pam
 ./usr/share/man/cat3/pam_vprompt.0		comp-c-catman		.cat,pam
 ./usr/share/man/cat3/parsedate.0		comp-c-catman		.cat
+./usr/share/man/cat3/paths.0			comp-c-catman		.cat
 ./usr/share/man/cat3/pause.0			comp-c-catman		.cat
 ./usr/share/man/cat3/pcap.0			comp-c-catman		.cat
 ./usr/share/man/cat3/pcap_activate.0		comp-c-catman		.cat
@@ -13630,6 +13631,7 @@
 ./usr/share/man/html3/pam_vinfo.html		comp-c-htmlman		html,pam
 ./usr/share/man/html3/pam_vprompt.html		comp-c-htmlman		html,pam
 ./usr/share/man/html3/parsedate.html		comp-c-htmlman		html
+./usr/share/man/html3/paths.html		comp-c-htmlman		html
 ./usr/share/man/html3/pause.html		comp-c-htmlman		html
 ./usr/share/man/html3/pcap.html			comp-c-htmlman		html
 ./usr/share/man/html3/pcap_activate.html	comp-c-htmlman		html
@@ -19661,6 +19663,7 @@
 ./usr/share/man/man3/pam_vinfo.3		comp-c-man		.man,pam
 ./usr/share/man/man3/pam_vprompt.3		comp-c-man		.man,pam
 ./usr/share/man/man3/parsedate.3		comp-c-man		.man
+./usr/share/man/man3/paths.3			comp-c-man		.man
 ./usr/share/man/man3/pause.3			comp-c-man		.man
 ./usr/share/man/man3/pcap.3			comp-c-man		.man
 ./usr/share/man/man3/pcap_activate.3		comp-c-man		.man

Index: src/share/man/man3/Makefile
diff -u src/share/man/man3/Makefile:1.70 src/share/man/man3/Makefile:1.71
--- src/share/man/man3/Makefile:1.70	Sat Mar 19 04:59:44 2011
+++ src/share/man/man3/Makefile	Wed Mar 30 10:06:59 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.70 2011/03/19 04:59:44 jruoho Exp $
+#	$NetBSD: Makefile,v 1.71 2011/03/30 10:06:59 jruoho Exp $
 #	@(#)Makefile	8.2 (Berkeley) 12/13/93
 
 MAN=	_DIAGASSERT.3 __CONCAT.3 __UNCONST.3 CMSG_DATA.3 \
@@ -10,7 +10,7 @@
 	cdefs.3 dirent.3 dlfcn.3 dl_iterate_phdr.3 end.3 \
 	fast_divide32.3 ffs32.3 gcq.3 \
 	ilog2.3 intro.3 inttypes.3 iso646.3 \
-	makedev.3 offsetof.3 queue.3 rbtree.3 sigevent.3 \
+	makedev.3 offsetof.3 paths.3 queue.3 rbtree.3 sigevent.3 \
 	stdarg.3 stdbool.3 stddef.3 stdint.3 stdlib.3 sysexits.3 \
 	tgmath.3 timeradd.3 timeval.3 tree.3 typeof.3 types.3 varargs.3
 

Added files:

Index: src/share/man/man3/paths.3
diff -u /dev/null src/share/man/man3/paths.3:1.1
--- /dev/null	Wed Mar 30 10:06:59 2011
+++ src/share/man/man3/paths.3	Wed Mar 30 10:06:59 2011
@@ -0,0 +1,98 @@
+.\ $NetBSD: paths.3,v 1.1 2011/03/30 10:06:59 jruoho Exp $
+.\
+.\ Copyright (c) 2011 The NetBSD Foundation, Inc.
+.\ All rights reserved.
+.\
+.\ This code is derived from software contributed to The NetBSD Foundation
+.\ by Jukka Ruohonen.
+.\
+.\ 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 March 30, 2011
+.Os
+.Dt PATHS 3
+.Sh 

CVS commit: src/share/man/man7

2011-03-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Mar 30 10:08:02 UTC 2011

Modified Files:
src/share/man/man7: hier.7

Log Message:
Xref paths(3).


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/share/man/man7/hier.7

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

Modified files:

Index: src/share/man/man7/hier.7
diff -u src/share/man/man7/hier.7:1.96 src/share/man/man7/hier.7:1.97
--- src/share/man/man7/hier.7:1.96	Fri Jan 28 09:24:46 2011
+++ src/share/man/man7/hier.7	Wed Mar 30 10:08:02 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: hier.7,v 1.96 2011/01/28 09:24:46 wiz Exp $
+.\	$NetBSD: hier.7,v 1.97 2011/03/30 10:08:02 jruoho Exp $
 .\
 .\ Copyright (c) 1990, 1993, 1994
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\	@(#)hier.7	8.5 (Berkeley) 6/1/94
 .\
-.Dd January 27, 2011
+.Dd March 30, 2011
 .Dt HIER 7
 .Os
 .Sh NAME
@@ -1245,7 +1245,8 @@
 .Xr ls 1 ,
 .Xr whatis 1 ,
 .Xr whereis 1 ,
-.Xr which 1
+.Xr which 1 ,
+.Xr paths 3
 .Sh HISTORY
 A
 .Nm



CVS commit: src/doc

2011-03-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Mar 30 10:32:36 UTC 2011

Modified Files:
src/doc: CHANGES

Log Message:
Note TLS support for sparc and sparc64


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1529 src/doc/CHANGES:1.1530
--- src/doc/CHANGES:1.1529	Thu Mar 24 19:29:43 2011
+++ src/doc/CHANGES	Wed Mar 30 10:32:35 2011
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1529 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1530 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -971,3 +971,5 @@
 	sandpoint: D-Link DSM-G600 support. [phx 20110319]
 	shark: chipsfb now works on shark. [macallan 20110323]
 	postfix(1): Import version 2.8.2 [tron 20110323]
+	sparc: add TLS (thread locale storage) support.  [martin 20110330]
+	sparc64: add TLS (thread locale storage) support.  [martin 20110330]



CVS commit: src/usr.bin/usbhidctl

2011-03-30 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Mar 30 11:35:26 UTC 2011

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

Log Message:
Add long example describing how to find and configure multimedia
keys; based on Mihai Chelaru's description on current-users in February.
Bump date.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/usbhidctl/usbhidctl.1

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

Modified files:

Index: src/usr.bin/usbhidctl/usbhidctl.1
diff -u src/usr.bin/usbhidctl/usbhidctl.1:1.22 src/usr.bin/usbhidctl/usbhidctl.1:1.23
--- src/usr.bin/usbhidctl/usbhidctl.1:1.22	Wed Apr 30 13:11:01 2008
+++ src/usr.bin/usbhidctl/usbhidctl.1	Wed Mar 30 11:35:25 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: usbhidctl.1,v 1.22 2008/04/30 13:11:01 martin Exp $
+.\ $NetBSD: usbhidctl.1,v 1.23 2011/03/30 11:35:25 wiz Exp $
 .\
 .\ Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd October 26, 2006
+.Dd March 30, 2011
 .Dt USBHIDCTL 1
 .Os
 .Sh NAME
@@ -215,6 +215,30 @@
 Each can be individually accessed by providing an instance number.
 For example, to set the value for the first item:
 .Dl usbhidctl -f /dev/uhid0 -w 'Consumer_Control.Unassigned#0=1'
+.Pp
+Another example is configuring multimedia keys on a keyboard.
+First you would look in the
+.Xr dmesg 8
+output, which
+.Xr uhid 4
+devices are attached to the keyboard's
+.Xr uhidev 4
+device and use
+.Nm
+to see how the controls are reported:
+.Dl usbhidctl -f /dev/uhidX -lv -a
+Then press the special keys; you should see something like
+.Dv Consumer:Volume_Up
+etc.
+Then create a configuration file containing the actions, like:
+.Bd -literal -offset indent
+Consumer:Volume_Up  1   /usr/pkg/bin/dcop amarok player volumeUp 
+Consumer:Volume_Down1   /usr/pkg/bin/dcop amarok player volumeDown 
+Consumer:Mute   1   /usr/pkg/bin/dcop amarok player mute 
+.Ed
+and use
+.Dl usbhidaction -c /path/to/file -f /dev/uhidX
+once during your X startup.
 .Sh SEE ALSO
 .Xr usbhidaction 1 ,
 .Xr usbhid 3 ,



CVS commit: src/share/man/man7

2011-03-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Mar 30 11:41:48 UTC 2011

Modified Files:
src/share/man/man7: security.7

Log Message:
Add some random, but decent enough, reading material to SEE ALSO.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man7/security.7

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

Modified files:

Index: src/share/man/man7/security.7
diff -u src/share/man/man7/security.7:1.7 src/share/man/man7/security.7:1.8
--- src/share/man/man7/security.7:1.7	Sun Mar 20 13:07:38 2011
+++ src/share/man/man7/security.7	Wed Mar 30 11:41:48 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: security.7,v 1.7 2011/03/20 13:07:38 jruoho Exp $
+.\ $NetBSD: security.7,v 1.8 2011/03/30 11:41:48 jruoho Exp $
 .\
 .\ Copyright (c) 2006, 2011 Elad Efrat e...@netbsd.org
 .\ All rights reserved.
@@ -25,7 +25,7 @@
 .\ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd March 20, 2011
+.Dd March 30, 2011
 .Dt SECURITY 7
 .Os
 .Sh NAME
@@ -438,7 +438,46 @@
 .Xr options 4 ,
 .Xr paxctl 8 ,
 .Xr sysctl 8 ,
-.Xr veriexec 8
+.Xr veriexec 8 ,
+.Xr kauth 9
+.\
+.Rs
+.%A Joseph Kong
+.%B Designing BSD Rootkits: An Introduction to Kernel Hacking
+.%D 2007
+.%I No Starch Press
+.Re
+.\
+.Rs
+.%A Enrico Perla
+.%A Massimiliano Oldani
+.%B A Guide to Kernel Exploitation: Attacking the Core
+.%D 2010
+.%I Elsevier
+.Re
+.\
+.Rs
+.%A Erik Buchanan
+.%A Ryan Roemer
+.%A Hovav Shacham
+.%A Stefan Savage
+.%T When Good Instructions Go Bad: \
+Generalizing Return-Oriented Programming to RISC
+.%P 27-38
+.%O CCS '08: Proceedings of the 15th ACM Conference \
+on Computer and Communications Security
+.%I ACM Press
+.%D October 27-31, 2008
+.%U http://cseweb.ucsd.edu/~hovav/dist/sparc.pdf
+.Re
+.\
+.Rs
+.%A Sebastian Krahmer
+.%T x86-64 Buffer Overflow Exploits and \
+the Borrowed Code Chunks Exploitation Technique
+.%D September 28, 2005
+.%U http://www.suse.de/~krahmer/no-nx.pdf
+.Re
 .Sh AUTHORS
 Many of the security features were pioneered by
 .An Elad Efrat Aq e...@netbsd.org .



CVS commit: src/sys/dev/flash

2011-03-30 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Mar 30 14:34:26 UTC 2011

Modified Files:
src/sys/dev/flash: flash.c flash.h

Log Message:
Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/flash/flash.c src/sys/dev/flash/flash.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/flash/flash.c
diff -u src/sys/dev/flash/flash.c:1.1 src/sys/dev/flash/flash.c:1.2
--- src/sys/dev/flash/flash.c:1.1	Sat Feb 26 18:07:30 2011
+++ src/sys/dev/flash/flash.c	Wed Mar 30 14:34:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: flash.c,v 1.1 2011/02/26 18:07:30 ahoka Exp $	*/
+/*	$NetBSD: flash.c,v 1.2 2011/03/30 14:34:26 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2011 Department of Software Engineering,
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: flash.c,v 1.1 2011/02/26 18:07:30 ahoka Exp $);
+__KERNEL_RCSID(0, $NetBSD: flash.c,v 1.2 2011/03/30 14:34:26 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -487,6 +487,7 @@
 
 	return err;
 }
+
 int
 flashsize(dev_t dev)
 {
Index: src/sys/dev/flash/flash.h
diff -u src/sys/dev/flash/flash.h:1.1 src/sys/dev/flash/flash.h:1.2
--- src/sys/dev/flash/flash.h:1.1	Sat Feb 26 18:07:30 2011
+++ src/sys/dev/flash/flash.h	Wed Mar 30 14:34:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: flash.h,v 1.1 2011/02/26 18:07:30 ahoka Exp $	*/
+/*	$NetBSD: flash.h,v 1.2 2011/03/30 14:34:26 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2011 Department of Software Engineering,
@@ -75,7 +75,7 @@
 struct flash_erase_instruction {
 	flash_addr_t ei_addr;
 	flash_addr_t ei_len;
-	void (*ei_callback) (struct flash_erase_instruction *);
+	void (*ei_callback)(struct flash_erase_instruction *);
 	u_long ei_priv;
 	u_char ei_state;
 };
@@ -106,12 +106,12 @@
  * @block_isbad: checks if a block is bad on flash
  */
 struct flash_interface {
-	int (*erase) (device_t, struct flash_erase_instruction *);
-	int (*read) (device_t, off_t, size_t, size_t *, uint8_t *);
-	int (*write) (device_t, off_t, size_t, size_t *, const uint8_t *);
+	int (*erase)(device_t, struct flash_erase_instruction *);
+	int (*read)(device_t, off_t, size_t, size_t *, uint8_t *);
+	int (*write)(device_t, off_t, size_t, size_t *, const uint8_t *);
 	int (*block_markbad)(device_t, uint64_t);
 	int (*block_isbad)(device_t, uint64_t);
-	int (*sync) (device_t);
+	int (*sync)(device_t);
 
 	int (*submit)(device_t, struct buf *);
 
@@ -159,7 +159,7 @@
 {
 	size_t i;
 	for (i = offset; i  size; i++) {
-		if (((const uint8_t *) buf)[i] != patt)
+		if (((const uint8_t *)buf)[i] != patt)
 			return 0;
 	}
 	return 1;



CVS commit: src/share/man/man7

2011-03-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Mar 30 15:37:15 UTC 2011

Modified Files:
src/share/man/man7: c.7

Log Message:
Xref cdefs(3).


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/share/man/man7/c.7

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

Modified files:

Index: src/share/man/man7/c.7
diff -u src/share/man/man7/c.7:1.11 src/share/man/man7/c.7:1.12
--- src/share/man/man7/c.7:1.11	Wed Jan 19 00:06:22 2011
+++ src/share/man/man7/c.7	Wed Mar 30 15:37:15 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: c.7,v 1.11 2011/01/19 00:06:22 uwe Exp $
+.\ $NetBSD: c.7,v 1.12 2011/03/30 15:37:15 jruoho Exp $
 .\
 .\ Copyright (C) 2007, 2010 Gabor Kovesdan. All rights reserved.
 .\
@@ -25,7 +25,7 @@
 .\
 .\ $FreeBSD: src/share/man/man7/c99.7,v 1.1 2010/06/17 12:05:47 gabor Exp $
 .\
-.Dd December 17, 2010
+.Dd March 30, 2011
 .Dt C 7
 .Os
 .Sh NAME
@@ -165,7 +165,8 @@
 .Sh SEE ALSO
 .Xr c89 1 ,
 .Xr c99 1 ,
-.Xr cc 1
+.Xr cc 1 ,
+.Xr cdefs 3
 .Rs
 .%A Brian W. Kernighan
 .%A Dennis M. Ritchie



CVS commit: src/lib/libc/gen

2011-03-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Mar 30 16:37:09 UTC 2011

Modified Files:
src/lib/libc/gen: lockf.3

Log Message:
+ .Pp.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/gen/lockf.3

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

Modified files:

Index: src/lib/libc/gen/lockf.3
diff -u src/lib/libc/gen/lockf.3:1.10 src/lib/libc/gen/lockf.3:1.11
--- src/lib/libc/gen/lockf.3:1.10	Wed Apr 30 13:10:50 2008
+++ src/lib/libc/gen/lockf.3	Wed Mar 30 16:37:09 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: lockf.3,v 1.10 2008/04/30 13:10:50 martin Exp $
+.\ $NetBSD: lockf.3,v 1.11 2011/03/30 16:37:09 jruoho Exp $
 .\
 .\ Copyright (c) 1997 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd December 19, 1997
+.Dd March 30, 2011
 .Dt LOCKF 3
 .Os
 .Sh NAME
@@ -64,6 +64,7 @@
 The permissible values for
 .Fa function
 are as follows:
+.Pp
 .Bl -tag -width F_ULOCKXX -compact -offset indent
 .It Sy Function
 .Sy Description



CVS commit: src/lib/libc/gen

2011-03-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Mar 30 16:41:01 UTC 2011

Modified Files:
src/lib/libc/gen: uname.3

Log Message:
.Li - .Em.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/gen/uname.3

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

Modified files:

Index: src/lib/libc/gen/uname.3
diff -u src/lib/libc/gen/uname.3:1.11 src/lib/libc/gen/uname.3:1.12
--- src/lib/libc/gen/uname.3:1.11	Tue Apr 27 15:16:28 2010
+++ src/lib/libc/gen/uname.3	Wed Mar 30 16:41:00 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: uname.3,v 1.11 2010/04/27 15:16:28 jruoho Exp $
+.\	$NetBSD: uname.3,v 1.12 2011/03/30 16:41:00 jruoho Exp $
 .\
 .\ Copyright (c) 1994
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\	@(#)uname.3	8.1 (Berkeley) 1/4/94
 .\
-.Dd April 27, 2010
+.Dd March 30, 2011
 .Dt UNAME 3
 .Os
 .Sh NAME
@@ -49,7 +49,7 @@
 .Fa name .
 .Pp
 The
-.Li utsname
+.Em utsname
 structure is defined in the
 .In sys/utsname.h
 header file, and contains the following members:



CVS commit: src

2011-03-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Mar 30 17:02:17 UTC 2011

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/lib/libutil: Makefile
Added Files:
src/tests/lib/libutil: t_efun.c

Log Message:
Add some naive tests for the efun(3) family of debug functions.


To generate a diff of this commit:
cvs rdiff -u -r1.280 -r1.281 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libutil/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libutil/t_efun.c

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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.280 src/distrib/sets/lists/tests/mi:1.281
--- src/distrib/sets/lists/tests/mi:1.280	Wed Mar 30 11:43:15 2011
+++ src/distrib/sets/lists/tests/mi	Wed Mar 30 17:02:17 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.280 2011/03/30 11:43:15 he Exp $
+# $NetBSD: mi,v 1.281 2011/03/30 17:02:17 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -499,6 +499,7 @@
 ./usr/libdata/debug/usr/tests/lib/libskeytests-lib-debug
 ./usr/libdata/debug/usr/tests/lib/libskey/t_algorithms.debug		tests-lib-debug		debug,atf,skey
 ./usr/libdata/debug/usr/tests/lib/libutiltests-lib-debug
+./usr/libdata/debug/usr/tests/lib/libutil/t_efun.debug			tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libutil/t_parsedate.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libutil/t_pidfile.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libutil/t_snprintb.debug		tests-lib-debug		debug,atf
@@ -1986,6 +1987,7 @@
 ./usr/tests/lib/libskey/t_algorithms		tests-lib-tests		atf,skey
 ./usr/tests/lib/libutiltests-lib-tests		atf
 ./usr/tests/lib/libutil/Atffile			tests-lib-tests		atf
+./usr/tests/lib/libutil/t_efun			tests-lib-tests		atf
 ./usr/tests/lib/libutil/t_parsedate		tests-lib-tests		atf
 ./usr/tests/lib/libutil/t_pidfile		tests-lib-tests		atf
 ./usr/tests/lib/libutil/t_snprintb		tests-lib-tests		atf

Index: src/tests/lib/libutil/Makefile
diff -u src/tests/lib/libutil/Makefile:1.3 src/tests/lib/libutil/Makefile:1.4
--- src/tests/lib/libutil/Makefile:1.3	Tue Mar 22 23:07:32 2011
+++ src/tests/lib/libutil/Makefile	Wed Mar 30 17:02:17 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2011/03/22 23:07:32 jmmv Exp $
+# $NetBSD: Makefile,v 1.4 2011/03/30 17:02:17 jruoho Exp $
 
 NOMAN=		# defined
 
@@ -9,7 +9,8 @@
 DPADD+=		${LIBUTIL}
 LDADD+=		-lutil
 
-TESTS_C=	t_parsedate
+TESTS_C=	t_efun
+TESTS_C+=	t_parsedate
 TESTS_C+=	t_pidfile
 TESTS_C+=	t_snprintb
 TESTS_C+=	t_sockaddr_snprintf

Added files:

Index: src/tests/lib/libutil/t_efun.c
diff -u /dev/null src/tests/lib/libutil/t_efun.c:1.1
--- /dev/null	Wed Mar 30 17:02:17 2011
+++ src/tests/lib/libutil/t_efun.c	Wed Mar 30 17:02:17 2011
@@ -0,0 +1,132 @@
+/*	$NetBSD: t_efun.c,v 1.1 2011/03/30 17:02:17 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * 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.
+ */
+
+#include atf-c.h
+
+#include stdint.h
+#include stdlib.h
+#include util.h
+
+static bool	fail;
+static void	handler(int, const char *, ...);
+
+static void
+handler(int ef, const char *fmt, ...)
+{
+	fail = false;
+}
+
+ATF_TC(ecalloc);
+ATF_TC_HEAD(ecalloc, tc)
+{
+	atf_tc_set_md_var(tc, descr, A basic test of ecalloc(3));
+}
+
+ATF_TC_BODY(ecalloc, tc)
+{
+	char *x;
+
+	fail = true;
+	x = ecalloc(-1, 1);
+
+	ATF_REQUIRE(x == NULL);
+	ATF_REQUIRE(fail != true);
+
+	fail = 

CVS commit: src/tests/lib/libutil

2011-03-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Mar 30 17:03:02 UTC 2011

Modified Files:
src/tests/lib/libutil: t_efun.c

Log Message:
Add missing __RCSID(3), again.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libutil/t_efun.c

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

Modified files:

Index: src/tests/lib/libutil/t_efun.c
diff -u src/tests/lib/libutil/t_efun.c:1.1 src/tests/lib/libutil/t_efun.c:1.2
--- src/tests/lib/libutil/t_efun.c:1.1	Wed Mar 30 17:02:17 2011
+++ src/tests/lib/libutil/t_efun.c	Wed Mar 30 17:03:02 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_efun.c,v 1.1 2011/03/30 17:02:17 jruoho Exp $ */
+/*	$NetBSD: t_efun.c,v 1.2 2011/03/30 17:03:02 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -28,6 +28,8 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
+#include sys/cdefs.h
+__RCSID($NetBSD: t_efun.c,v 1.2 2011/03/30 17:03:02 jruoho Exp $);
 
 #include atf-c.h
 



CVS commit: src/sys/external/bsd/drm/dist/shared-core

2011-03-30 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed Mar 30 17:21:05 UTC 2011

Modified Files:
src/sys/external/bsd/drm/dist/shared-core: radeon_cp.c

Log Message:
Add missing agp.h include file.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/drm/dist/shared-core/radeon_cp.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/drm/dist/shared-core/radeon_cp.c
diff -u src/sys/external/bsd/drm/dist/shared-core/radeon_cp.c:1.10 src/sys/external/bsd/drm/dist/shared-core/radeon_cp.c:1.11
--- src/sys/external/bsd/drm/dist/shared-core/radeon_cp.c:1.10	Sun Mar 27 08:45:11 2011
+++ src/sys/external/bsd/drm/dist/shared-core/radeon_cp.c	Wed Mar 30 17:21:04 2011
@@ -35,6 +35,10 @@
 #include radeon_drv.h
 #include r300_reg.h
 
+#if defined(__NetBSD__)
+#include agp.h
+#endif
+
 #define RADEON_FIFO_DEBUG	0
 
 static int radeon_do_cleanup_cp(struct drm_device * dev);



CVS commit: src/sys/dev/ic

2011-03-30 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Wed Mar 30 17:52:45 UTC 2011

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

Log Message:
IFF_PROMISC implys IFF_ALLMULTI.
Should fix PR#43186.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sys/dev/ic/i82557.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/i82557.c
diff -u src/sys/dev/ic/i82557.c:1.136 src/sys/dev/ic/i82557.c:1.137
--- src/sys/dev/ic/i82557.c:1.136	Sat Nov 13 08:55:13 2010
+++ src/sys/dev/ic/i82557.c	Wed Mar 30 17:52:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: i82557.c,v 1.136 2010/11/13 08:55:13 uebayasi Exp $	*/
+/*	$NetBSD: i82557.c,v 1.137 2011/03/30 17:52:45 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: i82557.c,v 1.136 2010/11/13 08:55:13 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: i82557.c,v 1.137 2011/03/30 17:52:45 jakllsch Exp $);
 
 #include rnd.h
 
@@ -2237,7 +2237,13 @@
 		panic(fxp_mc_setup: pending transmissions);
 #endif
 
-	ifp-if_flags = ~IFF_ALLMULTI;
+
+	if (ifp-if_flags  IFF_PROMISC) {
+		ifp-if_flags |= IFF_ALLMULTI;
+		return;
+	} else {
+		ifp-if_flags = ~IFF_ALLMULTI;
+	}
 
 	/*
 	 * Initialize multicast setup descriptor.



CVS commit: src/sys/net

2011-03-30 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Mar 30 18:04:27 UTC 2011

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

Log Message:
Allocate buffers with (M_WAITOK | M_CANFAIL) instead of M_NOWAIT.
M_NOWAIT cause dhcpd on a low-memory server with lots of interfaces to
occasionally fail to start with ENOBUFS; (M_WAITOK | M_CANFAIL) seems to
fix this.
Tested on 3 different dhcp servers.


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/sys/net/bpf.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/bpf.c
diff -u src/sys/net/bpf.c:1.162 src/sys/net/bpf.c:1.163
--- src/sys/net/bpf.c:1.162	Sat Jan 22 19:12:58 2011
+++ src/sys/net/bpf.c	Wed Mar 30 18:04:27 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.162 2011/01/22 19:12:58 christos Exp $	*/
+/*	$NetBSD: bpf.c,v 1.163 2011/03/30 18:04:27 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bpf.c,v 1.162 2011/01/22 19:12:58 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: bpf.c,v 1.163 2011/03/30 18:04:27 bouyer Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_bpf.h
@@ -1607,10 +1607,10 @@
 bpf_allocbufs(struct bpf_d *d)
 {
 
-	d-bd_fbuf = malloc(d-bd_bufsize, M_DEVBUF, M_NOWAIT);
+	d-bd_fbuf = malloc(d-bd_bufsize, M_DEVBUF, M_WAITOK | M_CANFAIL);
 	if (!d-bd_fbuf)
 		return (ENOBUFS);
-	d-bd_sbuf = malloc(d-bd_bufsize, M_DEVBUF, M_NOWAIT);
+	d-bd_sbuf = malloc(d-bd_bufsize, M_DEVBUF, M_WAITOK | M_CANFAIL);
 	if (!d-bd_sbuf) {
 		free(d-bd_fbuf, M_DEVBUF);
 		return (ENOBUFS);



CVS commit: src/sys/dev/pci

2011-03-30 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Mar 30 18:11:37 UTC 2011

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

Log Message:
Some bus_dma(9)-related and memory allocation fixes:
- always bus_dmamap_unload() before recycling a receive descriptor
- make sure to not sleep from interrupt context: call bus_dmamap_load with
  M_NOWAIT, and create dma maps BUS_DMA_ALLOCNOW.
- if a receive descriptor has a NULL mbuf try to allocate a new one, don't
  try to receive it.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/if_jme.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_jme.c
diff -u src/sys/dev/pci/if_jme.c:1.16 src/sys/dev/pci/if_jme.c:1.17
--- src/sys/dev/pci/if_jme.c:1.16	Sun Jan  9 00:12:45 2011
+++ src/sys/dev/pci/if_jme.c	Wed Mar 30 18:11:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_jme.c,v 1.16 2011/01/09 00:12:45 kochi Exp $	*/
+/*	$NetBSD: if_jme.c,v 1.17 2011/03/30 18:11:37 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2008 Manuel Bouyer.  All rights reserved.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_jme.c,v 1.16 2011/01/09 00:12:45 kochi Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_jme.c,v 1.17 2011/03/30 18:11:37 bouyer Exp $);
 
 
 #include sys/param.h
@@ -439,13 +439,14 @@
 	for (i = 0; i  JME_NBUFS; i++) {
 		sc-jme_txmbuf[i] = sc-jme_rxmbuf[i] = NULL;
 		if (bus_dmamap_create(sc-jme_dmatag, JME_MAX_TX_LEN,
-		JME_NBUFS, JME_MAX_TX_LEN, 0, BUS_DMA_NOWAIT,
+		JME_NBUFS, JME_MAX_TX_LEN, 0,
+		BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW,
 		sc-jme_txmbufm[i]) != 0) {
 			aprint_error_dev(self, can't allocate DMA TX map\n);
 			return;
 		}
 		if (bus_dmamap_create(sc-jme_dmatag, JME_MAX_RX_LEN,
-		1, JME_MAX_RX_LEN, 0, BUS_DMA_NOWAIT,
+		1, JME_MAX_RX_LEN, 0, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW,
 		sc-jme_rxmbufm[i]) != 0) {
 			aprint_error_dev(self, can't allocate DMA RX map\n);
 			return;
@@ -706,6 +707,8 @@
 	}
 	map = sc-jme_rxmbufm[i];
 	m-m_len = m-m_pkthdr.len = m-m_ext.ext_size;
+	KASSERT(m-m_len == MCLBYTES);
+
 	error = bus_dmamap_load_mbuf(sc-jme_dmatag, map, m,
 	BUS_DMA_READ|BUS_DMA_NOWAIT);
 	if (error) {
@@ -1051,6 +1054,7 @@
 static void
 jme_intr_rx(jme_softc_t *sc) {
 	struct mbuf *m, *mhead;
+	bus_dmamap_t mmap;
 	struct ifnet *ifp = sc-jme_if;
 	uint32_t flags,  buflen;
 	int i, ipackets, nsegs, seg, error;
@@ -1064,7 +1068,7 @@
 	sc-jme_rx_cons, le32toh(sc-jme_rxring[sc-jme_rx_cons].flags));
 #endif
 	ipackets = 0;
-	while((le32toh(sc-jme_rxring[ sc-jme_rx_cons].flags)  JME_RD_OWN)
+	while((le32toh(sc-jme_rxring[sc-jme_rx_cons].flags)  JME_RD_OWN)
 	== 0) {
 		i = sc-jme_rx_cons;
 		desc = sc-jme_rxring[i];
@@ -1072,11 +1076,19 @@
 		printf(rxintr i %d flags 0x%x buflen 0x%x\n,
 		i,  le32toh(desc-flags), le32toh(desc-buflen));
 #endif
+		if (sc-jme_rxmbuf[i] == NULL) {
+			if ((error = jme_add_rxbuf(sc, NULL)) != 0) {
+aprint_error_dev(sc-jme_dev,
+can't add new mbuf to empty slot: %d\n,
+error);
+break;
+			}
+			JME_DESC_INC(sc-jme_rx_cons, JME_NBUFS);
+			i = sc-jme_rx_cons;
+			continue;
+		}
 		if ((le32toh(desc-buflen)  JME_RD_VALID) == 0)
 			break;
-		bus_dmamap_sync(sc-jme_dmatag, sc-jme_rxmbufm[i], 0,
-		sc-jme_rxmbufm[i]-dm_mapsize, BUS_DMASYNC_POSTREAD);
-		bus_dmamap_unload(sc-jme_dmatag, sc-jme_rxmbufm[i]);
 
 		buflen = le32toh(desc-buflen);
 		nsegs = JME_RX_NSEGS(buflen);
@@ -1094,6 +1106,10 @@
 			for (seg = 0; seg  nsegs; seg++) {
 m = sc-jme_rxmbuf[i];
 sc-jme_rxmbuf[i] = NULL;
+mmap = sc-jme_rxmbufm[i];
+bus_dmamap_sync(sc-jme_dmatag, mmap, 0,
+mmap-dm_mapsize, BUS_DMASYNC_POSTREAD);
+bus_dmamap_unload(sc-jme_dmatag, mmap);
 if ((error = jme_add_rxbuf(sc, m)) != 0)
 	aprint_error_dev(sc-jme_dev,
 	can't reuse mbuf: %d\n, error);
@@ -1105,11 +1121,24 @@
 		/* receive this packet */
 		mhead = m = sc-jme_rxmbuf[i];
 		sc-jme_rxmbuf[i] = NULL;
+		mmap = sc-jme_rxmbufm[i];
+		bus_dmamap_sync(sc-jme_dmatag, mmap, 0,
+		mmap-dm_mapsize, BUS_DMASYNC_POSTREAD);
+		bus_dmamap_unload(sc-jme_dmatag, mmap);
 		/* add a new buffer to chain */
-		if (jme_add_rxbuf(sc, NULL) == ENOBUFS) {
-			for (seg = 0; seg  nsegs; seg++) {
+		if (jme_add_rxbuf(sc, NULL) != 0) {
+			if ((error = jme_add_rxbuf(sc, m)) != 0)
+aprint_error_dev(sc-jme_dev,
+can't reuse mbuf: %d\n, error);
+			JME_DESC_INC(sc-jme_rx_cons, JME_NBUFS);
+			i = sc-jme_rx_cons;
+			for (seg = 1; seg  nsegs; seg++) {
 m = sc-jme_rxmbuf[i];
 sc-jme_rxmbuf[i] = NULL;
+mmap = sc-jme_rxmbufm[i];
+bus_dmamap_sync(sc-jme_dmatag, mmap, 0,
+mmap-dm_mapsize, BUS_DMASYNC_POSTREAD);
+bus_dmamap_unload(sc-jme_dmatag, mmap);
 if ((error = jme_add_rxbuf(sc, m)) != 0)
 	aprint_error_dev(sc-jme_dev,
 	can't reuse mbuf: %d\n, error);
@@ -1131,7 +1160,13 @@
 			i = sc-jme_rx_cons;
 

CVS commit: src/sys/arch/sgimips/dev

2011-03-30 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Mar 30 18:25:31 UTC 2011

Modified Files:
src/sys/arch/sgimips/dev: crmfbreg.h

Log Message:
add a bunch of GBE registers, no functional change (yet)


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sgimips/dev/crmfbreg.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/sgimips/dev/crmfbreg.h
diff -u src/sys/arch/sgimips/dev/crmfbreg.h:1.11 src/sys/arch/sgimips/dev/crmfbreg.h:1.12
--- src/sys/arch/sgimips/dev/crmfbreg.h:1.11	Tue Mar  1 21:47:13 2011
+++ src/sys/arch/sgimips/dev/crmfbreg.h	Wed Mar 30 18:25:31 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: crmfbreg.h,v 1.11 2011/03/01 21:47:13 macallan Exp $ */
+/* $NetBSD: crmfbreg.h,v 1.12 2011/03/30 18:25:31 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -34,26 +34,137 @@
 #ifndef CRMFBREG_H
 #define CRMFBREG_H
 
+#define	CRMFB_CTRLSTAT		0x
+#define		CRMFB_CTRLSTAT_CHIPID_MASK	0x000f
+#define		CRMFB_CTRLSTAT_SENSE		0x0010 /* monitor sense pin */
+#define		CRMFB_CTRLSTAT_GPIO0_SENSE	0x0040
+#define		CRMFB_CTRLSTAT_GPIO0_INPUT	0x0080
+#define		CRMFB_CTRLSTAT_GPIO1_SENSE	0x0100
+#define		CRMFB_CTRLSTAT_GPIO1_INPUT	0x0200
+#define		CRMFB_CTRLSTAT_GPIO2_SENSE	0x0400
+#define		CRMFB_CTRLSTAT_GPIO2_INPUT	0x0800
+#define		CRMFB_CTRLSTAT_GPIO3_SENSE	0x1000
+#define		CRMFB_CTRLSTAT_GPIO3_INPUT	0x2000
+#define		CRMFB_CTRLSTAT_GPIO4_SENSE	0x4000
+#define		CRMFB_CTRLSTAT_GPIO4_INPUT	0x8000
+#define		CRMFB_CTRLSTAT_GPIO5_SENSE	0x0001
+#define		CRMFB_CTRLSTAT_GPIO5_INPUT	0x0002
+#define		CRMFB_CTRLSTAT_GPIO6_SENSE	0x0004
+#define		CRMFB_CTRLSTAT_GPIO6_INPUT	0x0008
+#define		CRMFB_CTRLSTAT_GPIO7_SENSE	0x0010
+#define		CRMFB_CTRLSTAT_GPIO7_INPUT	0x0020
+#define		CRMFB_CTRLSTAT_GPIO8_SENSE	0x0040
+#define		CRMFB_CTRLSTAT_GPIO8_INPUT	0x0080
+#define		CRMFB_CTRLSTAT_GPIO9_SENSE	0x0100
+#define		CRMFB_CTRLSTAT_GPIO9_INPUT	0x0200
+#define		CRMFB_CTRLSTAT_HALF_PHASE	0x0400 /* for flat panel */
+#define		CRMFB_CTRLSTAT_CSYNC_ALOW	0x0800 /* csync active low */
+#define		CRMFB_CTRLSTAT_EXTERNAL_PCLK	0x
+#define		CRMFB_CTRLSTAT_DIFF_PCLK	0x1000 /* differential pclock */
+#define		CRMFB_CTRLSTAT_INTERNAL_PCLK	0x3000
+
 #define CRMFB_DOTCLOCK		0x0004
+#define		CRMFB_DOTCLOCK_M_MASK		0x00ff
+#define		CRMFB_DOTCLOCK_N_MASK		0x3f00
+#define		CRMFB_DOTCLOCK_P_MASK		0xc000
 #define		CRMFB_DOTCLOCK_CLKRUN_SHIFT	20
-#define CRMFB_VT_XY		0x0001
+#define		CRMFB_DOTCLOCK_OUT_OF_RANGE	0x0040
+#define		CRMFB_DOTCLOCK_OUT_OF_LOCK	0x0080
+#define		CRMFB_DOTCLOCK_TDWNI		0x0100 /* ? */
+#define		CRMFB_DOTCLOCK_TUPI		0x0200 /* ? */
+
+#define CRMFB_I2C_VGA		0x0008
+#define 	CRMFB_I2C_SDA			0x0001
+#define 	CRMFB_I2C_SCL			0x0002
+
+#define CRMFB_SYSCLK		0x000c
+
+#define CRMFB_I2C_FP		0x0010 /* same bits as CRMFB_I2C_VGA */
+
+#define CRMFB_DEVICE_ID		0x0014
+#define		CRMFB_DEVICE_ID_DEF		0x0666 /* this chip is EVIL */
+
+
+#define CRMFB_VT_XY		0x0001 /* pixel / line counters */
+#define		CRMFB_VT_XY_X_MASK		0x0fff
+#define		CRMFB_VT_XY_Y_MASK		0x00fff000
 #define		CRMFB_VT_XY_FREEZE_SHIFT	31
+#define CRMFB_VT_MAX		0x00010004 /* same masks as CRMFB_VT_XY, counters in
+	* CRMFB_VT_XY reset when reaching max */
+#define CRMFB_VT_VSYNC		0x00010008
+#define		CRMFB_VT_VSYNC_OFF_MASK		0x0fff
+#define		CRMFB_VT_VSYNC_ON_MASK		0x00fff000
+#define CRMFB_VT_HSYNC		0x0001000c
+#define		CRMFB_VT_HSYNC_OFF_MASK		0x0fff
+#define		CRMFB_VT_HSYNC_ON_MASK		0x00fff000
+#define CRMFB_VT_VBLANK		0x00010010
+#define		CRMFB_VT_VBLANK_OFF_MASK	0x0fff
+#define		CRMFB_VT_VBLANK_ON_MASK		0x00fff000
+#define CRMFB_VT_HBLANK		0x00010014
+#define		CRMFB_VT_HBLANK_OFF_MASK	0x0fff
+#define		CRMFB_VT_HBLANK_ON_MASK		0x00fff000
+
 #define	CRMFB_VT_FLAGS		0x00010018
+#define 	CRMFB_VT_FLAGS_VDRV_INVERT	0x0001
+#define 	CRMFB_VT_FLAGS_VDRV_LOW		0x0002
+#define 	CRMFB_VT_FLAGS_HDRV_INVERT	0x0004
+#define 	CRMFB_VT_FLAGS_HDRV_LOW		0x0008 /* put monitor to sleep */
+#define 	CRMFB_VT_FLAGS_SYNC_HIGH	0x0010
+#define 	CRMFB_VT_FLAGS_SYNC_LOW		0x0020
 #define		CRMFB_VT_FLAGS_SYNC_LOW_MSB	5
 #define		CRMFB_VT_FLAGS_SYNC_LOW_LSB	5
+#define 	CRMFB_VT_FLAGS_F2RF_HIGH	0x0040 /* sync left/right ? */
+
+#define CRMFB_VT_FRAMELOCK	0x0001001c
+#define		CRMFB_VT_FRAMELOCK_F2RF_MASK	0x0fff /* f2rf toggles when y
+			* reaches this */
+#define		CRMFB_VT_FRAMELOCK_LOCK_MASK	0x00fff000
+
+/* scanline interrupts! */
 #define CRMFB_VT_INTR01		0x00010020
-#define		CRMFB_VT_INTR01_EN		0x
+#define		CRMFB_INTR_1_MASK		0x0fff /* intr1 when y == this */
+#define		CRMFB_INTR_0_MASK		0x00fff000 /* intr0 when y == this */
 #define CRMFB_VT_INTR23		0x00010024
-#define		

CVS commit: src/tests/include

2011-03-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Mar 30 18:31:15 UTC 2011

Modified Files:
src/tests/include: t_paths.c

Log Message:
Another proof that even the naive test cases are worth it;
expect a failure with fstat(2) and bpf(4), PR lib/44807.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/include/t_paths.c

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

Modified files:

Index: src/tests/include/t_paths.c
diff -u src/tests/include/t_paths.c:1.1 src/tests/include/t_paths.c:1.2
--- src/tests/include/t_paths.c:1.1	Wed Mar 30 09:43:22 2011
+++ src/tests/include/t_paths.c	Wed Mar 30 18:31:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_paths.c,v 1.1 2011/03/30 09:43:22 jruoho Exp $ */
+/*	$NetBSD: t_paths.c,v 1.2 2011/03/30 18:31:15 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_paths.c,v 1.1 2011/03/30 09:43:22 jruoho Exp $);
+__RCSID($NetBSD: t_paths.c,v 1.2 2011/03/30 18:31:15 jruoho Exp $);
 
 #include sys/param.h
 #include sys/stat.h
@@ -160,6 +160,9 @@
 
 		if ((paths[i].flags  PATH_DEV) != 0) {
 
+			if (strcmp(paths[i].path, _PATH_BPF) == 0)
+atf_tc_expect_fail(PR kern/44807);
+
 			ATF_REQUIRE(S_ISBLK(m) != 0 || S_ISCHR(m) != 0);
 
 			ATF_REQUIRE((paths[i].flags  PATH_DIR) == 0);



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

2011-03-30 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Wed Mar 30 18:33:05 UTC 2011

Modified Files:
src/sys/arch/xen/xen: if_xennet_xenbus.c

Log Message:
Do not clobber autoconf messages (and variables, for error reporting)
in xennet(4) handler. Keep if_xname though.

Reported by dyoung@, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/xen/xen/if_xennet_xenbus.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/xen/xen/if_xennet_xenbus.c
diff -u src/sys/arch/xen/xen/if_xennet_xenbus.c:1.47 src/sys/arch/xen/xen/if_xennet_xenbus.c:1.48
--- src/sys/arch/xen/xen/if_xennet_xenbus.c:1.47	Wed Mar 30 00:17:04 2011
+++ src/sys/arch/xen/xen/if_xennet_xenbus.c	Wed Mar 30 18:33:05 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: if_xennet_xenbus.c,v 1.47 2011/03/30 00:17:04 jym Exp $  */
+/*  $NetBSD: if_xennet_xenbus.c,v 1.48 2011/03/30 18:33:05 jym Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -85,7 +85,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_xennet_xenbus.c,v 1.47 2011/03/30 00:17:04 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_xennet_xenbus.c,v 1.48 2011/03/30 18:33:05 jym Exp $);
 
 #include opt_xen.h
 #include opt_nfs_boot.h
@@ -961,7 +961,7 @@
 		}
 		MGETHDR(m, M_DONTWAIT, MT_DATA);
 		if (__predict_false(m == NULL)) {
-			aprint_error_ifnet(ifp, rx no mbuf\n);
+			printf(%s: rx no mbuf\n, ifp-if_xname);
 			ifp-if_ierrors++;
 			xennet_rx_mbuf_free(NULL, (void *)va, PAGE_SIZE, req);
 			continue;



CVS commit: src/sys/dev/videomode

2011-03-30 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Wed Mar 30 18:45:05 UTC 2011

Modified Files:
src/sys/dev/videomode: modelines

Log Message:
Update modes based on our current xsrc.
Minor changes to 640x480 @ 60Hz, 640x480 @ 72Hz, 800x600 @ 85Hz, and
1024x768 @ 75Hz.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/videomode/modelines

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/videomode/modelines
diff -u src/sys/dev/videomode/modelines:1.8 src/sys/dev/videomode/modelines:1.9
--- src/sys/dev/videomode/modelines:1.8	Mon Mar 21 19:28:37 2011
+++ src/sys/dev/videomode/modelines	Wed Mar 30 18:45:04 2011
@@ -1,4 +1,4 @@
-// $NetBSD: modelines,v 1.8 2011/03/21 19:28:37 jdc Exp $
+// $NetBSD: modelines,v 1.9 2011/03/30 18:45:04 jdc Exp $
 //
 // This file was imported from XFree86, and is made of the contents of both
 // the vesamodes and extramodes files.  As a result these should correspond
@@ -31,10 +31,10 @@
 ModeLine 720x40035.5  720  738  846  900400  421  423  449 -hsync -vsync
 
 # 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
-ModeLine 640x48025.2  640  656  752  800480  490  492  525 -hsync -vsync
+ModeLine 640x48025.175 640  656  752  800480  490  492  525 -hsync -vsync
 
 # 640x480 @ 72Hz (VESA) hsync: 37.9kHz
-ModeLine 640x48031.5  640  664  704  832480  489  491  520 -hsync -vsync
+ModeLine 640x48031.5  640  664  704  832480  489  492  520 -hsync -vsync
 
 # 640x480 @ 75Hz (VESA) hsync: 37.5kHz
 ModeLine 640x48031.5  640  656  720  840480  481  484  500 -hsync -vsync
@@ -55,7 +55,7 @@
 ModeLine 800x60049.5  800  816  896 1056600  601  604  625 +hsync +vsync
 
 # 800x600 @ 85Hz (VESA) hsync: 53.7kHz
-ModeLine 800x60056.3  800  832  896 1048600  601  604  631 +hsync +vsync
+ModeLine 800x60056.25  800  832  896 1048600  601  604  631 +hsync +vsync
 
 # 1024x768i @ 43Hz (industry standard) hsync: 35.5kHz
 ModeLine 1024x768   44.9 1024 1032 1208 1264768  768  776  817 +hsync +vsync Interlace
@@ -67,7 +67,7 @@
 ModeLine 1024x768   75.0 1024 1048 1184 1328768  771  777  806 -hsync -vsync
 
 # 1024x768 @ 75Hz (VESA) hsync: 60.0kHz
-ModeLine 1024x768   78.8 1024 1040 1136 1312768  769  772  800 +hsync +vsync
+ModeLine 1024x768   78.75 1024 1040 1136 1312768  769  772  800 +hsync +vsync
 
 # 1024x768 @ 85Hz (VESA) hsync: 68.7kHz
 ModeLine 1024x768   94.5 1024 1072 1168 1376768  769  772  808 +hsync +vsync



CVS commit: src/sys/dev/videomode

2011-03-30 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Wed Mar 30 18:46:33 UTC 2011

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

Log Message:
Regenerate for:

Update modes based on our current xsrc.
Minor changes to 640x480 @ 60Hz, 640x480 @ 72Hz, 800x600 @ 85Hz, and
1024x768 @ 75Hz.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/videomode/videomode.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/videomode/videomode.c
diff -u src/sys/dev/videomode/videomode.c:1.10 src/sys/dev/videomode/videomode.c:1.11
--- src/sys/dev/videomode/videomode.c:1.10	Mon Mar 21 19:29:54 2011
+++ src/sys/dev/videomode/videomode.c	Wed Mar 30 18:46:32 2011
@@ -1,14 +1,14 @@
-/*	$NetBSD: videomode.c,v 1.10 2011/03/21 19:29:54 jdc Exp $	*/
+/*	$NetBSD: videomode.c,v 1.11 2011/03/30 18:46:32 jdc Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: modelines,v 1.8 2011/03/21 19:28:37 jdc Exp 
+ *	NetBSD: modelines,v 1.9 2011/03/30 18:45:04 jdc Exp 
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: videomode.c,v 1.10 2011/03/21 19:29:54 jdc Exp $);
+__KERNEL_RCSID(0, $NetBSD: videomode.c,v 1.11 2011/03/30 18:46:32 jdc Exp $);
 
 #include dev/videomode/videomode.h
 
@@ -31,19 +31,19 @@
 M(720x400x70,720,400,28320,738,846,900,412,414,449,HN|VP),
 M(720x400x85,720,400,35500,756,828,936,401,404,446,HN|VP),
 M(720x400x87,720,400,35500,738,846,900,421,423,449,HN|VN),
-M(640x480x60,640,480,25200,656,752,800,490,492,525,HN|VN),
-M(640x480x72,640,480,31500,664,704,832,489,491,520,HN|VN),
+M(640x480x60,640,480,25175,656,752,800,490,492,525,HN|VN),
+M(640x480x72,640,480,31500,664,704,832,489,492,520,HN|VN),
 M(640x480x75,640,480,31500,656,720,840,481,484,500,HN|VN),
 M(640x480x85,640,480,36000,696,752,832,481,484,509,HN|VN),
 M(800x600x56,800,600,36000,824,896,1024,601,603,625,HP|VP),
 M(800x600x60,800,600,4,840,968,1056,601,605,628,HP|VP),
 M(800x600x72,800,600,5,856,976,1040,637,643,666,HP|VP),
 M(800x600x75,800,600,49500,816,896,1056,601,604,625,HP|VP),
-M(800x600x85,800,600,56300,832,896,1048,601,604,631,HP|VP),
+M(800x600x85,800,600,56250,832,896,1048,601,604,631,HP|VP),
 M(1024x768x87i,1024,768,44900,1032,1208,1264,768,776,817,HP|VP|I),
 M(1024x768x60,1024,768,65000,1048,1184,1344,771,777,806,HN|VN),
 M(1024x768x70,1024,768,75000,1048,1184,1328,771,777,806,HN|VN),
-M(1024x768x75,1024,768,78800,1040,1136,1312,769,772,800,HP|VP),
+M(1024x768x75,1024,768,78750,1040,1136,1312,769,772,800,HP|VP),
 M(1024x768x85,1024,768,94500,1072,1168,1376,769,772,808,HP|VP),
 M(1024x768x89,1024,768,10,1108,1280,1408,768,780,796,HP|VP),
 M(1152x864x75,1152,864,108000,1216,1344,1600,865,868,900,HP|VP),
@@ -80,19 +80,19 @@
 M(360x200x70,360,200,14160,369,423,450,206,207,224,HN|VP|DS),
 M(360x200x85,360,200,17750,378,414,468,200,202,223,HN|VP|DS),
 M(360x200x87,360,200,17750,369,423,450,210,211,224,HN|VN|DS),
-M(320x240x60,320,240,12600,328,376,400,245,246,262,HN|VN|DS),
-M(320x240x72,320,240,15750,332,352,416,244,245,260,HN|VN|DS),
+M(320x240x60,320,240,12587,328,376,400,245,246,262,HN|VN|DS),
+M(320x240x72,320,240,15750,332,352,416,244,246,260,HN|VN|DS),
 M(320x240x75,320,240,15750,328,360,420,240,242,250,HN|VN|DS),
 M(320x240x85,320,240,18000,348,376,416,240,242,254,HN|VN|DS),
 M(400x300x56,400,300,18000,412,448,512,300,301,312,HP|VP|DS),
 M(400x300x60,400,300,2,420,484,528,300,302,314,HP|VP|DS),
 M(400x300x72,400,300,25000,428,488,520,318,321,333,HP|VP|DS),
 M(400x300x75,400,300,24750,408,448,528,300,302,312,HP|VP|DS),
-M(400x300x85,400,300,28150,416,448,524,300,302,315,HP|VP|DS),
+M(400x300x85,400,300,28125,416,448,524,300,302,315,HP|VP|DS),
 M(512x384x87i,512,384,22450,516,604,632,384,388,408,HP|VP|DS|I),
 M(512x384x60,512,384,32500,524,592,672,385,388,403,HN|VN|DS),
 M(512x384x70,512,384,37500,524,592,664,385,388,403,HN|VN|DS),
-M(512x384x75,512,384,39400,520,568,656,384,386,400,HP|VP|DS),
+M(512x384x75,512,384,39375,520,568,656,384,386,400,HP|VP|DS),
 M(512x384x85,512,384,47250,536,584,688,384,386,404,HP|VP|DS),
 M(512x384x89,512,384,5,554,640,704,384,390,398,HP|VP|DS),
 M(576x432x75,576,432,54000,608,672,800,432,434,450,HP|VP|DS),



CVS commit: src/sys/dev/videomode

2011-03-30 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Wed Mar 30 18:49:57 UTC 2011

Modified Files:
src/sys/dev/videomode: edidreg.h

Log Message:
Adjustments to detailed timing flags:
  give the stereo modes slightly better names
  correct the hsync positive and vsync positive bits (these were reversed)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/videomode/edidreg.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/videomode/edidreg.h
diff -u src/sys/dev/videomode/edidreg.h:1.2 src/sys/dev/videomode/edidreg.h:1.3
--- src/sys/dev/videomode/edidreg.h:1.2	Sat May 13 00:39:19 2006
+++ src/sys/dev/videomode/edidreg.h	Wed Mar 30 18:49:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: edidreg.h,v 1.2 2006/05/13 00:39:19 gdamore Exp $	*/
+/*	$NetBSD: edidreg.h,v 1.3 2011/03/30 18:49:56 jdc Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -203,11 +203,11 @@
 #define	EDID_DET_TIMING_VBORDER(ptr)	((ptr)[16])
 #define	EDID_DET_TIMING_FLAGS(ptr)	((ptr)[17])
 #define	EDID_DET_TIMING_FLAG_INTERLACE		0x80
-#define	EDID_DET_TIMING_FLAG_STEREO		0x60	/* wtf? */
+#define	EDID_DET_TIMING_FLAG_STEREO		0x60	/* stereo or not */
 #define	EDID_DET_TIMING_FLAG_SYNC_SEPARATE	0x18
-#define	EDID_DET_TIMING_FLAG_HSYNC_POSITIVE	0x04
-#define	EDID_DET_TIMING_FLAG_VSYNC_POSITIVE	0x02
-#define	EDID_DET_TIMING_FLAG_STEREO1		0x01	/* wtf? */
+#define	EDID_DET_TIMING_FLAG_VSYNC_POSITIVE	0x04
+#define	EDID_DET_TIMING_FLAG_HSYNC_POSITIVE	0x02
+#define	EDID_DET_TIMING_FLAG_STEREO_MODE	0x01	/* stereo mode */
 
 
 /* N.B.: these tests assume that we already checked for detailed timing! */



CVS commit: src/sys/dev/videomode

2011-03-30 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Wed Mar 30 18:50:37 UTC 2011

Modified Files:
src/sys/dev/videomode: edid.c

Log Message:
Display detailed timing parameters in edid_print().


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/videomode/edid.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/videomode/edid.c
diff -u src/sys/dev/videomode/edid.c:1.7 src/sys/dev/videomode/edid.c:1.8
--- src/sys/dev/videomode/edid.c:1.7	Mon Mar 21 19:34:27 2011
+++ src/sys/dev/videomode/edid.c	Wed Mar 30 18:50:37 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: edid.c,v 1.7 2011/03/21 19:34:27 jdc Exp $ */
+/* $NetBSD: edid.c,v 1.8 2011/03/30 18:50:37 jdc Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
  */ 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: edid.c,v 1.7 2011/03/21 19:34:27 jdc Exp $);
+__KERNEL_RCSID(0, $NetBSD: edid.c,v 1.8 2011/03/30 18:50:37 jdc Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -260,12 +260,25 @@
 	}
 	printf(Video modes:\n);
 	for (i = 0; i  edid-edid_nmodes; i++) {
-		printf(\t%dx%d @ %dHz\n,
+		printf(\t%dx%d @ %dHz,
 		edid-edid_modes[i].hdisplay,
 		edid-edid_modes[i].vdisplay,
 		DIVIDE(DIVIDE(edid-edid_modes[i].dot_clock * 1000,
 			   edid-edid_modes[i].htotal),
 			edid-edid_modes[i].vtotal));
+		printf( (%d %d %d %d %d %d %d,
+		edid-edid_modes[i].dot_clock,
+		edid-edid_modes[i].hsync_start,
+		edid-edid_modes[i].hsync_end,
+		edid-edid_modes[i].htotal,
+		edid-edid_modes[i].vsync_start,
+		edid-edid_modes[i].vsync_end,
+		edid-edid_modes[i].vtotal);
+		printf( %s%sH %s%sV)\n,
+		edid-edid_modes[i].flags  VID_PHSYNC ? + : ,
+		edid-edid_modes[i].flags  VID_NHSYNC ? - : ,
+		edid-edid_modes[i].flags  VID_PVSYNC ? + : ,
+		edid-edid_modes[i].flags  VID_NVSYNC ? - : );
 	}
 	if (edid-edid_preferred_mode)
 		printf(Preferred mode: %dx%d @ %dHz\n,
@@ -345,7 +358,7 @@
 
 	/* we don't support stereo modes (for now) */
 	if (flags  (EDID_DET_TIMING_FLAG_STEREO |
-		EDID_DET_TIMING_FLAG_STEREO1))
+		EDID_DET_TIMING_FLAG_STEREO_MODE))
 		return 0;
 
 	vmp-dot_clock = EDID_DET_TIMING_DOT_CLOCK(data) / 1000;



CVS commit: src/sys/arch/sgimips/dev

2011-03-30 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Mar 30 19:16:35 UTC 2011

Modified Files:
src/sys/arch/sgimips/dev: crmfb.c

Log Message:
device_t-ify, use aprint_*_dev() where appropriate


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/sgimips/dev/crmfb.c

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

Modified files:

Index: src/sys/arch/sgimips/dev/crmfb.c
diff -u src/sys/arch/sgimips/dev/crmfb.c:1.28 src/sys/arch/sgimips/dev/crmfb.c:1.29
--- src/sys/arch/sgimips/dev/crmfb.c:1.28	Tue Mar  1 21:47:13 2011
+++ src/sys/arch/sgimips/dev/crmfb.c	Wed Mar 30 19:16:35 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: crmfb.c,v 1.28 2011/03/01 21:47:13 macallan Exp $ */
+/* $NetBSD: crmfb.c,v 1.29 2011/03/30 19:16:35 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: crmfb.c,v 1.28 2011/03/01 21:47:13 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: crmfb.c,v 1.29 2011/03/30 19:16:35 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -98,8 +98,8 @@
  */
 #define CRMFB_TILESIZE	(512*128)
 
-static int	crmfb_match(struct device *, struct cfdata *, void *);
-static void	crmfb_attach(struct device *, struct device *, void *);
+static int	crmfb_match(device_t, struct cfdata *, void *);
+static void	crmfb_attach(device_t, device_t, void *);
 int		crmfb_probe(void);
 
 #define KERNADDR(p)	((void *)((p).addr))
@@ -118,7 +118,7 @@
 };
 
 struct crmfb_softc {
-	struct device		sc_dev;
+	device_t		sc_dev;
 	struct vcons_data	sc_vd;
 
 	bus_space_tag_t		sc_iot;
@@ -182,17 +182,17 @@
 static void	crmfb_cursor(void *, int, int, int);
 static void	crmfb_putchar(void *, int, int, u_int, long);
 
-CFATTACH_DECL(crmfb, sizeof(struct crmfb_softc),
+CFATTACH_DECL_NEW(crmfb, sizeof(struct crmfb_softc),
 crmfb_match, crmfb_attach, NULL, NULL);
 
 static int
-crmfb_match(struct device *parent, struct cfdata *cf, void *opaque)
+crmfb_match(device_t parent, struct cfdata *cf, void *opaque)
 {
 	return crmfb_probe();
 }
 
 static void
-crmfb_attach(struct device *parent, struct device *self, void *opaque)
+crmfb_attach(device_t parent, device_t self, void *opaque)
 {
 	struct mainbus_attach_args *ma;
 	struct crmfb_softc *sc;
@@ -205,7 +205,9 @@
 	const char *consdev;
 	int rv, i;
 
-	sc = (struct crmfb_softc *)self;
+	sc = device_private(self);
+	sc-sc_dev = self;
+
 	ma = (struct mainbus_attach_args *)opaque;
 
 	sc-sc_iot = SGIMIPS_BUS_SPACE_CRIME;
@@ -236,14 +238,14 @@
 		sc-sc_depth = 32;
 
 	if (sc-sc_width == 0 || sc-sc_height == 0) {
-		aprint_error(%s: device unusable if not setup by firmware\n,
-		sc-sc_dev.dv_xname);
+		aprint_error_dev(sc-sc_dev,
+		device unusable if not setup by firmware\n);
 		bus_space_unmap(sc-sc_iot, sc-sc_ioh, 0 /* XXX */);
 		return;
 	}
 
-	aprint_normal(%s: initial resolution %dx%d\n,
-	sc-sc_dev.dv_xname, sc-sc_width, sc-sc_height);
+	aprint_normal_dev(sc-sc_dev, initial resolution %dx%d\n,
+	sc-sc_width, sc-sc_height);
 
 	/*
 	 * first determine how many tiles we need
@@ -306,8 +308,7 @@
 	sc-sc_scratch = (char *)KERNADDR(sc-sc_dma) + (0xf * sc-sc_tiles_x);
 	sc-sc_linear = (paddr_t)DMAADDR(sc-sc_dma) + 0x10 * sc-sc_tiles_x;
 
-	aprint_normal(%s: allocated %d byte fb @ %p (%p)\n, 
-	sc-sc_dev.dv_xname,
+	aprint_normal_dev(sc-sc_dev, allocated %d byte fb @ %p (%p)\n, 
 	sc-sc_fbsize, KERNADDR(sc-sc_dmai), KERNADDR(sc-sc_dma));
 
 	crmfb_setup_video(sc, 8);



CVS commit: src/tests/include

2011-03-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Mar 30 19:32:13 UTC 2011

Modified Files:
src/tests/include: t_paths.c

Log Message:
Adjust for _PATH_CONSOLE, pointed out by njoly@.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/include/t_paths.c

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

Modified files:

Index: src/tests/include/t_paths.c
diff -u src/tests/include/t_paths.c:1.2 src/tests/include/t_paths.c:1.3
--- src/tests/include/t_paths.c:1.2	Wed Mar 30 18:31:15 2011
+++ src/tests/include/t_paths.c	Wed Mar 30 19:32:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_paths.c,v 1.2 2011/03/30 18:31:15 jruoho Exp $ */
+/*	$NetBSD: t_paths.c,v 1.3 2011/03/30 19:32:13 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_paths.c,v 1.2 2011/03/30 18:31:15 jruoho Exp $);
+__RCSID($NetBSD: t_paths.c,v 1.3 2011/03/30 19:32:13 jruoho Exp $);
 
 #include sys/param.h
 #include sys/stat.h
@@ -57,7 +57,7 @@
 	{ _PATH_AUDIOCTL0,	PATH_DEV		},
 	{ _PATH_BPF,		PATH_DEV | PATH_ROOT	},
 	{ _PATH_CLOCKCTL,	PATH_DEV | PATH_ROOT	},
-	{ _PATH_CONSOLE,	PATH_DEV		},
+	{ _PATH_CONSOLE,	PATH_DEV | PATH_ROOT	},
 	{ _PATH_CONSTTY,	PATH_DEV | PATH_ROOT	},
 	{ _PATH_CSMAPPER,	PATH_DIR		},
 	{ _PATH_DEFTAPE,	PATH_DEV | PATH_ROOT	},



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

2011-03-30 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Mar 30 19:57:15 UTC 2011

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

Log Message:
Fix libquota_pic.a


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/distrib/sets/lists/comp/md.amd64

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.amd64
diff -u src/distrib/sets/lists/comp/md.amd64:1.104 src/distrib/sets/lists/comp/md.amd64:1.105
--- src/distrib/sets/lists/comp/md.amd64:1.104	Thu Mar 24 17:05:41 2011
+++ src/distrib/sets/lists/comp/md.amd64	Wed Mar 30 19:57:15 2011
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.104 2011/03/24 17:05:41 bouyer Exp $
+# $NetBSD: md.amd64,v 1.105 2011/03/30 19:57:15 roy Exp $
 ./usr/include/amd64comp-c-include
 ./usr/include/amd64/ansi.h			comp-c-include
 ./usr/include/amd64/aout_machdep.h		comp-c-include
@@ -739,7 +739,7 @@
 ./usr/lib/i386/libquota.so			comp-sys-shlib		compat,pic
 ./usr/lib/i386/libquota_g.a			comp-c-proflib		compat,debuglib
 ./usr/lib/i386/libquota_p.a			comp-c-proflib		compat,profile
-./usr/lib/i386/libquota_pic.a			comp-c-proflib		compat,profile
+./usr/lib/i386/libquota_pic.a			comp-c-piclib		compat,pic
 ./usr/lib/i386/libradius.a			comp-c-lib		compat
 ./usr/lib/i386/libradius.so			comp-sys-shlib		compat,pic
 ./usr/lib/i386/libradius_g.a			comp-c-proflib		compat,debuglib



CVS commit: src/sys/external/bsd/drm/dist/shared-core

2011-03-30 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Wed Mar 30 19:59:04 UTC 2011

Modified Files:
src/sys/external/bsd/drm/dist/shared-core: radeon_cp.c

Log Message:
Fix build of radeondrm kernel module.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/sys/external/bsd/drm/dist/shared-core/radeon_cp.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/drm/dist/shared-core/radeon_cp.c
diff -u src/sys/external/bsd/drm/dist/shared-core/radeon_cp.c:1.11 src/sys/external/bsd/drm/dist/shared-core/radeon_cp.c:1.12
--- src/sys/external/bsd/drm/dist/shared-core/radeon_cp.c:1.11	Wed Mar 30 17:21:04 2011
+++ src/sys/external/bsd/drm/dist/shared-core/radeon_cp.c	Wed Mar 30 19:59:04 2011
@@ -35,7 +35,7 @@
 #include radeon_drv.h
 #include r300_reg.h
 
-#if defined(__NetBSD__)
+#if defined(__NetBSD__)  defined(_KERNEL_OPT)
 #include agp.h
 #endif
 



CVS commit: src/sys/net

2011-03-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 30 21:34:08 UTC 2011

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

Log Message:
lib/44807: something broken in stat(2), return that we are a character
device in st_mode.


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/sys/net/bpf.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/bpf.c
diff -u src/sys/net/bpf.c:1.163 src/sys/net/bpf.c:1.164
--- src/sys/net/bpf.c:1.163	Wed Mar 30 14:04:27 2011
+++ src/sys/net/bpf.c	Wed Mar 30 17:34:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.163 2011/03/30 18:04:27 bouyer Exp $	*/
+/*	$NetBSD: bpf.c,v 1.164 2011/03/30 21:34:08 christos Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bpf.c,v 1.163 2011/03/30 18:04:27 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: bpf.c,v 1.164 2011/03/30 21:34:08 christos Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_bpf.h
@@ -1178,6 +1178,7 @@
 	st-st_ctimespec = st-st_birthtimespec = d-bd_btime;
 	st-st_uid = kauth_cred_geteuid(fp-f_cred);
 	st-st_gid = kauth_cred_getegid(fp-f_cred);
+	st-st_mode = S_IFCHR;
 	KERNEL_UNLOCK_ONE(NULL);
 	return 0;
 }



CVS commit: src/share/man/man9

2011-03-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Mar 30 21:40:01 UTC 2011

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

Log Message:
Remove a duplicate word, .Fn for functions, .Vt.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man9/flash.9

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

Modified files:

Index: src/share/man/man9/flash.9
diff -u src/share/man/man9/flash.9:1.2 src/share/man/man9/flash.9:1.3
--- src/share/man/man9/flash.9:1.2	Sun Feb 27 06:25:07 2011
+++ src/share/man/man9/flash.9	Wed Mar 30 21:40:01 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: flash.9,v 1.2 2011/02/27 06:25:07 wiz Exp $
+.\	$NetBSD: flash.9,v 1.3 2011/03/30 21:40:01 jruoho Exp $
 .\
 .\ Copyright (c) 2010 Department of Software Engineering,
 .\		  University of Szeged, Hungary
@@ -29,7 +29,7 @@
 .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\ SUCH DAMAGE.
 .\
-.Dd January 21, 2010
+.Dd March 31, 2011
 .Dt FLASH 9
 .Os
 .Sh NAME
@@ -45,15 +45,17 @@
 layer with the
 .Fa flash_hw_if
 structure.
-This structure has function pointers and and other fields.
+This structure has function pointers and other fields.
 .Pp
 The attachment can be done by calling
-.Fa flash_attach_mi
-with this structure and the device's device_t as argument.
+.Fn flash_attach_mi
+with this structure and the device's
+.Vt device_t
+as an argument.
 Return value is the flash layer device.
 The
 .Fa flash_interface
-struct is shown below.
+structure is shown below.
 .Bd -literal
 struct flash_interface {
 	int (*erase) (device_t, struct flash_erase_instruction *);



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

2011-03-30 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Wed Mar 30 21:53:59 UTC 2011

Modified Files:
src/sys/arch/xen/x86: hypervisor_machdep.c

Log Message:
Fix a year old bug that was only fixed in jym-xensuspend branch, but
not in HEAD:
- use uvm_km_alloc() instead of kmem_alloc() to enforce alignement when
allocating p2m_frame pages (xentools can only deal with page-aligned
addresses)
- do not use paddr_t for p2m_frame_list_list with PAE, xentools expect
32 bits PFNs even with 64 bits PTE.

Required to make ``xm dump-core'' work as expected.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/xen/x86/hypervisor_machdep.c

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

Modified files:

Index: src/sys/arch/xen/x86/hypervisor_machdep.c
diff -u src/sys/arch/xen/x86/hypervisor_machdep.c:1.13 src/sys/arch/xen/x86/hypervisor_machdep.c:1.14
--- src/sys/arch/xen/x86/hypervisor_machdep.c:1.13	Fri Oct 23 02:32:34 2009
+++ src/sys/arch/xen/x86/hypervisor_machdep.c	Wed Mar 30 21:53:58 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervisor_machdep.c,v 1.13 2009/10/23 02:32:34 snj Exp $	*/
+/*	$NetBSD: hypervisor_machdep.c,v 1.14 2011/03/30 21:53:58 jym Exp $	*/
 
 /*
  *
@@ -54,7 +54,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hypervisor_machdep.c,v 1.13 2009/10/23 02:32:34 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: hypervisor_machdep.c,v 1.14 2011/03/30 21:53:58 jym Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -385,10 +385,11 @@
  * A L1 page contains the list of MFN we are looking for
  */
 max_pfn = xen_start_info.nr_pages;
-fpp = PAGE_SIZE / sizeof(paddr_t);
+fpp = PAGE_SIZE / sizeof(xen_pfn_t);
 
 /* we only need one L3 page */
-l3_p2m_page = kmem_alloc(PAGE_SIZE, KM_NOSLEEP);
+l3_p2m_page = (vaddr_t *)uvm_km_alloc(kernel_map, PAGE_SIZE,
+	PAGE_SIZE, UVM_KMF_WIRED | UVM_KMF_NOWAIT);
 if (l3_p2m_page == NULL)
 panic(could not allocate memory for l3_p2m_page);
 
@@ -398,7 +399,9 @@
  */
 l2_p2m_page_size = howmany(max_pfn, fpp);
 
-l2_p2m_page = kmem_alloc(l2_p2m_page_size * PAGE_SIZE, KM_NOSLEEP);
+l2_p2m_page = (vaddr_t *)uvm_km_alloc(kernel_map,
+	l2_p2m_page_size * PAGE_SIZE,
+	PAGE_SIZE, UVM_KMF_WIRED | UVM_KMF_NOWAIT);
 if (l2_p2m_page == NULL)
 panic(could not allocate memory for l2_p2m_page);
 
@@ -418,7 +421,7 @@
 unsigned long max_pfn;
 
 max_pfn = xen_start_info.nr_pages;
-fpp = PAGE_SIZE / sizeof(paddr_t);
+fpp = PAGE_SIZE / sizeof(xen_pfn_t);
 
 for (i = 0; i  l2_p2m_page_size; i++) {
 /*



CVS commit: src/usr.bin/make

2011-03-30 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Wed Mar 30 22:03:49 UTC 2011

Modified Files:
src/usr.bin/make: meta.c meta.h

Log Message:
Add NetBSD tags


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/meta.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/meta.h

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

Modified files:

Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.14 src/usr.bin/make/meta.c:1.15
--- src/usr.bin/make/meta.c:1.14	Tue Mar 29 17:29:20 2011
+++ src/usr.bin/make/meta.c	Wed Mar 30 22:03:49 2011
@@ -1,3 +1,5 @@
+/*  $NetBSD: meta.c,v 1.15 2011/03/30 22:03:49 sjg Exp $ */
+
 /*
  * Implement 'meta' mode.
  * Adapted from John Birrell's patches to FreeBSD make.

Index: src/usr.bin/make/meta.h
diff -u src/usr.bin/make/meta.h:1.1 src/usr.bin/make/meta.h:1.2
--- src/usr.bin/make/meta.h:1.1	Mon Sep 13 15:36:57 2010
+++ src/usr.bin/make/meta.h	Wed Mar 30 22:03:49 2011
@@ -1,3 +1,5 @@
+/*  $NetBSD: meta.h,v 1.2 2011/03/30 22:03:49 sjg Exp $ */
+
 /*
  * Things needed for 'meta' mode.
  */



CVS commit: src/tests/include

2011-03-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Mar 30 22:26:26 UTC 2011

Modified Files:
src/tests/include: t_paths.c

Log Message:
Remove atf_tc_expect_fail(). Should be fixed.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/include/t_paths.c

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

Modified files:

Index: src/tests/include/t_paths.c
diff -u src/tests/include/t_paths.c:1.3 src/tests/include/t_paths.c:1.4
--- src/tests/include/t_paths.c:1.3	Wed Mar 30 19:32:13 2011
+++ src/tests/include/t_paths.c	Wed Mar 30 22:26:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_paths.c,v 1.3 2011/03/30 19:32:13 jruoho Exp $ */
+/*	$NetBSD: t_paths.c,v 1.4 2011/03/30 22:26:26 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_paths.c,v 1.3 2011/03/30 19:32:13 jruoho Exp $);
+__RCSID($NetBSD: t_paths.c,v 1.4 2011/03/30 22:26:26 jruoho Exp $);
 
 #include sys/param.h
 #include sys/stat.h
@@ -160,9 +160,6 @@
 
 		if ((paths[i].flags  PATH_DEV) != 0) {
 
-			if (strcmp(paths[i].path, _PATH_BPF) == 0)
-atf_tc_expect_fail(PR kern/44807);
-
 			ATF_REQUIRE(S_ISBLK(m) != 0 || S_ISCHR(m) != 0);
 
 			ATF_REQUIRE((paths[i].flags  PATH_DIR) == 0);



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

2011-03-30 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Wed Mar 30 22:34:03 UTC 2011

Modified Files:
src/sys/arch/xen/xenbus: xenbus_probe.c

Log Message:
(purely cosmetic changes)

- Use free_otherend_details() instead of calling free() on xbusd_otherend.
- rename talk_to_otherend() to watch_otherend(). We register a watch for
changes in the otherend device state; we are not really talking to it.
- add missing prototypes.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/xen/xenbus/xenbus_probe.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/xen/xenbus/xenbus_probe.c
diff -u src/sys/arch/xen/xenbus/xenbus_probe.c:1.28 src/sys/arch/xen/xenbus/xenbus_probe.c:1.29
--- src/sys/arch/xen/xenbus/xenbus_probe.c:1.28	Tue Jul  6 15:00:10 2010
+++ src/sys/arch/xen/xenbus/xenbus_probe.c	Wed Mar 30 22:34:03 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: xenbus_probe.c,v 1.28 2010/07/06 15:00:10 cherry Exp $ */
+/* $NetBSD: xenbus_probe.c,v 1.29 2011/03/30 22:34:03 jym Exp $ */
 /**
  * Talks to Xen Store to figure out what devices we have.
  *
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xenbus_probe.c,v 1.28 2010/07/06 15:00:10 cherry Exp $);
+__KERNEL_RCSID(0, $NetBSD: xenbus_probe.c,v 1.29 2011/03/30 22:34:03 jym Exp $);
 
 #if 0
 #define DPRINTK(fmt, args...) \
@@ -69,6 +69,16 @@
 static void xenbus_attach(device_t, device_t, void *);
 static int  xenbus_print(void *, const char *);
 
+/* routines gathering device information from XenStore */
+static int  read_otherend_details(struct xenbus_device *,
+		const char *, const char *);
+static int  read_backend_details (struct xenbus_device *);
+static int  read_frontend_details(struct xenbus_device *);
+static void free_otherend_details(struct xenbus_device *);
+
+static int  watch_otherend (struct xenbus_device *);
+static void free_otherend_watch(struct xenbus_device *);
+
 static void xenbus_probe_init(void *);
 
 static struct xenbus_device *xenbus_lookup_device_path(const char *);
@@ -158,8 +168,7 @@
 		printf(missing other end from %s\n, xendev-xbusd_path);
 		xenbus_dev_fatal(xendev, -ENOENT, missing other end from %s,
  xendev-xbusd_path);
-		free(xendev-xbusd_otherend, M_DEVBUF);
-		xendev-xbusd_otherend = NULL;
+		free_otherend_details(xendev);
 		return ENOENT;
 	}
 
@@ -179,15 +188,12 @@
 	return read_otherend_details(xendev, frontend-id, frontend);
 }
 
-#if unused
 static void
 free_otherend_details(struct xenbus_device *dev)
 {
 	free(dev-xbusd_otherend, M_DEVBUF);
 	dev-xbusd_otherend = NULL;
 }
-#endif
-
 
 static void
 free_otherend_watch(struct xenbus_device *dev)
@@ -248,7 +254,7 @@
 }
 
 static int
-talk_to_otherend(struct xenbus_device *dev)
+watch_otherend(struct xenbus_device *dev)
 {
 	free_otherend_watch(dev);
 
@@ -360,7 +366,7 @@
 		}
 		SLIST_INSERT_HEAD(xenbus_device_list,
 		xbusd, xbusd_entries);
-		talk_to_otherend(xbusd);
+		watch_otherend(xbusd);
 	}
 	free(dir, M_DEVBUF);
 	return err;
@@ -467,7 +473,7 @@
 	KASSERT(xenbus_lookup_device_path(xbusd-xbusd_path) == xbusd);
 	SLIST_REMOVE(xenbus_device_list, xbusd, xenbus_device, xbusd_entries);
 	free_otherend_watch(xbusd);
-	free(xbusd-xbusd_otherend, M_DEVBUF);
+	free_otherend_details(xbusd);
 	xenbus_switch_state(xbusd, NULL, XenbusStateClosed);
 	free(xbusd, M_DEVBUF);
 	return 0;



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

2011-03-30 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Wed Mar 30 22:57:24 UTC 2011

Modified Files:
src/sys/arch/xen/include/amd64: hypercalls.h
src/sys/arch/xen/include/i386: hypercalls.h

Log Message:
Add the HYPERVISOR_sysctl() hypercall.

Although the hypercall arguments (like struct sysctl_readconsole) are not
compatible between different XEN_SYSCTL_INTERFACE_VERSIONs (one of the
reasons why the sysctl calls should only be used by xentools directly),
it's still practical to have when one wants to query Xen's dmesg from
ddb(4) in case of a panic.

Note: additional code is needed for readconsole() functionality, but adding
the hypercall should not cause any harm.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/xen/include/amd64/hypercalls.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/xen/include/i386/hypercalls.h

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

Modified files:

Index: src/sys/arch/xen/include/amd64/hypercalls.h
diff -u src/sys/arch/xen/include/amd64/hypercalls.h:1.5 src/sys/arch/xen/include/amd64/hypercalls.h:1.6
--- src/sys/arch/xen/include/amd64/hypercalls.h:1.5	Thu Nov 13 01:45:48 2008
+++ src/sys/arch/xen/include/amd64/hypercalls.h	Wed Mar 30 22:57:24 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: hypercalls.h,v 1.5 2008/11/13 01:45:48 cegger Exp $ */
+/* $NetBSD: hypercalls.h,v 1.6 2011/03/30 22:57:24 jym Exp $ */
 /**
  * hypercall.h
  * 
@@ -406,4 +406,10 @@
 	return _hypercall1(int, mca, mc);
 }
 
+static inline int
+HYPERVISOR_sysctl(void *sysctl)
+{
+	return _hypercall1(int, sysctl, sysctl);
+}
+
 #endif /* __HYPERCALL_H__ */

Index: src/sys/arch/xen/include/i386/hypercalls.h
diff -u src/sys/arch/xen/include/i386/hypercalls.h:1.10 src/sys/arch/xen/include/i386/hypercalls.h:1.11
--- src/sys/arch/xen/include/i386/hypercalls.h:1.10	Mon Oct 19 18:41:11 2009
+++ src/sys/arch/xen/include/i386/hypercalls.h	Wed Mar 30 22:57:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypercalls.h,v 1.10 2009/10/19 18:41:11 bouyer Exp $	*/
+/*	$NetBSD: hypercalls.h,v 1.11 2011/03/30 22:57:24 jym Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -534,4 +534,16 @@
 
 return ret;
 }
+
+static __inline int
+HYPERVISOR_sysctl(void *sysctl)
+{
+int ret;
+unsigned long ign1;
+
+_hypercall(__HYPERVISOR_sysctl, _harg(1 (sysctl)),
+	_harg(=a (ret), =b (ign1)));
+
+return ret;
+}
 #endif /* _XENI386_HYPERVISOR_H_ */



CVS commit: [jym-xensuspend] src/sys/arch/xen

2011-03-30 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Wed Mar 30 23:15:06 UTC 2011

Modified Files:
src/sys/arch/xen/include/amd64 [jym-xensuspend]: hypercalls.h
src/sys/arch/xen/include/i386 [jym-xensuspend]: hypercalls.h
src/sys/arch/xen/x86 [jym-xensuspend]: hypervisor_machdep.c x86_xpmap.c
src/sys/arch/xen/xen [jym-xensuspend]: if_xennet_xenbus.c xbd_xenbus.c
src/sys/arch/xen/xenbus [jym-xensuspend]: xenbus_probe.c

Log Message:
Sync with my commits in HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.5.4.3 -r1.5.4.4 src/sys/arch/xen/include/amd64/hypercalls.h
cvs rdiff -u -r1.8.4.3 -r1.8.4.4 src/sys/arch/xen/include/i386/hypercalls.h
cvs rdiff -u -r1.11.8.5 -r1.11.8.6 src/sys/arch/xen/x86/hypervisor_machdep.c
cvs rdiff -u -r1.12.4.12 -r1.12.4.13 src/sys/arch/xen/x86/x86_xpmap.c
cvs rdiff -u -r1.33.2.7 -r1.33.2.8 src/sys/arch/xen/xen/if_xennet_xenbus.c
cvs rdiff -u -r1.38.2.7 -r1.38.2.8 src/sys/arch/xen/xen/xbd_xenbus.c
cvs rdiff -u -r1.27.2.5 -r1.27.2.6 src/sys/arch/xen/xenbus/xenbus_probe.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/xen/include/amd64/hypercalls.h
diff -u src/sys/arch/xen/include/amd64/hypercalls.h:1.5.4.3 src/sys/arch/xen/include/amd64/hypercalls.h:1.5.4.4
--- src/sys/arch/xen/include/amd64/hypercalls.h:1.5.4.3	Sun Nov  1 21:43:28 2009
+++ src/sys/arch/xen/include/amd64/hypercalls.h	Wed Mar 30 23:15:05 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: hypercalls.h,v 1.5.4.3 2009/11/01 21:43:28 jym Exp $ */
+/* $NetBSD: hypercalls.h,v 1.5.4.4 2011/03/30 23:15:05 jym Exp $ */
 /**
  * hypercall.h
  * 

Index: src/sys/arch/xen/include/i386/hypercalls.h
diff -u src/sys/arch/xen/include/i386/hypercalls.h:1.8.4.3 src/sys/arch/xen/include/i386/hypercalls.h:1.8.4.4
--- src/sys/arch/xen/include/i386/hypercalls.h:1.8.4.3	Sun Nov  1 21:43:28 2009
+++ src/sys/arch/xen/include/i386/hypercalls.h	Wed Mar 30 23:15:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypercalls.h,v 1.8.4.3 2009/11/01 21:43:28 jym Exp $	*/
+/*	$NetBSD: hypercalls.h,v 1.8.4.4 2011/03/30 23:15:05 jym Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.

Index: src/sys/arch/xen/x86/hypervisor_machdep.c
diff -u src/sys/arch/xen/x86/hypervisor_machdep.c:1.11.8.5 src/sys/arch/xen/x86/hypervisor_machdep.c:1.11.8.6
--- src/sys/arch/xen/x86/hypervisor_machdep.c:1.11.8.5	Tue Mar 29 20:43:01 2011
+++ src/sys/arch/xen/x86/hypervisor_machdep.c	Wed Mar 30 23:15:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervisor_machdep.c,v 1.11.8.5 2011/03/29 20:43:01 jym Exp $	*/
+/*	$NetBSD: hypervisor_machdep.c,v 1.11.8.6 2011/03/30 23:15:05 jym Exp $	*/
 
 /*
  *
@@ -54,7 +54,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hypervisor_machdep.c,v 1.11.8.5 2011/03/29 20:43:01 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: hypervisor_machdep.c,v 1.11.8.6 2011/03/30 23:15:05 jym Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -394,11 +394,11 @@
  * A L1 page contains the list of MFN we are looking for
  */
 max_pfn = xen_start_info.nr_pages;
-fpp = PAGE_SIZE / sizeof(vaddr_t);
+fpp = PAGE_SIZE / sizeof(xen_pfn_t);
 
 /* we only need one L3 page */
 l3_p2m_page = (vaddr_t *)uvm_km_alloc(kernel_map, PAGE_SIZE,
-PAGE_SIZE, UVM_KMF_WIRED | UVM_KMF_NOWAIT);
+	PAGE_SIZE, UVM_KMF_WIRED | UVM_KMF_NOWAIT);
 if (l3_p2m_page == NULL)
 panic(could not allocate memory for l3_p2m_page);
 
@@ -430,7 +430,7 @@
 unsigned long max_pfn;
 
 max_pfn = xen_start_info.nr_pages;
-fpp = PAGE_SIZE / sizeof(vaddr_t);
+fpp = PAGE_SIZE / sizeof(xen_pfn_t);
 
 for (i = 0; i  l2_p2m_page_size; i++) {
 /*

Index: src/sys/arch/xen/x86/x86_xpmap.c
diff -u src/sys/arch/xen/x86/x86_xpmap.c:1.12.4.12 src/sys/arch/xen/x86/x86_xpmap.c:1.12.4.13
--- src/sys/arch/xen/x86/x86_xpmap.c:1.12.4.12	Tue Mar 29 20:43:01 2011
+++ src/sys/arch/xen/x86/x86_xpmap.c	Wed Mar 30 23:15:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_xpmap.c,v 1.12.4.12 2011/03/29 20:43:01 jym Exp $	*/
+/*	$NetBSD: x86_xpmap.c,v 1.12.4.13 2011/03/30 23:15:05 jym Exp $	*/
 
 /*
  * Copyright (c) 2006 Mathieu Ropert m...@adviseo.fr
@@ -69,7 +69,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: x86_xpmap.c,v 1.12.4.12 2011/03/29 20:43:01 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: x86_xpmap.c,v 1.12.4.13 2011/03/30 23:15:05 jym Exp $);
 
 #include opt_xen.h
 #include opt_ddb.h

Index: src/sys/arch/xen/xen/if_xennet_xenbus.c
diff -u src/sys/arch/xen/xen/if_xennet_xenbus.c:1.33.2.7 src/sys/arch/xen/xen/if_xennet_xenbus.c:1.33.2.8
--- src/sys/arch/xen/xen/if_xennet_xenbus.c:1.33.2.7	Mon Mar 28 23:04:56 2011
+++ src/sys/arch/xen/xen/if_xennet_xenbus.c	Wed Mar 30 23:15:06 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: if_xennet_xenbus.c,v 1.33.2.7 2011/03/28 23:04:56 jym Exp $ 

CVS commit: src/sys/arch/sgimips/dev

2011-03-30 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Mar 31 00:01:08 UTC 2011

Modified Files:
src/sys/arch/sgimips/dev: crmfb.c crmfbreg.h

Log Message:
add DDC2 support. Not too useful yet.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/sgimips/dev/crmfb.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sgimips/dev/crmfbreg.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/sgimips/dev/crmfb.c
diff -u src/sys/arch/sgimips/dev/crmfb.c:1.29 src/sys/arch/sgimips/dev/crmfb.c:1.30
--- src/sys/arch/sgimips/dev/crmfb.c:1.29	Wed Mar 30 19:16:35 2011
+++ src/sys/arch/sgimips/dev/crmfb.c	Thu Mar 31 00:01:08 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: crmfb.c,v 1.29 2011/03/30 19:16:35 macallan Exp $ */
+/* $NetBSD: crmfb.c,v 1.30 2011/03/31 00:01:08 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: crmfb.c,v 1.29 2011/03/30 19:16:35 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: crmfb.c,v 1.30 2011/03/31 00:01:08 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -54,6 +54,12 @@
 #include dev/rasops/rasops.h
 #include dev/wscons/wsdisplay_vconsvar.h
 
+#include dev/i2c/i2cvar.h
+#include dev/i2c/i2c_bitbang.h
+#include dev/i2c/ddcvar.h
+#include dev/videomode/videomode.h
+#include dev/videomode/edidvar.h
+
 #include arch/sgimips/dev/crmfbreg.h
 
 /*#define CRMFB_DEBUG*/
@@ -120,6 +126,8 @@
 struct crmfb_softc {
 	device_t		sc_dev;
 	struct vcons_data	sc_vd;
+	struct i2c_controller	sc_i2c;
+	int sc_dir;
 
 	bus_space_tag_t		sc_iot;
 	bus_space_handle_t	sc_ioh;
@@ -182,6 +190,33 @@
 static void	crmfb_cursor(void *, int, int, int);
 static void	crmfb_putchar(void *, int, int, u_int, long);
 
+/* I2C glue */
+static int crmfb_i2c_acquire_bus(void *, int);
+static void crmfb_i2c_release_bus(void *, int);
+static int crmfb_i2c_send_start(void *, int);
+static int crmfb_i2c_send_stop(void *, int);
+static int crmfb_i2c_initiate_xfer(void *, i2c_addr_t, int);
+static int crmfb_i2c_read_byte(void *, uint8_t *, int);
+static int crmfb_i2c_write_byte(void *, uint8_t, int);
+
+/* I2C bitbang glue */
+static void crmfb_i2cbb_set_bits(void *, uint32_t);
+static void crmfb_i2cbb_set_dir(void *, uint32_t);
+static uint32_t crmfb_i2cbb_read(void *);
+
+static const struct i2c_bitbang_ops crmfb_i2cbb_ops = {
+	crmfb_i2cbb_set_bits,
+	crmfb_i2cbb_set_dir,
+	crmfb_i2cbb_read,
+	{
+		CRMFB_I2C_SDA,
+		CRMFB_I2C_SCL,
+		0,
+		1
+	}
+};
+static void crmfb_setup_ddc(struct crmfb_softc *);
+
 CFATTACH_DECL_NEW(crmfb, sizeof(struct crmfb_softc),
 crmfb_match, crmfb_attach, NULL, NULL);
 
@@ -223,6 +258,8 @@
 	if (rv)
 		panic(crmfb_attach: can't map rendering engine);
 
+	//crmfb_setup_ddc(sc);
+
 	/* determine mode configured by firmware */
 	d = bus_space_read_4(sc-sc_iot, sc-sc_ioh, CRMFB_VT_HCMAP);
 	sc-sc_width = (d  CRMFB_VT_HCMAP_ON_SHIFT)  0xfff;
@@ -351,6 +388,7 @@
 #ifdef CRMFB_DEBUG
 	crmfb_test_mte(sc);
 #endif
+	crmfb_setup_ddc(sc);
 	return;
 }
 
@@ -1435,3 +1473,108 @@
 		}
 	}
 }
+
+static void
+crmfb_setup_ddc(struct crmfb_softc *sc)
+{
+	int i;
+	char edid_data[128];
+	struct edid_info ei;
+
+	memset(edid_data, 0, 128);
+	sc-sc_i2c.ic_cookie = sc;
+	sc-sc_i2c.ic_acquire_bus = crmfb_i2c_acquire_bus;
+	sc-sc_i2c.ic_release_bus = crmfb_i2c_release_bus;
+	sc-sc_i2c.ic_send_start = crmfb_i2c_send_start;
+	sc-sc_i2c.ic_send_stop = crmfb_i2c_send_stop;
+	sc-sc_i2c.ic_initiate_xfer = crmfb_i2c_initiate_xfer;
+	sc-sc_i2c.ic_read_byte = crmfb_i2c_read_byte;
+	sc-sc_i2c.ic_write_byte = crmfb_i2c_write_byte;
+	sc-sc_i2c.ic_exec = NULL;
+	i = 0;
+	while (edid_data[1] == 0  i++  10)
+		ddc_read_edid(sc-sc_i2c, edid_data, 128);
+	if (i  1)
+		aprint_debug_dev(sc-sc_dev,
+		had to try %d times to get EDID data\n, i);
+	if (i  11) {
+		edid_parse(edid_data, ei);
+		edid_print(ei);
+	}
+}
+
+/* I2C bitbanging */
+static void
+crmfb_i2cbb_set_bits(void *cookie, uint32_t bits)
+{
+	struct crmfb_softc *sc = cookie;
+
+	bus_space_write_4(sc-sc_iot, sc-sc_ioh, CRMFB_I2C_VGA, bits ^ 3);
+}
+
+static void
+crmfb_i2cbb_set_dir(void *cookie, uint32_t dir)
+{
+
+	/* Nothing to do */
+}
+
+static uint32_t
+crmfb_i2cbb_read(void *cookie)
+{
+	struct crmfb_softc *sc = cookie;
+
+	return bus_space_read_4(sc-sc_iot, sc-sc_ioh, CRMFB_I2C_VGA) ^ 3;
+}
+
+/* higher level I2C stuff */
+static int
+crmfb_i2c_acquire_bus(void *cookie, int flags)
+{
+
+	/* private bus */
+	return 0;
+}
+
+static void
+crmfb_i2c_release_bus(void *cookie, int flags)
+{
+
+	/* private bus */
+}
+
+static int
+crmfb_i2c_send_start(void *cookie, int flags)
+{
+
+	return i2c_bitbang_send_start(cookie, flags, crmfb_i2cbb_ops);
+}
+
+static int
+crmfb_i2c_send_stop(void *cookie, int flags)
+{
+
+	return i2c_bitbang_send_stop(cookie, flags, crmfb_i2cbb_ops);
+}
+
+static int
+crmfb_i2c_initiate_xfer(void *cookie, i2c_addr_t 

CVS commit: src/libexec/httpd

2011-03-30 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Mar 31 01:19:38 UTC 2011

Modified Files:
src/libexec/httpd: content-bozo.c

Log Message:
add .mp4 as video/mp4.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/libexec/httpd/content-bozo.c

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

Modified files:

Index: src/libexec/httpd/content-bozo.c
diff -u src/libexec/httpd/content-bozo.c:1.5 src/libexec/httpd/content-bozo.c:1.6
--- src/libexec/httpd/content-bozo.c:1.5	Mon May 10 03:37:45 2010
+++ src/libexec/httpd/content-bozo.c	Thu Mar 31 01:19:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: content-bozo.c,v 1.5 2010/05/10 03:37:45 mrg Exp $	*/
+/*	$NetBSD: content-bozo.c,v 1.6 2011/03/31 01:19:37 mrg Exp $	*/
 
 /*	$eterna: content-bozo.c,v 1.15 2010/05/10 02:51:28 mrg Exp $	*/
 
@@ -163,6 +163,7 @@
 	{ .mpeg,	5, video/mpeg,		,		, NULL },
 	{ .mpg,	4, video/mpeg,		,		, NULL },
 	{ .mpe,	4, video/mpeg,		,		, NULL },
+	{ .mp4,	4, video/mp4,			,		, NULL },
 	{ .qt,	3, video/quicktime,		,		, NULL },
 	{ .mov,	4, video/quicktime,		,		, NULL },
 	{ .avi,	4, video/x-msvideo,		,		, NULL },



CVS commit: src/sys/arch/sandpoint/sandpoint

2011-03-30 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Thu Mar 31 02:32:36 UTC 2011

Modified Files:
src/sys/arch/sandpoint/sandpoint: iic_eumb.c

Log Message:
Build and use i2c-child-devices property to choose the correct RTC
chip among various models.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sandpoint/sandpoint/iic_eumb.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/sandpoint/sandpoint/iic_eumb.c
diff -u src/sys/arch/sandpoint/sandpoint/iic_eumb.c:1.10 src/sys/arch/sandpoint/sandpoint/iic_eumb.c:1.11
--- src/sys/arch/sandpoint/sandpoint/iic_eumb.c:1.10	Wed Jan 12 18:09:03 2011
+++ src/sys/arch/sandpoint/sandpoint/iic_eumb.c	Thu Mar 31 02:32:35 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: iic_eumb.c,v 1.10 2011/01/12 18:09:03 phx Exp $ */
+/* $NetBSD: iic_eumb.c,v 1.11 2011/03/31 02:32:35 nisimura Exp $ */
 
 /*-
  * Copyright (c) 2010,2011 Frank Wille.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: iic_eumb.c,v 1.10 2011/01/12 18:09:03 phx Exp $);
+__KERNEL_RCSID(0, $NetBSD: iic_eumb.c,v 1.11 2011/03/31 02:32:35 nisimura Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -37,6 +37,7 @@
 #include machine/bus.h
 #include dev/i2c/motoi2cvar.h
 #include sandpoint/sandpoint/eumbvar.h
+#include machine/bootinfo.h
 
 struct iic_eumb_softc {
 	device_t		sc_dev;
@@ -51,6 +52,19 @@
 
 static int found;
 
+struct i2cdev {
+	const char *family;
+	const char *name;
+	int addr;
+};
+
+static struct i2cdev rtcmodel[] = {
+   { kurobox,  rs5c372rtc, 0x32 },
+   { synology, rs5c372rtc, 0x32 },
+};
+
+void add_i2c_child_devices(device_t, const char *);
+
 static int
 iic_eumb_match(device_t parent, cfdata_t cf, void *aux)
 {
@@ -64,6 +78,7 @@
 	struct iic_eumb_softc *sc;
 	struct eumb_attach_args *eaa;
 	bus_space_handle_t ioh;
+	struct btinfo_prodfamily *pfam;
 
 	sc = device_private(self);
 	sc-sc_dev = self;
@@ -73,6 +88,9 @@
 	aprint_naive(\n);
 	aprint_normal(\n);
 
+	if ((pfam = lookup_bootinfo(BTINFO_PRODFAMILY)) != NULL)
+		add_i2c_child_devices(self, pfam-name);
+
 	/*
 	 * map EUMB registers and attach MI motoi2c with default settings
 	 */
@@ -81,3 +99,31 @@
 	sc-sc_motoi2c.sc_ioh = ioh;
 	motoi2c_attach_common(self, sc-sc_motoi2c, NULL);
 }
+
+void
+add_i2c_child_devices(device_t self, const char *family)
+{
+	struct i2cdev *rtc;
+	prop_dictionary_t pd;
+	prop_array_t pa;
+	int i;
+
+	rtc = NULL;
+	for (i = 0; i  (int)(sizeof(rtcmodel)/sizeof(rtcmodel[0])); i++) {
+		if (strcmp(family, rtcmodel[i].family) == 0) {
+			rtc = rtcmodel[i];
+			goto found;
+		}
+	}
+	return;
+
+ found:
+	pd = prop_dictionary_create();
+	pa = prop_array_create();
+	prop_dictionary_set_cstring_nocopy(pd, name, rtc-name);
+	prop_dictionary_set_uint32(pd, addr, rtc-addr);
+	prop_array_add(pa, pd);
+	prop_dictionary_set(device_properties(self), i2c-child-devices, pa);
+	prop_object_release(pd);
+	prop_object_release(pa);
+}