CVS commit: src/sys/arch/x68k/x68k

2012-05-16 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Wed May 16 07:32:30 UTC 2012

Modified Files:
src/sys/arch/x68k/x68k: machdep.c

Log Message:
- Remove duplicated declarations.
- Make declaration of doboot() extern explicitly.


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 src/sys/arch/x68k/x68k/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/x68k/x68k/machdep.c
diff -u src/sys/arch/x68k/x68k/machdep.c:1.182 src/sys/arch/x68k/x68k/machdep.c:1.183
--- src/sys/arch/x68k/x68k/machdep.c:1.182	Sun May  6 19:46:18 2012
+++ src/sys/arch/x68k/x68k/machdep.c	Wed May 16 07:32:30 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.182 2012/05/06 19:46:18 tsutsui Exp $	*/
+/*	$NetBSD: machdep.c,v 1.183 2012/05/16 07:32:30 isaki Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.182 2012/05/06 19:46:18 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.183 2012/05/16 07:32:30 isaki Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -107,9 +107,7 @@ __KERNEL_RCSID(0, $NetBSD: machdep.c,v 
 #include machine/autoconf.h
 #include arch/x68k/dev/intiovar.h
 
-void initcpu(void);
-void identifycpu(void);
-void doboot(void) __attribute__((__noreturn__));
+extern void doboot(void) __attribute__((__noreturn__));
 
 /* the following is used externally (sysctl_hw) */
 char	machine[] = MACHINE;	/* from machine/param.h */



CVS commit: src/share/man/man4/man4.amiga

2012-05-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed May 16 08:08:39 UTC 2012

Modified Files:
src/share/man/man4/man4.amiga: clockport.4

Log Message:
Remove trailing comma.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/man4.amiga/clockport.4

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

Modified files:

Index: src/share/man/man4/man4.amiga/clockport.4
diff -u src/share/man/man4/man4.amiga/clockport.4:1.3 src/share/man/man4/man4.amiga/clockport.4:1.4
--- src/share/man/man4/man4.amiga/clockport.4:1.3	Tue May 15 17:46:26 2012
+++ src/share/man/man4/man4.amiga/clockport.4	Wed May 16 08:08:39 2012
@@ -1,4 +1,4 @@
-.\ $NetBSD: clockport.4,v 1.3 2012/05/15 17:46:26 rkujawa Exp $
+.\ $NetBSD: clockport.4,v 1.4 2012/05/16 08:08:39 wiz Exp $
 .\
 .\ Copyright (c) 2012 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -48,7 +48,7 @@ includes the following clockport drivers
 Individual Computers SilverSurfer 16C550-based serial port.
 .El
 .Sh SEE ALSO
-.Xr a1k2cp 4 ,
+.Xr a1k2cp 4
 .\ .Xr gencp 4
 .Sh HISTORY
 The



CVS commit: src/share/man/man4/man4.amiga

2012-05-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed May 16 08:09:12 UTC 2012

Modified Files:
src/share/man/man4/man4.amiga: xsurf.4

Log Message:
Remove trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/man4.amiga/xsurf.4

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

Modified files:

Index: src/share/man/man4/man4.amiga/xsurf.4
diff -u src/share/man/man4/man4.amiga/xsurf.4:1.1 src/share/man/man4/man4.amiga/xsurf.4:1.2
--- src/share/man/man4/man4.amiga/xsurf.4:1.1	Tue May 15 17:46:26 2012
+++ src/share/man/man4/man4.amiga/xsurf.4	Wed May 16 08:09:12 2012
@@ -1,4 +1,4 @@
-.\ $NetBSD: xsurf.4,v 1.1 2012/05/15 17:46:26 rkujawa Exp $
+.\ $NetBSD: xsurf.4,v 1.2 2012/05/16 08:09:12 wiz Exp $
 .\
 .\ Copyright (c) 2012 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -31,7 +31,7 @@
 .Dt XSURF 4 amiga
 .Os
 .Sh NAME
-.Nm xsurf 
+.Nm xsurf
 .Nd Individual Computers X-Surf driver
 .Sh SYNOPSIS
 .Cd xsurf* at zbus0
@@ -63,7 +63,7 @@ device first appeared in
 The
 .Nm
 driver was written by
