CVS commit: src/sys/dev/usb

2009-11-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Nov 12 07:58:32 UTC 2009

Modified Files:
src/sys/dev/usb: usbdi.c

Log Message:
Typo in a debug printf.


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/sys/dev/usb/usbdi.c

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

Modified files:

Index: src/sys/dev/usb/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.125 src/sys/dev/usb/usbdi.c:1.126
--- src/sys/dev/usb/usbdi.c:1.125	Fri Dec 12 05:35:11 2008
+++ src/sys/dev/usb/usbdi.c	Thu Nov 12 07:58:32 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.125 2008/12/12 05:35:11 jmorse Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.126 2009/11/12 07:58:32 uebayasi Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.125 2008/12/12 05:35:11 jmorse Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.126 2009/11/12 07:58:32 uebayasi Exp $");
 
 #include "opt_compat_netbsd.h"
 
@@ -522,7 +522,7 @@
 
 #ifdef DIAGNOSTIC
 	if (pipe == NULL) {
-		printf("usbd_close_pipe: pipe==NULL\n");
+		printf("usbd_abort_pipe: pipe==NULL\n");
 		return (USBD_NORMAL_COMPLETION);
 	}
 #endif



CVS commit: [itohy-usb1] src/sys/dev/usb

2009-11-11 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Nov 12 07:55:42 UTC 2009

Modified Files:
src/sys/dev/usb [itohy-usb1]: usbdi.c

Log Message:
Sort functions to reduce the diff.  Put a comment about a backward-incompatible
API change.


To generate a diff of this commit:
cvs rdiff -u -r1.119.12.6 -r1.119.12.7 src/sys/dev/usb/usbdi.c

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

Modified files:

Index: src/sys/dev/usb/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.119.12.6 src/sys/dev/usb/usbdi.c:1.119.12.7
--- src/sys/dev/usb/usbdi.c:1.119.12.6	Wed May 21 05:04:03 2008
+++ src/sys/dev/usb/usbdi.c	Thu Nov 12 07:55:42 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.119.12.6 2008/05/21 05:04:03 itohy Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.119.12.7 2009/11/12 07:55:42 uebayasi Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usbdi.c,v 1.99 2006/11/27 18:39:02 marius Exp $	*/
 
 /*-
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.119.12.6 2008/05/21 05:04:03 itohy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.119.12.7 2009/11/12 07:55:42 uebayasi Exp $");
 /* __FBSDID("$FreeBSD: src/sys/dev/usb/usbdi.c,v 1.99 2006/11/27 18:39:02 marius Exp $"); */
 
 #ifdef __NetBSD__
@@ -503,6 +503,23 @@
 	xfer->rqflags |= URQ_DEV_MAP_BUFFER;
 }
 
+usbd_xfer_handle
+/* XXX API change */
+#if 0
+usbd_alloc_xfer(usbd_device_handle dev)
+#else
+usbd_alloc_xfer(usbd_device_handle dev, usbd_pipe_handle pipe)
+#endif
+{
+	return (usbd_alloc_xfer_flag(dev, pipe, U_WAITOK));
+}
+
+usbd_xfer_handle
+usbd_alloc_default_xfer(usbd_device_handle dev)
+{
+	return (usbd_alloc_xfer_flag(dev, dev->default_pipe, U_WAITOK));
+}
+
 /* Map mbuf(9) chain. */
 usbd_status
 usbd_map_buffer_mbuf(usbd_xfer_handle xfer, struct mbuf *chain)
@@ -571,16 +588,11 @@
 	return (xfer);
 }
 
-usbd_xfer_handle
-usbd_alloc_xfer(usbd_device_handle dev, usbd_pipe_handle pipe)
+usbd_status
+usbd_free_xfer(usbd_xfer_handle xfer)
 {
-	return (usbd_alloc_xfer_flag(dev, pipe, U_WAITOK));
-}
 
-usbd_xfer_handle
-usbd_alloc_default_xfer(usbd_device_handle dev)
-{
-	return (usbd_alloc_xfer_flag(dev, dev->default_pipe, U_WAITOK));
+	return (usbd_free_xfer_flag(xfer, U_WAITOK));
 }
 
 Static usbd_status
@@ -604,13 +616,6 @@
 	return (USBD_NORMAL_COMPLETION);
 }
 
-usbd_status
-usbd_free_xfer(usbd_xfer_handle xfer)
-{
-
-	return (usbd_free_xfer_flag(xfer, U_WAITOK));
-}
-
 void
 usbd_setup_xfer(usbd_xfer_handle xfer, usbd_pipe_handle pipe,
 		usbd_private_handle priv, void *buffer, u_int32_t length,
@@ -733,6 +738,12 @@
 }
 
 usbd_status
+usbd_abort_default_pipe(usbd_device_handle dev)
+{
+	return (usbd_abort_pipe(dev->default_pipe));
+}
+
+usbd_status
 usbd_abort_pipe(usbd_pipe_handle pipe)
 {
 	usbd_status err;
@@ -751,12 +762,6 @@
 }
 
 usbd_status
-usbd_abort_default_pipe(usbd_device_handle dev)
-{
-	return (usbd_abort_pipe(dev->default_pipe));
-}
-
-usbd_status
 usbd_clear_endpoint_stall(usbd_pipe_handle pipe)
 {
 	usbd_device_handle dev = pipe->device;



CVS commit: src

2009-11-11 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Nov 12 00:43:53 UTC 2009

Modified Files:
src/lib/libintl: gettext.3
src/usr.bin/tr: tr.1

Log Message:
Do not use \." for comments, always use .\". Discussed with u...@.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libintl/gettext.3
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/tr/tr.1

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

Modified files:

Index: src/lib/libintl/gettext.3
diff -u src/lib/libintl/gettext.3:1.11 src/lib/libintl/gettext.3:1.12
--- src/lib/libintl/gettext.3:1.11	Wed Nov 10 13:46:14 2004
+++ src/lib/libintl/gettext.3	Thu Nov 12 00:43:52 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: gettext.3,v 1.11 2004/11/10 13:46:14 wiz Exp $
+.\"	$NetBSD: gettext.3,v 1.12 2009/11/12 00:43:52 joerg Exp $
 .\"
 .\" Copyright (c) 2000 Citrus Project,
 .\" All rights reserved.
@@ -399,9 +399,9 @@
 The functions are implemented by Citrus project,
 based on the documentations for GNU gettext.
 .Sh BUGS
-\." The text was ripped off from Annex C of
-\." .Dq LI18NUX 2000 Globalization Specification Version 1.0 .
-\." .Pp
+.\" The text was ripped off from Annex C of
+.\" .Dq LI18NUX 2000 Globalization Specification Version 1.0 .
+.\" .Pp
 .Fn bind_textdomain_codeset
 does not work at this moment
 .Pq it always fails .

Index: src/usr.bin/tr/tr.1
diff -u src/usr.bin/tr/tr.1:1.17 src/usr.bin/tr/tr.1:1.18
--- src/usr.bin/tr/tr.1:1.17	Sat Aug 22 00:23:02 2009
+++ src/usr.bin/tr/tr.1	Thu Nov 12 00:43:53 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: tr.1,v 1.17 2009/08/22 00:23:02 joerg Exp $
+.\"	$NetBSD: tr.1,v 1.18 2009/11/12 00:43:53 joerg Exp $
 .\"
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -174,21 +174,21 @@
 .It xdigit	\*[Lt]hexadecimal characters\*[Gt]
 .El
 .Pp
-\." All classes may be used in
-\." .Ar string1 ,
-\." and in
-\." .Ar string2
-\." when both the
-\." .Fl d
-\." and
-\." .Fl s
-\." options are specified.
-\." Otherwise, only the classes ``upper'' and ``lower'' may be used in
-\." .Ar string2
-\." and then only when the corresponding class (``upper'' for ``lower''
-\." and vice-versa) is specified in the same relative position in
-\." .Ar string1 .
-\." .Pp
+.\" All classes may be used in
+.\" .Ar string1 ,
+.\" and in
+.\" .Ar string2
+.\" when both the
+.\" .Fl d
+.\" and
+.\" .Fl s
+.\" options are specified.
+.\" Otherwise, only the classes ``upper'' and ``lower'' may be used in
+.\" .Ar string2
+.\" and then only when the corresponding class (``upper'' for ``lower''
+.\" and vice-versa) is specified in the same relative position in
+.\" .Ar string1 .
+.\" .Pp
 With the exception of the
 .Dq upper
 and



CVS commit: src/sys/arch/amd64/include

2009-11-11 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed Nov 11 23:59:36 UTC 2009

Modified Files:
src/sys/arch/amd64/include: param.h

Log Message:
Reert change which was not meant to be comitted.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/amd64/include/param.h

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

Modified files:

Index: src/sys/arch/amd64/include/param.h
diff -u src/sys/arch/amd64/include/param.h:1.11 src/sys/arch/amd64/include/param.h:1.12
--- src/sys/arch/amd64/include/param.h:1.11	Wed Nov 11 23:53:39 2009
+++ src/sys/arch/amd64/include/param.h	Wed Nov 11 23:59:36 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.11 2009/11/11 23:53:39 haad Exp $	*/
+/*	$NetBSD: param.h,v 1.12 2009/11/11 23:59:36 haad Exp $	*/
 
 #ifdef __x86_64__
 
@@ -56,12 +56,12 @@
 #define	MAXPHYS		(64 * 1024)	/* max raw I/O transfer size */
 #endif
 
-#define	SSIZE		8		/* initial stack size/NBPG */
-#define	SINCR		2		/* increment of stack/NBPG */
+#define	SSIZE		1		/* initial stack size/NBPG */
+#define	SINCR		1		/* increment of stack/NBPG */
 #ifdef DIAGNOSTIC
-#define	UPAGES		16		/* pages of u-area (1 for redzone) */
+#define	UPAGES		4		/* pages of u-area (1 for redzone) */
 #else
-#define	UPAGES		12		/* pages of u-area */
+#define	UPAGES		3		/* pages of u-area */
 #endif
 #define	USPACE		(UPAGES * NBPG)	/* total size of u-area */
 #define	INTRSTACKSIZE	4096



CVS commit: src/sys/arch/amd64/include

2009-11-11 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed Nov 11 23:53:39 UTC 2009

Modified Files:
src/sys/arch/amd64/include: param.h
Added Files:
src/sys/arch/amd64/include: Makefile.inc

Log Message:
Build kernel modules with -mno-red-zone like kernel is build. This fixes
frequent panics in amd64 zfs module. This should also fix problem reported
by Nicolas Joly in:

http://mail-index.netbsd.org/port-amd64/2008/12/09/msg000646.html

Thanks to cube@ for his help with this.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/amd64/include/Makefile.inc
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amd64/include/param.h

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

Modified files:

Index: src/sys/arch/amd64/include/param.h
diff -u src/sys/arch/amd64/include/param.h:1.10 src/sys/arch/amd64/include/param.h:1.11
--- src/sys/arch/amd64/include/param.h:1.10	Sat Dec 20 12:42:36 2008
+++ src/sys/arch/amd64/include/param.h	Wed Nov 11 23:53:39 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.10 2008/12/20 12:42:36 ad Exp $	*/
+/*	$NetBSD: param.h,v 1.11 2009/11/11 23:53:39 haad Exp $	*/
 
 #ifdef __x86_64__
 
@@ -56,12 +56,12 @@
 #define	MAXPHYS		(64 * 1024)	/* max raw I/O transfer size */
 #endif
 
-#define	SSIZE		1		/* initial stack size/NBPG */
-#define	SINCR		1		/* increment of stack/NBPG */
+#define	SSIZE		8		/* initial stack size/NBPG */
+#define	SINCR		2		/* increment of stack/NBPG */
 #ifdef DIAGNOSTIC
-#define	UPAGES		4		/* pages of u-area (1 for redzone) */
+#define	UPAGES		16		/* pages of u-area (1 for redzone) */
 #else
-#define	UPAGES		3		/* pages of u-area */
+#define	UPAGES		12		/* pages of u-area */
 #endif
 #define	USPACE		(UPAGES * NBPG)	/* total size of u-area */
 #define	INTRSTACKSIZE	4096

Added files:

Index: src/sys/arch/amd64/include/Makefile.inc
diff -u /dev/null src/sys/arch/amd64/include/Makefile.inc:1.1
--- /dev/null	Wed Nov 11 23:53:39 2009
+++ src/sys/arch/amd64/include/Makefile.inc	Wed Nov 11 23:53:38 2009
@@ -0,0 +1,3 @@
+# $NetBSD: Makefile.inc,v 1.1 2009/11/11 23:53:38 haad Exp $
+
+CFLAGS+=-mno-red-zone



CVS commit: src/sys/netinet6

2009-11-11 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Nov 11 22:19:22 UTC 2009

Modified Files:
src/sys/netinet6: ip6_forward.c

Log Message:
Clear cksum flags before any further processing like ip_forward does.
Many drivers set the UDP/TCP v4 flags even for v6 traffic and if the
packet is encapsulated with gif, the IPv6 header would get corrupted by
ip_output. Patch suggested by bad@


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/netinet6/ip6_forward.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/netinet6/ip6_forward.c
diff -u src/sys/netinet6/ip6_forward.c:1.66 src/sys/netinet6/ip6_forward.c:1.67
--- src/sys/netinet6/ip6_forward.c:1.66	Wed Mar 18 16:00:23 2009
+++ src/sys/netinet6/ip6_forward.c	Wed Nov 11 22:19:22 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_forward.c,v 1.66 2009/03/18 16:00:23 cegger Exp $	*/
+/*	$NetBSD: ip6_forward.c,v 1.67 2009/11/11 22:19:22 joerg Exp $	*/
 /*	$KAME: ip6_forward.c,v 1.109 2002/09/11 08:10:17 sakane Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip6_forward.c,v 1.66 2009/03/18 16:00:23 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_forward.c,v 1.67 2009/11/11 22:19:22 joerg Exp $");
 
 #include "opt_ipsec.h"
 #include "opt_pfil_hooks.h"
@@ -120,6 +120,10 @@
 int s;
 #endif
 
+	/*
+	 * Clear any in-bound checksum flags for this packet.
+	 */
+	m->m_pkthdr.csum_flags = 0;
 
 #ifdef IPSEC
 	/*



CVS commit: src/tools/compat

2009-11-11 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Wed Nov 11 21:53:46 UTC 2009

Modified Files:
src/tools/compat: compat_defs.h

Log Message:
Revert most of revision 1.73:
We cannot user_from_uid(3) or group_from_gid(3) unless the system
also supports pwcache_userdb(3) and pwcache_groupdb(3). The build will
use the hosts password and user database otherwise. Switch back to the
old behaviour to only the native functions if they are all present.
This fixes cross builds under Mac OS X and FreeBSD.

Fix based on problem analysis provided by Akihiko Hayashi.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/tools/compat/compat_defs.h

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

Modified files:

Index: src/tools/compat/compat_defs.h
diff -u src/tools/compat/compat_defs.h:1.74 src/tools/compat/compat_defs.h:1.75
--- src/tools/compat/compat_defs.h:1.74	Fri Nov  6 18:26:06 2009
+++ src/tools/compat/compat_defs.h	Wed Nov 11 21:53:46 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_defs.h,v 1.74 2009/11/06 18:26:06 joerg Exp $	*/
+/*	$NetBSD: compat_defs.h,v 1.75 2009/11/11 21:53:46 tron Exp $	*/
 
 #ifndef	__NETBSD_COMPAT_DEFS_H__
 #define	__NETBSD_COMPAT_DEFS_H__
@@ -345,34 +345,15 @@
  * XXX host system has all of these functions, all of their interfaces
  * XXX and interactions are exactly the same as in our libc/libutil -- ugh.
  */
-#if !HAVE_USER_FROM_UID
-# define user_from_uid __nbcompat_user_from_uid
-# undef HAVE_DECL_USER_FROM_UID
-#endif
-
-#if !HAVE_UID_FROM_USER
-# define uid_from_user __nbcompat_uid_from_user
-# undef HAVE_DECL_UID_FROM_USER
-#endif
-
-#if !HAVE_PWCACHE_USERDB
-# define pwcache_userdb __nbcompat_pwcache_userdb
-# undef HAVE_DECL_PWCACHE_USERDB
-#endif
-
-#if !HAVE_GROUP_FROM_GID
-# define group_from_gid __nbcompat_group_from_gid
-# undef HAVE_DECL_GROUP_FROM_GID
-#endif
-
-#if !HAVE_GID_FROM_GROUP
-# define gid_from_group __nbcompat_gid_from_group
-# undef HAVE_DECL_GID_FROM_GROUP
-#endif
-
-#if !HAVE_PWCACHE_GROUDB
-# define pwcache_groupdb __nbcompat_pwcache_groupdb
-# undef HAVE_DECL_PWCACHE_GROUPDB
+#if !HAVE_USER_FROM_UID || !HAVE_UID_FROM_USER || !HAVE_GROUP_FROM_GID || \
+!HAVE_GID_FROM_GROUP || !HAVE_PWCACHE_USERDB || !HAVE_PWCACHE_GROUDB
+/* Make them use our version */
+#  define user_from_uid __nbcompat_user_from_uid
+#  define uid_from_user __nbcompat_uid_from_user
+#  define pwcache_userdb __nbcompat_pwcache_userdb
+#  define group_from_gid __nbcompat_group_from_gid
+#  define gid_from_group __nbcompat_gid_from_group
+#  define pwcache_groupdb __nbcompat_pwcache_groupdb
 #endif
 
 #if !HAVE_DECL_UID_FROM_USER
@@ -385,7 +366,7 @@
 
 #if !HAVE_DECL_PWCACHE_USERDB
 int pwcache_userdb(int (*)(int), void (*)(void),
-struct passwd * (*)(const char *), struct passwd * (*)(uid_t));
+struct passwd * (*)(const char *), struct passwd * (*)(uid_t));
 #endif
 
 #if !HAVE_DECL_GID_FROM_GROUP



