CVS commit: src

2011-05-16 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Mon May 16 07:59:19 UTC 2011

Modified Files:
src/include: fenv.h
src/tests/lib/libc/stdlib: t_strtod.c

Log Message:
The support of  is actually for __sparc64__, not for __sparc__
(which is also defined on sparc64).  This fixes a build problem for
plain sparc.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/include/fenv.h
cvs rdiff -u -r1.9 -r1.10 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/include/fenv.h
diff -u src/include/fenv.h:1.3 src/include/fenv.h:1.4
--- src/include/fenv.h:1.3	Mon Jan 31 00:19:33 2011
+++ src/include/fenv.h	Mon May 16 07:59:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.3 2011/01/31 00:19:33 christos Exp $	*/
+/*	$NetBSD: fenv.h,v 1.4 2011/05/16 07:59:19 he Exp $	*/
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#if !defined(__i386__) && !defined(__amd64__) && !defined(__sparc__)
+#if !defined(__i386__) && !defined(__amd64__) && !defined(__sparc64__)
 #error	"fenv.h is currently not supported for this architecture"
 #endif
 

Index: src/tests/lib/libc/stdlib/t_strtod.c
diff -u src/tests/lib/libc/stdlib/t_strtod.c:1.9 src/tests/lib/libc/stdlib/t_strtod.c:1.10
--- src/tests/lib/libc/stdlib/t_strtod.c:1.9	Tue May 10 19:18:19 2011
+++ src/tests/lib/libc/stdlib/t_strtod.c	Mon May 16 07:59:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_strtod.c,v 1.9 2011/05/10 19:18:19 jruoho Exp $ */
+/*	$NetBSD: t_strtod.c,v 1.10 2011/05/16 07:59:18 he Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 /* Public domain, Otto Moerbeek , 2006. */
 
 #include 
-__RCSID("$NetBSD: t_strtod.c,v 1.9 2011/05/10 19:18:19 jruoho Exp $");
+__RCSID("$NetBSD: t_strtod.c,v 1.10 2011/05/16 07:59:18 he Exp $");
 
 #include 
 #include 
@@ -43,7 +43,7 @@
 #include 
 #include 
 
-#if defined(__i386__) || defined(__amd64__) || defined(__sparc__)
+#if defined(__i386__) || defined(__amd64__) || defined(__sparc64__)
 #include 
 #endif
 
