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

2011-02-04 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Feb  4 09:23:00 UTC 2011

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

Log Message:
in xcall(), use a (static) errbuf if we timeout, so we can build the whole
message up for a single call to printf_nolog().  this should get rid of
these messages that report no cpus answered.  eg:

xcall(cpu0,0xf000868c): couldn't ping cpus:
vs
xcall(cpu0,0xf000868c): couldn't ping cpus: cpu1


To generate a diff of this commit:
cvs rdiff -u -r1.227 -r1.228 src/sys/arch/sparc/sparc/cpu.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/cpu.c
diff -u src/sys/arch/sparc/sparc/cpu.c:1.227 src/sys/arch/sparc/sparc/cpu.c:1.228
--- src/sys/arch/sparc/sparc/cpu.c:1.227	Thu Jan 27 06:24:59 2011
+++ src/sys/arch/sparc/sparc/cpu.c	Fri Feb  4 09:23:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.227 2011/01/27 06:24:59 mrg Exp $ */
+/*	$NetBSD: cpu.c,v 1.228 2011/02/04 09:23:00 mrg Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.227 2011/01/27 06:24:59 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.228 2011/02/04 09:23:00 mrg Exp $);
 
 #include opt_multiprocessor.h
 #include opt_lockdebug.h
@@ -638,6 +638,9 @@
 	u_int pil;
 	int fasttrap;
 	int is_noop = func == (xcall_func_t)sparc_noop;
+	static char errbuf[160];
+	char *bufp = errbuf;
+	size_t bufsz = sizeof errbuf, wrsz;
 
 	mybit = (1  cpuinfo.ci_cpuid);
 	callself = func  (cpuset  mybit) != 0;
@@ -702,7 +705,6 @@
 	/*
 	 * Second, call ourselves.
 	 */
-	p = cpuinfo.msg.u.xpmsg_func;
 	if (callself)
 		(*func)(arg0, arg1, arg2);
 
