CVS commit: src/sys

2009-10-04 Thread Elad Efrat
Module Name:src
Committed By:   elad
Date:   Mon Oct  5 04:20:13 UTC 2009

Modified Files:
src/sys/kern: vfs_init.c
src/sys/secmodel/suser: secmodel_suser.c
src/sys/sys: mount.h

Log Message:
- Add usermount_common_policy() that implements some common (everything
  but access control) user mounting policies: enforced MNT_NOSUID and
  MNT_NODEV, no MNT_EXPORT, MNT_EXEC propagation. This can be useful for
  secmodels that are interested in simply adding finer grained user mount
  support.

- Add a mount subsystem listener for KAUTH_REQ_SYSTEM_MOUNT_GET.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/kern/vfs_init.c
cvs rdiff -u -r1.26 -r1.27 src/sys/secmodel/suser/secmodel_suser.c
cvs rdiff -u -r1.191 -r1.192 src/sys/sys/mount.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_init.c
diff -u src/sys/kern/vfs_init.c:1.44 src/sys/kern/vfs_init.c:1.45
--- src/sys/kern/vfs_init.c:1.44	Sun May  3 21:25:44 2009
+++ src/sys/kern/vfs_init.c	Mon Oct  5 04:20:13 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_init.c,v 1.44 2009/05/03 21:25:44 elad Exp $	*/
+/*	$NetBSD: vfs_init.c,v 1.45 2009/10/05 04:20:13 elad Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v 1.44 2009/05/03 21:25:44 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_init.c,v 1.45 2009/10/05 04:20:13 elad Exp $");
 
 #include 
 #include 
@@ -83,6 +83,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /*
  * Sigh, such primitive tools are these...
@@ -119,6 +120,8 @@
 struct vfs_list_head vfs_list =			/* vfs list */
 LIST_HEAD_INITIALIZER(vfs_list);
 
+static kauth_listener_t mount_listener;
+
 /*
  * This code doesn't work if the defn is **vnodop_defns with cc.
  * The problem is because of the compiler sometimes putting in an
@@ -332,6 +335,56 @@
 #endif /* DEBUG */
 
 /*
+ * Common routine to check if an unprivileged mount is allowed.
+ *
+ * We export just this part (i.e., without the access control) so that if a
+ * secmodel wants to implement finer grained user mounts it can do so without
+ * copying too much code. More elaborate policies (i.e., specific users allowed
+ * to also create devices and/or introduce set-id binaries, or export
+ * file-systems) will require a different implementation.
+ *
+ * This routine is intended to be called from listener context, and as such
+ * does not take credentials as an argument.
+ */
+int
+usermount_common_policy(struct mount *mp, u_long flags)
+{
+
+	/* No exporting if unprivileged. */
+	if (flags & MNT_EXPORTED)
+		return EPERM;
+
+	/* Must have 'nosuid' and 'nodev'. */
+	if ((flags & MNT_NODEV) == 0 || (flags & MNT_NOSUID) == 0)
+		return EPERM;
+
+	/* Retain 'noexec'. */
+	if ((mp->mnt_flag & MNT_NOEXEC) && (flags & MNT_NOEXEC) == 0)
+		return EPERM;
+
+	return 0;
+}
+
+static int
+mount_listener_cb(kauth_cred_t cred, kauth_action_t action, void *cookie,
+void *arg0, void *arg1, void *arg2, void *arg3)
+{
+	int result;
+	enum kauth_system_req req;
+
+	result = KAUTH_RESULT_DEFER;
+	req = (enum kauth_system_req)arg0;
+
+	if ((action != KAUTH_SYSTEM_MOUNT) ||
+	(req != KAUTH_REQ_SYSTEM_MOUNT_GET))
+		return result;
+
+	result = KAUTH_RESULT_ALLOW;
+
+	return result;
+}
+
+/*
  * Initialize the vnode structures and initialize each file system type.
  */
 void
@@ -382,6 +435,9 @@
 	 */
 	vfs_hooks_init();
 
+	mount_listener = kauth_listen_scope(KAUTH_SCOPE_SYSTEM,
+	mount_listener_cb, NULL);
+
 	/*
 	 * Establish each file system which was statically
 	 * included in the kernel.

Index: src/sys/secmodel/suser/secmodel_suser.c
diff -u src/sys/secmodel/suser/secmodel_suser.c:1.26 src/sys/secmodel/suser/secmodel_suser.c:1.27
--- src/sys/secmodel/suser/secmodel_suser.c:1.26	Sat Oct  3 03:59:39 2009
+++ src/sys/secmodel/suser/secmodel_suser.c	Mon Oct  5 04:20:13 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: secmodel_suser.c,v 1.26 2009/10/03 03:59:39 elad Exp $ */
+/* $NetBSD: secmodel_suser.c,v 1.27 2009/10/05 04:20:13 elad Exp $ */
 /*-
  * Copyright (c) 2006 Elad Efrat 
  * All rights reserved.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.26 2009/10/03 03:59:39 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: secmodel_suser.c,v 1.27 2009/10/05 04:20:13 elad Exp $");
 
 #include 
 #include 
@@ -152,7 +152,6 @@
 secmodel_suser_init(void)
 {
 	secmodel_suser_curtain = 0;
-	dovfsusermount = 0;
 }
 
 void
@@ -303,82 +302,71 @@
 
 		break;
 
-	case KAUTH_SYSTEM_FS_RESERVEDSPACE:
-		if (isroot)
-			result = KAUTH_RESULT_ALLOW;
-		break;
-
 	case KAUTH_SYSTEM_MOUNT:
 		switch (req) {
-		case KAUTH_REQ_SYSTEM_MOUNT_GET:
-			result = KAUTH_RESULT_ALLOW;
-			break;
+		case KAUTH_REQ_SYSTEM_MOUNT_NEW: {
+			struct mount *mp = ((struct vnode *)arg1)->v_mount;
+			u_long flags = (u_long)arg2;
 
-		case KAUTH_REQ_SYSTEM_MOUNT_N

CVS commit: src

2009-10-04 Thread Ty Sarna
Module Name:src
Committed By:   tsarna
Date:   Mon Oct  5 03:54:17 UTC 2009

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/external/apache2/mDNSResponder: Makefile
Added Files:
src/external/apache2/mDNSResponder/nss: Makefile nss_mdns.c

Log Message:
Add nss_mdns, a nsswitch plugin for host lookups vis mDNS ("Bonjour"),
eg "hostname.local".  This is a work in progress, but basically
functional. (note: this requires mdnsd to be running.)


To generate a diff of this commit:
cvs rdiff -u -r1.495 -r1.496 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.1 -r1.2 src/external/apache2/mDNSResponder/Makefile
cvs rdiff -u -r0 -r1.1 src/external/apache2/mDNSResponder/nss/Makefile \
src/external/apache2/mDNSResponder/nss/nss_mdns.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/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.495 src/distrib/sets/lists/base/shl.mi:1.496
--- src/distrib/sets/lists/base/shl.mi:1.495	Sun Oct  4 22:06:34 2009
+++ src/distrib/sets/lists/base/shl.mi	Mon Oct  5 03:54:17 2009
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.495 2009/10/04 22:06:34 christos Exp $
+# $NetBSD: shl.mi,v 1.496 2009/10/05 03:54:17 tsarna Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -166,6 +166,7 @@
 ./usr/lib/libutil.so.7.17			base-sys-shlib
 ./usr/lib/libwrap.so.1.0			base-net-shlib
 ./usr/lib/libz.so.1.0base-sys-shlib
+./usr/lib/nss_mdns.so.0base-mdns-shlib		mdns
 ./usr/lib/security/pam_afslog.so.3		base-sys-shlib		kerberos,pam
 ./usr/lib/security/pam_chroot.so.3		base-sys-shlib		pam
 ./usr/lib/security/pam_deny.so.3		base-sys-shlib		pam

Index: src/external/apache2/mDNSResponder/Makefile
diff -u src/external/apache2/mDNSResponder/Makefile:1.1 src/external/apache2/mDNSResponder/Makefile:1.2
--- src/external/apache2/mDNSResponder/Makefile:1.1	Tue Sep 29 23:56:27 2009
+++ src/external/apache2/mDNSResponder/Makefile	Mon Oct  5 03:54:17 2009
@@ -1,5 +1,5 @@
-#	$NetBSD: Makefile,v 1.1 2009/09/29 23:56:27 tsarna Exp $
+#	$NetBSD: Makefile,v 1.2 2009/10/05 03:54:17 tsarna Exp $
 
-SUBDIR=	usr.bin usr.sbin
+SUBDIR=	usr.bin usr.sbin nss
 
 .include 

Added files:

Index: src/external/apache2/mDNSResponder/nss/Makefile
diff -u /dev/null src/external/apache2/mDNSResponder/nss/Makefile:1.1
--- /dev/null	Mon Oct  5 03:54:17 2009
+++ src/external/apache2/mDNSResponder/nss/Makefile	Mon Oct  5 03:54:17 2009
@@ -0,0 +1,36 @@
+#	$NetBSD: Makefile,v 1.1 2009/10/05 03:54:17 tsarna Exp $
+
+LIB=		nss_mdns
+SHLIB_MAJOR=	0
+
+NOLINT=		# don't build a lint library
+NOPROFILE=	# don't build a profile library
+NOPICINSTALL=	# don't install _pic.a library
+
+.include 
+
+.include "${.CURDIR}/../Makefile.inc"
+
+SRCS=		nss_mdns.c
+LDADD+= 	-ldns_sd
+DPADD+= 	${LIBDNS_SD}
+
+.if ${MKPIC} != "no"
+.PRECIOUS: ${DESTDIR}${LIBDIR}/${LIB}.so.${SHLIB_MAJOR}
+libinstall:: ${DESTDIR}${LIBDIR}/${LIB}.so.${SHLIB_MAJOR}
+.else
+libinstall::
+.endif
+
+.include 
+
+${DESTDIR}${LIBDIR}/${LIB}.so.${SHLIB_MAJOR}: lib${LIB}.so.${SHLIB_FULLVERSION}
+	${_MKTARGET_INSTALL}
+	${INSTALL_FILE} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+	${.ALLSRC} ${.TARGET}
+
+#.if defined(LD32DIR)
+#LIBDIR=/usr/lib/${LD32DIR}
+#.else
+#LIBDIR=/usr/lib
+#.endif
Index: src/external/apache2/mDNSResponder/nss/nss_mdns.c
diff -u /dev/null src/external/apache2/mDNSResponder/nss/nss_mdns.c:1.1
--- /dev/null	Mon Oct  5 03:54:17 2009
+++ src/external/apache2/mDNSResponder/nss/nss_mdns.c	Mon Oct  5 03:54:17 2009
@@ -0,0 +1,673 @@
+/*	$NetBSD: nss_mdns.c,v 1.1 2009/10/05 03:54:17 tsarna Exp $	*/
+
+/*-
+ * Copyright (c) 2009 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Tyler C. Sarna
+ *
+ * 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) 

CVS commit: src/sys/dist/ipf/netinet

2009-10-04 Thread Elad Efrat
Module Name:src
Committed By:   elad
Date:   Mon Oct  5 03:44:01 UTC 2009

Modified Files:
src/sys/dist/ipf/netinet: ip_fil_netbsd.c

Log Message:
Attach the listener in the correct "attach" function.

Should fix issues reported by Anon Ymous.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/dist/ipf/netinet/ip_fil_netbsd.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/dist/ipf/netinet/ip_fil_netbsd.c
diff -u src/sys/dist/ipf/netinet/ip_fil_netbsd.c:1.52 src/sys/dist/ipf/netinet/ip_fil_netbsd.c:1.53
--- src/sys/dist/ipf/netinet/ip_fil_netbsd.c:1.52	Sat Oct  3 00:37:02 2009
+++ src/sys/dist/ipf/netinet/ip_fil_netbsd.c	Mon Oct  5 03:44:01 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_fil_netbsd.c,v 1.52 2009/10/03 00:37:02 elad Exp $	*/
+/*	$NetBSD: ip_fil_netbsd.c,v 1.53 2009/10/05 03:44:01 elad Exp $	*/
 
 /*
  * Copyright (C) 1993-2003 by Darren Reed.
@@ -8,7 +8,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.52 2009/10/03 00:37:02 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.53 2009/10/05 03:44:01 elad Exp $");
 #else
 static const char sccsid[] = "@(#)ip_fil.c	2.41 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 2.55.2.66 2009/05/17 17:45:26 darrenr Exp";
@@ -340,6 +340,12 @@
 	RWLOCK_INIT(&ipf_mutex, "ipf filter rwlock");
 	RWLOCK_INIT(&ipf_frcache, "ipf cache rwlock");
 # endif
+
+#if (__NetBSD_Version__ >= 599002000)
+	ipf_listener = kauth_listen_scope(KAUTH_SCOPE_NETWORK,
+	ipf_listener_cb, NULL);
+#endif
+
 }
 #endif
 
@@ -481,11 +487,6 @@
 	timeout(fr_slowtimer, NULL, (hz / IPF_HZ_DIVIDE) * IPF_HZ_MULT);
 #endif
 
-#if (__NetBSD_Version__ >= 599002000)
-	ipf_listener = kauth_listen_scope(KAUTH_SCOPE_NETWORK,
-	ipf_listener_cb, NULL);
-#endif
-
 	return 0;
 
 #if __NetBSD_Version__ >= 10511



CVS commit: src/include

2009-10-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct  4 22:59:25 UTC 2009

Modified Files:
src/include: math.h

Log Message:
oops forgot to commit that one--- Add f{dim,min,max}{,l,f}


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/include/math.h

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

Modified files:

Index: src/include/math.h
diff -u src/include/math.h:1.48 src/include/math.h:1.49
--- src/include/math.h:1.48	Sat Feb 21 20:34:01 2009
+++ src/include/math.h	Sun Oct  4 18:59:25 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: math.h,v 1.48 2009/02/22 01:34:01 martin Exp $	*/
+/*	$NetBSD: math.h,v 1.49 2009/10/04 22:59:25 christos Exp $	*/
 
 /*
  * 
@@ -352,6 +352,15 @@
 #define islessequal(x, y)	(!isunordered((x), (y)) && (x) <= (y))
 #define islessgreater(x, y)	(!isunordered((x), (y)) && \
  ((x) > (y) || (y) > (x)))
+double	fdim(double, double);
+double	fmax(double, double);
+double	fmin(double, double);
+float	fdimf(float, float);
+float	fmaxf(float, float);
+float	fminf(float, float);
+long double fdiml(long double, long double);
+long double fmaxl(long double, long double);
+long double fminl(long double, long double);
 
 #endif /* !_ANSI_SOURCE && ... */
 



