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

2010-11-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Nov 26 09:25:40 UTC 2010

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

Log Message:
Duh, it's x86_64, not amd64.  This should make the races which
require SMP trigger in the amd64/qemu runs again.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/rump/librump/rumpkern/Makefile.rumpkern

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/Makefile.rumpkern
diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.102 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.103
--- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.102	Mon Nov 22 10:50:50 2010
+++ src/sys/rump/librump/rumpkern/Makefile.rumpkern	Fri Nov 26 09:25:39 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rumpkern,v 1.102 2010/11/22 10:50:50 pooka Exp $
+#	$NetBSD: Makefile.rumpkern,v 1.103 2010/11/26 09:25:39 pooka Exp $
 #
 
 .include ${RUMPTOP}/Makefile.rump
@@ -26,7 +26,7 @@
 #SRCS+=	locks_up.c
 
 # Does the arch support multiple processors?
-.if ${MACHINE_ARCH} == amd64 || ${MACHINE_ARCH} == i386
+.if ${MACHINE_ARCH} == i386 || ${MACHINE_ARCH} == x86_64
 RUMP_SMP=		# defined
 CPPFLAGS.rump.c+=	-DRUMP_SMP
 .endif



CVS commit: src/lib/librumpuser

2010-11-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Nov 26 10:59:14 UTC 2010

Modified Files:
src/lib/librumpuser: rumpuser_sp.c

Log Message:
Plug recently introduced memory leak: release lwp after use instead of
just switching away.

Also, make freeing syscall arguments a little more symmetric.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/librumpuser/rumpuser_sp.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/librumpuser/rumpuser_sp.c
diff -u src/lib/librumpuser/rumpuser_sp.c:1.15 src/lib/librumpuser/rumpuser_sp.c:1.16
--- src/lib/librumpuser/rumpuser_sp.c:1.15	Thu Nov 25 17:59:02 2010
+++ src/lib/librumpuser/rumpuser_sp.c	Fri Nov 26 10:59:14 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: rumpuser_sp.c,v 1.15 2010/11/25 17:59:02 pooka Exp $	*/
+/*  $NetBSD: rumpuser_sp.c,v 1.16 2010/11/26 10:59:14 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: rumpuser_sp.c,v 1.15 2010/11/25 17:59:02 pooka Exp $);
+__RCSID($NetBSD: rumpuser_sp.c,v 1.16 2010/11/26 10:59:14 pooka Exp $);
 
 #include sys/types.h
 #include sys/atomic.h
@@ -421,8 +421,7 @@
 
 	lwproc_newlwp(spc-spc_pid);
 	rv = rumpsyscall(sysnum, data, retval);
-	lwproc_switch(NULL);
-	free(data);
+	lwproc_release();
 
 	DPRINTF((rump_sp: got return value %d  %d/%d\n,
 	rv, retval[0], retval[1]));
@@ -442,7 +441,8 @@
 
 	serv_handlesyscall(barg-sba_spc, barg-sba_hdr, barg-sba_data);
 	spcrelease(barg-sba_spc);
-	free(arg);
+	free(barg-sba_data);
+	free(barg);
 	return NULL;
 }
 



CVS commit: src/lib/libukfs

2010-11-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Nov 26 11:10:53 UTC 2010

Modified Files:
src/lib/libukfs: ukfs.c

Log Message:
rumpuser should not be included outside of the rump kernel (and
rumpuser itself)


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/lib/libukfs/ukfs.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/libukfs/ukfs.c
diff -u src/lib/libukfs/ukfs.c:1.54 src/lib/libukfs/ukfs.c:1.55
--- src/lib/libukfs/ukfs.c:1.54	Tue Sep  7 17:16:18 2010
+++ src/lib/libukfs/ukfs.c	Fri Nov 26 11:10:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ukfs.c,v 1.54 2010/09/07 17:16:18 pooka Exp $	*/
+/*	$NetBSD: ukfs.c,v 1.55 2010/11/26 11:10:53 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008, 2009  Antti Kantee.  All Rights Reserved.
@@ -62,7 +62,6 @@
 
 #include rump/rump.h
 #include rump/rump_syscalls.h
-#include rump/rumpuser.h
 
 #include ukfs_int_disklabel.h
 



CVS commit: src/lib/libp2k

2010-11-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Nov 26 11:12:06 UTC 2010

Modified Files:
src/lib/libp2k: p2k.c

Log Message:
update comment


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/lib/libp2k/p2k.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/libp2k/p2k.c
diff -u src/lib/libp2k/p2k.c:1.44 src/lib/libp2k/p2k.c:1.45
--- src/lib/libp2k/p2k.c:1.44	Tue Sep  7 17:22:53 2010
+++ src/lib/libp2k/p2k.c	Fri Nov 26 11:12:06 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: p2k.c,v 1.44 2010/09/07 17:22:53 pooka Exp $	*/
+/*	$NetBSD: p2k.c,v 1.45 2010/11/26 11:12:06 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008, 2009  Antti Kantee.  All Rights Reserved.
@@ -411,8 +411,9 @@
 	/* 
 	 * If we're mounting rumpfs, actually do no mount and redirect
 	 * requests to rump fs namespace root.  Strictly speaking, this
-	 * is not correct, but considering rumpfs doesn't currently
-	 * support VFS_MOUNT(), I don't think anyone will notice.
+	 * is not correct, but I don't think anyone will notice.
+	 * After all, we're mostly interested in things which reside
+	 * specifically on the rootfs, namely the contents of /dev
 	 */
 	if (strcmp(vfsname, MOUNT_RUMPFS) == 0) {
 		if ((rv = rump_pub_vfs_getmp(/, p2m-p2m_mp)) != 0) {



CVS commit: src/external/bsd/atf/dist/atf-sh

2010-11-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Nov 26 12:04:36 UTC 2010

Modified Files:
src/external/bsd/atf/dist/atf-sh: atf-check.cpp

Log Message:
Remove spammy (debug?) prints.  took ages to figure out they were
not coming from my application...

XXX: the memcmp below looks suspicious


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/atf/dist/atf-sh/atf-check.cpp

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

Modified files:

Index: src/external/bsd/atf/dist/atf-sh/atf-check.cpp
diff -u src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.1.1.2 src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.2
--- src/external/bsd/atf/dist/atf-sh/atf-check.cpp:1.1.1.2	Sun Nov  7 17:43:28 2010
+++ src/external/bsd/atf/dist/atf-sh/atf-check.cpp	Fri Nov 26 12:04:36 2010
@@ -421,8 +421,6 @@
 if (f2.bad())
 throw std::runtime_error(Failed to read from  + p1.str());
 
-std::cout  1 read:   f1.gcount()  \n;
-std::cout  2 read:   f2.gcount()  \n;
 if ((f1.gcount() == 0)  (f2.gcount() == 0)) {
 equal = true;
 break;



CVS commit: xsrc/external/mit/xf86-video-sunleo/dist/src

2010-11-26 Thread Takeshi Nakayama
Module Name:xsrc
Committed By:   nakayama
Date:   Fri Nov 26 12:05:17 UTC 2010

Modified Files:
xsrc/external/mit/xf86-video-sunleo/dist/src: leo_accel.c

Log Message:
Follow leo.h rev 1.2 change.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
xsrc/external/mit/xf86-video-sunleo/dist/src/leo_accel.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-sunleo/dist/src/leo_accel.c
diff -u xsrc/external/mit/xf86-video-sunleo/dist/src/leo_accel.c:1.2 xsrc/external/mit/xf86-video-sunleo/dist/src/leo_accel.c:1.3
--- xsrc/external/mit/xf86-video-sunleo/dist/src/leo_accel.c:1.2	Thu Sep 10 21:20:19 2009
+++ xsrc/external/mit/xf86-video-sunleo/dist/src/leo_accel.c	Fri Nov 26 12:05:17 2010
@@ -42,7 +42,11 @@
 
 #include	leo.h
 
+#if LEO_OLDPRIV
 int LeoGCPrivateIndex;
+#else
+DevPrivateKeyRec LeoGCPrivateIndex;
+#endif
 
 int	leoRopTable[16] = {
 	LEO_ATTR_RGBE_ENABLE|LEO_ROP_ZERO,		/* GXclear */



CVS commit: src/lib/librumpuser

2010-11-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Nov 26 14:37:08 UTC 2010

Modified Files:
src/lib/librumpuser: rumpuser_sp.c sp_common.c

Log Message:
Improve reliability in cases where client disconnects mid-operation.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/librumpuser/rumpuser_sp.c
cvs rdiff -u -r1.10 -r1.11 src/lib/librumpuser/sp_common.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/librumpuser/rumpuser_sp.c
diff -u src/lib/librumpuser/rumpuser_sp.c:1.16 src/lib/librumpuser/rumpuser_sp.c:1.17
--- src/lib/librumpuser/rumpuser_sp.c:1.16	Fri Nov 26 10:59:14 2010
+++ src/lib/librumpuser/rumpuser_sp.c	Fri Nov 26 14:37:08 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: rumpuser_sp.c,v 1.16 2010/11/26 10:59:14 pooka Exp $	*/
+/*  $NetBSD: rumpuser_sp.c,v 1.17 2010/11/26 14:37:08 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: rumpuser_sp.c,v 1.16 2010/11/26 10:59:14 pooka Exp $);
+__RCSID($NetBSD: rumpuser_sp.c,v 1.17 2010/11/26 14:37:08 pooka Exp $);
 
 #include sys/types.h
 #include sys/atomic.h
@@ -345,6 +345,13 @@
 	spc-spc_dying = 1;
 	kickall(spc);
 	pthread_mutex_unlock(spc-spc_mtx);
+
+	/*
+	 * Nobody's going to attempt to send/receive anymore,
+	 * so reinit info relevant to that.
+	 */
+	memset((char *)spc + SPC_ZEROFF, 0, sizeof(*spc) - SPC_ZEROFF);
+
 	spcrelease(spc);
 }
 

Index: src/lib/librumpuser/sp_common.c
diff -u src/lib/librumpuser/sp_common.c:1.10 src/lib/librumpuser/sp_common.c:1.11
--- src/lib/librumpuser/sp_common.c:1.10	Thu Nov 25 17:59:02 2010
+++ src/lib/librumpuser/sp_common.c	Fri Nov 26 14:37:08 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: sp_common.c,v 1.10 2010/11/25 17:59:02 pooka Exp $	*/
+/*  $NetBSD: sp_common.c,v 1.11 2010/11/26 14:37:08 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -47,6 +47,7 @@
 #include poll.h
 #include pthread.h
 #include stdarg.h
+#include stddef.h
 #include stdio.h
 #include stdlib.h
 #include string.h
@@ -123,22 +124,24 @@
 	int spc_refcnt;
 	int spc_dying;
 
+	pthread_mutex_t spc_mtx;
+	pthread_cond_t spc_cv;
+
 	struct lwp *spc_mainlwp;
 	pid_t spc_pid;
 
+	TAILQ_HEAD(, respwait) spc_respwait;
+
+	/* rest of the fields are zeroed upon disconnect */
+#define SPC_ZEROFF offsetof(struct spclient, spc_pid)
 	struct pollfd *spc_pfd;
 
 	struct rsp_hdr spc_hdr;
 	uint8_t *spc_buf;
 	size_t spc_off;
 
-	pthread_mutex_t spc_mtx;
-	pthread_cond_t spc_cv;
-
 	uint64_t spc_nextreq;
 	int spc_ostatus, spc_istatus;
-
-	TAILQ_HEAD(, respwait) spc_respwait;
 };
 #define SPCSTATUS_FREE 0
 #define SPCSTATUS_BUSY 1
@@ -249,7 +252,7 @@
 	}
 	DPRINTF((rump_sp: client %p woke up waiter at %p\n, spc, rw));
 	rw-rw_data = spc-spc_buf;
-	rw-rw_dlen = (size_t)spc-spc_off;
+	rw-rw_dlen = (size_t)(spc-spc_off - HDRSZ);
 	pthread_cond_signal(rw-rw_cv);
 	pthread_mutex_unlock(spc-spc_mtx);
 
@@ -292,7 +295,7 @@
 case -1:
 	rv = errno;
 	spc-spc_dying = 1;
-	break;
+	goto cleanup;
 default:
 	break;
 }
@@ -311,6 +314,7 @@
 	break;
 }
 			}
+ cleanup:
 			pthread_mutex_lock(spc-spc_mtx);
 			if (spc-spc_istatus == SPCSTATUS_WANTED)
 kickall(spc);
@@ -326,6 +330,8 @@
 
 	pthread_cond_destroy(rw-rw_cv);
 
+	if (rv == 0  spc-spc_dying)
+		rv = ENOTCONN;
 	return rv;
 }
 



CVS commit: src/usr.bin/make

2010-11-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 26 15:14:29 UTC 2010

Modified Files:
src/usr.bin/make: arch.c

Log Message:
check for NULL before de-referencing.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/usr.bin/make/arch.c

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

Modified files:

Index: src/usr.bin/make/arch.c
diff -u src/usr.bin/make/arch.c:1.60 src/usr.bin/make/arch.c:1.61
--- src/usr.bin/make/arch.c:1.60	Thu Nov 25 16:31:08 2010
+++ src/usr.bin/make/arch.c	Fri Nov 26 10:14:29 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.60 2010/11/25 21:31:08 christos Exp $	*/
+/*	$NetBSD: arch.c,v 1.61 2010/11/26 15:14:29 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = $NetBSD: arch.c,v 1.60 2010/11/25 21:31:08 christos Exp $;
+static char rcsid[] = $NetBSD: arch.c,v 1.61 2010/11/26 15:14:29 christos Exp $;
 #else
 #include sys/cdefs.h
 #ifndef lint
 #if 0
 static char sccsid[] = @(#)arch.c	8.2 (Berkeley) 1/2/94;
 #else
-__RCSID($NetBSD: arch.c,v 1.60 2010/11/25 21:31:08 christos Exp $);
+__RCSID($NetBSD: arch.c,v 1.61 2010/11/26 15:14:29 christos Exp $);
 #endif
 #endif /* not lint */
 #endif
@@ -1246,7 +1246,8 @@
 } else if (OP_NOP(gn-type)  Lst_IsEmpty(gn-children)) {
 	oodate = FALSE;
 } else if ((!Lst_IsEmpty(gn-children)  gn-cmgn == NULL) ||
-	   (gn-mtime  now) || (gn-mtime  gn-cmgn-mtime)) {
+	   (gn-mtime  now) ||
+	   (gn-cmgn != NULL  gn-mtime  gn-cmgn-mtime)) {
 	oodate = TRUE;
 } else {
 #ifdef RANLIBMAG



CVS commit: [netbsd-5] src/x11/bin/xinit

2010-11-26 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Nov 26 17:08:05 UTC 2010

Modified Files:
src/x11/bin/xinit [netbsd-5]: Makefile

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1482):
x11/bin/xinit/Makefile: revision 1.8
Disable USE_PAM on ports which have legacy non-XFree86 servers.
With this change, xinit(1) can properly quit Xserver after
xinitrc script exits.
Tested on dreamcast (-current) and hpcmips (netbsd-5).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.30.1 src/x11/bin/xinit/Makefile

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

Modified files:

Index: src/x11/bin/xinit/Makefile
diff -u src/x11/bin/xinit/Makefile:1.7 src/x11/bin/xinit/Makefile:1.7.30.1
--- src/x11/bin/xinit/Makefile:1.7	Wed Mar  2 01:06:15 2005
+++ src/x11/bin/xinit/Makefile	Fri Nov 26 17:08:04 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2005/03/02 01:06:15 christos Exp $
+#	$NetBSD: Makefile,v 1.7.30.1 2010/11/26 17:08:04 riz Exp $
 
 .include bsd.own.mk
 
@@ -13,8 +13,23 @@
 
 CPPFLAGS+=	-DXFREE86
 .if (${USE_PAM} != no)
+# XXX: Legacy non-XFree86 servers don't handle PAM
+.if \
+${MACHINE} != alpha	 \
+${MACHINE} != amiga	 \
+${MACHINE} != dreamcast	 \
+${MACHINE} != ews4800mips	 \
+${MACHINE} != hpcarm	 \
+${MACHINE} != hpcmips	 \
+${MACHINE} != hpcsh	 \
+${MACHINE} != newsmips	 \
+${MACHINE} != pmax	 \
+${MACHINE} != sun3	 \
+${MACHINE} != x68k	 \
+1
 CPPFLAGS+=	-DUSE_PAM
 .endif
+.endif
 
 CPPSCRIPTS=	startx xinitrc
 CPPSCRIPTFLAGS_xinitrc=	-DXINITDIR=${XINITDIR} -DBINDIR=${X11BINDIR}



CVS commit: [netbsd-5] src/sys/arch/dreamcast/dev

2010-11-26 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Nov 26 17:11:47 UTC 2010

Modified Files:
src/sys/arch/dreamcast/dev [netbsd-5]: gdrom.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1483):
sys/arch/dreamcast/dev/gdrom.c: revision 1.27
Set bp-b_resid properly after data transfer is complete.
Fixes unexpected Bad address errors on file read ops since January 2006.
The problem is reported and tracked by Yasushi Oshima.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.4.1 src/sys/arch/dreamcast/dev/gdrom.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/dreamcast/dev/gdrom.c
diff -u src/sys/arch/dreamcast/dev/gdrom.c:1.26 src/sys/arch/dreamcast/dev/gdrom.c:1.26.4.1
--- src/sys/arch/dreamcast/dev/gdrom.c:1.26	Fri Aug  1 20:19:49 2008
+++ src/sys/arch/dreamcast/dev/gdrom.c	Fri Nov 26 17:11:47 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gdrom.c,v 1.26 2008/08/01 20:19:49 marcus Exp $	*/
+/*	$NetBSD: gdrom.c,v 1.26.4.1 2010/11/26 17:11:47 riz Exp $	*/
 
 /*-
  * Copyright (c) 2001 Marcus Comstedt
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
-__KERNEL_RCSID(0, $NetBSD: gdrom.c,v 1.26 2008/08/01 20:19:49 marcus Exp $);
+__KERNEL_RCSID(0, $NetBSD: gdrom.c,v 1.26.4.1 2010/11/26 17:11:47 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -118,10 +118,12 @@
 #define GDROM_COND	GDROM(0x9c)
 
 int	gdrom_getstat(void);
-int	gdrom_do_command(struct gdrom_softc *, void *, void *, unsigned int);
-int	gdrom_command_sense(struct gdrom_softc *, void *, void *, unsigned int);
+int	gdrom_do_command(struct gdrom_softc *, void *, void *, unsigned int,
+	int *);
+int	gdrom_command_sense(struct gdrom_softc *, void *, void *, unsigned int,
+	int *);
 int	gdrom_read_toc(struct gdrom_softc *, struct gd_toc *);
-int	gdrom_read_sectors(struct gdrom_softc *, void *, int, int);
+int	gdrom_read_sectors(struct gdrom_softc *, void *, int, int, int *);
 int	gdrom_mount_disk(struct gdrom_softc *);
 int	gdrom_intr(void *);
 
@@ -202,7 +204,7 @@
 
 
 int gdrom_do_command(struct gdrom_softc *sc, void *req, void *buf,
-unsigned int nbyt)
+unsigned int nbyt, int *resid)
 {
 	int i, s;
 	short *ptr = req;
@@ -239,12 +241,15 @@
 
 	splx(s);
 
+	if (resid != NULL)
+		*resid = sc-cmd_result_size;
+
 	return sc-cmd_cond;
 }
 
 
 int gdrom_command_sense(struct gdrom_softc *sc, void *req, void *buf,
-unsigned int nbyt)
+unsigned int nbyt, int *resid)
 {
 	/* 76543210 76543210
 	   0   0x13  -
@@ -257,7 +262,7 @@
 	unsigned char cmd[12];
 	int sense_key, sense_specific;
 
-	int cond = gdrom_do_command(sc, req, buf, nbyt);
+	int cond = gdrom_do_command(sc, req, buf, nbyt, resid);
 
 	if (cond  0) {
 #ifdef GDROMDEBUG
@@ -278,7 +283,7 @@
 	cmd[0] = 0x13;
 	cmd[4] = sizeof(sense_data);
 	
-	gdrom_do_command(sc, cmd, sense_data, sizeof(sense_data));
+	gdrom_do_command(sc, cmd, sense_data, sizeof(sense_data), NULL);
 	
 	sense_key = sense_data[1]  0xf;
 	sense_specific = sense_data[4];
@@ -314,10 +319,11 @@
 	cmd[3] = sizeof(struct gd_toc)  8;
 	cmd[4] = sizeof(struct gd_toc)  0xff;
 	
-	return gdrom_command_sense(sc, cmd, toc, sizeof(struct gd_toc));
+	return gdrom_command_sense(sc, cmd, toc, sizeof(struct gd_toc), NULL);
 }
 
-int gdrom_read_sectors(struct gdrom_softc *sc, void *buf, int sector, int cnt)
+int gdrom_read_sectors(struct gdrom_softc *sc, void *buf, int sector, int cnt,
+int *resid)
 {
 	/* 76543210 76543210
 	   0   0x30datafmt
@@ -339,7 +345,7 @@
 	cmd[9] = cnt8;
 	cmd[10] = cnt;
 
-	return gdrom_command_sense(sc, cmd, buf, cnt  11);
+	return gdrom_command_sense(sc, cmd, buf, cnt  11, resid);
 }
 
 int gdrom_mount_disk(struct gdrom_softc *sc)
@@ -358,7 +364,7 @@
 	cmd[0] = 0x70;
 	cmd[1] = 0x1f;
 	
-	return gdrom_command_sense(sc, cmd, NULL, 0);
+	return gdrom_command_sense(sc, cmd, NULL, 0, NULL);
 }
 
 int
@@ -468,7 +474,7 @@
 gdromstrategy(struct buf *bp)
 {
 	struct gdrom_softc *sc;
-	int s, unit, error;
+	int s, unit, error, resid;
 #ifdef GDROMDEBUG
 	printf(GDROM: strategy\n);
 #endif
@@ -493,11 +499,14 @@
 	splx(s);
 
 	if ((error = gdrom_read_sectors(sc, bp-b_data, bp-b_rawblkno,
-	bp-b_bcount  11)))
+	bp-b_bcount  11, resid)))
 		bp-b_error = error;
 
 	sc-is_busy = 0;
 	wakeup(sc-is_busy);
+	bp-b_resid = resid;
+	biodone(bp);
+	return;
 
  done:
 	bp-b_resid = bp-b_bcount;



CVS commit: [netbsd-5] src/sys/arch/hpcmips/dev

2010-11-26 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Nov 26 17:14:01 UTC 2010

Modified Files:
src/sys/arch/hpcmips/dev [netbsd-5]: plumohci.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1484):
sys/arch/hpcmips/dev/plumohci.c: revision 1.13
Remove (possibly) unnecessary boundary arg from bus_space_alloc(9)
for DMA shared memory. PR port-hpcmips/43473 by Risto Sainio.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.14.1 src/sys/arch/hpcmips/dev/plumohci.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/hpcmips/dev/plumohci.c
diff -u src/sys/arch/hpcmips/dev/plumohci.c:1.12 src/sys/arch/hpcmips/dev/plumohci.c:1.12.14.1
--- src/sys/arch/hpcmips/dev/plumohci.c:1.12	Thu Apr  3 17:04:40 2008
+++ src/sys/arch/hpcmips/dev/plumohci.c	Fri Nov 26 17:14:01 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: plumohci.c,v 1.12 2008/04/03 17:04:40 drochner Exp $ */
+/*	$NetBSD: plumohci.c,v 1.12.14.1 2010/11/26 17:14:01 riz Exp $ */
 
 /*-
  * Copyright (c) 2000 UCHIYAMA Yasushi
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: plumohci.c,v 1.12 2008/04/03 17:04:40 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: plumohci.c,v 1.12.14.1 2010/11/26 17:14:01 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -241,7 +241,7 @@
 	 */
 	error = bus_space_alloc(sc-sc.iot, PLUM_OHCI_SHMEMBASE,
 	PLUM_OHCI_SHMEMBASE + PLUM_OHCI_SHMEMSIZE - 1,
-	size, OHCI_PAGE_SIZE, OHCI_PAGE_SIZE, 0,
+	size, OHCI_PAGE_SIZE, 0, 0,
 	(bus_addr_t *)(void *)caddr, bsh);
 	if (error)
 		return (1);



CVS commit: [netbsd-5] src/sys/arch/hpcmips/tx

2010-11-26 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Nov 26 17:16:03 UTC 2010

Modified Files:
src/sys/arch/hpcmips/tx [netbsd-5]: txcom.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1485):
sys/arch/hpcmips/tx/txcom.c: revision 1.42
sys/arch/hpcmips/tx/txcom.c: revision 1.43
Add missing callout_init(9) calls. PR port-hpcmips/43472
Fix a wrong arg for callout_reset(9) in txcom_txintr(). PR port-hpcmips/43474


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.40.6.1 src/sys/arch/hpcmips/tx/txcom.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/hpcmips/tx/txcom.c
diff -u src/sys/arch/hpcmips/tx/txcom.c:1.40 src/sys/arch/hpcmips/tx/txcom.c:1.40.6.1
--- src/sys/arch/hpcmips/tx/txcom.c:1.40	Thu Jun 12 16:50:53 2008
+++ src/sys/arch/hpcmips/tx/txcom.c	Fri Nov 26 17:16:03 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: txcom.c,v 1.40 2008/06/12 16:50:53 tsutsui Exp $ */
+/*	$NetBSD: txcom.c,v 1.40.6.1 2010/11/26 17:16:03 riz Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: txcom.c,v 1.40 2008/06/12 16:50:53 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: txcom.c,v 1.40.6.1 2010/11/26 17:16:03 riz Exp $);
 
 #include opt_tx39uart_debug.h
 
@@ -252,6 +252,10 @@
 
 	printf(\n);
 
+	/* initialize callouts */
+	callout_init(sc-sc_txsoft_ch, 0);
+	callout_init(sc-sc_rxsoft_ch, 0);
+
 	/* 
 	 * Enable interrupt
 	 */
@@ -748,7 +752,7 @@
 		sc-sc_tbc--;
 		sc-sc_tba++;
 	} else {
-		callout_reset(sc-sc_rxsoft_ch, 1, txcom_txsoft, sc);
+		callout_reset(sc-sc_txsoft_ch, 1, txcom_txsoft, sc);
 	}
 
 	return 0;



CVS commit: [netbsd-5] src/doc

2010-11-26 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Nov 26 17:16:50 UTC 2010

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2

Log Message:
Tickets 1482-1485.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.30 -r1.1.2.31 src/doc/CHANGES-5.2

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

Modified files:

Index: src/doc/CHANGES-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.30 src/doc/CHANGES-5.2:1.1.2.31
--- src/doc/CHANGES-5.2:1.1.2.30	Thu Nov 25 00:27:19 2010
+++ src/doc/CHANGES-5.2	Fri Nov 26 17:16:50 2010
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.30 2010/11/25 00:27:19 riz Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.31 2010/11/26 17:16:50 riz Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1
 release:
@@ -842,3 +842,23 @@
 	Install a.out version of INSTALL kernel in release. PR#41672
 	[is/tsutsui, ticket #1127]
 
+x11/bin/xinit/Makefile1.8
+
+	Disable USE_PAM on ports which have legacy non-XFree86 servers.
+	[tsutsui, ticket #1482]
+
+sys/arch/dreamcast/dev/gdrom.c			1.27
+
+	Dreamcast: Fix unexpected Bad address errors on file read ops.
+	[tsutsui, ticket #1483]
+
+sys/arch/hpcmips/dev/plumohci.c			1.13
+
+	Fix ohci(4) panics for TX39XX (hpcmips).  PR#43473
+	[tsutsui, ticket #1484]
+
+sys/arch/hpcmips/tx/txcom.c			1.42-43
+
+	hpcmips com fixes.  PR#43472, PR#43474.
+	[tsutsui, ticket #1485]
+



CVS commit: [netbsd-5] src/sys/dev/usb

2010-11-26 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Nov 26 17:29:13 UTC 2010

Modified Files:
src/sys/dev/usb [netbsd-5]: umass_quirks.c usbdevs

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #1489):
sys/dev/usb/umass_quirks.c: revision 1.82
sys/dev/usb/usbdevs: revision 1.564
Add Kingston DT Mini 10 pendrive
Regen
Add quirk for Kingston DT Mini 10 to stop it giving HBA errors.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.76.2.1 src/sys/dev/usb/umass_quirks.c
cvs rdiff -u -r1.519.4.7 -r1.519.4.8 src/sys/dev/usb/usbdevs

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/umass_quirks.c
diff -u src/sys/dev/usb/umass_quirks.c:1.76 src/sys/dev/usb/umass_quirks.c:1.76.2.1
--- src/sys/dev/usb/umass_quirks.c:1.76	Mon Oct 27 21:46:43 2008
+++ src/sys/dev/usb/umass_quirks.c	Fri Nov 26 17:29:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: umass_quirks.c,v 1.76 2008/10/27 21:46:43 joerg Exp $	*/
+/*	$NetBSD: umass_quirks.c,v 1.76.2.1 2010/11/26 17:29:13 riz Exp $	*/
 
 /*
  * Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: umass_quirks.c,v 1.76 2008/10/27 21:46:43 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: umass_quirks.c,v 1.76.2.1 2010/11/26 17:29:13 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -221,6 +221,14 @@
 	  UMATCH_VENDOR_PRODUCT,
 	  NULL, NULL
 	},
+	/* Kingston generic HBA errors */
+	{ { USB_VENDOR_KINGSTON, USB_PRODUCT_KINGSTON_DTMINI10 },
+	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
+	  0,
+	  PQUIRK_NODOORLOCK,
+	  UMATCH_VENDOR_PRODUCT,
+	  NULL, NULL
+	},
 };
 
 const struct umass_quirk *

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.519.4.7 src/sys/dev/usb/usbdevs:1.519.4.8
--- src/sys/dev/usb/usbdevs:1.519.4.7	Sun Nov 21 03:05:04 2010
+++ src/sys/dev/usb/usbdevs	Fri Nov 26 17:29:13 2010
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.519.4.7 2010/11/21 03:05:04 riz Exp $
+$NetBSD: usbdevs,v 1.519.4.8 2010/11/26 17:29:13 riz Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -1372,6 +1372,7 @@
 /* Kingston products */
 product KINGSTON XX1		0x0008	Ethernet Adapter
 product KINGSTON KNU101TX	0x000a	KNU101TX USB Ethernet
+product KINGSTON DTMINI10	0x162c	DT Mini 10 
 
 /* Kodak products */
 product KODAK DC220		0x0100	Digital Science DC220



CVS commit: [netbsd-5] src/sys/dev/usb

2010-11-26 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Nov 26 17:29:51 UTC 2010

Modified Files:
src/sys/dev/usb [netbsd-5]: usbdevs.h usbdevs_data.h

Log Message:
Regen for ticket 1489.


To generate a diff of this commit:
cvs rdiff -u -r1.515.4.7 -r1.515.4.8 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.516.4.7 -r1.516.4.8 src/sys/dev/usb/usbdevs_data.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/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.515.4.7 src/sys/dev/usb/usbdevs.h:1.515.4.8
--- src/sys/dev/usb/usbdevs.h:1.515.4.7	Sun Nov 21 10:11:58 2010
+++ src/sys/dev/usb/usbdevs.h	Fri Nov 26 17:29:50 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.515.4.7 2010/11/21 10:11:58 martin Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.515.4.8 2010/11/26 17:29:50 riz Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.519.4.7 2010/11/21 03:05:04 riz Exp
+ *	NetBSD
  */
 
 /*
@@ -1379,6 +1379,7 @@
 /* Kingston products */
 #define	USB_PRODUCT_KINGSTON_XX1	0x0008		/* Ethernet Adapter */
 #define	USB_PRODUCT_KINGSTON_KNU101TX	0x000a		/* KNU101TX USB Ethernet */
+#define	USB_PRODUCT_KINGSTON_DTMINI10	0x162c		/* DT Mini 10 */
 
 /* Kodak products */
 #define	USB_PRODUCT_KODAK_DC220	0x0100		/* Digital Science DC220 */

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.516.4.7 src/sys/dev/usb/usbdevs_data.h:1.516.4.8
--- src/sys/dev/usb/usbdevs_data.h:1.516.4.7	Sun Nov 21 10:11:58 2010
+++ src/sys/dev/usb/usbdevs_data.h	Fri Nov 26 17:29:50 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.516.4.7 2010/11/21 10:11:58 martin Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.516.4.8 2010/11/26 17:29:50 riz Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.519.4.7 2010/11/21 03:05:04 riz Exp
+ *	NetBSD
  */
 
 /*
@@ -4083,6 +4083,10 @@
 	KNU101TX USB Ethernet,
 	},
 	{
+	USB_VENDOR_KINGSTON, USB_PRODUCT_KINGSTON_DTMINI10,
+	DT Mini 10,
+	},
+	{
 	USB_VENDOR_KODAK, USB_PRODUCT_KODAK_DC220,
 	Digital Science DC220,
 	},
@@ -6855,4 +6859,4 @@
 	Prestige,
 	},
 };
-const int usb_nproducts = 1247;
+const int usb_nproducts = 1248;



CVS commit: [netbsd-5] src/doc

2010-11-26 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Nov 26 17:30:43 UTC 2010

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2

Log Message:
Ticket 1489.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.31 -r1.1.2.32 src/doc/CHANGES-5.2

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

Modified files:

Index: src/doc/CHANGES-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.31 src/doc/CHANGES-5.2:1.1.2.32
--- src/doc/CHANGES-5.2:1.1.2.31	Fri Nov 26 17:16:50 2010
+++ src/doc/CHANGES-5.2	Fri Nov 26 17:30:42 2010
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.31 2010/11/26 17:16:50 riz Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.32 2010/11/26 17:30:42 riz Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1
 release:
@@ -862,3 +862,11 @@
 	hpcmips com fixes.  PR#43472, PR#43474.
 	[tsutsui, ticket #1485]
 
+sys/dev/usb/umass_quirks.c			1.82 via patch
+sys/dev/usb/usbdevs1.564 via patch
+sys/dev/usb/usbdevs.hregen
+sys/dev/usb/usbdevs_data.h			regen
+
+	Add support for Kingston DT Mini 10 pendrive, with quirk.
+	[sborrill, ticket #1489]
+



CVS commit: src/lib/librumpuser

2010-11-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Nov 26 18:51:04 UTC 2010

Modified Files:
src/lib/librumpuser: rumpuser_sp.c sp_common.c

Log Message:
Fix a few locking problems with multithreaded clients.

TODO: make server deal graciously with out-of-resources conditions


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/lib/librumpuser/rumpuser_sp.c
cvs rdiff -u -r1.11 -r1.12 src/lib/librumpuser/sp_common.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/librumpuser/rumpuser_sp.c
diff -u src/lib/librumpuser/rumpuser_sp.c:1.17 src/lib/librumpuser/rumpuser_sp.c:1.18
--- src/lib/librumpuser/rumpuser_sp.c:1.17	Fri Nov 26 14:37:08 2010
+++ src/lib/librumpuser/rumpuser_sp.c	Fri Nov 26 18:51:03 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: rumpuser_sp.c,v 1.17 2010/11/26 14:37:08 pooka Exp $	*/
+/*  $NetBSD: rumpuser_sp.c,v 1.18 2010/11/26 18:51:03 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: rumpuser_sp.c,v 1.17 2010/11/26 14:37:08 pooka Exp $);
+__RCSID($NetBSD: rumpuser_sp.c,v 1.18 2010/11/26 18:51:03 pooka Exp $);
 
 #include sys/types.h
 #include sys/atomic.h
@@ -65,7 +65,7 @@
 
 #include sp_common.c
 
-#define MAXCLI 4
+#define MAXCLI 256
 
 static struct pollfd pfdlist[MAXCLI];
 static struct spclient spclist[MAXCLI];
@@ -329,7 +329,6 @@
 	spc-spc_dying = 0;
 
 	atomic_inc_uint(disco);
-
 }
 
 static void
@@ -622,25 +621,22 @@
 	DPRINTF((rump_sp: server mainloop\n));
 
 	for (;;) {
-		/* g/c hangarounds (eventually) */
-		if (disco) {
-			int discoed;
+		int discoed;
 
-			discoed = atomic_swap_uint(disco, 0);
-			while (discoed--) {
-nfds--;
-idx = maxidx;
-while (idx) {
-	if (pfdlist[idx].fd != -1) {
-		maxidx = idx;
-		break;
-	}
-	idx--;
+		/* g/c hangarounds (eventually) */
+		discoed = atomic_swap_uint(disco, 0);
+		while (discoed--) {
+			nfds--;
+			idx = maxidx;
+			while (idx) {
+if (pfdlist[idx].fd != -1) {
+	maxidx = idx;
+	break;
 }
-DPRINTF((rump_sp: set maxidx to [%u]\n,
-maxidx));
-assert(maxidx+1 = nfds);
+idx--;
 			}
+			DPRINTF((rump_sp: set maxidx to [%u]\n,
+			maxidx));
 		}
 
 		DPRINTF((rump_sp: loop nfd %d\n, maxidx+1));
@@ -744,7 +740,7 @@
 		fprintf(stderr, rump_sp: server bind failed\n);
 		return errno;
 	}
-	if (listen(s, 20) == -1) {
+	if (listen(s, MAXCLI) == -1) {
 		fprintf(stderr, rump_sp: server listen failed\n);
 		return errno;
 	}

Index: src/lib/librumpuser/sp_common.c
diff -u src/lib/librumpuser/sp_common.c:1.11 src/lib/librumpuser/sp_common.c:1.12
--- src/lib/librumpuser/sp_common.c:1.11	Fri Nov 26 14:37:08 2010
+++ src/lib/librumpuser/sp_common.c	Fri Nov 26 18:51:03 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: sp_common.c,v 1.11 2010/11/26 14:37:08 pooka Exp $	*/
+/*  $NetBSD: sp_common.c,v 1.12 2010/11/26 18:51:03 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -133,7 +133,7 @@
 	TAILQ_HEAD(, respwait) spc_respwait;
 
 	/* rest of the fields are zeroed upon disconnect */
-#define SPC_ZEROFF offsetof(struct spclient, spc_pid)
+#define SPC_ZEROFF offsetof(struct spclient, spc_pfd)
 	struct pollfd *spc_pfd;
 
 	struct rsp_hdr spc_hdr;
@@ -154,26 +154,42 @@
 static void handlereq(struct spclient *);
 
 static void
-sendlock(struct spclient *spc)
+sendlockl(struct spclient *spc)
 {
 
-	pthread_mutex_lock(spc-spc_mtx);
+	/* assert(pthread_mutex_owned) */
 	while (spc-spc_ostatus != SPCSTATUS_FREE) {
 		spc-spc_ostatus = SPCSTATUS_WANTED;
 		pthread_cond_wait(spc-spc_cv, spc-spc_mtx);
 	}
 	spc-spc_ostatus = SPCSTATUS_BUSY;
-	pthread_mutex_unlock(spc-spc_mtx);
 }
 
 static void
-sendunlock(struct spclient *spc)
+sendlock(struct spclient *spc)
 {
 
 	pthread_mutex_lock(spc-spc_mtx);
+	sendlockl(spc);
+	pthread_mutex_unlock(spc-spc_mtx);
+}
+
+static void
+sendunlockl(struct spclient *spc)
+{
+
+	/* assert(pthread_mutex_owned) */
 	if (spc-spc_ostatus == SPCSTATUS_WANTED)
 		pthread_cond_broadcast(spc-spc_cv);
 	spc-spc_ostatus = SPCSTATUS_FREE;
+}
+
+static void
+sendunlock(struct spclient *spc)
+{
+
+	pthread_mutex_lock(spc-spc_mtx);
+	sendunlockl(spc);
 	pthread_mutex_unlock(spc-spc_mtx);
 }
 
@@ -224,12 +240,16 @@
 	pthread_mutex_lock(spc-spc_mtx);
 	rw-rw_reqno = rhdr-rsp_reqno = spc-spc_nextreq++;
 	TAILQ_INSERT_TAIL(spc-spc_respwait, rw, rw_entries);
+
+	sendlockl(spc);
 }
 
 static void
 unputwait(struct spclient *spc, struct respwait *rw)
 {
 
+	sendunlockl(spc);
+
 	TAILQ_REMOVE(spc-spc_respwait, rw, rw_entries);
 	pthread_mutex_unlock(spc-spc_mtx);
 	pthread_cond_destroy(rw-rw_cv);
@@ -267,7 +287,7 @@
 
 	/* DIAGASSERT(mutex_owned(spc_lock)) */
 	TAILQ_FOREACH(rw, spc-spc_respwait, rw_entries)
-		pthread_cond_signal(rw-rw_cv);
+		pthread_cond_broadcast(rw-rw_cv);
 }
 
 static int
@@ -276,6 +296,8 @@
 	struct pollfd pfd;
 	

CVS commit: src/sys/uvm

2010-11-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 26 18:51:19 UTC 2010

Modified Files:
src/sys/uvm: uvm_pmap.h

Log Message:
don't leak kernel variables to userland!


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/uvm/uvm_pmap.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/uvm/uvm_pmap.h
diff -u src/sys/uvm/uvm_pmap.h:1.33 src/sys/uvm/uvm_pmap.h:1.34
--- src/sys/uvm/uvm_pmap.h:1.33	Tue Jul  6 17:11:22 2010
+++ src/sys/uvm/uvm_pmap.h	Fri Nov 26 13:51:19 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pmap.h,v 1.33 2010/07/06 21:11:22 cegger Exp $	*/
+/*	$NetBSD: uvm_pmap.h,v 1.34 2010/11/26 18:51:19 christos Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993
@@ -73,9 +73,6 @@
 struct pmap;
 typedef struct pmap *pmap_t;
 
-extern struct pmap	*const kernel_pmap_ptr;
-#define pmap_kernel()	kernel_pmap_ptr
-
 /*
  * Each machine dependent implementation is expected to
  * keep certain statistics.  They may do this anyway they
@@ -90,6 +87,10 @@
 
 #ifdef _KERNEL
 #include machine/pmap.h
+
+extern struct pmap	*const kernel_pmap_ptr;
+#define pmap_kernel()	kernel_pmap_ptr
+
 #endif
 
 /*



CVS commit: src/usr.sbin/faithd

2010-11-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Nov 26 18:58:43 UTC 2010

Modified Files:
src/usr.sbin/faithd: Makefile faithd.c faithd.h ftp.c prefix.c tcp.c

Log Message:
KNF, pass lint.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/faithd/Makefile
cvs rdiff -u -r1.32 -r1.33 src/usr.sbin/faithd/faithd.c
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/faithd/faithd.h \
src/usr.sbin/faithd/tcp.c
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/faithd/ftp.c
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/faithd/prefix.c

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

Modified files:

Index: src/usr.sbin/faithd/Makefile
diff -u src/usr.sbin/faithd/Makefile:1.4 src/usr.sbin/faithd/Makefile:1.5
--- src/usr.sbin/faithd/Makefile:1.4	Mon May 28 08:06:34 2007
+++ src/usr.sbin/faithd/Makefile	Fri Nov 26 13:58:43 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2007/05/28 12:06:34 tls Exp $
+# $NetBSD: Makefile,v 1.5 2010/11/26 18:58:43 christos Exp $
 
 USE_FORT?= yes	# network server
 
@@ -6,6 +6,6 @@
 SRCS=	faithd.c tcp.c ftp.c prefix.c
 MAN=	faithd.8
 
-#CFLAGS+= -DFAITH4
+#CPPFLAGS+= -DFAITH4
 
 .include bsd.prog.mk

Index: src/usr.sbin/faithd/faithd.c
diff -u src/usr.sbin/faithd/faithd.c:1.32 src/usr.sbin/faithd/faithd.c:1.33
--- src/usr.sbin/faithd/faithd.c:1.32	Sat Dec 15 11:32:07 2007
+++ src/usr.sbin/faithd/faithd.c	Fri Nov 26 13:58:43 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: faithd.c,v 1.32 2007/12/15 16:32:07 perry Exp $	*/
+/*	$NetBSD: faithd.c,v 1.33 2010/11/26 18:58:43 christos Exp $	*/
 /*	$KAME: faithd.c,v 1.62 2003/08/19 21:20:33 itojun Exp $	*/
 
 /*
@@ -77,7 +77,6 @@
 
 char *serverpath = NULL;
 char *serverarg[MAXARGV + 1];
-static char *faithdname = NULL;
 char logname[BUFSIZ];
 char procname[BUFSIZ];
 struct myaddrs {
@@ -94,22 +93,21 @@
 static int inetd = 0;
 static char *configfile = NULL;
 
-int main __P((int, char **));
-static int inetd_main __P((int, char **));
-static int daemon_main __P((int, char **));
-static void play_service __P((int));
-static void play_child __P((int, struct sockaddr *));
-static int faith_prefix __P((struct sockaddr *));
-static int map6to4 __P((struct sockaddr_in6 *, struct sockaddr_in *));
-static void sig_child __P((int));
-static void sig_terminate __P((int));
-static void start_daemon __P((void));
-static void exit_stderr __P((const char *, ...))
+static int inetd_main(int, char **);
+static int daemon_main(int, char **);
+static void play_service(int);
+static void play_child(int, struct sockaddr *);
+static int faith_prefix(struct sockaddr *);
+static int map6to4(struct sockaddr_in6 *, struct sockaddr_in *);
+static void sig_child(int);
+static void sig_terminate(int);
+static void start_daemon(void);
+static void exit_stderr(const char *, ...)
 	__attribute__((__format__(__printf__, 1, 2)));
-static void grab_myaddrs __P((void));
-static void free_myaddrs __P((void));
-static void update_myaddrs __P((void));
-static void usage __P((void));
+static void grab_myaddrs(void);
+static void free_myaddrs(void);
+static void update_myaddrs(void);
+static void usage(void) __attribute__((__noreturn__));
 
 int
 main(int argc, char **argv)
@@ -119,13 +117,9 @@
 	 * Initializing stuff
 	 */
 
-	faithdname = strrchr(argv[0], '/');
-	if (faithdname)
-		faithdname++;
-	else
-		faithdname = argv[0];
+	setprogname(argv[0]);
 
-	if (strcmp(faithdname, faithd) != 0) {
+	if (strcmp(getprogname(), faithd) != 0) {
 		inetd = 1;
 		return inetd_main(argc, argv);
 	} else
@@ -150,9 +144,10 @@
 	}
 
 	if (strrchr(argv[0], '/') == NULL)
-		snprintf(path, sizeof(path), %s/%s, DEFAULT_DIR, argv[0]);
+		(void)snprintf(path, sizeof(path), %s/%s, DEFAULT_DIR,
+		argv[0]);
 	else
-		snprintf(path, sizeof(path), %s, argv[0]);
+		(void)snprintf(path, sizeof(path), %s, argv[0]);
 
 #ifdef USE_ROUTE
 	grab_myaddrs();
@@ -165,26 +160,26 @@
 #endif
 
 	melen = sizeof(me);
-	if (getsockname(STDIN_FILENO, (struct sockaddr *)me, melen)  0) {
+	if (getsockname(STDIN_FILENO, (void *)me, melen) == -1) {
 		exit_failure(getsockname: %s, strerror(errno));
 		/*NOTREACHED*/
 	}
 	fromlen = sizeof(from);
-	if (getpeername(STDIN_FILENO, (struct sockaddr *)from, fromlen)  0) {
+	if (getpeername(STDIN_FILENO, (void *)from, fromlen) == -1) {
 		exit_failure(getpeername: %s, strerror(errno));
 		/*NOTREACHED*/
 	}
-	if (getnameinfo((struct sockaddr *)me, melen, NULL, 0,
-	sbuf, sizeof(sbuf), NI_NUMERICHOST) == 0)
+	if (getnameinfo((void *)me, melen, NULL, 0,
+	sbuf, (socklen_t)sizeof(sbuf), NI_NUMERICHOST) == 0)
 		service = sbuf;
 	else
 		service = DEFAULT_PORT_NAME;
-	if (getnameinfo((struct sockaddr *)me, melen, NULL, 0,
-	snum, sizeof(snum), NI_NUMERICHOST) != 0)
-		snprintf(snum, sizeof(snum), ?);
+	if (getnameinfo((void *)me, melen, NULL, 0,
+	snum, (socklen_t)sizeof(snum), NI_NUMERICHOST) != 0)
+		(void)snprintf(snum, sizeof(snum), ?);
 
-	snprintf(logname, sizeof(logname), faithd %s, snum);

CVS commit: xsrc/external/mit/xf86-video-vmware/include

2010-11-26 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Fri Nov 26 20:45:42 UTC 2010

Modified Files:
xsrc/external/mit/xf86-video-vmware/include: config.h

Log Message:
regenerate this with xorg-server 1.9.2: #define HAVE_XORG_SERVER_1_7_0 1


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 xsrc/external/mit/xf86-video-vmware/include/config.h

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

Modified files:

Index: xsrc/external/mit/xf86-video-vmware/include/config.h
diff -u xsrc/external/mit/xf86-video-vmware/include/config.h:1.7 xsrc/external/mit/xf86-video-vmware/include/config.h:1.8
--- xsrc/external/mit/xf86-video-vmware/include/config.h:1.7	Sat Nov 20 22:09:03 2010
+++ xsrc/external/mit/xf86-video-vmware/include/config.h	Fri Nov 26 20:45:41 2010
@@ -49,7 +49,7 @@
 #define HAVE_XORG_SERVER_1_5_0 1
 
 /* Has version 1.7.0 or greater of the Xserver */
-#undef HAVE_XORG_SERVER_1_7_0
+#define HAVE_XORG_SERVER_1_7_0 1
 
 /* Define to the sub-directory in which libtool stores uninstalled libraries.
*/



CVS commit: xsrc/external/mit/xf86-video-pnozz/dist/src

2010-11-26 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Fri Nov 26 21:18:10 UTC 2010

Modified Files:
xsrc/external/mit/xf86-video-pnozz/dist/src: pnozz_driver.c

Log Message:
apply some GET_ABI_MAJOR() and avoid compile errors


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_driver.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_driver.c
diff -u xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_driver.c:1.3 xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_driver.c:1.4
--- xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_driver.c:1.3	Wed Nov 24 02:54:09 2010
+++ xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_driver.c	Fri Nov 26 21:18:10 2010
@@ -20,7 +20,7 @@
  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
-/* $NetBSD: pnozz_driver.c,v 1.3 2010/11/24 02:54:09 mrg Exp $ */
+/* $NetBSD: pnozz_driver.c,v 1.4 2010/11/26 21:18:10 mrg Exp $ */
 
 /*
  * this driver has been tested on SPARCbook 3GX and 3TX, it supports full 
@@ -36,7 +36,9 @@
 #include xf86.h
 #include xf86_OSproc.h
 
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION)  6
 #include xf86Resources.h
+#endif
 #include xf86sbusBus.h
 
 #include mipointer.h



CVS commit: src/sys/dev/pci

2010-11-26 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Fri Nov 26 21:59:49 UTC 2010

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

Log Message:
Don't test flags with . From Henning Petersen in PR 44151.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pci/if_bnx.c

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

Modified files:

Index: src/sys/dev/pci/if_bnx.c
diff -u src/sys/dev/pci/if_bnx.c:1.33 src/sys/dev/pci/if_bnx.c:1.34
--- src/sys/dev/pci/if_bnx.c:1.33	Mon Apr  5 07:20:25 2010
+++ src/sys/dev/pci/if_bnx.c	Fri Nov 26 21:59:49 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bnx.c,v 1.33 2010/04/05 07:20:25 joerg Exp $	*/
+/*	$NetBSD: if_bnx.c,v 1.34 2010/11/26 21:59:49 dholland Exp $	*/
 /*	$OpenBSD: if_bnx.c,v 1.85 2009/11/09 14:32:41 dlg Exp $ */
 
 /*-
@@ -35,7 +35,7 @@
 #if 0
 __FBSDID($FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $);
 #endif
-__KERNEL_RCSID(0, $NetBSD: if_bnx.c,v 1.33 2010/04/05 07:20:25 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_bnx.c,v 1.34 2010/11/26 21:59:49 dholland Exp $);
 
 /*
  * The following controllers are supported by this driver:
@@ -1996,7 +1996,7 @@
 	} else if (BNX_CHIP_BOND_ID(sc)  BNX_CHIP_BOND_ID_SERDES_BIT)
 		sc-bnx_phy_flags |= BNX_PHY_SERDES_FLAG;
 
-	if (sc-bnx_phy_flags  BNX_PHY_SERDES_FLAG) {
+	if (sc-bnx_phy_flags  BNX_PHY_SERDES_FLAG) {
 		u_int32_t val;
  
 		sc-bnx_flags |= BNX_NO_WOL_FLAG;



CVS commit: src/lib/libkvm

2010-11-26 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Fri Nov 26 22:01:53 UTC 2010

Modified Files:
src/lib/libkvm: kvm.c

Log Message:
Return error on failure instead of hiding it and always returning zero.
From Henning Petersen in PR 44152.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/lib/libkvm/kvm.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/libkvm/kvm.c
diff -u src/lib/libkvm/kvm.c:1.96 src/lib/libkvm/kvm.c:1.97
--- src/lib/libkvm/kvm.c:1.96	Sat Oct 23 14:34:12 2010
+++ src/lib/libkvm/kvm.c	Fri Nov 26 22:01:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: kvm.c,v 1.96 2010/10/23 14:34:12 stacktic Exp $	*/
+/*	$NetBSD: kvm.c,v 1.97 2010/11/26 22:01:53 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1992, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = @(#)kvm.c	8.2 (Berkeley) 2/13/94;
 #else
-__RCSID($NetBSD: kvm.c,v 1.96 2010/10/23 14:34:12 stacktic Exp $);
+__RCSID($NetBSD: kvm.c,v 1.97 2010/11/26 22:01:53 dholland Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -759,7 +759,7 @@
 		free(kd-iobuf);
 	free(kd);
 
-	return (0);
+	return (error);
 }
 
 int



CVS commit: src/usr.bin/hexdump

2010-11-26 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Nov 27 00:42:58 UTC 2010

Modified Files:
src/usr.bin/hexdump: odsyntax.c

Log Message:
PR 44156: od -? prints usage for hexdump rather than od


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/hexdump/odsyntax.c

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

Modified files:

Index: src/usr.bin/hexdump/odsyntax.c
diff -u src/usr.bin/hexdump/odsyntax.c:1.26 src/usr.bin/hexdump/odsyntax.c:1.27
--- src/usr.bin/hexdump/odsyntax.c:1.26	Tue Feb  9 14:06:37 2010
+++ src/usr.bin/hexdump/odsyntax.c	Sat Nov 27 00:42:58 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: odsyntax.c,v 1.26 2010/02/09 14:06:37 drochner Exp $	*/
+/*	$NetBSD: odsyntax.c,v 1.27 2010/11/27 00:42:58 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = @(#)odsyntax.c	8.2 (Berkeley) 5/4/95;
 #else
-__RCSID($NetBSD: odsyntax.c,v 1.26 2010/02/09 14:06:37 drochner Exp $);
+__RCSID($NetBSD: odsyntax.c,v 1.27 2010/11/27 00:42:58 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -72,6 +72,7 @@
 
 static void odoffset(int, char ***);
 static void posixtypes(char const *);
+static void odusage(void);
 
 void
 odsyntax(int argc, char ***argvp)
@@ -176,7 +177,7 @@
 			break;
 		case '?':
 		default:
-			usage();
+			odusage();
 		}
 
 	if (fshead-nextfs-nextfs == NULL)
@@ -246,7 +247,7 @@
 default:
 	warnx(Bad type-size qualifier '%c',
 	*type_string);
-	usage();
+	odusage();
 }
 type_string++;
 			} else if (isdigit((unsigned char)*type_string)) {
@@ -276,7 +277,7 @@
 default:
 	warnx(Bad type-size qualifier '%c',
 	*type_string);
-	usage();
+	odusage();
 }
 type_string++;
 			} else if (isdigit((unsigned char)*type_string)) {
@@ -286,7 +287,7 @@
 nbytes = 4;
 			break;
 		default:
-			usage();
+			odusage();
 		}
 		for (odf = odftab; odf-type != 0; odf++)
 			if (odf-type == type  odf-nbytes == nbytes)
@@ -396,3 +397,12 @@
 	/* Terminate file list. */
 	(*argvp)[1] = NULL;
 }
+
+static void
+odusage(void)
+{
+	(void)warnx(Usage: od [-aBbcDdeFfHhIiLlOovXx] [-A base] [-j skip]
+		 [-N length]);
+	(void)warnx(   [-t type_string] [[+]offset[.][Bb]] [file ...]);
+	exit(1);
+}



CVS commit: src/usr.bin/make

2010-11-26 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Sat Nov 27 05:02:35 UTC 2010

Modified Files:
src/usr.bin/make: dir.c meta.c

Log Message:
When a source file moves, make will ignore the stale dependency,
but if the file in question is one that needs to be compiled (.c or .cc),
it still hands the bogus name to the compiler.

If Dir_MTime() cannot find such a file (gn-iParents is not empty),
see if the basename can be found via .PATH, and if so set gn-path to
the found file.   This prevents the stale path being given to the
compiler.

In meta_oodate(), if a referenced file no longer exists, consider the
target out-of-date.

Also, if meta_oodate() decides a target is out-of-date, and it
it uses .OODATE in its commands, we need .OODATE recomputed.
Undo our call to Make_DoAllVar() so that the call from Make_OODate()
will do the right thing.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/usr.bin/make/dir.c
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/meta.c

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

Modified files:

Index: src/usr.bin/make/dir.c
diff -u src/usr.bin/make/dir.c:1.61 src/usr.bin/make/dir.c:1.62
--- src/usr.bin/make/dir.c:1.61	Sat Jan 24 10:59:09 2009
+++ src/usr.bin/make/dir.c	Sat Nov 27 05:02:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.61 2009/01/24 10:59:09 dsl Exp $	*/
+/*	$NetBSD: dir.c,v 1.62 2010/11/27 05:02:35 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = $NetBSD: dir.c,v 1.61 2009/01/24 10:59:09 dsl Exp $;
+static char rcsid[] = $NetBSD: dir.c,v 1.62 2010/11/27 05:02:35 sjg Exp $;
 #else
 #include sys/cdefs.h
 #ifndef lint
 #if 0
 static char sccsid[] = @(#)dir.c	8.2 (Berkeley) 1/2/94;
 #else
-__RCSID($NetBSD: dir.c,v 1.61 2009/01/24 10:59:09 dsl Exp $);
+__RCSID($NetBSD: dir.c,v 1.62 2010/11/27 05:02:35 sjg Exp $);
 #endif
 #endif /* not lint */
 #endif
@@ -1434,6 +1434,31 @@
 	fullName = NULL;
 	else {
 	fullName = Dir_FindFile(gn-name, Suff_FindPath(gn));
+	if (fullName == NULL  gn-flags  FROM_DEPEND 
+		!Lst_IsEmpty(gn-iParents)) {
+		char *cp;
+
+		cp = strrchr(gn-name, '/');
+		if (cp) {
+		/*
+		 * This is an implied source, and it may have moved,
+		 * see if we can find it via the current .PATH
+		 */
+		cp++;
+			
+		fullName = Dir_FindFile(cp, Suff_FindPath(gn));
+		if (fullName) {
+			/*
+			 * Put the found file in gn-path
+			 * so that we give that to the compiler.
+			 */
+			gn-path = bmake_strdup(fullName);
+			fprintf(stdout,
+%s: ignoring stale %s for %s, found %s\n,
+progname, makeDependfile, gn-name, fullName);
+		}
+		}
+	}
 	if (DEBUG(DIR))
 		fprintf(debug_file, Found '%s' as '%s'\n,
 			gn-name, fullName ? fullName : (not found) );

Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.3 src/usr.bin/make/meta.c:1.4
--- src/usr.bin/make/meta.c:1.3	Mon Sep 13 21:31:59 2010
+++ src/usr.bin/make/meta.c	Sat Nov 27 05:02:35 2010
@@ -707,6 +707,9 @@
 FILE *fp;
 Boolean ignoreOODATE = FALSE;
 
+if (oodate)
+	return oodate;		/* we're done */
+
 /*
  * We need to check if the target is out-of-date. This includes
  * checking if the expanded command has changed. This in turn
@@ -715,9 +718,6 @@
  */
 Make_DoAllVar(gn);
 
-if (oodate)
-	return oodate;		/* we're done */
-
 if (getcwd(latestdir, sizeof(latestdir)) == NULL)
 	err(1, Could not get current working directory);
 
@@ -809,11 +809,16 @@
 			p = fname1;
 		}
 
-		if (stat(p, fs) == 0 
-			!S_ISDIR(fs.st_mode) 
-			fs.st_mtime  gn-mtime) {
+		if (stat(p, fs) == 0) {
+			if (!S_ISDIR(fs.st_mode) 
+			fs.st_mtime  gn-mtime) {
+			if (DEBUG(META))
+fprintf(debug_file, %s: %d: file '%s' is newer than the target...\n, fname, lineno, p);
+			oodate = TRUE;
+			}
+		} else if (errno == ENOENT) {
 			if (DEBUG(META))
-			fprintf(debug_file, %s: %d: file '%s' is newer than the target...\n, fname, lineno, p);
+			fprintf(debug_file, %s: %d: file '%s' may have moved?...\n, fname, lineno, p);
 			oodate = TRUE;
 		}
 		break;
@@ -904,6 +909,15 @@
 
 	fclose(fp);
 }
+if (oodate  ignoreOODATE) {
+	/*
+	 * Target uses .OODATE, so we need to re-compute it.
+	 * We need to clean up what Make_DoAllVar() did.
+	 */
+	Var_Delete(ALLSRC, gn);
+	Var_Delete(OODATE, gn);
+	gn-flags = ~DONE_ALLSRC;
+}
 return oodate;
 }