@@ -136,7 +136,7 @@
 
 ATF_TC_BODY(strtod_round, tc)
 {
-#if defined(__i386__) || defined(__amd64__) || defined(__sparc__)
+#if defined(__i386__) || defined(__amd64__) || defined(__sparc64__)
 
 	const char *val;
 	double d1, d2;



CVS commit: src/sys/netipsec

2011-05-16 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Mon May 16 10:00:32 UTC 2011

Modified Files:
src/sys/netipsec: ipsec.c

Log Message:
cosmetical whitespace changes


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/netipsec/ipsec.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/netipsec/ipsec.c
diff -u src/sys/netipsec/ipsec.c:1.50 src/sys/netipsec/ipsec.c:1.51
--- src/sys/netipsec/ipsec.c:1.50	Fri Feb 18 19:06:45 2011
+++ src/sys/netipsec/ipsec.c	Mon May 16 10:00:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec.c,v 1.50 2011/02/18 19:06:45 drochner Exp $	*/
+/*	$NetBSD: ipsec.c,v 1.51 2011/05/16 10:00:32 drochner Exp $	*/
 /*	$FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $	*/
 /*	$KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.50 2011/02/18 19:06:45 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.51 2011/05/16 10:00:32 drochner Exp $");
 
 /*
  * IPsec controller part.
@@ -429,7 +429,7 @@
  * Return a held reference to the default SP.
  */
 static struct secpolicy *
-key_allocsp_default(int af, const char* where, int tag)
+key_allocsp_default(int af, const char *where, int tag)
 {
 	struct secpolicy *sp;
 
@@ -2127,7 +2127,7 @@
 
 /* Return a printable string for the address. */
 const char *
-ipsec_address(const union sockaddr_union* sa)
+ipsec_address(const union sockaddr_union *sa)
 {
 	switch (sa->sa.sa_family) {
 #if INET
@@ -2196,8 +2196,8 @@
 
 #ifdef INET6
 struct secpolicy * 
-ipsec6_check_policy(struct mbuf * m, const struct socket * so,
-		int flags, int * needipsecp, int * errorp)
+ipsec6_check_policy(struct mbuf *m, const struct socket *so,
+		int flags, int *needipsecp, int *errorp)
 {
 	struct in6pcb *in6p = NULL;
 	struct secpolicy *sp = NULL;
@@ -2248,13 +2248,13 @@
 
 /* XXX this stuff doesn't belong here... */
 
-static	struct xformsw* xforms = NULL;
+static	struct xformsw *xforms = NULL;
 
 /*
  * Register a transform; typically at system startup.
  */
 void
-xform_register(struct xformsw* xsp)
+xform_register(struct xformsw *xsp)
 {
 	xsp->xf_next = xforms;
 	xforms = xsp;



CVS commit: src/sys/netipsec

2011-05-16 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Mon May 16 10:02:30 UTC 2011

Modified Files:
src/sys/netipsec: ipsec.h keydb.h

Log Message:
use time_t rather than long for timestamps


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/netipsec/ipsec.h
cvs rdiff -u -r1.8 -r1.9 src/sys/netipsec/keydb.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/netipsec/ipsec.h
diff -u src/sys/netipsec/ipsec.h:1.25 src/sys/netipsec/ipsec.h:1.26
--- src/sys/netipsec/ipsec.h:1.25	Fri Feb 18 19:06:45 2011
+++ src/sys/netipsec/ipsec.h	Mon May 16 10:02:30 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec.h,v 1.25 2011/02/18 19:06:45 drochner Exp $	*/
+/*	$NetBSD: ipsec.h,v 1.26 2011/05/16 10:02:30 drochner Exp $	*/
 /*	$FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec.h,v 1.2.4.2 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: ipsec.h,v 1.53 2001/11/20 08:32:38 itojun Exp $	*/
 
@@ -93,10 +93,10 @@
 	 * "lifetime" is passed by sadb_lifetime.sadb_lifetime_addtime.
 	 * "validtime" is passed by sadb_lifetime.sadb_lifetime_usetime.
 	 */
-	long created;		/* time created the policy */
-	long lastused;		/* updated every when kernel sends a packet */
-	long lifetime;		/* duration of the lifetime of this policy */
-	long validtime;		/* duration this policy is valid without use */
+	time_t created;		/* time created the policy */
+	time_t lastused;	/* updated every when kernel sends a packet */
+	time_t lifetime;	/* duration of the lifetime of this policy */
+	time_t validtime;	/* duration this policy is valid without use */
 };
 
 /* Request for IPsec */
@@ -146,7 +146,7 @@
 
 	struct secpolicyindex spidx;
 
-	long created;		/* for lifetime */
+	time_t created;		/* for lifetime */
 	int count;		/* for lifetime */
 	/* XXX: here is mbuf place holder to be sent ? */
 };

Index: src/sys/netipsec/keydb.h
diff -u src/sys/netipsec/keydb.h:1.8 src/sys/netipsec/keydb.h:1.9
--- src/sys/netipsec/keydb.h:1.8	Fri Feb 18 20:40:58 2011
+++ src/sys/netipsec/keydb.h	Mon May 16 10:02:30 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: keydb.h,v 1.8 2011/02/18 20:40:58 drochner Exp $	*/
+/*	$NetBSD: keydb.h,v 1.9 2011/05/16 10:02:30 drochner Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/keydb.h,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $	*/
 /*	$KAME: keydb.h,v 1.14 2000/08/02 17:58:26 sakane Exp $	*/
 
@@ -106,7 +106,7 @@
 	size_t schedlen;
 
 	struct secreplay *replay;	/* replay prevention */
-	long created;			/* for lifetime */
+	time_t created;			/* for lifetime */
 
 	struct sadb_lifetime *lft_c;	/* CURRENT lifetime, it's constant. */
 	struct sadb_lifetime *lft_h;	/* HARD lifetime */
@@ -159,7 +159,7 @@
 	struct secasindex saidx;
 
 	u_int32_t seq;		/* sequence number */
-	long created;		/* for lifetime */
+	time_t created;		/* for lifetime */
 	int count;		/* for lifetime */
 };
 #endif



CVS commit: src/sys/netipsec

2011-05-16 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Mon May 16 10:04:02 UTC 2011

Modified Files:
src/sys/netipsec: keysock.c

Log Message:
remove a useless m_freem() call where the argument is known to be NULL


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/netipsec/keysock.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/netipsec/keysock.c
diff -u src/sys/netipsec/keysock.c:1.19 src/sys/netipsec/keysock.c:1.20
--- src/sys/netipsec/keysock.c:1.19	Mon Feb  8 19:02:33 2010
+++ src/sys/netipsec/keysock.c	Mon May 16 10:04:02 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: keysock.c,v 1.19 2010/02/08 19:02:33 joerg Exp $	*/
+/*	$NetBSD: keysock.c,v 1.20 2011/05/16 10:04:02 drochner Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/keysock.c,v 1.3.2.1 2003/01/24 05:11:36 sam Exp $	*/
 /*	$KAME: keysock.c,v 1.25 2001/08/13 20:07:41 itojun Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: keysock.c,v 1.19 2010/02/08 19:02:33 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: keysock.c,v 1.20 2011/05/16 10:04:02 drochner Exp $");
 
 #include "opt_ipsec.h"
 
@@ -180,7 +180,6 @@
 			m = m_pullup(m, sizeof(struct sadb_msg));
 		if (!m) {
 			PFKEY_STATINC(PFKEY_STAT_IN_NOMEM);
-			m_freem(m);
 			return ENOBUFS;
 		}
 		m->m_pkthdr.len += sizeof(*pmsg);



CVS commit: src/sys/netipsec

2011-05-16 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Mon May 16 10:05:23 UTC 2011

Modified Files:
src/sys/netipsec: ipsec_mbuf.c

Log Message:
remove redundant declaration


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/netipsec/ipsec_mbuf.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/netipsec/ipsec_mbuf.c
diff -u src/sys/netipsec/ipsec_mbuf.c:1.11 src/sys/netipsec/ipsec_mbuf.c:1.12
--- src/sys/netipsec/ipsec_mbuf.c:1.11	Wed Apr 23 06:09:05 2008
+++ src/sys/netipsec/ipsec_mbuf.c	Mon May 16 10:05:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec_mbuf.c,v 1.11 2008/04/23 06:09:05 thorpej Exp $	*/
+/*	$NetBSD: ipsec_mbuf.c,v 1.12 2011/05/16 10:05:23 drochner Exp $	*/
 /*-
  * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
  * All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec_mbuf.c,v 1.11 2008/04/23 06:09:05 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec_mbuf.c,v 1.12 2011/05/16 10:05:23 drochner Exp $");
 
 /*
  * IPsec-specific mbuf routines.
@@ -53,8 +53,6 @@
 #include 
 #include 
 
-extern	struct mbuf *m_getptr(struct mbuf *, int, int *);
-
 /*
  * Create a writable copy of the mbuf chain.  While doing this
  * we compact the chain with a goal of producing a chain with



CVS commit: src/sys/opencrypto

2011-05-16 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Mon May 16 10:18:52 UTC 2011

Modified Files:
src/sys/opencrypto: cryptodev.h

Log Message:
remove redundant declarations


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/opencrypto/cryptodev.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/opencrypto/cryptodev.h
diff -u src/sys/opencrypto/cryptodev.h:1.20 src/sys/opencrypto/cryptodev.h:1.21
--- src/sys/opencrypto/cryptodev.h:1.20	Thu May  5 17:42:17 2011
+++ src/sys/opencrypto/cryptodev.h	Mon May 16 10:18:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cryptodev.h,v 1.20 2011/05/05 17:42:17 drochner Exp $ */
+/*	$NetBSD: cryptodev.h,v 1.21 2011/05/16 10:18:52 drochner Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/cryptodev.h,v 1.2.2.6 2003/07/02 17:04:50 sam Exp $	*/
 /*	$OpenBSD: cryptodev.h,v 1.33 2002/07/17 23:52:39 art Exp $	*/
 
@@ -623,9 +623,6 @@
  * XXX these don't really belong here; but for now they're
  * kept apart from the rest of the system.
  */
-struct mbuf;
-struct	mbuf	*m_getptr(struct mbuf *, int, int *);
-
 struct uio;
 extern	void cuio_copydata(struct uio* uio, int off, int len, void *cp);
 extern	void cuio_copyback(struct uio* uio, int off, int len, void *cp);



CVS commit: src/sys/opencrypto

2011-05-16 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Mon May 16 10:27:49 UTC 2011

Modified Files:
src/sys/opencrypto: crypto.c cryptodev.c ocryptodev.c

Log Message:
split the "crypto_mtx" spinlock into 3: one spinlock each for
the incoming and outgoing request queues (which can be dealt with
by hardware accelerators) and an adaptive lock for "all the rest"
(mostly driver configuration, but also some unrelated stuff in
cryptodev.c which should be revisited)
The latter one seems to be uneeded at many places, but for now I've
done simple replacements only, except minor fixes (where
softint_schedule() was called without the lock held)


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/opencrypto/crypto.c
cvs rdiff -u -r1.56 -r1.57 src/sys/opencrypto/cryptodev.c
cvs rdiff -u -r1.3 -r1.4 src/sys/opencrypto/ocryptodev.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/opencrypto/crypto.c
diff -u src/sys/opencrypto/crypto.c:1.39 src/sys/opencrypto/crypto.c:1.40
--- src/sys/opencrypto/crypto.c:1.39	Fri May  6 21:48:46 2011
+++ src/sys/opencrypto/crypto.c	Mon May 16 10:27:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: crypto.c,v 1.39 2011/05/06 21:48:46 drochner Exp $ */
+/*	$NetBSD: crypto.c,v 1.40 2011/05/16 10:27:49 drochner Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/crypto.c,v 1.4.2.5 2003/02/26 00:14:05 sam Exp $	*/
 /*	$OpenBSD: crypto.c,v 1.41 2002/07/17 23:52:38 art Exp $	*/
 
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.39 2011/05/06 21:48:46 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.40 2011/05/16 10:27:49 drochner Exp $");
 
 #include 
 #include 
@@ -70,6 +70,8 @@
 #include 
 #include 			/* XXX for M_XDATA */
 
+kmutex_t crypto_q_mtx;
+kmutex_t crypto_ret_q_mtx;
 kcondvar_t cryptoret_cv;
 kmutex_t crypto_mtx;
 
@@ -247,7 +249,9 @@
 {
 	int error;
 
-	mutex_init(&crypto_mtx, MUTEX_DEFAULT, IPL_NET);
+	mutex_init(&crypto_mtx, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(&crypto_q_mtx, MUTEX_DEFAULT, IPL_NET);
+	mutex_init(&crypto_ret_q_mtx, MUTEX_DEFAULT, IPL_NET);
 	cv_init(&cryptoret_cv, "crypto_w");
 	pool_init(&cryptop_pool, sizeof(struct cryptop), 0, 0,  
 		  0, "cryptop", NULL, IPL_NET); 
@@ -303,7 +307,7 @@
 	u_int32_t hid, lid;
 	int err = EINVAL;
 
-	mutex_spin_enter(&crypto_mtx);
+	mutex_enter(&crypto_mtx);
 
 	if (crypto_drivers == NULL)
 		goto done;
@@ -366,7 +370,7 @@
 		}
 	}
 done:
-	mutex_spin_exit(&crypto_mtx);
+	mutex_exit(&crypto_mtx);
 	return err;
 }
 
@@ -380,7 +384,7 @@
 	u_int32_t hid;
 	int err = 0;
 
-	mutex_spin_enter(&crypto_mtx);
+	mutex_enter(&crypto_mtx);
 
 	if (crypto_drivers == NULL) {
 		err = EINVAL;
@@ -415,7 +419,7 @@
 		memset(&crypto_drivers[hid], 0, sizeof(struct cryptocap));
 
 done:
-	mutex_spin_exit(&crypto_mtx);
+	mutex_exit(&crypto_mtx);
 	return err;
 }
 
@@ -431,7 +435,7 @@
 
 	crypto_init();		/* XXX oh, this is foul! */
 
-	mutex_spin_enter(&crypto_mtx);
+	mutex_enter(&crypto_mtx);
 	for (i = 0; i < crypto_drivers_num; i++)
 		if (crypto_drivers[i].cc_process == NULL &&
 		(crypto_drivers[i].cc_flags & CRYPTOCAP_F_CLEANUP) == 0 &&
@@ -442,7 +446,7 @@
 	if (i == crypto_drivers_num) {
 		/* Be careful about wrap-around. */
 		if (2 * crypto_drivers_num <= crypto_drivers_num) {
-			mutex_spin_exit(&crypto_mtx);
+			mutex_exit(&crypto_mtx);
 			printf("crypto: driver count wraparound!\n");
 			return -1;
 		}
@@ -450,7 +454,7 @@
 		newdrv = malloc(2 * crypto_drivers_num *
 		sizeof(struct cryptocap), M_CRYPTO_DATA, M_NOWAIT|M_ZERO);
 		if (newdrv == NULL) {
-			mutex_spin_exit(&crypto_mtx);
+			mutex_exit(&crypto_mtx);
 			printf("crypto: no space to expand driver table!\n");
 			return -1;
 		}
@@ -471,7 +475,7 @@
 	if (bootverbose)
 		printf("crypto: assign driver %u, flags %u\n", i, flags);
 
-	mutex_spin_exit(&crypto_mtx);
+	mutex_exit(&crypto_mtx);
 
 	return i;
 }
@@ -496,7 +500,7 @@
 	struct cryptocap *cap;
 	int err;
 
-	mutex_spin_enter(&crypto_mtx);
+	mutex_enter(&crypto_mtx);
 
 	cap = crypto_checkdriver(driverid);
 	if (cap != NULL &&
@@ -525,7 +529,7 @@
 	} else
 		err = EINVAL;
 
-	mutex_spin_exit(&crypto_mtx);
+	mutex_exit(&crypto_mtx);
 	return err;
 }
 
@@ -544,7 +548,7 @@
 	struct cryptocap *cap;
 	int err;
 
-	mutex_spin_enter(&crypto_mtx);
+	mutex_enter(&crypto_mtx);
 
 	cap = crypto_checkdriver(driverid);
 	/* NB: algorithms are in the range [1..max] */
@@ -579,7 +583,7 @@
 	} else
 		err = EINVAL;
 
-	mutex_spin_exit(&crypto_mtx);
+	mutex_exit(&crypto_mtx);
 	return err;
 }
 
@@ -596,7 +600,7 @@
 	u_int32_t ses;
 	struct cryptocap *cap;
 
-	mutex_spin_enter(&crypto_mtx);
+	mutex_enter(&crypto_mtx);
 
 	cap = crypto_checkdriver(driverid);
 	if (cap != NULL &&
@@ -625,7 +629,7 @@
 	} else
 		err = EINVAL;
 
-	mutex_spin_exit(&crypto_mtx);
+	mutex_exit(&crypto_mtx);
 	return err;
 }
 
@@ -647,7 +651,7 @@
 	u_int32_t ses;
 	struct cryptocap *cap;
 
