CVS commit: src/sys/netinet

2010-03-31 Thread Thor Lancelot Simon
Module Name:src
Committed By:   tls
Date:   Wed Mar 31 07:31:15 UTC 2010

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

Log Message:
Don't hold kernel lock across call to ip_input() -- it blocked *all*
hardware interrupts for the length of time it took for all dequeued
packets to flow up the stack (on multiprocessors only).  Initial testing
shows performance impact is minimal -- since this temporary fix actually
means taking/releasing the kernel lock per-packet, that seems
acceptable.

Holding the kernel lock across the ip_input() call duplicated the
exclusion intended to be provided by the socket locks/softnet lock
(same lock, for INET/INET6 sockets) and could mask serious bugs.  Several
hours' testing didn't turn any up but I'd be surprised if some don't now
appear.

Damon Permezel noticed the problem.  Temporary fix suggested by m...@.


To generate a diff of this commit:
cvs rdiff -u -r1.284 -r1.285 src/sys/netinet/ip_input.c

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

Modified files:

Index: src/sys/netinet/ip_input.c
diff -u src/sys/netinet/ip_input.c:1.284 src/sys/netinet/ip_input.c:1.285
--- src/sys/netinet/ip_input.c:1.284	Wed Sep 16 15:23:05 2009
+++ src/sys/netinet/ip_input.c	Wed Mar 31 07:31:15 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_input.c,v 1.284 2009/09/16 15:23:05 pooka Exp $	*/
+/*	$NetBSD: ip_input.c,v 1.285 2010/03/31 07:31:15 tls Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.284 2009/09/16 15:23:05 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.285 2010/03/31 07:31:15 tls Exp $");
 
 #include "opt_inet.h"
 #include "opt_compat_netbsd.h"
@@ -483,7 +483,9 @@
 		splx(s);
 		if (m == NULL)
 			break;
+		KERNEL_UNLOCK_ONE(NULL);
 		ip_input(m);
+		KERNEL_LOCK(1, NULL);
 	}
 	KERNEL_UNLOCK_ONE(NULL);
 	mutex_exit(softnet_lock);



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

2010-03-31 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Mar 31 09:14:56 UTC 2010

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

Log Message:
Import dhcpcd-5.2.2 with the following changes:
* Don't send a maximum DHCP message size beyond what we can handle.
* ip_id is now randomized.
* IPTOS_LOWDELAY and IP_DF flags are no longer set.

Status:

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

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
U 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/compat/getline.c
U src/external/bsd/dhcpcd/dist/compat/getline.h
U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/01-test
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

No conflicts created by this import



CVS commit: src/doc

2010-03-31 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Mar 31 09:21:44 UTC 2010

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note import of dhcpcd-5.2.2


To generate a diff of this commit:
cvs rdiff -u -r1.754 -r1.755 src/doc/3RDPARTY
cvs rdiff -u -r1.1372 -r1.1373 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.754 src/doc/3RDPARTY:1.755
--- src/doc/3RDPARTY:1.754	Mon Mar 29 15:44:53 2010
+++ src/doc/3RDPARTY	Wed Mar 31 09:21:43 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.754 2010/03/29 15:44:53 taca Exp $
+#	$NetBSD: 3RDPARTY,v 1.755 2010/03/31 09:21:43 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.1
-Current Vers:	5.2.1
+Version:	5.2.2
+Current Vers:	5.2.2
 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.1372 src/doc/CHANGES:1.1373
--- src/doc/CHANGES:1.1372	Wed Mar 24 00:41:21 2010
+++ src/doc/CHANGES	Wed Mar 31 09:21:43 2010
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1372 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1373 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -571,3 +571,4 @@
 		since the introduction of aibs(4).	[cnst 20100319]
 	cgtwelve: A driver for Sun CG12 / Matrox SG3 graphics boards
 		[macallan 20100323]
+	dhcpcd(8): Import dhcpcd-5.2.2. [roy 20100331]



CVS commit: src/sys/rump/librump/rumpkern

2010-03-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 31 11:35:33 UTC 2010

Modified Files:
src/sys/rump/librump/rumpkern: rump.c

Log Message:
* initialize msgbuf
* for banner, use aprint_verbose instead of if (verbose) printf


To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.156 src/sys/rump/librump/rumpkern/rump.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/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.155 src/sys/rump/librump/rumpkern/rump.c:1.156
--- src/sys/rump/librump/rumpkern/rump.c:1.155	Fri Mar  5 18:41:46 2010
+++ src/sys/rump/librump/rumpkern/rump.c	Wed Mar 31 11:35:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.155 2010/03/05 18:41:46 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.156 2010/03/31 11:35:33 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.155 2010/03/05 18:41:46 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.156 2010/03/31 11:35:33 pooka Exp $");
 
 #include 
 #include 
@@ -113,6 +113,8 @@
 int rump_threads = 1;
 #endif
 
+static char rump_msgbuf[16*1024]; /* 16k should be enough for std rump needs */
+
 static void
 rump_aiodone_worker(struct work *wk, void *dummy)
 {
@@ -182,10 +184,8 @@
 			boothowto = AB_VERBOSE;
 	}
 
-	/* Print some silly banners for spammy bootstrap. */
-	if (boothowto & AB_VERBOSE) {
-		printf("%s%s", copyright, version);
-	}
+	initmsgbuf(rump_msgbuf, sizeof(rump_msgbuf));
+	aprint_verbose("%s%s", copyright, version);
 
 	/*
 	 * Seed arc4random() with a "reasonable" amount of randomness.



CVS commit: src/sys/rump/librump/rumpkern

2010-03-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 31 12:16:15 UTC 2010

Modified Files:
src/sys/rump/librump/rumpkern: rump.c

Log Message:
set kernel boottime


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 src/sys/rump/librump/rumpkern/rump.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/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.156 src/sys/rump/librump/rumpkern/rump.c:1.157
--- src/sys/rump/librump/rumpkern/rump.c:1.156	Wed Mar 31 11:35:33 2010
+++ src/sys/rump/librump/rumpkern/rump.c	Wed Mar 31 12:16:15 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.156 2010/03/31 11:35:33 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.157 2010/03/31 12:16:15 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.156 2010/03/31 11:35:33 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.157 2010/03/31 12:16:15 pooka Exp $");
 
 #include 
 #include 
@@ -166,6 +166,7 @@
 rump__init(int rump_version)
 {
 	char buf[256];
+	uint64_t sec, nsec;
 	struct proc *p;
 	struct lwp *l;
 	int i;
@@ -184,6 +185,10 @@
 			boothowto = AB_VERBOSE;
 	}
 
+	rumpuser_gettime(&sec, &nsec, &error);
+	boottime.tv_sec = sec;
+	boottime.tv_nsec = nsec;
+
 	initmsgbuf(rump_msgbuf, sizeof(rump_msgbuf));
 	aprint_verbose("%s%s", copyright, version);
 



CVS commit: src/sys/net

2010-03-31 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Mar 31 12:17:01 UTC 2010

Modified Files:
src/sys/net: if_ieee1394subr.c

Log Message:
Now that fw_port.h is gone, we need to directly include 

Fixes build break reported by myself.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/net/if_ieee1394subr.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/net/if_ieee1394subr.c
diff -u src/sys/net/if_ieee1394subr.c:1.43 src/sys/net/if_ieee1394subr.c:1.44
--- src/sys/net/if_ieee1394subr.c:1.43	Mon Mar 29 03:05:27 2010
+++ src/sys/net/if_ieee1394subr.c	Wed Mar 31 12:17:01 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ieee1394subr.c,v 1.43 2010/03/29 03:05:27 kiyohara Exp $	*/
+/*	$NetBSD: if_ieee1394subr.c,v 1.44 2010/03/31 12:17:01 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ieee1394subr.c,v 1.43 2010/03/29 03:05:27 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ieee1394subr.c,v 1.44 2010/03/31 12:17:01 pgoyette Exp $");
 
 #include "opt_inet.h"
 
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 



CVS commit: src/sys/arch

2010-03-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Mar 31 12:56:14 UTC 2010

Modified Files:
src/sys/arch/hp700/hp700: genassym.cf intr.c locore.S
src/sys/arch/hp700/include: cpu.h intr.h
src/sys/arch/hppa/hppa: machdep.h trap.c

Log Message:
Make cpl, ipending, and intr_depth per CPU values.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/hp700/hp700/genassym.cf
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hp700/hp700/intr.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/hp700/hp700/locore.S
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/hp700/include/cpu.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/hp700/include/intr.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hppa/hppa/machdep.h
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/hppa/hppa/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/hp700/hp700/genassym.cf
diff -u src/sys/arch/hp700/hp700/genassym.cf:1.22 src/sys/arch/hp700/hp700/genassym.cf:1.23
--- src/sys/arch/hp700/hp700/genassym.cf:1.22	Tue Mar 30 19:38:52 2010
+++ src/sys/arch/hp700/hp700/genassym.cf	Wed Mar 31 12:56:14 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.22 2010/03/30 19:38:52 skrll Exp $
+#	$NetBSD: genassym.cf,v 1.23 2010/03/31 12:56:14 skrll Exp $
 
 #	$OpenBSD: genassym.cf,v 1.18 2001/09/20 18:31:14 mickey Exp $
 
@@ -85,7 +85,8 @@
 export	INT_REG_BIT_REG
 
 # struct cpu_info fields
-#define	CI_CPL			offsetof(struct cpu_info, ci_cpl)
+define	CI_CPL			offsetof(struct cpu_info, ci_cpl)
+define	CI_IPENDING		offsetof(struct cpu_info, ci_ipending)
 #define	CI_INTR_DEPTH		offsetof(struct cpu_info, ci_intr_depth)
 #define	CI_SOFTLWPS		offsetof(struct cpu_info, ci_softlwps)
 define	CI_MTX_COUNT		offsetof(struct cpu_info, ci_mtx_count)

Index: src/sys/arch/hp700/hp700/intr.c
diff -u src/sys/arch/hp700/hp700/intr.c:1.23 src/sys/arch/hp700/hp700/intr.c:1.24
--- src/sys/arch/hp700/hp700/intr.c:1.23	Wed Mar 24 12:38:55 2010
+++ src/sys/arch/hp700/hp700/intr.c	Wed Mar 31 12:56:14 2010
@@ -1,4 +1,6 @@
-/*	$NetBSD: intr.c,v 1.23 2010/03/24 12:38:55 skrll Exp $	*/
+/*	$NetBSD: intr.c,v 1.24 2010/03/31 12:56:14 skrll Exp $	*/
+/*	$NetBSD: intr.c,v 1.24 2010/03/31 12:56:14 skrll Exp $	*/
+/*	$OpenBSD: intr.c,v 1.27 2009/12/31 12:52:35 jsing Exp $	*/
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -34,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.23 2010/03/24 12:38:55 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.24 2010/03/31 12:56:14 skrll Exp $");
 
 #define __MUTEX_PRIVATE
 
@@ -57,18 +59,9 @@
 /* The priority level masks. */
 int imask[NIPL];
 
-/* The current priority level. */
-volatile int cpl;
-
-/* The pending interrupts. */
-volatile int ipending;
-
 /* Shared interrupts */
 int ishared;
 
-/* Nonzero iff we are running an interrupt. */
-u_int hppa_intr_depth;
-
 /* The list of all interrupt registers. */
 struct hp700_int_reg *hp700_int_regs[HP700_INT_BITS];
 
