CVS commit: src/share/man

2014-12-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec 13 14:16:48 UTC 2014

Modified Files:
src/share/man: Makefile

Log Message:
Fix MKRUMP = no build


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/share/man/Makefile

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/Makefile
diff -u src/share/man/Makefile:1.33 src/share/man/Makefile:1.34
--- src/share/man/Makefile:1.33	Sun Nov  9 12:39:37 2014
+++ src/share/man/Makefile	Sat Dec 13 09:16:48 2014
@@ -1,11 +1,14 @@
-#	$NetBSD: Makefile,v 1.33 2014/11/09 17:39:37 pooka Exp $
+#	$NetBSD: Makefile,v 1.34 2014/12/13 14:16:48 christos Exp $
 #	from: @(#)Makefile	8.2 (Berkeley) 4/16/94
 
 .include bsd.own.mk
 
 .if ${MKSHARE} != no
 SUBDIR=	man0 man1 man2 man3 man3lua man4 man5 man6 man7 man8 man9 man9lua
+
+.if ${MKRUMP} != no
 SUBDIR+=${.CURDIR}/../../sys/rump/share/man
+.endif
 
 WHATISDBDIR?=	/usr/share/man
 



CVS commit: src/distrib/amiga/miniroot

2014-12-13 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sat Dec 13 15:51:18 UTC 2014

Modified Files:
src/distrib/amiga/miniroot: Makefile.inc

Log Message:
Extend size of miniroot.fs from 6m to 7m.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/distrib/amiga/miniroot/Makefile.inc

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

Modified files:

Index: src/distrib/amiga/miniroot/Makefile.inc
diff -u src/distrib/amiga/miniroot/Makefile.inc:1.18 src/distrib/amiga/miniroot/Makefile.inc:1.19
--- src/distrib/amiga/miniroot/Makefile.inc:1.18	Thu Feb 11 09:06:47 2010
+++ src/distrib/amiga/miniroot/Makefile.inc	Sat Dec 13 15:51:18 2014
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile.inc,v 1.18 2010/02/11 09:06:47 roy Exp $
+#	$NetBSD: Makefile.inc,v 1.19 2014/12/13 15:51:18 phx Exp $
 
-IMAGESIZE=	6m
+IMAGESIZE=	7m
 MAKEFS_FLAGS=   -o density=4k
 IMAGEENDIAN=	be
 MAKEDEVTARGETS=	floppy



CVS commit: src/sys/coda

2014-12-13 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sat Dec 13 15:57:46 UTC 2014

Modified Files:
src/sys/coda: coda_subr.c coda_vfsops.c coda_vnops.c

Log Message:
Attach the control object vnode to the coda mount and release it
on unmount.  Initialize special files with NODEV.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/coda/coda_subr.c
cvs rdiff -u -r1.81 -r1.82 src/sys/coda/coda_vfsops.c
cvs rdiff -u -r1.98 -r1.99 src/sys/coda/coda_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/coda/coda_subr.c
diff -u src/sys/coda/coda_subr.c:1.27 src/sys/coda/coda_subr.c:1.28
--- src/sys/coda/coda_subr.c:1.27	Thu Aug  2 16:06:58 2012
+++ src/sys/coda/coda_subr.c	Sat Dec 13 15:57:46 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_subr.c,v 1.27 2012/08/02 16:06:58 christos Exp $	*/
+/*	$NetBSD: coda_subr.c,v 1.28 2014/12/13 15:57:46 hannken Exp $	*/
 
 /*
  *
@@ -55,7 +55,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: coda_subr.c,v 1.27 2012/08/02 16:06:58 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: coda_subr.c,v 1.28 2014/12/13 15:57:46 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -228,6 +228,8 @@ coda_kill(struct mount *whoIam, enum dc_
 
 	for (hash = 0; hash  CODA_CACHESIZE; hash++) {
 		for (cp = coda_cache[hash]; cp != NULL; cp = CNODE_NEXT(cp)) {
+			if (IS_CTL_VP(CTOV(cp)))
+continue;
 			if (CTOV(cp)-v_mount == whoIam) {
 #ifdef	DEBUG
 printf(coda_kill: vp %p, cp %p\n, CTOV(cp), cp);
@@ -302,11 +304,6 @@ coda_unmounting(struct mount *whoIam)
 	for (hash = 0; hash  CODA_CACHESIZE; hash++) {
 		for (cp = coda_cache[hash]; cp != NULL; cp = CNODE_NEXT(cp)) {
 			if (CTOV(cp)-v_mount == whoIam) {
-if (cp-c_flags  (C_LOCKED|C_WANTED)) {
-	printf(coda_unmounting: Unlocking %p\n, cp);
-	cp-c_flags = ~(C_LOCKED|C_WANTED);
-	wakeup((void *) cp);
-}
 cp-c_flags |= C_UNMOUNTING;
 			}
 		}

Index: src/sys/coda/coda_vfsops.c
diff -u src/sys/coda/coda_vfsops.c:1.81 src/sys/coda/coda_vfsops.c:1.82
--- src/sys/coda/coda_vfsops.c:1.81	Wed Apr 16 18:55:17 2014
+++ src/sys/coda/coda_vfsops.c	Sat Dec 13 15:57:46 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_vfsops.c,v 1.81 2014/04/16 18:55:17 maxv Exp $	*/
+/*	$NetBSD: coda_vfsops.c,v 1.82 2014/12/13 15:57:46 hannken Exp $	*/
 
 /*
  *
@@ -45,7 +45,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: coda_vfsops.c,v 1.81 2014/04/16 18:55:17 maxv Exp $);
+__KERNEL_RCSID(0, $NetBSD: coda_vfsops.c,v 1.82 2014/12/13 15:57:46 hannken Exp $);
 
 #ifndef _KERNEL_OPT
 #define	NVCODA 4
@@ -264,12 +264,7 @@ coda_mount(struct mount *vfsp,	/* Alloca
 rtvp = CTOV(cp);
 rtvp-v_vflag |= VV_ROOT;
 
-/*  cp = make_coda_node(ctlfid, vfsp, VCHR);
-The above code seems to cause a loop in the cnode links.
-I don't totally understand when it happens, it is caught
-when closing down the system.
- */
-cp = make_coda_node(ctlfid, 0, VCHR);
+cp = make_coda_node(ctlfid, vfsp, VCHR);
 
 coda_ctlvp = CTOV(cp);
 
@@ -325,6 +320,7 @@ coda_unmount(struct mount *vfsp, int mnt
 	mi-mi_started = 0;
 
 	vrele(mi-mi_rootvp);
+	vrele(coda_ctlvp);
 
 	active = coda_kill(vfsp, NOT_DOWNCALL);
 	mi-mi_rootvp-v_vflag = ~VV_ROOT;

Index: src/sys/coda/coda_vnops.c
diff -u src/sys/coda/coda_vnops.c:1.98 src/sys/coda/coda_vnops.c:1.99
--- src/sys/coda/coda_vnops.c:1.98	Sat Oct 18 08:33:27 2014
+++ src/sys/coda/coda_vnops.c	Sat Dec 13 15:57:46 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_vnops.c,v 1.98 2014/10/18 08:33:27 snj Exp $	*/
+/*	$NetBSD: coda_vnops.c,v 1.99 2014/12/13 15:57:46 hannken Exp $	*/
 
 /*
  *
@@ -46,7 +46,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: coda_vnops.c,v 1.98 2014/10/18 08:33:27 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: coda_vnops.c,v 1.99 2014/12/13 15:57:46 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -64,6 +64,7 @@ __KERNEL_RCSID(0, $NetBSD: coda_vnops.c
 #include sys/kauth.h
 
 #include miscfs/genfs/genfs.h
+#include miscfs/specfs/specdev.h
 
 #include coda/coda.h
 #include coda/cnode.h
@@ -836,6 +837,7 @@ coda_inactive(void *v)
 
 if (IS_CTL_VP(vp)) {
 	MARK_INT_SAT(CODA_INACTIVE_STATS);
+	VOP_UNLOCK(vp);
 	return 0;
 }
 
@@ -1844,6 +1846,8 @@ make_coda_node(CodaFid *fid, struct moun
 	vp-v_data = cp;
 	vp-v_type = type;
 	cp-c_vnode = vp;
+	if (type == VCHR || type == VBLK)
+		spec_node_init(vp, NODEV);
 	uvm_vnp_setsize(vp, 0);
 	coda_save(cp);
 
@@ -2014,7 +2018,7 @@ coda_putpages(void *v)
 #ifdef CODA_VERBOSE
 		printf(%s: control object %p\n, __func__, vp);
 #endif
-		return(EINVAL);
+		return 0;
 	}
 
 	/*



CVS commit: src/sys/coda

2014-12-13 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sat Dec 13 15:58:39 UTC 2014

Modified Files:
src/sys/coda: coda.h coda_psdev.c coda_subr.c coda_vfsops.c

Log Message:
Move the definition of NVCODA and CODA_COMPAT_5 to coda.h,
remove them from coda_vfsops.c and coda_psdev.c.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/coda/coda.h
cvs rdiff -u -r1.53 -r1.54 src/sys/coda/coda_psdev.c
cvs rdiff -u -r1.28 -r1.29 src/sys/coda/coda_subr.c
cvs rdiff -u -r1.82 -r1.83 src/sys/coda/coda_vfsops.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/coda/coda.h
diff -u src/sys/coda/coda.h:1.17 src/sys/coda/coda.h:1.18
--- src/sys/coda/coda.h:1.17	Sat Aug  7 20:39:33 2010
+++ src/sys/coda/coda.h	Sat Dec 13 15:58:39 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: coda.h,v 1.17 2010/08/07 20:39:33 christos Exp $ */
+/* $NetBSD: coda.h,v 1.18 2014/12/13 15:58:39 hannken Exp $ */
 
 /*
 
@@ -39,9 +39,14 @@ Mellon the rights to redistribute these 
 #ifndef _CODA_HEADER_
 #define _CODA_HEADER_
 
-#if defined(__NetBSD__)  defined(_KERNEL_OPT)
-/* pull in optional CODA_COMPAT_5 flag */
+#if defined(__NetBSD__)
+#if defined(_KERNEL_OPT)
+/* pull in optional CODA_COMPAT_5 flag and NVCODA. */
 #include opt_coda_compat.h
+#include vcoda.h
+#else
+#define NVCODA 4
+#endif
 #endif
 
 /* Catch new _KERNEL defn for NetBSD and DJGPP/__CYGWIN32__ */

Index: src/sys/coda/coda_psdev.c
diff -u src/sys/coda/coda_psdev.c:1.53 src/sys/coda/coda_psdev.c:1.54
--- src/sys/coda/coda_psdev.c:1.53	Fri Jul 25 08:10:35 2014
+++ src/sys/coda/coda_psdev.c	Sat Dec 13 15:58:39 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_psdev.c,v 1.53 2014/07/25 08:10:35 dholland Exp $	*/
+/*	$NetBSD: coda_psdev.c,v 1.54 2014/12/13 15:58:39 hannken Exp $	*/
 
 /*
  *
@@ -54,16 +54,10 @@
 /* These routines are the device entry points for Venus. */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: coda_psdev.c,v 1.53 2014/07/25 08:10:35 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: coda_psdev.c,v 1.54 2014/12/13 15:58:39 hannken Exp $);
 
 extern int coda_nc_initialized;/* Set if cache has been initialized */
 
-#ifndef _KERNEL_OPT
-#define	NVCODA 4
-#else
-#include vcoda.h
-#endif
-
 #include sys/param.h
 #include sys/systm.h
 #include sys/kernel.h