-	mutex_spin_enter(&cr

CVS commit: src/lib/libcrypt

2011-05-16 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Mon May 16 10:39:12 UTC 2011

Modified Files:
src/lib/libcrypt: hmac.c

Log Message:
fix ipad/opad buffer length (was one too much), just for sanity


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libcrypt/hmac.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/libcrypt/hmac.c
diff -u src/lib/libcrypt/hmac.c:1.2 src/lib/libcrypt/hmac.c:1.3
--- src/lib/libcrypt/hmac.c:1.2	Sun Jan 18 12:15:27 2009
+++ src/lib/libcrypt/hmac.c	Mon May 16 10:39:12 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: hmac.c,v 1.2 2009/01/18 12:15:27 lukem Exp $ */
+/* $NetBSD: hmac.c,v 1.3 2011/05/16 10:39:12 drochner Exp $ */
 
 /*
  * Copyright (c) 2004, Juniper Networks, Inc.
@@ -42,7 +42,7 @@
  */
 #include 
 #if !defined(lint)
-__RCSID("$NetBSD: hmac.c,v 1.2 2009/01/18 12:15:27 lukem Exp $");
+__RCSID("$NetBSD: hmac.c,v 1.3 2011/05/16 10:39:12 drochner Exp $");
 #endif /* not lint */
 
 #include 
@@ -70,9 +70,9 @@
 {
 HASH_CTX context;
 /* Inner padding key XOR'd with ipad */
-unsigned char k_ipad[HMAC_BLOCKSZ + 1];
+unsigned char k_ipad[HMAC_BLOCKSZ];
 /* Outer padding key XOR'd with opad */
-unsigned char k_opad[HMAC_BLOCKSZ + 1];
+unsigned char k_opad[HMAC_BLOCKSZ];
 /* HASH(key) if needed */
 unsigned char tk[HASH_LENGTH];	
 size_t i;



CVS commit: src/lib/libcrypt

2011-05-16 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Mon May 16 10:45:56 UTC 2011

Modified Files:
src/lib/libcrypt: bcrypt.c

Log Message:
-fix maximum length of salt (missing prefix, rounding error)
-clip number of rounds at 31 -- this is log2 of the real number,
 and anything larger would break exponentation
-catch possible atoi() error where log2(rounds) is parsed in the
 salt prefix
-zero crypto state on exit
from Open/FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libcrypt/bcrypt.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/libcrypt/bcrypt.c
diff -u src/lib/libcrypt/bcrypt.c:1.9 src/lib/libcrypt/bcrypt.c:1.10
--- src/lib/libcrypt/bcrypt.c:1.9	Fri Oct 27 19:39:11 2006
+++ src/lib/libcrypt/bcrypt.c	Mon May 16 10:45:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcrypt.c,v 1.9 2006/10/27 19:39:11 drochner Exp $	*/
+/*	$NetBSD: bcrypt.c,v 1.10 2011/05/16 10:45:56 drochner Exp $	*/
 /*	$OpenBSD: bcrypt.c,v 1.16 2002/02/19 19:39:36 millert Exp $	*/
 
 /*
@@ -46,7 +46,7 @@
  *
  */
 #include 
-__RCSID("$NetBSD: bcrypt.c,v 1.9 2006/10/27 19:39:11 drochner Exp $");
+__RCSID("$NetBSD: bcrypt.c,v 1.10 2011/05/16 10:45:56 drochner Exp $");
 
 #include 
 #include 
@@ -66,7 +66,7 @@
 
 #define BCRYPT_VERSION '2'
 #define BCRYPT_MAXSALT 16	/* Precomputation is just so nice */
-#define BCRYPT_MAXSALTLEN 	(BCRYPT_MAXSALT * 4 / 3 + 1)
+#define BCRYPT_MAXSALTLEN 	(7 + (BCRYPT_MAXSALT * 4 + 2) / 3 + 1)
 #define BCRYPT_BLOCKS 6		/* Ciphertext blocks */
 #define BCRYPT_MINROUNDS 16	/* we have log2(rounds) in salt */
 
@@ -175,13 +175,10 @@
 	if (errno == ERANGE && nrounds == ULONG_MAX)
 		return -1;
 
-	if (nrounds > 255) {
-		errno = EINVAL;
-		return -1;
-	}
-
 	if (nrounds < 4)
 		nrounds = 4;
+	else if (nrounds > 31)
+		nrounds = 31;
 
 	for (i = 0; i < BCRYPT_MAXSALT; i++) {
 		if (i % 4 == 0)
@@ -225,6 +222,7 @@
 	u_int8_t ciphertext[4 * BCRYPT_BLOCKS] = "OrpheanBeholderScryDoubt";
 	u_int8_t csalt[BCRYPT_MAXSALT];
 	u_int32_t cdata[BCRYPT_BLOCKS];
+	int n;
 
 	/* Discard "$" identifier */
 	salt++;
@@ -256,7 +254,11 @@
 		return error;
 
 	/* Computer power doesn't increase linear, 2^x should be fine */
-	if ((rounds = (u_int32_t) 1 << (logr = atoi(salt))) < BCRYPT_MINROUNDS)
+	n = atoi(salt);
+	if (n > 31 || n < 0)
+		return error;
+	logr = (u_int8_t)n;
+	if ((rounds = (u_int32_t) 1 << logr) < BCRYPT_MINROUNDS)
 		return error;
 
 	/* Discard num rounds + "$" identifier */
@@ -311,6 +313,7 @@
 	encode_base64((u_int8_t *) encrypted + i + 3, csalt, BCRYPT_MAXSALT);
 	encode_base64((u_int8_t *) encrypted + strlen(encrypted), ciphertext,
 	4 * BCRYPT_BLOCKS - 1);
+	memset(&state, 0, sizeof(state));
 	return encrypted;
 }
 



CVS commit: src/sys/dev/usb

2011-05-16 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Mon May 16 10:53:20 UTC 2011

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

Log Message:
fix detach() to avoid use-after-free problems:
-stop transfers before freeing data structures
 (and comment out a useless delay)
-free devinfo later
Hot-unplugging an USB cam while in use doesn't crash my box anymore now.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/usb/uvideo.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/uvideo.c
diff -u src/sys/dev/usb/uvideo.c:1.33 src/sys/dev/usb/uvideo.c:1.34
--- src/sys/dev/usb/uvideo.c:1.33	Fri Dec 24 20:54:28 2010
+++ src/sys/dev/usb/uvideo.c	Mon May 16 10:53:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvideo.c,v 1.33 2010/12/24 20:54:28 jmcneill Exp $	*/
+/*	$NetBSD: uvideo.c,v 1.34 2011/05/16 10:53:19 drochner Exp $	*/
 
 /*
  * Copyright (c) 2008 Patrick Mahoney
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.33 2010/12/24 20:54:28 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.34 2011/05/16 10:53:19 drochner Exp $");
 
 #ifdef _MODULE
 #include 
@@ -671,20 +671,21 @@
 
 	pmf_device_deregister(self);
 
-	usbd_devinfo_free(sc->sc_devname);
-
 	/* TODO: close the device if it is currently opened?  Or will
 	 * close be called automatically? */
 
 	while (!SLIST_EMPTY(&sc->sc_stream_list)) {
 		vs = SLIST_FIRST(&sc->sc_stream_list);
 		SLIST_REMOVE_HEAD(&sc->sc_stream_list, entries);
+		uvideo_stream_stop_xfer(vs);
 		uvideo_stream_free(vs);
 	}
 
+#if 0
 	/* Wait for outstanding request to complete.  TODO: what is
 	 * appropriate here? */
 	usbd_delay_ms(sc->sc_udev, 1000);
+#endif
 
 	DPRINTFN(15, ("uvideo: detaching from %s\n",
 		device_xname(sc->sc_dev)));
@@ -695,6 +696,8 @@
 	usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
 	sc->sc_dev);
 
+	usbd_devinfo_free(sc->sc_devname);
+
 	return rv;
 }
 



CVS commit: src/regress/sys/fs/lseek

2011-05-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May 16 12:43:59 UTC 2011

Modified Files:
src/regress/sys/fs/lseek: lseek.c

Log Message:
use err instead of printf, fix missing prototypes.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/regress/sys/fs/lseek/lseek.c

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

Modified files:

Index: src/regress/sys/fs/lseek/lseek.c
diff -u src/regress/sys/fs/lseek/lseek.c:1.6 src/regress/sys/fs/lseek/lseek.c:1.7
--- src/regress/sys/fs/lseek/lseek.c:1.6	Tue Sep 26 13:18:26 2006
+++ src/regress/sys/fs/lseek/lseek.c	Mon May 16 08:43:59 2011
@@ -2,6 +2,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -13,136 +14,103 @@
 	struct stat st;
 	int error;
 
-	if (argc != 2) {
-		printf("seektest filename\n");
-		return EXIT_FAILURE;
-	}
+	if (argc != 2)
+		errx(EXIT_FAILURE, "seektest filename");
 	fd = open(argv[1], 0, O_RDONLY);
-	if (fd <= 0) {
-		printf("can't open `%s` : %s\n", argv[1], strerror(errno));
-		return EXIT_FAILURE;
-	}
+	if (fd <= 0)
+		err(EXIT_FAILURE, "can't open `%s'", argv[1]);
 
 	printf("Statting file\n");
 	error = fstat(fd, &st);
-	if (error) {
-		printf("can't stat file\n");
-		return EXIT_FAILURE;
-	}
+	if (error)
+		err(EXIT_FAILURE, "can't stat file");
 	printf("fstat() returns %"PRIi64" as size\n", st.st_size);
 
 	error = stat(argv[1], &st);
-	if (error) {
-		printf("can't stat file\n");
-		return EXIT_FAILURE;
-	}
+	if (error)
+		err(EXIT_FAILURE, "can't stat file");
 	printf("stat()  returns %"PRIi64" as size\n", st.st_size);
 
 	error = lstat(argv[1], &st);
-	if (error) {
-		printf("can't lstat file\n");
-		return EXIT_FAILURE;
-	}
+	if (error)
+		err(EXIT_FAILURE, "can't lstat file");
 	printf("lstat() returns %"PRIi64" as size\n", st.st_size);
 
 	printf("\nTesting normal seeking\n");
 	printf("get initial position\n");
 	cur = lseek(fd, 0, SEEK_CUR);
+	if (cur != 0)
+		err(EXIT_FAILURE, "seek initial position wrong");
 	printf("seek start %"PRIi64"\n", cur);
-	if (cur != 0) {
-		printf("seek initial position wrong\n");
-		return EXIT_FAILURE;
-	}
 
 	printf("seeking end (filesize = %"PRIi64")\n", st.st_size);
 	cur = lseek(fd, 0, SEEK_END);
