Re: CVS commit: src/sys/kern

2011-11-21 Thread Joerg Sonnenberger
On Mon, Nov 21, 2011 at 01:44:38PM +, Izumi Tsutsui wrote:
 Module Name:  src
 Committed By: tsutsui
 Date: Mon Nov 21 13:44:38 UTC 2011
 
 Modified Files:
   src/sys/kern: subr_cprng.c
 
 Log Message:
 Include MD machine/cpu_counter.h only if defined(__HAVE_CPU_COUNTER).
 
 XXX: Why not timecounter(9) but deprecated cpu_counter32() and microtime(9)?

microtime(9) is part of timecounter(9). There is no real replacement for
cpu_counter32, which is doing a lot less processing than the
alternatives.

Joerg


Re: CVS commit: src/sys/kern

2011-11-21 Thread Izumi Tsutsui
  Modified Files:
  src/sys/kern: subr_cprng.c
  
  Log Message:
  Include MD machine/cpu_counter.h only if defined(__HAVE_CPU_COUNTER).
  
  XXX: Why not timecounter(9) but deprecated cpu_counter32() and microtime(9)?
 
 microtime(9) is part of timecounter(9).

With extra overhead?

 There is no real replacement for
 cpu_counter32, which is doing a lot less processing than the
 alternatives.

It seems used to get a random number and
I think MI getbintime(9) is simple and enough.

---
Izumi Tsutsui


Re: CVS commit: src/lib/libc/arch/vax

2011-11-21 Thread Christos Zoulas
In article 2021161748.b09dd17...@cvs.netbsd.org,
Chuck Silvers source-changes-d@NetBSD.org wrote:
-=-=-=-=-=-

gcc 4.5 on vax creates PLT stubs with an entry mask of 0xffc
rather than 0 like gcc 4.1 did, so the sneaky assembly functions
that ret without really returning now clobber their registers.
adjust these functions to avoid this problem.

Whee! This should fix all the vfork lossage! Any news on the addsi3 issue?

christos



Re: CVS commit: src/sys/fs/union

2011-11-21 Thread YAMAMOTO Takashi
hi,

do you have any plan on fs/unionfs?  eg. remove it

YAMAMOTO Takashi

 Module Name:  src
 Committed By: hannken
 Date: Mon Nov 21 18:29:23 UTC 2011
 
 Modified Files:
   src/sys/fs/union: union.h union_subr.c union_vfsops.c union_vnops.c
 
 Log Message:
 Replace flag based union node locking with generic vnode lock, support
 shared and nowait locks and protect un_uppervp and un_*sz with mutex.
 
 Mark file system MPSAFE.
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.21 -r1.22 src/sys/fs/union/union.h
 cvs rdiff -u -r1.52 -r1.53 src/sys/fs/union/union_subr.c
 cvs rdiff -u -r1.64 -r1.65 src/sys/fs/union/union_vfsops.c
 cvs rdiff -u -r1.48 -r1.49 src/sys/fs/union/union_vnops.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


Re: CVS commit: src/sys/fs/union

2011-11-21 Thread David Holland
On Tue, Nov 22, 2011 at 01:17:43AM +, YAMAMOTO Takashi wrote:
  hi,
  
  do you have any plan on fs/unionfs?  eg. remove it

My vote would be to remove it; it doesn't work and the only reason it
was ever brought in had to do with alleged locking improvements.

-- 
David A. Holland
dholl...@netbsd.org


CVS commit: src/sbin/iscsid

2011-11-21 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Nov 21 08:23:20 UTC 2011

Modified Files:
src/sbin/iscsid: iscsid.8

Log Message:
Fix title and xrefs.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sbin/iscsid/iscsid.8

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

Modified files:

Index: src/sbin/iscsid/iscsid.8
diff -u src/sbin/iscsid/iscsid.8:1.1 src/sbin/iscsid/iscsid.8:1.2
--- src/sbin/iscsid/iscsid.8:1.1	Sun Oct 23 21:11:23 2011
+++ src/sbin/iscsid/iscsid.8	Mon Nov 21 08:23:20 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: iscsid.8,v 1.1 2011/10/23 21:11:23 agc Exp $
+.\ $NetBSD: iscsid.8,v 1.2 2011/11/21 08:23:20 njoly Exp $
 .\
 .\ Copyright (c) 2011 Alistair Crooks a...@netbsd.org
 .\ All rights reserved.
@@ -24,7 +24,7 @@
 .\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
 .Dd August 8, 2011
-.Dt ISCSICTL 8
+.Dt ISCSID 8
 .Os
 .Sh NAME
 .Nm iscsid
@@ -39,7 +39,7 @@ The
 .Nm
 utility itself interfaces to the kernel iSCSI driver, and also
 communicates, using
-.Xr libisns 3 ,
+.Xr isns 3 ,
 with the iSCSI name service running on other hosts
 to locate services and iSCSI instances.
 In normal operation,
@@ -69,7 +69,7 @@ is shown in
 .Xr iscsictl 8 .
 .Sh SEE ALSO
 .Xr daemon 3 ,
-.Xr libisns 3 ,
+.Xr isns 3 ,
 .Xr iscsictl 8
 .Sh HISTORY
 The



CVS commit: src/sys/nfs

2011-11-21 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Nov 21 09:08:00 UTC 2011

Modified Files:
src/sys/nfs: nfs_serv.c

Log Message:
nfsrv_lookup(): Defer the postopattr lookup on dirp until the
child node is unlocked.

Ok: YAMAMOTO Takashi y...@netbsd.org


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/nfs/nfs_serv.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/nfs/nfs_serv.c
diff -u src/sys/nfs/nfs_serv.c:1.161 src/sys/nfs/nfs_serv.c:1.162
--- src/sys/nfs/nfs_serv.c:1.161	Sun Oct 30 12:00:27 2011
+++ src/sys/nfs/nfs_serv.c	Mon Nov 21 09:07:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_serv.c,v 1.161 2011/10/30 12:00:27 hannken Exp $	*/
+/*	$NetBSD: nfs_serv.c,v 1.162 2011/11/21 09:07:59 hannken Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -55,7 +55,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_serv.c,v 1.161 2011/10/30 12:00:27 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_serv.c,v 1.162 2011/11/21 09:07:59 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -453,15 +453,6 @@ nfsrv_lookup(struct nfsrv_descript *nfsd
 		}
 	}
 
-	if (dirp) {
-		if (v3) {
-			vn_lock(dirp, LK_SHARED | LK_RETRY);
-			dirattr_ret = VOP_GETATTR(dirp, dirattr, cred);
-			VOP_UNLOCK(dirp);
-		}
-		vrele(dirp);
-	}
-
 	if (error) {
 		if (nd.ni_pathbuf != NULL) {
 			pathbuf_destroy(nd.ni_pathbuf);
@@ -469,6 +460,14 @@ nfsrv_lookup(struct nfsrv_descript *nfsd
 		if (ipb != NULL) {
 			pathbuf_destroy(ipb);
 		}
+		if (dirp) {
+			if (v3) {
+vn_lock(dirp, LK_SHARED | LK_RETRY);
+dirattr_ret = VOP_GETATTR(dirp, dirattr, cred);
+vput(dirp);
+			} else
+vrele(dirp);
+		}
 		nfsm_reply(NFSX_POSTOPATTR(v3));
 		nfsm_srvpostop_attr(dirattr_ret, dirattr);
 		return (0);
@@ -484,6 +483,14 @@ nfsrv_lookup(struct nfsrv_descript *nfsd
 	if (!error)
 		error = VOP_GETATTR(vp, va, cred);
 	vput(vp);
+	if (dirp) {
+		if (v3) {
+			vn_lock(dirp, LK_SHARED | LK_RETRY);
+			dirattr_ret = VOP_GETATTR(dirp, dirattr, cred);
+			vput(dirp);
+		} else
+			vrele(dirp);
+	}
 	nfsm_reply(NFSX_SRVFH(nsfh, v3) + NFSX_POSTOPORFATTR(v3) +
 	NFSX_POSTOPATTR(v3));
 	if (error) {



CVS commit: src/lib/libc/gdtoa

2011-11-21 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Nov 21 09:46:20 UTC 2011

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

Log Message:
one more error path that didn't free a lock.


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

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

Modified files:

Index: src/lib/libc/gdtoa/misc.c
diff -u src/lib/libc/gdtoa/misc.c:1.10 src/lib/libc/gdtoa/misc.c:1.11
--- src/lib/libc/gdtoa/misc.c:1.10	Fri Nov 18 08:20:13 2011
+++ src/lib/libc/gdtoa/misc.c	Mon Nov 21 09:46:19 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: misc.c,v 1.10 2011/11/18 08:20:13 martin Exp $ */
+/* $NetBSD: misc.c,v 1.11 2011/11/21 09:46:19 mlelstv Exp $ */
 
 /
 
@@ -76,8 +76,10 @@ Balloc
 		else
 			rv = (Bigint*)MALLOC(len*sizeof(double));
 #endif
-		if (rv == NULL)
+		if (rv == NULL) {
+			FREE_DTOA_LOCK(0);
 			return NULL;
+		}
 		rv-k = k;
 		rv-maxwds = x;
 		}



CVS commit: src/sys/fs/msdosfs

2011-11-21 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Nov 21 10:46:57 UTC 2011

Modified Files:
src/sys/fs/msdosfs: msdosfs_vnops.c

Log Message:
Add missing fstrans_done().

Should fix PR #45635 (KASSERT fli-fli_trans_cnt == 0 failed)


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/fs/msdosfs/msdosfs_vnops.c

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

Modified files:

Index: src/sys/fs/msdosfs/msdosfs_vnops.c
diff -u src/sys/fs/msdosfs/msdosfs_vnops.c:1.78 src/sys/fs/msdosfs/msdosfs_vnops.c:1.79
--- src/sys/fs/msdosfs/msdosfs_vnops.c:1.78	Wed Jul 20 11:52:00 2011
+++ src/sys/fs/msdosfs/msdosfs_vnops.c	Mon Nov 21 10:46:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vnops.c,v 1.78 2011/07/20 11:52:00 hannken Exp $	*/
+/*	$NetBSD: msdosfs_vnops.c,v 1.79 2011/11/21 10:46:56 hannken Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.78 2011/07/20 11:52:00 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.79 2011/11/21 10:46:56 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -499,8 +499,10 @@ msdosfs_read(void *v)
 		lbn = de_cluster(pmp, uio-uio_offset);
 		on = uio-uio_offset  pmp-pm_crbomask;
 		n = MIN(pmp-pm_bpcluster - on, uio-uio_resid);
-		if (uio-uio_offset = dep-de_FileSize)
+		if (uio-uio_offset = dep-de_FileSize) {
+			fstrans_done(vp-v_mount);
 			return (0);
+		}
 		/* file size (and hence diff) may be up to 4GB */
 		diff = dep-de_FileSize - uio-uio_offset;
 		if (diff  n)



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Nov 21 11:21:04 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
i tested azalia


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.17 -r1.1.2.18 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.17 src/sys/dev/TODO.audiomp:1.1.2.18
--- src/sys/dev/TODO.audiomp:1.1.2.17	Sun Nov 20 19:26:34 2011
+++ src/sys/dev/TODO.audiomp	Mon Nov 21 11:21:04 2011
@@ -36,7 +36,7 @@ dev/pci/auich.c			done
 dev/pci/auixp.c			done
 dev/pci/autri.c			done
 dev/pci/auvia.c			done
-dev/pci/azalia.c		done
+dev/pci/azalia.c		done		port-i386
 dev/pci/cmpci.c			done
 dev/pci/cs4280.c		done
 dev/pci/cs4281.c		done



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

2011-11-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Nov 21 13:42:37 UTC 2011

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