Index: src/sys/coda/coda_subr.c
diff -u src/sys/coda/coda_subr.c:1.28 src/sys/coda/coda_subr.c:1.29
--- src/sys/coda/coda_subr.c:1.28	Sat Dec 13 15:57:46 2014
+++ src/sys/coda/coda_subr.c	Sat Dec 13 15:58:39 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_subr.c,v 1.28 2014/12/13 15:57:46 hannken Exp $	*/
+/*	$NetBSD: coda_subr.c,v 1.29 2014/12/13 15:58:39 hannken Exp $	*/
 
 /*
  *
@@ -55,7 +55,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: coda_subr.c,v 1.28 2014/12/13 15:57:46 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: coda_subr.c,v 1.29 2014/12/13 15:58:39 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -70,9 +70,6 @@ __KERNEL_RCSID(0, $NetBSD: coda_subr.c,
 #include coda/coda_subr.h
 #include coda/coda_namecache.h
 
-#ifdef _KERNEL_OPT
-#include opt_coda_compat.h
-#endif
 
 int coda_active = 0;
 int coda_reuse = 0;

Index: src/sys/coda/coda_vfsops.c
diff -u src/sys/coda/coda_vfsops.c:1.82 src/sys/coda/coda_vfsops.c:1.83
--- src/sys/coda/coda_vfsops.c:1.82	Sat Dec 13 15:57:46 2014
+++ src/sys/coda/coda_vfsops.c	Sat Dec 13 15:58:39 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_vfsops.c,v 1.82 2014/12/13 15:57:46 hannken Exp $	*/
+/*	$NetBSD: coda_vfsops.c,v 1.83 2014/12/13 15:58:39 hannken Exp $	*/
 
 /*
  *
@@ -45,13 +45,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: coda_vfsops.c,v 1.82 2014/12/13 15:57:46 hannken Exp $);
-
-#ifndef _KERNEL_OPT
-#define	NVCODA 4
-#else
-#include vcoda.h
-#endif
+__KERNEL_RCSID(0, $NetBSD: coda_vfsops.c,v 1.83 2014/12/13 15:58:39 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h



CVS commit: src/sys/coda

2014-12-13 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sat Dec 13 15:58:13 UTC 2014

Modified Files:
src/sys/coda: cnode.h

Log Message:
Remove unused definitions (C_WANTED, C_LOCKED).


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/coda/cnode.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/coda/cnode.h
diff -u src/sys/coda/cnode.h:1.18 src/sys/coda/cnode.h:1.19
--- src/sys/coda/cnode.h:1.18	Fri May  4 01:38:56 2012
+++ src/sys/coda/cnode.h	Sat Dec 13 15:58:13 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cnode.h,v 1.18 2012/05/04 01:38:56 christos Exp $	*/
+/*	$NetBSD: cnode.h,v 1.19 2014/12/13 15:58:13 hannken Exp $	*/
 
 /*
  *
@@ -115,8 +115,6 @@ struct cnode {
 /* flags */
 #define C_VATTR		0x01	/* Validity of vattr in the cnode */
 #define C_SYMLINK	0x02	/* Validity of symlink pointer in the Code */
-#define C_WANTED	0x08	/* Set if lock wanted */
-#define C_LOCKED	0x10	/* Set if lock held */
 #define C_UNMOUNTING	0X20	/* Set if unmounting */
 #define C_PURGING	0x40	/* Set if purging a fid */
 



CVS commit: src/sys/coda

2014-12-13 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sat Dec 13 15:59:03 UTC 2014

Modified Files:
src/sys/coda: coda_vnops.c

Log Message:
Remove cnodes from coda_reclaim(), not from coda_inactive().


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/coda/coda_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/coda/coda_vnops.c
diff -u src/sys/coda/coda_vnops.c:1.99 src/sys/coda/coda_vnops.c:1.100
--- src/sys/coda/coda_vnops.c:1.99	Sat Dec 13 15:57:46 2014
+++ src/sys/coda/coda_vnops.c	Sat Dec 13 15:59:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_vnops.c,v 1.99 2014/12/13 15:57:46 hannken Exp $	*/
+/*	$NetBSD: coda_vnops.c,v 1.100 2014/12/13 15:59:03 hannken Exp $	*/
 
 /*
  *
@@ -46,7 +46,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: coda_vnops.c,v 1.99 2014/12/13 15:57:46 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: coda_vnops.c,v 1.100 2014/12/13 15:59:03 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -844,18 +844,6 @@ coda_inactive(void *v)
 CODADEBUG(CODA_INACTIVE, myprintf((in inactive, %s, vfsp %p\n,
   coda_f2s(cp-c_fid), vp-v_mount));)
 
-/* If an array has been allocated to hold the symlink, deallocate it */
-if ((coda_symlink_cache)  (VALID_SYMLINK(cp))) {
-	if (cp-c_symlink == NULL)
-	panic(%s: null symlink pointer in cnode, __func__);
-
-	CODA_FREE(cp-c_symlink, cp-c_symlen);
-	cp-c_flags = ~C_SYMLINK;
-	cp-c_symlen = 0;
-}
-
-/* Remove it from the table so it can't be found. */
-coda_unsave(cp);
 if (vp-v_mount-mnt_data == NULL) {
 	myprintf((Help! vfsp-vfs_data was NULL, but vnode %p wasn't dying\n, vp));
 	panic(badness in coda_inactive);
@@ -1676,6 +1664,18 @@ coda_reclaim(void *v)
 	}
 #endif
 }
+/* If an array has been allocated to hold the symlink, deallocate it */
+if ((coda_symlink_cache)  (VALID_SYMLINK(cp))) {
+	if (cp-c_symlink == NULL)
+	panic(%s: null symlink pointer in cnode, __func__);
+
+	CODA_FREE(cp-c_symlink, cp-c_symlen);
+	cp-c_flags = ~C_SYMLINK;
+	cp-c_symlen = 0;
+}
+
+/* Remove it from the table so it can't be found. */
+coda_unsave(cp);
 coda_free(VTOC(vp));
 SET_VTOC(vp) = NULL;
 return (0);



CVS commit: src/sys/coda

2014-12-13 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sat Dec 13 15:59:30 UTC 2014

Modified Files:
src/sys/coda: cnode.h coda_subr.c coda_vfsops.c coda_vfsops.h
coda_vnops.c

Log Message:
Change coda from hashlist to vcache.
- Replace all hash list crawlers with vfs_vnode_iterator.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/coda/cnode.h
cvs rdiff -u -r1.29 -r1.30 src/sys/coda/coda_subr.c
cvs rdiff -u -r1.83 -r1.84 src/sys/coda/coda_vfsops.c
cvs rdiff -u -r1.18 -r1.19 src/sys/coda/coda_vfsops.h
cvs rdiff -u -r1.100 -r1.101 src/sys/coda/coda_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/coda/cnode.h
diff -u src/sys/coda/cnode.h:1.19 src/sys/coda/cnode.h:1.20
--- src/sys/coda/cnode.h:1.19	Sat Dec 13 15:58:13 2014
+++ src/sys/coda/cnode.h	Sat Dec 13 15:59:30 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cnode.h,v 1.19 2014/12/13 15:58:13 hannken Exp $	*/
+/*	$NetBSD: cnode.h,v 1.20 2014/12/13 15:59:30 hannken Exp $	*/
 
 /*
  *
@@ -106,7 +106,7 @@ struct cnode {
 u_short		 c_symlen;	/* length of symbolic link */
 dev_t		 c_device;	/* associated vnode device */
 ino_t		 c_inode;	/* associated vnode inode */
-struct cnode	*c_next;	/* links if on NetBSD machine */
+kmutex_t		 c_lock;
 };
 #define	VTOC(vp)	((struct cnode *)(vp)-v_data)
 #define	SET_VTOC(vp)	((vp)-v_data)

Index: src/sys/coda/coda_subr.c
diff -u src/sys/coda/coda_subr.c:1.29 src/sys/coda/coda_subr.c:1.30
--- src/sys/coda/coda_subr.c:1.29	Sat Dec 13 15:58:39 2014
+++ src/sys/coda/coda_subr.c	Sat Dec 13 15:59:30 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_subr.c,v 1.29 2014/12/13 15:58:39 hannken Exp $	*/
+/*	$NetBSD: coda_subr.c,v 1.30 2014/12/13 15:59:30 hannken Exp $	*/
 
 /*
  *
@@ -55,7 +55,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: coda_subr.c,v 1.29 2014/12/13 15:58:39 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: coda_subr.c,v 1.30 2014/12/13 15:59:30 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -70,22 +70,11 @@ __KERNEL_RCSID(0, $NetBSD: coda_subr.c,
 #include coda/coda_subr.h
 #include coda/coda_namecache.h
 
-
-int coda_active = 0;
-int coda_reuse = 0;
-int coda_new = 0;
-
-struct cnode *coda_freelist = NULL;
-struct cnode *coda_cache[CODA_CACHESIZE];
-MALLOC_DEFINE(M_CODA, coda, Coda file system structures and tables);
-
 int codadebug = 0;
 int coda_printf_delay = 0;  /* in microseconds */
 int coda_vnop_print_entry = 0;
 int coda_vfsop_print_entry = 0;
 
-#define	CNODE_NEXT(cp)	((cp)-c_next)
-
 #ifdef CODA_COMPAT_5
 #define coda_hash(fid) \
 (((fid)-Volume + (fid)-Vnode)  (CODA_CACHESIZE-1))
@@ -99,99 +88,56 @@ int coda_vfsop_print_entry = 0;
 struct vnode *coda_ctlvp;
 
 /*
- * Allocate a cnode.
+ * Lookup a cnode by fid. If the cnode is dying, it is bogus so skip it.
+ * The cnode is returned locked with the vnode referenced.
  */
 struct cnode *
-coda_alloc(void)
+coda_find(CodaFid *fid)
 {
-struct cnode *cp;
-
-if (coda_freelist) {
-	cp = coda_freelist;
-	coda_freelist = CNODE_NEXT(cp);
-	coda_reuse++;
-}
-else {
-	CODA_ALLOC(cp, struct cnode *, sizeof(struct cnode));
-	/* NetBSD vnodes don't have any Pager info in them ('cause there are
-	   no external pagers, duh!) */
-#define VNODE_VM_INFO_INIT(vp) /* MT */
-	VNODE_VM_INFO_INIT(CTOV(cp));
-	coda_new++;
-}
-memset(cp, 0, sizeof (struct cnode));
+	int i;
+	struct vnode *vp;
+	struct cnode *cp;
 
-return(cp);
-}
+	for (i = 0; i  NVCODA; i++) {
+		if (!coda_mnttbl[i].mi_started)
+			continue;
+		if (vcache_get(coda_mnttbl[i].mi_vfsp,
+		fid, sizeof(CodaFid), vp) != 0)
+			continue;
+		mutex_enter(vp-v_interlock);
+		cp = VTOC(vp);
+		if (vp-v_type == VNON || cp == NULL || IS_UNMOUNTING(cp)) {
+			mutex_exit(vp-v_interlock);
+			vrele(vp);
+			continue;
+		}
+		mutex_enter(cp-c_lock);
+		mutex_exit(vp-v_interlock);
 
-/*
- * Deallocate a cnode.
- */
-void
-coda_free(struct cnode *cp)
-{
+		return cp;
+	}
 
-CNODE_NEXT(cp) = coda_freelist;
-coda_freelist = cp;
+	return NULL;
 }
 
 /*
- * Put a cnode in the hash table
+ * Iterate over all nodes attached to coda mounts.
  */
