CVS commit: src/tests/fs/vfs

2011-07-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jul 18 06:47:08 UTC 2011

Modified Files:
src/tests/fs/vfs: t_renamerace.c

Log Message:
ffs and ffslog are no longer xfail.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/tests/fs/vfs/t_renamerace.c

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

Modified files:

Index: src/tests/fs/vfs/t_renamerace.c
diff -u src/tests/fs/vfs/t_renamerace.c:1.22 src/tests/fs/vfs/t_renamerace.c:1.23
--- src/tests/fs/vfs/t_renamerace.c:1.22	Mon Mar 14 19:05:19 2011
+++ src/tests/fs/vfs/t_renamerace.c	Mon Jul 18 06:47:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_renamerace.c,v 1.22 2011/03/14 19:05:19 pooka Exp $	*/
+/*	$NetBSD: t_renamerace.c,v 1.23 2011/07/18 06:47:08 dholland Exp $	*/
 
 /*
  * Modified for rump and atf from a program supplied
@@ -139,8 +139,7 @@
 		atf_tc_skip("rename not supported by fs");
 
 	/* XXX: msdosfs also sometimes hangs */
-	if (FSTYPE_FFS(tc) || FSTYPE_EXT2FS(tc) || FSTYPE_LFS(tc) ||
-	FSTYPE_MSDOS(tc) || FSTYPE_FFSLOG(tc))
+	if (FSTYPE_EXT2FS(tc) || FSTYPE_LFS(tc) || FSTYPE_MSDOS(tc))
 		atf_tc_expect_signal(-1, "PR kern/43626");
 
 	/* XXX: unracy execution not caught */
@@ -165,8 +164,7 @@
 	 * Doesn't always trigger when run on a slow backend
 	 * (i.e. not on tmpfs/mfs).  So do the usual kludge.
 	 */
