CVS commit: src

2011-09-30 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Sep 30 10:23:03 UTC 2011

Modified Files:
src/common/lib/libppath: ppath.c
src/sys/sys: systm.h

Log Message:
avoid sys/systm.h in userland ppath.h.
include types.h/stdarg.h in all systm.h configs.

my amd64 build without man pages now worked at least.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libppath/ppath.c
cvs rdiff -u -r1.249 -r1.250 src/sys/sys/systm.h

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

Modified files:

Index: src/common/lib/libppath/ppath.c
diff -u src/common/lib/libppath/ppath.c:1.2 src/common/lib/libppath/ppath.c:1.3
--- src/common/lib/libppath/ppath.c:1.2	Thu Sep 29 20:53:30 2011
+++ src/common/lib/libppath/ppath.c	Fri Sep 30 10:23:03 2011
@@ -1,5 +1,5 @@
-/* $NetBSD: ppath.c,v 1.2 2011/09/29 20:53:30 christos Exp $ */
-/* $Id: ppath.c,v 1.2 2011/09/29 20:53:30 christos Exp $ */
+/* $NetBSD: ppath.c,v 1.3 2011/09/30 10:23:03 mrg Exp $ */
+/* $Id: ppath.c,v 1.3 2011/09/30 10:23:03 mrg Exp $ */
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -30,9 +30,11 @@
  */
 
 #include sys/cdefs.h
-__RCSID($Id: ppath.c,v 1.2 2011/09/29 20:53:30 christos Exp $);
+__RCSID($Id: ppath.c,v 1.3 2011/09/30 10:23:03 mrg Exp $);
 
+#ifdef _KERNEL
 #include sys/systm.h
+#endif
 #include ppath/ppath.h
 #include ppath/ppath_impl.h
 

Index: src/sys/sys/systm.h
diff -u src/sys/sys/systm.h:1.249 src/sys/sys/systm.h:1.250
--- src/sys/sys/systm.h:1.249	Thu Sep 29 20:52:12 2011
+++ src/sys/sys/systm.h	Fri Sep 30 10:23:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: systm.h,v 1.249 2011/09/29 20:52:12 christos Exp $	*/
+/*	$NetBSD: systm.h,v 1.250 2011/09/30 10:23:03 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1988, 1991, 1993
@@ -46,10 +46,8 @@
 
 #include machine/endian.h
 
-#ifdef _KERNEL
 #include sys/types.h
 #include sys/stdarg.h
-#endif
 
 #include sys/device_if.h
 



CVS commit: src/tests

2011-09-30 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Fri Sep 30 14:50:20 UTC 2011

Modified Files:
src/tests/include/sys: t_bitops.c
src/tests/lib/libc/stdlib: t_strtod.c

Log Message:
Add expected failures for Qemu.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/include/sys/t_bitops.c
cvs rdiff -u -r1.26 -r1.27 src/tests/lib/libc/stdlib/t_strtod.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.10 src/tests/include/sys/t_bitops.c:1.11
--- src/tests/include/sys/t_bitops.c:1.10	Mon Aug 29 17:39:54 2011
+++ src/tests/include/sys/t_bitops.c	Fri Sep 30 14:50:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_bitops.c,v 1.10 2011/08/29 17:39:54 jruoho Exp $ */
+/*	$NetBSD: t_bitops.c,v 1.11 2011/09/30 14:50:20 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_bitops.c,v 1.10 2011/08/29 17:39:54 jruoho Exp $);
+__RCSID($NetBSD: t_bitops.c,v 1.11 2011/09/30 14:50:20 jruoho Exp $);
 
 #include atf-c.h
 
@@ -37,6 +37,7 @@ __RCSID($NetBSD: t_bitops.c,v 1.10 2011
 #include sys/bitops.h
 
 #include math.h
+#include inttypes.h
 #include stdlib.h
 #include string.h
 
@@ -176,7 +177,12 @@ ATF_TC_BODY(ilog2_log2, tc)
 		y = (double)(ilog2(i));
 
 		ATF_REQUIRE(ceil(x) = y);
-		ATF_REQUIRE(fabs(floor(x) - y)  1.0e-40);
+
+		if (fabs(floor(x) - y)  1.0e-40) {
+			atf_tc_expect_fail(PR misc/44767);
+			atf_tc_fail_nonfatal(log2(%PRIu64) != 
+			ilog2(%PRIu64), i, i);
+		}
 	}
 }
 

Index: src/tests/lib/libc/stdlib/t_strtod.c
diff -u src/tests/lib/libc/stdlib/t_strtod.c:1.26 src/tests/lib/libc/stdlib/t_strtod.c:1.27
--- src/tests/lib/libc/stdlib/t_strtod.c:1.26	Mon Aug 29 17:39:54 2011
+++ src/tests/lib/libc/stdlib/t_strtod.c	Fri Sep 30 14:50:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_strtod.c,v 1.26 2011/08/29 17:39:54 jruoho Exp $ */
+/*	$NetBSD: t_strtod.c,v 1.27 2011/09/30 14:50:20 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 /* Public domain, Otto Moerbeek o...@drijf.net, 2006. */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: t_strtod.c,v 1.26 2011/08/29 17:39:54 jruoho Exp $);
+__RCSID($NetBSD: t_strtod.c,v 1.27 2011/09/30 14:50:20 jruoho Exp $);
 
 #include errno.h
 #include math.h
@@ -280,7 +280,12 @@ ATF_TC_BODY(strtod_round, tc)
 
 	double d2 = strtod(val, NULL);
 
-	ATF_REQUIRE(fabs(d1 - d2)  0.0);
+	if (fabs(d1 - d2)  0.0)
+		return;
+	else {
+		atf_tc_expect_fail(PR misc/44767);
+		atf_tc_fail(strtod(3) did not honor fesetround(3));
+	}
 #else
 	atf_tc_skip(Requires one of i386, amd64 or sparc);
 #endif



CVS commit: src/share/man/man9

2011-09-30 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Fri Sep 30 15:47:20 UTC 2011

Modified Files:
src/share/man/man9: Makefile

Log Message:
There's no stand alone vpanic.9 man page.


To generate a diff of this commit:
cvs rdiff -u -r1.352 -r1.353 src/share/man/man9/Makefile

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/Makefile
diff -u src/share/man/man9/Makefile:1.352 src/share/man/man9/Makefile:1.353
--- src/share/man/man9/Makefile:1.352	Thu Sep 29 20:55:49 2011
+++ src/share/man/man9/Makefile	Fri Sep 30 15:47:20 2011
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.352 2011/09/29 20:55:49 christos Exp $
+#   $NetBSD: Makefile,v 1.353 2011/09/30 15:47:20 njoly Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -53,7 +53,7 @@ MAN=	accept_filter.9 accf_data.9 accf_ht
 	uiomove.9 ucom.9 userret.9 \
 	vattr.9 veriexec.9 vcons.9 vfs.9 vfs_hooks.9 vfsops.9 vfssubr.9 \
 	video.9 vme.9 \