+	if (cur != st.st_size)
+		err(EXIT_FAILURE, "seek to the end went wrong");
 	printf("seek now %"PRIi64"\n", cur);
-	if (cur != st.st_size) {
-		printf("seek to the end went wrong\n");
-		return EXIT_FAILURE;
-	}
 
-	printf("seeking backwards filesize-150 steps\n");
+	printf("seeking backwards filesize - 150 steps\n");
 	cur = lseek(fd, -(st.st_size - 150), SEEK_CUR);
+	if (cur != 150)
+		err(EXIT_FAILURE, "relative seek from end to 150 failed");
 	printf("seek now %"PRIi64"\n", cur);
-	if (cur != 150) {
-		printf("relative seek from end to 150 failed\n");
-		return EXIT_FAILURE;
-	}
 
 	printf("seek set 1000\n");
 	cur = lseek(fd, 1000, SEEK_SET);
+	if (cur != 1000)
+		err(EXIT_FAILURE, "seek 1000 went wrong");
 	printf("seek now %"PRIi64"\n", cur);
-	if (cur != 1000) {
-		printf("seek 1000 went wrong\n");
-		return EXIT_FAILURE;
-	}
 
 #if defined SEEK_DATA
 	printf("\nOne piece non sparse file checking:\n");
 	printf("seeking for sparse file data offset\n");
 	cur = lseek(fd, 0, SEEK_DATA);
-	if (cur != 0) {
-		printf("Not getting start of data segment at 0\n");
-		return EXIT_FAILURE;
-	}
+	if (cur != 0)
+		err(EXIT_FAILURE, "Not getting start of data segment at 0");
 
 	printf("if seek_data returns a 2nd part on a non-sparse file\n");
 	cur = lseek(fd, st.st_size, SEEK_DATA);
-	if (cur != -1) {
-		printf("Seek data gave 2nd part at end of file\n");
-		return EXIT_FAILURE;
-	}
-	if (errno != ENXIO) {
-		printf( "Seek data on the end of file didn't"
-			" raise ENXIO\n");
-		return EXIT_FAILURE;
-	}
-
+	if (cur != -1)
+		errx(EXIT_FAILURE, "Seek data gave 2nd part at end of file");
+	if (errno != ENXIO)
+		errx(EXIT_FAILURE, "Seek data on the end of file didn't"
+			" raise ENXIO (%d)", errno);
 	printf( "if seek_data in the file's last block of a non-sparse file "
 		"returns the current position\n");
 	cur = lseek(fd, st.st_size-50, SEEK_DATA);
 	if (cur != st.st_size - 50) {
-		printf("Seek data didn't give passed seek position back\n");
-		printf("%"PRIi64" should be %"PRIi64"\n", cur, st.st_size-50);
+		errx(EXIT_FAILURE"Seek data didn't give passed seek position "
+		"back %" PRIi64 " should be %" PRIi64, cur, st.st_size-50);
 		return EXIT_FAILURE;
 	}
 