Log Message:
No need to include MD machine/cpu_counter.h here.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/librump/rumpkern/cprng_stub.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/cprng_stub.c
diff -u src/sys/rump/librump/rumpkern/cprng_stub.c:1.1 src/sys/rump/librump/rumpkern/cprng_stub.c:1.2
--- src/sys/rump/librump/rumpkern/cprng_stub.c:1.1	Sat Nov 19 22:51:30 2011
+++ src/sys/rump/librump/rumpkern/cprng_stub.c	Mon Nov 21 13:42:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cprng_stub.c,v 1.1 2011/11/19 22:51:30 tls Exp $ */
+/*	$NetBSD: cprng_stub.c,v 1.2 2011/11/21 13:42:37 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -38,8 +38,6 @@
 #include sys/mutex.h
 #include sys/rngtest.h
 
-#include machine/cpu_counter.h
-
 #include sys/cprng.h
 
 /*



CVS commit: src/sys/kern

2011-11-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Nov 21 13:44:38 UTC 2011

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

Log Message:
Include MD machine/cpu_counter.h only if defined(__HAVE_CPU_COUNTER).

XXX: Why not timecounter(9) but deprecated cpu_counter32() and microtime(9)?


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/kern/subr_cprng.c

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

Modified files:

Index: src/sys/kern/subr_cprng.c
diff -u src/sys/kern/subr_cprng.c:1.1 src/sys/kern/subr_cprng.c:1.2
--- src/sys/kern/subr_cprng.c:1.1	Sat Nov 19 22:51:25 2011
+++ src/sys/kern/subr_cprng.c	Mon Nov 21 13:44:38 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_cprng.c,v 1.1 2011/11/19 22:51:25 tls Exp $ */
+/*	$NetBSD: subr_cprng.c,v 1.2 2011/11/21 13:44:38 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -39,11 +39,13 @@
 #include sys/rngtest.h
 #include sys/rnd.h
 
+#if defined(__HAVE_CPU_COUNTER)
 #include machine/cpu_counter.h
+#endif
 
 #include sys/cprng.h
 
-__KERNEL_RCSID(0, $NetBSD: subr_cprng.c,v 1.1 2011/11/19 22:51:25 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_cprng.c,v 1.2 2011/11/21 13:44:38 tsutsui Exp $);
 
 void
 cprng_init(void)



CVS commit: src/tools

2011-11-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Nov 21 13:46:37 UTC 2011

Modified Files:
src/tools: Makefile.gnuhost

Log Message:
Pass M4=${TOOL_M4:Q} to CONFIGURE_ENV for tools/gmp.
Fixes configure error on cygwin.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/tools/Makefile.gnuhost

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

Modified files:

Index: src/tools/Makefile.gnuhost
diff -u src/tools/Makefile.gnuhost:1.34 src/tools/Makefile.gnuhost:1.35
--- src/tools/Makefile.gnuhost:1.34	Wed Nov 25 11:49:36 2009
+++ src/tools/Makefile.gnuhost	Mon Nov 21 13:46:37 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.gnuhost,v 1.34 2009/11/25 11:49:36 uebayasi Exp $
+#	$NetBSD: Makefile.gnuhost,v 1.35 2011/11/21 13:46:37 tsutsui Exp $
 #
 # Rules used when building a GNU host package.  Expects MODULE to be set.
 #
@@ -55,6 +55,7 @@ CONFIGURE_ENV+= \
 		INSTALL=${HOST_INSTALL_FILE:Q} \
 		LDFLAGS=${HOST_LDFLAGS:Q} \
 		LEX=${LEX:Q} \
+		M4=${TOOL_M4:Q} \
 		MAKE=${MAKE:Q} \
 		PATH=${TOOLDIR}/bin:$$PATH \
 		RANLIB=${HOST_RANLIB:Q} \



CVS commit: src/share/man/man8

2011-11-21 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Nov 21 14:27:41 UTC 2011

Modified Files:
src/share/man/man8: compat_freebsd.8 compat_ibcs2.8 compat_linux.8

Log Message:
Switch from .nf/.fi groff macros to .Bd -literal/.Ed blocks.
While here, convert .sp macro to .Pp.

ok wiz@.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/share/man/man8/compat_freebsd.8
cvs rdiff -u -r1.5 -r1.6 src/share/man/man8/compat_ibcs2.8
cvs rdiff -u -r1.36 -r1.37 src/share/man/man8/compat_linux.8

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/man8/compat_freebsd.8
diff -u src/share/man/man8/compat_freebsd.8:1.13 src/share/man/man8/compat_freebsd.8:1.14
--- src/share/man/man8/compat_freebsd.8:1.13	Wed Feb 13 08:18:21 2002
+++ src/share/man/man8/compat_freebsd.8	Mon Nov 21 14:27:41 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: compat_freebsd.8,v 1.13 2002/02/13 08:18:21 ross Exp $
+.\	$NetBSD: compat_freebsd.8,v 1.14 2011/11/21 14:27:41 njoly Exp $
 .\	from: compat_linux.8,v 1.1 1995/03/05 23:30:36 fvdl Exp
 .\
 .\ Copyright (c) 1995 Frank van der Linden
@@ -128,18 +128,15 @@ Put it on the
 system you have access to, and check which shared libraries it
 needs by running
 .Sq ldd sim :
-.Pp
-.Bl -tag -width 123 -compact -offset indent
-.It me@freebsd% ldd /usr/local/lib/SimCity/res/sim
-.nf
+.Bd -literal -offset indent
+me@freebsd% ldd /usr/local/lib/SimCity/res/sim
 /usr/local/lib/SimCity/res/sim:
 	-lXext.6 =\*[Gt] /usr/X11R6/lib/libXext.so.6.0 (0x100c1000)
 	-lX11.6 =\*[Gt] /usr/X11R6/lib/libX11.so.6.0 (0x100c9000)
 	-lc.2 =\*[Gt] /usr/lib/libc.so.2.1 (0x10144000)
 	-lm.2 =\*[Gt] /usr/lib/libm.so.2.0 (0x101a7000)
 	-lgcc.261 =\*[Gt] /usr/lib/libgcc.so.261.0 (0x101bf000)
-.fi
-.El
+.Ed
 .Pp
 You would need go get all the files from the last column, and
 put them under
@@ -179,10 +176,9 @@ So, if you have these libraries on your 
 .Pp
 and you find that the ldd output for a new binary you want to
 install is:
-.Pp
-.nf
+.Bd -literal
 \-lc.2 =\*[Gt] /usr/lib/libc.so.2.1 (0x10144000)
-.fi
+.Ed
 .Pp
 You won't need to worry about copying
 .Pa /usr/lib/libc.so.2.1
@@ -259,12 +255,11 @@ ldconfig program with directory argument
 runtime linker should look for shared libs.
 .Pa /usr/lib
 are standard, you could run like the following:
-.Pp
-.Bl -tag -width 123 -compact -offset indent
-.It me@netbsd% mkdir -p /emul/freebsd/var/run
-.It me@netbsd% touch /emul/freebsd/var/run/ld.so.hints
-.It me@netbsd% ldconfig-freebsd /usr/X11R6/lib /usr/local/lib
-.El
+.Bd -literal -offset indent
+me@netbsd% mkdir -p /emul/freebsd/var/run
+me@netbsd% touch /emul/freebsd/var/run/ld.so.hints
+me@netbsd% ldconfig-freebsd /usr/X11R6/lib /usr/local/lib
+.Ed
 .Pp
 Note that argument directories of ldconfig are
 mapped to
@@ -298,14 +293,11 @@ You can test this by running the
 on itself.  Suppose that you have it installed as
 .Ic ldd-freebsd ,
 it should produce something like:
-.Pp
-.Bl -tag -width 123 -compact -offset indent
-.It me@netbsd% ldd-freebsd `which ldd-freebsd`
-.nf
+.Bd -literal -offset indent
+me@netbsd% ldd-freebsd `which ldd-freebsd`
 /usr/local/bin/ldd-freebsd:
 	-lc.2 =\*[Gt] /usr/lib/libc.so.2.1 (0x1001a000)
-.fi
-.El
+.Ed
 .Pp
 This being done, you are ready to install new
 .Fx
@@ -397,7 +389,6 @@ retrieve files
 too.  The way to look something up is to retrieve all the files in the
 distribution, and ``tar ztvf'' through them for the file you need.
 Here is an example of a list of files that you might need.
-.Pp
 .Bd -literal -offset indent
 Needed Files
 

Index: src/share/man/man8/compat_ibcs2.8
diff -u src/share/man/man8/compat_ibcs2.8:1.5 src/share/man/man8/compat_ibcs2.8:1.6
--- src/share/man/man8/compat_ibcs2.8:1.5	Wed Sep  5 23:47:15 2001
+++ src/share/man/man8/compat_ibcs2.8	Mon Nov 21 14:27:41 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: compat_ibcs2.8,v 1.5 2001/09/05 23:47:15 wiz Exp $
+.\	$NetBSD: compat_ibcs2.8,v 1.6 2011/11/21 14:27:41 njoly Exp $
 .\
 .\ Copyright (c) 1998 Scott Bartram
 .\ Copyright (c) 1995 Frank van der Linden
@@ -56,7 +56,7 @@ iBCS2 supports COFF, ELF, and x.out (XEN
 Binaries from SCO OpenServer (version 5.x) are the only ELF binaries
 that have been tested.
 Most programs should work, but not ones that use or depend on:
-.sp
+.Pp
 .Bl -item -compact -offset indent
 .It
 kernel internal data structures
@@ -67,7 +67,7 @@ local X displays (uses a STREAMS pipe)
 .It
 virtual 8086 mode
 .El
-.sp
+.Pp
 The iBCS2 compatibility feature is active for kernels compiled with
 the
 .Dv COMPAT_IBCS2
@@ -122,28 +122,25 @@ will need to be root on your
 .Nx
 system to do the necessary
 installation steps).
-.Pp
 .Bl -tag -width COFF binaries
 .It COFF binaries
 You can simply copy all of the available shared libraries since they
 are fairly small in size. The COFF shared libraries are typically
 found in /shlib and can be obtained from the following sources:
-.sp
-.nf
+.Bd 

CVS commit: src/lib/libc/string

2011-11-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Nov 21 15:02:48 UTC 2011

Modified Files:
src/lib/libc/string: wcscspn.c wcspbrk.c wcsspn.c

Log Message:
Clean up a bit in preparation for more serious changes


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/string/wcscspn.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/string/wcspbrk.c \
src/lib/libc/string/wcsspn.c

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

Modified files:

Index: src/lib/libc/string/wcscspn.c
diff -u src/lib/libc/string/wcscspn.c:1.2 src/lib/libc/string/wcscspn.c:1.3
--- src/lib/libc/string/wcscspn.c:1.2	Wed Jan  3 14:29:36 2001
+++ src/lib/libc/string/wcscspn.c	Mon Nov 21 15:02:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: wcscspn.c,v 1.2 2001/01/03 14:29:36 lukem Exp $	*/
+/*	$NetBSD: wcscspn.c,v 1.3 2011/11/21 15:02:48 joerg Exp $	*/
 
 /*-
  * Copyright (c)1999 Citrus Project,
@@ -29,17 +29,13 @@
  */
 
 #include sys/cdefs.h
-#if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: wcscspn.c,v 1.2 2001/01/03 14:29:36 lukem Exp $);
-#endif /* LIBC_SCCS and not lint */
+__RCSID($NetBSD: wcscspn.c,v 1.3 2011/11/21 15:02:48 joerg Exp $);
 
 #include assert.h
 #include wchar.h
 
 size_t
