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

2011-05-03 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed May  4 04:33:37 UTC 2011

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

Log Message:
add access functions for the Instruction Cache Throttling Control register
found in 750 and newer CPUs


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/powerpc/include/cpu.h

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

Modified files:

Index: src/sys/arch/powerpc/include/cpu.h
diff -u src/sys/arch/powerpc/include/cpu.h:1.75 src/sys/arch/powerpc/include/cpu.h:1.76
--- src/sys/arch/powerpc/include/cpu.h:1.75	Wed Feb 16 18:42:33 2011
+++ src/sys/arch/powerpc/include/cpu.h	Wed May  4 04:33:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.75 2011/02/16 18:42:33 matt Exp $	*/
+/*	$NetBSD: cpu.h,v 1.76 2011/05/04 04:33:37 macallan Exp $	*/
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -322,6 +322,28 @@
 	return (cnt);
 }
 
+/*
+ * functions to access the G3's cache throttling register
+ * bits 1 - 9 specify additional waits on cache acess
+ * bit 0 enables cache throttling
+ */
+
+static __inline int
+mfictc(void)
+{
+	int reg;
+
+	__asm ("mfspr %0,1019" : "=r"(reg));
+	return reg;
+}
+
+static __inline void
+mtictc(uint32_t reg)
+{
+
+	__asm ("mtspr 1019,%0" :: "r"(reg));
+}
+
 #define	CLKF_USERMODE(frame)	(((frame)->cf_srr1 & PSL_PR) != 0)
 #define	CLKF_PC(frame)		((frame)->cf_srr0)
 #define	CLKF_INTR(frame)	((frame)->cf_idepth > 0)



CVS commit: src/usr.bin/netstat

2011-05-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed May  4 03:43:30 UTC 2011

Modified Files:
src/usr.bin/netstat: vtw.c

Log Message:
Use %zx for _both_ size_t formats!


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/netstat/vtw.c

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

Modified files:

Index: src/usr.bin/netstat/vtw.c
diff -u src/usr.bin/netstat/vtw.c:1.3 src/usr.bin/netstat/vtw.c:1.4
--- src/usr.bin/netstat/vtw.c:1.3	Wed May  4 01:31:40 2011
+++ src/usr.bin/netstat/vtw.c	Wed May  4 03:43:30 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vtw.c,v 1.3 2011/05/04 01:31:40 dyoung Exp $	*/
+/*	$NetBSD: vtw.c,v 1.4 2011/05/04 03:43:30 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 #if 0
 static char sccsid[] = "from: @(#)inet.c	8.4 (Berkeley) 4/20/94";
 #else
-__RCSID("$NetBSD: vtw.c,v 1.3 2011/05/04 01:31:40 dyoung Exp $");
+__RCSID("$NetBSD: vtw.c,v 1.4 2011/05/04 03:43:30 pgoyette Exp $");
 #endif
 #endif /* not lint */
 
@@ -130,7 +130,7 @@
 	cc = kvm_read(get_kvmd(), (unsigned long) addr, buf, len);
 
 	if (cc != len) {
-		warnx("%s: short read at %p, len %x cc %zx\n", __func__, addr,
+		warnx("%s: short read at %p, len %zx cc %zx\n", __func__, addr,
 		len, cc);
 	}
 }



CVS commit: src/sys/netinet6

2011-05-03 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed May  4 01:45:48 UTC 2011

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

Log Message:
Invalidate the vestigital PCB at the top of in6_pcblookup_connect() to
fix the bug where incoming TCPv6 connections were reset.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/netinet6/in6_pcb.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_pcb.c
diff -u src/sys/netinet6/in6_pcb.c:1.113 src/sys/netinet6/in6_pcb.c:1.114
--- src/sys/netinet6/in6_pcb.c:1.113	Tue May  3 18:28:45 2011
+++ src/sys/netinet6/in6_pcb.c	Wed May  4 01:45:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_pcb.c,v 1.113 2011/05/03 18:28:45 dyoung Exp $	*/
+/*	$NetBSD: in6_pcb.c,v 1.114 2011/05/04 01:45:48 dyoung Exp $	*/
 /*	$KAME: in6_pcb.c,v 1.84 2001/02/08 18:02:08 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.113 2011/05/03 18:28:45 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.114 2011/05/04 01:45:48 dyoung Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -1121,6 +1121,9 @@
 	struct in6pcb *in6p;
 	u_int16_t fport = fport_arg, lport = lport_arg;
 
+	if (vp)
+		vp->valid = 0;
+
 	head = IN6PCBHASH_CONNECT(table, faddr6, fport, laddr6, lport);
 	LIST_FOREACH(inph, head, inph_hash) {
 		in6p = (struct in6pcb *)inph;



CVS commit: src/usr.bin/netstat

2011-05-03 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed May  4 01:31:40 UTC 2011

Modified Files:
src/usr.bin/netstat: vtw.c

Log Message:
On second thought, make a more conservative change: use %zx instead of
%x for size_t.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/netstat/vtw.c

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

Modified files:

Index: src/usr.bin/netstat/vtw.c
diff -u src/usr.bin/netstat/vtw.c:1.2 src/usr.bin/netstat/vtw.c:1.3
--- src/usr.bin/netstat/vtw.c:1.2	Wed May  4 01:30:01 2011
+++ src/usr.bin/netstat/vtw.c	Wed May  4 01:31:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vtw.c,v 1.2 2011/05/04 01:30:01 dyoung Exp $	*/
+/*	$NetBSD: vtw.c,v 1.3 2011/05/04 01:31:40 dyoung Exp $	*/
 
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 #if 0
 static char sccsid[] = "from: @(#)inet.c	8.4 (Berkeley) 4/20/94";
 #else
-__RCSID("$NetBSD: vtw.c,v 1.2 2011/05/04 01:30:01 dyoung Exp $");
+__RCSID("$NetBSD: vtw.c,v 1.3 2011/05/04 01:31:40 dyoung Exp $");
 #endif
 #endif /* not lint */
 
@@ -130,7 +130,7 @@
 	cc = kvm_read(get_kvmd(), (unsigned long) addr, buf, len);
 
 	if (cc != len) {
-		warnx("%s: short read at %p, len %x cc %zu\n", __func__, addr,
+		warnx("%s: short read at %p, len %x cc %zx\n", __func__, addr,
 		len, cc);
 	}
 }



CVS commit: src/usr.bin/netstat

2011-05-03 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed May  4 01:30:01 UTC 2011

Modified Files:
src/usr.bin/netstat: vtw.c

Log Message:
Use %zu format for size_t instead of %x.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/netstat/vtw.c

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

Modified files:

Index: src/usr.bin/netstat/vtw.c
diff -u src/usr.bin/netstat/vtw.c:1.1 src/usr.bin/netstat/vtw.c:1.2
--- src/usr.bin/netstat/vtw.c:1.1	Tue May  3 18:28:46 2011
+++ src/usr.bin/netstat/vtw.c	Wed May  4 01:30:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vtw.c,v 1.1 2011/05/03 18:28:46 dyoung Exp $	*/
+/*	$NetBSD: vtw.c,v 1.2 2011/05/04 01:30:01 dyoung Exp $	*/
 
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 #if 0
 static char sccsid[] = "from: @(#)inet.c	8.4 (Berkeley) 4/20/94";
 #else
-__RCSID("$NetBSD: vtw.c,v 1.1 2011/05/03 18:28:46 dyoung Exp $");
+__RCSID("$NetBSD: vtw.c,v 1.2 2011/05/04 01:30:01 dyoung Exp $");
 #endif
 #endif /* not lint */
 
@@ -130,7 +130,7 @@
 	cc = kvm_read(get_kvmd(), (unsigned long) addr, buf, len);
 
 	if (cc != len) {
-		warnx("%s: short read at %p, len %x cc %x\n", __func__, addr,
+		warnx("%s: short read at %p, len %x cc %zu\n", __func__, addr,
 		len, cc);
 	}
 }



CVS commit: src/usr.bin/netstat

2011-05-03 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed May  4 01:13:35 UTC 2011

Modified Files:
src/usr.bin/netstat: main.c

Log Message:
Always try to open kmem, do not always set use_sysctl to 1, and do not
fail if opening kmem fails unless !use_sysctl.  Fixes netstat(1) options
such as -s.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/usr.bin/netstat/main.c

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

Modified files:

Index: src/usr.bin/netstat/main.c
diff -u src/usr.bin/netstat/main.c:1.78 src/usr.bin/netstat/main.c:1.79
--- src/usr.bin/netstat/main.c:1.78	Tue May  3 18:28:46 2011
+++ src/usr.bin/netstat/main.c	Wed May  4 01:13:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.78 2011/05/03 18:28:46 dyoung Exp $	*/
+/*	$NetBSD: main.c,v 1.79 2011/05/04 01:13:35 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "from: @(#)main.c	8.4 (Berkeley) 3/1/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.78 2011/05/03 18:28:46 dyoung Exp $");
+__RCSID("$NetBSD: main.c,v 1.79 2011/05/04 01:13:35 dyoung Exp $");
 #endif
 #endif /* not lint */
 
@@ -348,9 +348,9 @@
 static struct protox *name2protox __P((const char *));
 static struct protox *knownname __P((const char *));
 static void prepare(const char *, const char *, struct protox *tp);
-static kvm_t *prepare_kvmd(const char *, const char *);
+static kvm_t *prepare_kvmd(const char *, const char *, char *);
 
-kvm_t *kvmd = NULL;
+static kvm_t *kvmd = NULL;
 gid_t egid;
 int interval;	/* repeat interval for i/f stats */
 static const char *nlistf = NULL, *memf = NULL;
@@ -358,27 +358,30 @@
 kvm_t *
 get_kvmd(void)
 {
-	return prepare_kvmd(nlistf, memf);
+	char buf[_POSIX2_LINE_MAX];
+
+	if (kvmd != NULL)
+		return kvmd;
+	if ((kvmd = prepare_kvmd(nlistf, memf, buf)) == NULL)
+		err(1, "kvm error: %s", buf);
+	return kvmd;
 }
 
 static kvm_t *
-prepare_kvmd(const char *nf, const char *mf)
+prepare_kvmd(const char *nf, const char *mf, char *errbuf)
 {
-	char buf[_POSIX2_LINE_MAX];
+	kvm_t *k;
 
-	if (kvmd != NULL)
-		return kvmd;
 	(void)setegid(egid);
-	kvmd = kvm_openfiles(nf, mf, NULL, O_RDONLY, buf);
+	k = kvm_openfiles(nf, mf, NULL, O_RDONLY, errbuf);
 	(void)setgid(getgid());
-	if (kvmd == NULL)
-		err(1, "kvm error: %s", buf);
-	return kvmd;
+	return k;
 }
 
 void
 prepare(const char *nf, const char *mf, struct protox *tp)
 {
+	char buf[_POSIX2_LINE_MAX];
 	/*
 	 * Try to figure out if we can use sysctl or not.
 	 */
@@ -389,7 +392,7 @@
 
 		/* If we have -M and -N, we're not dealing with live memory. */
 		use_sysctl = 0;
-	} else if (true || qflag ||
+	} else if (qflag ||
 		   rflag ||
 		   iflag ||
 #ifndef SMALL
@@ -415,9 +418,12 @@
 		use_sysctl = 1;
 	}
 