@@ -715,8 +717,11 @@
 	i = 10;	/* time-out, not too long, but still an _AGE_ */
 	while (!done) {
 		if (--i  0) {
-			printf_nolog(xcall(cpu%d,%p): couldn't ping cpus:,
+			wrsz = snprintf(bufp, bufsz,
+			xcall(cpu%d,%p): couldn't ping cpus:,
 			cpu_number(), func);
+			bufsz -= wrsz;
+			bufp += wrsz;
 		}
 
 		done = 1;
@@ -726,7 +731,13 @@
 
 			if (cpi-msg.complete == 0) {
 if (i  0) {
-	printf_nolog( cpu%d, cpi-ci_cpuid);
+	wrsz = snprintf(bufp, bufsz,
+			 cpu%d, cpi-ci_cpuid);
+	bufsz -= wrsz;
+	bufp += wrsz;
+	/* insanity */
+	if (bufsz  0)
+		break;
 } else {
 	done = 0;
 	break;
@@ -735,8 +746,7 @@
 		}
 	}
 	if (i  0)
-		printf_nolog(\n);
-
+		printf_nolog(%s\n, errbuf);
 	mutex_spin_exit(xpmsg_mutex);
 }
 



CVS commit: src/sys/rump/net/lib/libnet

2011-02-04 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Feb  4 09:57:54 UTC 2011

Modified Files:
src/sys/rump/net/lib/libnet: component.c

Log Message:
attach the compat_50_routedomain to make it actually work


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/rump/net/lib/libnet/component.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/rump/net/lib/libnet/component.c
diff -u src/sys/rump/net/lib/libnet/component.c:1.9 src/sys/rump/net/lib/libnet/component.c:1.10
--- src/sys/rump/net/lib/libnet/component.c:1.9	Tue Jan 11 09:24:05 2011
+++ src/sys/rump/net/lib/libnet/component.c	Fri Feb  4 09:57:53 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: component.c,v 1.9 2011/01/11 09:24:05 pooka Exp $	*/
+/*	$NetBSD: component.c,v 1.10 2011/02/04 09:57:53 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: component.c,v 1.9 2011/01/11 09:24:05 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: component.c,v 1.10 2011/02/04 09:57:53 pooka Exp $);
 
 #include sys/param.h
 #include sys/domain.h
@@ -49,10 +49,11 @@
 
 RUMP_COMPONENT(RUMP_COMPONENT_NET_ROUTE)
 {
-	extern struct domain routedomain, linkdomain;
+	extern struct domain routedomain, compat_50_routedomain, linkdomain;
 
 	DOMAINADD(linkdomain);
 	DOMAINADD(routedomain);
+	DOMAINADD(compat_50_routedomain);
 }
 
 RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)



CVS commit: src/sys/arch/hp700/gsc

2011-02-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Feb  4 10:56:03 UTC 2011

Modified Files:
src/sys/arch/hp700/gsc: harmony.c

Log Message:
Replace multiple spaces with tab


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hp700/gsc/harmony.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/hp700/gsc/harmony.c
diff -u src/sys/arch/hp700/gsc/harmony.c:1.20 src/sys/arch/hp700/gsc/harmony.c:1.21
--- src/sys/arch/hp700/gsc/harmony.c:1.20	Fri Feb  4 07:44:53 2011
+++ src/sys/arch/hp700/gsc/harmony.c	Fri Feb  4 10:56:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: harmony.c,v 1.20 2011/02/04 07:44:53 skrll Exp $	*/
+/*	$NetBSD: harmony.c,v 1.21 2011/02/04 10:56:03 skrll Exp $	*/
 
 /*	$OpenBSD: harmony.c,v 1.23 2004/02/13 21:28:19 mickey Exp $	*/
 
@@ -92,26 +92,26 @@
 #include hp700/gsc/harmonyreg.h
 #include hp700/gsc/harmonyvar.h
 
-int harmony_open(void *, int);
-voidharmony_close(void *);
-int harmony_query_encoding(void *, struct audio_encoding *);
-int harmony_set_params(void *, int, int, audio_params_t *,
+int	harmony_open(void *, int);
+void	harmony_close(void *);
+int	harmony_query_encoding(void *, struct audio_encoding *);
+int	harmony_set_params(void *, int, int, audio_params_t *,
 audio_params_t *, stream_filter_list_t *, stream_filter_list_t *);
-int harmony_round_blocksize(void *, int, int, const audio_params_t *);
-int harmony_commit_settings(void *);
-int harmony_halt_output(void *);
-int harmony_halt_input(void *);
-int harmony_getdev(void *, struct audio_device *);
-int harmony_set_port(void *, mixer_ctrl_t *);
-int harmony_get_port(void *, mixer_ctrl_t *);
-int harmony_query_devinfo(void *, mixer_devinfo_t *);
-void * harmony_allocm(void *, int, size_t, struct malloc_type *, int);
-voidharmony_freem(void *, void *, struct malloc_type *);
-size_t  harmony_round_buffersize(void *, int, size_t);
-int harmony_get_props(void *);
-int harmony_trigger_output(void *, void *, void *, int,
+int	harmony_round_blocksize(void *, int, int, const audio_params_t *);
+int	harmony_commit_settings(void *);
+int	harmony_halt_output(void *);
+int	harmony_halt_input(void *);
+int	harmony_getdev(void *, struct audio_device *);
+int	harmony_set_port(void *, mixer_ctrl_t *);
+int	harmony_get_port(void *, mixer_ctrl_t *);
+int	harmony_query_devinfo(void *, mixer_devinfo_t *);
+void *	harmony_allocm(void *, int, size_t, struct malloc_type *, int);
+void	harmony_freem(void *, void *, struct malloc_type *);
+size_t	harmony_round_buffersize(void *, int, size_t);
+int	harmony_get_props(void *);
+int	harmony_trigger_output(void *, void *, void *, int,
 void (*)(void *), void *, const audio_params_t *);
-int harmony_trigger_input(void *, void *, void *, int,
+int	harmony_trigger_input(void *, void *, void *, int,
 void (*)(void *), void *, const audio_params_t *);
 
 const struct audio_hw_if harmony_sa_hw_if = {



CVS commit: src/sys/arch/hp700/gsc

2011-02-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Feb  4 11:00:31 UTC 2011

Modified Files:
src/sys/arch/hp700/gsc: harmony.c

Log Message:
A better workaround hack for PR 41448

Bound the wait loop


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hp700/gsc/harmony.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/hp700/gsc/harmony.c
diff -u src/sys/arch/hp700/gsc/harmony.c:1.21 src/sys/arch/hp700/gsc/harmony.c:1.22
--- src/sys/arch/hp700/gsc/harmony.c:1.21	Fri Feb  4 10:56:03 2011
+++ src/sys/arch/hp700/gsc/harmony.c	Fri Feb  4 11:00:30 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: harmony.c,v 1.21 2011/02/04 10:56:03 skrll Exp $	*/
+/*	$NetBSD: harmony.c,v 1.22 2011/02/04 11:00:30 skrll Exp $	*/
 
 /*	$OpenBSD: harmony.c,v 1.23 2004/02/13 21:28:19 mickey Exp $	*/
 
@@ -98,7 +98,10 @@
 int	harmony_set_params(void *, int, int, audio_params_t *,
 audio_params_t *, stream_filter_list_t *, stream_filter_list_t *);
 int	harmony_round_blocksize(void *, int, int, const audio_params_t *);
+
+int	harmony_control_wait(struct harmony_softc *);
 int	harmony_commit_settings(void *);
+
 int	harmony_halt_output(void *);
 int	harmony_halt_input(void *);
 int	harmony_getdev(void *, struct audio_device *);
@@ -623,6 +626,24 @@
 }
 
 int
+harmony_control_wait(struct harmony_softc *sc)
+{
+	uint32_t reg;
+	int j = 0;
+
+	while (j  10) {
+		/* Wait for it to come out of control mode */
+		reg = READ_REG(sc, HARMONY_CNTL);
+		if ((reg  CNTL_C) == 0)
+			return 0;
+		DELAY(5);		/* wait 0.05 */
+		j++;
+	}
+
+	return 1;
+}
+
+int
 harmony_commit_settings(void *vsc)
 {
 	struct harmony_softc *sc;
@@ -669,24 +690,12 @@
 	offsetof(struct harmony_empty, playback[0][0]),
 	PLAYBACK_EMPTYS * HARMONY_BUFSIZE, BUS_DMASYNC_PREWRITE);
 
-	for (;;) {
-		/* Wait for it to come out of control mode */
-		reg = READ_REG(sc, HARMONY_CNTL);
-		if ((reg  CNTL_C) == 0)
-			break;
-	}
+	harmony_control_wait(sc);
 
 	bus_space_write_4(sc-sc_bt, sc-sc_bh, HARMONY_CNTL,
 	sc-sc_cntlbits | CNTL_C);
 
-#if 0
-	for (;;) {
-		/* Wait for it to come out of control mode */
-		reg = READ_REG(sc, HARMONY_CNTL);
-		if ((reg  CNTL_C) == 0)
-			break;
-	}
-#endif
+	harmony_control_wait(sc);
 
 	sc-sc_need_commit = 0;
 



CVS commit: src/distrib/notes/sandpoint

2011-02-04 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Fri Feb  4 12:23:08 UTC 2011

Modified Files:
src/distrib/notes/sandpoint: xfer

Log Message:
Supported installation medium: FTP and NFS.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/notes/sandpoint/xfer

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

Modified files:

Index: src/distrib/notes/sandpoint/xfer
diff -u src/distrib/notes/sandpoint/xfer:1.1 src/distrib/notes/sandpoint/xfer:1.2
--- src/distrib/notes/sandpoint/xfer:1.1	Wed Oct 24 18:30:35 2001
+++ src/distrib/notes/sandpoint/xfer	Fri Feb  4 12:23:08 2011
@@ -1,3 +1,118 @@
-.\	$NetBSD: xfer,v 1.1 2001/10/24 18:30:35 briggs Exp $
+.\	$NetBSD: xfer,v 1.2 2011/02/04 12:23:08 phx Exp $
+.\
+.\ Copyright (c) 1999-2004 The NetBSD Foundation, Inc.
+.\ All rights reserved.
+.\
+.\ Redistribution and use in source and binary forms, with or without
+.\ modification, are permitted provided that the following conditions
+.\ are met:
+.\ 1. Redistributions of source code must retain the above copyright
+.\notice, this list of conditions and the following disclaimer.
+.\ 2. Redistributions in binary form must reproduce the above copyright
+.\notice, this list of conditions and the following disclaimer in the
+.\documentation and/or other materials provided with the distribution.
+.\
+.\ THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\ POSSIBILITY OF SUCH DAMAGE.
+.\
 .
-.so ../common/xfer
+.\ - instructions for getting distribution off installation medium
+.
+Installation is supported from several media types, including:
+.Pp
+.(bullet -offset indent -compact
+FTP
+.
+.It
+Remote NFS partition
+.
+.bullet)
+.Pp
+.
+The steps necessary to prepare the distribution sets for installation
+depend upon which installation medium you choose.
+The steps for the various media are outlined below.
+.
+.(tag CD-ROM\ /\ DVD
+.
+.It Em FTP
+The preparations for this installation/upgrade method are
+easy; all you need to do is make sure that there's an FTP
+site from which you can retrieve the
+.Nx
+distribution when you're about to
+install or upgrade.
+If you don't have DHCP available on your network,
+you will need to know the numeric IP address of that site, and,
+if it's not on a network directly connected to the machine
+on which you're installing or upgrading
+.Nx ,
+you need to know the numeric IP address of the router closest
+to the
+.Nx
+machine.
+Finally, you need to know the numeric IP address of the
+.Nx
+machine itself.
+If you don't have access to a functioning nameserver during
+installation, the IPv4 address of
+.Sy ftp.NetBSD.org
+is
+.Li 204.152.190.15
+and the IPv6 address is
+.Li 2001:4f8:3:7:230:48ff:fec6:9aaa:21
+(as of May, 2010).
+.Pp
+Once you have this information, you can proceed to the next
+step in the installation or upgrade process.
+If you're installing
+.Nx
+from scratch, go to the section on preparing your hard disk, below.
+If you're upgrading an existing installation, go directly to
+the section on upgrading.
+.
+.It Em NFS
+Place the
+.Nx
+distribution sets you wish to install into a
+directory on an NFS server, and make that directory mountable
+by the machine on which you are installing or upgrading
+.Nx .
+This will probably require modifying the
+.Pa /etc/exports
+file on the NFS server and resetting its mount daemon (mountd).
+(Both of these actions will probably require superuser
+privileges on the server.)
+.Pp
+You need to know the numeric IP address of the NFS server,
+and, if you don't have DHCP available on your network and
+the server is not on a network directly connected to
+the machine on which you're installing or upgrading
+.Nx ,
+you need to know the numeric IP address of the router closest
+to the
+.Nx
+machine.
+Finally, you need to know the numeric IP address of the
+.Nx
+machine itself.
+.Pp
+Once the NFS server is set up properly and you have the
+information mentioned above, you can proceed to the next step
+in the installation or upgrade process.
+If you're installing
+.Nx
+from scratch, go to the section on preparing your hard disk, below.
+If you're upgrading an existing installation, go directly to the
+section on upgrading.
+.

CVS commit: src

2011-02-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb  4 14:31:23 UTC 2011

Modified Files:
src/sbin/route: show.c
src/usr.bin/netstat: if.c route.c show.c
src/usr.sbin/ifwatchd: ifwatchd.c

Log Message:
Use RT_ROUNDUP() and friends from sys/route.h instead of homegrown
variants.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sbin/route/show.c
cvs rdiff -u -r1.70 -r1.71 src/usr.bin/netstat/if.c
cvs rdiff -u -r1.76 -r1.77 src/usr.bin/netstat/route.c
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/netstat/show.c
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/ifwatchd/ifwatchd.c

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

Modified files:

Index: src/sbin/route/show.c
diff -u src/sbin/route/show.c:1.42 src/sbin/route/show.c:1.43
--- src/sbin/route/show.c:1.42	Mon Dec 13 17:39:47 2010
+++ src/sbin/route/show.c	Fri Feb  4 14:31:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: show.c,v 1.42 2010/12/13 17:39:47 pooka Exp $	*/
+/*	$NetBSD: show.c,v 1.43 2011/02/04 14:31:23 martin Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = from: @(#)route.c	8.3 (Berkeley) 3/9/94;
 #else
-__RCSID($NetBSD: show.c,v 1.42 2010/12/13 17:39:47 pooka Exp $);
+__RCSID($NetBSD: show.c,v 1.43 2011/02/04 14:31:23 martin Exp $);
 #endif
 #endif /* not lint */
 
@@ -65,9 +65,6 @@
 #include extern.h
 #include prog_ops.h
 
-#define ROUNDUP(a) \
-	((a)  0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
-#define ADVANCE(x, n) (x += ROUNDUP((n)-sa_len))
 
 /*
  * Definitions for showing gateway flags.
@@ -290,14 +287,14 @@
 		else {
 			/* skip to gateway */
 			nm = (struct sockaddr *)
-			(ROUNDUP(sa-sa_len) + (char *)sa);
+			(RT_ROUNDUP(sa-sa_len) + (char *)sa);
 			/* skip over gateway to netmask */
 			nm = (struct sockaddr *)
-			(ROUNDUP(nm-sa_len) + (char *)nm);
+			(RT_ROUNDUP(nm-sa_len) + (char *)nm);
 		}
 
 		p_sockaddr(sa, nm, rtm-rtm_flags, WID_DST(af));
-		sa = (struct sockaddr *)(ROUNDUP(sa-sa_len) + (char *)sa);
+		sa = (struct sockaddr *)(RT_ROUNDUP(sa-sa_len) + (char *)sa);
 		p_sockaddr(sa, NULL, 0, WID_GW(af));
 	}
 	p_flags(rtm-rtm_flags  interesting);

Index: src/usr.bin/netstat/if.c
diff -u src/usr.bin/netstat/if.c:1.70 src/usr.bin/netstat/if.c:1.71
--- src/usr.bin/netstat/if.c:1.70	Mon Dec 13 21:15:30 2010
+++ src/usr.bin/netstat/if.c	Fri Feb  4 14:31:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.70 2010/12/13 21:15:30 pooka Exp $	*/
+/*	$NetBSD: if.c,v 1.71 2011/02/04 14:31:23 martin Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = from: @(#)if.c	8.2 (Berkeley) 2/21/94;
 #else
-__RCSID($NetBSD: if.c,v 1.70 2010/12/13 21:15:30 pooka Exp $);
+__RCSID($NetBSD: if.c,v 1.71 2011/02/04 14:31:23 martin Exp $);
 #endif
 #endif /* not lint */
 
@@ -948,13 +948,6 @@
 	signalled = true;
 }
 
-#define ROUNDUP(a, size) \
-	(((a)  ((size)-1)) ? (1 + ((a) | ((size)-1))) : (a))
-
-#define NEXT_SA(ap) (ap) = (struct sockaddr *) \
-	((caddr_t)(ap) + ((ap)-sa_len ? ROUNDUP((ap)-sa_len,\
-	sizeof(u_long)) : sizeof(u_long)))
-
 static void
 get_rtaddrs(int addrs, struct sockaddr *sa, struct sockaddr **rti_info)
 {   
@@ -963,9 +956,8 @@
 	for (i = 0; i  RTAX_MAX; i++) {
 		if (addrs  (1  i)) {
 			rti_info[i] = sa;
-			NEXT_SA(sa);
-			/* sa = (struct sockaddr *)((char *)(sa) +
-			roundup(sa-sa_len, sizeof(long))); */
+			sa = (struct sockaddr *)((char *)(sa) +
+			RT_ROUNDUP(sa-sa_len));
 		} else 
 			rti_info[i] = NULL;
 	}

Index: src/usr.bin/netstat/route.c
diff -u src/usr.bin/netstat/route.c:1.76 src/usr.bin/netstat/route.c:1.77
--- src/usr.bin/netstat/route.c:1.76	Tue Feb  1 01:39:21 2011
+++ src/usr.bin/netstat/route.c	Fri Feb  4 14:31:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.76 2011/02/01 01:39:21 matt Exp $	*/
+/*	$NetBSD: route.c,v 1.77 2011/02/04 14:31:23 martin Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = from: @(#)route.c	8.3 (Berkeley) 3/9/94;
 #else
-__RCSID($NetBSD: route.c,v 1.76 2011/02/01 01:39:21 matt Exp $);
+__RCSID($NetBSD: route.c,v 1.77 2011/02/04 14:31:23 martin Exp $);
 #endif
 #endif /* not lint */
 
@@ -70,11 +70,6 @@
 
 #define kget(p, d) (kread((u_long)(p), (char *)(d), sizeof (d)))
 
-/* alignment constraint for routing socket */
-#define ROUNDUP(a) \
-	((a)  0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
-#define ADVANCE(x, n) (x += ROUNDUP((n)-sa_len))
-
 /*
  * XXX we put all of the sockaddr types in here to force the alignment
  * to be correct.

Index: src/usr.bin/netstat/show.c
diff -u src/usr.bin/netstat/show.c:1.12 src/usr.bin/netstat/show.c:1.13
--- src/usr.bin/netstat/show.c:1.12	Tue Feb  1 01:39:21 2011
+++ src/usr.bin/netstat/show.c	Fri Feb  4 14:31:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: show.c,v 1.12 2011/02/01 01:39:21 matt Exp $	*/
+/*	$NetBSD: show.c,v 1.13 2011/02/04 14:31:23 martin Exp $	

CVS commit: src/sys/arch/hp700/hp700

2011-02-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Feb  4 14:35:30 UTC 2011

Modified Files:
src/sys/arch/hp700/hp700: intr.c

Log Message:
Another change to suit my eye.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/hp700/hp700/intr.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/hp700/hp700/intr.c
diff -u src/sys/arch/hp700/hp700/intr.c:1.34 src/sys/arch/hp700/hp700/intr.c:1.35
--- src/sys/arch/hp700/hp700/intr.c:1.34	Tue Feb  1 18:33:24 2011
+++ src/sys/arch/hp700/hp700/intr.c	Fri Feb  4 14:35:30 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.34 2011/02/01 18:33:24 skrll Exp $	*/
+/*	$NetBSD: intr.c,v 1.35 2011/02/04 14:35:30 skrll Exp $	*/
 /*	$OpenBSD: intr.c,v 1.27 2009/12/31 12:52:35 jsing Exp $	*/
 
 /*
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.34 2011/02/01 18:33:24 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.35 2011/02/04 14:35:30 skrll Exp $);
 
 #define __MUTEX_PRIVATE
 
@@ -233,17 +233,18 @@
  * It returns the bit position, or -1 if no bits were available.
  */
 int
-hp700_intr_allocate_bit(struct hp700_interrupt_register *int_reg)
+hp700_intr_allocate_bit(struct hp700_interrupt_register *ir)
 {
 	int bit_pos, mask;
 
 	for (bit_pos = 31, mask = (1  bit_pos);
 	 bit_pos = 0;
 	 bit_pos--, mask = 1)
-		if (int_reg-ir_bits  mask)
+		if (ir-ir_bits  mask)
 			break;
 	if (bit_pos = 0)
-		int_reg-ir_bits = ~mask;
+		ir-ir_bits = ~mask;
+
 	return bit_pos;
 }
 



CVS commit: src/sys/arch/hp700/hp700

2011-02-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Feb  4 14:51:03 UTC 2011

Modified Files:
src/sys/arch/hp700/hp700: intr.c

Log Message:
mask should really be unsigned. it doesn't actually matter.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/hp700/hp700/intr.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/hp700/hp700/intr.c
diff -u src/sys/arch/hp700/hp700/intr.c:1.35 src/sys/arch/hp700/hp700/intr.c:1.36
--- src/sys/arch/hp700/hp700/intr.c:1.35	Fri Feb  4 14:35:30 2011
+++ src/sys/arch/hp700/hp700/intr.c	Fri Feb  4 14:51:02 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.35 2011/02/04 14:35:30 skrll Exp $	*/
+/*	$NetBSD: intr.c,v 1.36 2011/02/04 14:51:02 skrll Exp $	*/
 /*	$OpenBSD: intr.c,v 1.27 2009/12/31 12:52:35 jsing Exp $	*/
 
 /*
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.35 2011/02/04 14:35:30 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.36 2011/02/04 14:51:02 skrll Exp $);
 
 #define __MUTEX_PRIVATE
 
@@ -235,7 +235,8 @@
 int
 hp700_intr_allocate_bit(struct hp700_interrupt_register *ir)
 {
-	int bit_pos, mask;
+	int bit_pos;
+	u_int mask;
 
 	for (bit_pos = 31, mask = (1  bit_pos);
 	 bit_pos = 0;



CVS commit: src/external/bsd/dhcpcd/dist

2011-02-04 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Feb  4 15:00:25 UTC 2011

Update of /cvsroot/src/external/bsd/dhcpcd/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv24736

Log Message:
Import dhcpcd-5.2.11
Change from dhcpcd-5.2.10 is a fix for the new routing sockets. 

Status:

Vendor Tag: roy
Release Tags:   dhcpcd-5-2-11

U src/external/bsd/dhcpcd/dist/arp.c
U src/external/bsd/dhcpcd/dist/bind.c
U src/external/bsd/dhcpcd/dist/common.c
U src/external/bsd/dhcpcd/dist/control.c
U src/external/bsd/dhcpcd/dist/dhcp.c
U src/external/bsd/dhcpcd/dist/dhcpcd.c
U src/external/bsd/dhcpcd/dist/duid.c
U src/external/bsd/dhcpcd/dist/eloop.c
U src/external/bsd/dhcpcd/dist/if-options.c
U src/external/bsd/dhcpcd/dist/if-pref.c
U src/external/bsd/dhcpcd/dist/ipv4ll.c
U src/external/bsd/dhcpcd/dist/net.c
U src/external/bsd/dhcpcd/dist/signals.c
U src/external/bsd/dhcpcd/dist/configure.c
U src/external/bsd/dhcpcd/dist/bpf.c
U src/external/bsd/dhcpcd/dist/if-bsd.c
U src/external/bsd/dhcpcd/dist/platform-bsd.c
U src/external/bsd/dhcpcd/dist/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.in
C src/external/bsd/dhcpcd/dist/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/dhcpcd.conf.5.in
U src/external/bsd/dhcpcd/dist/arp.h
U src/external/bsd/dhcpcd/dist/bind.h
U src/external/bsd/dhcpcd/dist/bpf-filter.h
U src/external/bsd/dhcpcd/dist/common.h
U src/external/bsd/dhcpcd/dist/config.h
U src/external/bsd/dhcpcd/dist/configure.h
U src/external/bsd/dhcpcd/dist/control.h
U src/external/bsd/dhcpcd/dist/defs.h
U src/external/bsd/dhcpcd/dist/dhcp.h
U src/external/bsd/dhcpcd/dist/dhcpcd.h
U src/external/bsd/dhcpcd/dist/duid.h
U src/external/bsd/dhcpcd/dist/eloop.h
U src/external/bsd/dhcpcd/dist/if-options.h
U src/external/bsd/dhcpcd/dist/if-pref.h
U src/external/bsd/dhcpcd/dist/ipv4ll.h
U src/external/bsd/dhcpcd/dist/net.h
U src/external/bsd/dhcpcd/dist/platform.h
U src/external/bsd/dhcpcd/dist/signals.h
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/01-test
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/02-dump
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/10-mtu
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/30-hostname
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ypbind

1 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jroy:yesterday -jroy src/external/bsd/dhcpcd/dist



CVS commit: src/external/bsd/dhcpcd/dist

2011-02-04 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Feb  4 15:03:14 UTC 2011

Modified Files:
src/external/bsd/dhcpcd/dist: dhcpcd.8.in

Log Message:
sync


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/dhcpcd/dist/dhcpcd.8.in

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/dhcpcd/dist/dhcpcd.8.in
diff -u src/external/bsd/dhcpcd/dist/dhcpcd.8.in:1.7 src/external/bsd/dhcpcd/dist/dhcpcd.8.in:1.8
--- src/external/bsd/dhcpcd/dist/dhcpcd.8.in:1.7	Sat Nov 27 11:28:24 2010
+++ src/external/bsd/dhcpcd/dist/dhcpcd.8.in	Fri Feb  4 15:03:14 2011
@@ -1,4 +1,4 @@
-.\ Copyright (c) 2006-2010 Roy Marples
+.\ Copyright (c) 2006-2011 Roy Marples
 .\ All rights reserved
 .\
 .\ Redistribution and use in source and binary forms, with or without
@@ -22,7 +22,7 @@
 .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\ SUCH DAMAGE.
 .\
-.Dd August 31, 2010
+.Dd January 3, 2011
 .Dt DHCPCD 8 SMM
 .Os
 .Sh NAME
@@ -274,17 +274,10 @@
 NFS.
 You can use this option to stop this from happening.
 .It Fl r , -request Op Ar address
-.Nm
-normally sends a DHCP DISCOVER to find servers to offer an address.
-.Nm
-then requests the address used.
-You can use this option to skip the DISCOVER phase and just request the
-.Ar address .
-The downside is if you request an
+Request the
 .Ar address
-the DHCP server does not know about or the DHCP server is not
-authoritative, it will remain silent.
-In this situation, we go back to the init state and DISCOVER again.
+in the DHCP DISCOVER message.
+There is no guarantee this is the address the DHCP server will actual give.
 If no
 .Ar address
 is given then the first address currently assigned to the
@@ -293,7 +286,7 @@
 .It Fl s , -inform Op Ar address Ns Op Ar /cidr
 Behaves like
 .Fl r , -request
-as above, but sends a DHCP INFORM instead of a REQUEST.
+as above, but sends a DHCP INFORM instead of DISCOVER/REQUEST.
 This does not get a lease as such, just notifies the DHCP server of the
 .Ar address
 in use.



CVS commit: src/usr.bin/rump_dhcpclient

2011-02-04 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Feb  4 15:09:22 UTC 2011

Modified Files:
src/usr.bin/rump_dhcpclient: if-bsd.c

Log Message:
Work with the new routing.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/rump_dhcpclient/if-bsd.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/rump_dhcpclient/if-bsd.c
diff -u src/usr.bin/rump_dhcpclient/if-bsd.c:1.1 src/usr.bin/rump_dhcpclient/if-bsd.c:1.2
--- src/usr.bin/rump_dhcpclient/if-bsd.c:1.1	Thu Jan 20 18:47:20 2011
+++ src/usr.bin/rump_dhcpclient/if-bsd.c	Fri Feb  4 15:09:22 2011
@@ -62,10 +62,6 @@
 #include if-options.h
 #include net.h
 
-#define ROUNDUP(a)			  \
-	((a)  0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
-#define ADVANCE(x, n) (x += ROUNDUP((n)-sa_len))
-
 /* FIXME: Why do we need to check for sa_family 255 */
 #define COPYOUT(sin, sa)		  \
 	sin.s_addr = ((sa) != NULL) ?	  \
@@ -196,7 +192,7 @@
 	int retval = 0;
 
 #define ADDSU(_su) {			  \
-		l = ROUNDUP(_su.sa.sa_len);  \
+		l = RT_ROUNDUP(_su.sa.sa_len);  \
 		memcpy(bp, (_su), l);	  \
 		bp += l;		  \
 	}



CVS commit: src/doc

2011-02-04 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Feb  4 15:11:12 UTC 2011

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note import of dhcpcd-5.2.11


To generate a diff of this commit:
cvs rdiff -u -r1.809 -r1.810 src/doc/3RDPARTY
cvs rdiff -u -r1.1499 -r1.1500 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.809 src/doc/3RDPARTY:1.810
--- src/doc/3RDPARTY:1.809	Sun Jan 30 17:48:04 2011
+++ src/doc/3RDPARTY	Fri Feb  4 15:11:12 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.809 2011/01/30 17:48:04 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.810 2011/02/04 15:11:12 roy Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -268,8 +268,8 @@
 top of the current tree.
 
 Package:	dhcpcd
-Version:	5.2.10
-Current Vers:	5.2.10
+Version:	5.2.11
+Current Vers:	5.2.11
 Maintainer:	roy
 Archive Site:	ftp://roy.marples.name/pub/dhcpcd/
 Home Page:	http://roy.marples.name/projects/dhcpcd/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1499 src/doc/CHANGES:1.1500
--- src/doc/CHANGES:1.1499	Tue Feb  1 02:09:26 2011
+++ src/doc/CHANGES	Fri Feb  4 15:11:12 2011
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1499 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1500 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -840,3 +840,4 @@
 		Allow unprived vmstat to function is everything wanted is
 		available via sysctl. [matt 20110129]
 	route: make routing socket interface 64-bit clean. [matt 20110131]
+	dhcpcd(8): Import dhcpcd-5.2.11. [roy 20110204]



CVS commit: src/external/bsd/dhcpcd/dist

2011-02-04 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Feb  4 16:30:32 UTC 2011

Modified Files:
src/external/bsd/dhcpcd/dist: dhcpcd.8.in

Log Message:
Fix typo, already reported to roy@


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/dhcpcd/dist/dhcpcd.8.in

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/dhcpcd/dist/dhcpcd.8.in
diff -u src/external/bsd/dhcpcd/dist/dhcpcd.8.in:1.8 src/external/bsd/dhcpcd/dist/dhcpcd.8.in:1.9
--- src/external/bsd/dhcpcd/dist/dhcpcd.8.in:1.8	Fri Feb  4 15:03:14 2011
+++ src/external/bsd/dhcpcd/dist/dhcpcd.8.in	Fri Feb  4 16:30:32 2011
@@ -277,7 +277,7 @@
 Request the
 .Ar address
 in the DHCP DISCOVER message.
-There is no guarantee this is the address the DHCP server will actual give.
+There is no guarantee this is the address the DHCP server will actually give.
 If no
 .Ar address
 is given then the first address currently assigned to the



CVS commit: src/lib/libc/rpc

2011-02-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb  4 17:36:55 UTC 2011

Modified Files:
src/lib/libc/rpc: svc_vc.c

Log Message:
knf - no functional changes


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/rpc/svc_vc.c

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

Modified files:

Index: src/lib/libc/rpc/svc_vc.c
diff -u src/lib/libc/rpc/svc_vc.c:1.22 src/lib/libc/rpc/svc_vc.c:1.23
--- src/lib/libc/rpc/svc_vc.c:1.22	Wed Feb 11 23:38:52 2009
+++ src/lib/libc/rpc/svc_vc.c	Fri Feb  4 12:36:54 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: svc_vc.c,v 1.22 2009/02/12 04:38:52 lukem Exp $	*/
+/*	$NetBSD: svc_vc.c,v 1.23 2011/02/04 17:36:54 christos Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
 static char *sccsid = @(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro;
 static char *sccsid = @(#)svc_tcp.c	2.2 88/08/01 4.0 RPCSRC;
 #else
-__RCSID($NetBSD: svc_vc.c,v 1.22 2009/02/12 04:38:52 lukem Exp $);
+__RCSID($NetBSD: svc_vc.c,v 1.23 2011/02/04 17:36:54 christos Exp $);
 #endif
 #endif
 
@@ -79,23 +79,22 @@
 extern rwlock_t svc_fd_lock;
 #endif
 
-static SVCXPRT *makefd_xprt __P((int, u_int, u_int));
-static bool_t rendezvous_request __P((SVCXPRT *, struct rpc_msg *));
-static enum xprt_stat rendezvous_stat __P((SVCXPRT *));
-static void svc_vc_destroy __P((SVCXPRT *));
-static void __svc_vc_dodestroy __P((SVCXPRT *));
-static int read_vc __P((caddr_t, caddr_t, int));
-static int write_vc __P((caddr_t, caddr_t, int));
-static enum xprt_stat svc_vc_stat __P((SVCXPRT *));
-static bool_t svc_vc_recv __P((SVCXPRT *, struct rpc_msg *));
-static bool_t svc_vc_getargs __P((SVCXPRT *, xdrproc_t, caddr_t));
-static bool_t svc_vc_freeargs __P((SVCXPRT *, xdrproc_t, caddr_t));
-static bool_t svc_vc_reply __P((SVCXPRT *, struct rpc_msg *));
-static void svc_vc_rendezvous_ops __P((SVCXPRT *));
-static void svc_vc_ops __P((SVCXPRT *));
-static bool_t svc_vc_control __P((SVCXPRT *, const u_int, void *));
-static bool_t svc_vc_rendezvous_control __P((SVCXPRT *, const u_int,
-	 void *));
+static SVCXPRT *makefd_xprt(int, u_int, u_int);
+static bool_t rendezvous_request(SVCXPRT *, struct rpc_msg *);
+static enum xprt_stat rendezvous_stat(SVCXPRT *);
+static void svc_vc_destroy(SVCXPRT *);
+static void __svc_vc_dodestroy(SVCXPRT *);
+static int read_vc(caddr_t, caddr_t, int);
+static int write_vc(caddr_t, caddr_t, int);
+static enum xprt_stat svc_vc_stat(SVCXPRT *);
+static bool_t svc_vc_recv(SVCXPRT *, struct rpc_msg *);
+static bool_t svc_vc_getargs(SVCXPRT *, xdrproc_t, caddr_t);
+static bool_t svc_vc_freeargs(SVCXPRT *, xdrproc_t, caddr_t);
+static bool_t svc_vc_reply(SVCXPRT *, struct rpc_msg *);
+static void svc_vc_rendezvous_ops(SVCXPRT *);
+static void svc_vc_ops(SVCXPRT *);
+static bool_t svc_vc_control(SVCXPRT *, const u_int, void *);
+static bool_t svc_vc_rendezvous_control(SVCXPRT *, const u_int, void *);
 
 struct cf_rendezvous { /* kept in xprt-xp_p1 for rendezvouser */
 	u_int sendsize;
@@ -132,10 +131,7 @@
  * 0 = use the system default.
  */
 SVCXPRT *
-svc_vc_create(fd, sendsize, recvsize)
-	int fd;
-	u_int sendsize;
-	u_int recvsize;
+svc_vc_create(int fd, u_int sendsize, u_int recvsize)
 {
 	SVCXPRT *xprt;
 	struct cf_rendezvous *r = NULL;
@@ -192,13 +188,13 @@
 
 	xprt-xp_rtaddr.maxlen = sizeof (struct sockaddr_storage);
 	xprt_register(xprt);
-	return (xprt);
+	return xprt;
 cleanup_svc_vc_create:
 	if (xprt)
 		mem_free(xprt, sizeof(*xprt));
 	if (r != NULL)
 		mem_free(r, sizeof(*r));
-	return (NULL);
+	return NULL;
 }
 
 /*
@@ -206,10 +202,7 @@
  * descriptor as its first input.
  */
 SVCXPRT *
-svc_fd_create(fd, sendsize, recvsize)
-	int fd;
-	u_int sendsize;
-	u_int recvsize;
+svc_fd_create(int fd, u_int sendsize, u_int recvsize)
 {
 	struct sockaddr_storage ss;
 	socklen_t slen;
@@ -263,10 +256,7 @@
 }
 
 static SVCXPRT *
-makefd_xprt(fd, sendsize, recvsize)
-	int fd;
-	u_int sendsize;
-	u_int recvsize;
+makefd_xprt(int fd, u_int sendsize, u_int recvsize)
 {
 	SVCXPRT *xprt;
 	struct cf_conn *cd;
@@ -295,7 +285,7 @@
 			goto out;
 
 	xprt_register(xprt);
-	return (xprt);
+	return xprt;
 out:
 	warn(svc_tcp: makefd_xprt);
 	if (xprt)
@@ -305,9 +295,7 @@
 
 /*ARGSUSED*/
 static bool_t
-rendezvous_request(xprt, msg)
-	SVCXPRT *xprt;
-	struct rpc_msg *msg;
+rendezvous_request(SVCXPRT *xprt, struct rpc_msg *msg)
 {
 	int sock, flags;
 	struct cf_rendezvous *r;
@@ -337,7 +325,7 @@
 			if (__svc_clean_idle(cleanfds, 0, FALSE))
 goto again;
 		}
-		return (FALSE);
+		return FALSE;
 	}
 	/*
 	 * make a new transporter (re-uses xprt)
@@ -380,24 +368,22 @@
 
 	(void)gettimeofday(cd-last_recv_time, NULL);
 
-	return (FALSE); /* there is never an rpc msg to be processed */
+	return FALSE; /* there is never an rpc msg to be processed */
 out:
 	(void)close(sock);
-	return (FALSE); /* there was an error */
+	return FALSE; /* there was an 

CVS commit: src/lib/libc/rpc

2011-02-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb  4 17:38:15 UTC 2011

Modified Files:
src/lib/libc/rpc: svc_vc.c

Log Message:
PR/44514: Andrey Simonenko: Buffer underflow in RPC library for non-blocking
TCP sockets


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/rpc/svc_vc.c

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

Modified files:

Index: src/lib/libc/rpc/svc_vc.c
diff -u src/lib/libc/rpc/svc_vc.c:1.23 src/lib/libc/rpc/svc_vc.c:1.24
--- src/lib/libc/rpc/svc_vc.c:1.23	Fri Feb  4 12:36:54 2011
+++ src/lib/libc/rpc/svc_vc.c	Fri Feb  4 12:38:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: svc_vc.c,v 1.23 2011/02/04 17:36:54 christos Exp $	*/
+/*	$NetBSD: svc_vc.c,v 1.24 2011/02/04 17:38:15 christos Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
 static char *sccsid = @(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro;
 static char *sccsid = @(#)svc_tcp.c	2.2 88/08/01 4.0 RPCSRC;
 #else
-__RCSID($NetBSD: svc_vc.c,v 1.23 2011/02/04 17:36:54 christos Exp $);
+__RCSID($NetBSD: svc_vc.c,v 1.24 2011/02/04 17:38:15 christos Exp $);
 #endif
 #endif
 
@@ -583,7 +583,7 @@
 cd-strm_stat = XPRT_DIED;
 return -1;
 			}
-			if (cd-nonblock  i != cnt) {
+			if (cd-nonblock) {
 /*
  * For non-blocking connections, do not
  * take more than 2 seconds writing the
@@ -597,6 +597,7 @@
 	return -1;
 }
 			}
+			i = 0;
 		}
 	}
 	return len;



CVS commit: src

2011-02-04 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Feb  4 19:42:13 UTC 2011

Modified Files:
src/bin/dd: Makefile args.c dd.c dd.h
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/comp: mi
Added Files:
src/bin/dd: dd_hostops.c dd_rumpops.c

Log Message:
Remove the rif/rof options and add rump.dd.  This makes usage
consistent with other rump clients.  Copying between kernels is
done using the host pipe, e.g.:

  dd if=foo rof=bar skip=1 seek=1 = dd if=foo skip=1 | rump.dd of=bar seek=1

Also, the pipe idiom extends to copying between different rump
kernels, e.g.:

  env RUMP_SERVER=unix://srv1 rump.dd if=thefile \
  | env RUMP_SERVER=unix://srv2 rump.dd of=thefile

Pipe approach suggested by yamt (thanks!)


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/bin/dd/Makefile src/bin/dd/dd.h
cvs rdiff -u -r1.33 -r1.34 src/bin/dd/args.c
cvs rdiff -u -r1.46 -r1.47 src/bin/dd/dd.c
cvs rdiff -u -r0 -r1.1 src/bin/dd/dd_hostops.c src/bin/dd/dd_rumpops.c
cvs rdiff -u -r1.919 -r1.920 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.1580 -r1.1581 src/distrib/sets/lists/comp/mi

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

Modified files:

Index: src/bin/dd/Makefile
diff -u src/bin/dd/Makefile:1.14 src/bin/dd/Makefile:1.15
--- src/bin/dd/Makefile:1.14	Mon Nov 22 21:59:09 2010
+++ src/bin/dd/Makefile	Fri Feb  4 19:42:12 2011
@@ -1,7 +1,7 @@
-#	$NetBSD: Makefile,v 1.14 2010/11/22 21:59:09 pooka Exp $
+#	$NetBSD: Makefile,v 1.15 2011/02/04 19:42:12 pooka Exp $
 #	@(#)Makefile	8.1 (Berkeley) 5/31/93
 
-PROG=	dd
+RUMPPRG=dd
 SRCS=	args.c conv.c dd.c misc.c position.c
 
 DPADD+=	${LIBUTIL}
Index: src/bin/dd/dd.h
diff -u src/bin/dd/dd.h:1.14 src/bin/dd/dd.h:1.15
--- src/bin/dd/dd.h:1.14	Mon Dec  6 15:23:29 2010
+++ src/bin/dd/dd.h	Fri Feb  4 19:42:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dd.h,v 1.14 2010/12/06 15:23:29 pooka Exp $	*/
+/*	$NetBSD: dd.h,v 1.15 2011/02/04 19:42:12 pooka Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -38,6 +38,8 @@
 #include sys/stat.h
 
 struct ddfops {
+	int (*op_init)(void);
+
 	int (*op_open)(const char *, int, ...);
 	int (*op_close)(int);
 
@@ -119,6 +121,3 @@
 #define	C_UNBLOCK	0x8
 #define	C_OSYNC		0x10
 #define	C_SPARSE	0x20
-#define C_RIF		0x40
-#define C_ROF		0x80
-#define C_RUMP		0x100

Index: src/bin/dd/args.c
diff -u src/bin/dd/args.c:1.33 src/bin/dd/args.c:1.34
--- src/bin/dd/args.c:1.33	Thu Jan 13 23:45:13 2011
+++ src/bin/dd/args.c	Fri Feb  4 19:42:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: args.c,v 1.33 2011/01/13 23:45:13 jym Exp $	*/
+/*	$NetBSD: args.c,v 1.34 2011/02/04 19:42:12 pooka Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = @(#)args.c	8.3 (Berkeley) 4/2/94;
 #else
-__RCSID($NetBSD: args.c,v 1.33 2011/01/13 23:45:13 jym Exp $);
+__RCSID($NetBSD: args.c,v 1.34 2011/02/04 19:42:12 pooka Exp $);
 #endif
 #endif /* not lint */
 
@@ -55,12 +55,6 @@
 #include dd.h
 #include extern.h
 
-#if !defined(SMALL)  defined(__NetBSD__)
-#define _HAVE_RUMPOPS
-
-#include rump/rumpclient.h
-#endif
-
 static int	c_arg(const void *, const void *);
 #ifndef	NO_CONV
 static int	c_conv(const void *, const void *);
@@ -78,11 +72,6 @@
 static void	f_skip(char *);
 static void	f_progress(char *);
 
-#ifdef _HAVE_RUMPOPS
-static void	f_rif(char *);
-static void	f_rof(char *);
-#endif
-
 static const struct arg {
 	const char *name;
 	void (*f)(char *);
@@ -96,16 +85,12 @@
 	{ count,	f_count,	C_COUNT, C_COUNT },
 	{ files,	f_files,	C_FILES, C_FILES },
 	{ ibs,	f_ibs,		C_IBS,	 C_BS|C_IBS },
-	{ if,		f_if,		C_IF,	 C_IF|C_RIF },
+	{ if,		f_if,		C_IF,	 C_IF },
 	{ iseek,	f_skip,		C_SKIP,	 C_SKIP },
 	{ obs,	f_obs,		C_OBS,	 C_BS|C_OBS },
-	{ of,		f_of,		C_OF,	 C_OF|C_ROF },
+	{ of,		f_of,		C_OF,	 C_OF },
 	{ oseek,	f_seek,		C_SEEK,	 C_SEEK },
 	{ progress,	f_progress,	0,	 0 },
-#ifdef _HAVE_RUMPOPS
-	{ rif,	f_rif,		C_RIF|C_RUMP,	 C_RIF|C_IF },
-	{ rof,	f_rof,		C_ROF|C_RUMP,	 C_ROF|C_OF },
-#endif
 	{ seek,	f_seek,		C_SEEK,	 C_SEEK },
 	{ skip,	f_skip,		C_SKIP,	 C_SKIP },
 };
@@ -207,12 +192,6 @@
 	 * if (in.offset  INT_MAX/in.dbsz || out.offset  INT_MAX/out.dbsz)
 	 *	errx(1, seek offsets cannot be larger than %d, INT_MAX);
 	 */
-	
-#ifdef _HAVE_RUMPOPS
-	if (ddflags  C_RUMP)
-		if (rumpclient_init() == -1)
-			err(1, rumpclient init failed);
-#endif
 }
 
 static int
@@ -285,40 +264,6 @@
 	out.name = arg;
 }
 
-#ifdef _HAVE_RUMPOPS
-#include rump/rump.h
-#include rump/rump_syscalls.h
-
-static const struct ddfops ddfops_rump = {
-	.op_open = rump_sys_open,
-	.op_close = rump_sys_close,
-	.op_fcntl = rump_sys_fcntl,
-	.op_ioctl = rump_sys_ioctl,
-	.op_fstat = rump_sys_fstat,
-	.op_fsync = rump_sys_fsync,
-	.op_ftruncate = rump_sys_ftruncate,
-	.op_lseek = rump_sys_lseek,
-	.op_read = rump_sys_read,
-	.op_write = rump_sys_write,
-};
-
-static void
-f_rif(char *arg)
-{
-
-	in.name = arg;
-	in.ops = 

CVS commit: src/tests

2011-02-04 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Feb  4 19:44:00 UTC 2011

Modified Files:
src/tests/dev/cgd: t_cgd.sh
src/tests/dev/md: t_md.sh
src/tests/dev/raidframe: t_raid.sh
src/tests/usr.bin/rump_server: t_disk.sh

Log Message:
convert tests from oldstyle dd rif/rof to newstyle dd | rump.dd


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/dev/cgd/t_cgd.sh
cvs rdiff -u -r1.5 -r1.6 src/tests/dev/md/t_md.sh
cvs rdiff -u -r1.5 -r1.6 src/tests/dev/raidframe/t_raid.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/rump_server/t_disk.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/dev/cgd/t_cgd.sh
diff -u src/tests/dev/cgd/t_cgd.sh:1.5 src/tests/dev/cgd/t_cgd.sh:1.6
--- src/tests/dev/cgd/t_cgd.sh:1.5	Mon Jan  3 09:37:42 2011
+++ src/tests/dev/cgd/t_cgd.sh	Fri Feb  4 19:44:00 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: t_cgd.sh,v 1.5 2011/01/03 09:37:42 pooka Exp $
+#	$NetBSD: t_cgd.sh,v 1.6 2011/02/04 19:44:00 pooka Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -47,9 +47,11 @@
 	export RUMP_SERVER=unix://csock
 	atf_check -s exit:0 sh -c echo 12345 | \
 	rump.cgdconfig -p cgd0 /dev/dk ${d}/paramsfile
-	atf_check -s exit:0 -e ignore dd if=${d}/t_cgd rof=${rawcgd} count=2
+	atf_check -s exit:0 -e ignore sh -c \
+	dd if=${d}/t_cgd count=2 | rump.dd of=${rawcgd}
 	atf_check -s exit:0 -e ignore dd if=${d}/t_cgd of=testfile count=2
-	atf_check -s exit:0 -e ignore -o file:testfile dd rif=${rawcgd} count=2
+	atf_check -s exit:0 -e ignore -o file:testfile \
+	rump.dd if=${rawcgd} count=2
 }
 
 basic_cleanup()
@@ -76,7 +78,8 @@
 	export RUMP_SERVER=unix://csock
 	atf_check -s exit:0 sh -c echo 12345 | \
 	rump.cgdconfig -p cgd0 /dev/dk ${d}/paramsfile
-	atf_check -s exit:0 -e ignore dd if=${d}/t_cgd rof=${rawcgd} count=2
+	atf_check -s exit:0 -e ignore sh -c \
+	dd if=${d}/t_cgd | rump.dd of=${rawcgd} count=2
 
 	# unconfig and reconfig cgd
 	atf_check -s exit:0 rump.cgdconfig -u cgd0
@@ -85,7 +88,7 @@
 
 	atf_check -s exit:0 -e ignore dd if=${d}/t_cgd of=testfile count=2
 	atf_check -s exit:0 -e ignore -o not-file:testfile \
-	dd rif=${rawcgd} count=2
+	rump.dd if=${rawcgd} count=2
 }
 
 wrongpass_cleanup()

Index: src/tests/dev/md/t_md.sh
diff -u src/tests/dev/md/t_md.sh:1.5 src/tests/dev/md/t_md.sh:1.6
--- src/tests/dev/md/t_md.sh:1.5	Mon Jan  3 09:39:46 2011
+++ src/tests/dev/md/t_md.sh	Fri Feb  4 19:44:00 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: t_md.sh,v 1.5 2011/01/03 09:39:46 pooka Exp $
+#	$NetBSD: t_md.sh,v 1.6 2011/02/04 19:44:00 pooka Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -45,8 +45,10 @@
 	atf_check -s exit:0 $(atf_get_srcdir)/h_mdserv ${rawmd}
 
 	export RUMP_SERVER=unix://commsock
-	atf_check -s exit:0 -e ignore dd if=/bin/ls rof=${rawmd} seek=100 count=10
-	atf_check -s exit:0 -e ignore dd of=testfile rif=${rawmd} skip=100 count=10
+	atf_check -s exit:0 -e ignore sh -c \
+	dd if=/bin/ls count=10 | rump.dd of=${rawmd} seek=100
+	atf_check -s exit:0 -e ignore sh -c \
+	rump.dd if=${rawmd} skip=100 count=10 | dd of=testfile
 	atf_check -s exit:0 -e ignore -o file:testfile dd if=/bin/ls count=10
 }
 

