CVS commit: src/usr.sbin/makefs/msdos

2013-01-27 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Sun Jan 27 10:07:23 UTC 2013

Modified Files:
src/usr.sbin/makefs/msdos: msdosfs_vnops.c

Log Message:
Allow this to compile on 32bit architectures.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/makefs/msdos/msdosfs_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/usr.sbin/makefs/msdos/msdosfs_vnops.c
diff -u src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.4 src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.5
--- src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.4	Sat Jan 26 16:58:14 2013
+++ src/usr.sbin/makefs/msdos/msdosfs_vnops.c	Sun Jan 27 10:07:23 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vnops.c,v 1.4 2013/01/26 16:58:14 christos Exp $	*/
+/*	$NetBSD: msdosfs_vnops.c,v 1.5 2013/01/27 10:07:23 mbalmer Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -51,7 +51,7 @@
 #endif
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.4 2013/01/26 16:58:14 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.5 2013/01/27 10:07:23 mbalmer Exp $);
 
 #include sys/param.h
 #include sys/mman.h
@@ -177,7 +177,7 @@ msdosfs_wfile(const char *path, struct d
 	int error, fd;
 	size_t osize = dep-de_FileSize;
 	struct stat *st = node-inode-st;
-	size_t nsize = st-st_size;
+	off_t nsize = st-st_size;
 	size_t offs = 0;
 	struct msdosfsmount *pmp = dep-de_pmp;
 	struct buf *bp;
@@ -207,7 +207,7 @@ msdosfs_wfile(const char *path, struct d
 	if ((fd = open(path, O_RDONLY)) == -1)
 		err(1, open %s, path);
 
-	if ((dat = mmap(0, nsize, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0))
+	if ((dat = mmap(0, (size_t)nsize, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0))
 	== MAP_FAILED)
 		err(1, mmap %s, node-name);
 	close(fd);



CVS commit: src/usr.sbin/makefs/msdos

2013-01-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan 27 12:25:13 UTC 2013

Modified Files:
src/usr.sbin/makefs/msdos: msdosfs_vnops.c

Log Message:
Make it compile on 32bit AND 64bit archs.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/makefs/msdos/msdosfs_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/usr.sbin/makefs/msdos/msdosfs_vnops.c
diff -u src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.5 src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.6
--- src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.5	Sun Jan 27 10:07:23 2013
+++ src/usr.sbin/makefs/msdos/msdosfs_vnops.c	Sun Jan 27 12:25:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vnops.c,v 1.5 2013/01/27 10:07:23 mbalmer Exp $	*/
+/*	$NetBSD: msdosfs_vnops.c,v 1.6 2013/01/27 12:25:13 martin Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -51,7 +51,7 @@
 #endif
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.5 2013/01/27 10:07:23 mbalmer Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.6 2013/01/27 12:25:13 martin Exp $);
 
 #include sys/param.h
 #include sys/mman.h
@@ -177,7 +177,7 @@ msdosfs_wfile(const char *path, struct d
 	int error, fd;
 	size_t osize = dep-de_FileSize;
 	struct stat *st = node-inode-st;
-	off_t nsize = st-st_size;
+	size_t nsize;
 	size_t offs = 0;
 	struct msdosfsmount *pmp = dep-de_pmp;
 	struct buf *bp;
@@ -188,15 +188,16 @@ msdosfs_wfile(const char *path, struct d
 	printf(msdosfs_write(): diroff %lu, dirclust %lu, startcluster %lu\n,
 	dep-de_diroffset, dep-de_dirclust, dep-de_StartCluster);
 #endif
-	if (nsize == 0)
+	if (st-st_size == 0)
 		return 0;
 
 	/* Don't bother to try to write files larger than the fs limit */