-	printf( "if seek_data in the middle of the of a non-sparse file "
+	printf("if seek_data in the middle of the of a non-sparse file "
 		"returns the current position\n");
-	cur = lseek(fd, st.st_size-100*1024, SEEK_DATA);
-	if (cur != st.st_size - 100*1024) {
-		printf("Seek data didn't give passed seek position back\n");
-		printf("%"PRIi64" should be %"PRIi64"\n", cur,
-			st.st_size-100*1024);
-		return EXIT_FAILURE;
-	}
+	cur = lseek(fd, st.st_size - 100 * 1024, SEEK_DATA);
+	if (cur != st.st_

CVS commit: src/sys/arch

2011-05-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon May 16 13:22:56 UTC 2011

Modified Files:
src/sys/arch/amiga/amiga: machdep.c
src/sys/arch/amiga/include: cpu.h
src/sys/arch/atari/atari: machdep.c
src/sys/arch/atari/include: cpu.h
src/sys/arch/cesfic/cesfic: machdep.c
src/sys/arch/cesfic/include: cpu.h
src/sys/arch/hp300/hp300: machdep.c
src/sys/arch/hp300/include: cpu.h
src/sys/arch/luna68k/conf: files.luna68k
src/sys/arch/luna68k/include: cpu.h
src/sys/arch/luna68k/luna68k: machdep.c
src/sys/arch/m68k/include: m68k.h
src/sys/arch/m68k/m68k: m68k_machdep.c
src/sys/arch/mac68k/include: cpu.h
src/sys/arch/mac68k/mac68k: machdep.c
src/sys/arch/mvme68k/mvme68k: machdep.c
src/sys/arch/news68k/include: cpu.h
src/sys/arch/news68k/news68k: machdep.c
src/sys/arch/next68k/include: cpu.h
src/sys/arch/next68k/next68k: machdep.c
src/sys/arch/sun2/sun2: machdep.c
src/sys/arch/sun3/sun3: machdep.c machdep.h
src/sys/arch/sun3/sun3x: machdep.c
src/sys/arch/x68k/include: cpu.h
src/sys/arch/x68k/x68k: machdep.c

Log Message:
- merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into 

Briefly tested and no obvious breakage on atari, sun3, and x68k.


To generate a diff of this commit:
cvs rdiff -u -r1.232 -r1.233 src/sys/arch/amiga/amiga/machdep.c
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/amiga/include/cpu.h
cvs rdiff -u -r1.170 -r1.171 src/sys/arch/atari/atari/machdep.c
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/atari/include/cpu.h
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/cesfic/cesfic/machdep.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/cesfic/include/cpu.h
cvs rdiff -u -r1.221 -r1.222 src/sys/arch/hp300/hp300/machdep.c
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/hp300/include/cpu.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/luna68k/conf/files.luna68k
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/luna68k/include/cpu.h
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/luna68k/luna68k/machdep.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/m68k/include/m68k.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/m68k/m68k/m68k_machdep.c
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/mac68k/include/cpu.h
cvs rdiff -u -r1.339 -r1.340 src/sys/arch/mac68k/mac68k/machdep.c
cvs rdiff -u -r1.147 -r1.148 src/sys/arch/mvme68k/mvme68k/machdep.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/news68k/include/cpu.h
cvs rdiff -u -r1.93 -r1.94 src/sys/arch/news68k/news68k/machdep.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/next68k/include/cpu.h
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/next68k/next68k/machdep.c
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/sun2/sun2/machdep.c
cvs rdiff -u -r1.200 -r1.201 src/sys/arch/sun3/sun3/machdep.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/sun3/sun3/machdep.h
cvs rdiff -u -r1.127 -r1.128 src/sys/arch/sun3/sun3x/machdep.c
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/x68k/include/cpu.h
cvs rdiff -u -r1.176 -r1.177 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/amiga/amiga/machdep.c
diff -u src/sys/arch/amiga/amiga/machdep.c:1.232 src/sys/arch/amiga/amiga/machdep.c:1.233
--- src/sys/arch/amiga/amiga/machdep.c:1.232	Sun Apr 17 00:37:49 2011
+++ src/sys/arch/amiga/amiga/machdep.c	Mon May 16 13:22:51 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.232 2011/04/17 00:37:49 mlelstv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.233 2011/05/16 13:22:51 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -48,7 +48,7 @@
 #include "opt_m68k_arch.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.232 2011/04/17 00:37:49 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.233 2011/05/16 13:22:51 tsutsui Exp $");
 
 #include 
 #include 
@@ -276,44 +276,6 @@
 }
 
 /*
- * Set registers on exec.
- */
-void
-setregs(struct lwp *l, struct exec_package *pack, vaddr_t stack)
-{
-	struct frame *frame = (struct frame *)l->l_md.md_regs;
-	struct pcb *pcb = lwp_getpcb(l);
-
-	frame->f_sr = PSL_USERSET;
-	frame->f_pc = pack->ep_entry & ~1;
-	frame->f_regs[D0] = 0;
-	frame->f_regs[D1] = 0;
-	frame->f_regs[D2] = 0;
-	frame->f_regs[D3] = 0;
-	frame->f_regs[D4] = 0;
-	frame->f_regs[D5] = 0;
-	frame->f_regs[D6] = 0;
-	frame->f_regs[D7] = 0;
-	frame->f_regs[A0] = 0;
-	frame->f_regs[A1] = 0;
-	frame->f_regs[A2] = l->l_proc->p_psstrp;
-	frame->f_regs[A3] = 0;
-	frame->f_regs[A4] = 0;
-	frame->f_regs[A5] = 0;
-	frame->f_regs[A6] = 0;
-	frame->f_regs[SP] = stack;
-
-	/* restore a null state frame */
-	pcb->pcb_fpregs.fpf_null = 0;
-#ifdef FPU_EMULATE
-	if (!fputype)
-		memset(&pcb->pcb_fpregs, 0, sizeof(struct fpframe));
-	else
-#endif
-		m68881_restore(&pcb->pcb_fpregs);
-}
-
-/*
  * Info for CTL_HW
  */
 char cpu_model[120];

Index: src/sys/arch/amiga/include/cpu.h
diff -u sr

CVS commit: src/include

2011-05-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 16 14:50:37 UTC 2011

Modified Files:
src/include: fenv.h

Log Message:
Actually test for sparc v9 architecture, doesn't matter if we are building
32bit or 64bit (fixes 32bit compat library build on sparc64 - yes, they
differ from native sparc libs!)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/include/fenv.h

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

Modified files:

Index: src/include/fenv.h
diff -u src/include/fenv.h:1.4 src/include/fenv.h:1.5
--- src/include/fenv.h:1.4	Mon May 16 07:59:19 2011
+++ src/include/fenv.h	Mon May 16 14:50:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.4 2011/05/16 07:59:19 he Exp $	*/
+/*	$NetBSD: fenv.h,v 1.5 2011/05/16 14:50:36 martin Exp $	*/
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#if !defined(__i386__) && !defined(__amd64__) && !defined(__sparc64__)
+#if !defined(__i386__) && !defined(__amd64__) && !defined(__sparc_v9__)
 #error	"fenv.h is currently not supported for this architecture"
 #endif
 



CVS commit: src/sys/kern

2011-05-16 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon May 16 15:09:31 UTC 2011

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

Log Message:
Hack for PR 44961: restore the prior "logic" pertaining to looking up /
to prevent a crash when attempting rename("/", "foo"). This is not really
what I want going forward and it may cause e.g. rmdir("blah/") to fail, so
if it causes trouble for anyone back it out. The right fix is going to have
to wait until the qemu/tcp_vtw problems I ran into last night get sorted out.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/sys/kern/vfs_lookup.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/vfs_lookup.c
diff -u src/sys/kern/vfs_lookup.c:1.183 src/sys/kern/vfs_lookup.c:1.184
--- src/sys/kern/vfs_lookup.c:1.183	Mon Apr 18 00:47:24 2011
+++ src/sys/kern/vfs_lookup.c	Mon May 16 15:09:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.183 2011/04/18 00:47:24 dholland Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.184 2011/05/16 15:09:31 dholland Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.183 2011/04/18 00:47:24 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.184 2011/05/16 15:09:31 dholland Exp $");
 
 #include "opt_magiclinks.h"
 
@@ -1145,8 +1145,8 @@
 		 * current node.
 		 */
 		if (cnp->cn_nameptr[0] == '\0') {
-			vref(searchdir);
 			foundobj = searchdir;
+			searchdir = NULL;
 			cnp->cn_flags |= ISLASTCN;
 
 			/* bleh */



CVS commit: src/sys/dev/ic

2011-05-16 Thread Michael L. Hitch
Module Name:src
Committed By:   mhitch
Date:   Mon May 16 17:21:38 UTC 2011

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

Log Message:
I was allowing adapt_max_periph to use all available command slots, which
easily exceeds the maximum of 256 tags used by the scsipi layer because
the tag information from the scsipi layer was ignored and all the tagging
is handled implicitly internal to ciss(4).  But with the DIAGNOSTIC option,
the scsipi layer does a check for > 256 tags and will panic.  So, lets just
limit the adapt_max_periph to 256 so the scsipi layer won't try to user more.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/ic/ciss.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/ciss.c
diff -u src/sys/dev/ic/ciss.c:1.24 src/sys/dev/ic/ciss.c:1.25
--- src/sys/dev/ic/ciss.c:1.24	Sat Nov 13 13:52:00 2010
+++ src/sys/dev/ic/ciss.c	Mon May 16 17:21:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ciss.c,v 1.24 2010/11/13 13:52:00 uebayasi Exp $	*/
+/*	$NetBSD: ciss.c,v 1.25 2011/05/16 17:21:37 mhitch Exp $	*/
 /*	$OpenBSD: ciss.c,v 1.14 2006/03/13 16:02:23 mickey Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.24 2010/11/13 13:52:00 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.25 2011/05/16 17:21:37 mhitch Exp $");
 
 #include "bio.h"
 
@@ -373,7 +373,7 @@
 
 	sc->sc_adapter.adapt_dev = (device_t) sc;
 	sc->sc_adapter.adapt_openings = sc->sc_channel.chan_openings;
-	sc->sc_adapter.adapt_max_periph = sc->sc_channel.chan_openings;
+	sc->sc_adapter.adapt_max_periph = min(sc->sc_adapter.adapt_openings, 256);
 	sc->sc_adapter.adapt_request = ciss_scsi_cmd;
 	sc->sc_adapter.adapt_minphys = cissminphys;
 	sc->sc_adapter.adapt_ioctl = ciss_scsi_ioctl;



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

2011-05-16 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Mon May 16 18:08:04 UTC 2011

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

Log Message:
Hack-around sparc/sun4c case, which modifies const maxdmap/maxsmap.
>From he@.  OK mrg@.


To generate a diff of this commit:
cvs rdiff -u -r1.308 -r1.309 src/sys/arch/sparc/sparc/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/sparc/sparc/machdep.c
diff -u src/sys/arch/sparc/sparc/machdep.c:1.308 src/sys/arch/sparc/sparc/machdep.c:1.309
--- src/sys/arch/sparc/sparc/machdep.c:1.308	Mon Apr 18 00:26:11 2011
+++ src/sys/arch/sparc/sparc/machdep.c	Mon May 16 18:08:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.308 2011/04/18 00:26:11 rmind Exp $ */
+/*	$NetBSD: machdep.c,v 1.309 2011/05/16 18:08:04 rmind Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.308 2011/04/18 00:26:11 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.309 2011/05/16 18:08:04 rmind Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_sunos.h"
@@ -306,10 +306,10 @@
 
 		/* Clip max data & stack to avoid running into the MMU hole */
 #if MAXDSIZ > 256*1024*1024
-		maxdmap = 256*1024*1024;
+		*(rlim_t*)__UNCONST(&maxdmap) = 256*1024*1024;
 #endif
 #if MAXSSIZ > 256*1024*1024
-		maxsmap = 256*1024*1024;
+		*(rlim_t*)__UNCONST(&maxsmap) = 256*1024*1024;
 #endif
 	}
 



CVS commit: src

2011-05-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon May 16 19:27:48 UTC 2011

Modified Files:
src/external/bsd/llvm: Makefile.inc
src/external/bsd/llvm/config/llvm/Config: config.h
src/external/bsd/llvm/lib/libLLVMAsmPrinter: Makefile
src/external/bsd/llvm/lib/libLLVMExecutionEngine: Makefile
src/tools/llvm: Makefile

Log Message:
Update to LLVM/Clang revision 131404. This includes the fix for asm labels
on builtins (broke longjmp usage) and a better cross-compiling support
in combination with -m32/-m64.

Update configuration to include /usr/include/clang-3.0 in the search
path.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/llvm/Makefile.inc
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/llvm/config/llvm/Config/config.h
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/llvm/lib/libLLVMAsmPrinter/Makefile
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/llvm/lib/libLLVMExecutionEngine/Makefile
cvs rdiff -u -r1.3 -r1.4 src/tools/llvm/Makefile

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

Modified files:

Index: src/external/bsd/llvm/Makefile.inc
diff -u src/external/bsd/llvm/Makefile.inc:1.6 src/external/bsd/llvm/Makefile.inc:1.7
--- src/external/bsd/llvm/Makefile.inc:1.6	Thu May 12 14:56:22 2011
+++ src/external/bsd/llvm/Makefile.inc	Mon May 16 19:27:48 2011
@@ -1,12 +1,12 @@
-#	$NetBSD: Makefile.inc,v 1.6 2011/05/12 14:56:22 joerg Exp $
+#	$NetBSD: Makefile.inc,v 1.7 2011/05/16 19:27:48 joerg Exp $
 
 .if !defined(LLVM_TOPLEVEL_MK)
 LLVM_TOPLEVEL_MK=
 
 .include 
 
-LLVM_REVISION=	130695
-CLANG_REVISION=	130695
+LLVM_REVISION=	131404
+CLANG_REVISION=	131404
 
 LLVM_SRCDIR:=	${.PARSEDIR}/dist/llvm
 CLANG_SRCDIR:=	${.PARSEDIR}/dist/clang

Index: src/external/bsd/llvm/config/llvm/Config/config.h
diff -u src/external/bsd/llvm/config/llvm/Config/config.h:1.1 src/external/bsd/llvm/config/llvm/Config/config.h:1.2
--- src/external/bsd/llvm/config/llvm/Config/config.h:1.1	Sun Feb  6 01:13:51 2011
+++ src/external/bsd/llvm/config/llvm/Config/config.h	Mon May 16 19:27:48 2011
@@ -20,7 +20,7 @@
 #define CXX_INCLUDE_ROOT ""
 
 /* Directories clang will search for headers */
-#define C_INCLUDE_DIRS ""
+#define C_INCLUDE_DIRS "/usr/include/clang-3.0:/usr/include"
 
 /* Define if CBE is enabled for printf %a output */
 #define ENABLE_CBE_PRINTF_A 1

Index: src/external/bsd/llvm/lib/libLLVMAsmPrinter/Makefile
diff -u src/external/bsd/llvm/lib/libLLVMAsmPrinter/Makefile:1.3 src/external/bsd/llvm/lib/libLLVMAsmPrinter/Makefile:1.4
--- src/external/bsd/llvm/lib/libLLVMAsmPrinter/Makefile:1.3	Thu May 12 14:56:23 2011
+++ src/external/bsd/llvm/lib/libLLVMAsmPrinter/Makefile	Mon May 16 19:27:48 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2011/05/12 14:56:23 joerg Exp $
+#	$NetBSD: Makefile,v 1.4 2011/05/16 19:27:48 joerg Exp $
 
 LIB=	LLVMAsmPrinter
 
@@ -15,7 +15,6 @@
 	DwarfCompileUnit.cpp \
 	DwarfDebug.cpp \
 	DwarfException.cpp \
-	DwarfTableException.cpp \
 	OcamlGCPrinter.cpp
 
 .if defined(HOSTLIB)

Index: src/external/bsd/llvm/lib/libLLVMExecutionEngine/Makefile
diff -u src/external/bsd/llvm/lib/libLLVMExecutionEngine/Makefile:1.1 src/external/bsd/llvm/lib/libLLVMExecutionEngine/Makefile:1.2
--- src/external/bsd/llvm/lib/libLLVMExecutionEngine/Makefile:1.1	Sun Feb  6 01:13:57 2011
+++ src/external/bsd/llvm/lib/libLLVMExecutionEngine/Makefile	Mon May 16 19:27:48 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2011/02/06 01:13:57 joerg Exp $
+#	$NetBSD: Makefile,v 1.2 2011/05/16 19:27:48 joerg Exp $
 
 LIB=	LLVMExecutionEngine
 
@@ -7,6 +7,7 @@
 .PATH: ${LLVM_SRCDIR}/lib/ExecutionEngine
 
 SRCS+=	ExecutionEngine.cpp \
-	ExecutionEngineBindings.cpp
+	ExecutionEngineBindings.cpp \
+	TargetSelect.cpp
 
 .include 

Index: src/tools/llvm/Makefile
diff -u src/tools/llvm/Makefile:1.3 src/tools/llvm/Makefile:1.4
--- src/tools/llvm/Makefile:1.3	Mon Mar 21 02:10:10 2011
+++ src/tools/llvm/Makefile	Mon May 16 19:27:47 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2011/03/21 02:10:10 joerg Exp $
+#	$NetBSD: Makefile,v 1.4 2011/05/16 19:27:47 joerg Exp $
 
 .include 
 
@@ -21,7 +21,9 @@
 	mkdir -p config
 	cd config && ${LLVM_SRCDIR}/configure --prefix=/usr \
 	--enable-targets=x86 --host=x86_64--netbsd \
+	--with-c-include-dirs=/usr/include/clang-3.0:/usr/include \
 	--enable-optimized --disable--assertions
+
 need-dl:
 	printf '#include \nint main(void){void *p; return dladdr(p, p);}' > need-dl.c
 	if ${HOST_CC} -o need-dl.out -D_GNU_SOURCE need-dl.c > /dev/null 2>&1; then \



CVS commit: src/regress/sys/kern/sigtramp

2011-05-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May 16 21:51:31 UTC 2011

Modified Files:
src/regress/sys/kern/sigtramp: sigtramp.c

Log Message:
fix prototypes.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/regress/sys/kern/sigtramp/sigtramp.c

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

Modified files:

Index: src/regress/sys/kern/sigtramp/sigtramp.c
diff -u src/regress/sys/kern/sigtramp/sigtramp.c:1.3 src/regress/sys/kern/sigtramp/sigtramp.c:1.4
--- src/regress/sys/kern/sigtramp/sigtramp.c:1.3	Mon Apr 28 16:23:07 2008
+++ src/regress/sys/kern/sigtramp/sigtramp.c	Mon May 16 17:51:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sigtramp.c,v 1.3 2008/04/28 20:23:07 martin Exp $	*/
+/*	$NetBSD: sigtramp.c,v 1.4 2011/05/16 21:51:31 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,14 +31,16 @@
  * I&D-caches after copying out the signal trampoline code.
  */
 #include 
+#include 
 
-void catch(sig)
-int sig;
+static void
+catch(int sig)
 {
 	return;
 }
 
-main()
+int
+main(void)
 {
 	static struct sigaction sa;
 



CVS commit: othersrc/external/bsd/gensetlist

2011-05-16 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Tue May 17 00:22:44 UTC 2011

Modified Files:
othersrc/external/bsd/gensetlist: gensetlist.c

Log Message:
print the set name for scripts as well as program definitions (or both)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/gensetlist/gensetlist.c

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

Modified files:

Index: othersrc/external/bsd/gensetlist/gensetlist.c
diff -u othersrc/external/bsd/gensetlist/gensetlist.c:1.4 othersrc/external/bsd/gensetlist/gensetlist.c:1.5
--- othersrc/external/bsd/gensetlist/gensetlist.c:1.4	Sat May 14 00:08:45 2011
+++ othersrc/external/bsd/gensetlist/gensetlist.c	Tue May 17 00:22:44 2011
@@ -394,10 +394,13 @@
 pdefs(&vars, buf, sizeof(buf), NULL));
 		}
 	}