Index: src/tests/dev/raidframe/t_raid.sh
diff -u src/tests/dev/raidframe/t_raid.sh:1.5 src/tests/dev/raidframe/t_raid.sh:1.6
--- src/tests/dev/raidframe/t_raid.sh:1.5	Thu Dec 30 16:58:07 2010
+++ src/tests/dev/raidframe/t_raid.sh	Fri Feb  4 19:44:00 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: t_raid.sh,v 1.5 2010/12/30 16:58:07 pooka Exp $
+#	$NetBSD: t_raid.sh,v 1.6 2011/02/04 19:44:00 pooka Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -98,7 +98,8 @@
 	# put some data there
 	atf_check -s exit:0 -e ignore \
 	dd if=$(atf_get_srcdir)/t_raid of=testfile count=4
-	atf_check -s exit:0 -e ignore dd if=testfile rof=${rawraid} conv=sync
+	atf_check -s exit:0 -e ignore sh -c \
+	dd if=testfile | rump.dd of=${rawraid} conv=sync
 
 	# restart server with failed component
 	rump.halt
@@ -111,7 +112,8 @@
 	atf_check -s exit:0 rump.raidctl -c raid.conf raid0
 
 	# check if we we get what we wrote
-	atf_check -s exit:0 -o file:testfile -e ignore dd rif=${rawraid} count=4
+	atf_check -s exit:0 -o file:testfile -e ignore \
+	rump.dd if=${rawraid} count=4
 }
 
 raid1_compfail_cleanup()
@@ -183,7 +185,8 @@
 	# put some data there
 	atf_check -s exit:0 -e ignore \
 	dd if=$(atf_get_srcdir)/t_raid of=testfile count=4
-	atf_check -s exit:0 -e ignore dd if=testfile rof=${rawraid} conv=sync
+	atf_check -s exit:0 -e ignore sh -c \
+	dd if=testfile | rump.dd of=${rawraid} conv=sync
 
 	# restart server with failed component
 	rump.halt
@@ -197,7 +200,8 @@
 	atf_check -s exit:0 rump.raidctl -c raid.conf raid0
 
 	# check if we we get what we wrote
-	atf_check -s exit:0 -o file:testfile -e ignore dd rif=${rawraid} 

CVS commit: src/tests/dev/cgd

2011-02-04 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Feb  4 19:58:10 UTC 2011

Modified Files:
src/tests/dev/cgd: t_cgd.sh

Log Message:
test case for PR kern/44515


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/dev/cgd/t_cgd.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/dev/cgd/t_cgd.sh
diff -u src/tests/dev/cgd/t_cgd.sh:1.6 src/tests/dev/cgd/t_cgd.sh:1.7
--- src/tests/dev/cgd/t_cgd.sh:1.6	Fri Feb  4 19:44:00 2011
+++ src/tests/dev/cgd/t_cgd.sh	Fri Feb  4 19:58:10 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: t_cgd.sh,v 1.6 2011/02/04 19:44:00 pooka Exp $
+#	$NetBSD: t_cgd.sh,v 1.7 2011/02/04 19:58:10 pooka Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -97,9 +97,38 @@
 	env RUMP_SERVER=unix://csock rump.halt
 }
 
+
+atf_test_case non512 cleanup
+non512_head()
+{
+
+	atf_set descr Write a non-512 block to a raw cgd device
+}
+
+non512_body()
+{
+	d=$(atf_get_srcdir)
+	atf_check -s exit:0 \
+	${cgdserver} -d key=/dev/dk,hostpath=dk.img,size=1m unix://csock
+
+	export RUMP_SERVER=unix://csock
+	atf_check -s exit:0 sh -c echo 12345 | \
+	rump.cgdconfig -p cgd0 /dev/dk ${d}/paramsfile
+
+	atf_expect_fail PR kern/44515
+	atf_check -s exit:0 -e ignore sh -c \
+	echo die hard | rump.dd of=${rawcgd} bs=123 conv=sync
+}
+
+non512_cleanup()
+{
+	env RUMP_SERVER=unix://csock rump.halt
+}
+
 atf_init_test_cases()
 {
 
 	atf_add_test_case basic
 	atf_add_test_case wrongpass
+	atf_add_test_case non512
 }



CVS commit: src/usr.bin

2011-02-04 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Feb  4 20:06:23 UTC 2011

Modified Files:
src/usr.bin/rump_allserver: Makefile rump_allserver.1 rump_allserver.c
src/usr.bin/rump_server: Makefile

Log Message:
Allow to specify -d hostpath offset,size with disklabel.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/rump_allserver/Makefile
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/rump_allserver/rump_allserver.1
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/rump_allserver/rump_allserver.c
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/rump_server/Makefile

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/rump_allserver/Makefile
diff -u src/usr.bin/rump_allserver/Makefile:1.3 src/usr.bin/rump_allserver/Makefile:1.4
--- src/usr.bin/rump_allserver/Makefile:1.3	Mon Dec 13 19:36:34 2010
+++ src/usr.bin/rump_allserver/Makefile	Fri Feb  4 20:06:23 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2010/12/13 19:36:34 pooka Exp $
+#	$NetBSD: Makefile,v 1.4 2011/02/04 20:06:23 pooka Exp $
 #
 
 PROG=	rump_allserver
@@ -14,4 +14,7 @@
 LDADD+=	${RUMPDEVLDADD} ${RUMPFSLDADD} ${RUMPKERNLDADD} ${RUMPNETLDADD}
 LDADD+= -lrumpdev -lrumpvfs -lrumpnet -lrump -lrumpuser -lpthread
 
+DPADD+=	${LIBUTIL}
+LDADD+=	-lutil
+
 .include bsd.prog.mk

Index: src/usr.bin/rump_allserver/rump_allserver.1
diff -u src/usr.bin/rump_allserver/rump_allserver.1:1.11 src/usr.bin/rump_allserver/rump_allserver.1:1.12
--- src/usr.bin/rump_allserver/rump_allserver.1:1.11	Thu Feb  3 11:25:27 2011
+++ src/usr.bin/rump_allserver/rump_allserver.1	Fri Feb  4 20:06:23 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: rump_allserver.1,v 1.11 2011/02/03 11:25:27 pooka Exp $
+.\	$NetBSD: rump_allserver.1,v 1.12 2011/02/04 20:06:23 pooka Exp $
 .\
 .\ Copyright (c) 2010 Antti Kantee.  All rights reserved.
 .\
@@ -23,7 +23,7 @@
 .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\ SUCH DAMAGE.
 .\
-.Dd February 3, 2011
+.Dd February 4, 2011
 .Dt RUMP_SERVER 1
 .Os
 .Sh NAME
@@ -90,9 +90,16 @@
 Similar to
 .Xr dd 1 ,
 this argument accepts a suffix as the multiplier for the number.
+.It OR
+.It Ar disklabel
+Use a disklabel partition identifier to specify the offset and size
+of the mapping.
+.Ar hostpath
+must contain an existing and valid disklabel within the first 64k.
 .El
 .Pp
-The following specifier is optional:
+The following specifier is optional and used only if disklabel is
+not specified:
 .Bl -tag -width hostpath1234
 .It Ar offset
 Offset of the mapping.

Index: src/usr.bin/rump_allserver/rump_allserver.c
diff -u src/usr.bin/rump_allserver/rump_allserver.c:1.15 src/usr.bin/rump_allserver/rump_allserver.c:1.16
--- src/usr.bin/rump_allserver/rump_allserver.c:1.15	Thu Feb  3 11:25:27 2011
+++ src/usr.bin/rump_allserver/rump_allserver.c	Fri Feb  4 20:06:23 2011
@@ -1,7 +1,7 @@
-/*	$NetBSD: rump_allserver.c,v 1.15 2011/02/03 11:25:27 pooka Exp $	*/
+/*	$NetBSD: rump_allserver.c,v 1.16 2011/02/04 20:06:23 pooka Exp $	*/
 
 /*-
- * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
+ * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -27,10 +27,11 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: rump_allserver.c,v 1.15 2011/02/03 11:25:27 pooka Exp $);
+__RCSID($NetBSD: rump_allserver.c,v 1.16 2011/02/04 20:06:23 pooka Exp $);
 #endif /* !lint */
 
 #include sys/types.h
+#include sys/disklabel.h
 #include sys/signal.h
 #include sys/module.h
 
@@ -46,6 +47,7 @@
 #include stdlib.h
 #include string.h
 #include unistd.h
+#include util.h
 
 static void
 usage(void)
@@ -83,6 +85,8 @@
 	size,
 #define DOFFSET 3
 	offset,
+#define DLABEL 4
+	disklabel,
 	NULL
 };
 
@@ -91,6 +95,7 @@
 	const char *hostpath;
 	off_t flen;
 	off_t foffset;
+	char partition;
 	enum rump_etfs_type type;
 };
 
@@ -123,8 +128,10 @@
 			char *options, *value;
 			char *key, *hostpath;
 			long long flen, foffset;
+			char partition;
 
 			flen = foffset = 0;
+			partition = 0;
 			key = hostpath = NULL;
 			options = optarg;
 			while (*options) {
@@ -138,6 +145,7 @@
 	}
 	key = value;
 	break;