CVS commit: src/share/man/man7

2009-10-04 Thread Elad Efrat
Module Name:src
Committed By:   elad
Date:   Sun Oct  4 22:57:47 UTC 2009

Modified Files:
src/share/man/man7: sysctl.7

Log Message:
Slightly restructure vfs level documentation.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/share/man/man7/sysctl.7

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/man7/sysctl.7
diff -u src/share/man/man7/sysctl.7:1.25 src/share/man/man7/sysctl.7:1.26
--- src/share/man/man7/sysctl.7:1.25	Fri Oct  2 20:31:19 2009
+++ src/share/man/man7/sysctl.7	Sun Oct  4 22:57:46 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysctl.7,v 1.25 2009/10/02 20:31:19 elad Exp $
+.\"	$NetBSD: sysctl.7,v 1.26 2009/10/04 22:57:46 elad 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 October 2, 2009
+.Dd October 4, 2009
 .Dt SYSCTL 7
 .Os
 .Sh NAME
@@ -131,18 +131,20 @@
 A distinguished second level name,
 .Li vfs.generic ( VFS_GENERIC ) ,
 is used to get general information about all filesystems.
-One of its third level identifiers is
-.Li vfs.generic.maxtypenum ( VFS_MAXTYPENUM )
-that gives the highest valid filesystem type number.
-Its other third level identifier is
-.Li vfs.generic.conf ( VFS_CONF )
-that returns configuration information about the filesystem
-type given as a fourth level identifier.
-The remaining second level identifiers are the
-filesystem type number returned by a
+It has the following third level identifiers:
+.Bl -tag -width compact
+.It vfs.generic.maxtypenum ( VFS_MAXTYPENUM )
+The highest valid filesystem type number.
+.It vfs.generic.conf ( VFS_CONF )
+Returns configuration information about the file-system type given as a fourth
+level identifier.
+.El
+.Pp
+The remaining second level identifiers are the file-system names, identified
+by the type number returned by a
 .Xr statvfs 2
 call or from
-.Li vfs.generic.conf .
+.Li vfs.generic.conf.
 The third level identifiers available for each filesystem
 are given in the header file that defines the mount
 argument structure for that filesystem.



CVS commit: src/sys/dev/wscons

2009-10-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct  4 22:24:15 UTC 2009

Modified Files:
src/sys/dev/wscons: wsdisplay_compat_usl.c

Log Message:
Don't call usl_sync_check_sig from an interrupt context. Call it only if waitok.
Stack trace:mutex_vector_enter <- usl_sync_check_sig <- usl_detachproc <-
wsdisplay_switch <- wskbd_translate <- wskbd_input <-
pckbd_input <- pckbcintr <- intr_biglock_wrapper <-
Xintr_ioapic_edge1
Reported by Anon Ymous


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/wscons/wsdisplay_compat_usl.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/wscons/wsdisplay_compat_usl.c
diff -u src/sys/dev/wscons/wsdisplay_compat_usl.c:1.45 src/sys/dev/wscons/wsdisplay_compat_usl.c:1.46
--- src/sys/dev/wscons/wsdisplay_compat_usl.c:1.45	Thu Apr 24 11:35:28 2008
+++ src/sys/dev/wscons/wsdisplay_compat_usl.c	Sun Oct  4 18:24:15 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay_compat_usl.c,v 1.45 2008/04/24 15:35:28 ad Exp $ */
+/* $NetBSD: wsdisplay_compat_usl.c,v 1.46 2009/10/04 22:24:15 christos Exp $ */
 
 /*
  * Copyright (c) 1998
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay_compat_usl.c,v 1.45 2008/04/24 15:35:28 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay_compat_usl.c,v 1.46 2009/10/04 22:24:15 christos Exp $");
 
 #include "opt_compat_freebsd.h"
 #include "opt_compat_netbsd.h"
@@ -191,8 +191,10 @@
 	 */
 	sd->s_callback = callback;
 	sd->s_cbarg = cbarg;
-	if (!usl_sync_check_sig(sd, sd->s_relsig, SF_DETACHPENDING))	
-		return (0);
+	if (waitok) {
+		if (!usl_sync_check_sig(sd, sd->s_relsig, SF_DETACHPENDING))	
+			return (0);
+	}
 
 	callout_schedule(&sd->s_detach_ch, wscompat_usl_synctimeout * hz);
 	return (EAGAIN);



CVS commit: src/doc

2009-10-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct  4 22:11:39 UTC 2009

Modified Files:
src/doc: CHANGES

Log Message:
mention f{dim,min,max}{,f,l}


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1303 src/doc/CHANGES:1.1304
--- src/doc/CHANGES:1.1303	Fri Oct  2 17:44:02 2009
+++ src/doc/CHANGES	Sun Oct  4 18:11:39 2009
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1303 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1304 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -417,3 +417,4 @@
 		[jmcneill 20091002]
 	i386: Add support for VIA C7 temperature sensors. [jmcneill 20091002]
 	dhcpcd(8): Import dhcpcd-5.1.1. [roy 20091002]
+	libm(3): Add f{dim,max,min}{,f,l} from FreeBSD [christos 20091004]



CVS commit: src/lib/libm/man

2009-10-04 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Oct  4 22:11:22 UTC 2009

Modified Files:
src/lib/libm/man: fdim.3

Log Message:
Mention NetBSD in HISTORY as well.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/man/fdim.3

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

Modified files:

Index: src/lib/libm/man/fdim.3
diff -u src/lib/libm/man/fdim.3:1.1 src/lib/libm/man/fdim.3:1.2
--- src/lib/libm/man/fdim.3:1.1	Sun Oct  4 22:04:30 2009
+++ src/lib/libm/man/fdim.3	Sun Oct  4 22:11:22 2009
@@ -23,7 +23,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD: src/lib/msun/man/fdim.3,v 1.1 2004/06/30 07:04:01 das Exp $
-.\" $NetBSD: fdim.3,v 1.1 2009/10/04 22:04:30 christos Exp $
+.\" $NetBSD: fdim.3,v 1.2 2009/10/04 22:11:22 wiz Exp $
 .\"
 .Dd June 29, 2004
 .Dt FDIM 3
@@ -84,4 +84,6 @@
 .St -isoC-99 .
 .Sh HISTORY
 These routines first appeared in
-.Fx 5.3 .
+.Fx 5.3
+and
+.Nx 6.0 .



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

2009-10-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct  4 22:10:42 UTC 2009

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

Log Message:
document f{dim,min,max}{,l,f}


To generate a diff of this commit:
cvs rdiff -u -r1.1316 -r1.1317 src/distrib/sets/lists/comp/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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1316 src/distrib/sets/lists/comp/mi:1.1317
--- src/distrib/sets/lists/comp/mi:1.1316	Fri Oct  2 14:50:14 2009
+++ src/distrib/sets/lists/comp/mi	Sun Oct  4 18:10:42 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1316 2009/10/02 18:50:14 elad Exp $
+#	$NetBSD: mi,v 1.1317 2009/10/04 22:10:42 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5451,6 +5451,9 @@
 ./usr/share/man/cat3/fabs.0			comp-c-catman		.cat
 ./usr/share/man/cat3/fabsf.0			comp-c-catman		.cat
 ./usr/share/man/cat3/fclose.0			comp-c-catman		.cat
+./usr/share/man/cat3/fdim.0			comp-c-catman		.cat
+./usr/share/man/cat3/fdimf.0			comp-c-catman		.cat
+./usr/share/man/cat3/fdiml.0			comp-c-catman		.cat
 ./usr/share/man/cat3/fdopen.0			comp-c-catman		.cat
 ./usr/share/man/cat3/fdopendir.0		comp-c-catman		.cat
 ./usr/share/man/cat3/feof.0			comp-c-catman		.cat
@@ -5493,6 +5496,12 @@
 ./usr/share/man/cat3/floorf.0			comp-c-catman		.cat
 ./usr/share/man/cat3/flushinp.0			comp-c-catman		.cat
 ./usr/share/man/cat3/flushok.0			comp-c-catman		.cat
+./usr/share/man/cat3/fmax.0			comp-c-catman		.cat
+./usr/share/man/cat3/fmaxf.0			comp-c-catman		.cat
+./usr/share/man/cat3/fmaxl.0			comp-c-catman		.cat
+./usr/share/man/cat3/fmin.0			comp-c-catman		.cat
+./usr/share/man/cat3/fminf.0			comp-c-catman		.cat
+./usr/share/man/cat3/fminl.0			comp-c-catman		.cat
 ./usr/share/man/cat3/fmod.0			comp-c-catman		.cat
 ./usr/share/man/cat3/fmodf.0			comp-c-catman		.cat
 ./usr/share/man/cat3/fmtcheck.0			comp-c-catman		.cat
@@ -10977,6 +10986,9 @@
 ./usr/share/man/html3/fabs.html			comp-c-htmlman		html
 ./usr/share/man/html3/fabsf.html		comp-c-htmlman		html
 ./usr/share/man/html3/fclose.html		comp-c-htmlman		html
+./usr/share/man/html3/fdim.html			comp-c-htmlman		html
+./usr/share/man/html3/fdimf.html		comp-c-htmlman		html
+./usr/share/man/html3/fdiml.html		comp-c-htmlman		html
 ./usr/share/man/html3/fdopen.html		comp-c-htmlman		html
 ./usr/share/man/html3/fdopendir.html		comp-c-htmlman		html
 ./usr/share/man/html3/feof.html			comp-c-htmlman		html