-	vnfileops.9 vnode.9 vnodeops.9 vnsubr.9 vpanic.9 \
+	vnfileops.9 vnode.9 vnodeops.9 vnsubr.9 \
 	ubc.9 usbdi.9 uvm.9 uvm_km.9 uvm_map.9 vmem.9 \
 	wdc.9 workqueue.9 \
 	wscons.9 wsdisplay.9 wsfont.9 wskbd.9 wsmouse.9 \



CVS commit: src/lib/libc/arch/x86_64/gen

2011-09-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 30 17:42:35 UTC 2011

Modified Files:
src/lib/libc/arch/x86_64/gen: flt_rounds.S fpgetround.S fpsetround.S

Log Message:
PR/44293: Paul Goyette: Fix the mess of the rounding code.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/x86_64/gen/flt_rounds.S
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/x86_64/gen/fpgetround.S \
src/lib/libc/arch/x86_64/gen/fpsetround.S

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/arch/x86_64/gen/flt_rounds.S
diff -u src/lib/libc/arch/x86_64/gen/flt_rounds.S:1.5 src/lib/libc/arch/x86_64/gen/flt_rounds.S:1.6
--- src/lib/libc/arch/x86_64/gen/flt_rounds.S:1.5	Thu Sep 29 18:55:45 2011
+++ src/lib/libc/arch/x86_64/gen/flt_rounds.S	Fri Sep 30 13:42:34 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: flt_rounds.S,v 1.5 2011/09/29 22:55:45 christos Exp $	*/
+/*	$NetBSD: flt_rounds.S,v 1.6 2011/09/30 17:42:34 christos Exp $	*/
 
 #include machine/asm.h
 
@@ -12,8 +12,10 @@
 	_ALIGN_TEXT
 ENTRY(__flt_rounds)
 	fnstcw	-4(%rsp)
-	movl	-4(%rsp), %eax
-	shrl	$10, %eax
+	movl	-4(%rsp), %ecx
+	shrl	$9, %ecx
+	andl	$6, %ecx
+	movl	$0x2d, %eax	/* 0x2d = 00.10.11.01 */
+	sarl	%cl, %eax	/* 0,1,2,3 - 1,3,2,0 */
 	andl	$3, %eax
-	xorl	$1, %eax	/* map 0,1,2,3 - 1,0,3,2 */
 	ret

Index: src/lib/libc/arch/x86_64/gen/fpgetround.S
diff -u src/lib/libc/arch/x86_64/gen/fpgetround.S:1.3 src/lib/libc/arch/x86_64/gen/fpgetround.S:1.4
--- src/lib/libc/arch/x86_64/gen/fpgetround.S:1.3	Wed Jun 12 15:17:22 2002
+++ src/lib/libc/arch/x86_64/gen/fpgetround.S	Fri Sep 30 13:42:34 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetround.S,v 1.3 2002/06/12 19:17:22 fvdl Exp $	*/
+/*	$NetBSD: fpgetround.S,v 1.4 2011/09/30 17:42:34 christos Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 4, 1995
@@ -8,7 +8,7 @@
 #include machine/asm.h
 
 /*
- * XXX store only x87 state. If an application only uses the fp*
+ * XXX load only x87 state. If an application only uses the fp*
  * interface, this should be in sync with the SSE mxcsr register.
  */
 
@@ -19,7 +19,6 @@ ENTRY(_fpgetround)
 ENTRY(fpgetround)
 #endif
 	fnstcw -4(%rsp)
-	movl -4(%rsp),%eax
-	rorl $10,%eax
-	andl $3,%eax
+	movl -4(%rsp), %eax
+	andl $0x0c00, %eax
 	ret
Index: src/lib/libc/arch/x86_64/gen/fpsetround.S
diff -u src/lib/libc/arch/x86_64/gen/fpsetround.S:1.3 src/lib/libc/arch/x86_64/gen/fpsetround.S:1.4
--- src/lib/libc/arch/x86_64/gen/fpsetround.S:1.3	Wed Jun 12 15:17:22 2002
+++ src/lib/libc/arch/x86_64/gen/fpsetround.S	Fri Sep 30 13:42:34 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetround.S,v 1.3 2002/06/12 19:17:22 fvdl Exp $	*/
+/*	$NetBSD: fpsetround.S,v 1.4 2011/09/30 17:42:34 christos Exp $	*/
 
 /*
  * Written by Frank van der Linden at Wasabi Systems for NetBSD.
@@ -21,28 +21,22 @@ ENTRY(_fpsetround)
 #else
 ENTRY(fpsetround)
 #endif
-	fnstcw	-4(%rsp)
-	stmxcsr	-8(%rsp)
-
-	andl	$3,%edi
 
-	movl	-4(%rsp),%edx
-	rorl	$10,%edx
-	movl	%edx,%eax
-	andl	$3,%eax
+	fnstcw	-4(%rsp)
+	movl	-4(%rsp), %edx
+	movl	%edx, %eax
+	andl	$0x0c00, %eax	
+	andl	$0xf3ff, %edx
+	orl	%edi, %edx
+	movl	%edx, -4(%rsp)
+	fldcw	-4(%rsp)
 
-	andl	$~3,%edx
+	stmxcsr	-4(%rsp)
+	movl	-4(%rsp), %edx
+	andl	$0x9fff, %edx
+	sall	$3, %edi
 	orl	%edi,%edx
-	roll	$10,%edx
 	movl	%edx,-4(%rsp)
+	ldmxcsr	-4(%rsp)
 
-	movl	-8(%rsp),%edx
-	rorl	$13,%edx
-	andl	$~3,%edx
-	orl	%edi,%edx
-	roll	$13,%edx
-	movl	%edx,-8(%rsp)
-
-	ldmxcsr	-8(%rsp)
-	fldcw	-4(%rsp)
 	ret



CVS commit: src/tests/lib/libc/gen

2011-09-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 30 17:44:58 UTC 2011

Modified Files:
src/tests/lib/libc/gen: Makefile t_fpsetround.c

Log Message:
Make the rounding test work properly, and actually test the rounding modes.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tests/lib/libc/gen/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/gen/t_fpsetround.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/libc/gen/Makefile
diff -u src/tests/lib/libc/gen/Makefile:1.30 src/tests/lib/libc/gen/Makefile:1.31
--- src/tests/lib/libc/gen/Makefile:1.30	Mon Sep 19 01:40:38 2011
+++ src/tests/lib/libc/gen/Makefile	Fri Sep 30 13:44:58 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.30 2011/09/19 05:40:38 jruoho Exp $
+# $NetBSD: Makefile,v 1.31 2011/09/30 17:44:58 christos Exp $
 
 .include bsd.own.mk
 
@@ -30,9 +30,14 @@ TESTS_C+=	t_ttyname
 TESTS_C+=	t_vis
 
 LDADD.t_fpclassify+=	-lm
+DPADD.t_fpclassify+=	${LIBM}
+LDADD.t_fpsetround+=	-lm
+DPADD.t_fpsetround+=	${LIBM}
 
 LDADD.t_nice+=		-lpthread
+DPADD.t_nice+=		${LIBPTHREAD}
 LDADD.t_syslog+=	-lpthread
+DPADD.t_syslog+=	${LIBPTHREAD}
 
 .if ${MACHINE_ARCH} == alpha
 COPTS+=			-mieee

Index: src/tests/lib/libc/gen/t_fpsetround.c
diff -u src/tests/lib/libc/gen/t_fpsetround.c:1.1 src/tests/lib/libc/gen/t_fpsetround.c:1.2
--- src/tests/lib/libc/gen/t_fpsetround.c:1.1	Mon Sep 19 01:25:50 2011
+++ src/tests/lib/libc/gen/t_fpsetround.c	Fri Sep 30 13:44:58 2011
@@ -1,13 +1,45 @@
-/* $NetBSD: t_fpsetround.c,v 1.1 2011/09/19 05:25:50 jruoho Exp $ */
+/* $NetBSD: t_fpsetround.c,v 1.2 2011/09/30 17:44:58 christos Exp $ */
 