-void
-coda_save(struct cnode *cp)
+static void
+coda_iterate(bool (*f)(void *, struct vnode *), void *cl)
 {
-	CNODE_NEXT(cp) = coda_cache[coda_hash(cp-c_fid)];
-	coda_cache[coda_hash(cp-c_fid)] = cp;
-}
-
-/*
- * Remove a cnode from the hash table
- */
-void
-coda_unsave(struct cnode *cp)
-{
-struct cnode *ptr;
-struct cnode *ptrprev = NULL;
-
-ptr = coda_cache[coda_hash(cp-c_fid)];
-while (ptr != NULL) {
-	if (ptr == cp) {
-	if (ptrprev == NULL) {
-		coda_cache[coda_hash(cp-c_fid)]
-		= CNODE_NEXT(ptr);
-	} else {
-		CNODE_NEXT(ptrprev) = CNODE_NEXT(ptr);
-	}
-	CNODE_NEXT(cp) = NULL;
+	int i;
+	struct vnode_iterator *marker;
+	struct vnode *vp;
 
-	return;
+	for (i = 0; i  NVCODA; i++) { 
+		if (coda_mnttbl[i].mi_vfsp == 

CVS commit: src/sys/arch/arm/arm32

2014-12-13 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Dec 13 16:11:01 UTC 2014

Modified Files:
src/sys/arch/arm/arm32: arm32_boot.c

Log Message:
serialize printing of secondary cpu info


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/arm32/arm32_boot.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/arm/arm32/arm32_boot.c
diff -u src/sys/arch/arm/arm32/arm32_boot.c:1.10 src/sys/arch/arm/arm32/arm32_boot.c:1.11
--- src/sys/arch/arm/arm32/arm32_boot.c:1.10	Tue Nov  4 22:37:09 2014
+++ src/sys/arch/arm/arm32/arm32_boot.c	Sat Dec 13 16:11:01 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_boot.c,v 1.10 2014/11/04 22:37:09 matt Exp $	*/
+/*	$NetBSD: arm32_boot.c,v 1.11 2014/12/13 16:11:01 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -123,7 +123,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: arm32_boot.c,v 1.10 2014/11/04 22:37:09 matt Exp $);
+__KERNEL_RCSID(1, $NetBSD: arm32_boot.c,v 1.11 2014/12/13 16:11:01 jmcneill Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -151,6 +151,10 @@ __KERNEL_RCSID(1, $NetBSD: arm32_boot.c
 #include sys/kgdb.h
 #endif
 
+#ifdef MULTIPROCESSOR
+static kmutex_t cpu_hatch_lock;
+#endif
+
 vaddr_t
 initarm_common(vaddr_t kvm_base, vsize_t kvm_size,
 	const struct boot_physmem *bp, size_t nbp)
@@ -300,6 +304,10 @@ initarm_common(vaddr_t kvm_base, vsize_t
 		Debugger();
 #endif
 
+#ifdef MULTIPROCESSOR
+	mutex_init(cpu_hatch_lock, MUTEX_DEFAULT, IPL_HIGH);
+#endif
+
 #ifdef VERBOSE_INIT_ARM
 	printf(done.\n);
 #endif
@@ -383,6 +391,8 @@ cpu_hatch(struct cpu_info *ci, cpuid_t c
 	}
 #endif
 
+	mutex_enter(cpu_hatch_lock);
+
 	aprint_naive(%s, device_xname(ci-ci_dev));
 	aprint_normal(%s, device_xname(ci-ci_dev));
 	identify_arm_cpu(ci-ci_dev, ci);
@@ -391,6 +401,8 @@ cpu_hatch(struct cpu_info *ci, cpuid_t c
 #endif
 	vfp_attach(ci);
 
+	mutex_exit(cpu_hatch_lock);
+
 #ifdef VERBOSE_INIT_ARM
 	printf( interrupts);
 #endif



CVS commit: src/lib/librumpclient

2014-12-13 Thread Justin Cormack
Module Name:src
Committed By:   justin
Date:   Sat Dec 13 17:18:55 UTC 2014

Modified Files:
src/lib/librumpclient: rumpclient.c

Log Message:
Always use kqueue for BSDs in librumpclient

Tested now on the others


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/lib/librumpclient/rumpclient.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/librumpclient/rumpclient.c
diff -u src/lib/librumpclient/rumpclient.c:1.63 src/lib/librumpclient/rumpclient.c:1.64
--- src/lib/librumpclient/rumpclient.c:1.63	Mon Dec  8 01:10:07 2014
+++ src/lib/librumpclient/rumpclient.c	Sat Dec 13 17:18:55 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: rumpclient.c,v 1.63 2014/12/08 01:10:07 justin Exp $	*/
+/*  $NetBSD: rumpclient.c,v 1.64 2014/12/13 17:18:55 justin Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -32,8 +32,7 @@
 #include rump/rumpuser_port.h
 
 /*
- * We use kqueue on NetBSD and FreeBSD, poll elsewhere.  We could
- * use kqueue on other BSD's too, but I haven't tested those.  We
+ * We use kqueue on the BSDs, poll elsewhere.  We
  * want to use kqueue because it will give us the ability to get signal
  * notifications but defer their handling to a stage where we do not
  * hold the communication lock.  Taking a signal while holding on to
@@ -43,14 +42,15 @@
  * response from the server.
  */
 
-#if defined(__NetBSD__) || defined(__FreeBSD__)
+#if defined(__NetBSD__) || defined(__FreeBSD__) || \
+defined(__DragonFly__) || defined(__OpenBSD__)
 #define USE_KQUEUE
 #endif
 #if defined(__linux__)  !defined(__ANDROID__)
 #define USE_SIGNALFD
 #endif
 
-__RCSID($NetBSD: rumpclient.c,v 1.63 2014/12/08 01:10:07 justin Exp $);
+__RCSID($NetBSD: rumpclient.c,v 1.64 2014/12/13 17:18:55 justin Exp $);
 
 #include sys/param.h
 #include sys/mman.h



CVS commit: src/external/gpl3/binutils/dist

2014-12-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec 13 18:32:59 UTC 2014

Modified Files:
src/external/gpl3/binutils/dist/binutils: readelf.c
src/external/gpl3/binutils/dist/binutils/doc: readelf.1
src/external/gpl3/binutils/dist/include/elf: common.h

Log Message:
- Add -f to allow processing non-plain files.
- Align NetBSD note printing properly
- Add handling of PaX notes correctly. Perhaps we should rename them
  to NetBSD now.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/binutils/dist/binutils/readelf.c
cvs rdiff -u -r1.4 -r1.5 \
src/external/gpl3/binutils/dist/binutils/doc/readelf.1
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/binutils/dist/include/elf/common.h

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

Modified files:

Index: src/external/gpl3/binutils/dist/binutils/readelf.c
diff -u src/external/gpl3/binutils/dist/binutils/readelf.c:1.13 src/external/gpl3/binutils/dist/binutils/readelf.c:1.14
--- src/external/gpl3/binutils/dist/binutils/readelf.c:1.13	Fri Sep 19 13:19:53 2014
+++ src/external/gpl3/binutils/dist/binutils/readelf.c	Sat Dec 13 13:32:59 2014
@@ -185,6 +185,7 @@ static Elf_Internal_Phdr * program_heade
 static Elf_Internal_Dyn *  dynamic_section;
 static Elf_Internal_Shdr * symtab_shndx_hdr;
 static int show_name;
+static int do_special_files;
 static int do_dynamic;
 static int do_syms;
 static int do_dyn_syms;
@@ -3201,6 +3202,7 @@ static struct option options[] =
   {relocs,	   no_argument, 0, 'r'},
   {notes,	   no_argument, 0, 'n'},
   {dynamic,	   no_argument, 0, 'd'},
+  {special-files,no_argument, 0, 'f'},
   {arch-specific,no_argument, 0, 'A'},
   {version-info, no_argument, 0, 'V'},
   {use-dynamic,  no_argument, 0, 'D'},
@@ -3246,6 +3248,7 @@ usage (FILE * stream)
   -r --relocsDisplay the relocations (if present)\n\
   -u --unwindDisplay the unwind info (if present)\n\
   -d --dynamic   Display the dynamic section (if present)\n\
+  -f --special-files Process non-plain files too\n\
   -V --version-info  Display the version sections (if present)\n\
   -A --arch-specific Display architecture specific information (if any)\n\
   -c --archive-index Display the symbol/file index in an archive\n\
@@ -3365,7 +3368,7 @@ parse_args (int argc, char ** argv)
 usage (stderr);
 
   while ((c = getopt_long
-	  (argc, argv, ADHINR:SVWacdeghi:lnp:rstuvw::x:, options, NULL)) != EOF)
+	  (argc, argv, ADHINR:SVWacdefghi:lnp:rstuvw::x:, options, NULL)) != EOF)
 {
   switch (c)
 	{
@@ -3415,6 +3418,9 @@ parse_args (int argc, char ** argv)
 	case 'u':
 	  do_unwind++;
 	  break;
+	case 'f':
+	  do_special_files++;
+	  break;
 	case 'h':
 	  do_header++;
 	  break;
@@ -12706,14 +12712,24 @@ process_netbsd_elf_note (Elf_Internal_No
 		(version / 1) % 100  26 ? Z : ,
 		'A' + (version / 1) % 26); 
   else
-	printf (  NetBSD\t0x%08lx\tIDENT %u (%u.%u.%u)\n, pnote-descsz,
+	printf (  NetBSD\t\t0x%08lx\tIDENT %u (%u.%u.%u)\n, pnote-descsz,
 	version, version / 1, (version / 100) % 100,
 		(version / 100) % 100); 
   return 1;
 case NT_NETBSD_MARCH:
-  printf (  NetBSD\t0x%08lx\tMARCH %s\n, pnote-descsz,
+  printf (  NetBSD\t\t0x%08lx\tMARCH %s\n, pnote-descsz,
 	  pnote-descdata);
   return 1;
+case NT_NETBSD_PAX:
+  version = byte_get((unsigned char *)pnote-descdata, sizeof(version));
+  printf (  NetBSD\t\t0x%08lx\tPaX %s%s%s%s%s%s\n, pnote-descsz,
+	  ((version  NT_NETBSD_PAX_MPROTECT) ? +mprotect : ),
+	  ((version  NT_NETBSD_PAX_NOMPROTECT) ? -mprotect : ),
+	  ((version  NT_NETBSD_PAX_GUARD) ? +guard : ),
+	  ((version  NT_NETBSD_PAX_NOGUARD) ? -guard : ),
+	  ((version  NT_NETBSD_PAX_ASLR) ? +ASLR : ),
+	  ((version  NT_NETBSD_PAX_NOASLR) ? -ASLR : ));
+  return 1;
 default:
   break;
 }
@@ -13050,6 +13066,10 @@ process_note (Elf_Internal_Note * pnote)
 /* NetBSD-specific core file notes.  */
 return process_netbsd_elf_note (pnote);
 
+  else if (const_strneq (pnote-namedata, PaX))
+/* NetBSD-specific core file notes.  */
+return process_netbsd_elf_note (pnote);
+
   else if (const_strneq (pnote-namedata, NetBSD-CORE))
 /* NetBSD-specific core file notes.  */
 nt = get_netbsd_elfcore_note_type (pnote-type);
@@ -13789,7 +13809,7 @@ process_file (char * file_name)
   return 1;
 }
 
-  if (! S_ISREG (statbuf.st_mode))
+  if (!do_special_files  ! S_ISREG (statbuf.st_mode))
 {
   error (_('%s' is not an ordinary file\n), file_name);
   return 1;

Index: src/external/gpl3/binutils/dist/binutils/doc/readelf.1
diff -u src/external/gpl3/binutils/dist/binutils/doc/readelf.1:1.4 src/external/gpl3/binutils/dist/binutils/doc/readelf.1:1.5
--- src/external/gpl3/binutils/dist/binutils/doc/readelf.1:1.4	Sun Sep 29 10:03:30 2013

CVS commit: [netbsd-7] src/distrib/sets/lists/debug

2014-12-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Dec 13 18:49:51 UTC 2014

Modified Files:
src/distrib/sets/lists/debug [netbsd-7]: shl.mi

Log Message:
Pull up rev 1.83 requested by htodd in #306:
Fix usr/lib entry for libdm, which moved to lib.


To generate a diff of this commit:
cvs rdiff -u -r1.71.2.4 -r1.71.2.5 src/distrib/sets/lists/debug/shl.mi

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

Modified files:

Index: src/distrib/sets/lists/debug/shl.mi
diff -u src/distrib/sets/lists/debug/shl.mi:1.71.2.4 src/distrib/sets/lists/debug/shl.mi:1.71.2.5
--- src/distrib/sets/lists/debug/shl.mi:1.71.2.4	Thu Dec 11 23:53:34 2014
+++ src/distrib/sets/lists/debug/shl.mi	Sat Dec 13 18:49:51 2014
@@ -1,9 +1,9 @@
-# $NetBSD: shl.mi,v 1.71.2.4 2014/12/11 23:53:34 htodd Exp $
+# $NetBSD: shl.mi,v 1.71.2.5 2014/12/13 18:49:51 martin Exp $
 ./usr/libdata/debug/lib/libc.so.12.193.debug		comp-sys-debug	debug
 ./usr/libdata/debug/lib/libcrypt.so.1.0.debug		comp-sys-debug	debug
 ./usr/libdata/debug/lib/libcrypto.so.8.3.debug		comp-sys-debug	debug
 ./usr/libdata/debug/lib/libdevmapper.so.1.0.debug	comp-sys-debug	debug
-./usr/libdata/debug/lib/libdm.so.0.0.debug 		comp-sys-debug	debug
+./usr/libdata/debug/lib/libdm.so.0.0.debug 		comp-sys-debug	debug,obsolete
 ./usr/libdata/debug/lib/libedit.so.3.1.debug		comp-sys-debug	debug
 ./usr/libdata/debug/lib/libevent.so.4.0.debug		comp-sys-debug	debug
 ./usr/libdata/debug/lib/libgcc_s.so.1.0.debug		comp-sys-debug	gcc,debug



CVS commit: src/etc/mtree

2014-12-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec 13 18:55:18 UTC 2014

Modified Files:
src/etc/mtree: NetBSD.dist.base NetBSD.dist.x86_64

Log Message:
Add missing include directories


To generate a diff of this commit:
cvs rdiff -u -r1.139 -r1.140 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.8 -r1.9 src/etc/mtree/NetBSD.dist.x86_64

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

Modified files:

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.139 src/etc/mtree/NetBSD.dist.base:1.140
--- src/etc/mtree/NetBSD.dist.base:1.139	Sun Aug 10 13:32:54 2014
+++ src/etc/mtree/NetBSD.dist.base	Sat Dec 13 13:55:18 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.139 2014/08/10 17:32:54 joerg Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.140 2014/12/13 18:55:18 christos Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -131,7 +131,16 @@
 ./usr/include/event2
 ./usr/include/filecorefs
 ./usr/include/fs
-./usr/include/fs/smbfs
+./usr/include/efs
+./usr/include/hfs
+./usr/include/nilfs
+./usr/include/ptyfs
+./usr/include/puffs
+./usr/include/smbfs
+./usr/include/sysvbfs
+./usr/include/tmpfs
+./usr/include/udf
+./usr/include/v7fs
 ./usr/include/g++
 ./usr/include/g++/backward
 ./usr/include/g++/bits
@@ -197,6 +206,7 @@
 ./usr/include/netatalk
 ./usr/include/netbt
 ./usr/include/netinet
+./usr/include/net80211
 ./usr/include/netinet6
 ./usr/include/netipsec
 ./usr/include/netisdn

Index: src/etc/mtree/NetBSD.dist.x86_64
diff -u src/etc/mtree/NetBSD.dist.x86_64:1.8 src/etc/mtree/NetBSD.dist.x86_64:1.9
--- src/etc/mtree/NetBSD.dist.x86_64:1.8	Sat Jul 19 14:38:33 2014
+++ src/etc/mtree/NetBSD.dist.x86_64	Sat Dec 13 13:55:18 2014
@@ -1,9 +1,12 @@
-#	$NetBSD: NetBSD.dist.x86_64,v 1.8 2014/07/19 18:38:33 lneto Exp $
+#	$NetBSD: NetBSD.dist.x86_64,v 1.9 2014/12/13 18:55:18 christos Exp $
 
 ./lib/i386
 ./lib/i386/npf
+./usr/include/amd64
 ./usr/include/g++/bits/i386
 ./usr/include/g++/bits/x86_64
+./usr/include/i386
+./usr/include/x86
 ./usr/lib/i386
 ./usr/lib/i386/i18n
 ./usr/lib/i386/lua



CVS commit: [netbsd-7] src/doc

2014-12-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Dec 13 18:56:34 UTC 2014

Modified Files:
src/doc [netbsd-7]: CHANGES-7.0

Log Message:
Update entry for #306 for an additional pullup


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.128 -r1.1.2.129 src/doc/CHANGES-7.0

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-7.0
diff -u src/doc/CHANGES-7.0:1.1.2.128 src/doc/CHANGES-7.0:1.1.2.129
--- src/doc/CHANGES-7.0:1.1.2.128	Fri Dec 12 19:13:32 2014
+++ src/doc/CHANGES-7.0	Sat Dec 13 18:56:34 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.128 2014/12/12 19:13:32 martin Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.129 2014/12/13 18:56:34 martin Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -3394,7 +3394,7 @@ sbin/ccdconfig/ccdconfig.c			1.56
 	[mlelstv, ticket #305]
 
 distrib/sets/lists/base/shl.mi			1.723
-distrib/sets/lists/debug/shl.mi			1.82
+distrib/sets/lists/debug/shl.mi			1.82-1.83
 lib/libdm/Makefile1.4
 
 	libdm is needed by LVM early in the boot process. Fixes bin/49357.



CVS commit: [netbsd-7] src/sys/sys

2014-12-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Dec 13 19:13:25 UTC 2014

Modified Files:
src/sys/sys [netbsd-7]: cdefs_elf.h

Log Message:
Pull up following revision(s) (requested by joerg in ticket #316):
sys/sys/cdefs_elf.h: revision 1.47
Add macro to mark a symbol as weak. Use it to mark the end of a linker
set as empty linker set otherwise violate the aliasing rules of C by
presenting zero sized objects.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.44.2.1 src/sys/sys/cdefs_elf.h

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

Modified files:

Index: src/sys/sys/cdefs_elf.h
diff -u src/sys/sys/cdefs_elf.h:1.44 src/sys/sys/cdefs_elf.h:1.44.2.1
--- src/sys/sys/cdefs_elf.h:1.44	Tue May 13 19:58:23 2014
+++ src/sys/sys/cdefs_elf.h	Sat Dec 13 19:13:25 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs_elf.h,v 1.44 2014/05/13 19:58:23 christos Exp $	*/
+/*	$NetBSD: cdefs_elf.h,v 1.44.2.1 2014/12/13 19:13:25 martin Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -65,6 +65,12 @@
 __asm(.weak  _C_LABEL_STRING(#sym));
 
 #if __GNUC_PREREQ__(4, 0)
+#define	__weak	__attribute__((__weak__))
+#else
+#define	__weak
+#endif
+
+#if __GNUC_PREREQ__(4, 0)
 #define	__weak_reference(sym)	__attribute__((__weakref__(#sym)))
 #else
 #define	__weak_reference(sym)	; __asm(.weak  _C_LABEL_STRING(#sym))
@@ -157,7 +163,7 @@
 
 #define	__link_set_decl(set, ptype)	\
 	extern ptype * const __link_set_start(set)[] __dso_hidden;	\
-	extern ptype * const __link_set_end(set)[] __dso_hidden
+	extern ptype * const __link_set_end(set)[] __weak __dso_hidden
 
 #define	__link_set_count(set)		\
 	(__link_set_end(set) - __link_set_start(set))



CVS commit: [netbsd-7] src/sys/conf

2014-12-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Dec 13 19:23:10 UTC 2014

Modified Files:
src/sys/conf [netbsd-7]: Makefile.kern.inc

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #317):
sys/conf/Makefile.kern.inc: revision 1.179
Trim   at the beginning of version string to follow the change
in rev.1.60 of newvers.sh.
-const char sccs[] = @(#)${fullversion};
+const char sccs[] = @(#) ${fullversion_source};


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.169.2.1 src/sys/conf/Makefile.kern.inc

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

Modified files:

Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.169 src/sys/conf/Makefile.kern.inc:1.169.2.1
--- src/sys/conf/Makefile.kern.inc:1.169	Fri Aug  8 14:42:58 2014
+++ src/sys/conf/Makefile.kern.inc	Sat Dec 13 19:23:09 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.169 2014/08/08 14:42:58 joerg Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.169.2.1 2014/12/13 19:23:09 martin Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -281,7 +281,7 @@ SYSTEM_LD_TAIL?=true
 SYSTEM_LD_TAIL_DEBUG?=true
 .else
 SYSTEM_LD_TAIL?=@${SYSTEM_LD_TAIL_DBSYM} ; \
-		${TOOL_SED} '/const char sccs/!d;s/.*@(.)//;s/\\.*//' vers.c; \
+		${TOOL_SED} '/const char sccs/!d;s/.*@(.)//;s/ //;s/\\.*//' vers.c; \
 		${SIZE} $@; chmod 755 $@; \
 		${SYSTEM_CTFMERGE}
 SYSTEM_LD_TAIL_DEBUG?=; \



CVS commit: src/etc/mtree

2014-12-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec 13 19:23:35 UTC 2014

Modified Files:
src/etc/mtree: NetBSD.dist.base

Log Message:
add missing /fs/


To generate a diff of this commit:
cvs rdiff -u -r1.140 -r1.141 src/etc/mtree/NetBSD.dist.base

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

Modified files:

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.140 src/etc/mtree/NetBSD.dist.base:1.141
--- src/etc/mtree/NetBSD.dist.base:1.140	Sat Dec 13 13:55:18 2014
+++ src/etc/mtree/NetBSD.dist.base	Sat Dec 13 14:23:35 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.140 2014/12/13 18:55:18 christos Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.141 2014/12/13 19:23:35 christos Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -131,16 +131,16 @@
 ./usr/include/event2
 ./usr/include/filecorefs
 ./usr/include/fs
-./usr/include/efs
-./usr/include/hfs
-./usr/include/nilfs
-./usr/include/ptyfs
-./usr/include/puffs
-./usr/include/smbfs
-./usr/include/sysvbfs
-./usr/include/tmpfs
-./usr/include/udf
-./usr/include/v7fs
+./usr/include/fs/efs
+./usr/include/fs/hfs
+./usr/include/fs/nilfs
+./usr/include/fs/ptyfs
+./usr/include/fs/puffs
+./usr/include/fs/smbfs
+./usr/include/fs/sysvbfs
+./usr/include/fs/tmpfs
+./usr/include/fs/udf
+./usr/include/fs/v7fs
 ./usr/include/g++
 ./usr/include/g++/backward
 ./usr/include/g++/bits



CVS commit: src/sys/dev/bluetooth

2014-12-13 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sat Dec 13 19:28:55 UTC 2014

Modified Files:
src/sys/dev/bluetooth: btms.c

Log Message:
Added quirk for ELECOM M-XG2BB.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/bluetooth/btms.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/bluetooth/btms.c
diff -u src/sys/dev/bluetooth/btms.c:1.11 src/sys/dev/bluetooth/btms.c:1.12
--- src/sys/dev/bluetooth/btms.c:1.11	Sat Oct 27 17:18:15 2012
+++ src/sys/dev/bluetooth/btms.c	Sat Dec 13 19:28:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: btms.c,v 1.11 2012/10/27 17:18:15 chs Exp $	*/
+/*	$NetBSD: btms.c,v 1.12 2014/12/13 19:28:55 nonaka Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: btms.c,v 1.11 2012/10/27 17:18:15 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: btms.c,v 1.12 2014/12/13 19:28:55 nonaka Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -86,6 +86,15 @@ __KERNEL_RCSID(0, $NetBSD: btms.c,v 1.1
 #include dev/wscons/wsconsio.h
 #include dev/wscons/wsmousevar.h
 
+#ifdef BTMS_DEBUG
+int btms_debug = 0;
+#define	BTMSDBG(s)	if (btms_debug) printf s
+#define	BTMSDBGN(n,s)	if (btms_debug  (n)) printf s
+#else
+#define	BTMSDBG(s)
+#define	BTMSDBGN(n,s)
+#endif
+
 #define MAX_BUTTONS	31
 #define BUTTON(n)	(1  (((n) == 1 || (n) == 2) ? 3 - (n) : (n)))
 #define NOTMOUSE(f)	(((f)  (HIO_CONST | HIO_RELATIVE)) != HIO_RELATIVE)
@@ -135,6 +144,40 @@ static const struct wsmouse_accessops bt
 /* bthid methods */
 static void btms_input(struct bthidev *, uint8_t *, int);
 
+#ifdef BTMS_DEBUG
+static void	btms_print_device(struct btms_softc *);
+#endif
+
+/*
+ * quirks
+ */
+static const struct btms_quirk {
+	int		vendor;
+	int		product;
+
+	uint32_t	flags;
+#define	BTMS_QUIRK_ELECOM	__BIT(0)
+} btms_quirk_table[] = {
+	/* ELECOM M-XG2BB */
+	{ 0x056e, 0x00d2, BTMS_QUIRK_ELECOM },
+};
+
+static uint32_t
+btms_lookup_quirk_flags(int vendor, int product)
+{
+	const struct btms_quirk *q;
+	int i;
+
+	for (i = 0; i  __arraycount(btms_quirk_table); ++i) {
+		q = btms_quirk_table[i];
+		if (vendor == q-vendor  product == q-product)
+			return q-flags;
+	}
+	return 0;
+}
+
+static void btms_fixup_elecom(struct bthidev_attach_args *,struct btms_softc *);
+
 /*
  *
  *	btms autoconf(9) routines
@@ -159,11 +202,13 @@ btms_attach(device_t parent, device_t se
 	struct bthidev_attach_args *ba = aux;
 	struct wsmousedev_attach_args wsma;
 	struct hid_location *zloc;
-	uint32_t flags;
+	uint32_t flags, quirks;
 	int i, hl;
 
 	ba-ba_input = btms_input;
 
+	quirks = btms_lookup_quirk_flags(ba-ba_vendor, ba-ba_product);
+
 	/* control the horizontal */
 	hl = hid_locate(ba-ba_desc,
 			ba-ba_dlen,
@@ -265,12 +310,19 @@ btms_attach(device_t parent, device_t se
 	}
 	sc-sc_num_buttons = i - 1;
 
+	if (ISSET(quirks, BTMS_QUIRK_ELECOM))
+		btms_fixup_elecom(ba, sc);
+
 	aprint_normal(: %d button%s%s%s%s.\n,
 			sc-sc_num_buttons,
 			sc-sc_num_buttons == 1 ?  : s,
 			sc-sc_flags  BTMS_HASW ? , W : ,
 			sc-sc_flags  BTMS_HASZ ?  and Z dir : ,
 			sc-sc_flags  BTMS_HASW ? s : );
+#ifdef BTMS_DEBUG
+	if (btms_debug)
+		btms_print_device(sc);
+#endif
 
 	wsma.accessops = btms_wsmouse_accessops;
 	wsma.accesscookie = sc;
@@ -354,6 +406,16 @@ btms_input(struct bthidev *hidev, uint8_
 	if (sc-sc_wsmouse == NULL || sc-sc_enabled == 0)
 		return;
 
+#ifdef BTMS_DEBUG
+	if (btms_debug  9) {
+		printf(%s: data: , __func__);
+		for (i = 0; i  len; ++i) {
+			printf(%02x, data[i]);
+		}
+		printf(\n);
+	}
+#endif
+
 	dx =  hid_get_data(data, sc-sc_loc_x);
 	dy = -hid_get_data(data, sc-sc_loc_y);
 	dz =  hid_get_data(data, sc-sc_loc_z);
@@ -367,6 +429,8 @@ btms_input(struct bthidev *hidev, uint8_
 		if (hid_get_data(data, sc-sc_loc_button[i]))
 			buttons |= BUTTON(i);
 
+	BTMSDBGN(9,(%s: dx=%d, dy=%d, dz=%d, dw=%d, buttons=0x%08x\n,
+	__func__, dx, dy, dz, dw, buttons));
 	if (dx != 0 || dy != 0 || dz != 0 || dw != 0 || buttons != sc-sc_buttons) {
 		sc-sc_buttons = buttons;
 
@@ -378,3 +442,51 @@ btms_input(struct bthidev *hidev, uint8_
 		splx(s);
 	}
 }
+
+#ifdef BTMS_DEBUG
+static void
+btms_print_device(struct btms_softc *sc)
+{
+	int i;
+
+	printf(btms: X: pos=%d, size=%d\n,
+	sc-sc_loc_x.pos, sc-sc_loc_x.size);
+	printf(btms: Y: pos=%d, size=%d\n,
+	sc-sc_loc_y.pos, sc-sc_loc_y.size);
+	if (sc-sc_flags  BTMS_HASZ) {
+		printf(btms: Z: pos=%d, size=%d%s\n,
+		sc-sc_loc_z.pos, sc-sc_loc_z.size,
+		((sc-sc_flags  BTMS_REVZ) ? , REVZ : ));
+	}
+	if (sc-sc_flags  BTMS_HASW) {
+		printf(btms: W: pos=%d, size=%d\n,
+		sc-sc_loc_w.pos, sc-sc_loc_w.size);
+	}
+
+	for (i = 0; i  sc-sc_num_buttons; ++i) {
+		printf(btms: button%d: pos=%d, size=%d\n, i,
+		sc-sc_loc_button[i].pos, sc-sc_loc_button[i].size);
+	}
+}
+#endif
+

CVS commit: [netbsd-7] src/sys/arch/sparc64

2014-12-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Dec 13 19:29:28 UTC 2014

Modified Files:
src/sys/arch/sparc64/include [netbsd-7]: psl.h
src/sys/arch/sparc64/sparc64 [netbsd-7]: cpu.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #318):
sys/arch/sparc64/include/psl.h: revision 1.54
sys/arch/sparc64/include/psl.h: revision 1.55
sys/arch/sparc64/sparc64/cpu.c: revision 1.121
Make getver() into a constant function since Version Register (%ver)
is read only and its value is constant.
This change reduces multipule %ver reads to one in the functions
which uses a number of CPU_IS_* macros.
Use GETVER_CPU_* macros.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.53.4.1 src/sys/arch/sparc64/include/psl.h
cvs rdiff -u -r1.116 -r1.116.2.1 src/sys/arch/sparc64/sparc64/cpu.c

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

Modified files:

Index: src/sys/arch/sparc64/include/psl.h
diff -u src/sys/arch/sparc64/include/psl.h:1.53 src/sys/arch/sparc64/include/psl.h:1.53.4.1
--- src/sys/arch/sparc64/include/psl.h:1.53	Sun Aug 18 09:31:38 2013
+++ src/sys/arch/sparc64/include/psl.h	Sat Dec 13 19:29:28 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.53 2013/08/18 09:31:38 martin Exp $ */
+/*	$NetBSD: psl.h,v 1.53.4.1 2014/12/13 19:29:28 martin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -287,6 +287,13 @@
 /*
  * Inlines for manipulating privileged and ancillary state registers
  */
+#define SPARC64_RDCONST_DEF(rd, name, reg, type)			\
+static __inline __constfunc type get##name(void)			\
+{	\
+	type _val;			\
+	__asm(#rd  % #reg ,%0 : =r (_val));			\
+	return _val;			\
+}
 #define SPARC64_RD_DEF(rd, name, reg, type)\
 static __inline type get##name(void)	\
 {	\
@@ -301,9 +308,19 @@ static __inline void set##name(type _val
 }
 
 #ifdef __arch64__
+#define SPARC64_RDCONST64_DEF(rd, name, reg) \
+	SPARC64_RDCONST_DEF(rd, name, reg, uint64_t)
 #define SPARC64_RD64_DEF(rd, name, reg) SPARC64_RD_DEF(rd, name, reg, uint64_t)
 #define SPARC64_WR64_DEF(wr, name, reg) SPARC64_WR_DEF(wr, name, reg, uint64_t)
 #else
+#define SPARC64_RDCONST64_DEF(rd, name, reg)\
+static __inline __constfunc uint64_t get##name(void)			\
+{	\
+	uint32_t _hi, _lo;		\
+	__asm(#rd  % #reg ,%0; srl %0,0,%1; srlx %0,32,%0		\
+		: =r (_hi), =r (_lo));\
+	return ((uint64_t)_hi  32) | _lo;\
+}
 #define SPARC64_RD64_DEF(rd, name, reg)	\
 static __inline uint64_t get##name(void)\
 {	\
@@ -345,13 +362,14 @@ SPARC64_RDPR_DEF(cwp, %cwp, int)		/* get
 SPARC64_WRPR_DEF(cwp, %cwp, int)		/* setcwp() */
 
 /* Version Register (PR 31) */
-SPARC64_RDPR64_DEF(ver, %ver)			/* getver() */
+SPARC64_RDCONST64_DEF(rdpr, ver, %ver)		/* getver() */
 
 /* System Tick Register (ASR 24) */
 SPARC64_RDASR64_DEF(stick, STICK)		/* getstick() */
 SPARC64_WRASR64_DEF(stick, STICK)		/* setstick() */
 
 /* Some simple macros to check the cpu type. */
+#define GETVER_CPU_MASK()	((getver()  VER_MASK)  VER_MASK_SHIFT)
 #define GETVER_CPU_IMPL()	((getver()  VER_IMPL)  VER_IMPL_SHIFT)
 #define GETVER_CPU_MANUF()	((getver()  VER_MANUF)  VER_MANUF_SHIFT)
 #define CPU_IS_SPITFIRE()	(GETVER_CPU_IMPL() == IMPL_SPITFIRE)

Index: src/sys/arch/sparc64/sparc64/cpu.c
diff -u src/sys/arch/sparc64/sparc64/cpu.c:1.116 src/sys/arch/sparc64/sparc64/cpu.c:1.116.2.1
--- src/sys/arch/sparc64/sparc64/cpu.c:1.116	Fri Jul 25 18:29:45 2014
+++ src/sys/arch/sparc64/sparc64/cpu.c	Sat Dec 13 19:29:28 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.116 2014/07/25 18:29:45 nakayama Exp $ */
+/*	$NetBSD: cpu.c,v 1.116.2.1 2014/12/13 19:29:28 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.116 2014/07/25 18:29:45 nakayama Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.116.2.1 2014/12/13 19:29:28 martin Exp $);
 
 #include opt_multiprocessor.h
 
@@ -284,7 +284,6 @@ cpu_attach(device_t parent, device_t dev
 	struct cpu_info *ci;
 	const char *sep;
 	register int i, l;
-	uint64_t ver;
 	int bigcache, cachesize;
 	char buf[100];
 	int 	totalsize = 0;
@@ -349,11 +348,10 @@ cpu_attach(device_t parent, device_t dev
 	aprint_normal(: %s, CPU id %d\n, buf, ci-ci_cpuid);
 	aprint_naive(\n);
 	if (CPU_ISSUN4U || CPU_ISSUN4US) {
-		ver = getver();
 		aprint_normal_dev(dev, manuf %x, impl %x, mask %x\n,
-		(u_int)((ver  VER_MANUF)  VER_MANUF_SHIFT),
-		(u_int)((ver  VER_IMPL)  VER_IMPL_SHIFT),
-		(u_int)((ver  VER_MASK)  VER_MASK_SHIFT));
+		(u_int)GETVER_CPU_MANUF(),
+		(u_int)GETVER_CPU_IMPL(),
+		(u_int)GETVER_CPU_MASK());
 	}
 
 	if (ci-ci_system_clockrate[0] != 0) {
@@ -495,7 +493,6 @@ int
 cpu_myid(void)
 {
 	char buf[32];
-	int impl;
 
 #ifdef SUN4V
 	if (CPU_ISSUN4V) {
@@ -507,8 +504,7 @@ cpu_myid(void)
 	if (OF_getprop(findroot(), name, buf, sizeof(buf))  0 
 	strcmp(buf, 

CVS commit: src/libexec/httpd

2014-12-13 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Dec 13 19:30:04 UTC 2014

Modified Files:
src/libexec/httpd: content-bozo.c

Log Message:
add .ts and .vob suffixes.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/libexec/httpd/content-bozo.c

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

Modified files:

Index: src/libexec/httpd/content-bozo.c
diff -u src/libexec/httpd/content-bozo.c:1.10 src/libexec/httpd/content-bozo.c:1.11
--- src/libexec/httpd/content-bozo.c:1.10	Sat May 17 05:50:01 2014
+++ src/libexec/httpd/content-bozo.c	Sat Dec 13 19:30:04 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: content-bozo.c,v 1.10 2014/05/17 05:50:01 mrg Exp $	*/
+/*	$NetBSD: content-bozo.c,v 1.11 2014/12/13 19:30:04 mrg Exp $	*/
 
 /*	$eterna: content-bozo.c,v 1.17 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -164,6 +164,8 @@ static bozo_content_map_t static_content
 	{ .mpeg,	5, video/mpeg,		,		, NULL },
 	{ .mpg,	4, video/mpeg,		,		, NULL },
 	{ .mpe,	4, video/mpeg,		,		, NULL },
+	{ .ts,	4, video/mpeg,		,		, NULL },
+	{ .vob,	4, video/mpeg,		,		, NULL },
 	{ .mp4,	4, video/mp4,			,		, NULL },
 	{ .qt,	3, video/quicktime,		,		, NULL },
 	{ .mov,	4, video/quicktime,		,		, NULL },



CVS commit: [netbsd-7] src/sys/arch/arm/arm32

2014-12-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Dec 13 19:32:43 UTC 2014

Modified Files:
src/sys/arch/arm/arm32 [netbsd-7]: arm32_boot.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #319):
sys/arch/arm/arm32/arm32_boot.c: revision 1.11
serialize printing of secondary cpu info


To generate a diff of this commit:
cvs rdiff -u -r1.7.4.1 -r1.7.4.2 src/sys/arch/arm/arm32/arm32_boot.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/arm/arm32/arm32_boot.c
diff -u src/sys/arch/arm/arm32/arm32_boot.c:1.7.4.1 src/sys/arch/arm/arm32/arm32_boot.c:1.7.4.2
--- src/sys/arch/arm/arm32/arm32_boot.c:1.7.4.1	Sun Nov  9 16:05:25 2014
+++ src/sys/arch/arm/arm32/arm32_boot.c	Sat Dec 13 19:32:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_boot.c,v 1.7.4.1 2014/11/09 16:05:25 martin Exp $	*/
+/*	$NetBSD: arm32_boot.c,v 1.7.4.2 2014/12/13 19:32:43 martin Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -123,7 +123,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: arm32_boot.c,v 1.7.4.1 2014/11/09 16:05:25 martin Exp $);
+__KERNEL_RCSID(1, $NetBSD: arm32_boot.c,v 1.7.4.2 2014/12/13 19:32:43 martin Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -151,6 +151,10 @@ __KERNEL_RCSID(1, $NetBSD: arm32_boot.c
 #include sys/kgdb.h
 #endif
 
+#ifdef MULTIPROCESSOR
+static kmutex_t cpu_hatch_lock;
+#endif
+
 vaddr_t
 initarm_common(vaddr_t kvm_base, vsize_t kvm_size,
 	const struct boot_physmem *bp, size_t nbp)
@@ -300,6 +304,10 @@ initarm_common(vaddr_t kvm_base, vsize_t
 		Debugger();
 #endif
 
+#ifdef MULTIPROCESSOR
+	mutex_init(cpu_hatch_lock, MUTEX_DEFAULT, IPL_HIGH);
+#endif
+
 #ifdef VERBOSE_INIT_ARM
 	printf(done.\n);
 #endif
@@ -383,6 +391,8 @@ cpu_hatch(struct cpu_info *ci, cpuid_t c
 	}
 #endif
 
+	mutex_enter(cpu_hatch_lock);
+
 	aprint_naive(%s, device_xname(ci-ci_dev));
 	aprint_normal(%s, device_xname(ci-ci_dev));
 	identify_arm_cpu(ci-ci_dev, ci);
@@ -391,6 +401,8 @@ cpu_hatch(struct cpu_info *ci, cpuid_t c
 #endif
 	vfp_attach(ci);
 
+	mutex_exit(cpu_hatch_lock);
+
 #ifdef VERBOSE_INIT_ARM
 	printf( interrupts);
 #endif



CVS commit: [netbsd-7] src/doc

2014-12-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Dec 13 19:35:02 UTC 2014

Modified Files:
src/doc [netbsd-7]: CHANGES-7.0

Log Message:
Tickets #316 - #319


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.129 -r1.1.2.130 src/doc/CHANGES-7.0

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-7.0
diff -u src/doc/CHANGES-7.0:1.1.2.129 src/doc/CHANGES-7.0:1.1.2.130
--- src/doc/CHANGES-7.0:1.1.2.129	Sat Dec 13 18:56:34 2014
+++ src/doc/CHANGES-7.0	Sat Dec 13 19:35:02 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.129 2014/12/13 18:56:34 martin Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.130 2014/12/13 19:35:02 martin Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -3481,3 +3481,32 @@ sys/compat/netbsd32/netbsd32_compat_30.c
 	Avoid a user-triggerable kmem_alloc(0).
 	[maxv, ticket #314]
 
+sys/sys/cdefs_elf.h1.47
+
+	Add a macro to mark a symbol as weak. Use it to mark the end of a
+	linker set, as empty linker sets otherwise violate the C aliasing
+	rules by presenting zero sized objects.
+	[joerg, ticket #316]
+
+sys/conf/Makefile.kern.inc			1.179
+
+	Trim   at the beginning of version string to follow the change
+	in rev.1.60 of newvers.sh.
+	[nakayama, ticket #317]
+
+sys/arch/sparc64/include/psl.h			1.54-1.55
+sys/arch/sparc64/sparc64/cpu.c			1.121
+
+	Change getver() into a constant function since Version Register (%ver)
+	is read only and its value is constant. This change reduces multiple
+	%ver reads to one in the functions which uses a number of CPU_IS_*
+	macros.
+
+	Use GETVER_CPU_* macros.
+	[nakayama, ticket #318]
+
+sys/arch/arm/arm32/arm32_boot.c			1.11
+
+	Serialize printing of secondary cpu infos.
+	[jmcneill, ticket #319]
+



CVS import: xsrc/external/mit/libdrm/dist

2014-12-13 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Sat Dec 13 21:33:26 UTC 2014

Update of /cvsroot/xsrc/external/mit/libdrm/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv9546

Log Message:
initial import of libdrm-2.4.58

Status:

Vendor Tag: xorg
Release Tags:   libdrm-2-4-58

C xsrc/external/mit/libdrm/dist/xf86drmMode.c
U xsrc/external/mit/libdrm/dist/libdrm.pc.in
U xsrc/external/mit/libdrm/dist/README
N xsrc/external/mit/libdrm/dist/Makefile.sources
U xsrc/external/mit/libdrm/dist/libdrm_lists.h
C xsrc/external/mit/libdrm/dist/xf86atomic.h
N xsrc/external/mit/libdrm/dist/Android.mk
C xsrc/external/mit/libdrm/dist/xf86drmMode.h
U xsrc/external/mit/libdrm/dist/aclocal.m4
U xsrc/external/mit/libdrm/dist/Makefile.am
U xsrc/external/mit/libdrm/dist/Makefile.in
N xsrc/external/mit/libdrm/dist/libdrm.h
U xsrc/external/mit/libdrm/dist/xf86drmSL.c
U xsrc/external/mit/libdrm/dist/xf86drmHash.c
C xsrc/external/mit/libdrm/dist/xf86drm.c
U xsrc/external/mit/libdrm/dist/config.h.in
U xsrc/external/mit/libdrm/dist/configure.ac
U xsrc/external/mit/libdrm/dist/xf86drm.h
U xsrc/external/mit/libdrm/dist/configure
U xsrc/external/mit/libdrm/dist/xf86drmRandom.c
N xsrc/external/mit/libdrm/dist/libkms/Makefile.sources
U xsrc/external/mit/libdrm/dist/libkms/nouveau.c
U xsrc/external/mit/libdrm/dist/libkms/Makefile.am
U xsrc/external/mit/libdrm/dist/libkms/exynos.c
U xsrc/external/mit/libdrm/dist/libkms/intel.c
U xsrc/external/mit/libdrm/dist/libkms/Makefile.in
U xsrc/external/mit/libdrm/dist/libkms/radeon.c
U xsrc/external/mit/libdrm/dist/libkms/dumb.c
N xsrc/external/mit/libdrm/dist/libkms/Android.mk
U xsrc/external/mit/libdrm/dist/libkms/api.c
U xsrc/external/mit/libdrm/dist/libkms/linux.c
U xsrc/external/mit/libdrm/dist/libkms/libkms.h
U xsrc/external/mit/libdrm/dist/libkms/internal.h
U xsrc/external/mit/libdrm/dist/libkms/libkms.pc.in
U xsrc/external/mit/libdrm/dist/libkms/vmwgfx.c
U xsrc/external/mit/libdrm/dist/build-aux/test-driver
U xsrc/external/mit/libdrm/dist/build-aux/install-sh
U xsrc/external/mit/libdrm/dist/build-aux/config.sub
U xsrc/external/mit/libdrm/dist/build-aux/depcomp
U xsrc/external/mit/libdrm/dist/build-aux/config.guess
U xsrc/external/mit/libdrm/dist/build-aux/ltmain.sh
U xsrc/external/mit/libdrm/dist/build-aux/missing
U xsrc/external/mit/libdrm/dist/m4/lt~obsolete.m4
U xsrc/external/mit/libdrm/dist/m4/libtool.m4
U xsrc/external/mit/libdrm/dist/m4/ltoptions.m4
U xsrc/external/mit/libdrm/dist/m4/ltversion.m4
U xsrc/external/mit/libdrm/dist/m4/ltsugar.m4
N xsrc/external/mit/libdrm/dist/nouveau/Makefile.sources
U xsrc/external/mit/libdrm/dist/nouveau/nouveau.c
U xsrc/external/mit/libdrm/dist/nouveau/Makefile.am
U xsrc/external/mit/libdrm/dist/nouveau/abi16.c
U xsrc/external/mit/libdrm/dist/nouveau/Makefile.in
U xsrc/external/mit/libdrm/dist/nouveau/bufctx.c
N xsrc/external/mit/libdrm/dist/nouveau/Android.mk
U xsrc/external/mit/libdrm/dist/nouveau/private.h
U xsrc/external/mit/libdrm/dist/nouveau/nouveau.h
U xsrc/external/mit/libdrm/dist/nouveau/pushbuf.c
U xsrc/external/mit/libdrm/dist/nouveau/libdrm_nouveau.pc.in
U xsrc/external/mit/libdrm/dist/intel/intel_bufmgr_fake.c
U xsrc/external/mit/libdrm/dist/intel/intel_bufmgr.h
N xsrc/external/mit/libdrm/dist/intel/Makefile.sources
U xsrc/external/mit/libdrm/dist/intel/Makefile.am
U xsrc/external/mit/libdrm/dist/intel/mm.h
U xsrc/external/mit/libdrm/dist/intel/mm.c
C xsrc/external/mit/libdrm/dist/intel/intel_bufmgr_gem.c
U xsrc/external/mit/libdrm/dist/intel/intel_debug.h
U xsrc/external/mit/libdrm/dist/intel/intel_decode.c
U xsrc/external/mit/libdrm/dist/intel/Makefile.in
U xsrc/external/mit/libdrm/dist/intel/intel_chipset.h
U xsrc/external/mit/libdrm/dist/intel/libdrm_intel.pc.in
N xsrc/external/mit/libdrm/dist/intel/Android.mk
U xsrc/external/mit/libdrm/dist/intel/intel_aub.h
U xsrc/external/mit/libdrm/dist/intel/intel_bufmgr_priv.h
U xsrc/external/mit/libdrm/dist/intel/test_decode.c
U xsrc/external/mit/libdrm/dist/intel/intel_bufmgr.c
U xsrc/external/mit/libdrm/dist/intel/tests/gen5-3d.batch-ref.txt
U xsrc/external/mit/libdrm/dist/intel/tests/gen7-3d.batch.sh
U xsrc/external/mit/libdrm/dist/intel/tests/test-batch.sh
U xsrc/external/mit/libdrm/dist/intel/tests/gen7-2d-copy.batch.sh
U xsrc/external/mit/libdrm/dist/intel/tests/gen7-3d.batch
U xsrc/external/mit/libdrm/dist/intel/tests/gen4-3d.batch
U xsrc/external/mit/libdrm/dist/intel/tests/gen6-3d.batch
U xsrc/external/mit/libdrm/dist/intel/tests/gen7-2d-copy.batch-ref.txt
U xsrc/external/mit/libdrm/dist/intel/tests/gen4-3d.batch.sh
U xsrc/external/mit/libdrm/dist/intel/tests/gen6-3d.batch-ref.txt
U xsrc/external/mit/libdrm/dist/intel/tests/gm45-3d.batch
U xsrc/external/mit/libdrm/dist/intel/tests/gm45-3d.batch-ref.txt
U xsrc/external/mit/libdrm/dist/intel/tests/gen5-3d.batch.sh
U xsrc/external/mit/libdrm/dist/intel/tests/gen7-2d-copy.batch
U xsrc/external/mit/libdrm/dist/intel/tests/gen7-3d.batch-ref.txt
U xsrc/external/mit/libdrm/dist/intel/tests/gen6-3d.batch.sh
U 

CVS commit: xsrc/external/mit/libdrm/dist

2014-12-13 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Sat Dec 13 21:39:07 UTC 2014

Modified Files:
xsrc/external/mit/libdrm/dist: xf86atomic.h xf86drm.c xf86drmMode.c
xf86drmMode.h
xsrc/external/mit/libdrm/dist/include/drm: drm.h
xsrc/external/mit/libdrm/dist/intel: intel_bufmgr_gem.c
xsrc/external/mit/libdrm/dist/radeon: radeon_bo_gem.c radeon_cs_gem.c
radeon_surface.c
xsrc/external/mit/libdrm/dist/tests/modetest: modetest.c
Removed Files:
xsrc/external/mit/libdrm/dist: config.guess config.sub depcomp
install-sh ltmain.sh missing
xsrc/external/mit/libdrm/dist/include: Makefile.am Makefile.in
xsrc/external/mit/libdrm/dist/include/drm: Makefile Makefile.am
Makefile.in i810_drm.h i830_drm.h

Log Message:
merge libdrm 2.4.58.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 xsrc/external/mit/libdrm/dist/config.guess \
xsrc/external/mit/libdrm/dist/config.sub \
xsrc/external/mit/libdrm/dist/depcomp \
xsrc/external/mit/libdrm/dist/install-sh \
xsrc/external/mit/libdrm/dist/ltmain.sh \
xsrc/external/mit/libdrm/dist/missing
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/libdrm/dist/xf86atomic.h
cvs rdiff -u -r1.8 -r1.9 xsrc/external/mit/libdrm/dist/xf86drm.c
cvs rdiff -u -r1.6 -r1.7 xsrc/external/mit/libdrm/dist/xf86drmMode.c
cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/libdrm/dist/xf86drmMode.h
cvs rdiff -u -r1.1.1.1 -r0 xsrc/external/mit/libdrm/dist/include/Makefile.am
cvs rdiff -u -r1.1.1.5 -r0 xsrc/external/mit/libdrm/dist/include/Makefile.in
cvs rdiff -u -r1.1.1.6 -r0 xsrc/external/mit/libdrm/dist/include/drm/Makefile
cvs rdiff -u -r1.1.1.2 -r0 \
xsrc/external/mit/libdrm/dist/include/drm/Makefile.am
cvs rdiff -u -r1.1.1.5 -r0 \
xsrc/external/mit/libdrm/dist/include/drm/Makefile.in
cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/libdrm/dist/include/drm/drm.h
cvs rdiff -u -r1.1.1.1 -r0 \
xsrc/external/mit/libdrm/dist/include/drm/i810_drm.h \
xsrc/external/mit/libdrm/dist/include/drm/i830_drm.h
cvs rdiff -u -r1.8 -r1.9 \
xsrc/external/mit/libdrm/dist/intel/intel_bufmgr_gem.c
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/libdrm/dist/radeon/radeon_bo_gem.c \
xsrc/external/mit/libdrm/dist/radeon/radeon_surface.c
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/libdrm/dist/radeon/radeon_cs_gem.c
cvs rdiff -u -r1.4 -r1.5 \
xsrc/external/mit/libdrm/dist/tests/modetest/modetest.c

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

Modified files:

Index: xsrc/external/mit/libdrm/dist/xf86atomic.h
diff -u xsrc/external/mit/libdrm/dist/xf86atomic.h:1.4 xsrc/external/mit/libdrm/dist/xf86atomic.h:1.5
--- xsrc/external/mit/libdrm/dist/xf86atomic.h:1.4	Wed Jul  9 14:12:39 2014
+++ xsrc/external/mit/libdrm/dist/xf86atomic.h	Sat Dec 13 21:39:07 2014
@@ -113,4 +113,13 @@ typedef struct { int atomic; } atomic_t;
 #error libdrm requires atomic operations, please define them for your CPU/compiler.
 #endif
 
+static inline int atomic_add_unless(atomic_t *v, int add, int unless)
+{
+	int c, old;
+	c = atomic_read(v);
+	while (c != unless  (old = atomic_cmpxchg(v, c, c + add)) != c)
+		c = old;
+	return c == unless;
+}
+
 #endif

Index: xsrc/external/mit/libdrm/dist/xf86drm.c
diff -u xsrc/external/mit/libdrm/dist/xf86drm.c:1.8 xsrc/external/mit/libdrm/dist/xf86drm.c:1.9
--- xsrc/external/mit/libdrm/dist/xf86drm.c:1.8	Fri Jul 11 19:57:33 2014
+++ xsrc/external/mit/libdrm/dist/xf86drm.c	Sat Dec 13 21:39:07 2014
@@ -48,7 +48,6 @@
 #include sys/stat.h
 #define stat_t struct stat
 #include sys/ioctl.h
-#include sys/mman.h
 #include sys/time.h
 #include stdarg.h
 
@@ -58,6 +57,7 @@
 #endif
 
 #include xf86drm.h
+#include libdrm.h
 
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
 #define DRM_MAJOR 145
@@ -542,19 +542,6 @@ static int drmOpenByName(const char *nam
 int   fd;
 drmVersionPtr version;
 char *id;
-
-if (!drmAvailable()) {
-	if (!drm_server_info) {
-	return -1;
-	}
-	else {
-	/* try to load the kernel module now */
-	if (!drm_server_info-load_module(name)) {
-		drmMsg([drm] failed to load kernel module \%s\\n, name);
-		return -1;
-	}
-	}
-}
 
 /*
  * Open the first minor number that matches the driver name and isn't
@@ -1165,7 +1152,7 @@ int drmMap(int fd, drm_handle_t handle, 
 	return 0;
 }
 #endif
-*address = mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, handle);
+*address = drm_mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, handle);
 if (*address == MAP_FAILED)
 	return -errno;
 return 0;
@@ -1185,7 +1172,7 @@ int drmMap(int fd, drm_handle_t handle, 
  */
 int drmUnmap(drmAddress address, drmSize size)
 {
-return munmap(address, size);
+return drm_munmap(address, size);
 }
 
 drmBufInfoPtr drmGetBufInfo(int fd)
@@ -1292,7 +1279,7 @@ int drmUnmapBufs(drmBufMapPtr bufs)
 

CVS commit: xsrc/external/mit/libdrm/dist

2014-12-13 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Sat Dec 13 21:41:20 UTC 2014

Modified Files:
xsrc/external/mit/libdrm/dist: xf86drmMode.c

Log Message:
fix a merge botch.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 xsrc/external/mit/libdrm/dist/xf86drmMode.c

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

Modified files:

Index: xsrc/external/mit/libdrm/dist/xf86drmMode.c
diff -u xsrc/external/mit/libdrm/dist/xf86drmMode.c:1.7 xsrc/external/mit/libdrm/dist/xf86drmMode.c:1.8
--- xsrc/external/mit/libdrm/dist/xf86drmMode.c:1.7	Sat Dec 13 21:39:07 2014
+++ xsrc/external/mit/libdrm/dist/xf86drmMode.c	Sat Dec 13 21:41:19 2014
@@ -806,6 +806,8 @@ int drmCheckModesettingSupported(const c
 			return -EINVAL;
 		return (modesetting ? 0 : -ENOSYS);
 	}
+#elif defined(__DragonFly__)
+	return 0;
 #else
 	int fd;
 	static const struct drm_mode_card_res zero_res;
@@ -819,8 +821,6 @@ int drmCheckModesettingSupported(const c
 	drmClose(fd);
 	if (ret == 0)
 		return 0;
-#elif defined(__DragonFly__)
-	return 0;
 #endif
 	return -ENOSYS;
 



CVS commit: src/distrib/utils/embedded

2014-12-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 14 00:28:46 UTC 2014

Modified Files:
src/distrib/utils/embedded: mkimage
src/distrib/utils/embedded/conf: x86.conf

Log Message:
fix image building:
- round up the total size of the disk image
- fix fdisk offset for netbsd ffs images


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/distrib/utils/embedded/mkimage
cvs rdiff -u -r1.4 -r1.5 src/distrib/utils/embedded/conf/x86.conf

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.48 src/distrib/utils/embedded/mkimage:1.49
--- src/distrib/utils/embedded/mkimage:1.48	Thu Apr  3 18:51:38 2014
+++ src/distrib/utils/embedded/mkimage	Sat Dec 13 19:28:46 2014
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.48 2014/04/03 22:51:38 christos Exp $
+# $NetBSD: mkimage,v 1.49 2014/12/14 00:28:46 christos Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -190,6 +190,13 @@ if [ ${size} = 0 ]; then
 	size=$(getsize ${image})
 fi
 newsize=$((${size} / 2 / 1024))
+compare=$((${newsize} * 2 * 1024))
+while [ ${compare} != ${size} ]
+do
+	size=$((size + size - compare))  
+	newsize=$((${size} / 2 / 1024))
+	compare=$((${newsize} * 2 * 1024))
+done  
 
 echo ${bar} Adding label ${bar}
 make_label  ${tmp}/label
@@ -202,7 +209,7 @@ if [ -n ${msdosid} ]; then
 elif [ -n ${netbsdid} ]; then
 	echo ${bar} Running fdisk ${bar}
 	${FDISK} -f -i ${image}
-	${FDISK} -f -a -u -0 -s 169 ${image}
+	${FDISK} -f -a -u -0 -s 169/${init} ${image}
 	${INSTALLBOOT} -f -v ${image} ${release}/usr/mdec/bootxx_ffsv1
 fi
 

Index: src/distrib/utils/embedded/conf/x86.conf
diff -u src/distrib/utils/embedded/conf/x86.conf:1.4 src/distrib/utils/embedded/conf/x86.conf:1.5
--- src/distrib/utils/embedded/conf/x86.conf:1.4	Fri Apr  4 12:45:51 2014
+++ src/distrib/utils/embedded/conf/x86.conf	Sat Dec 13 19:28:46 2014
@@ -1,4 +1,4 @@
-# $NetBSD: x86.conf,v 1.4 2014/04/04 16:45:51 christos Exp $
+# $NetBSD: x86.conf,v 1.5 2014/12/14 00:28:46 christos Exp $
 # x86 shared config
 #
 
@@ -12,13 +12,14 @@ specialdirs=/kern /proc
 extra=8		# spare space
 size=0		# autocompute
 netbsdid=169
-ffsoffset=63b
+init=63
+ffsoffset=${init}b
 
 make_label() {
 	# compute all sizes in terms of sectors
 	local totalsize=$(( ${newsize} * 1024 * 2 / 512 ))
 
-	local aoffset=63
+	local aoffset=${init}
 	local asize=$(( ${totalsize} - ${aoffset} ))
 
 	local bps=512



CVS commit: src/sys/ufs/ffs

2014-12-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 14 00:36:07 UTC 2014

Modified Files:
src/sys/ufs/ffs: ffs_vfsops.c

Log Message:
- Add debugging for mount...
- Merge some error returns
- Check more errors


To generate a diff of this commit:
cvs rdiff -u -r1.302 -r1.303 src/sys/ufs/ffs/ffs_vfsops.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/ffs/ffs_vfsops.c
diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.302 src/sys/ufs/ffs/ffs_vfsops.c:1.303
--- src/sys/ufs/ffs/ffs_vfsops.c:1.302	Fri Nov 14 05:09:50 2014
+++ src/sys/ufs/ffs/ffs_vfsops.c	Sat Dec 13 19:36:07 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_vfsops.c,v 1.302 2014/11/14 10:09:50 manu Exp $	*/
+/*	$NetBSD: ffs_vfsops.c,v 1.303 2014/12/14 00:36:07 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ffs_vfsops.c,v 1.302 2014/11/14 10:09:50 manu Exp $);
+__KERNEL_RCSID(0, $NetBSD: ffs_vfsops.c,v 1.303 2014/12/14 00:36:07 christos Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ffs.h
@@ -120,6 +120,12 @@ static kauth_listener_t ffs_snapshot_lis
 /* how many times ffs_init() was called */
 int ffs_initcount = 0;
 
+#ifdef DEBUG_FFS_MOUNT
+#define DPRINTF(a)	printf a
+#else
+#define DPRINTF(a)	do {} while (/*CONSTCOND*/0)
+#endif
+
 extern const struct vnodeopv_desc ffs_vnodeop_opv_desc;
 extern const struct vnodeopv_desc ffs_specop_opv_desc;
 extern const struct vnodeopv_desc ffs_fifoop_opv_desc;
@@ -346,15 +352,22 @@ ffs_mount(struct mount *mp, const char *
 	int error = 0, flags, update;
 	mode_t accessmode;
 
-	if (args == NULL)
+	if (args == NULL) {
+		DPRINTF((%s: NULL args\n, __func__));
 		return EINVAL;
-	if (*data_len  sizeof *args)
+	}
+	if (*data_len  sizeof(*args)) {
+		DPRINTF((%s: bad size args %zu != %zu\n,
+		__func__, *data_len, sizeof(*args)));
 		return EINVAL;
+	}
 
 	if (mp-mnt_flag  MNT_GETARGS) {
 		ump = VFSTOUFS(mp);
-		if (ump == NULL)
+		if (ump == NULL) {
+			DPRINTF((%s: no ump\n, __func__));
 			return EIO;
+		}
 		args-fspec = NULL;
 		*data_len = sizeof *args;
 		return 0;
@@ -368,18 +381,26 @@ ffs_mount(struct mount *mp, const char *
 		 * Look up the name and verify that it's sane.
 		 */
 		error = namei_simple_user(args-fspec,
-	NSM_FOLLOW_NOEMULROOT, devvp);
-		if (error != 0)
-			return (error);
+		NSM_FOLLOW_NOEMULROOT, devvp);
+		if (error != 0) {
+			DPRINTF((%s: namei_simple_user %d\n, __func__,
+			error));
+			return error;
+		}
 
 		if (!update) {
 			/*
 			 * Be sure this is a valid block device
 			 */
-			if (devvp-v_type != VBLK)
+			if (devvp-v_type != VBLK) {
+DPRINTF((%s: non block device %d\n,
+__func__, devvp-v_type));
 error = ENOTBLK;
-			else if (bdevsw_lookup(devvp-v_rdev) == NULL)
+			} else if (bdevsw_lookup(devvp-v_rdev) == NULL) {
+DPRINTF((%s: can't find block device 0x%jx\n,
+__func__, devvp-v_rdev));
 error = ENXIO;
+			}
 		} else {
 			/*
 			 * Be sure we're still naming the same device
@@ -387,9 +408,13 @@ ffs_mount(struct mount *mp, const char *
 			 */
 			ump = VFSTOUFS(mp);
 			if (devvp != ump-um_devvp) {
-if (devvp-v_rdev != ump-um_devvp-v_rdev)
+if (devvp-v_rdev != ump-um_devvp-v_rdev) {
+	DPRINTF((%s: wrong device 0x%jx
+	 != 0x%jx\n, __func__,
+	(uintmax_t)devvp-v_rdev,
+	(uintmax_t)ump-um_devvp-v_rdev));
 	error = EINVAL;
-else {
+} else {
 	vrele(devvp);
 	devvp = ump-um_devvp;
 	vref(devvp);
@@ -399,7 +424,8 @@ ffs_mount(struct mount *mp, const char *
 	} else {
 		if (!update) {
 			/* New mounts must have a filename for the device */
-			return (EINVAL);
+			DPRINTF((%s: no filename for mount\n, __func__));
+			return EINVAL;
 		} else {
 			/* Use the extant mount */
 			ump = VFSTOUFS(mp);
@@ -426,6 +452,9 @@ ffs_mount(struct mount *mp, const char *
 		error = kauth_authorize_system(l-l_cred, KAUTH_SYSTEM_MOUNT,
 		KAUTH_REQ_SYSTEM_MOUNT_DEVICE, mp, devvp,
 		KAUTH_ARG(accessmode));
+		if (error) {
+			DPRINTF((%s: kauth %d\n, __func__, error));
+		}
 		VOP_UNLOCK(devvp);
 	}
 
@@ -453,10 +482,13 @@ ffs_mount(struct mount *mp, const char *
 		vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
 		error = VOP_OPEN(devvp, xflags, FSCRED);
 		VOP_UNLOCK(devvp);
-		if (error)
+		if (error) {	
+			DPRINTF((%s: VOP_OPEN %d\n, __func__, error));
 			goto fail;
+		}
 		error = ffs_mountfs(devvp, mp, l);
 		if (error) {
+			DPRINTF((%s: ffs_mountfs %d\n, __func__, error));
 			vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
 			(void)VOP_CLOSE(devvp, xflags, NOCRED);
 			VOP_UNLOCK(devvp);
@@ -497,17 +529,21 @@ ffs_mount(struct mount *mp, const char *
 fs-fs_clean = FS_ISCLEAN;
 (void) ffs_sbupdate(ump, MNT_WAIT);
 			}
-			if (error == 0)
-UFS_WAPBL_END(mp);
-			if (error)
-return (error);
+			if (error) {
+DPRINTF((%s: wapbl %d\n, 

CVS commit: src/sys/ufs/ffs

2014-12-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 14 01:13:57 UTC 2014

Modified Files:
src/sys/ufs/ffs: ffs_vfsops.c

Log Message:
Restore apple ufs error handling.


To generate a diff of this commit:
cvs rdiff -u -r1.303 -r1.304 src/sys/ufs/ffs/ffs_vfsops.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/ffs/ffs_vfsops.c
diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.303 src/sys/ufs/ffs/ffs_vfsops.c:1.304
--- src/sys/ufs/ffs/ffs_vfsops.c:1.303	Sat Dec 13 19:36:07 2014
+++ src/sys/ufs/ffs/ffs_vfsops.c	Sat Dec 13 20:13:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_vfsops.c,v 1.303 2014/12/14 00:36:07 christos Exp $	*/
+/*	$NetBSD: ffs_vfsops.c,v 1.304 2014/12/14 01:13:57 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ffs_vfsops.c,v 1.303 2014/12/14 00:36:07 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: ffs_vfsops.c,v 1.304 2014/12/14 01:13:57 christos Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ffs.h
@@ -773,10 +773,11 @@ ffs_reload(struct mount *mp, kauth_cred_
 		 * EINVAL is most probably a blocksize or alignment problem,
 		 * it is unlikely that this is an Apple UFS filesystem then.
 		 */
-		error = bread(devvp, (daddr_t)(APPLEUFS_LABEL_OFFSET / DEV_BSIZE),
-			APPLEUFS_LABEL_SIZE, cred, 0, bp);
+		error = bread(devvp,
+		(daddr_t)(APPLEUFS_LABEL_OFFSET / DEV_BSIZE),
+		APPLEUFS_LABEL_SIZE, cred, 0, bp);
 		if (error  error != EINVAL) {
-			return (error);
+			return error;
 		}
 		if (error == 0) {
 			error = ffs_appleufs_validate(fs-fs_fsmnt,
@@ -1153,15 +1154,10 @@ ffs_mountfs(struct vnode *devvp, struct 
 		}
 		error = ffs_appleufs_validate(fs-fs_fsmnt,
 		(struct appleufslabel *)bp-b_data, NULL);
-			(struct appleufslabel *)bp-b_data, NULL);
+		if (error == 0)
 			ump-um_flags |= UFS_ISAPPLEUFS;
 		brelse(bp, 0);
 		bp = NULL;
-		if (error) {
-			DPRINTF((%s: ffs_appleufs_validate %d\n, __func__,
-			error));
-			goto out;
-		}
 	}
 #else
 	if (ump-um_flags  UFS_ISAPPLEUFS) {