-.An Radoslaw Kujawa 
+.An Radoslaw Kujawa
 .Aq radoslaw.kuj...@gmail.com .
 The
 .Xr ne 4



CVS commit: xsrc/external/mit/xorg-server/dist/hw/xfree86/common

2012-05-16 Thread David Brownlee
Module Name:xsrc
Committed By:   abs
Date:   Wed May 16 09:01:38 UTC 2012

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/xfree86/common: compiler.h

Log Message:
Add vax to the list of non inb() users


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h

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

Modified files:

Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h
diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h:1.8 xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h:1.9
--- xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h:1.8	Tue Aug  2 07:15:03 2011
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h	Wed May 16 09:01:37 2012
@@ -1370,7 +1370,7 @@ static __inline__ void stl_u(unsigned lo
 #   else /* ix86 */
 
 #if !defined(__SUNPRO_C)
-#if !defined(FAKEIT)  !defined(__mc68000__)  !defined(__arm__)  !defined(__sh__)  !defined(__hppa__)  !defined(__s390__)  !defined(__m32r__)
+#if !defined(FAKEIT)  !defined(__mc68000__)  !defined(__arm__)  !defined(__sh__)  !defined(__hppa__)  !defined(__s390__)  !defined(__m32r__)  !defined(__vax__)
 # ifdef GCCUSESGAS
 
 /*
@@ -1479,7 +1479,7 @@ inl(unsigned short port)
 
 # endif /* GCCUSESGAS */
 
-#else /* !defined(FAKEIT)  !defined(__mc68000__)   !defined(__arm__)  !defined(__sh__)  !defined(__hppa__)  !defined(__m32r__) */
+#else /* !defined(FAKEIT)  !defined(__mc68000__)   !defined(__arm__)  !defined(__sh__)  !defined(__hppa__)  !defined(__m32r__)  !defined(__vax__) */
 
 static __inline__ void
 outb(unsigned short port, unsigned char val)



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

2012-05-16 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed May 16 09:06:35 UTC 2012

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

Log Message:
Add a case for PR kern/46457. This is skipped for the time being, as it
reproduces the panic described in the PR.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_pipe2.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_pipe2.c
diff -u src/tests/lib/libc/sys/t_pipe2.c:1.3 src/tests/lib/libc/sys/t_pipe2.c:1.4
--- src/tests/lib/libc/sys/t_pipe2.c:1.3	Sat Jan 28 02:47:09 2012
+++ src/tests/lib/libc/sys/t_pipe2.c	Wed May 16 09:06:35 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_pipe2.c,v 1.3 2012/01/28 02:47:09 christos Exp $ */
+/* $NetBSD: t_pipe2.c,v 1.4 2012/05/16 09:06:35 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_pipe2.c,v 1.3 2012/01/28 02:47:09 christos Exp $);
+__RCSID($NetBSD: t_pipe2.c,v 1.4 2012/05/16 09:06:35 jruoho Exp $);
 
 #include atf-c.h
 #include fcntl.h
@@ -98,6 +98,29 @@ ATF_TC_BODY(pipe2_basic, tc)
 	run(0);
 }
 
+ATF_TC(pipe2_consume);
+ATF_TC_HEAD(pipe2_consume, tc)
+{
+	atf_tc_set_md_var(tc, descr, Test that consuming file descriptors 
+	with pipe2(2) does not crash the system (PR kern/46457));
+}
+
+ATF_TC_BODY(pipe2_consume, tc)
+{
+	const size_t n = 200;
+	size_t i;
+
+	atf_tc_skip(The test case causes a panic (PR PR kern/46457));
+
+	for (i = 0; i  n; i++) {
+
+		int fildes[2];
+
+		if (pipe2(fildes, O_CLOEXEC) == -1)
+			return;
+	}
+}
+
 ATF_TC(pipe2_nonblock);
 ATF_TC_HEAD(pipe2_nonblock, tc)
 {
@@ -147,6 +170,7 @@ ATF_TP_ADD_TCS(tp)
 {
 
 	ATF_TP_ADD_TC(tp, pipe2_basic);
+	ATF_TP_ADD_TC(tp, pipe2_consume);
 	ATF_TP_ADD_TC(tp, pipe2_nonblock);
 	ATF_TP_ADD_TC(tp, pipe2_cloexec);
 	ATF_TP_ADD_TC(tp, pipe2_nosigpipe);



CVS commit: src/sys/kern

2012-05-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 16 09:41:11 UTC 2012

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

Log Message:
Make sure we can deliver two file descriptors for pipe2() before we set
up anything special (like close on exec).
Fixes PR kern/46457.


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/sys/kern/sys_pipe.c

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

Modified files:

Index: src/sys/kern/sys_pipe.c
diff -u src/sys/kern/sys_pipe.c:1.135 src/sys/kern/sys_pipe.c:1.136
--- src/sys/kern/sys_pipe.c:1.135	Wed Jan 25 00:28:36 2012
+++ src/sys/kern/sys_pipe.c	Wed May 16 09:41:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_pipe.c,v 1.135 2012/01/25 00:28:36 christos Exp $	*/
+/*	$NetBSD: sys_pipe.c,v 1.136 2012/05/16 09:41:11 martin Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sys_pipe.c,v 1.135 2012/01/25 00:28:36 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: sys_pipe.c,v 1.136 2012/05/16 09:41:11 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -267,21 +267,23 @@ pipe1(struct lwp *l, register_t *retval,
 	if (error)
 		goto free2;
 	retval[0] = fd;
-	rf-f_flag = FREAD | flags;
-	rf-f_type = DTYPE_PIPE;
-	rf-f_data = (void *)rpipe;
-	rf-f_ops = pipeops;
-	fd_set_exclose(l, fd, (flags  O_CLOEXEC) != 0);
 
 	error = fd_allocfile(wf, fd);
 	if (error)
 		goto free3;
 	retval[1] = fd;
+
+	rf-f_flag = FREAD | flags;
+	rf-f_type = DTYPE_PIPE;
+	rf-f_data = (void *)rpipe;
+	rf-f_ops = pipeops;
+	fd_set_exclose(l, (int)retval[0], (flags  O_CLOEXEC) != 0);
+
 	wf-f_flag = FWRITE | flags;
 	wf-f_type = DTYPE_PIPE;
 	wf-f_data = (void *)wpipe;
 	wf-f_ops = pipeops;
-	fd_set_exclose(l, fd, (flags  O_CLOEXEC) != 0);
+	fd_set_exclose(l, (int)retval[1], (flags  O_CLOEXEC) != 0);
 
 	rpipe-pipe_peer = wpipe;
 	wpipe-pipe_peer = rpipe;



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

2012-05-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 16 09:51:59 UTC 2012

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

Log Message:
Enable the test for PR kern/46457 now that it does not crash the
kernel any more.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/sys/t_pipe2.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_pipe2.c
diff -u src/tests/lib/libc/sys/t_pipe2.c:1.4 src/tests/lib/libc/sys/t_pipe2.c:1.5
--- src/tests/lib/libc/sys/t_pipe2.c:1.4	Wed May 16 09:06:35 2012
+++ src/tests/lib/libc/sys/t_pipe2.c	Wed May 16 09:51:58 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_pipe2.c,v 1.4 2012/05/16 09:06:35 jruoho Exp $ */
+/* $NetBSD: t_pipe2.c,v 1.5 2012/05/16 09:51:58 martin Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -36,13 +36,14 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_pipe2.c,v 1.4 2012/05/16 09:06:35 jruoho Exp $);
+__RCSID($NetBSD: t_pipe2.c,v 1.5 2012/05/16 09:51:58 martin Exp $);
 
 #include atf-c.h
 #include fcntl.h
 #include unistd.h
 #include stdlib.h
 #include errno.h
+#include sys/resource.h
 
 static void
 run(int flags)
@@ -107,10 +108,19 @@ ATF_TC_HEAD(pipe2_consume, tc)
 
 ATF_TC_BODY(pipe2_consume, tc)
 {
-	const size_t n = 200;
-	size_t i;
+	struct rlimit rl;
+	size_t i, n;
 
-	atf_tc_skip(The test case causes a panic (PR PR kern/46457));
+	getrlimit(RLIMIT_NOFILE, rl);
+	/*
+	 * Each pipe2 call will allocate two filedescriptors, make sure we
+	 * run into the limit...
+	 */
+	n = rl.rlim_cur/2+1;
+
+	/*
+	 * atf_tc_skip(The test case causes a panic (PR PR kern/46457));
+	 */
 
 	for (i = 0; i  n; i++) {
 



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

2012-05-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed May 16 11:45:08 UTC 2012

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

Log Message:
Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/sys/t_pipe2.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_pipe2.c
diff -u src/tests/lib/libc/sys/t_pipe2.c:1.5 src/tests/lib/libc/sys/t_pipe2.c:1.6
--- src/tests/lib/libc/sys/t_pipe2.c:1.5	Wed May 16 09:51:58 2012
+++ src/tests/lib/libc/sys/t_pipe2.c	Wed May 16 11:45:08 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_pipe2.c,v 1.5 2012/05/16 09:51:58 martin Exp $ */
+/* $NetBSD: t_pipe2.c,v 1.6 2012/05/16 11:45:08 wiz Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_pipe2.c,v 1.5 2012/05/16 09:51:58 martin Exp $);
+__RCSID($NetBSD: t_pipe2.c,v 1.6 2012/05/16 11:45:08 wiz Exp $);
 
 #include atf-c.h
 #include fcntl.h
@@ -119,7 +119,7 @@ ATF_TC_BODY(pipe2_consume, tc)
 	n = rl.rlim_cur/2+1;
 
 	/*
-	 * atf_tc_skip(The test case causes a panic (PR PR kern/46457));
+	 * atf_tc_skip(The test case causes a panic (PR kern/46457));
 	 */
 
 	for (i = 0; i  n; i++) {



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

2012-05-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 16 13:48:35 UTC 2012

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

Log Message:
Simplify the test for PR kern/4645 and make it independend of resource
settings.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libc/sys/t_pipe2.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_pipe2.c
diff -u src/tests/lib/libc/sys/t_pipe2.c:1.6 src/tests/lib/libc/sys/t_pipe2.c:1.7
--- src/tests/lib/libc/sys/t_pipe2.c:1.6	Wed May 16 11:45:08 2012
+++ src/tests/lib/libc/sys/t_pipe2.c	Wed May 16 13:48:35 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_pipe2.c,v 1.6 2012/05/16 11:45:08 wiz Exp $ */
+/* $NetBSD: t_pipe2.c,v 1.7 2012/05/16 13:48:35 martin Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_pipe2.c,v 1.6 2012/05/16 11:45:08 wiz Exp $);
+__RCSID($NetBSD: t_pipe2.c,v 1.7 2012/05/16 13:48:35 martin Exp $);
 
 #include atf-c.h
 #include fcntl.h
@@ -109,26 +109,27 @@ ATF_TC_HEAD(pipe2_consume, tc)
 ATF_TC_BODY(pipe2_consume, tc)
 {
 	struct rlimit rl;
-	size_t i, n;
+	int err, filedes[2];
 
-	getrlimit(RLIMIT_NOFILE, rl);
+	err = fcntl(4, F_CLOSEM);
+	ATF_REQUIRE(err == 0);
+
+	err = getrlimit(RLIMIT_NOFILE, rl);
+	ATF_REQUIRE(err == 0);
 	/*
-	 * Each pipe2 call will allocate two filedescriptors, make sure we
-	 * run into the limit...
+	 * The heart of this test is to run against the number of open
+	 * file descriptor limit in the middle of a pipe2() call - i.e.
+	 * before the call only a single descriptor may be openend.
 	 */
-	n = rl.rlim_cur/2+1;
+	rl.rlim_cur = 4;
+	err = setrlimit(RLIMIT_NOFILE, rl);
+	ATF_REQUIRE(err == 0);
 
 	/*
 	 * atf_tc_skip(The test case causes a panic (PR kern/46457));
 	 */
-
-	for (i = 0; i  n; i++) {
-
-		int fildes[2];
-
-		if (pipe2(fildes, O_CLOEXEC) == -1)
-			return;
-	}
+	err = pipe2(filedes, O_CLOEXEC);
+	ATF_REQUIRE(err == -1);
 }
 
 ATF_TC(pipe2_nonblock);



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

2012-05-16 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed May 16 13:54:28 UTC 2012

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

Log Message:
Remove also redundant comment (the reference to the PR is already in the
metadata).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/sys/t_pipe2.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_pipe2.c
diff -u src/tests/lib/libc/sys/t_pipe2.c:1.7 src/tests/lib/libc/sys/t_pipe2.c:1.8
--- src/tests/lib/libc/sys/t_pipe2.c:1.7	Wed May 16 13:48:35 2012
+++ src/tests/lib/libc/sys/t_pipe2.c	Wed May 16 13:54:28 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_pipe2.c,v 1.7 2012/05/16 13:48:35 martin Exp $ */
+/* $NetBSD: t_pipe2.c,v 1.8 2012/05/16 13:54:28 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_pipe2.c,v 1.7 2012/05/16 13:48:35 martin Exp $);
+__RCSID($NetBSD: t_pipe2.c,v 1.8 2012/05/16 13:54:28 jruoho Exp $);
 
 #include atf-c.h
 #include fcntl.h
@@ -125,9 +125,6 @@ ATF_TC_BODY(pipe2_consume, tc)
 	err = setrlimit(RLIMIT_NOFILE, rl);
 	ATF_REQUIRE(err == 0);
 
-	/*
-	 * atf_tc_skip(The test case causes a panic (PR kern/46457));
-	 */
 	err = pipe2(filedes, O_CLOEXEC);
 	ATF_REQUIRE(err == -1);
 }



CVS commit: src/lib/libc/gdtoa

2012-05-16 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Wed May 16 17:48:59 UTC 2012

Modified Files:
src/lib/libc/gdtoa: dtoa.c

Log Message:
Use original indentation style in more places.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/gdtoa/dtoa.c

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

Modified files:

Index: src/lib/libc/gdtoa/dtoa.c
diff -u src/lib/libc/gdtoa/dtoa.c:1.9 src/lib/libc/gdtoa/dtoa.c:1.10
--- src/lib/libc/gdtoa/dtoa.c:1.9	Tue May 15 18:13:21 2012
+++ src/lib/libc/gdtoa/dtoa.c	Wed May 16 17:48:59 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: dtoa.c,v 1.9 2012/05/15 18:13:21 alnsn Exp $ */
+/* $NetBSD: dtoa.c,v 1.10 2012/05/16 17:48:59 alnsn Exp $ */
 
 /
 
@@ -555,7 +555,7 @@ dtoa
 		S = pow5mult(S, s5);
 		if (S == NULL)
 			return NULL;
-	}
+		}
 
 	/* Check for special case that d is a normalized power of 2. */
 