CVS commit: src/gnu

2009-11-11 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Nov 11 19:03:53 UTC 2009

Modified Files:
src/gnu/dist/gcc4/gcc: c-opts.c c.opt gcc.h
src/gnu/dist/gcc4/gcc/doc: cpp.texi cppopts.texi invoke.texi
src/gnu/dist/gcc4/libcpp: macro.c
src/gnu/dist/gcc4/libcpp/include: cpplib.h
src/gnu/usr.bin/gcc4/cpp: cpp.1
src/gnu/usr.bin/gcc4/gcc: gcc.1

Log Message:
Add the -iremap option to gcc(1) and cpp(1).  This option specifies a
prefix transformation rule for __FILE__ and can be used to avoid
hard-coding the location of the source tree in the resulting binary.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/gnu/dist/gcc4/gcc/c-opts.c
cvs rdiff -u -r1.3 -r1.4 src/gnu/dist/gcc4/gcc/c.opt
cvs rdiff -u -r1.2 -r1.3 src/gnu/dist/gcc4/gcc/gcc.h
cvs rdiff -u -r1.4 -r1.5 src/gnu/dist/gcc4/gcc/doc/cpp.texi
cvs rdiff -u -r1.2 -r1.3 src/gnu/dist/gcc4/gcc/doc/cppopts.texi
cvs rdiff -u -r1.8 -r1.9 src/gnu/dist/gcc4/gcc/doc/invoke.texi
cvs rdiff -u -r1.2 -r1.3 src/gnu/dist/gcc4/libcpp/macro.c
cvs rdiff -u -r1.1.1.1 -r1.2 src/gnu/dist/gcc4/libcpp/include/cpplib.h
cvs rdiff -u -r1.2 -r1.3 src/gnu/usr.bin/gcc4/cpp/cpp.1
cvs rdiff -u -r1.3 -r1.4 src/gnu/usr.bin/gcc4/gcc/gcc.1

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

Modified files:

Index: src/gnu/dist/gcc4/gcc/c-opts.c
diff -u src/gnu/dist/gcc4/gcc/c-opts.c:1.4 src/gnu/dist/gcc4/gcc/c-opts.c:1.5
--- src/gnu/dist/gcc4/gcc/c-opts.c:1.4	Thu Jun 21 04:02:00 2007
+++ src/gnu/dist/gcc4/gcc/c-opts.c	Wed Nov 11 19:03:52 2009
@@ -163,6 +163,7 @@
 case OPT_isysroot:
 case OPT_isystem:
 case OPT_iquote:
+case OPT_iremap:
   error ("missing path after %qs", opt);
   break;
 
@@ -841,6 +842,10 @@
   add_path (xstrdup (arg), SYSTEM, 0, true);
   break;
 
+case OPT_iremap:
+  add_cpp_remap_path (arg);
+  break;
+
 case OPT_iwithprefix:
   add_prefixed_path (arg, SYSTEM);
   break;

Index: src/gnu/dist/gcc4/gcc/c.opt
diff -u src/gnu/dist/gcc4/gcc/c.opt:1.3 src/gnu/dist/gcc4/gcc/c.opt:1.4
--- src/gnu/dist/gcc4/gcc/c.opt:1.3	Thu Jun 21 04:02:00 2007
+++ src/gnu/dist/gcc4/gcc/c.opt	Wed Nov 11 19:03:52 2009
@@ -783,6 +783,10 @@
 C ObjC C++ ObjC++ Joined Separate
 -iquote 	Add  to the end of the quote include path
 
+iremap
+C ObjC C++ ObjC++ Joined Separate
+-iremap 	Convert  to  if it occurs as prefix in __FILE__.
+
 iwithprefix
 C ObjC C++ ObjC++ Joined Separate
 -iwithprefix 	Add  to the end of the system include path

Index: src/gnu/dist/gcc4/gcc/gcc.h
diff -u src/gnu/dist/gcc4/gcc/gcc.h:1.2 src/gnu/dist/gcc4/gcc/gcc.h:1.3
--- src/gnu/dist/gcc4/gcc/gcc.h:1.2	Fri May 12 00:33:26 2006
+++ src/gnu/dist/gcc4/gcc/gcc.h	Wed Nov 11 19:03:52 2009
@@ -50,7 +50,7 @@
   || !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \
   || !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \
   || !strcmp (STR, "iquote") || !strcmp (STR, "isystem") \
-  || !strcmp (STR, "isysroot") \
+  || !strcmp (STR, "-iremap") || !strcmp (STR, "isysroot") \
   || !strcmp (STR, "-param") || !strcmp (STR, "specs") \
   || !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ"))
 