@@ -11018,6 +11030,12 @@
 ./usr/share/man/html3/floorf.html		comp-c-htmlman		html
 ./usr/share/man/html3/flushinp.html		comp-c-htmlman		html
 ./usr/share/man/html3/flushok.html		comp-c-htmlman		html
+./usr/share/man/html3/fmax.html			comp-c-htmlman		html
+./usr/share/man/html3/fmaxf.html		comp-c-htmlman		html
+./usr/share/man/html3/fmaxl.html		comp-c-htmlman		html
+./usr/share/man/html3/fmin.html			comp-c-htmlman		html
+./usr/share/man/html3/fminf.html		comp-c-htmlman		html
+./usr/share/man/html3/fminl.html		comp-c-htmlman		html
 ./usr/share/man/html3/fmod.html			comp-c-htmlman		html
 ./usr/share/man/html3/fmodf.html		comp-c-htmlman		html
 ./usr/share/man/html3/fmtcheck.html		comp-c-htmlman		html
@@ -16413,6 +16431,9 @@
 ./usr/share/man/man3/fabs.3			comp-c-man		.man
 ./usr/share/man/man3/fabsf.3			comp-c-man		.man
 ./usr/share/man/man3/fclose.3			comp-c-man		.man
+./usr/share/man/man3/fdim.3			comp-c-man		.man
+./usr/share/man/man3/fdimf.3			comp-c-man		.man
+./usr/share/man/man3/fdiml.3			comp-c-man		.man
 ./usr/share/man/man3/fdopen.3			comp-c-man		.man
 ./usr/share/man/man3/fdopendir.3		comp-c-man		.man
 ./usr/share/man/man3/feof.3			comp-c-man		.man
@@ -16455,6 +16476,12 @@
 ./usr/share/man/man3/floorf.3			comp-c-man		.man
 ./usr/share/man/man3/flushinp.3			comp-c-man		.man
 ./usr/share/man/man3/flushok.3			comp-c-man		.man
+./usr/share/man/man3/fmax.3			comp-c-man		.man
+./usr/share/man/man3/fmaxf.3			comp-c-man		.man
+./usr/share/man/man3/fmaxl.3			comp-c-man		.man
+./usr/share/man/man3/fmin.3			comp-c-man		.man
+./usr/share/man/man3/fminf.3			comp-c-man		.man
+./usr/share/man/man3/fminl.3			comp-c-man		.man
 ./usr/share/man/man3/fmod.3			comp-c-man		.man
 ./usr/share/man/man3/fmodf.3			comp-c-man		.man
 ./usr/share/man/man3/fmtcheck.3			comp-c-man		.man



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

2009-10-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct  4 22:06:34 UTC 2009

Modified Files:
src/distrib/sets/lists/base: md.amd64 md.sparc64 shl.mi

Log Message:
bump libm.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.62 -r1.63 src/distrib/sets/lists/base/md.sparc64
cvs rdiff -u -r1.494 -r1.495 src/distrib/sets/lists/base/shl.mi

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

Modified files:

Index: src/distrib/sets/lists/base/md.amd64
diff -u src/distrib/sets/lists/base/md.amd64:1.69 src/distrib/sets/lists/base/md.amd64:1.70
--- src/distrib/sets/lists/base/md.amd64:1.69	Thu Oct  1 22:45:28 2009
+++ src/distrib/sets/lists/base/md.amd64	Sun Oct  4 18:06:34 2009
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.69 2009/10/02 02:45:28 tsarna Exp $
+# $NetBSD: md.amd64,v 1.70 2009/10/04 22:06:34 christos Exp $
 ./dev/lms0	base-obsolete		obsolete
 ./dev/mms0	base-obsolete		obsolete
 ./libexec/ld.elf_so-i386			base-sys-shlib		compat,pic
@@ -129,7 +129,7 @@
 ./usr/lib/i386/liblwres.so.4			base-compat-shlib	compat,pic
 ./usr/lib/i386/liblwres.so.4.0			base-compat-shlib	compat,pic
 ./usr/lib/i386/libm.so.0			base-compat-shlib	compat,pic
-./usr/lib/i386/libm.so.0.6			base-compat-shlib	compat,pic
+./usr/lib/i386/libm.so.0.7			base-compat-shlib	compat,pic
 ./usr/lib/i386/libmagic.so.3			base-compat-shlib	compat,pic
 ./usr/lib/i386/libmagic.so.3.0			base-compat-shlib	compat,pic
 ./usr/lib/i386/libmenu.so.6			base-compat-shlib	compat,pic

Index: src/distrib/sets/lists/base/md.sparc64
diff -u src/distrib/sets/lists/base/md.sparc64:1.62 src/distrib/sets/lists/base/md.sparc64:1.63
--- src/distrib/sets/lists/base/md.sparc64:1.62	Thu Oct  1 22:45:28 2009
+++ src/distrib/sets/lists/base/md.sparc64	Sun Oct  4 18:06:34 2009
@@ -1,4 +1,4 @@
-# $NetBSD: md.sparc64,v 1.62 2009/10/02 02:45:28 tsarna Exp $
+# $NetBSD: md.sparc64,v 1.63 2009/10/04 22:06:34 christos Exp $
 ./libexec/ld.elf_so-sparc			base-sysutil-bin	compat,pic
 ./sbin/edlabel	base-sysutil-root
 ./usr/bin/fdformatbase-util-bin
@@ -125,7 +125,7 @@
 ./usr/lib/sparc/liblwres.so.4			base-compat-shlib	compat,pic
 ./usr/lib/sparc/liblwres.so.4.0			base-compat-shlib	compat,pic
 ./usr/lib/sparc/libm.so.0			base-compat-shlib	compat,pic
-./usr/lib/sparc/libm.so.0.6			base-compat-shlib	compat,pic
+./usr/lib/sparc/libm.so.0.7			base-compat-shlib	compat,pic
 ./usr/lib/sparc/libmagic.so.3			base-compat-shlib	compat,pic
 ./usr/lib/sparc/libmagic.so.3.0			base-compat-shlib	compat,pic
 ./usr/lib/sparc/libmenu.so.6			base-compat-shlib	compat,pic

Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.494 src/distrib/sets/lists/base/shl.mi:1.495
--- src/distrib/sets/lists/base/shl.mi:1.494	Thu Oct  1 22:45:28 2009
+++ src/distrib/sets/lists/base/shl.mi	Sun Oct  4 18:06:34 2009
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.494 2009/10/02 02:45:28 tsarna Exp $
+# $NetBSD: shl.mi,v 1.495 2009/10/04 22:06:34 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -22,7 +22,7 @@
 ./lib/libgcc_s.so.1.0base-sys-shlib		gcc
 ./lib/libipsec.so.3.0base-net-shlib		dynamicroot
 ./lib/libkvm.so.6.0base-sys-shlib		dynamicroot
-./lib/libm.so.0.6base-sys-shlib		dynamicroot
+./lib/libm.so.0.7base-sys-shlib		dynamicroot
 ./lib/libprop.so.1.0base-sys-shlib		dynamicroot
 ./lib/libradius.so.4.0base-sys-shlib		dynamicroot
 ./lib/libtermcap.so.0.6base-sys-shlib		dynamicroot
@@ -96,7 +96,7 @@
 ./usr/lib/libldap.so.4.0			base-ldap-shlib		ldap
 ./usr/lib/libldap_r.so.4.0			base-ldap-shlib		ldap
 ./usr/lib/liblwres.so.4.0			base-bind-shlib
-./usr/lib/libm.so.0.6base-sys-shlib
+./usr/lib/libm.so.0.7base-sys-shlib
 ./usr/lib/libmagic.so.3.0			base-sys-shlib
 ./usr/lib/libmenu.so.6.0			base-sys-shlib
 ./usr/lib/libnetpgp.so.2.0			base-crypto-shlib	crypto



CVS commit: src/lib/libm

2009-10-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct  4 22:04:30 UTC 2009

Modified Files:
src/lib/libm: Makefile shlib_version
Added Files:
src/lib/libm/man: fdim.3 fmax.3
src/lib/libm/src: s_fdim.c s_fmax.c s_fmaxf.c s_fmaxl.c s_fmin.c
s_fminf.c s_fminl.c

Log Message:
add f{min,max,dim}{,l,f} from FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/lib/libm/Makefile
cvs rdiff -u -r1.9 -r1.10 src/lib/libm/shlib_version
cvs rdiff -u -r0 -r1.1 src/lib/libm/man/fdim.3 src/lib/libm/man/fmax.3
cvs rdiff -u -r0 -r1.1 src/lib/libm/src/s_fdim.c src/lib/libm/src/s_fmax.c \
src/lib/libm/src/s_fmaxf.c src/lib/libm/src/s_fmaxl.c \
src/lib/libm/src/s_fmin.c src/lib/libm/src/s_fminf.c \
src/lib/libm/src/s_fminl.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/libm/Makefile
diff -u src/lib/libm/Makefile:1.89 src/lib/libm/Makefile:1.90
--- src/lib/libm/Makefile:1.89	Sun Jan 18 15:42:11 2009
+++ src/lib/libm/Makefile	Sun Oct  4 18:04:30 2009
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.89 2009/01/18 20:42:11 he Exp $
+#  $NetBSD: Makefile,v 1.90 2009/10/04 22:04:30 christos Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -136,7 +136,9 @@
 	w_pow.c w_powf.c w_remainder.c w_remainderf.c w_scalb.c w_scalbf.c \
 	w_sinh.c w_sinhf.c w_sqrt.c w_sqrtf.c \
 	lrint.c lrintf.c llrint.c llrintf.c lround.c lroundf.c llround.c \
-	llroundf.c
+	llroundf.c \
+	s_fmax.c s_fmaxf.c s_fmaxl.c s_fmin.c s_fminf.c s_fminl.c s_fdim.c
+
 # Also in libc.
 #COMMON_SRCS += s_frexp.c s_ldexp.c s_modf.c
 
@@ -186,7 +188,7 @@
 	cos.3 cosh.3 erf.3 exp.3 fabs.3 floor.3 fmod.3 frexp.3 hypot.3 ieee.3 \
 	ieee_test.3 isinff.3 j0.3 ldexp.3 lgamma.3 lrint.3 \
 	math.3 modf.3 rint.3 round.3 sin.3 sinh.3 \
-	sqrt.3 tan.3 tanh.3 trunc.3
+	sqrt.3 tan.3 tanh.3 trunc.3 fmax.3 fdim.3
 
 MLINKS+=acos.3 acosf.3
 MLINKS+=acosh.3 acoshf.3
@@ -227,6 +229,13 @@
 MLINKS+=tanh.3 tanhf.3
 MLINKS+=round.3 roundf.3
 MLINKS+=trunc.3 truncf.3
+MLINKS+=fmax.3 fmaxl.3
+MLINKS+=fmax.3 fmaxf.3
+MLINKS+=fmax.3 fmin.3
+MLINKS+=fmax.3 fminl.3
+MLINKS+=fmax.3 fminf.3
+MLINKS+=fdim.3 fdiml.3
+MLINKS+=fdim.3 fdimf.3
 
 .if (${MKCOMPLEX} != "no")
 .include "${.CURDIR}/complex/Makefile.inc"

Index: src/lib/libm/shlib_version
diff -u src/lib/libm/shlib_version:1.9 src/lib/libm/shlib_version:1.10
--- src/lib/libm/shlib_version:1.9	Mon Aug 20 12:01:30 2007
+++ src/lib/libm/shlib_version	Sun Oct  4 18:04:30 2009
@@ -1,5 +1,5 @@
-#	$NetBSD: shlib_version,v 1.9 2007/08/20 16:01:30 drochner Exp $
+#	$NetBSD: shlib_version,v 1.10 2009/10/04 22:04:30 christos Exp $
 #	Remember to update distrib/sets/lists/base/shl.* when changing
 #
 major=0
-minor=6
+minor=7

Added files:

Index: src/lib/libm/man/fdim.3
diff -u /dev/null src/lib/libm/man/fdim.3:1.1
--- /dev/null	Sun Oct  4 18:04:30 2009
+++ src/lib/libm/man/fdim.3	Sun Oct  4 18:04:30 2009
@@ -0,0 +1,87 @@
+.\" Copyright (c) 2004 David Schultz 
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD: src/lib/msun/man/fdim.3,v 1.1 2004/06/30 07:04:01 das Exp $
+.\" $NetBSD: fdim.3,v 1.1 2009/10/04 22:04:30 christos Exp $
+.\"
+.Dd June 29, 2004
+.Dt FDIM 3
+.Os
+.Sh NAME
+.Nm fdim ,
+.Nm fdimf ,
+.Nm fdiml
+.Nd positive difference functions
+.Sh LIBRARY
+.Lb libm
+.Sh SYNOPSIS
+.In math.h
+.Ft double
+.Fn fdim "double x" "double y"
+.Ft float
+.Fn fdimf "float x" "float y"
+.Ft long double
+.Fn fdiml "long double x" "long double y"
+.Sh DESCRIPTION
+The
+.Fn fdim ,
+.Fn fdimf ,
+and
+.Fn fdiml
+functions return the positive difference between
+.Fa x
+and
+.Fa y .
+That is, if

CVS commit: src/crypto/external/bsd/netpgp/dist/src/lib

2009-10-04 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Sun Oct  4 21:58:25 UTC 2009

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/lib: compress.c

Log Message:
Get rid of some lint-style issues - pointed out by Poul-Henning Kamp
and FlexeLint (many thanks!)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
src/crypto/external/bsd/netpgp/dist/src/lib/compress.c

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/lib/compress.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/compress.c:1.12 src/crypto/external/bsd/netpgp/dist/src/lib/compress.c:1.13
--- src/crypto/external/bsd/netpgp/dist/src/lib/compress.c:1.12	Tue Jun  9 00:51:01 2009
+++ src/crypto/external/bsd/netpgp/dist/src/lib/compress.c	Sun Oct  4 21:58:25 2009
@@ -57,7 +57,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: compress.c,v 1.12 2009/06/09 00:51:01 agc Exp $");
+__RCSID("$NetBSD: compress.c,v 1.13 2009/10/04 21:58:25 agc Exp $");
 #endif
 
 #ifdef HAVE_ZLIB_H
@@ -191,7 +191,7 @@
 			(void) fprintf(stderr, "Out of memory in buffer\n");
 			return 0;
 		}
-		len = z->zstream.next_out - &z->out[z->offset];
+		len = (size_t)(z->zstream.next_out - &z->out[z->offset]);
 		if (len > length) {
 			len = length;
 		}
@@ -275,7 +275,7 @@
 			(void) fprintf(stderr, "Out of bz memroy\n");
 			return 0;
 		}
-		len = bz->bzstream.next_out - &bz->out[bz->offset];
+		len = (size_t)(bz->bzstream.next_out - &bz->out[bz->offset]);
 		if (len > length) {
 			len = length;
 		}
@@ -417,8 +417,8 @@
 		 __ops_output_t *out)
 {
 	compress_t	*zip = calloc(1, sizeof(compress_t));
-	size_t		 sz_in = 0;
-	size_t		 sz_out = 0;
+	size_t		 sz_in;
+	size_t		 sz_out;
 	int  r = 0;
 
 	/* compress the data */
@@ -442,7 +442,7 @@
 	}
 
 	sz_in = len * sizeof(unsigned char);
-	sz_out = (sz_in * 1.01) + 12;	/* from zlib webpage */
+	sz_out = ((101 * sz_in) / 100) + 12;	/* from zlib webpage */
 	zip->src = calloc(1, sz_in);
 	zip->dst = calloc(1, sz_out);
 	(void) memcpy(zip->src, data, len);



CVS commit: src/crypto/external/bsd/netpgp/dist/src/lib

2009-10-04 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Sun Oct  4 21:57:09 UTC 2009

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/lib: signature.h

Log Message:
Get rid of multiple prototypes - pointed out by Poul-Henning Kamp and
FlexeLint (many thanks!)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
src/crypto/external/bsd/netpgp/dist/src/lib/signature.h

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/lib/signature.h
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/signature.h:1.12 src/crypto/external/bsd/netpgp/dist/src/lib/signature.h:1.13
--- src/crypto/external/bsd/netpgp/dist/src/lib/signature.h:1.12	Tue Jun  9 00:51:02 2009
+++ src/crypto/external/bsd/netpgp/dist/src/lib/signature.h	Sun Oct  4 21:57:09 2009
@@ -144,9 +144,6 @@
 
 #define CRC24_INIT 0xb704ceL
 
-unsigned __ops_writer_push_clearsigned(__ops_output_t *,
-	__ops_create_sig_t *);
-void __ops_writer_push_armor_msg(__ops_output_t *);
 unsigned __ops_writer_use_armored_sig(__ops_output_t *);
 
 void __ops_writer_push_armoured(__ops_output_t *, __ops_armor_type_t);



CVS commit: src/crypto/external/bsd/netpgp/dist/src/lib

2009-10-04 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Sun Oct  4 21:55:56 UTC 2009

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/lib: packet-parse.c
packet-parse.h

Log Message:
const poisoning - pointed out by Poul-Henning Kamp and FlexeLint (many
thanks!)


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 \
src/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c
cvs rdiff -u -r1.10 -r1.11 \
src/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.h

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c:1.22 src/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c:1.23
--- src/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c:1.22	Sat Jun 13 05:25:08 2009
+++ src/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.c	Sun Oct  4 21:55:55 2009
@@ -58,7 +58,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: packet-parse.c,v 1.22 2009/06/13 05:25:08 agc Exp $");
+__RCSID("$NetBSD: packet-parse.c,v 1.23 2009/10/04 21:55:55 agc Exp $");
 #endif
 
 #ifdef HAVE_OPENSSL_CAST_H
@@ -3306,7 +3306,7 @@
  */
 
 int 
-__ops_parse(__ops_stream_t *stream, int perrors)
+__ops_parse(__ops_stream_t *stream, const int perrors)
 {
 	unsigned long   pktlen;
 	int r;

Index: src/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.h
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.h:1.10 src/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.h:1.11
--- src/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.h:1.10	Thu Jun 11 01:12:42 2009
+++ src/crypto/external/bsd/netpgp/dist/src/lib/packet-parse.h	Sun Oct  4 21:55:56 2009
@@ -134,7 +134,7 @@
 	__ops_cbdata_t *);
 __ops_reader_t *__ops_readinfo(__ops_stream_t *);
 
-int __ops_parse(__ops_stream_t *, int);
+int __ops_parse(__ops_stream_t *, const int);
 
 /** Used to specify whether subpackets should be returned raw, parsed
 * or ignored.  */



CVS commit: src/lib/libc/locale

2009-10-04 Thread Takehiko NOZAKI
Module Name:src
Committed By:   tnozaki
Date:   Sun Oct  4 21:05:18 UTC 2009

Modified Files:
src/lib/libc/locale: generic_lc_all.c

Log Message:
fix lib/42124: setlocale(3) never returns NULL with none existing locale.
reported by kambe-san, thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/locale/generic_lc_all.c

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

Modified files:

Index: src/lib/libc/locale/generic_lc_all.c
diff -u src/lib/libc/locale/generic_lc_all.c:1.2 src/lib/libc/locale/generic_lc_all.c:1.3
--- src/lib/libc/locale/generic_lc_all.c:1.2	Sun Jan 11 02:46:28 2009
+++ src/lib/libc/locale/generic_lc_all.c	Sun Oct  4 21:05:18 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: generic_lc_all.c,v 1.2 2009/01/11 02:46:28 christos Exp $ */
+/* $NetBSD: generic_lc_all.c,v 1.3 2009/10/04 21:05:18 tnozaki Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: generic_lc_all.c,v 1.2 2009/01/11 02:46:28 christos Exp $");
+__RCSID("$NetBSD: generic_lc_all.c,v 1.3 2009/10/04 21:05:18 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -56,10 +56,11 @@
 	_locale_category_t *l;
 	char head[_LOCALENAME_LEN_MAX * (_LC_LAST - 1)], *tail;
 	const char *tokens[_LC_LAST], *s, *t;
-	int i, j;
+	int load_locale_success, i, j;
 
 	l = _find_category(1);
 	_DIAGASSERT(l != NULL);
+	load_locale_success = 0;
 	if (name != NULL) {
 		strlcpy(&head[0], name, sizeof(head));
 		tokens[1] = &head[0];
@@ -78,10 +79,11 @@
 			}
 			tokens[_LC_LAST - 1] = (const char *)tail;
 			tail = strchr(tokens[i], '/');
-			if (tail == NULL)
+			if (tail != NULL)
 return NULL;
 		}
-		(*l->setlocale)(tokens[1], locale);
+		if ((*l->setlocale)(tokens[1], locale) != NULL)
+			load_locale_success = 1;
 	}
 	s = (*l->setlocale)(NULL, locale);
 	_DIAGASSERT(s != NULL);
@@ -89,8 +91,10 @@
 	for (i = 2, j = 0; i < _LC_LAST; ++i) {
 		l = _find_category(i);
 		_DIAGASSERT(l != NULL);
-		if (name != NULL)
-			(*l->setlocale)(tokens[1], locale);
+		if (name != NULL) {
+			if ((*l->setlocale)(tokens[i], locale) != NULL)
+load_locale_success = 1;
+		}
 		t = (*l->setlocale)(NULL, locale);
 		_DIAGASSERT(t != NULL);
 		if (j == 0) {
@@ -106,6 +110,8 @@
 		strlcat(&locale->query[0], "/", sizeof(locale->query));
 		strlcat(&locale->query[0], t, sizeof(locale->query));
 	}
+	if (name != NULL && !load_locale_success)
+		return NULL;
 	return (const char *)&locale->query[0];
 }
 



CVS commit: src/usr.sbin/mopd

2009-10-04 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun Oct  4 20:53:24 UTC 2009

Modified Files:
src/usr.sbin/mopd/mopd: mopd.8
src/usr.sbin/mopd/moptrace: moptrace.1

Log Message:
Fix markup. Handle the DECnet documentation like a journal.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/mopd/mopd/mopd.8
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/mopd/moptrace/moptrace.1

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

Modified files:

Index: src/usr.sbin/mopd/mopd/mopd.8
diff -u src/usr.sbin/mopd/mopd/mopd.8:1.12 src/usr.sbin/mopd/mopd/mopd.8:1.13
--- src/usr.sbin/mopd/mopd/mopd.8:1.12	Wed Mar 11 13:59:48 2009
+++ src/usr.sbin/mopd/mopd/mopd.8	Sun Oct  4 20:53:23 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mopd.8,v 1.12 2009/03/11 13:59:48 joerg Exp $
+.\"	$NetBSD: mopd.8,v 1.13 2009/10/04 20:53:23 joerg Exp $
 .\"
 .\" Copyright (c) 1993-96 Mats O Jansson.  All rights reserved.
 .\"
@@ -120,12 +120,12 @@
 .Xr moptrace 1 ,
 .Xr bpf 4
 .Rs
-DECnet Digital Network Architecture Phase IV,
+.%J DECnet Digital Network Architecture Phase IV
 .%R Maintenance Operations Functional Specification V3.0.0
 .%N AA-X436A-TK
 .Re
 .Rs
-DECnet Digital Network Architecture,
+.%J DECnet Digital Network Architecture
 .%R Maintenance Operations Protocol Functional Specification V4.0.0
 .%N EK-DNA11-FS-001
 .Re

Index: src/usr.sbin/mopd/moptrace/moptrace.1
diff -u src/usr.sbin/mopd/moptrace/moptrace.1:1.9 src/usr.sbin/mopd/moptrace/moptrace.1:1.10
--- src/usr.sbin/mopd/moptrace/moptrace.1:1.9	Wed Mar 11 13:59:48 2009
+++ src/usr.sbin/mopd/moptrace/moptrace.1	Sun Oct  4 20:53:23 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: moptrace.1,v 1.9 2009/03/11 13:59:48 joerg Exp $
+.\"	$NetBSD: moptrace.1,v 1.10 2009/10/04 20:53:23 joerg Exp $
 .\"
 .\" Copyright (c) 1993-95 Mats O Jansson.  All rights reserved.
 .\"
@@ -27,7 +27,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" @(#) $NetBSD: moptrace.1,v 1.9 2009/03/11 13:59:48 joerg Exp $
+.\" @(#) $NetBSD: moptrace.1,v 1.10 2009/10/04 20:53:23 joerg Exp $
 .\"
 .Dd October 2, 1995
 .Dt MOPTRACE 1
@@ -71,12 +71,12 @@
 .Xr mopprobe 1 ,
 .Xr mopd 8
 .Rs
-DECnet Digital Network Architecture Phase IV,
+.%J DECnet Digital Network Architecture Phase IV
 .%R Maintenance Operations Functional Specification V3.0.0
 .%N AA-X436A-TK
 .Re
 .Rs
-DECnet Digital Network Architecture,
+.%J DECnet Digital Network Architecture
 .%R Maintenance Operations Protocol Functional Specification V4.0.0
 .%N EK-DNA11-FS-001
 .Re



CVS commit: src/dist/pf/share/man/man4

2009-10-04 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun Oct  4 18:07:26 UTC 2009

Modified Files:
src/dist/pf/share/man/man4: pfsync.4

Log Message:
.Xr takes two arguments only.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/dist/pf/share/man/man4/pfsync.4

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

Modified files:

Index: src/dist/pf/share/man/man4/pfsync.4
diff -u src/dist/pf/share/man/man4/pfsync.4:1.3 src/dist/pf/share/man/man4/pfsync.4:1.4
--- src/dist/pf/share/man/man4/pfsync.4:1.3	Mon Sep 14 11:45:01 2009
+++ src/dist/pf/share/man/man4/pfsync.4	Sun Oct  4 18:07:26 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: pfsync.4,v 1.3 2009/09/14 11:45:01 degroote Exp $
+.\"	$NetBSD: pfsync.4,v 1.4 2009/10/04 18:07:26 joerg Exp $
 .\"	$OpenBSD: pfsync.4,v 1.25 2007/05/31 19:19:51 jmc Exp $
 .\"
 .\" Copyright (c) 2002 Michael Shalayeff
@@ -125,7 +125,8 @@
 Either run the pfsync protocol on a trusted network \- ideally  a network
 dedicated to pfsync messages such as a crossover cable between two firewalls,
 or specify a peer address and protect the traffic with
-.Xr ipsec 4 (it is not supported at the moment on
+.Xr ipsec 4
+(it is not supported at the moment on
 .Nx
 due to the lack of any encapsulation pseudo-device).
 .Pp



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

2009-10-04 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Oct  4 17:46:58 UTC 2009

Modified Files:
src/sys/rump/dev/wip/librumpusbhc: rumpusbhc.c

Log Message:
* pass a few write requests through to the device.
* drop async transfer requests on the floor (no, this does not make
  anything work, but it's the easiest way to prevent a receive pipe
  transfer request from hanging everything.  one tiny bugstep at a time ...)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/rump/dev/wip/librumpusbhc/rumpusbhc.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/dev/wip/librumpusbhc/rumpusbhc.c
diff -u src/sys/rump/dev/wip/librumpusbhc/rumpusbhc.c:1.4 src/sys/rump/dev/wip/librumpusbhc/rumpusbhc.c:1.5
--- src/sys/rump/dev/wip/librumpusbhc/rumpusbhc.c:1.4	Sun Oct  4 10:44:31 2009
+++ src/sys/rump/dev/wip/librumpusbhc/rumpusbhc.c	Sun Oct  4 17:46:58 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpusbhc.c,v 1.4 2009/10/04 10:44:31 pooka Exp $	*/
+/*	$NetBSD: rumpusbhc.c,v 1.5 2009/10/04 17:46:58 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rumpusbhc.c,v 1.4 2009/10/04 10:44:31 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpusbhc.c,v 1.5 2009/10/04 17:46:58 pooka Exp $");
 
 #include 
 #include 
@@ -476,6 +476,8 @@
 	 * XXX: don't wildcard these yet.  I want to better figure
 	 * out what to trap here
 	 */