@@ -607,12 +607,12 @@ dtoa
 		b = lshift(b, b2);
 		if (b == NULL)
 			return NULL;
-	}
+		}
 	if (s2  0) {
 		S = lshift(S, s2);
 		if (S == NULL)
 			return NULL;
-	}
+		}
 	if (k_check) {
 		if (cmp(b,S)  0) {
 			k--;
@@ -623,7 +623,7 @@ dtoa
 mhi = multadd(mhi, 10, 0);
 if (mhi == NULL)
 	return NULL;
-			}
+}
 			ilim = ilim1;
 			}
 		}
@@ -644,7 +644,7 @@ dtoa
 			mhi = lshift(mhi, m2);
 			if (mhi == NULL)
 return NULL;
-		}
+			}
 
 		/* Compute mlo -- check for special case
 		 * that d is a normalized power of 2.



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

2012-05-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 16 19:13:00 UTC 2012

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

Log Message:
mmap_block:
do not use a hardcoded block device list, but query the kernel for attached
disks instead, then try to mmap the raw partition.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/sys/t_mmap.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_mmap.c
diff -u src/tests/lib/libc/sys/t_mmap.c:1.4 src/tests/lib/libc/sys/t_mmap.c:1.5
--- src/tests/lib/libc/sys/t_mmap.c:1.4	Tue Mar 13 06:37:03 2012
+++ src/tests/lib/libc/sys/t_mmap.c	Wed May 16 19:12:59 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mmap.c,v 1.4 2012/03/13 06:37:03 jruoho Exp $ */
+/* $NetBSD: t_mmap.c,v 1.5 2012/05/16 19:12:59 martin Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
  * SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_mmap.c,v 1.4 2012/03/13 06:37:03 jruoho Exp $);
+__RCSID($NetBSD: t_mmap.c,v 1.5 2012/05/16 19:12:59 martin Exp $);
 
 #include sys/param.h
 #include sys/mman.h
@@ -71,6 +71,8 @@ __RCSID($NetBSD: t_mmap.c,v 1.4 2012/03
 #include stdlib.h
 #include string.h
 #include unistd.h
+#include paths.h
+#include machine/disklabel.h
 
 static long	page = 0;
 static char	path[] = mmap;
@@ -157,26 +159,35 @@ ATF_TC(mmap_block);
 ATF_TC_HEAD(mmap_block, tc)
 {
 	atf_tc_set_md_var(tc, descr, Test mmap(2) with a block device);
+	atf_tc_set_md_var(tc, require.user, root);
 }
 
 ATF_TC_BODY(mmap_block, tc)
 {
-	static const char *dev[] = { /dev/wd0c, /dev/wd0d, /dev/wd0g };
-	char *map;
-	size_t i;
-	int fd;
+	static const int mib[] = { CTL_HW, HW_DISKNAMES };
+	static const unsigned int miblen = __arraycount(mib);
+	char *map, *dk, *drives, dev[PATH_MAX];
+	size_t len;
+	int fd = -1;
 
 	atf_tc_skip(The test case causes a panic (PR kern/38889));
 
-	for (i = 0; i  __arraycount(dev); i++) {
+	ATF_REQUIRE(sysctl(mib, miblen, NULL, len, NULL, 0) == 0);
+	drives = malloc(len);
+	ATF_REQUIRE(drives != NULL);
+	ATF_REQUIRE(sysctl(mib, miblen, drives, len, NULL, 0) == 0);
+	for (dk = strtok(drives,  ); dk != NULL; dk = strtok(NULL,  )) {
+		sprintf(dev, _PATH_DEV %s%c, dk, 'a'+RAW_PART);
+		fprintf(stderr, trying: %s\n, dev);
 
-		if ((fd = open(dev[i], O_RDONLY)) = 0) {
-			(void)fprintf(stderr, using %s\n, dev[i]);
+		if ((fd = open(dev, O_RDONLY)) = 0) {
+			(void)fprintf(stderr, using %s\n, dev);
 			break;
 		}
 	}
+	free(drives);
 
-	if (i == __arraycount(dev))
+	if (fd  0)
 		atf_tc_skip(failed to find suitable block device);
 
 	map = mmap(NULL, 4096, PROT_READ, MAP_FILE, fd, 0);



CVS commit: src/share/man/man9

2012-05-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu May 17 02:58:15 UTC 2012

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

Log Message:
clarify some descriptions.  document a couple more functions.
make a big commented list of the functions that are lacking real
descriptions.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/share/man/man9/usbdi.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/usbdi.9
diff -u src/share/man/man9/usbdi.9:1.13 src/share/man/man9/usbdi.9:1.14
--- src/share/man/man9/usbdi.9:1.13	Sun May 13 19:29:59 2012
+++ src/share/man/man9/usbdi.9	Thu May 17 02:58:14 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: usbdi.9,v 1.13 2012/05/13 19:29:59 mrg Exp $
+.\	$NetBSD: usbdi.9,v 1.14 2012/05/17 02:58:14 mrg Exp $
 .\
 .\ Copyright (c) 2012 Matthew R. Green
 .\ All rights reserved.
@@ -54,7 +54,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd May 13, 2012
+.Dd May 16, 2012
 .Dt USBDI 9
 .Os
 .Sh NAME
@@ -71,7 +71,7 @@
 .Ft usbd_status
 .Fn usbd_close_pipe usbd_pipe_handle pipe
 .Ft usbd_status
-.Fn usbd_transfer usbd_xfer_handle req
+.Fn usbd_transfer usbd_xfer_handle xfer
 .Ft usbd_xfer_handle
 .Fn usbd_alloc_xfer usbd_device_handle dev
 .Ft usbd_status
@@ -161,7 +161,7 @@
 .Ft void
 .Fn usbd_dopoll usbd_interface_handle iface
 .Ft void
-.Fn usbd_set_polling usbd_device_handle iface int val
+.Fn usbd_set_polling usbd_device_handle iface int val
 .Ft const char *
 .Fn usbd_errstr usbd_status err
 .Ft void
@@ -217,7 +217,7 @@ through
 .Fn usbd_get_config_desc_full usbd_device_handle int dev void *d int size
 .Ft usbd_status
 .Fn usbd_get_device_desc usbd_device_handle dev \
-usb_device_descriptor_t *d
+ usb_device_descriptor_t *d
 .Ft usbd_status
 .Fn usbd_set_address usbd_device_handle dev int addr
 .Ft usbd_status
@@ -267,7 +267,7 @@ through
  uint16_t flags uint32_t timeout void *buf uint32_t *size char *lbl
 .Ft usbd_status
 .Fn usbd_intr_transfer usbd_xfer_handle xfer usbd_pipe_handle pipe \
-uint16_t flags uint32_t timeout void *buf uint32_t *size char *lbl
+ uint16_t flags uint32_t timeout void *buf uint32_t *size char *lbl
 .\ these are very different in usbmp
 .Ft void
 .Fn usb_detach_waitold device_t dv
@@ -283,6 +283,15 @@ A transfer describes a communication wit
 A transfer is an abstract concept that can result in several
 physical packets being transferred to or from a device.
 .Pp
+A pipe is a logical connection to a USB device.
+Pipes are created and destroyed by using the
+.Fn usbd_open_pipe ,
+.Fn usbd_open_pipe_intr
+and
+.Fn usbd_close_pipe
+functions.
+It is common to have more than one pipe per device.
+.Pp
 A transfer is described by a
 .Va usbd_xfer_handle ,
 a largely opaque cookie.
@@ -297,30 +306,39 @@ for control pipe transfers, by
 for bulk and interrupt transfers, and by
 .Fn usbd_setup_isoc_xfer
 for isochronous transfers.
-.Pp
-A pipe is a logical connection to a USB device.
-Pipes are created and destroyed by using the
-.Fn usbd_open_pipe ,
-.Fn usbd_open_pipe_intr
+.\ XXX describe args to usbd_setup*xfer
+Transfers are initiated by calling
+.Fn usbd_transfer .
+The
+.Fn usbd_bulk_transfer
 and
-.Fn usbd_close_pipe
-functions.
-It is common to have more than one pipe per device.
+.Fn usbd_intr_transfer
+functions are used to transfer data in either an interrupt or
+bulk fashion, and are front-ends to the
+.Fn usbd_setup_xfer ,
+.Fn usbd_transfer
+and 
+.Fn usbd_get_xfer_status ,
+as well as associated error handling.
+.\ XXX describe args to usbd_get_xfer_status
 Transfers are associated with a pipe at their creation time.
 Transfers are aborted via this pipe with
-.Fn usbd_abort_pipe .
+.Fn usbd_abort_pipe 
+and
+.Fn usbd_abort_default_pipe .
 The
 .Fn usbd_clear_endpoint_stall
 and
 .Fn usbd_clear_endpoint_stall_async
 functions are used to clear endpoint halt in either a synchronous
 or asynchronous fashion.
-The
-.Fn usbd_bulk_transfer
-and
-.Fn usbd_intr_transfer
-functions are used to transfer data in either an interrupt or
-bulk fashion.
+.\ XXX something about
+.\ .Fn usbd_clear_endpoint_toggle .
+To obtain the
+.Ft usbd_device_handle
+associated with a pipe the
+.Fn usbd_pipe2device_handle
+function should be used.
 .Pp
 A request is described by a
 .Va usb_device_request_t
@@ -336,7 +354,7 @@ section for more details.
 Error handling and other return values are described in
 .Xr usbd_status 9 .
 .Pp
-Comments on particular functions:
+Additional comments on particular functions:
 .Bl -tag -width 10n
 .It Fn usbd_errstr err
 Return the string associated with
@@ -357,11 +375,159 @@ must be one of
 .Dv USB_EVENT_DRIVER_ATTACH
 and
 .Dv USB_EVENT_DRIVER_DETACH .
+The
+.Fa dv
+corresponds with the
+.Ft device_t
+associated with the device attached or detached.
 .It Fn usb_lookup tbl vendor product
+Lookup a USB device.
+The returned
+.Va struct