-wcscspn(s, set)
-	const wchar_t *s;
-	const wchar_t *set;
+wcscspn(const wchar_t *s, const wchar_t *set)
 {
 	const wchar_t *p;
 	const wchar_t *q;
@@ -47,15 +43,11 @@ wcscspn(s, set)
 	_DIAGASSERT(s != NULL);
 	_DIAGASSERT(set != NULL);
 
-	p = s;
-	while (*p) {
-		q = set;
-		while (*q) {
+	for (p = s; *p; ++p) {
+		for (q = set; *q; ++q) {
 			if (*p == *q)
 goto done;
-			q++;
 		}
-		p++;
 	}
 
 done:

Index: src/lib/libc/string/wcspbrk.c
diff -u src/lib/libc/string/wcspbrk.c:1.3 src/lib/libc/string/wcspbrk.c:1.4
--- src/lib/libc/string/wcspbrk.c:1.3	Tue Nov 29 03:12:00 2005
+++ src/lib/libc/string/wcspbrk.c	Mon Nov 21 15:02:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: wcspbrk.c,v 1.3 2005/11/29 03:12:00 christos Exp $	*/
+/*	$NetBSD: wcspbrk.c,v 1.4 2011/11/21 15:02:48 joerg Exp $	*/
 
 /*-
  * Copyright (c)1999 Citrus Project,
@@ -29,17 +29,13 @@
  */
 
 #include sys/cdefs.h
-#if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: wcspbrk.c,v 1.3 2005/11/29 03:12:00 christos Exp $);
-#endif /* LIBC_SCCS and not lint */
+__RCSID($NetBSD: wcspbrk.c,v 1.4 2011/11/21 15:02:48 joerg Exp $);
 
 #include assert.h
 #include wchar.h
 
 wchar_t *
-wcspbrk(s, set)
-	const wchar_t *s;
-	const wchar_t *set;
+wcspbrk(const wchar_t *s, const wchar_t *set)
 {
 	const wchar_t *p;
 	const wchar_t *q;
@@ -47,15 +43,11 @@ wcspbrk(s, set)
 	_DIAGASSERT(s != NULL);
 	_DIAGASSERT(set != NULL);
 
-	p = s;
-	while (*p) {
-		q = set;
-		while (*q) {
+	for (p = s; *p; ++p) {
+		for (q = set; *q; ++q) {
 			if (*p == *q)
 return __UNCONST(p);
-			q++;
 		}
-		p++;
 	}
 	return NULL;
 }
Index: src/lib/libc/string/wcsspn.c
diff -u src/lib/libc/string/wcsspn.c:1.3 src/lib/libc/string/wcsspn.c:1.4
--- src/lib/libc/string/wcsspn.c:1.3	Fri Sep 21 16:09:15 2001
+++ src/lib/libc/string/wcsspn.c	Mon Nov 21 15:02:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: wcsspn.c,v 1.3 2001/09/21 16:09:15 yamt Exp $	*/
+/*	$NetBSD: wcsspn.c,v 1.4 2011/11/21 15:02:48 joerg Exp $	*/
 
 /*-
  * Copyright (c)1999,2001 Citrus Project,
@@ -29,17 +29,13 @@
  */
 
 #include sys/cdefs.h
-#if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: wcsspn.c,v 1.3 2001/09/21 16:09:15 yamt Exp $);
-#endif /* LIBC_SCCS and not lint */
+__RCSID($NetBSD: wcsspn.c,v 1.4 2011/11/21 15:02:48 joerg Exp $);
 
 #include assert.h
 #include wchar.h
 
 size_t
-wcsspn(s, set)
-	const wchar_t *s;
-	const wchar_t *set;
+wcsspn(const wchar_t *s, const wchar_t *set)
 {
 	const wchar_t *p;
 	const wchar_t *q;
@@ -47,19 +43,14 @@ wcsspn(s, set)
 	_DIAGASSERT(s != NULL);
 	_DIAGASSERT(set != NULL);
 
-	p = s;
-	while (*p) {
-		q = set;
-		while (*q) {
+	for (p = s; *p; ++p) {
+		for (q = set; *q; ++q) {
 			if (*p == *q)
 break;
-			q++;
 		}
 		if (!*q)
-			goto done;
-		p++;
+			break;
 	}
 
-done:
 	return (p - s);
 }



CVS commit: src/share/man/man8

2011-11-21 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Nov 21 15:11:45 UTC 2011

Modified Files:
src/share/man/man8: compat_freebsd.8 compat_ibcs2.8 compat_sunos.8
compat_svr4.8 compat_ultrix.8

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/share/man/man8/compat_freebsd.8
cvs rdiff -u -r1.6 -r1.7 src/share/man/man8/compat_ibcs2.8
cvs rdiff -u -r1.19 -r1.20 src/share/man/man8/compat_sunos.8 \
src/share/man/man8/compat_ultrix.8
cvs rdiff -u -r1.25 -r1.26 src/share/man/man8/compat_svr4.8

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/man8/compat_freebsd.8
diff -u src/share/man/man8/compat_freebsd.8:1.14 src/share/man/man8/compat_freebsd.8:1.15
--- src/share/man/man8/compat_freebsd.8:1.14	Mon Nov 21 14:27:41 2011
+++ src/share/man/man8/compat_freebsd.8	Mon Nov 21 15:11:45 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: compat_freebsd.8,v 1.14 2011/11/21 14:27:41 njoly Exp $
+.\	$NetBSD: compat_freebsd.8,v 1.15 2011/11/21 15:11:45 wiz Exp $
 .\	from: compat_linux.8,v 1.1 1995/03/05 23:30:36 fvdl Exp
 .\
 .\ Copyright (c) 1995 Frank van der Linden
@@ -52,18 +52,19 @@ with the
 .Dv COMPAT_FREEBSD
 option enabled.
 .Pp
-A lot of programs are dynamically linked. This means, that you will
-also need the
+A lot of programs are dynamically linked.
+This means, that you will also need the
 .Fx
 shared libraries that the program depends on, and the runtime
-linker.  Also, you will need to create a
+linker.
+Also, you will need to create a
 .Dq shadow root
 directory for
 .Fx
 binaries on your
 .Nx
-system. This directory
-is named
+system.
+This directory is named
 .Pa /emul/freebsd .
 Any file operations done by
 .Fx
@@ -88,8 +89,8 @@ packages that include configuration file
 .Pa /emul/freebsd ,
 to avoid naming conflicts with possible
 .Nx
-counterparts. Shared
-libraries should also be installed in the shadow tree.
+counterparts.
+Shared libraries should also be installed in the shadow tree.
 .Pp
 Generally, you will need to look for the shared libraries that
 .Fx
@@ -97,7 +98,8 @@ binaries depend on only the first few ti
 .Fx
 program on your
 .Nx
-system. After a while, you will have a sufficient set of
+system.
+After a while, you will have a sufficient set of
 .Fx
 shared libraries on your system to be able to run newly imported
 .Fx
@@ -209,10 +211,11 @@ tree):
 .It
 You don't have access to a
 .Fx
-system. In that case, you
-should get the extra files you need from various ftp sites.
+system.
+In that case, you should get the extra files you need from various ftp sites.
 Information on where to look for the various files is appended
-below. For now, let's assume you know where to get the files.
+below.
+For now, let's assume you know where to get the files.
 .Pp
 Retrieve the following files (from _one_ ftp site to avoid
 any version mismatches), and install them under
@@ -237,8 +240,8 @@ and
 .Ic ldd
 don't necessarily need to be under
 .Pa /emul/freebsd ,
-you can install them elsewhere in the system too. Just make sure
-they don't conflict with their
+you can install them elsewhere in the system too.
+Just make sure they don't conflict with their
 .Nx
 counterparts.
 A good idea would be to install them in
@@ -290,7 +293,8 @@ binaries which only need a shared libc.
 You can test this by running the
 .Fx
 .Ic ldd
-on itself.  Suppose that you have it installed as
+on itself.
+Suppose that you have it installed as
 .Ic ldd-freebsd ,
 it should produce something like:
 .Bd -literal -offset indent
@@ -342,7 +346,8 @@ For example,
 X server software needs
 .Fx
 .Pa /dev/ttyv0
-for ioctls.  In this case, create a symbolic link from
+for ioctls.
+In this case, create a symbolic link from
 .Pa /emul/freebsd/dev/ttyv0
 to a
 .Xr wscons 4
@@ -386,7 +391,8 @@ This distribution consists of a number o
 Normally, they're controlled by an install program, but you can
 retrieve files
 .Dq by hand
-too.  The way to look something up is to retrieve all the files in the
+too.
+The way to look something up is to retrieve all the files in the
 distribution, and ``tar ztvf'' through them for the file you need.
 Here is an example of a list of files that you might need.
 .Bd -literal -offset indent

Index: src/share/man/man8/compat_ibcs2.8
diff -u src/share/man/man8/compat_ibcs2.8:1.6 src/share/man/man8/compat_ibcs2.8:1.7
--- src/share/man/man8/compat_ibcs2.8:1.6	Mon Nov 21 14:27:41 2011
+++ src/share/man/man8/compat_ibcs2.8	Mon Nov 21 15:11:45 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: compat_ibcs2.8,v 1.6 2011/11/21 14:27:41 njoly Exp $
+.\	$NetBSD: compat_ibcs2.8,v 1.7 2011/11/21 15:11:45 wiz Exp $
 .\
 .\ Copyright (c) 1998 Scott Bartram
 .\ Copyright (c) 1995 Frank van der Linden
@@ -71,15 +71,17 @@ virtual 8086 mode
 The iBCS2 compatibility feature is active for kernels compiled with
 the
 .Dv COMPAT_IBCS2
-option enabled.  If support for iBCS2 ELF 

CVS commit: src/lib/libc/arch/vax

2011-11-21 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Mon Nov 21 16:17:48 UTC 2011

Modified Files:
src/lib/libc/arch/vax/gen: alloca.S
src/lib/libc/arch/vax/sys: __vfork14.S getcontext.S

Log Message:
gcc 4.5 on vax creates PLT stubs with an entry mask of 0xffc
rather than 0 like gcc 4.1 did, so the sneaky assembly functions
that ret without really returning now clobber their registers.
adjust these functions to avoid this problem.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/vax/gen/alloca.S
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/vax/sys/__vfork14.S
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/vax/sys/getcontext.S

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

Modified files:

Index: src/lib/libc/arch/vax/gen/alloca.S
diff -u src/lib/libc/arch/vax/gen/alloca.S:1.4 src/lib/libc/arch/vax/gen/alloca.S:1.5
--- src/lib/libc/arch/vax/gen/alloca.S:1.4	Tue Jan 25 02:38:15 2011
+++ src/lib/libc/arch/vax/gen/alloca.S	Mon Nov 21 16:17:48 2011
@@ -31,17 +31,17 @@
 
 #if defined(LIBC_SCCS)  !defined(lint)
 	/* .asciz @(#)alloca.s	8.1 (Berkeley) 6/4/93 */
-RCSID($NetBSD: alloca.S,v 1.4 2011/01/25 02:38:15 matt Exp $)
+RCSID($NetBSD: alloca.S,v 1.5 2011/11/21 16:17:48 chs Exp $)
 #endif /* LIBC_SCCS and not lint */
 
 ENTRY(alloca, 0)
 	movl	4(%ap),%r0	# get allocation size
-	movl	16(%fp),%r2	# save return address before we smash it
+	movl	16(%fp),%r1	# save return address before we smash it
 	movab	here,16(%fp)
 	ret
 here:
 	subl2	%r0,%sp		# create stack space
 	bicl2	$3,%sp		# align to longword boundary
 	movl	%sp,%r0
-	jmp	(%r2)
+	jmp	(%r1)
 END(alloca)

Index: src/lib/libc/arch/vax/sys/__vfork14.S
diff -u src/lib/libc/arch/vax/sys/__vfork14.S:1.6 src/lib/libc/arch/vax/sys/__vfork14.S:1.7
--- src/lib/libc/arch/vax/sys/__vfork14.S:1.6	Tue Jan 25 02:38:15 2011
+++ src/lib/libc/arch/vax/sys/__vfork14.S	Mon Nov 21 16:17:48 2011
@@ -31,7 +31,7 @@
 
 #if defined(SYSLIBC_SCCS)  !defined(lint)
 	/* .asciz @(#)Ovfork.s	8.1 (Berkeley) 6/4/93 */
-RCSID($NetBSD: __vfork14.S,v 1.6 2011/01/25 02:38:15 matt Exp $)
+RCSID($NetBSD: __vfork14.S,v 1.7 2011/11/21 16:17:48 chs Exp $)
 #endif /* SYSLIBC_SCCS and not lint */
 
 /*
@@ -51,10 +51,11 @@ RCSID($NetBSD: __vfork14.S,v 1.6 2011/0
  */
 
 ENTRY(__vfork14, 0)
-	movl	16(%fp),%r2	# save return address before we smash it
+	movl	16(%fp),%r0	# save return address before we smash it
 	movab	here,16(%fp)
 	ret
 here:
+	movl	%r0,%r2
 	chmk	$ SYS___vfork14
 	bcs	err		# if failed, set errno and return -1
 	/* this next trick is Chris Torek's fault */

Index: src/lib/libc/arch/vax/sys/getcontext.S
diff -u src/lib/libc/arch/vax/sys/getcontext.S:1.5 src/lib/libc/arch/vax/sys/getcontext.S:1.6
--- src/lib/libc/arch/vax/sys/getcontext.S:1.5	Tue Jan 25 02:38:15 2011
+++ src/lib/libc/arch/vax/sys/getcontext.S	Mon Nov 21 16:17:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: getcontext.S,v 1.5 2011/01/25 02:38:15 matt Exp $	*/
+/*	$NetBSD: getcontext.S,v 1.6 2011/11/21 16:17:48 chs Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include SYS.h
 
 #ifdef SYSLIBC_SCCS
-RCSID($NetBSD: getcontext.S,v 1.5 2011/01/25 02:38:15 matt Exp $)
+RCSID($NetBSD: getcontext.S,v 1.6 2011/11/21 16:17:48 chs Exp $)
 #endif
 
 #ifdef WEAK_ALIAS
@@ -48,8 +48,8 @@ ENTRY(_getcontext, 0)
 	jcc	1f
 	jmp	CERROR+2		/* badness happened */
 
-1:	movl	4(%ap),%r2		/* ptr to ucontext */
-	movl	16(%fp),%r3		/* PC to return to */
+1:	movl	4(%ap),%r0		/* ptr to ucontext */
+	movl	16(%fp),%r1		/* PC to return to */
 	movab	2f,16(%fp)		/* let's return early */
 	ret
 	/*
@@ -59,8 +59,9 @@ ENTRY(_getcontext, 0)
 	 * the callers state but we still have control.
 	 */
 	_ALIGN_TEXT
-2:	movq	%ap,(36+12*4)(%r2)	/* adjust AP + SP */
-	movl	%fp,(36+14*4)(%r2)	/* adjust FP */
-	movl	%r3,(36+15*4)(%r2)	/* adjust PC */
-	jmp	(%r3)			/* and return */
+2:	movq	%ap,(36+12*4)(%r0)	/* adjust AP + SP */
+	movl	%fp,(36+14*4)(%r0)	/* adjust FP */
+	movl	%r3,(36+15*4)(%r0)	/* adjust PC */
+	clrl	%r0
+	jmp	(%r1)			/* and return */
 END(_getcontext)



CVS commit: src/external/cddl/osnet

2011-11-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 21 17:51:04 UTC 2011

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: spa_config.c
src/external/cddl/osnet/sys/sys: zfs_context.h

Log Message:
make this compile again. VOP_CLOSE is really vn_close() through macros.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c
cvs rdiff -u -r1.11 -r1.12 src/external/cddl/osnet/sys/sys/zfs_context.h

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

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c:1.5 src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c:1.6
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c:1.5	Sun Nov 20 19:24:24 2011
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c	Mon Nov 21 12:51:03 2011
@@ -179,7 +179,7 @@ spa_config_write(spa_config_dirent_t *dp
 		VOP_FSYNC(vp, FSYNC, kcred, NULL) == 0) {
 			(void) vn_rename(temp, dp-scd_path, UIO_SYSSPACE);
 		}
-		vn_close(vp, FWRITE, kcred);
+		(void) VOP_CLOSE(vp, oflags, 1, 0, kcred, NULL);
 	}
 
 	(void) vn_remove(temp, UIO_SYSSPACE, RMFILE);

Index: src/external/cddl/osnet/sys/sys/zfs_context.h
diff -u src/external/cddl/osnet/sys/sys/zfs_context.h:1.11 src/external/cddl/osnet/sys/sys/zfs_context.h:1.12
--- src/external/cddl/osnet/sys/sys/zfs_context.h:1.11	Mon Nov 21 00:50:11 2011
+++ src/external/cddl/osnet/sys/sys/zfs_context.h	Mon Nov 21 12:51:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: zfs_context.h,v 1.11 2011/11/21 05:50:11 christos Exp $	*/
+/*	$NetBSD: zfs_context.h,v 1.12 2011/11/21 17:51:03 christos Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -380,7 +380,7 @@ extern int vn_openat(char *path, int x1,
 int x2, int x3, vnode_t *vp, int unk);
 extern int vn_rdwr(int uio, vnode_t *vp, void *addr, ssize_t len,
 offset_t offset, int x1, int x2, rlim64_t x3, void *x4, ssize_t *residp);
-extern void vn_close(vnode_t *vp, int flags, kauth_cred_t cred);
+extern void vn_close(vnode_t *vp);
 extern int vn_getattr(vnode_t *vp, vattr_t *va);
 
 #define	vn_remove(path, x1, x2)		remove(path)



CVS commit: src/sys/fs/union

2011-11-21 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Nov 21 18:29:23 UTC 2011

Modified Files:
src/sys/fs/union: union.h union_subr.c union_vfsops.c union_vnops.c

Log Message:
Replace flag based union node locking with generic vnode lock, support
shared and nowait locks and protect un_uppervp and un_*sz with mutex.

Mark file system MPSAFE.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/fs/union/union.h
cvs rdiff -u -r1.52 -r1.53 src/sys/fs/union/union_subr.c
cvs rdiff -u -r1.64 -r1.65 src/sys/fs/union/union_vfsops.c
cvs rdiff -u -r1.48 -r1.49 src/sys/fs/union/union_vnops.c

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

Modified files:

Index: src/sys/fs/union/union.h
diff -u src/sys/fs/union/union.h:1.21 src/sys/fs/union/union.h:1.22
--- src/sys/fs/union/union.h:1.21	Tue Aug 23 07:39:37 2011
+++ src/sys/fs/union/union.h	Mon Nov 21 18:29:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: union.h,v 1.21 2011/08/23 07:39:37 hannken Exp $	*/
+/*	$NetBSD: union.h,v 1.22 2011/11/21 18:29:22 hannken Exp $	*/
 
 /*
  * Copyright (c) 1994 The Regents of the University of California.
@@ -105,28 +105,36 @@ struct union_mount {
 #define	UN_FILEMODE	(S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
 
 /*
- * A cache of vnode references
+ * A cache of vnode references.
+ * Lock requirements are:
+ *
+ *	:	stable
+ *	c	unheadlock[hash]
+ *	l	un_lock
+ *	m	un_lock or vnode lock to read, un_lock and
+ *			exclusive vnode lock to write
+ *	v	vnode lock to read, exclusive vnode lock to write
+ *
+ * Lock order is vnode then un_lock.
  */
 struct union_node {
-	LIST_ENTRY(union_node)	un_cache;	/* Hash chain */
-	struct vnode		*un_vnode;	/* Back pointer */
-	struct vnode	*un_uppervp;	/* overlaying object */
-	struct vnode	*un_lowervp;	/* underlying object */
-	struct vnode		*un_dirvp;	/* Parent dir of uppervp */
-	struct vnode		*un_pvp;	/* Parent vnode */
-	char			*un_path;	/* saved component name */
-	int			un_hash;	/* saved un_path hash value */
-	int			un_openl;	/* # of opens on lowervp */
-	unsigned int		un_flags;
-	struct vnode		**un_dircache;	/* cached union stack */
-	off_t			un_uppersz;	/* size of upper object */
-	off_t			un_lowersz;	/* size of lower object */
-	lwp_t			*un_lwp;		/* DIAGNOSTIC only */
+	kmutex_t		un_lock;
+	LIST_ENTRY(union_node)	un_cache;	/* c: Hash chain */
+	struct vnode		*un_vnode;	/* :: Back pointer */
+	struct vnode	*un_uppervp;	/* m: overlaying object */
+	struct vnode	*un_lowervp;	/* v: underlying object */
+	struct vnode		*un_dirvp;	/* v: Parent dir of uppervp */
+	struct vnode		*un_pvp;	/* v: Parent vnode */
+	char			*un_path;	/* v: saved component name */
+	int			un_hash;	/* v: saved un_path hash */
+	int			un_openl;	/* v: # of opens on lowervp */
+	unsigned int		un_flags;	/* v: node flags */
+	unsigned int		un_cflags;	/* c: cache flags */
+	struct vnode		**un_dircache;	/* v: cached union stack */
+	off_t			un_uppersz;	/* l: size of upper object */
+	off_t			un_lowersz;	/* l: size of lower object */
 };
 
-#define UN_WANTED	0x01
-#define UN_LOCKED	0x02
-#define UN_ULOCK	0x04		/* Upper node is locked */
 #define UN_KLOCK	0x08		/* Keep upper node locked on vput */
 #define UN_CACHED	0x10		/* In union cache */
 
@@ -162,6 +170,7 @@ int union_readdirhook(struct vnode **, s
 #define	LOWERVP(vp) (VTOUNION(vp)-un_lowervp)
 #define	UPPERVP(vp) (VTOUNION(vp)-un_uppervp)
 #define OTHERVP(vp) (UPPERVP(vp) ? UPPERVP(vp) : LOWERVP(vp))
+#define LOCKVP(vp) (UPPERVP(vp) ? UPPERVP(vp) : (vp))
 
 extern int (**union_vnodeop_p)(void *);
 

Index: src/sys/fs/union/union_subr.c
diff -u src/sys/fs/union/union_subr.c:1.52 src/sys/fs/union/union_subr.c:1.53
--- src/sys/fs/union/union_subr.c:1.52	Mon Nov 14 18:38:13 2011
+++ src/sys/fs/union/union_subr.c	Mon Nov 21 18:29:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_subr.c,v 1.52 2011/11/14 18:38:13 hannken Exp $	*/
+/*	$NetBSD: union_subr.c,v 1.53 2011/11/21 18:29:22 hannken Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -72,7 +72,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: union_subr.c,v 1.52 2011/11/14 18:38:13 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: union_subr.c,v 1.53 2011/11/21 18:29:22 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -93,6 +93,7 @@ __KERNEL_RCSID(0, $NetBSD: union_subr.c
 #include uvm/uvm_extern.h
 
 #include fs/union/union.h
+#include miscfs/genfs/genfs.h
 #include miscfs/specfs/specdev.h
 
 /* must be power of two, otherwise change UNION_HASH() */
@@ -145,7 +146,9 @@ union_updatevp(struct union_node *un, st
 	int nhash = UNION_HASH(uppervp, lowervp);
 	int docache = (lowervp != NULLVP || uppervp != NULLVP);
 	int lhash, uhash;
+	bool un_unlock;
 
+	KASSERT(VOP_ISLOCKED(UNIONTOV(un)) == LK_EXCLUSIVE);
 	/*
 	 * Ensure locking is ordered from lower to higher
 	 * to avoid deadlocks.
@@ -164,8 +167,8 @@ union_updatevp(struct union_node *un, st
 	mutex_enter(unheadlock[uhash]);
 
 	if 

CVS commit: src/etc

2011-11-21 Thread D'Arcy J.M. Cain
Module Name:src
Committed By:   darcy
Date:   Mon Nov 21 20:56:21 UTC 2011

Modified Files:
src/etc/defaults: rc.conf
src/etc/rc.d: pf

Log Message:
Allow pf flags to be specified in rc.conf.
Add default to defaults/rc.d as suggested by lukem@


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/etc/defaults/rc.conf
cvs rdiff -u -r1.9 -r1.10 src/etc/rc.d/pf

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

Modified files:

Index: src/etc/defaults/rc.conf
diff -u src/etc/defaults/rc.conf:1.115 src/etc/defaults/rc.conf:1.116
--- src/etc/defaults/rc.conf:1.115	Tue Sep  6 21:32:29 2011
+++ src/etc/defaults/rc.conf	Mon Nov 21 20:56:21 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: rc.conf,v 1.115 2011/09/06 21:32:29 riz Exp $
+#	$NetBSD: rc.conf,v 1.116 2011/11/21 20:56:21 darcy Exp $
 #
 # /etc/defaults/rc.conf --
 #	default configuration of /etc/rc.conf
@@ -167,7 +167,7 @@ ipnat=NO	# uses /etc/ipnat.conf
 ipfs=NO			ipfs_flags=		# save/load ipnat and ipf states
 ipsec=NO	# uses /etc/ipsec.conf
 ipmon=NO		ipmon_flags=-Dns	# syslog ipfilter messages
-pf=NO			pf_rules=/etc/pf.conf
+pf=NO			pf_rules=/etc/pf.conf pf_flags=
 pflogd=NO
 ftp_proxy=NO
 racoon=NO	# IKE daemon

Index: src/etc/rc.d/pf
diff -u src/etc/rc.d/pf:1.9 src/etc/rc.d/pf:1.10
--- src/etc/rc.d/pf:1.9	Sat Nov 22 20:23:33 2008
+++ src/etc/rc.d/pf	Mon Nov 21 20:56:21 2011
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: pf,v 1.9 2008/11/22 20:23:33 tsutsui Exp $
+# $NetBSD: pf,v 1.10 2011/11/21 20:56:21 darcy Exp $
 #
 
 # PROVIDE: pf
@@ -35,11 +35,11 @@ pf_start()
 
 	# The pf_boot script has enabled pf already.
 	if [ $autoboot != yes ]; then
-		/sbin/pfctl -q -e 
+		/sbin/pfctl -q ${pf_flags} -e 
 	fi
 
 	if [ -f ${pf_rules} ]; then
-		/sbin/pfctl -q -f ${pf_rules}
+		/sbin/pfctl -q ${pf_flags} -f ${pf_rules}
 	else
 		warn ${pf_rules} not found; no pf rules loaded.
 	fi
@@ -48,14 +48,14 @@ pf_start()
 pf_stop()
 {
 	echo Disabling pf firewall.
-	/sbin/pfctl -q -Fa -d
+	/sbin/pfctl -q ${pf_flags} -Fa -d
 }
 
 pf_reload()
 {
 	echo Reloading pf rules.
 	if [ -f ${pf_rules} ]; then
-		/sbin/pfctl -q -f ${pf_rules}
+		/sbin/pfctl -q ${pf_flags} -f ${pf_rules}
 	else
 		warn ${pf_rules} not found; no pf rules loaded.
 	fi
@@ -63,7 +63,7 @@ pf_reload()
 
 pf_status()
 {
-	/sbin/pfctl -s info
+	/sbin/pfctl ${pf_flags} -s info
 }
 
 load_rc_config $name



CVS commit: src/sys/compat/linux/arch/alpha

2011-11-21 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Nov 21 22:00:43 UTC 2011

Modified Files:
src/sys/compat/linux/arch/alpha: linux_machdep.h

Log Message:
Adjust setup_linux_rt_sigframe/setup_linux_sigframe prototypes.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/compat/linux/arch/alpha/linux_machdep.h

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

Modified files:

Index: src/sys/compat/linux/arch/alpha/linux_machdep.h
diff -u src/sys/compat/linux/arch/alpha/linux_machdep.h:1.11 src/sys/compat/linux/arch/alpha/linux_machdep.h:1.12
--- src/sys/compat/linux/arch/alpha/linux_machdep.h:1.11	Mon Apr 28 20:23:42 2008
+++ src/sys/compat/linux/arch/alpha/linux_machdep.h	Mon Nov 21 22:00:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_machdep.h,v 1.11 2008/04/28 20:23:42 martin Exp $	*/
+/*	$NetBSD: linux_machdep.h,v 1.12 2011/11/21 22:00:42 njoly Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -92,10 +92,12 @@ struct linux_rt_sigframe {
 
 #ifdef _KERNEL
 __BEGIN_DECLS
-void setup_linux_rt_sigframe(struct trapframe *, int, const sigset_t *);
-void setup_linux_sigframe(struct trapframe *, int, const sigset_t *);
+void setup_linux_rt_sigframe(struct trapframe *, const ksiginfo_t *,
+const sigset_t *);
+void setup_linux_sigframe(struct trapframe *, const ksiginfo_t *,
+const sigset_t *);
 int linux_restore_sigcontext(struct lwp *, struct linux_sigcontext,
-  sigset_t *);
+sigset_t *);
 void linux_syscall_intern(struct proc *);
 __END_DECLS
 #endif /* !_KERNEL */



CVS commit: src/sys/crypto/nist_ctr_drbg

2011-11-21 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Mon Nov 21 23:48:52 UTC 2011

Modified Files:
src/sys/crypto/nist_ctr_drbg: nist_ctr_drbg.h

Log Message:
NIST_CTR_DRBG.V is accessed as (unsigned long *) so we need to make sure
it's aligned accordingly or we go boom on sparc64


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/crypto/nist_ctr_drbg/nist_ctr_drbg.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/crypto/nist_ctr_drbg/nist_ctr_drbg.h
diff -u src/sys/crypto/nist_ctr_drbg/nist_ctr_drbg.h:1.1 src/sys/crypto/nist_ctr_drbg/nist_ctr_drbg.h:1.2
--- src/sys/crypto/nist_ctr_drbg/nist_ctr_drbg.h:1.1	Sat Nov 19 22:51:22 2011
+++ src/sys/crypto/nist_ctr_drbg/nist_ctr_drbg.h	Mon Nov 21 23:48:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: nist_ctr_drbg.h,v 1.1 2011/11/19 22:51:22 tls Exp $ */
+/*	$NetBSD: nist_ctr_drbg.h,v 1.2 2011/11/21 23:48:52 macallan Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
 typedef struct {
 	unsigned int reseed_counter;
 	NIST_Key ctx;
-	unsigned int V[NIST_BLOCK_OUTLEN_INTS];
+	unsigned int V[NIST_BLOCK_OUTLEN_INTS] __attribute__ ((aligned(8)));
 } NIST_CTR_DRBG;
 
 int nist_ctr_initialize(void);



CVS commit: src

2011-11-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Nov 21 23:50:45 UTC 2011

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/lib/libc/locale: Makefile
src/tests/lib/libc/string: Makefile
Added Files:
src/tests/lib/libc/locale: t_wcscspn.c t_wcspbrk.c t_wcsspn.c
src/tests/lib/libc/string: t_strcspn.c t_strpbrk.c t_strspn.c

Log Message:
Add test cases for strcspn, strpbrk, strspn, wcscspn, wcspbrk and
wcsspn.


To generate a diff of this commit:
cvs rdiff -u -r1.424 -r1.425 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/locale/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/locale/t_wcscspn.c \
src/tests/lib/libc/locale/t_wcspbrk.c \
src/tests/lib/libc/locale/t_wcsspn.c
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/string/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/string/t_strcspn.c \
src/tests/lib/libc/string/t_strpbrk.c \
src/tests/lib/libc/string/t_strspn.c

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.424 src/distrib/sets/lists/tests/mi:1.425
--- src/distrib/sets/lists/tests/mi:1.424	Thu Nov 17 01:22:30 2011
+++ src/distrib/sets/lists/tests/mi	Mon Nov 21 23:50:44 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.424 2011/11/17 01:22:30 christos Exp $
+# $NetBSD: mi,v 1.425 2011/11/21 23:50:44 joerg Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -407,6 +407,9 @@
 ./usr/libdata/debug/usr/tests/lib/libc/locale/t_mbrtowc.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/locale/t_mbstowcs.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/locale/t_mbtowc.debug		tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/locale/t_wcscspn.debug		tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/locale/t_wcspbrk.debug		tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/locale/t_wcsspn.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/locale/t_wcstod.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/locale/t_wctomb.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/inettests-lib-debug
@@ -483,11 +486,14 @@
 ./usr/libdata/debug/usr/tests/lib/libc/string/t_strchr.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/string/t_strcmp.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/string/t_strcpy.debug		tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/string/t_strcspn.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/string/t_strerror.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/string/t_stresep.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/string/t_string.debug		tests-obsolete		obsolete
 ./usr/libdata/debug/usr/tests/lib/libc/string/t_strlen.debug		tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/string/t_strpbrk.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/string/t_strrchr.debug		tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/string/t_strspn.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/string/t_swab.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/systests-lib-debug
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_access.debug		tests-lib-debug		debug,atf
@@ -1997,6 +2003,9 @@
 ./usr/tests/lib/libc/locale/t_mbrtowc		tests-lib-tests		atf
 ./usr/tests/lib/libc/locale/t_mbstowcs		tests-lib-tests		atf
 ./usr/tests/lib/libc/locale/t_mbtowc		tests-lib-tests		atf
+./usr/tests/lib/libc/locale/t_wcscspn		tests-lib-tests		atf
+./usr/tests/lib/libc/locale/t_wcspbrk		tests-lib-tests		atf
+./usr/tests/lib/libc/locale/t_wcsspn		tests-lib-tests		atf
 ./usr/tests/lib/libc/locale/t_wcstod		tests-lib-tests		atf
 ./usr/tests/lib/libc/locale/t_wctomb		tests-lib-tests		atf
 ./usr/tests/lib/libc/inet			tests-lib-tests
@@ -2134,11 +2143,14 @@
 ./usr/tests/lib/libc/string/t_strchr		tests-lib-tests		atf
 ./usr/tests/lib/libc/string/t_strcmp		tests-lib-tests		atf
 ./usr/tests/lib/libc/string/t_strcpy		tests-lib-tests		atf
+./usr/tests/lib/libc/string/t_strcspn		tests-lib-tests		atf
 ./usr/tests/lib/libc/string/t_strerror		tests-lib-tests		atf
 ./usr/tests/lib/libc/string/t_stresep		tests-lib-tests		atf
 ./usr/tests/lib/libc/string/t_string		tests-obsolete		obsolete
 ./usr/tests/lib/libc/string/t_strlen		tests-lib-tests		atf
+./usr/tests/lib/libc/string/t_strpbrk		tests-lib-tests		atf
 ./usr/tests/lib/libc/string/t_strrchr		tests-lib-tests		atf
+./usr/tests/lib/libc/string/t_strspn		tests-lib-tests		atf
 ./usr/tests/lib/libc/string/t_swab		tests-lib-tests		atf
 ./usr/tests/lib/libc/sys			tests-lib-tests
 

CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Nov 22 00:19:30 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
I tested autri


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.20 -r1.1.2.21 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.20 src/sys/dev/TODO.audiomp:1.1.2.21
--- src/sys/dev/TODO.audiomp:1.1.2.20	Mon Nov 21 21:39:44 2011
+++ src/sys/dev/TODO.audiomp	Tue Nov 22 00:19:30 2011
@@ -34,7 +34,7 @@ dev/pad/pad.c			done
 dev/pci/auacer.c		done
 dev/pci/auich.c			done		port-amd64
 dev/pci/auixp.c			done
-dev/pci/autri.c			done
+dev/pci/autri.c			done		port-sparc64
 dev/pci/auvia.c			done
 dev/pci/azalia.c		done		port-i386
 dev/pci/cmpci.c			done



CVS commit: src/lib/libc/string

2011-11-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Nov 22 00:37:10 UTC 2011

Modified Files:
src/lib/libc/string: strpbrk.c

Log Message:
Handle simple cases (strlen(charset) = 1) more efficiently.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/string/strpbrk.c

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

Modified files:

Index: src/lib/libc/string/strpbrk.c
diff -u src/lib/libc/string/strpbrk.c:1.19 src/lib/libc/string/strpbrk.c:1.20
--- src/lib/libc/string/strpbrk.c:1.19	Wed Sep 24 16:58:53 2008
+++ src/lib/libc/string/strpbrk.c	Tue Nov 22 00:37:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: strpbrk.c,v 1.19 2008/09/24 16:58:53 christos Exp $	*/
+/*	$NetBSD: strpbrk.c,v 1.20 2011/11/22 00:37:09 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2008 Joerg Sonnenberger
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: strpbrk.c,v 1.19 2008/09/24 16:58:53 christos Exp $);
+__RCSID($NetBSD: strpbrk.c,v 1.20 2011/11/22 00:37:09 joerg Exp $);
 
 #include assert.h
 #include inttypes.h
@@ -60,6 +60,11 @@ strpbrk(const char *s, const char *chars
 	_DIAGASSERT(s != NULL);
 	_DIAGASSERT(charset != NULL);
 
+	if (charset[0] == '\0')
+		return NULL;
+	if (charset[1] == '\0')
+		return strchr(s, charset[0]);
+
 	for (; *charset != '\0'; ++charset)
 		ADD_TO_SET(UC(*charset));
 



CVS commit: [jmcneill-audiomp3] src/sys/arch/macppc/dev

2011-11-21 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Nov 22 00:48:49 UTC 2011

Modified Files:
src/sys/arch/macppc/dev [jmcneill-audiomp3]: awacs.c

Log Message:
adapt to jmcneill-audiomp3
from mrg@, minor fixes and testing by me


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.40.6.1 src/sys/arch/macppc/dev/awacs.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/macppc/dev/awacs.c
diff -u src/sys/arch/macppc/dev/awacs.c:1.40 src/sys/arch/macppc/dev/awacs.c:1.40.6.1
--- src/sys/arch/macppc/dev/awacs.c:1.40	Sun Feb 20 07:40:24 2011
+++ src/sys/arch/macppc/dev/awacs.c	Tue Nov 22 00:48:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: awacs.c,v 1.40 2011/02/20 07:40:24 macallan Exp $	*/
+/*	$NetBSD: awacs.c,v 1.40.6.1 2011/11/22 00:48:48 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -27,15 +27,16 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: awacs.c,v 1.40 2011/02/20 07:40:24 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: awacs.c,v 1.40.6.1 2011/11/22 00:48:48 macallan Exp $);
 
 #include sys/param.h
 #include sys/audioio.h
 #include sys/device.h
-#include sys/malloc.h
 #include sys/systm.h
 #include sys/kthread.h
 #include sys/kernel.h
+#include sys/mutex.h
+#include sys/condvar.h
 
 #include dev/auconv.h
 #include dev/audio_if.h
@@ -85,7 +86,7 @@ struct awacs_softc {
 	int vol_l, vol_r;
 	int sc_bass, sc_treble;
 	lwp_t *sc_thread;
-	int sc_event;
+	kcondvar_t sc_event;
 	int sc_output_wanted;
 	int sc_need_parallel_output;
 #if NSGSMIX  0
@@ -108,6 +109,9 @@ struct awacs_softc {
 
 #define AWACS_NFORMATS	2
 	struct audio_format sc_formats[AWACS_NFORMATS];
+
+	kmutex_t sc_lock;
+	kmutex_t sc_intr_lock;
 };
 
 static int awacs_match(device_t, struct cfdata *, void *);
@@ -134,6 +138,7 @@ static int awacs_query_devinfo(void *, m
 static size_t awacs_round_buffersize(void *, int, size_t);
 static paddr_t awacs_mappage(void *, void *, off_t, int);
 static int awacs_get_props(void *);
+static void awacs_get_locks(void *, kmutex_t **, kmutex_t **);
 
 static inline u_int awacs_read_reg(struct awacs_softc *, int);
 static inline void awacs_write_reg(struct awacs_softc *, int, int);
@@ -185,6 +190,8 @@ const struct audio_hw_if awacs_hw_if = {
 	awacs_trigger_output,
 	awacs_trigger_input,
 	NULL,
+	NULL,
+	awacs_get_locks,
 };
 
 struct audio_device awacs_device = {
@@ -374,8 +381,13 @@ awacs_attach(device_t parent, device_t s
 	}
 
 	intr_establish(cirq, cirq_type, IPL_BIO, awacs_status_intr, sc);
-	intr_establish(oirq, oirq_type, IPL_AUDIO, awacs_intr, sc);
-	intr_establish(iirq, iirq_type, IPL_AUDIO, awacs_intr, sc);
+	intr_establish(oirq, oirq_type, IPL_SCHED, awacs_intr, sc);
+	intr_establish(iirq, iirq_type, IPL_SCHED, awacs_intr, sc);
+
+	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(sc-sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED);
+
+	cv_init(sc-sc_event, awacs_wait);
 
 	/* check if the chip is a screamer */
 	sc-sc_screamer = (of_compatible(ca-ca_node, screamer) != -1);
@@ -570,11 +582,13 @@ awacs_setup_sgsmix(device_t cookie)
 	sc-sc_codecctl1 = ~AWACS_MUTE_HEADPHONE;
 	awacs_write_codec(sc, sc-sc_codecctl1);
 
+	mutex_enter(sc-sc_intr_lock);
 	awacs_select_output(sc, sc-sc_output_mask);
 	awacs_set_volume(sc, sc-vol_l, sc-vol_r);
 	awacs_set_bass(sc, 128);
 	awacs_set_treble(sc, 128);
-	wakeup(sc-sc_event);	
+	cv_signal(sc-sc_event);	
+	mutex_exit(sc-sc_intr_lock);
 #endif
 	return 0;
 }
@@ -618,6 +632,7 @@ awacs_intr(void *v)
 	int status;
 
 	sc = v;
+	mutex_spin_enter(sc-sc_intr_lock);
 	cmd = sc-sc_odmacmd;
 	count = sc-sc_opages;
 	/* Fill used buffer(s). */
@@ -632,6 +647,7 @@ awacs_intr(void *v)
 		}
 		cmd++;
 	}
+	mutex_spin_exit(sc-sc_intr_lock);
 
 	return 1;
 }
@@ -838,11 +854,15 @@ awacs_set_port(void *h, mixer_ctrl_t *mc
 		/* No change necessary? */
 		if (mc-un.mask == sc-sc_output_mask)
 			return 0;
+		mutex_enter(sc-sc_intr_lock);
 		awacs_select_output(sc, mc-un.mask);
+		mutex_exit(sc-sc_intr_lock);
 		return 0;
 
 	case AWACS_VOL_MASTER:
+		mutex_enter(sc-sc_intr_lock);
 		awacs_set_volume(sc, l, r);
+		mutex_exit(sc-sc_intr_lock);
 		return 0;
 
 	case AWACS_INPUT_SELECT:
@@ -883,11 +903,15 @@ awacs_set_port(void *h, mixer_ctrl_t *mc
 
 #if NSGSMIX  0
 	case AWACS_BASS:
+		mutex_enter(sc-sc_intr_lock);
 		awacs_set_bass(sc, l);
+		mutex_exit(sc-sc_intr_lock);
 		return 0;
 
 	case AWACS_TREBLE:
+		mutex_enter(sc-sc_intr_lock);
 		awacs_set_treble(sc, l);
+		mutex_exit(sc-sc_intr_lock);
 		return 0;
 #endif
 	}
@@ -1142,6 +1166,15 @@ awacs_trigger_input(void *h, void *start
 	DPRINTF(awacs_trigger_input called\n);
 	return 1;
 }
+  
+static void
+awacs_get_locks(void *opaque, kmutex_t **intr, kmutex_t **thread)
+{
+	struct awacs_softc *sc = opaque;
+
+	*intr = sc-sc_intr_lock;
+	*thread = sc-sc_lock;
+}
 
 static void
 awacs_select_output(struct awacs_softc *sc, int mask)
@@ -1369,14 +1402,16 @@ 

CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Nov 22 00:49:38 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
awacs works now


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.21 -r1.1.2.22 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.21 src/sys/dev/TODO.audiomp:1.1.2.22
--- src/sys/dev/TODO.audiomp:1.1.2.21	Tue Nov 22 00:19:30 2011
+++ src/sys/dev/TODO.audiomp	Tue Nov 22 00:49:37 2011
@@ -8,7 +8,7 @@ arcm/arm/xscale/pxa2x0_ac97.c	done
 arch/dreamcast/dev/g2/aica.c	done
 arch/hp700/gsc/harmony.c	done
 arch/hpcmips/vr/vraiu.c		done
-arch/macppc/dev/awacs.c
+arch/macppc/dev/awacs.c		done		port-macppc
 arch/macppc/dev/snapper.c
 arch/prep/isa/paud_isa.c	done
 arch/sgimips/hpc/haltwo.c	done



CVS commit: [jmcneill-audiomp3] src/sys/dev/usb

2011-11-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Nov 22 02:39:59 UTC 2011

Modified Files:
src/sys/dev/usb [jmcneill-audiomp3]: uaudio.c

Log Message:
port to audiomp.  mostly from jared, tested and completed by me.

this one is a little more tricky.  besides the usual spl and get_locks
changes, we have to deal with the USB subsystem wanting to sleep and
expecting to be called with the kernel lock held.  so we always take
the kernel lock and drop the interrupt lock before calling into usbd.


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.120.10.1 src/sys/dev/usb/uaudio.c

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

Modified files:

Index: src/sys/dev/usb/uaudio.c
diff -u src/sys/dev/usb/uaudio.c:1.120 src/sys/dev/usb/uaudio.c:1.120.10.1
--- src/sys/dev/usb/uaudio.c:1.120	Tue Dec 28 20:11:18 2010
+++ src/sys/dev/usb/uaudio.c	Tue Nov 22 02:39:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uaudio.c,v 1.120 2010/12/28 20:11:18 jakllsch Exp $	*/
+/*	$NetBSD: uaudio.c,v 1.120.10.1 2011/11/22 02:39:59 mrg Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uaudio.c,v 1.120 2010/12/28 20:11:18 jakllsch Exp $);
+__KERNEL_RCSID(0, $NetBSD: uaudio.c,v 1.120.10.1 2011/11/22 02:39:59 mrg Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -155,8 +155,18 @@ struct chan {
 	struct uaudio_softc *sc; /* our softc */
 };
 
+/*
+ * XXX Locking notes:
+ *
+ *The MI USB audio subsystem is not MP-SAFE.  Our strategy here
+ *is to ensure we have the kernel lock held when calling into
+ *usbd, and, generally, to have dropped the sc_intr_lock during
+ *these sections as well since the usb code will sleep.
+ */
 struct uaudio_softc {
 	device_t	sc_dev;		/* base device */
+	kmutex_t	sc_lock;
+	kmutex_t	sc_intr_lock;
 	usbd_device_handle sc_udev;	/* USB device */
 	int		sc_ac_iface;	/* Audio Control interface */
 	usbd_interface_handle	sc_ac_ifaceh;
@@ -322,6 +332,7 @@ Static int	uaudio_mixer_set_port(void *,
 Static int	uaudio_mixer_get_port(void *, mixer_ctrl_t *);
 Static int	uaudio_query_devinfo(void *, mixer_devinfo_t *);
 Static int	uaudio_get_props(void *);
+Static void	uaudio_get_locks(void *, kmutex_t **, kmutex_t **);
 
 Static const struct audio_hw_if uaudio_hw_if = {
 	uaudio_open,
@@ -352,6 +363,7 @@ Static const struct audio_hw_if uaudio_h
 	uaudio_trigger_input,
 	NULL,
 	NULL,
+	uaudio_get_locks,
 };
 
 int uaudio_match(device_t, cfdata_t, void *);
@@ -393,6 +405,8 @@ uaudio_attach(device_t parent, device_t 
 
 	sc-sc_dev = self;
 	sc-sc_udev = uaa-device;
+	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(sc-sc_intr_lock, MUTEX_DEFAULT, IPL_USB);
 
 	strlcpy(sc-sc_adev.name, USB audio, sizeof(sc-sc_adev.name));
 	strlcpy(sc-sc_adev.version, , sizeof(sc-sc_adev.version));
@@ -519,6 +533,10 @@ uaudio_detach(device_t self, int flags)
 	if (sc-sc_formats != NULL)
 		free(sc-sc_formats, M_USBDEV);
 	auconv_delete_encodings(sc-sc_encodings);
+
+	mutex_destroy(sc-sc_lock);
+	mutex_destroy(sc-sc_intr_lock);
+
 	return rv;
 }
 
@@ -2173,10 +2191,12 @@ uaudio_close(void *addr)
 Static int
 uaudio_drain(void *addr)
 {
-	struct uaudio_softc *sc;
+	struct uaudio_softc *sc = addr;
 
-	sc = addr;
-	usbd_delay_ms(sc-sc_udev, UAUDIO_NCHANBUFS * UAUDIO_NFRAMES);
+	KASSERT(mutex_owned(sc-sc_intr_lock));
+
+	kpause(uaudiodr, false,
+	mstohz(UAUDIO_NCHANBUFS * UAUDIO_NFRAMES), sc-sc_intr_lock);
 
 	return 0;
 }
@@ -2184,32 +2204,42 @@ uaudio_drain(void *addr)
 Static int
 uaudio_halt_out_dma(void *addr)
 {
-	struct uaudio_softc *sc;
+	struct uaudio_softc *sc = addr;
 
 	DPRINTF((uaudio_halt_out_dma: enter\n));
-	sc = addr;
+
+	KERNEL_LOCK(1, curlwp);
+	mutex_spin_exit(sc-sc_intr_lock);
 	if (sc-sc_playchan.pipe != NULL) {
 		uaudio_chan_close(sc, sc-sc_playchan);
 		sc-sc_playchan.pipe = NULL;
 		uaudio_chan_free_buffers(sc, sc-sc_playchan);
 		sc-sc_playchan.intr = NULL;
 	}
+	mutex_spin_enter(sc-sc_intr_lock);
+	KERNEL_UNLOCK_ONE(curlwp);
+
 	return 0;
 }
 
 Static int
 uaudio_halt_in_dma(void *addr)
 {
-	struct uaudio_softc *sc;
+	struct uaudio_softc *sc = addr;
 
 	DPRINTF((uaudio_halt_in_dma: enter\n));
-	sc = addr;
+
+	KERNEL_LOCK(1, curlwp);
+	mutex_spin_exit(sc-sc_intr_lock);
 	if (sc-sc_recchan.pipe != NULL) {
 		uaudio_chan_close(sc, sc-sc_recchan);
 		sc-sc_recchan.pipe = NULL;
 		uaudio_chan_free_buffers(sc, sc-sc_recchan);
 		sc-sc_recchan.intr = NULL;
 	}
+	mutex_spin_enter(sc-sc_intr_lock);
+	KERNEL_UNLOCK_ONE(curlwp);
+
 	return 0;
 }
 
@@ -2283,6 +2313,16 @@ uaudio_get_props(void *addr)
 
 }
 
+Static void
+uaudio_get_locks(void *addr, kmutex_t **intr, kmutex_t **thread)
+{
+	struct uaudio_softc *sc;
+
+	sc = addr;
+	*intr = sc-sc_intr_lock;
+	*thread = sc-sc_lock;
+}
+
 Static int
 uaudio_get(struct uaudio_softc *sc, int which, int type, int wValue,
 	   int wIndex, int len)
@@ -2412,8 +2452,10 @@ 

CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Nov 22 02:43:59 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
note3 uaudio and hdafg on amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.22 -r1.1.2.23 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.22 src/sys/dev/TODO.audiomp:1.1.2.23
--- src/sys/dev/TODO.audiomp:1.1.2.22	Tue Nov 22 00:49:37 2011
+++ src/sys/dev/TODO.audiomp	Tue Nov 22 02:43:59 2011
@@ -50,9 +50,9 @@ dev/pci/gcscaudio.c		done
 dev/pci/neo.c			done
 dev/pci/sv.c			done
 dev/pci/yds.c			done
-dev/pci/hdaudio/hdafg.c		done		port-i386
+dev/pci/hdaudio/hdafg.c		done		port-i386, port-amd64
 dev/sbus/cs4231_sbus.c		done
 dev/sbus/dbri.c			done
 dev/tc/bba.c			done
-dev/usb/uaudio.c
+dev/usb/uaudio.c		done		port-amd64
 dev/usb/umidi.c



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Nov 22 03:02:14 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
dbri works on sparc.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.23 -r1.1.2.24 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.23 src/sys/dev/TODO.audiomp:1.1.2.24
--- src/sys/dev/TODO.audiomp:1.1.2.23	Tue Nov 22 02:43:59 2011
+++ src/sys/dev/TODO.audiomp	Tue Nov 22 03:02:14 2011
@@ -52,7 +52,7 @@ dev/pci/sv.c			done
 dev/pci/yds.c			done
 dev/pci/hdaudio/hdafg.c		done		port-i386, port-amd64
 dev/sbus/cs4231_sbus.c		done
-dev/sbus/dbri.c			done
+dev/sbus/dbri.c			done		port-sparc
 dev/tc/bba.c			done
 dev/usb/uaudio.c		done		port-amd64
 dev/usb/umidi.c



CVS commit: [jmcneill-audiomp3] src/sys/dev/isa

2011-11-21 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Nov 22 03:02:53 UTC 2011

Modified Files:
src/sys/dev/isa [jmcneill-audiomp3]: ad1848_isa.c

Log Message:
don't attempt to obtain the intr mutex again, only KASSERT we own it already


To generate a diff of this commit:
cvs rdiff -u -r1.37.4.1 -r1.37.4.2 src/sys/dev/isa/ad1848_isa.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/isa/ad1848_isa.c
diff -u src/sys/dev/isa/ad1848_isa.c:1.37.4.1 src/sys/dev/isa/ad1848_isa.c:1.37.4.2
--- src/sys/dev/isa/ad1848_isa.c:1.37.4.1	Sat Nov 19 21:49:37 2011
+++ src/sys/dev/isa/ad1848_isa.c	Tue Nov 22 03:02:53 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ad1848_isa.c,v 1.37.4.1 2011/11/19 21:49:37 jmcneill Exp $	*/
+/*	$NetBSD: ad1848_isa.c,v 1.37.4.2 2011/11/22 03:02:53 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2008 The NetBSD Foundation, Inc.
@@ -95,7 +95,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ad1848_isa.c,v 1.37.4.1 2011/11/19 21:49:37 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: ad1848_isa.c,v 1.37.4.2 2011/11/22 03:02:53 jakllsch Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -502,9 +502,8 @@ ad1848_isa_open(void *addr, int flags)
 #ifndef AUDIO_NO_POWER_CTL
 	/* Power-up chip */
 	if (isc-powerctl) {
-		mutex_spin_enter(sc-sc_intr_lock);
+		KASSERT(mutex_owned(sc-sc_intr_lock));
 		isc-powerctl(isc-powerarg, flags);
-		mutex_spin_exit(sc-sc_intr_lock);
 	}
 #endif
 
@@ -515,9 +514,8 @@ ad1848_isa_open(void *addr, int flags)
 	if (error) {
 #ifndef AUDIO_NO_POWER_CTL
 		if (isc-powerctl) {
-			mutex_spin_enter(sc-sc_intr_lock);
+			KASSERT(mutex_owned(sc-sc_intr_lock));
 			isc-powerctl(isc-powerarg, 0);
-			mutex_spin_exit(sc-sc_intr_lock);
 		}
 #endif
 		goto bad;
@@ -549,9 +547,8 @@ ad1848_isa_close(void *addr)
 #ifndef AUDIO_NO_POWER_CTL
 	/* Power-down chip */
 	if (isc-powerctl) {
-		mutex_spin_enter(sc-sc_intr_lock);
+		KASSERT(mutex_owned(sc-sc_intr_lock));
 		isc-powerctl(isc-powerarg, 0);
-		mutex_spin_exit(sc-sc_intr_lock);
 	}
 #endif
 



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Nov 22 03:07:31 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
ym(4) successfully tested lightly on i386


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.24 -r1.1.2.25 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.24 src/sys/dev/TODO.audiomp:1.1.2.25
--- src/sys/dev/TODO.audiomp:1.1.2.24	Tue Nov 22 03:02:14 2011
+++ src/sys/dev/TODO.audiomp	Tue Nov 22 03:07:30 2011
@@ -28,7 +28,7 @@ dev/isa/gus.c			done
 dev/isa/pas.c			done
 dev/isa/sb.c			done		port-i386
 dev/isa/wss.c			done
-dev/isa/ym.c			done
+dev/isa/ym.c			done		port-i386
 dev/isapnp/mpu_isapnp.c		done
 dev/pad/pad.c			done
 dev/pci/auacer.c		done



CVS commit: [jmcneill-audiomp3] src/sys/arch/macppc/dev

2011-11-21 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Nov 22 05:54:54 UTC 2011

Modified Files:
src/sys/arch/macppc/dev [jmcneill-audiomp3]: snapper.c

Log Message:
convert snapper
code from mrg, tested on my iBook G4


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.36.10.1 src/sys/arch/macppc/dev/snapper.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/macppc/dev/snapper.c
diff -u src/sys/arch/macppc/dev/snapper.c:1.36 src/sys/arch/macppc/dev/snapper.c:1.36.10.1
--- src/sys/arch/macppc/dev/snapper.c:1.36	Fri Nov 12 12:26:29 2010
+++ src/sys/arch/macppc/dev/snapper.c	Tue Nov 22 05:54:54 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: snapper.c,v 1.36 2010/11/12 12:26:29 phx Exp $	*/
+/*	$NetBSD: snapper.c,v 1.36.10.1 2011/11/22 05:54:54 macallan Exp $	*/
 /*	Id: snapper.c,v 1.11 2002/10/31 17:42:13 tsubai Exp	*/
 /*	Id: i2s.c,v 1.12 2005/01/15 14:32:35 tsubai Exp		*/
 
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: snapper.c,v 1.36 2010/11/12 12:26:29 phx Exp $);
+__KERNEL_RCSID(0, $NetBSD: snapper.c,v 1.36.10.1 2011/11/22 05:54:54 macallan Exp $);
 
 #include sys/param.h
 #include sys/audioio.h
@@ -111,6 +111,9 @@ struct snapper_softc {
 	unsigned char	dbdma_cmdspace[sizeof(struct dbdma_command) * 40 + 15];
 	struct dbdma_command *sc_odmacmd;
 	struct dbdma_command *sc_idmacmd;
+
+	kmutex_t sc_lock;
+	kmutex_t sc_intr_lock;
 };
 
 static int snapper_match(device_t, struct cfdata *, void *);
@@ -134,6 +137,7 @@ static int snapper_trigger_output(void *
 void *, const audio_params_t *);
 static int snapper_trigger_input(void *, void *, void *, int, void (*)(void *),
 void *, const audio_params_t *);
+static void snapper_get_locks(void *, kmutex_t **, kmutex_t **);
 static void snapper_set_volume(struct snapper_softc *, u_int, u_int);
 static int snapper_set_rate(struct snapper_softc *);
 static void snapper_set_treble(struct snapper_softc *, u_int);
@@ -161,7 +165,7 @@ struct snapper_codecvar {
 };
 
 static stream_filter_t *snapper_filter_factory
-	(int (*)(stream_fetcher_t *, audio_stream_t *, int));
+	(int (*)(struct audio_softc *sc, stream_fetcher_t *, audio_stream_t *, int));
 static void snapper_filter_dtor(stream_filter_t *);
 
 /* XXX We can't access the hw device softc from our audio
@@ -172,7 +176,7 @@ static u_int snapper_vol_l = 128, snappe
 /* XXX why doesn't auconv define this? */
 #define DEFINE_FILTER(name)	\
 static int \
-name##_fetch_to(stream_fetcher_t *, audio_stream_t *, int); \
+name##_fetch_to(struct audio_softc *, stream_fetcher_t *, audio_stream_t *, int); \
 stream_filter_t * name(struct audio_softc *, \
 const audio_params_t *, const audio_params_t *); \
 stream_filter_t * \
@@ -182,7 +186,7 @@ name(struct audio_softc *sc, const audio
 	return snapper_filter_factory(name##_fetch_to); \
 } \
 static int \
-name##_fetch_to(stream_fetcher_t *self, audio_stream_t *dst, int max_used)
+name##_fetch_to(struct audio_softc *sc, stream_fetcher_t *self, audio_stream_t *dst, int max_used)
 
 DEFINE_FILTER(snapper_volume)
 {
@@ -193,7 +197,7 @@ DEFINE_FILTER(snapper_volume)
 
 	this = (stream_filter_t *)self;
 	max_used = (max_used + 1)  ~1;
-	if ((err = this-prev-fetch_to(this-prev, this-src, max_used)))
+	if ((err = this-prev-fetch_to(sc, this-prev, this-src, max_used)))
 		return err;
 	m = (dst-end - dst-start)  ~1;
 	m = min(m, max_used);
@@ -226,7 +230,7 @@ DEFINE_FILTER(snapper_fixphase)
 		panic(snapper_fixphase);
 #endif
 	max_used = (max_used + 3)  ~2;
-	if ((err = this-prev-fetch_to(this-prev, this-src, max_used)))
+	if ((err = this-prev-fetch_to(sc, this-prev, this-src, max_used)))
 		return err;
 
 	/* work in stereo frames (4 bytes) */
@@ -245,7 +249,7 @@ DEFINE_FILTER(snapper_fixphase)
 }
 
 static stream_filter_t *
-snapper_filter_factory(int (*fetch_to)(stream_fetcher_t *, audio_stream_t *, int))
+snapper_filter_factory(int (*fetch_to)(struct audio_softc *sc, stream_fetcher_t *, audio_stream_t *, int))
 {
 	struct snapper_codecvar *this;
 
@@ -299,7 +303,8 @@ const struct audio_hw_if snapper_hw_if =
 	snapper_trigger_output,
 	snapper_trigger_input,
 	NULL,
-	NULL
+	NULL,
+	snapper_get_locks,
 };
 
 struct audio_device snapper_device = {
@@ -782,12 +787,15 @@ snapper_attach(device_t parent, device_t
 	oirq_type = intr[3] ? IST_LEVEL : IST_EDGE;
 	iirq_type = intr[5] ? IST_LEVEL : IST_EDGE;
 
-	/* intr_establish(cirq, cirq_type, IPL_AUDIO, snapper_intr, sc); */
-	intr_establish(oirq, oirq_type, IPL_AUDIO, snapper_intr, sc);
-	intr_establish(iirq, iirq_type, IPL_AUDIO, snapper_intr, sc);
+	/* intr_establish(cirq, cirq_type, IPL_BIO, snapper_intr, sc); */
+	intr_establish(oirq, oirq_type, IPL_SCHED, snapper_intr, sc);
+	intr_establish(iirq, iirq_type, IPL_SCHED, snapper_intr, sc);
 
 	aprint_normal(: irq %d,%d,%d\n, cirq, oirq, iirq);
 
+	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(sc-sc_intr_lock, 

CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Nov 22 05:56:43 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
snapper works


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.25 -r1.1.2.26 src/sys/dev/TODO.audiomp

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/TODO.audiomp
diff -u src/sys/dev/TODO.audiomp:1.1.2.25 src/sys/dev/TODO.audiomp:1.1.2.26
--- src/sys/dev/TODO.audiomp:1.1.2.25	Tue Nov 22 03:07:30 2011
+++ src/sys/dev/TODO.audiomp	Tue Nov 22 05:56:43 2011
@@ -9,7 +9,7 @@ arch/dreamcast/dev/g2/aica.c	done
 arch/hp700/gsc/harmony.c	done
 arch/hpcmips/vr/vraiu.c		done
 arch/macppc/dev/awacs.c		done		port-macppc
-arch/macppc/dev/snapper.c
+arch/macppc/dev/snapper.c	done		port-macppc, TAS3004 only
 arch/prep/isa/paud_isa.c	done
 arch/sgimips/hpc/haltwo.c	done
 arch/sgimips/mace/mavb.c	done



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Nov 22 06:11:12 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: midictl.c

Log Message:
avoid one use-after-free error.  midi_store-lock is unlocked after
we cv_broadcast() to get the midi_store freed.  keep a local copy
of the lock pointer to avoid this.


To generate a diff of this commit:
cvs rdiff -u -r1.6.32.1 -r1.6.32.2 src/sys/dev/midictl.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/midictl.c
diff -u src/sys/dev/midictl.c:1.6.32.1 src/sys/dev/midictl.c:1.6.32.2
--- src/sys/dev/midictl.c:1.6.32.1	Sat Nov 19 21:49:35 2011
+++ src/sys/dev/midictl.c	Tue Nov 22 06:11:12 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: midictl.c,v 1.6.32.1 2011/11/19 21:49:35 jmcneill Exp $ */
+/* $NetBSD: midictl.c,v 1.6.32.2 2011/11/22 06:11:12 mrg Exp $ */
 
 /*-
  * Copyright (c) 2006, 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: midictl.c,v 1.6.32.1 2011/11/19 21:49:35 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: midictl.c,v 1.6.32.2 2011/11/22 06:11:12 mrg Exp $);
 
 /*
  * See midictl.h for an overview of the purpose and use of this module.
@@ -206,13 +206,15 @@ void
 midictl_close(midictl *mc)
 {
 	midictl_store *s;
+	kmutex_t *lock;
 
 	s = mc-store;
+	lock = s-lock;
 
-	mutex_enter(s-lock);
+	mutex_enter(lock);
 	s-destroy = true;
 	cv_broadcast(s-cv);
-	mutex_exit(s-lock);
+	mutex_exit(lock);
 }
 
 void



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Nov 22 07:54:45 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: midi.c

Log Message:
adjust some DPRINTF*() calls so that they compile now.


To generate a diff of this commit:
cvs rdiff -u -r1.72.10.1 -r1.72.10.2 src/sys/dev/midi.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/midi.c
diff -u src/sys/dev/midi.c:1.72.10.1 src/sys/dev/midi.c:1.72.10.2
--- src/sys/dev/midi.c:1.72.10.1	Sat Nov 19 21:49:35 2011
+++ src/sys/dev/midi.c	Tue Nov 22 07:54:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: midi.c,v 1.72.10.1 2011/11/19 21:49:35 jmcneill Exp $	*/
+/*	$NetBSD: midi.c,v 1.72.10.2 2011/11/22 07:54:45 mrg Exp $	*/
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: midi.c,v 1.72.10.1 2011/11/19 21:49:35 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: midi.c,v 1.72.10.2 2011/11/22 07:54:45 mrg Exp $);
 
 #include midi.h
 #include sequencer.h
@@ -838,11 +838,11 @@ midiclose(dev_t dev, int flags, int ifmt
 	struct midi_softc *sc;
 	const struct midi_hw_if *hw;
 
-	DPRINTFN(3,(midiclose %p\n, sc));
-
 	sc = device_lookup_private(midi_cd, MIDIUNIT(dev));
 	hw = sc-hw_if;
 
+	DPRINTFN(3,(midiclose %p\n, sc));
+
 	mutex_enter(sc-lock);
 	/* midi_start_output(sc); anything buffered = pbus already set! */
 	while (sc-pbus) {
@@ -869,13 +869,13 @@ midiread(dev_t dev, struct uio *uio, int
 	MIDI_BUF_DECLARE(idx);
 	MIDI_BUF_DECLARE(buf);
 
-	DPRINTFN(6,(midiread: %p, count=%lu\n, sc,
-	(unsigned long)uio-uio_resid));
-
 	sc = device_lookup_private(midi_cd, MIDIUNIT(dev));
 	mb = sc-inbuf;
 	first = 1;
 
+	DPRINTFN(6,(midiread: %p, count=%lu\n, sc,
+	(unsigned long)uio-uio_resid));
+
 	mutex_enter(sc-lock);
 	if (sc-dying) {
 		mutex_exit(sc-lock);
@@ -1261,7 +1261,7 @@ midi_intr_out(struct midi_softc *sc)
 		softint_schedule(sc-sih);
 	}
 	if (error) {
-		DPRINTF((midi_intr_output error %d\n, error))
+		DPRINTF((midi_intr_output error %d\n, error));
 	}
 	return error;
 }
@@ -1393,10 +1393,11 @@ midiwrite(dev_t dev, struct uio *uio, in
 	size_t xfrcount;
 	int pollout = 0;
 
+	sc = device_lookup_private(midi_cd, MIDIUNIT(dev));
+
 	DPRINTFN(6,(midiwrite: %p, unit=%d, count=%lu\n, sc, (int)minor(dev),
 	(unsigned long)uio-uio_resid));
 
-	sc = device_lookup_private(midi_cd, MIDIUNIT(dev));
 	mutex_enter(sc-lock);
 	if (sc-dying) {
 		mutex_exit(sc-lock);
@@ -1527,14 +1528,14 @@ midiioctl(dev_t dev, u_long cmd, void *a
 	int error;
 	MIDI_BUF_DECLARE(buf);
 
-	DPRINTFN(5,(midiioctl: %p cmd=0x%08lx\n, sc, cmd));
-
 	sc = device_lookup_private(midi_cd, MIDIUNIT(dev));;
 	if (sc-dying)
 		return EIO;
 	hw = sc-hw_if;
 	error = 0;
 
+	DPRINTFN(5,(midiioctl: %p cmd=0x%08lx\n, sc, cmd));
+
 	switch (cmd) {
 	case FIONBIO:
 		/* All handled in the upper layer. */
@@ -1611,11 +1612,11 @@ midipoll(dev_t dev, int events, struct l
 	MIDI_BUF_DECLARE(idx);
 	MIDI_BUF_DECLARE(buf);
 
-	DPRINTFN(6,(midipoll: %p events=0x%x\n, sc, events));
-
 	sc = device_lookup_private(midi_cd, MIDIUNIT(dev));
 	revents = 0;
 
+	DPRINTFN(6,(midipoll: %p events=0x%x\n, sc, events));
+
 	mutex_enter(sc-lock);
 	if (sc-dying) {
 		mutex_exit(sc-lock);



CVS commit: [jmcneill-audiomp3] src/sys/dev/usb

2011-11-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Nov 22 07:56:15 UTC 2011

Modified Files:
src/sys/dev/usb [jmcneill-audiomp3]: umidi.c umidivar.h

Log Message:
port umidi to audiomp: get_locks support, take locks in interrupts.

untested, and midi in this branch has general problems still anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.44.4.1 src/sys/dev/usb/umidi.c
cvs rdiff -u -r1.14 -r1.14.10.1 src/sys/dev/usb/umidivar.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/usb/umidi.c
diff -u src/sys/dev/usb/umidi.c:1.44 src/sys/dev/usb/umidi.c:1.44.4.1
--- src/sys/dev/usb/umidi.c:1.44	Fri Oct  7 19:41:03 2011
+++ src/sys/dev/usb/umidi.c	Tue Nov 22 07:56:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: umidi.c,v 1.44 2011/10/07 19:41:03 jakllsch Exp $	*/
+/*	$NetBSD: umidi.c,v 1.44.4.1 2011/11/22 07:56:15 mrg Exp $	*/
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: umidi.c,v 1.44 2011/10/07 19:41:03 jakllsch Exp $);
+__KERNEL_RCSID(0, $NetBSD: umidi.c,v 1.44.4.1 2011/11/22 07:56:15 mrg Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -79,6 +79,7 @@ static int umidi_commonmsg(void *, int, 
 static int umidi_sysex(void *, u_char *, int);
 static int umidi_rtmsg(void *, int);
 static void umidi_getinfo(void *, struct midi_info *);
+static void umidi_get_locks(void *, kmutex_t **, kmutex_t **);
 
 static usbd_status alloc_pipe(struct umidi_endpoint *);
 static void free_pipe(struct umidi_endpoint *);
@@ -127,11 +128,11 @@ static void out_solicit(void *); /* stru
 
 
 const struct midi_hw_if umidi_hw_if = {
-	umidi_open,
-	umidi_close,
-	umidi_rtmsg,
-	umidi_getinfo,
-	0,		/* ioctl */
+	.open = umidi_open,
+	.close = umidi_close,
+	.output = umidi_rtmsg,
+	.getinfo = umidi_getinfo,
+	.get_locks = umidi_get_locks,
 };
 
 struct midi_hw_if_ext umidi_hw_if_ext = {
@@ -200,6 +201,8 @@ umidi_attach(device_t parent, device_t s
 	aprint_normal_dev(self, );
 	umidi_print_quirk(sc-sc_quirk);
 
+	mutex_init(sc-sc_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(sc-sc_intr_lock, MUTEX_DEFAULT, IPL_USB);
 
 	err = alloc_all_endpoints(sc);
 	if (err!=USBD_NORMAL_COMPLETION) {
@@ -297,6 +300,9 @@ umidi_detach(device_t self, int flags)
 	usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc-sc_udev,
 			   sc-sc_dev);
 
+	mutex_destroy(sc-sc_lock);
+	mutex_destroy(sc-sc_intr_lock);
+
 	return 0;
 }
 
@@ -436,6 +442,15 @@ umidi_getinfo(void *addr, struct midi_in
 	midi_register_hw_if_ext(mm? umidi_hw_if_mm : umidi_hw_if_ext);
 }
 
+static void
+umidi_get_locks(void *addr, kmutex_t **intr, kmutex_t **thread)
+{
+	struct umidi_mididev *mididev = addr;
+	struct umidi_softc *sc = mididev-sc;
+
+	*intr = sc-sc_intr_lock;
+	*thread = sc-sc_lock;
+}
 
 /*
  * each endpoint stuffs
@@ -1547,6 +1562,7 @@ in_intr(usbd_xfer_handle xfer, usbd_priv
 {
 	int cn, len, i;
 	struct umidi_endpoint *ep = (struct umidi_endpoint *)priv;
+	struct umidi_softc *sc = ep-sc;
 	struct umidi_jack *jack;
 	unsigned char *packet;
 	umidi_packet_bufp slot;
@@ -1557,6 +1573,7 @@ in_intr(usbd_xfer_handle xfer, usbd_priv
 	if (ep-sc-sc_dying || !ep-num_open)
 		return;
 
+	mutex_enter(sc-sc_intr_lock);
 	usbd_get_xfer_status(xfer, NULL, NULL, count, NULL);
 if ( 0 == count % UMIDI_PACKET_SIZE ) {
 		DPRINTFN(200,(%s: input endpoint %p transfer length %u\n,
@@ -1588,6 +1605,7 @@ in_intr(usbd_xfer_handle xfer, usbd_priv
  (unsigned)data[0],
  (unsigned)data[1],
  (unsigned)data[2]));
+			mutex_exit(sc-sc_intr_lock);
 			return;
 		}
 
@@ -1610,6 +1628,7 @@ in_intr(usbd_xfer_handle xfer, usbd_priv
 	}
 
 	(void)start_input_transfer(ep);
+	mutex_exit(sc-sc_intr_lock);
 }
 
 static void
@@ -1623,6 +1642,7 @@ out_intr(usbd_xfer_handle xfer, usbd_pri
 	if (sc-sc_dying)
 		return;
 
+	mutex_enter(sc-sc_intr_lock);
 #ifdef UMIDI_DEBUG
 	if ( umididebug = 200 )
 		microtime(umidi_tv);
@@ -1657,6 +1677,7 @@ out_intr(usbd_xfer_handle xfer, usbd_pri
 		ep-soliciting = 1;
 		out_solicit(ep);
 	}
+	mutex_exit(sc-sc_intr_lock);
 }
 
 /*

Index: src/sys/dev/usb/umidivar.h
diff -u src/sys/dev/usb/umidivar.h:1.14 src/sys/dev/usb/umidivar.h:1.14.10.1
--- src/sys/dev/usb/umidivar.h:1.14	Wed Nov  3 22:34:24 2010
+++ src/sys/dev/usb/umidivar.h	Tue Nov 22 07:56:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: umidivar.h,v 1.14 2010/11/03 22:34:24 dyoung Exp $	*/
+/*	$NetBSD: umidivar.h,v 1.14.10.1 2011/11/22 07:56:15 mrg Exp $	*/
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -119,4 +119,7 @@ struct umidi_softc {
 	struct umidi_endpoint	*sc_in_ep;
 	struct umidi_endpoint	*sc_endpoints;
 	int			cblnums_global;
+
+	kmutex_t		sc_lock;
+	kmutex_t		sc_intr_lock;
 };



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Nov 22 07:57:24 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: sequencer.c

Log Message:
adjust DPRINTF*() calls to actually build.
avoid a potential NULl pointer deref.


To generate a diff of this commit:
cvs rdiff -u -r1.52.14.2 -r1.52.14.3 src/sys/dev/sequencer.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/sequencer.c
diff -u src/sys/dev/sequencer.c:1.52.14.2 src/sys/dev/sequencer.c:1.52.14.3
--- src/sys/dev/sequencer.c:1.52.14.2	Sun Nov 20 20:00:15 2011
+++ src/sys/dev/sequencer.c	Tue Nov 22 07:57:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sequencer.c,v 1.52.14.2 2011/11/20 20:00:15 jmcneill Exp $	*/
+/*	$NetBSD: sequencer.c,v 1.52.14.3 2011/11/22 07:57:23 mrg Exp $	*/
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sequencer.c,v 1.52.14.2 2011/11/20 20:00:15 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: sequencer.c,v 1.52.14.3 2011/11/22 07:57:23 mrg Exp $);
 
 #include sequencer.h
 
@@ -370,7 +370,7 @@ sequencerclose(dev_t dev, int flags, int
 	struct midi_softc *msc;
 	int unit, error;
 
-	DPRINTF((sequencerclose: %d\n, dev));
+	DPRINTF((sequencerclose: %PRIx64\n, dev));
 
 	if ((error = sequencer_enter(dev, sc)) != 0)
 		return error;
@@ -389,7 +389,8 @@ sequencerclose(dev_t dev, int flags, int
 	mutex_exit(sc-lock);
 
 	for (unit = 0; unit  sc-nmidi; unit++)
-		midiseq_close(sc-devs[unit]);
+		if (sc-devs[unit] != NULL)
+			midiseq_close(sc-devs[unit]);
 	if (sc-devs != NULL) {
 		KASSERT(sc-ndevs  0);
 		kmem_free(sc-devs, sc-ndevs * sizeof(struct midi_dev *));
@@ -400,6 +401,8 @@ sequencerclose(dev_t dev, int flags, int
 	sc-isopen = 0;
 	sequencer_exit(sc);
 
+	DPRINTF((sequencerclose: %PRIx64 done\n, dev));
+
 	return (0);
 }
 
@@ -510,7 +513,7 @@ sequencerread(dev_t dev, struct uio *uio
 	seq_event_t ev;
 	int error;
 
-	DPRINTFN(20, (sequencerread: %d, count=%d, ioflag=%x\n,
+	DPRINTFN(20, (sequencerread: %PRIx64, count=%d, ioflag=%x\n,
 	   dev, (int)uio-uio_resid, ioflag));
 
 	q = sc-inq;
@@ -557,7 +560,7 @@ sequencerwrite(dev_t dev, struct uio *ui
 	seq_event_t cmdbuf;
 	int size;
 	
-	DPRINTFN(2, (sequencerwrite: %d, count=%d\n, dev,
+	DPRINTFN(2, (sequencerwrite: %PRIx64, count=%d\n, dev,
 	(int)uio-uio_resid));
 
 	q = sc-outq;
@@ -620,7 +623,7 @@ sequencerioctl(dev_t dev, u_long cmd, vo
 	struct timeval now;
 	u_long tx;
 
-	DPRINTFN(2, (sequencerioctl: %d cmd=0x%08lx\n, dev, cmd));
+	DPRINTFN(2, (sequencerioctl: %PRIx64 cmd=0x%08lx\n, dev, cmd));
 
 	if ((error = sequencer_enter(dev, sc)) != 0)
 		return error;



CVS commit: src/sbin/iscsid

2011-11-21 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Nov 21 08:23:20 UTC 2011

Modified Files:
src/sbin/iscsid: iscsid.8

Log Message:
Fix title and xrefs.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sbin/iscsid/iscsid.8

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



CVS commit: src/sys/fs/msdosfs

2011-11-21 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Nov 21 10:46:57 UTC 2011

Modified Files:
src/sys/fs/msdosfs: msdosfs_vnops.c

Log Message:
Add missing fstrans_done().

Should fix PR #45635 (KASSERT fli-fli_trans_cnt == 0 failed)


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/fs/msdosfs/msdosfs_vnops.c

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



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Nov 21 11:21:04 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
i tested azalia


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.17 -r1.1.2.18 src/sys/dev/TODO.audiomp

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



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

2011-11-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Nov 21 13:42:37 UTC 2011

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

Log Message:
No need to include MD machine/cpu_counter.h here.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/librump/rumpkern/cprng_stub.c

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



CVS commit: src/sys/kern

2011-11-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Nov 21 13:44:38 UTC 2011

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

Log Message:
Include MD machine/cpu_counter.h only if defined(__HAVE_CPU_COUNTER).

XXX: Why not timecounter(9) but deprecated cpu_counter32() and microtime(9)?


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/kern/subr_cprng.c

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



CVS commit: src/tools

2011-11-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Nov 21 13:46:37 UTC 2011

Modified Files:
src/tools: Makefile.gnuhost

Log Message:
Pass M4=${TOOL_M4:Q} to CONFIGURE_ENV for tools/gmp.
Fixes configure error on cygwin.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/tools/Makefile.gnuhost

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



CVS commit: src/share/man/man8

2011-11-21 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Nov 21 14:27:41 UTC 2011

Modified Files:
src/share/man/man8: compat_freebsd.8 compat_ibcs2.8 compat_linux.8

Log Message:
Switch from .nf/.fi groff macros to .Bd -literal/.Ed blocks.
While here, convert .sp macro to .Pp.

ok wiz@.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/share/man/man8/compat_freebsd.8
cvs rdiff -u -r1.5 -r1.6 src/share/man/man8/compat_ibcs2.8
cvs rdiff -u -r1.36 -r1.37 src/share/man/man8/compat_linux.8

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



CVS commit: src/doc

2011-11-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Nov 21 14:39:47 UTC 2011

Modified Files:
src/doc: CHANGES

Log Message:
Note news68k PROM function based framebuffer console support.


To generate a diff of this commit:
cvs rdiff -u -r1.1628 -r1.1629 src/doc/CHANGES

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



CVS commit: src/lib/libc/string

2011-11-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Nov 21 15:02:48 UTC 2011

Modified Files:
src/lib/libc/string: wcscspn.c wcspbrk.c wcsspn.c

Log Message:
Clean up a bit in preparation for more serious changes


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/string/wcscspn.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/string/wcspbrk.c \
src/lib/libc/string/wcsspn.c

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



CVS commit: src/share/man/man8

2011-11-21 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Nov 21 15:11:45 UTC 2011

Modified Files:
src/share/man/man8: compat_freebsd.8 compat_ibcs2.8 compat_sunos.8
compat_svr4.8 compat_ultrix.8

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/share/man/man8/compat_freebsd.8
cvs rdiff -u -r1.6 -r1.7 src/share/man/man8/compat_ibcs2.8
cvs rdiff -u -r1.19 -r1.20 src/share/man/man8/compat_sunos.8 \
src/share/man/man8/compat_ultrix.8
cvs rdiff -u -r1.25 -r1.26 src/share/man/man8/compat_svr4.8

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



CVS commit: src/lib/libc/arch/vax

2011-11-21 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Mon Nov 21 16:17:48 UTC 2011

Modified Files:
src/lib/libc/arch/vax/gen: alloca.S
src/lib/libc/arch/vax/sys: __vfork14.S getcontext.S

Log Message:
gcc 4.5 on vax creates PLT stubs with an entry mask of 0xffc
rather than 0 like gcc 4.1 did, so the sneaky assembly functions
that ret without really returning now clobber their registers.
adjust these functions to avoid this problem.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/vax/gen/alloca.S
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/vax/sys/__vfork14.S
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/vax/sys/getcontext.S

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



CVS commit: src/external/cddl/osnet

2011-11-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 21 17:51:04 UTC 2011

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: spa_config.c
src/external/cddl/osnet/sys/sys: zfs_context.h

Log Message:
make this compile again. VOP_CLOSE is really vn_close() through macros.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c
cvs rdiff -u -r1.11 -r1.12 src/external/cddl/osnet/sys/sys/zfs_context.h

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



CVS commit: src/sys/fs/union

2011-11-21 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Nov 21 18:29:23 UTC 2011

Modified Files:
src/sys/fs/union: union.h union_subr.c union_vfsops.c union_vnops.c

Log Message:
Replace flag based union node locking with generic vnode lock, support
shared and nowait locks and protect un_uppervp and un_*sz with mutex.

Mark file system MPSAFE.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/fs/union/union.h
cvs rdiff -u -r1.52 -r1.53 src/sys/fs/union/union_subr.c
cvs rdiff -u -r1.64 -r1.65 src/sys/fs/union/union_vfsops.c
cvs rdiff -u -r1.48 -r1.49 src/sys/fs/union/union_vnops.c

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



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Nov 21 18:35:20 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
auich(4) successfully tested on amd64 (nForce4)


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.18 -r1.1.2.19 src/sys/dev/TODO.audiomp

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



CVS commit: src/sys/arch/alpha/alpha

2011-11-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 21 19:50:37 UTC 2011

Modified Files:
src/sys/arch/alpha/alpha: mcclock.c

Log Message:
- don't clear the flags twice in the loop
- reorder calculation to preserve as much precision as possible.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/alpha/alpha/mcclock.c

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



CVS commit: src/etc

2011-11-21 Thread D'Arcy J.M. Cain
Module Name:src
Committed By:   darcy
Date:   Mon Nov 21 20:56:21 UTC 2011

Modified Files:
src/etc/defaults: rc.conf
src/etc/rc.d: pf

Log Message:
Allow pf flags to be specified in rc.conf.
Add default to defaults/rc.d as suggested by lukem@


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/etc/defaults/rc.conf
cvs rdiff -u -r1.9 -r1.10 src/etc/rc.d/pf

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



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Nov 21 21:39:44 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp
src/sys/dev/pci [jmcneill-audiomp3]: emuxki.c emuxkivar.h

Log Message:
Make emuxki(4) work w/ audiomp changes.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.19 -r1.1.2.20 src/sys/dev/TODO.audiomp
cvs rdiff -u -r1.59.14.2 -r1.59.14.3 src/sys/dev/pci/emuxki.c
cvs rdiff -u -r1.12.14.1 -r1.12.14.2 src/sys/dev/pci/emuxkivar.h

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



CVS commit: src/sys/compat/linux/arch/alpha

2011-11-21 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Nov 21 22:00:43 UTC 2011

Modified Files:
src/sys/compat/linux/arch/alpha: linux_machdep.h

Log Message:
Adjust setup_linux_rt_sigframe/setup_linux_sigframe prototypes.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/compat/linux/arch/alpha/linux_machdep.h

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



CVS commit: src/sys/crypto/nist_ctr_drbg

2011-11-21 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Mon Nov 21 23:48:52 UTC 2011

Modified Files:
src/sys/crypto/nist_ctr_drbg: nist_ctr_drbg.h

Log Message:
NIST_CTR_DRBG.V is accessed as (unsigned long *) so we need to make sure
it's aligned accordingly or we go boom on sparc64


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/crypto/nist_ctr_drbg/nist_ctr_drbg.h

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



CVS commit: src

2011-11-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Nov 21 23:50:45 UTC 2011

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/lib/libc/locale: Makefile
src/tests/lib/libc/string: Makefile
Added Files:
src/tests/lib/libc/locale: t_wcscspn.c t_wcspbrk.c t_wcsspn.c
src/tests/lib/libc/string: t_strcspn.c t_strpbrk.c t_strspn.c

Log Message:
Add test cases for strcspn, strpbrk, strspn, wcscspn, wcspbrk and
wcsspn.


To generate a diff of this commit:
cvs rdiff -u -r1.424 -r1.425 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/locale/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/locale/t_wcscspn.c \
src/tests/lib/libc/locale/t_wcspbrk.c \
src/tests/lib/libc/locale/t_wcsspn.c
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/string/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/string/t_strcspn.c \
src/tests/lib/libc/string/t_strpbrk.c \
src/tests/lib/libc/string/t_strspn.c

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



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Nov 22 00:19:30 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
I tested autri


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.20 -r1.1.2.21 src/sys/dev/TODO.audiomp

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



CVS commit: src/lib/libc/string

2011-11-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Nov 22 00:37:10 UTC 2011

Modified Files:
src/lib/libc/string: strpbrk.c

Log Message:
Handle simple cases (strlen(charset) = 1) more efficiently.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/string/strpbrk.c

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



CVS commit: [jmcneill-audiomp3] src/sys/arch/macppc/dev

2011-11-21 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Nov 22 00:48:49 UTC 2011

Modified Files:
src/sys/arch/macppc/dev [jmcneill-audiomp3]: awacs.c

Log Message:
adapt to jmcneill-audiomp3
from mrg@, minor fixes and testing by me


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.40.6.1 src/sys/arch/macppc/dev/awacs.c

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



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Nov 22 00:49:38 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
awacs works now


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.21 -r1.1.2.22 src/sys/dev/TODO.audiomp

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



CVS commit: [jmcneill-audiomp3] src/sys/dev/usb

2011-11-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Nov 22 02:39:59 UTC 2011

Modified Files:
src/sys/dev/usb [jmcneill-audiomp3]: uaudio.c

Log Message:
port to audiomp.  mostly from jared, tested and completed by me.

this one is a little more tricky.  besides the usual spl and get_locks
changes, we have to deal with the USB subsystem wanting to sleep and
expecting to be called with the kernel lock held.  so we always take
the kernel lock and drop the interrupt lock before calling into usbd.


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.120.10.1 src/sys/dev/usb/uaudio.c

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



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Nov 22 02:43:59 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
note3 uaudio and hdafg on amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.22 -r1.1.2.23 src/sys/dev/TODO.audiomp

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



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Nov 22 03:02:14 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
dbri works on sparc.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.23 -r1.1.2.24 src/sys/dev/TODO.audiomp

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



CVS commit: [jmcneill-audiomp3] src/sys/dev/isa

2011-11-21 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Nov 22 03:02:53 UTC 2011

Modified Files:
src/sys/dev/isa [jmcneill-audiomp3]: ad1848_isa.c

Log Message:
don't attempt to obtain the intr mutex again, only KASSERT we own it already


To generate a diff of this commit:
cvs rdiff -u -r1.37.4.1 -r1.37.4.2 src/sys/dev/isa/ad1848_isa.c

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



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Nov 22 03:07:31 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
ym(4) successfully tested lightly on i386


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.24 -r1.1.2.25 src/sys/dev/TODO.audiomp

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



CVS commit: [jmcneill-audiomp3] src/sys/arch/macppc/dev

2011-11-21 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Nov 22 05:54:54 UTC 2011

Modified Files:
src/sys/arch/macppc/dev [jmcneill-audiomp3]: snapper.c

Log Message:
convert snapper
code from mrg, tested on my iBook G4


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.36.10.1 src/sys/arch/macppc/dev/snapper.c

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



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Nov 22 05:56:43 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: TODO.audiomp

Log Message:
snapper works


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.25 -r1.1.2.26 src/sys/dev/TODO.audiomp

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



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Nov 22 06:11:12 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: midictl.c

Log Message:
avoid one use-after-free error.  midi_store-lock is unlocked after
we cv_broadcast() to get the midi_store freed.  keep a local copy
of the lock pointer to avoid this.


To generate a diff of this commit:
cvs rdiff -u -r1.6.32.1 -r1.6.32.2 src/sys/dev/midictl.c

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



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Nov 22 07:54:45 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: midi.c

Log Message:
adjust some DPRINTF*() calls so that they compile now.


To generate a diff of this commit:
cvs rdiff -u -r1.72.10.1 -r1.72.10.2 src/sys/dev/midi.c

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



CVS commit: [jmcneill-audiomp3] src/sys/dev/usb

2011-11-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Nov 22 07:56:15 UTC 2011

Modified Files:
src/sys/dev/usb [jmcneill-audiomp3]: umidi.c umidivar.h

Log Message:
port umidi to audiomp: get_locks support, take locks in interrupts.

untested, and midi in this branch has general problems still anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.44.4.1 src/sys/dev/usb/umidi.c
cvs rdiff -u -r1.14 -r1.14.10.1 src/sys/dev/usb/umidivar.h

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



CVS commit: [jmcneill-audiomp3] src/sys/dev

2011-11-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Nov 22 07:57:24 UTC 2011

Modified Files:
src/sys/dev [jmcneill-audiomp3]: sequencer.c

Log Message:
adjust DPRINTF*() calls to actually build.
avoid a potential NULl pointer deref.


To generate a diff of this commit:
cvs rdiff -u -r1.52.14.2 -r1.52.14.3 src/sys/dev/sequencer.c

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