-	/* programs */
-	if (vars.progname[0]) {
+	/* if a program or a script, then print the set name */
+	if (vars.progname[0] || vars.scriptc > 0) {
 		psetname(setname, sizeof(setname),
 			"\n[src/distrib/sets/lists/base/mi]\n");
+	}
+	/* programs */
+	if (vars.progname[0]) {
 		printf(".%s/%s\t\tbase-%s-bin\t%s\n",
 			vars.bindir, vars.progname, vars.category,
 			pdefs(&vars, buf, sizeof(buf), NULL));



CVS commit: src/share/mk

2011-05-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 17 01:12:34 UTC 2011

Modified Files:
src/share/mk: bsd.kmodule.mk bsd.sys.mk

Log Message:
Enable c99 mode by default.

This has the side effect of complaining for missing prototypes
implicit type declarations and missing return statements.

NB: I've only ran a build on amd64, so other platforms MI code might break.
If you can't wait for me to fix them, revert this commit.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/share/mk/bsd.kmodule.mk
cvs rdiff -u -r1.193 -r1.194 src/share/mk/bsd.sys.mk

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

Modified files:

Index: src/share/mk/bsd.kmodule.mk
diff -u src/share/mk/bsd.kmodule.mk:1.28 src/share/mk/bsd.kmodule.mk:1.29
--- src/share/mk/bsd.kmodule.mk:1.28	Sun Apr 17 05:47:40 2011
+++ src/share/mk/bsd.kmodule.mk	Mon May 16 21:12:34 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.kmodule.mk,v 1.28 2011/04/17 09:47:40 mrg Exp $
+#	$NetBSD: bsd.kmodule.mk,v 1.29 2011/05/17 01:12:34 christos Exp $
 
 # We are not building this with PIE
 MKPIE=no
@@ -17,7 +17,6 @@
 CPPFLAGS+=	-nostdinc -I. -I${.CURDIR} -isystem $S -isystem $S/arch
 CPPFLAGS+=	-isystem ${S}/../common/include
 CPPFLAGS+=	-D_KERNEL -D_LKM -D_MODULE
-CPPFLAGS+=	-std=gnu99
 
 # XXX until the kernel is fixed again...
 .if (defined(HAVE_GCC) && ${HAVE_GCC} == 4) || defined(HAVE_PCC)

Index: src/share/mk/bsd.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.193 src/share/mk/bsd.sys.mk:1.194
--- src/share/mk/bsd.sys.mk:1.193	Sat Dec 25 13:56:45 2010
+++ src/share/mk/bsd.sys.mk	Mon May 16 21:12:34 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.sys.mk,v 1.193 2010/12/25 18:56:45 joerg Exp $
+#	$NetBSD: bsd.sys.mk,v 1.194 2011/05/17 01:12:34 christos Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -10,6 +10,13 @@
 CPPFLAGS+=	-Wp,-iremap,${DESTDIR}/:/
 .endif
 
+# Enable c99 mode by default.
+# This has the side effect of complaining for missing prototypes
+# implicit type declarations and missing return statements.
+.if defined(HAVE_GCC) && ${HAVE_GCC} >= 3
+CFLAGS+=	-std=gnu99
+.endif
+
 .if defined(WARNS)
 .if ${WARNS} > 0
 CFLAGS+=	-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
@@ -47,7 +54,6 @@
 .endif
 .if ${WARNS} > 3 && defined(HAVE_GCC) && ${HAVE_GCC} >= 3
 CFLAGS+=	-Wsign-compare
-CFLAGS+=	-std=gnu99
 .endif
 .endif
 



CVS commit: src/lib/libc

2011-05-16 Thread enami tsugutomo
Module Name:src
Committed By:   enami
Date:   Tue May 17 03:35:39 UTC 2011

Modified Files:
src/lib/libc/gen: vis.3
src/lib/libc/regex: regex.3
src/lib/libc/rpc: rpc_clnt_create.3

Log Message:
Use Pq or Po macro for better output rather than putting raw open paren
at the end of line.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/lib/libc/gen/vis.3
cvs rdiff -u -r1.21 -r1.22 src/lib/libc/regex/regex.3
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/rpc/rpc_clnt_create.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/vis.3
diff -u src/lib/libc/gen/vis.3:1.25 src/lib/libc/gen/vis.3:1.26
--- src/lib/libc/gen/vis.3:1.25	Sun Mar 13 09:12:35 2011
+++ src/lib/libc/gen/vis.3	Tue May 17 03:35:38 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: vis.3,v 1.25 2011/03/13 09:12:35 wiz Exp $
+.\"	$NetBSD: vis.3,v 1.26 2011/05/17 03:35:38 enami Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -429,13 +429,13 @@
 .Fn strsvisx
 functions appeared in
 .Nx 1.5 .
-The buffer size limited versions of the functions (
-.Fn nvis ,
+The buffer size limited versions of the functions
+.Po Fn nvis ,
 .Fn strnvis ,
 .Fn strnvisx ,
 .Fn snvis ,
 .Fn strsnvis ,
 and 
-.Fn strsnvisx )
+.Fn strsnvisx Pc
 appeared in
 .Nx 6.0 .

Index: src/lib/libc/regex/regex.3
diff -u src/lib/libc/regex/regex.3:1.21 src/lib/libc/regex/regex.3:1.22
--- src/lib/libc/regex/regex.3:1.21	Mon Mar 22 19:30:54 2010
+++ src/lib/libc/regex/regex.3	Tue May 17 03:35:38 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: regex.3,v 1.21 2010/03/22 19:30:54 joerg Exp $
+.\"	$NetBSD: regex.3,v 1.22 2011/05/17 03:35:38 enami Exp $
 .\"
 .\" Copyright (c) 1992, 1993, 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -394,11 +394,11 @@
 it should have been the result from the most recent
 .Fn regcomp
 using that
-.Fa regex_t . (
-.Fn regerror
+.Fa regex_t .
+.Po Fn regerror
 may be able to supply a more detailed message using information
 from the
-.Fa regex_t . )
+.Fa regex_t . Pc
 .Fn regerror
 places the NUL-terminated message into the buffer pointed to by
 .Fa errbuf ,

Index: src/lib/libc/rpc/rpc_clnt_create.3
diff -u src/lib/libc/rpc/rpc_clnt_create.3:1.11 src/lib/libc/rpc/rpc_clnt_create.3:1.12
--- src/lib/libc/rpc/rpc_clnt_create.3:1.11	Sat May 23 18:57:25 2009
+++ src/lib/libc/rpc/rpc_clnt_create.3	Tue May 17 03:35:39 2011
@@ -2,7 +2,7 @@
 .\" Copyright 1989 AT&T
 .\" @(#)rpc_clnt_create 1.5 89/07/24 SMI;
 .\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved.
-.\"	$NetBSD: rpc_clnt_create.3,v 1.11 2009/05/23 18:57:25 christos Exp $
+.\"	$NetBSD: rpc_clnt_create.3,v 1.12 2011/05/17 03:35:39 enami Exp $
 .Dd May 23, 2009
 .Dt RPC_CLNT_CREATE 3
 .Os
@@ -84,8 +84,8 @@
 Note:
 If you set the timeout value to 0
 .Fn clnt_control
-immediately returns an error (
-.Dv RPC_TIMEDOUT ) .
+immediately returns an error
+.Pq Dv RPC_TIMEDOUT .
 Set the timeout parameter to 0 for batching calls.
 .Bl -column CLSET_FD_NCLOSE "struct timeval *" "do not close fd on destroy"
 .It Dv CLGET_SVC_ADDR Ta "struct netbuf *" Ta "get servers address"



CVS commit: othersrc/external/bsd/genraidconf

2011-05-16 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Tue May 17 03:48:50 UTC 2011

Update of /cvsroot/othersrc/external/bsd/genraidconf
In directory ivanova.netbsd.org:/tmp/cvs-serv2114

Log Message:
initial import of genraidconf, an embryonic RAIDframe configuration file
generator, into opthersrc.

 The genraidconf command constructs a configuration file for a RAID set.
 It uses various pieces of information to construct a number of disklabels
 for the RAID set component disks using disklabel(8), and a configuration
 file for RAID frame itself, raid(4) producing a file as described in
 raidctl(8).

It also can zero components before use, performs some basic sanity checks
on its inputs, and, in general, prepares the RAID set to the stage where a
newfs(8) may occur on it.

This utility is embryonic, since it needs much more testing. As such, it
must be considered experimental at this stage.

Examples of sage:

 % uname -m
 amd64
 % genraidconf.sh -n -o raid5 -d raid0 sd0 sd1 sd2
 fdisk -uai -A 2048 sd0a
 fdisk -uai -A 2048 sd1a
 fdisk -uai -A 2048 sd2a
 disklabel -R sd0 /tmp/label.20322a
 disklabel -R sd1 /tmp/label.20322a
 disklabel -R sd2 /tmp/label.20322a
 raidctl -I 20110516143616 raid0
 raidctl -i raid0
 raidctl -A yes raid0
 % genraidconf.sh -n -o raid1 -d raid1 sd0 sd1 sd2
 RAIDframe RAID1 requires 2 disks
 % genraidconf.sh -n -r 1 -d raid1 sd0 sd1
 fdisk -uai -A 2048 sd0a
 fdisk -uai -A 2048 sd1a
 disklabel -R sd0 /tmp/label.26009a
 disklabel -R sd1 /tmp/label.26009a
 raidctl -I 20110516143702 raid1
 raidctl -i raid1
 raidctl -A yes raid1
 % genraidconf.sh -n -o raid1 -d raid1 -o zero sd0 sd1
 dd if=/dev/zero bs=32k of=/dev/rsd0a
 dd if=/dev/zero bs=32k of=/dev/rsd1a
 fdisk -uai -A 2048 sd0a
 fdisk -uai -A 2048 sd1a
 disklabel -R sd0 /tmp/label.23760a
 disklabel -R sd1 /tmp/label.23760a
 raidctl -I 20110516143710 raid1
 raidctl -i raid1
 raidctl -A yes raid1
 % genraidconf.sh -n -o raid1 -d raid1 -o zero -o root sd0 sd1
 dd if=/dev/zero bs=32k of=/dev/rsd0a
 dd if=/dev/zero bs=32k of=/dev/rsd1a
 fdisk -uai -A 2048 sd0a
 fdisk -uai -A 2048 sd1a
 disklabel -R sd0 /tmp/label.25286a
 disklabel -R sd1 /tmp/label.25286a
 raidctl -I 20110516143738 raid1
 raidctl -i raid1
 raidctl -A yes raid1
 raidctl -A root raid1
 %

With a huge thankyou to Matthew Green for guidance on a number of
issues.


Status:

Vendor Tag: CROOKS
Release Tags:   genraidconf-base

N othersrc/external/bsd/genraidconf/genraidconf.8
N othersrc/external/bsd/genraidconf/genraidconf.sh
N othersrc/external/bsd/genraidconf/Makefile

No conflicts created by this import



CVS commit: othersrc/external/bsd/genraidconf

2011-05-16 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Tue May 17 03:51:40 UTC 2011

Modified Files:
othersrc/external/bsd/genraidconf: genraidconf.8

Log Message:
invoke the commands in the example properly


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 othersrc/external/bsd/genraidconf/genraidconf.8

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

Modified files:

Index: othersrc/external/bsd/genraidconf/genraidconf.8
diff -u othersrc/external/bsd/genraidconf/genraidconf.8:1.1.1.1 othersrc/external/bsd/genraidconf/genraidconf.8:1.2
--- othersrc/external/bsd/genraidconf/genraidconf.8:1.1.1.1	Tue May 17 03:48:50 2011
+++ othersrc/external/bsd/genraidconf/genraidconf.8	Tue May 17 03:51:40 2011
@@ -1,4 +1,4 @@
-.\" $NetBSD: genraidconf.8,v 1.1.1.1 2011/05/17 03:48:50 agc Exp $
+.\" $NetBSD: genraidconf.8,v 1.2 2011/05/17 03:51:40 agc Exp $
 .\"
 .\" Copyright (c) 2011 Alistair Crooks 
 .\" All rights reserved.
@@ -116,7 +116,7 @@
 .Bd -literal
 % uname -m
 amd64
-% genraidconf.sh -n -o raid5 -d raid0 sd0 sd1 sd2
+% genraidconf -n -o raid5 -d raid0 sd0 sd1 sd2
 fdisk -uai -A 2048 sd0a
 fdisk -uai -A 2048 sd1a
 fdisk -uai -A 2048 sd2a
@@ -126,9 +126,9 @@
 raidctl -I 20110516143616 raid0
 raidctl -i raid0
 raidctl -A yes raid0
-% genraidconf.sh -n -o raid1 -d raid1 sd0 sd1 sd2
+% genraidconf -n -o raid1 -d raid1 sd0 sd1 sd2
 RAIDframe RAID1 requires 2 disks
-% genraidconf.sh -n -r 1 -d raid1 sd0 sd1
+% genraidconf -n -r 1 -d raid1 sd0 sd1
 fdisk -uai -A 2048 sd0a
 fdisk -uai -A 2048 sd1a
 disklabel -R sd0 /tmp/label.26009a
@@ -136,7 +136,7 @@
 raidctl -I 20110516143702 raid1
 raidctl -i raid1
 raidctl -A yes raid1
-% genraidconf.sh -n -o raid1 -d raid1 -o zero sd0 sd1
+% genraidconf -n -o raid1 -d raid1 -o zero sd0 sd1
 dd if=/dev/zero bs=32k of=/dev/rsd0a
 dd if=/dev/zero bs=32k of=/dev/rsd1a
 fdisk -uai -A 2048 sd0a
@@ -146,7 +146,7 @@
 raidctl -I 20110516143710 raid1
 raidctl -i raid1
 raidctl -A yes raid1
-% genraidconf.sh -n -o raid1 -d raid1 -o zero -o root sd0 sd1
+% genraidconf -n -o raid1 -d raid1 -o zero -o root sd0 sd1
 dd if=/dev/zero bs=32k of=/dev/rsd0a
 dd if=/dev/zero bs=32k of=/dev/rsd1a
 fdisk -uai -A 2048 sd0a



CVS commit: src

2011-05-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue May 17 04:18:07 UTC 2011

Modified Files:
src/sys/arch/sparc64/conf: GENERIC
src/sys/conf: files
src/sys/ddb: db_command.c
src/sys/dev/ic: sl811hs.c
src/sys/uvm: uvm.h uvm_ddb.h uvm_map.c uvm_stat.c uvm_stat.h
src/usr.bin/vmstat: vmstat.c
Added Files:
src/sys/kern: kern_history.c
src/sys/sys: kernhist.h

Log Message:
move and rename the uvm history code out of uvm_stat to "kernhist".

rename "UVMHIST" option to enable the uvm histories.

TODO:
- make UVMHIST properly depend upon KERNHIST
- enable dynamic registration of histories.  this is mostly just
  allocating something in a bitmap, and is only for viewing multiple
  histories in a merged form.

tested on amd64 and sparc64.


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/sys/arch/sparc64/conf/GENERIC
cvs rdiff -u -r1.1011 -r1.1012 src/sys/conf/files
cvs rdiff -u -r1.135 -r1.136 src/sys/ddb/db_command.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/ic/sl811hs.c
cvs rdiff -u -r0 -r1.1 src/sys/kern/kern_history.c
cvs rdiff -u -r0 -r1.1 src/sys/sys/kernhist.h
cvs rdiff -u -r1.61 -r1.62 src/sys/uvm/uvm.h
cvs rdiff -u -r1.14 -r1.15 src/sys/uvm/uvm_ddb.h
cvs rdiff -u -r1.296 -r1.297 src/sys/uvm/uvm_map.c
cvs rdiff -u -r1.36 -r1.37 src/sys/uvm/uvm_stat.c
cvs rdiff -u -r1.49 -r1.50 src/sys/uvm/uvm_stat.h
cvs rdiff -u -r1.180 -r1.181 src/usr.bin/vmstat/vmstat.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/sparc64/conf/GENERIC
diff -u src/sys/arch/sparc64/conf/GENERIC:1.137 src/sys/arch/sparc64/conf/GENERIC:1.138
--- src/sys/arch/sparc64/conf/GENERIC:1.137	Thu May 12 07:06:00 2011
+++ src/sys/arch/sparc64/conf/GENERIC	Tue May 17 04:18:05 2011
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.137 2011/05/12 07:06:00 mrg Exp $
+# $NetBSD: GENERIC,v 1.138 2011/05/17 04:18:05 mrg Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.137 $"
+#ident 		"GENERIC-$Revision: 1.138 $"
 
 maxusers	64
 
@@ -99,7 +99,7 @@
 ## Compile the kernel with debugging symbols (`netbsd.gdb' is the debug file),
 ## such that gdb(1) can be used on a kernel coredump.
 
-#makeoptions	DEBUG="-g"
+makeoptions	DEBUG="-g"
 
 
 ## Adds code to the kernel that does internal consistency checks, and will

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1011 src/sys/conf/files:1.1012
--- src/sys/conf/files:1.1011	Thu May  5 17:38:35 2011
+++ src/sys/conf/files	Tue May 17 04:18:06 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1011 2011/05/05 17:38:35 drochner Exp $
+#	$NetBSD: files,v 1.1012 2011/05/17 04:18:06 mrg Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20100430
@@ -1384,6 +1384,13 @@
 include "uvm/files.uvm"
 
 #
+# Kernel history/tracing. Old UVMHIST depends upon this.
+# XXXMRG can't make UVMHIST depend properly on KERNHIST?
+#
+defflag opt_kernhist.h			KERNHIST KERNHIST_PRINT
+file	kern/kern_history.c		kernhist
+
+#
 # Security models
 #
 include "secmodel/files.secmodel"

Index: src/sys/ddb/db_command.c
diff -u src/sys/ddb/db_command.c:1.135 src/sys/ddb/db_command.c:1.136
--- src/sys/ddb/db_command.c:1.135	Sun Apr 10 20:59:22 2011
+++ src/sys/ddb/db_command.c	Tue May 17 04:18:06 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_command.c,v 1.135 2011/04/10 20:59:22 christos Exp $	*/
+/*	$NetBSD: db_command.c,v 1.136 2011/05/17 04:18:06 mrg Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2009 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.135 2011/04/10 20:59:22 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_command.c,v 1.136 2011/05/17 04:18:06 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -68,7 +68,7 @@
 #include "opt_kgdb.h"
 #include "opt_mqueue.h"
 #include "opt_inet.h"
-#include "opt_uvmhist.h"
+#include "opt_kernhist.h"
 #include "opt_ddbparam.h"
 #include "opt_multiprocessor.h"
 #include "arp.h"
@@ -90,6 +90,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /*include queue macros*/
 #include 
@@ -205,8 +206,8 @@
 static void	db_sync_cmd(db_expr_t, bool, db_expr_t, const char *);
 static void	db_whatis_cmd(db_expr_t, bool, db_expr_t, const char *);
 static void	db_uvmexp_print_cmd(db_expr_t, bool, db_expr_t, const char *);
-#ifdef UVMHIST
-static void	db_uvmhist_print_cmd(db_expr_t, bool, db_expr_t, const char *);
+#ifdef KERNHIST
+static void	db_kernhist_print_cmd(db_expr_t, bool, db_expr_t, const char *);
 #endif
 static void	db_vnode_print_cmd(db_expr_t, bool, db_expr_t, const char *);
 static void	db_vmem_print_cmd(db_expr_t, bool, db_expr_t, const char *);
@@ -276,8 +277,8 @@
 	{ DDB_ADD_CMD("uvmexp",	db_uvmexp_print_cmd, 0,
 	"Print a selection of UVM counters and statistics.",
 	NULL,NULL) },
-#ifdef UVMHIST
-	{ DDB_ADD_CMD

CVS commit: src/sys/netinet6

2011-05-16 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 17 04:39:57 UTC 2011

Modified Files:
src/sys/netinet6: in6_src.c

Log Message:
Add missing $NetBSD$ header.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/netinet6/in6_src.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/netinet6/in6_src.c
diff -u src/sys/netinet6/in6_src.c:1.50 src/sys/netinet6/in6_src.c:1.51
--- src/sys/netinet6/in6_src.c:1.50	Tue May  3 18:28:45 2011
+++ src/sys/netinet6/in6_src.c	Tue May 17 04:39:57 2011
@@ -1,3 +1,4 @@
+/*	$NetBSD: in6_src.c,v 1.51 2011/05/17 04:39:57 dholland Exp $	*/
 /*	$KAME: in6_src.c,v 1.159 2005/10/19 01:40:32 t-momose Exp $	*/
 
 /*
@@ -65,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.50 2011/05/03 18:28:45 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.51 2011/05/17 04:39:57 dholland Exp $");
 
 #include "opt_inet.h"
 



CVS commit: src/sys

2011-05-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue May 17 05:32:31 UTC 2011

Modified Files:
src/sys/conf: files
src/sys/uvm: files.uvm

Log Message:
fix the ordering and make UVMHIST enable KERNHIST automatically.


To generate a diff of this commit:
cvs rdiff -u -r1.1012 -r1.1013 src/sys/conf/files
cvs rdiff -u -r1.19 -r1.20 src/sys/uvm/files.uvm

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

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1012 src/sys/conf/files:1.1013
--- src/sys/conf/files:1.1012	Tue May 17 04:18:06 2011
+++ src/sys/conf/files	Tue May 17 05:32:31 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1012 2011/05/17 04:18:06 mrg Exp $
+#	$NetBSD: files,v 1.1013 2011/05/17 05:32:31 mrg Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20100430
@@ -1379,18 +1379,17 @@
 include "ufs/files.ufs"
 
 #
-# UVM (virtual memory)
-#
-include "uvm/files.uvm"
-
-#
 # Kernel history/tracing. Old UVMHIST depends upon this.
-# XXXMRG can't make UVMHIST depend properly on KERNHIST?
 #
 defflag opt_kernhist.h			KERNHIST KERNHIST_PRINT
 file	kern/kern_history.c		kernhist
 
 #
+# UVM (virtual memory)
+#
+include "uvm/files.uvm"
+
+#
 # Security models
 #
 include "secmodel/files.secmodel"

Index: src/sys/uvm/files.uvm
diff -u src/sys/uvm/files.uvm:1.19 src/sys/uvm/files.uvm:1.20
--- src/sys/uvm/files.uvm:1.19	Thu Dec  9 01:48:05 2010
+++ src/sys/uvm/files.uvm	Tue May 17 05:32:31 2011
@@ -1,9 +1,9 @@
-#	$NetBSD: files.uvm,v 1.19 2010/12/09 01:48:05 uebayasi Exp $
+#	$NetBSD: files.uvm,v 1.20 2011/05/17 05:32:31 mrg Exp $
 
 #
 # UVM options
 # 
-defflag opt_uvmhist.h		UVMHIST UVMHIST_PRINT
+defflag opt_uvmhist.h		UVMHIST UVMHIST_PRINT: KERNHIST
 defflag opt_uvm.h		USE_TOPDOWN_VM UVMMAP_COUNTERS
 defflag opt_vmswap.h		VMSWAP
 defflag opt_readahead.h		READAHEAD_STATS



CVS commit: src/sys/netinet

2011-05-16 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 17 05:40:24 UTC 2011

Modified Files:
src/sys/netinet: tcp_input.c

Log Message:
typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.312 -r1.313 src/sys/netinet/tcp_input.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/netinet/tcp_input.c
diff -u src/sys/netinet/tcp_input.c:1.312 src/sys/netinet/tcp_input.c:1.313
--- src/sys/netinet/tcp_input.c:1.312	Tue May  3 18:28:45 2011
+++ src/sys/netinet/tcp_input.c	Tue May 17 05:40:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_input.c,v 1.312 2011/05/03 18:28:45 dyoung Exp $	*/
+/*	$NetBSD: tcp_input.c,v 1.313 2011/05/17 05:40:24 dholland Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.312 2011/05/03 18:28:45 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.313 2011/05/17 05:40:24 dholland Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -2248,7 +2248,7 @@
 			TCP_STATINC(TCP_STAT_CONNECTS);
 			/*
 			 * move tcp_established before soisconnected
-			 * becasue upcall handler can drive tcp_output
+			 * because upcall handler can drive tcp_output
 			 * functionality.
 			 * XXX we might call soisconnected at the end of
 			 * all processing



CVS commit: src/sys/netinet

2011-05-16 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue May 17 05:42:40 UTC 2011

Modified Files:
src/sys/netinet: tcp_vtw.c tcp_vtw.h

Log Message:
typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/netinet/tcp_vtw.c
cvs rdiff -u -r1.2 -r1.3 src/sys/netinet/tcp_vtw.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/netinet/tcp_vtw.c
diff -u src/sys/netinet/tcp_vtw.c:1.3 src/sys/netinet/tcp_vtw.c:1.4
--- src/sys/netinet/tcp_vtw.c:1.3	Wed May 11 15:08:59 2011
+++ src/sys/netinet/tcp_vtw.c	Tue May 17 05:42:40 2011
@@ -77,7 +77,7 @@
 #include 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: tcp_vtw.c,v 1.3 2011/05/11 15:08:59 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_vtw.c,v 1.4 2011/05/17 05:42:40 dholland Exp $");
 
 #define db_trace(__a, __b)	do { } while (/*CONSTCOND*/0)
 
@@ -662,7 +662,7 @@
 	ctl->oldest.v = vtw_next(ctl, vtw);
 }
 
-/*!\brief	insert vestigeal timewait in hash chain
+/*!\brief	insert vestigial timewait in hash chain
  */
 static void
 vtw_inshash_v4(vtw_ctl_t *ctl, vtw_t *vtw)
@@ -701,7 +701,7 @@
 	vtw->hashed = 1;
 }
 
-/*!\brief	insert vestigeal timewait in hash chain
+/*!\brief	insert vestigial timewait in hash chain
  */
 static void
 vtw_inshash_v6(vtw_ctl_t *ctl, vtw_t *vtw)

Index: src/sys/netinet/tcp_vtw.h
diff -u src/sys/netinet/tcp_vtw.h:1.2 src/sys/netinet/tcp_vtw.h:1.3
--- src/sys/netinet/tcp_vtw.h:1.2	Tue May  3 23:57:41 2011
+++ src/sys/netinet/tcp_vtw.h	Tue May 17 05:42:40 2011
@@ -239,7 +239,7 @@
 typedef struct fatp_ctl		fatp_ctl_t;
 
 /*
- * The vestigeal time waits are kept in a contiguous chunk.
+ * The vestigial time waits are kept in a contiguous chunk.
  * Allocation and free pointers run as clock hands thru this array.
  */
 struct vtw_ctl {