-	if (FSTYPE_FFS(tc) || FSTYPE_EXT2FS(tc) || FSTYPE_LFS(tc) ||
-	FSTYPE_MSDOS(tc) || FSTYPE_FFSLOG(tc))
+	if (FSTYPE_EXT2FS(tc) || FSTYPE_LFS(tc) || FSTYPE_MSDOS(tc))
 		abort();
 
 	if (FSTYPE_P2K_FFS(tc)) {



CVS commit: src/sys/ufs/ufs

2011-07-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jul 18 06:46:05 UTC 2011

Modified Files:
src/sys/ufs/ufs: ufs_wapbl.c

Log Message:
Remove some unneeded rename-related static const data.
(Why didn't gcc warn that this was unused?)


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/ufs/ufs/ufs_wapbl.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/ufs/ufs/ufs_wapbl.c
diff -u src/sys/ufs/ufs/ufs_wapbl.c:1.21 src/sys/ufs/ufs/ufs_wapbl.c:1.22
--- src/sys/ufs/ufs/ufs_wapbl.c:1.21	Mon Jul 18 06:45:28 2011
+++ src/sys/ufs/ufs/ufs_wapbl.c	Mon Jul 18 06:46:05 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: ufs_wapbl.c,v 1.21 2011/07/18 06:45:28 dholland Exp $ */
+/*  $NetBSD: ufs_wapbl.c,v 1.22 2011/07/18 06:46:05 dholland Exp $ */
 
 /*-
  * Copyright (c) 2003,2006,2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ufs_wapbl.c,v 1.21 2011/07/18 06:45:28 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_wapbl.c,v 1.22 2011/07/18 06:46:05 dholland Exp $");
 
 #include 
 #include 
@@ -101,14 +101,6 @@
 
 #include 
 
-/*
- * A virgin directory (no blushing please).
- */
-static const struct dirtemplate mastertemplate = {
-	0,	12,		DT_DIR,	1,	".",
-	0,	DIRBLKSIZ - 12,	DT_DIR,	2,	".."
-};
-
 #ifdef WAPBL_DEBUG_INODES
 #error WAPBL_DEBUG_INODES: not functional before ufs_wapbl.c is updated
 void



CVS commit: src/sys/ufs/ufs

2011-07-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jul 18 06:45:47 UTC 2011

Modified Files:
src/sys/ufs/ufs: ufs_vnops.c

Log Message:
Eliminate the old ufs_rename. The only reason the WAPBL one was
different is that in order to avoid issues with the WAPBL journal lock
the wrong locking had to be changed to different wrong locking. This
is now moot.

I have not hand-validated that the current two copies of rename are
equivalent, or that the locking fixes merged with the old rename
produce code that is textually identical (modulo WAPBL calls that do
nothing when WAPBL is turned off) to the WAPBL rename... but I did
this check when preparing my previous round of rename patches last
year and all updates since have been applied to both.


To generate a diff of this commit:
cvs rdiff -u -r1.199 -r1.200 src/sys/ufs/ufs/ufs_vnops.c

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

Modified files:

Index: src/sys/ufs/ufs/ufs_vnops.c
diff -u src/sys/ufs/ufs/ufs_vnops.c:1.199 src/sys/ufs/ufs/ufs_vnops.c:1.200
--- src/sys/ufs/ufs/ufs_vnops.c:1.199	Mon Jul 18 06:45:27 2011
+++ src/sys/ufs/ufs/ufs_vnops.c	Mon Jul 18 06:45:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_vnops.c,v 1.199 2011/07/18 06:45:27 dholland Exp $	*/
+/*	$NetBSD: ufs_vnops.c,v 1.200 2011/07/18 06:45:47 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.199 2011/07/18 06:45:27 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.200 2011/07/18 06:45:47 dholland Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1300,15 +1300,9 @@
  *directory was moved and the parent of the destination
  *is different from the source, patch the ".." entry in the
  *directory.
- *
- * WAPBL NOTE: wapbl_ufs_rename derived from ufs_rename in ufs_vnops.c
- * ufs_vnops.c netbsd cvs revision 1.108
- * which has the berkeley copyright above
- * changes introduced to ufs_rename since netbsd cvs revision 1.164
- * will need to be ported into wapbl_ufs_rename
  */
 int
-wapbl_ufs_rename(void *v)
+ufs_rename(void *v)
 {
 	struct vop_rename_args  /* {
 		struct vnode		*a_fdvp;
@@ -1970,406 +1964,6 @@
 }
 
 int
-ufs_rename(void *v)
-{
-	struct vop_rename_args  /* {
-		struct vnode		*a_fdvp;
-		struct vnode		*a_fvp;
-		struct componentname	*a_fcnp;
-		struct vnode		*a_tdvp;
-		struct vnode		*a_tvp;
-		struct componentname	*a_tcnp;
-	} */ *ap = v;
-	struct vnode		*tvp, *tdvp, *fvp, *fdvp;
-	struct componentname	*tcnp, *fcnp;
-	struct inode		*ip, *xp, *dp;
-	struct mount		*mp;
-	struct direct		*newdir;
-	int			doingdirectory, oldparent, newparent, error;
-	struct ufs_lookup_results from_ulr, to_ulr;
-
-#ifdef WAPBL
-	if (ap->a_tdvp->v_mount->mnt_wapbl)
-		return wapbl_ufs_rename(v);
-#endif
-
-	tvp = ap->a_tvp;
-	tdvp = ap->a_tdvp;
-	fvp = ap->a_fvp;
-	fdvp = ap->a_fdvp;
-	tcnp = ap->a_tcnp;
-	fcnp = ap->a_fcnp;
-	doingdirectory = oldparent = newparent = error = 0;
-
-	/* save the supplemental lookup results as they currently exist */
-	from_ulr = VTOI(fdvp)->i_crap;
-	to_ulr = VTOI(tdvp)->i_crap;
-	UFS_CHECK_CRAPCOUNTER(VTOI(fdvp));
-	UFS_CHECK_CRAPCOUNTER(VTOI(tdvp));
-
-	/*
-	 * Check for cross-device rename.
-	 */
-	if ((fvp->v_mount != tdvp->v_mount) ||
-	(tvp && (fvp->v_mount != tvp->v_mount))) {
-		error = EXDEV;
- abortit:
-		VOP_ABORTOP(tdvp, tcnp); /* XXX, why not in NFS? */
-		if (tdvp == tvp)
-			vrele(tdvp);
-		else
-			vput(tdvp);
-		if (tvp)
-			vput(tvp);
-		VOP_ABORTOP(fdvp, fcnp); /* XXX, why not in NFS? */
-		vrele(fdvp);
-		vrele(fvp);
-		return (error);
-	}
-
-	/*
-	 * Check if just deleting a link name.
-	 */
-	if (tvp && ((VTOI(tvp)->i_flags & (IMMUTABLE | APPEND)) ||
-	(VTOI(tdvp)->i_flags & APPEND))) {
-		error = EPERM;
-		goto abortit;
-	}
-	if (fvp == tvp) {
-		if (fvp->v_type == VDIR) {
-			error = EINVAL;
-			goto abortit;
-		}
-
-		/* Release destination completely. */
-		VOP_ABORTOP(tdvp, tcnp);
-		vput(tdvp);
-		vput(tvp);
-
-		/* Delete source. */
-		vrele(fvp);
-		fcnp->cn_flags &= ~(MODMASK);
-		fcnp->cn_flags |= LOCKPARENT | LOCKLEAF;
-		fcnp->cn_nameiop = DELETE;
-		vn_lock(fdvp, LK_EXCLUSIVE | LK_RETRY);
-		if ((error = relookup(fdvp, &fvp, fcnp, 0))) {
-			vput(fdvp);
-			return (error);
-		}
-		return (VOP_REMOVE(fdvp, fvp, fcnp));
-	}
-	if ((error = vn_lock(fvp, LK_EXCLUSIVE)) != 0)
-		goto abortit;
-	dp = VTOI(fdvp);
-	ip = VTOI(fvp);
-	if ((nlink_t) ip->i_nlink >= LINK_MAX) {
-		VOP_UNLOCK(fvp);
-		error = EMLINK;
-		goto abortit;
-	}
-	if ((ip->i_flags & (IMMUTABLE | APPEND)) ||
-		(dp->i_flags & APPEND)) {
-		VOP_UNLOCK(fvp);
-		error = EPERM;
-		goto abortit;
-	}
-	if ((ip->i_mode & IFMT) == IFDIR) {
-		/*
-		 * Avoid ".", "..", and aliases of "." for obvious reasons.
-		 */
-		if ((fcnp->cn_namelen == 1 && fcnp->cn_nameptr[0] == '.') ||
-		dp == ip ||
-		(fcnp->cn_flags & ISDOTDOT) ||
-		(tcnp->cn_fl

CVS commit: src/sys/ufs/ufs

2011-07-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jul 18 06:45:28 UTC 2011

Modified Files:
src/sys/ufs/ufs: ufs_vnops.c ufs_wapbl.c

Log Message:
Move ufs_wapbl_rename to ufs_vnops.c next to the old ufs_rename.


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/sys/ufs/ufs/ufs_vnops.c
cvs rdiff -u -r1.20 -r1.21 src/sys/ufs/ufs/ufs_wapbl.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/ufs/ufs/ufs_vnops.c
diff -u src/sys/ufs/ufs/ufs_vnops.c:1.198 src/sys/ufs/ufs/ufs_vnops.c:1.199
--- src/sys/ufs/ufs/ufs_vnops.c:1.198	Mon Jul 18 02:35:11 2011
+++ src/sys/ufs/ufs/ufs_vnops.c	Mon Jul 18 06:45:27 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_vnops.c,v 1.198 2011/07/18 02:35:11 dholland Exp $	*/
+/*	$NetBSD: ufs_vnops.c,v 1.199 2011/07/18 06:45:27 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.198 2011/07/18 02:35:11 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.199 2011/07/18 06:45:27 dholland Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1103,6 +1103,872 @@
  * once.)
  */
 
+/* XXX following lifted from ufs_lookup.c */
+#define	FSFMT(vp)	(((vp)->v_mount->mnt_iflag & IMNT_DTYPE) == 0)
+
+/*
+ * Check if either entry referred to by FROM_ULR is within the range
+ * of entries named by TO_ULR.
+ */
+static int
+ulr_overlap(const struct ufs_lookup_results *from_ulr,
+	const struct ufs_lookup_results *to_ulr)
+{
+	doff_t from_start, from_prevstart;
+	doff_t to_start, to_end;
+
+	/*
+	 * FROM is a DELETE result; offset points to the entry to
+	 * remove and subtracting count gives the previous entry.
+	 */
+	from_start = from_ulr->ulr_offset - from_ulr->ulr_count;
+	from_prevstart = from_ulr->ulr_offset;
+
+	/*
+	 * TO is a RENAME (thus non-DELETE) result; offset points
+	 * to the beginning of a region to write in, and adding
+	 * count gives the end of the region.
+	 */
+	to_start = to_ulr->ulr_offset;
+	to_end = to_ulr->ulr_offset + to_ulr->ulr_count;
+
+	if (from_prevstart >= to_start && from_prevstart < to_end) {
+		return 1;
+	}
+	if (from_start >= to_start && from_start < to_end) {
+		return 1;
+	}
+	return 0;
+}
+
+/*
+ * Wrapper for relookup that also updates the supplemental results.
+ */
+static int
+do_relookup(struct vnode *dvp, struct ufs_lookup_results *ulr,
+	struct vnode **vp, struct componentname *cnp)
+{
+	int error;
+
+	error = relookup(dvp, vp, cnp, 0);
+	if (error) {
+		return error;
+	}
+	/* update the supplemental reasults */
+	*ulr = VTOI(dvp)->i_crap;
+	UFS_CHECK_CRAPCOUNTER(VTOI(dvp));
+	return 0;
+}
+
+/*
+ * Lock and relookup a sequence of two directories and two children.
+ *
+ */
+static int
+lock_vnode_sequence(struct vnode *d1, struct ufs_lookup_results *ulr1,
+		struct vnode **v1_ret, struct componentname *cn1, 
+		int v1_missing_ok,
+		int overlap_error,
+		struct vnode *d2, struct ufs_lookup_results *ulr2,
+		struct vnode **v2_ret, struct componentname *cn2, 
+		int v2_missing_ok)
+{
+	struct vnode *v1, *v2;
+	int error;
+
+	KASSERT(d1 != d2);
+
+	vn_lock(d1, LK_EXCLUSIVE | LK_RETRY);
+	if (VTOI(d1)->i_size == 0) {
+		/* d1 has been rmdir'd */
+		VOP_UNLOCK(d1);
+		return ENOENT;
+	}
+	error = do_relookup(d1, ulr1, &v1, cn1);
+	if (v1_missing_ok) {
+		if (error == ENOENT) {
+			/*
+			 * Note: currently if the name doesn't exist,
+			 * relookup succeeds (it intercepts the
+			 * EJUSTRETURN from VOP_LOOKUP) and sets tvp
+			 * to NULL. Therefore, we will never get
+			 * ENOENT and this branch is not needed.
+			 * However, in a saner future the EJUSTRETURN
+			 * garbage will go away, so let's DTRT.
+			 */
+			v1 = NULL;
+			error = 0;
+		}
+	} else {
+		if (error == 0 && v1 == NULL) {
+			/* This is what relookup sets if v1 disappeared. */
+			error = ENOENT;
+		}
+	}
+	if (error) {
+		VOP_UNLOCK(d1);
+		return error;
+	}
+	if (v1 && v1 == d2) {
+		VOP_UNLOCK(d1);
+		VOP_UNLOCK(v1);
+		vrele(v1);
+		return overlap_error;
+	}
+
+	/*
+	 * The right way to do this is to do lookups without locking
+	 * the results, and lock the results afterwards; then at the
+	 * end we can avoid trying to lock v2 if v2 == v1.
+	 *
+	 * However, for the reasons described in the fdvp == tdvp case
+	 * in rename below, we can't do that safely. So, in the case
+	 * where v1 is not a directory, unlock it and lock it again
+	 * afterwards. This is safe in locking order because a
+	 * non-directory can't be above anything else in the tree. If
+	 * v1 *is* a directory, that's not true, but then because d1
+	 * != d2, v1 != v2.
+	 */
+	if (v1 && v1->v_type != VDIR) {
+		VOP_UNLOCK(v1);
+	}
+	vn_lock(d2, LK_EXCLUSIVE | LK_RETRY);
+	if (VTOI(d2)->i_size == 0) {
+		/* d2 has been rmdir'd */
+		VOP_UNLOCK(d2);
+		if (v1 && v1->v_type == VDIR) {
+			VOP_UNLOCK(v1);
+		}
+		VOP_UNLOCK(d1);
+		if (v1) {
+			

CVS commit: src/sys/dev/usb

2011-07-17 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Jul 18 06:31:59 UTC 2011

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.575 -r1.576 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.576 -r1.577 src/sys/dev/usb/usbdevs_data.h

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

Modified files:

Index: src/sys/dev/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.575 src/sys/dev/usb/usbdevs.h:1.576
--- src/sys/dev/usb/usbdevs.h:1.575	Mon Jul 11 20:22:30 2011
+++ src/sys/dev/usb/usbdevs.h	Mon Jul 18 06:31:59 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.575 2011/07/11 20:22:30 matt Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.576 2011/07/18 06:31:59 jruoho Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.582 2011/07/11 20:21:59 matt Exp
+ *	NetBSD: usbdevs,v 1.583 2011/07/18 06:30:49 jruoho Exp
  */
 
 /*
@@ -1824,6 +1824,8 @@
 /* Micro Star International products */
 #define	USB_PRODUCT_MSI_BLUETOOTH	0x1967		/* Bluetooth USB Adapter */
 #define	USB_PRODUCT_MSI_RT3070	0x3820		/* RT3070 */
+#define	USB_PRODUCT_MSI_MEGASKY580	0x5580		/* MSI MegaSky DVB-T Adapter */
+#define	USB_PRODUCT_MSI_MEGASKY580_55801	0x5581		/* MSI MegaSky DVB-T Adapter */
 #define	USB_PRODUCT_MSI_MS6861	0x6861		/* MS-6861 */
 #define	USB_PRODUCT_MSI_MS6865	0x6865		/* MS-6865 */
 #define	USB_PRODUCT_MSI_MS6869	0x6869		/* MS-6869 */

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.576 src/sys/dev/usb/usbdevs_data.h:1.577
--- src/sys/dev/usb/usbdevs_data.h:1.576	Mon Jul 11 20:22:30 2011
+++ src/sys/dev/usb/usbdevs_data.h	Mon Jul 18 06:31:59 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.576 2011/07/11 20:22:30 matt Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.577 2011/07/18 06:31:59 jruoho Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.582 2011/07/11 20:21:59 matt Exp
+ *	NetBSD: usbdevs,v 1.583 2011/07/18 06:30:49 jruoho Exp
  */
 
 /*
@@ -5499,6 +5499,14 @@
 	"RT3070",
 	},
 	{
+	USB_VENDOR_MSI, USB_PRODUCT_MSI_MEGASKY580,
+	"MSI MegaSky DVB-T Adapter",
+	},
+	{
+	USB_VENDOR_MSI, USB_PRODUCT_MSI_MEGASKY580_55801,
+	"MSI MegaSky DVB-T Adapter",
+	},
+	{
 	USB_VENDOR_MSI, USB_PRODUCT_MSI_MS6861,
 	"MS-6861",
 	},
@@ -8431,4 +8439,4 @@
 	"Prestige",
 	},
 };
-const int usb_nproducts = 1604;
+const int usb_nproducts = 1606;



CVS commit: src/sys/dev/usb

2011-07-17 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Jul 18 06:30:49 UTC 2011

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
Add MSI MegaSky DVB-T dongle.


To generate a diff of this commit:
cvs rdiff -u -r1.582 -r1.583 src/sys/dev/usb/usbdevs

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

Modified files:

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.582 src/sys/dev/usb/usbdevs:1.583
--- src/sys/dev/usb/usbdevs:1.582	Mon Jul 11 20:21:59 2011
+++ src/sys/dev/usb/usbdevs	Mon Jul 18 06:30:49 2011
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.582 2011/07/11 20:21:59 matt Exp $
+$NetBSD: usbdevs,v 1.583 2011/07/18 06:30:49 jruoho Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -1817,6 +1817,8 @@
 /* Micro Star International products */
 product MSI BLUETOOTH		0x1967	Bluetooth USB Adapter
 product MSI RT3070		0x3820	RT3070
+product MSI MEGASKY580		0x5580	MSI MegaSky DVB-T Adapter
+product MSI MEGASKY580_55801	0x5581	MSI MegaSky DVB-T Adapter
 product MSI MS6861		0x6861	MS-6861
 product MSI MS6865		0x6865	MS-6865
 product MSI MS6869		0x6869	MS-6869



CVS commit: src/sys/dev/usb

2011-07-17 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Jul 18 05:57:40 UTC 2011

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

Log Message:
Use __arraycount(3).


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/usb/if_zyd.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/if_zyd.c
diff -u src/sys/dev/usb/if_zyd.c:1.28 src/sys/dev/usb/if_zyd.c:1.29
--- src/sys/dev/usb/if_zyd.c:1.28	Sun Jan 16 09:08:29 2011
+++ src/sys/dev/usb/if_zyd.c	Mon Jul 18 05:57:40 2011
@@ -1,5 +1,5 @@
 /*	$OpenBSD: if_zyd.c,v 1.52 2007/02/11 00:08:04 jsg Exp $	*/
-/*	$NetBSD: if_zyd.c,v 1.28 2011/01/16 09:08:29 tsutsui Exp $	*/
+/*	$NetBSD: if_zyd.c,v 1.29 2011/07/18 05:57:40 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 2006 by Damien Bergamini 
@@ -22,7 +22,7 @@
  * ZyDAS ZD1211/ZD1211B USB WLAN driver.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_zyd.c,v 1.28 2011/01/16 09:08:29 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_zyd.c,v 1.29 2011/07/18 05:57:40 jruoho Exp $");
 
 
 #include 
@@ -942,26 +942,25 @@
 Static int
 zyd_rfmd_init(struct zyd_rf *rf)
 {
-#define N(a)	(sizeof (a) / sizeof ((a)[0]))
 	struct zyd_softc *sc = rf->rf_sc;
 	static const struct zyd_phy_pair phyini[] = ZYD_RFMD_PHY;
 	static const uint32_t rfini[] = ZYD_RFMD_RF;
-	int i, error;
+	int error;
+	size_t i;
 
 	/* init RF-dependent PHY registers */
-	for (i = 0; i < N(phyini); i++) {
+	for (i = 0; i < __arraycount(phyini); i++) {
 		error = zyd_write16(sc, phyini[i].reg, phyini[i].val);
 		if (error != 0)
 			return error;
 	}
 
 	/* init RFMD radio */
-	for (i = 0; i < N(rfini); i++) {
+	for (i = 0; i < __arraycount(rfini); i++) {
 		if ((error = zyd_rfwrite(sc, rfini[i])) != 0)
 			return error;
 	}
 	return 0;
-#undef N
 }
 
 Static int
@@ -995,22 +994,22 @@
 Static int
 zyd_al2230_init(struct zyd_rf *rf)
 {
-#define N(a)	(sizeof (a) / sizeof ((a)[0]))
 	struct zyd_softc *sc = rf->rf_sc;
 	static const struct zyd_phy_pair phyini[] = ZYD_AL2230_PHY;
 	static const struct zyd_phy_pair phy2230s[] = ZYD_AL2230S_PHY_INIT;
 	static const uint32_t rfini[] = ZYD_AL2230_RF;
-	int i, error;
+	int error;
+	size_t i;
 
 	/* init RF-dependent PHY registers */
-	for (i = 0; i < N(phyini); i++) {
+	for (i = 0; i < __arraycount(phyini); i++) {
 		error = zyd_write16(sc, phyini[i].reg, phyini[i].val);
 		if (error != 0)
 			return error;
 	}
 
 	if (sc->rf_rev == ZYD_RF_AL2230S) {
-		for (i = 0; i < N(phy2230s); i++) {
+		for (i = 0; i < __arraycount(phy2230s); i++) {
 			error = zyd_write16(sc, phy2230s[i].reg,
 			phy2230s[i].val);
 			if (error != 0)
@@ -1019,37 +1018,35 @@
 	}
 
 	/* init AL2230 radio */
-	for (i = 0; i < N(rfini); i++) {
+	for (i = 0; i < __arraycount(rfini); i++) {
 		if ((error = zyd_rfwrite(sc, rfini[i])) != 0)
 			return error;
 	}
 	return 0;
-#undef N
 }
 
 Static int
 zyd_al2230_init_b(struct zyd_rf *rf)
 {
-#define N(a)	(sizeof (a) / sizeof ((a)[0]))
 	struct zyd_softc *sc = rf->rf_sc;
 	static const struct zyd_phy_pair phyini[] = ZYD_AL2230_PHY_B;
 	static const uint32_t rfini[] = ZYD_AL2230_RF_B;
-	int i, error;
+	int error;
+	size_t i;
 
 	/* init RF-dependent PHY registers */
-	for (i = 0; i < N(phyini); i++) {
+	for (i = 0; i < __arraycount(phyini); i++) {
 		error = zyd_write16(sc, phyini[i].reg, phyini[i].val);
 		if (error != 0)
 			return error;
 	}
 
 	/* init AL2230 radio */
-	for (i = 0; i < N(rfini); i++) {
+	for (i = 0; i < __arraycount(rfini); i++) {
 		if ((error = zyd_rfwrite(sc, rfini[i])) != 0)
 			return error;
 	}
 	return 0;
-#undef N
 }
 
 Static int
@@ -1088,48 +1085,47 @@
 Static int
 zyd_al7230B_init(struct zyd_rf *rf)
 {
-#define N(a)	(sizeof (a) / sizeof ((a)[0]))
 	struct zyd_softc *sc = rf->rf_sc;
 	static const struct zyd_phy_pair phyini_1[] = ZYD_AL7230B_PHY_1;
 	static const struct zyd_phy_pair phyini_2[] = ZYD_AL7230B_PHY_2;
 	static const struct zyd_phy_pair phyini_3[] = ZYD_AL7230B_PHY_3;
 	static const uint32_t rfini_1[] = ZYD_AL7230B_RF_1;
 	static const uint32_t rfini_2[] = ZYD_AL7230B_RF_2;
-	int i, error;
+	int error;
+	size_t i;
 
 	/* for AL7230B, PHY and RF need to be initialized in "phases" */
 
 	/* init RF-dependent PHY registers, part one */
-	for (i = 0; i < N(phyini_1); i++) {
+	for (i = 0; i < __arraycount(phyini_1); i++) {
 		error = zyd_write16(sc, phyini_1[i].reg, phyini_1[i].val);
 		if (error != 0)
 			return error;
 	}
 	/* init AL7230B radio, part one */
-	for (i = 0; i < N(rfini_1); i++) {
+	for (i = 0; i < __arraycount(rfini_1); i++) {
 		if ((error = zyd_rfwrite(sc, rfini_1[i])) != 0)
 			return error;
 	}
 	/* init RF-dependent PHY registers, part two */
-	for (i = 0; i < N(phyini_2); i++) {
+	for (i = 0; i < __arraycount(phyini_2); i++) {
 		error = zyd_write16(sc, phyini_2[i].reg, phyini_2[i].val);
 		if (error != 0)
 			return error;
 	}
 	/* init AL7230B radio, part two */
-	for (i = 0; i < N(rfini_2); i++) {
+	for (i = 0; i < __ar

CVS commit: src/lib/libc/stdio

2011-07-17 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Jul 18 05:17:16 UTC 2011

Modified Files:
src/lib/libc/stdio: fopen.3

Log Message:
Use a list for clarity, update standards, etc.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/lib/libc/stdio/fopen.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/libc/stdio/fopen.3
diff -u src/lib/libc/stdio/fopen.3:1.26 src/lib/libc/stdio/fopen.3:1.27
--- src/lib/libc/stdio/fopen.3:1.26	Mon Jun 27 08:21:07 2011
+++ src/lib/libc/stdio/fopen.3	Mon Jul 18 05:17:16 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fopen.3,v 1.26 2011/06/27 08:21:07 wiz Exp $
+.\"	$NetBSD: fopen.3,v 1.27 2011/07/18 05:17:16 jruoho Exp $
 .\"
 .\" Copyright (c) 1990, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -33,7 +33,7 @@
 .\"
 .\" @(#)fopen.3	8.1 (Berkeley) 6/4/93
 .\"
-.Dd June 24, 2011
+.Dd July 18, 2011
 .Dt FOPEN 3
 .Os
 .Sh NAME
@@ -82,6 +82,9 @@
 The file is created if it does not exist.
 .El
 .Pp
+Additionally:
+.Bl -bullet -offset 2n
+.It
 The
 .Fa mode
 string can also include the letter
@@ -94,17 +97,18 @@
 and has no effect; the
 .Dq b
 is ignored.
-.Pp
+.It
 The letter
 .Dq f
-in the mode string restricts fopen to regular
-files; if the file opened is not a regular file,
+in the mode string restricts
+.Fn fopen
+to regular files; if the file opened is not a regular file,
 .Fn fopen
 will fail.
 This is a non
 .St -ansiC
 extension.
-.Pp
+.It
 The letter
 .Dq e
 in the mode string sets the close-on-exec flag in the file descriptors of
@@ -114,6 +118,7 @@
 This is a non
 .St -ansiC
 extension.
+.El
 .Pp
 Any created files will have mode
 .Pf \*q Dv S_IRUSR
@@ -129,8 +134,8 @@
 .Dv S_IWOTH Ns \*q
 .Pq Li 0666 ,
 as modified by the process'
-umask value (see
-.Xr umask 2 ) .
+.Xr umask 2
+value.
 .Pp
 Opening a file with append mode causes all subsequent writes to it
 to be forced to the then current end of file, regardless of intervening
@@ -201,18 +206,14 @@
 .Va errno
 is set to indicate the error.
 .Sh ERRORS
+The functions may fail if:
 .Bl -tag -width Er
 .It Bq Er EFTYPE
 The file is not a regular file and the character ``f'' is specified
 in the mode.
 .It Bq Er EINVAL
-The
+The specified
 .Fa mode
-provided to
-.Fn fopen ,
-.Fn fdopen ,
-or
-.Fn freopen
 was invalid.
 .El
 .Pp
@@ -264,13 +265,10 @@
 .Fn fopen
 and
 .Fn freopen
-functions
-conform to
+functions conform to
 .St -ansiC .
-The
-.Fn fdopen
-function conforms to
-.St -p1003.1-90 .
+All three functions are specified in
+.St -p1003.1-2008 .
 .Sh CAVEATS
 Proper code using
 .Fn fdopen



CVS commit: src/share/man/man9

2011-07-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jul 18 04:39:28 UTC 2011

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

Log Message:
typo


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/share/man/man9/vnodeops.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/vnodeops.9
diff -u src/share/man/man9/vnodeops.9:1.82 src/share/man/man9/vnodeops.9:1.83
--- src/share/man/man9/vnodeops.9:1.82	Mon Jul 11 08:27:37 2011
+++ src/share/man/man9/vnodeops.9	Mon Jul 18 04:39:28 2011
@@ -1,4 +1,4 @@
-.\" $NetBSD: vnodeops.9,v 1.82 2011/07/11 08:27:37 hannken Exp $
+.\" $NetBSD: vnodeops.9,v 1.83 2011/07/18 04:39:28 dholland Exp $
 .\"
 .\" Copyright (c) 2001, 2005, 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -844,7 +844,7 @@
 The argument
 .Fa tcnp
 is the pathname component about the file's new name.
-If the operation is successful zero is returned, otherwise and error
+If the operation is successful zero is returned, otherwise an error
 code is returned.
 .Pp
 The source directory and file vnodes should be unlocked and their



CVS commit: src/tests/lib/libc/sys

2011-07-17 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Mon Jul 18 04:29:37 UTC 2011

Modified Files:
src/tests/lib/libc/sys: t_dup.c

Log Message:
Verify that dup2(2) and dup3(2) fail with EBADF if the "new descriptor" is
specified to be larger than RLIMIT_NOFILE.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/sys/t_dup.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_dup.c
diff -u src/tests/lib/libc/sys/t_dup.c:1.4 src/tests/lib/libc/sys/t_dup.c:1.5
--- src/tests/lib/libc/sys/t_dup.c:1.4	Sat Jul 16 14:29:15 2011
+++ src/tests/lib/libc/sys/t_dup.c	Mon Jul 18 04:29:37 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: t_dup.c,v 1.4 2011/07/16 14:29:15 jruoho Exp $ */
+/* $NetBSD: t_dup.c,v 1.5 2011/07/18 04:29:37 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_dup.c,v 1.4 2011/07/16 14:29:15 jruoho Exp $");
+__RCSID("$NetBSD: t_dup.c,v 1.5 2011/07/18 04:29:37 jruoho Exp $");
 
 #include 
 #include 
@@ -158,6 +158,23 @@
 	(void)close(fd);
 }
 
+ATF_TC(dup2_max);
+ATF_TC_HEAD(dup2_max, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Test dup2(2) against limits");
+}
+
+ATF_TC_BODY(dup2_max, tc)
+{
+	struct rlimit res;
+
+	(void)memset(&res, 0, sizeof(struct rlimit));
+	(void)getrlimit(RLIMIT_NOFILE, &res);
+
+	errno = 0;
+	ATF_REQUIRE_ERRNO(EBADF, dup2(STDERR_FILENO, res.rlim_cur + 1) == -1);
+}
+
 ATF_TC_WITH_CLEANUP(dup2_mode);
 ATF_TC_HEAD(dup2_mode, tc)
 {
@@ -209,6 +226,24 @@
 	(void)close(fd);
 }
 
+ATF_TC(dup3_max);
+ATF_TC_HEAD(dup3_max, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Test dup3(2) against limits");
+}
+
+ATF_TC_BODY(dup3_max, tc)
+{
+	struct rlimit res;
+
+	(void)memset(&res, 0, sizeof(struct rlimit));
+	(void)getrlimit(RLIMIT_NOFILE, &res);
+
+	errno = 0;
+	ATF_REQUIRE_ERRNO(EBADF, dup3(STDERR_FILENO,
+		res.rlim_cur + 1, O_CLOEXEC) == -1);
+}
+
 ATF_TC_WITH_CLEANUP(dup3_mode);
 ATF_TC_HEAD(dup3_mode, tc)
 {
@@ -341,8 +376,10 @@
 
 	ATF_TP_ADD_TC(tp, dup2_basic);
 	ATF_TP_ADD_TC(tp, dup2_err);
+	ATF_TP_ADD_TC(tp, dup2_max);
 	ATF_TP_ADD_TC(tp, dup2_mode);
 	ATF_TP_ADD_TC(tp, dup3_err);
+	ATF_TP_ADD_TC(tp, dup3_max);
 	ATF_TP_ADD_TC(tp, dup3_mode);
 	ATF_TP_ADD_TC(tp, dup_err);
 	ATF_TP_ADD_TC(tp, dup_max);



CVS commit: src/external/cddl/osnet/dist/uts/common/dtrace

2011-07-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 18 02:47:52 UTC 2011

Modified Files:
src/external/cddl/osnet/dist/uts/common/dtrace: dtrace.c

Log Message:
better fix for gcc uninitialized.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c

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

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c
diff -u src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c:1.13 src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c:1.14
--- src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c:1.13	Sun Jul 17 20:43:35 2011
+++ src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c	Sun Jul 17 22:47:52 2011
@@ -6939,8 +6939,12 @@
 #if defined(sun)
 	if (cr == NULL || PRIV_POLICY_ONLY(cr, PRIV_ALL, B_FALSE)) {
 		/*
-		 * For DTRACE_PRIV_ALL, the uid and zoneid don't matter.
+		 * For DTRACE_PRIV_ALL, the uid and zoneid don't matter,
+		 * but for GCC they do.
 		 */
+		*uidp = 0;
+		*zoneidp = 0;
+
 		priv = DTRACE_PRIV_ALL;
 	} else {
 		*uidp = crgetuid(cr);
@@ -6960,6 +6964,8 @@
 	}
 #else
 	priv = DTRACE_PRIV_ALL;
+	*uidp = 0;
+	*zoneidp = 0;
 #endif
 
 	*privp = priv;
@@ -8092,8 +8098,8 @@
 {
 	dtrace_probekey_t pkey;
 	uint32_t priv;
-	uid_t uid = 0;	/* XXX: gcc */
-	zoneid_t zoneid = 0;	/* XXX: gcc */
+	uid_t uid;
+	zoneid_t zoneid;
 
 	ASSERT(MUTEX_HELD(&dtrace_lock));
 	dtrace_ecb_create_cache = NULL;



CVS commit: src/sys/ufs/ufs

2011-07-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jul 18 02:35:11 UTC 2011

Modified Files:
src/sys/ufs/ufs: ufs_vnops.c

Log Message:
ok, it is clear that at least vput(vp) needs to go before fstrans_done().
I hoping vput(dvp) doesn't, because if it does that will vastly complicate
future vfs locking cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.197 -r1.198 src/sys/ufs/ufs/ufs_vnops.c

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

Modified files:

Index: src/sys/ufs/ufs/ufs_vnops.c
diff -u src/sys/ufs/ufs/ufs_vnops.c:1.197 src/sys/ufs/ufs/ufs_vnops.c:1.198
--- src/sys/ufs/ufs/ufs_vnops.c:1.197	Mon Jul 18 01:52:55 2011
+++ src/sys/ufs/ufs/ufs_vnops.c	Mon Jul 18 02:35:11 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_vnops.c,v 1.197 2011/07/18 01:52:55 dholland Exp $	*/
+/*	$NetBSD: ufs_vnops.c,v 1.198 2011/07/18 02:35:11 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.197 2011/07/18 01:52:55 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.198 2011/07/18 02:35:11 dholland Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1763,9 +1763,9 @@
 #endif
  out:
 	VN_KNOTE(vp, NOTE_DELETE);
+	vput(vp);
 	fstrans_done(dvp->v_mount);
 	vput(dvp);
-	vput(vp);
 	return (error);
 }
 



CVS commit: src/lib/libperfuse

2011-07-17 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Mon Jul 18 02:14:01 UTC 2011

Modified Files:
src/lib/libperfuse: ops.c

Log Message:
ftruncate(2) cause a SETATTR with only va_size set, and some filesystems
(e.g.: glusterfs) will do a custom handling in such a situation. This
breaks because libpuffs folds a metadata (va_atime and va_mtime) update
in each SETATTR. We try to identify SETATTR caused by ftruncate(2) and
remove va_atime and va_mtime in such situation.

This fixes a bug with glusterfs, where parts of a file downloaded by
FTP was filled with zeros because of a ftruncate(2) sent out of order
with write(2) requests. glusterfs behavior depends on the undocumented
FUSE rule that ftruncate(2) will only set va_size in SETATTR.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/lib/libperfuse/ops.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/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.33 src/lib/libperfuse/ops.c:1.34
--- src/lib/libperfuse/ops.c:1.33	Thu Jul 14 15:37:32 2011
+++ src/lib/libperfuse/ops.c	Mon Jul 18 02:14:01 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.33 2011/07/14 15:37:32 manu Exp $ */
+/*  $NetBSD: ops.c,v 1.34 2011/07/18 02:14:01 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -1652,6 +1652,27 @@
 	}
 
 	/*
+	 * ftruncate() sends only va_size, and metadata cache
+	 * flush adds va_atime and va_mtime. Some FUSE
+	 * filesystems will attempt to detect ftruncate by 
+	 * checking for FATTR_SIZE being set without
+	 * FATTR_UID|FATTR_GID|FATTR_ATIME|FATTR_MTIME|FATTR_MODE
+	 * 
+	 * Try to adapt and remove FATTR_ATIME|FATTR_MTIME
+	 * if we suspect a ftruncate().
+	 */ 
+	if ((va_size != (u_quad_t)PUFFS_VNOVAL) &&
+	((vap->va_mode == (mode_t)PUFFS_VNOVAL) &&
+	 (vap->va_uid == (uid_t)PUFFS_VNOVAL) &&
+	 (vap->va_gid == (gid_t)PUFFS_VNOVAL))) {
+		fsi->atime = 0;
+		fsi->atimensec = 0;
+		fsi->mtime = 0;
+		fsi->mtimensec = 0;
+		fsi->valid &= ~(FUSE_FATTR_ATIME|FUSE_FATTR_MTIME);
+	}
+		
+	/*
 	 * If nothing remain, discard the operation.
 	 */
 	if (!(fsi->valid & (FUSE_FATTR_SIZE|FUSE_FATTR_ATIME|FUSE_FATTR_MTIME|



CVS commit: src/sys/ufs/ufs

2011-07-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jul 18 01:52:55 UTC 2011

Modified Files:
src/sys/ufs/ufs: ufs_vnops.c

Log Message:
Add the long essay on rename locking from my earlier patch set as a
big comment, and expand it some for clarity.


To generate a diff of this commit:
cvs rdiff -u -r1.196 -r1.197 src/sys/ufs/ufs/ufs_vnops.c

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

Modified files:

Index: src/sys/ufs/ufs/ufs_vnops.c
diff -u src/sys/ufs/ufs/ufs_vnops.c:1.196 src/sys/ufs/ufs/ufs_vnops.c:1.197
--- src/sys/ufs/ufs/ufs_vnops.c:1.196	Mon Jul 18 01:13:33 2011
+++ src/sys/ufs/ufs/ufs_vnops.c	Mon Jul 18 01:52:55 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_vnops.c,v 1.196 2011/07/18 01:13:33 dholland Exp $	*/
+/*	$NetBSD: ufs_vnops.c,v 1.197 2011/07/18 01:52:55 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.196 2011/07/18 01:13:33 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.197 2011/07/18 01:52:55 dholland Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -972,6 +972,137 @@
  *is different from the source, patch the ".." entry in the
  *directory.
  */
+
+/*
+ * Notes on rename locking:
+ *
+ * We lock parent vnodes before child vnodes. This means in particular
+ * that if A is above B in the directory tree then A must be locked
+ * before B. (This is true regardless of how many steps appear in
+ * between, because an arbitrary number of other processes could lock
+ * parent/child in between and establish a lock cycle and deadlock.)
+ *
+ * Therefore, if tdvp is above fdvp we must lock tdvp first; if fdvp
+ * is above tdvp we must lock fdvp first; and if they're
+ * incommensurate it doesn't matter. (But, we rely on the fact that
+ * there's a whole-volume rename lock to prevent deadlock among groups
+ * of renames upon overlapping sets of incommensurate vnodes.)
+ *
+ * In addition to establishing lock ordering the parent check also
+ * serves to rule out cases where someone tries to move a directory
+ * underneath itself, e.g. rename("a/b", "a/b/c"). If allowed to
+ * proceed such renames would detach portions of the directory tree
+ * and make fsck very unhappy.
+ *
+ * Note that it is an error for *fvp* to be above tdvp; however,
+ * *fdvp* can be above tdvp, as in rename("a/b", "a/c/d").
+ *
+ * The parent check searches up the tree from tdvp until it either
+ * finds fdvp or the root of the volume. It also returns the vnode it
+ * saw immediately before fdvp, if any. Later on (after looking up
+ * fvp) we will check to see if this *is* fvp and if so fail.
+ *
+ * If the parent check finds fdvp, it means fdvp is above tdvp, so we
+ * lock fdvp first and then tdvp. Otherwise, either tdvp is above fdvp
+ * or they're incommensurate and we lock tdvp first.
+ *
+ * In either case each of the child vnodes has to be looked up and
+ * locked immediately after its parent. The cases
+ *
+ *   fdvp/fvp/[.../]tdvp/tvp
+ *   tdvp/tvp/[.../]fdvp/fvp
+ *
+ * can cause deadlock otherwise. Note that both of these are error
+ * cases; the first fails the parent check and the second fails
+ * because tvp isn't empty. The parent check case is handled before
+ * we start locking; however, the nonempty case requires locking tvp
+ * to find out safely that it's nonempty.
+ *
+ * Therefore the procedure is either
+ *
+ *   lock fdvp
+ *   lookup fvp
+ *   lock fvp
+ *   lock tdvp
+ *   lookup tvp
+ *   lock tvp
+ *
+ * or
+ *
+ *   lock tdvp
+ *   lookup tvp
+ *   lock tvp
+ *   lock fdvp
+ *   lookup fvp
+ *   lock fvp
+ *
+ * This could in principle be simplified by always looking up fvp
+ * last; because of the parent check we know by the time we start
+ * locking that fvp cannot be directly above tdvp, so (given the
+ * whole-volume rename lock and other assumptions) it's safe to lock
+ * tdvp before fvp. This would allow the following scheme:
+ *
+ *   lock fdvp
+ *   lock tdvp
+ * or
+ *   lock tdvp
+ *   lock fdvp
+ *
+ * then
+ *   lookup tvp
+ *   lock tvp
+ *   lookup fvp
+ *   check if fvp is above of tdvp, fail if so
+ *   lock fvp
+ *
+ * which is much, much simpler.
+ *
+ * However, current levels of vfs namei/lookup sanity do not permit
+ * this. It is impossible currently to look up fvp without locking it.
+ * (It gets locked regardless of whether LOCKLEAF is set; without
+ * LOCKLEAF it just gets unlocked again, which doesn't help.)
+ *
+ * Therefore, because we must look up fvp to know if it's above tdvp,
+ * which locks fvp, we must, at least in the case where fdvp is above
+ * tdvp, do that before locking tdvp. The longer scheme does that; the
+ * simpler scheme is not safe.
+ *
+ * Note that for now we aren't doing lookup() but relookup(); however,
+ * the differences are minor.
+ *
+ * On top of all the above, just to make everything more
+ * exciting, any

CVS commit: src/sys/ufs/ufs

2011-07-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jul 18 01:14:27 UTC 2011

Modified Files:
src/sys/ufs/ufs: ufs_wapbl.c

Log Message:
More rename tidying.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/ufs/ufs/ufs_wapbl.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/ufs/ufs/ufs_wapbl.c
diff -u src/sys/ufs/ufs/ufs_wapbl.c:1.19 src/sys/ufs/ufs/ufs_wapbl.c:1.20
--- src/sys/ufs/ufs/ufs_wapbl.c:1.19	Mon Jul 18 01:14:04 2011
+++ src/sys/ufs/ufs/ufs_wapbl.c	Mon Jul 18 01:14:27 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: ufs_wapbl.c,v 1.19 2011/07/18 01:14:04 dholland Exp $ */
+/*  $NetBSD: ufs_wapbl.c,v 1.20 2011/07/18 01:14:27 dholland Exp $ */
 
 /*-
  * Copyright (c) 2003,2006,2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ufs_wapbl.c,v 1.19 2011/07/18 01:14:04 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_wapbl.c,v 1.20 2011/07/18 01:14:27 dholland Exp $");
 
 #include 
 #include 
@@ -371,18 +371,7 @@
 	 */
 	if (fdvp->v_mount != tdvp->v_mount) {
 		error = EXDEV;
- abortit:
-		VOP_ABORTOP(fdvp, fcnp); /* XXX, why not in NFS? */
-		VOP_ABORTOP(tdvp, tcnp); /* XXX, why not in NFS? */
-		vrele(tdvp);
-		if (tvp) {
-			vrele(tvp);
-		}
-		vrele(fdvp);
-		if (fvp) {
-			vrele(fvp);
-		}
-		return (error);
+		goto abort;
 	}
 
 	/*
@@ -392,7 +381,7 @@
 	(fcnp->cn_namelen == 1 && fcnp->cn_nameptr[0] == '.') ||
 	(tcnp->cn_namelen == 1 && tcnp->cn_nameptr[0] == '.')) {
 		error = EINVAL;
-		goto abortit;
+		goto abort;
 	}
 	
 	/*
@@ -411,7 +400,7 @@
 			/* directory has been rmdir'd */
 			VOP_UNLOCK(fdvp);
 			error = ENOENT;
-			goto abortit;
+			goto abort;
 		}
 
 		error = do_relookup(fdvp, &from_ulr, &fvp, fcnp);
@@ -421,7 +410,7 @@
 		}
 		if (error) {
 			VOP_UNLOCK(fdvp);
-			goto abortit;
+			goto abort;
 		}
 
 		/*
@@ -443,7 +432,7 @@
 		error = do_relookup(tdvp, &to_ulr, &tvp, tcnp);
 		if (error && error != ENOENT) {
 			VOP_UNLOCK(fdvp);
-			goto abortit;
+			goto abort;
 		}
 		if (error == ENOENT) {
 			/*
@@ -483,7 +472,7 @@
 		error = ufs_parentcheck(fdvp, tdvp, fcnp->cn_cred,
 	&found_fdvp, &illegal_fvp);
 		if (error) {
-			goto abortit;
+			goto abort;
 		}
 
 		/* Must lock in tree order. */
@@ -507,23 +496,14 @@
 			if (illegal_fvp) {
 vrele(illegal_fvp);
 			}
-			goto abortit;
+			goto abort;
 		}
 		KASSERT(fvp != NULL);
 
 		if (illegal_fvp && fvp == illegal_fvp) {
 			vrele(illegal_fvp);
 			error = EINVAL;
-		abort_withlocks:
-			VOP_UNLOCK(fdvp);
-			if (tdvp != fdvp) {
-VOP_UNLOCK(tdvp);
-			}
-			VOP_UNLOCK(fvp);
-			if (tvp && tvp != fvp) {
-VOP_UNLOCK(tvp);
-			}
-			goto abortit;
+			goto abort_withlocks;
 		}
 
 		if (illegal_fvp) {
@@ -620,26 +600,22 @@
 	mp = fdvp->v_mount;
 	fstrans_start(mp, FSTRANS_SHARED);
 
+	if (oldparent != tdp->i_number)
+		newparent = tdp->i_number;
+
 	/*
 	 * If ".." must be changed (ie the directory gets a new
 	 * parent) the user must have write permission in the source
 	 * so as to be able to change "..".
 	 */
-	error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred);
-
-	if (oldparent != tdp->i_number)
-		newparent = tdp->i_number;
 	if (doingdirectory && newparent) {
-		if (error)	/* write access check above */
+		error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred);
+		if (error)
 			goto out;
 	}
 
-	/*
-	 * This was moved up to before the journal lock to
-	 * avoid potential deadlock
-	 */
-	fcnp->cn_flags &= ~(MODMASK);
-	fcnp->cn_flags |= LOCKPARENT | LOCKLEAF;
+	KASSERT(fdvp != tvp);
+
 	if (newparent) {
 		/* Check for the rename("foo/foo", "foo") case. */
 		if (fdvp == tvp) {
@@ -974,6 +950,29 @@
 
 	fstrans_done(mp);
 	return (error);
+
+ abort_withlocks:
+	VOP_UNLOCK(fdvp);
+	if (tdvp != fdvp) {
+		VOP_UNLOCK(tdvp);
+	}
+	VOP_UNLOCK(fvp);
+	if (tvp && tvp != fvp) {
+		VOP_UNLOCK(tvp);
+	}
+
+ abort:
+	VOP_ABORTOP(fdvp, fcnp); /* XXX, why not in NFS? */
+	VOP_ABORTOP(tdvp, tcnp); /* XXX, why not in NFS? */
+	vrele(tdvp);
+	if (tvp) {
+		vrele(tvp);
+	}
+	vrele(fdvp);
+	if (fvp) {
+		vrele(fvp);
+	}
+	return (error);
 }
 
 #ifdef WAPBL_DEBUG_INODES



CVS commit: src/sys/ufs/ufs

2011-07-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jul 18 01:14:04 UTC 2011

Modified Files:
src/sys/ufs/ufs: ufs_wapbl.c

Log Message:
In ufs_wapbl_rename, remove #if 0 blocks and remove code for
now-impossible cases.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/ufs/ufs/ufs_wapbl.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/ufs/ufs/ufs_wapbl.c
diff -u src/sys/ufs/ufs/ufs_wapbl.c:1.18 src/sys/ufs/ufs/ufs_wapbl.c:1.19
--- src/sys/ufs/ufs/ufs_wapbl.c:1.18	Sun Jul 17 22:14:47 2011
+++ src/sys/ufs/ufs/ufs_wapbl.c	Mon Jul 18 01:14:04 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: ufs_wapbl.c,v 1.18 2011/07/17 22:14:47 dholland Exp $ */
+/*  $NetBSD: ufs_wapbl.c,v 1.19 2011/07/18 01:14:04 dholland Exp $ */
 
 /*-
  * Copyright (c) 2003,2006,2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ufs_wapbl.c,v 1.18 2011/07/17 22:14:47 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_wapbl.c,v 1.19 2011/07/18 01:14:04 dholland Exp $");
 
 #include 
 #include 
@@ -466,11 +466,28 @@
 		int found_fdvp;
 		struct vnode *illegal_fvp;
 
+		/*
+		 * The source must not be above the destination. (If
+		 * it were, the rename would detach a section of the
+		 * tree.)
+		 *
+		 * Look up the tree from tdvp to see if we find fdvp,
+		 * and if so, return the immediate child of fdvp we're
+		 * under; that must not turn out to be the same as
+		 * fvp.
+		 *
+		 * The per-volume rename lock guarantees that the
+		 * result of this check remains true until we finish
+		 * looking up and locking.
+		 */
 		error = ufs_parentcheck(fdvp, tdvp, fcnp->cn_cred,
 	&found_fdvp, &illegal_fvp);
 		if (error) {
 			goto abortit;
 		}
+
+		/* Must lock in tree order. */
+
 		if (found_fdvp) {
 			/* fdvp -> fvp -> tdvp -> tvp */
 			error = lock_vnode_sequence(fdvp, &from_ulr,
@@ -562,10 +579,6 @@
 		}
 		return (VOP_REMOVE(fdvp, fvp, fcnp));
 	}
-#if 0
-	if ((error = vn_lock(fvp, LK_EXCLUSIVE)) != 0)
-		goto abortit;
-#endif
 	fdp = VTOI(fdvp);
 	ip = VTOI(fvp);
 	if ((nlink_t) ip->i_nlink >= LINK_MAX) {
@@ -607,61 +620,20 @@
 	mp = fdvp->v_mount;
 	fstrans_start(mp, FSTRANS_SHARED);
 
-#if 0
 	/*
 	 * If ".." must be changed (ie the directory gets a new
-	 * parent) then the source directory must not be in the
-	 * directory hierarchy above the target, as this would
-	 * orphan everything below the source directory. Also
-	 * the user must have write permission in the source so
-	 * as to be able to change "..". We must repeat the call 
-	 * to namei, as the parent directory is unlocked by the
-	 * call to checkpath().
+	 * parent) the user must have write permission in the source
+	 * so as to be able to change "..".
 	 */
-#endif
 	error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred);
-#if 0
-	VOP_UNLOCK(fvp);
-#endif
+
 	if (oldparent != tdp->i_number)
 		newparent = tdp->i_number;
 	if (doingdirectory && newparent) {
 		if (error)	/* write access check above */
 			goto out;
-#if 0
-		if (txp != NULL)
-			vput(tvp);
-		txp = NULL;
-		vref(tdvp);	/* compensate for the ref checkpath loses */
-		if ((error = ufs_checkpath(ip, tdp, tcnp->cn_cred)) != 0) {
-			vrele(tdvp);
-			tdp = NULL;
-			goto out;
-		}
-		tdp = NULL;
-		vn_lock(tdvp, LK_EXCLUSIVE | LK_RETRY);
-		error = relookup(tdvp, &tvp, tcnp, 0);
-		if (error != 0) {
-			vput(tdvp);
-			goto out;
-		}
-		tdp = VTOI(tdvp);
-
-		/* update the supplemental reasults */
-		to_ulr = tdp->i_crap;
-		UFS_CHECK_CRAPCOUNTER(tdp);
-		if (tvp)
-			txp = VTOI(tvp);
-#endif
 	}
 
-#if 0
-	/*
-	 * XXX handle case where fdvp is parent of tdvp,
-	 * by unlocking tdvp and regrabbing it with vget after?
-	 */
-#endif
-
 	/*
 	 * This was moved up to before the journal lock to
 	 * avoid potential deadlock
@@ -674,53 +646,10 @@
 			error = doingdirectory ? ENOTEMPTY : EISDIR;
 			goto out;
 		}
-#if 0
-		vn_lock(fdvp, LK_EXCLUSIVE | LK_RETRY);
-		if ((error = relookup(fdvp, &fvp, fcnp, 0))) {
-			vput(fdvp);
-			vrele(ap->a_fvp);
-			goto out2;
-		}
-
-		/* update supplemental lookup results */
-		from_ulr = VTOI(fdvp)->i_crap;
-		UFS_CHECK_CRAPCOUNTER(VTOI(fdvp));
-	} else {
-		error = VOP_LOOKUP(fdvp, &fvp, fcnp);
-		if (error && (error != EJUSTRETURN)) {
-			vput(fdvp);
-			vrele(ap->a_fvp);
-			goto out2;
-		}
-		error = 0;
-
-		/* update supplemental lookup results */
-		from_ulr = VTOI(fdvp)->i_crap;
-		UFS_CHECK_CRAPCOUNTER(VTOI(fdvp));
-#endif
 	}
-	if (fvp != NULL) {
-		fxp = VTOI(fvp);
-		fdp = VTOI(fdvp);
-	} else {
-		/*
-		 * From name has disappeared.
-		 */
-		if (doingdirectory)
-			panic("rename: lost dir entry");
-#if 0
-		vrele(ap->a_fvp);
-#endif
-		error = ENOENT;	/* XXX ufs_rename sets "0" here */
-		goto out2;
-	}
-#if 0
-	/*
-	 * XXX: if fvp != a_fvp, a_fvp can now have 0 references and yet we
-	 * access a_fvp->inode via ip later.  boom.
-	 */
-	vrele(ap->a_fvp);
-#endif
+
+	fxp = VTOI(fvp);
+	f

CVS commit: src/sys/ufs/ufs

2011-07-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Jul 18 01:13:33 UTC 2011

Modified Files:
src/sys/ufs/ufs: ufs_vnops.c

Log Message:
Fix error path for UFS_WAPBL_BEGIN failure to avoid leaking an vnode
(in memory) and inode (on disk). Caution: untested; I have no idea how
to provoke such a failure.


To generate a diff of this commit:
cvs rdiff -u -r1.195 -r1.196 src/sys/ufs/ufs/ufs_vnops.c

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

Modified files:

Index: src/sys/ufs/ufs/ufs_vnops.c
diff -u src/sys/ufs/ufs/ufs_vnops.c:1.195 src/sys/ufs/ufs/ufs_vnops.c:1.196
--- src/sys/ufs/ufs/ufs_vnops.c:1.195	Sun Jul 17 22:02:26 2011
+++ src/sys/ufs/ufs/ufs_vnops.c	Mon Jul 18 01:13:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_vnops.c,v 1.195 2011/07/17 22:02:26 dholland Exp $	*/
+/*	$NetBSD: ufs_vnops.c,v 1.196 2011/07/18 01:13:33 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.195 2011/07/17 22:02:26 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.196 2011/07/18 01:13:33 dholland Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1412,11 +1412,16 @@
 	 */
 	if ((error = UFS_VALLOC(dvp, dmode, cnp->cn_cred, ap->a_vpp)) != 0)
 		goto out;
-	error = UFS_WAPBL_BEGIN(ap->a_dvp->v_mount);
-	if (error)
-		goto out;
+
 	tvp = *ap->a_vpp;
 	ip = VTOI(tvp);
+
+	error = UFS_WAPBL_BEGIN(ap->a_dvp->v_mount);
+	if (error) {
+		UFS_VFREE(tvp, ip->i_number, dmode);
+		vput(tvp);
+		goto out;
+	}
 	ip->i_uid = kauth_cred_geteuid(cnp->cn_cred);
 	DIP_ASSIGN(ip, uid, ip->i_uid);
 	ip->i_gid = dp->i_gid;



CVS commit: src/sys/dev

2011-07-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jul 18 00:58:52 UTC 2011

Modified Files:
src/sys/dev/ic: cd18xxvar.h midway.c midwayvar.h
src/sys/dev/pci: if_en_pci.c
src/sys/dev/sbus: if_en.c qe.c sio16.c spif.c spifvar.h stp4020.c
xbox.c

Log Message:
convert the remaining dev/sbus drivers to CFATTACH_DECL_NEW, cfdata_t
and device_t, including the pci frontend and backend for en(4).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/cd18xxvar.h
cvs rdiff -u -r1.92 -r1.93 src/sys/dev/ic/midway.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/ic/midwayvar.h
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/if_en_pci.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/sbus/if_en.c
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/sbus/qe.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/sbus/sio16.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/sbus/spif.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/sbus/spifvar.h
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/sbus/stp4020.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/sbus/xbox.c

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

Modified files:

Index: src/sys/dev/ic/cd18xxvar.h
diff -u src/sys/dev/ic/cd18xxvar.h:1.2 src/sys/dev/ic/cd18xxvar.h:1.3
--- src/sys/dev/ic/cd18xxvar.h:1.2	Thu May 29 14:51:27 2008
+++ src/sys/dev/ic/cd18xxvar.h	Mon Jul 18 00:58:51 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd18xxvar.h,v 1.2 2008/05/29 14:51:27 mrg Exp $	*/
+/*	$NetBSD: cd18xxvar.h,v 1.3 2011/07/18 00:58:51 mrg Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -97,8 +97,6 @@
 
 /* softc allocated per-cd18xx */
 struct cd18xx_softc {
-	struct device		sc_dev;
-
 	/* tag and handle for our registers (128 bytes) */
 	bus_space_tag_t		sc_tag;
 	bus_space_handle_t	sc_handle;

Index: src/sys/dev/ic/midway.c
diff -u src/sys/dev/ic/midway.c:1.92 src/sys/dev/ic/midway.c:1.93
--- src/sys/dev/ic/midway.c:1.92	Tue Feb  1 19:50:03 2011
+++ src/sys/dev/ic/midway.c	Mon Jul 18 00:58:51 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: midway.c,v 1.92 2011/02/01 19:50:03 chuck Exp $	*/
+/*	$NetBSD: midway.c,v 1.93 2011/07/18 00:58:51 mrg Exp $	*/
 /*	(sync'd to midway.c 1.68)	*/
 
 /*
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.92 2011/02/01 19:50:03 chuck Exp $");
+__KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.93 2011/07/18 00:58:51 mrg Exp $");
 
 #include "opt_natm.h"
 
@@ -728,7 +728,7 @@
 
   reg = EN_READ(sc, MID_RESID);
 
-  aprint_normal_dev(&sc->sc_dev, 
+  aprint_normal_dev(sc->sc_dev, 
   "ATM midway v%d, board IDs %d.%d, %s%s%s, %ldKB on-board RAM\n",
 	MID_VER(reg), MID_MID(reg), MID_DID(reg),
 	(MID_IS_SABRE(reg)) ? "sabre controller, " : "",
@@ -738,19 +738,19 @@
 
   if (sc->is_adaptec) {
 if (sc->bestburstlen == 64 && sc->alburst == 0)
-  aprint_normal_dev(&sc->sc_dev, "passed 64 byte DMA test\n");
+  aprint_normal_dev(sc->sc_dev, "passed 64 byte DMA test\n");
 else
-  aprint_error_dev(&sc->sc_dev, "FAILED DMA TEST: burst=%d, alburst=%d\n",
+  aprint_error_dev(sc->sc_dev, "FAILED DMA TEST: burst=%d, alburst=%d\n",
 	sc->bestburstlen, sc->alburst);
   } else {
-aprint_normal_dev(&sc->sc_dev, "maximum DMA burst length = %d bytes%s\n",
+aprint_normal_dev(sc->sc_dev, "maximum DMA burst length = %d bytes%s\n",
 	  sc->bestburstlen, (sc->alburst) ? " (must align)" : "");
   }
 
 #if 0		/* WMAYBE doesn't work, don't complain about it */
   /* check if en_dmaprobe disabled wmaybe */
   if (en_dmaplan == en_dma_planB)
-aprint_normal_dev(&sc->sc_dev, "note: WMAYBE DMA has been disabled\n");
+aprint_normal_dev(sc->sc_dev, "note: WMAYBE DMA has been disabled\n");
 #endif
 
   /*
@@ -758,7 +758,7 @@
*/
 
 #if defined(__NetBSD__) || defined(__OpenBSD__)
-  strlcpy(sc->enif.if_xname, device_xname(&sc->sc_dev), IFNAMSIZ);
+  strlcpy(sc->enif.if_xname, device_xname(sc->sc_dev), IFNAMSIZ);
 #endif
 #if !defined(MISSING_IF_SOFTC)
   sc->enif.if_softc = sc;
@@ -784,7 +784,7 @@
   ptr = roundup(ptr, EN_TXSZ * 1024);	/* align */
   sz = sz - (ptr - sav);
   if (EN_TXSZ*1024 * EN_NTX > sz) {
-aprint_error_dev(&sc->sc_dev, "EN_NTX/EN_TXSZ too big\n");
+aprint_error_dev(sc->sc_dev, "EN_NTX/EN_TXSZ too big\n");
 return;
   }
   for (lcv = 0 ; lcv < EN_NTX ; lcv++) {
@@ -800,7 +800,7 @@
 memset(&sc->txslot[lcv].indma, 0, sizeof(sc->txslot[lcv].indma));
 memset(&sc->txslot[lcv].q, 0, sizeof(sc->txslot[lcv].q));
 #ifdef EN_DEBUG
-aprint_debug_dev(&sc->sc_dev, "tx%d: start 0x%x, stop 0x%x\n", lcv,
+aprint_debug_dev(sc->sc_dev, "tx%d: start 0x%x, stop 0x%x\n", lcv,
 		sc->txslot[lcv].start, sc->txslot[lcv].stop);
 #endif
   }
@@ -810,7 +810,7 @@
   sz = sz - (ptr - sav);
   sc->en_nrx = sz / (EN_RXSZ * 1024);
   if (sc->en_nrx <= 0) {
-aprint_error_dev(&sc->sc_dev, "EN_NTX/EN_TXSZ/EN_RXSZ too big\n");
+aprint_error_dev(sc->sc_dev, "EN_NTX/EN_TXSZ/EN_RXSZ too big\n");
 return;
   }
 
@@ -838,7 +838,7 @@
 	(en_k2sz(EN_RXSZ) << 

CVS commit: src/external/cddl/osnet/dist/uts/common/dtrace

2011-07-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 18 00:43:35 UTC 2011

Modified Files:
src/external/cddl/osnet/dist/uts/common/dtrace: dtrace.c

Log Message:
fix gcc uninitialized warnings


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c

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

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c
diff -u src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c:1.12 src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c:1.13
--- src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c:1.12	Sun Aug 22 14:01:01 2010
+++ src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c	Sun Jul 17 20:43:35 2011
@@ -8092,8 +8092,8 @@
 {
 	dtrace_probekey_t pkey;
 	uint32_t priv;
-	uid_t uid;
-	zoneid_t zoneid;
+	uid_t uid = 0;	/* XXX: gcc */
+	zoneid_t zoneid = 0;	/* XXX: gcc */
 
 	ASSERT(MUTEX_HELD(&dtrace_lock));
 	dtrace_ecb_create_cache = NULL;



CVS commit: src/external/cddl/osnet/dev/dtrace/amd64

2011-07-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul 18 00:42:40 UTC 2011

Modified Files:
src/external/cddl/osnet/dev/dtrace/amd64: dis_tables.c

Log Message:
fix uninitialized gcc variables


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/cddl/osnet/dev/dtrace/amd64/dis_tables.c

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

Modified files:

Index: src/external/cddl/osnet/dev/dtrace/amd64/dis_tables.c
diff -u src/external/cddl/osnet/dev/dtrace/amd64/dis_tables.c:1.2 src/external/cddl/osnet/dev/dtrace/amd64/dis_tables.c:1.3
--- src/external/cddl/osnet/dev/dtrace/amd64/dis_tables.c:1.2	Sat Feb 20 20:46:33 2010
+++ src/external/cddl/osnet/dev/dtrace/amd64/dis_tables.c	Sun Jul 17 20:42:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dis_tables.c,v 1.2 2010/02/21 01:46:33 darran Exp $	*/
+/*	$NetBSD: dis_tables.c,v 1.3 2011/07/18 00:42:40 christos Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -1716,9 +1716,9 @@
 	uint_t opcode2;		/* low nibble of 1st byte */
 	uint_t opcode3;		/* extra opcode bits usually from ModRM byte */
 	uint_t opcode4;		/* high nibble of 2nd byte */
-	uint_t opcode5;		/* low nibble of 2ne byte */
+	uint_t opcode5 = 0;	/* low nibble of 2ne byte */	/* XXX: gcc */
 	uint_t opcode6;		/* high nibble of 3rd byte */
-	uint_t opcode7;		/* low nibble of 3rd byte */
+	uint_t opcode7 = 0;	/* low nibble of 3rd byte */	/* XXX: gcc */
 	uint_t opcode_bytes = 1;
 
 	/*



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

2011-07-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jul 18 00:31:13 UTC 2011

Modified Files:
src/sys/arch/sparc/dev: bootbus.c cgsix_obio.c ebus.c rtc.c tctrl.c
vme_machdep.c

Log Message:
convert the remaining sparc drivers to CFATTACH_DECL_NEW/cfdata_t/device_t.
(cgsix_obio.c was only partially converted with the rest of the cgsix code
when it was changed some time ago.)


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/sparc/dev/bootbus.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sparc/dev/cgsix_obio.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/sparc/dev/ebus.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/sparc/dev/rtc.c
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/sparc/dev/tctrl.c
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/sparc/dev/vme_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/sparc/dev/bootbus.c
diff -u src/sys/arch/sparc/dev/bootbus.c:1.18 src/sys/arch/sparc/dev/bootbus.c:1.19
--- src/sys/arch/sparc/dev/bootbus.c:1.18	Fri Jul  1 18:50:41 2011
+++ src/sys/arch/sparc/dev/bootbus.c	Mon Jul 18 00:31:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootbus.c,v 1.18 2011/07/01 18:50:41 dyoung Exp $	*/
+/*	$NetBSD: bootbus.c,v 1.19 2011/07/18 00:31:13 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bootbus.c,v 1.18 2011/07/01 18:50:41 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bootbus.c,v 1.19 2011/07/18 00:31:13 mrg Exp $");
 
 #include 
 #include 
@@ -50,7 +50,6 @@
 #include "locators.h"
 
 struct bootbus_softc {
-	struct device sc_dev;
 	int sc_node;/* our OBP node */
 
 	bus_space_tag_t sc_st;			/* ours */
@@ -60,11 +59,10 @@
 static int bootbus_match(device_t, cfdata_t, void *);
 static void bootbus_attach(device_t, device_t, void *);
 
-CFATTACH_DECL(bootbus, sizeof(struct bootbus_softc),
+CFATTACH_DECL_NEW(bootbus, sizeof(struct bootbus_softc),
 bootbus_match, bootbus_attach, NULL, NULL);
 
-static int bootbus_submatch(struct device *, struct cfdata *,
-			const int *, void *);
+static int bootbus_submatch(device_t, cfdata_t, const int *, void *);
 static int bootbus_print(void *, const char *);
 
 static int bootbus_setup_attach_args(struct bootbus_softc *, bus_space_tag_t,

Index: src/sys/arch/sparc/dev/cgsix_obio.c
diff -u src/sys/arch/sparc/dev/cgsix_obio.c:1.24 src/sys/arch/sparc/dev/cgsix_obio.c:1.25
--- src/sys/arch/sparc/dev/cgsix_obio.c:1.24	Fri Jul  1 18:50:41 2011
+++ src/sys/arch/sparc/dev/cgsix_obio.c	Mon Jul 18 00:31:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgsix_obio.c,v 1.24 2011/07/01 18:50:41 dyoung Exp $ */
+/*	$NetBSD: cgsix_obio.c,v 1.25 2011/07/18 00:31:13 mrg Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgsix_obio.c,v 1.24 2011/07/01 18:50:41 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgsix_obio.c,v 1.25 2011/07/18 00:31:13 mrg Exp $");
 
 #include 
 #include 
@@ -68,7 +68,7 @@
 static void	cgsixattach(device_t, device_t, void *);
 static int	cg6_pfour_probe(void *, void *);
 
-CFATTACH_DECL(cgsix_obio, sizeof(struct cgsix_softc),
+CFATTACH_DECL_NEW(cgsix_obio, sizeof(struct cgsix_softc),
 cgsixmatch, cgsixattach, NULL, NULL);
 
 /*

Index: src/sys/arch/sparc/dev/ebus.c
diff -u src/sys/arch/sparc/dev/ebus.c:1.32 src/sys/arch/sparc/dev/ebus.c:1.33
--- src/sys/arch/sparc/dev/ebus.c:1.32	Fri Jul  1 18:50:41 2011
+++ src/sys/arch/sparc/dev/ebus.c	Mon Jul 18 00:31:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ebus.c,v 1.32 2011/07/01 18:50:41 dyoung Exp $ */
+/*	$NetBSD: ebus.c,v 1.33 2011/07/18 00:31:13 mrg Exp $ */
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ebus.c,v 1.32 2011/07/01 18:50:41 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ebus.c,v 1.33 2011/07/18 00:31:13 mrg Exp $");
 
 #if defined(DEBUG) && !defined(EBUS_DEBUG)
 #define EBUS_DEBUG
@@ -82,7 +82,7 @@
 #endif
 
 struct ebus_softc {
-	struct device			sc_dev;
+	device_t			sc_dev;
 	device_t			sc_parent;	/* PCI bus */
 
 	intsc_node;	/* PROM node */
@@ -100,7 +100,7 @@
 static int	ebus_match(device_t, cfdata_t, void *);
 static void	ebus_attach(device_t, device_t, void *);
 
-CFATTACH_DECL(ebus, sizeof(struct ebus_softc),
+CFATTACH_DECL_NEW(ebus, sizeof(struct ebus_softc),
 ebus_match, ebus_attach, NULL, NULL);
 
 static int	ebus_setup_attach_args(struct ebus_softc *, bus_space_tag_t,
@@ -212,7 +212,7 @@
 
 	if (wiring_map != NULL) {
 		printf("%s: global ebus wiring map already initalized\n",
-		device_xname(&sc->sc_dev));
+		device_xname(sc->sc_dev));
 		return (0);
 	}
 
@@ -250,6 +250,8 @@
 	int node, error;
 	char devinfo[256];
 
+	sc->sc_dev = self;
+
 #ifdef BLINK
 	callout_init(&ebus_blink_ch, 0);
 #endif

Index: src/sys/arch/sparc/dev/rtc.c
diff -u src/sys/arch/sparc/dev/rtc.c:1.17 src/sys/arch/sparc/de

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

2011-07-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jul 18 00:05:35 UTC 2011

Modified Files:
src/sys/arch/sparc/dev: cgeight.c cgfour.c cgtwo.c

Log Message:
convert to use device_t, cfdata_t and CFATTACH_DECL_NEW().

XXX: compile time tested only.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/sparc/dev/cgeight.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/sparc/dev/cgfour.c
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/sparc/dev/cgtwo.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/dev/cgeight.c
diff -u src/sys/arch/sparc/dev/cgeight.c:1.46 src/sys/arch/sparc/dev/cgeight.c:1.47
--- src/sys/arch/sparc/dev/cgeight.c:1.46	Wed Jun 11 21:25:31 2008
+++ src/sys/arch/sparc/dev/cgeight.c	Mon Jul 18 00:05:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgeight.c,v 1.46 2008/06/11 21:25:31 drochner Exp $	*/
+/*	$NetBSD: cgeight.c,v 1.47 2011/07/18 00:05:35 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -102,7 +102,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgeight.c,v 1.46 2008/06/11 21:25:31 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgeight.c,v 1.47 2011/07/18 00:05:35 mrg Exp $");
 
 #include 
 #include 
@@ -127,7 +127,6 @@
 
 /* per-display variables */
 struct cgeight_softc {
-	struct device	sc_dev;		/* base device */
 	struct fbdevice	sc_fb;		/* frame buffer device */
 	bus_space_tag_t	sc_bustag;
 	bus_addr_t	sc_paddr;	/* phys address for device mmap() */
@@ -137,15 +136,15 @@
 };
 
 /* autoconfiguration driver */
-static void	cgeightattach(struct device *, struct device *, void *);
-static int	cgeightmatch(struct device *, struct cfdata *, void *);
+static void	cgeightattach(device_t, device_t, void *);
+static int	cgeightmatch(device_t, cfdata_t, void *);
 #if defined(SUN4)
-static void	cgeightunblank(struct device *);
+static void	cgeightunblank(device_t);
 #endif
 
 static int	cg8_pfour_probe(void *, void *);
 
-CFATTACH_DECL(cgeight, sizeof(struct cgeight_softc),
+CFATTACH_DECL_NEW(cgeight, sizeof(struct cgeight_softc),
 cgeightmatch, cgeightattach, NULL, NULL);
 
 extern struct cfdriver cgeight_cd;
@@ -175,7 +174,7 @@
  * Match a cgeight.
  */
 static int
-cgeightmatch(struct device *parent, struct cfdata *cf, void *aux)
+cgeightmatch(device_t parent, cfdata_t cf, void *aux)
 {
 	union obio_attach_args *uoba = aux;
 	struct obio4_attach_args *oba;
@@ -202,7 +201,7 @@
  * Attach a display.  We need to notice if it is the console, too.
  */
 static void
-cgeightattach(struct device *parent, struct device *self, void *aux)
+cgeightattach(device_t parent, device_t self, void *aux)
 {
 #if defined(SUN4)
 	union obio_attach_args *uoba = aux;
@@ -221,15 +220,16 @@
 			  sizeof(uint32_t),
 			  BUS_SPACE_MAP_LINEAR,
 			  &bh) != 0) {
-		printf("%s: cannot map pfour register\n", self->dv_xname);
+		printf("%s: cannot map pfour register\n",
+			device_xname(self));
 		return;
 	}
 	fb->fb_pfour = (volatile uint32_t *)bh;
 
 	fb->fb_driver = &cgeightfbdriver;
-	fb->fb_device = &sc->sc_dev;
+	fb->fb_device = self;
 	fb->fb_type.fb_type = FBTYPE_MEMCOLOR;
-	fb->fb_flags = device_cfdata(&sc->sc_dev)->cf_flags & FB_USERMASK;
+	fb->fb_flags = device_cfdata(self)->cf_flags & FB_USERMASK;
 	fb->fb_flags |= FB_PFOUR;
 
 	ramsize = PFOUR_COLOR_OFF_END - PFOUR_COLOR_OFF_OVERLAY;
@@ -285,7 +285,8 @@
 			  sizeof(struct fbcontrol),
 			  BUS_SPACE_MAP_LINEAR,
 			  &bh) != 0) {
-		printf("%s: cannot map control registers\n", self->dv_xname);
+		printf("%s: cannot map control registers\n",
+			device_xname(self));
 		return;
 	}
 	sc->sc_fbc = (volatile struct fbcontrol *)bh;
@@ -481,7 +482,7 @@
  * Undo the effect of an FBIOSVIDEO that turns the video off.
  */
 static void
-cgeightunblank(struct device *dev)
+cgeightunblank(device_t dev)
 {
 
 	cgeight_set_video(device_private(dev), 1);

Index: src/sys/arch/sparc/dev/cgfour.c
diff -u src/sys/arch/sparc/dev/cgfour.c:1.45 src/sys/arch/sparc/dev/cgfour.c:1.46
--- src/sys/arch/sparc/dev/cgfour.c:1.45	Wed Jun 11 21:25:31 2008
+++ src/sys/arch/sparc/dev/cgfour.c	Mon Jul 18 00:05:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgfour.c,v 1.45 2008/06/11 21:25:31 drochner Exp $	*/
+/*	$NetBSD: cgfour.c,v 1.46 2011/07/18 00:05:35 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -102,7 +102,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgfour.c,v 1.45 2008/06/11 21:25:31 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgfour.c,v 1.46 2011/07/18 00:05:35 mrg Exp $");
 
 #include 
 #include 
@@ -125,7 +125,6 @@
 
 /* per-display variables */
 struct cgfour_softc {
-	struct device	sc_dev;		/* base device */
 	struct fbdevice	sc_fb;		/* frame buffer device */
 	bus_space_tag_t	sc_bustag;
 	bus_addr_t	sc_paddr;	/* phys address for device mmap() */
@@ -135,8 +134,8 @@
 };
 
 /* autoconfiguration driver */
-static int	cgfourmatch(struct device *, struct cfdata *, void *);
-static vo

CVS commit: src/sys/compat/linux/common

2011-07-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 17 23:59:55 UTC 2011

Modified Files:
src/sys/compat/linux/common: linux_socket.c

Log Message:
fail early on socket domain+type combinations we don't support


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sys/compat/linux/common/linux_socket.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/compat/linux/common/linux_socket.c
diff -u src/sys/compat/linux/common/linux_socket.c:1.109 src/sys/compat/linux/common/linux_socket.c:1.110
--- src/sys/compat/linux/common/linux_socket.c:1.109	Thu Jun 30 16:09:39 2011
+++ src/sys/compat/linux/common/linux_socket.c	Sun Jul 17 19:59:54 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_socket.c,v 1.109 2011/06/30 20:09:39 wiz Exp $	*/
+/*	$NetBSD: linux_socket.c,v 1.110 2011/07/17 23:59:54 christos Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.109 2011/06/30 20:09:39 wiz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.110 2011/07/17 23:59:54 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -309,6 +309,13 @@
 	SCARG(&bsa, domain) = linux_to_bsd_domain(SCARG(uap, domain));
 	if (SCARG(&bsa, domain) == -1)
 		return EINVAL;
+	/*
+	 * Apparently linux uses this to talk to ISDN sockets. If we fail
+	 * now programs seems to handle it, but if we don't we are going
+	 * to fail when we bind and programs don't handle this well.
+	 */
+	if (SCARG(&bsa, domain) == AF_ROUTE && SCARG(&bsa, type) == SOCK_RAW)
+		return ENOTSUP;
 	flags = SCARG(uap, type) & ~LINUX_SOCK_TYPE_MASK;
 	if (flags & ~(LINUX_SOCK_CLOEXEC | LINUX_SOCK_NONBLOCK))
 		return EINVAL;



CVS commit: src/sys/arch

2011-07-17 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Sun Jul 17 23:53:41 UTC 2011

Modified Files:
src/sys/arch/landisk/include: Makefile
src/sys/arch/netwinder/include: Makefile
src/sys/arch/sbmips/include: Makefile

Log Message:
Do not install bus.h.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/landisk/include/Makefile
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/netwinder/include/Makefile
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sbmips/include/Makefile

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/landisk/include/Makefile
diff -u src/sys/arch/landisk/include/Makefile:1.3 src/sys/arch/landisk/include/Makefile:1.4
--- src/sys/arch/landisk/include/Makefile:1.3	Sun Jul 17 20:54:42 2011
+++ src/sys/arch/landisk/include/Makefile	Sun Jul 17 23:53:41 2011
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.3 2011/07/17 20:54:42 joerg Exp $
+#	$NetBSD: Makefile,v 1.4 2011/07/17 23:53:41 dyoung Exp $
 
 INCSDIR= /usr/include/landisk
 
 INCS=	ansi.h aout_machdep.h asm.h \
-	bootinfo.h bswap.h bus.h \
+	bootinfo.h bswap.h \
 	button.h \
 	cdefs.h coff_machdep.h cpu.h cputypes.h \
 	db_machdep.h disklabel.h \

Index: src/sys/arch/netwinder/include/Makefile
diff -u src/sys/arch/netwinder/include/Makefile:1.22 src/sys/arch/netwinder/include/Makefile:1.23
--- src/sys/arch/netwinder/include/Makefile:1.22	Sun Jul 17 20:54:44 2011
+++ src/sys/arch/netwinder/include/Makefile	Sun Jul 17 23:53:41 2011
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.22 2011/07/17 20:54:44 joerg Exp $
+#	$NetBSD: Makefile,v 1.23 2011/07/17 23:53:41 dyoung Exp $
 
 INCSDIR= /usr/include/netwinder
 
 INCS=	ansi.h aout_machdep.h asm.h \
-	bswap.h bus.h \
+	bswap.h \
 	cdefs.h cpu.h \
 	disklabel.h \
 	elf_machdep.h endian.h endian_machdep.h \

Index: src/sys/arch/sbmips/include/Makefile
diff -u src/sys/arch/sbmips/include/Makefile:1.12 src/sys/arch/sbmips/include/Makefile:1.13
--- src/sys/arch/sbmips/include/Makefile:1.12	Sun Jul 17 20:54:46 2011
+++ src/sys/arch/sbmips/include/Makefile	Sun Jul 17 23:53:41 2011
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.12 2011/07/17 20:54:46 joerg Exp $
+# $NetBSD: Makefile,v 1.13 2011/07/17 23:53:41 dyoung Exp $
 
 INCSDIR= /usr/include/sbmips
 
-# XXXcgd need local: bus.h pci_machdep.h
+# XXXcgd need local: pci_machdep.h
 # XXXcgd need export: intr.h
 
 INCS=	ansi.h asm.h \



CVS commit: src/sys/arch

2011-07-17 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Sun Jul 17 23:52:12 UTC 2011

Modified Files:
src/sys/arch/arm/include: Makefile
src/sys/arch/sh3/include: Makefile

Log Message:
Do not install bus.h.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/arm/include/Makefile
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/sh3/include/Makefile

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/arm/include/Makefile
diff -u src/sys/arch/arm/include/Makefile:1.39 src/sys/arch/arm/include/Makefile:1.40
--- src/sys/arch/arm/include/Makefile:1.39	Sun Jul 17 20:54:37 2011
+++ src/sys/arch/arm/include/Makefile	Sun Jul 17 23:52:12 2011
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.39 2011/07/17 20:54:37 joerg Exp $
+#	$NetBSD: Makefile,v 1.40 2011/07/17 23:52:12 dyoung Exp $
 
 INCSDIR= /usr/include/arm
 
 INCS=	ansi.h aout_machdep.h armreg.h asm.h atomic.h \
-	bswap.h byte_swap.h bus.h \
+	bswap.h byte_swap.h \
 	cdefs.h cpu.h \
 	disklabel.h \
 	elf_machdep.h endian.h endian_machdep.h \

Index: src/sys/arch/sh3/include/Makefile
diff -u src/sys/arch/sh3/include/Makefile:1.25 src/sys/arch/sh3/include/Makefile:1.26
--- src/sys/arch/sh3/include/Makefile:1.25	Sun Jul 17 20:54:47 2011
+++ src/sys/arch/sh3/include/Makefile	Sun Jul 17 23:52:12 2011
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.25 2011/07/17 20:54:47 joerg Exp $
+#	$NetBSD: Makefile,v 1.26 2011/07/17 23:52:12 dyoung Exp $
 
 INCSDIR= /usr/include/sh3
 
 INCS=	ansi.h aout_machdep.h asm.h \
-	bswap.h bus.h byte_swap.h \
+	bswap.h byte_swap.h \
 	cdefs.h coff_machdep.h cpu.h cputypes.h \
 	disklabel.h \
 	elf_machdep.h endian.h endian_machdep.h \



CVS commit: src/share/man/man4

2011-07-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 17 23:50:05 UTC 2011

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

Log Message:
fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/share/man/man4/mpls.4

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

Modified files:

Index: src/share/man/man4/mpls.4
diff -u src/share/man/man4/mpls.4:1.6 src/share/man/man4/mpls.4:1.7
--- src/share/man/man4/mpls.4:1.6	Sun Jul  3 09:10:37 2011
+++ src/share/man/man4/mpls.4	Sun Jul 17 23:50:05 2011
@@ -1,4 +1,4 @@
-.\" $NetBSD: mpls.4,v 1.6 2011/07/03 09:10:37 wiz Exp $
+.\" $NetBSD: mpls.4,v 1.7 2011/07/17 23:50:05 dholland Exp $
 .\"
 .\" Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -51,7 +51,7 @@
 .Dq labeled
 before they are forwarded.
 .Pp
-A router capable of receiving and forwarding MPLS frame is called
+A router capable of receiving and forwarding MPLS frames is called
 .Dq Label Switch Router
 or LSR.
 Label scope is generally router-wide meaning that a certain



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

2011-07-17 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Sun Jul 17 23:49:47 UTC 2011

Modified Files:
src/sys/arch/sbmips/include: types.h
Removed Files:
src/sys/arch/sbmips/include: bus.h

Log Message:
Switch to new-style .


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 src/sys/arch/sbmips/include/bus.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sbmips/include/types.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/sbmips/include/types.h
diff -u src/sys/arch/sbmips/include/types.h:1.8 src/sys/arch/sbmips/include/types.h:1.9
--- src/sys/arch/sbmips/include/types.h:1.8	Sun Feb 20 07:47:38 2011
+++ src/sys/arch/sbmips/include/types.h	Sun Jul 17 23:49:46 2011
@@ -1,7 +1,7 @@
-/* $NetBSD: types.h,v 1.8 2011/02/20 07:47:38 matt Exp $ */
+/* $NetBSD: types.h,v 1.9 2011/07/17 23:49:46 dyoung Exp $ */
 
 #define	_MIPS_PADDR_T_64BIT
 
 #include 
 
-#define	__HAVE_DEVICE_REGISTER
+#define	__HAVE_NEW_STYLE_BUS_H



CVS commit: src/sys/arch

2011-07-17 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Sun Jul 17 23:48:35 UTC 2011

Modified Files:
src/sys/arch/landisk/include: types.h
src/sys/arch/sh3/include: types.h
Removed Files:
src/sys/arch/landisk/include: bus.h
src/sys/arch/sh3/include: bus.h

Log Message:
Switch to new-style .


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r0 src/sys/arch/landisk/include/bus.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/landisk/include/types.h
cvs rdiff -u -r1.18 -r0 src/sys/arch/sh3/include/bus.h
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/sh3/include/types.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/landisk/include/types.h
diff -u src/sys/arch/landisk/include/types.h:1.3 src/sys/arch/landisk/include/types.h:1.4
--- src/sys/arch/landisk/include/types.h:1.3	Wed Sep 20 00:41:13 2006
+++ src/sys/arch/landisk/include/types.h	Sun Jul 17 23:48:35 2011
@@ -1,8 +1,10 @@
-/*	$NetBSD: types.h,v 1.3 2006/09/20 00:41:13 uwe Exp $	*/
+/*	$NetBSD: types.h,v 1.4 2011/07/17 23:48:35 dyoung Exp $	*/
 
 #ifndef _LANDISK_TYPES_H_
 #define	_LANDISK_TYPES_H_
 
 #include 
 
+#define __HAVE_NEW_STYLE_BUS_H
+
 #endif /* _LANDISK_TYPES_H_ */

Index: src/sys/arch/sh3/include/types.h
diff -u src/sys/arch/sh3/include/types.h:1.33 src/sys/arch/sh3/include/types.h:1.34
--- src/sys/arch/sh3/include/types.h:1.33	Sun Jun 12 03:35:46 2011
+++ src/sys/arch/sh3/include/types.h	Sun Jul 17 23:48:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.33 2011/06/12 03:35:46 rmind Exp $	*/
+/*	$NetBSD: types.h,v 1.34 2011/07/17 23:48:35 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -70,6 +70,7 @@
 #define	__SIMPLELOCK_UNLOCKED	0
 
 #define	__HAVE_AST_PERPROC
+#define	__HAVE_NEW_STYLE_BUS_H
 #define	__HAVE_CPU_DATA_FIRST
 #define	__HAVE_SYSCALL_INTERN
 #define	__HAVE_MM_MD_DIRECT_MAPPED_IO



CVS commit: src/sbin/route

2011-07-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 17 23:46:54 UTC 2011

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

Log Message:
prune stray commas


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sbin/route/route.8

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

Modified files:

Index: src/sbin/route/route.8
diff -u src/sbin/route/route.8:1.44 src/sbin/route/route.8:1.45
--- src/sbin/route/route.8:1.44	Sun Jul  3 09:15:20 2011
+++ src/sbin/route/route.8	Sun Jul 17 23:46:53 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: route.8,v 1.44 2011/07/03 09:15:20 wiz Exp $
+.\"	$NetBSD: route.8,v 1.45 2011/07/17 23:46:53 dholland Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -246,14 +246,14 @@
 symbolic names.
 .Pp
 The optional modifiers
-.Fl mpls ,
+.Fl mpls
 and
 .Fl tag
 specify that all subsequent addresses are in the
 .Tn MPLS
 address family.
 See
-.Xr mpls 4 ,
+.Xr mpls 4
 for examples about setting routes involving MPLS.
 .Pp
 The optional



CVS commit: src/sys/arch

2011-07-17 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Sun Jul 17 23:46:50 UTC 2011

Modified Files:
src/sys/arch/arm/include: types.h
src/sys/arch/cats/include: Makefile types.h
src/sys/arch/evbarm/include: Makefile types.h
src/sys/arch/iyonix/include: Makefile types.h
src/sys/arch/netwinder/include: types.h
Removed Files:
src/sys/arch/arm/include: bus.h
src/sys/arch/cats/include: bus.h
src/sys/arch/evbarm/include: bus.h
src/sys/arch/iyonix/include: bus.h
src/sys/arch/netwinder/include: bus.h

Log Message:
On ARM-ish ports having PCI support, use new-style .  Do not
install .  Remove various  sources.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r0 src/sys/arch/arm/include/bus.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/include/types.h
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/cats/include/Makefile
cvs rdiff -u -r1.3 -r0 src/sys/arch/cats/include/bus.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/cats/include/types.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/include/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/arch/evbarm/include/bus.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbarm/include/types.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/iyonix/include/Makefile
cvs rdiff -u -r1.2 -r0 src/sys/arch/iyonix/include/bus.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/iyonix/include/types.h
cvs rdiff -u -r1.3 -r0 src/sys/arch/netwinder/include/bus.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/netwinder/include/types.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/arm/include/types.h
diff -u src/sys/arch/arm/include/types.h:1.19 src/sys/arch/arm/include/types.h:1.20
--- src/sys/arch/arm/include/types.h:1.19	Thu Apr  7 10:20:29 2011
+++ src/sys/arch/arm/include/types.h	Sun Jul 17 23:46:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.19 2011/04/07 10:20:29 matt Exp $	*/
+/*	$NetBSD: types.h,v 1.20 2011/07/17 23:46:49 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -82,6 +82,7 @@
 #define	__SIMPLELOCK_UNLOCKED	0
 
 #define	__HAVE_SYSCALL_INTERN
+#define	__HAVE_NEW_STYLE_BUS_H
 #define	__HAVE_MINIMAL_EMUL
 #define __HAVE_CPU_DATA_FIRST
 #define	__HAVE___LWP_GETPRIVATE_FAST

Index: src/sys/arch/cats/include/Makefile
diff -u src/sys/arch/cats/include/Makefile:1.23 src/sys/arch/cats/include/Makefile:1.24
--- src/sys/arch/cats/include/Makefile:1.23	Sun Jul 17 20:54:38 2011
+++ src/sys/arch/cats/include/Makefile	Sun Jul 17 23:46:49 2011
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.23 2011/07/17 20:54:38 joerg Exp $
+#	$NetBSD: Makefile,v 1.24 2011/07/17 23:46:49 dyoung Exp $
 
 INCSDIR= /usr/include/cats
 
 INCS=	ansi.h aout_machdep.h asm.h \
-	bswap.h bus.h \
+	bswap.h \
 	cdefs.h cpu.h \
 	disklabel.h \
 	elf_machdep.h endian.h endian_machdep.h \

Index: src/sys/arch/cats/include/types.h
diff -u src/sys/arch/cats/include/types.h:1.11 src/sys/arch/cats/include/types.h:1.12
--- src/sys/arch/cats/include/types.h:1.11	Sun Jan 20 18:09:05 2008
+++ src/sys/arch/cats/include/types.h	Sun Jul 17 23:46:49 2011
@@ -1,9 +1,9 @@
-/*	$NetBSD: types.h,v 1.11 2008/01/20 18:09:05 joerg Exp $	*/
+/*	$NetBSD: types.h,v 1.12 2011/07/17 23:46:49 dyoung Exp $	*/
 
 #ifndef _ARM32_TYPES_H_
 #define	_ARM32_TYPES_H_
 
 #include 
-#define __HAVE_DEVICE_REGISTER
+#define __HAVE_NEW_STYLE_BUS_H
 
 #endif

Index: src/sys/arch/evbarm/include/Makefile
diff -u src/sys/arch/evbarm/include/Makefile:1.16 src/sys/arch/evbarm/include/Makefile:1.17
--- src/sys/arch/evbarm/include/Makefile:1.16	Sun Jul 17 20:54:39 2011
+++ src/sys/arch/evbarm/include/Makefile	Sun Jul 17 23:46:49 2011
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.16 2011/07/17 20:54:39 joerg Exp $
+#	$NetBSD: Makefile,v 1.17 2011/07/17 23:46:49 dyoung Exp $
 
 INCSDIR= /usr/include/evbarm
 
 INCS=	ansi.h aout_machdep.h asm.h \
-	bswap.h bus.h \
+	bswap.h \
 	cdefs.h cpu.h \
 	disklabel.h \
 	elf_machdep.h endian.h endian_machdep.h \

Index: src/sys/arch/evbarm/include/types.h
diff -u src/sys/arch/evbarm/include/types.h:1.10 src/sys/arch/evbarm/include/types.h:1.11
--- src/sys/arch/evbarm/include/types.h:1.10	Sun Jan 20 18:09:05 2008
+++ src/sys/arch/evbarm/include/types.h	Sun Jul 17 23:46:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.10 2008/01/20 18:09:05 joerg Exp $	*/
+/*	$NetBSD: types.h,v 1.11 2011/07/17 23:46:49 dyoung Exp $	*/
 
 #ifndef _EVBARM_TYPES_H_
 #define	_EVBARM_TYPES_H_
@@ -7,6 +7,6 @@
 
 #ifndef __OLD_INTERRUPT_CODE		/* XXX */
 #endif
-#define	__HAVE_DEVICE_REGISTER
+#define	__HAVE_NEW_STYLE_BUS_H
 
 #endif

Index: src/sys/arch/iyonix/include/Makefile
diff -u src/sys/arch/iyonix/include/Makefile:1.6 src/sys/arch/iyonix/include/Makefile:1.7
--- src/sys/arch/iyonix/include/Makefile:1.6	Sun Jul 17 20:54:42 2011
+++ src/sys/arch/iyonix/include/Makefile	Sun Jul 17 23:46:49 2011
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.6 2011/07/17 20:54:42 joerg Exp $
+#	$NetBSD

CVS commit: src/sys/arch/evbmips/conf

2011-07-17 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Sun Jul 17 23:40:43 UTC 2011

Modified Files:
src/sys/arch/evbmips/conf: ALCHEMY

Log Message:
Increase SYMTAB_SPACE.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/evbmips/conf/ALCHEMY

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/evbmips/conf/ALCHEMY
diff -u src/sys/arch/evbmips/conf/ALCHEMY:1.36 src/sys/arch/evbmips/conf/ALCHEMY:1.37
--- src/sys/arch/evbmips/conf/ALCHEMY:1.36	Fri Jul  1 22:10:31 2011
+++ src/sys/arch/evbmips/conf/ALCHEMY	Sun Jul 17 23:40:43 2011
@@ -1,11 +1,11 @@
-#	$NetBSD: ALCHEMY,v 1.36 2011/07/01 22:10:31 dyoung Exp $
+#	$NetBSD: ALCHEMY,v 1.37 2011/07/17 23:40:43 dyoung Exp $
 #
 # Kernel config for the Alchemy Semiconductor (AMD) PB1000, PB1500,
 # DBAu1000 and DBAu1500 evaluation boards.
 
 include 	"arch/evbmips/conf/std.alchemy"
 
-#ident 		"ALCHEMY-$Revision: 1.36 $"
+#ident 		"ALCHEMY-$Revision: 1.37 $"
 
 maxusers	32
 
@@ -45,7 +45,7 @@
 options 	DDB		# kernel dynamic debugger
 options 	DDB_HISTORY_SIZE=100 # enable history editing in DDB
 makeoptions 	DEBUG="-g"	# compile full symbol table
-options 	SYMTAB_SPACE=481000	# size for embedded symbol table
+options 	SYMTAB_SPACE=482000	# size for embedded symbol table
 
 # Compatibility options
 #options 	COMPAT_43	# compatibility with 4.3BSD binaries



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

2011-07-17 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Sun Jul 17 23:40:16 UTC 2011

Modified Files:
src/sys/arch/atari/include: types.h
Removed Files:
src/sys/arch/atari/include: bus.h

Log Message:
Switch to new-style .


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r0 src/sys/arch/atari/include/bus.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/atari/include/types.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/atari/include/types.h
diff -u src/sys/arch/atari/include/types.h:1.14 src/sys/arch/atari/include/types.h:1.15
--- src/sys/arch/atari/include/types.h:1.14	Sun Jun 12 03:35:40 2011
+++ src/sys/arch/atari/include/types.h	Sun Jul 17 23:40:16 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: types.h,v 1.14 2011/06/12 03:35:40 rmind Exp $	*/
+/*	$NetBSD: types.h,v 1.15 2011/07/17 23:40:16 dyoung Exp $	*/
 
 #ifndef _MACHINE_TYPES_H_
 #define	_MACHINE_TYPES_H_
 
 #include 
 
-#define	__HAVE_MM_MD_READWRITE
+#define __HAVE_NEW_STYLE_BUS_H
 
 #endif



CVS commit: src/sys/arch/algor/conf

2011-07-17 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Sun Jul 17 23:39:47 UTC 2011

Modified Files:
src/sys/arch/algor/conf: P4032 P5064

Log Message:
Increase SYMTAB_SPACE.  How do we automate this?


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/algor/conf/P4032
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/algor/conf/P5064

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/algor/conf/P4032
diff -u src/sys/arch/algor/conf/P4032:1.58 src/sys/arch/algor/conf/P4032:1.59
--- src/sys/arch/algor/conf/P4032:1.58	Sat Jul  9 17:13:32 2011
+++ src/sys/arch/algor/conf/P4032	Sun Jul 17 23:39:46 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: P4032,v 1.58 2011/07/09 17:13:32 dyoung Exp $
+#	$NetBSD: P4032,v 1.59 2011/07/17 23:39:46 dyoung Exp $
 #
 # Algorithmics P-4032 kernel.
 #
@@ -7,7 +7,7 @@
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"P4032-$Revision: 1.58 $"
+#ident 		"P4032-$Revision: 1.59 $"
 
 maxusers 32
 
@@ -30,7 +30,7 @@
 options 	DDB			# kernel debugger
 makeoptions	DEBUG="-g"
 #makeoptions	DEBUGLIST="pattern1 pattern2 ..."
-options 	SYMTAB_SPACE=402000
+options 	SYMTAB_SPACE=404000
 
 # File systems
 file-system	FFS		# Fast file system

Index: src/sys/arch/algor/conf/P5064
diff -u src/sys/arch/algor/conf/P5064:1.67 src/sys/arch/algor/conf/P5064:1.68
--- src/sys/arch/algor/conf/P5064:1.67	Sat Jul  9 17:13:32 2011
+++ src/sys/arch/algor/conf/P5064	Sun Jul 17 23:39:46 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: P5064,v 1.67 2011/07/09 17:13:32 dyoung Exp $
+#	$NetBSD: P5064,v 1.68 2011/07/17 23:39:46 dyoung Exp $
 #
 # Algorithmics P-5064 kernel.
 #
@@ -7,7 +7,7 @@
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"P5064-$Revision: 1.67 $"
+#ident 		"P5064-$Revision: 1.68 $"
 
 maxusers 32
 
@@ -25,7 +25,7 @@
 options 	DDB			# kernel debugger
 makeoptions	DEBUG="-g"
 #makeoptions	DEBUGLIST="pattern1 pattern2 ..."
-options 	SYMTAB_SPACE=464000
+options 	SYMTAB_SPACE=465000
 
 # File systems
 file-system	FFS		# Fast file system



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

2011-07-17 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Sun Jul 17 23:38:32 UTC 2011

Modified Files:
src/sys/arch/x86/include: Makefile
Removed Files:
src/sys/arch/x86/include: bus.h

Log Message:
Good-bye bus.h.  Don't install .


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/x86/include/Makefile
cvs rdiff -u -r1.20 -r0 src/sys/arch/x86/include/bus.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/Makefile
diff -u src/sys/arch/x86/include/Makefile:1.15 src/sys/arch/x86/include/Makefile:1.16
--- src/sys/arch/x86/include/Makefile:1.15	Mon Dec 20 04:29:56 2010
+++ src/sys/arch/x86/include/Makefile	Sun Jul 17 23:38:32 2011
@@ -1,9 +1,9 @@
-# 	$NetBSD: Makefile,v 1.15 2010/12/20 04:29:56 christos Exp $
+# 	$NetBSD: Makefile,v 1.16 2011/07/17 23:38:32 dyoung Exp $
 
 INCSDIR=/usr/include/x86
 
 INCS=	aout_machdep.h \
-	bootinfo.h bus.h \
+	bootinfo.h \
 	cacheinfo.h \
 	cpu.h \
 	cputypes.h \



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

2011-07-17 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Sun Jul 17 23:37:33 UTC 2011

Modified Files:
src/distrib/sets/lists/comp: md.hp700 md.sparc64

Log Message:
Update set lists for changes related to new-style .

While I'm here, repair sparc64 set list.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/distrib/sets/lists/comp/md.hp700
cvs rdiff -u -r1.110 -r1.111 src/distrib/sets/lists/comp/md.sparc64

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/md.hp700
diff -u src/distrib/sets/lists/comp/md.hp700:1.7 src/distrib/sets/lists/comp/md.hp700:1.8
--- src/distrib/sets/lists/comp/md.hp700:1.7	Sun Jul 17 20:54:31 2011
+++ src/distrib/sets/lists/comp/md.hp700	Sun Jul 17 23:37:32 2011
@@ -1,11 +1,11 @@
-# $NetBSD: md.hp700,v 1.7 2011/07/17 20:54:31 joerg Exp $
+# $NetBSD: md.hp700,v 1.8 2011/07/17 23:37:32 dyoung Exp $
 ./usr/include/hp700comp-c-include
 ./usr/include/hp700/ansi.h			comp-c-include
 ./usr/include/hp700/aout_machdep.h		comp-c-include
 ./usr/include/hp700/asm.h			comp-c-include
 ./usr/include/hp700/autoconf.h			comp-c-include
 ./usr/include/hp700/bswap.h			comp-c-include
-./usr/include/hp700/bus.h			comp-c-include
+./usr/include/hp700/bus.h			comp-obsolete		obsolete
 ./usr/include/hp700/byte_swap.h			comp-c-include
 ./usr/include/hp700/cdefs.h			comp-c-include
 ./usr/include/hp700/cpu.h			comp-c-include

Index: src/distrib/sets/lists/comp/md.sparc64
diff -u src/distrib/sets/lists/comp/md.sparc64:1.110 src/distrib/sets/lists/comp/md.sparc64:1.111
--- src/distrib/sets/lists/comp/md.sparc64:1.110	Sun Jul 17 20:54:31 2011
+++ src/distrib/sets/lists/comp/md.sparc64	Sun Jul 17 23:37:32 2011
@@ -1,4 +1,4 @@
-# $NetBSD: md.sparc64,v 1.110 2011/07/17 20:54:31 joerg Exp $
+# $NetBSD: md.sparc64,v 1.111 2011/07/17 23:37:32 dyoung Exp $
 ./usr/include/gcc-4.5/tgmath.h			comp-c-include		gcccmds,gcc=45
 ./usr/include/ieeefp.hcomp-c-include
 ./usr/include/sparccomp-c-include
@@ -881,7 +881,7 @@
 ./usr/libdata/debug/usr/lib/sparc/libcom_err.so.6.0.debug	comp-compat-shlib	compat,pic,kerberos,debug,obsolete
 ./usr/libdata/debug/usr/lib/sparc/libcom_err.so.7.0.debug	comp-compat-shlib	compat,pic,kerberos,debug
 ./usr/libdata/debug/usr/lib/sparc/libcrypt.so.1.0.debug			comp-compat-shlib	compat,pic,debug
-./usr/libdata/debug/usr/lib/sparc/libcrypto.so.6.2.debug		comp-compat-shlib	compat,pic,debug,crypto
+./usr/libdata/debug/usr/lib/sparc/libcrypto.so.7.0.debug		comp-compat-shlib	compat,pic,debug,crypto
 ./usr/libdata/debug/usr/lib/sparc/libcurses.so.7.0.debug		comp-compat-shlib	compat,pic,debug
 ./usr/libdata/debug/usr/lib/sparc/libdes.so.8.1.debug			comp-compat-shlib	compat,pic,debug,crypto
 ./usr/libdata/debug/usr/lib/sparc/libdevmapper.so.1.0.debug			comp-compat-shlib	compat,pic,debug,lvm
@@ -968,7 +968,7 @@
 ./usr/libdata/debug/usr/lib/sparc/libsl.so.5.0.debug			comp-compat-shlib	compat,pic,debug
 ./usr/libdata/debug/usr/lib/sparc/libss.so.6.0.debug			comp-compat-shlib	obsolete
 ./usr/libdata/debug/usr/lib/sparc/libssh.so.16.0.debug			comp-compat-shlib	compat,pic,debug
-./usr/libdata/debug/usr/lib/sparc/libssl.so.8.2.debug			comp-compat-shlib	compat,pic,debug
+./usr/libdata/debug/usr/lib/sparc/libssl.so.9.0.debug			comp-compat-shlib	compat,pic,debug
 ./usr/libdata/debug/usr/lib/sparc/libstdc++.so.7.0.debug		comp-compat-shlib	gcc=4,compat,pic,debug
 ./usr/libdata/debug/usr/lib/sparc/libstdc++.so.7.1.debug		comp-compat-shlib	gcc=45,compat,pic,debug
 ./usr/libdata/debug/usr/lib/sparc/libterminfo.so.1.0.debug		comp-compat-shlib	compat,pic,debug



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

2011-07-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jul 17 23:34:17 UTC 2011

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

Log Message:
actually use CFATTACH_DECL_NEW() and device_private() for mspcic.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 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.42 src/sys/arch/sparc/sparc/msiiep.c:1.43
--- src/sys/arch/sparc/sparc/msiiep.c:1.42	Sun Jul 17 23:32:37 2011
+++ src/sys/arch/sparc/sparc/msiiep.c	Sun Jul 17 23:34:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: msiiep.c,v 1.42 2011/07/17 23:32:37 mrg Exp $ */
+/*	$NetBSD: msiiep.c,v 1.43 2011/07/17 23:34:17 mrg 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.42 2011/07/17 23:32:37 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msiiep.c,v 1.43 2011/07/17 23:34:17 mrg Exp $");
 
 #include 
 #include 
@@ -83,7 +83,7 @@
 static void	mspcic_attach(device_t, device_t, void *);
 static int	mspcic_print(void *, const char *);
 
-CFATTACH_DECL(mspcic, sizeof(struct mspcic_softc),
+CFATTACH_DECL_NEW(mspcic, sizeof(struct mspcic_softc),
 mspcic_match, mspcic_attach, NULL, NULL);
 
 
@@ -278,7 +278,7 @@
 static void
 mspcic_attach(device_t parent, device_t self, void *aux)
 {
-	struct mspcic_softc *sc = (struct mspcic_softc *)self;
+	struct mspcic_softc *sc = device_private(self);
 	struct msiiep_attach_args *msa = aux;
 	struct mainbus_attach_args *ma = msa->msa_ma;
 	int node = ma->ma_node;



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

2011-07-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jul 17 23:32:37 UTC 2011

Modified Files:
src/sys/arch/sparc/sparc: auxiotwo.c clkctrl.c eeprom.c memreg.c
msiiep.c msiiepvar.h

Log Message:
convert all the "empty softc" (just "struct device") drivers to using
device_t/cfdata_t and CFATTACH_DECL_NEW().

the mspcic driver was also converted since it does not ever touch the
sc_dev it used to have in there.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sparc/sparc/auxiotwo.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sparc/sparc/clkctrl.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sparc/sparc/eeprom.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/sparc/sparc/memreg.c
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/sparc/sparc/msiiep.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sparc/sparc/msiiepvar.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/sparc/sparc/auxiotwo.c
diff -u src/sys/arch/sparc/sparc/auxiotwo.c:1.9 src/sys/arch/sparc/sparc/auxiotwo.c:1.10
--- src/sys/arch/sparc/sparc/auxiotwo.c:1.9	Mon Apr 28 20:23:36 2008
+++ src/sys/arch/sparc/sparc/auxiotwo.c	Sun Jul 17 23:32:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: auxiotwo.c,v 1.9 2008/04/28 20:23:36 martin Exp $	*/
+/*	$NetBSD: auxiotwo.c,v 1.10 2011/07/17 23:32:37 mrg Exp $	*/
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: auxiotwo.c,v 1.9 2008/04/28 20:23:36 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auxiotwo.c,v 1.10 2011/07/17 23:32:37 mrg Exp $");
 
 #include 
 #include 
@@ -51,17 +51,17 @@
 static int serial_refcount;
 static int serial_power;
 
-static int auxiotwomatch(struct device *, struct cfdata *, void *);
-static void auxiotwoattach(struct device *, struct device *, void *);
+static int auxiotwomatch(device_t, cfdata_t, void *);
+static void auxiotwoattach(device_t, device_t, void *);
 
-CFATTACH_DECL(auxiotwo_obio, sizeof(struct device),
+CFATTACH_DECL_NEW(auxiotwo_obio, 0,
  auxiotwomatch, auxiotwoattach, NULL, NULL);
 
 /*
  * The OPENPROM calls this "auxio2".
  */
 static int
-auxiotwomatch(struct device *parent, struct cfdata *cf, void *aux)
+auxiotwomatch(device_t parent, cfdata_t cf, void *aux)
 {
 	union obio_attach_args *uoba = aux;
 
@@ -72,7 +72,7 @@
 }
 
 static void
-auxiotwoattach(struct device *parent, struct device *self, void *aux)
+auxiotwoattach(device_t parent, device_t self, void *aux)
 {
 	union obio_attach_args *uoba = aux;
 	struct sbus_attach_args *sa = &uoba->uoba_sbus;

Index: src/sys/arch/sparc/sparc/clkctrl.c
diff -u src/sys/arch/sparc/sparc/clkctrl.c:1.4 src/sys/arch/sparc/sparc/clkctrl.c:1.5
--- src/sys/arch/sparc/sparc/clkctrl.c:1.4	Thu May  8 02:16:27 2008
+++ src/sys/arch/sparc/sparc/clkctrl.c	Sun Jul 17 23:32:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: clkctrl.c,v 1.4 2008/05/08 02:16:27 macallan Exp $	*/
+/*	$NetBSD: clkctrl.c,v 1.5 2011/07/17 23:32:37 mrg Exp $	*/
 
 /*
  * Copyright (c) 2005 Michael Lorenz
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clkctrl.c,v 1.4 2008/05/08 02:16:27 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clkctrl.c,v 1.5 2011/07/17 23:32:37 mrg Exp $");
 
 #include 
 #include 
@@ -38,17 +38,17 @@
 
 #include 
 
-static int clkctrl_match(struct device *, struct cfdata *, void *);
-static void clkctrl_attach(struct device *, struct device *, void *);
+static int clkctrl_match(device_t, cfdata_t, void *);
+static void clkctrl_attach(device_t, device_t, void *);
 
-CFATTACH_DECL(clkctrl, sizeof(struct device),
+CFATTACH_DECL_NEW(clkctrl, 0,
  clkctrl_match, clkctrl_attach, NULL, NULL);
 
 static void tadpole_cpu_sleep(struct cpu_info *);
 volatile uint8_t *clkctrl_reg = NULL;
 
 static int
-clkctrl_match(struct device *parent, struct cfdata *cf, void *aux)
+clkctrl_match(device_t parent, cfdata_t cf, void *aux)
 {
 	union obio_attach_args *uoba = aux;
 
@@ -59,7 +59,7 @@
 }
 
 static void
-clkctrl_attach(struct device *parent, struct device *self, void *aux)
+clkctrl_attach(device_t parent, device_t self, void *aux)
 {
 	union obio_attach_args *uoba = aux;
 	struct sbus_attach_args *sa = &uoba->uoba_sbus;

Index: src/sys/arch/sparc/sparc/eeprom.c
diff -u src/sys/arch/sparc/sparc/eeprom.c:1.8 src/sys/arch/sparc/sparc/eeprom.c:1.9
--- src/sys/arch/sparc/sparc/eeprom.c:1.8	Fri Jul  1 18:51:51 2011
+++ src/sys/arch/sparc/sparc/eeprom.c	Sun Jul 17 23:32:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: eeprom.c,v 1.8 2011/07/01 18:51:51 dyoung Exp $ */
+/*	$NetBSD: eeprom.c,v 1.9 2011/07/17 23:32:37 mrg Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: eeprom.c,v 1.8 2011/07/01 18:51:51 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: eeprom.c,v 1.9 2011/07/17 23:32:37 mrg Exp $");
 
 #include "opt_sparc_arch.h"
 
@@ -58,10 +58,10 @@
 /* Imported from clock.c: */
 extern char	*eeprom_va;
 
-stat

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

2011-07-17 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Sun Jul 17 23:32:21 UTC 2011

Modified Files:
src/sys/arch/hp700/include: Makefile types.h
Removed Files:
src/sys/arch/hp700/include: bus.h

Log Message:
Switch to new-style . hp700 releases are unbuildable for
reasons not related to my changes here, so I'm not 100% that a release
build will run to completion with these changes in place.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hp700/include/Makefile \
src/sys/arch/hp700/include/types.h
cvs rdiff -u -r1.16 -r0 src/sys/arch/hp700/include/bus.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/include/Makefile
diff -u src/sys/arch/hp700/include/Makefile:1.11 src/sys/arch/hp700/include/Makefile:1.12
--- src/sys/arch/hp700/include/Makefile:1.11	Sun Jul 17 20:54:40 2011
+++ src/sys/arch/hp700/include/Makefile	Sun Jul 17 23:32:21 2011
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.11 2011/07/17 20:54:40 joerg Exp $
+#	$NetBSD: Makefile,v 1.12 2011/07/17 23:32:21 dyoung Exp $
 
 INCSDIR= /usr/include/hp700
 
 INCS=	ansi.h aout_machdep.h asm.h autoconf.h \
-	bswap.h bus.h byte_swap.h \
+	bswap.h byte_swap.h \
 	cdefs.h cpu.h cpufunc.h \
 	disklabel.h \
 	eisa_machdep.h elf_machdep.h endian.h endian_machdep.h exec.h \
Index: src/sys/arch/hp700/include/types.h
diff -u src/sys/arch/hp700/include/types.h:1.11 src/sys/arch/hp700/include/types.h:1.12
--- src/sys/arch/hp700/include/types.h:1.11	Sun Jun 12 03:35:41 2011
+++ src/sys/arch/hp700/include/types.h	Sun Jul 17 23:32:21 2011
@@ -1,11 +1,11 @@
-/*	$NetBSD: types.h,v 1.11 2011/06/12 03:35:41 rmind Exp $	*/
+/*	$NetBSD: types.h,v 1.12 2011/07/17 23:32:21 dyoung Exp $	*/
 
 #ifndef	_HP700_TYPES_H_
 #define	_HP700_TYPES_H_
 
 #include 
 
-#define	__HAVE_DEVICE_REGISTER
+#define	__HAVE_NEW_STYLE_BUS_H
 
 #define	__HAVE_MM_MD_DIRECT_MAPPED_PHYS
 #define	__HAVE_MM_MD_KERNACC



CVS commit: src/sys/arch

2011-07-17 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Sun Jul 17 23:29:10 UTC 2011

Modified Files:
src/sys/arch/sparc/include: types.h
src/sys/arch/sparc/sparc: machdep.c
src/sys/arch/sparc64/include: bus_defs.h bus_funcs.h
src/sys/arch/sparc64/sparc64: machdep.c
Removed Files:
src/sys/arch/sparc/include: bus.h
src/sys/arch/sparc64/include: bus.h

Log Message:
Switch sparc and sparc64 to new-style .


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r0 src/sys/arch/sparc/include/bus.h
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/sparc/include/types.h
cvs rdiff -u -r1.312 -r1.313 src/sys/arch/sparc/sparc/machdep.c
cvs rdiff -u -r1.61 -r0 src/sys/arch/sparc64/include/bus.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sparc64/include/bus_defs.h \
src/sys/arch/sparc64/include/bus_funcs.h
cvs rdiff -u -r1.260 -r1.261 src/sys/arch/sparc64/sparc64/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/sparc/include/types.h
diff -u src/sys/arch/sparc/include/types.h:1.59 src/sys/arch/sparc/include/types.h:1.60
--- src/sys/arch/sparc/include/types.h:1.59	Sat Jun 18 18:51:17 2011
+++ src/sys/arch/sparc/include/types.h	Sun Jul 17 23:29:10 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.59 2011/06/18 18:51:17 nakayama Exp $ */
+/*	$NetBSD: types.h,v 1.60 2011/07/17 23:29:10 dyoung Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -117,7 +117,7 @@
 
 #endif /* _LOCORE */
 
-#define	__HAVE_DEVICE_REGISTER
+#define	__HAVE_NEW_STYLE_BUS_H
 #define	__HAVE_SYSCALL_INTERN
 #define	__GENERIC_SOFT_INTERRUPTS_ALL_LEVELS
 #define __HAVE_CPU_DATA_FIRST

Index: src/sys/arch/sparc/sparc/machdep.c
diff -u src/sys/arch/sparc/sparc/machdep.c:1.312 src/sys/arch/sparc/sparc/machdep.c:1.313
--- src/sys/arch/sparc/sparc/machdep.c:1.312	Sat Jul  2 13:10:53 2011
+++ src/sys/arch/sparc/sparc/machdep.c	Sun Jul 17 23:29:10 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.312 2011/07/02 13:10:53 mrg Exp $ */
+/*	$NetBSD: machdep.c,v 1.313 2011/07/17 23:29:10 dyoung Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.312 2011/07/02 13:10:53 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.313 2011/07/17 23:29:10 dyoung Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_sunos.h"
@@ -118,7 +118,7 @@
 
 #define _SPARC_BUS_DMA_PRIVATE
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -1863,6 +1863,892 @@
 static void sparc_bus_barrier(bus_space_tag_t, bus_space_handle_t,
 	bus_size_t, bus_size_t, int);
 
+int
+bus_space_map(t, a, s, f, hp)
+	bus_space_tag_t	t;
+	bus_addr_t	a;
+	bus_size_t	s;
+	int		f;
+	bus_space_handle_t *hp;
+{
+	return (*t->sparc_bus_map)(t, a, s, f, (vaddr_t)0, hp);
+}
+
+int
+bus_space_map2(t, a, s, f, v, hp)
+	bus_space_tag_t	t;
+	bus_addr_t	a;
+	bus_size_t	s;
+	int		f;
+	vaddr_t		v;
+	bus_space_handle_t *hp;
+{
+	return (*t->sparc_bus_map)(t, a, s, f, v, hp);
+}
+
+void
+bus_space_unmap(t, h, s)
+	bus_space_tag_t t;
+	bus_space_handle_t h;
+	bus_size_t	s;
+{
+	(*t->sparc_bus_unmap)(t, h, s);
+}
+
+int
+bus_space_subregion(t, h, o, s, hp)
+	bus_space_tag_t	t;
+	bus_space_handle_t h;
+	bus_size_t	o;
+	bus_size_t	s;
+	bus_space_handle_t *hp;
+{
+	return (*t->sparc_bus_subregion)(t, h, o, s, hp);
+}
+
+paddr_t
+bus_space_mmap(t, a, o, p, f)
+	bus_space_tag_t	t;
+	bus_addr_t	a;
+	off_t		o;
+	int		p;
+	int		f;
+{
+	return (*t->sparc_bus_mmap)(t, a, o, p, f);
+}
+
+void *
+bus_intr_establish(t, p, l, h, a)
+	bus_space_tag_t t;
+	int	p;
+	int	l;
+	int	(*h)(void *);
+	void	*a;
+{
+	return (*t->sparc_intr_establish)(t, p, l, h, a, NULL);
+}
+
+void *
+bus_intr_establish2(t, p, l, h, a, v)
+	bus_space_tag_t t;
+	int	p;
+	int	l;
+	int	(*h)(void *);
+	void	*a;
+	void	(*v)(void);
+{
+	return (*t->sparc_intr_establish)(t, p, l, h, a, v);
+}
+
+void
+bus_space_barrier(t, h, o, s, f)
+	bus_space_tag_t t;
+	bus_space_handle_t h;
+	bus_size_t o;
+	bus_size_t s;
+	int f;
+{
+	(*t->sparc_bus_barrier)(t, h, o, s, f);
+}
+
+void
+bus_space_write_multi_stream_2(t, h, o, a, c)
+	bus_space_tag_t		t;
+	bus_space_handle_t	h;
+	bus_size_t		o, c;
+	const uint16_t		*a;
+{
+	while (c-- > 0)
+		bus_space_write_2_real(t, h, o, *a++);
+}
+
+void
+bus_space_write_multi_stream_4(t, h, o, a, c)
+	bus_space_tag_t		t;
+	bus_space_handle_t	h;
+	bus_size_t		o, c;
+	const uint32_t		*a;
+{
+	while (c-- > 0)
+		bus_space_write_4_real(t, h, o, *a++);
+}
+
+void
+bus_space_write_multi_stream_8(t, h, o, a, c)
+	bus_space_tag_t		t;
+	bus_space_handle_t	h;
+	bus_size_t		o, c;
+	const uint64_t		*a;
+{
+	while (c-- > 0)
+		bus_space_write_8_real(t, h, o, *a++);
+}
+
+
+/*
+ *	void bus_space_set_multi_N(bus_space_tag_t tag,
+ *	bus_space_handle_t bsh, bus_size_t offset, u_intN_t val,
+ *	bus_size_t count);
+ *
+ * Write the 1, 2, 4, or 8 byte value `val' to bus space de

CVS commit: src/sys/arch

2011-07-17 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Sun Jul 17 23:27:02 UTC 2011

Modified Files:
src/sys/arch/bebox/include: types.h
src/sys/arch/ibmnws/include: types.h
src/sys/arch/prep/include: types.h
src/sys/arch/sandpoint/include: types.h
Removed Files:
src/sys/arch/bebox/include: bus.h

Log Message:
Switch more PowerPC ports having PCI support to new-style .


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r0 src/sys/arch/bebox/include/bus.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/bebox/include/types.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/ibmnws/include/types.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/prep/include/types.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sandpoint/include/types.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/bebox/include/types.h
diff -u src/sys/arch/bebox/include/types.h:1.11 src/sys/arch/bebox/include/types.h:1.12
--- src/sys/arch/bebox/include/types.h:1.11	Sat Jul 17 15:25:57 2010
+++ src/sys/arch/bebox/include/types.h	Sun Jul 17 23:27:02 2011
@@ -1,5 +1,5 @@
-/*	$NetBSD: types.h,v 1.11 2010/07/17 15:25:57 tsutsui Exp $	*/
+/*	$NetBSD: types.h,v 1.12 2011/07/17 23:27:02 dyoung Exp $	*/
 
-#define __HAVE_DEVICE_REGISTER
+#define __HAVE_NEW_STYLE_BUS_H
 
 #include 

Index: src/sys/arch/ibmnws/include/types.h
diff -u src/sys/arch/ibmnws/include/types.h:1.10 src/sys/arch/ibmnws/include/types.h:1.11
--- src/sys/arch/ibmnws/include/types.h:1.10	Sun Jan 20 18:09:07 2008
+++ src/sys/arch/ibmnws/include/types.h	Sun Jul 17 23:27:02 2011
@@ -1,5 +1,5 @@
-/*	$NetBSD: types.h,v 1.10 2008/01/20 18:09:07 joerg Exp $	*/
+/*	$NetBSD: types.h,v 1.11 2011/07/17 23:27:02 dyoung Exp $	*/
 
-#define	__HAVE_DEVICE_REGISTER
+#define	__HAVE_NEW_STYLE_BUS_H
 
 #include 

Index: src/sys/arch/prep/include/types.h
diff -u src/sys/arch/prep/include/types.h:1.12 src/sys/arch/prep/include/types.h:1.13
--- src/sys/arch/prep/include/types.h:1.12	Sun Jan 20 18:09:08 2008
+++ src/sys/arch/prep/include/types.h	Sun Jul 17 23:27:02 2011
@@ -1,5 +1,5 @@
-/*	$NetBSD: types.h,v 1.12 2008/01/20 18:09:08 joerg Exp $	*/
+/*	$NetBSD: types.h,v 1.13 2011/07/17 23:27:02 dyoung Exp $	*/
 
-#define __HAVE_DEVICE_REGISTER
+#define __HAVE_NEW_STYLE_BUS_H
 
 #include 

Index: src/sys/arch/sandpoint/include/types.h
diff -u src/sys/arch/sandpoint/include/types.h:1.7 src/sys/arch/sandpoint/include/types.h:1.8
--- src/sys/arch/sandpoint/include/types.h:1.7	Sat Jul 17 15:25:57 2010
+++ src/sys/arch/sandpoint/include/types.h	Sun Jul 17 23:27:02 2011
@@ -1,6 +1,6 @@
-/*	$NetBSD: types.h,v 1.7 2010/07/17 15:25:57 tsutsui Exp $	*/
+/*	$NetBSD: types.h,v 1.8 2011/07/17 23:27:02 dyoung Exp $	*/
 
-#define __HAVE_DEVICE_REGISTER
+#define __HAVE_NEW_STYLE_BUS_H
 
 #include 
 



CVS commit: src/sys/arch

2011-07-17 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Sun Jul 17 23:23:54 UTC 2011

Modified Files:
src/sys/arch/evbppc/include: types.h
src/sys/arch/macppc/include: types.h
src/sys/arch/mvmeppc/include: types.h
src/sys/arch/ofppc/include: types.h
src/sys/arch/powerpc/include: types.h
src/sys/arch/powerpc/oea: ofwoea_machdep.c
src/sys/arch/powerpc/powerpc: bus_dma.c
Removed Files:
src/sys/arch/evbppc/include: bus.h
src/sys/arch/macppc/include: bus.h
src/sys/arch/mvmeppc/include: bus.h
src/sys/arch/ofppc/include: bus.h
src/sys/arch/powerpc/include: bus.h

Log Message:
Enable new-style  on several PowerPC ports supporting PCI
buses.  Make non-inline implementations of bus_space(9) and bus_dma(9)
routines and move them to appropriate .c files.

This may leave amigappc in a bad state, sorry.  Fortunately, it will be
easy to repair by imitating the bus.h -> bus_{defs,funcs}.h split in
some other PowerPC port.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r0 src/sys/arch/evbppc/include/bus.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbppc/include/types.h
cvs rdiff -u -r1.26 -r0 src/sys/arch/macppc/include/bus.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/macppc/include/types.h
cvs rdiff -u -r1.6 -r0 src/sys/arch/mvmeppc/include/bus.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mvmeppc/include/types.h
cvs rdiff -u -r1.12 -r0 src/sys/arch/ofppc/include/bus.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/ofppc/include/types.h
cvs rdiff -u -r1.21 -r0 src/sys/arch/powerpc/include/bus.h
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/powerpc/include/types.h
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/powerpc/oea/ofwoea_machdep.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/powerpc/powerpc/bus_dma.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/evbppc/include/types.h
diff -u src/sys/arch/evbppc/include/types.h:1.9 src/sys/arch/evbppc/include/types.h:1.10
--- src/sys/arch/evbppc/include/types.h:1.9	Sun Jan 20 18:09:06 2008
+++ src/sys/arch/evbppc/include/types.h	Sun Jul 17 23:23:53 2011
@@ -1,5 +1,5 @@
-/*	$NetBSD: types.h,v 1.9 2008/01/20 18:09:06 joerg Exp $	*/
+/*	$NetBSD: types.h,v 1.10 2011/07/17 23:23:53 dyoung Exp $	*/
 
 #include 
 
-#define	__HAVE_DEVICE_REGISTER
+#define	__HAVE_NEW_STYLE_BUS_H

Index: src/sys/arch/macppc/include/types.h
diff -u src/sys/arch/macppc/include/types.h:1.13 src/sys/arch/macppc/include/types.h:1.14
--- src/sys/arch/macppc/include/types.h:1.13	Sun Jan 20 18:09:07 2008
+++ src/sys/arch/macppc/include/types.h	Sun Jul 17 23:23:53 2011
@@ -1,5 +1,5 @@
-/*	$NetBSD: types.h,v 1.13 2008/01/20 18:09:07 joerg Exp $	*/
+/*	$NetBSD: types.h,v 1.14 2011/07/17 23:23:53 dyoung Exp $	*/
 
 #include 
 
-#define	__HAVE_DEVICE_REGISTER
+#define	__HAVE_NEW_STYLE_BUS_H

Index: src/sys/arch/mvmeppc/include/types.h
diff -u src/sys/arch/mvmeppc/include/types.h:1.7 src/sys/arch/mvmeppc/include/types.h:1.8
--- src/sys/arch/mvmeppc/include/types.h:1.7	Sat Jul 17 15:25:57 2010
+++ src/sys/arch/mvmeppc/include/types.h	Sun Jul 17 23:23:53 2011
@@ -1,5 +1,5 @@
-/*	$NetBSD: types.h,v 1.7 2010/07/17 15:25:57 tsutsui Exp $	*/
+/*	$NetBSD: types.h,v 1.8 2011/07/17 23:23:53 dyoung Exp $	*/
 
 #include 
 
-#define __HAVE_DEVICE_REGISTER
+#define __HAVE_NEW_STYLE_BUS_H

Index: src/sys/arch/ofppc/include/types.h
diff -u src/sys/arch/ofppc/include/types.h:1.10 src/sys/arch/ofppc/include/types.h:1.11
--- src/sys/arch/ofppc/include/types.h:1.10	Sun Jan 20 18:09:08 2008
+++ src/sys/arch/ofppc/include/types.h	Sun Jul 17 23:23:53 2011
@@ -1,5 +1,5 @@
-/*	$NetBSD: types.h,v 1.10 2008/01/20 18:09:08 joerg Exp $	*/
+/*	$NetBSD: types.h,v 1.11 2011/07/17 23:23:53 dyoung Exp $	*/
 
-#define	__HAVE_DEVICE_REGISTER
+#define	__HAVE_NEW_STYLE_BUS_H
 
 #include 

Index: src/sys/arch/powerpc/include/types.h
diff -u src/sys/arch/powerpc/include/types.h:1.45 src/sys/arch/powerpc/include/types.h:1.46
--- src/sys/arch/powerpc/include/types.h:1.45	Thu Jun 23 01:27:20 2011
+++ src/sys/arch/powerpc/include/types.h	Sun Jul 17 23:23:54 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.45 2011/06/23 01:27:20 matt Exp $	*/
+/*	$NetBSD: types.h,v 1.46 2011/07/17 23:23:54 dyoung Exp $	*/
 
 /*-
  * Copyright (C) 1995 Wolfgang Solfrank.
@@ -75,6 +75,7 @@
 #define __SIMPLELOCK_UNLOCKED	0
 
 #define __HAVE_CPU_COUNTER
+#define __HAVE_NEW_STYLE_BUS_H
 #define __HAVE_SYSCALL_INTERN
 #define	__HAVE_CPU_DATA_FIRST
 #define	__HAVE_CPU_UAREA_ROUTINES

Index: src/sys/arch/powerpc/oea/ofwoea_machdep.c
diff -u src/sys/arch/powerpc/oea/ofwoea_machdep.c:1.23 src/sys/arch/powerpc/oea/ofwoea_machdep.c:1.24
--- src/sys/arch/powerpc/oea/ofwoea_machdep.c:1.23	Sat Jul  2 00:22:06 2011
+++ src/sys/arch/powerpc/oea/ofwoea_machdep.c	Sun Jul 17 23:23:54 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ofwoea_machdep.c,v 1.23 2011/07/02 00:22:06 matt Exp $ */
+/* $NetBSD: ofwoea_machdep.c,v 1.24 2011/07/17 23:23:54 d

CVS commit: src/sys/arch/sparc

2011-07-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jul 17 23:18:23 UTC 2011

Modified Files:
src/sys/arch/sparc/dev: fd.c power.c
src/sys/arch/sparc/sparc: autoconf.c auxreg.c cpu.c cpuunit.c iommu.c
memecc.c timer.c timer_msiiep.c timer_sun4.c timer_sun4m.c
timervar.h

Log Message:
convert all the sparc drivers that attach on my ss20 to use device_t,
cfdata_t and CFATTACH_DECL_NEW().

fd/fdc could use better testing, but i'm pretty sure i got it right.


To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.150 src/sys/arch/sparc/dev/fd.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/sparc/dev/power.c
cvs rdiff -u -r1.241 -r1.242 src/sys/arch/sparc/sparc/autoconf.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/sparc/sparc/auxreg.c
cvs rdiff -u -r1.232 -r1.233 src/sys/arch/sparc/sparc/cpu.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/sparc/sparc/cpuunit.c
cvs rdiff -u -r1.93 -r1.94 src/sys/arch/sparc/sparc/iommu.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sparc/sparc/memecc.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/sparc/sparc/timer.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/sparc/sparc/timer_msiiep.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/sparc/sparc/timer_sun4.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/sparc/sparc/timer_sun4m.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sparc/sparc/timervar.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/sparc/dev/fd.c
diff -u src/sys/arch/sparc/dev/fd.c:1.149 src/sys/arch/sparc/dev/fd.c:1.150
--- src/sys/arch/sparc/dev/fd.c:1.149	Wed Feb 24 22:37:55 2010
+++ src/sys/arch/sparc/dev/fd.c	Sun Jul 17 23:18:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fd.c,v 1.149 2010/02/24 22:37:55 dyoung Exp $	*/
+/*	$NetBSD: fd.c,v 1.150 2011/07/17 23:18:23 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.149 2010/02/24 22:37:55 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.150 2011/07/17 23:18:23 mrg Exp $");
 
 #include "opt_ddb.h"
 #include "opt_md.h"
@@ -174,7 +174,7 @@
 
 /* software state, per controller */
 struct fdc_softc {
-	struct device	sc_dev;		/* boilerplate */
+	struct device	*sc_dev;
 	bus_space_tag_t	sc_bustag;
 
 	struct callout sc_timo_ch;	/* timeout callout */
@@ -212,17 +212,17 @@
 extern	struct fdcio	*fdciop;	/* I/O descriptor used in fdintr.s */
 
 /* controller driver configuration */
-int	fdcmatch_mainbus(struct device *, struct cfdata *, void *);
-int	fdcmatch_obio(struct device *, struct cfdata *, void *);
-void	fdcattach_mainbus(struct device *, struct device *, void *);
-void	fdcattach_obio(struct device *, struct device *, void *);
+int	fdcmatch_mainbus(device_t, cfdata_t, void *);
+int	fdcmatch_obio(device_t, cfdata_t, void *);
+void	fdcattach_mainbus(device_t, device_t, void *);
+void	fdcattach_obio(device_t, device_t, void *);
 
 int	fdcattach(struct fdc_softc *, int);
 
-CFATTACH_DECL(fdc_mainbus, sizeof(struct fdc_softc),
+CFATTACH_DECL_NEW(fdc_mainbus, sizeof(struct fdc_softc),
 fdcmatch_mainbus, fdcattach_mainbus, NULL, NULL);
 
-CFATTACH_DECL(fdc_obio, sizeof(struct fdc_softc),
+CFATTACH_DECL_NEW(fdc_obio, sizeof(struct fdc_softc),
 fdcmatch_obio, fdcattach_obio, NULL, NULL);
 
 inline struct fd_type *fd_dev_to_type(struct fd_softc *, dev_t);
@@ -259,7 +259,7 @@
 
 /* software state, per disk (with up to 4 disks per ctlr) */
 struct fd_softc {
-	struct device	sc_dv;		/* generic device info */
+	struct device	*sc_dv;		/* generic device info */
 	struct disk	sc_dk;		/* generic disk info */
 
 	struct fd_type *sc_deftype;	/* default type descriptor */
@@ -289,12 +289,12 @@
 };
 
 /* floppy driver configuration */
-int	fdmatch(struct device *, struct cfdata *, void *);
-void	fdattach(struct device *, struct device *, void *);
+int	fdmatch(device_t, cfdata_t, void *);
+void	fdattach(device_t, device_t, void *);
 bool	fdshutdown(device_t, int);
 bool	fdsuspend(device_t, const pmf_qual_t *);
 
-CFATTACH_DECL(fd, sizeof(struct fd_softc),
+CFATTACH_DECL_NEW(fd, sizeof(struct fd_softc),
 fdmatch, fdattach, NULL, NULL);
 
 extern struct cfdriver fd_cd;
@@ -358,7 +358,7 @@
 #define OBP_FDNAME	(CPU_ISSUN4M ? "SUNW,fdtwo" : "fd")
 
 int
-fdcmatch_mainbus(struct device *parent, struct cfdata *match, void *aux)
+fdcmatch_mainbus(device_t parent, cfdata_t match, void *aux)
 {
 	struct mainbus_attach_args *ma = aux;
 
@@ -381,7 +381,7 @@
 }
 
 int
-fdcmatch_obio(struct device *parent, struct cfdata *match, void *aux)
+fdcmatch_obio(device_t parent, cfdata_t match, void *aux)
 {
 	union obio_attach_args *uoba = aux;
 	struct sbus_attach_args *sa;
@@ -533,11 +533,12 @@
 }
 
 void
-fdcattach_mainbus(struct device *parent, struct device *self, void *aux)
+fdcattach_mainbus(device_t parent, device_t self, void *aux)
 {
 	struct fdc_softc *fdc = device_private(self);
 	struct mainbus_attach_args *ma = aux;
 
+	fdc->sc_dev = self;
 	

CVS commit: src/sys/arch/powerpc/booke/dev

2011-07-17 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Sun Jul 17 23:08:56 UTC 2011

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3cfi.c pq3nandfcm.c

Log Message:
#include  not .


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/powerpc/booke/dev/pq3cfi.c \
src/sys/arch/powerpc/booke/dev/pq3nandfcm.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/powerpc/booke/dev/pq3cfi.c
diff -u src/sys/arch/powerpc/booke/dev/pq3cfi.c:1.1 src/sys/arch/powerpc/booke/dev/pq3cfi.c:1.2
--- src/sys/arch/powerpc/booke/dev/pq3cfi.c:1.1	Fri Jul 15 19:19:56 2011
+++ src/sys/arch/powerpc/booke/dev/pq3cfi.c	Sun Jul 17 23:08:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3cfi.c,v 1.1 2011/07/15 19:19:56 cliff Exp $	*/
+/*	$NetBSD: pq3cfi.c,v 1.2 2011/07/17 23:08:56 dyoung Exp $	*/
 
 /*
  * NOR CFI driver support for booke
@@ -8,7 +8,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pq3cfi.c,v 1.1 2011/07/15 19:19:56 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3cfi.c,v 1.2 2011/07/17 23:08:56 dyoung Exp $");
 
 #include 
 #include 
@@ -16,7 +16,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 #include 
 
Index: src/sys/arch/powerpc/booke/dev/pq3nandfcm.c
diff -u src/sys/arch/powerpc/booke/dev/pq3nandfcm.c:1.1 src/sys/arch/powerpc/booke/dev/pq3nandfcm.c:1.2
--- src/sys/arch/powerpc/booke/dev/pq3nandfcm.c:1.1	Thu Jun 30 04:44:26 2011
+++ src/sys/arch/powerpc/booke/dev/pq3nandfcm.c	Sun Jul 17 23:08:56 2011
@@ -32,14 +32,14 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pq3nandfcm.c,v 1.1 2011/06/30 04:44:26 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3nandfcm.c,v 1.2 2011/07/17 23:08:56 dyoung Exp $");
 
 #include 
 #include 
 #include 
 #include 
 
-#include 
+#include 
 
 #include 
 #include 



CVS commit: src/sys/ufs/ufs

2011-07-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 17 22:14:47 UTC 2011

Modified Files:
src/sys/ufs/ufs: ufs_wapbl.c

Log Message:
minor amendment to previous


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/ufs/ufs/ufs_wapbl.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/ufs/ufs/ufs_wapbl.c
diff -u src/sys/ufs/ufs/ufs_wapbl.c:1.17 src/sys/ufs/ufs/ufs_wapbl.c:1.18
--- src/sys/ufs/ufs/ufs_wapbl.c:1.17	Sun Jul 17 22:07:59 2011
+++ src/sys/ufs/ufs/ufs_wapbl.c	Sun Jul 17 22:14:47 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: ufs_wapbl.c,v 1.17 2011/07/17 22:07:59 dholland Exp $ */
+/*  $NetBSD: ufs_wapbl.c,v 1.18 2011/07/17 22:14:47 dholland Exp $ */
 
 /*-
  * Copyright (c) 2003,2006,2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ufs_wapbl.c,v 1.17 2011/07/17 22:07:59 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_wapbl.c,v 1.18 2011/07/17 22:14:47 dholland Exp $");
 
 #include 
 #include 
@@ -246,7 +246,9 @@
 			VOP_UNLOCK(v1);
 		}
 		VOP_UNLOCK(d1);
-		vrele(v1);
+		if (v1) {
+			vrele(v1);
+		}
 		return ENOENT;
 	}
 	error = do_relookup(d2, ulr2, &v2, cn2);
@@ -268,7 +270,9 @@
 			VOP_UNLOCK(v1);
 		}
 		VOP_UNLOCK(d1);
-		vrele(v1);
+		if (v1) {
+			vrele(v1);
+		}
 		return error;
 	}
 	if (v1 && v1->v_type != VDIR && v1 != v2) {



CVS commit: src/sys/ufs/ufs

2011-07-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 17 22:07:59 UTC 2011

Modified Files:
src/sys/ufs/ufs: ufs_extern.h ufs_lookup.c ufs_wapbl.c

Log Message:
Provide correct locking for ufs_wapbl_rename. Note that this does not
fix the non-wapbl rename; that will be coming soon. This patch also
leaves a lot of the older locking-related code around in #if 0 blocks,
and there's a lot of leftover redundant logic. All that will be going
away later.

Relates to at least these PRs:

  PR kern/24887
  PR kern/41417
  PR kern/42093
  PR kern/43626

and possibly others.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/ufs/ufs/ufs_extern.h
cvs rdiff -u -r1.110 -r1.111 src/sys/ufs/ufs/ufs_lookup.c
cvs rdiff -u -r1.16 -r1.17 src/sys/ufs/ufs/ufs_wapbl.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/ufs/ufs/ufs_extern.h
diff -u src/sys/ufs/ufs/ufs_extern.h:1.65 src/sys/ufs/ufs/ufs_extern.h:1.66
--- src/sys/ufs/ufs/ufs_extern.h:1.65	Tue Jul 12 16:59:49 2011
+++ src/sys/ufs/ufs/ufs_extern.h	Sun Jul 17 22:07:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_extern.h,v 1.65 2011/07/12 16:59:49 dholland Exp $	*/
+/*	$NetBSD: ufs_extern.h,v 1.66 2011/07/17 22:07:59 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -135,6 +135,8 @@
 		   struct inode *, ino_t, int, int, int);
 int	ufs_dirempty(struct inode *, ino_t, kauth_cred_t);
 int	ufs_checkpath(struct inode *, struct inode *, kauth_cred_t);
+int	ufs_parentcheck(struct vnode *, struct vnode *, kauth_cred_t,
+			int *, struct vnode **);
 int	ufs_blkatoff(struct vnode *, off_t, char **, struct buf **, bool);
 
 /* ufs_quota.c */

Index: src/sys/ufs/ufs/ufs_lookup.c
diff -u src/sys/ufs/ufs/ufs_lookup.c:1.110 src/sys/ufs/ufs/ufs_lookup.c:1.111
--- src/sys/ufs/ufs/ufs_lookup.c:1.110	Thu Jul 14 16:27:11 2011
+++ src/sys/ufs/ufs/ufs_lookup.c	Sun Jul 17 22:07:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_lookup.c,v 1.110 2011/07/14 16:27:11 dholland Exp $	*/
+/*	$NetBSD: ufs_lookup.c,v 1.111 2011/07/17 22:07:59 dholland Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ufs_lookup.c,v 1.110 2011/07/14 16:27:11 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_lookup.c,v 1.111 2011/07/17 22:07:59 dholland Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ffs.h"
@@ -1308,6 +1308,129 @@
 	return (error);
 }
 
+/*
+ * Extract the inode number of ".." from a directory.
+ * Helper for ufs_parentcheck.
+ */
+static int
+ufs_readdotdot(struct vnode *vp, int needswap, kauth_cred_t cred, ino_t *result)
+{
+	struct dirtemplate dirbuf;
+	int namlen, error;
+
+	error = vn_rdwr(UIO_READ, vp, &dirbuf,
+		sizeof (struct dirtemplate), (off_t)0, UIO_SYSSPACE,
+		IO_NODELOCKED, cred, NULL, NULL);
+	if (error) {
+		return error;
+	}
+
+#if (BYTE_ORDER == LITTLE_ENDIAN)
+	if (FSFMT(vp) && needswap == 0)
+		namlen = dirbuf.dotdot_type;
+	else
+		namlen = dirbuf.dotdot_namlen;
+#else
+	if (FSFMT(vp) && needswap != 0)
+		namlen = dirbuf.dotdot_type;
+	else
+		namlen = dirbuf.dotdot_namlen;
+#endif
+	if (namlen != 2 ||
+	dirbuf.dotdot_name[0] != '.' ||
+	dirbuf.dotdot_name[1] != '.') {
+		printf("ufs_readdotdot: directory %llu contains "
+		   "garbage instead of ..\n",
+		   (unsigned long long) VTOI(vp)->i_number);
+		return ENOTDIR;
+	}
+	*result = ufs_rw32(dirbuf.dotdot_ino, needswap);
+	return 0;
+}
+
+/*
+ * Check if LOWER is a descendent of UPPER. If we find UPPER, return
+ * nonzero in FOUND and return a reference to the immediate descendent
+ * of UPPER in UPPERCHILD. If we don't find UPPER (that is, if we
+ * reach the volume root and that isn't UPPER), return zero in FOUND
+ * and null in UPPERCHILD.
+ *
+ * Neither UPPER nor LOWER should be locked.
+ *
+ * On error (such as a permissions error checking up the directory
+ * tree) fail entirely.
+ *
+ * Note that UPPER and LOWER must be on the same volume, and because
+ * we inspect only that volume NEEDSWAP can be constant.
+ */
+int
+ufs_parentcheck(struct vnode *upper, struct vnode *lower, kauth_cred_t cred,
+		int *found_ret, struct vnode **upperchild_ret)
+{
+	const int needswap = UFS_MPNEEDSWAP(VTOI(lower)->i_ump);
+	ino_t upper_ino, found_ino;
+	struct vnode *current, *next;
+	int error;
+
+	if (upper == lower) {
+		vref(upper);
+		*found_ret = 1;
+		*upperchild_ret = upper;
+		return 0;
+	}
+	if (VTOI(lower)->i_number == ROOTINO) {
+		*found_ret = 0;
+		*upperchild_ret = NULL;
+		return 0;
+	}
+
+	upper_ino = VTOI(upper)->i_number;
+
+	current = lower;
+	vref(current);
+	vn_lock(current, LK_EXCLUSIVE | LK_RETRY);
+
+	for (;;) {
+		error = ufs_readdotdot(current, needswap, cred, &found_ino);
+		if (error) {
+			vput(current);
+			return error;
+		}
+		if (found_ino == upper_ino) {
+			VOP_UNLOCK(current);
+			*found_ret = 1;
+			*upperchild_ret = current;
+			return 0;
+		}
+		if (found_ino == ROOTINO) {
+			vput

CVS commit: src/sys/ufs/ufs

2011-07-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 17 22:02:27 UTC 2011

Modified Files:
src/sys/ufs/ufs: ufs_vnops.c

Log Message:
At the end of ufs_rmdir, don't use a dangling vnode pointer to call
fstrans_done. Ok hannken@


To generate a diff of this commit:
cvs rdiff -u -r1.194 -r1.195 src/sys/ufs/ufs/ufs_vnops.c

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

Modified files:

Index: src/sys/ufs/ufs/ufs_vnops.c
diff -u src/sys/ufs/ufs/ufs_vnops.c:1.194 src/sys/ufs/ufs/ufs_vnops.c:1.195
--- src/sys/ufs/ufs/ufs_vnops.c:1.194	Sun Jul 17 22:00:38 2011
+++ src/sys/ufs/ufs/ufs_vnops.c	Sun Jul 17 22:02:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_vnops.c,v 1.194 2011/07/17 22:00:38 dholland Exp $	*/
+/*	$NetBSD: ufs_vnops.c,v 1.195 2011/07/17 22:02:26 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.194 2011/07/17 22:00:38 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.195 2011/07/17 22:02:26 dholland Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1627,9 +1627,9 @@
 #endif
  out:
 	VN_KNOTE(vp, NOTE_DELETE);
+	fstrans_done(dvp->v_mount);
 	vput(dvp);
 	vput(vp);
-	fstrans_done(dvp->v_mount);
 	return (error);
 }
 



CVS commit: src/sys/ufs/ufs

2011-07-17 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 17 22:00:38 UTC 2011

Modified Files:
src/sys/ufs/ufs: ufs_vnops.c

Log Message:
Fix typo in ufs_rmdir that causes locking botches. This code should be
unreachable because the FS-independent code contains the same test... but
I'm not sure if that applies if nfsd is involved.


To generate a diff of this commit:
cvs rdiff -u -r1.193 -r1.194 src/sys/ufs/ufs/ufs_vnops.c

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

Modified files:

Index: src/sys/ufs/ufs/ufs_vnops.c
diff -u src/sys/ufs/ufs/ufs_vnops.c:1.193 src/sys/ufs/ufs/ufs_vnops.c:1.194
--- src/sys/ufs/ufs/ufs_vnops.c:1.193	Thu Jul 14 16:27:43 2011
+++ src/sys/ufs/ufs/ufs_vnops.c	Sun Jul 17 22:00:38 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_vnops.c,v 1.193 2011/07/14 16:27:43 dholland Exp $	*/
+/*	$NetBSD: ufs_vnops.c,v 1.194 2011/07/17 22:00:38 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.193 2011/07/14 16:27:43 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_vnops.c,v 1.194 2011/07/17 22:00:38 dholland Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1557,9 +1557,9 @@
 	 */
 	if (dp == ip || vp->v_mountedhere != NULL) {
 		if (dp == ip)
-			vrele(vp);
+			vrele(dvp);
 		else
-			vput(vp);
+			vput(dvp);
 		vput(vp);
 		return (EINVAL);
 	}



CVS commit: src/lib/libc/db/btree

2011-07-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 17 20:47:39 UTC 2011

Modified Files:
src/lib/libc/db/btree: bt_debug.c

Log Message:
fix type punned warnings in debugging code.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/db/btree/bt_debug.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/db/btree/bt_debug.c
diff -u src/lib/libc/db/btree/bt_debug.c:1.15 src/lib/libc/db/btree/bt_debug.c:1.16
--- src/lib/libc/db/btree/bt_debug.c:1.15	Wed Sep 10 13:52:35 2008
+++ src/lib/libc/db/btree/bt_debug.c	Sun Jul 17 16:47:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bt_debug.c,v 1.15 2008/09/10 17:52:35 joerg Exp $	*/
+/*	$NetBSD: bt_debug.c,v 1.16 2011/07/17 20:47:39 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: bt_debug.c,v 1.15 2008/09/10 17:52:35 joerg Exp $");
+__RCSID("$NetBSD: bt_debug.c,v 1.16 2011/07/17 20:47:39 christos Exp $");
 
 #include 
 #include 
@@ -124,6 +124,22 @@
 	}
 }
 
+static pgno_t
+__bt_pgno_t(const void *m)
+{
+	pgno_t r;
+	memcpy(&r, m, sizeof(r));
+	return r;
+}
+
+static uint32_t
+__bt_uint32_t(const void *m)
+{
+	uint32_t r;
+	memcpy(&r, m, sizeof(r));
+	return r;
+}
+
 /*
  * BT_DNPAGE -- Dump the page
  *
@@ -206,15 +222,16 @@
 			if (bl->flags & P_BIGKEY)
 (void)fprintf(stderr,
 "big key page %lu size %u/",
-(unsigned long) *(pgno_t *)(void *)bl->bytes,
-*(uint32_t *)(void *)(bl->bytes + sizeof(pgno_t)));
+(unsigned long) __bt_pgno_t(bl->bytes),
+__bt_uint32_t(bl->bytes + sizeof(pgno_t)));
 			else if (bl->ksize)
 (void)fprintf(stderr, "%s/", bl->bytes);
 			if (bl->flags & P_BIGDATA)
 (void)fprintf(stderr,
 "big data page %lu size %u",
-(unsigned long) *(pgno_t *)(void *)(bl->bytes + bl->ksize),
-*(uint32_t *)(void *)(bl->bytes + bl->ksize +
+(unsigned long)
+__bt_pgno_t(bl->bytes + bl->ksize),
+__bt_uint32_t(bl->bytes + bl->ksize +
 sizeof(pgno_t)));
 			else if (bl->dsize)
 (void)fprintf(stderr, "%.*s",
@@ -225,8 +242,8 @@
 			if (rl->flags & P_BIGDATA)
 (void)fprintf(stderr,
 "big data page %lu size %u",
-(unsigned long) *(pgno_t *)(void *)rl->bytes,
-*(uint32_t *)(void *)(rl->bytes + sizeof(pgno_t)));
+(unsigned long) __bt_pgno_t(rl->bytes),
+__bt_uint32_t(rl->bytes + sizeof(pgno_t)));
 			else if (rl->dsize)
 (void)fprintf(stderr,
 "%.*s", (int)rl->dsize, rl->bytes);



CVS commit: src

2011-07-17 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun Jul 17 20:07:59 UTC 2011

Modified Files:
src/external/bsd/llvm: Makefile.inc
src/external/bsd/llvm/bin/clang: Makefile
src/external/bsd/llvm/bin/llc: Makefile
src/external/bsd/llvm/bin/lli: Makefile
src/external/bsd/llvm/bin/llvm-mc: Makefile
src/external/bsd/llvm/config/llvm/Config: config.h llvm-config.h
src/external/bsd/llvm/lib: Makefile
src/external/bsd/llvm/lib/libLLVMARMCodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMARMMCTargetDesc: Makefile
src/external/bsd/llvm/lib/libLLVMCodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMMipsCodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMPowerPCCodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMSparcCodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMX86CodeGen: Makefile
src/external/bsd/llvm/lib/libLLVMX86MCTargetDesc: Makefile
Added Files:
src/external/bsd/llvm/lib/libLLVMMipsMCTargetDesc: Makefile
src/external/bsd/llvm/lib/libLLVMPowerPCMCTargetDesc: Makefile
src/external/bsd/llvm/lib/libLLVMSparcMCTargetDesc: Makefile
src/tools/llvm-lib/libLLVMMipsMCTargetDesc: Makefile
src/tools/llvm-lib/libLLVMPowerPCMCTargetDesc: Makefile
src/tools/llvm-lib/libLLVMSparcMCTargetDesc: Makefile

Log Message:
Update to Clang/LLVM r135360. Most importantly, this adjusts the
cc -print-search-dirs output to expand sysroot-prefixed library paths to
make live easier for libtool.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/llvm/Makefile.inc
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/llvm/bin/clang/Makefile
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/llvm/bin/llc/Makefile
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/llvm/bin/lli/Makefile
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/llvm/bin/llvm-mc/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/llvm/config/llvm/Config/config.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/llvm/config/llvm/Config/llvm-config.h
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/llvm/lib/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/llvm/lib/libLLVMARMCodeGen/Makefile
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/llvm/lib/libLLVMARMMCTargetDesc/Makefile
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/llvm/lib/libLLVMCodeGen/Makefile
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/llvm/lib/libLLVMMipsCodeGen/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/bsd/llvm/lib/libLLVMMipsMCTargetDesc/Makefile
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/llvm/lib/libLLVMPowerPCCodeGen/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/bsd/llvm/lib/libLLVMPowerPCMCTargetDesc/Makefile
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/llvm/lib/libLLVMSparcCodeGen/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/bsd/llvm/lib/libLLVMSparcMCTargetDesc/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/llvm/lib/libLLVMX86CodeGen/Makefile
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/llvm/lib/libLLVMX86MCTargetDesc/Makefile
cvs rdiff -u -r0 -r1.1 src/tools/llvm-lib/libLLVMMipsMCTargetDesc/Makefile
cvs rdiff -u -r0 -r1.1 src/tools/llvm-lib/libLLVMPowerPCMCTargetDesc/Makefile
cvs rdiff -u -r0 -r1.1 src/tools/llvm-lib/libLLVMSparcMCTargetDesc/Makefile

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

Modified files:

Index: src/external/bsd/llvm/Makefile.inc
diff -u src/external/bsd/llvm/Makefile.inc:1.16 src/external/bsd/llvm/Makefile.inc:1.17
--- src/external/bsd/llvm/Makefile.inc:1.16	Wed Jul 13 23:48:29 2011
+++ src/external/bsd/llvm/Makefile.inc	Sun Jul 17 20:07:57 2011
@@ -1,12 +1,12 @@
-#	$NetBSD: Makefile.inc,v 1.16 2011/07/13 23:48:29 joerg Exp $
+#	$NetBSD: Makefile.inc,v 1.17 2011/07/17 20:07:57 joerg Exp $
 
 .if !defined(LLVM_TOPLEVEL_MK)
 LLVM_TOPLEVEL_MK=
 
 .include 
 
-LLVM_REVISION=	135100
-CLANG_REVISION=	135100
+LLVM_REVISION=	135360
+CLANG_REVISION=	135360
 
 LLVM_SRCDIR:=	${.PARSEDIR}/dist/llvm
 CLANG_SRCDIR:=	${.PARSEDIR}/dist/clang

Index: src/external/bsd/llvm/bin/clang/Makefile
diff -u src/external/bsd/llvm/bin/clang/Makefile:1.13 src/external/bsd/llvm/bin/clang/Makefile:1.14
--- src/external/bsd/llvm/bin/clang/Makefile:1.13	Thu Jul 14 21:38:57 2011
+++ src/external/bsd/llvm/bin/clang/Makefile	Sun Jul 17 20:07:57 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13 2011/07/14 21:38:57 joerg Exp $
+#	$NetBSD: Makefile,v 1.14 2011/07/17 20:07:57 joerg Exp $
 
 PROG_CXX=	clang
 NOMAN=		yes
@@ -46,12 +46,15 @@
 	ARMAsmPrinter \
 	MipsCodeGen \
 	MipsTargetInfo \
+	MipsMCTargetDesc \
 	MipsAsmPrinter \
 	PowerPCCodeGen \
 	PowerPCTargetInfo \
+	PowerPCMCTargetDesc \
 	PowerPCAsmPrinter \
 	SparcCodeGen \
 	SparcTargetInfo \
+	SparcMCTargetDesc \
 	X86CodeGen \
 	X86MCTargetDesc \
 	X86TargetInfo \

Index: src/external/bsd/llvm/bin/llc/Makefile
diff -u src/external/bsd/llvm/bin/llc/Makefile:1.8 src/external/bsd/llvm/bin/llc/Ma

CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto/arch/x86_64

2011-07-17 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun Jul 17 19:48:31 UTC 2011

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/x86_64: aes.inc

Log Message:
Disable Clang's integrated assembler for the AES-NI files for now.
Somewhere in this mess of .byte streams, corruption happens. Disassembly
only shows slightly different filling of alignment sequences, further
analysis is needed.

XXX This should be rewritten to be proper assembler code


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/x86_64/aes.inc

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/openssl/lib/libcrypto/arch/x86_64/aes.inc
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/x86_64/aes.inc:1.2 src/crypto/external/bsd/openssl/lib/libcrypto/arch/x86_64/aes.inc:1.3
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/x86_64/aes.inc:1.2	Tue Jul  5 10:42:54 2011
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/x86_64/aes.inc	Sun Jul 17 19:48:31 2011
@@ -3,3 +3,6 @@
 AESCPPFLAGS = -DAES_ASM -DOPENSSL_IA32_SSE2
 AESNI = yes
 .include "../../aes.inc"
+
+COPTS.aesni-x86_64.S+=	${${ACTIVE_CC} == "clang":?-no-integrated-as:}
+COPTS.aes-x86_64.S+=	${${ACTIVE_CC} == "clang":?-no-integrated-as:}



CVS commit: [netbsd-5] src/doc

2011-07-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Jul 17 15:36:33 UTC 2011

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

Log Message:
Ticket 1645


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

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

Modified files:

Index: src/doc/CHANGES-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.93 src/doc/CHANGES-5.2:1.1.2.94
--- src/doc/CHANGES-5.2:1.1.2.93	Sat Jul 16 00:19:57 2011
+++ src/doc/CHANGES-5.2	Sun Jul 17 15:36:32 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.93 2011/07/16 00:19:57 riz Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.94 2011/07/17 15:36:32 riz Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -5397,3 +5397,25 @@
 	Prevent panic when removing a file with extended attributes.
 	[manu, ticket #1642]
 
+distrib/sets/lists/comp/mi			1.1634 via patch
+lib/libc/sys/Makefile.inc			1.207 via patch
+lib/libc/sys/extattr_get_file.2			patch
+lib/libpuffs/dispatcher.c			1.34,1.36 via patch
+lib/libpuffs/puffs.c1.107 via patch
+lib/libpuffs/puffs.h1.115,1.118 via patch
+sys/fs/puffs/puffs_msgif.h			1.71,1.76 via patch
+sys/fs/puffs/puffs_vfsops.c			1.88 via patch
+sys/fs/puffs/puffs_vnops.c			1.145,1.154 via patch
+sys/kern/vfs_xattr.c1.24-1.27 via patch
+sys/kern/vnode_if.c1.87 via patch
+sys/sys/Makefile1.133 via patch
+sys/sys/extattr.h1.6 via patch
+sys/sys/vnode_if.h1.81 via patch
+sys/ufs/ffs/ffs_vnops.cpatch
+sys/ufs/ufs/ufs_extattr.c			1.31,1.34 via patch
+
+	Support extended attribute backing store autocreation and
+	autoload, fix the Linux-like extattr API, and add puffs
+	support.
+	[manu, ticket #1645]
+



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

2011-07-17 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Sun Jul 17 15:16:59 UTC 2011

Modified Files:
src/sys/arch/amd64/amd64: machdep.c

Log Message:
CR4_PAE is always set to 1 under amd64, so indicate that PAE mode is
enabled. Can be useful for 32-bits test runs on amd64 hosts.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/arch/amd64/amd64/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/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.161 src/sys/arch/amd64/amd64/machdep.c:1.162
--- src/sys/arch/amd64/amd64/machdep.c:1.161	Sun Jun 12 03:35:37 2011
+++ src/sys/arch/amd64/amd64/machdep.c	Sun Jul 17 15:16:58 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.161 2011/06/12 03:35:37 rmind Exp $	*/
+/*	$NetBSD: machdep.c,v 1.162 2011/07/17 15:16:58 jym Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008
@@ -107,7 +107,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.161 2011/06/12 03:35:37 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.162 2011/07/17 15:16:58 jym Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -524,6 +524,12 @@
 		   CTLTYPE_QUAD, "tsc_freq", NULL,
 		   NULL, 0, &tsc_freq, 0,
 		   CTL_MACHDEP, CTL_CREATE, CTL_EOL);
+	sysctl_createv(clog, 0, NULL, NULL,
+		   CTLFLAG_PERMANENT | CTLFLAG_IMMEDIATE,
+		   CTLTYPE_INT, "pae",
+		   SYSCTL_DESCR("Whether the kernel uses PAE"),
+		   NULL, 1, NULL, 0,
+		   CTL_MACHDEP, CTL_CREATE, CTL_EOL);
 }
 
 void



CVS commit: src/sbin/fsck_v7fs

2011-07-17 Thread UCHIYAMA Yasushi
Module Name:src
Committed By:   uch
Date:   Sun Jul 17 12:47:38 UTC 2011

Modified Files:
src/sbin/fsck_v7fs: freeblock.c

Log Message:
fix freeblock counting


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sbin/fsck_v7fs/freeblock.c

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

Modified files:

Index: src/sbin/fsck_v7fs/freeblock.c
diff -u src/sbin/fsck_v7fs/freeblock.c:1.1 src/sbin/fsck_v7fs/freeblock.c:1.2
--- src/sbin/fsck_v7fs/freeblock.c:1.1	Mon Jun 27 11:52:58 2011
+++ src/sbin/fsck_v7fs/freeblock.c	Sun Jul 17 12:47:38 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: freeblock.c,v 1.1 2011/06/27 11:52:58 uch Exp $	*/
+/*	$NetBSD: freeblock.c,v 1.2 2011/07/17 12:47:38 uch Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: freeblock.c,v 1.1 2011/06/27 11:52:58 uch Exp $");
+__RCSID("$NetBSD: freeblock.c,v 1.2 2011/07/17 12:47:38 uch Exp $");
 #endif /* not lint */
 
 #include 
@@ -241,6 +241,7 @@
 		}
 
 		/* freeblock list is used as freeblock. */
+		n--;
 		if ((ret = func(fs, ctx, blk)))
 			return ret;
 



CVS commit: src/usr.bin/netstat

2011-07-17 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Sun Jul 17 10:22:08 UTC 2011

Modified Files:
src/usr.bin/netstat: main.c

Log Message:
Use errx() to display kvm_openfiles error message, the provided buffer
already has it.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/usr.bin/netstat/main.c

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

Modified files:

Index: src/usr.bin/netstat/main.c
diff -u src/usr.bin/netstat/main.c:1.79 src/usr.bin/netstat/main.c:1.80
--- src/usr.bin/netstat/main.c:1.79	Wed May  4 01:13:35 2011
+++ src/usr.bin/netstat/main.c	Sun Jul 17 10:22:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.79 2011/05/04 01:13:35 dyoung Exp $	*/
+/*	$NetBSD: main.c,v 1.80 2011/07/17 10:22:07 njoly Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "from: @(#)main.c	8.4 (Berkeley) 3/1/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.79 2011/05/04 01:13:35 dyoung Exp $");
+__RCSID("$NetBSD: main.c,v 1.80 2011/07/17 10:22:07 njoly Exp $");
 #endif
 #endif /* not lint */
 
@@ -363,7 +363,7 @@
 	if (kvmd != NULL)
 		return kvmd;
 	if ((kvmd = prepare_kvmd(nlistf, memf, buf)) == NULL)
-		err(1, "kvm error: %s", buf);
+		errx(1, "kvm error: %s", buf);
 	return kvmd;
 }
 
@@ -423,7 +423,7 @@
 	if (!use_sysctl) {
 
 		if (kvmd == NULL)
-			err(1, "kvm error: %s", buf);
+			errx(1, "kvm error: %s", buf);
 		if (kvm_nlist(kvmd, nl) < 0 || nl[0].n_type == 0) {
 			if (nf)
 errx(1, "%s: no namelist", nf);