Index: src/gnu/dist/gcc4/gcc/doc/cpp.texi
diff -u src/gnu/dist/gcc4/gcc/doc/cpp.texi:1.4 src/gnu/dist/gcc4/gcc/doc/cpp.texi:1.5
--- src/gnu/dist/gcc4/gcc/doc/cpp.texi:1.4	Thu Jun 21 04:02:02 2007
+++ src/gnu/dist/gcc4/gcc/doc/cpp.texi	Wed Nov 11 19:03:52 2009
@@ -4196,6 +4196,7 @@
 @c man begin SYNOPSIS
 cpp [...@option{-d}@var{macro...@var{defn}]@dots{}] [...@option{-u}@var{macro}]
 [...@option{-i}@var{d...@dots{}] [...@option{-iquote}@var{d...@dots{}]
+[...@option{-iremap}@var{src}:@var{dst}]
 [...@option{-w}@var{wa...@dots{}]
 [...@option{-m}|@option{-MM}] [...@option{-mg}] [...@option{-mf} @var{filename}]
 [...@option{-mp}] [...@option{-mq} @var{targ...@dots{}]

Index: src/gnu/dist/gcc4/gcc/doc/cppopts.texi
diff -u src/gnu/dist/gcc4/gcc/doc/cppopts.texi:1.2 src/gnu/dist/gcc4/gcc/doc/cppopts.texi:1.3
--- src/gnu/dist/gcc4/gcc/doc/cppopts.texi:1.2	Fri May 12 00:33:26 2006
+++ src/gnu/dist/gcc4/gcc/doc/cppopts.texi	Wed Nov 11 19:03:52 2009
@@ -513,6 +513,12 @@
 @xref{Search Path}.
 @end ifset
 
+...@item -iremap @var{src}:@var{dst}
+...@opindex iremap
+Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time.
+This option can be specified more than once.  Processing stops at the first
+match.
+
 @item -fdollars-in-identifiers
 @opindex fdollars-in-identifiers
 @anchor{fdollars-in-identifiers}

Index: src/gnu/dist/gcc4/gcc/doc/invoke.texi
diff -u src/gnu/dist/gcc4/gcc/doc/invoke.texi:1.8 src/gnu/dist/gcc4/gcc/doc/invoke.texi:1.9
--- src/gnu/dist/gcc4/gcc/doc/invoke.texi:1.8	Wed Apr 29 23:53:28 2009
+++ src/gnu/dist/gcc4/gcc/doc/invoke.texi	Wed Nov 11 19:03:52 2009
@@ -376,7 +376,8 @@
 
 @item Directory Options
 @xref{Directory Options,,Options for Directory Search}.
-...@gccoptlist{-b@var{p

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

2009-11-11 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Wed Nov 11 17:08:16 UTC 2009

Modified Files:
src/sys/arch/x86/include: pmap.h

Log Message:
update comment: we use PMAP_NOCACHE for both pmap_enter and pmap_kenter_pa


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/x86/include/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/arch/x86/include/pmap.h
diff -u src/sys/arch/x86/include/pmap.h:1.27 src/sys/arch/x86/include/pmap.h:1.28
--- src/sys/arch/x86/include/pmap.h:1.27	Sat Nov  7 07:27:48 2009
+++ src/sys/arch/x86/include/pmap.h	Wed Nov 11 17:08:16 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.27 2009/11/07 07:27:48 cegger Exp $	*/
+/*	$NetBSD: pmap.h,v 1.28 2009/11/11 17:08:16 cegger Exp $	*/
 
 /*
  *
@@ -176,7 +176,7 @@
 #endif
 
 /*
- * MD flags that we use for pmap_enter:
+ * MD flags that we use for pmap_enter and pmap_kenter_pa:
  */
 #define PMAP_NOCACHE	0x0100	/* set the non-cacheable bit */
 



CVS commit: src/sys/arch/shark/ofw

2009-11-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Nov 11 17:05:11 UTC 2009

Modified Files:
src/sys/arch/shark/ofw: igsfb_ofbus.c

Log Message:
Look for a Sun-like video mode specifier in output-device, if there is one
pass it on to igsfb. With this you can
setenv output-device=screen:r1280x1024x60
and igsfb will use that mode. The mode specified must be listed in
dev/videomode/modelines.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/shark/ofw/igsfb_ofbus.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/shark/ofw/igsfb_ofbus.c
diff -u src/sys/arch/shark/ofw/igsfb_ofbus.c:1.9 src/sys/arch/shark/ofw/igsfb_ofbus.c:1.10
--- src/sys/arch/shark/ofw/igsfb_ofbus.c:1.9	Tue Nov 10 22:24:57 2009
+++ src/sys/arch/shark/ofw/igsfb_ofbus.c	Wed Nov 11 17:05:11 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: igsfb_ofbus.c,v 1.9 2009/11/10 22:24:57 macallan Exp $ */
+/*	$NetBSD: igsfb_ofbus.c,v 1.10 2009/11/11 17:05:11 macallan Exp $ */
 
 /*
  * Copyright (c) 2006 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: igsfb_ofbus.c,v 1.9 2009/11/10 22:24:57 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: igsfb_ofbus.c,v 1.10 2009/11/11 17:05:11 macallan Exp $");
 
 #include 
 #include 
@@ -90,6 +90,7 @@
 	int chosen_phandle, igs_node;
 	int stdout_ihandle, stdout_phandle;
 	uint32_t regs[16];
+	char mode_buffer[64];
 
 	stdout_phandle = 0;
 
@@ -139,6 +140,10 @@
 	if (ret)
 		return ret;
 
+	if (of_get_mode_string(mode_buffer, sizeof(mode_buffer))) {
+		strcpy(dc->dc_modestring, mode_buffer);
+	}	
+
 	ret = igsfb_cnattach_subr(dc);
 	if (ret)
 		return ret;
@@ -199,7 +204,6 @@
 	return 10;	/* beat vga etc. */
 }
 
-
 static void
 igsfb_ofbus_attach(struct device *parent, struct device *self, void *aux)
 {
@@ -207,7 +211,7 @@
 	struct ofbus_attach_args *oba = aux;
 	uint32_t regs[16];
 	int isconsole, ret;
-
+	
 	if (igsfb_ofbus_is_console(oba->oba_phandle)) {
 		isconsole = 1;
 		sc->sc_dc = &igsfb_console_dc;



CVS commit: src/sys/dev/ic

2009-11-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Nov 11 17:01:17 UTC 2009

Modified Files:
src/sys/dev/ic: igsfb.c igsfb_subr.c igsfbreg.h igsfbvar.h

Log Message:
add modeseting support. Now if there's a mode string in igsfb_devconfig the
driver will try to use it if at all possible, otherwise fall back to the old
hardcoded 1024x768x60 mode.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/ic/igsfb.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ic/igsfb_subr.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/ic/igsfbreg.h
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/ic/igsfbvar.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/ic/igsfb.c
diff -u src/sys/dev/ic/igsfb.c:1.45 src/sys/dev/ic/igsfb.c:1.46
--- src/sys/dev/ic/igsfb.c:1.45	Tue Nov 10 22:23:22 2009
+++ src/sys/dev/ic/igsfb.c	Wed Nov 11 17:01:17 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: igsfb.c,v 1.45 2009/11/10 22:23:22 macallan Exp $ */
+/*	$NetBSD: igsfb.c,v 1.46 2009/11/11 17:01:17 macallan Exp $ */
 
 /*
  * Copyright (c) 2002, 2003 Valeriy E. Ushakov
@@ -31,7 +31,7 @@
  * Integraphics Systems IGA 168x and CyberPro series.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: igsfb.c,v 1.45 2009/11/10 22:23:22 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: igsfb.c,v 1.46 2009/11/11 17:01:17 macallan Exp $");
 
 #include 
 #include 
@@ -53,7 +53,10 @@
 #include 
 
 
-struct igsfb_devconfig igsfb_console_dc = {.dc_mmap = NULL,};
+struct igsfb_devconfig igsfb_console_dc = {
+	.dc_mmap = NULL,
+	.dc_modestring = "",
+};
 
 /*
  * wsscreen
@@ -202,6 +205,9 @@
 	ri = &dc->dc_console.scr_ri;
 	ri->ri_ops.eraserows(ri, 0, ri->ri_rows, defattr);
 
+	if (isconsole)
+		vcons_replay_msgbuf(&dc->dc_console);
+
 	/* attach wsdisplay */
 	waa.console = isconsole;
 	waa.scrdata = &igsfb_screenlist;
@@ -278,15 +284,10 @@
 	 */
 	igsfb_hw_setup(dc);
 
-	dc->dc_width = 1024;
-	dc->dc_height = 768;
-	dc->dc_depth = 8;
-	dc->dc_stride = dc->dc_width;
-
 	/*
 	 * Don't map in all N megs, just the amount we need for the wsscreen.
 	 */
-	dc->dc_fbsz = dc->dc_width * dc->dc_height; /* XXX: 8bpp specific */
+	dc->dc_fbsz = dc->dc_stride * dc->dc_height;
 	if (bus_space_map(dc->dc_memt, fbaddr, dc->dc_fbsz,
 			  dc->dc_memflags | BUS_SPACE_MAP_LINEAR,
 			  &dc->dc_fbh) != 0)

Index: src/sys/dev/ic/igsfb_subr.c
diff -u src/sys/dev/ic/igsfb_subr.c:1.9 src/sys/dev/ic/igsfb_subr.c:1.10
--- src/sys/dev/ic/igsfb_subr.c:1.9	Fri Oct 19 11:59:53 2007
+++ src/sys/dev/ic/igsfb_subr.c	Wed Nov 11 17:01:17 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: igsfb_subr.c,v 1.9 2007/10/19 11:59:53 ad Exp $ */
+/*	$NetBSD: igsfb_subr.c,v 1.10 2009/11/11 17:01:17 macallan Exp $ */
 
 /*
  * Copyright (c) 2002 Valeriy E. Ushakov
@@ -31,7 +31,7 @@
  * Integraphics Systems IGA 168x and CyberPro series.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: igsfb_subr.c,v 1.9 2007/10/19 11:59:53 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: igsfb_subr.c,v 1.10 2009/11/11 17:01:17 macallan Exp $");
 
 #include 
 #include 
@@ -48,6 +48,11 @@
 #include 
 #include 
 
+#ifdef IGSFB_DEBUG
+#define DPRINTF printf
+#else
+#define DPRINTF while (0) printf
+#endif
 
 static void	igsfb_init_seq(struct igsfb_devconfig *);
 static void	igsfb_init_crtc(struct igsfb_devconfig *);
@@ -58,6 +63,7 @@
 
 static void	igsfb_freq_latch(struct igsfb_devconfig *);
 static void	igsfb_video_on(struct igsfb_devconfig *);
+static void	igsfb_calc_pll(int, int *, int *, int *, int, int, int, int);
 
 
 
@@ -405,6 +411,11 @@
 	igs_ext_write(iot, ioh, 0x77, 0x01); /* 8bpp, indexed */
 	igs_ext_write(iot, ioh, 0x14, 0x81);
 	igs_ext_write(iot, ioh, 0x15, 0x00);
+
+	dc->dc_width = 1024;
+	dc->dc_height = 768;
+	dc->dc_depth = 8;
+	dc->dc_stride = dc->dc_width;
 }
 
 
@@ -414,6 +425,8 @@
 void
 igsfb_hw_setup(struct igsfb_devconfig *dc)
 {
+	const struct videomode *mode = NULL;
+	int i;
 
 	igsfb_init_seq(dc);
 	igsfb_init_crtc(dc);
@@ -422,6 +435,207 @@
 	igsfb_init_ext(dc);
 	igsfb_init_dac(dc);
 
-	igsfb_1024x768_8bpp_60Hz(dc);
+	i = 0;
+	while ((strcmp(dc->dc_modestring, videomode_list[i].name) != 0) &&	
+	   ( i < videomode_count)) {
+		i++;
+	}
+
+	if (i < videomode_count) {
+		/* found a mode, now let's see if we can display it */
+		if ((videomode_list[i].dot_clock <= IGS_MAX_CLOCK) &&
+		(videomode_list[i].hdisplay <= 2048) &&
+		(videomode_list[i].hdisplay >= 320) &&
+		(videomode_list[i].vdisplay <= 2048) &&
+		(videomode_list[i].vdisplay >= 200)) {
+		 	mode = &videomode_list[i];
+		}
+	}
+
+	if (mode != NULL) {
+		igsfb_set_mode(dc, mode, 8);
+	} else
+		igsfb_1024x768_8bpp_60Hz(dc);
+
 	igsfb_video_on(dc);
 }
+
+void
+igsfb_set_mode(struct igsfb_devconfig *dc, const struct videomode *mode,
+int depth)
+{
+	bus_space_tag_t iot = dc->dc_iot;
+	bus_space_handle_t ioh = dc->dc_ioh;
+	int i, m, n, p, hoffset, bytes_per_pixel, memfetch;
+	int vsync_start, hsync_start, vsync_end, hsync_end;
+	int vblank_start, vblank

CVS commit: src/sys/dev/ofw

2009-11-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Nov 11 16:56:52 UTC 2009

Modified Files:
src/sys/dev/ofw: ofw_subr.c openfirm.h

Log Message:
add another convenience function - of_get_mode_string() to extract a Sun-like
video mode specifier from output-device


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/ofw/ofw_subr.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/ofw/openfirm.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/ofw/ofw_subr.c
diff -u src/sys/dev/ofw/ofw_subr.c:1.14 src/sys/dev/ofw/ofw_subr.c:1.15
--- src/sys/dev/ofw/ofw_subr.c:1.14	Sat Mar 14 21:04:21 2009
+++ src/sys/dev/ofw/ofw_subr.c	Wed Nov 11 16:56:52 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw_subr.c,v 1.14 2009/03/14 21:04:21 dsl Exp $	*/
+/*	$NetBSD: ofw_subr.c,v 1.15 2009/11/11 16:56:52 macallan Exp $	*/
 
 /*
  * Copyright 1998
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.14 2009/03/14 21:04:21 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.15 2009/11/11 16:56:52 macallan Exp $");
 
 #include 
 #include 
@@ -291,3 +291,34 @@
 	data = prop_data_create_data(prop, len);
 	return(prop_dictionary_set(dict, propname, data));
 }
+
+/*
+ * look at output-device, see if there's a Sun-typical video mode specifier as
+ * in screen:r1024x768x60 attached. If found copy it into *buffer, otherwise
+ * return NULL
+ */
+
+char *
+of_get_mode_string(char *buffer, int len)
+{
+	int options;
+	char *pos, output_device[256];
+
+	/*
+	 * finally, let's see if there's a video mode specified in
+	 * output-device and pass it on so there's at least some way
+	 * to program video modes
+	 */
+	options = OF_finddevice("/options");
+	if ((options == 0) || (options == -1))
+		return NULL;
+	if (OF_getprop(options, "output-device", output_device, 256) == 0)
+		return NULL;
+
+	/* find the mode string if there is one */
+	pos = strstr(output_device, ":r");
+	if (pos == NULL)
+		return NULL;
+	strncpy(buffer, pos + 2, len);
+	return buffer;
+}

Index: src/sys/dev/ofw/openfirm.h
diff -u src/sys/dev/ofw/openfirm.h:1.26 src/sys/dev/ofw/openfirm.h:1.27
--- src/sys/dev/ofw/openfirm.h:1.26	Tue Dec 25 18:33:40 2007
+++ src/sys/dev/ofw/openfirm.h	Wed Nov 11 16:56:52 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: openfirm.h,v 1.26 2007/12/25 18:33:40 perry Exp $	*/
+/*	$NetBSD: openfirm.h,v 1.27 2009/11/11 16:56:52 macallan Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -113,5 +113,6 @@
 const char *);
 
 int	*of_network_decode_media(int, int *, int *);
+char	*of_get_mode_string(char *, int);
 
 #endif /*_OPENFIRM_H_*/



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

2009-11-11 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Nov 11 16:50:17 UTC 2009

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

Log Message:
set return value properly


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/rump/librump/rumpkern/ltsleep.c

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

Modified files:

Index: src/sys/rump/librump/rumpkern/ltsleep.c
diff -u src/sys/rump/librump/rumpkern/ltsleep.c:1.20 src/sys/rump/librump/rumpkern/ltsleep.c:1.21
--- src/sys/rump/librump/rumpkern/ltsleep.c:1.20	Wed Nov 11 16:47:50 2009
+++ src/sys/rump/librump/rumpkern/ltsleep.c	Wed Nov 11 16:50:17 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ltsleep.c,v 1.20 2009/11/11 16:47:50 pooka Exp $	*/
+/*	$NetBSD: ltsleep.c,v 1.21 2009/11/11 16:50:17 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ltsleep.c,v 1.20 2009/11/11 16:47:50 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ltsleep.c,v 1.21 2009/11/11 16:50:17 pooka Exp $");
 
 #include 
 #include 
@@ -61,8 +61,11 @@
 
 	/* protected by biglock */
 	if (timo) {
-		rv = rumpuser_cv_timedwait(ltsp->cv, rump_giantlock,
-		timo / hz, (timo % hz) * (10/hz));
+		if (rumpuser_cv_timedwait(ltsp->cv, rump_giantlock,
+		timo / hz, (timo % hz) * (10/hz)) == 0)
+			rv = 0;
+		else
+			rv = EWOULDBLOCK;
 	} else {
 		rumpuser_cv_wait(ltsp->cv, rump_giantlock);
 		rv = 0;



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

2009-11-11 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Nov 11 16:47:50 UTC 2009

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

Log Message:
support timeouts in tsleep


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/rump/librump/rumpkern/ltsleep.c

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

Modified files:

Index: src/sys/rump/librump/rumpkern/ltsleep.c
diff -u src/sys/rump/librump/rumpkern/ltsleep.c:1.19 src/sys/rump/librump/rumpkern/ltsleep.c:1.20
--- src/sys/rump/librump/rumpkern/ltsleep.c:1.19	Thu Oct 15 00:28:46 2009
+++ src/sys/rump/librump/rumpkern/ltsleep.c	Wed Nov 11 16:47:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ltsleep.c,v 1.19 2009/10/15 00:28:46 pooka Exp $	*/
+/*	$NetBSD: ltsleep.c,v 1.20 2009/11/11 16:47:50 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -29,9 +29,10 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ltsleep.c,v 1.19 2009/10/15 00:28:46 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ltsleep.c,v 1.20 2009/11/11 16:47:50 pooka Exp $");
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -50,32 +51,49 @@
 
 kcondvar_t lbolt; /* Oh Kath Ra */
 
+static int
+sleeper(struct ltsleeper *ltsp, int timo)
+{
+	int rv, nlocks;
+
+	LIST_INSERT_HEAD(&sleepers, ltsp, entries);
+	kernel_unlock_allbutone(&nlocks);
+
+	/* protected by biglock */
+	if (timo) {
+		rv = rumpuser_cv_timedwait(ltsp->cv, rump_giantlock,
+		timo / hz, (timo % hz) * (10/hz));
+	} else {
+		rumpuser_cv_wait(ltsp->cv, rump_giantlock);
+		rv = 0;
+	}
+
+	LIST_REMOVE(ltsp, entries);
+	rumpuser_cv_destroy(ltsp->cv);
+	kernel_ununlock_allbutone(nlocks);
+
+	return rv;
+}
+
 int
 ltsleep(wchan_t ident, pri_t prio, const char *wmesg, int timo,
 	volatile struct simplelock *slock)
 {
 	struct ltsleeper lts;
-	int nlocks;
+	int rv;
 
 	lts.id = ident;
 	rumpuser_cv_init(

CVS commit: src/sys/rump

2009-11-11 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Nov 11 16:46:50 UTC 2009

Modified Files:
src/sys/rump/include/rump: rumpuser.h
src/sys/rump/librump/rumpkern: intr.c locks.c
src/sys/rump/librump/rumpuser: rumpuser_pth.c

Log Message:
Make rumpuser_cv_timedwait take two int64's instead timespec to
uncouple it from the timespec layout.  Also, change return value
to zero for "timeout didn't expire" and non-zero for "timeout
expired".  This decouples the interface from errno assignments.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/rump/include/rump/rumpuser.h
cvs rdiff -u -r1.20 -r1.21 src/sys/rump/librump/rumpkern/intr.c
cvs rdiff -u -r1.33 -r1.34 src/sys/rump/librump/rumpkern/locks.c
cvs rdiff -u -r1.37 -r1.38 src/sys/rump/librump/rumpuser/rumpuser_pth.c

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

Modified files:

Index: src/sys/rump/include/rump/rumpuser.h
diff -u src/sys/rump/include/rump/rumpuser.h:1.31 src/sys/rump/include/rump/rumpuser.h:1.32
--- src/sys/rump/include/rump/rumpuser.h:1.31	Sat Oct 24 11:36:59 2009
+++ src/sys/rump/include/rump/rumpuser.h	Wed Nov 11 16:46:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpuser.h,v 1.31 2009/10/24 11:36:59 pooka Exp $	*/
+/*	$NetBSD: rumpuser.h,v 1.32 2009/11/11 16:46:50 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -142,7 +142,7 @@
 void rumpuser_cv_wait(struct rumpuser_cv *, struct rumpuser_mtx *);
 void rumpuser_cv_wait_nowrap(struct rumpuser_cv *, struct rumpuser_mtx *);
 int  rumpuser_cv_timedwait(struct rumpuser_cv *, struct rumpuser_mtx *,
-			   struct timespec *);
+			   int64_t, int64_t);
 void rumpuser_cv_signal(struct rumpuser_cv *);
 void rumpuser_cv_broadcast(struct rumpuser_cv *);
 int  rumpuser_cv_has_waiters(struct rumpuser_cv *);

Index: src/sys/rump/librump/rumpkern/intr.c
diff -u src/sys/rump/librump/rumpkern/intr.c:1.20 src/sys/rump/librump/rumpkern/intr.c:1.21
--- src/sys/rump/librump/rumpkern/intr.c:1.20	Mon Nov  9 19:16:18 2009
+++ src/sys/rump/librump/rumpkern/intr.c	Wed Nov 11 16:46:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.20 2009/11/09 19:16:18 pooka Exp $	*/
+/*	$NetBSD: intr.c,v 1.21 2009/11/11 16:46:50 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.20 2009/11/09 19:16:18 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.21 2009/11/11 16:46:50 pooka Exp $");
 
 #include 
 #include 
@@ -124,7 +124,7 @@
 
 		/* wait until the next tick. XXX: what if the clock changes? */
 		while (rumpuser_cv_timedwait(clockcv, clockmtx,
-		&curtime) != EWOULDBLOCK)
+		curtime.tv_sec, curtime.tv_nsec) == 0)
 			continue;
 
 		clkgen++;

Index: src/sys/rump/librump/rumpkern/locks.c
diff -u src/sys/rump/librump/rumpkern/locks.c:1.33 src/sys/rump/librump/rumpkern/locks.c:1.34
--- src/sys/rump/librump/rumpkern/locks.c:1.33	Wed Nov  4 13:32:39 2009
+++ src/sys/rump/librump/rumpkern/locks.c	Wed Nov 11 16:46:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: locks.c,v 1.33 2009/11/04 13:32:39 pooka Exp $	*/
+/*	$NetBSD: locks.c,v 1.34 2009/11/11 16:46:50 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: locks.c,v 1.33 2009/11/04 13:32:39 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locks.c,v 1.34 2009/11/11 16:46:50 pooka Exp $");
 
 #include 
 #include 
@@ -236,7 +236,11 @@
 		cv_wait(cv, mtx);
 		return 0;
 	} else {
-		return rumpuser_cv_timedwait(RUMPCV(cv), RUMPMTX(mtx), &ts);
+		if (rumpuser_cv_timedwait(RUMPCV(cv), RUMPMTX(mtx),
+		ts.tv_sec, ts.tv_nsec))
+			return EWOULDBLOCK;
+		else
+			return 0;
 	}
 }
 

Index: src/sys/rump/librump/rumpuser/rumpuser_pth.c
diff -u src/sys/rump/librump/rumpuser/rumpuser_pth.c:1.37 src/sys/rump/librump/rumpuser/rumpuser_pth.c:1.38
--- src/sys/rump/librump/rumpuser/rumpuser_pth.c:1.37	Mon Nov  9 18:00:26 2009
+++ src/sys/rump/librump/rumpuser/rumpuser_pth.c	Wed Nov 11 16:46:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpuser_pth.c,v 1.37 2009/11/09 18:00:26 pooka Exp $	*/
+/*	$NetBSD: rumpuser_pth.c,v 1.38 2009/11/11 16:46:50 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
 
 #include 
 #if !defined(lint)
-__RCSID("$NetBSD: rumpuser_pth.c,v 1.37 2009/11/09 18:00:26 pooka Exp $");
+__RCSID("$NetBSD: rumpuser_pth.c,v 1.38 2009/11/11 16:46:50 pooka Exp $");
 #endif /* !lint */
 
 #ifdef __linux__
@@ -473,21 +473,23 @@
 
 int
 rumpuser_cv_timedwait(struct rumpuser_cv *cv, struct rumpuser_mtx *mtx,
-	struct timespec *ts)
+	int64_t sec, int64_t nsec)
 {
+	struct timespec ts;
 	int rv;
 
+	/* LINTED */
+	ts.tv_sec = sec; ts.tv_nsec = nsec;
+
 	cv->nwaiters++;
 	mtxexit(mtx);
-	KLOCK_WRAP(rv = pthread_cond_timedwait(&cv->pthcv, &mtx->pthmtx, ts));
+	KLOCK_WRAP(rv = pthread_cond_timedwait(&cv->pthcv, &mt

CVS commit: src/share/mk

2009-11-11 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Wed Nov 11 16:35:45 UTC 2009

Modified Files:
src/share/mk: bsd.sys.mk bsd.x11.mk

Log Message:
Enable Stack Smash Protection (SSP) by default for NetBSD/amd64 and
NetBSD/i386 as previously discussed on the "port-amd64" and
"port-i386" mailing lists. No objections from the core team.

Thanks a lot to Tobias Nygren for helping me with the benchmarking
and to Christos Zoulas for fixing SSP problems in cgd(4).


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/share/mk/bsd.sys.mk
cvs rdiff -u -r1.79 -r1.80 src/share/mk/bsd.x11.mk

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

Modified files:

Index: src/share/mk/bsd.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.181 src/share/mk/bsd.sys.mk:1.182
--- src/share/mk/bsd.sys.mk:1.181	Mon Nov  9 15:58:09 2009
+++ src/share/mk/bsd.sys.mk	Wed Nov 11 16:35:45 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.sys.mk,v 1.181 2009/11/09 15:58:09 skrll Exp $
+#	$NetBSD: bsd.sys.mk,v 1.182 2009/11/11 16:35:45 tron Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -59,6 +59,11 @@
 HAS_SSP=	yes
 .endif
 
+.if ((${MACHINE_ARCH} == "amd64") || (${MACHINE_ARCH} == "i386") && \
+ (_SRC_TOP_ != ""))
+USE_SSP?=	yes
+.endif
+
 .if defined(USE_FORT) && (${USE_FORT} != "no")
 USE_SSP?=	yes
 .if !defined(KERNSRCDIR) && !defined(KERN) # not for kernels nor kern modules

Index: src/share/mk/bsd.x11.mk
diff -u src/share/mk/bsd.x11.mk:1.79 src/share/mk/bsd.x11.mk:1.80
--- src/share/mk/bsd.x11.mk:1.79	Mon Nov  9 07:38:14 2009
+++ src/share/mk/bsd.x11.mk	Wed Nov 11 16:35:45 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.x11.mk,v 1.79 2009/11/09 07:38:14 mrg Exp $
+#	$NetBSD: bsd.x11.mk,v 1.80 2009/11/11 16:35:45 tron Exp $
 
 .include 
 
@@ -8,6 +8,8 @@
 
 COPTS+=			-fno-strict-aliasing
 
+.include 
+
 .if defined(USE_SSP) && (${USE_SSP} != "no")
 CPPFLAGS+=		-DNO_ALLOCA
 .endif



CVS commit: src/sys/arch

2009-11-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov 11 16:08:32 UTC 2009

Modified Files:
src/sys/arch/hp700/hp700: mainbus.c
src/sys/arch/hppa/hppa: pmap.c
src/sys/arch/hppa/include: pmap.h

Log Message:
Use the new flags argument to pmap_kenter_pa for PMAP_NOCACHE.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/hp700/hp700/mainbus.c
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/hppa/hppa/pmap.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hppa/include/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/arch/hp700/hp700/mainbus.c
diff -u src/sys/arch/hp700/hp700/mainbus.c:1.55 src/sys/arch/hp700/hp700/mainbus.c:1.56
--- src/sys/arch/hp700/hp700/mainbus.c:1.55	Sat Nov  7 07:27:43 2009
+++ src/sys/arch/hp700/hp700/mainbus.c	Wed Nov 11 16:08:31 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.55 2009/11/07 07:27:43 cegger Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.56 2009/11/11 16:08:31 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.55 2009/11/07 07:27:43 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.56 2009/11/11 16:08:31 skrll Exp $");
 
 #include "locators.h"
 #include "power.h"
@@ -1304,7 +1304,7 @@
 	TAILQ_FOREACH(pg, pglist, pageq.queue) {
 		KASSERT(size != 0);
 		pa = VM_PAGE_TO_PHYS(pg);
-		pmap_kenter_pa(va, pa, VM_PROT_READ | VM_PROT_WRITE | PMAP_NC, 0);
+		pmap_kenter_pa(va, pa, VM_PROT_READ | VM_PROT_WRITE, PMAP_NOCACHE);
 		va += PAGE_SIZE;
 		size -= PAGE_SIZE;
 	}

Index: src/sys/arch/hppa/hppa/pmap.c
diff -u src/sys/arch/hppa/hppa/pmap.c:1.54 src/sys/arch/hppa/hppa/pmap.c:1.55
--- src/sys/arch/hppa/hppa/pmap.c:1.54	Sat Nov  7 07:27:44 2009
+++ src/sys/arch/hppa/hppa/pmap.c	Wed Nov 11 16:08:31 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.54 2009/11/07 07:27:44 cegger Exp $	*/
+/*	$NetBSD: pmap.c,v 1.55 2009/11/11 16:08:31 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.54 2009/11/07 07:27:44 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.55 2009/11/11 16:08:31 skrll Exp $");
 
 #include 
 #include 
@@ -1780,7 +1780,7 @@
 	opte = pmap_pte_get(pde, va);
 	pte = pa | PTE_PROT(TLB_WIRED | TLB_REFTRAP |
 	pmap_prot(pmap_kernel(), prot & VM_PROT_ALL));
-	if (pa >= HPPA_IOBEGIN || (prot & PMAP_NC))
+	if (pa >= HPPA_IOBEGIN || (flags & PMAP_NOCACHE))
 		pte |= PTE_PROT(TLB_UNCACHEABLE);
 	pmap_kernel()->pm_stats.wired_count++;
 	pmap_kernel()->pm_stats.resident_count++;
@@ -1797,7 +1797,7 @@
 
 			mutex_enter(&pg->mdpage.pvh_lock);
 
-			if (prot & PMAP_NC)
+			if (flags & PMAP_NOCACHE)
 pg->mdpage.pvh_attrs |= PVF_NC;
 			else {
 struct pv_entry *pve;

Index: src/sys/arch/hppa/include/pmap.h
diff -u src/sys/arch/hppa/include/pmap.h:1.21 src/sys/arch/hppa/include/pmap.h:1.22
--- src/sys/arch/hppa/include/pmap.h:1.21	Sun May 24 06:53:35 2009
+++ src/sys/arch/hppa/include/pmap.h	Wed Nov 11 16:08:31 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.21 2009/05/24 06:53:35 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.22 2009/11/11 16:08:31 skrll Exp $	*/
 
 /*	$OpenBSD: pmap.h,v 1.35 2007/12/14 18:32:23 deraadt Exp $	*/
 
@@ -56,8 +56,6 @@
 	struct pmap_statistics	pm_stats;
 };
 
-#define	PMAP_NC		0x100
-
 /*
  * Flags that indicate attributes of pages or mappings of pages.
  *
@@ -208,6 +206,11 @@
 	va) & 0xc000) != 0xc000) ? \
 	 (pmap)->pm_space : HPPA_SID_KERNEL)
 
+/*
+ * MD flags that we use for pmap_kenter_pa:
+ */
+#define PMAP_NOCACHE0x01	/* set the non-cacheable bit */
+
 #endif /* _KERNEL */
 
 #endif /* _HPPA_PMAP_H_ */



CVS commit: src/sys/dev/usb

2009-11-11 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Nov 11 15:49:05 UTC 2009

Modified Files:
src/sys/dev/usb: usb_subr.c

Log Message:
be a little more verbose in DIAGNOSTIC printf


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/sys/dev/usb/usb_subr.c

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

Modified files:

Index: src/sys/dev/usb/usb_subr.c
diff -u src/sys/dev/usb/usb_subr.c:1.164 src/sys/dev/usb/usb_subr.c:1.165
--- src/sys/dev/usb/usb_subr.c:1.164	Thu Sep  3 20:54:03 2009
+++ src/sys/dev/usb/usb_subr.c	Wed Nov 11 15:49:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_subr.c,v 1.164 2009/09/03 20:54:03 dyoung Exp $	*/
+/*	$NetBSD: usb_subr.c,v 1.165 2009/11/11 15:49:05 pooka Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.164 2009/09/03 20:54:03 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.165 2009/11/11 15:49:05 pooka Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_usbverbose.h"
@@ -1130,8 +1130,9 @@
 		/* Max packet size must be 64 (sec 5.5.3). */
 		if (dd->bMaxPacketSize != USB_2_MAX_CTRL_PACKET) {
 #ifdef DIAGNOSTIC
-			printf("usbd_new_device: addr=%d bad max packet size\n",
-			   addr);
+			printf("usbd_new_device: addr=%d bad max packet "
+			"size=%d. adjusting to %d.\n",
+			addr, dd->bMaxPacketSize, USB_2_MAX_CTRL_PACKET);
 #endif
 			dd->bMaxPacketSize = USB_2_MAX_CTRL_PACKET;
 		}



CVS commit: src/doc

2009-11-11 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Wed Nov 11 15:35:57 UTC 2009

Modified Files:
src/doc: 3RDPARTY

Log Message:
update libevent version information


To generate a diff of this commit:
cvs rdiff -u -r1.731 -r1.732 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.731 src/doc/3RDPARTY:1.732
--- src/doc/3RDPARTY:1.731	Wed Nov 11 09:11:26 2009
+++ src/doc/3RDPARTY	Wed Nov 11 15:35:57 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.731 2009/11/11 09:11:26 martti Exp $
+#	$NetBSD: 3RDPARTY,v 1.732 2009/11/11 15:35:57 plunky Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -557,8 +557,8 @@
 repository. See the lvm2tools Notes for more information.
 
 Package:	libevent
-Version:	1.4.4-stable
-Current Vers:	1.4.11-stable
+Version:	1.4.12-stable
+Current Vers:	2.0.2-alpha
 Maintainer:	Niels Provos 
 Archive Site:	http://www.monkey.org/~provos/libevent/
 Home Page:	http://www.monkey.org/~provos/libevent/



CVS commit: src/sys/dev/ppbus

2009-11-11 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Wed Nov 11 15:34:37 UTC 2009

Modified Files:
src/sys/dev/ppbus: ppbus_conf.c

Log Message:
Make this actually build, as part of the sgimips GENERIC32_IP2x kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/ppbus/ppbus_conf.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/ppbus/ppbus_conf.c
diff -u src/sys/dev/ppbus/ppbus_conf.c:1.17 src/sys/dev/ppbus/ppbus_conf.c:1.18
--- src/sys/dev/ppbus/ppbus_conf.c:1.17	Sat Nov  7 00:05:49 2009
+++ src/sys/dev/ppbus/ppbus_conf.c	Wed Nov 11 15:34:37 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: ppbus_conf.c,v 1.17 2009/11/07 00:05:49 dyoung Exp $ */
+/* $NetBSD: ppbus_conf.c,v 1.18 2009/11/11 15:34:37 he Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998, 1999 Nicolas Souchu
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ppbus_conf.c,v 1.17 2009/11/07 00:05:49 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ppbus_conf.c,v 1.18 2009/11/11 15:34:37 he Exp $");
 
 #include "opt_ppbus.h"
 #include "opt_ppbus_1284.h"
@@ -181,13 +181,16 @@
 static void
 ppbus_childdet(device_t self, device_t target)
 {
+	struct ppbus_softc * ppbus = device_private(self);
+	struct ppbus_device_softc * child;
+
 	SLIST_FOREACH(child, &ppbus->sc_childlist_head, entries) {
 		if (child->sc_dev == target)
 			break;
 	}
 	if (child != NULL)
 		SLIST_REMOVE(&ppbus->sc_childlist_head, child,
-		struct ppbus_device_softc, entries);
+		ppbus_device_softc, entries);
 }
 
 /* Detach function for ppbus. */



CVS commit: src/sys/kern

2009-11-11 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Wed Nov 11 14:54:40 UTC 2009

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

Log Message:
workqueue_finiqueue: remove unused variable.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/kern/subr_workqueue.c

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

Modified files:

Index: src/sys/kern/subr_workqueue.c
diff -u src/sys/kern/subr_workqueue.c:1.29 src/sys/kern/subr_workqueue.c:1.30
--- src/sys/kern/subr_workqueue.c:1.29	Wed Oct 21 21:12:06 2009
+++ src/sys/kern/subr_workqueue.c	Wed Nov 11 14:54:40 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_workqueue.c,v 1.29 2009/10/21 21:12:06 rmind Exp $	*/
+/*	$NetBSD: subr_workqueue.c,v 1.30 2009/11/11 14:54:40 rmind Exp $	*/
 
 /*-
  * Copyright (c)2002, 2005, 2006, 2007 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.29 2009/10/21 21:12:06 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.30 2009/11/11 14:54:40 rmind Exp $");
 
 #include 
 #include 
@@ -205,14 +205,12 @@
 workqueue_finiqueue(struct workqueue *wq, struct workqueue_queue *q)
 {
 	struct workqueue_exitargs wqe;
-	lwp_t *l;
 
 	KASSERT(wq->wq_func == workqueue_exit);
 
 	wqe.wqe_q = q;
 	KASSERT(SIMPLEQ_EMPTY(&q->q_queue));
 	KASSERT(q->q_worker != NULL);
-	l = curlwp;
 	mutex_enter(&q->q_mutex);
 	SIMPLEQ_INSERT_TAIL(&q->q_queue, &wqe.wqe_wk, wk_entry);
 	cv_signal(&q->q_cv);



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

2009-11-11 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Wed Nov 11 14:20:01 UTC 2009

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

Log Message:
Pass a 0 as flag value to pmap_kenter_pa().


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/sparc/sparc/msiiep.c

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

Modified files:

Index: src/sys/arch/sparc/sparc/msiiep.c
diff -u src/sys/arch/sparc/sparc/msiiep.c:1.37 src/sys/arch/sparc/sparc/msiiep.c:1.38
--- src/sys/arch/sparc/sparc/msiiep.c:1.37	Sat May 16 17:42:35 2009
+++ src/sys/arch/sparc/sparc/msiiep.c	Wed Nov 11 14:20:01 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: msiiep.c,v 1.37 2009/05/16 17:42:35 martin Exp $ */
+/*	$NetBSD: msiiep.c,v 1.38 2009/11/11 14:20:01 he Exp $ */
 
 /*
  * Copyright (c) 2001 Valeriy E. Ushakov
@@ -27,7 +27,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: msiiep.c,v 1.37 2009/05/16 17:42:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msiiep.c,v 1.38 2009/11/11 14:20:01 he Exp $");
 
 #include 
 #include 
@@ -701,7 +701,8 @@
 			panic("mspcic_dmamem_map: size botch");
 
 		pa = VM_PAGE_TO_PHYS(m);
-		pmap_kenter_pa(va, pa | PMAP_NC, VM_PROT_READ | VM_PROT_WRITE);
+		pmap_kenter_pa(va,
+		pa | PMAP_NC, VM_PROT_READ | VM_PROT_WRITE, 0);
 		va += pagesz;
 		size -= pagesz;
 	}



CVS commit: src/libexec/ld.elf_so/arch/arm

2009-11-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov 11 14:15:41 UTC 2009

Modified Files:
src/libexec/ld.elf_so/arch/arm: rtld_start.S

Log Message:
Add RCSID


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/libexec/ld.elf_so/arch/arm/rtld_start.S

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

Modified files:

Index: src/libexec/ld.elf_so/arch/arm/rtld_start.S
diff -u src/libexec/ld.elf_so/arch/arm/rtld_start.S:1.9 src/libexec/ld.elf_so/arch/arm/rtld_start.S:1.10
--- src/libexec/ld.elf_so/arch/arm/rtld_start.S:1.9	Mon Apr 28 20:23:03 2008
+++ src/libexec/ld.elf_so/arch/arm/rtld_start.S	Wed Nov 11 14:15:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld_start.S,v 1.9 2008/04/28 20:23:03 martin Exp $	*/
+/*	$NetBSD: rtld_start.S,v 1.10 2009/11/11 14:15:41 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
@@ -31,6 +31,8 @@
 
 #include 
 
+RCSID("$NetBSD: rtld_start.S,v 1.10 2009/11/11 14:15:41 skrll Exp $")
+
 	.text
 	.align	0
 	.globl	_rtld_start



CVS commit: src/sys/rump/dev/wip

2009-11-11 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Nov 11 13:54:54 UTC 2009

Added Files:
src/sys/rump/dev/wip: Makefile

Log Message:
Give this a makefile for easy rebuild of all the components when
the kernel ABI changes.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/rump/dev/wip/Makefile

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

Added files:

Index: src/sys/rump/dev/wip/Makefile
diff -u /dev/null src/sys/rump/dev/wip/Makefile:1.1
--- /dev/null	Wed Nov 11 13:54:54 2009
+++ src/sys/rump/dev/wip/Makefile	Wed Nov 11 13:54:54 2009
@@ -0,0 +1,6 @@
+#	$NetBSD: Makefile,v 1.1 2009/11/11 13:54:54 pooka Exp $
+#
+
+SUBDIR=	libnet80211 librumpusbhc libumass libusb libusbrum
+
+.include 



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

2009-11-11 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Wed Nov 11 13:38:53 UTC 2009

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

Log Message:
x86_get_sdbase: copyout to a correct address.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x86/x86/sys_machdep.c

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

Modified files:

Index: src/sys/arch/x86/x86/sys_machdep.c
diff -u src/sys/arch/x86/x86/sys_machdep.c:1.20 src/sys/arch/x86/x86/sys_machdep.c:1.21
--- src/sys/arch/x86/x86/sys_machdep.c:1.20	Wed Jul 29 12:02:06 2009
+++ src/sys/arch/x86/x86/sys_machdep.c	Wed Nov 11 13:38:53 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_machdep.c,v 1.20 2009/07/29 12:02:06 cegger Exp $	*/
+/*	$NetBSD: sys_machdep.c,v 1.21 2009/11/11 13:38:53 yamt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.20 2009/07/29 12:02:06 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.21 2009/11/11 13:38:53 yamt Exp $");
 
 #include "opt_mtrr.h"
 #include "opt_perfctrs.h"
@@ -647,7 +647,7 @@
 	}
 
 	base = sd->sd_hibase << 24 | sd->sd_lobase;
-	return copyout(&base, &arg, sizeof(base));
+	return copyout(&base, arg, sizeof(base));
 #else
 	return EINVAL;
 #endif



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

2009-11-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov 11 12:57:53 UTC 2009

Modified Files:
src/sys/arch/hp700/hp700: pim.h

Log Message:
Update / improve the snprintb formats.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hp700/hp700/pim.h

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

Modified files:

Index: src/sys/arch/hp700/hp700/pim.h
diff -u src/sys/arch/hp700/hp700/pim.h:1.4 src/sys/arch/hp700/hp700/pim.h:1.5
--- src/sys/arch/hp700/hp700/pim.h:1.4	Sun May 17 18:21:29 2009
+++ src/sys/arch/hp700/hp700/pim.h	Wed Nov 11 12:57:52 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pim.h,v 1.4 2009/05/17 18:21:29 mjf Exp $	*/
+/*	$NetBSD: pim.h,v 1.5 2009/11/11 12:57:52 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -136,7 +136,12 @@
 #define	PIM_CHECK_TLB		(1 << 30)
 #define	PIM_CHECK_BUS		(1 << 29)
 #define	PIM_CHECK_ASSISTS	(1 << 28)
-#define	PIM_CHECK_BITS		"\020\040CACHE\037TLB\036BUS\035ASSISTS"
+#define	PIM_CHECK_BITS		\
+	"\177\020"		/* New bitmask format */	\
+	"b\040cache\0"		/* bit 31 */			\
+	"b\037tlb\0"		/* bit 30 */			\
+	"b\036bus\0"		/* bit 29 */			\
+	"b\035assists\0"	/* bit 28 */
 
 	/*
 	 * The CPU State.  In addition to the common PIM_CPU_
@@ -150,12 +155,25 @@
 #define	PIM_CPU_CRV	(1 << 27)
 #define	PIM_CPU_SRV	(1 << 26)
 #define	PIM_CPU_TRV	(1 << 25)
-#define	PIM_CPU_BITS	"\020\040IQV\037IQF\036IPV\035GRV\034CRV\033SRV\032TRV"
+#define	PIM_CPU_BITS		\
+	"\177\020"		/* New bitmask format */	\
+	"b\040iqv\0"		/* bit 31 */			\
+	"b\037iqf\0"		/* bit 30 */			\
+	"b\036ipv\0"		/* bit 29 */			\
+	"b\035grv\0"		/* bit 28 */			\
+	"b\034crv\0"		/* bit 27 */			\
+	"b\033srv\0"		/* bit 26 */			\
+	"b\032trv\0"		/* bit 25 */
 #define	PIM_CPU_HPMC_TL(cs)	(((cs) >> 4) & 0x3)
 #define	PIM_CPU_HPMC_HD		(1 << 3)
 #define	PIM_CPU_HPMC_SIS	(1 << 2)
 #define	PIM_CPU_HPMC_CS(cs)	((cs) & 0x3)
-#define	PIM_CPU_HPMC_BITS	PIM_CPU_BITS "\004HD\003SIS"
+#define	PIM_CPU_HPMC_BITS	\
+	PIM_CPU_BITS		\
+	"f\004\002tl\0" /* bit 4 .. 5 */		\
+	"b\003hd\0" /* bit 3 */			\
+	"b\002sis\0"/* bit 2 */			\
+	"f\000\002cs\0" /* bit 0 .. 1 */
 
 	uint32_t	pim_check_reserved_0;
 
@@ -169,7 +187,16 @@
 #define	PIM_CACHE_LC	(1 << 26)
 #define	PIM_CACHE_RCC	(1 << 25)
 #define	PIM_CACHE_PADD(cc)	((cc) & 0x000f)
-#define	PIM_CACHE_BITS	"\020\040ICC\037DCC\036TC\035DC\034CRG\033LC\032RCC"
+#define	PIM_CACHE_BITS		\
+	"\177\020"		/* New bitmask format */	\
+	"b\040icc\0"		/* bit 31 */			\
+	"b\039dcc\0"		/* bit 30 */			\
+	"b\038tc\0"		/* bit 29 */			\
+	"b\037dc\0"		/* bit 28 */			\
+	"b\036crg\0"		/* bit 27 */			\
+	"b\035lc\0"		/* bit 26 */			\
+	"b\034rcc\0"		/* bit 25 */			\
+	"f\000\032paddr\0"	/* bit 0 .. 23 */
 
 	/* The TLB Check word. */
 	uint32_t	pim_check_tlb;
@@ -178,7 +205,13 @@
 #define	PIM_TLB_TRG	(1 << 29)
 #define	PIM_TLB_TUC	(1 << 28)
 #define	PIM_TLB_TNF	(1 << 27)
-#define	PIM_TLB_BITS	"\020\040ITC\037DTC\036TRG\035TUC\034TNF"
+#define	PIM_TLB_BITS		\
+	"\177\020"		/* New bitmask format */	\
+	"b\040itc\0"		/* bit 31 */			\
+	"b\039dtc\0"		/* bit 30 */			\
+	"b\038trg\0"		/* bit 29 */			\
+	"b\037tuc\0"		/* bit 28 */			\
+	"b\036tnf\0"		/* bit 27 */			\
 
 	/* The Bus Check word. */
 	uint32_t	pim_check_bus;
@@ -190,7 +223,16 @@
 #define	PIM_BUS_PIV		(1 << 7)
 #define	PIM_BUS_BSV		(1 << 6)
 #define	PIM_BUS_STAT(bc)	((bc) & 0x3f)
-#define	PIM_BUS_BITS		"\020\026RSV\025RQV\010PIV\007BSV"
+#define	PIM_BUS_BITS \
+	"\177\020"		/* New bitmask format */	\
+	"b\025rsv\0" 		/* bit 21 */			\
+	"b\024rqv\0"		/* bit 20 */			\
+	"f\020\004var\0"	/* bit 16 .. 19 */		\
+	"f\014\004type\0"	/* bit 12 .. 15 */		\
+	"f\010\004size\0"	/* bit 8 .. 11 */		\
+	"b\007piv\0"		/* bit 7 */			\
+	"b\006bsv\0"		/* bit 6 */			\
+	"f\000\006stat\0"	/* bit 0 .. 5 */
 
 	/* The Assist Check word. */
 	uint32_t	pim_check_assist;



CVS commit: src/sys/arch/m68k/m68k

2009-11-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov 11 11:25:53 UTC 2009

Modified Files:
src/sys/arch/m68k/m68k: lock_stubs.s

Log Message:
Remove unnecessary and incorrect STRONG_ALIAS.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/m68k/m68k/lock_stubs.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/m68k/m68k/lock_stubs.s
diff -u src/sys/arch/m68k/m68k/lock_stubs.s:1.7 src/sys/arch/m68k/m68k/lock_stubs.s:1.8
--- src/sys/arch/m68k/m68k/lock_stubs.s:1.7	Sun May 25 15:56:12 2008
+++ src/sys/arch/m68k/m68k/lock_stubs.s	Wed Nov 11 11:25:52 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock_stubs.s,v 1.7 2008/05/25 15:56:12 chs Exp $	*/
+/*	$NetBSD: lock_stubs.s,v 1.8 2009/11/11 11:25:52 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -69,7 +69,6 @@
 STRONG_ALIAS(atomic_cas_ulong,_atomic_cas_32)
 STRONG_ALIAS(_atomic_cas_ulong,_atomic_cas_32)
 STRONG_ALIAS(atomic_cas_32,_atomic_cas_32)
-STRONG_ALIAS(_atomic_cas_32,_atomic_cas_32)
 
 STRONG_ALIAS(atomic_cas_32_ni,_atomic_cas_32)
 STRONG_ALIAS(_atomic_cas_32_ni,_atomic_cas_32)



CVS commit: src/sys/fs/tmpfs

2009-11-11 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Wed Nov 11 09:59:42 UTC 2009

Modified Files:
src/sys/fs/tmpfs: tmpfs_subr.c

Log Message:
Simplify tmpfs_itimes() and use vfs_timestamp().  Also, replace unnecessary
kmem_zalloc()s with kmem_alloc()s.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/fs/tmpfs/tmpfs_subr.c

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

Modified files:

Index: src/sys/fs/tmpfs/tmpfs_subr.c
diff -u src/sys/fs/tmpfs/tmpfs_subr.c:1.55 src/sys/fs/tmpfs/tmpfs_subr.c:1.56
--- src/sys/fs/tmpfs/tmpfs_subr.c:1.55	Thu Sep  3 11:22:05 2009
+++ src/sys/fs/tmpfs/tmpfs_subr.c	Wed Nov 11 09:59:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_subr.c,v 1.55 2009/09/03 11:22:05 pooka Exp $	*/
+/*	$NetBSD: tmpfs_subr.c,v 1.56 2009/11/11 09:59:41 rmind Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_subr.c,v 1.55 2009/09/03 11:22:05 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_subr.c,v 1.56 2009/11/11 09:59:41 rmind Exp $");
 
 #include 
 #include 
@@ -127,9 +127,12 @@
 	nnode->tn_status = 0;
 	nnode->tn_flags = 0;
 	nnode->tn_links = 0;
-	getnanotime(&nnode->tn_atime);
-	nnode->tn_birthtime = nnode->tn_ctime = nnode->tn_mtime =
-	nnode->tn_atime;
+
+	vfs_timestamp(&nnode->tn_atime);
+	nnode->tn_birthtime = nnode->tn_atime;
+	nnode->tn_ctime = nnode->tn_atime;
+	nnode->tn_mtime = nnode->tn_atime;
+
 	nnode->tn_uid = uid;
 	nnode->tn_gid = gid;
 	nnode->tn_mode = mode;
@@ -625,7 +628,7 @@
 	TMPFS_VALIDATE_DIR(node);
 	KASSERT(uio->uio_offset == TMPFS_DIRCOOKIE_DOT);
 
-	dentp = kmem_zalloc(sizeof(struct dirent), KM_SLEEP);
+	dentp = kmem_alloc(sizeof(struct dirent), KM_SLEEP);
 
 	dentp->d_fileno = node->tn_id;
 	dentp->d_type = DT_DIR;
@@ -666,7 +669,7 @@
 	TMPFS_VALIDATE_DIR(node);
 	KASSERT(uio->uio_offset == TMPFS_DIRCOOKIE_DOTDOT);
 
-	dentp = kmem_zalloc(sizeof(struct dirent), KM_SLEEP);
+	dentp = kmem_alloc(sizeof(struct dirent), KM_SLEEP);
 
 	dentp->d_fileno = node->tn_spec.tn_dir.tn_parent->tn_id;
 	dentp->d_type = DT_DIR;
@@ -758,7 +761,7 @@
 		return EINVAL;
 	}
 
-	dentp = kmem_zalloc(sizeof(struct dirent), KM_SLEEP);
+	dentp = kmem_alloc(sizeof(struct dirent), KM_SLEEP);
 
 	/* Read as much entries as possible; i.e., until we reach the end of
 	 * the directory or we exhaust uio space. */
@@ -1238,8 +1241,8 @@
 tmpfs_itimes(struct vnode *vp, const struct timespec *acc,
 const struct timespec *mod, const struct timespec *birth)
 {
-	struct timespec now, *nowp = NULL;
 	struct tmpfs_node *node;
+	struct timespec nowtm;
 
 	node = VP_TO_TMPFS_NODE(vp);
 
@@ -1247,29 +1250,19 @@
 	TMPFS_NODE_CHANGED)) == 0)
 		return;
 
-	if (birth != NULL)
+	if (birth != NULL) {
 		node->tn_birthtime = *birth;
+	}
+	vfs_timestamp(&nowtm);
 
 	if (node->tn_status & TMPFS_NODE_ACCESSED) {
-		if (acc == NULL) {
-			if (nowp == NULL)
-getnanotime(nowp = &now);
-			acc = nowp;
-		}
-		node->tn_atime = *acc;
+		node->tn_atime = acc ? *acc : nowtm;
 	}
 	if (node->tn_status & TMPFS_NODE_MODIFIED) {
-		if (mod == NULL) {
-			if (nowp == NULL)
-getnanotime(nowp = &now);
-			mod = nowp;
-		}
-		node->tn_mtime = *mod;
+		node->tn_mtime = mod ? *mod : nowtm;
 	}
 	if (node->tn_status & TMPFS_NODE_CHANGED) {
-		if (nowp == NULL)
-			getnanotime(nowp = &now);
-		node->tn_ctime = *nowp;
+		node->tn_ctime = nowtm;
 	}
 
 	node->tn_status &=



CVS commit: src/sys

2009-11-11 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Wed Nov 11 09:48:51 UTC 2009

Modified Files:
src/sys/compat/common: kern_time_50.c
src/sys/compat/linux/common: linux_misc.c
src/sys/compat/linux32/common: linux32_unistd.c
src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_select.c
src/sys/compat/osf1: osf1_generic.c
src/sys/kern: sys_select.c
src/sys/sys: poll.h select.h

Log Message:
- selcommon/pollcommon: drop redundant l argument.
- Use cached curlwp->l_fd, instead of p->p_fd.
- Inline selscan/pollscan.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/compat/common/kern_time_50.c
cvs rdiff -u -r1.210 -r1.211 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.33 -r1.34 src/sys/compat/linux32/common/linux32_unistd.c
cvs rdiff -u -r1.6 -r1.7 src/sys/compat/netbsd32/netbsd32_compat_50.c
cvs rdiff -u -r1.17 -r1.18 src/sys/compat/netbsd32/netbsd32_select.c
cvs rdiff -u -r1.15 -r1.16 src/sys/compat/osf1/osf1_generic.c
cvs rdiff -u -r1.18 -r1.19 src/sys/kern/sys_select.c
cvs rdiff -u -r1.14 -r1.15 src/sys/sys/poll.h
cvs rdiff -u -r1.35 -r1.36 src/sys/sys/select.h

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

Modified files:

Index: src/sys/compat/common/kern_time_50.c
diff -u src/sys/compat/common/kern_time_50.c:1.11 src/sys/compat/common/kern_time_50.c:1.12
--- src/sys/compat/common/kern_time_50.c:1.11	Wed Nov  4 21:23:02 2009
+++ src/sys/compat/common/kern_time_50.c	Wed Nov 11 09:48:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_time_50.c,v 1.11 2009/11/04 21:23:02 rmind Exp $	*/
+/*	$NetBSD: kern_time_50.c,v 1.12 2009/11/11 09:48:50 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.11 2009/11/04 21:23:02 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.12 2009/11/11 09:48:50 rmind Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -400,7 +400,8 @@
 }
 
 int
-compat_50_sys_select(struct lwp *l, const struct compat_50_sys_select_args *uap, register_t *retval)
+compat_50_sys_select(struct lwp *l,
+const struct compat_50_sys_select_args *uap, register_t *retval)
 {
 	/* {
 		syscallarg(int)			nd;
@@ -422,7 +423,7 @@
 		ts = &ats;
 	}
 
-	return selcommon(l, retval, SCARG(uap, nd), SCARG(uap, in),
+	return selcommon(retval, SCARG(uap, nd), SCARG(uap, in),
 	SCARG(uap, ou), SCARG(uap, ex), ts, NULL);
 }
 
@@ -457,7 +458,7 @@
 		mask = &amask;
 	}
 
-	return selcommon(l, retval, SCARG(uap, nd), SCARG(uap, in),
+	return selcommon(retval, SCARG(uap, nd), SCARG(uap, in),
 	SCARG(uap, ou), SCARG(uap, ex), ts, mask);
 }
 int
@@ -489,8 +490,7 @@
 		mask = &amask;
 	}
 
-	return pollcommon(l, retval, SCARG(uap, fds), SCARG(uap, nfds),
-	ts, mask);
+	return pollcommon(retval, SCARG(uap, fds), SCARG(uap, nfds), ts, mask);
 }
 
 int

Index: src/sys/compat/linux/common/linux_misc.c
diff -u src/sys/compat/linux/common/linux_misc.c:1.210 src/sys/compat/linux/common/linux_misc.c:1.211
--- src/sys/compat/linux/common/linux_misc.c:1.210	Wed Nov  4 21:23:02 2009
+++ src/sys/compat/linux/common/linux_misc.c	Wed Nov 11 09:48:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_misc.c,v 1.210 2009/11/04 21:23:02 rmind Exp $	*/
+/*	$NetBSD: linux_misc.c,v 1.211 2009/11/11 09:48:50 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.210 2009/11/04 21:23:02 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.211 2009/11/11 09:48:50 rmind Exp $");
 
 #include 
 #include 
@@ -851,7 +851,8 @@
  * 2) select never returns ERESTART on Linux, always return EINTR
  */
 int
-linux_select1(struct lwp *l, register_t *retval, int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct linux_timeval *timeout)
+linux_select1(struct lwp *l, register_t *retval, int nfds, fd_set *readfds,
+fd_set *writefds, fd_set *exceptfds, struct linux_timeval *timeout)
 {
 	struct timespec ts0, ts1, uts, *ts = NULL;
 	struct linux_timeval ltv;
@@ -884,8 +885,7 @@
 		nanotime(&ts0);
 	}
 
-	error = selcommon(l, retval, nfds, readfds, writefds, exceptfds,
-	ts, NULL);
+	error = selcommon(retval, nfds, readfds, writefds, exceptfds, ts, NULL);
 
 	if (error) {
 		/*

Index: src/sys/compat/linux32/common/linux32_unistd.c
diff -u src/sys/compat/linux32/common/linux32_unistd.c:1.33 src/sys/compat/linux32/common/linux32_unistd.c:1.34
--- src/sys/compat/linux32/common/linux32_unistd.c:1.33	Tue Jun  2 13:00:24 2009
+++ src/sys/compat/linux32/common/linux32_unistd.c	Wed Nov 11 09:48:51 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_unistd.c,v 1.33 2009/06/02 13:00:24 njoly Exp $ */
+/*	$NetBSD: linux32_unistd.c,v 1.34 2009/11/11 09:48:51 rmind Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights r

CVS commit: src/sys

2009-11-11 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Wed Nov 11 09:15:42 UTC 2009

Modified Files:
src/sys/kern: vfs_bio.c
src/sys/sys: buf.h

Log Message:
Add a small comment on buffer cache locking, fix mark letter b_objlock.


To generate a diff of this commit:
cvs rdiff -u -r1.220 -r1.221 src/sys/kern/vfs_bio.c
cvs rdiff -u -r1.114 -r1.115 src/sys/sys/buf.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/kern/vfs_bio.c
diff -u src/sys/kern/vfs_bio.c:1.220 src/sys/kern/vfs_bio.c:1.221
--- src/sys/kern/vfs_bio.c:1.220	Wed Nov 11 07:22:33 2009
+++ src/sys/kern/vfs_bio.c	Wed Nov 11 09:15:42 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_bio.c,v 1.220 2009/11/11 07:22:33 rmind Exp $	*/
+/*	$NetBSD: vfs_bio.c,v 1.221 2009/11/11 09:15:42 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -100,14 +100,30 @@
  */
 
 /*
+ * The buffer cache subsystem.
+ *
  * Some references:
  *	Bach: The Design of the UNIX Operating System (Prentice Hall, 1986)
  *	Leffler, et al.: The Design and Implementation of the 4.3BSD
  *		UNIX Operating System (Addison Welley, 1989)
+ *
+ * Locking
+ *
+ * There are three locks:
+ * - bufcache_lock: protects global buffer cache state.
+ * - BC_BUSY: a long term per-buffer lock.
+ * - buf_t::b_objlock: lock on completion (biowait vs biodone).
+ *
+ * For buffers associated with vnodes (a most common case) b_objlock points
+ * to the vnode_t::v_interlock.  Otherwise, it points to generic buffer_lock.
+ *
+ * Lock order:
+ *	bufcache_lock ->
+ *		buf_t::b_objlock
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.220 2009/11/11 07:22:33 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.221 2009/11/11 09:15:42 rmind Exp $");
 
 #include "fs_ffs.h"
 #include "opt_bufcache.h"

Index: src/sys/sys/buf.h
diff -u src/sys/sys/buf.h:1.114 src/sys/sys/buf.h:1.115
--- src/sys/sys/buf.h:1.114	Wed Nov 11 07:22:34 2009
+++ src/sys/sys/buf.h	Wed Nov 11 09:15:42 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: buf.h,v 1.114 2009/11/11 07:22:34 rmind Exp $ */
+/* $NetBSD: buf.h,v 1.115 2009/11/11 09:15:42 rmind Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2007, 2008 The NetBSD Foundation, Inc.
@@ -95,7 +95,7 @@
  * b	thread of execution that holds BC_BUSY, does not correspond
  *	  directly to any particular LWP
  * c	bufcache_lock
- * l	b_objlock
+ * o	b_objlock
  *
  * For buffers associated with a vnode, b_objlock points to vp->v_interlock.
  * If not associated with a vnode, it points to the generic buffer_lock.



CVS commit: src/doc

2009-11-11 Thread Martti Kuparinen
Module Name:src
Committed By:   martti
Date:   Wed Nov 11 09:11:26 UTC 2009

Modified Files:
src/doc: 3RDPARTY

Log Message:
I'm no longer going to work on IPF as I'm now using PF on all my hosts
(because NAT works much better for me in PF)...


To generate a diff of this commit:
cvs rdiff -u -r1.730 -r1.731 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.730 src/doc/3RDPARTY:1.731
--- src/doc/3RDPARTY:1.730	Thu Oct 29 00:58:06 2009
+++ src/doc/3RDPARTY	Wed Nov 11 09:11:26 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.730 2009/10/29 00:58:06 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.731 2009/11/11 09:11:26 martti Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -445,7 +445,7 @@
 Archive Site:	http://coombs.anu.edu.au/~avalon/
 Home Page:	http://coombs.anu.edu.au/~avalon/
 Mailing List:	ipfil...@postbox.anu.edu.au
-Responsible:	darrenr, mike, martti
+Responsible:	darrenr, mike
 License:	BSD-based, see src/dist/ipf/IPFILTER.LICENSE
 Notes:
 ipf2netbsd should be used on a virgin ipfilter source tree.



CVS commit: src/share/man/man9

2009-11-11 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Wed Nov 11 08:43:18 UTC 2009

Modified Files:
src/share/man/man9: buffercache.9

Log Message:
Sync declarations with reality, bump date.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/share/man/man9/buffercache.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/buffercache.9
diff -u src/share/man/man9/buffercache.9:1.23 src/share/man/man9/buffercache.9:1.24
--- src/share/man/man9/buffercache.9:1.23	Fri May 16 09:21:59 2008
+++ src/share/man/man9/buffercache.9	Wed Nov 11 08:43:18 2009
@@ -1,4 +1,4 @@
-.\" $NetBSD: buffercache.9,v 1.23 2008/05/16 09:21:59 hannken Exp $
+.\" $NetBSD: buffercache.9,v 1.24 2009/11/11 08:43:18 rmind Exp $
 .\"
 .\" Copyright (c)2003 YAMAMOTO Takashi,
 .\" All rights reserved.
@@ -101,13 +101,12 @@
 .\"
 .\"
 .\" 
-.Dd May 16, 2008
+.Dd November 11, 2009
 .Dt BUFFERCACHE 9
 .Os
 .Sh NAME
 .Nm buffercache ,
 .Nm bread ,
-.Nm breada ,
 .Nm breadn ,
 .Nm bwrite ,
 .Nm bawrite ,
@@ -125,36 +124,32 @@
 .In sys/buf.h
 .Ft int
 .Fn bread "struct vnode *vp" "daddr_t blkno" "int size" \
-"struct kauth_cred *cred" "int flags" "struct buf **bpp"
+"struct kauth_cred *cred" "int flags" "buf_t **bpp"
 .Ft int
 .Fn breadn "struct vnode *vp" "daddr_t blkno" "int size" \
 "daddr_t rablks[]" "int rasizes[]" "int nrablks" \
-"struct kauth_cred *cred" "int flags" "struct buf **bpp"
+"struct kauth_cred *cred" "int flags" "buf_t **bpp"
 .Ft int
-.Fn breada "struct vnode *vp" "daddr_t blkno" "int size" \
-"daddr_t rablkno" "int rabsize" \
-"struct kauth_cred *cred" "int flags" "struct buf **bpp"
-.Ft int
-.Fn bwrite "struct buf *bp"
+.Fn bwrite "buf_t *bp"
 .Ft void
-.Fn bawrite "struct buf *bp"
+.Fn bawrite "buf_t *bp"
 .Ft void
-.Fn bdwrite "struct buf *bp"
-.Ft struct buf *
+.Fn bdwrite "buf_t *bp"
+.Ft buf_t *
 .Fn getblk "struct vnode *vp" "daddr_t blkno" "int size" \
 "int slpflag" "int slptimeo"
-.Ft struct buf *
+.Ft buf_t *
 .Fn geteblk "int size"
-.Ft struct buf *
+.Ft buf_t *
 .Fn incore "struct vnode *vp" "daddr_t blkno"
 .Ft void
-.Fn allocbuf "struct buf *bp" "int size" "int preserve"
+.Fn allocbuf "buf_t *bp" "int size" "int preserve"
 .Ft void
-.Fn brelse "struct buf *bp"
+.Fn brelse "buf_t *bp" "int set"
 .Ft void
-.Fn biodone "struct buf *bp"
+.Fn biodone "buf_t *bp"
 .Ft int
-.Fn biowait "struct buf *bp"
+.Fn biowait "buf_t *bp"
 .\" 
 .Sh DESCRIPTION
 The
@@ -170,7 +165,7 @@
 .Em buf
 structure is also used to describe an I/O request as a part of
 the disk driver interface.
-.\" XXX struct buf, B_ flags, MP locks, etc
+.\" XXX buf_t, B_ flags, MP locks, etc
 .\" 
 .Sh FUNCTIONS
 .Bl -tag -width compact
@@ -324,7 +319,7 @@
 If the buffer grows, it is the callers responsibility to fill out
 the buffer's additional contents.
 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-.It Fn brelse "bp"
+.It Fn brelse "bp" "set"
 Unbusy a buffer and release it to the free lists.
 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 .It Fn biodone "bp"