+	case C(0x01, UT_WRITE_VENDOR_DEVICE):
+	case C(0x06, UT_WRITE_VENDOR_DEVICE):
 	case C(0x07, UT_READ_VENDOR_DEVICE):
 	case C(0x09, UT_READ_VENDOR_DEVICE):
 		{
@@ -650,6 +652,12 @@
 {
 	usbd_status err;
 
+	/* XXX: lie about supporting async transfers */
+	if ((xfer->flags & USBD_SYNCHRONOUS) == 0) {
+		printf("rumpusbhc does not support async transfers. LIAR!\n");
+		return USBD_IN_PROGRESS;
+	}
+
 	err = usb_insert_transfer(xfer);
 	if (err)
 		return (err);



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

2009-10-04 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Oct  4 17:40:34 UTC 2009

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

Log Message:
Fix hopefully the last deadlock in the wretched piece of code:
since ltsleep abuses "while (!mutex_tryenter()) continue;" for NOT
releasing the kernel biglock before sleeping, we cannot do a normal
mutex_enter() in the wakeup path, or otherwise we might be a
situation where the sleeper holds the kernel lock and wants the
sleepermutex (and will not back down) and the wakeupper holds the
sleepermutex and wants the kernel lock.  So introduce kernel lock
backdown to the wakeup path.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 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.17 src/sys/rump/librump/rumpkern/ltsleep.c:1.18
--- src/sys/rump/librump/rumpkern/ltsleep.c:1.17	Fri Sep  4 16:42:19 2009
+++ src/sys/rump/librump/rumpkern/ltsleep.c	Sun Oct  4 17:40:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ltsleep.c,v 1.17 2009/09/04 16:42:19 pooka Exp $	*/
+/*	$NetBSD: ltsleep.c,v 1.18 2009/10/04 17:40:34 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ltsleep.c,v 1.17 2009/09/04 16:42:19 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ltsleep.c,v 1.18 2009/10/04 17:40:34 pooka Exp $");
 
 #include 
 #include 
@@ -116,33 +116,37 @@
 	return 0;
 }
 
-void
-wakeup(wchan_t ident)
+static void
+do_wakeup(wchan_t ident, void (*wakeupfn)(kcondvar_t *))
 {
 	struct ltsleeper *ltsp;
+	int nlocks;
 
-	mutex_enter(&sleepermtx);
+	while (!mutex_tryenter(&sleepermtx)) {
+		KERNEL_UNLOCK_ALL(curlwp, &nlocks);
+		yield();
+		KERNEL_LOCK(nlocks, curlwp);
+	}
 	LIST_FOREACH(ltsp, &sleepers, entries) {
 		if (ltsp->id == ident) {
-			cv_broadcast(cv);
+			wakeupfn(cv);
 		}
 	}
 	mutex_exit(&sleepermtx);
 }
 
 void
+wakeup(wchan_t ident)
+{
+
+	do_wakeup(ident, cv_broadcast);
+}
+
+void
 wakeup_one(wchan_t ident)
 {
-	struct ltsleeper *ltsp;
 
-	mutex_enter(&sleepermtx);
-	LIST_FOREACH(ltsp, &sleepers, entries) {
-		if (ltsp->id == ident) {
-			cv_signal(cv);
-			break;
-		}
-	}
-	mutex_exit(&sleepermtx);
+	do_wakeup(ident, cv_signal);
 }
 
 void



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

2009-10-04 Thread Michael L. Hitch
Module Name:src
Committed By:   mhitch
Date:   Sun Oct  4 17:00:31 UTC 2009

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

Log Message:
IPI interrupts occur above IPL_VM, so using IPL_VM in for the tlb shootdown
queue mutex doesn't work very well.  I get various deadlocks and corrupted
queue entries.  Change to IPL_SCHED [IPL_CLOCK] to block IPI interrupts
while the cpu is mucking with the shootdown queue.


To generate a diff of this commit:
cvs rdiff -u -r1.242 -r1.243 src/sys/arch/alpha/alpha/pmap.c

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

Modified files:

Index: src/sys/arch/alpha/alpha/pmap.c
diff -u src/sys/arch/alpha/alpha/pmap.c:1.242 src/sys/arch/alpha/alpha/pmap.c:1.243
--- src/sys/arch/alpha/alpha/pmap.c:1.242	Thu Sep 10 22:27:11 2009
+++ src/sys/arch/alpha/alpha/pmap.c	Sun Oct  4 17:00:31 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.242 2009/09/10 22:27:11 mhitch Exp $ */
+/* $NetBSD: pmap.c,v 1.243 2009/10/04 17:00:31 mhitch Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008 The NetBSD Foundation, Inc.
@@ -140,7 +140,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.242 2009/09/10 22:27:11 mhitch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.243 2009/10/04 17:00:31 mhitch Exp $");
 
 #include 
 #include 
@@ -962,7 +962,7 @@
 	for (i = 0; i < ALPHA_MAXPROCS; i++) {
 		TAILQ_INIT(&pmap_tlb_shootdown_q[i].pq_head);
 		mutex_init(&pmap_tlb_shootdown_q[i].pq_lock, MUTEX_DEFAULT,
-		IPL_VM);
+		IPL_SCHED);
 	}
 #endif
 



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

2009-10-04 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Oct  4 16:31:08 UTC 2009

Modified Files:
src/sys/rump/librump/rumpvfs: rumpfs.c

Log Message:
Implement RUMP_ETFS_REG.  Usable e.g. by firmload(9).
(well, it should probably be RUMP_ETFS_PATH, but simple things first)


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/rump/librump/rumpvfs/rumpfs.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/rumpvfs/rumpfs.c
diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.23 src/sys/rump/librump/rumpvfs/rumpfs.c:1.24
--- src/sys/rump/librump/rumpvfs/rumpfs.c:1.23	Sat Sep  5 11:02:49 2009
+++ src/sys/rump/librump/rumpvfs/rumpfs.c	Sun Oct  4 16:31:08 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpfs.c,v 1.23 2009/09/05 11:02:49 pooka Exp $	*/
+/*	$NetBSD: rumpfs.c,v 1.24 2009/10/04 16:31:08 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,21 +28,23 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.23 2009/09/05 11:02:49 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.24 2009/10/04 16:31:08 pooka Exp $");
 
 #include 
-#include 
-#include 
+#include 
+#include 
 #include 
+#include 
 #include 
+#include 
+#include 
+#include 
 #include 
 #include 
-#include 
-#include 
 #include 
-#include 
+#include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
@@ -61,6 +63,9 @@
 static int rump_vop_reclaim(void *);
 static int rump_vop_success(void *);
 static int rump_vop_spec(void *);
+static int rump_vop_read(void *);
+static int rump_vop_write(void *);
+static int rump_vop_open(void *);
 
 int (**fifo_vnodeop_p)(void *);
 const struct vnodeopv_entry_desc fifo_vnodeop_entries[] = {
@@ -78,6 +83,9 @@
 	{ &vop_mkdir_desc, rump_vop_mkdir },
 	{ &vop_mknod_desc, rump_vop_mknod },
 	{ &vop_access_desc, rump_vop_success },
+	{ &vop_read_desc, rump_vop_read },
+	{ &vop_write_desc, rump_vop_write },
+	{ &vop_open_desc, rump_vop_open },
 	{ &vop_putpages_desc, genfs_null_putpages },
 	{ &vop_fsync_desc, rump_vop_success },
 	{ &vop_lock_desc, genfs_lock },
@@ -114,11 +122,21 @@
 	struct vattr rn_va;
 	struct vnode *rn_vp;
 
-	/* only for VDIR */
-	LIST_HEAD(, rumpfs_dent) rn_dir;
+	union {
+		struct {
+			char *hostpath;		/* VREG */
+			int readfd;
+			int writefd;
+		} reg;
+		LIST_HEAD(, rumpfs_dent) dir;	/* VDIR */
+	} rn_u;
 };
+#define rn_hostpath	rn_u.reg.hostpath
+#define rn_readfd	rn_u.reg.readfd
+#define rn_writefd	rn_u.reg.writefd
+#define rn_dir		rn_u.dir
 
-static struct rumpfs_node *makeprivate(enum vtype, dev_t, off_t);
+static struct rumpfs_node *makeprivate(enum vtype, dev_t, off_t, const char *);
 
 /*
  * Extra Terrestrial stuff.  We map a given key (pathname) to a file on
@@ -130,6 +148,8 @@
 
 struct etfs {
 	char et_key[MAXPATHLEN];
+	size_t et_keylen;
+
 	LIST_ENTRY(etfs) et_entries;
 
 	struct rumpfs_node *et_rn;
@@ -163,12 +183,13 @@
 etfs_find(const char *key, struct rumpfs_node **rnp)
 {
 	struct etfs *et;
+	size_t keylen = strlen(key);
 	bool rv = false;
 
 	KASSERT(mutex_owned(&etfs_lock));
 
 	LIST_FOREACH(et, &etfs_list, et_entries) {
-		if (strcmp(key, et->et_key) == 0) {
+		if (keylen == et->et_keylen && strcmp(key, et->et_key) == 0) {
 			*rnp = et->et_rn;
 			rv = true;
 			break;
@@ -185,26 +206,25 @@
 	struct etfs *et;
 	struct rumpfs_node *rn_dummy;
 	uint64_t fsize;
-	dev_t rdev;
+	dev_t rdev = NODEV;
 	devminor_t dmin;
 	int hft, error;
 
-	/* not supported for now, need r/w VOPs ... */
-	if (ftype == RUMP_ETFS_REG)
-		return EOPNOTSUPP;
-
 	if (rumpuser_getfileinfo(hostpath, &fsize, &hft, &error))
 		return error;
 
-	error = rumpblk_register(hostpath, &dmin);
-	if (error != 0) {
-		return error;
+	if (ftype == RUMP_ETFS_BLK || ftype == RUMP_ETFS_CHR) {
+		error = rumpblk_register(hostpath, &dmin);
+		if (error != 0) {
+			return error;
+		}
+		rdev = makedev(RUMPBLK, dmin);
 	}
-	rdev = makedev(RUMPBLK, dmin);
 
 	et = kmem_alloc(sizeof(*et), KM_SLEEP);
 	strcpy(et->et_key, key);
-	et->et_rn = makeprivate(ettype_to_vtype(ftype), rdev, fsize);
+	et->et_keylen = strlen(et->et_key);
+	et->et_rn = makeprivate(ettype_to_vtype(ftype), rdev, fsize, hostpath);
 
 	mutex_enter(&etfs_lock);
 	if (etfs_find(key, &rn_dummy)) {
@@ -223,10 +243,11 @@
 rump_etfs_remove(const char *key)
 {
 	struct etfs *et;
+	size_t keylen = strlen(key);
 
 	mutex_enter(&etfs_lock);
 	LIST_FOREACH(et, &etfs_list, et_entries) {
-		if (strcmp(et->et_key, key) == 0) {
+		if (keylen == et->et_keylen && strcmp(et->et_key, key) == 0) {
 			LIST_REMOVE(et, et_entries);
 			kmem_free(et, sizeof(*et));
 			break;
@@ -248,14 +269,28 @@
 static kmutex_t reclock;
 
 static struct rumpfs_node *
-makeprivate(enum vtype vt, dev_t rdev, off_t size)
+makeprivate(enum vtype vt, dev_t rdev, off_t size, const char *hostpath)
 {
 	struct rumpfs_node *rn;
 	struct vattr *va;
 	struct timespec ts;
 
 	rn = kmem_zalloc(sizeof(*rn), KM_SLEEP);
-	LIS

CVS commit: src/regress/usr.bin/xlint/lint1

2009-10-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct  4 15:12:42 UTC 2009

Added Files:
src/regress/usr.bin/xlint/lint1: test26.c

Log Message:
add packed tests.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/regress/usr.bin/xlint/lint1/test26.c

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

Added files:

Index: src/regress/usr.bin/xlint/lint1/test26.c
diff -u /dev/null src/regress/usr.bin/xlint/lint1/test26.c:1.1
--- /dev/null	Sun Oct  4 11:12:42 2009
+++ src/regress/usr.bin/xlint/lint1/test26.c	Sun Oct  4 11:12:41 2009
@@ -0,0 +1,35 @@
+/* packed tests */
+
+struct in_addr {
+	int x;
+};
+struct	ip_timestamp {
+	char ipt_code;
+	char ipt_len;
+	char ipt_ptr;
+	unsigned int ipt_flg:4,
+		 ipt_oflw:4;
+	union ipt_timestamp {
+		 int	ipt_time[1];
+		 struct	ipt_ta {
+			struct in_addr ipt_addr;
+			int ipt_time;
+		 } ipt_ta[1] __packed;
+	} ipt_timestamp __packed;
+} __packed;
+
+typedef struct __packed {
+	int x;
+} t;
+
+struct x {
+	char c;
+	long l;
+} __packed;
+
+struct y {
+	char c;
+	long l;
+};
+
+int a[sizeof(struct y) - sizeof(struct x) - 1];



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

2009-10-04 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Oct  4 13:29:36 UTC 2009

Modified Files:
src/sys/rump/librump/rumpvfs: Makefile.rumpvfs rump_vfs.c

Log Message:
Include firmload.  Although it may be used by devices, it's pure
vfs in nature, and therefore it belongs here (can't load a firmware
from a file system without file system support, right?).  Rename
rump_cwdi to cwdi0, since firmload depends on that name (naughty
firmload).


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/rump/librump/rumpvfs/Makefile.rumpvfs
cvs rdiff -u -r1.25 -r1.26 src/sys/rump/librump/rumpvfs/rump_vfs.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/rumpvfs/Makefile.rumpvfs
diff -u src/sys/rump/librump/rumpvfs/Makefile.rumpvfs:1.13 src/sys/rump/librump/rumpvfs/Makefile.rumpvfs:1.14
--- src/sys/rump/librump/rumpvfs/Makefile.rumpvfs:1.13	Sun Sep  6 20:42:25 2009
+++ src/sys/rump/librump/rumpvfs/Makefile.rumpvfs	Sun Oct  4 13:29:36 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rumpvfs,v 1.13 2009/09/06 20:42:25 pooka Exp $
+#	$NetBSD: Makefile.rumpvfs,v 1.14 2009/10/04 13:29:36 pooka Exp $
 #
 
 .include "${RUMPTOP}/Makefile.rump"
@@ -9,7 +9,8 @@
 	${RUMPTOP}/../kern	\
 	${RUMPTOP}/../miscfs/genfs ${RUMPTOP}/../miscfs/syncfs	\
 	${RUMPTOP}/../miscfs/specfs ${RUMPTOP}/../miscfs/deadfs	\
-	${RUMPTOP}/../compat/common ${RUMPTOP}/../uvm
+	${RUMPTOP}/../compat/common ${RUMPTOP}/../uvm		\
+	${RUMPTOP}/../dev
 
 #
 # Source modules, first the ones specifically implemented for librump.
@@ -42,6 +43,10 @@
 SRCS+=	subr_bufq.c bufq_disksort.c bufq_fcfs.c bufq_priocscan.c	\
 	bufq_readprio.c
 
+# dev
+# firmload is technically part of rumpdev, but it's pure vfs in nature.
+SRCS+= firmload.c
+
 # compat syscalls
 SRCS+=	vfs_syscalls_50.c compat.c
 

Index: src/sys/rump/librump/rumpvfs/rump_vfs.c
diff -u src/sys/rump/librump/rumpvfs/rump_vfs.c:1.25 src/sys/rump/librump/rumpvfs/rump_vfs.c:1.26
--- src/sys/rump/librump/rumpvfs/rump_vfs.c:1.25	Fri Oct  2 18:50:15 2009
+++ src/sys/rump/librump/rumpvfs/rump_vfs.c	Sun Oct  4 13:29:36 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_vfs.c,v 1.25 2009/10/02 18:50:15 elad Exp $	*/
+/*	$NetBSD: rump_vfs.c,v 1.26 2009/10/04 13:29:36 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v 1.25 2009/10/02 18:50:15 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v 1.26 2009/10/04 13:29:36 pooka Exp $");
 
 #include 
 #include 
@@ -54,7 +54,7 @@
 #include "rump_private.h"
 #include "rump_vfs_private.h"
 
-static struct cwdinfo rump_cwdi;
+struct cwdinfo cwdi0;
 
 static void rump_rcvp_lwpset(struct vnode *, struct vnode *, struct lwp *);
 
@@ -103,10 +103,10 @@
 	rump_proc_vfs_release = pvfs_rele;
 
 	/* bootstrap cwdi */
-	rw_init(&rump_cwdi.cwdi_lock);
-	rump_cwdi.cwdi_cdir = rootvnode;
-	vref(rump_cwdi.cwdi_cdir);
-	proc0.p_cwdi = &rump_cwdi;
+	rw_init(&cwdi0.cwdi_lock);
+	cwdi0.cwdi_cdir = rootvnode;
+	vref(cwdi0.cwdi_cdir);
+	proc0.p_cwdi = &cwdi0;
 	proc0.p_cwdi = cwdinit();
 
 	if (rump_threads) {
@@ -175,9 +175,9 @@
 {
 
 	/* See rcvp XXX above */
-	rump_cwdi.cwdi_rdir = NULL;
+	cwdi0.cwdi_rdir = NULL;
 	vref(rootvnode);
-	rump_cwdi.cwdi_cdir = rootvnode;
+	cwdi0.cwdi_cdir = rootvnode;
 
 	mount_finispecific(mp);
 	kmem_free(mp, sizeof(*mp));



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

2009-10-04 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Oct  4 13:24:58 UTC 2009

Modified Files:
src/sys/rump/librump/rumpnet: rump_net.c

Log Message:
Initialize suckets before domains since some domains install timers
which take softnet_lock and might run before the lock is actually
initialized.  Also, soinit() itself already calls soinit2(), so no
need to call it twice.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/rump/librump/rumpnet/rump_net.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/rumpnet/rump_net.c
diff -u src/sys/rump/librump/rumpnet/rump_net.c:1.9 src/sys/rump/librump/rumpnet/rump_net.c:1.10
--- src/sys/rump/librump/rumpnet/rump_net.c:1.9	Wed Sep 16 13:30:41 2009
+++ src/sys/rump/librump/rumpnet/rump_net.c	Sun Oct  4 13:24:58 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_net.c,v 1.9 2009/09/16 13:30:41 pooka Exp $	*/
+/*	$NetBSD: rump_net.c,v 1.10 2009/10/04 13:24:58 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rump_net.c,v 1.9 2009/09/16 13:30:41 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_net.c,v 1.10 2009/10/04 13:24:58 pooka Exp $");
 
 #include 
 
@@ -52,6 +52,7 @@
 {
 
 	mbinit();
+	soinit();
 
 	domaininit(false);
 	/*
@@ -66,8 +67,5 @@
 
 	rump_net_virtif_init();
 
-	soinit();
-	soinit2();
-
 	rump_netisr_init();
 }



CVS commit: [netbsd-5-0] src/doc

2009-10-04 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Oct  4 11:51:12 UTC 2009

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

Log Message:
Ticket 1066


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.15 -r1.1.2.16 src/doc/CHANGES-5.0.2

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

Modified files:

Index: src/doc/CHANGES-5.0.2
diff -u src/doc/CHANGES-5.0.2:1.1.2.15 src/doc/CHANGES-5.0.2:1.1.2.16
--- src/doc/CHANGES-5.0.2:1.1.2.15	Sun Oct  4 00:57:06 2009
+++ src/doc/CHANGES-5.0.2	Sun Oct  4 11:51:12 2009
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.0.2,v 1.1.2.15 2009/10/04 00:57:06 snj Exp $
+# $NetBSD: CHANGES-5.0.2,v 1.1.2.16 2009/10/04 11:51:12 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.0.1 release to the NetBSD 5.0.2
 release:
@@ -300,3 +300,15 @@
 	Do not require sys/mtio.h for a tools build of pax.
 	[apb, ticket #1020]
 
+distrib/cdrom/hide-hfs.lst			1.5
+distrib/mac68k/stand/Makefile			1.6
+distrib/notes/common/main			1.451
+distrib/sets/Makefile1.70
+distrib/sets/makesrctars			1.37
+distrib/sets/makesums1.16
+share/man/man7/release.7			1.31 via patch
+
+	Sync release(7) with reality.
+	Only generate SHA512 and MD5 checksums for releases.
+	[snj, ticket #1066]
+



CVS commit: [netbsd-5-0] src

2009-10-04 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Oct  4 11:50:27 UTC 2009

Modified Files:
src/distrib/cdrom [netbsd-5-0]: hide-hfs.lst
src/distrib/mac68k/stand [netbsd-5-0]: Makefile
src/distrib/notes/common [netbsd-5-0]: main
src/distrib/sets [netbsd-5-0]: Makefile makesrctars makesums
src/share/man/man7 [netbsd-5-0]: release.7

Log Message:
Pull up following revision(s) (requested by snj in ticket #1066):
distrib/notes/common/main: revision 1.451
share/man/man7/release.7: revision 1.31 via patch
distrib/mac68k/stand/Makefile: revision 1.6
distrib/sets/makesums: revision 1.16
distrib/sets/Makefile: revision 1.70
distrib/sets/makesrctars: revision 1.37
distrib/cdrom/hide-hfs.lst: revision 1.5
Sync release(7) with reality.
Only generate SHA512 and MD5 checksums for releases.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.46.1 src/distrib/cdrom/hide-hfs.lst
cvs rdiff -u -r1.5 -r1.5.6.1 src/distrib/mac68k/stand/Makefile
cvs rdiff -u -r1.425.2.5.2.1 -r1.425.2.5.2.2 src/distrib/notes/common/main
cvs rdiff -u -r1.63.2.1 -r1.63.2.1.2.1 src/distrib/sets/Makefile
cvs rdiff -u -r1.34 -r1.34.10.1 src/distrib/sets/makesrctars
cvs rdiff -u -r1.15 -r1.15.32.1 src/distrib/sets/makesums
cvs rdiff -u -r1.25 -r1.25.8.1 src/share/man/man7/release.7

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

Modified files:

Index: src/distrib/cdrom/hide-hfs.lst
diff -u src/distrib/cdrom/hide-hfs.lst:1.4 src/distrib/cdrom/hide-hfs.lst:1.4.46.1
--- src/distrib/cdrom/hide-hfs.lst:1.4	Thu Nov 30 05:14:01 2000
+++ src/distrib/cdrom/hide-hfs.lst	Sun Oct  4 11:50:27 2009
@@ -1,7 +1,5 @@
-BSDSUM
-CKSUM
 MD5
-SYSVSUM
+SHA512
 TRANS.TBL
 INSTALL.more
 ./boot

Index: src/distrib/mac68k/stand/Makefile
diff -u src/distrib/mac68k/stand/Makefile:1.5 src/distrib/mac68k/stand/Makefile:1.5.6.1
--- src/distrib/mac68k/stand/Makefile:1.5	Mon Jun 23 02:16:53 2008
+++ src/distrib/mac68k/stand/Makefile	Sun Oct  4 11:50:26 2009
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.5 2008/06/23 02:16:53 matt Exp $
+#   $NetBSD: Makefile,v 1.5.6.1 2009/10/04 11:50:26 bouyer Exp $
 #
 
 .include 
@@ -18,7 +18,7 @@
 	${RELEASE_INSTALL} ${DISTRIBDIR}/mac68k/stand/extensions.map \
 	  ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc
 	rm -f \
-	  ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/{BSDSUM,CKSUM,MD5,SYSVSUM}
+	  ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/{MD5,SHA512}
 	for i in BSD_Mac68k_Booter.bin Mkfs.sea.hqx Booter-HTML-manual-12.tar \
 	  Mkfs_1.47.sea.bin Mkfs_1.47.sea.hqx Booter2.0.0.sea \
 	  BooterManual.stxt.bin NetBSD_ROM.sit.hqx Installer.sea.hqx \
@@ -31,31 +31,22 @@
 	do \
 	  ${RELEASE_INSTALL} $$i ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc ; \
 	  (cd ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc ; \
-	${TOOL_CKSUM} -o1 `basename $$i` >> BSDSUM) ; \
-	  (cd ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc ; \
-	${TOOL_CKSUM} `basename $$i` >> CKSUM) ; \
-	  (cd ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc ; \
 	${TOOL_CKSUM} -a MD5 `basename $$i` >> MD5) ; \
 	  (cd ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc ; \
-	${TOOL_CKSUM} -o2 `basename $$i` >> SYSVSUM) ; \
+	${TOOL_CKSUM} -a SHA512 `basename $$i` >> SHA512) ; \
 	done
 	${INSTALL} -d ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/src
 	rm -f \
-	  ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/src/{BSDSUM,CKSUM,MD5}
-	rm -f ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/src/SYSVSUM
+	  ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/src/{MD5,SHA512}
 	for i in Booter2.0.0-src.sea Mkfs_1.47src.sea.hqx \
 	  Installer_1.1g.src.sea.hqx Installer_1.1h.src.sea.hqx ; \
 	do \
 	  ${RELEASE_INSTALL} $$i \
 	${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/src ; \
 	  (cd ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/src ; \
-	${TOOL_CKSUM} -o1 `basename $$i` >> BSDSUM) ; \
-	  (cd ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/src ; \
-	${TOOL_CKSUM} `basename $$i` >> CKSUM) ; \
-	  (cd ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/src ; \
 	${TOOL_CKSUM} -a MD5 `basename $$i` >> MD5) ; \
 	  (cd ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/src ; \
-	${TOOL_CKSUM} -o2 `basename $$i` >> SYSVSUM) ; \
+	${TOOL_CKSUM} -a SHA512 `basename $$i` >> SHA512) ; \
 	done
 
 .include 

Index: src/distrib/notes/common/main
diff -u src/distrib/notes/common/main:1.425.2.5.2.1 src/distrib/notes/common/main:1.425.2.5.2.2
--- src/distrib/notes/common/main:1.425.2.5.2.1	Wed Jul 29 22:28:46 2009
+++ src/distrib/notes/common/main	Sun Oct  4 11:50:26 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: main,v 1.425.2.5.2.1 2009/07/29 22:28:46 snj Exp $
+.\"	$NetBSD: main,v 1.425.2.5.2.2 2009/10/04 11:50:26 bouyer Exp $
 .\"
 .\" Copyright (c) 1999-2008 The NetBSD Foundation, Inc.
 .\

CVS commit: [netbsd-5] src/doc

2009-10-04 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Oct  4 11:49:23 UTC 2009

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

Log Message:
Ticket 1066


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.80 -r1.1.2.81 src/doc/CHANGES-5.1

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

Modified files:

Index: src/doc/CHANGES-5.1
diff -u src/doc/CHANGES-5.1:1.1.2.80 src/doc/CHANGES-5.1:1.1.2.81
--- src/doc/CHANGES-5.1:1.1.2.80	Sun Oct  4 00:54:16 2009
+++ src/doc/CHANGES-5.1	Sun Oct  4 11:49:23 2009
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1,v 1.1.2.80 2009/10/04 00:54:16 snj Exp $
+# $NetBSD: CHANGES-5.1,v 1.1.2.81 2009/10/04 11:49:23 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1
 release:
@@ -13923,3 +13923,15 @@
 	Fix build after ticket 952.
 	[mrg, ticket #1063]
 
+distrib/cdrom/hide-hfs.lst			1.5
+distrib/mac68k/stand/Makefile			1.6
+distrib/notes/common/main			1.451
+distrib/sets/Makefile1.70
+distrib/sets/makesrctars			1.37
+distrib/sets/makesums1.16
+share/man/man7/release.7			1.31 via patch
+
+	Sync release(7) with reality.
+	Only generate SHA512 and MD5 checksums for releases.
+	[snj, ticket #1066]
+



CVS commit: [netbsd-5] src

2009-10-04 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Oct  4 11:48:39 UTC 2009

Modified Files:
src/distrib/cdrom [netbsd-5]: hide-hfs.lst
src/distrib/mac68k/stand [netbsd-5]: Makefile
src/distrib/notes/common [netbsd-5]: main
src/distrib/sets [netbsd-5]: Makefile makesrctars makesums
src/share/man/man7 [netbsd-5]: release.7

Log Message:
Pull up following revision(s) (requested by snj in ticket #1066):
distrib/notes/common/main: revision 1.451
share/man/man7/release.7: revision 1.31 via patch
distrib/mac68k/stand/Makefile: revision 1.6
distrib/sets/makesums: revision 1.16
distrib/sets/Makefile: revision 1.70
distrib/sets/makesrctars: revision 1.37
distrib/cdrom/hide-hfs.lst: revision 1.5
Sync release(7) with reality.
Only generate SHA512 and MD5 checksums for releases.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.42.1 src/distrib/cdrom/hide-hfs.lst
cvs rdiff -u -r1.5 -r1.5.2.1 src/distrib/mac68k/stand/Makefile
cvs rdiff -u -r1.425.2.5 -r1.425.2.6 src/distrib/notes/common/main
cvs rdiff -u -r1.63.2.1 -r1.63.2.2 src/distrib/sets/Makefile
cvs rdiff -u -r1.34 -r1.34.6.1 src/distrib/sets/makesrctars
cvs rdiff -u -r1.15 -r1.15.28.1 src/distrib/sets/makesums
cvs rdiff -u -r1.25 -r1.25.4.1 src/share/man/man7/release.7

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

Modified files:

Index: src/distrib/cdrom/hide-hfs.lst
diff -u src/distrib/cdrom/hide-hfs.lst:1.4 src/distrib/cdrom/hide-hfs.lst:1.4.42.1
--- src/distrib/cdrom/hide-hfs.lst:1.4	Thu Nov 30 05:14:01 2000
+++ src/distrib/cdrom/hide-hfs.lst	Sun Oct  4 11:48:39 2009
@@ -1,7 +1,5 @@
-BSDSUM
-CKSUM
 MD5
-SYSVSUM
+SHA512
 TRANS.TBL
 INSTALL.more
 ./boot

Index: src/distrib/mac68k/stand/Makefile
diff -u src/distrib/mac68k/stand/Makefile:1.5 src/distrib/mac68k/stand/Makefile:1.5.2.1
--- src/distrib/mac68k/stand/Makefile:1.5	Mon Jun 23 02:16:53 2008
+++ src/distrib/mac68k/stand/Makefile	Sun Oct  4 11:48:39 2009
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.5 2008/06/23 02:16:53 matt Exp $
+#   $NetBSD: Makefile,v 1.5.2.1 2009/10/04 11:48:39 bouyer Exp $
 #
 
 .include 
@@ -18,7 +18,7 @@
 	${RELEASE_INSTALL} ${DISTRIBDIR}/mac68k/stand/extensions.map \
 	  ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc
 	rm -f \
-	  ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/{BSDSUM,CKSUM,MD5,SYSVSUM}
+	  ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/{MD5,SHA512}
 	for i in BSD_Mac68k_Booter.bin Mkfs.sea.hqx Booter-HTML-manual-12.tar \
 	  Mkfs_1.47.sea.bin Mkfs_1.47.sea.hqx Booter2.0.0.sea \
 	  BooterManual.stxt.bin NetBSD_ROM.sit.hqx Installer.sea.hqx \
@@ -31,31 +31,22 @@
 	do \
 	  ${RELEASE_INSTALL} $$i ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc ; \
 	  (cd ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc ; \
-	${TOOL_CKSUM} -o1 `basename $$i` >> BSDSUM) ; \
-	  (cd ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc ; \
-	${TOOL_CKSUM} `basename $$i` >> CKSUM) ; \
-	  (cd ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc ; \
 	${TOOL_CKSUM} -a MD5 `basename $$i` >> MD5) ; \
 	  (cd ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc ; \
-	${TOOL_CKSUM} -o2 `basename $$i` >> SYSVSUM) ; \
+	${TOOL_CKSUM} -a SHA512 `basename $$i` >> SHA512) ; \
 	done
 	${INSTALL} -d ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/src
 	rm -f \
-	  ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/src/{BSDSUM,CKSUM,MD5}
-	rm -f ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/src/SYSVSUM
+	  ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/src/{MD5,SHA512}
 	for i in Booter2.0.0-src.sea Mkfs_1.47src.sea.hqx \
 	  Installer_1.1g.src.sea.hqx Installer_1.1h.src.sea.hqx ; \
 	do \
 	  ${RELEASE_INSTALL} $$i \
 	${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/src ; \
 	  (cd ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/src ; \
-	${TOOL_CKSUM} -o1 `basename $$i` >> BSDSUM) ; \
-	  (cd ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/src ; \
-	${TOOL_CKSUM} `basename $$i` >> CKSUM) ; \
-	  (cd ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/src ; \
 	${TOOL_CKSUM} -a MD5 `basename $$i` >> MD5) ; \
 	  (cd ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc/src ; \
-	${TOOL_CKSUM} -o2 `basename $$i` >> SYSVSUM) ; \
+	${TOOL_CKSUM} -a SHA512 `basename $$i` >> SHA512) ; \
 	done
 
 .include 

Index: src/distrib/notes/common/main
diff -u src/distrib/notes/common/main:1.425.2.5 src/distrib/notes/common/main:1.425.2.6
--- src/distrib/notes/common/main:1.425.2.5	Sun Apr 26 01:35:25 2009
+++ src/distrib/notes/common/main	Sun Oct  4 11:48:39 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: main,v 1.425.2.5 2009/04/26 01:35:25 snj Exp $
+.\"	$NetBSD: main,v 1.425.2.6 2009/10/04 11:48:39 bouyer Exp $
 .\"
 .\" Copyright (c) 1999-2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -2229,46 +2229,21

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

2009-10-04 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Oct  4 10:44:31 UTC 2009

Modified Files:
src/sys/rump/dev/wip/librumpusbhc: rumpusbhc.c

Log Message:
Pass some requests to the device.  Hi ho, required for rum.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/rump/dev/wip/librumpusbhc/rumpusbhc.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/dev/wip/librumpusbhc/rumpusbhc.c
diff -u src/sys/rump/dev/wip/librumpusbhc/rumpusbhc.c:1.3 src/sys/rump/dev/wip/librumpusbhc/rumpusbhc.c:1.4
--- src/sys/rump/dev/wip/librumpusbhc/rumpusbhc.c:1.3	Sat Oct  3 20:46:49 2009
+++ src/sys/rump/dev/wip/librumpusbhc/rumpusbhc.c	Sun Oct  4 10:44:31 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpusbhc.c,v 1.3 2009/10/03 20:46:49 pooka Exp $	*/
+/*	$NetBSD: rumpusbhc.c,v 1.4 2009/10/04 10:44:31 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rumpusbhc.c,v 1.3 2009/10/03 20:46:49 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpusbhc.c,v 1.4 2009/10/04 10:44:31 pooka Exp $");
 
 #include 
 #include 
@@ -472,6 +472,24 @@
 		totlen = 0;
 		break;
 
+	/*
+	 * XXX: don't wildcard these yet.  I want to better figure
+	 * out what to trap here
+	 */
+	case C(0x07, UT_READ_VENDOR_DEVICE):
+	case C(0x09, UT_READ_VENDOR_DEVICE):
+		{
+		struct usb_ctl_request ucr;
+
+		memcpy(&ucr.ucr_request, req, sizeof(ucr.ucr_request));
+		ucr.ucr_data = buf;
+		if (rumpuser_ioctl(sc->sc_ugenfd[UGEN_EPT_CTRL],
+		USB_DO_REQUEST, &ucr, &ru_error) == -1) {
+			panic("request failed");
+		}
+		}
+		break;
+
 	default:
 		panic("unhandled request");
 		break;



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

2009-10-04 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Oct  4 10:43:03 UTC 2009

Added Files:
src/sys/rump/dev/wip/libusbrum: Makefile rum_at_usb.c shlib_version

Log Message:
Support r...@usb.  Currently manages to configure and attach:

pain-rustique:66:~> ./rumpusbprobe
mainbus0 (root)
rumpusbhc2 at mainbus0
usb0 at rumpusbhc2: USB revision 2.0
uhub0 at usb0: vendor 0x product 0x, class 9/0, rev 0.00/0.00, addr 1
rum0 at uhub0 port 1
rum0: D-Link DWA-111, rev 2.00/0.01, addr 2
rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528, address 00:24:01:31:98:9a
rum0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
rum0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 
36Mbps 48Mbps 54Mbps


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

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/libusbrum/Makefile
diff -u /dev/null src/sys/rump/dev/wip/libusbrum/Makefile:1.1
--- /dev/null	Sun Oct  4 10:43:03 2009
+++ src/sys/rump/dev/wip/libusbrum/Makefile	Sun Oct  4 10:43:03 2009
@@ -0,0 +1,16 @@
+#	$NetBSD: Makefile,v 1.1 2009/10/04 10:43:03 pooka Exp $
+#
+
+.PATH:	${.CURDIR}/../../../../dev/usb
+
+LIB=	rumpdev_usbrum
+
+SRCS=   if_rum.c
+
+SRCS+=	rum_at_usb.c
+
+CFLAGS+=	-Wno-pointer-sign
+CPPFLAGS+=	-I${.CURDIR}/opt -I${RUMPTOP}/librump/rumpnet/opt
+
+.include 
+.include 
Index: src/sys/rump/dev/wip/libusbrum/rum_at_usb.c
diff -u /dev/null src/sys/rump/dev/wip/libusbrum/rum_at_usb.c:1.1
--- /dev/null	Sun Oct  4 10:43:03 2009
+++ src/sys/rump/dev/wip/libusbrum/rum_at_usb.c	Sun Oct  4 10:43:03 2009
@@ -0,0 +1,108 @@
+/*	$NetBSD: rum_at_usb.c,v 1.1 2009/10/04 10:43:03 pooka Exp $	*/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/*
+ * rum @ usb
+ *
+ * handwritten device configuration 'nuf said
+ */
+
+static const struct cfiattrdata uroothub_iattrdata = {
+	"usbroothubif", 0, {
+		{ NULL, NULL, 0 },
+	}
+};
+static const struct cfiattrdata *const usb_attrs[] = {
+	&uroothub_iattrdata,
+	NULL,
+};
+CFDRIVER_DECL(usb, DV_DULL, usb_attrs);
+
+static const struct cfiattrdata usbdevif_iattrdata = {
+	"usbdevif", 0, {
+		{ NULL, NULL, 0 },
+	}
+};
+static const struct cfiattrdata usbifif_iattrdata = {
+	"usbifif", 0, {
+		{ NULL, NULL, 0 },
+	}
+};
+static const struct cfiattrdata *const uhub_attrs[] = {
+	&usbdevif_iattrdata,
+	&usbifif_iattrdata,
+	NULL,
+};
+CFDRIVER_DECL(uhub, DV_DULL, uhub_attrs);
+
+CFDRIVER_DECL(rum, DV_IFNET, NULL);
+
+struct cfparent rumpusbhc_pspec = {
+	"usbus",
+	"rumpusbhc",
+	DVUNIT_ANY
+};
+
+struct cfdata usb_cfdata[] = {
+	{ "usb", "usb", 0, FSTATE_STAR, NULL, 0, &rumpusbhc_pspec },
+};
+
+struct cfparent usb_pspec = {
+	"usbroothubif",
+	"usb",
+	DVUNIT_ANY
+};
+
+struct cfdata uhub_cfdata[] = {
+	{ "uhub", "uroothub", 0, FSTATE_STAR, NULL, 0, &usb_pspec },
+};
+
+struct cfparent usbifif_pspec = {
+	"usbifif",
+	"uhub",
+	DVUNIT_ANY
+};
+
+struct cfparent usbdevif_pspec = {
+	"usbdevif",
+	"uhub",
+	DVUNIT_ANY
+};
+
+struct cfdata rum_cfdata[] = {
+	{ "rum", "rum", 0, FSTATE_STAR, NULL, 0, &usbdevif_pspec },
+};
+
+#include "rump_dev_private.h"
+
+#define FLAWLESSCALL(call)		\
+do {	\
+	int att_error;			\
+	if ((att_error = call) != 0)	\
+		panic("\"%s\" failed", #call);\
+} while (/*CONSTCOND*/0)
+
+void
+rump_device_configuration(void)
+{
+	extern struct cfattach usb_ca, uhub_ca, uroothub_ca, rum_ca;
+
+	FLAWLESSCALL(config_cfdriver_attach(&usb_cd));
+	FLAWLESSCALL(config_cfattach_attach("usb", &usb_ca));
+	FLAWLESSCALL(config_cfdata_attach(usb_cfdata, 0));
+
+	FLAWLESSCALL(config_cfdriver_attach(&uhub_cd));
+	FLAWLESSCALL(config_cfattach_attach("uhub", &uhub_ca));
+	FLAWLESSCALL(config_cfdata_attach(uhub_cfdata, 0));
+
+	FLAWLESSCALL(config_cfdriver_attach(&rum_cd));
+	FLAWLESSCALL(config_cfattach_attach("rum", &rum_ca));
+	FLAWLESSCALL(config_cfdata_attach(rum_cfdata, 0));
+
+	FLAWLESSCALL(config_cfattach_attach("uhub", &uroothub_ca));
+}
Index: src/sys/rump/dev/wip/libusbrum/shlib_version
diff -u /dev/null src/sys/rump/dev/wip/libusbrum/shlib_version:1.1
--- /dev/null	Sun Oct  4 10:43:03 2009
+++ src/sys/rump/dev/wip/libusbrum/shlib_version	Sun Oct  4 10:43:03 2009
@@ -0,0 +1,4 @@
+#	$NetBSD: shlib_version,v 1.1 2009/10/04 10:43:03 pooka Exp $
+#
+major=0
+minor=0



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

2009-10-04 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Sun Oct  4 10:40:40 UTC 2009

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

Log Message:
Support net80211 in rump (for wireless device drivers, therefore in "dev")


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

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/libnet80211/Makefile
diff -u /dev/null src/sys/rump/dev/wip/libnet80211/Makefile:1.1
--- /dev/null	Sun Oct  4 10:40:40 2009
+++ src/sys/rump/dev/wip/libnet80211/Makefile	Sun Oct  4 10:40:40 2009
@@ -0,0 +1,19 @@
+#	$NetBSD: Makefile,v 1.1 2009/10/04 10:40:40 pooka Exp $
+#
+
+.PATH:	${.CURDIR}/../../../../net80211
+
+LIB=	rumpdev_net80211
+
+SRCS=   ieee80211.c ieee80211_acl.c ieee80211_amrr.c ieee80211_crypto.c	\
+	ieee80211_crypto_ccmp.c ieee80211_crypto_none.c			\
+	ieee80211_crypto_tkip.c ieee80211_crypto_wep.c ieee80211_input.c\
+	ieee80211_ioctl.c ieee80211_netbsd.c ieee80211_node.c		\
+	ieee80211_output.c ieee80211_proto.c ieee80211_rssadapt.c	\
+	ieee80211_xauth.c
+
+CFLAGS+=	-Wno-pointer-sign
+CPPFLAGS+=	-I${.CURDIR}/opt -I${RUMPTOP}/librump/rumpnet/opt
+
+.include 
+.include 
Index: src/sys/rump/dev/wip/libnet80211/shlib_version
diff -u /dev/null src/sys/rump/dev/wip/libnet80211/shlib_version:1.1
--- /dev/null	Sun Oct  4 10:40:40 2009
+++ src/sys/rump/dev/wip/libnet80211/shlib_version	Sun Oct  4 10:40:40 2009
@@ -0,0 +1,4 @@
+#	$NetBSD: shlib_version,v 1.1 2009/10/04 10:40:40 pooka Exp $
+#
+major=0
+minor=0