-	if (nsize  MSDOSFS_FILESIZE_MAX) {
+	if (st-st_size  (off_t)min(MSDOSFS_FILESIZE_MAX,__SIZE_MAX__)) {
 		errno = EFBIG;
 		return -1;
 	}
 
+	nsize = st-st_size;
 	if (nsize  osize) {
 		if ((error = deextend(dep, nsize, NULL)) != 0) {
 			errno = error;



CVS commit: src/sys/dev/ic

2013-01-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 27 12:48:57 UTC 2013

Modified Files:
src/sys/dev/ic: ath.c ath_netbsd.h athvar.h

Log Message:
don't transmit while in a key change is in progress


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/dev/ic/ath.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/ic/ath_netbsd.h
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/ic/athvar.h

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

Modified files:

Index: src/sys/dev/ic/ath.c
diff -u src/sys/dev/ic/ath.c:1.114 src/sys/dev/ic/ath.c:1.115
--- src/sys/dev/ic/ath.c:1.114	Thu Nov  8 20:43:55 2012
+++ src/sys/dev/ic/ath.c	Sun Jan 27 12:48:56 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ath.c,v 1.114 2012/11/08 20:43:55 dyoung Exp $	*/
+/*	$NetBSD: ath.c,v 1.115 2013/01/27 12:48:56 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -41,7 +41,7 @@
 __FBSDID($FreeBSD: src/sys/dev/ath/if_ath.c,v 1.104 2005/09/16 10:09:23 ru Exp $);
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, $NetBSD: ath.c,v 1.114 2012/11/08 20:43:55 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: ath.c,v 1.115 2013/01/27 12:48:56 jmcneill Exp $);
 #endif
 
 /*
@@ -1278,6 +1278,10 @@ ath_start(struct ifnet *ifp)
 	if ((ifp-if_flags  IFF_RUNNING) == 0 ||
 	!device_is_active(sc-sc_dev))
 		return;
+
+	if (sc-sc_flags  ATH_KEY_UPDATING)
+		return;
+
 	for (;;) {
 		/*
 		 * Grab a TX buffer and associated resources.
@@ -1887,7 +1891,7 @@ ath_key_update_begin(struct ieee80211com
 #if 0
 	tasklet_disable(sc-sc_rxtq);
 #endif
-	IF_LOCK(ifp-if_snd);		/* NB: doesn't block mgmt frames */
+	sc-sc_flags |= ATH_KEY_UPDATING;
 }
 
 static void
@@ -1897,7 +1901,7 @@ ath_key_update_end(struct ieee80211com *
 	struct ath_softc *sc = ifp-if_softc;
 
 	DPRINTF(sc, ATH_DEBUG_KEYCACHE, %s:\n, __func__);
-	IF_UNLOCK(ifp-if_snd);
+	sc-sc_flags = ~ATH_KEY_UPDATING;
 #if 0
 	tasklet_enable(sc-sc_rxtq);
 #endif

Index: src/sys/dev/ic/ath_netbsd.h
diff -u src/sys/dev/ic/ath_netbsd.h:1.14 src/sys/dev/ic/ath_netbsd.h:1.15
--- src/sys/dev/ic/ath_netbsd.h:1.14	Thu Nov  8 20:43:55 2012
+++ src/sys/dev/ic/ath_netbsd.h	Sun Jan 27 12:48:56 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ath_netbsd.h,v 1.14 2012/11/08 20:43:55 dyoung Exp $ */
+/*	$NetBSD: ath_netbsd.h,v 1.15 2013/01/27 12:48:56 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2003, 2004 David Young
@@ -62,9 +62,6 @@ typedef kmutex_t ath_txbuf_lock_t;
 #define	NET_LOCK_GIANT()
 #define	NET_UNLOCK_GIANT()
 
-#define	IF_LOCK(__q)
-#define	IF_UNLOCK(__q)
-
 #define	SYSCTL_INT_SUBR(__rw, __name, __descr) \
 	sysctl_createv(log, 0, rnode, cnode, CTLFLAG_PERMANENT|(__rw), \
 	CTLTYPE_INT, #__name, SYSCTL_DESCR(__descr), ath_sysctl_##__name,\

Index: src/sys/dev/ic/athvar.h
diff -u src/sys/dev/ic/athvar.h:1.35 src/sys/dev/ic/athvar.h:1.36
--- src/sys/dev/ic/athvar.h:1.35	Fri Oct  7 16:58:11 2011
+++ src/sys/dev/ic/athvar.h	Sun Jan 27 12:48:56 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: athvar.h,v 1.35 2011/10/07 16:58:11 dyoung Exp $	*/
+/*	$NetBSD: athvar.h,v 1.36 2013/01/27 12:48:56 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -309,6 +309,7 @@ struct ath_softc {
 #define	sc_rx_th		u_rx_rt.th
 
 #define	ATH_ATTACHED		0x0001		/* attach has succeeded */
+#define	ATH_KEY_UPDATING	0x0002		/* key change in progress */
 
 #define	ATH_TXQ_SETUP(sc, i)	((sc)-sc_txqsetup  (1i))
 



CVS commit: src/usr.sbin/makefs

2013-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 27 14:07:12 UTC 2013

Modified Files:
src/usr.sbin/makefs: makefs.c

Log Message:
fix single letter parsing.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/usr.sbin/makefs/makefs.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.sbin/makefs/makefs.c
diff -u src/usr.sbin/makefs/makefs.c:1.39 src/usr.sbin/makefs/makefs.c:1.40
--- src/usr.sbin/makefs/makefs.c:1.39	Wed Jan 23 20:10:47 2013
+++ src/usr.sbin/makefs/makefs.c	Sun Jan 27 09:07:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: makefs.c,v 1.39 2013/01/24 01:10:47 christos Exp $	*/
+/*	$NetBSD: makefs.c,v 1.40 2013/01/27 14:07:12 christos Exp $	*/
 
 /*
  * Copyright (c) 2001-2003 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: makefs.c,v 1.39 2013/01/24 01:10:47 christos Exp $);
+__RCSID($NetBSD: makefs.c,v 1.40 2013/01/27 14:07:12 christos Exp $);
 #endif	/* !__lint */
 
 #include assert.h
@@ -336,9 +336,10 @@ set_option_var(const option_t *options, 
 options[i].minimum, options[i].maximum); break
 
 	for (i = 0; options[i].name != NULL; i++) {
-		if (options[i].letter != var[0]  var[1] == '\0')
-			continue;
-		else if (strcmp(options[i].name, var) != 0)
+		if (var[1] == '\0') {
+			if (options[i].letter != var[0])
+continue;
+		} else if (strcmp(options[i].name, var) != 0)
 			continue;
 		switch (options[i].type) {
 		case OPT_BOOL:



CVS commit: src/usr.sbin/makefs/ffs

2013-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 27 14:10:04 UTC 2013

Modified Files:
src/usr.sbin/makefs/ffs: buf.c

Log Message:
Don't print the pointers in debugging, it is not useful.
zero all memory


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/makefs/ffs/buf.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.sbin/makefs/ffs/buf.c
diff -u src/usr.sbin/makefs/ffs/buf.c:1.13 src/usr.sbin/makefs/ffs/buf.c:1.14
--- src/usr.sbin/makefs/ffs/buf.c:1.13	Fri Jan 25 19:19:39 2013
+++ src/usr.sbin/makefs/ffs/buf.c	Sun Jan 27 09:10:03 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.c,v 1.13 2013/01/26 00:19:39 christos Exp $	*/
+/*	$NetBSD: buf.c,v 1.14 2013/01/27 14:10:03 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: buf.c,v 1.13 2013/01/26 00:19:39 christos Exp $);
+__RCSID($NetBSD: buf.c,v 1.14 2013/01/27 14:10:03 christos Exp $);
 #endif	/* !__lint */
 
 #include sys/param.h
@@ -77,13 +77,12 @@ bread(struct vnode *vp, daddr_t blkno, i
 	assert (bpp != NULL);
 
 	if (debug  DEBUG_BUF_BREAD)
-		printf(bread: fs %p blkno %lld size %d\n,
-		fs, (long long)blkno, size);
+		printf(bread: blkno %lld size %d\n, (long long)blkno, size);
 	*bpp = getblk(vp, blkno, size, 0, 0);
 	offset = (*bpp)-b_blkno * sectorsize;	/* XXX */
 	if (debug  DEBUG_BUF_BREAD)
-		printf(bread: bp %p blkno %lld offset %lld bcount %ld\n,
-		(*bpp), (long long)(*bpp)-b_blkno, (long long) offset,
+		printf(bread: blkno %lld offset %lld bcount %ld\n,
+		(long long)(*bpp)-b_blkno, (long long) offset,
 		(*bpp)-b_bcount);
 	if (lseek((*bpp)-b_fd, offset, SEEK_SET) == -1)
 		err(1, bread: lseek %lld (%lld),
@@ -141,9 +140,8 @@ bwrite(struct buf *bp)
 	assert (bp != NULL);
 	offset = bp-b_blkno * sectorsize;	/* XXX */
 	if (debug  DEBUG_BUF_BWRITE)
-		printf(bwrite: bp %p blkno %lld offset %lld bcount %ld\n,
-		bp, (long long)bp-b_blkno, (long long) offset,
-		bp-b_bcount);
+		printf(bwrite: blkno %lld offset %lld bcount %ld\n,
+		(long long)bp-b_blkno, (long long) offset, bp-b_bcount);
 	if (lseek(bp-b_fd, offset, SEEK_SET) == -1)
 		return (errno);
 	rv = write(bp-b_fd, bp-b_data, bp-b_bcount);
@@ -191,11 +189,10 @@ getblk(struct vnode *vp, daddr_t blkno, 
 	int fd = vp-fd;
 	struct fs *fs = vp-fs;
 
-	blkno += vp-offset;
+	// blkno += vp-offset;
 	assert (fs != NULL);
 	if (debug  DEBUG_BUF_GETBLK)
-		printf(getblk: fs %p blkno %lld size %d\n, fs,
-		(long long)blkno, size);
+		printf(getblk: blkno %lld size %d\n, (long long)blkno, size);
 
 	bp = NULL;
 	if (!buftailinitted) {
@@ -226,6 +223,7 @@ getblk(struct vnode *vp, daddr_t blkno, 
 		n = realloc(bp-b_data, size);
 		if (n == NULL)
 			err(1, getblk: realloc b_data %ld, bp-b_bcount);
+		memset(n, 0, size);
 		bp-b_data = n;
 		bp-b_bufsize = size;
 	}



CVS commit: src/usr.sbin/makefs/ffs

2013-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 27 14:10:22 UTC 2013

Modified Files:
src/usr.sbin/makefs/ffs: buf.h

Log Message:
zero memory


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/makefs/ffs/buf.h

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

Modified files:

Index: src/usr.sbin/makefs/ffs/buf.h
diff -u src/usr.sbin/makefs/ffs/buf.h:1.4 src/usr.sbin/makefs/ffs/buf.h:1.5
--- src/usr.sbin/makefs/ffs/buf.h:1.4	Sat Jan 26 11:50:46 2013
+++ src/usr.sbin/makefs/ffs/buf.h	Sun Jan 27 09:10:22 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.h,v 1.4 2013/01/26 16:50:46 christos Exp $	*/
+/*	$NetBSD: buf.h,v 1.5 2013/01/27 14:10:22 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -99,7 +99,7 @@ struct pool {
 };
 
 #define pool_init(p, s, a1, a2, a3, a4, a5, a6)	(p)-size = (s)
-#define pool_get(p, f)	malloc((p)-size)
+#define pool_get(p, f)	calloc(1, (p)-size)
 #define pool_put(p, a)	free(a)
 #define pool_destroy(p)
 



CVS commit: src/share/man/man9

2013-01-27 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Jan 27 15:21:39 UTC 2013

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

Log Message:
Fix indentation of kcpuset_export_u32


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man9/kcpuset.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/kcpuset.9
diff -u src/share/man/man9/kcpuset.9:1.4 src/share/man/man9/kcpuset.9:1.5
--- src/share/man/man9/kcpuset.9:1.4	Sun Sep 16 22:22:45 2012
+++ src/share/man/man9/kcpuset.9	Sun Jan 27 15:21:38 2013
@@ -1,4 +1,4 @@
-.\ $NetBSD: kcpuset.9,v 1.4 2012/09/16 22:22:45 rmind Exp $ */
+.\ $NetBSD: kcpuset.9,v 1.5 2013/01/27 15:21:38 pgoyette Exp $ */
 .\
 .\ Copyright (c) 2011 Jukka Ruohonen jruohonen.iki.fi
 .\ All rights reserved.
@@ -234,7 +234,7 @@ from the
 set
 .Fa kcp
 atomically.
-.Fn kcpuset_export_u32 kcp bitfield len
+.It Fn kcpuset_export_u32 kcp bitfield len
 Exports the CPU set
 .Fa kcp
 into a format of 32-bit integer array,



CVS commit: src/usr.sbin/makefs

2013-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 27 15:35:45 UTC 2013

Modified Files:
src/usr.sbin/makefs: msdos.c
src/usr.sbin/makefs/msdos: msdosfs_vfsops.c msdosfs_vnops.c

Log Message:
fixed directory entry allocation. Now the file data remains and is currently
broken.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/makefs/msdos.c
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/makefs/msdos/msdosfs_vfsops.c
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/makefs/msdos/msdosfs_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/usr.sbin/makefs/msdos.c
diff -u src/usr.sbin/makefs/msdos.c:1.6 src/usr.sbin/makefs/msdos.c:1.7
--- src/usr.sbin/makefs/msdos.c:1.6	Fri Jan 25 19:20:40 2013
+++ src/usr.sbin/makefs/msdos.c	Sun Jan 27 10:35:45 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdos.c,v 1.6 2013/01/26 00:20:40 christos Exp $	*/
+/*	$NetBSD: msdos.c,v 1.7 2013/01/27 15:35:45 christos Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: msdos.c,v 1.6 2013/01/26 00:20:40 christos Exp $);
+__RCSID($NetBSD: msdos.c,v 1.7 2013/01/27 15:35:45 christos Exp $);
 #endif	/* !__lint */
 
 #include sys/param.h
@@ -62,6 +62,8 @@ __RCSID($NetBSD: msdos.c,v 1.6 2013/01/
 #include msdos.h
 #include mkfs_msdos.h
 
+extern int sectorsize;	/* XXX: horrid */
+
 static int msdos_populate_dir(const char *, struct denode *, fsnode *,
 fsnode *, fsinfo_t *);
 
@@ -149,6 +151,7 @@ msdos_makefs(const char *image, const ch
 	 * Is minsize right here?
 	 */
 	msdos_opt-create_size = MAX(msdos_opt-create_size, fsopts-minsize);
+	msdos_opt-bytes_per_sector = sectorsize = 512;
 
 		/* create image */
 	printf(Creating `%s'\n, image);
@@ -159,7 +162,7 @@ msdos_makefs(const char *image, const ch
 
 	vp.fd = open(image, O_RDWR);
 	vp.fs = msdos_opt;
-	vp.offset = 1;
+	vp.offset = 0;
 
 	if ((pmp = msdosfs_mount(vp, 0)) == NULL)
 		err(1, msdosfs_mount);
@@ -171,9 +174,6 @@ msdos_makefs(const char *image, const ch
 		printf(msdos_makefs: image %s directory %s root %p\n,
 		image, dir, root);
 
-	printf(Calculated size of `%s': %lld bytes, %lld inodes\n,
-	image, (long long)fsopts-size, (long long)fsopts-inodes);
-
 		/* populate image */
 	printf(Populating `%s'\n, image);
 	TIMER_START(start);

Index: src/usr.sbin/makefs/msdos/msdosfs_vfsops.c
diff -u src/usr.sbin/makefs/msdos/msdosfs_vfsops.c:1.3 src/usr.sbin/makefs/msdos/msdosfs_vfsops.c:1.4
--- src/usr.sbin/makefs/msdos/msdosfs_vfsops.c:1.3	Sat Jan 26 11:50:46 2013
+++ src/usr.sbin/makefs/msdos/msdosfs_vfsops.c	Sun Jan 27 10:35:45 2013
@@ -50,7 +50,7 @@
 #endif
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_vfsops.c,v 1.3 2013/01/26 16:50:46 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_vfsops.c,v 1.4 2013/01/27 15:35:45 christos Exp $);
 
 #include sys/param.h
 
@@ -94,7 +94,8 @@ msdosfs_mount(struct vnode *devvp, int f
 	uint64_t psize = m-create_size;
 	unsigned secsize = 512;
 
-	if ((error = bread(devvp, 1, secsize, NULL, 0, bp)) != 0)
+	DPRINTF((%s(bread 0)\n, __func__));
+	if ((error = bread(devvp, 0, secsize, NULL, 0, bp)) != 0)
 		goto error_exit;
 
 	bsp = (union bootsector *)bp-b_data;
@@ -135,6 +136,11 @@ msdosfs_mount(struct vnode *devvp, int f
 	pmp-pm_Heads = getushort(b50-bpbHeads);
 	pmp-pm_Media = b50-bpbMedia;
 
+	DPRINTF((%s(BytesPerSec=%u, ResSectors=%u, FATs=%d, RootDirEnts=%u, 
+	Sectors=%u, FATsecs=%lu, SecPerTrack=%u, Heads=%u, Media=%u)\n,
+	__func__, pmp-pm_BytesPerSec, pmp-pm_ResSectors, pmp-pm_FATs,
+	pmp-pm_RootDirEnts, pmp-pm_Sectors, pmp-pm_FATsecs,
+	pmp-pm_SecPerTrack, pmp-pm_Heads, pmp-pm_Media));
 	if (!(flags  MSDOSFSMNT_GEMDOSFS)) {
 		/* XXX - We should probably check more values here */
 		if (!pmp-pm_BytesPerSec || !SecPerClust
@@ -323,6 +329,8 @@ msdosfs_mount(struct vnode *devvp, int f
 		 *	2KB or larger sectors, is the fsinfo structure
 		 *	padded at the end or in the middle?
 		 */
+		DPRINTF((%s(bread %lu)\n, __func__,
+		(unsigned long)de_bn2kb(pmp, pmp-pm_fsinfo)));
 		if ((error = bread(devvp, de_bn2kb(pmp, pmp-pm_fsinfo),
 		pmp-pm_BytesPerSec, NULL, 0, bp)) != 0)
 			goto error_exit;
@@ -352,9 +360,8 @@ msdosfs_mount(struct vnode *devvp, int f
 	 * Allocate memory for the bitmap of allocated clusters, and then
 	 * fill it in.
 	 */
-	pmp-pm_inusemap = malloc(((pmp-pm_maxcluster + N_INUSEBITS)
-   / N_INUSEBITS)
-  * sizeof(*pmp-pm_inusemap));
+	pmp-pm_inusemap = calloc(sizeof(*pmp-pm_inusemap),
+	((pmp-pm_maxcluster + N_INUSEBITS) / N_INUSEBITS));
 	if (pmp-pm_inusemap == NULL)
 		goto error_exit;
 

Index: src/usr.sbin/makefs/msdos/msdosfs_vnops.c
diff -u src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.6 src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.7
--- src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.6	Sun Jan 27 07:25:13 2013

CVS commit: src/usr.sbin/makefs/msdos

2013-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 27 16:03:16 UTC 2013

Modified Files:
src/usr.sbin/makefs/msdos: msdosfs_vnops.c

Log Message:
the max msdos file size is less than size_t so don't bother checking against it.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/makefs/msdos/msdosfs_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/usr.sbin/makefs/msdos/msdosfs_vnops.c
diff -u src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.7 src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.8
--- src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.7	Sun Jan 27 10:35:45 2013
+++ src/usr.sbin/makefs/msdos/msdosfs_vnops.c	Sun Jan 27 11:03:15 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vnops.c,v 1.7 2013/01/27 15:35:45 christos Exp $ */
+/*	$NetBSD: msdosfs_vnops.c,v 1.8 2013/01/27 16:03:15 christos Exp $ */
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -51,7 +51,7 @@
 #endif
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.7 2013/01/27 15:35:45 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.8 2013/01/27 16:03:15 christos Exp $);
 
 #include sys/param.h
 #include sys/mman.h
@@ -423,7 +423,7 @@ msdosfs_wfile(const char *path, struct d
 		return 0;
 
 	/* Don't bother to try to write files larger than the fs limit */
-	if (st-st_size  (off_t)min(MSDOSFS_FILESIZE_MAX,__SIZE_MAX__)) {
+	if (st-st_size  MSDOSFS_FILESIZE_MAX) {
 		errno = EFBIG;
 		return -1;
 	}



CVS commit: src/sys/arch/arm

2013-01-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jan 27 17:38:55 UTC 2013

Modified Files:
src/sys/arch/arm/arm32: bus_dma.c
src/sys/arch/arm/broadcom: bcm2835_obio.c
src/sys/arch/arm/include: bus_defs.h

Log Message:
Add a flag to make bus_dmamem_map use the bus/sys transation table when
mapping bus addresses.  Make bcm2835 obio use it.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/arm/arm32/bus_dma.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/broadcom/bcm2835_obio.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/include/bus_defs.h

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

Modified files:

Index: src/sys/arch/arm/arm32/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.67 src/sys/arch/arm/arm32/bus_dma.c:1.68
--- src/sys/arch/arm/arm32/bus_dma.c:1.67	Wed Jan 16 22:32:45 2013
+++ src/sys/arch/arm/arm32/bus_dma.c	Sun Jan 27 17:38:55 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.67 2013/01/16 22:32:45 matt Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.68 2013/01/27 17:38:55 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define _ARM32_BUS_DMA_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.67 2013/01/16 22:32:45 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.68 2013/01/27 17:38:55 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -970,7 +970,7 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 	if (!bouncing  pre_ops == 0  post_ops == BUS_DMASYNC_POSTWRITE) {
 		return;
 	}
-
+	KASSERT(pre_ops != 0 || (post_ops  BUS_DMASYNC_POSTREAD));
 #ifdef _ARM32_NEED_BUS_DMA_BOUNCE
 	if (bouncing  (ops  BUS_DMASYNC_PREWRITE)) {
 		struct arm32_bus_dma_cookie * const cookie = map-_dm_cookie;
@@ -1213,34 +1213,37 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma
 	 * avoid having a separate mapping for it.
 	 */
 	if (nsegs == 1) {
-		paddr_t paddr = segs[0].ds_addr;
 		/*
 		 * If this is a non-COHERENT mapping, then the existing kernel
 		 * mapping is already compatible with it.
 		 */
-		if ((flags  BUS_DMA_COHERENT) == 0) {
-#ifdef DEBUG_DMA
-			printf(dmamem_map: =%p\n, *kvap);
-#endif	/* DEBUG_DMA */
-			*kvap = (void *)PMAP_MAP_POOLPAGE(paddr);
-			return 0;
-		}
+		bool direct_mapable = (flags  BUS_DMA_COHERENT) == 0;
+		pa = segs[0].ds_addr;
+
 		/*
-		 * This is a COHERENT mapping, which unless this address is in
+		 * This is a COHERENT mapping which, unless this address is in
 		 * a COHERENT dma range, will not be compatible.
 		 */
 		if (t-_ranges != NULL) {
 			const struct arm32_dma_range * const dr =
-			_bus_dma_paddr_inrange(t-_ranges, t-_nranges,
-paddr);
-			if (dr != NULL
-			 (dr-dr_flags  _BUS_DMAMAP_COHERENT) != 0) {
-*kvap = (void *)PMAP_MAP_POOLPAGE(paddr);
+			_bus_dma_paddr_inrange(t-_ranges, t-_nranges, pa);
+			if (dr != NULL) {
+if (dr-dr_flags  _BUS_DMAMAP_COHERENT) {
+	direct_mapable = true;
+}
+if (dr-dr_flags  _BUS_DMAMAP_MEM_XLATE) {
+	pa = (pa - dr-dr_sysbase)
+	+ dr-dr_busbase;
+}
+			}
+		}
+
+		if (direct_mapable) {
+			*kvap = (void *)PMAP_MAP_POOLPAGE(pa);
 #ifdef DEBUG_DMA
-printf(dmamem_map: =%p\n, *kvap);
+			printf(dmamem_map: =%p\n, *kvap);
 #endif	/* DEBUG_DMA */
-return 0;
-			}
+			return 0;
 		}
 	}
 #endif
@@ -1273,11 +1276,28 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma
 		for (pa = segs[curseg].ds_addr;
 		pa  (segs[curseg].ds_addr + segs[curseg].ds_len);
 		pa += PAGE_SIZE, va += PAGE_SIZE, size -= PAGE_SIZE) {
+			bool uncached = (flags  BUS_DMA_COHERENT);
 #ifdef DEBUG_DMA
 			printf(wiring p%lx to v%lx, pa, va);
 #endif	/* DEBUG_DMA */
 			if (size == 0)
 panic(_bus_dmamem_map: size botch);
+
+			const struct arm32_dma_range * const dr =
+			_bus_dma_paddr_inrange(t-_ranges, t-_nranges, pa);
+			/*
+			 * If this dma region is coherent then there is
+			 * no need for an uncached mapping.
+			 */
+			if (dr != NULL) {
+if (dr-dr_flags  _BUS_DMAMAP_COHERENT) {
+	uncached = false;
+}
+if (dr-dr_flags  _BUS_DMAMAP_MEM_XLATE) {
+	pa = (pa - dr-dr_sysbase)
+	 + dr-dr_busbase;
+}
+			}
 			pmap_kenter_pa(va, pa,
 			VM_PROT_READ | VM_PROT_WRITE, PMAP_WIRED);
 
@@ -1289,21 +1309,6 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma
 			 * contain the virtal addresses we are making
 			 * uncacheable.
 			 */
-
-			bool uncached = (flags  BUS_DMA_COHERENT);
-			if (uncached) {
-const struct arm32_dma_range * const dr =
-_bus_dma_paddr_inrange(t-_ranges,
-	t-_nranges, pa);
-/*
- * If this dma region is coherent then there is
- * no need for an uncached mapping.
- */
-if (dr != NULL
- (dr-dr_flags  _BUS_DMAMAP_COHERENT)) {
-	uncached = false;
-}
-			}
 			if (uncached) {
 cpu_dcache_wbinv_range(va, PAGE_SIZE);
 cpu_sdcache_wbinv_range(va, pa, PAGE_SIZE);

Index: 

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

2013-01-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jan 27 17:43:21 UTC 2013

Modified Files:
src/sys/arch/arm/include: ansi.h

Log Message:
Change _BSD_SSIZE_T_ so it's not dependent of _BSD_PTRDIFF_T_


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/include/ansi.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/ansi.h
diff -u src/sys/arch/arm/include/ansi.h:1.14 src/sys/arch/arm/include/ansi.h:1.15
--- src/sys/arch/arm/include/ansi.h:1.14	Thu Jan 24 10:18:41 2013
+++ src/sys/arch/arm/include/ansi.h	Sun Jan 27 17:43:20 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ansi.h,v 1.14 2013/01/24 10:18:41 matt Exp $	*/
+/*	$NetBSD: ansi.h,v 1.15 2013/01/27 17:43:20 matt Exp $	*/
 
 /*
  * Copyright (c) 1990, 1993
@@ -50,15 +50,16 @@
 #define	_BSD_CLOCK_T_		unsigned int	/* clock() */
 #ifdef __PTRDIFF_TYPE__
 #define	_BSD_PTRDIFF_T_		__PTRDIFF_TYPE__ /* ptr1 - ptr2 */
+#define	_BSD_SSIZE_T_		__PTRDIFF_TYPE__ /* byte count or error */
 #else
 #define	_BSD_PTRDIFF_T_		long int	/* ptr1 - ptr2 */
+#define	_BSD_SSIZE_T_		long int	/* byte count or error */
 #endif
 #ifdef __SIZE_TYPE__
 #define	_BSD_SIZE_T_		__SIZE_TYPE__	/* sizeof() */
 #else
 #define	_BSD_SIZE_T_		unsigned long int /* sizeof() */
 #endif
-#define	_BSD_SSIZE_T_		_BSD_PTRDIFF_T_	/* byte count or error */
 #define	_BSD_TIME_T_		__int64_t	/* time() */
 #define	_BSD_CLOCKID_T_		int		/* clockid_t */
 #define	_BSD_TIMER_T_		int		/* timer_t */



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

2013-01-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jan 27 17:44:39 UTC 2013

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_obio.c

Log Message:
Get rid of _BUS_DMAMAP_MEM_XLATE


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/broadcom/bcm2835_obio.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/broadcom/bcm2835_obio.c
diff -u src/sys/arch/arm/broadcom/bcm2835_obio.c:1.14 src/sys/arch/arm/broadcom/bcm2835_obio.c:1.15
--- src/sys/arch/arm/broadcom/bcm2835_obio.c:1.14	Sun Jan 27 17:38:55 2013
+++ src/sys/arch/arm/broadcom/bcm2835_obio.c	Sun Jan 27 17:44:39 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_obio.c,v 1.14 2013/01/27 17:38:55 matt Exp $	*/
+/*	$NetBSD: bcm2835_obio.c,v 1.15 2013/01/27 17:44:39 matt Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bcm2835_obio.c,v 1.14 2013/01/27 17:38:55 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: bcm2835_obio.c,v 1.15 2013/01/27 17:44:39 matt Exp $);
 
 #include locators.h
 #include obio.h
@@ -183,7 +183,6 @@ obio_attach(device_t parent, device_t se
 	sc-sc_dmarange.dr_sysbase = 0;
 	sc-sc_dmarange.dr_busbase = BCM2835_BUSADDR_CACHE_COHERENT;
 	sc-sc_dmarange.dr_len = physmem * PAGE_SIZE;
-	sc-sc_dmarange.dr_flags = _BUS_DMAMAP_MEM_XLATE;
 	bcm2835_bus_dma_tag._ranges = sc-sc_dmarange;
 	bcm2835_bus_dma_tag._nranges = 1;
 



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

2013-01-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jan 27 17:48:38 UTC 2013

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

Log Message:
Make _BUS_DMAMAP_MEM_XLATE supplied by the caller.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/arm/arm32/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/arm/arm32/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.68 src/sys/arch/arm/arm32/bus_dma.c:1.69
--- src/sys/arch/arm/arm32/bus_dma.c:1.68	Sun Jan 27 17:38:55 2013
+++ src/sys/arch/arm/arm32/bus_dma.c	Sun Jan 27 17:48:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.68 2013/01/27 17:38:55 matt Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.69 2013/01/27 17:48:38 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define _ARM32_BUS_DMA_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.68 2013/01/27 17:38:55 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.69 2013/01/27 17:48:38 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1231,7 +1231,7 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma
 if (dr-dr_flags  _BUS_DMAMAP_COHERENT) {
 	direct_mapable = true;
 }
-if (dr-dr_flags  _BUS_DMAMAP_MEM_XLATE) {
+if (flags  _BUS_DMAMAP_MEM_XLATE) {
 	pa = (pa - dr-dr_sysbase)
 	+ dr-dr_busbase;
 }
@@ -1293,7 +1293,7 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma
 if (dr-dr_flags  _BUS_DMAMAP_COHERENT) {
 	uncached = false;
 }
-if (dr-dr_flags  _BUS_DMAMAP_MEM_XLATE) {
+if (flags  _BUS_DMAMAP_MEM_XLATE) {
 	pa = (pa - dr-dr_sysbase)
 	 + dr-dr_busbase;
 }



CVS commit: src/sys/arch/arm

2013-01-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jan 27 18:31:32 UTC 2013

Modified Files:
src/sys/arch/arm/arm32: bus_dma.c
src/sys/arch/arm/broadcom: bcm2835_obio.c
src/sys/arch/arm/include: bus_defs.h

Log Message:
Add a _BUS_DMAMAP_NOALLOC which tells bus_dmamem_alloc to skip that
dmarange when allocating memory.
Add a second dmarange to bcm23xx obio to allow it to map coherently mapped
memory.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/arm/arm32/bus_dma.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/broadcom/bcm2835_obio.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/include/bus_defs.h

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

Modified files:

Index: src/sys/arch/arm/arm32/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.69 src/sys/arch/arm/arm32/bus_dma.c:1.70
--- src/sys/arch/arm/arm32/bus_dma.c:1.69	Sun Jan 27 17:48:38 2013
+++ src/sys/arch/arm/arm32/bus_dma.c	Sun Jan 27 18:31:31 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.69 2013/01/27 17:48:38 matt Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.70 2013/01/27 18:31:31 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define _ARM32_BUS_DMA_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.69 2013/01/27 17:48:38 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.70 2013/01/27 18:31:31 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1132,7 +1132,8 @@ _bus_dmamem_alloc(bus_dma_tag_t t, bus_s
 	if ((dr = t-_ranges) != NULL) {
 		error = ENOMEM;
 		for (i = 0; i  t-_nranges; i++, dr++) {
-			if (dr-dr_len == 0)
+			if (dr-dr_len == 0
+			|| (dr-dr_flags  _BUS_DMAMAP_NOALLOC))
 continue;
 			error = _bus_dmamem_alloc_range(t, size, alignment,
 			boundary, segs, nsegs, rsegs, flags,

Index: src/sys/arch/arm/broadcom/bcm2835_obio.c
diff -u src/sys/arch/arm/broadcom/bcm2835_obio.c:1.15 src/sys/arch/arm/broadcom/bcm2835_obio.c:1.16
--- src/sys/arch/arm/broadcom/bcm2835_obio.c:1.15	Sun Jan 27 17:44:39 2013
+++ src/sys/arch/arm/broadcom/bcm2835_obio.c	Sun Jan 27 18:31:32 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_obio.c,v 1.15 2013/01/27 17:44:39 matt Exp $	*/
+/*	$NetBSD: bcm2835_obio.c,v 1.16 2013/01/27 18:31:32 matt Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bcm2835_obio.c,v 1.15 2013/01/27 17:44:39 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: bcm2835_obio.c,v 1.16 2013/01/27 18:31:32 matt Exp $);
 
 #include locators.h
 #include obio.h
@@ -47,7 +47,7 @@ __KERNEL_RCSID(0, $NetBSD: bcm2835_obio
 struct obio_softc {
 	device_t		sc_dev;
 	bus_dma_tag_t		sc_dmat;
-	struct arm32_dma_range	sc_dmarange;
+	struct arm32_dma_range	sc_dmarange[2];
 	bus_space_tag_t		sc_iot;
 	bus_space_handle_t	sc_ioh;
 	bus_addr_t		sc_base;
@@ -180,11 +180,14 @@ obio_attach(device_t parent, device_t se
 	sc-sc_dev = self;
 	sc-sc_dmat = bcm2835_bus_dma_tag;
 
-	sc-sc_dmarange.dr_sysbase = 0;
-	sc-sc_dmarange.dr_busbase = BCM2835_BUSADDR_CACHE_COHERENT;
-	sc-sc_dmarange.dr_len = physmem * PAGE_SIZE;
-	bcm2835_bus_dma_tag._ranges = sc-sc_dmarange;
-	bcm2835_bus_dma_tag._nranges = 1;
+	sc-sc_dmarange[0].dr_sysbase = 0;
+	sc-sc_dmarange[0].dr_busbase = BCM2835_BUSADDR_CACHE_COHERENT;
+	sc-sc_dmarange[0].dr_len = physmem * PAGE_SIZE;
+	sc-sc_dmarange[1] = sc-sc_dmarange[0];
+	sc-sc_dmarange[1].dr_sysbase = BCM2835_BUSADDR_CACHE_COHERENT;
+	sc-sc_dmarange[1].dr_flags = _BUS_DMAMAP_NOALLOC;
+	bcm2835_bus_dma_tag._ranges = sc-sc_dmarange;
+	bcm2835_bus_dma_tag._nranges = __arraycount(sc-sc_dmarange);
 
 	aprint_normal(\n);
 

Index: src/sys/arch/arm/include/bus_defs.h
diff -u src/sys/arch/arm/include/bus_defs.h:1.6 src/sys/arch/arm/include/bus_defs.h:1.7
--- src/sys/arch/arm/include/bus_defs.h:1.6	Sun Jan 27 17:38:55 2013
+++ src/sys/arch/arm/include/bus_defs.h	Sun Jan 27 18:31:31 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_defs.h,v 1.6 2013/01/27 17:38:55 matt Exp $	*/
+/*	$NetBSD: bus_defs.h,v 1.7 2013/01/27 18:31:31 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -300,8 +300,9 @@ struct bus_space {
  * Private flags stored in the DMA map.
  */
 #define	_BUS_DMAMAP_COHERENT	0x1	/* no cache flush necessary on sync */
-#define	_BUS_DMAMAP_IS_BOUNCING	0x2	/* is bouncing current xfer */
-#define	_BUS_DMAMAP_MEM_XLATE	0x4 /* translate sys-bus for dmamam_map */
+#define	_BUS_DMAMAP_IS_BOUNCING	0x2 /* is bouncing current xfer */
+#define	_BUS_DMAMAP_MEM_XLATE	0x4	/* translate sys-bus for dmamam_map */
+#define	_BUS_DMAMAP_NOALLOC	0x8	/* don't alloc memory from this range */
 
 /* Forwards needed by prototypes below. */
 struct mbuf;



CVS commit: src/usr.bin/make

2013-01-27 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Sun Jan 27 18:52:02 UTC 2013

Modified Files:
src/usr.bin/make: make.1

Log Message:
In SHELL COMMANDS section, provide some clues about different
behavior in jobs vs non-jobs mode.
Move the comment about when shell is skipped to this discussion
from COMPATABILITY.
Remove the incorrect statement about default mode being somehow
neither jobs mode or compat mode (it is compat mode).


To generate a diff of this commit:
cvs rdiff -u -r1.209 -r1.210 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.209 src/usr.bin/make/make.1:1.210
--- src/usr.bin/make/make.1:1.209	Mon Oct  8 15:09:48 2012
+++ src/usr.bin/make/make.1	Sun Jan 27 18:52:01 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: make.1,v 1.209 2012/10/08 15:09:48 christos Exp $
+.\	$NetBSD: make.1,v 1.210 2013/01/27 18:52:01 sjg Exp $
 .\
 .\ Copyright (c) 1990, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\	from: @(#)make.1	8.4 (Berkeley) 3/19/94
 .\
-.Dd October 8, 2012
+.Dd January 23, 2013
 .Dt MAKE 1
 .Os
 .Sh NAME
@@ -468,6 +468,50 @@ except that the effect can be limited to
 A
 .Ql Ic \-
 causes any non-zero exit status of the command line to be ignored.
+.Pp
+When
+.Nm
+is run in jobs mode with
+.Fl j Ar max_jobs ,
+the entire script for the target is fed to a
+single instance of the shell.
+.Pp
+In compatibility (non-jobs) mode, each command is run in a separate process.
+If the command contains any shell meta characters
+.Pq Ql #=|^(){};*?[]:$`\e\en
+it will be passed to the shell, otherwise
+.Nm
+will attempt direct execution.
+.Pp
+Since
+.Nm
+will
+.Xr chdir 2
+to
+.Ql Va .OBJDIR
+before executing any targets, each child process
+starts with that as its current working directory.
+.Pp
+Makefiles should be written so that the mode of
+.Nm
+operation does not change their behavior.
+For example, any command which needs to use
+.Dq cd
+or
+.Dq chdir ,
+without side-effect should be put in parenthesis:
+.Bd -literal -offset indent
+
+avoid-chdir-side-effects:
+	@echo Building $@ in `pwd`
+	@(cd ${.CURDIR}  ${.MAKE} $@)
+	@echo Back in `pwd`
+
+ensure-one-shell-regardless-of-mode:
+	@echo Building $@ in `pwd`; \\
+	(cd ${.CURDIR}  ${.MAKE} $@); \\
+	echo Back in `pwd`
+.Ed
 .Sh VARIABLE ASSIGNMENTS
 Variables in make are much like variables in the shell, and, by tradition,
 consist of all upper-case letters.
@@ -2027,28 +2071,6 @@ The way that .for loop variables are sub
 so that they still appear to be variable expansions.
 In particular this stops them being treated as syntax, and removes some
 obscure problems using them in .if statements.
-.Pp
-Unlike other
-.Nm
-programs, this implementation by default executes all commands for a given
-target using a single shell invocation.
-This is done for both efficiency and to simplify error handling in remote
-command invocations.
-Typically this is transparent to the user, unless the target commands change
-the current working directory using
-.Dq cd
-or
-.Dq chdir .
-To be compatible with Makefiles that do this, one can use
-.Fl B
-to disable this behavior.
-.Pp
-In compatibility mode, each command is run in a separate process.
-If the command contains any shell meta characters
-.Pq Ql #=|^(){};*?[]:$`\e\en
-it will be passed to the shell, otherwise
-.Nm
-will attempt direct execution.
 .Sh SEE ALSO
 .Xr mkdep 1
 .Sh HISTORY



CVS commit: src/sys/arch/arm

2013-01-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jan 27 19:00:08 UTC 2013

Modified Files:
src/sys/arch/arm/arm32: bus_dma.c
src/sys/arch/arm/include: bus_defs.h

Log Message:
Get rid of _BUS_DMAMAP_MEM_XLATE


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/arm/arm32/bus_dma.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/include/bus_defs.h

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

Modified files:

Index: src/sys/arch/arm/arm32/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.70 src/sys/arch/arm/arm32/bus_dma.c:1.71
--- src/sys/arch/arm/arm32/bus_dma.c:1.70	Sun Jan 27 18:31:31 2013
+++ src/sys/arch/arm/arm32/bus_dma.c	Sun Jan 27 19:00:08 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.70 2013/01/27 18:31:31 matt Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.71 2013/01/27 19:00:08 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define _ARM32_BUS_DMA_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.70 2013/01/27 18:31:31 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.71 2013/01/27 19:00:08 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1228,14 +1228,9 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma
 		if (t-_ranges != NULL) {
 			const struct arm32_dma_range * const dr =
 			_bus_dma_paddr_inrange(t-_ranges, t-_nranges, pa);
-			if (dr != NULL) {
-if (dr-dr_flags  _BUS_DMAMAP_COHERENT) {
-	direct_mapable = true;
-}
-if (flags  _BUS_DMAMAP_MEM_XLATE) {
-	pa = (pa - dr-dr_sysbase)
-	+ dr-dr_busbase;
-}
+			if (dr != NULL
+			 (dr-dr_flags  _BUS_DMAMAP_COHERENT)) {
+direct_mapable = true;
 			}
 		}
 
@@ -1290,15 +1285,11 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma
 			 * If this dma region is coherent then there is
 			 * no need for an uncached mapping.
 			 */
-			if (dr != NULL) {
-if (dr-dr_flags  _BUS_DMAMAP_COHERENT) {
-	uncached = false;
-}
-if (flags  _BUS_DMAMAP_MEM_XLATE) {
-	pa = (pa - dr-dr_sysbase)
-	 + dr-dr_busbase;
-}
+			if (dr != NULL
+			 (dr-dr_flags  _BUS_DMAMAP_COHERENT)) {
+uncached = false;
 			}
+
 			pmap_kenter_pa(va, pa,
 			VM_PROT_READ | VM_PROT_WRITE, PMAP_WIRED);
 

Index: src/sys/arch/arm/include/bus_defs.h
diff -u src/sys/arch/arm/include/bus_defs.h:1.7 src/sys/arch/arm/include/bus_defs.h:1.8
--- src/sys/arch/arm/include/bus_defs.h:1.7	Sun Jan 27 18:31:31 2013
+++ src/sys/arch/arm/include/bus_defs.h	Sun Jan 27 19:00:08 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_defs.h,v 1.7 2013/01/27 18:31:31 matt Exp $	*/
+/*	$NetBSD: bus_defs.h,v 1.8 2013/01/27 19:00:08 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -301,8 +301,7 @@ struct bus_space {
  */
 #define	_BUS_DMAMAP_COHERENT	0x1	/* no cache flush necessary on sync */
 #define	_BUS_DMAMAP_IS_BOUNCING	0x2 /* is bouncing current xfer */
-#define	_BUS_DMAMAP_MEM_XLATE	0x4	/* translate sys-bus for dmamam_map */
-#define	_BUS_DMAMAP_NOALLOC	0x8	/* don't alloc memory from this range */
+#define	_BUS_DMAMAP_NOALLOC	0x4	/* don't alloc memory from this range */
 
 /* Forwards needed by prototypes below. */
 struct mbuf;



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

2013-01-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Jan 27 19:06:45 UTC 2013

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_obio.c

Log Message:
Revert back to one dmarange


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/broadcom/bcm2835_obio.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/broadcom/bcm2835_obio.c
diff -u src/sys/arch/arm/broadcom/bcm2835_obio.c:1.16 src/sys/arch/arm/broadcom/bcm2835_obio.c:1.17
--- src/sys/arch/arm/broadcom/bcm2835_obio.c:1.16	Sun Jan 27 18:31:32 2013
+++ src/sys/arch/arm/broadcom/bcm2835_obio.c	Sun Jan 27 19:06:45 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_obio.c,v 1.16 2013/01/27 18:31:32 matt Exp $	*/
+/*	$NetBSD: bcm2835_obio.c,v 1.17 2013/01/27 19:06:45 matt Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bcm2835_obio.c,v 1.16 2013/01/27 18:31:32 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: bcm2835_obio.c,v 1.17 2013/01/27 19:06:45 matt Exp $);
 
 #include locators.h
 #include obio.h
@@ -47,7 +47,7 @@ __KERNEL_RCSID(0, $NetBSD: bcm2835_obio
 struct obio_softc {
 	device_t		sc_dev;
 	bus_dma_tag_t		sc_dmat;
-	struct arm32_dma_range	sc_dmarange[2];
+	struct arm32_dma_range	sc_dmarange[1];
 	bus_space_tag_t		sc_iot;
 	bus_space_handle_t	sc_ioh;
 	bus_addr_t		sc_base;
@@ -183,9 +183,6 @@ obio_attach(device_t parent, device_t se
 	sc-sc_dmarange[0].dr_sysbase = 0;
 	sc-sc_dmarange[0].dr_busbase = BCM2835_BUSADDR_CACHE_COHERENT;
 	sc-sc_dmarange[0].dr_len = physmem * PAGE_SIZE;
-	sc-sc_dmarange[1] = sc-sc_dmarange[0];
-	sc-sc_dmarange[1].dr_sysbase = BCM2835_BUSADDR_CACHE_COHERENT;
-	sc-sc_dmarange[1].dr_flags = _BUS_DMAMAP_NOALLOC;
 	bcm2835_bus_dma_tag._ranges = sc-sc_dmarange;
 	bcm2835_bus_dma_tag._nranges = __arraycount(sc-sc_dmarange);
 



CVS commit: src/tools

2013-01-27 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jan 27 19:21:12 UTC 2013

Modified Files:
src/tools/ctfconvert: Makefile
src/tools/ctfmerge: Makefile

Log Message:
Set NOMAN before including bsd.own.mk to really fix PR 47500.

(Hi, christos.)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tools/ctfconvert/Makefile
cvs rdiff -u -r1.3 -r1.4 src/tools/ctfmerge/Makefile

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

Modified files:

Index: src/tools/ctfconvert/Makefile
diff -u src/tools/ctfconvert/Makefile:1.3 src/tools/ctfconvert/Makefile:1.4
--- src/tools/ctfconvert/Makefile:1.3	Thu Jan 24 13:35:52 2013
+++ src/tools/ctfconvert/Makefile	Sun Jan 27 19:21:12 2013
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.3 2013/01/24 13:35:52 christos Exp $
-
-.include bsd.own.mk
+#	$NetBSD: Makefile,v 1.4 2013/01/27 19:21:12 riastradh Exp $
 
 NOMAN=	# defined
 
+.include bsd.own.mk
+
 HOSTPROGNAME=   ${_TOOL_PREFIX}ctfconvert
 HOST_SRCDIR=external/cddl/osnet/usr.bin/ctfconvert
 #HOST_SRCS=	alist.c \

Index: src/tools/ctfmerge/Makefile
diff -u src/tools/ctfmerge/Makefile:1.3 src/tools/ctfmerge/Makefile:1.4
--- src/tools/ctfmerge/Makefile:1.3	Thu Jan 24 13:35:52 2013
+++ src/tools/ctfmerge/Makefile	Sun Jan 27 19:21:12 2013
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.3 2013/01/24 13:35:52 christos Exp $
-
-.include bsd.own.mk
+#	$NetBSD: Makefile,v 1.4 2013/01/27 19:21:12 riastradh Exp $
 
 NOMAN=	# defined
 
+.include bsd.own.mk
+
 HOSTPROGNAME=   ${_TOOL_PREFIX}ctfmerge
 HOST_SRCDIR=external/cddl/osnet/usr.bin/ctfmerge
 



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

2013-01-27 Thread Radoslaw Kujawa
Module Name:src
Committed By:   rkujawa
Date:   Sun Jan 27 19:58:04 UTC 2013

Modified Files:
src/sys/arch/amiga/dev: a2kbbc.c

Log Message:
Remove confusing, leftover comment.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/amiga/dev/a2kbbc.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/amiga/dev/a2kbbc.c
diff -u src/sys/arch/amiga/dev/a2kbbc.c:1.25 src/sys/arch/amiga/dev/a2kbbc.c:1.26
--- src/sys/arch/amiga/dev/a2kbbc.c:1.25	Wed Nov 14 01:55:25 2012
+++ src/sys/arch/amiga/dev/a2kbbc.c	Sun Jan 27 19:58:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: a2kbbc.c,v 1.25 2012/11/14 01:55:25 rkujawa Exp $ */
+/*	$NetBSD: a2kbbc.c,v 1.26 2013/01/27 19:58:04 rkujawa Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: a2kbbc.c,v 1.25 2012/11/14 01:55:25 rkujawa Exp $);
+__KERNEL_RCSID(0, $NetBSD: a2kbbc.c,v 1.26 2013/01/27 19:58:04 rkujawa Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -74,7 +74,6 @@ CFATTACH_DECL_NEW(a2kbbc, sizeof(struct 
 static int
 a2kbbc_match(device_t parent, cfdata_t cf, void *aux)
 {
-	//struct clock_ymdhms dt;
 	static int a2kbbc_matched = 0;
 
 	if (!matchname(a2kbbc, aux))



CVS commit: src/usr.sbin/makefs

2013-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 27 20:05:47 UTC 2013

Modified Files:
src/usr.sbin/makefs: Makefile ffs.c msdos.c
src/usr.sbin/makefs/ffs: buf.c buf.h ffs_alloc.c ffs_balloc.c
src/usr.sbin/makefs/msdos: msdosfs_vfsops.c msdosfs_vnops.c

Log Message:
This works well enough to populate plain files in the root dir. creating
directories fails.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.sbin/makefs/Makefile
cvs rdiff -u -r1.54 -r1.55 src/usr.sbin/makefs/ffs.c
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/makefs/msdos.c
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/makefs/ffs/buf.c
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/makefs/ffs/buf.h
cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/makefs/ffs/ffs_alloc.c
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/makefs/ffs/ffs_balloc.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/makefs/msdos/msdosfs_vfsops.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/makefs/msdos/msdosfs_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/usr.sbin/makefs/Makefile
diff -u src/usr.sbin/makefs/Makefile:1.34 src/usr.sbin/makefs/Makefile:1.35
--- src/usr.sbin/makefs/Makefile:1.34	Fri Jan 25 19:31:49 2013
+++ src/usr.sbin/makefs/Makefile	Sun Jan 27 15:05:46 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.34 2013/01/26 00:31:49 christos Exp $
+#	$NetBSD: Makefile,v 1.35 2013/01/27 20:05:46 christos Exp $
 #
 
 WARNS?=	5
@@ -18,7 +18,7 @@ MKNODSRC=	${NETBSDSRCDIR}/sbin/mknod
 MTREESRC=	${NETBSDSRCDIR}/usr.sbin/mtree
 
 CPPFLAGS+=	-I${.CURDIR} -I${MKNODSRC} -I${MTREESRC} -DMAKEFS
-CPPFLAGS+=	-DMSDOSFS_DEBUG
+#CPPFLAGS+=	-DMSDOSFS_DEBUG
 .PATH:		${MKNODSRC} ${MTREESRC}
 
 .include ${.CURDIR}/cd9660/Makefile.inc

Index: src/usr.sbin/makefs/ffs.c
diff -u src/usr.sbin/makefs/ffs.c:1.54 src/usr.sbin/makefs/ffs.c:1.55
--- src/usr.sbin/makefs/ffs.c:1.54	Fri Jan 25 19:19:39 2013
+++ src/usr.sbin/makefs/ffs.c	Sun Jan 27 15:05:46 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs.c,v 1.54 2013/01/26 00:19:39 christos Exp $	*/
+/*	$NetBSD: ffs.c,v 1.55 2013/01/27 20:05:46 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -71,7 +71,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: ffs.c,v 1.54 2013/01/26 00:19:39 christos Exp $);
+__RCSID($NetBSD: ffs.c,v 1.55 2013/01/27 20:05:46 christos Exp $);
 #endif	/* !__lint */
 
 #include sys/param.h
@@ -945,7 +945,6 @@ ffs_write_file(union dinode *din, uint32
 		errno = bwrite(bp);
 		if (errno != 0)
 			goto bad_ffs_write_file;
-		brelse(bp, 0);
 		if (!isfile)
 			p += chunk;
 	}

Index: src/usr.sbin/makefs/msdos.c
diff -u src/usr.sbin/makefs/msdos.c:1.7 src/usr.sbin/makefs/msdos.c:1.8
--- src/usr.sbin/makefs/msdos.c:1.7	Sun Jan 27 10:35:45 2013
+++ src/usr.sbin/makefs/msdos.c	Sun Jan 27 15:05:46 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdos.c,v 1.7 2013/01/27 15:35:45 christos Exp $	*/
+/*	$NetBSD: msdos.c,v 1.8 2013/01/27 20:05:46 christos Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: msdos.c,v 1.7 2013/01/27 15:35:45 christos Exp $);
+__RCSID($NetBSD: msdos.c,v 1.8 2013/01/27 20:05:46 christos Exp $);
 #endif	/* !__lint */
 
 #include sys/param.h
@@ -162,7 +162,6 @@ msdos_makefs(const char *image, const ch
 
 	vp.fd = open(image, O_RDWR);
 	vp.fs = msdos_opt;
-	vp.offset = 0;
 
 	if ((pmp = msdosfs_mount(vp, 0)) == NULL)
 		err(1, msdosfs_mount);
@@ -237,7 +236,7 @@ msdos_populate_dir(const char *path, str
 			continue;
 		}
 		if (msdosfs_mkfile(pbuf, dir, cur) == NULL)
-			err(1, msdosfs_mkfile);
+			err(1, msdosfs_mkfile %s, pbuf);
 	}
 	return 0;
 }

Index: src/usr.sbin/makefs/ffs/buf.c
diff -u src/usr.sbin/makefs/ffs/buf.c:1.14 src/usr.sbin/makefs/ffs/buf.c:1.15
--- src/usr.sbin/makefs/ffs/buf.c:1.14	Sun Jan 27 09:10:03 2013
+++ src/usr.sbin/makefs/ffs/buf.c	Sun Jan 27 15:05:46 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.c,v 1.14 2013/01/27 14:10:03 christos Exp $	*/
+/*	$NetBSD: buf.c,v 1.15 2013/01/27 20:05:46 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: buf.c,v 1.14 2013/01/27 14:10:03 christos Exp $);
+__RCSID($NetBSD: buf.c,v 1.15 2013/01/27 20:05:46 christos Exp $);
 #endif	/* !__lint */
 
 #include sys/param.h
@@ -148,6 +148,7 @@ bwrite(struct buf *bp)
 	if (debug  DEBUG_BUF_BWRITE)
 		printf(bwrite: write %ld (offset %lld) returned %lld\n,
 		bp-b_bcount, (long long)offset, (long long)rv);
+	brelse(bp, 0);
 	if (rv == bp-b_bcount)
 		return (0);
 	else if (rv == -1)		/* write error */
@@ -189,7 +190,6 @@ getblk(struct vnode *vp, daddr_t blkno, 
 	int fd = vp-fd;
 	struct fs *fs = vp-fs;
 
-	// blkno += vp-offset;
 	assert (fs != NULL);
 	if (debug  DEBUG_BUF_GETBLK)
 		printf(getblk: blkno %lld size %d\n, (long long)blkno, size);


CVS commit: src/sys/fs/msdosfs

2013-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 27 20:15:58 UTC 2013

Modified Files:
src/sys/fs/msdosfs: msdosfs_fat.c

Log Message:
tidy up debugging printfs; no functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/fs/msdosfs/msdosfs_fat.c

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

Modified files:

Index: src/sys/fs/msdosfs/msdosfs_fat.c
diff -u src/sys/fs/msdosfs/msdosfs_fat.c:1.25 src/sys/fs/msdosfs/msdosfs_fat.c:1.26
--- src/sys/fs/msdosfs/msdosfs_fat.c:1.25	Sat Jan 26 11:51:51 2013
+++ src/sys/fs/msdosfs/msdosfs_fat.c	Sun Jan 27 15:15:58 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_fat.c,v 1.25 2013/01/26 16:51:51 christos Exp $	*/
+/*	$NetBSD: msdosfs_fat.c,v 1.26 2013/01/27 20:15:58 christos Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -52,7 +52,7 @@
 #endif
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_fat.c,v 1.25 2013/01/26 16:51:51 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_fat.c,v 1.26 2013/01/27 20:15:58 christos Exp $);
 
 /*
  * kernel include files.
@@ -97,6 +97,11 @@ int fc_wherefrom, fc_whereto, fc_lastclu
 int pm_fatblocksize;
 
 #ifdef MSDOSFS_DEBUG
+#define DPRINTF(a) printf a
+#else
+#define DPRINTF(a)
+#endif
+#ifdef MSDOSFS_DEBUG
 void print_fat_stats(void);
 
 void
@@ -199,6 +204,7 @@ pcbmap(struct denode *dep, u_long findcn
 		return (0);
 
 	cn = dep-de_StartCluster;
+	DPRINTF((%s(start cluster=%lu)\n, __func__, cn));
 	/*
 	 * The file that makes up the root directory is contiguous,
 	 * permanently allocated, of fixed size, and is not made up of
@@ -210,6 +216,8 @@ pcbmap(struct denode *dep, u_long findcn
 			if (de_cn2off(pmp, findcn) = dep-de_FileSize) {
 if (cnp)
 	*cnp = de_bn2cn(pmp, pmp-pm_rootdirsize);
+DPRINTF((%s(root, %lu ETOOBIG)\n, __func__,
+de_cn2off(pmp, findcn)));
 return (E2BIG);
 			}
 			if (bnp)
@@ -219,10 +227,14 @@ pcbmap(struct denode *dep, u_long findcn
 			if (sp)
 *sp = min(pmp-pm_bpcluster,
 dep-de_FileSize - de_cn2off(pmp, findcn));
+			DPRINTF((%s(root, bn=%lu, cn=%u)\n, __func__,
+			pmp-pm_rootdirblk + de_cn2bn(pmp, findcn),
+			MSDOSFSROOT));
 			return (0);
 		} else {		/* just an empty file */
 			if (cnp)
 *cnp = 0;
+			DPRINTF((%s(root, empty ETOOBIG)\n, __func__));
 			return (E2BIG);
 		}
 	}
@@ -240,6 +252,8 @@ pcbmap(struct denode *dep, u_long findcn
 	 */
 	i = 0;
 	fc_lookup(dep, findcn, i, cn);
+	DPRINTF((%s(bpcluster=%lu i=%lu cn=%lu\n, __func__, pmp-pm_bpcluster,
+	i, cn));
 	if ((bn = findcn - i) = LMMAX) {
 		fc_largedistance++;
 		fc_wherefrom = i;
@@ -265,6 +279,7 @@ pcbmap(struct denode *dep, u_long findcn
 			error = bread(pmp-pm_devvp, de_bn2kb(pmp, bn), bsize,
 			NOCRED, 0, bp);
 			if (error) {
+DPRINTF((%s(bread, %d)\n, __func__, error));
 return (error);
 			}
 			bp_bn = bn;
@@ -273,6 +288,8 @@ pcbmap(struct denode *dep, u_long findcn
 		if (bo = bsize) {
 			if (bp)
 brelse(bp, 0);
+			DPRINTF((%s(block, %lu = %lu)\n, __func__, bo,
+			bsize));
 			return (EIO);
 		}
 		KASSERT(bp != NULL);
@@ -292,6 +309,8 @@ pcbmap(struct denode *dep, u_long findcn
 			*bnp = cntobn(pmp, cn);
 		if (cnp)
 			*cnp = cn;
+		DPRINTF((%s(bn=%lu, cn=%lu)\n, __func__, cntobn(pmp, cn),
+		cn));
 		fc_setcache(dep, FC_LASTMAP, i, cn);
 		return (0);
 	}
@@ -303,6 +322,7 @@ hiteof:;
 		brelse(bp, 0);
 	/* update last file cluster entry in the FAT cache */
 	fc_setcache(dep, FC_LASTFC, i - 1, prevcn);
+	DPRINTF((%s(eof, %lu)\n, __func__, i));
 	return (E2BIG);
 }
 
@@ -362,10 +382,7 @@ updatefats(struct msdosfsmount *pmp, str
 	int i;
 	struct buf *bpn;
 
-#ifdef MSDOSFS_DEBUG
-	printf(updatefats(pmp %p, bp %p, fatbn %lu)\n,
-	pmp, bp, fatbn);
-#endif
+	DPRINTF((%s(pmp %p, bp %p, fatbn %lu)\n, __func__, pmp, bp, fatbn));
 
 	/*
 	 * If we have an FSInfo block, update it.
@@ -530,17 +547,16 @@ fatentry(int function, struct msdosfsmou
 	u_long bn, bo, bsize, byteoffset;
 	struct buf *bp;
 
-#ifdef	MSDOSFS_DEBUG
-	printf(fatentry(func %d, pmp %p, clust %lu, oldcon %p, newcon %lx)\n,
-	 function, pmp, cn, oldcontents, newcontents);
-#endif
+	DPRINTF((%s(func %d, pmp %p, clust %lu, oldcon %p, newcon  %lx)\n,
+	__func__, function, pmp, cn, oldcontents, newcontents));
 
 #ifdef DIAGNOSTIC
 	/*
 	 * Be sure they asked us to do something.
 	 */
 	if ((function  (FAT_SET | FAT_GET)) == 0) {
-		printf(fatentry(): function code doesn't specify get or set\n);
+		DPRINTF((%s(): function code doesn't specify get or set\n,
+		__func__));
 		return (EINVAL);
 	}
 
@@ -549,7 +565,8 @@ fatentry(int function, struct msdosfsmou
 	 * where to put it, give them an error.
 	 */
 	if ((function  FAT_GET)  oldcontents == NULL) {
-		printf(fatentry(): get function with no place to put result\n);
+		DPRINTF((%s(): get function with no place to put result\n,
+			__func__));
 		return (EINVAL);
 	}
 

CVS commit: src/sbin/newfs_msdos

2013-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 27 21:56:27 UTC 2013

Modified Files:
src/sbin/newfs_msdos: mkfs_msdos.c

Log Message:
nbtool_config.h undefines _NETBSD_SOURCE, and that makes sys/types.h not
define cpuid_t, which makes sys/mount.h unincludable. Although this is a
bug in the build system, it is simpler to fix it here.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sbin/newfs_msdos/mkfs_msdos.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/newfs_msdos/mkfs_msdos.c
diff -u src/sbin/newfs_msdos/mkfs_msdos.c:1.5 src/sbin/newfs_msdos/mkfs_msdos.c:1.6
--- src/sbin/newfs_msdos/mkfs_msdos.c:1.5	Thu Jan 24 14:24:56 2013
+++ src/sbin/newfs_msdos/mkfs_msdos.c	Sun Jan 27 16:56:26 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkfs_msdos.c,v 1.5 2013/01/24 19:24:56 christos Exp $	*/
+/*	$NetBSD: mkfs_msdos.c,v 1.6 2013/01/27 21:56:26 christos Exp $	*/
 
 /*
  * Copyright (c) 1998 Robert Nordier
@@ -37,16 +37,16 @@
 static const char rcsid[] =
   $FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $;
 #else
-__RCSID($NetBSD: mkfs_msdos.c,v 1.5 2013/01/24 19:24:56 christos Exp $);
+__RCSID($NetBSD: mkfs_msdos.c,v 1.6 2013/01/27 21:56:26 christos Exp $);
 #endif
 #endif /* not lint */
 
 #include sys/types.h
 #include sys/param.h
-#include sys/mount.h
 #include sys/stat.h
 #include sys/time.h
 #ifndef MAKEFS
+#include sys/mount.h
 #include sys/disk.h
 #endif
 



CVS commit: src/sys/fs/msdosfs

2013-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 27 22:04:19 UTC 2013

Modified Files:
src/sys/fs/msdosfs: msdosfs_fat.c

Log Message:
don't need sys/mount.h in userland.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/fs/msdosfs/msdosfs_fat.c

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

Modified files:

Index: src/sys/fs/msdosfs/msdosfs_fat.c
diff -u src/sys/fs/msdosfs/msdosfs_fat.c:1.26 src/sys/fs/msdosfs/msdosfs_fat.c:1.27
--- src/sys/fs/msdosfs/msdosfs_fat.c:1.26	Sun Jan 27 15:15:58 2013
+++ src/sys/fs/msdosfs/msdosfs_fat.c	Sun Jan 27 17:04:19 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_fat.c,v 1.26 2013/01/27 20:15:58 christos Exp $	*/
+/*	$NetBSD: msdosfs_fat.c,v 1.27 2013/01/27 22:04:19 christos Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -52,15 +52,15 @@
 #endif
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_fat.c,v 1.26 2013/01/27 20:15:58 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_fat.c,v 1.27 2013/01/27 22:04:19 christos Exp $);
 
 /*
  * kernel include files.
  */
 #include sys/param.h
 #include sys/file.h
-#include sys/mount.h		/* to define statvfs structure */
 #ifdef _KERNEL
+#include sys/mount.h		/* to define statvfs structure */
 #include sys/errno.h
 #include sys/systm.h
 #include sys/kauth.h



CVS commit: src/usr.sbin/makefs/msdos

2013-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 27 22:07:20 UTC 2013

Modified Files:
src/usr.sbin/makefs/msdos: msdosfs_vnops.c

Log Message:
- some more debugging
- use msdosfs_update() -- should not be needed.
- remove sys/mount.h


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/makefs/msdos/msdosfs_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/usr.sbin/makefs/msdos/msdosfs_vnops.c
diff -u src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.9 src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.10
--- src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.9	Sun Jan 27 15:05:46 2013
+++ src/usr.sbin/makefs/msdos/msdosfs_vnops.c	Sun Jan 27 17:07:19 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vnops.c,v 1.9 2013/01/27 20:05:46 christos Exp $ */
+/*	$NetBSD: msdosfs_vnops.c,v 1.10 2013/01/27 22:07:19 christos Exp $ */
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -51,11 +51,10 @@
 #endif
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.9 2013/01/27 20:05:46 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.10 2013/01/27 22:07:19 christos Exp $);
 
 #include sys/param.h
 #include sys/mman.h
-#include sys/mount.h
 #include fcntl.h
 #include unistd.h
 
@@ -554,6 +553,7 @@ msdosfs_mkdire(const char *path, struct 
 	if (error)
 		goto bad2;
 
+	DPRINTF((%s(newcluster %lu)\n, __func__, newcluster));
 	memset(ndirent, 0, sizeof(ndirent));
 	ndirent.de_pmp = pmp;
 	ndirent.de_flag = DE_ACCESS | DE_CREATE | DE_UPDATE;
@@ -566,6 +566,8 @@ msdosfs_mkdire(const char *path, struct 
 	 */
 	bn = cntobn(pmp, newcluster);
 	lbn = de_bn2kb(pmp, bn);
+	DPRINTF((%s(newcluster %lu, bn=%lu, lbn=%lu)\n, __func__, newcluster,
+	bn, lbn));
 	/* always succeeds */
 	bp = getblk(pmp-pm_devvp, lbn, pmp-pm_bpcluster, 0, 0);
 	memset(bp-b_data, 0, pmp-pm_bpcluster);
@@ -616,6 +618,8 @@ msdosfs_mkdire(const char *path, struct 
 		goto bad;
 	if ((error = createde(ndirent, pdep, dep, cn)) != 0)
 		goto bad;
+	if ((error = msdosfs_updatede(dep)) != 0)
+		goto bad;
 	return dep;
 
 bad:



CVS commit: src/usr.sbin/makefs/msdos

2013-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 27 22:09:25 UTC 2013

Modified Files:
src/usr.sbin/makefs/msdos: msdosfs_vnops.c

Log Message:
undo c99


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/makefs/msdos/msdosfs_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/usr.sbin/makefs/msdos/msdosfs_vnops.c
diff -u src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.10 src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.11
--- src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.10	Sun Jan 27 17:07:19 2013
+++ src/usr.sbin/makefs/msdos/msdosfs_vnops.c	Sun Jan 27 17:09:24 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vnops.c,v 1.10 2013/01/27 22:07:19 christos Exp $ */
+/*	$NetBSD: msdosfs_vnops.c,v 1.11 2013/01/27 22:09:24 christos Exp $ */
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -51,7 +51,7 @@
 #endif
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.10 2013/01/27 22:07:19 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.11 2013/01/27 22:09:24 christos Exp $);
 
 #include sys/param.h
 #include sys/mman.h
@@ -419,7 +419,7 @@ msdosfs_wfile(const char *path, struct d
 	int error, fd;
 	size_t osize = dep-de_FileSize;
 	struct stat *st = node-inode-st;
-	size_t nsize;
+	size_t nsize, offs;
 	struct msdosfsmount *pmp = dep-de_pmp;
 	struct buf *bp;
 	char *dat;
@@ -460,7 +460,7 @@ msdosfs_wfile(const char *path, struct d
 	}
 	close(fd);
 
-	for (size_t offs = 0; offs  nsize;) {
+	for (offs = 0; offs  nsize;) {
 		int blsize, cpsize;
 		daddr_t bn;
 		u_long lbn = dep-de_StartCluster;



CVS commit: src/usr.sbin/makefs/msdos

2013-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 27 22:52:19 UTC 2013

Modified Files:
src/usr.sbin/makefs/msdos: msdosfs_vnops.c

Log Message:
- don't forget to set de_pmp
- unexpand inserted tabs to the . and .. strings!


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/makefs/msdos/msdosfs_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/usr.sbin/makefs/msdos/msdosfs_vnops.c
diff -u src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.11 src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.12
--- src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.11	Sun Jan 27 17:09:24 2013
+++ src/usr.sbin/makefs/msdos/msdosfs_vnops.c	Sun Jan 27 17:52:19 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vnops.c,v 1.11 2013/01/27 22:09:24 christos Exp $ */
+/*	$NetBSD: msdosfs_vnops.c,v 1.12 2013/01/27 22:52:19 christos Exp $ */
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -51,7 +51,7 @@
 #endif
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.11 2013/01/27 22:09:24 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.12 2013/01/27 22:52:19 christos Exp $);
 
 #include sys/param.h
 #include sys/mman.h
@@ -146,6 +146,7 @@ msdosfs_findslot(struct denode *dp, stru
 	int olddos = 1;
 
 	pmp = dp-de_pmp;
+
 	switch (unix2dosfn((const u_char *)cnp-cn_nameptr, dosfilename,
 	cnp-cn_namelen, 0)) {
 	case 0:
@@ -498,7 +499,7 @@ static const struct {
 	struct direntry dot;
 	struct direntry dotdot;
 } dosdirtemplate = {
-	{	.	 , 	,			/* the . entry */
+	{	.   ,,			/* the . entry */
 		ATTR_DIRECTORY,/* file attribute */
 		0,	/* reserved */
 		0, { 0, 0 }, { 0, 0 },			/* create time  date */
@@ -508,7 +509,7 @@ static const struct {
 		{ 0, 0 },/* startcluster */
 		{ 0, 0, 0, 0 }/* filesize */
 	},
-	{	..	 , 	,			/* the .. entry */
+	{	..  ,,			/* the .. entry */
 		ATTR_DIRECTORY,/* file attribute */
 		0,	/* reserved */
 		0, { 0, 0 }, { 0, 0 },			/* create time  date */
@@ -553,7 +554,6 @@ msdosfs_mkdire(const char *path, struct 
 	if (error)
 		goto bad2;
 
-	DPRINTF((%s(newcluster %lu)\n, __func__, newcluster));
 	memset(ndirent, 0, sizeof(ndirent));
 	ndirent.de_pmp = pmp;
 	ndirent.de_flag = DE_ACCESS | DE_CREATE | DE_UPDATE;
@@ -581,6 +581,8 @@ msdosfs_mkdire(const char *path, struct 
 	putushort(denp[0].deMDate, ndirent.de_MDate);
 	putushort(denp[0].deMTime, ndirent.de_MTime);
 	pcl = pdep-de_StartCluster;
+	DPRINTF((%s(pcl %lu, rootdirblk=%lu)\n, __func__, pcl,
+	pmp-pm_rootdirblk));
 	if (FAT32(pmp)  pcl == pmp-pm_rootdirblk)
 		pcl = 0;
 	putushort(denp[1].deStartCluster, pcl);
@@ -614,6 +616,7 @@ msdosfs_mkdire(const char *path, struct 
 	ndirent.de_FileSize = 0;
 	ndirent.de_dev = pdep-de_dev;
 	ndirent.de_devvp = pdep-de_devvp;
+	ndirent.de_pmp = pdep-de_pmp;
 	if ((error = msdosfs_findslot(pdep, cn)) != 0)
 		goto bad;
 	if ((error = createde(ndirent, pdep, dep, cn)) != 0)



CVS commit: src/usr.sbin/makefs/msdos

2013-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 27 22:52:38 UTC 2013

Modified Files:
src/usr.sbin/makefs/msdos: msdosfs_denode.c

Log Message:
fix root detection (although the code is a noop)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/makefs/msdos/msdosfs_denode.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.sbin/makefs/msdos/msdosfs_denode.c
diff -u src/usr.sbin/makefs/msdos/msdosfs_denode.c:1.2 src/usr.sbin/makefs/msdos/msdosfs_denode.c:1.3
--- src/usr.sbin/makefs/msdos/msdosfs_denode.c:1.2	Sat Jan 26 11:50:46 2013
+++ src/usr.sbin/makefs/msdos/msdosfs_denode.c	Sun Jan 27 17:52:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_denode.c,v 1.2 2013/01/26 16:50:46 christos Exp $	*/
+/*	$NetBSD: msdosfs_denode.c,v 1.3 2013/01/27 22:52:38 christos Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -52,7 +52,7 @@
 #endif
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_denode.c,v 1.2 2013/01/26 16:50:46 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_denode.c,v 1.3 2013/01/27 22:52:38 christos Exp $);
 
 #include sys/param.h
 
@@ -215,7 +215,7 @@ detrunc(struct denode *dep, u_long lengt
 	 * recognize the root directory at this point in a file or
 	 * directory's life.
 	 */
-	if ((DETOV(dep) == (struct vnode *)-1)  !FAT32(pmp)) {
+	if (dep-de_vnode != NULL  !FAT32(pmp)) {
 		printf(detrunc(): can't truncate root directory, clust %ld, offset %ld\n,
 		dep-de_dirclust, dep-de_diroffset);
 		return (EINVAL);
@@ -323,7 +323,7 @@ deextend(struct denode *dep, u_long leng
 	/*
 	 * The root of a DOS filesystem cannot be extended.
 	 */
-	if ((DETOV(dep) == (struct vnode *)-1)  !FAT32(pmp))
+	if (dep-de_vnode != NULL  !FAT32(pmp))
 		return EINVAL;
 
 	/*



CVS commit: src/usr.sbin/makefs

2013-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 27 22:53:03 UTC 2013

Modified Files:
src/usr.sbin/makefs: msdos.c

Log Message:
fix recursion error handling. top level directory works.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/makefs/msdos.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.sbin/makefs/msdos.c
diff -u src/usr.sbin/makefs/msdos.c:1.8 src/usr.sbin/makefs/msdos.c:1.9
--- src/usr.sbin/makefs/msdos.c:1.8	Sun Jan 27 15:05:46 2013
+++ src/usr.sbin/makefs/msdos.c	Sun Jan 27 17:53:03 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdos.c,v 1.8 2013/01/27 20:05:46 christos Exp $	*/
+/*	$NetBSD: msdos.c,v 1.9 2013/01/27 22:53:03 christos Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: msdos.c,v 1.8 2013/01/27 20:05:46 christos Exp $);
+__RCSID($NetBSD: msdos.c,v 1.9 2013/01/27 22:53:03 christos Exp $);
 #endif	/* !__lint */
 
 #include sys/param.h
@@ -224,19 +224,25 @@ msdos_populate_dir(const char *path, str
 
 		if (cur-child) {
 			struct denode *de;
-			if ((de = msdosfs_mkdire(pbuf, dir, cur)) == NULL)
-err(1, msdosfs_mkdire);
-			if (!msdos_populate_dir(pbuf, de, cur-child, cur,
-			fsopts))
-err(1, populate_dir);
+			if ((de = msdosfs_mkdire(pbuf, dir, cur)) == NULL) {
+warn(msdosfs_mkdire %s, pbuf);
+return -1;
+			}
+			if (msdos_populate_dir(pbuf, de, cur-child, cur,
+			fsopts) == -1) {
+warn(msdos_populate_dir %s, pbuf);
+return -1;
+			}
 			continue;
 		} else if (!S_ISREG(cur-type)) {
 			warnx(skipping non-regular file %s/%s, cur-path,
 			cur-name);
 			continue;
 		}
-		if (msdosfs_mkfile(pbuf, dir, cur) == NULL)
-			err(1, msdosfs_mkfile %s, pbuf);
+		if (msdosfs_mkfile(pbuf, dir, cur) == NULL) {
+			warn(msdosfs_mkfile %s, pbuf);
+			return -1;
+		}
 	}
 	return 0;
 }



CVS commit: src/usr.sbin/makefs/msdos

2013-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 28 00:16:24 UTC 2013

Modified Files:
src/usr.sbin/makefs/msdos: msdosfs_denode.c

Log Message:
don't forget to initialize the cache.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/makefs/msdos/msdosfs_denode.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.sbin/makefs/msdos/msdosfs_denode.c
diff -u src/usr.sbin/makefs/msdos/msdosfs_denode.c:1.3 src/usr.sbin/makefs/msdos/msdosfs_denode.c:1.4
--- src/usr.sbin/makefs/msdos/msdosfs_denode.c:1.3	Sun Jan 27 17:52:38 2013
+++ src/usr.sbin/makefs/msdos/msdosfs_denode.c	Sun Jan 27 19:16:24 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_denode.c,v 1.3 2013/01/27 22:52:38 christos Exp $	*/
+/*	$NetBSD: msdosfs_denode.c,v 1.4 2013/01/28 00:16:24 christos Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -52,7 +52,7 @@
 #endif
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_denode.c,v 1.3 2013/01/27 22:52:38 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_denode.c,v 1.4 2013/01/28 00:16:24 christos Exp $);
 
 #include sys/param.h
 
@@ -113,6 +113,7 @@ deget(struct msdosfsmount *pmp, u_long d
 	ldep-de_pmp = pmp;
 	ldep-de_devvp = pmp-pm_devvp;
 	ldep-de_refcnt = 1;
+	fc_purge(ldep, 0);
 	/*
 	 * Copy the directory entry into the denode area of the vnode.
 	 */



CVS commit: src/usr.sbin/makefs/msdos

2013-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 28 00:16:48 UTC 2013

Modified Files:
src/usr.sbin/makefs/msdos: msdosfs_vnops.c

Log Message:
use pcbmap instead of the open coded hack now the pcbmap works.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/makefs/msdos/msdosfs_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/usr.sbin/makefs/msdos/msdosfs_vnops.c
diff -u src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.12 src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.13
--- src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.12	Sun Jan 27 17:52:19 2013
+++ src/usr.sbin/makefs/msdos/msdosfs_vnops.c	Sun Jan 27 19:16:48 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vnops.c,v 1.12 2013/01/27 22:52:19 christos Exp $ */
+/*	$NetBSD: msdosfs_vnops.c,v 1.13 2013/01/28 00:16:48 christos Exp $ */
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -51,7 +51,7 @@
 #endif
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.12 2013/01/27 22:52:19 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.13 2013/01/28 00:16:48 christos Exp $);
 
 #include sys/param.h
 #include sys/mman.h
@@ -424,6 +424,7 @@ msdosfs_wfile(const char *path, struct d
 	struct msdosfsmount *pmp = dep-de_pmp;
 	struct buf *bp;
 	char *dat;
+	u_long cn = 0;
 
 	DPRINTF((%s(diroff %lu, dirclust %lu, startcluster %lu)\n, __func__,
 	dep-de_diroffset, dep-de_dirclust, dep-de_StartCluster));
@@ -464,17 +465,23 @@ msdosfs_wfile(const char *path, struct d
 	for (offs = 0; offs  nsize;) {
 		int blsize, cpsize;
 		daddr_t bn;
-		u_long lbn = dep-de_StartCluster;
 		u_long on = offs  pmp-pm_crbomask;
-
-		if (lbn == MSDOSFSROOT) {
-			DPRINTF((%s: bad lbn %lu, __func__, lbn));
+#ifdef HACK
+		cn = dep-de_StartCluster;
+		if (cn == MSDOSFSROOT) {
+			DPRINTF((%s: bad lbn %lu, __func__, cn));
 			goto out;
 		}
-		bn = cntobn(pmp, lbn);
+		bn = cntobn(pmp, cn);
 		blsize = pmp-pm_bpcluster;
-		DPRINTF((%s(lbn=%lu, bn=%llu/%llu, blsize=%d)\n, __func__,
-		lbn, (unsigned long long)bn,
+#else
+		if ((error = pcbmap(dep, cn++, bn, NULL, blsize)) != 0) {
+			DPRINTF((%s: pcbmap %lu, __func__, bn));
+			goto out;
+		}
+#endif
+		DPRINTF((%s(cn=%lu, bn=%llu/%llu, blsize=%d)\n, __func__,
+		cn, (unsigned long long)bn,
 		(unsigned long long)de_bn2kb(pmp, bn), blsize));
 		if ((error = bread(pmp-pm_devvp, de_bn2kb(pmp, bn), blsize,
 		NULL, 0, bp)) != 0) {



CVS commit: src/sys/fs/msdosfs

2013-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 28 00:17:18 UTC 2013

Modified Files:
src/sys/fs/msdosfs: msdosfs_fat.c

Log Message:
A little more debugging.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/fs/msdosfs/msdosfs_fat.c

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

Modified files:

Index: src/sys/fs/msdosfs/msdosfs_fat.c
diff -u src/sys/fs/msdosfs/msdosfs_fat.c:1.27 src/sys/fs/msdosfs/msdosfs_fat.c:1.28
--- src/sys/fs/msdosfs/msdosfs_fat.c:1.27	Sun Jan 27 17:04:19 2013
+++ src/sys/fs/msdosfs/msdosfs_fat.c	Sun Jan 27 19:17:18 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_fat.c,v 1.27 2013/01/27 22:04:19 christos Exp $	*/
+/*	$NetBSD: msdosfs_fat.c,v 1.28 2013/01/28 00:17:18 christos Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -52,7 +52,7 @@
 #endif
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_fat.c,v 1.27 2013/01/27 22:04:19 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_fat.c,v 1.28 2013/01/28 00:17:18 christos Exp $);
 
 /*
  * kernel include files.
@@ -147,6 +147,8 @@ fatblock(struct msdosfsmount *pmp, u_lon
 	* pmp-pm_BytesPerSec;
 	bn += pmp-pm_fatblk + pmp-pm_curfat * pmp-pm_FATsecs;
 
+	DPRINTF((%s(ofs=%lu bn=%lu, size=%lu, bo=%lu)\n, __func__, ofs, bn,
+	size, ofs % pmp-pm_fatblocksize));
 	if (bnp)
 		*bnp = bn;
 	if (sizep)
@@ -154,7 +156,7 @@ fatblock(struct msdosfsmount *pmp, u_lon
 	if (bop)
 		*bop = ofs % pmp-pm_fatblocksize;
 
-	pm_fatblocksize =  pmp-pm_fatblocksize;
+	pm_fatblocksize = pmp-pm_fatblocksize;
 }
 
 /*
@@ -299,6 +301,8 @@ pcbmap(struct denode *dep, u_long findcn
 			cn = getushort((char *)bp-b_data + bo);
 		if (FAT12(pmp)  (prevcn  1))
 			cn = 4;
+		DPRINTF((%s(cn=%lu masked=%lu)\n, __func__, cn,
+		cn  pmp-pm_fatmask));
 		cn = pmp-pm_fatmask;
 	}
 



CVS commit: src/usr.sbin/makefs

2013-01-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 28 00:23:18 UTC 2013

Modified Files:
src/usr.sbin/makefs: makefs.8

Log Message:
now that msdos works, document it.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/makefs/makefs.8

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

Modified files:

Index: src/usr.sbin/makefs/makefs.8
diff -u src/usr.sbin/makefs/makefs.8:1.41 src/usr.sbin/makefs/makefs.8:1.42
--- src/usr.sbin/makefs/makefs.8:1.41	Fri Jun 22 02:15:18 2012
+++ src/usr.sbin/makefs/makefs.8	Sun Jan 27 19:23:18 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: makefs.8,v 1.41 2012/06/22 06:15:18 sjg Exp $
+.\	$NetBSD: makefs.8,v 1.42 2013/01/28 00:23:18 christos Exp $
 .\
 .\ Copyright (c) 2001-2003 Wasabi Systems, Inc.
 .\ All rights reserved.
@@ -33,7 +33,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd June 12, 2012
+.Dd January 27, 2013
 .Dt MAKEFS 8
 .Os
 .Sh NAME
@@ -201,6 +201,8 @@ BSD fast file system (default).
 ISO 9660 file system.
 .It Sy chfs
 Chip flash file system.
+.It Sy msdos
+FAT12, FAT16, or FAT32 file system.
 .It Sy v7fs
 7th Edition(V7) file system.
 .El
@@ -362,6 +364,10 @@ Erase block size of the media.
 Type of the media.
 NOR: 0 or NAND: 1.
 .El
+.Ss msdos-specific options
+See
+.Xr newfs_msdos 8
+for fs specific options.
 .Ss V7FS-specific options
 The following keywords are supported:
 .Pp



CVS commit: src/sys/secmodel

2013-01-27 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Mon Jan 28 00:51:30 UTC 2013

Modified Files:
src/sys/secmodel/extensions: secmodel_extensions.c
src/sys/secmodel/securelevel: secmodel_securelevel.c

Log Message:
Re-instate backwards compatible security.models.bsd44.{curtain,securelevel}.

They were mistakenly removed when curtain and securelevel moved to
secmodel_extensions(9).

Reported by tls@ on tech-security@.

XXX will ask for pull-up for -6.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/secmodel/extensions/secmodel_extensions.c
cvs rdiff -u -r1.28 -r1.29 \
src/sys/secmodel/securelevel/secmodel_securelevel.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/secmodel/extensions/secmodel_extensions.c
diff -u src/sys/secmodel/extensions/secmodel_extensions.c:1.3 src/sys/secmodel/extensions/secmodel_extensions.c:1.4
--- src/sys/secmodel/extensions/secmodel_extensions.c:1.3	Tue Mar 13 18:41:01 2012
+++ src/sys/secmodel/extensions/secmodel_extensions.c	Mon Jan 28 00:51:29 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: secmodel_extensions.c,v 1.3 2012/03/13 18:41:01 elad Exp $ */
+/* $NetBSD: secmodel_extensions.c,v 1.4 2013/01/28 00:51:29 jym Exp $ */
 /*-
  * Copyright (c) 2011 Elad Efrat e...@netbsd.org
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: secmodel_extensions.c,v 1.3 2012/03/13 18:41:01 elad Exp $);
+__KERNEL_RCSID(0, $NetBSD: secmodel_extensions.c,v 1.4 2013/01/28 00:51:29 jym Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -73,7 +73,7 @@ static int secmodel_extensions_network_c
 static void
 sysctl_security_extensions_setup(struct sysctllog **clog)
 {
-	const struct sysctlnode *rnode;
+	const struct sysctlnode *rnode, *rnode2;
 
 	sysctl_createv(clog, 0, NULL, rnode,
 		   CTLFLAG_PERMANENT,
@@ -87,6 +87,23 @@ sysctl_security_extensions_setup(struct 
 		   NULL, 0, NULL, 0,
 		   CTL_CREATE, CTL_EOL);
 
+	/* Compatibility: security.models.bsd44 */
+	rnode2 = rnode;
+	sysctl_createv(clog, 0, rnode2, rnode2,
+		   CTLFLAG_PERMANENT,
+		   CTLTYPE_NODE, bsd44, NULL,
+		   NULL, 0, NULL, 0,
+		   CTL_CREATE, CTL_EOL);
+
+/* Compatibility: security.models.bsd44.curtain */
+	sysctl_createv(clog, 0, rnode2, NULL,
+		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
+		   CTLTYPE_INT, curtain,
+		   SYSCTL_DESCR(Curtain information about objects to \
+		   		users not owning them.),
+		   sysctl_extensions_curtain_handler, 0, curtain, 0,
+		   CTL_CREATE, CTL_EOL);
+
 	sysctl_createv(clog, 0, rnode, rnode,
 		   CTLFLAG_PERMANENT,
 		   CTLTYPE_NODE, extensions, NULL,

Index: src/sys/secmodel/securelevel/secmodel_securelevel.c
diff -u src/sys/secmodel/securelevel/secmodel_securelevel.c:1.28 src/sys/secmodel/securelevel/secmodel_securelevel.c:1.29
--- src/sys/secmodel/securelevel/secmodel_securelevel.c:1.28	Wed Jun 27 10:15:25 2012
+++ src/sys/secmodel/securelevel/secmodel_securelevel.c	Mon Jan 28 00:51:30 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: secmodel_securelevel.c,v 1.28 2012/06/27 10:15:25 cheusov Exp $ */
+/* $NetBSD: secmodel_securelevel.c,v 1.29 2013/01/28 00:51:30 jym Exp $ */
 /*-
  * Copyright (c) 2006 Elad Efrat e...@netbsd.org
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: secmodel_securelevel.c,v 1.28 2012/06/27 10:15:25 cheusov Exp $);
+__KERNEL_RCSID(0, $NetBSD: secmodel_securelevel.c,v 1.29 2013/01/28 00:51:30 jym Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_insecure.h
@@ -95,7 +95,7 @@ secmodel_securelevel_sysctl(SYSCTLFN_ARG
 void
 sysctl_security_securelevel_setup(struct sysctllog **clog)
 {
-	const struct sysctlnode *rnode;
+	const struct sysctlnode *rnode, *rnode2;
 
 	sysctl_createv(clog, 0, NULL, rnode,
 		   CTLFLAG_PERMANENT,
@@ -109,6 +109,22 @@ sysctl_security_securelevel_setup(struct
 		   NULL, 0, NULL, 0,
 		   CTL_CREATE, CTL_EOL);
 
+	/* Compatibility: security.models.bsd44 */
+	rnode2 = rnode;
+	sysctl_createv(clog, 0, rnode2, rnode2,
+		   CTLFLAG_PERMANENT,
+		   CTLTYPE_NODE, bsd44, NULL,
+		   NULL, 0, NULL, 0,
+		   CTL_CREATE, CTL_EOL);
+
+/* Compatibility: security.models.bsd44.securelevel */
+	sysctl_createv(clog, 0, rnode2, NULL,
+		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
+		   CTLTYPE_INT, securelevel,
+		   SYSCTL_DESCR(System security level),
+		   secmodel_securelevel_sysctl, 0, NULL, 0,
+		   CTL_CREATE, CTL_EOL);
+
 	sysctl_createv(clog, 0, rnode, rnode,
 		   CTLFLAG_PERMANENT,
 		   CTLTYPE_NODE, securelevel, NULL,



CVS commit: src/sys/arch/arm

2013-01-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jan 28 06:14:45 UTC 2013

Modified Files:
src/sys/arch/arm/conf: files.arm
src/sys/arch/arm/vfp: vfp_init.c

Log Message:
Disable bzero_page_vfp and bcopy_page_vfp since it really isn't any faster
than memcpy.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/arch/arm/conf/files.arm
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/vfp/vfp_init.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/conf/files.arm
diff -u src/sys/arch/arm/conf/files.arm:1.114 src/sys/arch/arm/conf/files.arm:1.115
--- src/sys/arch/arm/conf/files.arm:1.114	Mon Dec 10 04:58:54 2012
+++ src/sys/arch/arm/conf/files.arm	Mon Jan 28 06:14:45 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: files.arm,v 1.114 2012/12/10 04:58:54 matt Exp $
+#	$NetBSD: files.arm,v 1.115 2013/01/28 06:14:45 matt Exp $
 
 # temporary define to allow easy moving to ../arch/arm/arm32
 defflagARM32
@@ -52,7 +52,7 @@ obsolete defflagARMFPE
 
 # VFP support
 file	arch/arm/vfp/vfp_init.c			arm32
-file	arch/arm/vfp/pmap_vfp.S			arm32  fpu_vfp
+#file	arch/arm/vfp/pmap_vfp.S			arm32  fpu_vfp
 
 # PMAP_DEBUG (heavily abused option)
 defflagPMAP_DEBUG

Index: src/sys/arch/arm/vfp/vfp_init.c
diff -u src/sys/arch/arm/vfp/vfp_init.c:1.15 src/sys/arch/arm/vfp/vfp_init.c:1.16
--- src/sys/arch/arm/vfp/vfp_init.c:1.15	Mon Dec 31 03:23:53 2012
+++ src/sys/arch/arm/vfp/vfp_init.c	Mon Jan 28 06:14:45 2013
@@ -1,4 +1,4 @@
-/*  $NetBSD: vfp_init.c,v 1.15 2012/12/31 03:23:53 matt Exp $ */
+/*  $NetBSD: vfp_init.c,v 1.16 2013/01/28 06:14:45 matt Exp $ */
 
 /*
  * Copyright (c) 2008 ARM Ltd
@@ -280,6 +280,7 @@ vfp_attach(void)
 }
 
 #else
+#if 0
 static bool
 vfp_patch_branch(uintptr_t code, uintptr_t func, uintptr_t newfunc)
 {
@@ -306,6 +307,7 @@ vfp_patch_branch(uintptr_t code, uintptr
 		}
 	}
 }
+#endif
 
 void
 vfp_attach(void)
@@ -395,10 +397,12 @@ vfp_attach(void)
 	install_coproc_handler(CORE_UNKNOWN_HANDLER, neon_handler);
 #endif
 
+#if 0
 	vfp_patch_branch((uintptr_t)pmap_copy_page_generic,
 	   (uintptr_t)bcopy_page, (uintptr_t)bcopy_page_vfp);
 	vfp_patch_branch((uintptr_t)pmap_zero_page_generic,
 	   (uintptr_t)bzero_page, (uintptr_t)bzero_page_vfp);
+#endif
 }
 
 /* The real handler for VFP bounces.  */



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

2013-01-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jan 28 06:16:05 UTC 2013

Modified Files:
src/sys/arch/arm/include: byte_swap.h

Log Message:
Use uint32_t for __asm to appease clang.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/include/byte_swap.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/byte_swap.h
diff -u src/sys/arch/arm/include/byte_swap.h:1.12 src/sys/arch/arm/include/byte_swap.h:1.13
--- src/sys/arch/arm/include/byte_swap.h:1.12	Wed Sep  5 01:03:53 2012
+++ src/sys/arch/arm/include/byte_swap.h	Mon Jan 28 06:16:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: byte_swap.h,v 1.12 2012/09/05 01:03:53 matt Exp $	*/
+/*	$NetBSD: byte_swap.h,v 1.13 2013/01/28 06:16:05 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1999, 2002 The NetBSD Foundation, Inc.
@@ -91,8 +91,9 @@ __byte_swap_u16_variable(uint16_t v)
 
 #ifdef _ARM_ARCH_6
 	if (!__builtin_constant_p(v)) {
-		__asm(rev16\t%0, %1 : =r (v) : 0 (v));
-		return v;
+		uint32_t v32 = v;
+		__asm(rev16\t%0, %1 : =r (v32) : 0 (v32));
+		return v32;
 	}
 #elif !defined(__thumb__)  0	/* gcc produces decent code for this */
 	if (!__builtin_constant_p(v)) {



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

2013-01-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jan 28 06:17:05 UTC 2013

Modified Files:
src/sys/arch/arm/include: lock.h

Log Message:
Use uint32_t for __asm to appease clang.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/arm/include/lock.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/lock.h
diff -u src/sys/arch/arm/include/lock.h:1.23 src/sys/arch/arm/include/lock.h:1.24
--- src/sys/arch/arm/include/lock.h:1.23	Thu Jan 24 10:15:30 2013
+++ src/sys/arch/arm/include/lock.h	Mon Jan 28 06:17:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock.h,v 1.23 2013/01/24 10:15:30 matt Exp $	*/
+/*	$NetBSD: lock.h,v 1.24 2013/01/28 06:17:05 matt Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,8 +78,7 @@ static __inline unsigned char
 __swp(__cpu_simple_lock_t __val, volatile __cpu_simple_lock_t *__ptr)
 {
 #ifdef _ARM_ARCH_6
-	uint32_t __rv;
-	__cpu_simple_lock_t __tmp;
+	uint32_t __rv, __tmp;
 	if (sizeof(*__ptr) == 1) {
 		__asm volatile(
 			1:\t



CVS commit: src/lib/csu/common

2013-01-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jan 28 06:17:57 UTC 2013

Modified Files:
src/lib/csu/common: crt0-common.c

Log Message:
Make with work with gcc 4.5 or clang.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/csu/common/crt0-common.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/csu/common/crt0-common.c
diff -u src/lib/csu/common/crt0-common.c:1.10 src/lib/csu/common/crt0-common.c:1.11
--- src/lib/csu/common/crt0-common.c:1.10	Tue Jan 22 22:57:37 2013
+++ src/lib/csu/common/crt0-common.c	Mon Jan 28 06:17:57 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0-common.c,v 1.10 2013/01/22 22:57:37 matt Exp $ */
+/* $NetBSD: crt0-common.c,v 1.11 2013/01/28 06:17:57 matt Exp $ */
 
 /*
  * Copyright (c) 1998 Christos Zoulas
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: crt0-common.c,v 1.10 2013/01/22 22:57:37 matt Exp $);
+__RCSID($NetBSD: crt0-common.c,v 1.11 2013/01/28 06:17:57 matt Exp $);
 
 #include sys/types.h
 #include sys/exec.h
@@ -95,10 +95,17 @@ do {		\
  * Since we don't need .init or .fini sections, just code them in C
  * to make life easier.
  */
+#if __GNUC_PREREQ__(4,5) || defined(__clang__)
+static const fptr_t init_array_start[1] __weak_reference(__init_array_start);
+static const fptr_t init_array_end[1] __weak_reference(__init_array_end);
+static const fptr_t fini_array_start[1] __weak_reference(__fini_array_start);
+static const fptr_t fini_array_end[1] __weak_reference(__fini_array_end);
+#else
 extern const fptr_t init_array_start[] __weak_reference(__init_array_start);
 extern const fptr_t init_array_end[] __weak_reference(__init_array_end);
 extern const fptr_t fini_array_start[] __weak_reference(__fini_array_start);
 extern const fptr_t fini_array_end[] __weak_reference(__fini_array_end);
+#endif
 
 static inline void
 _init(void)



CVS commit: src/common/lib/libc/arch/arm/atomic

2013-01-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jan 28 06:22:34 UTC 2013

Modified Files:
src/common/lib/libc/arch/arm/atomic: atomic_swap.S

Log Message:
Change movsne to movnes for clang.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/arm/atomic/atomic_swap.S

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

Modified files:

Index: src/common/lib/libc/arch/arm/atomic/atomic_swap.S
diff -u src/common/lib/libc/arch/arm/atomic/atomic_swap.S:1.4 src/common/lib/libc/arch/arm/atomic/atomic_swap.S:1.5
--- src/common/lib/libc/arch/arm/atomic/atomic_swap.S:1.4	Fri Aug 31 23:41:52 2012
+++ src/common/lib/libc/arch/arm/atomic/atomic_swap.S	Mon Jan 28 06:22:34 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: atomic_swap.S,v 1.4 2012/08/31 23:41:52 matt Exp $	*/
+/*	$NetBSD: atomic_swap.S,v 1.5 2013/01/28 06:22:34 matt Exp $	*/
 
 /*-
  * Copyright (c) 2007,2012 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@ ENTRY_NP(_atomic_swap_32)
 #else
 	swp	r0, r1, [r2]
 	cmp	r0, r1
-	movsne	ip, #0
+	movnes	ip, #0
 #endif
 	cmpne	ip, #0
 	bne	1b



CVS commit: src/common/lib/libc/arch/arm/string

2013-01-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jan 28 06:23:15 UTC 2013

Modified Files:
src/common/lib/libc/arch/arm/string: strrchr_arm.S

Log Message:
Deal with an end-of-string condition properly.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/arch/arm/string/strrchr_arm.S

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

Modified files:

Index: src/common/lib/libc/arch/arm/string/strrchr_arm.S
diff -u src/common/lib/libc/arch/arm/string/strrchr_arm.S:1.1 src/common/lib/libc/arch/arm/string/strrchr_arm.S:1.2
--- src/common/lib/libc/arch/arm/string/strrchr_arm.S:1.1	Tue Jan 15 08:52:27 2013
+++ src/common/lib/libc/arch/arm/string/strrchr_arm.S	Mon Jan 28 06:23:14 2013
@@ -29,7 +29,7 @@
 
 #include machine/asm.h
 
-RCSID($NetBSD: strrchr_arm.S,v 1.1 2013/01/15 08:52:27 matt Exp $)
+RCSID($NetBSD: strrchr_arm.S,v 1.2 2013/01/28 06:23:14 matt Exp $)
 
 #ifdef __ARMEL__
 #define	BYTE0	0x00ff
@@ -94,6 +94,8 @@ ENTRY(strrchr)
 	 * Copy the NUL bit to the following byte lanes.  Then clear any match
 	 * bits in those byte lanes to prevent false positives in those bytes.
 	 */
+	bics	r5, r5, r4		/* clear any NUL match bits */
+	beq	.Ldone			/*   no remaining matches, we're done */
 	movs	r3, r4, lshi #8		/* shift up a byte */
 	orrnes	r3, r3, r3, lshi #8	/* if non 0, copy up to next byte */
 	orrnes	r3, r3, r3, lshi #8	/* if non 0, copy up to last byte */



CVS commit: src/common/lib/libc/arch/arm/string

2013-01-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jan 28 06:23:44 UTC 2013

Modified Files:
src/common/lib/libc/arch/arm/string: memcpy_arm.S memmove.S memset.S

Log Message:
Add aeabi strong aliases.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/arm/string/memcpy_arm.S \
src/common/lib/libc/arch/arm/string/memset.S
cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/arch/arm/string/memmove.S

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

Modified files:

Index: src/common/lib/libc/arch/arm/string/memcpy_arm.S
diff -u src/common/lib/libc/arch/arm/string/memcpy_arm.S:1.2 src/common/lib/libc/arch/arm/string/memcpy_arm.S:1.3
--- src/common/lib/libc/arch/arm/string/memcpy_arm.S:1.2	Mon Apr 28 20:22:52 2008
+++ src/common/lib/libc/arch/arm/string/memcpy_arm.S	Mon Jan 28 06:23:44 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: memcpy_arm.S,v 1.2 2008/04/28 20:22:52 martin Exp $	*/
+/*	$NetBSD: memcpy_arm.S,v 1.3 2013/01/28 06:23:44 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,6 +31,10 @@
 
 #include machine/asm.h
 
+#if defined(__ARM_EABI__)
+STRONG_ALIAS(__aeabi_memcpy, memcpy)
+#endif
+
 /*
  * This is one fun bit of code ...
  * Some easy listening music is suggested while trying to understand this
Index: src/common/lib/libc/arch/arm/string/memset.S
diff -u src/common/lib/libc/arch/arm/string/memset.S:1.2 src/common/lib/libc/arch/arm/string/memset.S:1.3
--- src/common/lib/libc/arch/arm/string/memset.S:1.2	Wed Dec 12 15:46:05 2012
+++ src/common/lib/libc/arch/arm/string/memset.S	Mon Jan 28 06:23:44 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: memset.S,v 1.2 2012/12/12 15:46:05 matt Exp $	*/
+/*	$NetBSD: memset.S,v 1.3 2013/01/28 06:23:44 matt Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -68,6 +68,10 @@
 
 #include machine/asm.h
 
+#if defined(__ARM_EABI__)  !defined(BZER0)
+STRONG_ALIAS(__aeabi_memset, memset)
+#endif
+
 /*
  * memset: Sets a block of memory to the specified value
  *

Index: src/common/lib/libc/arch/arm/string/memmove.S
diff -u src/common/lib/libc/arch/arm/string/memmove.S:1.3 src/common/lib/libc/arch/arm/string/memmove.S:1.4
--- src/common/lib/libc/arch/arm/string/memmove.S:1.3	Mon Apr 28 20:22:52 2008
+++ src/common/lib/libc/arch/arm/string/memmove.S	Mon Jan 28 06:23:44 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: memmove.S,v 1.3 2008/04/28 20:22:52 martin Exp $	*/
+/*	$NetBSD: memmove.S,v 1.4 2013/01/28 06:23:44 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,6 +31,10 @@
 
 #include machine/asm.h
 
+#if defined(__ARM_EABI__)  !defined(BCOPY)
+STRONG_ALIAS(__aeabi_memmove, memmove)
+#endif
+
 #ifndef _BCOPY
 /* LINTSTUB: Func: void *memmove(void *, const void *, size_t) */
 ENTRY(memmove)



CVS commit: src/lib/libm/src

2013-01-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jan 28 06:26:20 UTC 2013

Modified Files:
src/lib/libm/src: namespace.h

Log Message:
Add long double aliases


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libm/src/namespace.h

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

Modified files:

Index: src/lib/libm/src/namespace.h
diff -u src/lib/libm/src/namespace.h:1.4 src/lib/libm/src/namespace.h:1.5
--- src/lib/libm/src/namespace.h:1.4	Tue Jul 26 16:10:16 2011
+++ src/lib/libm/src/namespace.h	Mon Jan 28 06:26:20 2013
@@ -1,14 +1,18 @@
-/* $NetBSD: namespace.h,v 1.4 2011/07/26 16:10:16 joerg Exp $ */
+/* $NetBSD: namespace.h,v 1.5 2013/01/28 06:26:20 matt Exp $ */
 
 #define atan2 _atan2
 #define atan2f _atan2f
+#define atan2l _atan2l
 #define hypot _hypot
 #define hypotf _hypotf
+#define hypotl _hypotl
 
 #define exp _exp
 #define expf _expf
+#define expl _expl
 #define log _log
 #define logf _logf
+#define logl _logl
 
 #if 0 /* not yet - need to review use in machdep code first */
 #define sin _sin
@@ -20,16 +24,24 @@
 #endif /* notyet */
 #define sinh _sinh
 #define sinhf _sinhf
+#define sinhl _sinhl
 #define cosh _cosh
 #define coshf _coshf
+#define coshl _coshl
 #define asin _asin
 #define asinf _asinf
+#define asinl _asinl
 
 #define casin _casin
 #define casinf _casinf
+#define casinl _casinl
 #define catan _catan
 #define catanf _catanf
+#define catanl _catanl
 
 #define scalbn _scalbn
 #define scalbnf _scalbnf
 #define scalbnl _scalbnl
+#define scalbln _scalbln
+#define scalblnf _scalblnf
+#define scalblnl _scalblnl



CVS commit: src/lib/libm/src

2013-01-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jan 28 06:34:09 UTC 2013

Modified Files:
src/lib/libm/src: s_scalbn.c s_scalbnf.c s_scalbnl.c

Log Message:
Deal with _LP64 properly.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libm/src/s_scalbn.c
cvs rdiff -u -r1.9 -r1.10 src/lib/libm/src/s_scalbnf.c
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/src/s_scalbnl.c

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

Modified files:

Index: src/lib/libm/src/s_scalbn.c
diff -u src/lib/libm/src/s_scalbn.c:1.15 src/lib/libm/src/s_scalbn.c:1.16
--- src/lib/libm/src/s_scalbn.c:1.15	Tue Jul 26 16:10:16 2011
+++ src/lib/libm/src/s_scalbn.c	Mon Jan 28 06:34:09 2013
@@ -12,7 +12,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBM_SCCS)  !defined(lint)
-__RCSID($NetBSD: s_scalbn.c,v 1.15 2011/07/26 16:10:16 joerg Exp $);
+__RCSID($NetBSD: s_scalbn.c,v 1.16 2013/01/28 06:34:09 matt Exp $);
 #endif
 
 /*
@@ -26,24 +26,39 @@ __RCSID($NetBSD: s_scalbn.c,v 1.15 2011
 #include math.h
 #include math_private.h
 
+#ifndef _LP64
+__strong_alias(_scalbn, _scalbln)
+#endif
+
 #ifndef __HAVE_LONG_DOUBLE
 __strong_alias(_scalbnl, _scalbn)
+__strong_alias(_scalblnl, _scalbln)
 __weak_alias(scalbnl, _scalbnl)
+__weak_alias(scalblnl, _scalblnl)
 #endif
 
 #ifdef __weak_alias
 __weak_alias(scalbn, _scalbn)
+__weak_alias(scalbln, _scalbln)
 #endif
 
 static const double
-two54   =  1.8014398509481984e+16, /* 0x4350, 0x */
-twom54  =  5.55111512312578270212e-17, /* 0x3C90, 0x */
+two54   =  0x1.0p54,	/* 0x4350, 0x */
+twom54  =  0x1.0p-54,	/* 0x3C90, 0x */
 huge   = 1.0e+300,
 tiny   = 1.0e-300;
 
+#ifdef _LP64
 double
 scalbn(double x, int n)
 {
+	return scalbln(x, n);
+}
+#endif
+
+double
+scalbln(double x, long n)
+{
 	int32_t k,hx,lx;
 	EXTRACT_WORDS(hx,lx,x);
 k = ((uint32_t)hx0x7ff0)20;		/* extract exponent */

Index: src/lib/libm/src/s_scalbnf.c
diff -u src/lib/libm/src/s_scalbnf.c:1.9 src/lib/libm/src/s_scalbnf.c:1.10
--- src/lib/libm/src/s_scalbnf.c:1.9	Fri Apr 23 19:17:07 2010
+++ src/lib/libm/src/s_scalbnf.c	Mon Jan 28 06:34:09 2013
@@ -15,26 +15,36 @@
 
 #include sys/cdefs.h
 #if defined(LIBM_SCCS)  !defined(lint)
-__RCSID($NetBSD: s_scalbnf.c,v 1.9 2010/04/23 19:17:07 drochner Exp $);
+__RCSID($NetBSD: s_scalbnf.c,v 1.10 2013/01/28 06:34:09 matt Exp $);
 #endif
 
 #include namespace.h
 #include math.h
 #include math_private.h
 
-#ifdef __weak_alias
-__weak_alias(scalbnf, _scalbnf)
+#ifndef _LP64
+__strong_alias(_scalbnf, _scalblnf)
 #endif
+__weak_alias(scalbnf, _scalbnf)
+__weak_alias(scalblnf, _scalblnf)
 
 static const float
-two25   =  3.355443200e+07,	/* 0x4c00 */
-twom25  =  2.9802322388e-08,	/* 0x3300 */
+two25   =  0x1.0p25,	/* 0x4c00 */
+twom25  =  0x1.0p-25,	/* 0x3300 */
 huge   = 1.0e+30,
 tiny   = 1.0e-30;
 
+#ifdef _LP64
 float
 scalbnf(float x, int n)
 {
+	return scalblnf(x, n);
+}
+#endif
+
+float
+scalblnf(float x, long n)
+{
 	int32_t k,ix;
 	GET_FLOAT_WORD(ix,x);
 k = (ix0x7f80)23;		/* extract exponent */

Index: src/lib/libm/src/s_scalbnl.c
diff -u src/lib/libm/src/s_scalbnl.c:1.1 src/lib/libm/src/s_scalbnl.c:1.2
--- src/lib/libm/src/s_scalbnl.c:1.1	Tue Jul 26 16:10:16 2011
+++ src/lib/libm/src/s_scalbnl.c	Mon Jan 28 06:34:09 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_scalbnl.c,v 1.1 2011/07/26 16:10:16 joerg Exp $	*/
+/*	$NetBSD: s_scalbnl.c,v 1.2 2013/01/28 06:34:09 matt Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: s_scalbnl.c,v 1.1 2011/07/26 16:10:16 joerg Exp $);
+__RCSID($NetBSD: s_scalbnl.c,v 1.2 2013/01/28 06:34:09 matt Exp $);
 
 #include namespace.h
 
@@ -40,10 +40,13 @@ __RCSID($NetBSD: s_scalbnl.c,v 1.1 2011
 
 #ifdef __HAVE_LONG_DOUBLE
 
-#ifdef __weak_alias
-__weak_alias(scalbnl, _scalbnl)
+#ifndef _LP64
+__strong_alias(_scalbnl, _scalblnl)
 #endif
 
+__weak_alias(scalbnl, _scalbnl)
+__weak_alias(scalblnl, _scalblnl)
+
 #if LDBL_MANT_DIG == 64
 #define	FROM_UNDERFLOW	0x1p65L
 #define	TO_UNDERFLOW	0x1p-65L
@@ -54,9 +57,17 @@ __weak_alias(scalbnl, _scalbnl)
 #error Unsupported long double format
 #endif
 
+#ifdef _LP64
 long double
 scalbnl(long double x, int n)
 {
+	return scalblnl(x, n)
+}
+#endif
+
+long double
+scalblnl(long double x, long n)
+{
 	union ieee_ext_u u;
 
 	/* Trivial cases first */



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

2013-01-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jan 28 06:38:50 UTC 2013

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

Log Message:
Enable INET6


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbmips/conf/XLSATX

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/XLSATX
diff -u src/sys/arch/evbmips/conf/XLSATX:1.10 src/sys/arch/evbmips/conf/XLSATX:1.11
--- src/sys/arch/evbmips/conf/XLSATX:1.10	Thu Feb  9 18:58:14 2012
+++ src/sys/arch/evbmips/conf/XLSATX	Mon Jan 28 06:38:50 2013
@@ -1,8 +1,8 @@
-#	$NetBSD: XLSATX,v 1.10 2012/02/09 18:58:14 matt Exp $
+#	$NetBSD: XLSATX,v 1.11 2013/01/28 06:38:50 matt Exp $
 
 include 	arch/evbmips/conf/std.rmixl
 
-#ident 		XLSATX-$Revision: 1.10 $
+#ident 		XLSATX-$Revision: 1.11 $
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
@@ -95,7 +95,7 @@ options 	FFS_NO_SNAPSHOT	# No FFS snapsh
 # Networking options
 #options 	GATEWAY		# IP packet forwarding
 options 	INET		# Internet protocols
-#options 	INET6		# IPV6
+options 	INET6		# IPV6
 #options 	IPSEC		# IP security
 #options 	IPSEC_ESP	# IP security (encryption part; define w/IPSEC)
 #options 	IPSEC_NAT_T	# IPsec NAT traversal (NAT-T)