+
 case DFILE:
 	if (hostpath != NULL) {
 		fprintf(stderr,
@@ -146,6 +154,7 @@
 	}
 	hostpath = value;
 	break;
+
 case DSIZE:
 	if (flen != 0) {
 		fprintf(stderr,
@@ -166,6 +175,23 @@
 	foffset = strsuftoll(-d offset, value,
 	0, LLONG_MAX);
 	break;
+
+case DLABEL:
+	if (foffset != 0 || flen != 0) {
+		fprintf(stderr,
+		disklabel needs to be 
+		used alone\n);
+		usage();
+	}
+	if (strlen(value) != 1 ||
+	*value  'a' || *value  'z') {
+		fprintf(stderr,
+		invalid label part\n);
+		usage();
+	}
+	partition = *value;
+	break;
+
 default:
 	

CVS commit: src

2011-02-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb  4 22:07:08 UTC 2011

Modified Files:
src/include: stdlib.h
src/lib/libc/gen: arc4random.3 arc4random.c

Log Message:
add arc4random_{buf,uniform}, from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/include/stdlib.h
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/gen/arc4random.3
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/gen/arc4random.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/stdlib.h
diff -u src/include/stdlib.h:1.94 src/include/stdlib.h:1.95
--- src/include/stdlib.h:1.94	Wed Dec 22 14:47:56 2010
+++ src/include/stdlib.h	Fri Feb  4 17:07:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: stdlib.h,v 1.94 2010/12/22 19:47:56 jruoho Exp $	*/
+/*	$NetBSD: stdlib.h,v 1.95 2011/02/04 22:07:07 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -250,6 +250,8 @@
 
 uint32_t arc4random(void);
 void	 arc4random_stir(void);
+void	 arc4random_buf(void *, size_t);
+uint32_t arc4random_uniform(uint32_t);
 void	 arc4random_addrandom(u_char *, int);
 char	*getbsize(int *, long *);
 char	*cgetcap(char *, const char *, int);

Index: src/lib/libc/gen/arc4random.3
diff -u src/lib/libc/gen/arc4random.3:1.7 src/lib/libc/gen/arc4random.3:1.8
--- src/lib/libc/gen/arc4random.3:1.7	Mon Dec 26 14:40:14 2005
+++ src/lib/libc/gen/arc4random.3	Fri Feb  4 17:07:07 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: arc4random.3,v 1.7 2005/12/26 19:40:14 perry Exp $
+.\	$NetBSD: arc4random.3,v 1.8 2011/02/04 22:07:07 christos Exp $
 .\ $OpenBSD: arc4random.3,v 1.17 2000/12/21 14:07:41 aaron Exp $
 .\
 .\ Copyright 1997 Niels Provos pro...@physnet.uni-hamburg.de
@@ -31,11 +31,13 @@
 .\
 .\ Manual page, using -mandoc macros
 .\
-.Dd April 15, 1997
+.Dd February 4, 2011
 .Dt ARC4RANDOM 3
 .Os
 .Sh NAME
 .Nm arc4random ,
+.Nm arc4random_buf ,
+.Nm arc4random_uniform ,
 .Nm arc4random_stir ,
 .Nm arc4random_addrandom
 .Nd arc4 random number generator
@@ -46,6 +48,10 @@
 .Ft uint32_t
 .Fn arc4random void
 .Ft void
+.Fn arc4random_buf void *buffer size_t length
+.Ft uint32_t
+.Fn arc4random_uniform uint32_t upper_bound
+.Ft void
 .Fn arc4random_stir void
 .Ft void
 .Fn arc4random_addrandom u_char *dat int datlen
@@ -76,6 +82,20 @@
 and
 .Xr drand48 3 .
 .Pp
+The 
+.Fn arc4random_buf 
+function fills the 
+.Fa buffer
+with 
+.Fa length
+bytes of ARC4-derived random data.
+.Pp
+The
+.Fn arc4random_uniform
+function returns a uniformly distributed random number less than
+.Fa upper_bound
+avoiding modulo bias when the upper bound is not a power of two.
+.Pp
 The
 .Fn arc4random_stir
 function reads data from

Index: src/lib/libc/gen/arc4random.c
diff -u src/lib/libc/gen/arc4random.c:1.9 src/lib/libc/gen/arc4random.c:1.10
--- src/lib/libc/gen/arc4random.c:1.9	Sat Dec 24 16:11:16 2005
+++ src/lib/libc/gen/arc4random.c	Fri Feb  4 17:07:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: arc4random.c,v 1.9 2005/12/24 21:11:16 perry Exp $	*/
+/*	$NetBSD: arc4random.c,v 1.10 2011/02/04 22:07:07 christos Exp $	*/
 /*	$OpenBSD: arc4random.c,v 1.6 2001/06/05 05:05:38 pvalchev Exp $	*/
 
 /*
@@ -27,7 +27,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: arc4random.c,v 1.9 2005/12/24 21:11:16 perry Exp $);
+__RCSID($NetBSD: arc4random.c,v 1.10 2011/02/04 22:07:07 christos Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -44,9 +44,9 @@
 #endif
 
 struct arc4_stream {
-	u_int8_t i;
-	u_int8_t j;
-	u_int8_t s[256];
+	uint8_t i;
+	uint8_t j;
+	uint8_t s[256];
 };
 
 static int rs_initialized;
@@ -55,12 +55,11 @@
 static inline void arc4_init(struct arc4_stream *);
 static inline void arc4_addrandom(struct arc4_stream *, u_char *, int);
 static void arc4_stir(struct arc4_stream *);
-static inline u_int8_t arc4_getbyte(struct arc4_stream *);
-static inline u_int32_t arc4_getword(struct arc4_stream *);
+static inline uint8_t arc4_getbyte(struct arc4_stream *);
+static inline uint32_t arc4_getword(struct arc4_stream *);
 
 static inline void
-arc4_init(as)
-	struct arc4_stream *as;
+arc4_init(struct arc4_stream *as)
 {
 	int n;
 
@@ -71,13 +70,10 @@
 }
 
 static inline void
-arc4_addrandom(as, dat, datlen)
-	struct arc4_stream *as;
-	u_char *dat;
-	int datlen;
+arc4_addrandom(struct arc4_stream *as, u_char *dat, int datlen)
 {
 	int n;
-	u_int8_t si;
+	uint8_t si;
 
 	as-i--;
 	for (n = 0; n  256; n++) {
@@ -91,8 +87,7 @@
 }
 
 static void
-arc4_stir(as)
-	struct arc4_stream *as;
+arc4_stir(struct arc4_stream *as)
 {
 	int fd;
 	struct {
@@ -140,11 +135,10 @@
 		arc4_getbyte(as);
 }
 
-static inline u_int8_t
-arc4_getbyte(as)
-	struct arc4_stream *as;
+static inline uint8_t
+arc4_getbyte(struct arc4_stream *as)
 {
-	u_int8_t si, sj;
+	uint8_t si, sj;
 
 	as-i = (as-i + 1);
 	si = as-s[as-i];
@@ -155,11 +149,10 @@
 	return (as-s[(si + sj)  0xff]);
 }
 
-static inline u_int32_t
-arc4_getword(as)
-	struct arc4_stream *as;

CVS commit: src/lib/libc

2011-02-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb  4 22:07:42 UTC 2011

Modified Files:
src/lib/libc: shlib_version

Log Message:
bump for arc4random_{buf,uniform}


To generate a diff of this commit:
cvs rdiff -u -r1.220 -r1.221 src/lib/libc/shlib_version

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/shlib_version
diff -u src/lib/libc/shlib_version:1.220 src/lib/libc/shlib_version:1.221
--- src/lib/libc/shlib_version:1.220	Thu Dec 16 13:38:06 2010
+++ src/lib/libc/shlib_version	Fri Feb  4 17:07:41 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: shlib_version,v 1.220 2010/12/16 18:38:06 christos Exp $
+#	$NetBSD: shlib_version,v 1.221 2011/02/04 22:07:41 christos Exp $
 #	Remember to update distrib/sets/lists/base/shl.* when changing
 #
 # things we wish to do on next major version bump:
@@ -31,4 +31,4 @@
 #   it's insufficient bitwidth to implement all ctype class.
 #   see isblank's comment in ctype.h.
 major=12
-minor=175
+minor=176



CVS commit: src/distrib/sets/lists

2011-02-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb  4 22:09:18 UTC 2011

Modified Files:
src/distrib/sets/lists/base: ad.mips64eb ad.mips64el md.amd64
md.sparc64 shl.mi
src/distrib/sets/lists/comp: md.amd64 md.sparc64 shl.mi

Log Message:
bump libc for arc4random_{buf,uniform}


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/distrib/sets/lists/base/ad.mips64eb
cvs rdiff -u -r1.35 -r1.36 src/distrib/sets/lists/base/ad.mips64el
cvs rdiff -u -r1.110 -r1.111 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.103 -r1.104 src/distrib/sets/lists/base/md.sparc64
cvs rdiff -u -r1.571 -r1.572 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.94 -r1.95 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.83 -r1.84 src/distrib/sets/lists/comp/md.sparc64
cvs rdiff -u -r1.156 -r1.157 src/distrib/sets/lists/comp/shl.mi

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/base/ad.mips64eb
diff -u src/distrib/sets/lists/base/ad.mips64eb:1.37 src/distrib/sets/lists/base/ad.mips64eb:1.38
--- src/distrib/sets/lists/base/ad.mips64eb:1.37	Tue Feb  1 21:20:26 2011
+++ src/distrib/sets/lists/base/ad.mips64eb	Fri Feb  4 17:09:17 2011
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips64eb,v 1.37 2011/02/02 02:20:26 rmind Exp $
+# $NetBSD: ad.mips64eb,v 1.38 2011/02/04 22:09:17 christos Exp $
 ./libexec/ld.elf_so-64base-compat-shlib	compat,pic
 ./libexec/ld.elf_so-o32base-sysutil-bin	compat,pic
 ./usr/lib/64	base-compat-lib
@@ -66,7 +66,7 @@
 ./usr/lib/64/libbz2.so.1			base-compat-shlib	compat,pic
 ./usr/lib/64/libbz2.so.1.1			base-compat-shlib	compat,pic
 ./usr/lib/64/libc.so.12base-compat-shlib	compat,pic
-./usr/lib/64/libc.so.12.175			base-compat-shlib	compat,pic
+./usr/lib/64/libc.so.12.176			base-compat-shlib	compat,pic
 ./usr/lib/64/libcom_err.so.6			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/64/libcom_err.so.6.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/64/libcrypt.so.1			base-compat-shlib	compat,pic
@@ -325,7 +325,7 @@
 ./usr/lib/o32/libbz2.so.1			base-compat-shlib	compat,pic
 ./usr/lib/o32/libbz2.so.1.1			base-compat-shlib	compat,pic
 ./usr/lib/o32/libc.so.12			base-compat-shlib	compat,pic
-./usr/lib/o32/libc.so.12.175			base-compat-shlib	compat,pic
+./usr/lib/o32/libc.so.12.176			base-compat-shlib	compat,pic
 ./usr/lib/o32/libcom_err.so.6			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/o32/libcom_err.so.6.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/o32/libcrypt.so.1			base-compat-shlib	compat,pic

Index: src/distrib/sets/lists/base/ad.mips64el
diff -u src/distrib/sets/lists/base/ad.mips64el:1.35 src/distrib/sets/lists/base/ad.mips64el:1.36
--- src/distrib/sets/lists/base/ad.mips64el:1.35	Tue Feb  1 21:20:26 2011
+++ src/distrib/sets/lists/base/ad.mips64el	Fri Feb  4 17:09:17 2011
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips64el,v 1.35 2011/02/02 02:20:26 rmind Exp $
+# $NetBSD: ad.mips64el,v 1.36 2011/02/04 22:09:17 christos Exp $
 ./libexec/ld.elf_so-64base-compat-shlib	compat,pic
 ./libexec/ld.elf_so-o32base-sysutil-bin	compat,pic
 ./usr/lib/64	base-compat-lib
@@ -66,7 +66,7 @@
 ./usr/lib/64/libbz2.so.1			base-compat-shlib	compat,pic
 ./usr/lib/64/libbz2.so.1.1			base-compat-shlib	compat,pic
 ./usr/lib/64/libc.so.12base-compat-shlib	compat,pic
-./usr/lib/64/libc.so.12.175			base-compat-shlib	compat,pic
+./usr/lib/64/libc.so.12.176			base-compat-shlib	compat,pic
 ./usr/lib/64/libcom_err.so.6			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/64/libcom_err.so.6.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/64/libcrypt.so.1			base-compat-shlib	compat,pic
@@ -325,7 +325,7 @@
 ./usr/lib/o32/libbz2.so.1			base-compat-shlib	compat,pic
 ./usr/lib/o32/libbz2.so.1.1			base-compat-shlib	compat,pic
 ./usr/lib/o32/libc.so.12			base-compat-shlib	compat,pic
-./usr/lib/o32/libc.so.12.175			base-compat-shlib	compat,pic
+./usr/lib/o32/libc.so.12.176			base-compat-shlib	compat,pic
 ./usr/lib/o32/libcom_err.so.6			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/o32/libcom_err.so.6.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/o32/libcrypt.so.1			base-compat-shlib	compat,pic

Index: src/distrib/sets/lists/base/md.amd64
diff -u src/distrib/sets/lists/base/md.amd64:1.110 src/distrib/sets/lists/base/md.amd64:1.111
--- src/distrib/sets/lists/base/md.amd64:1.110	Tue Feb  1 21:20:26 2011
+++ src/distrib/sets/lists/base/md.amd64	Fri Feb  4 17:09:17 2011
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.110 2011/02/02 02:20:26 rmind Exp $
+# $NetBSD: md.amd64,v 1.111 2011/02/04 22:09:17 christos Exp $
 ./dev/lms0	base-obsolete		obsolete
 ./dev/mms0	base-obsolete		obsolete
 ./libexec/ld.elf_so-i386			base-sys-shlib		compat,pic
@@ -69,7 +69,7 @@
 ./usr/lib/i386/libbz2.so.1			base-compat-shlib	compat,pic
 ./usr/lib/i386/libbz2.so.1.1			base-compat-shlib	compat,pic
 ./usr/lib/i386/libc.so.12			base-compat-shlib	compat,pic

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

2011-02-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb  4 22:11:09 UTC 2011

Modified Files:
src/crypto/external/bsd/openssh/dist: key.c

Log Message:
Fix CVE-2011-0539:
Legacy certificates generated by OpenSSH might contain data
from the stack thus leaking confidential information.


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

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/key.c
diff -u src/crypto/external/bsd/openssh/dist/key.c:1.4 src/crypto/external/bsd/openssh/dist/key.c:1.5
--- src/crypto/external/bsd/openssh/dist/key.c:1.4	Sun Nov 21 13:59:04 2010
+++ src/crypto/external/bsd/openssh/dist/key.c	Fri Feb  4 17:11:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.4 2010/11/21 18:59:04 adam Exp $	*/
+/*	$NetBSD: key.c,v 1.5 2011/02/04 22:11:09 christos Exp $	*/
 /* $OpenBSD: key.c,v 1.90 2010/07/13 23:13:16 djm Exp $ */
 /*
  * read_bignum():
@@ -36,7 +36,7 @@
  */
 
 #include includes.h
-__RCSID($NetBSD: key.c,v 1.4 2010/11/21 18:59:04 adam Exp $);
+__RCSID($NetBSD: key.c,v 1.5 2011/02/04 22:11:09 christos Exp $);
 #include sys/param.h
 #include sys/types.h
 
@@ -1514,10 +1514,8 @@
 	buffer_put_cstring(k-cert-certblob, key_ssh_name(k));
 
 	/* -v01 certs put nonce first */
+	arc4random_buf(nonce, sizeof(nonce));
 	if (k-type == KEY_DSA_CERT || k-type == KEY_RSA_CERT) {
-		/*arc4random_buf(nonce, sizeof(nonce));*/
-		for (i = 0; i  sizeof(nonce); i += 4)
-			*(uint32_t *)(nonce[i]) = arc4random();
 		buffer_put_string(k-cert-certblob, nonce, sizeof(nonce));
 	}
 



CVS commit: src/usr.bin/xlint/lint1

2011-02-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb  4 23:31:23 UTC 2011

Modified Files:
src/usr.bin/xlint/lint1: tree.c

Log Message:
fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/usr.bin/xlint/lint1/tree.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/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.66 src/usr.bin/xlint/lint1/tree.c:1.67
--- src/usr.bin/xlint/lint1/tree.c:1.66	Sat Dec 18 15:57:41 2010
+++ src/usr.bin/xlint/lint1/tree.c	Fri Feb  4 18:31:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.66 2010/12/18 20:57:41 christos Exp $	*/
+/*	$NetBSD: tree.c,v 1.67 2011/02/04 23:31:23 christos Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(lint)
-__RCSID($NetBSD: tree.c,v 1.66 2010/12/18 20:57:41 christos Exp $);
+__RCSID($NetBSD: tree.c,v 1.67 2011/02/04 23:31:23 christos Exp $);
 #endif
 
 #include stdlib.h
@@ -1139,7 +1139,7 @@
 		goto assign;
 	case SHRASS:
 		if (pflag  !isutyp(lt)  !(tflag  isutyp(rt))) {
-			/* bitwise operation on s.v. possibly nonportabel */
+			/* bitwise operation on s.v. possibly nonportable */
 			warning(117);
 		}
 		goto assign;



CVS commit: src/usr.bin/xlint/lint1

2011-02-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb  4 23:32:44 UTC 2011

Modified Files:
src/usr.bin/xlint/lint1: Makefile op.h
Added Files:
src/usr.bin/xlint/lint1: Makefile.ops-c Makefile.ops-h ops.def

Log Message:
generate ops table dynamically. Will move the other table from tree.c there
too.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/xlint/lint1/Makefile.ops-c \
src/usr.bin/xlint/lint1/Makefile.ops-h src/usr.bin/xlint/lint1/ops.def
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/xlint/lint1/op.h

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

Modified files:

Index: src/usr.bin/xlint/lint1/Makefile
diff -u src/usr.bin/xlint/lint1/Makefile:1.45 src/usr.bin/xlint/lint1/Makefile:1.46
--- src/usr.bin/xlint/lint1/Makefile:1.45	Sun Jul 11 08:07:32 2010
+++ src/usr.bin/xlint/lint1/Makefile	Fri Feb  4 18:32:44 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.45 2010/07/11 12:07:32 mrg Exp $
+#	$NetBSD: Makefile,v 1.46 2011/02/04 23:32:44 christos Exp $
 
 .include bsd.own.mk
 
@@ -34,4 +34,7 @@
 DPADD+=		${LIBL}
 .endif
 
+.include Makefile.ops-h
+.include Makefile.ops-c
+
 .include bsd.prog.mk

Index: src/usr.bin/xlint/lint1/op.h
diff -u src/usr.bin/xlint/lint1/op.h:1.4 src/usr.bin/xlint/lint1/op.h:1.5
--- src/usr.bin/xlint/lint1/op.h:1.4	Fri Apr 25 18:18:34 2008
+++ src/usr.bin/xlint/lint1/op.h	Fri Feb  4 18:32:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: op.h,v 1.4 2008/04/25 22:18:34 christos Exp $	*/
+/*	$NetBSD: op.h,v 1.5 2011/02/04 23:32:44 christos Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -56,68 +56,4 @@
 	const char *m_name;	/* name of op. */
 } mod_t;
 
-typedef	enum {
-	NOOP	= 0,
-	ARROW,
-	POINT,
-	NOT,
-	COMPL,
-	INC,
-	DEC,
-	INCBEF,
-	DECBEF,
-	INCAFT,
-	DECAFT,
-	UPLUS,
-	UMINUS,
-	STAR,
-	AMPER,
-	MULT,
-	DIV,
-	MOD,
-	PLUS,
-	MINUS,
-	SHL,
-	SHR,
-	LT,
-	LE,
-	GT,
-	GE,
-	EQ,
-	NE,
-	AND,
-	XOR,
-	OR,
-	LOGAND,
-	LOGOR,
-	QUEST,
-	COLON,
-	ASSIGN,
-	MULASS,
-	DIVASS,
-	MODASS,
-	ADDASS,
-	SUBASS,
-	SHLASS,
-	SHRASS,
-	ANDASS,
-	XORASS,
-	ORASS,
-	NAME,
-	CON,
-	STRING,
-	FSEL,
-	CALL,
-	COMMA,
-	CVT,
-	ICALL,
-	LOAD,
-	PUSH,
-	RETURN,
-	REAL,
-	IMAG,
-	INIT,		/* pseudo op, not used in trees */
-	CASE,		/* pseudo op, not used in trees */
-	FARG		/* pseudo op, not used in trees */
-#define NOPS	((int)FARG + 1)
-} op_t;
+#include ops.h

Added files:

Index: src/usr.bin/xlint/lint1/Makefile.ops-c
diff -u /dev/null src/usr.bin/xlint/lint1/Makefile.ops-c:1.1
--- /dev/null	Fri Feb  4 18:32:44 2011
+++ src/usr.bin/xlint/lint1/Makefile.ops-c	Fri Feb  4 18:32:44 2011
@@ -0,0 +1,9 @@
+#	$NetBSD: Makefile.ops-c,v 1.1 2011/02/04 23:32:44 christos Exp $
+
+ops.c: ops.def
+	${_MKTARGET_CREATE}
+	AWK=${TOOL_AWK:Q} ${HOST_SH} ${.CURDIR}/mkops -c ${.ALLSRC}  ${.TARGET}
+
+SRCS+=		ops.c
+CLEANFILES+=	ops.c
+DPSRCS+=	ops.c
Index: src/usr.bin/xlint/lint1/Makefile.ops-h
diff -u /dev/null src/usr.bin/xlint/lint1/Makefile.ops-h:1.1
--- /dev/null	Fri Feb  4 18:32:44 2011
+++ src/usr.bin/xlint/lint1/Makefile.ops-h	Fri Feb  4 18:32:44 2011
@@ -0,0 +1,10 @@
+#	$NetBSD: Makefile.ops-h,v 1.1 2011/02/04 23:32:44 christos Exp $
+
+ops.h: ops.def
+	${_MKTARGET_CREATE}
+	AWK=${TOOL_AWK:Q} ${HOST_SH} ${.CURDIR}/mkops -h ${.ALLSRC}  ${.TARGET}
+
+CLEANFILES+=	ops.h
+
+op.h: ops.h
+.BEGIN: ops.h
Index: src/usr.bin/xlint/lint1/ops.def
diff -u /dev/null src/usr.bin/xlint/lint1/ops.def:1.1
--- /dev/null	Fri Feb  4 18:32:44 2011
+++ src/usr.bin/xlint/lint1/ops.def	Fri Feb  4 18:32:44 2011
@@ -0,0 +1,62 @@
+no-op	NOOP
+-	ARROW
+.	POINT
+!	NOT
+~	COMPL
+p + 1	INC
+p - 1	DEC
+++p	INCBEF
+--p	DECBEF
+p++	INCAFT
+p--	DECAFT
++p	UPLUS
+-p	UMINUS
+*p	STAR
+	AMPER
+p * p	MULT
+p / p	DIV
+p % p	MOD
+p + p	PLUS
+p - p	MINUS
+p  p	SHL
+p  p	SHR
+p  p	LT
+p = p	LE
+p  p	GT
+p = p	GE
+p == p	EQ
+p != p	NE
+p  p	AND
+p ^ p 	XOR
+p | p	OR
+p  p	LOGAND
+p || p	LOGOR
+?	QUEST
+:	COLON
+p = p	ASSIGN
+p *= p	MULASS
+p /= p	DIVASS
+p %= p	MODASS
+p += p	ADDASS
+p -= p	SUBASS
+p  p	SHLASS
+p  p	SHRASS
+p = p	ANDASS
+p ^= p	XORASS
+p |= p	ORASS
+n	NAME
+const	CON
+char *	STRING
+fsel	FSEL
+p()	CALL
+,	COMMA
+(cast)p	CVT
+icall	ICALL
+load	LOAD
+push	PUSH
+return	RETURN
+p.re	REAL
+p.im	IMAG
+p = {}	INIT	/* pseudo op not used in trees */
+case	CASE	/* pseudo op not used in trees */
+f(p)	FARG	/* pseudo op not used in trees */



CVS commit: src/lib/libc/gen

2011-02-04 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Feb  5 00:24:08 UTC 2011

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

Log Message:
Remove trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/gen/arc4random.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/arc4random.3
diff -u src/lib/libc/gen/arc4random.3:1.8 src/lib/libc/gen/arc4random.3:1.9
--- src/lib/libc/gen/arc4random.3:1.8	Fri Feb  4 22:07:07 2011
+++ src/lib/libc/gen/arc4random.3	Sat Feb  5 00:24:08 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: arc4random.3,v 1.8 2011/02/04 22:07:07 christos Exp $
+.\	$NetBSD: arc4random.3,v 1.9 2011/02/05 00:24:08 wiz Exp $
 .\ $OpenBSD: arc4random.3,v 1.17 2000/12/21 14:07:41 aaron Exp $
 .\
 .\ Copyright 1997 Niels Provos pro...@physnet.uni-hamburg.de
@@ -82,11 +82,11 @@
 and
 .Xr drand48 3 .
 .Pp
-The 
-.Fn arc4random_buf 
-function fills the 
+The
+.Fn arc4random_buf
+function fills the
 .Fa buffer
-with 
+with
 .Fa length
 bytes of ARC4-derived random data.
 .Pp



CVS commit: src/gnu/dist/gcc4/libstdc++-v3/include/ext

2011-02-04 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Feb  5 00:37:40 UTC 2011

Modified Files:
src/gnu/dist/gcc4/libstdc++-v3/include/ext: ropeimpl.h

Log Message:
Explicitly use template to allow building with the more strict
template lookup in clang. From FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/gnu/dist/gcc4/libstdc++-v3/include/ext/ropeimpl.h

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

Modified files:

Index: src/gnu/dist/gcc4/libstdc++-v3/include/ext/ropeimpl.h
diff -u src/gnu/dist/gcc4/libstdc++-v3/include/ext/ropeimpl.h:1.1.1.1 src/gnu/dist/gcc4/libstdc++-v3/include/ext/ropeimpl.h:1.2
--- src/gnu/dist/gcc4/libstdc++-v3/include/ext/ropeimpl.h:1.1.1.1	Thu Apr 20 10:03:52 2006
+++ src/gnu/dist/gcc4/libstdc++-v3/include/ext/ropeimpl.h	Sat Feb  5 00:37:40 2011
@@ -432,7 +432,7 @@
 {
   size_t __old_len = __r-_M_size;
   _CharT* __new_data = (_CharT*)
-	_Data_allocate(_S_rounded_up_size(__old_len + __len));
+	_Rope_rep_base_CharT, _Alloc::_Data_allocate(_S_rounded_up_size(__old_len + __len));
   _RopeLeaf* __result;
 
   uninitialized_copy_n(__r-_M_data, __old_len, __new_data);
@@ -817,7 +817,7 @@
 	if (__result_len  __lazy_threshold)
 	  goto lazy;
 	__section = (_CharT*)
-	  _Data_allocate(_S_rounded_up_size(__result_len));
+	  _Rope_rep_base_CharT, _Alloc::_Data_allocate(_S_rounded_up_size(__result_len));
 	try
 	  {	(*(__f-_M_fn))(__start, __result_len, __section); }
 	catch(...)



CVS commit: src/sys/kern

2011-02-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb  5 01:22:13 UTC 2011

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

Log Message:
avoid code duplication.


To generate a diff of this commit:
cvs rdiff -u -r1.178 -r1.179 src/sys/kern/init_sysctl.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/init_sysctl.c
diff -u src/sys/kern/init_sysctl.c:1.178 src/sys/kern/init_sysctl.c:1.179
--- src/sys/kern/init_sysctl.c:1.178	Fri Jan 28 15:31:10 2011
+++ src/sys/kern/init_sysctl.c	Fri Feb  4 20:22:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_sysctl.c,v 1.178 2011/01/28 20:31:10 pooka Exp $ */
+/*	$NetBSD: init_sysctl.c,v 1.179 2011/02/05 01:22:12 christos Exp $ */
 
 /*-
  * Copyright (c) 2003, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: init_sysctl.c,v 1.178 2011/01/28 20:31:10 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: init_sysctl.c,v 1.179 2011/02/05 01:22:12 christos Exp $);
 
 #include opt_sysv.h
 #include opt_compat_netbsd.h
@@ -734,22 +734,19 @@
 		   sysctl_security_setidcore, 0, security_setidcore_mode,
 		   0,
 		   CTL_CREATE, CTL_EOL);
-#ifdef KERN_SA
 	sysctl_createv(clog, 0, NULL, NULL,
 		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
 		   CTLTYPE_INT, no_sa_support,
-		   SYSCTL_DESCR(0 if the kernel supports SA, otherwise it doesn't),
-		   NULL, 0, sa_system_disabled, 0,
-		   CTL_KERN, CTL_CREATE, CTL_EOL);
+		   SYSCTL_DESCR(0 if the kernel supports SA, otherwise 
+		   it doesn't),
+		   NULL, 
+#ifdef KERN_SA
+		   0, sa_system_disabled,
 #else
-	sysctl_createv(clog, 0, NULL, NULL,
-		   CTLFLAG_PERMANENT|CTLFLAG_IMMEDIATE,
-		   CTLTYPE_INT, no_sa_support,
-		   SYSCTL_DESCR(0 if the kernel supports SA, otherwise it doesn't),
-		   NULL, 1, NULL, 0,
-		   CTL_KERN, CTL_CREATE, CTL_EOL);
+		   1, NULL,
 #endif
-
+		   0,
+		   CTL_KERN, CTL_CREATE, CTL_EOL);
 	/* kern.posix. */
 	sysctl_createv(clog, 0, NULL, rnode,
 			CTLFLAG_PERMANENT,



CVS commit: src/usr.bin/xlint/lint1

2011-02-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Feb  5 03:09:46 UTC 2011

Modified Files:
src/usr.bin/xlint/lint1: Makefile.ops-c Makefile.ops-h

Log Message:
fix tools build. Why doesn't .PARSEDIR work?


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/xlint/lint1/Makefile.ops-c \
src/usr.bin/xlint/lint1/Makefile.ops-h

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

Modified files:

Index: src/usr.bin/xlint/lint1/Makefile.ops-c
diff -u src/usr.bin/xlint/lint1/Makefile.ops-c:1.1 src/usr.bin/xlint/lint1/Makefile.ops-c:1.2
--- src/usr.bin/xlint/lint1/Makefile.ops-c:1.1	Fri Feb  4 18:32:44 2011
+++ src/usr.bin/xlint/lint1/Makefile.ops-c	Fri Feb  4 22:09:46 2011
@@ -1,8 +1,8 @@
-#	$NetBSD: Makefile.ops-c,v 1.1 2011/02/04 23:32:44 christos Exp $
+#	$NetBSD: Makefile.ops-c,v 1.2 2011/02/05 03:09:46 christos Exp $
 
 ops.c: ops.def
 	${_MKTARGET_CREATE}
-	AWK=${TOOL_AWK:Q} ${HOST_SH} ${.CURDIR}/mkops -c ${.ALLSRC}  ${.TARGET}
+	AWK=${TOOL_AWK:Q} ${HOST_SH} ${NETBSDSRCDIR}/usr.bin/xlint/lint1/mkops -c ${.ALLSRC}  ${.TARGET}
 
 SRCS+=		ops.c
 CLEANFILES+=	ops.c
Index: src/usr.bin/xlint/lint1/Makefile.ops-h
diff -u src/usr.bin/xlint/lint1/Makefile.ops-h:1.1 src/usr.bin/xlint/lint1/Makefile.ops-h:1.2
--- src/usr.bin/xlint/lint1/Makefile.ops-h:1.1	Fri Feb  4 18:32:44 2011
+++ src/usr.bin/xlint/lint1/Makefile.ops-h	Fri Feb  4 22:09:46 2011
@@ -1,8 +1,8 @@
-#	$NetBSD: Makefile.ops-h,v 1.1 2011/02/04 23:32:44 christos Exp $
+#	$NetBSD: Makefile.ops-h,v 1.2 2011/02/05 03:09:46 christos Exp $
 
 ops.h: ops.def
 	${_MKTARGET_CREATE}
-	AWK=${TOOL_AWK:Q} ${HOST_SH} ${.CURDIR}/mkops -h ${.ALLSRC}  ${.TARGET}
+	AWK=${TOOL_AWK:Q} ${HOST_SH} ${NETBSDSRCDIR}/usr.bin/xlint/lint1/mkops -h ${.ALLSRC}  ${.TARGET}
 
 CLEANFILES+=	ops.h
 



CVS commit: [matt-nb5-mips64] src/sys

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:00:15 UTC 2011

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: pmap.h vmparam.h
src/sys/arch/mips/mips [matt-nb5-mips64]: mips3_clock.c mips_fixup.c
mips_fpu.c pmap_segtab.c
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_cpucore.c
rmixl_cpucorevar.h
src/sys/kern [matt-nb5-mips64]: kern_cctr.c kern_lwp.c kern_mutex.c
kern_runq.c kern_rwlock.c kern_stub.c subr_autoconf.c
src/sys/lib/libkern [matt-nb5-mips64]: softfloat.c
src/sys/miscfs/procfs [matt-nb5-mips64]: procfs_linux.c
src/sys/sys [matt-nb5-mips64]: lwp.h

Log Message:
- include opt_multiprocessor.h for explicit MULTIPROCESSOR dependency


To generate a diff of this commit:
cvs rdiff -u -r1.54.26.15 -r1.54.26.16 src/sys/arch/mips/include/pmap.h
cvs rdiff -u -r1.41.28.17 -r1.41.28.18 src/sys/arch/mips/include/vmparam.h
cvs rdiff -u -r1.10.28.1 -r1.10.28.2 src/sys/arch/mips/mips/mips3_clock.c
cvs rdiff -u -r1.1.2.8 -r1.1.2.9 src/sys/arch/mips/mips/mips_fixup.c \
src/sys/arch/mips/mips/pmap_segtab.c
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/arch/mips/mips/mips_fpu.c
cvs rdiff -u -r1.1.2.7 -r1.1.2.8 src/sys/arch/mips/rmi/rmixl_cpucore.c
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/arch/mips/rmi/rmixl_cpucorevar.h
cvs rdiff -u -r1.8 -r1.8.14.1 src/sys/kern/kern_cctr.c
cvs rdiff -u -r1.126.2.2 -r1.126.2.2.4.1 src/sys/kern/kern_lwp.c
cvs rdiff -u -r1.44 -r1.44.10.1 src/sys/kern/kern_mutex.c
cvs rdiff -u -r1.22.4.3.4.1 -r1.22.4.3.4.2 src/sys/kern/kern_runq.c
cvs rdiff -u -r1.28.10.2.2.1 -r1.28.10.2.2.2 src/sys/kern/kern_rwlock.c
cvs rdiff -u -r1.11 -r1.11.8.1 src/sys/kern/kern_stub.c
cvs rdiff -u -r1.163.4.2 -r1.163.4.2.4.1 src/sys/kern/subr_autoconf.c
cvs rdiff -u -r1.4 -r1.4.94.1 src/sys/lib/libkern/softfloat.c
cvs rdiff -u -r1.54.14.1 -r1.54.14.2 src/sys/miscfs/procfs/procfs_linux.c
cvs rdiff -u -r1.114.4.1 -r1.114.4.1.4.1 src/sys/sys/lwp.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/mips/include/pmap.h
diff -u src/sys/arch/mips/include/pmap.h:1.54.26.15 src/sys/arch/mips/include/pmap.h:1.54.26.16
--- src/sys/arch/mips/include/pmap.h:1.54.26.15	Wed Dec 22 06:05:41 2010
+++ src/sys/arch/mips/include/pmap.h	Sat Feb  5 06:00:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.54.26.15 2010/12/22 06:05:41 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.54.26.16 2011/02/05 06:00:12 cliff Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -74,6 +74,8 @@
 #ifndef	_MIPS_PMAP_H_
 #define	_MIPS_PMAP_H_
 
+#include opt_multiprocessor.h
+
 #include mips/cpuregs.h	/* for KSEG0 below */
 //#include mips/pte.h
 

Index: src/sys/arch/mips/include/vmparam.h
diff -u src/sys/arch/mips/include/vmparam.h:1.41.28.17 src/sys/arch/mips/include/vmparam.h:1.41.28.18
--- src/sys/arch/mips/include/vmparam.h:1.41.28.17	Thu Aug 19 07:19:31 2010
+++ src/sys/arch/mips/include/vmparam.h	Sat Feb  5 06:00:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.41.28.17 2010/08/19 07:19:31 matt Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.41.28.18 2011/02/05 06:00:12 cliff Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -79,6 +79,8 @@
 #ifndef _MIPS_VMPARAM_H_
 #define	_MIPS_VMPARAM_H_
 
+#include opt_multiprocessor.h
+
 /*
  * Machine dependent VM constants for MIPS.
  */

Index: src/sys/arch/mips/mips/mips3_clock.c
diff -u src/sys/arch/mips/mips/mips3_clock.c:1.10.28.1 src/sys/arch/mips/mips/mips3_clock.c:1.10.28.2
--- src/sys/arch/mips/mips/mips3_clock.c:1.10.28.1	Wed Jan 20 06:58:36 2010
+++ src/sys/arch/mips/mips/mips3_clock.c	Sat Feb  5 06:00:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips3_clock.c,v 1.10.28.1 2010/01/20 06:58:36 matt Exp $	*/
+/*	$NetBSD: mips3_clock.c,v 1.10.28.2 2011/02/05 06:00:13 cliff Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -78,7 +78,9 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: mips3_clock.c,v 1.10.28.1 2010/01/20 06:58:36 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: mips3_clock.c,v 1.10.28.2 2011/02/05 06:00:13 cliff Exp $);
+
+#include opt_multiprocessor.h
 
 #include sys/param.h
 #include sys/systm.h

Index: src/sys/arch/mips/mips/mips_fixup.c
diff -u src/sys/arch/mips/mips/mips_fixup.c:1.1.2.8 src/sys/arch/mips/mips/mips_fixup.c:1.1.2.9
--- src/sys/arch/mips/mips/mips_fixup.c:1.1.2.8	Wed Dec 29 00:46:17 2010
+++ src/sys/arch/mips/mips/mips_fixup.c	Sat Feb  5 06:00:13 2011
@@ -29,8 +29,9 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: mips_fixup.c,v 1.1.2.8 2010/12/29 00:46:17 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: mips_fixup.c,v 1.1.2.9 2011/02/05 06:00:13 cliff Exp $);
 
+#include opt_multiprocessor.h
 #include opt_mips3_wired.h
 #include sys/param.h
 
Index: src/sys/arch/mips/mips/pmap_segtab.c
diff -u src/sys/arch/mips/mips/pmap_segtab.c:1.1.2.8 src/sys/arch/mips/mips/pmap_segtab.c:1.1.2.9
--- src/sys/arch/mips/mips/pmap_segtab.c:1.1.2.8	Mon Aug 16 

CVS commit: [matt-nb5-mips64] src/sys/arch/mips/conf

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:01:23 UTC 2011

Modified Files:
src/sys/arch/mips/conf [matt-nb5-mips64]: files.mips

Log Message:
- define config options flag MIPS_DDB_WATCH, enables COP0 watchpoint support in 
ddb


To generate a diff of this commit:
cvs rdiff -u -r1.58.24.12 -r1.58.24.13 src/sys/arch/mips/conf/files.mips

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/mips/conf/files.mips
diff -u src/sys/arch/mips/conf/files.mips:1.58.24.12 src/sys/arch/mips/conf/files.mips:1.58.24.13
--- src/sys/arch/mips/conf/files.mips:1.58.24.12	Wed Dec 29 00:40:40 2010
+++ src/sys/arch/mips/conf/files.mips	Sat Feb  5 06:01:23 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mips,v 1.58.24.12 2010/12/29 00:40:40 matt Exp $
+#	$NetBSD: files.mips,v 1.58.24.13 2011/02/05 06:01:23 cliff Exp $
 #
 
 defflag	opt_cputype.h		NOFPU FPEMUL
@@ -17,6 +17,7 @@
 defflag opt_mips3_wired.h		ENABLE_MIPS3_WIRED_MAP
 
 defflag	opt_ddb.h		DDB_TRACE
+defflag	opt_ddb.h		MIPS_DDB_WATCH
 
 file	arch/mips/mips/locore_mips1.S		mips1
 file	arch/mips/mips/locore_mips3.S		mips3 | mips4 | mips32 | mips64



CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/conf

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:02:09 UTC 2011

Modified Files:
src/sys/arch/evbmips/conf [matt-nb5-mips64]: XLSATX

Log Message:
- add options MIPS_DDB_WATCH, to enable COP0 watchpoint support in ddb
- add config netbsd-sd0a for disk-rooted kernel


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.11 -r1.1.2.12 src/sys/arch/evbmips/conf/XLSATX

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/evbmips/conf/XLSATX
diff -u src/sys/arch/evbmips/conf/XLSATX:1.1.2.11 src/sys/arch/evbmips/conf/XLSATX:1.1.2.12
--- src/sys/arch/evbmips/conf/XLSATX:1.1.2.11	Mon Aug 16 18:44:45 2010
+++ src/sys/arch/evbmips/conf/XLSATX	Sat Feb  5 06:02:09 2011
@@ -1,8 +1,8 @@
-#	$NetBSD: XLSATX,v 1.1.2.11 2010/08/16 18:44:45 matt Exp $
+#	$NetBSD: XLSATX,v 1.1.2.12 2011/02/05 06:02:09 cliff Exp $
 
 include 	arch/evbmips/conf/std.rmixl
 
-#ident 		XLSATX-$Revision: 1.1.2.11 $
+#ident 		XLSATX-$Revision: 1.1.2.12 $
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
@@ -39,6 +39,7 @@
 options 	USERCONF	# userconf(4) support
 #options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel
 options 	DDB		# kernel dynamic debugger
+options		MIPS_DDB_WATCH	# enable T_WATCH (see IEU_DEFAUTURE[DBE])
 options 	DDB_HISTORY_SIZE=100 # enable history editing in DDB
 makeoptions 	DEBUG=-g	# compile full symbol table
 options 	SYMTAB_SPACE=50	# size for embedded symbol table
@@ -135,6 +136,7 @@
 config	netbsd		root on ? type ?
 config	netbsd-wm0	root on wm0 type nfs
 config	netbsd-msk0	root on msk0 type nfs
+config	netbsd-sd0a	root on sd0a type ffs
 
 
 mainbus0 	at root



CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/rmixl

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:02:52 UTC 2011

Modified Files:
src/sys/arch/evbmips/rmixl [matt-nb5-mips64]: machdep.c

Log Message:
- include opt_multiprocessor.h for MULTIPROCESSOR dependency
- in rmixl_pcr_init_core(), ifdef MIPS_DDB_WATCH, clear IEU_DEFEATURE
so we can get T_WATCH execeptions if/when we set COP0 watchpoint


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.32 -r1.1.2.33 src/sys/arch/evbmips/rmixl/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/evbmips/rmixl/machdep.c
diff -u src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.32 src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.33
--- src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.32	Fri Jan  7 00:17:42 2011
+++ src/sys/arch/evbmips/rmixl/machdep.c	Sat Feb  5 06:02:51 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.1.2.32 2011/01/07 00:17:42 cliff Exp $	*/
+/*	$NetBSD: machdep.c,v 1.1.2.33 2011/02/05 06:02:51 cliff Exp $	*/
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -112,10 +112,11 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.1.2.32 2011/01/07 00:17:42 cliff Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.1.2.33 2011/02/05 06:02:51 cliff Exp $);
 
 #define __INTR_PRIVATE
 
+#include opt_multiprocessor.h
 #include opt_ddb.h
 #include opt_com.h
 #include opt_execfmt.h
@@ -488,6 +489,17 @@
 	r = rmixl_mfcr(RMIXL_PCR_L1D_CONFIG0);
 	r = ~__BIT(14);			/* disable Unaligned Access */
 	rmixl_mtcr(RMIXL_PCR_L1D_CONFIG0, r);
+
+#if defined(DDB)  defined(MIPS_DDB_WATCH)
+	/*
+	 * clear IEU_DEFEATURE[DBE]
+	 * this enables COP0 watchpoint to trigger T_WATCH exception
+	 * instead of signaling JTAG.
+	 */
+	r = rmixl_mfcr(RMIXL_PCR_IEU_DEFEATURE);
+	r = ~__BIT(7);
+	rmixl_mtcr(RMIXL_PCR_IEU_DEFEATURE, r);
+#endif
 }
 
 #ifdef MULTIPROCESSOR



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:04:08 UTC 2011

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: cpu.h

Log Message:
- include cpuset.h, we're using CPUSET_* macros now for cpus_running, 
cpus_paused, etc.
those data are now type mips_cpuset_t.
- move opt_* includes up above sys/* includes
- add declarations for IPI broadcast, multicast functions
- add declarations for cpu halt, pause, resume, etc functions useful for ddb


To generate a diff of this commit:
cvs rdiff -u -r1.90.16.32 -r1.90.16.33 src/sys/arch/mips/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/mips/include/cpu.h
diff -u src/sys/arch/mips/include/cpu.h:1.90.16.32 src/sys/arch/mips/include/cpu.h:1.90.16.33
--- src/sys/arch/mips/include/cpu.h:1.90.16.32	Wed Sep  1 00:59:42 2010
+++ src/sys/arch/mips/include/cpu.h	Sat Feb  5 06:04:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.90.16.32 2010/09/01 00:59:42 matt Exp $	*/
+/*	$NetBSD: cpu.h,v 1.90.16.33 2011/02/05 06:04:07 cliff Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -46,16 +46,18 @@
 #ifdef _KERNEL
 
 #ifndef _LOCORE
-#include sys/cpu_data.h
-#include sys/device.h
-#include sys/evcnt.h
-
 #if defined(_KERNEL_OPT)
 #include opt_cputype.h
 #include opt_lockdebug.h
 #include opt_multiprocessor.h
 #endif
 
+#include sys/cpu_data.h
+#include sys/device.h
+#include sys/evcnt.h
+#include mips/reg.h
+#include mips/cpuset.h
+
 struct cpu_info {
 	struct cpu_data ci_data;	/* MI per-cpu data */
 	struct cpu_info *ci_next;	/* Next CPU in list */
@@ -352,6 +354,16 @@
 #define	cpu_swapout(p)			panic(cpu_swapout: can't get here);
 
 /*
+ * Send an inter-processor interupt to each other CPU (excludes curcpu())
+ */
+void cpu_broadcast_ipi(int);
+
+/*
+ * Send an inter-processor interupt to CPUs in cpuset (excludes curcpu())
+ */
+void cpu_multicast_ipi(mips_cpuset_t, int);
+
+/*
  * Send an inter-processor interupt to another CPU.
  */
 int cpu_send_ipi(struct cpu_info *, int);
@@ -426,13 +438,6 @@
 
 extern int mips_poolpage_vmfreelist;	/* freelist to allocate poolpages */
 
-/* cpu_subr.c */
-#ifdef MULTIPROCESSOR
-extern volatile u_long cpus_running;
-extern volatile u_long cpus_hatched;
-extern volatile u_long cpus_halted;
-#endif
-
 struct cpu_info *
 	cpu_info_alloc(struct pmap_tlb_info *, cpuid_t, cpuid_t, cpuid_t,
 	cpuid_t);
@@ -441,10 +446,25 @@
 #ifdef _LP64
 void	cpu_vmspace_exec(struct lwp *, vaddr_t, vaddr_t);
 #endif
+
 #ifdef MULTIPROCESSOR
 void	cpu_hatch(struct cpu_info *ci);
 void	cpu_trampoline(void);
 void	cpu_boot_secondary_processors(void);
+void	cpu_halt(void);
+void	cpu_halt_others(void);
+void	cpu_pause(struct reg *);
+void	cpu_pause_others(void);
+void	cpu_resume(int);
+void	cpu_resume_others(void);
+int	cpu_is_paused(int);
+void	cpu_debug_dump(void);
+
+extern volatile mips_cpuset_t cpus_running;
+extern volatile mips_cpuset_t cpus_hatched;
+extern volatile mips_cpuset_t cpus_paused;
+extern volatile mips_cpuset_t cpus_resumed;
+extern volatile mips_cpuset_t cpus_halted;
 #endif
 
 /* copy.S */



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:04:59 UTC 2011

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: db_machdep.h

Log Message:
- declare new md MP ddb functions.


To generate a diff of this commit:
cvs rdiff -u -r1.22.62.1 -r1.22.62.2 src/sys/arch/mips/include/db_machdep.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/mips/include/db_machdep.h
diff -u src/sys/arch/mips/include/db_machdep.h:1.22.62.1 src/sys/arch/mips/include/db_machdep.h:1.22.62.2
--- src/sys/arch/mips/include/db_machdep.h:1.22.62.1	Mon Feb  1 04:16:19 2010
+++ src/sys/arch/mips/include/db_machdep.h	Sat Feb  5 06:04:59 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.h,v 1.22.62.1 2010/02/01 04:16:19 matt Exp $ */
+/* $NetBSD: db_machdep.h,v 1.22.62.2 2011/02/05 06:04:59 cliff Exp $ */
 
 /*
  * Copyright (c) 1997 Jonathan Stone (hereinafter referred to as the author)
@@ -113,6 +113,13 @@
 db_addr_t branch_taken(int inst, db_addr_t pc, db_regs_t *regs);
 db_addr_t next_instr_address(db_addr_t pc, bool bd);
 
+bool ddb_running_on_this_cpu(void);
+bool ddb_running_on_any_cpu(void);
+void db_resume_others(void);
+#ifdef MIPS_DDB_WATCH
+void db_mach_watch_set_all(void);
+#endif
+
 /*
  * We have machine-dependent commands.
  */



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:05:35 UTC 2011

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: intr.h

Log Message:
- include opt_multiprocessor.h for MULTIPROCESSOR dependency
- add IPI tag defines for SUSPEND, HALT, and bump NIPIS


To generate a diff of this commit:
cvs rdiff -u -r1.3.96.14 -r1.3.96.15 src/sys/arch/mips/include/intr.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/mips/include/intr.h
diff -u src/sys/arch/mips/include/intr.h:1.3.96.14 src/sys/arch/mips/include/intr.h:1.3.96.15
--- src/sys/arch/mips/include/intr.h:1.3.96.14	Wed Dec 22 06:09:02 2010
+++ src/sys/arch/mips/include/intr.h	Sat Feb  5 06:05:35 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.h,v 1.3.96.14 2010/12/22 06:09:02 matt Exp $ */
+/* $NetBSD: intr.h,v 1.3.96.15 2011/02/05 06:05:35 cliff Exp $ */
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -31,6 +31,8 @@
 #ifndef _MIPS_INTR_H_
 #define	_MIPS_INTR_H_
 
+#include opt_multiprocessor.h
+
 /*
  * This is a common machine/intr.h for all MIPS platforms.
  */
@@ -63,7 +65,9 @@
 #define	IPI_FPSAVE	3		/* save current fp registers */
 #define	IPI_SYNCICACHE	4		/* sync icache for pages */
 #define	IPI_KPREEMPT	5		/* schedule a kernel preemption */
-#define	NIPIS		6
+#define	IPI_SUSPEND	6		/* DDB suspend signaling */
+#define	IPI_HALT	7		/* halt cpu */
+#define	NIPIS		8
 
 #ifdef __INTR_PRIVATE
 struct splsw {



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:06:11 UTC 2011

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: cpu_subr.c

Log Message:
- add ddb related includes
- convert 'cpus_running' et. al. to mips_cpuset_t, and use CPUSET_* macros
- add IPI broadcast, multicast functions
- add IPI halt, pause, resume, functions and related, useful for MP ddb


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.13 -r1.1.2.14 src/sys/arch/mips/mips/cpu_subr.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/mips/mips/cpu_subr.c
diff -u src/sys/arch/mips/mips/cpu_subr.c:1.1.2.13 src/sys/arch/mips/mips/cpu_subr.c:1.1.2.14
--- src/sys/arch/mips/mips/cpu_subr.c:1.1.2.13	Wed Dec 22 05:53:38 2010
+++ src/sys/arch/mips/mips/cpu_subr.c	Sat Feb  5 06:06:11 2011
@@ -29,10 +29,11 @@
 
 #include sys/cdefs.h
 
+#include opt_ddb.h
 #include opt_multiprocessor.h
 #include opt_sa.h
 
-__KERNEL_RCSID(0, $NetBSD: cpu_subr.c,v 1.1.2.13 2010/12/22 05:53:38 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu_subr.c,v 1.1.2.14 2011/02/05 06:06:11 cliff Exp $);
 
 #include sys/param.h
 #include sys/cpu.h
@@ -57,6 +58,15 @@
 #include mips/frame.h
 #include mips/userret.h
 #include mips/pte.h
+#include mips/cpuset.h
+
+#if defined(DDB) || defined(KGDB)
+#ifdef DDB 
+#include mips/db_machdep.h
+#include ddb/db_command.h
+#include ddb/db_output.h
+#endif
+#endif
 
 struct cpu_info cpu_info_store
 #ifdef MULTIPROCESSOR
@@ -82,9 +92,15 @@
 
 #ifdef MULTIPROCESSOR
 
-volatile u_long cpus_running = 1;
-volatile u_long cpus_hatched = 1;
-volatile u_long cpus_paused = 0;
+volatile mips_cpuset_t cpus_running = 1;
+volatile mips_cpuset_t cpus_hatched = 1;
+volatile mips_cpuset_t cpus_paused = 0;
+volatile mips_cpuset_t cpus_resumed = 0;
+volatile mips_cpuset_t cpus_halted = 0;
+
+static int  cpu_ipi_wait(volatile mips_cpuset_t *, u_long);
+static void cpu_ipi_error(const char *, mips_cpuset_t, mips_cpuset_t);
+
 
 static struct cpu_info *cpu_info_last = cpu_info_store;
 
@@ -602,6 +618,32 @@
 }
 
 #ifdef MULTIPROCESSOR
+
+void
+cpu_broadcast_ipi(int tag)
+{
+	(void)cpu_multicast_ipi(
+		CPUSET_EXCEPT(cpus_running, cpu_index(curcpu())), tag);
+}
+
+void
+cpu_multicast_ipi(mips_cpuset_t cpuset, int tag)
+{
+	CPU_INFO_ITERATOR cii;
+	struct cpu_info *ci;
+
+	CPUSET_DEL(cpuset, cpu_index(curcpu()));
+	if (CPUSET_EMPTY(cpuset))
+		return;
+
+	for (CPU_INFO_FOREACH(cii, ci)) {
+		if (CPUSET_HAS(cpuset, cpu_index(ci))) {
+			CPUSET_DEL(cpuset, cpu_index(ci));
+			(void)cpu_send_ipi(ci, tag);
+		}
+	}
+}
+
 int
 cpu_send_ipi(struct cpu_info *ci, int tag)
 {
@@ -609,11 +651,192 @@
 	return (*mips_locoresw.lsw_send_ipi)(ci, tag);
 }
 
+static void
+cpu_ipi_error(const char *s, mips_cpuset_t succeeded, mips_cpuset_t expected)
+{
+	CPUSET_SUB(expected, succeeded);
+	if (!CPUSET_EMPTY(expected)) {
+		printf(Failed to %s:, s);
+		do {
+			int index = CPUSET_NEXT(expected);
+			CPUSET_DEL(expected, index);
+			printf( cpu%d, index);
+		} while(!CPUSET_EMPTY(expected));
+		printf(\n);
+	}
+}
+
+static int
+cpu_ipi_wait(volatile mips_cpuset_t *watchset, u_long mask)
+{
+	u_long limit = curcpu()-ci_cpu_freq;	/* some finite amount of time */
+
+	while (limit--)
+		if (*watchset == mask)
+			return 0;		/* success */
+
+	return 1;/* timed out */
+}
+
+/*
+ * Halt this cpu
+ */
+void
+cpu_halt(void)
+{
+	int index = cpu_index(curcpu());
+
+	printf(cpu%d: shutting down\n, index);
+	CPUSET_ADD(cpus_halted, index);
+	spl0();		/* allow interrupts e.g. further ipi ? */
+	for (;;) ;	/* spin */
+
+	/* NOTREACHED */
+}
+
+/*
+ * Halt all running cpus, excluding current cpu.
+ */
+void
+cpu_halt_others(void)
+{
+	mips_cpuset_t cpumask, cpuset;
+
+	CPUSET_ASSIGN(cpuset, cpus_running);
+	CPUSET_DEL(cpuset, cpu_index(curcpu()));
+	CPUSET_ASSIGN(cpumask, cpuset);
+	CPUSET_SUB(cpuset, cpus_halted);
+
+	if (CPUSET_EMPTY(cpuset))
+		return;
+
+	cpu_multicast_ipi(cpuset, IPI_HALT);
+	if (cpu_ipi_wait(cpus_halted, cpumask))
+		cpu_ipi_error(halt, cpumask, cpus_halted);
+
+	/*
+	 * TBD
+	 * Depending on available firmware methods, other cpus will
+	 * either shut down themselfs, or spin and wait for us to
+	 * stop them.
+	 */
+}
+
+/*
+ * Pause this cpu
+ */
+void
+cpu_pause(struct reg *regsp)
+{
+	int s = splhigh();
+	int index = cpu_index(curcpu());
+
+	for (;;) {
+		CPUSET_ADD(cpus_paused, index);
+		do {
+			;
+		} while(CPUSET_HAS(cpus_paused, index));
+		CPUSET_ADD(cpus_resumed, index);
+
+#if defined(DDB)
+		if (ddb_running_on_this_cpu())
+			cpu_Debugger();
+		if (ddb_running_on_any_cpu())
+			continue;
+#endif
+		break;
+	}
+#if defined(DDB)  defined(MIPS_DDB_WATCH)
+	db_mach_watch_set_all();
+#endif
+
+	splx(s);
+}
+
+/*
+ * Pause all running cpus, excluding current cpu.
+ */
+void
+cpu_pause_others(void)
+{
+	mips_cpuset_t cpuset;
+
+	CPUSET_ASSIGN(cpuset, cpus_running);
+	CPUSET_DEL(cpuset, cpu_index(curcpu()));
+
+	if 

CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:07:07 UTC 2011

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: db_interface.c

Log Message:
- add suport for MP ddb
- add 'mach watch' command and related to enable ddb use of MIPS CP0 watchpoint
operator may specify one or more of rwx access mode qualifiers,
optional mask, and optional asid.  with no args, 'mach watch' dumps the
CP0 watchpoints table.
- 'mach unwatch' command deletes entries from the table; either
a) all entries matching an optional address, or
b) with no address specified, deletes all entries.
- fix 'mach cp0' dump of CP0 watchhi, watchlo regs
- fix opcode in 'mach mtcr' command function


To generate a diff of this commit:
cvs rdiff -u -r1.64.16.18 -r1.64.16.19 src/sys/arch/mips/mips/db_interface.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/mips/mips/db_interface.c
diff -u src/sys/arch/mips/mips/db_interface.c:1.64.16.18 src/sys/arch/mips/mips/db_interface.c:1.64.16.19
--- src/sys/arch/mips/mips/db_interface.c:1.64.16.18	Wed Dec 29 00:48:22 2010
+++ src/sys/arch/mips/mips/db_interface.c	Sat Feb  5 06:07:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.64.16.18 2010/12/29 00:48:22 matt Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.64.16.19 2011/02/05 06:07:07 cliff Exp $	*/
 
 /*
  * Mach Operating System
@@ -27,8 +27,9 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.64.16.18 2010/12/29 00:48:22 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.64.16.19 2011/02/05 06:07:07 cliff Exp $);
 
+#include opt_multiprocessor.h
 #include opt_cputype.h	/* which mips CPUs do we support? */
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -39,9 +40,13 @@
 #include sys/proc.h
 #include sys/user.h
 #include sys/reboot.h
+#include sys/atomic.h
+#include sys/cpu.h
 
 #include uvm/uvm_extern.h
 
+#include mips/asm.h
+#include mips/regnum.h
 #include mips/cache.h
 #include mips/pte.h
 #include mips/cpu.h
@@ -59,11 +64,43 @@
 #include ddb/db_extern.h
 #include ddb/db_interface.h
 #include ddb/db_lex.h
+#include ddb/db_run.h	/* for db_continue_cmd() proto */
 #endif
 
+#define NOCPU   -1
+int ddb_cpu = NOCPU;
+
 int		db_active = 0;
 db_regs_t	ddb_regs;
 
+#ifdef MIPS_DDB_WATCH
+struct db_mach_watch {
+	register_t	addr;
+	register_t	mask;
+	uint32_t	asid;
+	uint32_t	mode;
+};
+/* mode bits */
+#define DB_WATCH_WRITE	__BIT(0)
+#define DB_WATCH_READ	__BIT(1)
+#define DB_WATCH_EXEC	__BIT(2)
+#define DB_WATCH_MASK	__BIT(3)
+#define DB_WATCH_ASID	__BIT(4)
+#define DB_WATCH_RWX	(DB_WATCH_EXEC|DB_WATCH_READ|DB_WATCH_WRITE)
+
+#define DBNWATCH	1
+static volatile struct db_mach_watch db_mach_watch_tab[DBNWATCH];
+
+static void db_mach_watch_set(int, register_t, register_t, uint32_t, uint32_t,
+	bool);
+static void db_watch_cmd(db_expr_t, bool, db_expr_t, const char *);
+static void db_unwatch_cmd(db_expr_t, bool, db_expr_t, const char *);
+#endif	/* MIPS_DDB_WATCH */
+
+#ifdef MULTIPROCESSOR
+static void db_mach_cpu(db_expr_t, bool, db_expr_t, const char *);
+#endif
+
 void db_tlbdump_cmd(db_expr_t, bool, db_expr_t, const char *);
 void db_kvtophys_cmd(db_expr_t, bool, db_expr_t, const char *);
 void db_cp0dump_cmd(db_expr_t, bool, db_expr_t, const char *);
@@ -72,6 +109,8 @@
 void db_mtcr_cmd(db_expr_t, bool, db_expr_t, const char *);
 #endif
 
+bool ddb_running_on_this_cpu(void);
+
 static void	kdbpoke_4(vaddr_t addr, int newval);
 static void	kdbpoke_2(vaddr_t addr, short newval);
 static void	kdbpoke_1(vaddr_t addr, char newval);
@@ -152,32 +191,66 @@
 int
 kdb_trap(int type, struct reg *regs)
 {
+	int s;
+	extern const char * const trap_type[];
 
-#ifdef notyet
 	switch (type) {
+	case T_WATCH:		/* watchpoint */
 	case T_BREAK:		/* breakpoint */
-	case -1:		/* keyboard interrupt */
+		printf(kernel: %s trap\n, trap_type[type  0xff]);
+		break;
+	case -1:		/* keyboard interrupt *//* ??? */
+		printf(kernel: -1 trap\n);
 		break;
 	default:
-		printf(kernel: %s trap, trap_type[type  0xff]);
+		printf(kernel: %s trap\n, trap_type[type  0xff]);
 		if (db_recover != 0) {
 			db_error(Faulted in DDB; continuing...\n);
 			/*NOTREACHED*/
 		}
 		break;
 	}
+
+#ifdef MULTIPROCESSOR
+	bool first_in_ddb = false;
+	int cpu_me = cpu_index(curcpu());
+	int old_ddb_cpu = atomic_cas_32(ddb_cpu, NOCPU, cpu_me);
+	if (old_ddb_cpu == NOCPU) {
+		first_in_ddb = true;
+		cpu_pause_others();
+	} else {
+		if (old_ddb_cpu != cpu_me) {
+			cpu_pause(regs);
+			return 1;
+		}
+	}
 #endif
+
 	/* Should switch to kdb`s own stack here. */
+	KASSERT(sizeof(ddb_regs) == sizeof(*regs));
 	ddb_regs = *regs;
 
+	s = splhigh();
 	db_active++;
-	cnpollc(1);
+	cnpollc(TRUE);
 	db_trap(type  ~T_USER, 0 /*code*/);
-	cnpollc(0);
+	cnpollc(FALSE);
 	db_active--;
+	splx(s);
 
 	*regs = ddb_regs;
 
+#ifdef MULTIPROCESSOR
+	if (ddb_cpu == cpu_me) {
+		ddb_cpu = NOCPU;
+		cpu_resume_others();
+	} else {
+		

CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:07:39 UTC 2011

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: ipifuncs.c

Log Message:
- add support for MP ddb
- add IPI halt func


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/arch/mips/mips/ipifuncs.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/mips/mips/ipifuncs.c
diff -u src/sys/arch/mips/mips/ipifuncs.c:1.1.2.4 src/sys/arch/mips/mips/ipifuncs.c:1.1.2.5
--- src/sys/arch/mips/mips/ipifuncs.c:1.1.2.4	Wed Dec 22 05:57:48 2010
+++ src/sys/arch/mips/mips/ipifuncs.c	Sat Feb  5 06:07:38 2011
@@ -27,9 +27,11 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include opt_ddb.h
+
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: ipifuncs.c,v 1.1.2.4 2010/12/22 05:57:48 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: ipifuncs.c,v 1.1.2.5 2011/02/05 06:07:38 cliff Exp $);
 
 #include sys/param.h
 #include sys/cpu.h
@@ -38,6 +40,13 @@
 #include uvm/uvm_extern.h
 
 #include mips/cache.h
+#ifdef DDB
+#include mips/db_machdep.h
+#endif
+
+
+static void ipi_halt(void) __attribute__((__noreturn__));
+
 
 static const char * const ipi_names[] = {
 	[IPI_NOP]	= ipi nop,
@@ -46,6 +55,8 @@
 	[IPI_FPSAVE]	= ipi fpsave,
 	[IPI_SYNCICACHE]	= ipi isync,
 	[IPI_KPREEMPT]	= ipi kpreempt,
+	[IPI_SUSPEND]	= ipi suspend,
+	[IPI_HALT]	= ipi halt,
 };
 
 static void
@@ -89,6 +100,22 @@
 }
 #endif
 
+/*
+ * Process cpu stop-self event.
+ * XXX could maybe add/use locoresw halt function?
+ */
+static void
+ipi_halt(void)
+{
+	int index = cpu_index(curcpu());
+	printf(cpu%d: shutting down\n, index);
+	CPUSET_ADD(cpus_halted, index);
+	splhigh();
+	for (;;)
+		;
+	/* NOTREACHED */
+}
+
 void
 ipi_process(struct cpu_info *ci, uint64_t ipi_mask)
 {
@@ -114,12 +141,14 @@
 		ci-ci_evcnt_per_ipi[IPI_NOP].ev_count++;
 		ipi_syncicache(ci);
 	}
-#ifdef IPI_HALT
+	if (ipi_mask  __BIT(IPI_SUSPEND)) {
+		ci-ci_evcnt_per_ipi[IPI_SUSPEND].ev_count++;
+		cpu_pause(NULL);
+	}
 	if (ipi_mask  __BIT(IPI_HALT)) {
-		ci-ci_evcnt_per_ipi[IPI_NOP].ev_count++;
+		ci-ci_evcnt_per_ipi[IPI_HALT].ev_count++;
 		ipi_halt();
 	}
-#endif
 }
 
 void



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:08:12 UTC 2011

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: trap.c

Log Message:
- include opt_multiprocessor.h for MULTIPROCESSOR dependency
- in trap at dopanic:, use snprintf to allow a single, idempotent, readable
printf; needed for MP, but harmless for UP so not ifdef'ed.
- add case for case T_WATCH (not USER), handled same as T_BREAK
i.e. entry to ddb if configured


To generate a diff of this commit:
cvs rdiff -u -r1.217.12.33 -r1.217.12.34 src/sys/arch/mips/mips/trap.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/mips/mips/trap.c
diff -u src/sys/arch/mips/mips/trap.c:1.217.12.33 src/sys/arch/mips/mips/trap.c:1.217.12.34
--- src/sys/arch/mips/mips/trap.c:1.217.12.33	Wed Jan 26 03:32:31 2011
+++ src/sys/arch/mips/mips/trap.c	Sat Feb  5 06:08:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.217.12.33 2011/01/26 03:32:31 matt Exp $	*/
+/*	$NetBSD: trap.c,v 1.217.12.34 2011/02/05 06:08:12 cliff Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -78,8 +78,9 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.217.12.33 2011/01/26 03:32:31 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.217.12.34 2011/02/05 06:08:12 cliff Exp $);
 
+#include opt_multiprocessor.h
 #include opt_cputype.h	/* which mips CPU levels do we support? */
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -217,21 +218,42 @@
 	default:
 	dopanic:
 		(void)splhigh();
-		printf(pid %d(%s): , p-p_pid, p-p_comm);
-		printf(trap: %s in %s mode\n,
-			trap_type[TRAPTYPE(cause)],
+
+		/*
+		 * use snprintf to allow a single, idempotent, readable printf
+		 */
+		char strbuf[256], *str = strbuf;
+		int n, sz = sizeof(strbuf);
+
+		n = snprintf(str, sz, pid %d(%s): , p-p_pid, p-p_comm);
+		sz -= n; 
+		str += n;
+		n = snprintf(str, sz, trap: cpu%d, %s in %s mode\n,
+			cpu_index(ci), trap_type[TRAPTYPE(cause)],
 			USERMODE(status) ? user : kernel);
-		printf(status=0x%x, cause=0x%x, epc=%# PRIxVADDR
-			, vaddr=%# PRIxVADDR, status, cause, pc, vaddr);
+		sz -= n; 
+		str += n;
+		n = snprintf(str, sz, status=0x%x, cause=0x%x, epc=%#
+			PRIxVADDR , vaddr=%# PRIxVADDR \n,
+			status, cause, pc, vaddr);
+		sz -= n; 
+		str += n;
 		if (USERMODE(status)) {
 			KASSERT(tf == utf);
-			printf( frame=%p usp=%# PRIxREGISTER
+			n = snprintf(str, sz, frame=%p usp=%# PRIxREGISTER
 			 ra=%# PRIxREGISTER \n,
-			   tf, tf-tf_regs[_R_SP], tf-tf_regs[_R_RA]);
+			tf, tf-tf_regs[_R_SP], tf-tf_regs[_R_RA]);
+			sz -= n; 
+			str += n;
 		} else {
-			printf( tf=%p ksp=%p ra=%# PRIxREGISTER \n,
-			   tf, tf+1, tf-tf_regs[_R_RA]);
+			n = snprintf(str, sz, tf=%p ksp=%p ra=%#
+			PRIxREGISTER  ppl=%#x\n,
+			tf, tf+1, tf-tf_regs[_R_RA],
+			tf-tf_ppl);
+			sz -= n; 
+			str += n;
 		}
+		printf(%s, strbuf);
 
 		if ((TRAPTYPE(cause) == 6) || (TRAPTYPE(cause) == 7))
 			(void)(*mips_locoresw.lsw_bus_error)(cause);
@@ -530,6 +552,7 @@
 		}
 		break; /* SIGNAL */
 
+	case T_WATCH:	/* XXX */
 	case T_BREAK:
 #if defined(DDB)
 		kdb_trap(type, tf-tf_registers);



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:10:29 UTC 2011

Modified Files:
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_cpu.c

Log Message:
- include opt_multiprocessor.h for MULTIPROCESSOR dependency
- add suport for MIPS COP0 watchpoint in ddb
- add ci_pmap_asid_cur print in rmixl_cpuinfo_print().
- note rmixl_cpuinfo_print() (or something like it) should eventually get moved
into a md support fn of a (hypothetical) ddb 'show cpu' command.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.16 -r1.1.2.17 src/sys/arch/mips/rmi/rmixl_cpu.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/mips/rmi/rmixl_cpu.c
diff -u src/sys/arch/mips/rmi/rmixl_cpu.c:1.1.2.16 src/sys/arch/mips/rmi/rmixl_cpu.c:1.1.2.17
--- src/sys/arch/mips/rmi/rmixl_cpu.c:1.1.2.16	Fri Jan  7 00:17:22 2011
+++ src/sys/arch/mips/rmi/rmixl_cpu.c	Sat Feb  5 06:10:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_cpu.c,v 1.1.2.16 2011/01/07 00:17:22 cliff Exp $	*/
+/*	$NetBSD: rmixl_cpu.c,v 1.1.2.17 2011/02/05 06:10:29 cliff Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -38,7 +38,10 @@
 #include locators.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rmixl_cpu.c,v 1.1.2.16 2011/01/07 00:17:22 cliff Exp $);
+__KERNEL_RCSID(0, $NetBSD: rmixl_cpu.c,v 1.1.2.17 2011/02/05 06:10:29 cliff Exp $);
+
+#include opt_multiprocessor.h
+#include opt_ddb.h
 
 #include sys/param.h
 #include sys/device.h
@@ -60,6 +63,9 @@
 #include mips/rmi/rmixl_cpuvar.h
 #include mips/rmi/rmixl_intr.h
 #include mips/rmi/rmixl_fmnvar.h
+#ifdef DDB
+#include mips/db_machdep.h
+#endif
 
 
 static int	cpu_rmixl_match(device_t, cfdata_t, void *);
@@ -91,6 +97,20 @@
 static struct rmixl_cpu_trampoline_args rmixl_cpu_trampoline_args;
 #endif
 
+#if defined(DDB)  defined(MIPS_DDB_WATCH)
+/*
+ * cpu_rmixl_db_watch_init - initialize COP0 watchpoint stuff
+ *
+ * clear IEU_DEFEATURE[DBE] to ensure T_WATCH on watchpoint exception
+ * set COP0 watchhi and watchlo
+ */
+static void
+cpu_rmixl_db_watch_init(void)
+{
+	db_mach_watch_set_all();
+}
+#endif	/* DDB  MIPS_DDB_WATCH */
+
 /*
  * cpu_xls616_erratum
  *
@@ -222,6 +242,10 @@
 		return;
 	once = true;
 
+#if defined(DDB)  defined(MIPS_DDB_WATCH)
+	cpu_rmixl_db_watch_init();
+#endif
+
 	rmixl_fmn_init();
 
 	sc-sc_ih_clk = rmixl_intr_init_clk();
@@ -280,6 +304,10 @@
 #endif
 
 	cpucore_rmixl_hatch(device_parent(sc-sc_dev));
+
+#if defined(DDB)  defined(MIPS_DDB_WATCH)
+	cpu_rmixl_db_watch_init();
+#endif
 }
 
 static int
@@ -422,6 +450,7 @@
 		for (int i=0; i  SOFTINT_COUNT; i++)
 			printf(ci_softlwps[%d] %p\n, i, ci-ci_softlwps[i]);
 		printf(ci_tlb_slot %d\n, ci-ci_tlb_slot);
+		printf(ci_pmap_asid_cur %d\n, ci-ci_pmap_asid_cur);
 		printf(ci_tlb_info %p\n, ci-ci_tlb_info);
 		printf(ci_pmap_seg0tab %p\n, ci-ci_pmap_seg0tab);
 #ifdef _LP64
@@ -441,5 +470,4 @@
 
 	return ci;
 }
-
 #endif	/* DEBUG */



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:11:16 UTC 2011

Modified Files:
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_fmn.c

Log Message:
- obtain rmixl_intr_lock before rmixl_vec_establish(),
he expects that lock is held


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/arch/mips/rmi/rmixl_fmn.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/mips/rmi/rmixl_fmn.c
diff -u src/sys/arch/mips/rmi/rmixl_fmn.c:1.1.2.4 src/sys/arch/mips/rmi/rmixl_fmn.c:1.1.2.5
--- src/sys/arch/mips/rmi/rmixl_fmn.c:1.1.2.4	Tue Apr 13 18:15:16 2010
+++ src/sys/arch/mips/rmi/rmixl_fmn.c	Sat Feb  5 06:11:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_fmn.c,v 1.1.2.4 2010/04/13 18:15:16 cliff Exp $	*/
+/*	$NetBSD: rmixl_fmn.c,v 1.1.2.5 2011/02/05 06:11:16 cliff Exp $	*/
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -644,10 +644,15 @@
 	/*
 	 * establish dispatcher for FMN interrupt
 	 */
-	void *ih = rmixl_vec_establish(RMIXL_INTRVEC_FMN, -1, RMIXL_FMN_INTR_IPL,
+	extern kmutex_t rmixl_intr_lock;
+	void *ih;
+
+	mutex_enter(rmixl_intr_lock);
+	ih = rmixl_vec_establish(RMIXL_INTRVEC_FMN, -1, RMIXL_FMN_INTR_IPL,
 		rmixl_fmn_intr_dispatch, fmnp, fmn);
 	if (ih == NULL)
 		panic(%s: rmixl_vec_establish failed, __func__);
+	mutex_exit(rmixl_intr_lock);
 	fmnp-fmn_ih = ih;
 #endif
 



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:11:48 UTC 2011

Modified Files:
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_intr.c

Log Message:
- include opt_multiprocessor.h for MULTIPROCESSOR dependency
- use seperate vectors for various IPI tags, instead of all piling on one.
this theoretically allows different functions to interrupt at different
priorities.  the fmn vector number got rippled up in the process.
- add rmixl_ipi_lock to serialize access to RMIXL_PIC_IPIBASE
- add rmixl_intr_lock to serialize access to rest of PIC and rmixl_intrhand[]
- include mips/cpuset.h and use CPUSET_* macros for cpus_running etc.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.24 -r1.1.2.25 src/sys/arch/mips/rmi/rmixl_intr.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/mips/rmi/rmixl_intr.c
diff -u src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.24 src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.25
--- src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.24	Mon Sep 20 19:41:05 2010
+++ src/sys/arch/mips/rmi/rmixl_intr.c	Sat Feb  5 06:11:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_intr.c,v 1.1.2.24 2010/09/20 19:41:05 cliff Exp $	*/
+/*	$NetBSD: rmixl_intr.c,v 1.1.2.25 2011/02/05 06:11:47 cliff Exp $	*/
 
 /*-
  * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@@ -64,8 +64,9 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rmixl_intr.c,v 1.1.2.24 2010/09/20 19:41:05 cliff Exp $);
+__KERNEL_RCSID(0, $NetBSD: rmixl_intr.c,v 1.1.2.25 2011/02/05 06:11:47 cliff Exp $);
 
+#include opt_multiprocessor.h
 #include opt_ddb.h
 #define	__INTR_PRIVATE
 
@@ -76,6 +77,7 @@
 #include sys/device.h
 #include sys/kernel.h
 #include sys/atomic.h
+#include sys/mutex.h
 #include sys/cpu.h
 
 #include machine/bus.h
@@ -290,14 +292,14 @@
 	vec 6,		/*  6 */
 	vec 7,		/*  7 */
 	vec 8 (ipi),		/*  8 */
-	vec 9 (fmn),		/*  9 */
-	vec 10,		/* 10 */
-	vec 11,		/* 11 */
-	vec 12,		/* 12 */
-	vec 13,		/* 13 */
-	vec 14,		/* 14 */
-	vec 15,		/* 15 */
-	vec 16,		/* 16 */
+	vec 9 (ipi),		/*  9 */
+	vec 10 (ipi),		/* 10 */
+	vec 11 (ipi),		/* 11 */
+	vec 12 (ipi),		/* 12 */
+	vec 13 (ipi),		/* 13 */
+	vec 14 (ipi),		/* 14 */
+	vec 15 (ipi),		/* 15 */
+	vec 16 (fmn),		/* 16 */
 	vec 17,		/* 17 */
 	vec 18,		/* 18 */
 	vec 19,		/* 19 */
@@ -353,6 +355,8 @@
  */
 static uint32_t cpu_present_mask;
 
+kmutex_t rmixl_ipi_lock;	/* covers RMIXL_PIC_IPIBASE */
+kmutex_t rmixl_intr_lock;	/* covers rest of PIC, and rmixl_intrhand[] */
 rmixl_intrhand_t rmixl_intrhand[NINTRVECS];
 
 #ifdef DIAGNOSTIC
@@ -407,6 +411,11 @@
 			__func__, rmixl_pic_init_done);
 #endif
 
+	mutex_init(rmixl_ipi_lock, MUTEX_DEFAULT, IPL_HIGH);
+	mutex_init(rmixl_intr_lock, MUTEX_DEFAULT, IPL_HIGH);
+
+	mutex_enter(rmixl_intr_lock);
+
 	/*
 	 * initialize (zero) all IRT Entries in the PIC
 	 */
@@ -427,6 +436,7 @@
 #ifdef DIAGNOSTIC
 	rmixl_pic_init_done = 1;
 #endif
+	mutex_exit(rmixl_intr_lock);
 
 }
 
@@ -440,9 +450,14 @@
 rmixl_intr_init_clk(void)
 {
 	int vec = ffs(MIPS_INT_MASK_5  8) - 1;
+
+	mutex_enter(rmixl_intr_lock);
+
 	void *ih = rmixl_vec_establish(vec, 0, IPL_SCHED, NULL, NULL, false);
 	if (ih == NULL)
 		panic(%s: establish vec %d failed, __func__, vec);
+
+	mutex_exit(rmixl_intr_lock);
 	
 	return ih;
 }
@@ -454,14 +469,24 @@
 void *
 rmixl_intr_init_ipi(void)
 {
-	void *ih = rmixl_vec_establish(RMIXL_INTRVEC_IPI, -1, IPL_SCHED,
-		rmixl_ipi_intr, NULL, false);
-	if (ih == NULL)
-		panic(%s: establish vec %d failed,
-			__func__, RMIXL_INTRVEC_IPI);
+	u_int ipi, vec;
+	void *ih;
+
+	mutex_enter(rmixl_intr_lock);
+
+	for (ipi=0; ipi  NIPIS; ipi++) {
+		vec = RMIXL_INTRVEC_IPI + ipi;
+		ih = rmixl_vec_establish(vec, -1, IPL_SCHED,
+			rmixl_ipi_intr, (void *)(uintptr_t)ipi, true);
+		if (ih == NULL)
+			panic(%s: establish ipi %d at vec %d failed,
+__func__, ipi, vec);
+	}
 
 	mips_locoresw.lsw_send_ipi = rmixl_send_ipi;
 
+	mutex_exit(rmixl_intr_lock);
+
 	return ih;
 }
 #endif 	/* MULTIPROCESSOR */
@@ -484,7 +509,7 @@
 			rmixl_intr_string(vec));
 
 	KASSERT(ci-ci_cpuid  (sizeof(cpu_present_mask) * 8));
-	cpu_present_mask |= 1  ci-ci_cpuid;
+	atomic_or_32((volatile uint32_t *)cpu_present_mask, 1  ci-ci_cpuid);
 }
 
 /*
@@ -623,6 +648,7 @@
 static void
 rmixl_irt_disestablish(int irt)
 {
+	KASSERT(mutex_owned(rmixl_intr_lock));
 	DPRINTF((%s: irt %d, irtc1 %#x\n, __func__, irt, 0));
 	rmixl_irt_init(irt);
 }
@@ -638,6 +664,8 @@
 	uint32_t irtc1;
 	uint32_t irtc0;
 
+	KASSERT(mutex_owned(rmixl_intr_lock));
+
 	if (irt = NIRTS)
 		panic(%s: bad irt %d\n, __func__, irt);
 
@@ -698,6 +726,8 @@
 	uint64_t eimr_bit;
 	int s;
 
+	KASSERT(mutex_owned(rmixl_intr_lock));
+
 	DPRINTF((%s: vec %d, cpumask %#x, ipl %d, func %p, arg %p\n
 			__func__, vec, cpumask, ipl, func, arg));
 #ifdef DIAGNOSTIC
@@ -756,7 +786,6 @@
 {
 	rmixl_intrhand_t *ih;
 	int vec;
-	int s;
 
 #ifdef DIAGNOSTIC
 	if (rmixl_pic_init_done == 0)
@@ -777,7 +806,7 @@
 

CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:12:42 UTC 2011

Modified Files:
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_intr.h

Log Message:
- include opt_multiprocessor.h for MULTIPROCESSOR dependency
- move RMIXL_INTRVEC_FMN to RMIXL_INTRVEC_IPI + NIPIS
since each IPI tag now has own vector


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/arch/mips/rmi/rmixl_intr.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/mips/rmi/rmixl_intr.h
diff -u src/sys/arch/mips/rmi/rmixl_intr.h:1.1.2.4 src/sys/arch/mips/rmi/rmixl_intr.h:1.1.2.5
--- src/sys/arch/mips/rmi/rmixl_intr.h:1.1.2.4	Fri May 21 23:35:42 2010
+++ src/sys/arch/mips/rmi/rmixl_intr.h	Sat Feb  5 06:12:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_intr.h,v 1.1.2.4 2010/05/21 23:35:42 cliff Exp $	*/
+/*	$NetBSD: rmixl_intr.h,v 1.1.2.5 2011/02/05 06:12:42 cliff Exp $	*/
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -31,6 +31,8 @@
 #ifndef _MIPS_RMI_RMIXL_INTR_H_
 #define _MIPS_RMI_RMIXL_INTR_H_
 
+#include opt_multiprocessor.h
+
 /*
  * A 'vector' is bit number in EIRR/EIMR
  * - non-IRT-based interrupts use vectors 0..31
@@ -54,7 +56,7 @@
  * vectors (8 = vec  31) are for other non-IRT based interrupts
  */
 #define RMIXL_INTRVEC_IPI	8
-#define RMIXL_INTRVEC_FMN	9
+#define RMIXL_INTRVEC_FMN	(RMIXL_INTRVEC_IPI + NIPIS)
 
 typedef enum {
 	RMIXL_TRIG_NONE=0,



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:13:17 UTC 2011

Modified Files:
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_usbi.c

Log Message:
- if obio_intr is OBIOCF_INTR_DEFAULT, don't establish an interrupt


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/arch/mips/rmi/rmixl_usbi.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/mips/rmi/rmixl_usbi.c
diff -u src/sys/arch/mips/rmi/rmixl_usbi.c:1.1.2.5 src/sys/arch/mips/rmi/rmixl_usbi.c:1.1.2.6
--- src/sys/arch/mips/rmi/rmixl_usbi.c:1.1.2.5	Mon Apr 12 22:42:07 2010
+++ src/sys/arch/mips/rmi/rmixl_usbi.c	Sat Feb  5 06:13:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_usbi.c,v 1.1.2.5 2010/04/12 22:42:07 cliff Exp $	*/
+/*	$NetBSD: rmixl_usbi.c,v 1.1.2.6 2011/02/05 06:13:16 cliff Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002, 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rmixl_usbi.c,v 1.1.2.5 2010/04/12 22:42:07 cliff Exp $);
+__KERNEL_RCSID(0, $NetBSD: rmixl_usbi.c,v 1.1.2.6 2011/02/05 06:13:16 cliff Exp $);
 
 #include locators.h
 
@@ -173,11 +173,14 @@
 	RMIXL_USBI_GEN_WRITE(RMIXL_USB_INTERRUPT_ENABLE, 0);
 
 	/* establish interrupt */
-	ih = rmixl_intr_establish(obio-obio_intr, obio-obio_tmsk,
-		IPL_USB, RMIXL_TRIG_LEVEL, RMIXL_POLR_HIGH,
-		rmixl_usbi_intr, sc, false);
-	if (ih == NULL)
-		panic(%s: couldn't establish interrupt, device_xname(self));
+	if (obio-obio_intr != OBIOCF_INTR_DEFAULT) {
+		ih = rmixl_intr_establish(obio-obio_intr, obio-obio_tmsk,
+			IPL_USB, RMIXL_TRIG_LEVEL, RMIXL_POLR_HIGH,
+			rmixl_usbi_intr, sc, false);
+		if (ih == NULL)
+			panic(%s: couldn't establish interrupt,
+device_xname(self));
+	}
 
 	aprint_normal(\n);
 



CVS commit: [matt-nb5-mips64] src/sys/kern

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:13:45 UTC 2011

Modified Files:
src/sys/kern [matt-nb5-mips64]: subr_evcnt.c

Log Message:
- add evcnt_lock and use to protect the 'allevents' list
(pulled back fromk -current)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.94.1 src/sys/kern/subr_evcnt.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/subr_evcnt.c
diff -u src/sys/kern/subr_evcnt.c:1.4 src/sys/kern/subr_evcnt.c:1.4.94.1
--- src/sys/kern/subr_evcnt.c:1.4	Sun Dec 11 12:24:30 2005
+++ src/sys/kern/subr_evcnt.c	Sat Feb  5 06:13:45 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_evcnt.c,v 1.4 2005/12/11 12:24:30 christos Exp $ */
+/* $NetBSD: subr_evcnt.c,v 1.4.94.1 2011/02/05 06:13:45 cliff Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,16 +77,18 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_evcnt.c,v 1.4 2005/12/11 12:24:30 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_evcnt.c,v 1.4.94.1 2011/02/05 06:13:45 cliff Exp $);
 
 #include opt_ddb.h
 
 #include sys/param.h
 #include sys/device.h
+#include sys/mutex.h
 #include sys/systm.h
 
 /* list of all events */
 struct evcntlist allevents = TAILQ_HEAD_INITIALIZER(allevents);
+static kmutex_t evcnt_lock;
 
 /*
  * We need a dummy object to stuff into the evcnt link set to
@@ -105,6 +107,8 @@
 	__link_set_decl(evcnts, struct evcnt);
 	struct evcnt * const *evp;
 
+	mutex_init(evcnt_lock, MUTEX_DEFAULT, IPL_NONE);
+
 	__link_set_foreach(evp, evcnts) {
 		if (*evp == dummy_static_evcnt)
 			continue;
@@ -121,6 +125,9 @@
 {
 	int len;
 
+#ifdef DEBUG	/* XXX TMP FIXME */
+	printf(%s: %p \%s\\n, __func__, ev, ev-ev_name);
+#endif
 	len = strlen(ev-ev_group);
 #ifdef DIAGNOSTIC
 	if (len = EVCNT_STRING_MAX)		/* ..._MAX includes NUL */
@@ -135,7 +142,9 @@
 #endif
 	ev-ev_namelen = len;
 
+	mutex_enter(evcnt_lock);
 	TAILQ_INSERT_TAIL(allevents, ev, ev_list);
+	mutex_exit(evcnt_lock);
 }
 
 /*
@@ -162,7 +171,9 @@
 evcnt_detach(struct evcnt *ev)
 {
 
+	mutex_enter(evcnt_lock);
 	TAILQ_REMOVE(allevents, ev, ev_list);
+	mutex_exit(evcnt_lock);
 }
 
 #ifdef DDB



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:17:41 UTC 2011

Added Files:
src/sys/arch/mips/include [matt-nb5-mips64]: cpuset.h

Log Message:
add cpuset.h to allow abstracting bit-per-cpu run state variables (cpus_running 
et. al.)


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/mips/include/cpuset.h

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

Added files:

Index: src/sys/arch/mips/include/cpuset.h
diff -u /dev/null src/sys/arch/mips/include/cpuset.h:1.1.2.1
--- /dev/null	Sat Feb  5 06:17:41 2011
+++ src/sys/arch/mips/include/cpuset.h	Sat Feb  5 06:17:41 2011
@@ -0,0 +1,54 @@
+/*	$NetBSD: cpuset.h,v 1.1.2.1 2011/02/05 06:17:41 cliff Exp $	*/
+/*	$NetBSD: cpuset.h,v 1.1.2.1 2011/02/05 06:17:41 cliff Exp $ */
+
+/*-
+ * Copyright (c) 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _MIPS_CPUSET_H_
+#define	_MIPS_CPUSET_H_
+
+#include sys/atomic.h
+
+#define	CPUSET_MAXNUMCPU	64
+typedef	uint64_t mips_cpuset_t;
+
+#define	CPUSET_SINGLE(cpu)		((mips_cpuset_t)1  (cpu))
+
+#define	CPUSET_ADD(set, cpu)		atomic_or_64((volatile uint64_t *)(set), CPUSET_SINGLE(cpu))
+#define	CPUSET_DEL(set, cpu)		atomic_and_64((volatile uint64_t *)(set), ~CPUSET_SINGLE(cpu))
+#define	CPUSET_SUB(set1, set2)		atomic_and_64((volatile uint64_t *)(set1), ~(set2))
+
+#define	CPUSET_EXCEPT(set, cpu)		((set)  ~CPUSET_SINGLE(cpu))
+
+#define	CPUSET_HAS(set, cpu)		((set)  CPUSET_SINGLE(cpu))
+#define	CPUSET_NEXT(set)		(ffs(set) - 1)
+
+#define	CPUSET_EMPTY(set)		((set) == (mips_cpuset_t)0)
+#define	CPUSET_EQUAL(set1, set2)	((set1) == (set2))
+#define	CPUSET_CLEAR(set)		((set) = (mips_cpuset_t)0)
+#define	CPUSET_ASSIGN(set1, set2)	((set1) = (set2))
+
+#endif /* _MIPS_CPUSET_H_ */



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

2011-02-04 Thread S.P.Zeidler
Module Name:src
Committed By:   spz
Date:   Sat Feb  5 06:23:58 UTC 2011

Modified Files:
src/crypto/external/bsd/openssh/dist: key.c

Log Message:
fix compile


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

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/key.c
diff -u src/crypto/external/bsd/openssh/dist/key.c:1.5 src/crypto/external/bsd/openssh/dist/key.c:1.6
--- src/crypto/external/bsd/openssh/dist/key.c:1.5	Fri Feb  4 22:11:09 2011
+++ src/crypto/external/bsd/openssh/dist/key.c	Sat Feb  5 06:23:58 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.5 2011/02/04 22:11:09 christos Exp $	*/
+/*	$NetBSD: key.c,v 1.6 2011/02/05 06:23:58 spz Exp $	*/
 /* $OpenBSD: key.c,v 1.90 2010/07/13 23:13:16 djm Exp $ */
 /*
  * read_bignum():
@@ -36,7 +36,7 @@
  */
 
 #include includes.h
-__RCSID($NetBSD: key.c,v 1.5 2011/02/04 22:11:09 christos Exp $);
+__RCSID($NetBSD: key.c,v 1.6 2011/02/05 06:23:58 spz Exp $);
 #include sys/param.h
 #include sys/types.h
 
@@ -1514,7 +1514,10 @@
 	buffer_put_cstring(k-cert-certblob, key_ssh_name(k));
 
 	/* -v01 certs put nonce first */
-	arc4random_buf(nonce, sizeof(nonce));
+	/*arc4random_buf(nonce, sizeof(nonce));*/
+	for (i = 0; i  sizeof(nonce); i += 4)
+		*(uint32_t *)(nonce[i]) = arc4random();
+
 	if (k-type == KEY_DSA_CERT || k-type == KEY_RSA_CERT) {
 		buffer_put_string(k-cert-certblob, nonce, sizeof(nonce));
 	}



CVS commit: [matt-nb5-mips64] src/sys

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:31:07 UTC 2011

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: intr.h pmap.h vmparam.h
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_cpucorevar.h
rmixl_intr.h
src/sys/sys [matt-nb5-mips64]: lwp.h

Log Message:
- protect option includes (opt_multiprocessor.h) with #ifdef _KERNEL_OPT


To generate a diff of this commit:
cvs rdiff -u -r1.3.96.15 -r1.3.96.16 src/sys/arch/mips/include/intr.h
cvs rdiff -u -r1.54.26.16 -r1.54.26.17 src/sys/arch/mips/include/pmap.h
cvs rdiff -u -r1.41.28.18 -r1.41.28.19 src/sys/arch/mips/include/vmparam.h
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/arch/mips/rmi/rmixl_cpucorevar.h \
src/sys/arch/mips/rmi/rmixl_intr.h
cvs rdiff -u -r1.114.4.1.4.1 -r1.114.4.1.4.2 src/sys/sys/lwp.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/mips/include/intr.h
diff -u src/sys/arch/mips/include/intr.h:1.3.96.15 src/sys/arch/mips/include/intr.h:1.3.96.16
--- src/sys/arch/mips/include/intr.h:1.3.96.15	Sat Feb  5 06:05:35 2011
+++ src/sys/arch/mips/include/intr.h	Sat Feb  5 06:31:05 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.h,v 1.3.96.15 2011/02/05 06:05:35 cliff Exp $ */
+/* $NetBSD: intr.h,v 1.3.96.16 2011/02/05 06:31:05 cliff Exp $ */
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -31,7 +31,9 @@
 #ifndef _MIPS_INTR_H_
 #define	_MIPS_INTR_H_
 
+#ifdef _KERNEL_OPT
 #include opt_multiprocessor.h
+#endif
 
 /*
  * This is a common machine/intr.h for all MIPS platforms.

Index: src/sys/arch/mips/include/pmap.h
diff -u src/sys/arch/mips/include/pmap.h:1.54.26.16 src/sys/arch/mips/include/pmap.h:1.54.26.17
--- src/sys/arch/mips/include/pmap.h:1.54.26.16	Sat Feb  5 06:00:12 2011
+++ src/sys/arch/mips/include/pmap.h	Sat Feb  5 06:31:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.54.26.16 2011/02/05 06:00:12 cliff Exp $	*/
+/*	$NetBSD: pmap.h,v 1.54.26.17 2011/02/05 06:31:05 cliff Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -74,7 +74,9 @@
 #ifndef	_MIPS_PMAP_H_
 #define	_MIPS_PMAP_H_
 
+#ifdef _KERNEL_OPT
 #include opt_multiprocessor.h
+#endif
 
 #include mips/cpuregs.h	/* for KSEG0 below */
 //#include mips/pte.h

Index: src/sys/arch/mips/include/vmparam.h
diff -u src/sys/arch/mips/include/vmparam.h:1.41.28.18 src/sys/arch/mips/include/vmparam.h:1.41.28.19
--- src/sys/arch/mips/include/vmparam.h:1.41.28.18	Sat Feb  5 06:00:12 2011
+++ src/sys/arch/mips/include/vmparam.h	Sat Feb  5 06:31:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.41.28.18 2011/02/05 06:00:12 cliff Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.41.28.19 2011/02/05 06:31:05 cliff Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -79,7 +79,9 @@
 #ifndef _MIPS_VMPARAM_H_
 #define	_MIPS_VMPARAM_H_
 
+#ifdef _KERNEL_OPT
 #include opt_multiprocessor.h
+#endif
 
 /*
  * Machine dependent VM constants for MIPS.

Index: src/sys/arch/mips/rmi/rmixl_cpucorevar.h
diff -u src/sys/arch/mips/rmi/rmixl_cpucorevar.h:1.1.2.5 src/sys/arch/mips/rmi/rmixl_cpucorevar.h:1.1.2.6
--- src/sys/arch/mips/rmi/rmixl_cpucorevar.h:1.1.2.5	Sat Feb  5 06:00:13 2011
+++ src/sys/arch/mips/rmi/rmixl_cpucorevar.h	Sat Feb  5 06:31:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_cpucorevar.h,v 1.1.2.5 2011/02/05 06:00:13 cliff Exp $	*/
+/*	$NetBSD: rmixl_cpucorevar.h,v 1.1.2.6 2011/02/05 06:31:05 cliff Exp $	*/
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -31,7 +31,9 @@
 #ifndef _ARCH_MIPS_RMI_RMIXL_CPUCOREVAR_H_
 #define _ARCH_MIPS_RMI_RMIXL_CPUCOREVAR_H_
 
+#ifdef _KERNEL_OPT
 #include opt_multiprocessor.h
+#endif
 
 struct cpucore_softc {
 	device_t	sc_dev;
Index: src/sys/arch/mips/rmi/rmixl_intr.h
diff -u src/sys/arch/mips/rmi/rmixl_intr.h:1.1.2.5 src/sys/arch/mips/rmi/rmixl_intr.h:1.1.2.6
--- src/sys/arch/mips/rmi/rmixl_intr.h:1.1.2.5	Sat Feb  5 06:12:42 2011
+++ src/sys/arch/mips/rmi/rmixl_intr.h	Sat Feb  5 06:31:06 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_intr.h,v 1.1.2.5 2011/02/05 06:12:42 cliff Exp $	*/
+/*	$NetBSD: rmixl_intr.h,v 1.1.2.6 2011/02/05 06:31:06 cliff Exp $	*/
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -31,7 +31,9 @@
 #ifndef _MIPS_RMI_RMIXL_INTR_H_
 #define _MIPS_RMI_RMIXL_INTR_H_
 
+#ifdef _KERNEL_OPT
 #include opt_multiprocessor.h
+#endif
 
 /*
  * A 'vector' is bit number in EIRR/EIMR

Index: src/sys/sys/lwp.h
diff -u src/sys/sys/lwp.h:1.114.4.1.4.1 src/sys/sys/lwp.h:1.114.4.1.4.2
--- src/sys/sys/lwp.h:1.114.4.1.4.1	Sat Feb  5 06:00:15 2011
+++ src/sys/sys/lwp.h	Sat Feb  5 06:31:06 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: lwp.h,v 1.114.4.1.4.1 2011/02/05 06:00:15 cliff Exp $	*/
+/*	$NetBSD: lwp.h,v 1.114.4.1.4.2 2011/02/05 06:31:06 cliff Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -32,7 +32,9 @@
 #ifndef _SYS_LWP_H_
 #define _SYS_LWP_H_
 
+#ifdef _KERNEL_OPT
 #include 

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

2011-02-04 Thread S.P.Zeidler
Module Name:src
Committed By:   spz
Date:   Sat Feb  5 06:42:45 UTC 2011

Modified Files:
src/crypto/external/bsd/openssh/dist: key.c

Log Message:
revert previous


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

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/key.c
diff -u src/crypto/external/bsd/openssh/dist/key.c:1.6 src/crypto/external/bsd/openssh/dist/key.c:1.7
--- src/crypto/external/bsd/openssh/dist/key.c:1.6	Sat Feb  5 06:23:58 2011
+++ src/crypto/external/bsd/openssh/dist/key.c	Sat Feb  5 06:42:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.6 2011/02/05 06:23:58 spz Exp $	*/
+/*	$NetBSD: key.c,v 1.7 2011/02/05 06:42:44 spz Exp $	*/
 /* $OpenBSD: key.c,v 1.90 2010/07/13 23:13:16 djm Exp $ */
 /*
  * read_bignum():
@@ -36,7 +36,7 @@
  */
 
 #include includes.h
-__RCSID($NetBSD: key.c,v 1.6 2011/02/05 06:23:58 spz Exp $);
+__RCSID($NetBSD: key.c,v 1.7 2011/02/05 06:42:44 spz Exp $);
 #include sys/param.h
 #include sys/types.h
 
@@ -1514,10 +1514,7 @@
 	buffer_put_cstring(k-cert-certblob, key_ssh_name(k));
 
 	/* -v01 certs put nonce first */
-	/*arc4random_buf(nonce, sizeof(nonce));*/
-	for (i = 0; i  sizeof(nonce); i += 4)
-		*(uint32_t *)(nonce[i]) = arc4random();
-
+	arc4random_buf(nonce, sizeof(nonce));
 	if (k-type == KEY_DSA_CERT || k-type == KEY_RSA_CERT) {
 		buffer_put_string(k-cert-certblob, nonce, sizeof(nonce));
 	}



CVS commit: [matt-nb5-mips64] src/sys/kern

2011-02-04 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Sat Feb  5 06:54:58 UTC 2011

Modified Files:
src/sys/kern [matt-nb5-mips64]: subr_evcnt.c

Log Message:
- remove leftover debug print


To generate a diff of this commit:
cvs rdiff -u -r1.4.94.1 -r1.4.94.2 src/sys/kern/subr_evcnt.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/subr_evcnt.c
diff -u src/sys/kern/subr_evcnt.c:1.4.94.1 src/sys/kern/subr_evcnt.c:1.4.94.2
--- src/sys/kern/subr_evcnt.c:1.4.94.1	Sat Feb  5 06:13:45 2011
+++ src/sys/kern/subr_evcnt.c	Sat Feb  5 06:54:58 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_evcnt.c,v 1.4.94.1 2011/02/05 06:13:45 cliff Exp $ */
+/* $NetBSD: subr_evcnt.c,v 1.4.94.2 2011/02/05 06:54:58 cliff Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_evcnt.c,v 1.4.94.1 2011/02/05 06:13:45 cliff Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_evcnt.c,v 1.4.94.2 2011/02/05 06:54:58 cliff Exp $);
 
 #include opt_ddb.h
 
@@ -125,9 +125,6 @@
 {
 	int len;
 
-#ifdef DEBUG	/* XXX TMP FIXME */
-	printf(%s: %p \%s\\n, __func__, ev, ev-ev_name);
-#endif
 	len = strlen(ev-ev_group);
 #ifdef DIAGNOSTIC
 	if (len = EVCNT_STRING_MAX)		/* ..._MAX includes NUL */