@@ -137,6 +130,7 @@
 void
 hp700_intr_bootstrap(void)
 {
+	struct cpu_info *ci = curcpu();
 	int i;
 
 	/* Initialize all prority level masks to mask everything. */
@@ -144,13 +138,13 @@
 		imask[i] = -1;
 
 	/* We are now at the highest priority level. */
-	cpl = -1;
+	ci->ci_cpl = -1;
 
 	/* There are no pending interrupts. */
-	ipending = 0;
+	ci->ci_ipending = 0;
 
 	/* We are not running an interrupt. */
-	hppa_intr_depth = 0;
+	ci->ci_intr_depth = 0;
 
 	/* There are no interrupt handlers. */
 	memset(hp700_int_bits, 0, sizeof(hp700_int_bits));
@@ -277,10 +271,11 @@
 void
 hp700_intr_init(void)
 {
-	int idx, bit_pos;
 	struct hp700_int_bit *int_bit;
-	int mask;
 	struct hp700_int_reg *int_reg;
+	struct cpu_info *ci = curcpu();
+	int idx, bit_pos;
+	int mask;
 	int eiem;
 
 	/*
@@ -339,8 +334,8 @@
 	 * Because we're paranoid, we force these values for cpl and ipending,
 	 * even though they should be unchanged since hp700_intr_bootstrap().
 	 */
-	cpl = -1;
-	ipending = 0;
+	ci->ci_cpl = -1;
+	ci->ci_ipending = 0;
 	eiem = 0;
 	for (idx = 0; idx < HP700_INT_BITS; idx++) {
 		int_reg = hp700_int_regs[idx];
@@ -374,6 +369,7 @@
 	int i;
 	struct hp700_int_reg *int_reg;
 	int hp700_intr_ipending_new(struct hp700_int_reg *, int);
+	struct cpu_info *ci = curcpu();
 
 	extern char ucas_ras_start[];
 	extern char ucas_ras_end[];
@@ -418,11 +414,12 @@
 	 */
 	mfctl(CR_EIRR, eirr);
 	mtctl(eirr, CR_EIRR);
-	ipending |= hp700_intr_ipending_new(&int_reg_cpu, eirr);
+
+	ci->ci_ipending |= hp700_intr_ipending_new(&int_reg_cpu, eirr);
 
 	/* If we have interrupts to dispatch, do so. */
-	if (ipending & ~cpl)
-		hp700_intr_dispatch(cpl, frame->tf_eiem, frame);
+	if (ci->ci_ipending & ~ci->ci_cpl)
+		hp700_intr_dispatch(ci->ci_cpl, frame->tf_eiem, frame);
 
 	/* We are done if there are no shared interrupts. */
 	if (ishared == 0)
@@ -439,15 +436,15 @@
 		ipending_new = *int_reg->int_reg_level;
 		while (ipending_new != 0) {
 			pending = ffs(ipending_new) - 1;

CVS commit: src/sbin/mount_fdesc

2010-03-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 31 13:10:10 UTC 2010

Modified Files:
src/sbin/mount_fdesc: mount_fdesc.c

Log Message:
initialize canon_dev


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sbin/mount_fdesc/mount_fdesc.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/mount_fdesc/mount_fdesc.c
diff -u src/sbin/mount_fdesc/mount_fdesc.c:1.24 src/sbin/mount_fdesc/mount_fdesc.c:1.25
--- src/sbin/mount_fdesc/mount_fdesc.c:1.24	Fri Jul 31 14:58:21 2009
+++ src/sbin/mount_fdesc/mount_fdesc.c	Wed Mar 31 13:10:10 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount_fdesc.c,v 1.24 2009/07/31 14:58:21 pooka Exp $	*/
+/*	$NetBSD: mount_fdesc.c,v 1.25 2010/03/31 13:10:10 pooka Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993, 1994
@@ -77,7 +77,7 @@
 #if 0
 static char sccsid[] = "@(#)mount_fdesc.c	8.3 (Berkeley) 4/26/95";
 #else
-__RCSID("$NetBSD: mount_fdesc.c,v 1.24 2009/07/31 14:58:21 pooka Exp $");
+__RCSID("$NetBSD: mount_fdesc.c,v 1.25 2010/03/31 13:10:10 pooka Exp $");
 #endif
 #endif /* not lint */
 
@@ -141,6 +141,7 @@
 	if (*mntflags & MNT_GETARGS)
 		exit(0);
 
+	strlcpy(canon_dev, argv[0], MAXPATHLEN);
 	if (realpath(argv[1], canon_dir) == NULL)/* Check mounton path */
 		err(1, "realpath %s", argv[1]);
 	if (strncmp(argv[1], canon_dir, MAXPATHLEN)) {



CVS commit: src/sys/arch/atari/atari

2010-03-31 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Mar 31 13:15:52 UTC 2010

Modified Files:
src/sys/arch/atari/atari: be_bus.c bus.c

Log Message:
ANSIfy, some KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/atari/atari/be_bus.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/atari/atari/bus.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/atari/atari/be_bus.c
diff -u src/sys/arch/atari/atari/be_bus.c:1.13 src/sys/arch/atari/atari/be_bus.c:1.14
--- src/sys/arch/atari/atari/be_bus.c:1.13	Wed Mar 18 16:00:10 2009
+++ src/sys/arch/atari/atari/be_bus.c	Wed Mar 31 13:15:52 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: be_bus.c,v 1.13 2009/03/18 16:00:10 cegger Exp $	*/
+/*	$NetBSD: be_bus.c,v 1.14 2010/03/31 13:15:52 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: be_bus.c,v 1.13 2009/03/18 16:00:10 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: be_bus.c,v 1.14 2010/03/31 13:15:52 tsutsui Exp $");
 
 #include 
 #include 
@@ -184,7 +184,7 @@
 		beb_t = storage;
 	else {
 	if ((beb_t = malloc(sizeof(*beb_t), M_TEMP, M_NOWAIT)) == NULL)
-		return(NULL);
+		return NULL;
 	}
 	memset(beb_t, 0, sizeof(*beb_t));
 	

Index: src/sys/arch/atari/atari/bus.c
diff -u src/sys/arch/atari/atari/bus.c:1.51 src/sys/arch/atari/atari/bus.c:1.52
--- src/sys/arch/atari/atari/bus.c:1.51	Wed Mar 18 16:00:10 2009
+++ src/sys/arch/atari/atari/bus.c	Wed Mar 31 13:15:52 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.c,v 1.51 2009/03/18 16:00:10 cegger Exp $	*/
+/*	$NetBSD: bus.c,v 1.52 2010/03/31 13:15:52 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.51 2009/03/18 16:00:10 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.52 2010/03/31 13:15:52 tsutsui Exp $");
 
 #include 
 #include 
@@ -128,6 +128,7 @@
 int
 bootm_free(vaddr_t va, u_long size)
 {
+
 	if ((va < bootm_ex->ex_start) || ((va + size) > bootm_ex->ex_end))
 		return 0; /* Not for us! */
 	extent_free(bootm_ex, va, size, EX_NOWAIT);
@@ -135,7 +136,8 @@
 }
 
 int
-bus_space_map(bus_space_tag_t t, bus_addr_t bpa, bus_size_t size, int flags, bus_space_handle_t *mhp)
+bus_space_map(bus_space_tag_t t, bus_addr_t bpa, bus_size_t size, int flags,
+bus_space_handle_t *mhp)
 {
 	int	error;
 
@@ -147,21 +149,24 @@
 			EX_NOWAIT | (iomem_malloc_safe ? EX_MALLOCOK : 0));
 
 	if (error)
-		return (error);
+		return error;
 
 	error = bus_mem_add_mapping(t, bpa, size, flags, mhp);
 	if (error) {
 		if (extent_free(iomem_ex, bpa + t->base, size, EX_NOWAIT |
-(iomem_malloc_safe ? EX_MALLOCOK : 0))) {
-		printf("bus_space_map: pa 0x%lx, size 0x%lx\n", bpa, size);
-		printf("bus_space_map: can't free region\n");
+		(iomem_malloc_safe ? EX_MALLOCOK : 0))) {
+			printf("bus_space_map: pa 0x%lx, size 0x%lx\n",
+			bpa, size);
+			printf("bus_space_map: can't free region\n");
 		}
 	}
-	return (error);
+	return error;
 }
 
 int
-bus_space_alloc(bus_space_tag_t t, bus_addr_t rstart, bus_addr_t rend, bus_size_t size, bus_size_t alignment, bus_size_t boundary, int flags, bus_addr_t *bpap, bus_space_handle_t *bshp)
+bus_space_alloc(bus_space_tag_t t, bus_addr_t rstart, bus_addr_t rend,
+bus_size_t size, bus_size_t alignment, bus_size_t boundary, int flags,
+bus_addr_t *bpap, bus_space_handle_t *bshp)
 {
 	u_long bpa;
 	int error;
@@ -172,8 +177,8 @@
 	 * XXX: Since we manage the whole of memory in a single map,
 	 *  this is nonsense for now! Brace it DIAGNOSTIC
 	 */
-	if ((rstart + t->base) < iomem_ex->ex_start
-|| (rend + t->base) > iomem_ex->ex_end)
+	if ((rstart + t->base) < iomem_ex->ex_start ||
+	(rend + t->base) > iomem_ex->ex_end)
 		panic("bus_space_alloc: bad region start/end");
 #endif /* DIAGNOSTIC */
 
@@ -186,7 +191,7 @@
 	&bpa);
 
 	if (error)
-		return (error);
+		return error;
 
 	/*
 	 * Map the bus physical address to a kernel virtual address.
@@ -203,11 +208,12 @@
 
 	*bpap = bpa;
 
-	return (error);
+	return error;
 }
 
 static int
-bus_mem_add_mapping(bus_space_tag_t t, bus_addr_t bpa, bus_size_t size, int flags, bus_space_handle_t *bshp)
+bus_mem_add_mapping(bus_space_tag_t t, bus_addr_t bpa, bus_size_t size,
+int flags, bus_space_handle_t *bshp)
 {
 	vaddr_t	va;
 	paddr_t	pa, endpa;
@@ -227,15 +233,15 @@
 		 */
 		va = bootm_alloc(pa, endpa - pa, flags);
 		if (va == 0)
-			return (ENOMEM);
+			return ENOMEM;
 		*bshp = va + (bpa & PGOFSET);
-		return (0);
+		return 0;
 	}
 
 	va = uvm_km_alloc(kernel_map, endpa - pa, 0,
 	UVM_KMF_VAONLY | UVM_KMF_NOWAIT);
 	if (va == 0)
-		return (ENOMEM);
+		return ENOMEM;
 
 	*bshp = va + (bpa & PGOFSET);
 
@@ -243,12 +249,12 @@
 		u_int	*ptep, npte;
 
 		pmap_enter(pmap_kernel(), (vaddr_t)va, pa,
-VM_PROT_READ|VM_PROT_WRITE, PMAP_WIRED);
+		VM_PROT

CVS commit: src/sbin/mount_kernfs

2010-03-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 31 13:33:14 UTC 2010

Modified Files:
src/sbin/mount_kernfs: mount_kernfs.c
Added Files:
src/sbin/mount_kernfs: mount_kernfs.h

Log Message:
convert to parseargs


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sbin/mount_kernfs/mount_kernfs.c
cvs rdiff -u -r0 -r1.1 src/sbin/mount_kernfs/mount_kernfs.h

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

Modified files:

Index: src/sbin/mount_kernfs/mount_kernfs.c
diff -u src/sbin/mount_kernfs/mount_kernfs.c:1.23 src/sbin/mount_kernfs/mount_kernfs.c:1.24
--- src/sbin/mount_kernfs/mount_kernfs.c:1.23	Mon Jul 21 13:29:05 2008
+++ src/sbin/mount_kernfs/mount_kernfs.c	Wed Mar 31 13:33:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount_kernfs.c,v 1.23 2008/07/21 13:29:05 lukem Exp $	*/
+/*	$NetBSD: mount_kernfs.c,v 1.24 2010/03/31 13:33:14 pooka Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993, 1994
@@ -77,7 +77,7 @@
 #if 0
 static char sccsid[] = "@(#)mount_kernfs.c	8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: mount_kernfs.c,v 1.23 2008/07/21 13:29:05 lukem Exp $");
+__RCSID("$NetBSD: mount_kernfs.c,v 1.24 2010/03/31 13:33:14 pooka Exp $");
 #endif
 #endif /* not lint */
 
@@ -92,6 +92,8 @@
 
 #include 
 
+#include "mount_kernfs.h"
+
 static const struct mntopt mopts[] = {
 	MOPT_STDOPTS,
 	MOPT_GETARGS,
@@ -109,18 +111,18 @@
 }
 #endif
 
-int
-mount_kernfs(int argc, char *argv[])
+void
+mount_kernfs_parseargs(int argc, char *argv[], void *dummy, int *mntflags,
+	char *canon_dev, char *canon_dir)
 {
-	int ch, mntflags;
-	char canon_dir[MAXPATHLEN];
+	int ch;
 	mntoptparse_t mp;
 
-	mntflags = 0;
+	*mntflags = 0;
 	while ((ch = getopt(argc, argv, "o:")) != -1)
 		switch (ch) {
 		case 'o':
-			mp = getmntopts(optarg, mopts, &mntflags, 0);
+			mp = getmntopts(optarg, mopts, mntflags, 0);
 			if (mp == NULL)
 err(1, "getmntopts");
 			freemntopts(mp);
@@ -136,16 +138,26 @@
 		usage();
 
 	/* not supported, fail silently */
-	if (mntflags & MNT_GETARGS)
+	if (*mntflags & MNT_GETARGS)
 		exit(0);
 
+	strlcpy(canon_dev, argv[0], MAXPATHLEN);
 	if (realpath(argv[1], canon_dir) == NULL)/* Check mounton path */
 		err(1, "realpath %s", argv[1]);
 	if (strncmp(argv[1], canon_dir, MAXPATHLEN)) {
 		warnx("\"%s\" is a relative path.", argv[1]);
 		warnx("using \"%s\" instead.", canon_dir);
 	}
+}
+
+int
+mount_kernfs(int argc, char *argv[])
+{
+	char canon_dev[MAXPATHLEN], canon_dir[MAXPATHLEN];
+	int mntflags;
 
+	mount_kernfs_parseargs(argc, argv, NULL, &mntflags,
+	canon_dev, canon_dir);
 	if (mount(MOUNT_KERNFS, canon_dir, mntflags, NULL, 0) == -1)
 		err(1, "kernfs on %s", argv[1]);
 	exit(0);

Added files:

Index: src/sbin/mount_kernfs/mount_kernfs.h
diff -u /dev/null src/sbin/mount_kernfs/mount_kernfs.h:1.1
--- /dev/null	Wed Mar 31 13:33:14 2010
+++ src/sbin/mount_kernfs/mount_kernfs.h	Wed Mar 31 13:33:14 2010
@@ -0,0 +1,35 @@
+/*	$NetBSD: mount_kernfs.h,v 1.1 2010/03/31 13:33:14 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2008 The NetBSD Foundation.  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 AUTHOR ``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 AUTHOR 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 _SBIN_MOUNT_KERNFS_MOUNT_KERNFS_H_
+#define _SBIN_MOUNT_KERNFS_MOUNT_KERNFS_H_
+
+int	mount_kernfs(int, char **);
+void	mount_kernfs_parseargs(int, char **, void *, int *,
+			   char *, char *);
+
+#endif /* _SBIN_MOUNT_KERNFS_MOUNT_KERNFS_H_ */



CVS commit: src/sys/rump/librump/rumpkern

2010-03-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 31 14:08:33 UTC 2010

Modified Files:
src/sys/rump/librump/rumpkern: emul.c

Log Message:
We don't have a real rootdev (by default at least), so set it to NODEV.


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/sys/rump/librump/rumpkern/emul.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/librump/rumpkern/emul.c
diff -u src/sys/rump/librump/rumpkern/emul.c:1.123 src/sys/rump/librump/rumpkern/emul.c:1.124
--- src/sys/rump/librump/rumpkern/emul.c:1.123	Mon Mar  1 11:35:58 2010
+++ src/sys/rump/librump/rumpkern/emul.c	Wed Mar 31 14:08:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: emul.c,v 1.123 2010/03/01 11:35:58 pooka Exp $	*/
+/*	$NetBSD: emul.c,v 1.124 2010/03/31 14:08:33 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.123 2010/03/01 11:35:58 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.124 2010/03/31 14:08:33 pooka Exp $");
 
 #include 
 #include 
@@ -67,7 +67,7 @@
 kmutex_t *proc_lock;
 struct lwp lwp0;
 struct vnode *rootvp;
-dev_t rootdev;
+dev_t rootdev = NODEV;
 int physmem = 256*256; /* 256 * 1024*1024 / 4k, PAGE_SIZE not always set */
 int doing_shutdown;
 const int schedppq = 1;



CVS commit: src/sys/rump/fs

2010-03-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 31 14:12:33 UTC 2010

Modified Files:
src/sys/rump/fs: Makefile.rumpfs

Log Message:
separate vfs-like components from actual drivers
(no functional change)


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/rump/fs/Makefile.rumpfs

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/fs/Makefile.rumpfs
diff -u src/sys/rump/fs/Makefile.rumpfs:1.21 src/sys/rump/fs/Makefile.rumpfs:1.22
--- src/sys/rump/fs/Makefile.rumpfs:1.21	Tue Mar 30 00:59:07 2010
+++ src/sys/rump/fs/Makefile.rumpfs	Wed Mar 31 14:12:33 2010
@@ -1,9 +1,11 @@
-#	$NetBSD: Makefile.rumpfs,v 1.21 2010/03/30 00:59:07 pooka Exp $
+#	$NetBSD: Makefile.rumpfs,v 1.22 2010/03/31 14:12:33 pooka Exp $
 #
 
-RUMPFSLIST=	cd9660 efs ext2fs fdesc ffs fifovfs hfs layervfs lfs	\
-		mfs msdos nfs nilfs ntfs nullfs smbfs syspuffs sysvbfs	\
-		tmpfs udf umapfs union
+RUMPFSLIST=	cd9660 efs ext2fs fdesc ffs hfs lfs mfs msdos		\
+		nfs nilfs ntfs nullfs smbfs syspuffs sysvbfs tmpfs udf	\
+		umapfs union
+
+RUMPFSLIST+=	fifovfs layervfs
 
 .for var in ${RUMPFSLIST}
 RUMPFSLIBS+=lib${var}



CVS commit: src/sys/arch/atari/atari

2010-03-31 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Mar 31 14:12:55 UTC 2010

Modified Files:
src/sys/arch/atari/atari: disksubr.c intr.c machdep.c

Log Message:
Misc KNF and cosmetics.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/atari/atari/disksubr.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/atari/atari/intr.c
cvs rdiff -u -r1.165 -r1.166 src/sys/arch/atari/atari/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/atari/atari/disksubr.c
diff -u src/sys/arch/atari/atari/disksubr.c:1.41 src/sys/arch/atari/atari/disksubr.c:1.42
--- src/sys/arch/atari/atari/disksubr.c:1.41	Tue Oct 20 19:10:10 2009
+++ src/sys/arch/atari/atari/disksubr.c	Wed Mar 31 14:12:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: disksubr.c,v 1.41 2009/10/20 19:10:10 snj Exp $	*/
+/*	$NetBSD: disksubr.c,v 1.42 2010/03/31 14:12:55 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1995 Leo Weppelman.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.41 2009/10/20 19:10:10 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.42 2010/03/31 14:12:55 tsutsui Exp $");
 
 #ifndef DISKLABEL_NBDA
 #define	DISKLABEL_NBDA	/* required */
@@ -69,13 +69,15 @@
  * Returns NULL on success and an error string on failure.
  */
 const char *
-readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, struct cpu_disklabel *clp)
+readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp,
+struct cpu_disklabel *clp)
 {
-	int			e;
+	int e;
 
 	if (clp != NULL)
 		memset(clp, 0, sizeof *clp);
-	else printf("Warning: clp == NULL\n");
+	else
+		printf("Warning: clp == NULL\n");
 
 	/*
 	 * Give some guaranteed validity to the disk label.
@@ -85,7 +87,7 @@
 	if (lp->d_secperunit == 0)
 		lp->d_secperunit = 0x1fff;
 	if (lp->d_secpercyl == 0)
-		return("Zero secpercyl");
+		return "Zero secpercyl";
 
 	/*
 	 * Some parts of the kernel (see scsipi/cd.c for an example)
@@ -117,39 +119,41 @@
 		e = ahdi_label(dev, strat, lp, clp);
 #endif
 	if (e < 0)
-		return("I/O error");
+		return "I/O error";
 
 	/* Unknown format or uninitialized volume? */
 	if (e > 0)
 		uprintf("Warning: unknown disklabel format"
-			"- assuming empty disk\n");
+		"- assuming empty disk\n");
 
 	/* Calulate new checksum. */
 	lp->d_magic = lp->d_magic2 = DISKMAGIC;
 	lp->d_checksum = 0;
 	lp->d_checksum = dkcksum(lp);
 
-	return(NULL);
+	return NULL;
 }
 
 /*
  * Check new disk label for sensibility before setting it.
  */
 int