+	kvmd = prepare_kvmd(nf, mf, buf);
+
 	if (!use_sysctl) {
-		kvmd = prepare_kvmd(nf, mf);
 
+		if (kvmd == NULL)
+			err(1, "kvm error: %s", buf);
 		if (kvm_nlist(kvmd, nl) < 0 || nl[0].n_type == 0) {
 			if (nf)
 errx(1, "%s: no namelist", nf);



CVS commit: src/usr.bin/netstat

2011-05-03 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed May  4 01:11:29 UTC 2011

Modified Files:
src/usr.bin/netstat: unix.c

Log Message:
Access the kvm_t using get_kvmd(), only.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/netstat/unix.c

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

Modified files:

Index: src/usr.bin/netstat/unix.c
diff -u src/usr.bin/netstat/unix.c:1.31 src/usr.bin/netstat/unix.c:1.32
--- src/usr.bin/netstat/unix.c:1.31	Mon Dec 13 21:15:30 2010
+++ src/usr.bin/netstat/unix.c	Wed May  4 01:11:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: unix.c,v 1.31 2010/12/13 21:15:30 pooka Exp $	*/
+/*	$NetBSD: unix.c,v 1.32 2011/05/04 01:11:29 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "from: @(#)unix.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: unix.c,v 1.31 2010/12/13 21:15:30 pooka Exp $");
+__RCSID("$NetBSD: unix.c,v 1.32 2011/05/04 01:11:29 dyoung Exp $");
 #endif
 #endif /* not lint */
 
@@ -73,7 +73,6 @@
 
 static struct	file *file, *fileNFILE;
 static int	ns_nfiles;
-extern	kvm_t *kvmd;
 
 static void
 unixdomainprhdr(void)
@@ -210,9 +209,9 @@
 			goto again;
 		}
 	} else {
-		filebuf = (char *)kvm_getfiles(kvmd, KERN_FILE, 0, &ns_nfiles);
+		filebuf = (char *)kvm_getfiles(get_kvmd(), KERN_FILE, 0, &ns_nfiles);
 		if (filebuf == 0) {
-			printf("file table read error: %s", kvm_geterr(kvmd));
+			printf("file table read error: %s", kvm_geterr(get_kvmd()));
 			return;
 		}
 		file = (struct file *)(filebuf + sizeof(fp));



CVS commit: src/usr.bin/netstat

2011-05-03 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed May  4 00:55:20 UTC 2011

Modified Files:
src/usr.bin/netstat: inet6.c

Log Message:
Don't use type qualifier 'register'.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/usr.bin/netstat/inet6.c

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

Modified files:

Index: src/usr.bin/netstat/inet6.c
diff -u src/usr.bin/netstat/inet6.c:1.55 src/usr.bin/netstat/inet6.c:1.56
--- src/usr.bin/netstat/inet6.c:1.55	Tue May  3 23:36:26 2011
+++ src/usr.bin/netstat/inet6.c	Wed May  4 00:55:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: inet6.c,v 1.55 2011/05/03 23:36:26 dyoung Exp $	*/
+/*	$NetBSD: inet6.c,v 1.56 2011/05/04 00:55:19 dyoung Exp $	*/
 /*	BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp	*/
 
 /*
@@ -64,7 +64,7 @@
 #if 0
 static char sccsid[] = "@(#)inet.c	8.4 (Berkeley) 4/20/94";
 #else
-__RCSID("$NetBSD: inet6.c,v 1.55 2011/05/03 23:36:26 dyoung Exp $");
+__RCSID("$NetBSD: inet6.c,v 1.56 2011/05/04 00:55:19 dyoung Exp $");
 #endif
 #endif /* not lint */
 
@@ -1123,7 +1123,7 @@
 icmp6_stats(u_long off, const char *name)
 {
 	uint64_t icmp6stat[ICMP6_NSTATS];
-	register int i, first;
+	int i, first;
 
 	if (use_sysctl) {
 		size_t size = sizeof(icmp6stat);
@@ -1386,7 +1386,7 @@
 char *
 inet6name(const struct in6_addr *in6p)
 {
-	register char *cp;
+	char *cp;
 	static char line[NI_MAXHOST];
 	struct hostent *hp;
 	static char domain[MAXHOSTNAMELEN + 1];



CVS commit: src/sys/netinet

2011-05-03 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue May  3 23:57:41 UTC 2011

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

Log Message:
Remove #ifdef INET6 throughout.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 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.h
diff -u src/sys/netinet/tcp_vtw.h:1.1 src/sys/netinet/tcp_vtw.h:1.2
--- src/sys/netinet/tcp_vtw.h:1.1	Tue May  3 18:28:45 2011
+++ src/sys/netinet/tcp_vtw.h	Tue May  3 23:57:41 2011
@@ -360,21 +360,17 @@
 int vtw_lookup_v4(const struct ip *ip, const struct tcphdr *th,
 		  uint32_t faddr, uint16_t fport,
 		  uint32_t laddr, uint16_t lport);
-#ifdef INET6
 struct ip6_hdr;
 struct in6_addr;
 
 int vtw_lookup_v6(const struct ip6_hdr *ip, const struct tcphdr *th,
 		  const struct in6_addr *faddr, uint16_t fport,
 		  const struct in6_addr *laddr, uint16_t lport);
-#endif
 
 typedef struct vestigial_inpcb {
 	union {
 		struct in_addr	v4;
-#ifdef INET6
 		struct in6_addr	v6;
-#endif
 	} faddr, laddr;
 	uint16_t		fport, lport;
 	uint32_t		valid		: 1;
@@ -401,9 +397,7 @@
 	uint16_t	sin_port;
 	union {
 		struct in_addr	v4;
-#ifdef INET6
 		struct in6_addr	v6;
-#endif
 	}		sin_addr;
 } sin_either_t;
 



CVS commit: src/usr.bin/netstat

2011-05-03 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue May  3 23:36:26 UTC 2011

Modified Files:
src/usr.bin/netstat: inet.c inet6.c

Log Message:
Do not display expired or reclaimed vestigial TIME_WAIT entries.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/usr.bin/netstat/inet.c
cvs rdiff -u -r1.54 -r1.55 src/usr.bin/netstat/inet6.c

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

Modified files:

Index: src/usr.bin/netstat/inet.c
diff -u src/usr.bin/netstat/inet.c:1.96 src/usr.bin/netstat/inet.c:1.97
--- src/usr.bin/netstat/inet.c:1.96	Tue May  3 18:28:46 2011
+++ src/usr.bin/netstat/inet.c	Tue May  3 23:36:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: inet.c,v 1.96 2011/05/03 18:28:46 dyoung Exp $	*/
+/*	$NetBSD: inet.c,v 1.97 2011/05/03 23:36:26 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "from: @(#)inet.c	8.4 (Berkeley) 4/20/94";
 #else
-__RCSID("$NetBSD: inet.c,v 1.96 2011/05/03 18:28:46 dyoung Exp $");
+__RCSID("$NetBSD: inet.c,v 1.97 2011/05/03 23:36:26 dyoung Exp $");
 #endif
 #endif /* not lint */
 
@@ -162,14 +162,15 @@
 			   tcpstates[t_state]);
 	}
 	if (Vflag && expires != NULL) {
-		if (expires->tv_sec != 0 || expires->tv_usec != -1) {
+		if (expires->tv_sec == 0 && expires->tv_usec == -1)
+			printf(" reclaimed");
+		else {
 			struct timeval delta;
 
 			timersub(expires, &now, &delta);
 			printf(" %.3fms",
 			delta.tv_sec * 1000.0 + delta.tv_usec / 1000.0);
-		} else
-			printf(" expired");
+		}
 	}
 	putchar('\n');
 }
@@ -187,6 +188,7 @@
 	struct timeval delta;
 	struct in_addr la, fa;
 	char buf[2][32];
+	static const struct timeval zero = {.tv_sec = 0, .tv_usec = 0};
 
 	la.s_addr = v4->laddr;
 	fa.s_addr = v4->faddr;
@@ -197,14 +199,19 @@
 	timersub(&vtw->expire, &now, &delta);
 
 	if (vtw->expire.tv_sec == 0 && vtw->expire.tv_usec == -1) {
-		dbg_printf("%15.15s:%d %15.15s:%d expired\n"
+		dbg_printf("%15.15s:%d %15.15s:%d reclaimed\n"
 		,buf[0], ntohs(v4->lport)
 		,buf[1], ntohs(v4->fport));
 		if (!(Vflag && vflag))
 			return;
 	} else if (vtw->expire.tv_sec == 0)
 		return;
-	else {
+	else if (timercmp(&delta, &zero, <) && !(Vflag && vflag)) {
+		dbg_printf("%15.15s:%d %15.15s:%d expired\n"
+		,buf[0], ntohs(v4->lport)
+		,buf[1], ntohs(v4->fport));
+		return;
+	} else {
 		dbg_printf("%15.15s:%d %15.15s:%d expires in %.3fms\n"
 		,buf[0], ntohs(v4->lport)
 		,buf[1], ntohs(v4->fport)

Index: src/usr.bin/netstat/inet6.c
diff -u src/usr.bin/netstat/inet6.c:1.54 src/usr.bin/netstat/inet6.c:1.55
--- src/usr.bin/netstat/inet6.c:1.54	Tue May  3 18:28:46 2011
+++ src/usr.bin/netstat/inet6.c	Tue May  3 23:36:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: inet6.c,v 1.54 2011/05/03 18:28:46 dyoung Exp $	*/
+/*	$NetBSD: inet6.c,v 1.55 2011/05/03 23:36:26 dyoung Exp $	*/
 /*	BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp	*/
 
 /*
@@ -64,7 +64,7 @@
 #if 0
 static char sccsid[] = "@(#)inet.c	8.4 (Berkeley) 4/20/94";
 #else
-__RCSID("$NetBSD: inet6.c,v 1.54 2011/05/03 18:28:46 dyoung Exp $");
+__RCSID("$NetBSD: inet6.c,v 1.55 2011/05/03 23:36:26 dyoung Exp $");
 #endif
 #endif /* not lint */
 
@@ -217,14 +217,15 @@
 #endif
 	}
 	if (Vflag && expires != NULL) {
-		if (expires->tv_sec != 0 || expires->tv_usec != -1) {
+		if (expires->tv_sec == 0 && expires->tv_usec == -1)
+			printf(" reclaimed");
+		else {
 			struct timeval delta;
 
 			timersub(expires, &now, &delta);
 			printf(" %.3fms",
 			delta.tv_sec * 1000.0 + delta.tv_usec / 1000.0);
-		} else
-			printf(" expired");
+		}
 	}
 	putchar('\n');
 }
@@ -241,6 +242,7 @@
 	const vtw_v6_t *v6 = (const vtw_v6_t *)vtw;
 	struct timeval delta;
 	char buf[2][128];
+	static const struct timeval zero = {.tv_sec = 0, .tv_usec = 0};
 
 	inet_ntop(AF_INET6, &v6->laddr, buf[0], sizeof(buf[0]));
 	inet_ntop(AF_INET6, &v6->faddr, buf[1], sizeof(buf[1]));
@@ -248,14 +250,19 @@
 	timersub(&vtw->expire, &now, &delta);
 
 	if (vtw->expire.tv_sec == 0 && vtw->expire.tv_usec == -1) {
-		dbg_printf("%15.15s:%d %15.15s:%d expired\n"
+		dbg_printf("%15.15s:%d %15.15s:%d reclaimed\n"
 		,buf[0], ntohs(v6->lport)
 		,buf[1], ntohs(v6->fport));
 		if (!(Vflag && vflag))
 			return;
 	} else if (vtw->expire.tv_sec == 0)
 		return;
-	else {
+	else if (timercmp(&delta, &zero, <) && !(Vflag && vflag)) {
+		dbg_printf("%15.15s:%d %15.15s:%d expired\n"
+		,buf[0], ntohs(v6->lport)
+		,buf[1], ntohs(v6->fport));
+		return;
+	} else {
 		dbg_printf("%15.15s:%d %15.15s:%d expires in %.3fms\n"
 		,buf[0], ntohs(v6->lport)
 		,buf[1], ntohs(v6->fport)



CVS commit: src/sys/sys

2011-05-03 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Tue May  3 21:37:00 UTC 2011

Modified Files:
src/sys/sys: bitops.h

Log Message:
Use fls64() only for types strictly bigger than 4 bytes.

ok christos@. Will ask for a pull-up, using 64 bits ops even for 4-bytes
int's is plain overkill.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/sys/bitops.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/sys/bitops.h
diff -u src/sys/sys/bitops.h:1.7 src/sys/sys/bitops.h:1.8
--- src/sys/sys/bitops.h:1.7	Sun Mar 21 14:28:15 2010
+++ src/sys/sys/bitops.h	Tue May  3 21:36:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bitops.h,v 1.7 2010/03/21 14:28:15 christos Exp $	*/
+/*	$NetBSD: bitops.h,v 1.8 2011/05/03 21:36:59 jym Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2010 The NetBSD Foundation, Inc.
@@ -255,7 +255,7 @@
 	_ilog2_helper(_n,  2) \
 	_ilog2_helper(_n,  1) \
 	_ilog2_helper(_n,  0) \
-	-1) : ((sizeof(_n) >= 4 ? fls64(_n) : fls32(_n)) - 1) \
+	-1) : ((sizeof(_n) > 4 ? fls64(_n) : fls32(_n)) - 1) \
 )
 
 static __inline void



CVS commit: src/sys

2011-05-03 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue May  3 17:44:31 UTC 2011

Modified Files:
src/sys/netinet: in_proto.c ip_input.c ip_var.h tcp_subr.c tcp_var.h
src/sys/netinet6: frag6.c in6_proto.c ip6_var.h

Log Message:
*_drain() routines may be called with locks held, so instead of doing
any work in *_drain(), set a drain-needed flag.  Do the work in the
fasttimo handler.

Contributed by Coyote Point Systems, Inc.


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/netinet/in_proto.c
cvs rdiff -u -r1.294 -r1.295 src/sys/netinet/ip_input.c
cvs rdiff -u -r1.96 -r1.97 src/sys/netinet/ip_var.h
cvs rdiff -u -r1.239 -r1.240 src/sys/netinet/tcp_subr.c
cvs rdiff -u -r1.164 -r1.165 src/sys/netinet/tcp_var.h
cvs rdiff -u -r1.48 -r1.49 src/sys/netinet6/frag6.c
cvs rdiff -u -r1.90 -r1.91 src/sys/netinet6/in6_proto.c
cvs rdiff -u -r1.53 -r1.54 src/sys/netinet6/ip6_var.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/in_proto.c
diff -u src/sys/netinet/in_proto.c:1.100 src/sys/netinet/in_proto.c:1.101
--- src/sys/netinet/in_proto.c:1.100	Thu Mar 31 19:40:52 2011
+++ src/sys/netinet/in_proto.c	Tue May  3 17:44:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: in_proto.c,v 1.100 2011/03/31 19:40:52 dyoung Exp $	*/
+/*	$NetBSD: in_proto.c,v 1.101 2011/05/03 17:44:31 dyoung Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in_proto.c,v 1.100 2011/03/31 19:40:52 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_proto.c,v 1.101 2011/05/03 17:44:31 dyoung Exp $");
 
 #include "opt_mrouting.h"
 #include "opt_eon.h"			/* ISO CLNL over IP */
@@ -215,8 +215,9 @@
 {	.pr_domain = &inetdomain,
 	.pr_init = ip_init,
 	.pr_output = ip_output,
+	.pr_fasttimo = ip_fasttimo,
 	.pr_slowtimo = ip_slowtimo,
-	.pr_drain = ip_drain,
+	.pr_drain = ip_drainstub,
 },
 {	.pr_type = SOCK_DGRAM,
 	.pr_domain = &inetdomain,
@@ -237,8 +238,9 @@
 	.pr_ctloutput = tcp_ctloutput,
 	.pr_usrreq = tcp_usrreq,
 	.pr_init = tcp_init,
+	.pr_fasttimo = tcp_fasttimo,
 	.pr_slowtimo = tcp_slowtimo,
-	.pr_drain = tcp_drain,
+	.pr_drain = tcp_drainstub,
 },
 {	.pr_type = SOCK_RAW,
 	.pr_domain = &inetdomain,

Index: src/sys/netinet/ip_input.c
diff -u src/sys/netinet/ip_input.c:1.294 src/sys/netinet/ip_input.c:1.295
--- src/sys/netinet/ip_input.c:1.294	Thu Apr 14 20:32:04 2011
+++ src/sys/netinet/ip_input.c	Tue May  3 17:44:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_input.c,v 1.294 2011/04/14 20:32:04 dyoung Exp $	*/
+/*	$NetBSD: ip_input.c,v 1.295 2011/05/03 17:44:31 dyoung Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.294 2011/04/14 20:32:04 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.295 2011/05/03 17:44:31 dyoung Exp $");
 
 #include "opt_inet.h"
 #include "opt_compat_netbsd.h"
@@ -278,6 +278,8 @@
 	struct	in_addr route[MAX_IPOPTLEN/sizeof(struct in_addr)];
 } ip_srcrt;
 
+static int ip_drainwanted;
+
 static void save_rte(u_char *, struct in_addr);
 
 #ifdef MBUFTRACE
@@ -1282,6 +1284,21 @@
 	[PRC_PARAMPROB] = ENOPROTOOPT,
 };
 
+void
+ip_fasttimo(void)
+{
+	if (ip_drainwanted) {
+		ip_drain();
+		ip_drainwanted = 0;
+	}
+}
+
+void
+ip_drainstub(void)
+{
+	ip_drainwanted = 1;
+}
+
 /*
  * Forward a packet.  If some error occurs return the sender
  * an icmp packet.  Note we can't always generate a meaningful

Index: src/sys/netinet/ip_var.h
diff -u src/sys/netinet/ip_var.h:1.96 src/sys/netinet/ip_var.h:1.97
--- src/sys/netinet/ip_var.h:1.96	Fri Nov  5 00:21:51 2010
+++ src/sys/netinet/ip_var.h	Tue May  3 17:44:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_var.h,v 1.96 2010/11/05 00:21:51 rmind Exp $	*/
+/*	$NetBSD: ip_var.h,v 1.97 2011/05/03 17:44:31 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -185,6 +185,7 @@
 int	 ip_ctloutput(int, struct socket *, struct sockopt *);
 int	 ip_dooptions(struct mbuf *);
 void	 ip_drain(void);
+void	 ip_drainstub(void);
 void	 ip_forward(struct mbuf *, int);
 void	 ip_freemoptions(struct ip_moptions *);
 int	 ip_getmoptions(struct ip_moptions *, struct sockopt *);
@@ -206,6 +207,7 @@
 	   struct mbuf *);
 int	 ip_setmoptions(struct ip_moptions **, const struct sockopt *);
 void	 ip_slowtimo(void);
+void	 ip_fasttimo(void);
 struct mbuf *
 	 ip_srcroute(void);
 int	 ip_sysctl(int *, u_int, void *, size_t *, void *, size_t);

Index: src/sys/netinet/tcp_subr.c
diff -u src/sys/netinet/tcp_subr.c:1.239 src/sys/netinet/tcp_subr.c:1.240
--- src/sys/netinet/tcp_subr.c:1.239	Wed Apr 20 13:35:51 2011
+++ src/sys/netinet/tcp_subr.c	Tue May  3 17:44:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_subr.c,v 1.239 2011/04/20 13:35:51 gdt Exp $	*/
+/*	$NetBSD: tcp_subr.c,v 1.240 2011/05/03 17:44:31 dyoung Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 

CVS commit: src/share/man/man5

2011-05-03 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May  3 16:25:20 UTC 2011

Modified Files:
src/share/man/man5: daily.5 monthly.5 weekly.5

Log Message:
Fix PR bin/22230.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man5/daily.5 \
src/share/man/man5/monthly.5 src/share/man/man5/weekly.5

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/man5/daily.5
diff -u src/share/man/man5/daily.5:1.1 src/share/man/man5/daily.5:1.2
--- src/share/man/man5/daily.5:1.1	Tue May  3 16:12:23 2011
+++ src/share/man/man5/daily.5	Tue May  3 16:25:19 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: daily.5,v 1.1 2011/05/03 16:12:23 jruoho Exp $
+.\"	$NetBSD: daily.5,v 1.2 2011/05/03 16:25:19 jruoho Exp $
 .\"
 .\" Copyright (c) 1996 Matthew R. Green
 .\" All rights reserved.
@@ -24,23 +24,24 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd February 5, 2010
-.Dt DAILY.CONF 5
+.Dd May 3, 2011
+.Dt DAILY 5
 .Os
 .Sh NAME
+.Nm daily ,
 .Nm daily.conf
-.Nd daily maintenance configuration file
+.Nd daily maintenance
 .Sh DESCRIPTION
 The
-.Nm
-file specifies which of the standard
-.Pa /etc/daily
-services are performed.
-The
 .Pa /etc/daily
 script is run, by default, every night on a
 .Nx
 system.
+The
+.Pa /etc/daily.conf
+file specifies which of the standard
+.Nm
+services are performed.
 .Pp
 The variables described below can be set to
 .Dq YES
@@ -194,11 +195,11 @@
 .Pa /etc/daily
 .El
 .Sh SEE ALSO
-.Xr monthly.conf 5 ,
+.Xr monthly 5 ,
 .Xr security.conf 5 ,
-.Xr weekly.conf 5
+.Xr weekly 5
 .Sh HISTORY
 The
-.Nm
+.Pa /etc/daily.conf
 file appeared in
 .Nx 1.3 .
Index: src/share/man/man5/monthly.5
diff -u src/share/man/man5/monthly.5:1.1 src/share/man/man5/monthly.5:1.2
--- src/share/man/man5/monthly.5:1.1	Tue May  3 16:12:23 2011
+++ src/share/man/man5/monthly.5	Tue May  3 16:25:19 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: monthly.5,v 1.1 2011/05/03 16:12:23 jruoho Exp $
+.\"	$NetBSD: monthly.5,v 1.2 2011/05/03 16:25:19 jruoho Exp $
 .\"
 .\" Copyright (c) 1996 Matthew R. Green
 .\" All rights reserved.
@@ -24,18 +24,15 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd February 6, 2007
-.Dt MONTHLY.CONF 5
+.Dd May 3, 2011
+.Dt MONTHLY 5
 .Os
 .Sh NAME
+.Nm monthly ,
 .Nm monthly.conf
-.Nd monthly maintenance configuration file
+.Nd monthly maintenance
 .Sh DESCRIPTION
 The
-.Nm
-file specifies which of the standard
-.Pa /etc/monthly
-services are performed.  The
 .Pa /etc/monthly
 script is normally run in the morning of the 1st of every month, on a
 .Nx
@@ -43,6 +40,11 @@
 Note: this is disabled (commented out) in the default root's
 .Xr crontab 5
 file.
+The
+.Pa /etc/monthly.conf
+file specifies which of the standard
+.Nm
+services are performed.
 .Pp
 There are currently no monthly tasks.
 .Sh FILES
@@ -56,10 +58,10 @@
 .Pa /etc/monthly
 .El
 .Sh SEE ALSO
-.Xr daily.conf 5 ,
-.Xr weekly.conf 5
+.Xr daily 5 ,
+.Xr weekly 5
 .Sh HISTORY
 The
-.Nm
+.Pa /etc/monthly.conf
 file appeared in
 .Nx 1.3 .
Index: src/share/man/man5/weekly.5
diff -u src/share/man/man5/weekly.5:1.1 src/share/man/man5/weekly.5:1.2
--- src/share/man/man5/weekly.5:1.1	Tue May  3 16:12:23 2011
+++ src/share/man/man5/weekly.5	Tue May  3 16:25:19 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: weekly.5,v 1.1 2011/05/03 16:12:23 jruoho Exp $
+.\"	$NetBSD: weekly.5,v 1.2 2011/05/03 16:25:19 jruoho Exp $
 .\"
 .\" Copyright (c) 1996 Matthew R. Green
 .\" All rights reserved.
@@ -24,22 +24,24 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd February 15, 2007
-.Dt WEEKLY.CONF 5
+.Dd May 3, 2011
+.Dt WEEKLY 5
 .Os
 .Sh NAME
+.Nm weekly ,
 .Nm weekly.conf
-.Nd weekly maintenance configuration file
+.Nd weekly maintenance
 .Sh DESCRIPTION
 The
-.Nm
-file specifies which of the standard
-.Pa /etc/weekly
-services are performed.  The
 .Pa /etc/weekly
 script is run, by default, every Saturday morning on a
 .Nx
 system.
+The
+.Pa /etc/weekly.conf
+file specifies which of the standar
+.Nm
+services are performed.
 .Pp
 The variables described below can be set to
 .Dq YES
@@ -56,19 +58,22 @@
 directly, as it is often replaced during system upgrades.)
 .Bl -tag -width rebuild_locatedb
 .It Sy rebuild_locatedb
-This rebuilds the locate database,
+This rebuilds the
+.Xr locate 1
+database,
 .Pa /var/db/locate.database ,
 which must also exist, in order to be rebuilt.
 .It Sy rebuild_whatisdb
-This rebuilds the whatis database(s).
+This rebuilds the
+.Xr whatis 1
+database(s).
 Note that
 .Nx
 provides a default whatis.db for the system manual pages and
 this may not be needed.
 (Adjust your
 .Pa /etc/man.conf
-as necessary.
-See
+as necessary; see
 .Xr man.conf 5
 for details.)
 .El
@@ -87,6 +92,10 @@
 .Xr monthly.conf 5
 .Sh HISTORY
 The
-.Nm
-file appeared in
+.Pa /etc/weekly
+script

CVS commit: src

2011-05-03 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May  3 16:12:24 UTC 2011

Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man5: Makefile
Added Files:
src/share/man/man5: daily.5 monthly.5 weekly.5
Removed Files:
src/share/man/man5: daily.conf.5 monthly.conf.5 weekly.conf.5

Log Message:
Link {daily, monthly, weekly}.conf.5 to {daily, monthly, weekly}.5 and move
things around a little. Part of fixing PR bin/22230.


To generate a diff of this commit:
cvs rdiff -u -r1.1313 -r1.1314 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.66 -r1.67 src/share/man/man5/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man5/daily.5 \
src/share/man/man5/monthly.5 src/share/man/man5/weekly.5
cvs rdiff -u -r1.27 -r0 src/share/man/man5/daily.conf.5
cvs rdiff -u -r1.9 -r0 src/share/man/man5/monthly.conf.5
cvs rdiff -u -r1.10 -r0 src/share/man/man5/weekly.conf.5

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

Modified files:

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1313 src/distrib/sets/lists/man/mi:1.1314
--- src/distrib/sets/lists/man/mi:1.1313	Tue Apr 26 17:30:45 2011
+++ src/distrib/sets/lists/man/mi	Tue May  3 16:12:23 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1313 2011/04/26 17:30:45 joerg Exp $
+# $NetBSD: mi,v 1.1314 2011/05/03 16:12:23 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1839,6 +1839,7 @@
 ./usr/share/man/cat5/cidr_table.0		man-postfix-catman	postfix,.cat
 ./usr/share/man/cat5/core.0			man-sys-catman		.cat
 ./usr/share/man/cat5/crontab.0			man-cron-catman		.cat
+./usr/share/man/cat5/daily.0			man-sys-catman		.cat
 ./usr/share/man/cat5/daily.conf.0		man-sys-catman		.cat
 ./usr/share/man/cat5/dhclient.conf.0		man-dhclient-catman	.cat
 ./usr/share/man/cat5/dhclient.leases.0		man-dhclient-catman	.cat
@@ -1922,6 +1923,7 @@
 ./usr/share/man/cat5/master.passwd.0		man-sys-catman		.cat
 ./usr/share/man/cat5/mixerctl.conf.0		man-audio-catman	.cat
 ./usr/share/man/cat5/moduli.0			man-secsh-catman	crypto,.cat
+./usr/share/man/cat5/monthly.0			man-sys-catman		.cat
 ./usr/share/man/cat5/monthly.conf.0		man-sys-catman		.cat
 ./usr/share/man/cat5/motd.0			man-sys-catman		.cat
 ./usr/share/man/cat5/named.conf.0		man-bind-catman		.cat
@@ -2000,6 +2002,7 @@
 ./usr/share/man/cat5/veriexec.0			man-sys-catman		.cat
 ./usr/share/man/cat5/vgrindefs.0		man-groff-catman	.cat
 ./usr/share/man/cat5/virtual.0			man-postfix-catman	postfix,.cat
+./usr/share/man/cat5/weekly.0			man-sys-catman		.cat
 ./usr/share/man/cat5/weekly.conf.0		man-sys-catman		.cat
 ./usr/share/man/cat5/wpa_supplicant.conf.0	man-net-catman		.cat
 ./usr/share/man/cat5/wscons.conf.0		man-sys-catman		.cat
@@ -4540,6 +4543,7 @@
 ./usr/share/man/html5/cidr_table.html		man-postfix-htmlman	postfix,html
 ./usr/share/man/html5/core.html			man-sys-htmlman		html
 ./usr/share/man/html5/crontab.html		man-cron-htmlman	html
+./usr/share/man/html5/daily.html		man-sys-htmlman		html
 ./usr/share/man/html5/daily.conf.html		man-sys-htmlman		html
 ./usr/share/man/html5/dhclient.conf.html	man-dhclient-htmlman	html
 ./usr/share/man/html5/dhclient.leases.html	man-dhclient-htmlman	html
@@ -4616,6 +4620,7 @@
 ./usr/share/man/html5/master.passwd.html	man-sys-htmlman		html
 ./usr/share/man/html5/mixerctl.conf.html	man-audio-htmlman	html
 ./usr/share/man/html5/moduli.html		man-secsh-htmlman	crypto,html
+./usr/share/man/html5/monthly.html		man-sys-htmlman		html
 ./usr/share/man/html5/monthly.conf.html		man-sys-htmlman		html
 ./usr/share/man/html5/motd.html			man-sys-htmlman		html
 ./usr/share/man/html5/named.conf.html		man-bind-htmlman	html
@@ -4684,6 +4689,7 @@
 ./usr/share/man/html5/veriexec.html		man-sys-htmlman		html
 ./usr/share/man/html5/vgrindefs.html		man-groff-htmlman	html
 ./usr/share/man/html5/virtual.html		man-postfix-htmlman	postfix,html
+./usr/share/man/html5/weekly.html		man-sys-htmlman		html
 ./usr/share/man/html5/weekly.conf.html		man-sys-htmlman		html
 ./usr/share/man/html5/wpa_supplicant.conf.html	man-net-htmlman		html
 ./usr/share/man/html5/wscons.conf.html		man-sys-htmlman		html
@@ -7178,6 +7184,7 @@
 ./usr/share/man/man5/cidr_table.5		man-postfix-man		postfix,.man
 ./usr/share/man/man5/core.5			man-sys-man		.man
 ./usr/share/man/man5/crontab.5			man-cron-man		.man
+./usr/share/man/man5/daily.5			man-sys-man		.man
 ./usr/share/man/man5/daily.conf.5		man-sys-man		.man
 ./usr/share/man/man5/dhclient.conf.5		man-dhclient-man	.man
 ./usr/share/man/man5/dhclient.leases.5		man-dhclient-man	.man
@@ -7261,6 +7268,7 @@
 ./usr/share/man/man5/master.passwd.5		man-sys-man		.man
 ./usr/share/man/man5/mixerctl.conf.5		man-audio-man		.man
 ./usr/share/man/man5/moduli.5			man-secsh-man		crypto,.man
+./usr/share/man/man5/monthly.5			man-sys-man		.man
 ./usr/share/man/man5/monthly.conf.5		man-sys-man		.man
 ./usr/share/man/man5/motd.5			man-sys-man		.man
 ./usr/share/man/man5/named.con

CVS commit: src/sys/netinet

2011-05-03 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue May  3 16:00:30 UTC 2011

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

Log Message:
arp_drain() may be called with locks held, so instead of doing any work
in arp_drain(), set a drain-needed flag.  Do the work in the fasttimo
handler.

Contributed by Coyote Point Systems, Inc.


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.151 src/sys/netinet/if_arp.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/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.150 src/sys/netinet/if_arp.c:1.151
--- src/sys/netinet/if_arp.c:1.150	Tue Feb  1 01:39:21 2011
+++ src/sys/netinet/if_arp.c	Tue May  3 16:00:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.150 2011/02/01 01:39:21 matt Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.151 2011/05/03 16:00:29 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.150 2011/02/01 01:39:21 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.151 2011/05/03 16:00:29 dyoung Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -151,6 +151,7 @@
 static	struct llinfo_arp *arplookup(struct mbuf *, const struct in_addr *,
 	  int, int);
 static	void in_arpinput(struct mbuf *);
+static	void arp_drainstub(void);
 
 LIST_HEAD(, llinfo_arp) llinfo_arp;
 struct	ifqueue arpintrq = {
@@ -188,6 +189,8 @@
 static int db_show_rtentry(struct rtentry *, void *);
 #endif
 
+static int arp_drainwanted;
+
 /*
  * this should be elsewhere.
  */
@@ -224,6 +227,15 @@
 
 DOMAIN_DEFINE(arpdomain);	/* forward declare and add to link set */
 
+static void
+arp_fasttimo(void)
+{
+	if (arp_drainwanted) {
+		arp_drain();
+		arp_drainwanted = 0;
+	}
+}
+
 const struct protosw arpsw[] = {
 	{ .pr_type = 0,
 	  .pr_domain = &arpdomain,
@@ -235,9 +247,9 @@
 	  .pr_ctloutput = 0,
 	  .pr_usrreq =  0,
 	  .pr_init = arp_init,
-	  .pr_fasttimo = 0,
+	  .pr_fasttimo = arp_fasttimo,
 	  .pr_slowtimo = 0,
-	  .pr_drain = arp_drain,
+	  .pr_drain = arp_drainstub,
 	}
 };
 
@@ -328,6 +340,12 @@
 	arpstat_percpu = percpu_alloc(sizeof(uint64_t) * ARP_NSTATS);
 }
 
+static void
+arp_drainstub(void)
+{
+	arp_drainwanted = 1;
+}
+
 /*
  * ARP protocol drain routine.  Called when memory is in short supply.
  * Called at splvm();  don't acquire softnet_lock as can be called from



CVS commit: src

2011-05-03 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May  3 15:13:51 UTC 2011

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/tests/usr.bin: Makefile
Added Files:
src/tests/usr.bin/diff: Makefile d_mallocv1.in d_mallocv2.in t_diff.sh

Log Message:
Add a test case for PR bin/26453.


To generate a diff of this commit:
cvs rdiff -u -r1.325 -r1.326 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.45 -r1.46 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/diff/Makefile \
src/tests/usr.bin/diff/d_mallocv1.in src/tests/usr.bin/diff/d_mallocv2.in \
src/tests/usr.bin/diff/t_diff.sh

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.325 src/distrib/sets/lists/tests/mi:1.326
--- src/distrib/sets/lists/tests/mi:1.325	Tue May  3 08:36:15 2011
+++ src/distrib/sets/lists/tests/mi	Tue May  3 15:13:51 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.325 2011/05/03 08:36:15 jruoho Exp $
+# $NetBSD: mi,v 1.326 2011/05/03 15:13:51 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2311,6 +2311,11 @@
 ./usr/tests/toolchain/cc/t_hello		tests-syscall-tests	atf
 ./usr/tests/usr.bintests-util-tests
 ./usr/tests/usr.bin/Atffile			tests-sbin-tests	atf
+./usr/tests/usr.bin/diff			tests-util-tests
+./usr/tests/usr.bin/diff/Atffile		tests-util-tests	atf
+./usr/tests/usr.bin/diff/d_mallocv1.in		tests-util-tests	atf
+./usr/tests/usr.bin/diff/d_mallocv2.in		tests-util-tests	atf
+./usr/tests/usr.bin/diff/t_diff			tests-util-tests	atf
 ./usr/tests/usr.bin/prtests-util-tests
 ./usr/tests/usr.bin/pr/Atffile			tests-util-tests	atf
 ./usr/tests/usr.bin/pr/d_basic.in		tests-util-tests	atf

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.45 src/etc/mtree/NetBSD.dist.tests:1.46
--- src/etc/mtree/NetBSD.dist.tests:1.45	Tue May  3 08:36:15 2011
+++ src/etc/mtree/NetBSD.dist.tests	Tue May  3 15:13:50 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.45 2011/05/03 08:36:15 jruoho Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.46 2011/05/03 15:13:50 jruoho Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -238,6 +238,7 @@
 ./usr/tests/toolchain
 ./usr/tests/toolchain/cc
 ./usr/tests/usr.bin
+./usr/tests/usr.bin/diff
 ./usr/tests/usr.bin/pr
 ./usr/tests/usr.bin/rump_server
 ./usr/tests/usr.bin/shmif_dumpbus

Index: src/tests/usr.bin/Makefile
diff -u src/tests/usr.bin/Makefile:1.4 src/tests/usr.bin/Makefile:1.5
--- src/tests/usr.bin/Makefile:1.4	Tue May  3 08:36:15 2011
+++ src/tests/usr.bin/Makefile	Tue May  3 15:13:50 2011
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.4 2011/05/03 08:36:15 jruoho Exp $
+#	$NetBSD: Makefile,v 1.5 2011/05/03 15:13:50 jruoho Exp $
 #
 
 .include 
 
 TESTSDIR=   ${TESTSBASE}/usr.bin
 
-TESTS_SUBDIRS+= pr rump_server shmif_dumpbus unifdef
+TESTS_SUBDIRS+= diff pr rump_server shmif_dumpbus unifdef
 
 .include 

Added files:

Index: src/tests/usr.bin/diff/Makefile
diff -u /dev/null src/tests/usr.bin/diff/Makefile:1.1
--- /dev/null	Tue May  3 15:13:51 2011
+++ src/tests/usr.bin/diff/Makefile	Tue May  3 15:13:50 2011
@@ -0,0 +1,13 @@
+# $NetBSD: Makefile,v 1.1 2011/05/03 15:13:50 jruoho Exp $
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/usr.bin/diff
+
+TESTS_SH=	t_diff
+
+FILESDIR=	${TESTSDIR}
+FILES+=		d_mallocv1.in
+FILES+=		d_mallocv2.in
+
+.include 
Index: src/tests/usr.bin/diff/d_mallocv1.in
diff -u /dev/null src/tests/usr.bin/diff/d_mallocv1.in:1.1
--- /dev/null	Tue May  3 15:13:51 2011
+++ src/tests/usr.bin/diff/d_mallocv1.in	Tue May  3 15:13:50 2011
@@ -0,0 +1,5 @@
+18086b1e91f730facb2d6e1b
+c562653b24814eb3651b1e68301a3c14b96302bb
+6d017f7aef74662ed8dd51eef14281eaad223298db370bfaca
+30c04231cb3de404e4b8a5359a74066fd963291d7986be835834ab07870c097682a953bfff38784780eef844de47fb36c34f8e034c96cfa64d9cb5decee472138236e9fb79e9fe1fba6b7757b970f22477d167832206900473f09f3e8c822db6d9a8273340ed6743d99638d6cf192d821b6f33d23278b1a929f303a80865c426d01add11b2f2416babd13e70b44d8eeb731c09c7163af9d1a23cbe20ddb08b0f67ecaa2eed511263a67e9c12e59ef113f0b9e4e4e140b43896078a7571c61826ba099b3dd8c4b096a9785b4434e97ea99e662ba6fdb60a41547ccae4c67d3e1f3ef515198e91f009c75c9e80fda90d13ee29d8aad5d87cc2437ce60e6ce55700837fb0815bfd2495f8aa1a33fe67c1ae28a885506a78ca6257f5a5f2a8042e28680acc83b1aecb3a9cb51911126f2f0deaf14fcfa5f165e9a5c3f8f2d1c3f4683b2d75927a7bc802d63b680a5e22768cc0439854ccd49e58a002794f541bddd6ef6fbd4f9869843a72d0ae9d438c90353a46c0c9863a16b1de206c717ab7ce6ea6f648a38efa12b70bbe3388b35adec7a789ea98de217520d7d6ce699841e17e5946bf5a8b3c7a2c3e2d6767422baf3159ff08d913ec78011ab7d34bc24af26c24a8d46f7261c7705a7b270e27590c29583c659a0df8dada4e7a0532f115040165d18f74a55a4f39bb1dcfd865e94
a
+ 488ca910cc447e121b2a19450239e75d24
Index: src

CVS commit: src/tests/usr.bin/pr

2011-05-03 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May  3 14:26:11 UTC 2011

Modified Files:
src/tests/usr.bin/pr: t_basic.sh

Log Message:
Fix same copy-paste error here. (Why atf(7) does not warn about these?)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/pr/t_basic.sh

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

Modified files:

Index: src/tests/usr.bin/pr/t_basic.sh
diff -u src/tests/usr.bin/pr/t_basic.sh:1.1 src/tests/usr.bin/pr/t_basic.sh:1.2
--- src/tests/usr.bin/pr/t_basic.sh:1.1	Tue May  3 08:36:15 2011
+++ src/tests/usr.bin/pr/t_basic.sh	Tue May  3 14:26:11 2011
@@ -1,6 +1,6 @@
 #! /usr/bin/atf-sh
 #
-# $NetBSD: t_basic.sh,v 1.1 2011/05/03 08:36:15 jruoho Exp $
+# $NetBSD: t_basic.sh,v 1.2 2011/05/03 14:26:11 jruoho Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -31,7 +31,7 @@
 #
 
 atf_test_case basic
-nonexistent_head() {
+basic_head() {
 	atf_set "descr" "A basic test of pr(1)"
 }
 



CVS commit: src/tests/usr.bin

2011-05-03 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May  3 14:11:51 UTC 2011

Modified Files:
src/tests/usr.bin/pr: Makefile
src/tests/usr.bin/unifdef: Makefile

Log Message:
Fix build failure reported by pgoyette@.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/pr/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/unifdef/Makefile

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

Modified files:

Index: src/tests/usr.bin/pr/Makefile
diff -u src/tests/usr.bin/pr/Makefile:1.1 src/tests/usr.bin/pr/Makefile:1.2
--- src/tests/usr.bin/pr/Makefile:1.1	Tue May  3 08:36:15 2011
+++ src/tests/usr.bin/pr/Makefile	Tue May  3 14:11:51 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2011/05/03 08:36:15 jruoho Exp $
+# $NetBSD: Makefile,v 1.2 2011/05/03 14:11:51 jruoho Exp $
 
 .include 
 
@@ -6,4 +6,8 @@
 
 TESTS_SH=	t_basic
 
+FILESDIR=	${TESTSDIR}
+FILES+=		d_basic.in
+FILES+=		d_basic.out
+
 .include 

Index: src/tests/usr.bin/unifdef/Makefile
diff -u src/tests/usr.bin/unifdef/Makefile:1.1 src/tests/usr.bin/unifdef/Makefile:1.2
--- src/tests/usr.bin/unifdef/Makefile:1.1	Tue May  3 07:23:19 2011
+++ src/tests/usr.bin/unifdef/Makefile	Tue May  3 14:11:51 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2011/05/03 07:23:19 jruoho Exp $
+# $NetBSD: Makefile,v 1.2 2011/05/03 14:11:51 jruoho Exp $
 
 .include 
 
@@ -6,4 +6,8 @@
 
 TESTS_SH=	t_basic
 
+FILESDIR=	${TESTSDIR}
+FILES+=		d_basic.in
+FILES+=		d_basic.out
+
 .include 



CVS commit: src/lib/libperfuse

2011-05-03 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Tue May  3 13:19:50 UTC 2011

Modified Files:
src/lib/libperfuse: ops.c

Log Message:
Fixes for the advlock method. It can now sustain pkgsrc/devel/locktests
with glusterfs as backend


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/lib/libperfuse/ops.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/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.24 src/lib/libperfuse/ops.c:1.25
--- src/lib/libperfuse/ops.c:1.24	Mon Apr 25 04:54:53 2011
+++ src/lib/libperfuse/ops.c	Tue May  3 13:19:50 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.24 2011/04/25 04:54:53 manu Exp $ */
+/*  $NetBSD: ops.c,v 1.25 2011/05/03 13:19:50 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -2579,7 +2579,10 @@
 	int fop;
 	perfuse_msg_t *pm;
 	struct fuse_lk_in *fli;
+	struct fuse_out_header *foh;
 	struct fuse_lk_out *flo;
+	uint32_t owner;
+	size_t len;
 	int error;
 	
 	ps = puffs_getspecific(pu);
@@ -2599,6 +2602,8 @@
 	fli->lk.pid = fl->l_pid;
 	fli->lk_flags = (flags & F_FLOCK) ? FUSE_LK_FLOCK : 0;
 
+	owner = fl->l_pid;
+
 #ifdef PERFUSE_DEBUG
 	if (perfuse_diagflags & PDF_FH)
 		DPRINTF("%s: opc = %p, ino = %"PRId64", fh = 0x%"PRIx64"\n",
@@ -2606,27 +2611,48 @@
 			PERFUSE_NODE_DATA(opc)->pnd_ino, fli->fh);
 #endif
 
-	if ((error = xchg_msg(pu, opc, pm, sizeof(*flo), wait_reply)) != 0)
+	if ((error = xchg_msg(pu, opc, pm, UNSPEC_REPLY_LEN, wait_reply)) != 0)
 		goto out;
 
-	flo = GET_OUTPAYLOAD(ps, pm, fuse_lk_out);
-	fl->l_start = flo->lk.start;
-	fl->l_len = flo->lk.end - flo->lk.start;
-	fl->l_pid = flo->lk.pid;
-	fl->l_type = flo->lk.type;
-	fl->l_whence = SEEK_SET;	/* libfuse hardcodes it */
+	foh = GET_OUTHDR(ps, pm);
+	len = foh->len - sizeof(*foh);
 
 	/*
 	 * Save or clear the lock
 	 */
 	switch (op) {
-	case F_SETLK:
+	case F_GETLK:
+		if (len != sizeof(*flo))
+			DERRX(EX_SOFTWARE, 
+			  "%s: Unexpected lock reply len %zd",
+			  __func__, len);
+
+		flo = GET_OUTPAYLOAD(ps, pm, fuse_lk_out);
+		fl->l_start = flo->lk.start;
+		fl->l_len = flo->lk.end - flo->lk.start;
+		fl->l_pid = flo->lk.pid;
+		fl->l_type = flo->lk.type;
+		fl->l_whence = SEEK_SET;	/* libfuse hardcodes it */
+
 		PERFUSE_NODE_DATA(opc)->pnd_lock_owner = flo->lk.pid;
 		break;
 	case F_UNLCK:
-		PERFUSE_NODE_DATA(opc)->pnd_lock_owner = 0;
+		owner = 0;
+		/* FALLTHROUGH */
+	case F_SETLK: 
+		/* FALLTHROUGH */
+	case F_SETLKW: 
+		if (error != 0)
+			PERFUSE_NODE_DATA(opc)->pnd_lock_owner = owner;
+
+		if (len != 0)
+			DERRX(EX_SOFTWARE, 
+			  "%s: Unexpected unlock reply len %zd",
+			  __func__, len);
+
 		break;
 	default:
+		DERRX(EX_SOFTWARE, "%s: Unexpected op %d", __func__, op);
 		break;
 	}
 	



CVS commit: src

2011-05-03 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Tue May  3 13:16:47 UTC 2011

Modified Files:
src/lib/libpuffs: puffs.c
src/sys/fs/puffs: puffs_vnops.c

Log Message:
Call advlock method if supplied


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/lib/libpuffs/puffs.c
cvs rdiff -u -r1.150 -r1.151 src/sys/fs/puffs/puffs_vnops.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/libpuffs/puffs.c
diff -u src/lib/libpuffs/puffs.c:1.115 src/lib/libpuffs/puffs.c:1.116
--- src/lib/libpuffs/puffs.c:1.115	Mon Dec  6 14:50:34 2010
+++ src/lib/libpuffs/puffs.c	Tue May  3 13:16:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs.c,v 1.115 2010/12/06 14:50:34 pooka Exp $	*/
+/*	$NetBSD: puffs.c,v 1.116 2011/05/03 13:16:47 manu Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@
 
 #include 
 #if !defined(lint)
-__RCSID("$NetBSD: puffs.c,v 1.115 2010/12/06 14:50:34 pooka Exp $");
+__RCSID("$NetBSD: puffs.c,v 1.116 2011/05/03 13:16:47 manu Exp $");
 #endif /* !lint */
 
 #include 
@@ -98,6 +98,7 @@
 	FILLOP(print,PRINT);
 	FILLOP(read, READ);
 	FILLOP(write,WRITE);
+	FILLOP(advlock,  ADVLOCK);
 	FILLOP(abortop,  ABORTOP);
 	FILLOP(pathconf, PATHCONF);
 

Index: src/sys/fs/puffs/puffs_vnops.c
diff -u src/sys/fs/puffs/puffs_vnops.c:1.150 src/sys/fs/puffs/puffs_vnops.c:1.151
--- src/sys/fs/puffs/puffs_vnops.c:1.150	Tue Jan 11 14:04:54 2011
+++ src/sys/fs/puffs/puffs_vnops.c	Tue May  3 13:16:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_vnops.c,v 1.150 2011/01/11 14:04:54 kefren Exp $	*/
+/*	$NetBSD: puffs_vnops.c,v 1.151 2011/05/03 13:16:47 manu Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.150 2011/01/11 14:04:54 kefren Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.151 2011/05/03 13:16:47 manu Exp $");
 
 #include 
 #include 
@@ -125,7 +125,7 @@
 { &vop_getpages_desc, puffs_vnop_checkop },	/* getpages */
 { &vop_putpages_desc, genfs_putpages },		/* REAL putpages */
 { &vop_pathconf_desc, puffs_vnop_checkop },	/* pathconf */
-{ &vop_advlock_desc, puffs_vnop_advlock },	/* REAL advlock */
+{ &vop_advlock_desc, puffs_vnop_advlock },	/* advlock */
 { &vop_strategy_desc, puffs_vnop_strategy },	/* REAL strategy */
 { &vop_revoke_desc, genfs_revoke },		/* REAL revoke */
 { &vop_abortop_desc, puffs_vnop_abortop },	/* REAL abortop */
@@ -2108,10 +2108,28 @@
 		struct flock *a_fl;
 		int a_flags;
 	} */ *ap = v;
+	PUFFS_MSG_VARS(vn, advlock);
 	struct vnode *vp = ap->a_vp;
 	struct puffs_node *pn = VPTOPP(vp);
+	struct puffs_mount *pmp = MPTOPUFFSMP(vp->v_mount);
+	int error;
+
+	if (!EXISTSOP(pmp, ADVLOCK))
+		return lf_advlock(ap, &pn->pn_lockf, vp->v_size); 
+	
+	PUFFS_MSG_ALLOC(vn, advlock);
+	(void)memcpy(&advlock_msg->pvnr_fl, ap->a_fl, 
+		 sizeof(advlock_msg->pvnr_fl));
+	advlock_msg->pvnr_id = ap->a_id;
+	advlock_msg->pvnr_op = ap->a_op;
+	advlock_msg->pvnr_flags = ap->a_flags;
+	puffs_msg_setinfo(park_advlock, PUFFSOP_VN,
+	PUFFS_VN_ADVLOCK, VPTOPNC(vp));
+	PUFFS_MSG_ENQUEUEWAIT2(pmp, park_advlock, vp->v_data, NULL, error);
+	error = checkerr(pmp, error, __func__);
+	PUFFS_MSG_RELEASE(advlock);
 
-	return lf_advlock(ap, &pn->pn_lockf, vp->v_size);
+	return error;
 }
 
 int



CVS commit: src/lib/libperfuse

2011-05-03 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Tue May  3 13:14:10 UTC 2011

Modified Files:
src/lib/libperfuse: Makefile

Log Message:
Fix build (libperfuse is still not built by default, but time is coming)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libperfuse/Makefile

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

Modified files:

Index: src/lib/libperfuse/Makefile
diff -u src/lib/libperfuse/Makefile:1.1 src/lib/libperfuse/Makefile:1.2
--- src/lib/libperfuse/Makefile:1.1	Wed Aug 25 07:16:00 2010
+++ src/lib/libperfuse/Makefile	Tue May  3 13:14:09 2011
@@ -1,10 +1,13 @@
 LIB=perfuse
-LIBDPLIBS+= puffs	/usr/src/lib/libpuffs
+LIBDPLIBS+= puffs	${.CURDIR}/../libpuffs
 
 
 PERFUSE_OPT_DEBUG_FLAGS=   -g -DPERFUSE_DEBUG
 
 CFLAGS+=${PERFUSE_OPT_DEBUG_FLAGS}
+CPPFLAGS+=	-I${.CURDIR} 
+CPPFLAGS+=	-I${NETBSDSRCDIR}/lib/libpuffs 
+CPPFLAGS+=	-I${NETBSDSRCDIR}/sys -I${ARCHDIR} 
 SRCS=   perfuse.c ops.c subr.c debug.c
 MAN=		libperfuse.3
 WARNS=  4



CVS commit: src/crypto/external/bsd/openssh/dist

2011-05-03 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May  3 13:04:00 UTC 2011

Modified Files:
src/crypto/external/bsd/openssh/dist: sshd_config

Log Message:
Clarify the comment on how to disable password authentication (i.e. the
combination of PasswordAuthentication=no and UsePam=yes still allow password
authentication). Fixes PR bin/32313 from Curt Sampson.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/crypto/external/bsd/openssh/dist/sshd_config

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/sshd_config
diff -u src/crypto/external/bsd/openssh/dist/sshd_config:1.5 src/crypto/external/bsd/openssh/dist/sshd_config:1.6
--- src/crypto/external/bsd/openssh/dist/sshd_config:1.5	Sun Nov 21 18:59:04 2010
+++ src/crypto/external/bsd/openssh/dist/sshd_config	Tue May  3 13:04:00 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: sshd_config,v 1.5 2010/11/21 18:59:04 adam Exp $
+#	$NetBSD: sshd_config,v 1.6 2011/05/03 13:04:00 jruoho Exp $
 #	$OpenBSD: sshd_config,v 1.81 2009/10/08 14:03:41 markus Exp $
 
 # This is the sshd server system-wide configuration file.  See
@@ -54,7 +54,7 @@
 # Don't read the user's ~/.rhosts and ~/.shosts files
 #IgnoreRhosts yes
 
-# To disable tunneled clear text passwords, change to no here!
+# To disable password authentication, set this and UsePam to no
 #PasswordAuthentication yes
 #PermitEmptyPasswords no
 



CVS commit: src/tests/usr.bin/unifdef

2011-05-03 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May  3 12:54:48 UTC 2011

Modified Files:
src/tests/usr.bin/unifdef: t_basic.sh

Log Message:
Fix copy-paste error.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/unifdef/t_basic.sh

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

Modified files:

Index: src/tests/usr.bin/unifdef/t_basic.sh
diff -u src/tests/usr.bin/unifdef/t_basic.sh:1.1 src/tests/usr.bin/unifdef/t_basic.sh:1.2
--- src/tests/usr.bin/unifdef/t_basic.sh:1.1	Tue May  3 07:23:19 2011
+++ src/tests/usr.bin/unifdef/t_basic.sh	Tue May  3 12:54:48 2011
@@ -1,6 +1,6 @@
 #! /usr/bin/atf-sh
 #
-# $NetBSD: t_basic.sh,v 1.1 2011/05/03 07:23:19 jruoho Exp $
+# $NetBSD: t_basic.sh,v 1.2 2011/05/03 12:54:48 jruoho Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -31,7 +31,7 @@
 #
 
 atf_test_case basic
-nonexistent_head() {
+basic_head() {
 	atf_set "descr" "A basic test of unifdef(1)"
 }
 



CVS commit: src

2011-05-03 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue May  3 09:36:24 UTC 2011

Modified Files:
src/lib/libc/stdlib: div.3
src/share/man/man4: acpi.4

Log Message:
Remove \*[q] -- not necessary, just use plain double quotes instead.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/stdlib/div.3
cvs rdiff -u -r1.69 -r1.70 src/share/man/man4/acpi.4

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/stdlib/div.3
diff -u src/lib/libc/stdlib/div.3:1.13 src/lib/libc/stdlib/div.3:1.14
--- src/lib/libc/stdlib/div.3:1.13	Wed Apr 13 07:12:52 2011
+++ src/lib/libc/stdlib/div.3	Tue May  3 09:36:24 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: div.3,v 1.13 2011/04/13 07:12:52 jruoho Exp $
+.\"	$NetBSD: div.3,v 1.14 2011/05/03 09:36:24 wiz Exp $
 .\"
 .\" Copyright (c) 1990, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -76,7 +76,7 @@
 
 d = div(a, b);
 
-(void)printf(\*[q]%d %d\en\*[q], d.quot, d.rem);
+(void)printf("%d %d\en", d.quot, d.rem);
 .Ed
 .Sh SEE ALSO
 .Xr fast_divide32 3 ,

Index: src/share/man/man4/acpi.4
diff -u src/share/man/man4/acpi.4:1.69 src/share/man/man4/acpi.4:1.70
--- src/share/man/man4/acpi.4:1.69	Mon Jan 17 21:56:38 2011
+++ src/share/man/man4/acpi.4	Tue May  3 09:36:24 2011
@@ -1,4 +1,4 @@
-.\" $NetBSD: acpi.4,v 1.69 2011/01/17 21:56:38 jruoho Exp $
+.\" $NetBSD: acpi.4,v 1.70 2011/05/03 09:36:24 wiz Exp $
 .\"
 .\" Copyright (c) 2002, 2004, 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -31,14 +31,14 @@
 .Nm acpi
 .Nd Advanced Configuration and Power Interface
 .Sh SYNOPSIS
-.Cd "acpi0	at mainbus0"
+.Cd acpi0	at mainbus0
 .Pp
-.Cd "options	ACPI_DEBUG"
-.Cd "options	ACPIVERBOSE"
-.Cd "options	ACPI_ACTIVATE_DEV"
-.Cd "options	ACPI_DSDT_OVERRIDE"
-.Cd "options	ACPI_DSDT_FILE=\*[q]\*[q]"
-.Cd "options	ACPI_BLACKLIST_YEAR=2000"
+.Cd options	ACPI_DEBUG
+.Cd options	ACPIVERBOSE
+.Cd options	ACPI_ACTIVATE_DEV
+.Cd options	ACPI_DSDT_OVERRIDE
+.Cd options	ACPI_DSDT_FILE=""
+.Cd options	ACPI_BLACKLIST_YEAR=2000
 .Sh DESCRIPTION
 .Nx
 provides machine-independent bus support for



CVS commit: src/sys/arch/cobalt

2011-05-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue May  3 09:15:20 UTC 2011

Modified Files:
src/sys/arch/cobalt/cobalt: bus.c
src/sys/arch/cobalt/conf: GENERIC INSTALL RAMDISK majors.cobalt
src/sys/arch/cobalt/dev: panel.c
src/sys/arch/cobalt/include: cpu.h
src/sys/arch/cobalt/pci: pci_machdep.c

Log Message:
TAB/space cosmetics.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/cobalt/cobalt/bus.c
cvs rdiff -u -r1.129 -r1.130 src/sys/arch/cobalt/conf/GENERIC
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/cobalt/conf/INSTALL
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/cobalt/conf/RAMDISK
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/cobalt/conf/majors.cobalt
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/cobalt/dev/panel.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/cobalt/include/cpu.h
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/cobalt/pci/pci_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/cobalt/cobalt/bus.c
diff -u src/sys/arch/cobalt/cobalt/bus.c:1.39 src/sys/arch/cobalt/cobalt/bus.c:1.40
--- src/sys/arch/cobalt/cobalt/bus.c:1.39	Sun Feb 20 07:54:10 2011
+++ src/sys/arch/cobalt/cobalt/bus.c	Tue May  3 09:15:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.c,v 1.39 2011/02/20 07:54:10 matt Exp $	*/
+/*	$NetBSD: bus.c,v 1.40 2011/05/03 09:15:20 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.39 2011/02/20 07:54:10 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.40 2011/05/03 09:15:20 tsutsui Exp $");
 
 #include 
 #include 
@@ -683,6 +683,6 @@
 	rv = _bus_dmamem_mmap_common(t, segs, nsegs, off, prot, flags);
 	if (rv == (bus_addr_t)-1)
 		return (-1);
-	
+
 	return (mips_btop((char *)rv));
 }

Index: src/sys/arch/cobalt/conf/GENERIC
diff -u src/sys/arch/cobalt/conf/GENERIC:1.129 src/sys/arch/cobalt/conf/GENERIC:1.130
--- src/sys/arch/cobalt/conf/GENERIC:1.129	Sun Mar  6 17:08:21 2011
+++ src/sys/arch/cobalt/conf/GENERIC	Tue May  3 09:15:20 2011
@@ -1,7 +1,7 @@
-# $NetBSD: GENERIC,v 1.129 2011/03/06 17:08:21 bouyer Exp $
+# $NetBSD: GENERIC,v 1.130 2011/05/03 09:15:20 tsutsui Exp $
 #
 # GENERIC machine description file
-# 
+#
 # This machine description file is used to generate the default NetBSD
 # kernel.  The generic kernel does not include all options, subsystems
 # and device drivers, but should be useful for most applications.
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.129 $"
+#ident 		"GENERIC-$Revision: 1.130 $"
 
 maxusers	32
 
@@ -37,7 +37,7 @@
 #options	PIPE_SOCKETPAIR	# smaller, but slower pipe(2)
 options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel
 
-# Enable experimental buffer queue strategy for better responsiveness under 
+# Enable experimental buffer queue strategy for better responsiveness under
 # high disk I/O load. Use it with caution - it's not proven to be stable yet.
 #options 	BUFQ_READPRIO
 #options 	BUFQ_PRIOCSCAN

Index: src/sys/arch/cobalt/conf/INSTALL
diff -u src/sys/arch/cobalt/conf/INSTALL:1.43 src/sys/arch/cobalt/conf/INSTALL:1.44
--- src/sys/arch/cobalt/conf/INSTALL:1.43	Sun Mar  6 17:08:21 2011
+++ src/sys/arch/cobalt/conf/INSTALL	Tue May  3 09:15:20 2011
@@ -1,16 +1,16 @@
-# $NetBSD: INSTALL,v 1.43 2011/03/06 17:08:21 bouyer Exp $
+# $NetBSD: INSTALL,v 1.44 2011/05/03 09:15:20 tsutsui Exp $
 #
 # INSTALL -- installation and rescue kernel.
 #
 # This kernel should be derived from GENERIC with most features
 # commented out to shoehorn into Cobalt kernel size limitations.
-# 
+#
 
 include 	"arch/cobalt/conf/std.cobalt"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"INSTALL-$Revision: 1.43 $"
+#ident 		"INSTALL-$Revision: 1.44 $"
 
 makeoptions COPTS="-Os -mmemcpy"
 makeoptions	CPUFLAGS="-march=vr5000 -mabi=32"
@@ -32,7 +32,7 @@
 options 	PIPE_SOCKETPAIR	# smaller, but slower pipe(2)
 #options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel
 
-# Enable experimental buffer queue strategy for better responsiveness under 
+# Enable experimental buffer queue strategy for better responsiveness under
 # high disk I/O load. Use it with caution - it's not proven to be stable yet.
 #options 	BUFQ_READPRIO
 #options 	BUFQ_PRIOCSCAN

Index: src/sys/arch/cobalt/conf/RAMDISK
diff -u src/sys/arch/cobalt/conf/RAMDISK:1.4 src/sys/arch/cobalt/conf/RAMDISK:1.5
--- src/sys/arch/cobalt/conf/RAMDISK:1.4	Tue Nov 23 11:13:55 2010
+++ src/sys/arch/cobalt/conf/RAMDISK	Tue May  3 09:15:20 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: RAMDISK,v 1.4 2010/11/23 11:13:55 hannken Exp $
+#	$NetBSD: RAMDISK,v 1.5 2011/05/03 09:15:20 tsutsui Exp $
 #
 #	memory disk based configuration file
 #
@@ -14,4 +14,4 @@
 
 makeoptions	COPTS="-Os -mmemcpy"	# generates smaller code than -O2, -O1
 
-pseudo-device	md	
+pseudo-dev

CVS commit: src/usr.sbin/cpuctl/arch

2011-05-03 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May  3 09:06:22 UTC 2011

Modified Files:
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
Identify AMD Family 11h. From PR bin/41188 by FUKAUMI Naoki.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/cpuctl/arch/i386.c

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

Modified files:

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.24 src/usr.sbin/cpuctl/arch/i386.c:1.25
--- src/usr.sbin/cpuctl/arch/i386.c:1.24	Sat Feb 19 13:34:38 2011
+++ src/usr.sbin/cpuctl/arch/i386.c	Tue May  3 09:06:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.24 2011/02/19 13:34:38 jmcneill Exp $	*/
+/*	$NetBSD: i386.c,v 1.25 2011/05/03 09:06:22 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.24 2011/02/19 13:34:38 jmcneill Exp $");
+__RCSID("$NetBSD: i386.c,v 1.25 2011/05/03 09:06:22 jruoho Exp $");
 #endif /* not lint */
 
 #include 
@@ -967,6 +967,16 @@
 break;
 		}
 		break;
+	case 0x02:
+		switch (model) {
+			case 0x03:
+ret = "Family 11h";
+break;
+			default:
+ret = "Unknown AMD64 CPU";
+break;
+		}
+		break;
 	}
 
 	return ret;



CVS commit: src

2011-05-03 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May  3 08:36:15 UTC 2011

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/tests/usr.bin: Makefile
Added Files:
src/tests/usr.bin/pr: Makefile d_basic.in d_basic.out t_basic.sh

Log Message:
Add a test for PR bin/41880.


To generate a diff of this commit:
cvs rdiff -u -r1.324 -r1.325 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.44 -r1.45 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/pr/Makefile \
src/tests/usr.bin/pr/d_basic.in src/tests/usr.bin/pr/d_basic.out \
src/tests/usr.bin/pr/t_basic.sh

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.324 src/distrib/sets/lists/tests/mi:1.325
--- src/distrib/sets/lists/tests/mi:1.324	Tue May  3 07:56:42 2011
+++ src/distrib/sets/lists/tests/mi	Tue May  3 08:36:15 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.324 2011/05/03 07:56:42 jruoho Exp $
+# $NetBSD: mi,v 1.325 2011/05/03 08:36:15 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2304,16 +2304,21 @@
 ./usr/tests/syscall/t_setuid			tests-syscall-tests	atf
 ./usr/tests/syscall/t_timer			tests-syscall-tests	atf
 ./usr/tests/syscall/t_umask			tests-syscall-tests	atf
-./usr/tests/toolchain	tests-syscall-tests	atf
-./usr/tests/toolchain/Atffile	tests-syscall-tests	atf
-./usr/tests/toolchain/cc	tests-syscall-tests	atf
-./usr/tests/toolchain/cc/Atffile	tests-syscall-tests	atf
-./usr/tests/toolchain/cc/t_hello	tests-syscall-tests	atf
+./usr/tests/toolchaintests-syscall-tests	atf
+./usr/tests/toolchain/Atffile			tests-syscall-tests	atf
+./usr/tests/toolchain/cc			tests-syscall-tests	atf
+./usr/tests/toolchain/cc/Atffile		tests-syscall-tests	atf
+./usr/tests/toolchain/cc/t_hello		tests-syscall-tests	atf
 ./usr/tests/usr.bintests-util-tests
 ./usr/tests/usr.bin/Atffile			tests-sbin-tests	atf
+./usr/tests/usr.bin/prtests-util-tests
+./usr/tests/usr.bin/pr/Atffile			tests-util-tests	atf
+./usr/tests/usr.bin/pr/d_basic.in		tests-util-tests	atf
+./usr/tests/usr.bin/pr/d_basic.out		tests-util-tests	atf
+./usr/tests/usr.bin/pr/t_basic			tests-util-tests	atf
 ./usr/tests/usr.bin/rump_server			tests-util-tests
 ./usr/tests/usr.bin/rump_server/Atffile		tests-util-tests	atf
-./usr/tests/usr.bin/rump_server/t_disk	tests-util-tests	atf
+./usr/tests/usr.bin/rump_server/t_disk		tests-util-tests	atf
 ./usr/tests/usr.bintests-util-tests
 ./usr/tests/usr.bin/shmif_dumpbus			tests-util-tests
 ./usr/tests/usr.bin/shmif_dumpbus/Atffile		tests-util-tests	atf

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.44 src/etc/mtree/NetBSD.dist.tests:1.45
--- src/etc/mtree/NetBSD.dist.tests:1.44	Tue May  3 07:56:42 2011
+++ src/etc/mtree/NetBSD.dist.tests	Tue May  3 08:36:15 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.44 2011/05/03 07:56:42 jruoho Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.45 2011/05/03 08:36:15 jruoho Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -238,6 +238,7 @@
 ./usr/tests/toolchain
 ./usr/tests/toolchain/cc
 ./usr/tests/usr.bin
+./usr/tests/usr.bin/pr
 ./usr/tests/usr.bin/rump_server
 ./usr/tests/usr.bin/shmif_dumpbus
 ./usr/tests/usr.bin/unifdef

Index: src/tests/usr.bin/Makefile
diff -u src/tests/usr.bin/Makefile:1.3 src/tests/usr.bin/Makefile:1.4
--- src/tests/usr.bin/Makefile:1.3	Tue May  3 07:23:19 2011
+++ src/tests/usr.bin/Makefile	Tue May  3 08:36:15 2011
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.3 2011/05/03 07:23:19 jruoho Exp $
+#	$NetBSD: Makefile,v 1.4 2011/05/03 08:36:15 jruoho Exp $
 #
 
 .include 
 
 TESTSDIR=   ${TESTSBASE}/usr.bin
 
-TESTS_SUBDIRS+= rump_server shmif_dumpbus unifdef
+TESTS_SUBDIRS+= pr rump_server shmif_dumpbus unifdef
 
 .include 

Added files:

Index: src/tests/usr.bin/pr/Makefile
diff -u /dev/null src/tests/usr.bin/pr/Makefile:1.1
--- /dev/null	Tue May  3 08:36:16 2011
+++ src/tests/usr.bin/pr/Makefile	Tue May  3 08:36:15 2011
@@ -0,0 +1,9 @@
+# $NetBSD: Makefile,v 1.1 2011/05/03 08:36:15 jruoho Exp $
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/usr.bin/pr
+
+TESTS_SH=	t_basic
+
+.include 
Index: src/tests/usr.bin/pr/d_basic.in
diff -u /dev/null src/tests/usr.bin/pr/d_basic.in:1.1
--- /dev/null	Tue May  3 08:36:16 2011
+++ src/tests/usr.bin/pr/d_basic.in	Tue May  3 08:36:15 2011
@@ -0,0 +1,2 @@
+123 456 789
+abc def ghi
Index: src/tests/usr.bin/pr/d_basic.out
diff -u /dev/null src/tests/usr.bin/pr/d_basic.out:1.1
--- /dev/null	Tue May  3 08:36:16 2011
+++ src/tests/usr.bin/pr/d_basic.out	Tue May  3 08:36:15 2011
@@ -0,0 +1 @@
+123 456 789			abc def ghi
Index: src/tests/usr.bin/pr/t_basic.sh
diff -u /dev/null src/tests/usr.bin/pr/t_basic.sh:1.1
--- /dev/null	Tue May  3 08:36:16 2011
++

CVS commit: src/sys/dev/raidframe

2011-05-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue May  3 08:18:43 UTC 2011

Modified Files:
src/sys/dev/raidframe: rf_psstatus.c rf_psstatus.h rf_threadstuff.h

Log Message:
convert the pssTable mutex into a kmutex/cv.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/raidframe/rf_psstatus.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/raidframe/rf_psstatus.h
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/raidframe/rf_threadstuff.h

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

Modified files:

Index: src/sys/dev/raidframe/rf_psstatus.c
diff -u src/sys/dev/raidframe/rf_psstatus.c:1.33 src/sys/dev/raidframe/rf_psstatus.c:1.34
--- src/sys/dev/raidframe/rf_psstatus.c:1.33	Thu Nov 16 01:33:23 2006
+++ src/sys/dev/raidframe/rf_psstatus.c	Tue May  3 08:18:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_psstatus.c,v 1.33 2006/11/16 01:33:23 christos Exp $	*/
+/*	$NetBSD: rf_psstatus.c,v 1.34 2011/05/03 08:18:43 mrg Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_psstatus.c,v 1.33 2006/11/16 01:33:23 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_psstatus.c,v 1.34 2011/05/03 08:18:43 mrg Exp $");
 
 #include 
 
@@ -106,7 +106,8 @@
 		  raidPtr->pssTableSize * sizeof(RF_PSStatusHeader_t),
 		  (RF_PSStatusHeader_t *));
 	for (i = 0; i < raidPtr->pssTableSize; i++) {
-		rf_mutex_init(&pssTable[i].mutex);
+		rf_init_mutex2(pssTable[i].mutex, IPL_VM);
+		rf_init_cond2(pssTable[i].cond, "rfpsslk");
 	}
 	return (pssTable);
 }
@@ -115,9 +116,9 @@
 rf_FreeParityStripeStatusTable(RF_Raid_t *raidPtr,
 			   RF_PSStatusHeader_t *pssTable)
 {
-#if RF_DEBUG_PSS
 	int i;
 
+#if RF_DEBUG_PSS
 	if (rf_pssDebug)
 		RealPrintPSStatusTable(raidPtr, pssTable);
 
@@ -127,6 +128,10 @@
 		}
 	}
 #endif
+	for (i = 0; i < raidPtr->pssTableSize; i++) {
+		rf_destroy_mutex2(pssTable[i].mutex);
+		rf_destroy_cond2(pssTable[i].cond);
+	}
 	RF_Free(pssTable, raidPtr->pssTableSize * sizeof(RF_PSStatusHeader_t));
 }
 
@@ -219,12 +224,12 @@
 	RF_ReconParityStripeStatus_t *p, *pt;
 	RF_CallbackDesc_t *cb, *cb1;
 
-	RF_LOCK_MUTEX(hdr->mutex);
+	rf_lock_mutex2(hdr->mutex);
 	while(hdr->lock) {
-		ltsleep(&hdr->lock, PRIBIO, "rf_racrecon", 0, &hdr->mutex);
+		rf_wait_cond2(hdr->cond, hdr->mutex);
 	}
 	hdr->lock = 1;
-	RF_UNLOCK_MUTEX(hdr->mutex);
+	rf_unlock_mutex2(hdr->mutex);
 	for (pt = NULL, p = hdr->chain; p; pt = p, p = p->next) {
 		if ((p->parityStripeID == psid) && (p->which_ru == which_ru))
 			break;
@@ -243,9 +248,9 @@
 		hdr->chain = p->next;
 	p->next = NULL;
 
-	RF_LOCK_MUTEX(hdr->mutex);
+	rf_lock_mutex2(hdr->mutex);
 	hdr->lock = 0;
-	RF_UNLOCK_MUTEX(hdr->mutex);
+	rf_unlock_mutex2(hdr->mutex);
 
 	/* wakup anyone waiting on the parity stripe ID */
 	cb = p->procWaitList;

Index: src/sys/dev/raidframe/rf_psstatus.h
diff -u src/sys/dev/raidframe/rf_psstatus.h:1.13 src/sys/dev/raidframe/rf_psstatus.h:1.14
--- src/sys/dev/raidframe/rf_psstatus.h:1.13	Tue Feb 14 01:13:33 2006
+++ src/sys/dev/raidframe/rf_psstatus.h	Tue May  3 08:18:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_psstatus.h,v 1.13 2006/02/14 01:13:33 oster Exp $	*/
+/*	$NetBSD: rf_psstatus.h,v 1.14 2011/05/03 08:18:43 mrg Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -56,21 +56,20 @@
 #define RF_HASH_PSID(_raid_,_psid_) ( (_psid_) % ((_raid_)->pssTableSize) )	/* simple hash function */
 #define RF_LOCK_PSS_MUTEX(_raidPtr, _psid)  \
   do {  \
- RF_LOCK_MUTEX((_raidPtr)->reconControl->pssTable[ RF_HASH_PSID(_raidPtr,_psid) ].mutex);   \
+ rf_lock_mutex2((_raidPtr)->reconControl->pssTable[ RF_HASH_PSID(_raidPtr,_psid) ].mutex);  \
  while((_raidPtr)->reconControl->pssTable[ RF_HASH_PSID(_raidPtr,_psid) ].lock) {   \
-  ltsleep(&(_raidPtr)->reconControl->pssTable[ RF_HASH_PSID(_raidPtr,_psid) ].lock, \
-	  PRIBIO, "rflockpss", 0,   \
-	  &(_raidPtr)->reconControl->pssTable[ RF_HASH_PSID(_raidPtr,_psid) ].mutex);   \
+  rf_wait_cond2((_raidPtr)->reconControl->pssTable[ RF_HASH_PSID(_raidPtr,_psid) ].cond,\
+	(_raidPtr)->reconControl->pssTable[ RF_HASH_PSID(_raidPtr,_psid) ].mutex);\
  }  \
  (_raidPtr)->reconControl->pssTable[ RF_HASH_PSID(_raidPtr,_psid) ].lock = 1;   \
- RF_UNLOCK_MUTEX((_raidPtr)->reconControl->pssTable[ RF_HASH_PSID(_raidPtr,_psid) ].mutex); \
+ rf_unlock_mutex2((_raidPtr)->reconControl->pssTable[ RF_HASH_PSID(_raidPtr,_psid) ].mutex);\
   } while (0);
 
 #define R

CVS commit: src

2011-05-03 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May  3 07:56:42 UTC 2011

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/tests/sbin: Makefile
Added Files:
src/tests/sbin/route: Makefile t_missing.sh

Log Message:
A test for non-critical/low PR bin/42179.


To generate a diff of this commit:
cvs rdiff -u -r1.323 -r1.324 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.43 -r1.44 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.3 -r1.4 src/tests/sbin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/sbin/route/Makefile \
src/tests/sbin/route/t_missing.sh

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.323 src/distrib/sets/lists/tests/mi:1.324
--- src/distrib/sets/lists/tests/mi:1.323	Tue May  3 07:23:19 2011
+++ src/distrib/sets/lists/tests/mi	Tue May  3 07:56:42 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.323 2011/05/03 07:23:19 jruoho Exp $
+# $NetBSD: mi,v 1.324 2011/05/03 07:56:42 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2273,8 +2273,11 @@
 ./usr/tests/sbin/resize_ffs/t_shrink_swapped	tests-sbin-tests	atf
 ./usr/tests/sbin/resize_ffs/testdata.md5	tests-sbin-tests	atf
 ./usr/tests/sbin/resize_ffs/testdata.tar.gz.base64	tests-sbin-tests	atf
-./usr/tests/systests-sys-tests
-./usr/tests/sys/Atffile			tests-sys-tests	atf
+./usr/tests/sbin/routetests-sbin-tests
+./usr/tests/sbin/route/Atffile			tests-sbin-tests	atf
+./usr/tests/sbin/route/t_missing		tests-sbin-tests	atf
+./usr/tests/sys	tests-sys-tests
+./usr/tests/sys/Atffiletests-sys-tests	atf
 ./usr/tests/sys/rctests-sys-tests
 ./usr/tests/sys/rc/Atffile			tests-sys-tests	atf
 ./usr/tests/sys/rc/h_args			tests-sys-tests	atf

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.43 src/etc/mtree/NetBSD.dist.tests:1.44
--- src/etc/mtree/NetBSD.dist.tests:1.43	Tue May  3 07:23:19 2011
+++ src/etc/mtree/NetBSD.dist.tests	Tue May  3 07:56:42 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.43 2011/05/03 07:23:19 jruoho Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.44 2011/05/03 07:56:42 jruoho Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -231,6 +231,7 @@
 ./usr/tests/sbin/ifconfig
 ./usr/tests/sbin/newfs
 ./usr/tests/sbin/resize_ffs
+./usr/tests/sbin/route
 ./usr/tests/sys
 ./usr/tests/sys/rc
 ./usr/tests/syscall

Index: src/tests/sbin/Makefile
diff -u src/tests/sbin/Makefile:1.3 src/tests/sbin/Makefile:1.4
--- src/tests/sbin/Makefile:1.3	Tue May  3 06:13:06 2011
+++ src/tests/sbin/Makefile	Tue May  3 07:56:42 2011
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.3 2011/05/03 06:13:06 jruoho Exp $
+#	$NetBSD: Makefile,v 1.4 2011/05/03 07:56:42 jruoho Exp $
 #
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/sbin
 
-TESTS_SUBDIRS+=	fsck_ffs ifconfig newfs resize_ffs
+TESTS_SUBDIRS+=	fsck_ffs ifconfig newfs resize_ffs route
 
 .include 

Added files:

Index: src/tests/sbin/route/Makefile
diff -u /dev/null src/tests/sbin/route/Makefile:1.1
--- /dev/null	Tue May  3 07:56:42 2011
+++ src/tests/sbin/route/Makefile	Tue May  3 07:56:42 2011
@@ -0,0 +1,9 @@
+# $NetBSD: Makefile,v 1.1 2011/05/03 07:56:42 jruoho Exp $
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/sbin/route
+
+TESTS_SH=	t_missing
+
+.include 
Index: src/tests/sbin/route/t_missing.sh
diff -u /dev/null src/tests/sbin/route/t_missing.sh:1.1
--- /dev/null	Tue May  3 07:56:42 2011
+++ src/tests/sbin/route/t_missing.sh	Tue May  3 07:56:42 2011
@@ -0,0 +1,49 @@
+#! /usr/bin/atf-sh
+#
+# $NetBSD: t_missing.sh,v 1.1 2011/05/03 07:56:42 jruoho Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) H

CVS commit: src

2011-05-03 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue May  3 07:23:19 UTC 2011

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/tests/usr.bin: Makefile
Added Files:
src/tests/usr.bin/unifdef: Makefile d_basic.in d_basic.out t_basic.sh

Log Message:
Verify that PR bin/42628 is no longer an issue.


To generate a diff of this commit:
cvs rdiff -u -r1.322 -r1.323 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.42 -r1.43 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/unifdef/Makefile \
src/tests/usr.bin/unifdef/d_basic.in \
src/tests/usr.bin/unifdef/d_basic.out \
src/tests/usr.bin/unifdef/t_basic.sh

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.322 src/distrib/sets/lists/tests/mi:1.323
--- src/distrib/sets/lists/tests/mi:1.322	Tue May  3 06:13:06 2011
+++ src/distrib/sets/lists/tests/mi	Tue May  3 07:23:19 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.322 2011/05/03 06:13:06 jruoho Exp $
+# $NetBSD: mi,v 1.323 2011/05/03 07:23:19 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2320,6 +2320,11 @@
 ./usr/tests/usr.bin/shmif_dumpbus/d_pkthdrs.out.bz2.uue		tests-util-tests	atf
 ./usr/tests/usr.bin/shmif_dumpbus/shmbus.bz2.uue		tests-util-tests	atf
 ./usr/tests/usr.bin/shmif_dumpbus/t_basic		tests-util-tests	atf
+./usr/tests/usr.bin/unifdef			tests-util-tests
+./usr/tests/usr.bin/unifdef/Atffile		tests-util-tests	atf
+./usr/tests/usr.bin/unifdef/d_basic.in		tests-util-tests	atf
+./usr/tests/usr.bin/unifdef/d_basic.out		tests-util-tests	atf
+./usr/tests/usr.bin/unifdef/t_basic		tests-util-tests	atf
 ./usr/tests/usr.sbintests-util-tests
 ./usr/tests/usr.sbin/Atffile			tests-sbin-tests	atf
 ./usr/tests/usr.sbin/traceroute			tests-util-tests

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.42 src/etc/mtree/NetBSD.dist.tests:1.43
--- src/etc/mtree/NetBSD.dist.tests:1.42	Tue May  3 06:13:06 2011
+++ src/etc/mtree/NetBSD.dist.tests	Tue May  3 07:23:19 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.42 2011/05/03 06:13:06 jruoho Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.43 2011/05/03 07:23:19 jruoho Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -239,6 +239,7 @@
 ./usr/tests/usr.bin
 ./usr/tests/usr.bin/rump_server
 ./usr/tests/usr.bin/shmif_dumpbus
+./usr/tests/usr.bin/unifdef
 ./usr/tests/usr.sbin
 ./usr/tests/usr.sbin/traceroute
 ./usr/tests/util

Index: src/tests/usr.bin/Makefile
diff -u src/tests/usr.bin/Makefile:1.2 src/tests/usr.bin/Makefile:1.3
--- src/tests/usr.bin/Makefile:1.2	Thu Mar 10 11:13:33 2011
+++ src/tests/usr.bin/Makefile	Tue May  3 07:23:19 2011
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.2 2011/03/10 11:13:33 pooka Exp $
+#	$NetBSD: Makefile,v 1.3 2011/05/03 07:23:19 jruoho Exp $
 #
 
 .include 
 
 TESTSDIR=   ${TESTSBASE}/usr.bin
 
-TESTS_SUBDIRS+= rump_server shmif_dumpbus
+TESTS_SUBDIRS+= rump_server shmif_dumpbus unifdef
 
 .include 

Added files:

Index: src/tests/usr.bin/unifdef/Makefile
diff -u /dev/null src/tests/usr.bin/unifdef/Makefile:1.1
--- /dev/null	Tue May  3 07:23:19 2011
+++ src/tests/usr.bin/unifdef/Makefile	Tue May  3 07:23:19 2011
@@ -0,0 +1,9 @@
+# $NetBSD: Makefile,v 1.1 2011/05/03 07:23:19 jruoho Exp $
+
+.include 
+
+TESTSDIR=	${TESTSBASE}/usr.bin/unifdef
+
+TESTS_SH=	t_basic
+
+.include 
Index: src/tests/usr.bin/unifdef/d_basic.in
diff -u /dev/null src/tests/usr.bin/unifdef/d_basic.in:1.1
--- /dev/null	Tue May  3 07:23:19 2011
+++ src/tests/usr.bin/unifdef/d_basic.in	Tue May  3 07:23:19 2011
@@ -0,0 +1,25 @@
+#if defined(__FreeBSD__)
+#include 
+#else
+#include 
+#endif
+
+#if defined(__FreeBSD__)
+	#include 
+		#include 
+			#include 
+			#include 
+		#include 
+	#include 
+#else
+#include 
+#endif
+
+#if defined(__FreeBSD__)
+#endif
+
+#ifdef __FreeBSD__
+#include 
+#else
+#include 
+#endif
Index: src/tests/usr.bin/unifdef/d_basic.out
diff -u /dev/null src/tests/usr.bin/unifdef/d_basic.out:1.1
--- /dev/null	Tue May  3 07:23:19 2011
+++ src/tests/usr.bin/unifdef/d_basic.out	Tue May  3 07:23:19 2011
@@ -0,0 +1,6 @@
+#include 
+
+#include 
+
+
+#include 
Index: src/tests/usr.bin/unifdef/t_basic.sh
diff -u /dev/null src/tests/usr.bin/unifdef/t_basic.sh:1.1
--- /dev/null	Tue May  3 07:23:19 2011
+++ src/tests/usr.bin/unifdef/t_basic.sh	Tue May  3 07:23:19 2011
@@ -0,0 +1,48 @@
+#! /usr/bin/atf-sh
+#
+# $NetBSD: t_basic.sh,v 1.1 2011/05/03 07:23:19 jruoho Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Jukka Ruohonen.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitte