CVS commit: src/sys/kern

2010-07-28 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Jul 28 09:30:21 UTC 2010

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

Log Message:
Modify vn_lock():
- Take v_interlock before examining v_iflag
- Must always be called without v_interlock taken,
  LK_INTERLOCK flag is no longer allowed.


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/kern/vfs_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/kern/vfs_vnops.c
diff -u src/sys/kern/vfs_vnops.c:1.175 src/sys/kern/vfs_vnops.c:1.176
--- src/sys/kern/vfs_vnops.c:1.175	Tue Jul 13 15:38:15 2010
+++ src/sys/kern/vfs_vnops.c	Wed Jul 28 09:30:21 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_vnops.c,v 1.175 2010/07/13 15:38:15 pooka Exp $	*/
+/*	$NetBSD: vfs_vnops.c,v 1.176 2010/07/28 09:30:21 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_vnops.c,v 1.175 2010/07/13 15:38:15 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_vnops.c,v 1.176 2010/07/28 09:30:21 hannken Exp $);
 
 #include veriexec.h
 
@@ -770,12 +770,10 @@
 	int error;
 
 #if 0
-	KASSERT(vp-v_usecount  0 || (flags  LK_INTERLOCK) != 0
-	|| (vp-v_iflag  VI_ONWORKLST) != 0);
+	KASSERT(vp-v_usecount  0 || (vp-v_iflag  VI_ONWORKLST) != 0);
 #endif
-	KASSERT((flags 
-	~(LK_INTERLOCK|LK_SHARED|LK_EXCLUSIVE|LK_NOWAIT|LK_RETRY))
-	== 0);
+	KASSERT((flags  ~(LK_SHARED|LK_EXCLUSIVE|LK_NOWAIT|LK_RETRY)) == 0);
+	KASSERT(!mutex_owned(vp-v_interlock));
 
 #ifdef DIAGNOSTIC
 	if (wapbl_vphaswapbl(vp))
@@ -787,11 +785,8 @@
 		 * XXX PR 37706 forced unmount of file systems is unsafe.
 		 * Race between vclean() and this the remaining problem.
 		 */
+		mutex_enter(vp-v_interlock);
 		if (vp-v_iflag  VI_XLOCK) {
-			if ((flags  LK_INTERLOCK) == 0) {
-mutex_enter(vp-v_interlock);
-			}
-			flags = ~LK_INTERLOCK;
 			if (flags  LK_NOWAIT) {
 mutex_exit(vp-v_interlock);
 return EBUSY;
@@ -800,10 +795,7 @@
 			mutex_exit(vp-v_interlock);
 			error = ENOENT;
 		} else {
-			if ((flags  LK_INTERLOCK) != 0) {
-mutex_exit(vp-v_interlock);
-			}
-			flags = ~LK_INTERLOCK;
+			mutex_exit(vp-v_interlock);
 			error = VOP_LOCK(vp, (flags  ~LK_RETRY));
 			if (error == 0 || error == EDEADLK || error == EBUSY)
 return (error);



CVS commit: src/sys/sys

2010-07-28 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Jul 28 09:31:00 UTC 2010

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

Log Message:
Remove now unneeded flag LK_INTERLOCK.


To generate a diff of this commit:
cvs rdiff -u -r1.221 -r1.222 src/sys/sys/vnode.h

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

Modified files:

Index: src/sys/sys/vnode.h
diff -u src/sys/sys/vnode.h:1.221 src/sys/sys/vnode.h:1.222
--- src/sys/sys/vnode.h:1.221	Thu Jul  1 13:00:57 2010
+++ src/sys/sys/vnode.h	Wed Jul 28 09:31:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnode.h,v 1.221 2010/07/01 13:00:57 hannken Exp $	*/
+/*	$NetBSD: vnode.h,v 1.222 2010/07/28 09:31:00 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -239,7 +239,6 @@
 #define	LK_SHARED	0x0001	/* shared lock */
 #define	LK_EXCLUSIVE	0x0002	/* exclusive lock */
 #define	LK_NOWAIT	0x0010	/* do not sleep to await lock */
-#define	LK_INTERLOCK	0x0001	/* caller holds v_interlock */
 #define	LK_RETRY	0x0002	/* vn_lock: retry until locked */
 
 /*



CVS commit: src/sys/rump/include/rump

2010-07-28 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Jul 28 09:32:13 UTC 2010

Modified Files:
src/sys/rump/include/rump: rumpdefs.h

Log Message:
Regen. LK_INTERLOCK is gone.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/rump/include/rump/rumpdefs.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/rump/include/rump/rumpdefs.h
diff -u src/sys/rump/include/rump/rumpdefs.h:1.8 src/sys/rump/include/rump/rumpdefs.h:1.9
--- src/sys/rump/include/rump/rumpdefs.h:1.8	Fri Jul  2 10:45:16 2010
+++ src/sys/rump/include/rump/rumpdefs.h	Wed Jul 28 09:32:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpdefs.h,v 1.8 2010/07/02 10:45:16 hannken Exp $	*/
+/*	$NetBSD: rumpdefs.h,v 1.9 2010/07/28 09:32:13 hannken Exp $	*/
 
 /*
  *	AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -29,7 +29,7 @@
 #define	RUMP_O_DIRECT	0x0008	/* direct I/O hint */
 #define	RUMP_O_NOCTTY	0x8000	/* don't assign controlling terminal */
 
-/*	NetBSD: vnode.h,v 1.221 2010/07/01 13:00:57 hannken Exp 	*/
+/*	NetBSD: vnode.h,v 1.222 2010/07/28 09:31:00 hannken Exp 	*/
 #ifndef __VTYPE_DEFINED
 #define __VTYPE_DEFINED
 enum vtype	{ VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO, VBAD };
@@ -37,7 +37,6 @@
 #define	RUMP_LK_SHARED	0x0001	
 #define	RUMP_LK_EXCLUSIVE	0x0002	
 #define	RUMP_LK_NOWAIT	0x0010	
-#define	RUMP_LK_INTERLOCK	0x0001	
 #define	RUMP_LK_RETRY	0x0002	
 
 /*	NetBSD: errno.h,v 1.39 2006/10/31 00:38:07 cbiere Exp 	*/



CVS commit: src

2010-07-28 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Jul 28 13:51:41 UTC 2010

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/lib/csu: Makefile t_crt0.sh
Added Files:
src/tests/lib/csu: h_initfini1.cxx h_initfini3.cxx
h_initfini_common.cxx
src/tests/lib/csu/dso: Makefile h_initfini3_dso.cxx
Removed Files:
src/tests/lib/csu: h_initfini.c
src/tests/lib/csu/arch/alpha: initfini_asm.S
src/tests/lib/csu/arch/arm: initfini_asm.S
src/tests/lib/csu/arch/hppa: initfini_asm.S
src/tests/lib/csu/arch/i386: initfini_asm.S
src/tests/lib/csu/arch/m68k: initfini_asm.S
src/tests/lib/csu/arch/mips: initfini_asm.S
src/tests/lib/csu/arch/powerpc: initfini_asm.S
src/tests/lib/csu/arch/sh3: initfini_asm.S
src/tests/lib/csu/arch/sparc: initfini_asm.S
src/tests/lib/csu/arch/sparc64: initfini_asm.S
src/tests/lib/csu/arch/vax: initfini_asm.S
src/tests/lib/csu/arch/x86_64: initfini_asm.S

Log Message:
Replace csu test case with a C++ based version. This makes the various
assembler routines obsolete. Be more exhaustive by testing dynamically
linked, statically linked and dynamically loaded.

XXX currently hard-codes /usr/tests due to limitations of bsd.test.mk


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/csu/Makefile \
src/tests/lib/csu/t_crt0.sh
cvs rdiff -u -r1.1 -r0 src/tests/lib/csu/h_initfini.c
cvs rdiff -u -r0 -r1.1 src/tests/lib/csu/h_initfini1.cxx \
src/tests/lib/csu/h_initfini3.cxx src/tests/lib/csu/h_initfini_common.cxx
cvs rdiff -u -r1.1 -r0 src/tests/lib/csu/arch/alpha/initfini_asm.S
cvs rdiff -u -r1.1 -r0 src/tests/lib/csu/arch/arm/initfini_asm.S
cvs rdiff -u -r1.1 -r0 src/tests/lib/csu/arch/hppa/initfini_asm.S
cvs rdiff -u -r1.1 -r0 src/tests/lib/csu/arch/i386/initfini_asm.S
cvs rdiff -u -r1.1 -r0 src/tests/lib/csu/arch/m68k/initfini_asm.S
cvs rdiff -u -r1.1 -r0 src/tests/lib/csu/arch/mips/initfini_asm.S
cvs rdiff -u -r1.1 -r0 src/tests/lib/csu/arch/powerpc/initfini_asm.S
cvs rdiff -u -r1.1 -r0 src/tests/lib/csu/arch/sh3/initfini_asm.S
cvs rdiff -u -r1.1 -r0 src/tests/lib/csu/arch/sparc/initfini_asm.S
cvs rdiff -u -r1.1 -r0 src/tests/lib/csu/arch/sparc64/initfini_asm.S
cvs rdiff -u -r1.1 -r0 src/tests/lib/csu/arch/vax/initfini_asm.S
cvs rdiff -u -r1.1 -r0 src/tests/lib/csu/arch/x86_64/initfini_asm.S
cvs rdiff -u -r0 -r1.1 src/tests/lib/csu/dso/Makefile \
src/tests/lib/csu/dso/h_initfini3_dso.cxx

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.119 src/distrib/sets/lists/tests/mi:1.120
--- src/distrib/sets/lists/tests/mi:1.119	Mon Jul 26 19:19:15 2010
+++ src/distrib/sets/lists/tests/mi	Wed Jul 28 13:51:38 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.119 2010/07/26 19:19:15 pooka Exp $
+# $NetBSD: mi,v 1.120 2010/07/28 13:51:38 joerg Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -265,7 +265,9 @@
 ./usr/libdata/debug/usr/tests/kernel/tty/t_pr.debug			tests-kernel-tests	debug,atf
 ./usr/libdata/debug/usr/tests/lib	tests-lib-debug
 ./usr/libdata/debug/usr/tests/lib/csu	tests-lib-debug
-./usr/libdata/debug/usr/tests/lib/csu/h_initfini.debug			tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/csu/h_initfini1.debug			tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/csu/h_initfini2.debug			tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/csu/h_initfini3.debug			tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc	tests-lib-debug
 ./usr/libdata/debug/usr/tests/lib/libc/hashtests-lib-debug
 ./usr/libdata/debug/usr/tests/lib/libc/hash/t_sha2.debug		tests-lib-debug		debug,atf
@@ -1371,7 +1373,11 @@
 ./usr/tests/lib/Atffiletests-lib-tests		atf
 ./usr/tests/lib/csutests-lib-tests
 ./usr/tests/lib/csu/Atffile			tests-lib-tests		atf
-./usr/tests/lib/csu/h_initfini			tests-lib-tests		atf
+./usr/tests/lib/csu/h_initfini1			tests-lib-tests		atf
+./usr/tests/lib/csu/h_initfini2			tests-lib-tests		atf
+./usr/tests/lib/csu/h_initfini3			tests-lib-tests		atf
+./usr/tests/lib/csu/libh_initfini3_dso.so	tests-lib-tests		atf
+./usr/tests/lib/csu/libh_initfini3_dso.so.1	tests-lib-tests		atf
 ./usr/tests/lib/csu/t_crt0			tests-lib-tests		atf
 ./usr/tests/lib/libctests-lib-tests
 ./usr/tests/lib/libc/Atffile			tests-lib-tests		atf

Index: src/tests/lib/csu/Makefile
diff -u src/tests/lib/csu/Makefile:1.1 src/tests/lib/csu/Makefile:1.2
--- src/tests/lib/csu/Makefile:1.1	Sat Jul 17 19:25:27 2010
+++ src/tests/lib/csu/Makefile	Wed Jul 28 13:51:38 2010
@@ -1,19 +1,20 @@
-# $NetBSD: Makefile,v 1.1 2010/07/17 19:25:27 jmmv Exp $
+# $NetBSD: Makefile,v 1.2 2010/07/28 13:51:38 joerg Exp $
 
-NOMAN=		# defined

CVS commit: src/tests/fs/common

2010-07-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jul 28 14:23:02 UTC 2010

Modified Files:
src/tests/fs/common: h_fsmacros.h

Log Message:
Add FSTEST_CONSTRUCTOR/FSTEST_DESTRUCTOR which create/mount the
file system with default params.  Make ATF_FS_APPLY use the
constructor (can't use the destructor due to the (useless) cleanup).


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/tests/fs/common/h_fsmacros.h

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

Modified files:

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.14 src/tests/fs/common/h_fsmacros.h:1.15
--- src/tests/fs/common/h_fsmacros.h:1.14	Mon Jul 26 16:15:49 2010
+++ src/tests/fs/common/h_fsmacros.h	Wed Jul 28 14:23:02 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.14 2010/07/26 16:15:49 pooka Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.15 2010/07/28 14:23:02 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -56,6 +56,23 @@
 #define FSTEST_IMGSIZE (1 * 512)
 #define FSTEST_MNTNAME /mnt
 
+#define FSTEST_CONSTRUCTOR(_tc_, _fs_, _args_)\
+do {	\
+	if (_fs_##_fstest_newfs(_tc_, _args_,\
+	FSTEST_IMGNAME, FSTEST_IMGSIZE) != 0)			\
+		atf_tc_fail(newfs failed);\
+	if (_fs_##_fstest_mount(_tc_, _args_, FSTEST_MNTNAME, 0) != 0)	\
+		atf_tc_fail(mount failed);\
+} while (/*CONSTCOND*/0);
+
+#define FSTEST_DESTRUCTOR(_tc_, _fs_, _args_)\
+do {	\
+	if (_fs_##_fstest_unmount(_tc_, FSTEST_MNTNAME, 0) != 0)	\
+		atf_tc_fail(unmount failed);\
+	if (_fs_##_fstest_delfs(_tc_, _args_) != 0)			\
+		atf_tc_fail(delfs failed);\
+} while (/*CONSTCOND*/0);
+
 #define ATF_TC_FSADD(fs,type,func,desc) \
   ATF_TC_WITH_CLEANUP(fs##_##func); \
   ATF_TC_HEAD(fs##_##func,tc) \
@@ -69,10 +86,7 @@
   { \
 if (!atf_check_fstype(tc, type)) \
   atf_tc_skip(filesystem not selected); \
-if (fs##_fstest_newfs(tc, fs##func##tmp, FSTEST_IMGNAME, FSTEST_IMGSIZE) != 0) \
-  atf_tc_fail(newfs failed); \
-if (fs##_fstest_mount(tc, fs##func##tmp, FSTEST_MNTNAME, 0) != 0) \
-  atf_tc_fail(mount failed); \
+FSTEST_CONSTRUCTOR(tc,fs,fs##func##tmp); \
 func(tc,FSTEST_MNTNAME); \
 if (fs##_fstest_unmount(tc, FSTEST_MNTNAME, 0) != 0) \
   atf_tc_fail(unmount failed); \



CVS commit: src/tests/fs/nfs/nfsservice/rpcbind

2010-07-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jul 28 15:11:30 UTC 2010

Modified Files:
src/tests/fs/nfs/nfsservice/rpcbind: rpcbind.c

Log Message:
Don't ignore SIGHUP here since mountd uses it.  The mountd signal
handler is installed later, so technically this is unnecessary,
but try to be complete.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/nfs/nfsservice/rpcbind/rpcbind.c

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

Modified files:

Index: src/tests/fs/nfs/nfsservice/rpcbind/rpcbind.c
diff -u src/tests/fs/nfs/nfsservice/rpcbind/rpcbind.c:1.1 src/tests/fs/nfs/nfsservice/rpcbind/rpcbind.c:1.2
--- src/tests/fs/nfs/nfsservice/rpcbind/rpcbind.c:1.1	Mon Jul 26 15:53:00 2010
+++ src/tests/fs/nfs/nfsservice/rpcbind/rpcbind.c	Wed Jul 28 15:11:30 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rpcbind.c,v 1.1 2010/07/26 15:53:00 pooka Exp $	*/
+/*	$NetBSD: rpcbind.c,v 1.2 2010/07/28 15:11:30 pooka Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -173,7 +173,7 @@
 	(void) signal(SIGQUIT, terminate);
 	/* ignore others that could get sent */
 	(void) signal(SIGPIPE, SIG_IGN);
-	(void) signal(SIGHUP, SIG_IGN);
+	//(void) signal(SIGHUP, SIG_IGN); used by mountd
 	(void) signal(SIGUSR1, SIG_IGN);
 	(void) signal(SIGUSR2, SIG_IGN);
 #ifdef WARMSTART



CVS commit: src/tests/fs/nfs/nfsservice

2010-07-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jul 28 15:12:17 UTC 2010

Modified Files:
src/tests/fs/nfs/nfsservice: nfsd.c

Log Message:
Make sure we are not executed in non-debug mode (which forks).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/nfs/nfsservice/nfsd.c

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

Modified files:

Index: src/tests/fs/nfs/nfsservice/nfsd.c
diff -u src/tests/fs/nfs/nfsservice/nfsd.c:1.2 src/tests/fs/nfs/nfsservice/nfsd.c:1.3
--- src/tests/fs/nfs/nfsservice/nfsd.c:1.2	Tue Jul 27 14:04:47 2010
+++ src/tests/fs/nfs/nfsservice/nfsd.c	Wed Jul 28 15:12:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfsd.c,v 1.2 2010/07/27 14:04:47 macallan Exp $	*/
+/*	$NetBSD: nfsd.c,v 1.3 2010/07/28 15:12:17 pooka Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)nfsd.c	8.9 (Berkeley) 3/29/95;
 #else
-__RCSID($NetBSD: nfsd.c,v 1.2 2010/07/27 14:04:47 macallan Exp $);
+__RCSID($NetBSD: nfsd.c,v 1.3 2010/07/28 15:12:17 pooka Exp $);
 #endif
 #endif /* not lint */
 
@@ -220,11 +220,16 @@
 		udpflag = 1;
 
 	if (debug == 0) {
+		fprintf(stderr, non-debug not supported here\n);
+		exit(1);
+
+#ifdef not_the_debug_man
 		daemon(0, 0);
 		(void)signal(SIGHUP, SIG_IGN);
 		(void)signal(SIGINT, SIG_IGN);
 		(void)signal(SIGQUIT, SIG_IGN);
 		(void)signal(SIGSYS, nonfs);
+#endif
 	}
 
 	if (udpflag) {



CVS commit: src/tests/fs/nfs/nfsservice

2010-07-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jul 28 15:15:23 UTC 2010

Modified Files:
src/tests/fs/nfs/nfsservice: mountd.c

Log Message:
Defer definitely-nonreentrant signal handler to thread context.
This protects from rump kernel reentry and makes things not
crash  burn.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/nfs/nfsservice/mountd.c

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

Modified files:

Index: src/tests/fs/nfs/nfsservice/mountd.c
diff -u src/tests/fs/nfs/nfsservice/mountd.c:1.3 src/tests/fs/nfs/nfsservice/mountd.c:1.4
--- src/tests/fs/nfs/nfsservice/mountd.c:1.3	Tue Jul 27 14:04:47 2010
+++ src/tests/fs/nfs/nfsservice/mountd.c	Wed Jul 28 15:15:22 2010
@@ -1,4 +1,4 @@
-/* 	$NetBSD: mountd.c,v 1.3 2010/07/27 14:04:47 macallan Exp $	 */
+/* 	$NetBSD: mountd.c,v 1.4 2010/07/28 15:15:22 pooka Exp $	 */
 
 /*
  * Copyright (c) 1989, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)mountd.c  8.15 (Berkeley) 5/1/95;
 #else
-__RCSID($NetBSD: mountd.c,v 1.3 2010/07/27 14:04:47 macallan Exp $);
+__RCSID($NetBSD: mountd.c,v 1.4 2010/07/28 15:15:22 pooka Exp $);
 #endif
 #endif/* not lint */
 
@@ -75,6 +75,7 @@
 #include netdb.h
 #include pwd.h
 #include netgroup.h
+#include pthread.h
 #include semaphore.h
 #include signal.h
 #include stdio.h
@@ -305,6 +306,31 @@
 }
 
 /*
+ * Make sure mountd signal handler is executed from a thread context
+ * instead of the signal handler.  This avoids the signal handler
+ * ruining our kernel context.
+ */
+static sem_t exportsem;
+static void
+signal_get_exportlist(int sig)
+{
+
+	sem_post(exportsem);
+}
+
+static void *
+exportlist_thread(void *arg)
+{
+
+	for (;;) {
+		sem_wait(exportsem);
+		get_exportlist(0);
+	}
+
+	return NULL;
+}
+
+/*
  * Mountd server for NFS mount protocol as described in:
  * NFS: Network File System Protocol Specification, RFC1094, Appendix A
  * The optional arguments are the exports file name
@@ -323,6 +349,7 @@
 	int maxrec = RPC_MAXDATASIZE;
 	in_port_t forcedport = 0;
 	extern sem_t gensem;
+	pthread_t ptdummy;
 
 	alloc_fdset();
 
@@ -361,6 +388,9 @@
 	argv += optind;
 #endif
 
+	sem_init(exportsem, 0, 0);
+	pthread_create(ptdummy, NULL, exportlist_thread, NULL);
+
 	grphead = NULL;
 	exphead = NULL;
 	mlhead = NULL;
@@ -381,7 +411,7 @@
 		(void)signal(SIGINT, SIG_IGN);
 		(void)signal(SIGQUIT, SIG_IGN);
 	}
-	(void)signal(SIGHUP, get_exportlist);
+	(void)signal(SIGHUP, signal_get_exportlist);
 	(void)signal(SIGTERM, send_umntall);
 	pidfile(NULL);
 



CVS commit: src/tests/fs/common

2010-07-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jul 28 15:16:50 UTC 2010

Modified Files:
src/tests/fs/common: h_fsmacros.h nfs.c

Log Message:
Move nfstestargs to header because I need them.  A more sweeping
action would be good here.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/tests/fs/common/h_fsmacros.h
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/common/nfs.c

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

Modified files:

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.15 src/tests/fs/common/h_fsmacros.h:1.16
--- src/tests/fs/common/h_fsmacros.h:1.15	Wed Jul 28 14:23:02 2010
+++ src/tests/fs/common/h_fsmacros.h	Wed Jul 28 15:16:50 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.15 2010/07/28 14:23:02 pooka Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.16 2010/07/28 15:16:50 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -160,4 +160,11 @@
 #define FSTYPE_TMPFS(tc)\
 (strcmp(atf_tc_get_md_var(tc, X-fs.type), MOUNT_TMPFS) == 0)
 
+
+/* file system args structures */
+struct nfstestargs {
+	pid_t ta_childpid;
+	char ta_ethername[MAXPATHLEN];
+};
+
 #endif /* __H_FSMACROS_H_ */

Index: src/tests/fs/common/nfs.c
diff -u src/tests/fs/common/nfs.c:1.1 src/tests/fs/common/nfs.c:1.2
--- src/tests/fs/common/nfs.c:1.1	Mon Jul 26 16:15:49 2010
+++ src/tests/fs/common/nfs.c	Wed Jul 28 15:16:50 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs.c,v 1.1 2010/07/26 16:15:49 pooka Exp $	*/
+/*	$NetBSD: nfs.c,v 1.2 2010/07/28 15:16:50 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -57,11 +57,6 @@
 #define NETNETMASK 255.255.255.0
 #define EXPORTPATH /myexport
 
-struct nfstestargs {
-	pid_t ta_childpid;
-	char ta_ethername[MAXPATHLEN];
-};
-
 static void
 childfail(int status)
 {



CVS commit: src/distrib/sets/lists/tests

2010-07-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jul 28 15:27:18 UTC 2010

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
+tp


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/distrib/sets/lists/tests/mi

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.120 src/distrib/sets/lists/tests/mi:1.121
--- src/distrib/sets/lists/tests/mi:1.120	Wed Jul 28 13:51:38 2010
+++ src/distrib/sets/lists/tests/mi	Wed Jul 28 15:27:18 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.120 2010/07/28 13:51:38 joerg Exp $
+# $NetBSD: mi,v 1.121 2010/07/28 15:27:18 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -197,6 +197,7 @@
 ./usr/libdata/debug/usr/tests/fs/msdosfstests-fs-debug
 ./usr/libdata/debug/usr/tests/fs/msdosfs/t_snapshot.debug		tests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/fs/nfs	tests-fs-debug
+./usr/libdata/debug/usr/tests/fs/nfs/t_mountd			tests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/fs/nfs/nfsservice	tests-fs-debug
 ./usr/libdata/debug/usr/tests/fs/nfs/nfsservice/rumpnfsd.debug			tests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/fs/nullfs	tests-fs-debug
@@ -938,6 +939,7 @@
 ./usr/tests/fs/msdosfs/Atffile			tests-fs-tests		atf
 ./usr/tests/fs/msdosfs/t_snapshot		tests-fs-tests		atf
 ./usr/tests/fs/nfstests-fs-tests
+./usr/tests/fs/nfs/t_mountdtests-fs-tests	atf
 ./usr/tests/fs/nfs/nfsservicetests-fs-tests
 ./usr/tests/fs/nfs/nfsservice/exports			tests-fs-tests		atf
 ./usr/tests/fs/nfs/nfsservice/rumpnfsd			tests-fs-tests		atf



CVS commit: src/sys/dev/acpi

2010-07-28 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jul 28 16:02:34 UTC 2010

Modified Files:
src/sys/dev/acpi: atk0110.c

Log Message:
Remove leftovers from the aiboost(4) removal.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/acpi/atk0110.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/acpi/atk0110.c
diff -u src/sys/dev/acpi/atk0110.c:1.11 src/sys/dev/acpi/atk0110.c:1.12
--- src/sys/dev/acpi/atk0110.c:1.11	Sun Mar 14 18:05:07 2010
+++ src/sys/dev/acpi/atk0110.c	Wed Jul 28 16:02:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: atk0110.c,v 1.11 2010/03/14 18:05:07 pgoyette Exp $	*/
+/*	$NetBSD: atk0110.c,v 1.12 2010/07/28 16:02:33 jruoho Exp $	*/
 /*	$OpenBSD: atk0110.c,v 1.1 2009/07/23 01:38:16 cnst Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: atk0110.c,v 1.11 2010/03/14 18:05:07 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: atk0110.c,v 1.12 2010/07/28 16:02:33 jruoho Exp $);
 
 #include sys/param.h
 #include sys/malloc.h
@@ -86,8 +86,7 @@
 	if(aa-aa_node-ad_type != ACPI_TYPE_DEVICE)
 		return 0;
 
-	/* successful match supersedes aiboost(4) */
-	return acpi_match_hid(aa-aa_node-ad_devinfo, aibs_hid) * 2;
+	return acpi_match_hid(aa-aa_node-ad_devinfo, aibs_hid);
 }
 
 static void



CVS commit: src/sys/dev/acpi

2010-07-28 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jul 28 16:26:57 UTC 2010

Modified Files:
src/sys/dev/acpi: smbus_acpi.c

Log Message:
Remove the homegrown attempt to match the parent PCI bus. This was only used
for descriptive purposes, and for such purposes the ACPIVERBOSE output is
much better.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/acpi/smbus_acpi.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/acpi/smbus_acpi.c
diff -u src/sys/dev/acpi/smbus_acpi.c:1.10 src/sys/dev/acpi/smbus_acpi.c:1.11
--- src/sys/dev/acpi/smbus_acpi.c:1.10	Thu Apr 15 07:02:24 2010
+++ src/sys/dev/acpi/smbus_acpi.c	Wed Jul 28 16:26:56 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: smbus_acpi.c,v 1.10 2010/04/15 07:02:24 jruoho Exp $ */
+/* $NetBSD: smbus_acpi.c,v 1.11 2010/07/28 16:26:56 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: smbus_acpi.c,v 1.10 2010/04/15 07:02:24 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: smbus_acpi.c,v 1.11 2010/07/28 16:26:56 jruoho Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -176,12 +176,9 @@
 	struct acpi_attach_args *aa = aux;
 	struct i2cbus_attach_args iba;
 	ACPI_STATUS rv;
-	ACPI_HANDLE native_dev, native_bus;
-	ACPI_DEVICE_INFO *native_dev_info, *native_bus_info;
 	ACPI_BUFFER smi_buf;
 	ACPI_OBJECT *e, *p;
 	struct SMB_INFO *info;
-	int pci_bus, pci_dev, pci_func;
 
 	aprint_naive(\n);
 
@@ -229,44 +226,6 @@
 	}
 	aprint_normal(\n);
 
-	/*
-	 * Retrieve and display native controller info
-	 */
-	rv = AcpiGetParent(sc-sc_devnode-ad_handle, native_dev);
-
-	native_bus_info = native_dev_info = NULL;
-
-	if (ACPI_SUCCESS(rv))
-		rv = AcpiGetParent(native_dev, native_bus);
-
-	if (ACPI_SUCCESS(rv))
-		rv = AcpiGetObjectInfo(native_bus, native_bus_info);
-
-	if (ACPI_SUCCESS(rv) 
-	acpi_match_hid(native_bus_info, pcibus_acpi_ids) != 0) {
-
-		rv = AcpiGetObjectInfo(native_dev, native_dev_info);
-
-		if (ACPI_SUCCESS(rv)) {
-			pci_bus = native_bus_info-Address;
-			pci_dev = ACPI_ADR_PCI_DEV(native_dev_info-Address);
-			pci_func = ACPI_ADR_PCI_FUNC(native_dev_info-Address);
-			aprint_debug_dev(self, Native i2c host controller
-			 is on PCI bus %d dev %d func %d\n,
-			pci_bus, pci_dev, pci_func);
-			/*
-			 * XXX We really need a mechanism to prevent the
-			 * XXX native controller from attaching
-			 */
-		}
-	}
-
-	if (native_bus_info != NULL)
-		ACPI_FREE(native_bus_info);
-
-	if (native_dev_info != NULL)
-		ACPI_FREE(native_dev_info);
-
 	memset(iba, 0, sizeof(iba));
 	iba.iba_tag = sc-sc_i2c_tag;
 	config_found_ia(self, i2cbus, iba, iicbus_print);



CVS commit: src/sys/dev/acpi

2010-07-28 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jul 28 16:29:11 UTC 2010

Modified Files:
src/sys/dev/acpi: smbus_acpi.c

Log Message:
Remove also the HIDs from previous.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/acpi/smbus_acpi.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/acpi/smbus_acpi.c
diff -u src/sys/dev/acpi/smbus_acpi.c:1.11 src/sys/dev/acpi/smbus_acpi.c:1.12
--- src/sys/dev/acpi/smbus_acpi.c:1.11	Wed Jul 28 16:26:56 2010
+++ src/sys/dev/acpi/smbus_acpi.c	Wed Jul 28 16:29:11 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: smbus_acpi.c,v 1.11 2010/07/28 16:26:56 jruoho Exp $ */
+/* $NetBSD: smbus_acpi.c,v 1.12 2010/07/28 16:29:11 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: smbus_acpi.c,v 1.11 2010/07/28 16:26:56 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: smbus_acpi.c,v 1.12 2010/07/28 16:29:11 jruoho Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -119,12 +119,6 @@
 	NULL
 };
 
-static const char * const pcibus_acpi_ids[] = {
-	PNP0A03,
-	PNP0A08,
-	NULL
-};
-
 CFATTACH_DECL_NEW(acpismbus, sizeof(struct acpi_smbus_softc),
 acpi_smbus_match, acpi_smbus_attach, acpi_smbus_detach, NULL);
 



CVS commit: src/sys/arch/i386/i386

2010-07-28 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Wed Jul 28 17:05:51 UTC 2010

Modified Files:
src/sys/arch/i386/i386: mptramp.S

Log Message:
Enable the NX bit feature early in i386 MP trampoline code (do not rely on
cpu_init_msrs() to do it). Having NX bit set on a page will raise a #GP
on fetch if NXE is not enabled, which can happen early when structures
(like idlelwp) are allocated with just rw- rights.

NX is enabled with PAE (if host supports it).

Exact same issue as for amd64, some weeks ago. Same player, shoot again...


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/i386/i386/mptramp.S

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/i386/i386/mptramp.S
diff -u src/sys/arch/i386/i386/mptramp.S:1.21 src/sys/arch/i386/i386/mptramp.S:1.22
--- src/sys/arch/i386/i386/mptramp.S:1.21	Sat Jul 24 00:45:55 2010
+++ src/sys/arch/i386/i386/mptramp.S	Wed Jul 28 17:05:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mptramp.S,v 1.21 2010/07/24 00:45:55 jym Exp $	*/
+/*	$NetBSD: mptramp.S,v 1.22 2010/07/28 17:05:51 jym Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include machine/asm.h
-__KERNEL_RCSID(0, $NetBSD: mptramp.S,v 1.21 2010/07/24 00:45:55 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: mptramp.S,v 1.22 2010/07/28 17:05:51 jym Exp $);
 	
 #include opt_mpbios.h		/* for MPDEBUG */
 		
@@ -158,6 +158,7 @@
 	movl	%cr4,%eax
 	orl	$CR4_PSE,%eax
 	movl	%eax,%cr4
+
 1:
 
 #ifdef PAE /* Enable PAE */
@@ -181,6 +182,18 @@
 #endif
 	HALT(0x6)
 
+	/*
+	 * If EFER_NXE is not enabled, fetching a page with a NX bit set
+	 * will raise a #GP. Avoid that by setting the NXE feature now.
+	 */
+	movl	_C_LABEL(cpu_feature)+2*4,%eax	/* cpu_feature[2] */
+	andl	$CPUID_NOX,%eax
+	jz	1f
+	movl	$MSR_EFER,%ecx
+	rdmsr
+	orl	$EFER_NXE,%eax	/* enable No-Execute feature */
+	wrmsr
+
 /*
  * ok, we are now running with paging enabled and sharing page tables
  * with cpu0.  figure out which processor we really are, what stack we



CVS commit: src/bin/ps

2010-07-28 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Wed Jul 28 17:39:54 UTC 2010

Modified Files:
src/bin/ps: print.c

Log Message:
Do not check pcpu value against 100.0 but rather 99.95, to properly
deal with value rounding. From a...@.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/bin/ps/print.c

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

Modified files:

Index: src/bin/ps/print.c
diff -u src/bin/ps/print.c:1.114 src/bin/ps/print.c:1.115
--- src/bin/ps/print.c:1.114	Tue Jul 27 12:40:48 2010
+++ src/bin/ps/print.c	Wed Jul 28 17:39:54 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: print.c,v 1.114 2010/07/27 12:40:48 njoly Exp $	*/
+/*	$NetBSD: print.c,v 1.115 2010/07/28 17:39:54 njoly Exp $	*/
 
 /*
  * Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 #if 0
 static char sccsid[] = @(#)print.c	8.6 (Berkeley) 4/16/94;
 #else
-__RCSID($NetBSD: print.c,v 1.114 2010/07/27 12:40:48 njoly Exp $);
+__RCSID($NetBSD: print.c,v 1.115 2010/07/28 17:39:54 njoly Exp $);
 #endif
 #endif /* not lint */
 
@@ -1092,7 +1092,7 @@
 	k = arg;
 	v = ve-var;
 	dbl = getpcpu(k);
-	doubleprintorsetwidth(v, dbl, (dbl = 100.0) ? 0 : 1, mode);
+	doubleprintorsetwidth(v, dbl, (dbl = 99.95) ? 0 : 1, mode);
 }
 
 double



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

2010-07-28 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jul 28 18:10:32 UTC 2010

Modified Files:
src/sys/arch/x86/acpi: acpi_wakeup.c

Log Message:
Use acpi_eval_set_integer(), KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/x86/acpi/acpi_wakeup.c

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

Modified files:

Index: src/sys/arch/x86/acpi/acpi_wakeup.c
diff -u src/sys/arch/x86/acpi/acpi_wakeup.c:1.23 src/sys/arch/x86/acpi/acpi_wakeup.c:1.24
--- src/sys/arch/x86/acpi/acpi_wakeup.c:1.23	Wed Apr 14 19:32:35 2010
+++ src/sys/arch/x86/acpi/acpi_wakeup.c	Wed Jul 28 18:10:31 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_wakeup.c,v 1.23 2010/04/14 19:32:35 jruoho Exp $	*/
+/*	$NetBSD: acpi_wakeup.c,v 1.24 2010/07/28 18:10:31 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_wakeup.c,v 1.23 2010/04/14 19:32:35 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_wakeup.c,v 1.24 2010/07/28 18:10:31 jruoho Exp $);
 
 /*-
  * Copyright (c) 2001 Takanori Watanabe takaw...@jp.freebsd.org
@@ -188,53 +188,54 @@
 static ACPI_STATUS
 enter_s4_with_bios(void)
 {
-	ACPI_OBJECT_LIST	ArgList;
-	ACPI_OBJECT		Arg;
-	uint32_t		ret;
-	ACPI_STATUS		status;
+	ACPI_STATUS rv;
+	uint32_t val;
 
-	/* run the _PTS and _GTS methods */
-
-	(void)memset(ArgList, 0, sizeof(ArgList));
-
-	ArgList.Count = 1;
-	ArgList.Pointer = Arg;
-
-	(void)memset(Arg, 0, sizeof(Arg));
-
-	Arg.Type = ACPI_TYPE_INTEGER;
-	Arg.Integer.Value = ACPI_STATE_S4;
-
-	AcpiEvaluateObject(NULL, \\_PTS, ArgList, NULL);
-	AcpiEvaluateObject(NULL, \\_GTS, ArgList, NULL);
-
-	/* clear wake status */
-
-	AcpiWriteBitRegister(ACPI_BITREG_WAKE_STATUS, 1);
+	/*
+	 * Run the _PTS and _GTS methods.
+	 */
+	(void)acpi_eval_set_integer(NULL, \\_PTS, ACPI_STATE_S4);
+	(void)acpi_eval_set_integer(NULL, \\_GTS, ACPI_STATE_S4);
 
-	AcpiHwDisableAllGpes();
-	AcpiHwEnableAllWakeupGpes();
+	/*
+	 * Clear wake status.
+	 */
+	(void)AcpiWriteBitRegister(ACPI_BITREG_WAKE_STATUS, 1);
 
-	/* flush caches */
+	/*
+	 * Enable wake GPEs.
+	 */
+	(void)AcpiHwDisableAllGpes();
+	(void)AcpiHwEnableAllWakeupGpes();
 
+	/*
+	 * Flush caches.
+	 */
 	ACPI_FLUSH_CPU_CACHE();
 
 	/*
-	 * write the value to command port and wait until we enter sleep state
+	 * Write the value to command port and wait until we enter sleep state.
 	 */
 	do {
 		AcpiOsStall(100);
-		AcpiOsWritePort(AcpiGbl_FADT.SmiCommand,
-AcpiGbl_FADT.S4BiosRequest, 8);
-		status = AcpiReadBitRegister(ACPI_BITREG_WAKE_STATUS, ret);
-		if (ACPI_FAILURE(status))
+
+		(void)AcpiOsWritePort(AcpiGbl_FADT.SmiCommand,
+  AcpiGbl_FADT.S4BiosRequest, 8);
+
+		rv = AcpiReadBitRegister(ACPI_BITREG_WAKE_STATUS, val);
+
+		if (ACPI_FAILURE(rv))
 			break;
-	} while (!ret);
 
-	AcpiHwDisableAllGpes();
-	AcpiHwEnableAllRuntimeGpes();
+	} while (val == 0);
+
+	/*
+	 * Enable runtime GPEs.
+	 */
+	(void)AcpiHwDisableAllGpes();
+	(void)AcpiHwEnableAllRuntimeGpes();
 
-	return (AE_OK);
+	return AE_OK;
 }
 
 void



CVS commit: src/share/man/man4

2010-07-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Jul 28 18:28:15 UTC 2010

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

Log Message:
Update list of supported chips and add additional chip addresses to the
config info in the synopsis.  Also remove the xref to sysctl, since the
threshold values are now accessible within envsys framework.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/sdtemp.4

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

Modified files:

Index: src/share/man/man4/sdtemp.4
diff -u src/share/man/man4/sdtemp.4:1.1 src/share/man/man4/sdtemp.4:1.2
--- src/share/man/man4/sdtemp.4:1.1	Sat May  9 15:04:25 2009
+++ src/share/man/man4/sdtemp.4	Wed Jul 28 18:28:15 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: sdtemp.4,v 1.1 2009/05/09 15:04:25 pgoyette Exp $
+.\	$NetBSD: sdtemp.4,v 1.2 2010/07/28 18:28:15 pgoyette Exp $
 .\
 .\ Copyright (c) 2008 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,15 +27,21 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd May 9, 2009
+.Dd July 29, 2010
 .Dt SDTEMP 4
 .Os
 .Sh NAME
 .Nm sdtemp
-.Nd Microchip Technology MCP9805/98242 and compatible memory module
-temperature sensors
+.Nd JEDEC JC-42.4 compatible memory module temperature sensors
 .Sh SYNOPSIS
 .Cd sdtemp0 at iic? addr 0x18
+.Cd sdtemp0 at iic? addr 0x19
+.Cd sdtemp0 at iic? addr 0x1a
+.Cd sdtemp0 at iic? addr 0x1b
+.Cd sdtemp0 at iic? addr 0x1c
+.Cd sdtemp0 at iic? addr 0x1d
+.Cd sdtemp0 at iic? addr 0x1e
+.Cd sdtemp0 at iic? addr 0x1f
 .Sh DESCRIPTION
 The
 .Nm
@@ -44,13 +50,10 @@
 MCP9805/98242 and other chips that conform to JEDEC Standard 21-C section
 4.7.
 Memory module temperature sensors are optional on DDR2 and DDR3 SDRAM DIMMs.
-Sensors provided by this driver are accessed through the
+Sensors provided by this driver, including the on-chip thresholds for the
+Alarm Window and Critical level, are accessed through the
 .Xr envsys 4
 API.
-The on-chip thresholds for the Alarm Window and Critical level are
-accessed through the
-.Xr sysctl 8
-utility.
 .Pp
 The
 .Nm
@@ -62,34 +65,42 @@
 .Pp
 .Bl -item -offset indent
 .It
-.Tn Microchip Technology
-.Em MCP9805
-.It
-.Tn Microchip Technology
-.Em MCP98242
+.Tn Catalyst
+.Em CAT34TS02
+and
+.Em CAT6095
 .It
 .Tn Analog Devices
 .Em ADT7408
 .It
-.Tn NXP Semiconductors
-.Em SE97
+.Tn Integrated Deviced Technology
+.Em TSE2002B3
+and
+.Em TSE3000B3
+.It
+.Tn Maxim
+.Em MAX6604
+.It
+.Tn Microchip Technology
+.Em MCP9805 ,
+.Em MCP9843 ,
+.Em MCP98242 ,
+and
+.Em MCP98243
 .It
 .Tn NXP Semiconductors
+.Em SE97
+and
 .Em SE98
 .It
 .Tn STmicroelectronics
-.Em STTS424E02-DA/DN
-.It
-.Tn Catalyst
-.Em CAT34TS02
-.It
-.Tn Catalyst
-.Em CAT6095
+.Em STTS424
+and
+.Em STTS424E
 .El
 .Sh SEE ALSO
 .Xr envsys 4 ,
-.Xr envstat 8 ,
-.Xr sysctl 8
+.Xr envstat 8
 .Sh HISTORY
 The
 .Nm



CVS commit: src/sys/dev/i2c

2010-07-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Jul 28 18:43:11 UTC 2010

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

Log Message:
Fix a typo (missing digit) in chip name table.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/i2c/sdtemp.c

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

Modified files:

Index: src/sys/dev/i2c/sdtemp.c
diff -u src/sys/dev/i2c/sdtemp.c:1.15 src/sys/dev/i2c/sdtemp.c:1.16
--- src/sys/dev/i2c/sdtemp.c:1.15	Sun Jul 11 15:16:41 2010
+++ src/sys/dev/i2c/sdtemp.c	Wed Jul 28 18:43:10 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: sdtemp.c,v 1.15 2010/07/11 15:16:41 pgoyette Exp $*/
+/*  $NetBSD: sdtemp.c,v 1.16 2010/07/28 18:43:10 pgoyette Exp $*/
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sdtemp.c,v 1.15 2010/07/11 15:16:41 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: sdtemp.c,v 1.16 2010/07/28 18:43:10 pgoyette Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -101,7 +101,7 @@
 static const struct sdtemp_dev_entry
 sdtemp_dev_table[] = {
 { MAXIM_MANUFACTURER_ID, MAX_6604_DEVICE_ID,MAX_6604_MASK,   3,
-	Maxim MAX604 },
+	Maxim MAX6604 },
 { MCP_MANUFACTURER_ID,   MCP_9805_DEVICE_ID,MCP_9805_MASK,   2,
 	Microchip Tech MCP9805/MCP9843 },
 { MCP_MANUFACTURER_ID,   MCP_98243_DEVICE_ID,   MCP_98243_MASK, -4,



CVS commit: src/tests/fs/nfs

2010-07-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jul 28 19:23:01 UTC 2010

Modified Files:
src/tests/fs/nfs: Makefile

Log Message:
install to right place.  from pgoyette


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/nfs/Makefile

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

Modified files:

Index: src/tests/fs/nfs/Makefile
diff -u src/tests/fs/nfs/Makefile:1.2 src/tests/fs/nfs/Makefile:1.3
--- src/tests/fs/nfs/Makefile:1.2	Wed Jul 28 15:24:54 2010
+++ src/tests/fs/nfs/Makefile	Wed Jul 28 19:23:01 2010
@@ -1,8 +1,10 @@
-#	$NetBSD: Makefile,v 1.2 2010/07/28 15:24:54 pooka Exp $
+#	$NetBSD: Makefile,v 1.3 2010/07/28 19:23:01 pooka Exp $
 #
 
 .include bsd.own.mk
 
+TESTSDIR=   ${TESTSBASE}/fs/nfs
+
 SUBDIR+= 	nfsservice
 
 TESTS_C=	t_mountd



CVS commit: src

2010-07-28 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jul 28 20:49:13 UTC 2010

Modified Files:
src/lib/librt: mq.3
src/share/man/man7: sysctl.7
src/sys/kern: sys_mqueue.c

Log Message:
Get rid of SYSCTL_SETUP.

We want the sysctl variables also when mqueue(3) is loaded as a module.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/librt/mq.3
cvs rdiff -u -r1.47 -r1.48 src/share/man/man7/sysctl.7
cvs rdiff -u -r1.29 -r1.30 src/sys/kern/sys_mqueue.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/librt/mq.3
diff -u src/lib/librt/mq.3:1.3 src/lib/librt/mq.3:1.4
--- src/lib/librt/mq.3:1.3	Mon Jun  7 16:33:45 2010
+++ src/lib/librt/mq.3	Wed Jul 28 20:49:12 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: mq.3,v 1.3 2010/06/07 16:33:45 wiz Exp $
+.\ $NetBSD: mq.3,v 1.4 2010/07/28 20:49:12 jruoho Exp $
 .\
 .\ Copyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
 .\
@@ -23,11 +23,12 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd May 26, 2010
+.Dd July 28, 2010
 .Dt MQ 3
 .Os
 .Sh NAME
-.Nm mq
+.Nm mq ,
+.Nm mqueue
 .Nd POSIX message queues (REALTIME)
 .Sh LIBRARY
 .Lb librt
@@ -144,10 +145,7 @@
 The standard does not specify whether
 .Tn POSIX
 message queues are exposed at the file system level.
-In the
-.Nx
-implementation these are not seen in the file system.
-Thus, it can be argued that
+It can be argued that
 .Nm
 inherited an old problem with the System V message queues.
 Even if an implementation would have support for it,
@@ -221,14 +219,13 @@
 .Fn mq_getattr
 and
 .Fn mq_setattr ,
-to retrieve and set attributes once
-the message queue has been created,
-the resource limits cannot be changed
-by an user once the queue has been created.
-To avoid blocking in case the maximum number of messages has been reached, the
-.Dv O_NONBLOCK
-flag can be set as an argument to
-.Fn mq_open .
+to retrieve and set attributes,
+resource limits cannot be changed once the queue has been created.
+In
+.Nx
+the super user may however control the global resource limits by using few
+.Xr sysctl 7
+variables.
 .Ss Asynchronous Notification
 Instead of blocking in the functions that receive messages,
 .Nm
@@ -278,8 +275,8 @@
 The basic rule of thumb with realtime prioritization is that low priority
 tasks should never unnecessarily delay high priority tasks.
 Priority inheritance is not however part of the provided
-.Tn API .
-The receiver process may run at low priority even
+.Tn API ;
+the receiver process may run at low priority even
 when receiving high priority messages.
 To address this limitation and other potential realtime problems,
 the user may consider other functions from the

Index: src/share/man/man7/sysctl.7
diff -u src/share/man/man7/sysctl.7:1.47 src/share/man/man7/sysctl.7:1.48
--- src/share/man/man7/sysctl.7:1.47	Tue Apr 20 13:03:33 2010
+++ src/share/man/man7/sysctl.7	Wed Jul 28 20:49:12 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: sysctl.7,v 1.47 2010/04/20 13:03:33 wiz Exp $
+.\	$NetBSD: sysctl.7,v 1.48 2010/07/28 20:49:12 jruoho Exp $
 .\
 .\ Copyright (c) 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\	@(#)sysctl.3	8.4 (Berkeley) 5/9/95
 .\
-.Dd April 20, 2010
+.Dd July 28, 2010
 .Dt SYSCTL 7
 .Os
 .Sh NAME
@@ -692,6 +692,36 @@
 A boolean that enables or disables verbose
 debug messages related to kernel modules.
 .El
+.It Li kern.mqueue
+Settings related to
+.Tn POSIX
+message queues; see
+.Xr mqueue 3 .
+This node is created dynamically when
+the corresponding kernel module is loaded.
+The third level names for the settings are described below.
+.Bl -column kern.mqueue.mq_max_msgsize integer Changeable -offset indent
+.It Sy Third level name	Type	Changeable
+.It kern.mqueue.mq_open_max	integer	yes
+.It kern.mqueue.mq_prio_max	integer	yes
+.It kern.mqueue.mq_max_msgsize	integer	yes
+.It kern.mqueue.mq_def_maxmsg	integer	yes
+.It kern.mqueue.mq_max_maxmsg	integer	yes
+.El
+.Pp
+The variables are:
+.Bl -tag -width 123456
+.It Li kern.mqueue.mq_open_max
+The maximum number of message queue descriptors any single process can open.
+.It Li kern.mqueue.mq_prio_max
+The maximum priority of a message.
+.It Li kern.mqueue.mq_max_msgsize
+The maximum size of a message in a message queue.
+.It Li kern.mqueue.mq_def_maxmsg
+The default maximum message count.
+.It Li kern.mqueue.mq_max_maxmsg
+The maximum number of messages in a message queue.
+.El
 .It Li kern.monotonic_clock ( KERN_MONOTONIC_CLOCK )
 Returns the standard version the implementation of the POSIX 1003.1b
 Monotonic Clock Option conforms to,

Index: src/sys/kern/sys_mqueue.c
diff -u src/sys/kern/sys_mqueue.c:1.29 src/sys/kern/sys_mqueue.c:1.30
--- src/sys/kern/sys_mqueue.c:1.29	Sun Dec 20 09:36:05 2009
+++ src/sys/kern/sys_mqueue.c	Wed Jul 28 20:49:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_mqueue.c,v 

CVS commit: src

2010-07-28 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jul 28 21:29:16 UTC 2010

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/lib/libpthread: Makefile
Added Files:
src/tests/lib/libpthread: t_join.c

Log Message:
Add a simple test for pthread_join(3).


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libpthread/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libpthread/t_join.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.122 src/distrib/sets/lists/tests/mi:1.123
--- src/distrib/sets/lists/tests/mi:1.122	Wed Jul 28 20:08:45 2010
+++ src/distrib/sets/lists/tests/mi	Wed Jul 28 21:29:16 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.122 2010/07/28 20:08:45 pooka Exp $
+# $NetBSD: mi,v 1.123 2010/07/28 21:29:16 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -301,6 +301,7 @@
 ./usr/libdata/debug/usr/tests/lib/libpthread/t_cond.debug		tests-lib-tests		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libpthread/t_fork.debug		tests-lib-tests		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libpthread/t_fpu.debug		tests-lib-tests		debug,atf
+./usr/libdata/debug/usr/tests/lib/libpthread/t_join.debug		tests-lib-tests		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libpthread/t_kill.debug		tests-lib-tests		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libpthread/t_mutex.debug		tests-lib-tests		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libpthread/t_name.debug		tests-lib-tests		debug,atf
@@ -1433,6 +1434,7 @@
 ./usr/tests/lib/libpthread/t_exit		tests-lib-tests		atf
 ./usr/tests/lib/libpthread/t_fork		tests-lib-tests		atf
 ./usr/tests/lib/libpthread/t_fpu		tests-lib-tests		atf
+./usr/tests/lib/libpthread/t_join		tests-lib-tests		atf
 ./usr/tests/lib/libpthread/t_kill		tests-lib-tests		atf
 ./usr/tests/lib/libpthread/t_mutex		tests-lib-tests		atf
 ./usr/tests/lib/libpthread/t_name		tests-lib-tests		atf

Index: src/tests/lib/libpthread/Makefile
diff -u src/tests/lib/libpthread/Makefile:1.1 src/tests/lib/libpthread/Makefile:1.2
--- src/tests/lib/libpthread/Makefile:1.1	Fri Jul 16 15:42:53 2010
+++ src/tests/lib/libpthread/Makefile	Wed Jul 28 21:29:15 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2010/07/16 15:42:53 jmmv Exp $
+# $NetBSD: Makefile,v 1.2 2010/07/28 21:29:15 jruoho Exp $
 
 NOMAN=		# defined
 
@@ -14,6 +14,7 @@
 TESTS_SH+=	t_exit
 TESTS_C+=	t_fork
 TESTS_C+=	t_fpu
+TESTS_C+=	t_join
 TESTS_C+=	t_kill
 TESTS_C+=	t_mutex
 TESTS_C+=	t_name

Added files:

Index: src/tests/lib/libpthread/t_join.c
diff -u /dev/null src/tests/lib/libpthread/t_join.c:1.1
--- /dev/null	Wed Jul 28 21:29:16 2010
+++ src/tests/lib/libpthread/t_join.c	Wed Jul 28 21:29:15 2010
@@ -0,0 +1,153 @@
+/* $NetBSD: t_join.c,v 1.1 2010/07/28 21:29:15 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jukka Ruohonen.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include sys/cdefs.h
+__RCSID($NetBSD: t_join.c,v 1.1 2010/07/28 21:29:15 jruoho Exp $);
+
+#include errno.h
+#include pthread.h
+
+#include atf-c.h
+
+#include h_common.h
+
+static bool error;
+
+static void *threadfunc1(void *);
+static void *threadfunc2(void *);
+
+ATF_TC(pthread_join);
+ATF_TC_HEAD(pthread_join, tc)
+{
+
+	atf_tc_set_md_var(tc, descr,
+	Checks basic error conditions in pthread_join(3));
+}
+
+ATF_TC_BODY(pthread_join, tc)
+{
+	pthread_t thread;

CVS commit: src/sys/arch/sparc64/sparc64

2010-07-28 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Jul 28 21:34:57 UTC 2010

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

Log Message:
try to synchronize %tick registers across CPUs during startup
this should take care of a lot of clock-gone-backwards problems I've seen on
my Blade 2500


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/sparc64/sparc64/cpu.c

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/cpu.c
diff -u src/sys/arch/sparc64/sparc64/cpu.c:1.95 src/sys/arch/sparc64/sparc64/cpu.c:1.96
--- src/sys/arch/sparc64/sparc64/cpu.c:1.95	Tue May 18 04:30:16 2010
+++ src/sys/arch/sparc64/sparc64/cpu.c	Wed Jul 28 21:34:57 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.95 2010/05/18 04:30:16 mrg Exp $ */
+/*	$NetBSD: cpu.c,v 1.96 2010/07/28 21:34:57 macallan Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.95 2010/05/18 04:30:16 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.96 2010/07/28 21:34:57 macallan Exp $);
 
 #include opt_multiprocessor.h
 
@@ -441,6 +441,7 @@
 break;
 			delay(1);
 		}
+		settick(0);
 		setpstate(pstate);
 
 		if (!CPUSET_HAS(cpus_active, ci-ci_index))



CVS commit: src/libexec/lfs_cleanerd

2010-07-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jul 28 22:35:52 UTC 2010

Modified Files:
src/libexec/lfs_cleanerd: Makefile.inc

Log Message:
always add to SRCS


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/libexec/lfs_cleanerd/Makefile.inc

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

Modified files:

Index: src/libexec/lfs_cleanerd/Makefile.inc
diff -u src/libexec/lfs_cleanerd/Makefile.inc:1.2 src/libexec/lfs_cleanerd/Makefile.inc:1.3
--- src/libexec/lfs_cleanerd/Makefile.inc:1.2	Fri Oct  9 20:19:44 2009
+++ src/libexec/lfs_cleanerd/Makefile.inc	Wed Jul 28 22:35:52 2010
@@ -1,12 +1,12 @@
-#	$NetBSD: Makefile.inc,v 1.2 2009/10/09 20:19:44 pooka Exp $
+#	$NetBSD: Makefile.inc,v 1.3 2010/07/28 22:35:52 pooka Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 WARNS?=3		# XXX: too many sign-compare issues
 
 .include bsd.own.mk
 
-SRCS=	lfs_cleanerd.c fdfs.c coalesce.c cleansrv.c
-SRCS+=  lfs_cksum.c
+SRCS+=	lfs_cleanerd.c fdfs.c coalesce.c cleansrv.c
+SRCS+=	lfs_cksum.c
 SRCS+=	bufcache.c vnode.c lfs.c kernelops.c # segwrite.c
 .PATH:	${NETBSDSRCDIR}/sys/ufs/lfs ${NETBSDSRCDIR}/sbin/fsck_lfs	\
 	${NETBSDSRCDIR}/libexec/lfs_cleanerd



CVS commit: src/sys/dev/ic

2010-07-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jul 28 23:30:21 UTC 2010

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

Log Message:
The ETHERCAP_VLAN_HWTAGGING flag is not a member of if_cap but ec_cap,
so fix it.


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/sys/dev/ic/rtl8169.c

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

Modified files:

Index: src/sys/dev/ic/rtl8169.c
diff -u src/sys/dev/ic/rtl8169.c:1.132 src/sys/dev/ic/rtl8169.c:1.133
--- src/sys/dev/ic/rtl8169.c:1.132	Tue Jul 27 21:02:00 2010
+++ src/sys/dev/ic/rtl8169.c	Wed Jul 28 23:30:21 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtl8169.c,v 1.132 2010/07/27 21:02:00 jakllsch Exp $	*/
+/*	$NetBSD: rtl8169.c,v 1.133 2010/07/28 23:30:21 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998-2003
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rtl8169.c,v 1.132 2010/07/27 21:02:00 jakllsch Exp $);
+__KERNEL_RCSID(0, $NetBSD: rtl8169.c,v 1.133 2010/07/28 23:30:21 msaitoh Exp $);
 /* $FreeBSD: /repoman/r/ncvs/src/sys/dev/re/if_re.c,v 1.20 2004/04/11 20:34:08 ru Exp $ */
 
 /*
@@ -1742,7 +1742,7 @@
 	if ((sc-sc_quirk  RTKQ_8169NONS) != 0)
 		cfg |= (0x1  14);
 
-	if ((ifp-if_capenable  ETHERCAP_VLAN_HWTAGGING) != 0)
+	if ((sc-ethercom.ec_capenable  ETHERCAP_VLAN_HWTAGGING) != 0)
 		cfg |= RE_CPLUSCMD_VLANSTRIP;
 	if ((ifp-if_capenable  (IFCAP_CSUM_IPv4_Rx |
 	 IFCAP_CSUM_TCPv4_Rx | IFCAP_CSUM_UDPv4_Rx)) != 0)



CVS commit: [uebayasi-xip] src/share/man/man9

2010-07-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Jul 29 04:44:34 UTC 2010

Modified Files:
src/share/man/man9 [uebayasi-xip]: bus_space.9

Log Message:
Document bus_space_physload(9), bus_space_physunload(9),
bus_space_physload_device(9), and bus_space_physunload_device(9).


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.40.2.1 src/share/man/man9/bus_space.9

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/man9/bus_space.9
diff -u src/share/man/man9/bus_space.9:1.40 src/share/man/man9/bus_space.9:1.40.2.1
--- src/share/man/man9/bus_space.9:1.40	Fri Apr 16 20:05:37 2010
+++ src/share/man/man9/bus_space.9	Thu Jul 29 04:44:34 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: bus_space.9,v 1.40 2010/04/16 20:05:37 dyoung Exp $
+.\ $NetBSD: bus_space.9,v 1.40.2.1 2010/07/29 04:44:34 uebayasi Exp $
 .\
 .\ Copyright (c) 1997 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd April 16, 2010
+.Dd July 29, 2010
 .Dt BUS_SPACE 9
 .Os
 .Sh NAME
@@ -45,6 +45,10 @@
 .Nm bus_space_peek_2 ,
 .Nm bus_space_peek_4 ,
 .Nm bus_space_peek_8 ,
+.Nm bus_space_physload ,
+.Nm bus_space_physload_device ,
+.Nm bus_space_physunload ,
+.Nm bus_space_physunload_device ,
 .Nm bus_space_poke_1 ,
 .Nm bus_space_poke_2 ,
 .Nm bus_space_poke_4 ,
@@ -144,6 +148,16 @@
 .Ft int
 .Fn bus_space_peek_8 bus_space_tag_t space bus_space_handle_t handle \
 bus_size_t offset uint64_t *datap
+.Ft void *
+.Fn bus_space_physload bus_space_tag_t space bus_addr_t addr bus_size_t size \
+int freelist
+.Ft void
+.Fn bus_space_physunload bus_space_tag_t space void *phys
+.Ft void *
+.Fn bus_space_physload_device bus_space_tag_t space bus_addr_t addr bus_size_t size \
+int prot int flags
+.Ft void
+.Fn bus_space_physunload_device bus_space_tag_t space void *phys
 .Ft int
 .Fn bus_space_poke_1 bus_space_tag_t space bus_space_handle_t handle \
 bus_size_t offset uint8_t data
@@ -732,7 +746,7 @@
 .Fn bus_space_free
 is called on a handle, all subregions of that handle become invalid.
 .Pp
-.It Fn bus_space_vaddr tag handle
+.It Fn bus_space_vaddr space handle
 .Pp
 This method returns the kernel virtual address of a mapped bus space if and
 only if it was mapped with the
@@ -745,7 +759,7 @@
 .Fn bus_space_barrier
 method must be used to force a particular access order.
 .Pp
-.It Fn bus_space_mmap tag addr off prot flags
+.It Fn bus_space_mmap space addr off prot flags
 .Pp
 This method is used to provide support for memory mapping bus space
 into user applications.
@@ -783,6 +797,91 @@
 .Fa prot
 argument indicates the memory protection requested by the user application
 for the range.
+.Pp
+.It Fn bus_space_physload space addr size freelist
+.Pp
+This method is used to register a bus space range as part of general purpose
+memory.
+The
+.Xr uvm 9
+internally allocates a single segment object,
+.Fa struct vm_physseg ,
+with per-page objects,
+.Fa struct vm_page ,
+to manage the corresponding physical address region indicated by
+.Fa addr
+and
+.Fa size .
+.Fa addr
+is the base address of the device memory region, and
+.Fa size
+is the size of that region.
+The added pages are queued in the freelist specified by
+.Fa freelist
+in the
+.Xr uvm 9 .
+.Pp
+If the registered memory is meant to be truely general purpose, users would
+want to add those pages to a pre-defined freelist.
+In other cases where device's memory needs special treatment, its platform has
+to define a dedicated freelist.
+The actual usage of such a special freelist and its pages is up to respective
+users.
+.Pp
+If successful,
+.Fn bus_space_physload
+returns an opaque handle to the allocated segment object.
+It returns NULL to indicate failure.
+.Pp
+.It Fn bus_space_physunload space phys
+.Pp
+This method frees the memory segment returned by
+.Fn bus_space_physload ,
+and specified by
+.Fa phys .
+This function will never fail.
+.Pp
+.It Fn bus_space_physload_device space addr size prot flags
+.Pp
+This method is used to register a bus space range as part of managed memory
+indicated by
+.Fa addr
+and
+.Fa size .
+.Fa addr
+is the base address of the device memory region, and
+.Fa size
+is the size of that region.
+.Fa prot
+is the device's capable access protection of the region, in cases where some
+devices allow read-only or write-only access.
+This information is referencial.
+.Fa flags
+is reserved for future use.
+.Pp
+Unlike
+.Fn bus_space_physload
+which registers pages as general purpose memory, this function only allocates
+a segment object and per-page objects.
+The registered pages can be accessed only by
+.Xr mmap 2
+interface from userland, or XIP, where pages are implicitly mapped into user
+address space by
+.Xr uvm 9
+and the vnode pager.
+.Pp
+If successful,
+.Fn bus_space_physload_device
+returns an opaque handle