-setdisklabel(struct disklabel *olp, struct disklabel *nlp, u_long openmask, struct cpu_disklabel *clp)
+setdisklabel(struct disklabel *olp, struct disklabel *nlp, u_long openmask,
+struct cpu_disklabel *clp)
 {
+
 	/* special case to allow disklabel to be invalidated */
 	if (nlp->d_magic == 0x) {
 		*olp = *nlp;
-		return(0);
+		return 0;
 	}
 
 	/* sanity clause */
-	if (nlp->d_secpercyl == 0 || nlp->d_npartitions > MAXPARTITIONS
-	  || nlp->d_secsize  == 0 || (nlp->d_secsize % DEV_BSIZE) != 0
-	  || nlp->d_magic != DISKMAGIC || nlp->d_magic2 != DISKMAGIC
-	  || dkcksum(nlp) != 0)
-		return(EINVAL);
+	if (nlp->d_secpercyl == 0 || nlp->d_npartitions > MAXPARTITIONS ||
+	nlp->d_secsize  == 0 || (nlp->d_secsize % DEV_BSIZE) != 0 ||
+	nlp->d_magic != DISKMAGIC || nlp->d_magic2 != DISKMAGIC ||
+	dkcksum(nlp) != 0)
+		return EINVAL;
 
 #ifdef DISKLABEL_AHDI
 	if (clp && clp->cd_bblock)
@@ -160,11 +164,11 @@
 		int i = ffs(openmask) - 1;
 		openmask &= ~(1 << i);
 		if (i >= nlp->d_npartitions)
-			return(EBUSY);
+			return EBUSY;
 		op = &olp->d_partitions[i];
 		np = &nlp->d_partitions[i];
 		if (np->p_offset != op->p_offset || np->p_size < op->p_size)
-			return(EBUSY);
+			return EBUSY;
 		/*
 		 * Copy internally-set partition information
 		 * if new label doesn't include it.		XXX
@@ -179,22 +183,23 @@
  	nlp->d_checksum = 0;
  	nlp->d_checksum = dkcksum(nlp);
 	*olp = *nlp;
-	return(0);
+	return 0;
 }
 
 /*
  * Write disk label back to device after modification.
  */
 int
-writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp, struct cpu_disklabel *clp)
+writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp,
+struct cpu_disklabel *clp)
 {
-	struct buf		*bp;
-	u_int			blk;
-	int			rv;
+	struct buf *bp;
+	u_int blk;
+	int rv;
 
 	blk = clp->cd_bblock;
 	if (blk == NO_BOOT_BLOCK)
-		return(ENXIO);
+		return ENXIO;
 
 	bp = geteblk(BBMINSIZE);
 	bp->b_dev  = MAKEDISKDEV(major(dev), DISKUNIT(dev), RAW_PART);
@@ -204,7 +209,7 @@
 	bp->b_cylinder = blk / lp->d_secpercyl;
 	(*strat)(bp);
 	rv = biowait(bp);
-	if (!rv) {
+	if (rv == 0) {
 		struct bootblock *bb = (struct bootblock *)bp->b_data;
 		/*
 		 * Allthough the disk pack label may appear anywhere
@@ -228,7 +233,7 @@
 		rv = biowait(bp);
 	}
 	brelse(bp, 0);
-	return(rv);
+	return rv;
 }
 
 /*
@@ -240,15 +245,11 @@
  *  

CVS commit: src/sys/rump/fs

2010-03-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 31 14:18:33 UTC 2010

Modified Files:
src/sys/rump/fs: Makefile.rumpfs
Added Files:
src/sys/rump/fs/lib/libkernfs: Makefile shlib_version

Log Message:
support kernfs


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/rump/fs/Makefile.rumpfs
cvs rdiff -u -r0 -r1.1 src/sys/rump/fs/lib/libkernfs/Makefile \
src/sys/rump/fs/lib/libkernfs/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/sys/rump/fs/Makefile.rumpfs
diff -u src/sys/rump/fs/Makefile.rumpfs:1.22 src/sys/rump/fs/Makefile.rumpfs:1.23
--- src/sys/rump/fs/Makefile.rumpfs:1.22	Wed Mar 31 14:12:33 2010
+++ src/sys/rump/fs/Makefile.rumpfs	Wed Mar 31 14:18:33 2010
@@ -1,7 +1,7 @@
-#	$NetBSD: Makefile.rumpfs,v 1.22 2010/03/31 14:12:33 pooka Exp $
+#	$NetBSD: Makefile.rumpfs,v 1.23 2010/03/31 14:18:33 pooka Exp $
 #
 
-RUMPFSLIST=	cd9660 efs ext2fs fdesc ffs hfs lfs mfs msdos		\
+RUMPFSLIST=	cd9660 efs ext2fs fdesc ffs hfs kernfs lfs mfs msdos	\
 		nfs nilfs ntfs nullfs smbfs syspuffs sysvbfs tmpfs udf	\
 		umapfs union
 

Added files:

Index: src/sys/rump/fs/lib/libkernfs/Makefile
diff -u /dev/null src/sys/rump/fs/lib/libkernfs/Makefile:1.1
--- /dev/null	Wed Mar 31 14:18:33 2010
+++ src/sys/rump/fs/lib/libkernfs/Makefile	Wed Mar 31 14:18:33 2010
@@ -0,0 +1,11 @@
+#	$NetBSD: Makefile,v 1.1 2010/03/31 14:18:33 pooka Exp $
+#
+
+.PATH:  ${.CURDIR}/../../../../miscfs/kernfs
+
+LIB=	rumpfs_kernfs
+
+SRCS=	kernfs_subr.c kernfs_vfsops.c kernfs_vnops.c
+
+.include 
+.include 
Index: src/sys/rump/fs/lib/libkernfs/shlib_version
diff -u /dev/null src/sys/rump/fs/lib/libkernfs/shlib_version:1.1
--- /dev/null	Wed Mar 31 14:18:33 2010
+++ src/sys/rump/fs/lib/libkernfs/shlib_version	Wed Mar 31 14:18:33 2010
@@ -0,0 +1,4 @@
+#	$NetBSD: shlib_version,v 1.1 2010/03/31 14:18:33 pooka Exp $
+#
+major=0
+minor=0



CVS commit: src/distrib/sets/lists

2010-03-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 31 14:21:23 UTC 2010

Modified Files:
src/distrib/sets/lists/base: shl.elf shl.mi
src/distrib/sets/lists/comp: mi shl.mi

Log Message:
+rumpfs_kernfs


To generate a diff of this commit:
cvs rdiff -u -r1.209 -r1.210 src/distrib/sets/lists/base/shl.elf
cvs rdiff -u -r1.530 -r1.531 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.1421 -r1.1422 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.111 -r1.112 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/shl.elf
diff -u src/distrib/sets/lists/base/shl.elf:1.209 src/distrib/sets/lists/base/shl.elf:1.210
--- src/distrib/sets/lists/base/shl.elf:1.209	Tue Mar 30 01:01:09 2010
+++ src/distrib/sets/lists/base/shl.elf	Wed Mar 31 14:21:22 2010
@@ -1,4 +1,4 @@
-# $NetBSD: shl.elf,v 1.209 2010/03/30 01:01:09 pooka Exp $
+# $NetBSD: shl.elf,v 1.210 2010/03/31 14:21:22 pooka Exp $
 #
 # Note:	Do not mark "old" major and major.minor shared libraries as
 #	"obsolete"; just remove the entry, as third-party applications
@@ -288,6 +288,8 @@
 ./usr/lib/librumpfs_ffs.so.0			base-rump-shlib
 ./usr/lib/librumpfs_hfs.so			base-rump-shlib
 ./usr/lib/librumpfs_hfs.so.0			base-rump-shlib
+./usr/lib/librumpfs_kernfs.so			base-rump-shlib
+./usr/lib/librumpfs_kernfs.so.0			base-rump-shlib
 ./usr/lib/librumpfs_lfs.so			base-rump-shlib
 ./usr/lib/librumpfs_lfs.so.0			base-rump-shlib
 ./usr/lib/librumpfs_mfs.so			base-rump-shlib

Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.530 src/distrib/sets/lists/base/shl.mi:1.531
--- src/distrib/sets/lists/base/shl.mi:1.530	Tue Mar 30 01:01:09 2010
+++ src/distrib/sets/lists/base/shl.mi	Wed Mar 31 14:21:22 2010
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.530 2010/03/30 01:01:09 pooka Exp $
+# $NetBSD: shl.mi,v 1.531 2010/03/31 14:21:22 pooka Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -151,6 +151,7 @@
 ./usr/lib/librumpfs_fdesc.so.0.0		base-rump-shlib
 ./usr/lib/librumpfs_ffs.so.0.0			base-rump-shlib
 ./usr/lib/librumpfs_hfs.so.0.0			base-rump-shlib
+./usr/lib/librumpfs_kernfs.so.0.0		base-rump-shlib
 ./usr/lib/librumpfs_lfs.so.0.0			base-rump-shlib
 ./usr/lib/librumpfs_mfs.so.0.0			base-rump-shlib
 ./usr/lib/librumpfs_msdos.so.0.0		base-rump-shlib

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1421 src/distrib/sets/lists/comp/mi:1.1422
--- src/distrib/sets/lists/comp/mi:1.1421	Tue Mar 30 01:01:09 2010
+++ src/distrib/sets/lists/comp/mi	Wed Mar 31 14:21:22 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1421 2010/03/30 01:01:09 pooka Exp $
+#	$NetBSD: mi,v 1.1422 2010/03/31 14:21:22 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2643,6 +2643,9 @@
 ./usr/lib/librumpfs_hfs.a			comp-c-lib
 ./usr/lib/librumpfs_hfs_g.a			-unknown-		debuglib
 ./usr/lib/librumpfs_hfs_p.a			comp-c-proflib		profile
+./usr/lib/librumpfs_kernfs.a			comp-c-lib
+./usr/lib/librumpfs_kernfs_g.a			-unknown-		debuglib
+./usr/lib/librumpfs_kernfs_p.a			comp-c-proflib		profile
 ./usr/lib/librumpfs_lfs.a			comp-c-lib
 ./usr/lib/librumpfs_lfs_g.a			-unknown-		debuglib
 ./usr/lib/librumpfs_lfs_p.a			comp-c-proflib		profile

Index: src/distrib/sets/lists/comp/shl.mi
diff -u src/distrib/sets/lists/comp/shl.mi:1.111 src/distrib/sets/lists/comp/shl.mi:1.112
--- src/distrib/sets/lists/comp/shl.mi:1.111	Tue Mar 30 01:01:10 2010
+++ src/distrib/sets/lists/comp/shl.mi	Wed Mar 31 14:21:23 2010
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.111 2010/03/30 01:01:10 pooka Exp $
+# $NetBSD: shl.mi,v 1.112 2010/03/31 14:21:23 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -113,6 +113,7 @@
 ./usr/lib/librumpfs_fdesc_pic.a			comp-c-piclib
 ./usr/lib/librumpfs_ffs_pic.a			comp-c-piclib
 ./usr/lib/librumpfs_hfs_pic.a			comp-c-piclib
+./usr/lib/librumpfs_kernfs_pic.a		comp-c-piclib
 ./usr/lib/librumpfs_lfs_pic.a			comp-c-piclib
 ./usr/lib/librumpfs_mfs_pic.a			comp-c-piclib
 ./usr/lib/librumpfs_msdos_pic.a			comp-c-piclib



CVS commit: src/usr.sbin/puffs

2010-03-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 31 14:22:27 UTC 2010

Modified Files:
src/usr.sbin/puffs: Makefile
Added Files:
src/usr.sbin/puffs/rump_kernfs: Makefile rump_kernfs.c

Log Message:
Add kernfs server.

Don't build & install it by default, since it represents the state
of the rump virtual kernel and not the host kernel.  However, it's
useful for debugging kernfs.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/puffs/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/puffs/rump_kernfs/Makefile \
src/usr.sbin/puffs/rump_kernfs/rump_kernfs.c

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

Modified files:

Index: src/usr.sbin/puffs/Makefile
diff -u src/usr.sbin/puffs/Makefile:1.12 src/usr.sbin/puffs/Makefile:1.13
--- src/usr.sbin/puffs/Makefile:1.12	Mon Mar  8 12:48:31 2010
+++ src/usr.sbin/puffs/Makefile	Wed Mar 31 14:22:27 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.12 2010/03/08 12:48:31 pooka Exp $
+#	$NetBSD: Makefile,v 1.13 2010/03/31 14:22:27 pooka Exp $
 
 SUBDIR=	mount_9p mount_psshfs mount_sysctlfs
 
@@ -14,6 +14,9 @@
 # and is therefore not useful for the average user
 #SUBDIR+=rump_fdesc
 
+# ditto for kernfs
+#SUBDIR+=rump_kernfs
+
 # rump_mqmfs is just another ffs, useful mainly for debugging
 #SUBDIR+=rump_nqmfs
 

Added files:

Index: src/usr.sbin/puffs/rump_kernfs/Makefile
diff -u /dev/null src/usr.sbin/puffs/rump_kernfs/Makefile:1.1
--- /dev/null	Wed Mar 31 14:22:27 2010
+++ src/usr.sbin/puffs/rump_kernfs/Makefile	Wed Mar 31 14:22:27 2010
@@ -0,0 +1,8 @@
+#	$NetBSD: Makefile,v 1.1 2010/03/31 14:22:27 pooka Exp $
+#
+
+MOUNTNAME=	kernfs
+
+ISRUMP=		# syndicate
+
+.include 
Index: src/usr.sbin/puffs/rump_kernfs/rump_kernfs.c
diff -u /dev/null src/usr.sbin/puffs/rump_kernfs/rump_kernfs.c:1.1
--- /dev/null	Wed Mar 31 14:22:27 2010
+++ src/usr.sbin/puffs/rump_kernfs/rump_kernfs.c	Wed Mar 31 14:22:27 2010
@@ -0,0 +1,57 @@
+/*	$NetBSD: rump_kernfs.c,v 1.1 2010/03/31 14:22:27 pooka Exp $	*/
+
+/*
+ * Copyright (c) 2008 Antti Kantee.  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 AUTHOR ``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 AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include "mount_kernfs.h"
+
+int
+main(int argc, char *argv[])
+{
+	char canon_dev[MAXPATHLEN], canon_dir[MAXPATHLEN];
+	int mntflags;
+	int rv;
+
+	setprogname(argv[0]);
+
+	mount_kernfs_parseargs(argc, argv, NULL, &mntflags,
+	canon_dev, canon_dir);
+	rv = p2k_run_fs(MOUNT_KERNFS, canon_dev, canon_dir, mntflags,
+		NULL, 0, PUFFS_KFLAG_NOCACHE);
+	if (rv)
+		err(1, "mount");
+
+	return 0;
+}



CVS commit: src/usr.sbin/puffs/rump_kernfs

2010-03-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 31 14:33:38 UTC 2010

Added Files:
src/usr.sbin/puffs/rump_kernfs: rump_kernfs.8

Log Message:
generate


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/usr.sbin/puffs/rump_kernfs/rump_kernfs.8

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

Added files:

Index: src/usr.sbin/puffs/rump_kernfs/rump_kernfs.8
diff -u /dev/null src/usr.sbin/puffs/rump_kernfs/rump_kernfs.8:1.1
--- /dev/null	Wed Mar 31 14:33:38 2010
+++ src/usr.sbin/puffs/rump_kernfs/rump_kernfs.8	Wed Mar 31 14:33:37 2010
@@ -0,0 +1,112 @@
+.\"	$NetBSD: rump_kernfs.8,v 1.1 2010/03/31 14:33:37 pooka Exp $
+.\"
+.\"	WARNING: GENERATED FILE, DO NOT EDIT
+.\"	INSTEAD, EDIT makerumpmanpages.sh AND REGEN
+.\"
+.\" Copyright (c) 2008 Antti Kantee. 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 AUTHOR 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 AUTHOR 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.
+.\"
+.Dd February 15, 2009
+.Dt RUMP_KERNFS 8
+.Os
+.Sh NAME
+.Nm rump_kernfs
+.Nd mount the kernfs file system using a userspace server
+.Sh SYNOPSIS
+.Cd "file-system PUFFS"
+.Cd "pseudo-device putter"
+.Pp
+.Nm
+.Op options
+.Ar special
+.Ar node
+.Sh DESCRIPTION
+The
+.Nm
+utility can be used to mount kernfs file systems.
+It uses
+.Xr rump 3
+and
+.Xr p2k 3
+to facilitate running the file system as a server in userspace.
+As opposed to
+.Xr mount_kernfs 8 ,
+.Nm
+does not use file system code within the kernel and therefore does
+not require kernel support except
+.Xr puffs 4 .
+Apart from a minor speed penalty (starting from 10% and depending
+on the workload and file system in question), there is no difference
+to using in-kernel code.
+.Pp
+In case mounting a file system image from a regular file,
+.Nm
+does not require the use of
+.Xr vnconfig 8
+unlike kernel file systems.
+Instead, the image path can be directly passed as the special file path.
+The exception is if the image contains a disklabel.
+In this case vnconfig is required to resolve the start offset for the
+correct partition within the image.
+.Pp
+It is recommended that untrusted file system images be mounted with
+.Nm
+instead of
+.Xr mount_kernfs 8 .
+Corrupt file system images commonly cause the file system
+to crash the entire kernel, but with
+.Nm
+only the userspace server process will dump core.
+.Pp
+To use
+.Nm
+via
+.Xr mount 8 ,
+the flags
+.Fl o Ar rump
+and
+.Fl t Ar kernfs
+should be given.
+Similarly,
+.Nm
+is run instead of
+.Xr mount_kernfs 8
+if
+.Dq rump
+is added to the options field of
+.Xr fstab 5 .
+.Pp
+Please see
+.Xr mount_kernfs 8
+for a full description of the available command line options.
+.Sh SEE ALSO
+.Xr p2k 3 ,
+.Xr puffs 3 ,
+.Xr rump 3 ,
+.Xr mount_kernfs 8
+.Sh HISTORY
+The
+.Nm
+utility first appeared in
+.Nx 5.0 .
+It is currently considered experimental.



CVS commit: src/usr.sbin/puffs

2010-03-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 31 14:45:59 UTC 2010

Modified Files:
src/usr.sbin/puffs: makerumpmanpages.sh

Log Message:
Add note saying that the manual page is autogenerated and all parts
may not apply to this particular server.

TODO: have three different texts, one for device backed file systems
(e.g. ffs), another for network backed (e.g. nfs), and a third for
fictional (e.g. kernfs)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/puffs/makerumpmanpages.sh

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

Modified files:

Index: src/usr.sbin/puffs/makerumpmanpages.sh
diff -u src/usr.sbin/puffs/makerumpmanpages.sh:1.8 src/usr.sbin/puffs/makerumpmanpages.sh:1.9
--- src/usr.sbin/puffs/makerumpmanpages.sh:1.8	Sun Feb 15 18:00:16 2009
+++ src/usr.sbin/puffs/makerumpmanpages.sh	Wed Mar 31 14:45:59 2010
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: makerumpmanpages.sh,v 1.8 2009/02/15 18:00:16 pooka Exp $
+#	$NetBSD: makerumpmanpages.sh,v 1.9 2010/03/31 14:45:59 pooka Exp $
 #
 
 IFS=' '
@@ -32,7 +32,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd February 15, 2009
+.Dd March 31, 2010
 .Dt RUMP_XXXFSXXX 8
 .Os
 .Sh NAME
@@ -47,6 +47,14 @@
 .Ar special
 .Ar node
 .Sh DESCRIPTION
+.Em NOTE!
+This manual page has been generated from a common source shared between all
+.Xr rump 3
+file servers.
+Some parts of this manual page may not apply to this particular server.
+After reading this manual page, you may want to verify the details from
+.Xr mount_xxxfsxxx 8 .
+.Pp
 The
 .Nm
 utility can be used to mount xxxfsxxx file systems.



CVS commit: src/usr.sbin/puffs/rump_nqmfs

2010-03-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 31 14:49:02 UTC 2010

Modified Files:
src/usr.sbin/puffs/rump_nqmfs: rump_nqmfs.c

Log Message:
MAP_COPY is available only in _KERNEL  uh, so don't use it here.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/puffs/rump_nqmfs/rump_nqmfs.c

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

Modified files:

Index: src/usr.sbin/puffs/rump_nqmfs/rump_nqmfs.c
diff -u src/usr.sbin/puffs/rump_nqmfs/rump_nqmfs.c:1.1 src/usr.sbin/puffs/rump_nqmfs/rump_nqmfs.c:1.2
--- src/usr.sbin/puffs/rump_nqmfs/rump_nqmfs.c:1.1	Mon Mar  8 12:46:34 2010
+++ src/usr.sbin/puffs/rump_nqmfs/rump_nqmfs.c	Wed Mar 31 14:49:02 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_nqmfs.c,v 1.1 2010/03/08 12:46:34 pooka Exp $	*/
+/*	$NetBSD: rump_nqmfs.c,v 1.2 2010/03/31 14:49:02 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -115,7 +115,7 @@
 		err(1, "open fspec");
 
 	membase = mmap(NULL, sb.st_size, PROT_READ | (rdonly ? 0 : PROT_WRITE),
-	MAP_FILE | (shared ? MAP_SHARED : MAP_COPY), fd, 0);
+	MAP_FILE | (shared ? MAP_SHARED : MAP_PRIVATE), fd, 0);
 	if (membase == MAP_FAILED)
 		err(1, "cannot mmap fpsec");
 



CVS commit: src/usr.sbin/puffs

2010-03-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 31 14:49:47 UTC 2010

Modified Files:
src/usr.sbin/puffs/rump_cd9660: rump_cd9660.8
src/usr.sbin/puffs/rump_efs: rump_efs.8
src/usr.sbin/puffs/rump_ext2fs: rump_ext2fs.8
src/usr.sbin/puffs/rump_fdesc: rump_fdesc.8
src/usr.sbin/puffs/rump_ffs: rump_ffs.8
src/usr.sbin/puffs/rump_hfs: rump_hfs.8
src/usr.sbin/puffs/rump_kernfs: rump_kernfs.8
src/usr.sbin/puffs/rump_lfs: rump_lfs.8
src/usr.sbin/puffs/rump_msdos: rump_msdos.8
src/usr.sbin/puffs/rump_nfs: rump_nfs.8
src/usr.sbin/puffs/rump_ntfs: rump_ntfs.8
src/usr.sbin/puffs/rump_smbfs: rump_smbfs.8
src/usr.sbin/puffs/rump_sysvbfs: rump_sysvbfs.8
src/usr.sbin/puffs/rump_tmpfs: rump_tmpfs.8
src/usr.sbin/puffs/rump_udf: rump_udf.8

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/puffs/rump_cd9660/rump_cd9660.8
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/puffs/rump_efs/rump_efs.8
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/puffs/rump_ext2fs/rump_ext2fs.8
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/puffs/rump_fdesc/rump_fdesc.8
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/puffs/rump_ffs/rump_ffs.8
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/puffs/rump_hfs/rump_hfs.8
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/puffs/rump_kernfs/rump_kernfs.8
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/puffs/rump_lfs/rump_lfs.8
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/puffs/rump_msdos/rump_msdos.8
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/puffs/rump_nfs/rump_nfs.8
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/puffs/rump_ntfs/rump_ntfs.8
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/puffs/rump_smbfs/rump_smbfs.8
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/puffs/rump_sysvbfs/rump_sysvbfs.8
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/puffs/rump_tmpfs/rump_tmpfs.8
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/puffs/rump_udf/rump_udf.8

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

Modified files:

Index: src/usr.sbin/puffs/rump_cd9660/rump_cd9660.8
diff -u src/usr.sbin/puffs/rump_cd9660/rump_cd9660.8:1.8 src/usr.sbin/puffs/rump_cd9660/rump_cd9660.8:1.9
--- src/usr.sbin/puffs/rump_cd9660/rump_cd9660.8:1.8	Sun Feb 15 18:01:26 2009
+++ src/usr.sbin/puffs/rump_cd9660/rump_cd9660.8	Wed Mar 31 14:49:46 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rump_cd9660.8,v 1.8 2009/02/15 18:01:26 pooka Exp $
+.\"	$NetBSD: rump_cd9660.8,v 1.9 2010/03/31 14:49:46 pooka Exp $
 .\"
 .\"	WARNING: GENERATED FILE, DO NOT EDIT
 .\"	INSTEAD, EDIT makerumpmanpages.sh AND REGEN
@@ -26,7 +26,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd February 15, 2009
+.Dd March 31, 2010
 .Dt RUMP_CD9660 8
 .Os
 .Sh NAME
@@ -41,6 +41,14 @@
 .Ar special
 .Ar node
 .Sh DESCRIPTION
+.Em NOTE!
+This manual page has been generated from a common source shared between all
+.Xr rump 3
+file servers.
+Some parts of this manual page may not apply to this particular server.
+After reading this manual page, you may want to verify the details from
+.Xr mount_cd9660 8 .
+.Pp
 The
 .Nm
 utility can be used to mount cd9660 file systems.

Index: src/usr.sbin/puffs/rump_efs/rump_efs.8
diff -u src/usr.sbin/puffs/rump_efs/rump_efs.8:1.8 src/usr.sbin/puffs/rump_efs/rump_efs.8:1.9
--- src/usr.sbin/puffs/rump_efs/rump_efs.8:1.8	Sun Feb 15 18:01:26 2009
+++ src/usr.sbin/puffs/rump_efs/rump_efs.8	Wed Mar 31 14:49:46 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rump_efs.8,v 1.8 2009/02/15 18:01:26 pooka Exp $
+.\"	$NetBSD: rump_efs.8,v 1.9 2010/03/31 14:49:46 pooka Exp $
 .\"
 .\"	WARNING: GENERATED FILE, DO NOT EDIT
 .\"	INSTEAD, EDIT makerumpmanpages.sh AND REGEN
@@ -26,7 +26,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd February 15, 2009
+.Dd March 31, 2010
 .Dt RUMP_EFS 8
 .Os
 .Sh NAME
@@ -41,6 +41,14 @@
 .Ar special
 .Ar node
 .Sh DESCRIPTION
+.Em NOTE!
+This manual page has been generated from a common source shared between all
+.Xr rump 3
+file servers.
+Some parts of this manual page may not apply to this particular server.
+After reading this manual page, you may want to verify the details from
+.Xr mount_efs 8 .
+.Pp
 The
 .Nm
 utility can be used to mount efs file systems.

Index: src/usr.sbin/puffs/rump_ext2fs/rump_ext2fs.8
diff -u src/usr.sbin/puffs/rump_ext2fs/rump_ext2fs.8:1.8 src/usr.sbin/puffs/rump_ext2fs/rump_ext2fs.8:1.9
--- src/usr.sbin/puffs/rump_ext2fs/rump_ext2fs.8:1.8	Sun Feb 15 18:01:26 2009
+++ src/usr.sbin/puffs/rump_ext2fs/rump_ext2fs.8	Wed Mar 31 14:49:46 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rump_ext2fs.8,v 1.8 2009/02/15 18:01:26 pooka Exp $
+.\"	$NetBSD: rump_ext2fs.8,v 1.9 2010/03/31 14:49:46 pooka Exp $
 .\"
 .\"	WARNING: GENERATED FILE, DO NOT EDIT
 .\"	INSTEAD, EDIT makerumpmanpages.sh AND REGEN
@@ -26,7 +26,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"

CVS commit: src/usr.sbin/puffs/rump_nqmfs

2010-03-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 31 14:54:07 UTC 2010

Modified Files:
src/usr.sbin/puffs/rump_nqmfs: rump_nqmfs.c

Log Message:
fix typo (at least it was in an error string instead of a comment)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/puffs/rump_nqmfs/rump_nqmfs.c

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

Modified files:

Index: src/usr.sbin/puffs/rump_nqmfs/rump_nqmfs.c
diff -u src/usr.sbin/puffs/rump_nqmfs/rump_nqmfs.c:1.2 src/usr.sbin/puffs/rump_nqmfs/rump_nqmfs.c:1.3
--- src/usr.sbin/puffs/rump_nqmfs/rump_nqmfs.c:1.2	Wed Mar 31 14:49:02 2010
+++ src/usr.sbin/puffs/rump_nqmfs/rump_nqmfs.c	Wed Mar 31 14:54:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_nqmfs.c,v 1.2 2010/03/31 14:49:02 pooka Exp $	*/
+/*	$NetBSD: rump_nqmfs.c,v 1.3 2010/03/31 14:54:07 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -117,7 +117,7 @@
 	membase = mmap(NULL, sb.st_size, PROT_READ | (rdonly ? 0 : PROT_WRITE),
 	MAP_FILE | (shared ? MAP_SHARED : MAP_PRIVATE), fd, 0);
 	if (membase == MAP_FAILED)
-		err(1, "cannot mmap fpsec");
+		err(1, "cannot mmap fspec");
 
 	args.fspec = mntfile;
 	args.base = membase;



CVS commit: src/usr.bin/head

2010-03-31 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Mar 31 15:01:02 UTC 2010

Modified Files:
src/usr.bin/head: head.c

Log Message:
ANSIfy. Sprinkle static.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/head/head.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/head/head.c
diff -u src/usr.bin/head/head.c:1.19 src/usr.bin/head/head.c:1.20
--- src/usr.bin/head/head.c:1.19	Mon Jul 21 14:19:23 2008
+++ src/usr.bin/head/head.c	Wed Mar 31 15:01:02 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: head.c,v 1.19 2008/07/21 14:19:23 lukem Exp $	*/
+/*	$NetBSD: head.c,v 1.20 2010/03/31 15:01:02 joerg Exp $	*/
 
 /*
  * Copyright (c) 1980, 1987, 1992, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)head.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: head.c,v 1.19 2008/07/21 14:19:23 lukem Exp $");
+__RCSID("$NetBSD: head.c,v 1.20 2010/03/31 15:01:02 joerg Exp $");
 #endif
 #endif /* not lint */
 
@@ -61,17 +61,14 @@
  * Bill Joy UCB August 24, 1977
  */
 
-void head __P((FILE *, long, long));
-void obsolete __P((char *[]));
-void usage __P((void));
-int main __P((int, char *[]));
+static void head(FILE *, long, long);
+static void obsolete(char *[]);
+__dead static void usage(void);
 
 int eval = 0;
 
 int
-main(argc, argv)
-	int argc;
-	char *argv[];
+main(int argc, char *argv[])
 {
 	int ch;
 	FILE *fp;
@@ -145,11 +142,8 @@
 	exit(eval);
 }
 
-void
-head(fp, cnt, bytecnt)
-	FILE *fp;
-	long cnt;
-	long bytecnt;
+static void
+head(FILE *fp, long cnt, long bytecnt)
 {
 	int ch;
 
@@ -164,9 +158,8 @@
 		}
 }
 
-void
-obsolete(argv)
-	char *argv[];
+static void
+obsolete(char *argv[])
 {
 	char *ap;
 
@@ -184,8 +177,8 @@
 	}
 }
 
-void
-usage()
+static void
+usage(void)
 {
 
 	(void)fprintf(stderr, "usage: %s [-n lines] [file ...]\n",



CVS commit: src/usr.bin/head

2010-03-31 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Mar 31 15:01:51 UTC 2010

Modified Files:
src/usr.bin/head: head.c

Log Message:
Make eval a local variable.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/head/head.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/head/head.c
diff -u src/usr.bin/head/head.c:1.20 src/usr.bin/head/head.c:1.21
--- src/usr.bin/head/head.c:1.20	Wed Mar 31 15:01:02 2010
+++ src/usr.bin/head/head.c	Wed Mar 31 15:01:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: head.c,v 1.20 2010/03/31 15:01:02 joerg Exp $	*/
+/*	$NetBSD: head.c,v 1.21 2010/03/31 15:01:51 joerg Exp $	*/
 
 /*
  * Copyright (c) 1980, 1987, 1992, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)head.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: head.c,v 1.20 2010/03/31 15:01:02 joerg Exp $");
+__RCSID("$NetBSD: head.c,v 1.21 2010/03/31 15:01:51 joerg Exp $");
 #endif
 #endif /* not lint */
 
@@ -65,7 +65,6 @@
 static void obsolete(char *[]);
 __dead static void usage(void);
 
-int eval = 0;
 
 int
 main(int argc, char *argv[])
@@ -76,6 +75,7 @@
 	long linecnt;
 	long bytecnt;
 	char *ep;
+	int eval = 0;
 	int qflag = 0;
 	int vflag = 0;
 



CVS commit: src/share/man/man1

2010-03-31 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Mar 31 16:52:03 UTC 2010

Modified Files:
src/share/man/man1: ld.so.1

Log Message:
Add the "Linkers and Loaders" to SEE ALSO.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man1/ld.so.1

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

Modified files:

Index: src/share/man/man1/ld.so.1
diff -u src/share/man/man1/ld.so.1:1.2 src/share/man/man1/ld.so.1:1.3
--- src/share/man/man1/ld.so.1:1.2	Wed Apr 30 13:10:53 2008
+++ src/share/man/man1/ld.so.1	Wed Mar 31 16:52:03 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ld.so.1,v 1.2 2008/04/30 13:10:53 martin Exp $
+.\"	$NetBSD: ld.so.1,v 1.3 2010/03/31 16:52:03 jruoho Exp $
 .\"
 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 6, 2000
+.Dd March 31, 2010
 .Dt LD.SO 1
 .Os
 .Sh NAME
@@ -52,3 +52,9 @@
 .Xr elf 5 ,
 .Xr link 5 ,
 .Xr ldconfig 8
+.Rs
+.%A John R. Levine
+.%B Linkers and Loaders
+.%D 1999
+.%I Morgan Kaufmann
+.Re



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

2010-03-31 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Mar 31 17:46:21 UTC 2010

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

Log Message:
2 RCSIDs are enough for anyone.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 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.24 src/sys/arch/hp700/hp700/intr.c:1.25
--- src/sys/arch/hp700/hp700/intr.c:1.24	Wed Mar 31 12:56:14 2010
+++ src/sys/arch/hp700/hp700/intr.c	Wed Mar 31 17:46:21 2010
@@ -1,5 +1,4 @@
-/*	$NetBSD: intr.c,v 1.24 2010/03/31 12:56:14 skrll Exp $	*/
-/*	$NetBSD: intr.c,v 1.24 2010/03/31 12:56:14 skrll Exp $	*/
+/*	$NetBSD: intr.c,v 1.25 2010/03/31 17:46:21 skrll Exp $	*/
 /*	$OpenBSD: intr.c,v 1.27 2009/12/31 12:52:35 jsing Exp $	*/
 
 /*
@@ -36,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.24 2010/03/31 12:56:14 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.25 2010/03/31 17:46:21 skrll Exp $");
 
 #define __MUTEX_PRIVATE
 



CVS commit: src/sys/dev/i2c

2010-03-31 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Mar 31 18:07:13 UTC 2010

Modified Files:
src/sys/dev/i2c: dbcool.c dbcool_reg.h

Log Message:
Add preliminary support for the ADM1031 found in the Sun Blade 2500 and similar
machines. For now we treat it like an ADM1030 - the only difference is the
device ID and a few previously reserved registers.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/i2c/dbcool.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/i2c/dbcool_reg.h

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

Modified files:

Index: src/sys/dev/i2c/dbcool.c
diff -u src/sys/dev/i2c/dbcool.c:1.20 src/sys/dev/i2c/dbcool.c:1.21
--- src/sys/dev/i2c/dbcool.c:1.20	Sat Mar 20 19:04:51 2010
+++ src/sys/dev/i2c/dbcool.c	Wed Mar 31 18:07:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbcool.c,v 1.20 2010/03/20 19:04:51 pgoyette Exp $ */
+/*	$NetBSD: dbcool.c,v 1.21 2010/03/31 18:07:13 macallan Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.20 2010/03/20 19:04:51 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.21 2010/03/31 18:07:13 macallan Exp $");
 
 #include 
 #include 
@@ -592,6 +592,10 @@
 		ADM1030_sensor_table, ADM1030_power_table,
 		DBCFLAG_ADM1030 | DBCFLAG_NO_READBYTE,
 		11250 * 60, "ADM1030" },
+	{ DBCOOL_COMPANYID, ADM1031_DEVICEID, 0xff,
+		ADM1030_sensor_table, ADM1030_power_table,
+		DBCFLAG_ADM1030 | DBCFLAG_NO_READBYTE,
+		11250 * 60, "ADM1031" },
 	{ 0, 0, 0, NULL, NULL, 0, 0, NULL }
 };
 

Index: src/sys/dev/i2c/dbcool_reg.h
diff -u src/sys/dev/i2c/dbcool_reg.h:1.3 src/sys/dev/i2c/dbcool_reg.h:1.4
--- src/sys/dev/i2c/dbcool_reg.h:1.3	Thu Dec 18 20:41:35 2008
+++ src/sys/dev/i2c/dbcool_reg.h	Wed Mar 31 18:07:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbcool_reg.h,v 1.3 2008/12/18 20:41:35 pgoyette Exp $ */
+/*	$NetBSD: dbcool_reg.h,v 1.4 2010/03/31 18:07:13 macallan Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #define DBCOOLREG_H
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dbcool_reg.h,v 1.3 2008/12/18 20:41:35 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dbcool_reg.h,v 1.4 2010/03/31 18:07:13 macallan Exp $");
 
 #define DBCOOL_ADDRMASK		0x7c
 #define	DBCOOL_ADDR		0x2c	/* Some chips have multiple addrs */
@@ -374,6 +374,7 @@
 
 #define	ADM1027_DEVICEID	0x27
 #define	ADM1030_DEVICEID	0x30
+#define	ADM1031_DEVICEID	0x31
 #define	ADT7463_DEVICEID	0x27
 #define	ADT7466_DEVICEID	0x66
 #define	ADT7467_DEVICEID	0x68	/* The ADT7467/7468 cannot be */



CVS commit: src/tests/fs

2010-03-31 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Wed Mar 31 18:37:06 UTC 2010

Modified Files:
src/tests/fs: Atffile

Log Message:
The Atffile tp/tp-glob keys does not allow more than one word. Put new
union value on its own line.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/Atffile

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

Modified files:

Index: src/tests/fs/Atffile
diff -u src/tests/fs/Atffile:1.5 src/tests/fs/Atffile:1.6
--- src/tests/fs/Atffile:1.5	Mon Mar 29 18:19:19 2010
+++ src/tests/fs/Atffile	Wed Mar 31 18:37:06 2010
@@ -1,6 +1,7 @@
 Content-Type: application/X-atf-atffile; version="1"
-X-NetBSD-Id: "$NetBSD: Atffile,v 1.5 2010/03/29 18:19:19 pooka Exp $"
+X-NetBSD-Id: "$NetBSD: Atffile,v 1.6 2010/03/31 18:37:06 njoly Exp $"
 
 prop: test-suite = "NetBSD"
 
-tp-glob: *fs union
+tp-glob: *fs
+tp: union



CVS commit: src/tests/fs

2010-03-31 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Wed Mar 31 18:40:27 UTC 2010

Modified Files:
src/tests/fs/ffs: Atffile
src/tests/fs/nullfs: Atffile
src/tests/fs/umapfs: Atffile
src/tests/fs/union: Atffile

Log Message:
Use tp-glob keys when requesting for test pattern.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/ffs/Atffile
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/nullfs/Atffile
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/umapfs/Atffile
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/union/Atffile

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

Modified files:

Index: src/tests/fs/ffs/Atffile
diff -u src/tests/fs/ffs/Atffile:1.2 src/tests/fs/ffs/Atffile:1.3
--- src/tests/fs/ffs/Atffile:1.2	Mon Mar 29 13:26:32 2010
+++ src/tests/fs/ffs/Atffile	Wed Mar 31 18:40:26 2010
@@ -1,6 +1,6 @@
 Content-Type: application/X-atf-atffile; version="1"
-X-NetBSD-Id: "$NetBSD: Atffile,v 1.2 2010/03/29 13:26:32 pooka Exp $"
+X-NetBSD-Id: "$NetBSD: Atffile,v 1.3 2010/03/31 18:40:26 njoly Exp $"
 
 prop: test-suite = "NetBSD"
 
-tp: t_*
+tp-glob: t_*

Index: src/tests/fs/nullfs/Atffile
diff -u src/tests/fs/nullfs/Atffile:1.1 src/tests/fs/nullfs/Atffile:1.2
--- src/tests/fs/nullfs/Atffile:1.1	Tue Mar 30 01:02:47 2010
+++ src/tests/fs/nullfs/Atffile	Wed Mar 31 18:40:26 2010
@@ -1,6 +1,6 @@
 Content-Type: application/X-atf-atffile; version="1"
-X-NetBSD-Id: "$NetBSD: Atffile,v 1.1 2010/03/30 01:02:47 pooka Exp $"
+X-NetBSD-Id: "$NetBSD: Atffile,v 1.2 2010/03/31 18:40:26 njoly Exp $"
 
 prop: test-suite = "NetBSD"
 
-tp: t_*
+tp-glob: t_*

Index: src/tests/fs/umapfs/Atffile
diff -u src/tests/fs/umapfs/Atffile:1.1 src/tests/fs/umapfs/Atffile:1.2
--- src/tests/fs/umapfs/Atffile:1.1	Tue Mar 30 01:05:28 2010
+++ src/tests/fs/umapfs/Atffile	Wed Mar 31 18:40:26 2010
@@ -1,6 +1,6 @@
 Content-Type: application/X-atf-atffile; version="1"
-X-NetBSD-Id: "$NetBSD: Atffile,v 1.1 2010/03/30 01:05:28 pooka Exp $"
+X-NetBSD-Id: "$NetBSD: Atffile,v 1.2 2010/03/31 18:40:26 njoly Exp $"
 
 prop: test-suite = "NetBSD"
 
-tp: t_*
+tp-glob: t_*

Index: src/tests/fs/union/Atffile
diff -u src/tests/fs/union/Atffile:1.1 src/tests/fs/union/Atffile:1.2
--- src/tests/fs/union/Atffile:1.1	Mon Mar 29 18:19:19 2010
+++ src/tests/fs/union/Atffile	Wed Mar 31 18:40:26 2010
@@ -1,6 +1,6 @@
 Content-Type: application/X-atf-atffile; version="1"
-X-NetBSD-Id: "$NetBSD: Atffile,v 1.1 2010/03/29 18:19:19 pooka Exp $"
+X-NetBSD-Id: "$NetBSD: Atffile,v 1.2 2010/03/31 18:40:26 njoly Exp $"
 
 prop: test-suite = "NetBSD"
 
-tp: t_*
+tp-glob: t_*



CVS commit: src/sys/rump/librump/rumpkern

2010-03-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 31 18:56:07 UTC 2010

Modified Files:
src/sys/rump/librump/rumpkern: rump.c

Log Message:
Create kern.hostname sysctl node.  Using init_sysctl.c for creating
the nodes requires some weeding, so don't try to use it yet.


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/rump/librump/rumpkern/rump.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/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.157 src/sys/rump/librump/rumpkern/rump.c:1.158
--- src/sys/rump/librump/rumpkern/rump.c:1.157	Wed Mar 31 12:16:15 2010
+++ src/sys/rump/librump/rumpkern/rump.c	Wed Mar 31 18:56:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.157 2010/03/31 12:16:15 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.158 2010/03/31 18:56:07 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.157 2010/03/31 12:16:15 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.158 2010/03/31 18:56:07 pooka Exp $");
 
 #include 
 #include 
@@ -162,6 +162,26 @@
 	}
 }
 
+/*
+ * Create kern.hostname.  why only this you ask.  well, init_sysctl
+ * is a kitchen sink in need of some gardening.  but i want to use
+ * kern.hostname today.
+ */
+static void
+mksysctls(void)
+{
+
+	sysctl_createv(NULL, 0, NULL, NULL,
+	CTLFLAG_PERMANENT, CTLTYPE_NODE, "kern", NULL,
+	NULL, 0, NULL, 0, CTL_KERN, CTL_EOL);
+
+	/* XXX: setting hostnamelen is missing */
+	sysctl_createv(NULL, 0, NULL, NULL,
+	CTLFLAG_PERMANENT|CTLFLAG_READWRITE, CTLTYPE_STRING, "hostname",
+	SYSCTL_DESCR("System hostname"), NULL, 0,
+	&hostname, MAXHOSTNAMELEN, CTL_KERN, KERN_HOSTNAME, CTL_EOL);
+}
+
 int
 rump__init(int rump_version)
 {
@@ -306,6 +326,7 @@
 			panic("aiodoned");
 	}
 
+	mksysctls();
 	sysctl_finalize();
 
 	module_init_class(MODULE_CLASS_ANY);



CVS commit: src/sys/arch/x86/x86

2010-03-31 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Wed Mar 31 19:07:33 UTC 2010

Modified Files:
src/sys/arch/x86/x86: pmap.c

Log Message:
KNF FTW


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/x86/x86/pmap.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/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.105 src/sys/arch/x86/x86/pmap.c:1.106
--- src/sys/arch/x86/x86/pmap.c:1.105	Fri Feb 26 19:25:07 2010
+++ src/sys/arch/x86/x86/pmap.c	Wed Mar 31 19:07:32 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.105 2010/02/26 19:25:07 jym Exp $	*/
+/*	$NetBSD: pmap.c,v 1.106 2010/03/31 19:07:32 ad Exp $	*/
 
 /*
  * Copyright (c) 2007 Manuel Bouyer.
@@ -149,7 +149,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.105 2010/02/26 19:25:07 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.106 2010/03/31 19:07:32 ad Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -750,7 +750,8 @@
  * Unmap the content of APDP PDEs
  */
 static void
-pmap_unmap_apdp(void) {
+pmap_unmap_apdp(void)
+{
 	int i;
 
 	for (i = 0; i < PDP_SIZE; i++) {
@@ -782,7 +783,7 @@
 
 static void
 pmap_map_ptes(struct pmap *pmap, struct pmap **pmap2,
-pd_entry_t **ptepp, pd_entry_t * const **pdeppp)
+	  pd_entry_t **ptepp, pd_entry_t * const **pdeppp)
 {
 	pd_entry_t opde, npde;
 	struct pmap *ourpmap;
@@ -791,7 +792,7 @@
 	bool iscurrent;
 	uint64_t ncsw;
 #ifdef XEN
-	int s;
+	int s, i;
 #endif
 
 	/* the kernel's pmap is always accessible */
@@ -853,7 +854,6 @@
 	if (!pmap_valid_entry(opde) ||
 	pmap_pte2pa(opde) != pmap_pdirpa(pmap, 0)) {
 #ifdef XEN
-		int i;
 		s = splvm();
 		/* Make recursive entry usable in user PGD */
 		for (i = 0; i < PDP_SIZE; i++) {



CVS commit: src/tests/fs

2010-03-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 31 19:14:30 UTC 2010

Modified Files:
src/tests/fs: Makefile
Added Files:
src/tests/fs/kernfs: Atffile Makefile t_basic.c

Log Message:
Add some basic tests for kernfs (getdents & changing hostname).

Per a "mad \"scientist\"" experiment, on i386 load kernfs support
from the installed kernel module instead of linking the driver in.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/fs/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/fs/kernfs/Atffile \
src/tests/fs/kernfs/Makefile src/tests/fs/kernfs/t_basic.c

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

Modified files:

Index: src/tests/fs/Makefile
diff -u src/tests/fs/Makefile:1.7 src/tests/fs/Makefile:1.8
--- src/tests/fs/Makefile:1.7	Tue Mar 30 01:05:28 2010
+++ src/tests/fs/Makefile	Wed Mar 31 19:14:30 2010
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.7 2010/03/30 01:05:28 pooka Exp $
+# $NetBSD: Makefile,v 1.8 2010/03/31 19:14:30 pooka Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/fs
 
-SUBDIR+=	ffs nullfs puffs tmpfs umapfs union
+SUBDIR+=	ffs kernfs nullfs puffs tmpfs umapfs union
 
 FILES= h_funcs.subr
 FILESDIR= ${TESTSDIR}

Added files:

Index: src/tests/fs/kernfs/Atffile
diff -u /dev/null src/tests/fs/kernfs/Atffile:1.1
--- /dev/null	Wed Mar 31 19:14:30 2010
+++ src/tests/fs/kernfs/Atffile	Wed Mar 31 19:14:30 2010
@@ -0,0 +1,6 @@
+Content-Type: application/X-atf-atffile; version="1"
+X-NetBSD-Id: "$NetBSD: Atffile,v 1.1 2010/03/31 19:14:30 pooka Exp $"
+
+prop: test-suite = "NetBSD"
+
+tp-glob: t_*
Index: src/tests/fs/kernfs/Makefile
diff -u /dev/null src/tests/fs/kernfs/Makefile:1.1
--- /dev/null	Wed Mar 31 19:14:30 2010
+++ src/tests/fs/kernfs/Makefile	Wed Mar 31 19:14:30 2010
@@ -0,0 +1,19 @@
+#	$NetBSD: Makefile,v 1.1 2010/03/31 19:14:30 pooka Exp $
+#
+
+TESTSDIR=	${TESTSBASE}/fs/kernfs
+WARNS=		4
+
+TESTS_C=	t_basic
+
+# use kernel module binary on i386
+.if ${MACHINE} == "i386"
+OSRELEASE!=	${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh
+CPPFLAGS+=	-DMODDIR=\"/stand/${MACHINE}/${OSRELEASE}/modules/kernfs/\"
+CPPFLAGS+=	-DMODBASE=\"kernfs.kmod\"
+.else
+LDADD+=	-lrumpfs_kernfs		# fs driver
+.endif
+LDADD+=	-lrumpvfs -lrump -lrumpuser -lpthread			# base
+
+.include 
Index: src/tests/fs/kernfs/t_basic.c
diff -u /dev/null src/tests/fs/kernfs/t_basic.c:1.1
--- /dev/null	Wed Mar 31 19:14:30 2010
+++ src/tests/fs/kernfs/t_basic.c	Wed Mar 31 19:14:30 2010
@@ -0,0 +1,198 @@
+/*	$NetBSD: t_basic.c,v 1.1 2010/03/31 19:14:30 pooka Exp $	*/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#define USE_ATF
+#include "../../h_macros.h"
+
+#ifdef USE_ATF
+ATF_TC(getdents);
+ATF_TC_HEAD(getdents, tc)
+{
+
+	atf_tc_set_md_var(tc, "descr", "kernfs directory contains files");
+}
+#else
+#define atf_tc_fail(...) errx(1, __VA_ARGS__)
+#endif
+
+#ifdef MODDIR
+/*
+ * Try to load kernfs module (only on archs where ABIs match).
+ * This is slightly ... inconvenient currently.  Let's try to improve
+ * it in the future.
+ *
+ * steps:
+ *   1) copy it into our working directory
+ *   2) rename symbols
+ *   3) lock & load
+ */
+static int
+loadmodule(void)
+{
+	modctl_load_t ml;
+	int error;
+
+	if (system("cp " MODDIR MODBASE " .") == -1) {
+		warn("failed to copy %s into pwd", MODDIR MODBASE);
+		return errno;
+	}
+	if (chmod(MODBASE, 0666) == -1) {
+		warn("chmod %s", MODBASE);
+		return errno;
+	}
+	if (system("make -f /usr/src/sys/rump/Makefile.rump RUMP_SYMREN="
+	MODBASE) == -1) {
+		warn("objcopy failed");
+		return errno;
+	}
+
+	if ((error = rump_pub_etfs_register(MODBASE, MODBASE, RUMP_ETFS_REG))) {
+		warn("rump etfs");
+		return error;
+	}
+
+	memset(&ml, 0, sizeof(ml));
+	ml.ml_filename = MODBASE;
+	if (rump_sys_modctl(MODCTL_LOAD, &ml) == -1) {
+		warn("module load");
+		return errno;
+	}
+
+	return 0;
+}
+#endif
+
+static void
+mountkernfs(void)
+{
+
+	rump_init();
+
+#ifdef MODDIR
+	if (loadmodule() != 0) {
+		/* failed?  fallback to dlopen()  some day */
+		atf_tc_fail("could not load kernfs");
+	}
+#endif
+
+	if (rump_sys_mkdir("/kern", 0777) == -1)
+		atf_tc_fail_errno("mkdir /kern");
+	if (rump_sys_mount(MOUNT_KERNFS, "/kern", 0, NULL, 0) == -1)
+		atf_tc_fail_errno("could not mount kernfs");
+}
+
+#ifdef USE_ATF
+ATF_TC_BODY(getdents, tc)
+#else
+int main(int argc, char *argv[])
+#endif
+{
+	struct dirent *dent;
+	char buf[8192];
+	int dfd;
+
+	mountkernfs();
+
+	if ((dfd = rump_sys_open("/kern", O_RDONLY)) == -1)
+		atf_tc_fail_errno("can't open directory");
+	if (rump_sys_getdents(dfd, buf, sizeof(buf)) == -1)
+		atf_tc_fail_errno("getdents");
+
+	/*
+	 * Check that we get the first three values (., .., boottime).
+	 * Make more complete by autogenerating list from kernfs_vnops.c?
+	 */
+	dent = (void *)buf;
+	ATF_REQUIRE_STREQ(d

CVS commit: src

2010-03-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Mar 31 19:18:39 UTC 2010

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.base

Log Message:
add necessary build bucatini for kernfs tests


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.14 -r1.15 src/etc/mtree/NetBSD.dist.base

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.67 src/distrib/sets/lists/tests/mi:1.68
--- src/distrib/sets/lists/tests/mi:1.67	Tue Mar 30 01:11:18 2010
+++ src/distrib/sets/lists/tests/mi	Wed Mar 31 19:18:39 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.67 2010/03/30 01:11:18 pooka Exp $
+# $NetBSD: mi,v 1.68 2010/03/31 19:18:39 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -113,6 +113,8 @@
 ./usr/libdata/debug/usr/tests/fs/ffs	tests-fs-debug
 ./usr/libdata/debug/usr/tests/fs/ffs/t_fifos.debug			tests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/fs/ffs/t_renamerace.debug			tests-fs-debug		debug,atf
+./usr/libdata/debug/usr/tests/fs/kernfs	tests-fs-debug
+./usr/libdata/debug/usr/tests/fs/kernfs/t_basic.debug			tests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/fs/nullfs	tests-fs-debug
 ./usr/libdata/debug/usr/tests/fs/nullfs/t_basic.debug			tests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/fs/puffs	tests-fs-debug
@@ -563,6 +565,9 @@
 ./usr/tests/fs/ffs/Atffile			tests-fs-tests		atf
 ./usr/tests/fs/ffs/t_fifos			tests-fs-tests		atf
 ./usr/tests/fs/ffs/t_renamerace			tests-fs-tests		atf
+./usr/tests/fs/kernfstests-fs-tests
+./usr/tests/fs/kernfs/Atffile			tests-fs-tests		atf
+./usr/tests/fs/kernfs/t_basic			tests-fs-tests		atf
 ./usr/tests/fs/nullfstests-fs-tests
 ./usr/tests/fs/nullfs/Atffile			tests-fs-tests		atf
 ./usr/tests/fs/nullfs/t_basic			tests-fs-tests		atf

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.14 src/etc/mtree/NetBSD.dist.base:1.15
--- src/etc/mtree/NetBSD.dist.base:1.14	Tue Mar 30 01:11:17 2010
+++ src/etc/mtree/NetBSD.dist.base	Wed Mar 31 19:18:39 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.14 2010/03/30 01:11:17 pooka Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.15 2010/03/31 19:18:39 pooka Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -198,6 +198,7 @@
 ./usr/libdata/debug/usr/tests/crypto/libcrypto
 ./usr/libdata/debug/usr/tests/fs
 ./usr/libdata/debug/usr/tests/fs/ffs
+./usr/libdata/debug/usr/tests/fs/kernfs
 ./usr/libdata/debug/usr/tests/fs/nullfs
 ./usr/libdata/debug/usr/tests/fs/puffs
 ./usr/libdata/debug/usr/tests/fs/tmpfs
@@ -1086,6 +1087,7 @@
 ./usr/tests/crypto/libcrypto
 ./usr/tests/fs
 ./usr/tests/fs/ffs
+./usr/tests/fs/kernfs
 ./usr/tests/fs/nullfs
 ./usr/tests/fs/puffs
 ./usr/tests/fs/tmpfs



CVS commit: src/sys/kern

2010-03-31 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Wed Mar 31 19:59:39 UTC 2010

Modified Files:
src/sys/kern: kern_mutex_obj.c kern_rwlock_obj.c

Log Message:
Fix copyrights.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/kern/kern_mutex_obj.c \
src/sys/kern/kern_rwlock_obj.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/kern_mutex_obj.c
diff -u src/sys/kern/kern_mutex_obj.c:1.1 src/sys/kern/kern_mutex_obj.c:1.2
--- src/sys/kern/kern_mutex_obj.c:1.1	Wed Nov  4 13:29:45 2009
+++ src/sys/kern/kern_mutex_obj.c	Wed Mar 31 19:59:39 2010
@@ -1,11 +1,11 @@
-/*	$NetBSD: kern_mutex_obj.c,v 1.1 2009/11/04 13:29:45 pooka Exp $	*/
+/*	$NetBSD: kern_mutex_obj.c,v 1.2 2010/03/31 19:59:39 ad Exp $	*/
 
 /*-
- * Copyright (c) 2002, 2006, 2007, 2008 The NetBSD Foundation, Inc.
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe and Andrew Doran.
+ * by Andrew Doran.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_mutex_obj.c,v 1.1 2009/11/04 13:29:45 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_mutex_obj.c,v 1.2 2010/03/31 19:59:39 ad Exp $");
 
 #include 
 #include 
Index: src/sys/kern/kern_rwlock_obj.c
diff -u src/sys/kern/kern_rwlock_obj.c:1.1 src/sys/kern/kern_rwlock_obj.c:1.2
--- src/sys/kern/kern_rwlock_obj.c:1.1	Wed Nov  4 13:29:45 2009
+++ src/sys/kern/kern_rwlock_obj.c	Wed Mar 31 19:59:39 2010
@@ -1,11 +1,11 @@
-/*	$NetBSD: kern_rwlock_obj.c,v 1.1 2009/11/04 13:29:45 pooka Exp $	*/
+/*	$NetBSD: kern_rwlock_obj.c,v 1.2 2010/03/31 19:59:39 ad Exp $	*/
 
 /*-
- * Copyright (c) 2002, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
+ * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe and Andrew Doran.
+ * by Andrew Doran.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_rwlock_obj.c,v 1.1 2009/11/04 13:29:45 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_rwlock_obj.c,v 1.2 2010/03/31 19:59:39 ad Exp $");
 
 #include 
 #include 



CVS commit: src/sys/dev/ic

2010-03-31 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Mar 31 21:01:04 UTC 2010

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

Log Message:
remove a now useless bus_space_barrier()


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/ic/pcf8584.c

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

Modified files:

Index: src/sys/dev/ic/pcf8584.c
diff -u src/sys/dev/ic/pcf8584.c:1.7 src/sys/dev/ic/pcf8584.c:1.8
--- src/sys/dev/ic/pcf8584.c:1.7	Wed Mar 31 05:09:41 2010
+++ src/sys/dev/ic/pcf8584.c	Wed Mar 31 21:01:03 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcf8584.c,v 1.7 2010/03/31 05:09:41 macallan Exp $	*/
+/*	$NetBSD: pcf8584.c,v 1.8 2010/03/31 21:01:03 macallan Exp $	*/
 /*	$OpenBSD: pcf8584.c,v 1.9 2007/10/20 18:46:21 kettenis Exp $ */
 
 /*
@@ -270,8 +270,6 @@
 	volatile uint8_t junk;
 	bus_space_write_1(sc->sc_iot, sc->sc_ioh, sc->sc_regmap[r], v);
 	junk = bus_space_read_1(sc->sc_iot, sc->sc_ioh, PCF_S1);
-	bus_space_barrier(sc->sc_iot, sc->sc_ioh, sc->sc_regmap[r], 1,
-	BUS_SPACE_BARRIER_WRITE);
 }
 
 void



CVS commit: src/usr.bin/head

2010-03-31 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Mar 31 21:52:11 UTC 2010

Modified Files:
src/usr.bin/head: head.c

Log Message:
Remove 2**31 limit on the number of lines or bytes to process.
For the byte operations, process in blocks of 64KB.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/head/head.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/head/head.c
diff -u src/usr.bin/head/head.c:1.21 src/usr.bin/head/head.c:1.22
--- src/usr.bin/head/head.c:1.21	Wed Mar 31 15:01:51 2010
+++ src/usr.bin/head/head.c	Wed Mar 31 21:52:11 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: head.c,v 1.21 2010/03/31 15:01:51 joerg Exp $	*/
+/*	$NetBSD: head.c,v 1.22 2010/03/31 21:52:11 joerg Exp $	*/
 
 /*
  * Copyright (c) 1980, 1987, 1992, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)head.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: head.c,v 1.21 2010/03/31 15:01:51 joerg Exp $");
+__RCSID("$NetBSD: head.c,v 1.22 2010/03/31 21:52:11 joerg Exp $");
 #endif
 #endif /* not lint */
 
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -61,7 +62,7 @@
  * Bill Joy UCB August 24, 1977
  */
 
-static void head(FILE *, long, long);
+static void head(FILE *, intmax_t, intmax_t);
 static void obsolete(char *[]);
 __dead static void usage(void);
 
@@ -72,8 +73,8 @@
 	int ch;
 	FILE *fp;
 	int first;
-	long linecnt;
-	long bytecnt;
+	uintmax_t linecnt;
+	uintmax_t bytecnt;
 	char *ep;
 	int eval = 0;
 	int qflag = 0;
@@ -87,22 +88,18 @@
 		switch(ch) {
 		case 'c':
 			errno = 0;
-			bytecnt = strtol(optarg, &ep, 10);
-			if ((bytecnt == LONG_MIN || bytecnt == LONG_MAX) &&
-			errno == ERANGE)
+			bytecnt = strtoimax(optarg, &ep, 10);
+			if ((bytecnt == INTMAX_MAX && errno == ERANGE) ||
+			*ep || bytecnt <= 0)
 err(1, "illegal byte count -- %s", optarg);
-			else if (*ep || bytecnt <= 0)
-errx(1, "illegal byte count -- %s", optarg);
 			break;
 
 		case 'n':
 			errno = 0;
-			linecnt = strtol(optarg, &ep, 10);
-			if ((linecnt == LONG_MIN || linecnt == LONG_MAX) &&
-			errno == ERANGE)
+			linecnt = strtoimax(optarg, &ep, 10);
+			if ((linecnt == INTMAX_MAX && errno == ERANGE) ||
+			*ep || linecnt <= 0)
 err(1, "illegal line count -- %s", optarg);
-			else if (*ep || linecnt <= 0)
-errx(1, "illegal line count -- %s", optarg);
 			break;
 
 		case 'q':
@@ -143,19 +140,39 @@
 }
 
 static void
-head(FILE *fp, long cnt, long bytecnt)
+head(FILE *fp, intmax_t cnt, intmax_t bytecnt)
 {
+	char buf[65536];
+	size_t len, rv, rv2;
 	int ch;
 
-	if (bytecnt)
-		cnt = bytecnt;
-	while (cnt--)
+	if (bytecnt) {
+		while (bytecnt) {
+			len = sizeof(buf);
+			if (bytecnt > (intmax_t)sizeof(buf))
+len = sizeof(buf);
+			else
+len = bytecnt;
+			rv = fread(buf, 1, len, fp);
+			if (rv == 0)
+break; /* Distinguish EOF and error? */
+			rv2 = fwrite(buf, 1, rv, stdout);
+			if (rv2 != rv) {
+if (feof(stdout))
+	errx(1, "EOF on stdout");
+else
+	err(1, "failure writing to stdout");
+			}
+			bytecnt -= rv;
+		}
+	} else {
 		while ((ch = getc(fp)) != EOF) {
 			if (putchar(ch) == EOF)
 err(1, "stdout");
-			if (ch == '\n' || bytecnt)
+			if (ch == '\n' && --cnt == 0)
 break;
 		}
+	}
 }
 
 static void



CVS commit: src/usr.bin/head

2010-03-31 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Mar 31 21:55:23 UTC 2010

Modified Files:
src/usr.bin/head: head.c

Log Message:
Just ignore the errno of strtoimax, it doesn't provide much value.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/head/head.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/head/head.c
diff -u src/usr.bin/head/head.c:1.22 src/usr.bin/head/head.c:1.23
--- src/usr.bin/head/head.c:1.22	Wed Mar 31 21:52:11 2010
+++ src/usr.bin/head/head.c	Wed Mar 31 21:55:23 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: head.c,v 1.22 2010/03/31 21:52:11 joerg Exp $	*/
+/*	$NetBSD: head.c,v 1.23 2010/03/31 21:55:23 joerg Exp $	*/
 
 /*
  * Copyright (c) 1980, 1987, 1992, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)head.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: head.c,v 1.22 2010/03/31 21:52:11 joerg Exp $");
+__RCSID("$NetBSD: head.c,v 1.23 2010/03/31 21:55:23 joerg Exp $");
 #endif
 #endif /* not lint */
 
@@ -91,7 +91,7 @@
 			bytecnt = strtoimax(optarg, &ep, 10);
 			if ((bytecnt == INTMAX_MAX && errno == ERANGE) ||
 			*ep || bytecnt <= 0)
-err(1, "illegal byte count -- %s", optarg);
+errx(1, "illegal byte count -- %s", optarg);
 			break;
 
 		case 'n':
@@ -99,7 +99,7 @@
 			linecnt = strtoimax(optarg, &ep, 10);
 			if ((linecnt == INTMAX_MAX && errno == ERANGE) ||
 			*ep || linecnt <= 0)
-err(1, "illegal line count -- %s", optarg);
+errx(1, "illegal line count -- %s", optarg);
 			break;
 
 		case 'q':



CVS commit: src/sys/netinet

2010-03-31 Thread Thor Lancelot Simon
Module Name:src
Committed By:   tls
Date:   Thu Apr  1 00:24:41 UTC 2010

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

Log Message:
After discussion with ad@: it appears that KERNEL_LOCK also protects
the driver output path (that is, ifp->if_output()).  In the case of
entry through the socket code, we are fine, because pru_usrreq takes
KERNEL_LOCK.  However, there are a few other ways to cause output
which require protection:

1) direct calls to tcp_output() in tcp_input()
2) fast-forwarding code (ip_flow) -- protected elsewise
   against itself by the softnet lock.
3) *Possibly* the ARP code.  I have currently persuaded
   myself that it is safe because of how it's called.
4) Possibly the ICMP code.

This change addresses #1 and #2.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/netinet/ip_flow.c
cvs rdiff -u -r1.300 -r1.301 src/sys/netinet/tcp_input.c

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

Modified files:

Index: src/sys/netinet/ip_flow.c
diff -u src/sys/netinet/ip_flow.c:1.58 src/sys/netinet/ip_flow.c:1.59
--- src/sys/netinet/ip_flow.c:1.58	Sun Mar 15 22:16:09 2009
+++ src/sys/netinet/ip_flow.c	Thu Apr  1 00:24:41 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_flow.c,v 1.58 2009/03/15 22:16:09 cegger Exp $	*/
+/*	$NetBSD: ip_flow.c,v 1.59 2010/04/01 00:24:41 tls Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_flow.c,v 1.58 2009/03/15 22:16:09 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_flow.c,v 1.59 2010/04/01 00:24:41 tls Exp $");
 
 #include 
 #include 
@@ -301,12 +301,14 @@
 	else
 		dst = rtcache_getdst(&ipf->ipf_ro);
 
+	KERNEL_LOCK(1, NULL);
 	if ((error = (*rt->rt_ifp->if_output)(rt->rt_ifp, m, dst, rt)) != 0) {
 		if (error == ENOBUFS)
 			ipf->ipf_dropped++;
 		else
 			ipf->ipf_errors++;
 	}
+	KERNEL_UNLOCK_ONE(NULL);
 	return 1;
 }
 

Index: src/sys/netinet/tcp_input.c
diff -u src/sys/netinet/tcp_input.c:1.300 src/sys/netinet/tcp_input.c:1.301
--- src/sys/netinet/tcp_input.c:1.300	Tue Jan 26 18:09:07 2010
+++ src/sys/netinet/tcp_input.c	Thu Apr  1 00:24:41 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_input.c,v 1.300 2010/01/26 18:09:07 pooka Exp $	*/
+/*	$NetBSD: tcp_input.c,v 1.301 2010/04/01 00:24:41 tls Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -145,7 +145,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.300 2010/01/26 18:09:07 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.301 2010/04/01 00:24:41 tls Exp $");
 
 #include "opt_inet.h"
 #include "opt_ipsec.h"
@@ -1787,7 +1787,9 @@
 
 sowwakeup(so);
 if (so->so_snd.sb_cc)
+	KERNEL_LOCK(1, NULL);
 	(void) tcp_output(tp);
+	KERNEL_UNLOCK_ONE(NULL);
 if (tcp_saveti)
 	m_freem(tcp_saveti);
 return;
@@ -1883,7 +1885,9 @@
 			sorwakeup(so);
 			tcp_setup_ack(tp, th);
 			if (tp->t_flags & TF_ACKNOW)
+KERNEL_LOCK(1, NULL);
 (void) tcp_output(tp);
+KERNEL_UNLOCK_ONE(NULL);
 			if (tcp_saveti)
 m_freem(tcp_saveti);
 			return;
@@ -2369,7 +2373,9 @@
 		goto drop;
 } else if (tp->t_dupacks > tcprexmtthresh) {
 	tp->snd_cwnd += tp->t_segsz;
+	KERNEL_LOCK(1, NULL);
 	(void) tcp_output(tp);
+	KERNEL_UNLOCK_ONE(NULL);
 	goto drop;
 }
 			} else {
@@ -2730,7 +2736,9 @@
 	 * Return any desired output.
 	 */
 	if (needoutput || (tp->t_flags & TF_ACKNOW)) {
+		KERNEL_LOCK(1, NULL);
 		(void) tcp_output(tp);
+		KERNEL_UNLOCK_ONE(NULL);
 	}
 	if (tcp_saveti)
 		m_freem(tcp_saveti);
@@ -2767,7 +2775,9 @@
 dropafterack2:
 	m_freem(m);
 	tp->t_flags |= TF_ACKNOW;
+	KERNEL_LOCK(1, NULL);
 	(void) tcp_output(tp);
+	KERNEL_UNLOCK_ONE(NULL);
 	if (tcp_saveti)
 		m_freem(tcp_saveti);
 	return;



CVS commit: src/sys/dev/pci

2010-03-31 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Apr  1 01:11:53 UTC 2010

Modified Files:
src/sys/dev/pci: if_bge.c

Log Message:
Fix the code for 5822 B0 errata. Use pci_conf_read() and access at
32bit alignment.


To generate a diff of this commit:
cvs rdiff -u -r1.180 -r1.181 src/sys/dev/pci/if_bge.c

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

Modified files:

Index: src/sys/dev/pci/if_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.180 src/sys/dev/pci/if_bge.c:1.181
--- src/sys/dev/pci/if_bge.c:1.180	Wed Feb  3 15:36:36 2010
+++ src/sys/dev/pci/if_bge.c	Thu Apr  1 01:11:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.180 2010/02/03 15:36:36 msaitoh Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.181 2010/04/01 01:11:53 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.180 2010/02/03 15:36:36 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.181 2010/04/01 01:11:53 msaitoh Exp $");
 
 #include "vlan.h"
 #include "rnd.h"
@@ -3224,8 +3224,15 @@
 
 
 	/* Step 21: 5822 B0 errata */
-	if (BGE_CHIPREV(sc->bge_chipid) == BGE_CHIPREV_5704_BX)
-		BGE_SETBIT(sc, 0x66, 1 << 13 | 1 << 12 | 1 << 10);
+	if (BGE_CHIPREV(sc->bge_chipid) == BGE_CHIPREV_5704_BX) {
+		pcireg_t msidata;
+		
+		msidata = pci_conf_read(sc->sc_pc, sc->sc_pcitag,
+		BGE_PCI_MSI_DATA);
+		msidata |= ((1 << 13 | 1 << 12 | 1 << 10) << 16);
+		pci_conf_write(sc->sc_pc, sc->sc_pcitag, BGE_PCI_MSI_DATA,
+		msidata);
+	}
 
 	/* Step 23: restore cache line size */
 	pci_conf_write(sc->sc_pc, sc->sc_pcitag, BGE_PCI_CACHESZ, cachesize);



CVS commit: src/sys/netinet

2010-03-31 Thread Thor Lancelot Simon
Module Name:src
Committed By:   tls
Date:   Thu Apr  1 01:23:32 UTC 2010

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

Log Message:
As suggested by at least 3 different people (the guilty parties know who
they are) avoid repeated kernel_lock/unlock by using an intrq on the stack.

About 5%-10% better from run to run, on my *very* simpleminded test.  Can't
possibly be worse.


To generate a diff of this commit:
cvs rdiff -u -r1.285 -r1.286 src/sys/netinet/ip_input.c

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

Modified files:

Index: src/sys/netinet/ip_input.c
diff -u src/sys/netinet/ip_input.c:1.285 src/sys/netinet/ip_input.c:1.286
--- src/sys/netinet/ip_input.c:1.285	Wed Mar 31 07:31:15 2010
+++ src/sys/netinet/ip_input.c	Thu Apr  1 01:23:32 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_input.c,v 1.285 2010/03/31 07:31:15 tls Exp $	*/
+/*	$NetBSD: ip_input.c,v 1.286 2010/04/01 01:23:32 tls Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.285 2010/03/31 07:31:15 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.286 2010/04/01 01:23:32 tls Exp $");
 
 #include "opt_inet.h"
 #include "opt_compat_netbsd.h"
@@ -231,6 +231,7 @@
 int	in_multientries;			/* total number of addrs */
 struct	in_multihashhead *in_multihashtbl;
 struct	ifqueue ipintrq;
+
 uint16_t ip_id;
 
 percpu_t *ipstat_percpu;
@@ -474,20 +475,35 @@
 {
 	int s;
 	struct mbuf *m;
+	struct ifqueue lcl_intrq;
+
+	memset(&lcl_intrq, 0, sizeof(lcl_intrq));
+	ipintrq.ifq_maxlen = ipqmaxlen;
 
 	mutex_enter(softnet_lock);
 	KERNEL_LOCK(1, NULL);
-	while (!IF_IS_EMPTY(&ipintrq)) {
+	if (!IF_IS_EMPTY(&ipintrq)) {
 		s = splnet();
-		IF_DEQUEUE(&ipintrq, m);
+
+		/* Take existing queue onto stack */
+		lcl_intrq = ipintrq;
+
+		/* Zero out global queue, preserving maxlen and drops */
+		ipintrq.ifq_head = NULL;
+		ipintrq.ifq_tail = NULL;
+		ipintrq.ifq_len = 0;
+		ipintrq.ifq_maxlen = lcl_intrq.ifq_maxlen;
+		ipintrq.ifq_drops = lcl_intrq.ifq_drops;
+
 		splx(s);
+	}
+	KERNEL_UNLOCK_ONE(NULL);
+	while (!IF_IS_EMPTY(&lcl_intrq)) {
+		IF_DEQUEUE(&lcl_intrq, m);
 		if (m == NULL)
 			break;
-		KERNEL_UNLOCK_ONE(NULL);
 		ip_input(m);
-		KERNEL_LOCK(1, NULL);
 	}
-	KERNEL_UNLOCK_ONE(NULL);
 	mutex_exit(softnet_lock);
 }
 



CVS commit: src/usr.sbin/puffs/mount_psshfs

2010-03-31 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Apr  1 02:34:09 UTC 2010

Modified Files:
src/usr.sbin/puffs/mount_psshfs: fs.c node.c psshfs.h subr.c

Log Message:
In case we create a file, reclaim the vnode, and lookup the file
without the directory timeout expiring, we get vattr_null as the
attributes for that file.  Ensure that we always report sane
attributes by getting them from the server if this is the case.
(also, sprinkle some const)

Fixes problem reported by dyoung.   But wait!  The bug's medallion
begins to glow!  The bug looks much better!  I crumble to dust.

There's probably another similar bug related to "lazy open".  It
will trigger if we reclaim a node before the response to the open
arrives.  Even the comments (typoless) know about this bug ...
But verifying it exists and fixing it will have to wait for another
day.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/puffs/mount_psshfs/fs.c
cvs rdiff -u -r1.60 -r1.61 src/usr.sbin/puffs/mount_psshfs/node.c
cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/puffs/mount_psshfs/psshfs.h
cvs rdiff -u -r1.49 -r1.50 src/usr.sbin/puffs/mount_psshfs/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/usr.sbin/puffs/mount_psshfs/fs.c
diff -u src/usr.sbin/puffs/mount_psshfs/fs.c:1.21 src/usr.sbin/puffs/mount_psshfs/fs.c:1.22
--- src/usr.sbin/puffs/mount_psshfs/fs.c:1.21	Wed Feb  3 17:02:52 2010
+++ src/usr.sbin/puffs/mount_psshfs/fs.c	Thu Apr  1 02:34:09 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fs.c,v 1.21 2010/02/03 17:02:52 pooka Exp $	*/
+/*	$NetBSD: fs.c,v 1.22 2010/04/01 02:34:09 pooka Exp $	*/
 
 /*
  * Copyright (c) 2006-2009  Antti Kantee.  All Rights Reserved.
@@ -27,7 +27,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: fs.c,v 1.21 2010/02/03 17:02:52 pooka Exp $");
+__RCSID("$NetBSD: fs.c,v 1.22 2010/04/01 02:34:09 pooka Exp $");
 #endif /* !lint */
 
 #include 
@@ -269,7 +269,7 @@
 		return EINVAL;
 
 	/* update node attributes */
-	rv = getnodeattr(pu, pn);
+	rv = getnodeattr(pu, pn, NULL);
 	if (rv)
 		return EINVAL;
 

Index: src/usr.sbin/puffs/mount_psshfs/node.c
diff -u src/usr.sbin/puffs/mount_psshfs/node.c:1.60 src/usr.sbin/puffs/mount_psshfs/node.c:1.61
--- src/usr.sbin/puffs/mount_psshfs/node.c:1.60	Thu Jan  7 21:05:50 2010
+++ src/usr.sbin/puffs/mount_psshfs/node.c	Thu Apr  1 02:34:09 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: node.c,v 1.60 2010/01/07 21:05:50 pooka Exp $	*/
+/*	$NetBSD: node.c,v 1.61 2010/04/01 02:34:09 pooka Exp $	*/
 
 /*
  * Copyright (c) 2006-2009  Antti Kantee.  All Rights Reserved.
@@ -27,7 +27,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: node.c,v 1.60 2010/01/07 21:05:50 pooka Exp $");
+__RCSID("$NetBSD: node.c,v 1.61 2010/04/01 02:34:09 pooka Exp $");
 #endif /* !lint */
 
 #include 
@@ -90,7 +90,17 @@
 		if (pd->entry)
 			pn = pd->entry;
 		else
-			pn = makenode(pu, pn_dir, pd, &pd->va);
+			pd->entry = pn = makenode(pu, pn_dir, pd, &pd->va);
+
+		/*
+		 * sure sure we have fresh attributes.  most likely we will
+		 * have them cached.  we might not if we go through:
+		 * create - reclaim - lookup (this).
+		 */
+		rv = getnodeattr(pu, pn, PCNPATH(pcn));
+		if (rv)
+			return rv;
+
 		psn = pn->pn_data;
 	}
 
@@ -110,7 +120,7 @@
 	struct puffs_node *pn = opc;
 	int rv;
 
-	rv = getnodeattr(pu, pn);
+	rv = getnodeattr(pu, pn, NULL);
 	if (rv)
 		return rv;
 

Index: src/usr.sbin/puffs/mount_psshfs/psshfs.h
diff -u src/usr.sbin/puffs/mount_psshfs/psshfs.h:1.39 src/usr.sbin/puffs/mount_psshfs/psshfs.h:1.40
--- src/usr.sbin/puffs/mount_psshfs/psshfs.h:1.39	Thu Jan  7 21:05:50 2010
+++ src/usr.sbin/puffs/mount_psshfs/psshfs.h	Thu Apr  1 02:34:09 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: psshfs.h,v 1.39 2010/01/07 21:05:50 pooka Exp $	*/
+/*	$NetBSD: psshfs.h,v 1.40 2010/04/01 02:34:09 pooka Exp $	*/
 
 /*
  * Copyright (c) 2006-2009  Antti Kantee.  All Rights Reserved.
@@ -230,14 +230,14 @@
 
 struct psshfs_dir *lookup(struct psshfs_dir *, size_t, const char *);
 struct puffs_node *makenode(struct puffs_usermount *, struct puffs_node *,
-			struct psshfs_dir *, const struct vattr *);
+			const struct psshfs_dir *, const struct vattr *);
 struct puffs_node *allocnode(struct puffs_usermount *, struct puffs_node *,
 			const char *, const struct vattr *);
 struct psshfs_dir *direnter(struct puffs_node *, const char *);
 void nukenode(struct puffs_node *, const char *, int);
 void doreclaim(struct puffs_node *);
 int getpathattr(struct puffs_usermount *, const char *, struct vattr *);
-int getnodeattr(struct puffs_usermount *, struct puffs_node *);
+int getnodeattr(struct puffs_usermount *, struct puffs_node *, const char *);
 
 void closehandles(struct puffs_usermount *, struct psshfs_node *, int);
 void lazyopen_rresp(struct puffs_usermount *, struct puffs_framebuf *,

Index: src/usr.sbin/puffs/mount_psshfs/subr.c
diff -u src/usr.sbin/puffs/mount_psshfs/subr.c:1.49 src/usr.sbin

CVS commit: src

2010-03-31 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Apr  1 04:04:11 UTC 2010

Modified Files:
src/share/man/man4: nca.4 pci.4
src/sys/arch/i386/conf: ALL
src/sys/dev/pci: files.pci
Added Files:
src/sys/dev/pci: nca_pci.c

Log Message:
Add support for Domex 536 PCI SCSI controller to nca(4).
This truly remarkable chip is found on the Domex DMX-3191D SCSI adapter.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man4/nca.4
cvs rdiff -u -r1.91 -r1.92 src/share/man/man4/pci.4
cvs rdiff -u -r1.251 -r1.252 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.327 -r1.328 src/sys/dev/pci/files.pci
cvs rdiff -u -r0 -r1.1 src/sys/dev/pci/nca_pci.c

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

Modified files:

Index: src/share/man/man4/nca.4
diff -u src/share/man/man4/nca.4:1.5 src/share/man/man4/nca.4:1.6
--- src/share/man/man4/nca.4:1.5	Wed Apr 30 13:10:54 2008
+++ src/share/man/man4/nca.4	Thu Apr  1 04:04:11 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: nca.4,v 1.5 2008/04/30 13:10:54 martin Exp $
+.\" $NetBSD: nca.4,v 1.6 2010/04/01 04:04:11 jakllsch Exp $
 .\"
 .\" Copyright (c) 2000 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd March 18, 2000
+.Dd April 1, 2010
 .Dt NCA 4
 .Os
 .Sh NAME
@@ -33,6 +33,7 @@
 .Sh SYNOPSIS
 .Cd "nca0 at isa? port 0x360 irq 15   # Port-mapped NCR 53C80 controller"
 .Cd "nca1 at isa? iomem 0xd8000 irq 5 # Memory-mapped controller (T128...)"
+.Cd "nca* at pci? dev ? function ?# Domex 536 (DMX-3191D)"
 .Cd "scsibus* at nca?"
 .Sh DESCRIPTION
 The
@@ -40,6 +41,7 @@
 driver provides support for the NCR-5380/NCR-53C400 SCSI controllers.
 .Sh SEE ALSO
 .Xr isa 4 ,
+.Xr pci 4 ,
 .Xr scsi 4
 .Sh HISTORY
 The
@@ -47,3 +49,5 @@
 driver
 appeared in
 .Nx 1.4 .
+Domex 536 support appeared in
+.Nx 6.0 .

Index: src/share/man/man4/pci.4
diff -u src/share/man/man4/pci.4:1.91 src/share/man/man4/pci.4:1.92
--- src/share/man/man4/pci.4:1.91	Sun Jan  4 16:38:58 2009
+++ src/share/man/man4/pci.4	Thu Apr  1 04:04:11 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: pci.4,v 1.91 2009/01/04 16:38:58 christos Exp $
+.\"	$NetBSD: pci.4,v 1.92 2010/04/01 04:04:11 jakllsch Exp $
 .\"
 .\" Copyright (c) 1997 Jason R. Thorpe.  All rights reserved.
 .\" Copyright (c) 1997 Jonathan Stone
@@ -29,7 +29,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 3, 2009
+.Dd April 1, 2010
 .Dt PCI 4
 .Os
 .Sh NAME
@@ -173,6 +173,10 @@
 LSI Logic \*[Am] Dell MegaRAID SAS RAID controllers.
 .It mly
 Mylex AcceleRAID and eXtremeRAID controllers with v6 firmware.
+.It nca
+Domex 536
+.Tn SCSI
+interfaces.
 .It pcscp
 Advanced Micro Devices Am53c974 PCscsi-PCI
 .Tn SCSI
@@ -473,6 +477,7 @@
 .Xr mly 4 ,
 .Xr mpt 4 ,
 .Xr msk 4 ,
+.Xr nca 4 ,
 .Xr ne 4 ,
 .Xr neo 4 ,
 .Xr nfe 4 ,

Index: src/sys/arch/i386/conf/ALL
diff -u src/sys/arch/i386/conf/ALL:1.251 src/sys/arch/i386/conf/ALL:1.252
--- src/sys/arch/i386/conf/ALL:1.251	Sat Mar 27 03:04:51 2010
+++ src/sys/arch/i386/conf/ALL	Thu Apr  1 04:04:11 2010
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.251 2010/03/27 03:04:51 nonaka Exp $
+# $NetBSD: ALL,v 1.252 2010/04/01 04:04:11 jakllsch Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"ALL-$Revision: 1.251 $"
+#ident 		"ALL-$Revision: 1.252 $"
 
 maxusers	64		# estimated number of users
 
@@ -764,6 +764,7 @@
 mfi*	at pci? dev ? function ?	# LSI MegaRAID SAS
 mly*	at pci? dev ? function ?	# Mylex AcceleRAID and eXtremeRAID
 mpt*	at pci? dev ? function ?	# LSI Fusion SCSI/FC
+nca*	at pci? dev ? function ?	# Domex DMX-3191D
 njs*	at pci? dev ? function ?	# Workbit NinjaSCSI-32
 pcscp*	at pci? dev ? function ?	# AMD 53c974 PCscsi-PCI SCSI
 siop*	at pci? dev ? function ?	# Symbios 53c8xx SCSI

Index: src/sys/dev/pci/files.pci
diff -u src/sys/dev/pci/files.pci:1.327 src/sys/dev/pci/files.pci:1.328
--- src/sys/dev/pci/files.pci:1.327	Sun Mar 21 21:11:13 2010
+++ src/sys/dev/pci/files.pci	Thu Apr  1 04:04:11 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.327 2010/03/21 21:11:13 jklos Exp $
+#	$NetBSD: files.pci,v 1.328 2010/04/01 04:04:11 jakllsch Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -1005,3 +1005,7 @@
 attach		wcfb at pci
 file		dev/pci/wcfb.c	wcfb
 defflag		opt_wcfb.h	WCFB_DEBUG
+
+# Domex 536, 5380-compatible SCSI HBA
+attach	nca at pci with nca_pci
+file	dev/pci/nca_pci.c	nca_pci

Added files:

Index: src/sys/dev/pci/nca_pci.c
diff -u /dev/null src/sys/dev/pci/nca_pci.c:1.1
--- /dev/null	Thu Apr  1 04:

CVS commit: src/sys/dev/i2c

2010-03-31 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Apr  1 04:29:35 UTC 2010

Modified Files:
src/sys/dev/i2c: dbcool.c dbcool_reg.h

Log Message:
add some more ADM1031 support:
- additional temperature and fan speed sensors work now
- limits on should work on all temperature sensors
Controlling fan behaviour doesn't work yet, the ADM1031 uses the same
register for both fans which doesn't quite fit with the way the dbcool
driver works.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/i2c/dbcool.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/i2c/dbcool_reg.h

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

Modified files:

Index: src/sys/dev/i2c/dbcool.c
diff -u src/sys/dev/i2c/dbcool.c:1.21 src/sys/dev/i2c/dbcool.c:1.22
--- src/sys/dev/i2c/dbcool.c:1.21	Wed Mar 31 18:07:13 2010
+++ src/sys/dev/i2c/dbcool.c	Thu Apr  1 04:29:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbcool.c,v 1.21 2010/03/31 18:07:13 macallan Exp $ */
+/*	$NetBSD: dbcool.c,v 1.22 2010/04/01 04:29:35 macallan Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.21 2010/03/31 18:07:13 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.22 2010/04/01 04:29:35 macallan Exp $");
 
 #include 
 #include 
@@ -529,7 +529,7 @@
 	{ DBC_CTL,  {	DBCOOL_ADM1030_R_TMIN,
 			DBCOOL_NO_REG,
 			DBCOOL_NO_REG },		1,  8, 0 },
-	{ DBC_CTL,  {	DBCOOL_ADM1030_L_TTHRESH,
+	{ DBC_CTL,  {	DBCOOL_ADM1030_R_TTHRESH,
 			DBCOOL_NO_REG,
 			DBCOOL_NO_REG },		1,  9, 0 },
 	{ DBC_CTL,  {	DBCOOL_ADM1030_R_TTHRESH,
@@ -545,6 +545,61 @@
 	{ { 0, 0, 0, 0 }, NULL }
 };
 
+struct dbcool_sensor ADM1031_sensor_table[] = {
+	{ DBC_TEMP, {	DBCOOL_ADM1030_L_TEMP,
+			DBCOOL_ADM1030_L_HI_LIM,
+			DBCOOL_ADM1030_L_LO_LIM },	0,  0, 0 },
+	{ DBC_TEMP, {	DBCOOL_ADM1030_R_TEMP,
+			DBCOOL_ADM1030_R_HI_LIM,
+			DBCOOL_ADM1030_R_LO_LIM },	1,  0, 0 },
+	{ DBC_TEMP, {	DBCOOL_ADM1031_R2_TEMP,
+			DBCOOL_ADM1031_R2_HI_LIM,
+			DBCOOL_ADM1031_R2_LO_LIM },	2,  0, 0 },
+	{ DBC_FAN,  {	DBCOOL_ADM1030_FAN_TACH,
+			DBCOOL_NO_REG,
+			DBCOOL_ADM1030_FAN_LO_LIM },	5,  0, 0 },
+	{ DBC_FAN,  {	DBCOOL_ADM1031_FAN2_TACH,
+			DBCOOL_NO_REG,
+			DBCOOL_ADM1031_FAN2_LO_LIM },	6,  0, 0 },
+	{ DBC_CTL,  {	DBCOOL_ADM1030_L_TMIN,
+			DBCOOL_NO_REG,
+			DBCOOL_NO_REG },		0,  8, 0 },
+	{ DBC_CTL,  {	DBCOOL_ADM1030_L_TTHRESH,
+			DBCOOL_NO_REG,
+			DBCOOL_NO_REG },		0,  9, 0 },
+	{ DBC_CTL,  {	DBCOOL_ADM1030_L_TTHRESH,
+			DBCOOL_NO_REG,
+			DBCOOL_NO_REG },		0,  6, 0 },
+	{ DBC_CTL,  {	DBCOOL_ADM1030_R_TMIN,
+			DBCOOL_NO_REG,
+			DBCOOL_NO_REG },		1,  8, 0 },
+	{ DBC_CTL,  {	DBCOOL_ADM1030_R_TTHRESH,
+			DBCOOL_NO_REG,
+			DBCOOL_NO_REG },		1,  9, 0 },
+	{ DBC_CTL,  {	DBCOOL_ADM1030_R_TTHRESH,
+			DBCOOL_NO_REG,
+			DBCOOL_NO_REG },		1,  6, 0 },
+	{ DBC_CTL,  {	DBCOOL_ADM1031_R2_TMIN,
+			DBCOOL_NO_REG,
+			DBCOOL_NO_REG },		2,  8, 0 },
+	{ DBC_CTL,  {	DBCOOL_ADM1031_R2_TTHRESH,
+			DBCOOL_NO_REG,
+			DBCOOL_NO_REG },		2,  9, 0 },
+	{ DBC_CTL,  {	DBCOOL_ADM1031_R2_TTHRESH,
+			DBCOOL_NO_REG,
+			DBCOOL_NO_REG },		2,  6, 0 },
+	{ DBC_EOF,  {0, 0, 0 }, 0, 0, 0 }
+};
+
+struct dbcool_power_control ADM1031_power_table[] = {   
+	{ { DBCOOL_ADM1030_CFG1,  DBCOOL_NO_REG, DBCOOL_NO_REG,
+	DBCOOL_ADM1030_FAN_SPEED_CFG },
+	  "fan_control_1" },
+	{ { DBCOOL_ADM1030_CFG1,  DBCOOL_NO_REG, DBCOOL_NO_REG,
+	DBCOOL_ADM1030_FAN_SPEED_CFG },
+	  "fan_control_2" },
+	{ { 0, 0, 0, 0 }, NULL }
+};
 struct chip_id chip_table[] = {
 	{ DBCOOL_COMPANYID, ADT7490_DEVICEID, ADT7490_REV_ID,
 		ADT7490_sensor_table, ADT7475_power_table,
@@ -593,7 +648,7 @@
 		DBCFLAG_ADM1030 | DBCFLAG_NO_READBYTE,
 		11250 * 60, "ADM1030" },
 	{ DBCOOL_COMPANYID, ADM1031_DEVICEID, 0xff,
-		ADM1030_sensor_table, ADM1030_power_table,
+		ADM1031_sensor_table, ADM1030_power_table,
 		DBCFLAG_ADM1030 | DBCFLAG_NO_READBYTE,
 		11250 * 60, "ADM1031" },
 	{ 0, 0, 0, NULL, NULL, 0, 0, NULL }
@@ -794,6 +849,8 @@
 			ext = sc->sc_dc.dc_readreg(&sc->sc_dc, DBCOOL_ADM1030_TEMP_EXTRES);
 			if (reg == DBCOOL_ADM1030_L_TEMP)
 ext >>= 6;
+			else if (reg == DBCOOL_ADM1031_R2_TEMP)
+ext >>= 4;
 			else
 ext >>= 1;
 			ext &= 0x03;

Index: src/sys/dev/i2c/dbcool_reg.h
diff -u src/sys/dev/i2c/dbcool_reg.h:1.4 src/sys/dev/i2c/dbcool_reg.h:1.5
--- src/sys/dev/i2c/dbcool_reg.h:1.4	Wed Mar 31 18:07:13 2010
+++ src/sys/dev/i2c/dbcool_reg.h	Thu Apr  1 04:29:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbcool_reg.h,v 1.4 2010/03/31 18:07:13 macallan Exp $ */
+/*	$NetBSD: dbcool_reg.h,v 1.5 2010/04/01 04:29:35 macallan Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #define DBCOOLREG_H
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dbcool_reg.h,v 1.4 2010/03/31 18:07:13 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dbcool_reg.h,v 1.5 2010/04/01 04:29:35 macallan Exp $");
 
 #define DBCOOL_ADDRMASK		0x7c
 #define	DBCOOL_ADDR		0x2c	/* Some ch

CVS commit: src/doc

2010-03-31 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Apr  1 05:08:46 UTC 2010

Modified Files:
src/doc: CHANGES

Log Message:
mention ADM1031 support in dbcool


To generate a diff of this commit:
cvs rdiff -u -r1.1373 -r1.1374 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/CHANGES
diff -u src/doc/CHANGES:1.1373 src/doc/CHANGES:1.1374
--- src/doc/CHANGES:1.1373	Wed Mar 31 09:21:43 2010
+++ src/doc/CHANGES	Thu Apr  1 05:08:46 2010
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1373 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1374 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -572,3 +572,5 @@
 	cgtwelve: A driver for Sun CG12 / Matrox SG3 graphics boards
 		[macallan 20100323]
 	dhcpcd(8): Import dhcpcd-5.2.2. [roy 20100331]
+	dbcool(4): Added support for ADM1031 therman sensor / fan controller
+		[macallan 20100401]



CVS commit: src/share/man/man4

2010-03-31 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Apr  1 05:10:52 UTC 2010

Modified Files:
src/share/man/man4: dbcool.4

Log Message:
mention adm1031 support


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man4/dbcool.4

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

Modified files:

Index: src/share/man/man4/dbcool.4
diff -u src/share/man/man4/dbcool.4:1.7 src/share/man/man4/dbcool.4:1.8
--- src/share/man/man4/dbcool.4:1.7	Mon Mar  1 03:15:16 2010
+++ src/share/man/man4/dbcool.4	Thu Apr  1 05:10:52 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: dbcool.4,v 1.7 2010/03/01 03:15:16 pgoyette Exp $
+.\"	$NetBSD: dbcool.4,v 1.8 2010/04/01 05:10:52 macallan Exp $
 .\"
 .\" Copyright (c) 2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -34,6 +34,7 @@
 .Nm dbcool ,
 .Nm adm1027 ,
 .Nm adm1030 ,
+.Nm adm1031 ,
 .Nm adt7463 ,
 .Nm adt7466 ,
 .Nm adt7467 ,



CVS commit: src/sys/dev/i2c

2010-03-31 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Apr  1 05:26:48 UTC 2010

Modified Files:
src/sys/dev/i2c: dbcool.c

Log Message:
don't divide by zero. ever.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/i2c/dbcool.c

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

Modified files:

Index: src/sys/dev/i2c/dbcool.c
diff -u src/sys/dev/i2c/dbcool.c:1.22 src/sys/dev/i2c/dbcool.c:1.23
--- src/sys/dev/i2c/dbcool.c:1.22	Thu Apr  1 04:29:35 2010
+++ src/sys/dev/i2c/dbcool.c	Thu Apr  1 05:26:48 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbcool.c,v 1.22 2010/04/01 04:29:35 macallan Exp $ */
+/*	$NetBSD: dbcool.c,v 1.23 2010/04/01 05:26:48 macallan Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.22 2010/04/01 04:29:35 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.23 2010/04/01 05:26:48 macallan Exp $");
 
 #include 
 #include 
@@ -922,7 +922,8 @@
 	if (rpm == 0x)
 		return 0;	/* 0x indicates stalled/failed fan */
 
-	return (sc->sc_dc.dc_chip->rpm_dividend / rpm);
+	/* don't divide by zero */
+	return (rpm == 0)? 0 : (sc->sc_dc.dc_chip->rpm_dividend / rpm);
 }
 
 /* Provide chip's supply voltage, in microvolts */



CVS commit: src/sys/dev/cardbus

2010-03-31 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Thu Apr  1 05:58:52 UTC 2010

Modified Files:
src/sys/dev/cardbus: siisata_cardbus.c

Log Message:
Cosmetic: join a couple of lines.  Stop storing the value of a BAR in a
temporary variable with the name 'csr'.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/cardbus/siisata_cardbus.c

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

Modified files:

Index: src/sys/dev/cardbus/siisata_cardbus.c
diff -u src/sys/dev/cardbus/siisata_cardbus.c:1.12 src/sys/dev/cardbus/siisata_cardbus.c:1.13
--- src/sys/dev/cardbus/siisata_cardbus.c:1.12	Thu Mar 18 20:54:56 2010
+++ src/sys/dev/cardbus/siisata_cardbus.c	Thu Apr  1 05:58:52 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata_cardbus.c,v 1.12 2010/03/18 20:54:56 dyoung Exp $ */
+/* $NetBSD: siisata_cardbus.c,v 1.13 2010/04/01 05:58:52 dyoung Exp $ */
 /* Id: siisata_pci.c,v 1.11 2008/05/21 16:20:11 jakllsch Exp  */
 
 /*
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: siisata_cardbus.c,v 1.12 2010/03/18 20:54:56 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata_cardbus.c,v 1.13 2010/04/01 05:58:52 dyoung Exp $");
 
 #include 
 #include 
@@ -175,9 +175,7 @@
 	{
 #define SIISATA_BAR0_SIZE	128
 		grsize = SIISATA_BAR0_SIZE;
-		csr =
-		Cardbus_conf_read(ct, ca->ca_tag, SIISATA_CARDBUS_BAR0);
-		base = PCI_MAPREG_MEM_ADDR(csr);
+		base = PCI_MAPREG_MEM_ADDR(Cardbus_conf_read(ct, ca->ca_tag, SIISATA_CARDBUS_BAR0));
 		memt = csc->sc_memt;
 		if ((*cf->cardbus_space_alloc)(cc, csc->sc_rbus_memt, base,
 		grsize, grsize - 1, grsize, 0, &base, &memh)) {
@@ -186,8 +184,7 @@
 			SIISATANAME(sc));
 			return;
 		}
-		Cardbus_conf_write(ct, ca->ca_tag, SIISATA_CARDBUS_BAR0,
-		base);
+		Cardbus_conf_write(ct, ca->ca_tag, SIISATA_CARDBUS_BAR0, base);
 	}
 	sc->sc_grt = memt;
 	sc->sc_grh = memh;
@@ -211,8 +208,7 @@
 			SIISATANAME(sc));
 			return;
 		}
-		Cardbus_conf_write(ct, ca->ca_tag, SIISATA_CARDBUS_BAR1,
-		base);
+		Cardbus_conf_write(ct, ca->ca_tag, SIISATA_CARDBUS_BAR1, base);
 	}
 	sc->sc_prt = memt;
 	sc->sc_prh = memh;