-/*
- * Written by J.T. Conklin, Apr 18, 1995
- * Public domain.
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *must display the following acknowledgement:
+ *This product includes software developed by the NetBSD
+ *Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *contributors may be used to endorse or promote products derived
+ *from this software without specific prior written permission.
+ *
+ * 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 sys/cdefs.h
+__RCSID($NetBSD: t_fpsetround.c,v 1.2 2011/09/30 17:44:58 christos Exp $);
 
 #include float.h
+#include math.h
 #include stdlib.h
 #include string.h
 
@@ -15,6 +47,15 @@
 #include ieeefp.h
 #endif
 
+#ifdef DEBUG
+#include stdio.h
+#define DPRINTF(a)	printf a
+#else
+#define DPRINTF(a)
+#endif
+
+#include atf-c.h
+
 ATF_TC(fpsetround_basic);
 ATF_TC_HEAD(fpsetround_basic, tc)
 {
@@ -23,48 +64,62 @@ ATF_TC_HEAD(fpsetround_basic, tc)
 	Minimal testing of fpgetround(3) and fpsetround(3));
 }
 
+static const struct {
+	const char *n;
+	int v[4];
+} tst[] = {	/*  RN  RP  RM  RZ */
+	{  1.1, {  1,  1,  2,  1 } },
+	{  1.5, {  1,  2,  2,  1 } },
+	{  1.9, {  1,  2,  2,  1 } },
+	{ -1.1, { -1, -1, -1, -2 } },
+	{ -1.5, { -1, -2, -1, -2 } },
+	{ -1.9, { -1, -2, -1, -2 } },
+};
+
+static void
+test(int r)
+{
+	for (size_t i = 0; i  __arraycount(tst); i++) {
+		double d = strtod(tst[i].n, NULL);
+		ATF_CHECK_EQ((int)rint(d), tst[i].v[r]);
+		DPRINTF((%s %d %d\n, tst[i].n, (int)rint(d), tst[i].v[r]));
+	}
+}
+
+static const struct {
+	int rm;
+	int rf;
+} rnd[] = {
+	{ FP_RN, 1 },
+	{ FP_RP, 2 },
+	{ FP_RM, 3 },
+	{ FP_RZ, 0 },
+
+};
+
 ATF_TC_BODY(fpsetround_basic, tc)
 {

CVS commit: src/tests/lib/libc/gen

2011-09-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 30 18:27:18 UTC 2011

Modified Files:
src/tests/lib/libc/gen: t_fpsetround.c

Log Message:
print stderr, when things go wrong.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/gen/t_fpsetround.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/libc/gen/t_fpsetround.c
diff -u src/tests/lib/libc/gen/t_fpsetround.c:1.2 src/tests/lib/libc/gen/t_fpsetround.c:1.3
--- src/tests/lib/libc/gen/t_fpsetround.c:1.2	Fri Sep 30 13:44:58 2011
+++ src/tests/lib/libc/gen/t_fpsetround.c	Fri Sep 30 14:27:18 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fpsetround.c,v 1.2 2011/09/30 17:44:58 christos Exp $ */
+/* $NetBSD: t_fpsetround.c,v 1.3 2011/09/30 18:27:18 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -36,24 +36,18 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_fpsetround.c,v 1.2 2011/09/30 17:44:58 christos Exp $);
+__RCSID($NetBSD: t_fpsetround.c,v 1.3 2011/09/30 18:27:18 christos Exp $);
 
 #include float.h
 #include math.h
 #include stdlib.h
 #include string.h
+#include stdio.h
 
 #if !defined(__mc68000__)  !defined(__vax__)
 #include ieeefp.h
 #endif
 
-#ifdef DEBUG
-#include stdio.h
-#define DPRINTF(a)	printf a
-#else
-#define DPRINTF(a)
-#endif
-
 #include atf-c.h
 
 ATF_TC(fpsetround_basic);
@@ -66,6 +60,18 @@ ATF_TC_HEAD(fpsetround_basic, tc)
 
 static const struct {
 	const char *n;
+	int rm;
+	int rf;
+} rnd[] = {
+	{ RN, FP_RN, 1 },
+	{ RP, FP_RP, 2 },
+	{ RM, FP_RM, 3 },
+	{ RZ, FP_RZ, 0 },
+
+};
+
+static const struct {
+	const char *n;
 	int v[4];
 } tst[] = {	/*  RN  RP  RM  RZ */
 	{  1.1, {  1,  1,  2,  1 } },
@@ -79,23 +85,23 @@ static const struct {
 static void
 test(int r)
 {
+	int did = 0;
 	for (size_t i = 0; i  __arraycount(tst); i++) {
 		double d = strtod(tst[i].n, NULL);
-		ATF_CHECK_EQ((int)rint(d), tst[i].v[r]);
-		DPRINTF((%s %d %d\n, tst[i].n, (int)rint(d), tst[i].v[r]));
+		int g = (int)rint(d);
+		int e = tst[i].v[r];
+		ATF_CHECK_EQ(g, e);
+		if (g != e) {
+			if (!did) {
+fprintf(stderr, Mode Value Result Expected\n);
+did = 1;
+			}
+			fprintf(stderr, %4.4s %-5.5s %6d %8d\n, rnd[r].n,
+			tst[i].n, (int)rint(d), tst[i].v[r]);
+		}
 	}
 }
 
-static const struct {
-	int rm;
-	int rf;
-} rnd[] = {
-	{ FP_RN, 1 },
-	{ FP_RP, 2 },
-	{ FP_RM, 3 },
-	{ FP_RZ, 0 },
-
-};
 
 ATF_TC_BODY(fpsetround_basic, tc)
 {
@@ -114,10 +120,15 @@ ATF_TC_BODY(fpsetround_basic, tc)
 		int n = rnd[j].rm;
 
 		ATF_CHECK_EQ(r = fpsetround(n), o);
-		DPRINTF((s o=%x r=%x\n, o, r));
+		if (o != r)
+			fprintf(stderr, set expected=%x got=%x\n, o, r);
 		ATF_CHECK_EQ(r = fpgetround(), n);
-		DPRINTF((g n=%x r=%x\n, n, r));
-		ATF_CHECK_EQ(FLT_ROUNDS, rnd[j].rf);
+		if (n != r)
+			fprintf(stderr, get expected=%x got=%x\n, n, r);
+		ATF_CHECK_EQ(r= FLT_ROUNDS, rnd[j].rf);
+		if (r != rnd[j].rf)
+			fprintf(stderr, rounds expected=%x got=%x\n,
+			rnd[j].rf, r);
 		test(rnd[j].rf);
 	}
 #endif /* defined(__mc68000__) || defined(__vax__) */



CVS commit: src/sys/dev/usb

2011-09-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 30 18:43:00 UTC 2011

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
Add 4G Systems XSStick P14 USUPA 5.76Mb/s USB modem


To generate a diff of this commit:
cvs rdiff -u -r1.596 -r1.597 src/sys/dev/usb/usbdevs

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

Modified files:

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.596 src/sys/dev/usb/usbdevs:1.597
--- src/sys/dev/usb/usbdevs:1.596	Tue Sep 20 15:25:01 2011
+++ src/sys/dev/usb/usbdevs	Fri Sep 30 14:42:59 2011
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.596 2011/09/20 19:25:01 jakllsch Exp $
+$NetBSD: usbdevs,v 1.597 2011/09/30 18:42:59 christos Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -514,6 +514,7 @@ vendor QUALCOMMINC	0x19d2	Qualcomm, Inco
 vendor QUANTA		0x1a32	Quanta
 vendor WINCHIPHEAD2	0x1a86	QinHeng Electronics
 vendor MPMAN		0x1cae	MPMan
+vendor 4GSYSTEMS	0x1c9e	4G Systems
 vendor PEGATRON		0x1d4d	Pegatron
 vendor AIRTIES		0x1eda	AirTies
 vendor DLINK		0x2001	D-Link
@@ -573,6 +574,9 @@ product 3COMUSR USRISDN		0x008f	3Com U.S
 product 3COMUSR HOMECONN	0x009d	3Com HomeConnect camera
 product 3COMUSR USR56K		0x3021	U.S.Robotics 56000 Voice Faxmodem Pro
 
+/* 4G Systems products */
+product 4GSYSTEMS XSSTICK_P14	0x9605	4G Systems XSStick P14
+
 /* ACDC products */
 product ACDC HUB		0x2315	USB Pen Drive HUB
 product ACDC SECWRITE		0x2316	USB Pen Drive Secure Write



CVS commit: src/sys/dev/usb

2011-09-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 30 18:43:20 UTC 2011

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.589 -r1.590 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.590 -r1.591 src/sys/dev/usb/usbdevs_data.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/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.589 src/sys/dev/usb/usbdevs.h:1.590
--- src/sys/dev/usb/usbdevs.h:1.589	Tue Sep 20 15:25:16 2011
+++ src/sys/dev/usb/usbdevs.h	Fri Sep 30 14:43:19 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.589 2011/09/20 19:25:16 jakllsch Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.590 2011/09/30 18:43:19 christos Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.596 2011/09/20 19:25:01 jakllsch Exp
+ *	NetBSD: usbdevs,v 1.597 2011/09/30 18:42:59 christos Exp
  */
 
 /*
@@ -521,6 +521,7 @@
 #define	USB_VENDOR_QUANTA	0x1a32		/* Quanta */
 #define	USB_VENDOR_WINCHIPHEAD2	0x1a86		/* QinHeng Electronics */
 #define	USB_VENDOR_MPMAN	0x1cae		/* MPMan */
+#define	USB_VENDOR_4GSYSTEMS	0x1c9e		/* 4G Systems */
 #define	USB_VENDOR_PEGATRON	0x1d4d		/* Pegatron */
 #define	USB_VENDOR_AIRTIES	0x1eda		/* AirTies */
 #define	USB_VENDOR_DLINK	0x2001		/* D-Link */
@@ -580,6 +581,9 @@
 #define	USB_PRODUCT_3COMUSR_HOMECONN	0x009d		/* 3Com HomeConnect camera */
 #define	USB_PRODUCT_3COMUSR_USR56K	0x3021		/* U.S.Robotics 56000 Voice Faxmodem Pro */
 
+/* 4G Systems products */
+#define	USB_PRODUCT_4GSYSTEMS_XSSTICK_P14	0x9605		/* 4G Systems XSStick P14 */
+
 /* ACDC products */
 #define	USB_PRODUCT_ACDC_HUB	0x2315		/* USB Pen Drive HUB */
 #define	USB_PRODUCT_ACDC_SECWRITE	0x2316		/* USB Pen Drive Secure Write */

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.590 src/sys/dev/usb/usbdevs_data.h:1.591
--- src/sys/dev/usb/usbdevs_data.h:1.590	Tue Sep 20 15:25:16 2011
+++ src/sys/dev/usb/usbdevs_data.h	Fri Sep 30 14:43:19 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.590 2011/09/20 19:25:16 jakllsch Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.591 2011/09/30 18:43:19 christos Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.596 2011/09/20 19:25:01 jakllsch Exp
+ *	NetBSD: usbdevs,v 1.597 2011/09/30 18:42:59 christos Exp
  */
 
 /*
@@ -1863,6 +1863,10 @@ const struct usb_vendor usb_vendors[] = 
 	MPMan,
 	},
 	{
+	USB_VENDOR_4GSYSTEMS,
+	4G Systems,
+	},
+	{
 	USB_VENDOR_PEGATRON,
 	Pegatron,
 	},
@@ -2023,7 +2027,7 @@ const struct usb_vendor usb_vendors[] = 
 	GNU Radio USRP,
 	},
 };
-const int usb_nvendors = 496;
+const int usb_nvendors = 497;
 
 const struct usb_product usb_products[] = {
 	{
@@ -2071,6 +2075,10 @@ const struct usb_product usb_products[] 
 	U.S.Robotics 56000 Voice Faxmodem Pro,
 	},
 	{
+	USB_VENDOR_4GSYSTEMS, USB_PRODUCT_4GSYSTEMS_XSSTICK_P14,
+	4G Systems XSStick P14,
+	},
+	{
 	USB_VENDOR_ACDC, USB_PRODUCT_ACDC_HUB,
 	USB Pen Drive HUB,
 	},
@@ -8551,4 +8559,4 @@ const struct usb_product usb_products[] 
 	Prestige,
 	},
 };
-const int usb_nproducts = 1631;
+const int usb_nproducts = 1632;



CVS commit: src/sys/dev/usb

2011-09-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 30 18:59:04 UTC 2011

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

Log Message:
PR/45156: Moritz Wilhelmy: Add 4G Systems XS Stick P14 USB 3G modem support.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/usb/u3g.c

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

Modified files:

Index: src/sys/dev/usb/u3g.c
diff -u src/sys/dev/usb/u3g.c:1.19 src/sys/dev/usb/u3g.c:1.20
--- src/sys/dev/usb/u3g.c:1.19	Wed Aug 24 15:42:52 2011
+++ src/sys/dev/usb/u3g.c	Fri Sep 30 14:59:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: u3g.c,v 1.19 2011/08/24 19:42:52 veego Exp $	*/
+/*	$NetBSD: u3g.c,v 1.20 2011/09/30 18:59:04 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: u3g.c,v 1.19 2011/08/24 19:42:52 veego Exp $);
+__KERNEL_RCSID(0, $NetBSD: u3g.c,v 1.20 2011/09/30 18:59:04 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -246,10 +246,13 @@ static const struct usb_devno u3g_devs[]
 
 	/* Toshiba */
 	{ USB_VENDOR_TOSHIBA, USB_PRODUCT_TOSHIBA_HSDPA_MODEM_EU870DT1 },
+
+	/* 4G Systems */
+	{ USB_VENDOR_4GSYSTEMS, USB_PRODUCT_4GSYSTEMS_XSSTICK_P14 },
 };
 
 static int
-send_bulkmsg(usbd_device_handle dev, char *cmd, size_t cmdlen)
+send_bulkmsg(usbd_device_handle dev, void *cmd, size_t cmdlen)
 {
 	usbd_interface_handle iface;
 	usb_interface_descriptor_t *id;
@@ -437,6 +440,20 @@ u3g_sierra_reinit(usbd_device_handle dev
 	return (UMATCH_HIGHEST); /* Match to prevent umass from attaching */
 }
 
+static int
+u3g_4gsystems_reinit(usbd_device_handle dev)
+{
+	/* magic string adapted from usb_modeswitch database */
+	static unsigned char cmd[31] = {
+		0x55, 0x53, 0x42, 0x43, 0x12, 0x34, 0x56, 0x78, 0x80, 0x00,
+		0x00, 0x00, 0x80, 0x00, 0x06, 0x06, 0xf5, 0x04, 0x02, 0x52,
+		0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00
+	};
+
+	return send_bulkmsg(dev, cmd, sizeof(cmd));
+}
+
 /*
  * First personality:
  *
@@ -488,6 +505,11 @@ u3ginit_match(device_t parent, cfdata_t 
 			return u3g_novatel_reinit(uaa-device);
 		break;
 
+	case USB_VENDOR_4GSYSTEMS:
+		if (uaa-product == USB_PRODUCT_4GSYSTEMS_XSSTICK_P14)
+			return u3g_4gsystems_reinit(uaa-device);
+		break;
+
 	default:
 		break;
 	}



CVS commit: src/tests/net/net

2011-09-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 30 19:12:35 UTC 2011

Modified Files:
src/tests/net/net: t_unix.c

Log Message:
use ATF_CHECK_MSG instead of err() in atf.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/net/net/t_unix.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/net/net/t_unix.c
diff -u src/tests/net/net/t_unix.c:1.3 src/tests/net/net/t_unix.c:1.4
--- src/tests/net/net/t_unix.c:1.3	Wed Sep 28 18:19:52 2011
+++ src/tests/net/net/t_unix.c	Fri Sep 30 15:12:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_unix.c,v 1.3 2011/09/28 22:19:52 christos Exp $	*/
+/*	$NetBSD: t_unix.c,v 1.4 2011/09/30 19:12:35 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($Id: t_unix.c,v 1.3 2011/09/28 22:19:52 christos Exp $);
+__RCSID($Id: t_unix.c,v 1.4 2011/09/30 19:12:35 christos Exp $);
 
 #include stdio.h
 #include err.h
@@ -49,6 +49,15 @@ __RCSID($Id: t_unix.c,v 1.3 2011/09/28 
 #include sys/socket.h
 #include sys/un.h
 
+#ifdef TEST
+#define FAIL(msg, ...)	err(EXIT_FAILURE, msg, ## __VA_ARGS__)
+#else
+
+#include atf-c.h
+#define FAIL(msg, ...)	ATF_CHECK_MSG(0, msg, ## __VA_ARGS__)
+
+#endif
+
 static __dead int
 acc(int s)
 {
@@ -61,7 +70,7 @@ acc(int s)
 
 	len = sizeof(sun);
 	if (accept(s, (struct sockaddr *)sun, len) == -1)
-		err(EXIT_FAILURE, accept);
+		FAIL(accept);
 	if (guard1 != 's')
 		errx(EXIT_FAILURE, guard1 = '%c', guard1);
 	if (guard2 != 's')
@@ -79,11 +88,11 @@ test(size_t len)
 	slen = len + offsetof(struct sockaddr_un, sun_path) + 1;
 	
 	if ((sun = calloc(1, slen)) == NULL)
-		err(EXIT_FAILURE, calloc);
+		FAIL(calloc);
 
 	s = socket(AF_UNIX, SOCK_STREAM, 0);
 	if (s == -1)
-		err(EXIT_FAILURE, socket);
+		FAIL(socket);
 
 	memset(sun-sun_path, 'a', len);
 	sun-sun_path[len] = '\0';
@@ -93,25 +102,21 @@ test(size_t len)
 	sun-sun_family = AF_UNIX;
 
 	if (bind(s, (struct sockaddr *)sun, sun-sun_len) == -1)
-#ifdef TEST
-		err(EXIT_FAILURE, bind);
-#else
-		return -1;
-#endif
+		FAIL(bind);
 
 	if (listen(s, 5) == -1)
-		err(EXIT_FAILURE, listen);
+		FAIL(listen);
 
 	switch (fork()) {
 	case -1:
-		err(EXIT_FAILURE, fork);
+		FAIL(fork);
 	case 0:
 		sleep(1);
 		s2 = socket(AF_UNIX, SOCK_STREAM, 0);
 		if (s == -1)
-			err(EXIT_FAILURE, socket);
+			FAIL(socket);
 		if (connect(s2, (struct sockaddr *)sun, sun-sun_len) == -1)
-			err(EXIT_FAILURE, connect);
+			FAIL(connect);
 		break;
 	default:
 		acc(s);
@@ -121,7 +126,6 @@ test(size_t len)
 }
 
 #ifndef TEST
-#include atf-c.h
 
 ATF_TC(sockaddr_un_len_exceed);
 ATF_TC_HEAD(sockaddr_un_len_exceed, tc)



CVS commit: src/tests/lib/libc/sys

2011-09-30 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Fri Sep 30 21:08:19 UTC 2011

Modified Files:
src/tests/lib/libc/sys: t_dup.c

Log Message:
Do not try to open files up to the RLIMIT_NOFILE limit, which fails
when process limit is identical to the whole system limit. Just do it
for a small fixed value, and adjust the limit accordingly instead.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/sys/t_dup.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/libc/sys/t_dup.c
diff -u src/tests/lib/libc/sys/t_dup.c:1.5 src/tests/lib/libc/sys/t_dup.c:1.6
--- src/tests/lib/libc/sys/t_dup.c:1.5	Mon Jul 18 04:29:37 2011
+++ src/tests/lib/libc/sys/t_dup.c	Fri Sep 30 21:08:19 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: t_dup.c,v 1.5 2011/07/18 04:29:37 jruoho Exp $ */
+/* $NetBSD: t_dup.c,v 1.6 2011/09/30 21:08:19 njoly Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,13 +29,14 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_dup.c,v 1.5 2011/07/18 04:29:37 jruoho Exp $);
+__RCSID($NetBSD: t_dup.c,v 1.6 2011/09/30 21:08:19 njoly Exp $);
 
 #include sys/resource.h
 #include sys/stat.h
 #include sys/wait.h
 
 #include atf-c.h
+#include err.h
 #include errno.h
 #include fcntl.h
 #include limits.h
@@ -300,13 +301,11 @@ ATF_TC_BODY(dup_max, tc)
 		(void)closefrom(0);
 		(void)memset(res, 0, sizeof(struct rlimit));
 
-		if (getrlimit(RLIMIT_NOFILE, res) != 0)
+		n = 10;
+		res.rlim_cur = res.rlim_max = n;
+		if (setrlimit(RLIMIT_NOFILE, res) != 0)
 			_exit(EX_OSERR);
 
-		if (res.rlim_cur == 0 || res.rlim_max == 0)
-			_exit(EX_OSERR);
-
-		n = res.rlim_cur;
 		buf = calloc(n, sizeof(int));
 
 		if (buf == NULL)



CVS commit: src

2011-09-30 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Fri Sep 30 22:08:20 UTC 2011

Modified Files:
src/common/include/prop: prop_array.h prop_dictionary.h
src/common/lib/libprop: prop_array.3 prop_dictionary.3 prop_kern.c
prop_send_syscall.3
src/distrib/sets/lists/comp: mi
src/lib/libprop: Makefile
src/lib/libquota: getufsquota.c
src/usr.bin/quota: getvfsquota.c
src/usr.sbin/edquota: edquota.c
src/usr.sbin/quotaon: quotaon.c
src/usr.sbin/repquota: repquota.c

Log Message:
Fix an implementation inconsistency with the prop_*_send_syscall() and
prop_*_recv_syscall() functions from proplib(3). They now share the
same logic as the one from prop_*_send_ioctl() functions:
- returns an int
- 0 indicates no error, otherwise returns the error number (and
set errno)

Many consumers of the prop_*_{ioctl, syscall} expect errno to be set
on error and use err() to display the error message. As such, ensures that
errno gets set before returning from these functions.

prop_*_send_syscall() functions returned a boolean, and now return an int.
Fix all call sites to use the new paradigm (only quota2 is affected in src).

As the prop_*_{send,recv}_syscall() API appeared in -current and is only
used by the recent quota2 code, I am not bumping the lib. The API change
only affects the prop_*_send_syscall() function (recv_syscall()s were
already used correctly), so ensure you are not mixing old -current
quota binaries with a new proplib(3) (or the other way around). This
change will be announced via a HEADS-UP and UPDATING.

Does not affect the kernel part of proplib.

Document the correct API in prop_array(3) and prop_dictionary(3).

Thanks to Francois Tigeot for noticing the API inconsistency and
reporting it on tech-kern@.

ok bouyer@.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/common/include/prop/prop_array.h
cvs rdiff -u -r1.13 -r1.14 src/common/include/prop/prop_dictionary.h
cvs rdiff -u -r1.12 -r1.13 src/common/lib/libprop/prop_array.3
cvs rdiff -u -r1.17 -r1.18 src/common/lib/libprop/prop_dictionary.3
cvs rdiff -u -r1.16 -r1.17 src/common/lib/libprop/prop_kern.c
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libprop/prop_send_syscall.3
cvs rdiff -u -r1.1682 -r1.1683 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.18 -r1.19 src/lib/libprop/Makefile
cvs rdiff -u -r1.2 -r1.3 src/lib/libquota/getufsquota.c
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/quota/getvfsquota.c
cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/edquota/edquota.c
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/quotaon/quotaon.c
cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/repquota/repquota.c

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

Modified files:

Index: src/common/include/prop/prop_array.h
diff -u src/common/include/prop/prop_array.h:1.12 src/common/include/prop/prop_array.h:1.13
--- src/common/include/prop/prop_array.h:1.12	Thu Mar 24 17:05:39 2011
+++ src/common/include/prop/prop_array.h	Fri Sep 30 22:08:18 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: prop_array.h,v 1.12 2011/03/24 17:05:39 bouyer Exp $*/
+/* $NetBSD: prop_array.h,v 1.13 2011/09/30 22:08:18 jym Exp $*/
 
 /*-
  * Copyright (c) 2006, 2009 The NetBSD Foundation, Inc.
@@ -70,10 +70,12 @@ struct plistref;
 
 #if !defined(_KERNEL)  !defined(_STANDALONE)
 bool		prop_array_externalize_to_pref(prop_array_t, struct plistref *);
+bool		prop_array_internalize_from_pref(const struct plistref *,
+		 prop_array_t *);
 int		prop_array_send_ioctl(prop_array_t, int, unsigned long);
 int		prop_array_recv_ioctl(int, unsigned long, prop_array_t *);
-bool		prop_array_send_syscall(prop_array_t, struct plistref *);
-bool		prop_array_recv_syscall(const struct plistref *,
+int		prop_array_send_syscall(prop_array_t, struct plistref *);
+int		prop_array_recv_syscall(const struct plistref *,
 	prop_array_t *);
 #elif defined(_KERNEL)
 int		prop_array_copyin(const struct plistref *, prop_array_t *);

Index: src/common/include/prop/prop_dictionary.h
diff -u src/common/include/prop/prop_dictionary.h:1.13 src/common/include/prop/prop_dictionary.h:1.14
--- src/common/include/prop/prop_dictionary.h:1.13	Thu Mar 24 17:05:39 2011
+++ src/common/include/prop/prop_dictionary.h	Fri Sep 30 22:08:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: prop_dictionary.h,v 1.13 2011/03/24 17:05:39 bouyer Exp $	*/
+/*	$NetBSD: prop_dictionary.h,v 1.14 2011/09/30 22:08:18 jym Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2009 The NetBSD Foundation, Inc.
@@ -86,6 +86,8 @@ struct plistref;
 
 #if !defined(_KERNEL)  !defined(_STANDALONE)
 bool		prop_dictionary_externalize_to_pref(prop_dictionary_t, struct plistref *);
+bool		prop_dictionary_internalize_from_pref(const struct plistref *,
+		  prop_dictionary_t *);
 int		prop_dictionary_send_ioctl(prop_dictionary_t, int,
 	   unsigned long);
 int		prop_dictionary_recv_ioctl(int, 

CVS commit: src

2011-09-30 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Fri Sep 30 22:17:51 UTC 2011

Modified Files:
src: UPDATING

Log Message:
Inform that the prop_{array,dictionary}_send_syscall(3) change breaks
backward compatibility with old quota2 binaries, so ensure that you
update both (proplib + quota2 executables) simultaneously when updating
a -current installation.


To generate a diff of this commit:
cvs rdiff -u -r1.228 -r1.229 src/UPDATING

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

Modified files:

Index: src/UPDATING
diff -u src/UPDATING:1.228 src/UPDATING:1.229
--- src/UPDATING:1.228	Wed Aug 17 09:18:38 2011
+++ src/UPDATING	Fri Sep 30 22:17:50 2011
@@ -1,4 +1,4 @@
-$NetBSD: UPDATING,v 1.228 2011/08/17 09:18:38 mrg Exp $
+$NetBSD: UPDATING,v 1.229 2011/09/30 22:17:50 jym Exp $
 
 This file (UPDATING) is intended to be a brief reference to recent
 changes that might cause problems in the build process, and a guide for
@@ -15,6 +15,12 @@ See also: BUILDING, build.sh, Makefile.
 
 Recent changes:
 ^^^
+20111001:
+	the prop_*_send_syscall() functions from proplib(3) have been
+	changed and their new version is not backward compatible with the old
+	one. So ensure that all consumers of these functions (currently:
+	quota2 code and its tests) are updated together with the new lib.
+
 20110817:
 	sparc has been changed to use GCC 4.5.3, so any objdir or
 	DESTDIR for them should be deleted before updating.



CVS commit: src/lib/libc/arch/i386/gen

2011-09-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 30 23:42:01 UTC 2011

Modified Files:
src/lib/libc/arch/i386/gen: flt_rounds.S fpgetround.S fpsetround.S

Log Message:
make rounding work


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/i386/gen/flt_rounds.S
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/i386/gen/fpgetround.S
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/i386/gen/fpsetround.S

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/arch/i386/gen/flt_rounds.S
diff -u src/lib/libc/arch/i386/gen/flt_rounds.S:1.8 src/lib/libc/arch/i386/gen/flt_rounds.S:1.9
--- src/lib/libc/arch/i386/gen/flt_rounds.S:1.8	Thu Sep 29 18:53:13 2011
+++ src/lib/libc/arch/i386/gen/flt_rounds.S	Fri Sep 30 19:42:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: flt_rounds.S,v 1.8 2011/09/29 22:53:13 christos Exp $	*/
+/*	$NetBSD: flt_rounds.S,v 1.9 2011/09/30 23:42:00 christos Exp $	*/
 
 #include machine/asm.h
 
@@ -12,8 +12,10 @@
 	_ALIGN_TEXT
 ENTRY(__flt_rounds)
 	fnstcw	-4(%esp)
-	movl	-4(%esp), %eax
-	shrl	$10, %eax
+	movl	-4(%esp), %ecx
+	shrl	$9, %ecx
+	andl	$6, %ecx
+	movl	$0x2d, %eax	/* 0x2d = 00.10.11.01 */
+	sarl	%cl, %eax	/* 0,1,2,3 - 1,3,2,0 */
 	andl	$3, %eax
-	xorl	$1, %eax	/* map 0,1,2,3 - 1,0,3,2 */
 	ret

Index: src/lib/libc/arch/i386/gen/fpgetround.S
diff -u src/lib/libc/arch/i386/gen/fpgetround.S:1.5 src/lib/libc/arch/i386/gen/fpgetround.S:1.6
--- src/lib/libc/arch/i386/gen/fpgetround.S:1.5	Sun Jan 13 16:45:43 2002
+++ src/lib/libc/arch/i386/gen/fpgetround.S	Fri Sep 30 19:42:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetround.S,v 1.5 2002/01/13 21:45:43 thorpej Exp $	*/
+/*	$NetBSD: fpgetround.S,v 1.6 2011/09/30 23:42:00 christos Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 4, 1995
@@ -7,16 +7,17 @@
 
 #include machine/asm.h
 
+/*
+ * XXX load only x87 state.
+ */
+
 #ifdef WEAK_ALIAS
 WEAK_ALIAS(fpgetround, _fpgetround)
 ENTRY(_fpgetround)
 #else
 ENTRY(fpgetround)
 #endif
-	subl $4,%esp
-	fnstcw (%esp)
-	movl (%esp),%eax
-	rorl $10,%eax
-	andl $3,%eax
-	addl $4,%esp
+	fnstcw -4(%esp)
+	movl -4(%esp), %eax
+	andl $0x0c00, %eax
 	ret

Index: src/lib/libc/arch/i386/gen/fpsetround.S
diff -u src/lib/libc/arch/i386/gen/fpsetround.S:1.3 src/lib/libc/arch/i386/gen/fpsetround.S:1.4
--- src/lib/libc/arch/i386/gen/fpsetround.S:1.3	Sun Jan 13 16:45:43 2002
+++ src/lib/libc/arch/i386/gen/fpsetround.S	Fri Sep 30 19:42:00 2011
@@ -1,34 +1,33 @@
-/*	$NetBSD: fpsetround.S,v 1.3 2002/01/13 21:45:43 thorpej Exp $	*/
+/*	$NetBSD: fpsetround.S,v 1.4 2011/09/30 23:42:00 christos Exp $	*/
 
 /*
- * Written by Charles M. Hannum, Apr 9, 1995
+ * Written by Frank van der Linden at Wasabi Systems for NetBSD.
  * Public domain.
  */
 
 #include machine/asm.h
 
+/*
+ * XXX set both the x87 control word
+ * Applications should only set exception and round flags
+ */ 
+
+
 #ifdef WEAK_ALIAS
 WEAK_ALIAS(fpsetround, _fpsetround)
 ENTRY(_fpsetround)
 #else
 ENTRY(fpsetround)
 #endif
-	subl $4,%esp
-
-	fnstcw (%esp)
-	movl (%esp),%eax
 
-	rorl $10,%eax
-	movl %eax,%edx
-	andl $3,%eax
-
-	subl %eax,%edx
-	movl 8(%esp),%ecx
-	andl $3,%ecx
-	orl %ecx,%edx
-	roll $10,%edx
-	movl %edx,(%esp)
-	fldcw (%esp)
+	fnstcw	-4(%esp)
+	movl	-4(%esp), %edx
+	movl	%edx, %eax
+	andl	$0x0c00, %eax	
+	andl	$0xf3ff, %edx
+	movl	4(%esp), %edi
+	orl	%edi, %edx
+	movl	%edx, -4(%esp)
+	fldcw	-4(%esp)
 
-	addl $4,%esp
 	ret



CVS commit: src/lib/libc/arch/i386/gen

2011-09-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 30 23:45:41 UTC 2011

Modified Files:
src/lib/libc/arch/i386/gen: fpsetround.S

Log Message:
don't use %edi!


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/i386/gen/fpsetround.S

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/arch/i386/gen/fpsetround.S
diff -u src/lib/libc/arch/i386/gen/fpsetround.S:1.4 src/lib/libc/arch/i386/gen/fpsetround.S:1.5
--- src/lib/libc/arch/i386/gen/fpsetround.S:1.4	Fri Sep 30 19:42:00 2011
+++ src/lib/libc/arch/i386/gen/fpsetround.S	Fri Sep 30 19:45:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetround.S,v 1.4 2011/09/30 23:42:00 christos Exp $	*/
+/*	$NetBSD: fpsetround.S,v 1.5 2011/09/30 23:45:41 christos Exp $	*/
 
 /*
  * Written by Frank van der Linden at Wasabi Systems for NetBSD.
@@ -25,8 +25,8 @@ ENTRY(fpsetround)
 	movl	%edx, %eax
 	andl	$0x0c00, %eax	
 	andl	$0xf3ff, %edx
-	movl	4(%esp), %edi
-	orl	%edi, %edx
+	movl	4(%esp), %ecx
+	orl	%ecx, %edx
 	movl	%edx, -4(%esp)
 	fldcw	-4(%esp)
 



CVS commit: src/tests/lib/libc/gen

2011-09-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 30 23:46:15 UTC 2011

Modified Files:
src/tests/lib/libc/gen: t_fpsetround.c

Log Message:
add symbolic name printing.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/gen/t_fpsetround.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/libc/gen/t_fpsetround.c
diff -u src/tests/lib/libc/gen/t_fpsetround.c:1.3 src/tests/lib/libc/gen/t_fpsetround.c:1.4
--- src/tests/lib/libc/gen/t_fpsetround.c:1.3	Fri Sep 30 14:27:18 2011
+++ src/tests/lib/libc/gen/t_fpsetround.c	Fri Sep 30 19:46:15 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fpsetround.c,v 1.3 2011/09/30 18:27:18 christos Exp $ */
+/* $NetBSD: t_fpsetround.c,v 1.4 2011/09/30 23:46:15 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_fpsetround.c,v 1.3 2011/09/30 18:27:18 christos Exp $);
+__RCSID($NetBSD: t_fpsetround.c,v 1.4 2011/09/30 23:46:15 christos Exp $);
 
 #include float.h
 #include math.h
@@ -82,6 +82,15 @@ static const struct {
 	{ -1.9, { -1, -2, -1, -2 } },
 };
 
+static const char *
+getname(int r)
+{
+	for (size_t i = 0; i  __arraycount(rnd); i++)
+		if (rnd[i].rm == r)
+			return rnd[i].n;
+	return *unknown*;
+}
+
 static void
 test(int r)
 {
@@ -112,24 +121,29 @@ ATF_TC_BODY(fpsetround_basic, tc)
 	int r;
 
 	ATF_CHECK_EQ(r = fpgetround(), FP_RN);
+	if (FP_RN != r)
+		fprintf(stderr, default expected=%s got=%s\n, getname(FP_RN),
+		getname(r));
 	ATF_CHECK_EQ(FLT_ROUNDS, 1);
 
 	for (size_t i = 0; i  __arraycount(rnd); i++) {
-		size_t j = (i + 1)  3;
-		int o = rnd[i].rm;
-		int n = rnd[j].rm;
+		const size_t j = (i + 1)  3;
+		const int o = rnd[i].rm;
+		const int n = rnd[j].rm;
 
 		ATF_CHECK_EQ(r = fpsetround(n), o);
 		if (o != r)
-			fprintf(stderr, set expected=%x got=%x\n, o, r);
+			fprintf(stderr, set %s expected=%s got=%s\n,
+			getname(n), getname(o), getname(r));
 		ATF_CHECK_EQ(r = fpgetround(), n);
 		if (n != r)
-			fprintf(stderr, get expected=%x got=%x\n, n, r);
-		ATF_CHECK_EQ(r= FLT_ROUNDS, rnd[j].rf);
+			fprintf(stderr, get expected=%s got=%s\n, getname(n),
+			getname(r));
+		ATF_CHECK_EQ(r = FLT_ROUNDS, rnd[j].rf);
 		if (r != rnd[j].rf)
 			fprintf(stderr, rounds expected=%x got=%x\n,
 			rnd[j].rf, r);
-		test(rnd[j].rf);
+		test(r);
 	}
 #endif /* defined(__mc68000__) || defined(__vax__) */
 }



CVS commit: src/tests/lib/libc/gen

2011-09-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 30 23:51:50 UTC 2011

Modified Files:
src/tests/lib/libc/gen: t_fpsetround.c

Log Message:
add more tests.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/gen/t_fpsetround.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/libc/gen/t_fpsetround.c
diff -u src/tests/lib/libc/gen/t_fpsetround.c:1.4 src/tests/lib/libc/gen/t_fpsetround.c:1.5
--- src/tests/lib/libc/gen/t_fpsetround.c:1.4	Fri Sep 30 19:46:15 2011
+++ src/tests/lib/libc/gen/t_fpsetround.c	Fri Sep 30 19:51:50 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fpsetround.c,v 1.4 2011/09/30 23:46:15 christos Exp $ */
+/* $NetBSD: t_fpsetround.c,v 1.5 2011/09/30 23:51:50 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_fpsetround.c,v 1.4 2011/09/30 23:46:15 christos Exp $);
+__RCSID($NetBSD: t_fpsetround.c,v 1.5 2011/09/30 23:51:50 christos Exp $);
 
 #include float.h
 #include math.h
@@ -77,9 +77,15 @@ static const struct {
 	{  1.1, {  1,  1,  2,  1 } },
 	{  1.5, {  1,  2,  2,  1 } },
 	{  1.9, {  1,  2,  2,  1 } },
+	{  2.1, {  2,  2,  3,  2 } },
+	{  2.5, {  2,  2,  3,  2 } },
+	{  2.9, {  2,  3,  3,  2 } },
 	{ -1.1, { -1, -1, -1, -2 } },
 	{ -1.5, { -1, -2, -1, -2 } },
 	{ -1.9, { -1, -2, -1, -2 } },
+	{ -2.1, { -2, -2, -2, -3 } },
+	{ -2.5, { -2, -2, -2, -3 } },
+	{ -2.9, { -2, -3, -2, -3 } },
 };
 
 static const char *



CVS commit: src/sbin/rndctl

2011-09-30 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Oct  1 02:55:00 UTC 2011

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

Log Message:
Fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sbin/rndctl/rndctl.8

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

Modified files:

Index: src/sbin/rndctl/rndctl.8
diff -u src/sbin/rndctl/rndctl.8:1.17 src/sbin/rndctl/rndctl.8:1.18
--- src/sbin/rndctl/rndctl.8:1.17	Sun Jan  4 12:01:43 2009
+++ src/sbin/rndctl/rndctl.8	Sat Oct  1 02:55:00 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: rndctl.8,v 1.17 2009/01/04 12:01:43 apb Exp $
+.\	$NetBSD: rndctl.8,v 1.18 2011/10/01 02:55:00 pgoyette Exp $
 .\
 .\ Copyright (c) 1997 Michael Graff
 .\ All rights reserved.
@@ -56,7 +56,7 @@ Disable collection of timing information
 device name or device type.
 .It Fl c
 Enable collection of timing information for the given
-device name of device type.
+device name or device type.
 .It Fl d
 Only the device named
 .Ar devname