CVS commit: src/sys

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Mar 23 06:03:38 UTC 2014

Modified Files:
src/sys/arch/hp300/hp300: autoconf.c
src/sys/compat/linux/common: linux_ioctl.c

Log Message:
typos in comments


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/hp300/hp300/autoconf.c
cvs rdiff -u -r1.57 -r1.58 src/sys/compat/linux/common/linux_ioctl.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/hp300/hp300/autoconf.c
diff -u src/sys/arch/hp300/hp300/autoconf.c:1.102 src/sys/arch/hp300/hp300/autoconf.c:1.103
--- src/sys/arch/hp300/hp300/autoconf.c:1.102	Fri Jan 11 12:03:04 2013
+++ src/sys/arch/hp300/hp300/autoconf.c	Sun Mar 23 06:03:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.102 2013/01/11 12:03:04 tsutsui Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.103 2014/03/23 06:03:38 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.102 2013/01/11 12:03:04 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.103 2014/03/23 06:03:38 dholland Exp $");
 
 #include "dvbox.h"
 #include "gbox.h"
@@ -608,7 +608,7 @@ setbootdev(void)
 	 *	4 == sd
 	 *	6 == le
 	 *
-	 * Allare bdevsw major numbers, except for le, which
+	 * All are bdevsw major numbers, except for le, which
 	 * is just special.
 	 *
 	 * We can't mount root on a tape, so we ignore those.

Index: src/sys/compat/linux/common/linux_ioctl.c
diff -u src/sys/compat/linux/common/linux_ioctl.c:1.57 src/sys/compat/linux/common/linux_ioctl.c:1.58
--- src/sys/compat/linux/common/linux_ioctl.c:1.57	Wed Sep 19 21:24:29 2012
+++ src/sys/compat/linux/common/linux_ioctl.c	Sun Mar 23 06:03:38 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_ioctl.c,v 1.57 2012/09/19 21:24:29 bouyer Exp $	*/
+/*	$NetBSD: linux_ioctl.c,v 1.58 2014/03/23 06:03:38 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_ioctl.c,v 1.57 2012/09/19 21:24:29 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_ioctl.c,v 1.58 2014/03/23 06:03:38 dholland Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "sequencer.h"
@@ -148,7 +148,7 @@ linux_sys_ioctl(struct lwp *l, const str
 #if NSEQUENCER > 0
 /* XXX XAX 2x check this. */
 		/*
-		 * Both termios and the MIDI sequncer use 'T' to identify
+		 * Both termios and the MIDI sequencer use 'T' to identify
 		 * the ioctl, so we have to differentiate them in another
 		 * way.  We do it by indexing in the cdevsw with the major
 		 * device number and check if that is the sequencer entry.



CVS commit: src/sbin/fsck_lfs

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Mar 23 05:39:32 UTC 2014

Modified Files:
src/sbin/fsck_lfs: inode.c

Log Message:
don't use sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sbin/fsck_lfs/inode.c

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

Modified files:

Index: src/sbin/fsck_lfs/inode.c
diff -u src/sbin/fsck_lfs/inode.c:1.51 src/sbin/fsck_lfs/inode.c:1.52
--- src/sbin/fsck_lfs/inode.c:1.51	Tue Jun 18 18:18:58 2013
+++ src/sbin/fsck_lfs/inode.c	Sun Mar 23 05:39:32 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: inode.c,v 1.51 2013/06/18 18:18:58 christos Exp $	 */
+/* $NetBSD: inode.c,v 1.52 2014/03/23 05:39:32 dholland Exp $	 */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -259,7 +259,8 @@ iblock(struct inodesc *idesc, long ileve
 		for (ap = ((ulfs_daddr_t *) bp->b_data) + nif; ap < aplim; ap++) {
 			if (*ap == 0)
 continue;
-			(void) sprintf(buf, "PARTIALLY TRUNCATED INODE I=%llu",
+			(void)snprintf(buf, sizeof(buf),
+			"PARTIALLY TRUNCATED INODE I=%llu",
 			(unsigned long long)idesc->id_number);
 			if (dofix(idesc, buf)) {
 *ap = 0;



CVS commit: src/sbin/resize_lfs

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Mar 23 05:38:14 UTC 2014

Modified Files:
src/sbin/resize_lfs: resize_lfs.c

Log Message:
missed one


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sbin/resize_lfs/resize_lfs.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/resize_lfs/resize_lfs.c
diff -u src/sbin/resize_lfs/resize_lfs.c:1.8 src/sbin/resize_lfs/resize_lfs.c:1.9
--- src/sbin/resize_lfs/resize_lfs.c:1.8	Sun Mar 23 05:26:23 2014
+++ src/sbin/resize_lfs/resize_lfs.c	Sun Mar 23 05:38:14 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: resize_lfs.c,v 1.8 2014/03/23 05:26:23 dholland Exp $	*/
+/*	$NetBSD: resize_lfs.c,v 1.9 2014/03/23 05:38:14 dholland Exp $	*/
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -146,13 +146,14 @@ main(int argc, char **argv)
 	 * (XXX make the kernel able to do this instead?)
 	 */
 	for (i = fs->lfs_nseg - 1; i >= newnsegs; --i) {
-		char cmd[80];
+		char cmd[128];
 
 		/* If it's already empty, don't call the cleaner */
 		if (fcntl(rootfd, LFCNINVAL, &i) == 0)
 			continue;
 
-		sprintf(cmd, "/libexec/lfs_cleanerd -q -i %d %s", i, fsname);
+		snprintf(cmd, sizeof(cmd), "/libexec/lfs_cleanerd -q -i %d %s",
+			 i, fsname);
 		if (system(cmd) != 0)
 			err(1, "invalidating segment %d", i);
 	}



CVS commit: src/sbin/routed/rtquery

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Mar 23 05:36:58 UTC 2014

Modified Files:
src/sbin/routed/rtquery: rtquery.c

Log Message:
don't use sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sbin/routed/rtquery/rtquery.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/routed/rtquery/rtquery.c
diff -u src/sbin/routed/rtquery/rtquery.c:1.24 src/sbin/routed/rtquery/rtquery.c:1.25
--- src/sbin/routed/rtquery/rtquery.c:1.24	Sat Oct 19 00:57:41 2013
+++ src/sbin/routed/rtquery/rtquery.c	Sun Mar 23 05:36:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtquery.c,v 1.24 2013/10/19 00:57:41 christos Exp $	*/
+/*	$NetBSD: rtquery.c,v 1.25 2014/03/23 05:36:58 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1993
@@ -63,7 +63,7 @@
 __COPYRIGHT("@(#) Copyright (c) 1983, 1988, 1993\
  The Regents of the University of California.  All rights reserved.");
 #ifdef __NetBSD__
-__RCSID("$NetBSD: rtquery.c,v 1.24 2013/10/19 00:57:41 christos Exp $");
+__RCSID("$NetBSD: rtquery.c,v 1.25 2014/03/23 05:36:58 dholland Exp $");
 #elif defined(__FreeBSD__)
 __RCSID("$FreeBSD$");
 #else
@@ -552,11 +552,11 @@ static char *
 qstring(u_char *s, int len)
 {
 	static char buf[8*20+1];
-	char *p;
+	size_t bufpos;
 	u_char *s2, c;
 
 
-	for (p = buf; len != 0 && p < &buf[sizeof(buf)-1]; len--) {
+	for (bufpos = 0; len != 0 && bufpos < sizeof(buf) - 1; len--) {
 		c = *s++;
 		if (c == '\0') {
 			for (s2 = s+1; s2 < &s[len]; s2++) {
@@ -568,33 +568,38 @@ qstring(u_char *s, int len)
 		}
 
 		if (c >= ' ' && c < 0x7f && c != '\\') {
-			*p++ = c;
+			buf[bufpos++] = c;
 			continue;
 		}
-		*p++ = '\\';
+		if (bufpos >= sizeof(buf) - 2) {
+			/* too long */
+			break;
+		}
+		buf[bufpos++] = '\\';
 		switch (c) {
 		case '\\':
-			*p++ = '\\';
+			buf[bufpos++] = '\\';
 			break;
 		case '\n':
-			*p++= 'n';
+			buf[bufpos++] = 'n';
 			break;
 		case '\r':
-			*p++= 'r';
+			buf[bufpos++] = 'r';
 			break;
 		case '\t':
-			*p++ = 't';
+			buf[bufpos++] = 't';
 			break;
 		case '\b':
-			*p++ = 'b';
+			buf[bufpos++] = 'b';
 			break;
 		default:
-			p += sprintf(p,"%o",c);
+			bufpos += snprintf(buf + bufpos, sizeof(buf) - bufpos,
+	   "%o", c);
 			break;
 		}
 	}
 exit:
-	*p = '\0';
+	buf[bufpos] = '\0';
 	return buf;
 }
 
@@ -614,7 +619,7 @@ rip_input(struct sockaddr_in *from,
 	MD5_CTX md5_ctx;
 	u_char md5_authed = 0;
 	u_int mask, dmask;
-	char *sp;
+	size_t spos;
 	int i;
 	struct hostent *hp;
 	struct netent *np;
@@ -665,9 +670,11 @@ rip_input(struct sockaddr_in *from,
 			mask = ntohl(n->n_mask);
 			dmask = mask & -mask;
 			if (mask != 0) {
-sp = &net_buf[strlen(net_buf)];
+spos = strlen(net_buf);
 if (IMSG.rip_vers == RIPv1) {
-	(void)sprintf(sp," mask=%#x ? ",mask);
+	(void)snprintf(net_buf + spos,
+		   sizeof(net_buf) - spos,
+		   " mask=%#x ? ", mask);
 	mask = 0;
 } else if (mask + dmask == 0) {
 	for (i = 0;
@@ -675,9 +682,13 @@ rip_input(struct sockaddr_in *from,
 	  && ((1n_dst >> 24),
   (u_char)(n->n_dst >> 16),



CVS commit: src/sbin/resize_lfs

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Mar 23 05:26:23 UTC 2014

Modified Files:
src/sbin/resize_lfs: resize_lfs.c

Log Message:
don't use sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sbin/resize_lfs/resize_lfs.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/resize_lfs/resize_lfs.c
diff -u src/sbin/resize_lfs/resize_lfs.c:1.7 src/sbin/resize_lfs/resize_lfs.c:1.8
--- src/sbin/resize_lfs/resize_lfs.c:1.7	Wed Jun 19 01:07:55 2013
+++ src/sbin/resize_lfs/resize_lfs.c	Sun Mar 23 05:26:23 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: resize_lfs.c,v 1.7 2013/06/19 01:07:55 christos Exp $	*/
+/*	$NetBSD: resize_lfs.c,v 1.8 2014/03/23 05:26:23 dholland Exp $	*/
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -60,6 +60,7 @@ int
 main(int argc, char **argv)
 {
 	char *rdev, *fsname, buf[LFS_SBPAD];
+	size_t rdevlen;
 	daddr_t newsize, newnsegs;
 	int devfd, rootfd;
 	int ch, i, verbose;
@@ -95,8 +96,9 @@ main(int argc, char **argv)
 	 */
 	if (statvfs(fsname, &vfs) < 0)
 		err(1, "%s", fsname);
-	rdev = (char *)malloc(strlen(vfs.f_mntfromname + 2));
-	sprintf(rdev, "/dev/r%s", vfs.f_mntfromname + 5);
+	rdevlen = strlen(vfs.f_mntfromname) + 2;
+	rdev = malloc(rdevlen);
+	snprintf(rdev, rdevlen, "/dev/r%s", vfs.f_mntfromname + 5);
 	devfd = open(rdev, O_RDONLY);
 	if (devfd < 0)
 		err(1, "open raw device");



CVS commit: src/sbin/newfs_sysvbfs

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Mar 23 05:10:56 UTC 2014

Modified Files:
src/sbin/newfs_sysvbfs: newfs_sysvbfs.c

Log Message:
don't use sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sbin/newfs_sysvbfs/newfs_sysvbfs.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_sysvbfs/newfs_sysvbfs.c
diff -u src/sbin/newfs_sysvbfs/newfs_sysvbfs.c:1.8 src/sbin/newfs_sysvbfs/newfs_sysvbfs.c:1.9
--- src/sbin/newfs_sysvbfs/newfs_sysvbfs.c:1.8	Mon Aug 29 14:35:03 2011
+++ src/sbin/newfs_sysvbfs/newfs_sysvbfs.c	Sun Mar 23 05:10:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: newfs_sysvbfs.c,v 1.8 2011/08/29 14:35:03 joerg Exp $	*/
+/*	$NetBSD: newfs_sysvbfs.c,v 1.9 2014/03/23 05:10:56 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -220,10 +220,10 @@ bfs_newfs(int fd, uint32_t nsectors)
 	/* dirent table */
 	memset(buf, 0, BFS_BSIZE);
 	dirent->inode = BFS_ROOT_INODE;
-	sprintf(dirent->name, ".");
+	strcpy(dirent->name, ".");
 	dirent++;
 	dirent->inode = BFS_ROOT_INODE;
-	sprintf(dirent->name, "..");
+	strcpy(dirent->name, "..");
 	if (write(fd, buf, BFS_BSIZE) < 0) {
 		perror("write dirent");
 		return -1;



CVS commit: src/sbin/amrctl

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Mar 23 05:09:56 UTC 2014

Modified Files:
src/sbin/amrctl: amrctl.c

Log Message:
don't use sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sbin/amrctl/amrctl.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/amrctl/amrctl.c
diff -u src/sbin/amrctl/amrctl.c:1.9 src/sbin/amrctl/amrctl.c:1.10
--- src/sbin/amrctl/amrctl.c:1.9	Fri May 18 14:01:34 2012
+++ src/sbin/amrctl/amrctl.c	Sun Mar 23 05:09:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: amrctl.c,v 1.9 2012/05/18 14:01:34 jakllsch Exp $	*/
+/*	$NetBSD: amrctl.c,v 1.10 2014/03/23 05:09:56 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2002, Pierre David 
@@ -29,7 +29,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: amrctl.c,v 1.9 2012/05/18 14:01:34 jakllsch Exp $");
+__RCSID("$NetBSD: amrctl.c,v 1.10 2014/03/23 05:09:56 dholland Exp $");
 #endif
 
 #include 
@@ -311,18 +311,21 @@ describe_card(int fd, int verbosity, int
 	 */
 	product = "HP NetRaid 3si";
 }
-sprintf(firmware, "%c.%02d.%02d",
+snprintf(firmware, sizeof(firmware),
+	"%c.%02d.%02d",
 	ae->ae_adapter.aa_firmware[2],
 	ae->ae_adapter.aa_firmware[1],
 	ae->ae_adapter.aa_firmware[0]);
-sprintf(bios, "%c.%02d.%02d",
+snprintf(bios, sizeof(bios),
+	"%c.%02d.%02d",
 	ae->ae_adapter.aa_bios[2],
 	ae->ae_adapter.aa_bios[1],
 	ae->ae_adapter.aa_bios[0]);
 			} else {
-sprintf(firmware, "%.4s",
+snprintf(firmware, sizeof(firmware), "%.4s",
 	ae->ae_adapter.aa_firmware);
-sprintf(bios, "%.4s", ae->ae_adapter.aa_bios);
+snprintf(bios, sizeof(bios), "%.4s",
+	ae->ae_adapter.aa_bios);
 			}
 
 			printf("Ioctl = %d (%s)\n", FIRMWARE_8LD, "8LD");



CVS commit: src/bin/sh

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Mar 23 05:07:59 UTC 2014

Modified Files:
src/bin/sh: histedit.c

Log Message:
don't use sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/bin/sh/histedit.c

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

Modified files:

Index: src/bin/sh/histedit.c
diff -u src/bin/sh/histedit.c:1.45 src/bin/sh/histedit.c:1.46
--- src/bin/sh/histedit.c:1.45	Tue Mar 20 18:42:29 2012
+++ src/bin/sh/histedit.c	Sun Mar 23 05:07:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: histedit.c,v 1.45 2012/03/20 18:42:29 matt Exp $	*/
+/*	$NetBSD: histedit.c,v 1.46 2014/03/23 05:07:59 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)histedit.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: histedit.c,v 1.45 2012/03/20 18:42:29 matt Exp $");
+__RCSID("$NetBSD: histedit.c,v 1.46 2014/03/23 05:07:59 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -432,10 +432,12 @@ histcmd(int argc, char **argv)
 	}
 	if (editor) {
 		char *editcmd;
+		size_t cmdlen;
 
 		fclose(efp);
-		editcmd = stalloc(strlen(editor) + strlen(editfile) + 2);
-		sprintf(editcmd, "%s %s", editor, editfile);
+		cmdlen = strlen(editor) + strlen(editfile) + 2;
+		editcmd = stalloc(cmdlen);
+		snprintf(editcmd, cmdlen, "%s %s", editor, editfile);
 		evalstring(editcmd, 0);	/* XXX - should use no JC command */
 		INTON;
 		readcmdfile(editfile);	/* XXX - should read back - quick tst */



CVS commit: src/bin/ed

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Mar 23 05:06:42 UTC 2014

Modified Files:
src/bin/ed: buf.c cbc.c ed.h glbl.c io.c main.c re.c sub.c undo.c

Log Message:
sprintf considered harmful


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/bin/ed/buf.c
cvs rdiff -u -r1.22 -r1.23 src/bin/ed/cbc.c
cvs rdiff -u -r1.35 -r1.36 src/bin/ed/ed.h
cvs rdiff -u -r1.6 -r1.7 src/bin/ed/glbl.c src/bin/ed/sub.c
cvs rdiff -u -r1.9 -r1.10 src/bin/ed/io.c
cvs rdiff -u -r1.25 -r1.26 src/bin/ed/main.c
cvs rdiff -u -r1.20 -r1.21 src/bin/ed/re.c
cvs rdiff -u -r1.5 -r1.6 src/bin/ed/undo.c

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

Modified files:

Index: src/bin/ed/buf.c
diff -u src/bin/ed/buf.c:1.26 src/bin/ed/buf.c:1.27
--- src/bin/ed/buf.c:1.26	Fri Mar 17 14:37:14 2006
+++ src/bin/ed/buf.c	Sun Mar 23 05:06:42 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.c,v 1.26 2006/03/17 14:37:14 rumble Exp $	*/
+/*	$NetBSD: buf.c,v 1.27 2014/03/23 05:06:42 dholland Exp $	*/
 
 /* buf.c: This file contains the scratch-file buffer routines for the
ed line editor. */
@@ -33,7 +33,7 @@
 #if 0
 static char *rcsid = "@(#)buf.c,v 1.4 1994/02/01 00:34:35 alm Exp";
 #else
-__RCSID("$NetBSD: buf.c,v 1.26 2006/03/17 14:37:14 rumble Exp $");
+__RCSID("$NetBSD: buf.c,v 1.27 2014/03/23 05:06:42 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -70,7 +70,7 @@ get_sbuf_line(line_t *lp)
 		sfseek = lp->seek;
 		if (fseek(sfp, sfseek, SEEK_SET) < 0) {
 			fprintf(stderr, "%s\n", strerror(errno));
-			sprintf(errmsg, "cannot seek temp file");
+			seterrmsg("cannot seek temp file");
 			return NULL;
 		}
 	}
@@ -78,7 +78,7 @@ get_sbuf_line(line_t *lp)
 	REALLOC(sfbuf, sfbufsz, len + 1, NULL);
 	if ((ct = fread(sfbuf, sizeof(char), len, sfp)) <  0 || ct != len) {
 		fprintf(stderr, "%s\n", strerror(errno));
-		sprintf(errmsg, "cannot read temp file");
+		seterrmsg("cannot read temp file");
 		return NULL;
 	}
 	sfseek += len;/* update file position */
@@ -98,14 +98,14 @@ put_sbuf_line(char *cs)
 
 	if ((lp = (line_t *) malloc(sizeof(line_t))) == NULL) {
 		fprintf(stderr, "%s\n", strerror(errno));
-		sprintf(errmsg, "out of memory");
+		seterrmsg("out of memory");
 		return NULL;
 	}
 	/* assert: cs is '\n' terminated */
 	for (s = cs; *s != '\n'; s++)
 		;
 	if (s - cs >= LINECHARS) {
-		sprintf(errmsg, "line too long");
+		seterrmsg("line too long");
 		free(lp);
 		return NULL;
 	}
@@ -114,7 +114,7 @@ put_sbuf_line(char *cs)
 	if (seek_write) {
 		if (fseek(sfp, 0L, SEEK_END) < 0) {
 			fprintf(stderr, "%s\n", strerror(errno));
-			sprintf(errmsg, "cannot seek temp file");
+			seterrmsg("cannot seek temp file");
 			free(lp);
 			return NULL;
 		}
@@ -125,7 +125,7 @@ put_sbuf_line(char *cs)
 	if ((ct = fwrite(cs, sizeof(char), len, sfp)) < 0 || ct != len) {
 		sfseek = -1;
 		fprintf(stderr, "%s\n", strerror(errno));
-		sprintf(errmsg, "cannot write temp file");
+		seterrmsg("cannot write temp file");
 		free(lp);
 		return NULL;
 	}
@@ -160,7 +160,7 @@ get_line_node_addr(line_t *lp)
 	while (cp != lp && (cp = cp->q_forw) != &buffer_head)
 		n++;
 	if (n && cp == &buffer_head) {
-		sprintf(errmsg, "invalid address");
+		seterrmsg("invalid address");
 		return ERR;
 	}
 	return n;
@@ -222,7 +222,7 @@ open_sbuf(void)
 		(void)asprintf(&sfn, "%s/ed.XX", tmp);
 	if (sfn == NULL) {
 		warn(NULL);
-		sprintf(errmsg, "could not allocate memory");
+		seterrmsg("could not allocate memory");
 		umask(u);
 		return ERR;
 	}
@@ -232,7 +232,7 @@ open_sbuf(void)
 		if (fd != -1)
 			close(fd);
 		warn("%s", sfn);
-		sprintf(errmsg, "cannot open temp file");
+		seterrmsg("cannot open temp file");
 		umask(u);
 		return ERR;
 	}
@@ -248,7 +248,7 @@ close_sbuf(void)
 	if (sfp) {
 		if (fclose(sfp) < 0) {
 			fprintf(stderr, "%s: %s\n", sfn, strerror(errno));
-			sprintf(errmsg, "cannot close temp file");
+			seterrmsg("cannot close temp file");
 			return ERR;
 		}
 		sfp = NULL;

Index: src/bin/ed/cbc.c
diff -u src/bin/ed/cbc.c:1.22 src/bin/ed/cbc.c:1.23
--- src/bin/ed/cbc.c:1.22	Wed Jun  9 19:20:18 2010
+++ src/bin/ed/cbc.c	Sun Mar 23 05:06:42 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cbc.c,v 1.22 2010/06/09 19:20:18 riz Exp $	*/
+/*	$NetBSD: cbc.c,v 1.23 2014/03/23 05:06:42 dholland Exp $	*/
 
 /* cbc.c: This file contains the encryption routines for the ed line editor */
 /*-
@@ -72,7 +72,7 @@
 #if 0
 static char *rcsid = "@(#)cbc.c,v 1.2 1994/02/01 00:34:36 alm Exp";
 #else
-__RCSID("$NetBSD: cbc.c,v 1.22 2010/06/09 19:20:18 riz Exp $");
+__RCSID("$NetBSD: cbc.c,v 1.23 2014/03/23 05:06:42 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -252,7 +252,7 @@ get_keyword(void)
 static void
 des_error(const char *s /* the message */)
 {
-	(void)sprintf(errmsg, "%s", s ? s : strerror(errno));
+	seterrmsg("%s", s ? s : strerror(errno));
 }
 
 /*

Index: src/bin/ed/ed.h
diff -u src/bin/ed/ed.h:1.35 src/bin/ed/ed.h:1.36
--- src/bin/ed/ed.h:1.35	Mon Aug 29 

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

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Mar 23 04:58:16 UTC 2014

Modified Files:
src/usr.bin/xlint/lint1: cgram.y

Log Message:
typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/usr.bin/xlint/lint1/cgram.y

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/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.58 src/usr.bin/xlint/lint1/cgram.y:1.59
--- src/usr.bin/xlint/lint1/cgram.y:1.58	Tue Feb 18 22:01:36 2014
+++ src/usr.bin/xlint/lint1/cgram.y	Sun Mar 23 04:58:16 2014
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.58 2014/02/18 22:01:36 christos Exp $ */
+/* $NetBSD: cgram.y,v 1.59 2014/03/23 04:58:16 dholland Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.58 2014/02/18 22:01:36 christos Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.59 2014/03/23 04:58:16 dholland Exp $");
 #endif
 
 #include 
@@ -575,7 +575,7 @@ struct_spec:
 		 * a new tag if "a" is not declared at current level
 		 *
 		 * yychar is valid because otherwise the parser would
-		 * not been able to deceide if he must shift or reduce
+		 * not been able to decide if he must shift or reduce
 		 */
 		$$ = mktag($2, $1, 0, yychar == T_SEMI);
 	  }



CVS commit: src/sys/dev/raidframe

2014-03-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 23 03:42:39 UTC 2014

Modified Files:
src/sys/dev/raidframe: rf_dagdegwr.c

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/raidframe/rf_dagdegwr.c

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

Modified files:

Index: src/sys/dev/raidframe/rf_dagdegwr.c
diff -u src/sys/dev/raidframe/rf_dagdegwr.c:1.32 src/sys/dev/raidframe/rf_dagdegwr.c:1.33
--- src/sys/dev/raidframe/rf_dagdegwr.c:1.32	Sun Sep 15 08:20:28 2013
+++ src/sys/dev/raidframe/rf_dagdegwr.c	Sat Mar 22 23:42:39 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_dagdegwr.c,v 1.32 2013/09/15 12:20:28 martin Exp $	*/
+/*	$NetBSD: rf_dagdegwr.c,v 1.33 2014/03/23 03:42:39 christos Exp $	*/
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_dagdegwr.c,v 1.32 2013/09/15 12:20:28 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_dagdegwr.c,v 1.33 2014/03/23 03:42:39 christos Exp $");
 
 #include 
 
@@ -582,7 +582,7 @@ rf_WriteGenerateFailedAccessASMs(
 	int numDataCol = layoutPtr->numDataCol;
 	int state;
 	unsigned napdas;
-	RF_SectorNum_t fone_start, fone_end, ftwo_start = 0, ftwo_end;
+	RF_SectorNum_t fone_start, ftwo_start = 0;
 	RF_PhysDiskAddr_t *fone = asmap->failedPDAs[0], *ftwo = asmap->failedPDAs[1];
 	RF_PhysDiskAddr_t *pda_p;
 	RF_RaidAddr_t sosAddr;
@@ -592,7 +592,6 @@ rf_WriteGenerateFailedAccessASMs(
 	 * possibly two, depending whether they overlap. */
 
 	fone_start = rf_StripeUnitOffset(layoutPtr, fone->startSector);
-	fone_end = fone_start + fone->numSector;
 
 	if (asmap->numDataFailed == 1) {
 		PDAPerDisk = 1;
@@ -608,7 +607,6 @@ rf_WriteGenerateFailedAccessASMs(
 		pda_p->type = RF_PDA_TYPE_Q;
 	} else {
 		ftwo_start = rf_StripeUnitOffset(layoutPtr, ftwo->startSector);
-		ftwo_end = ftwo_start + ftwo->numSector;
 		if (fone->numSector + ftwo->numSector > secPerSU) {
 			PDAPerDisk = 1;
 			state = 2;



CVS commit: src/sys/dev/gpib

2014-03-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 23 03:41:10 UTC 2014

Modified Files:
src/sys/dev/gpib: rd.c

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/gpib/rd.c

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

Modified files:

Index: src/sys/dev/gpib/rd.c
diff -u src/sys/dev/gpib/rd.c:1.32 src/sys/dev/gpib/rd.c:1.33
--- src/sys/dev/gpib/rd.c:1.32	Sun Mar 16 01:20:27 2014
+++ src/sys/dev/gpib/rd.c	Sat Mar 22 23:41:10 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rd.c,v 1.32 2014/03/16 05:20:27 dholland Exp $ */
+/*	$NetBSD: rd.c,v 1.33 2014/03/23 03:41:10 christos Exp $ */
 
 /*-
  * Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.32 2014/03/16 05:20:27 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.33 2014/03/23 03:41:10 christos Exp $");
 
 #include 
 #include 
@@ -697,7 +697,7 @@ void
 rdstart(struct rd_softc *sc)
 {
 	struct buf *bp = bufq_peek(sc->sc_tab);
-	int part, slave, punit;
+	int slave, punit;
 
 	slave = sc->sc_slave;
 	punit = sc->sc_punit;
@@ -707,7 +707,6 @@ rdstart(struct rd_softc *sc)
 
 again:
 
-	part = RDPART(bp->b_dev);
 	sc->sc_flags |= RDF_SEEK;
 	sc->sc_ioc.c_unit = CS80CMD_SUNIT(punit);
 	sc->sc_ioc.c_volume = CS80CMD_SVOL(0);



CVS commit: src/sys/dev/isa

2014-03-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 23 02:59:19 UTC 2014

Modified Files:
src/sys/dev/isa: radiotrack.c

Log Message:
fix unused


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/isa/radiotrack.c

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

Modified files:

Index: src/sys/dev/isa/radiotrack.c
diff -u src/sys/dev/isa/radiotrack.c:1.19 src/sys/dev/isa/radiotrack.c:1.20
--- src/sys/dev/isa/radiotrack.c:1.19	Sat Oct 27 13:18:25 2012
+++ src/sys/dev/isa/radiotrack.c	Sat Mar 22 22:59:19 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: radiotrack.c,v 1.19 2012/10/27 17:18:25 chs Exp $ */
+/* $NetBSD: radiotrack.c,v 1.20 2014/03/23 02:59:19 christos Exp $ */
 /* $OpenBSD: radiotrack.c,v 1.1 2001/12/05 10:27:06 mickey Exp $ */
 /* $RuOBSD: radiotrack.c,v 1.3 2001/10/18 16:51:36 pva Exp $ */
 
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radiotrack.c,v 1.19 2012/10/27 17:18:25 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radiotrack.c,v 1.20 2014/03/23 02:59:19 christos Exp $");
 
 #include 
 #include 
@@ -334,10 +334,9 @@ rt_unconv_vol(u_int8_t vol)
 int
 rt_find(bus_space_tag_t iot, bus_space_handle_t ioh)
 {
+#ifdef notdef
 	struct rt_softc sc;
-#if 0
 	u_int i, scanres = 0;
-#endif
 
 	sc.lm.iot = iot;
 	sc.lm.ioh = ioh;
@@ -359,14 +358,14 @@ rt_find(bus_space_tag_t iot, bus_space_h
 	 * Scan whole FM range. If there is a card it'll
 	 * respond on some frequency.
 	 */
-	return 0;
-#if 0
 	for (i = MIN_FM_FREQ; !scanres && i < MAX_FM_FREQ; i += 10) {
 		rt_set_freq(&sc, i);
 		scanres += rt_state(iot, ioh);
 	}
 
 	return scanres;
+#else
+	return 0;
 #endif
 }
 



CVS commit: src/sys/arch/i386/pnpbios

2014-03-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 23 02:57:58 UTC 2014

Modified Files:
src/sys/arch/i386/pnpbios: pckbc_pnpbios.c

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/i386/pnpbios/pckbc_pnpbios.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/i386/pnpbios/pckbc_pnpbios.c
diff -u src/sys/arch/i386/pnpbios/pckbc_pnpbios.c:1.17 src/sys/arch/i386/pnpbios/pckbc_pnpbios.c:1.18
--- src/sys/arch/i386/pnpbios/pckbc_pnpbios.c:1.17	Sun Jun  8 14:35:25 2008
+++ src/sys/arch/i386/pnpbios/pckbc_pnpbios.c	Sat Mar 22 22:57:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pckbc_pnpbios.c,v 1.17 2008/06/08 18:35:25 tsutsui Exp $	*/
+/*	$NetBSD: pckbc_pnpbios.c,v 1.18 2014/03/23 02:57:58 christos Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pckbc_pnpbios.c,v 1.17 2008/06/08 18:35:25 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pckbc_pnpbios.c,v 1.18 2014/03/23 02:57:58 christos Exp $");
 
 #include 
 #include 
@@ -108,16 +108,13 @@ pckbc_pnpbios_attach(device_t parent, de
 	struct pnpbiosdev_attach_args *aa = aux;
 	bus_space_tag_t iot;
 	bus_space_handle_t ioh_d, ioh_c;
-	pckbc_slot_t peer;
 	int iobase;
 
 	sc->sc_dv = self;
 	if (strncmp(aa->idstr, "PNP03", 5) == 0) {
 		psc->sc_slot = PCKBC_KBD_SLOT;
-		peer = PCKBC_AUX_SLOT;
 	} else if (strcmp(aa->idstr, "PNP0F13") == 0) {
 		psc->sc_slot = PCKBC_AUX_SLOT;
-		peer = PCKBC_KBD_SLOT;
 	} else {
 		aprint_error(": unknown port!\n");
 		panic("pckbc_pnpbios_attach: impossible");



CVS commit: src/sys/dev/gpib

2014-03-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 23 02:57:20 UTC 2014

Modified Files:
src/sys/dev/gpib: mt.c

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/gpib/mt.c

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

Modified files:

Index: src/sys/dev/gpib/mt.c
diff -u src/sys/dev/gpib/mt.c:1.26 src/sys/dev/gpib/mt.c:1.27
--- src/sys/dev/gpib/mt.c:1.26	Sun Mar 16 01:20:27 2014
+++ src/sys/dev/gpib/mt.c	Sat Mar 22 22:57:20 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mt.c,v 1.26 2014/03/16 05:20:27 dholland Exp $ */
+/*	$NetBSD: mt.c,v 1.27 2014/03/23 02:57:20 christos Exp $ */
 
 /*-
  * Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.26 2014/03/16 05:20:27 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mt.c,v 1.27 2014/03/23 02:57:20 christos Exp $");
 
 #include 
 #include 
@@ -962,20 +962,12 @@ error:
 int
 mtread(dev_t dev, struct uio *uio, int flags)
 {
-	struct mt_softc *sc;
-
-	sc = device_lookup_private(&mt_cd, MTUNIT(dev));
-
 	return (physio(mtstrategy, NULL, dev, B_READ, minphys, uio));
 }
 
 int
 mtwrite(dev_t dev, struct uio *uio, int flags)
 {
-	struct mt_softc *sc;
-
-	sc = device_lookup_private(&mt_cd, MTUNIT(dev));
-
 	return (physio(mtstrategy, NULL, dev, B_WRITE, minphys, uio));
 }
 



CVS commit: src/sys/kern

2014-03-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 23 02:56:33 UTC 2014

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

Log Message:
fix unused


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

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

Modified files:

Index: src/sys/kern/kgdb_stub.c
diff -u src/sys/kern/kgdb_stub.c:1.26 src/sys/kern/kgdb_stub.c:1.27
--- src/sys/kern/kgdb_stub.c:1.26	Sat May 11 11:44:46 2013
+++ src/sys/kern/kgdb_stub.c	Sat Mar 22 22:56:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: kgdb_stub.c,v 1.26 2013/05/11 15:44:46 skrll Exp $	*/
+/*	$NetBSD: kgdb_stub.c,v 1.27 2014/03/23 02:56:33 christos Exp $	*/
 
 /*
  * Copyright (c) 1990, 1993
@@ -45,7 +45,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kgdb_stub.c,v 1.26 2013/05/11 15:44:46 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kgdb_stub.c,v 1.27 2014/03/23 02:56:33 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -304,6 +304,7 @@ kgdb_recv(u_char *bp, int maxlen)
 			break;
 		}
 		DPRINTF((" Bad(wanted %x, off by %d)- ", tmpcsum, csum));
+		__USE(tmpcsum);
 		PUTC(KGDB_BADP);
 	} while (1);
 	DPRINTF(("kgdb_recv: %s\n", bp));



CVS commit: src/sys/compat/ndis

2014-03-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 23 02:55:26 UTC 2014

Modified Files:
src/sys/compat/ndis: kern_ndis.c

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/compat/ndis/kern_ndis.c

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

Modified files:

Index: src/sys/compat/ndis/kern_ndis.c
diff -u src/sys/compat/ndis/kern_ndis.c:1.24 src/sys/compat/ndis/kern_ndis.c:1.25
--- src/sys/compat/ndis/kern_ndis.c:1.24	Thu Sep 19 14:50:35 2013
+++ src/sys/compat/ndis/kern_ndis.c	Sat Mar 22 22:55:26 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_ndis.c,v 1.24 2013/09/19 18:50:35 christos Exp $	*/
+/*	$NetBSD: kern_ndis.c,v 1.25 2014/03/23 02:55:26 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003
@@ -37,7 +37,7 @@
 __FBSDID("$FreeBSD: src/sys/compat/ndis/kern_ndis.c,v 1.60.2.5 2005/04/01 17:14:20 wpaul Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: kern_ndis.c,v 1.24 2013/09/19 18:50:35 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_ndis.c,v 1.25 2014/03/23 02:55:26 christos Exp $");
 #endif
 
 #include 
@@ -579,14 +579,11 @@ ndis_unsched(void (*func)(void *), void 
 {
 	struct ndis_req		*r;
 	struct ndisqhead	*q;
-	struct proc		*p;
 
 	if (t == NDIS_TASKQUEUE) {
 		q = &ndis_ttodo;
-		p = ndis_tproc.np_p;
 	} else {
 		q = &ndis_itodo;
-		p = ndis_iproc.np_p;
 	}
 
 	mtx_lock_spin(&ndis_thr_mtx);
@@ -1484,7 +1481,6 @@ ndis_set_info(void *arg, ndis_oid oid, v
 	ndis_handle		adapter;
 	__stdcall ndis_setinfo_handler	setfunc;
 	uint32_t		byteswritten = 0, bytesneeded = 0;
-	int			error;
 	uint8_t			irql = 0;	/* XXX: gcc */
 
 	/*
@@ -1527,9 +1523,8 @@ ndis_set_info(void *arg, ndis_oid oid, v
 
 	if (rval == NDIS_STATUS_PENDING) {
 		mtx_lock(&ndis_req_mtx);
-		error = mtsleep(&sc->ndis_block->nmb_setstat,
-PZERO | PNORELOCK, 
-"ndisset", 5 * hz, &ndis_req_mtx);
+		mtsleep(&sc->ndis_block->nmb_setstat, PZERO | PNORELOCK, 
+		"ndisset", 5 * hz, &ndis_req_mtx);
 		rval = sc->ndis_block->nmb_setstat;
 	}
 
@@ -1708,16 +1703,10 @@ ndis_reset_nic(void *arg)
 	ndis_handle		adapter;
 	__stdcall ndis_reset_handler	resetfunc;
 	uint8_t			addressing_reset;
-	struct ifnet		*ifp;
 	int			rval;
 	uint8_t			irql = 0;	/* XXX: gcc */
 
 	sc = arg;
-#ifdef __FreeBSD__
-	ifp = &sc->arpcom.ac_if;
-#else
-	ifp = &sc->arpcom.ec_if;
-#endif
 
 	adapter = sc->ndis_block->nmb_miniportadapterctx;
 	resetfunc = sc->ndis_chars->nmc_reset_func;
@@ -1746,14 +1735,8 @@ ndis_halt_nic(void *arg)
 	struct ndis_softc	*sc;
 	ndis_handle		adapter;
 	__stdcall ndis_halt_handler	haltfunc;
-	struct ifnet		*ifp;
 
 	sc = arg;
-#ifdef __FreeBSD__
-	ifp = &sc->arpcom.ac_if;
-#else
-	ifp = &sc->arpcom.ec_if;
-#endif
 
 	NDIS_LOCK(sc);
 	



CVS commit: src/sys/dev/pci

2014-03-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 23 02:54:12 UTC 2014

Modified Files:
src/sys/dev/pci: iwic_dchan.c

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/iwic_dchan.c

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

Modified files:

Index: src/sys/dev/pci/iwic_dchan.c
diff -u src/sys/dev/pci/iwic_dchan.c:1.8 src/sys/dev/pci/iwic_dchan.c:1.9
--- src/sys/dev/pci/iwic_dchan.c:1.8	Sat Mar 22 22:53:12 2014
+++ src/sys/dev/pci/iwic_dchan.c	Sat Mar 22 22:54:12 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: iwic_dchan.c,v 1.8 2014/03/23 02:53:12 christos Exp $	*/
+/*	$NetBSD: iwic_dchan.c,v 1.9 2014/03/23 02:54:12 christos Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Dave Boyce. All rights reserved.
@@ -36,7 +36,7 @@
  *---*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: iwic_dchan.c,v 1.8 2014/03/23 02:53:12 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iwic_dchan.c,v 1.9 2014/03/23 02:54:12 christos Exp $");
 
 #include 
 #include 
@@ -351,10 +351,10 @@ dchan_receive(struct iwic_softc *sc, int
 		}
 		else
 		{
-			int hi, lo;
+			int lo;
 
 			lo = IWIC_READ(sc, D_RBCL);
-			hi = IWIC_READ(sc, D_RBCH);
+			(void)IWIC_READ(sc, D_RBCH);
 			lo = lo & 0x3f;
 
 			if (lo == 0)



CVS commit: src/sys/dev/pci

2014-03-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 23 02:53:12 UTC 2014

Modified Files:
src/sys/dev/pci: iwic_bchan.c iwic_dchan.c

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/iwic_bchan.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/iwic_dchan.c

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

Modified files:

Index: src/sys/dev/pci/iwic_bchan.c
diff -u src/sys/dev/pci/iwic_bchan.c:1.8 src/sys/dev/pci/iwic_bchan.c:1.9
--- src/sys/dev/pci/iwic_bchan.c:1.8	Sat Oct 27 13:18:34 2012
+++ src/sys/dev/pci/iwic_bchan.c	Sat Mar 22 22:53:12 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: iwic_bchan.c,v 1.8 2012/10/27 17:18:34 chs Exp $	*/
+/*	$NetBSD: iwic_bchan.c,v 1.9 2014/03/23 02:53:12 christos Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Dave Boyce. All rights reserved.
@@ -38,7 +38,7 @@
  *---*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: iwic_bchan.c,v 1.8 2012/10/27 17:18:34 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iwic_bchan.c,v 1.9 2014/03/23 02:53:12 christos Exp $");
 
 #include 
 #include 
@@ -78,7 +78,6 @@ iwic_bchan_xirq(struct iwic_softc *sc, i
 	int irq_stat;
 	struct iwic_bchan *chan;
 	int cmd = 0;
-	int activity = 0;
 
 	chan = &sc->sc_bchan[chan_no];
 
@@ -176,8 +175,6 @@ iwic_bchan_xirq(struct iwic_softc *sc, i
 (*chan->l4_driver->bch_rx_data_ready)(chan->l4_driver_softc);
 
 
-activity = ACT_RX;
-
 /* mark buffer ptr as unused */
 
 chan->in_mbuf = NULL;
@@ -252,8 +249,7 @@ iwic_bchan_xirq(struct iwic_softc *sc, i
 
 /* silence detection */
 
-if(!(isdn_bchan_silence(chan->in_mbuf->m_data, chan->in_mbuf->m_len)))
-	activity = ACT_RX;
+isdn_bchan_silence(chan->in_mbuf->m_data, chan->in_mbuf->m_len);
 
 #if defined (__FreeBSD__) && __FreeBSD__ > 4
 (void) IF_HANDOFF(&chan->rx_queue, chan->in_mbuf, NULL);
@@ -311,7 +307,6 @@ iwic_bchan_xirq(struct iwic_softc *sc, i
 	{
 		/* transmit fifo empty, new data can be written to fifo */
 
-		int activity1 = -1;
 		int len;
 		int nextlen;
 
@@ -344,12 +339,7 @@ iwic_bchan_xirq(struct iwic_softc *sc, i
 
 if(chan->bprot == BPROT_NONE)
 {
-	if(!(isdn_bchan_silence(chan->out_mbuf_cur->m_data, chan->out_mbuf_cur->m_len)))
-		activity1 = ACT_TX;
-}
-else
-{
-	activity1 = ACT_TX;
+	isdn_bchan_silence(chan->out_mbuf_cur->m_data, chan->out_mbuf_cur->m_len);
 }
 			}
 		}

Index: src/sys/dev/pci/iwic_dchan.c
diff -u src/sys/dev/pci/iwic_dchan.c:1.7 src/sys/dev/pci/iwic_dchan.c:1.8
--- src/sys/dev/pci/iwic_dchan.c:1.7	Sat Oct 27 13:18:34 2012
+++ src/sys/dev/pci/iwic_dchan.c	Sat Mar 22 22:53:12 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: iwic_dchan.c,v 1.7 2012/10/27 17:18:34 chs Exp $	*/
+/*	$NetBSD: iwic_dchan.c,v 1.8 2014/03/23 02:53:12 christos Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Dave Boyce. All rights reserved.
@@ -36,7 +36,7 @@
  *---*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: iwic_dchan.c,v 1.7 2012/10/27 17:18:34 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iwic_dchan.c,v 1.8 2014/03/23 02:53:12 christos Exp $");
 
 #include 
 #include 
@@ -352,11 +352,9 @@ dchan_receive(struct iwic_softc *sc, int
 		else
 		{
 			int hi, lo;
-			int total_frame_len;
 
 			lo = IWIC_READ(sc, D_RBCL);
 			hi = IWIC_READ(sc, D_RBCH);
-			total_frame_len = D_RBC(hi, lo);
 			lo = lo & 0x3f;
 
 			if (lo == 0)



CVS commit: src/sys/dev/isa

2014-03-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 23 02:50:51 UTC 2014

Modified Files:
src/sys/dev/isa: isv.c

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/isa/isv.c

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

Modified files:

Index: src/sys/dev/isa/isv.c
diff -u src/sys/dev/isa/isv.c:1.5 src/sys/dev/isa/isv.c:1.6
--- src/sys/dev/isa/isv.c:1.5	Sun Mar 16 01:20:28 2014
+++ src/sys/dev/isa/isv.c	Sat Mar 22 22:50:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: isv.c,v 1.5 2014/03/16 05:20:28 dholland Exp $ */
+/*	$NetBSD: isv.c,v 1.6 2014/03/23 02:50:51 christos Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: isv.c,v 1.5 2014/03/16 05:20:28 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isv.c,v 1.6 2014/03/23 02:50:51 christos Exp $");
 
 #include 
 #include 
@@ -324,7 +324,6 @@ static int
 isv_capture(struct isv_softc *sc)
 {
 	int speed;
-	uint16_t discard;
 	int rc, state = ISV_S_CAPTURE0;
 	struct timeval diff, end, start, stop;
 	static const struct timeval wait = {.tv_sec = 0, .tv_usec = 20};
@@ -372,7 +371,7 @@ isv_capture(struct isv_softc *sc)
 	/* read one dummy word to prime the state machine on the
 	 * image capture board
 	 */
-	discard = isv_read(ir, ISV_DATA);
+	isv_read(ir, ISV_DATA);
 	bus_space_read_multi_stream_2(ir->ir_bt, ir->ir_bh, ISV_DATA,
 	sc->sc_frame, ISV_WIDTH * ISV_LINES / 2);
 



CVS commit: src/sys/dev/pcmcia

2014-03-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 23 02:50:08 UTC 2014

Modified Files:
src/sys/dev/pcmcia: isic_pcmcia_sbspeedstar2.c

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pcmcia/isic_pcmcia_sbspeedstar2.c

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

Modified files:

Index: src/sys/dev/pcmcia/isic_pcmcia_sbspeedstar2.c
diff -u src/sys/dev/pcmcia/isic_pcmcia_sbspeedstar2.c:1.12 src/sys/dev/pcmcia/isic_pcmcia_sbspeedstar2.c:1.13
--- src/sys/dev/pcmcia/isic_pcmcia_sbspeedstar2.c:1.12	Mon Apr 28 16:23:56 2008
+++ src/sys/dev/pcmcia/isic_pcmcia_sbspeedstar2.c	Sat Mar 22 22:50:08 2014
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia_sbspeedstar2.c,v 1.12 2008/04/28 20:23:56 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia_sbspeedstar2.c,v 1.13 2014/03/23 02:50:08 christos Exp $");
 
 #include "opt_isicpcmcia.h"
 #ifdef ISICPCMCIA_SBSPEEDSTAR2
@@ -184,8 +184,6 @@ int
 isic_attach_sbspeedstar2(struct pcmcia_isic_softc *psc, struct pcmcia_config_entry *cfe, struct pcmcia_attach_args *pa)
 {
 	struct isic_softc * sc = &psc->sc_isic;
-	bus_space_tag_t t;
-	bus_space_handle_t h;
 
 	/* Validate config info */
 	if (cfe->num_memspace != 0)
@@ -218,9 +216,6 @@ isic_attach_sbspeedstar2(struct pcmcia_i
 	sc->sc_maps[0].offset = 0;
 	sc->sc_maps[0].size = 0;	/* not our mapping */
 
-	t = sc->sc_maps[0].t;
-	h = sc->sc_maps[0].h;
-
 	/* setup access routines */
 
 	sc->readreg   = sws_read_reg;



CVS commit: src/sys/dev/pcmcia

2014-03-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 23 02:48:41 UTC 2014

Modified Files:
src/sys/dev/pcmcia: isic_pcmcia_elsa_mcall.c

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pcmcia/isic_pcmcia_elsa_mcall.c

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

Modified files:

Index: src/sys/dev/pcmcia/isic_pcmcia_elsa_mcall.c
diff -u src/sys/dev/pcmcia/isic_pcmcia_elsa_mcall.c:1.14 src/sys/dev/pcmcia/isic_pcmcia_elsa_mcall.c:1.15
--- src/sys/dev/pcmcia/isic_pcmcia_elsa_mcall.c:1.14	Mon Apr 28 16:23:56 2008
+++ src/sys/dev/pcmcia/isic_pcmcia_elsa_mcall.c	Sat Mar 22 22:48:41 2014
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia_elsa_mcall.c,v 1.14 2008/04/28 20:23:56 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia_elsa_mcall.c,v 1.15 2014/03/23 02:48:41 christos Exp $");
 
 #include "opt_isicpcmcia.h"
 #ifdef ISICPCMCIA_ELSA_MCALL
@@ -181,8 +181,6 @@ int
 isic_attach_elsamcall(struct pcmcia_isic_softc *psc, struct pcmcia_config_entry *cfe, struct pcmcia_attach_args *pa)
 {
 	struct isic_softc *sc = &psc->sc_isic;
-	bus_space_tag_t t;
-	bus_space_handle_t h;
 
 	/* Validate config info */
 	if (cfe->num_memspace != 0)
@@ -215,9 +213,6 @@ isic_attach_elsamcall(struct pcmcia_isic
 	sc->sc_maps[0].offset = 0;
 	sc->sc_maps[0].size = 0;	/* not our mapping */
 
-	t = sc->sc_maps[0].t;
-	h = sc->sc_maps[0].h;
-
 	sc->clearirq = NULL;
 	sc->readreg = elsa_mcall_read_reg;
 	sc->writereg = elsa_mcall_write_reg;



CVS commit: src/sys/dev/pcmcia

2014-03-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 23 02:47:38 UTC 2014

Modified Files:
src/sys/dev/pcmcia: isic_pcmcia_elsa_isdnmc.c

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/pcmcia/isic_pcmcia_elsa_isdnmc.c

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

Modified files:

Index: src/sys/dev/pcmcia/isic_pcmcia_elsa_isdnmc.c
diff -u src/sys/dev/pcmcia/isic_pcmcia_elsa_isdnmc.c:1.13 src/sys/dev/pcmcia/isic_pcmcia_elsa_isdnmc.c:1.14
--- src/sys/dev/pcmcia/isic_pcmcia_elsa_isdnmc.c:1.13	Mon Apr 28 16:23:56 2008
+++ src/sys/dev/pcmcia/isic_pcmcia_elsa_isdnmc.c	Sat Mar 22 22:47:38 2014
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia_elsa_isdnmc.c,v 1.13 2008/04/28 20:23:56 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isic_pcmcia_elsa_isdnmc.c,v 1.14 2014/03/23 02:47:38 christos Exp $");
 
 #include "opt_isicpcmcia.h"
 #ifdef ISICPCMCIA_ELSA_ISDNMC
@@ -250,8 +250,6 @@ int
 isic_attach_elsaisdnmc(struct pcmcia_isic_softc *psc, struct pcmcia_config_entry *cfe, struct pcmcia_attach_args *pa)
 {
 	struct isic_softc *sc = &psc->sc_isic;
-	bus_space_tag_t t;
-	bus_space_handle_t h;
 
 	/* Validate config info */
 	if (cfe->num_memspace != 0)
@@ -284,9 +282,6 @@ isic_attach_elsaisdnmc(struct pcmcia_isi
 	sc->sc_maps[0].offset = 0;
 	sc->sc_maps[0].size = 0;	/* not our mapping */
 
-	t = sc->sc_maps[0].t;
-	h = sc->sc_maps[0].h;
-
 	sc->clearirq = elsa_isdnmc_clrirq;
 
 	sc->readreg = elsa_isdnmc_read_reg;



CVS commit: src/sys/dev/isa

2014-03-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 23 02:46:55 UTC 2014

Modified Files:
src/sys/dev/isa: isic_isa.c

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/isa/isic_isa.c

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

Modified files:

Index: src/sys/dev/isa/isic_isa.c
diff -u src/sys/dev/isa/isic_isa.c:1.36 src/sys/dev/isa/isic_isa.c:1.37
--- src/sys/dev/isa/isic_isa.c:1.36	Sat Oct 27 13:18:24 2012
+++ src/sys/dev/isa/isic_isa.c	Sat Mar 22 22:46:55 2014
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: isic_isa.c,v 1.36 2012/10/27 17:18:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isic_isa.c,v 1.37 2014/03/23 02:46:55 christos Exp $");
 
 #include 
 #include 
@@ -780,23 +780,11 @@ isic_isa_attach(device_t parent, device_
 	struct isic_softc *sc = device_private(self);
 	struct isa_attach_args *ia = aux;
 	int flags = device_cfdata(self)->cf_flags;
-	int ret = 0, iobase, iosize, maddr, msize;
+	int ret = 0, iobase, maddr;
 	struct isic_attach_args args;
 
-	if (ia->ia_nio > 0) {
-		iobase = ia->ia_io[0].ir_addr;
-		iosize = ia->ia_io[0].ir_size;
-	} else {
-		iobase = ISA_UNKNOWN_PORT;
-		iosize = 0;
-	}
-	if (ia->ia_niomem > 0) {
-		maddr = ia->ia_iomem[0].ir_addr;
-		msize = ia->ia_iomem[0].ir_size;
-	} else {
-		maddr = ISA_UNKNOWN_IOMEM;
-		msize = 0;
-	}
+	iobase = ia->ia_nio > 0 ? ia->ia_io[0].ir_addr : ISA_UNKNOWN_PORT;
+	maddr = ia->ia_niomem > 0 ? ia->ia_iomem[0].ir_addr : ISA_UNKNOWN_IOMEM;
 
 	/* Setup parameters */
 	sc->sc_dev = self;



CVS commit: src/sys/dev/pci

2014-03-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 23 02:45:30 UTC 2014

Modified Files:
src/sys/dev/pci: ifpci2.c

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/ifpci2.c

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

Modified files:

Index: src/sys/dev/pci/ifpci2.c
diff -u src/sys/dev/pci/ifpci2.c:1.20 src/sys/dev/pci/ifpci2.c:1.21
--- src/sys/dev/pci/ifpci2.c:1.20	Sat Oct 27 13:18:34 2012
+++ src/sys/dev/pci/ifpci2.c	Sat Mar 22 22:45:30 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: ifpci2.c,v 1.20 2012/10/27 17:18:34 chs Exp $	*/
+/* $NetBSD: ifpci2.c,v 1.21 2014/03/23 02:45:30 christos Exp $	*/
 /*
  *   Copyright (c) 1999 Gary Jennejohn. All rights reserved.
  *
@@ -36,14 +36,14 @@
  *	Fritz!Card PCI driver
  *	
  *
- *	$Id: ifpci2.c,v 1.20 2012/10/27 17:18:34 chs Exp $
+ *	$Id: ifpci2.c,v 1.21 2014/03/23 02:45:30 christos Exp $
  *
  *  last edit-date: [Fri Jan  5 11:38:58 2001]
  *
  *---*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ifpci2.c,v 1.20 2012/10/27 17:18:34 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ifpci2.c,v 1.21 2014/03/23 02:45:30 christos Exp $");
 
 
 #include 
@@ -249,7 +249,6 @@ ifpci2_attach(device_t parent, device_t 
 	struct pci_attach_args *pa = aux;
 	struct isic_softc *sc = &psc->sc_isic;
 	struct isdn_l3_driver *drv;
-	u_int v;
 
 	sc->sc_dev = self;
 
@@ -297,7 +296,7 @@ ifpci2_attach(device_t parent, device_t 
 
 	/* init the card */
 
-	v = bus_space_read_4(sc->sc_maps[0].t, sc->sc_maps[0].h, 0);
+	bus_space_read_4(sc->sc_maps[0].t, sc->sc_maps[0].h, 0);
 	bus_space_write_1(sc->sc_maps[0].t, sc->sc_maps[0].h, STAT0_OFFSET, 0);
 	DELAY(SEC_DELAY/20); /* 50 ms */
 	bus_space_write_1(sc->sc_maps[0].t, sc->sc_maps[0].h, STAT0_OFFSET, ASL_RESET);
@@ -318,7 +317,7 @@ ifpci2_attach(device_t parent, device_t 
 	/* init the ISAC */
 	isic_isacsx_init(sc);
 
-	v = ISAC_READ(I_CIR0); /* Leo: reset generates status change */
+	ISAC_READ(I_CIR0); /* Leo: reset generates status change */
 
 	/* init the "HSCX" */
 	avma1pp2_bchannel_setup(sc, HSCX_CH_A, BPROT_NONE, 0);



CVS commit: src/sys/dev/isa

2014-03-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 23 02:45:02 UTC 2014

Modified Files:
src/sys/dev/isa: if_ntwoc_isa.c

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/isa/if_ntwoc_isa.c

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

Modified files:

Index: src/sys/dev/isa/if_ntwoc_isa.c
diff -u src/sys/dev/isa/if_ntwoc_isa.c:1.24 src/sys/dev/isa/if_ntwoc_isa.c:1.25
--- src/sys/dev/isa/if_ntwoc_isa.c:1.24	Sat Oct 27 13:18:24 2012
+++ src/sys/dev/isa/if_ntwoc_isa.c	Sat Mar 22 22:45:02 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ntwoc_isa.c,v 1.24 2012/10/27 17:18:24 chs Exp $	*/
+/*	$NetBSD: if_ntwoc_isa.c,v 1.25 2014/03/23 02:45:02 christos Exp $	*/
 /*
  * Copyright (c) 1999 Christian E. Hopps
  * Copyright (c) 1996 John Hay.
@@ -29,11 +29,11 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: if_ntwoc_isa.c,v 1.24 2012/10/27 17:18:24 chs Exp $
+ * $Id: if_ntwoc_isa.c,v 1.25 2014/03/23 02:45:02 christos Exp $
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ntwoc_isa.c,v 1.24 2012/10/27 17:18:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ntwoc_isa.c,v 1.25 2014/03/23 02:45:02 christos Exp $");
 
 #include 
 #include 
@@ -191,7 +191,7 @@ ntwoc_isa_probe(device_t parent, cfdata_
 	struct isa_attach_args *ia;
 	bus_space_tag_t iot, memt;
 	bus_space_handle_t ioh, memh, sca_ioh[16];
-	int i, tmp, dbg, rv;
+	int i, tmp, rv;
 	int gotmem, gotsca[16];
 	u_int32_t ioport;
 
@@ -211,7 +211,6 @@ ntwoc_isa_probe(device_t parent, cfdata_
 
 	memset(gotsca, 0, sizeof(gotsca));
 	gotmem = rv = 0;
-	dbg = 0;
 
 	/* disallow wildcarded I/O base */
 	if (ia->ia_io[0].ir_addr == ISA_UNKNOWN_PORT) {
@@ -390,13 +389,12 @@ ntwoc_isa_attach(device_t parent, device
 	u_int8_t rdiv, tdiv, tmc;
 	u_int32_t flags, ioport;
 	u_int16_t tmp;
-	int i, dbg, pgs, rv;
+	int i, pgs, rv;
 
 	ia = (struct isa_attach_args *)aux;
 	sc = device_private(self);
 	sc->sc_dev = self;
 	sca = &sc->sc_sca;
-	dbg = 0;
 
 	printf(": N2 Serial Interface\n");
 	flags = device_cfdata(sc->sc_dev)->cf_flags;



CVS commit: src/sys/dev/ic

2014-03-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 23 02:44:19 UTC 2014

Modified Files:
src/sys/dev/ic: iavc.c

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/ic/iavc.c

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

Modified files:

Index: src/sys/dev/ic/iavc.c
diff -u src/sys/dev/ic/iavc.c:1.11 src/sys/dev/ic/iavc.c:1.12
--- src/sys/dev/ic/iavc.c:1.11	Sat Mar 22 22:44:00 2014
+++ src/sys/dev/ic/iavc.c	Sat Mar 22 22:44:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: iavc.c,v 1.11 2014/03/23 02:44:00 christos Exp $	*/
+/*	$NetBSD: iavc.c,v 1.12 2014/03/23 02:44:19 christos Exp $	*/
 
 /*
  * Copyright (c) 2001-2003 Cubical Solutions Ltd. All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: iavc.c,v 1.11 2014/03/23 02:44:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iavc.c,v 1.12 2014/03/23 02:44:19 christos Exp $");
 
 #include 
 #include 
@@ -738,7 +738,6 @@ static int iavc_receive_debugmsg(iavc_so
 	amcc_get_word(dmabuf, &Length);
 } else {
 	Length = iavc_get_slice(sc, sc->sc_recvbuf);
-	sc->sc_recvbuf;
 }
 
 /* XXX could show the message if trace enabled? XXX */



CVS commit: src/sys/dev/ic

2014-03-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 23 02:44:00 UTC 2014

Modified Files:
src/sys/dev/ic: iavc.c

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/ic/iavc.c

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

Modified files:

Index: src/sys/dev/ic/iavc.c
diff -u src/sys/dev/ic/iavc.c:1.10 src/sys/dev/ic/iavc.c:1.11
--- src/sys/dev/ic/iavc.c:1.10	Wed May 29 05:26:02 2013
+++ src/sys/dev/ic/iavc.c	Sat Mar 22 22:44:00 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: iavc.c,v 1.10 2013/05/29 09:26:02 martin Exp $	*/
+/*	$NetBSD: iavc.c,v 1.11 2014/03/23 02:44:00 christos Exp $	*/
 
 /*
  * Copyright (c) 2001-2003 Cubical Solutions Ltd. All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: iavc.c,v 1.10 2013/05/29 09:26:02 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iavc.c,v 1.11 2014/03/23 02:44:00 christos Exp $");
 
 #include 
 #include 
@@ -732,14 +732,13 @@ static int iavc_receive_task_ready(iavc_
 static int iavc_receive_debugmsg(iavc_softc_t *sc, u_int8_t *dmabuf)
 {
 u_int32_t Length;
-u_int8_t *p;
 printf("%s: receive_debugmsg\n", device_xname(sc->sc_dev));
 
 if (sc->sc_dma) {
-	p = amcc_get_word(dmabuf, &Length);
+	amcc_get_word(dmabuf, &Length);
 } else {
 	Length = iavc_get_slice(sc, sc->sc_recvbuf);
-	p = sc->sc_recvbuf;
+	sc->sc_recvbuf;
 }
 
 /* XXX could show the message if trace enabled? XXX */



CVS commit: src/external/historical/nawk/bin

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Mar 23 01:29:12 UTC 2014

Modified Files:
src/external/historical/nawk/bin: awk.1

Log Message:
Change the argument names in the prototypes and discussion for
sub/gsub to match those in gensub. Noted by Kai-Uwe Eckhardt in
PR 48667.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/historical/nawk/bin/awk.1

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

Modified files:

Index: src/external/historical/nawk/bin/awk.1
diff -u src/external/historical/nawk/bin/awk.1:1.2 src/external/historical/nawk/bin/awk.1:1.3
--- src/external/historical/nawk/bin/awk.1:1.2	Wed Apr 20 10:10:32 2011
+++ src/external/historical/nawk/bin/awk.1	Sun Mar 23 01:29:12 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: awk.1,v 1.2 2011/04/20 10:10:32 drochner Exp $
+.\"	$NetBSD: awk.1,v 1.3 2014/03/23 01:29:12 dholland Exp $
 .\"
 .\" Copyright (C) Lucent Technologies 1997
 .\" All Rights Reserved
@@ -419,8 +419,8 @@ supported by GNU
 are
 .Em not
 supported at this moment.
-.It Fn gsub r t "[s]"
-same as
+.It Fn gsub r s "[t]"
+Same as
 .Fn sub
 except that all occurrences of the regular expression
 are replaced;
@@ -477,13 +477,13 @@ according to the
 .Xr printf 3
 format
 .Ar fmt .
-.It Fn sub r t "[s]"
+.It Fn sub r s "[t]"
 substitutes
-.Ar t
+.Ar s
 for the first occurrence of the regular expression
 .Ar r
-in the string
-.Ar s .
+in the target string
+.Ar t .
 If
 .Ar s
 is not given,



CVS commit: src/share/man/man4

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Mar 23 00:50:20 UTC 2014

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

Log Message:
Fix the heading for ext2fs options to be consistent with the others.


To generate a diff of this commit:
cvs rdiff -u -r1.436 -r1.437 src/share/man/man4/options.4

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

Modified files:

Index: src/share/man/man4/options.4
diff -u src/share/man/man4/options.4:1.436 src/share/man/man4/options.4:1.437
--- src/share/man/man4/options.4:1.436	Sun Mar 23 00:48:08 2014
+++ src/share/man/man4/options.4	Sun Mar 23 00:50:20 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: options.4,v 1.436 2014/03/23 00:48:08 dholland Exp $
+.\"	$NetBSD: options.4,v 1.437 2014/03/23 00:50:20 dholland Exp $
 .\"
 .\" Copyright (c) 1996
 .\" 	Perry E. Metzger.  All rights reserved.
@@ -1056,7 +1056,7 @@ created for another architecture.
 Increase lookup performance by maintaining in-core hash tables
 for large directories.
 .El
-.Ss Options for ext2fs File Systems
+.Ss Options for the ext2fs File System
 .Bl -ohang
 .It Cd options EXT2FS_SYSTEM_FLAGS
 This option changes the behavior of the APPEND and IMMUTABLE flags



CVS commit: src/share/man/man4

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Mar 23 00:48:08 UTC 2014

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

Log Message:
Revise documentation of QUOTA and QUOTA2 options to make it clear that
these are FFS options. (QUOTA2 also works with mfs. AFAIK, traditional
quotas don't.)

Don't refer to QUOTA2 as "the new quotas format" as "new" is not a
good long-term identifier.

Also, don't xref half the quota utilities; there's no need to.


To generate a diff of this commit:
cvs rdiff -u -r1.435 -r1.436 src/share/man/man4/options.4

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

Modified files:

Index: src/share/man/man4/options.4
diff -u src/share/man/man4/options.4:1.435 src/share/man/man4/options.4:1.436
--- src/share/man/man4/options.4:1.435	Sat Mar 22 07:49:06 2014
+++ src/share/man/man4/options.4	Sun Mar 23 00:48:08 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: options.4,v 1.435 2014/03/22 07:49:06 skrll Exp $
+.\"	$NetBSD: options.4,v 1.436 2014/03/23 00:48:08 dholland Exp $
 .\"
 .\" Copyright (c) 1996
 .\" 	Perry E. Metzger.  All rights reserved.
@@ -992,34 +992,25 @@ It also provides better general use perf
 See also
 .Xr wapbl 4 .
 .It Cd options QUOTA
-Enables kernel support for file system quotas.
-See
-.Xr quotaon 8 ,
-.Xr edquota 8 ,
-and
-.Xr quota 1
-for details.
-Note that quotas only work on
-.Dq ffs
-file systems, although
-.Xr rpc.rquotad 8
-permits them to be accessed over
-.Em NFS .
+Enables kernel support for traditional quotas in FFS.
+Traditional quotas store the quota information in external files and
+require
+.Xr quotacheck 8
+and
+.Xr quotaon 8
+at boot time.
+Traditional quotas are limited to 32-bit sizes and are at this point
+considered a legacy feature.
 .It Cd options QUOTA2
-Enables kernel support for the new file system quotas format.
-See
-.Xr tunefs 8 ,
-.Xr newfs 8 ,
-.Xr mount_mfs 8 ,
-.Xr edquota 8 ,
-and
-.Xr quota 1
-for details.
-Note that quota2 is only supported by
-.Dq ffs
-and
-.Dq mfs
-file systems at this time.
+Enables kernel support for in-volume quotas in FFS.
+The quota information is file system metadata maintained by
+.Xr fsck 8
+and/or WAPBL journaling.
+MFS volumes can also use
+.Dv QUOTA2
+quotas; see
+.Xr mount_mfs 8
+for more information.
 .It Cd options FFS_EI
 Enable
 .Dq Endian-Independent



CVS commit: src/games

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Mar 23 00:17:40 UTC 2014

Modified Files:
src/games: Makefile.inc

Log Message:
Add note cautioning against bothering with WARNS=6 until gcc improves
(or -Wconversion is removed from WARNS=6) as it produces loads of false
positives. The most entertaining of these that I've seen this afternoon:

games/hack/hack.apply.c:143:22: error: conversion to 'unsigned char:1' from 
'int' may alter its value [-Werror=conversion]
   flags.move = multi = 0;
  ^


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/games/Makefile.inc

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

Modified files:

Index: src/games/Makefile.inc
diff -u src/games/Makefile.inc:1.15 src/games/Makefile.inc:1.16
--- src/games/Makefile.inc:1.15	Tue Jun 19 05:46:08 2012
+++ src/games/Makefile.inc	Sun Mar 23 00:17:40 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.15 2012/06/19 05:46:08 dholland Exp $
+#	$NetBSD: Makefile.inc,v 1.16 2014/03/23 00:17:40 dholland Exp $
 #	@(#)Makefile.inc	8.1 (Berkeley) 5/31/93
 
 MKHIDEGAME?=	no
@@ -20,4 +20,7 @@ BINGRP=		games
 BINMODE=	2555
 .endif
 .endif
+# Note: do not bother with WARNS=6 until -Wconversion is either
+# removed from WARNS=6 or rendered useful by improving gcc; as it is
+# (with gcc48) it produces buckets of drivel.
 WARNS?=		5



CVS commit: src/games/number

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Mar 23 00:03:05 UTC 2014

Modified Files:
src/games/number: number.c

Log Message:
gratuitous (but not harmful) changes to pass gcc48's -Wconversion


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/games/number/number.c

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

Modified files:

Index: src/games/number/number.c
diff -u src/games/number/number.c:1.15 src/games/number/number.c:1.16
--- src/games/number/number.c:1.15	Tue Jun 19 05:46:09 2012
+++ src/games/number/number.c	Sun Mar 23 00:03:04 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: number.c,v 1.15 2012/06/19 05:46:09 dholland Exp $	*/
+/*	$NetBSD: number.c,v 1.16 2014/03/23 00:03:04 dholland Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)number.c	8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: number.c,v 1.15 2012/06/19 05:46:09 dholland Exp $");
+__RCSID("$NetBSD: number.c,v 1.16 2014/03/23 00:03:04 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -78,9 +78,9 @@ static const char	*const name1[] = {
 
 int	main(int, char *[]);
 static void convert(char *);
-static int number(const char *, int);
-static void pfract(int);
-static int unit(int, const char *);
+static int number(const char *, size_t);
+static void pfract(size_t);
+static int unit(size_t, const char *);
 static void usage(void) __dead;
 
 static int lflag;
@@ -125,7 +125,8 @@ main(int argc, char *argv[])
 void
 convert(char *line)
 {
-	int flen, len, rval;
+	size_t flen, len;
+	int rval;
 	char *p, *fraction;
 
 	flen = 0;
@@ -191,9 +192,10 @@ badnum:			errx(1, "illegal number: %s", 
 }
 
 int
-unit(int len, const char *p)
+unit(size_t len, const char *p)
 {
-	int off, rval;
+	size_t off;
+	int rval;
 
 	rval = 0;
 	if (len > 3) {
@@ -225,7 +227,7 @@ unit(int len, const char *p)
 }
 
 int
-number(const char *p, int len)
+number(const char *p, size_t len)
 {
 	int val, rval;
 
@@ -263,7 +265,7 @@ number(const char *p, int len)
 }
 
 void
-pfract(int len)
+pfract(size_t len)
 {
 	static const char *const pref[] = { "", "ten-", "hundred-" };
 



CVS commit: src/games/quiz

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Mar 23 00:07:15 UTC 2014

Modified Files:
src/games/quiz: quiz.c

Log Message:
fix signedness issue


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/games/quiz/quiz.c

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

Modified files:

Index: src/games/quiz/quiz.c
diff -u src/games/quiz/quiz.c:1.26 src/games/quiz/quiz.c:1.27
--- src/games/quiz/quiz.c:1.26	Thu Aug 27 00:31:12 2009
+++ src/games/quiz/quiz.c	Sun Mar 23 00:07:15 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: quiz.c,v 1.26 2009/08/27 00:31:12 dholland Exp $	*/
+/*	$NetBSD: quiz.c,v 1.27 2014/03/23 00:07:15 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)quiz.c	8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: quiz.c,v 1.26 2009/08/27 00:31:12 dholland Exp $");
+__RCSID("$NetBSD: quiz.c,v 1.27 2014/03/23 00:07:15 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -226,7 +226,7 @@ quiz(void)
 	int i;
 	size_t len;
 	unsigned guesses, rights, wrongs;
-	int next;
+	unsigned next, j;
 	char *answer, *t, question[LINE_SZ];
 	const char *s;
 
@@ -237,7 +237,7 @@ quiz(void)
 			break;
 		next = random() % qsize;
 		qp = qlist.q_next;
-		for (i = 0; i < next; i++)
+		for (j = 0; j < next; j++)
 			qp = qp->q_next;
 		while (qp && qp->q_answered)
 			qp = qp->q_next;



CVS commit: src/games/canfield/canfield

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 22 23:47:03 UTC 2014

Modified Files:
src/games/canfield/canfield: canfield.c

Log Message:
Use ssize_t for read() results. Don't use int for lseek() results.
Call srandom() with time(), not getpid().


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/games/canfield/canfield/canfield.c

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

Modified files:

Index: src/games/canfield/canfield/canfield.c
diff -u src/games/canfield/canfield/canfield.c:1.29 src/games/canfield/canfield/canfield.c:1.30
--- src/games/canfield/canfield/canfield.c:1.29	Sat Mar 22 23:42:48 2014
+++ src/games/canfield/canfield/canfield.c	Sat Mar 22 23:47:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: canfield.c,v 1.29 2014/03/22 23:42:48 dholland Exp $	*/
+/*	$NetBSD: canfield.c,v 1.30 2014/03/22 23:47:03 dholland Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)canfield.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: canfield.c,v 1.29 2014/03/22 23:42:48 dholland Exp $");
+__RCSID("$NetBSD: canfield.c,v 1.30 2014/03/22 23:47:03 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -1637,9 +1637,9 @@ instruct(void)
 static void
 initall(void)
 {
-	int i;
+	ssize_t i;
 
-	srandom(getpid());
+	srandom(time(NULL));
 	time(&acctstart);
 	initdeck(deck);
 	uid = getuid();
@@ -1652,8 +1652,7 @@ initall(void)
 		return;
 	if (dbfd < 3)
 		exit(1);
-	i = lseek(dbfd, uid * sizeof(struct betinfo), SEEK_SET);
-	if (i < 0) {
+	if (lseek(dbfd, uid * sizeof(struct betinfo), SEEK_SET) < 0) {
 		close(dbfd);
 		dbfd = -1;
 		return;



CVS commit: src/games/canfield/cfscores

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 22 23:45:34 UTC 2014

Modified Files:
src/games/canfield/cfscores: cfscores.c

Log Message:
Use ssize_t for read() results. Don't use int for lseek() results.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/games/canfield/cfscores/cfscores.c

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

Modified files:

Index: src/games/canfield/cfscores/cfscores.c
diff -u src/games/canfield/cfscores/cfscores.c:1.21 src/games/canfield/cfscores/cfscores.c:1.22
--- src/games/canfield/cfscores/cfscores.c:1.21	Sun Jan  3 17:08:45 2010
+++ src/games/canfield/cfscores/cfscores.c	Sat Mar 22 23:45:34 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cfscores.c,v 1.21 2010/01/03 17:08:45 dholland Exp $	*/
+/*	$NetBSD: cfscores.c,v 1.22 2014/03/22 23:45:34 dholland Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)cfscores.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: cfscores.c,v 1.21 2010/01/03 17:08:45 dholland Exp $");
+__RCSID("$NetBSD: cfscores.c,v 1.22 2014/03/22 23:45:34 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -106,7 +106,7 @@ printuser(const struct passwd *pw, int p
 {
 	struct betinfo total;
 	off_t pos;
-	int i;
+	ssize_t i;
 
 	pos = pw->pw_uid * (off_t)sizeof(struct betinfo);
 	/* test pos, not pw_uid; uid_t can be unsigned, which makes gcc warn */
@@ -114,9 +114,9 @@ printuser(const struct passwd *pw, int p
 		warnx("Bad uid %d", (int)pw->pw_uid);
 		return;
 	}
-	i = lseek(dbfd, pos, SEEK_SET);
-	if (i < 0)
-		warn("lseek %s", _PATH_SCORE);
+	if (lseek(dbfd, pos, SEEK_SET) < 0) {
+		warn("%s: lseek", _PATH_SCORE);
+	}
 	i = read(dbfd, &total, sizeof(total));
 	if (i < 0)
 		warn("read %s", _PATH_SCORE);



CVS commit: src/games/canfield/canfield

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 22 23:42:48 UTC 2014

Modified Files:
src/games/canfield/canfield: canfield.c

Log Message:
Use uid_t to hold getuid() results, and don't check getuid for failure
as it isn't allowed to fail.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/games/canfield/canfield/canfield.c

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

Modified files:

Index: src/games/canfield/canfield/canfield.c
diff -u src/games/canfield/canfield/canfield.c:1.28 src/games/canfield/canfield/canfield.c:1.29
--- src/games/canfield/canfield/canfield.c:1.28	Mon May 23 22:46:35 2011
+++ src/games/canfield/canfield/canfield.c	Sat Mar 22 23:42:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: canfield.c,v 1.28 2011/05/23 22:46:35 joerg Exp $	*/
+/*	$NetBSD: canfield.c,v 1.29 2014/03/22 23:42:48 dholland Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)canfield.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: canfield.c,v 1.28 2011/05/23 22:46:35 joerg Exp $");
+__RCSID("$NetBSD: canfield.c,v 1.29 2014/03/22 23:42:48 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -168,7 +168,7 @@ static bool mtfdone, Cflag = FALSE;
 #define BETTINGBOX	2
 #define NOBOX		3
 static int status = INSTRUCTIONBOX;
-static int uid;
+static uid_t uid;
 
 /*
  * Basic betting costs
@@ -1643,8 +1643,6 @@ initall(void)
 	time(&acctstart);
 	initdeck(deck);
 	uid = getuid();
-	if (uid < 0)
-		uid = 0;
 	dbfd = open(_PATH_SCORE, O_RDWR);
 
 	/* Revoke setgid privileges */



CVS commit: src/games/boggle/boggle

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 22 23:39:04 UTC 2014

Modified Files:
src/games/boggle/boggle: bog.c

Log Message:
use size_t instead of int for a length


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/games/boggle/boggle/bog.c

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

Modified files:

Index: src/games/boggle/boggle/bog.c
diff -u src/games/boggle/boggle/bog.c:1.28 src/games/boggle/boggle/bog.c:1.29
--- src/games/boggle/boggle/bog.c:1.28	Sat Oct 13 20:12:18 2012
+++ src/games/boggle/boggle/bog.c	Sat Mar 22 23:39:04 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bog.c,v 1.28 2012/10/13 20:12:18 dholland Exp $	*/
+/*	$NetBSD: bog.c,v 1.29 2014/03/22 23:39:04 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\
 #if 0
 static char sccsid[] = "@(#)bog.c	8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: bog.c,v 1.28 2012/10/13 20:12:18 dholland Exp $");
+__RCSID("$NetBSD: bog.c,v 1.29 2014/03/22 23:39:04 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -377,7 +377,7 @@ playgame(void)
 			else if (!validword(buf))
 badword();
 			else {
-int len;
+size_t len;
 
 len = strlen(buf) + 1;
 if (npwords == MAXPWORDS - 1 ||



CVS commit: src/games/battlestar

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 22 23:33:33 UTC 2014

Modified Files:
src/games/battlestar: extern.h init.c

Log Message:
Use random(), not rand().


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/games/battlestar/extern.h
cvs rdiff -u -r1.15 -r1.16 src/games/battlestar/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/games/battlestar/extern.h
diff -u src/games/battlestar/extern.h:1.35 src/games/battlestar/extern.h:1.36
--- src/games/battlestar/extern.h:1.35	Sat Mar 22 23:23:55 2014
+++ src/games/battlestar/extern.h	Sat Mar 22 23:33:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.35 2014/03/22 23:23:55 dholland Exp $ */
+/*	$NetBSD: extern.h,v 1.36 2014/03/22 23:33:33 dholland Exp $ */
 
 /*
  * Copyright (c) 1983, 1993
@@ -45,7 +45,7 @@
 #define BITS (CHAR_BIT * sizeof (unsigned int))
 
 #define OUTSIDE		(position > 68 && position < 246 && position != 218)
-#define rnd(x)		(rand() % (x))
+#define rnd(x)		(random() % (x))
 #define max(a,b)	((a) < (b) ? (b) : (a))
 #define testbit(array, index)	(array[index/BITS] & (1U << (index % BITS)))
 #define setbit(array, index)	(array[index/BITS] |= (1U << (index % BITS)))

Index: src/games/battlestar/init.c
diff -u src/games/battlestar/init.c:1.15 src/games/battlestar/init.c:1.16
--- src/games/battlestar/init.c:1.15	Fri Jul  1 06:04:54 2005
+++ src/games/battlestar/init.c	Sat Mar 22 23:33:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.15 2005/07/01 06:04:54 jmc Exp $	*/
+/*	$NetBSD: init.c,v 1.16 2014/03/22 23:33:33 dholland Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)init.c	8.4 (Berkeley) 4/30/95";
 #else
-__RCSID("$NetBSD: init.c,v 1.15 2005/07/01 06:04:54 jmc Exp $");
+__RCSID("$NetBSD: init.c,v 1.16 2014/03/22 23:33:33 dholland Exp $");
 #endif
 #endif/* not lint */
 
@@ -54,7 +54,7 @@ initialize(const char *filename)
 	puts("First Adventure game written by His Lordship, the honorable");
 	puts("Admiral D.W. Riggle\n");
 	location = dayfile;
-	srand(getpid());
+	srandom(time(NULL));
 	username = getutmp();
 	wordinit();
 	if (filename == NULL) {



CVS commit: src/games/battlestar

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 22 23:31:28 UTC 2014

Modified Files:
src/games/battlestar: command5.c

Log Message:
avoid unnecessary floating point ops


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/games/battlestar/command5.c

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

Modified files:

Index: src/games/battlestar/command5.c
diff -u src/games/battlestar/command5.c:1.4 src/games/battlestar/command5.c:1.5
--- src/games/battlestar/command5.c:1.4	Tue Jun 19 05:46:08 2012
+++ src/games/battlestar/command5.c	Sat Mar 22 23:31:28 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: command5.c,v 1.4 2012/06/19 05:46:08 dholland Exp $	*/
+/*	$NetBSD: command5.c,v 1.5 2014/03/22 23:31:28 dholland Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)com5.c	8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: command5.c,v 1.4 2012/06/19 05:46:08 dholland Exp $");
+__RCSID("$NetBSD: command5.c,v 1.5 2014/03/22 23:31:28 dholland Exp $");
 #endif
 #endif/* not lint */
 
@@ -186,10 +186,13 @@ zzz(void)
 {
 	int oldtime;
 	int n;
+	int zzztime;
+
+	zzztime = (3 * CYCLE) / 4;
 
 	oldtime = ourtime;
-	if ((snooze - ourtime) < (0.75 * CYCLE)) {
-		ourtime += 0.75 * CYCLE - (snooze - ourtime);
+	if ((snooze - ourtime) < zzztime) {
+		ourtime += zzztime - (snooze - ourtime);
 		printf("");
 		for (n = 0; n < ourtime - oldtime; n++)
 			printf(".");



CVS commit: src/games/battlestar

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 22 23:23:55 UTC 2014

Modified Files:
src/games/battlestar: extern.h

Log Message:
avoid signed left-shift


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/games/battlestar/extern.h

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

Modified files:

Index: src/games/battlestar/extern.h
diff -u src/games/battlestar/extern.h:1.34 src/games/battlestar/extern.h:1.35
--- src/games/battlestar/extern.h:1.34	Sat Mar 22 23:16:21 2014
+++ src/games/battlestar/extern.h	Sat Mar 22 23:23:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.34 2014/03/22 23:16:21 dholland Exp $ */
+/*	$NetBSD: extern.h,v 1.35 2014/03/22 23:23:55 dholland Exp $ */
 
 /*
  * Copyright (c) 1983, 1993
@@ -42,14 +42,14 @@
 #include 
 #include 
 
-#define BITS (CHAR_BIT * sizeof (int))
+#define BITS (CHAR_BIT * sizeof (unsigned int))
 
 #define OUTSIDE		(position > 68 && position < 246 && position != 218)
 #define rnd(x)		(rand() % (x))
 #define max(a,b)	((a) < (b) ? (b) : (a))
-#define testbit(array, index)	(array[index/BITS] & (1 << (index % BITS)))
-#define setbit(array, index)	(array[index/BITS] |= (1 << (index % BITS)))
-#define clearbit(array, index)	(array[index/BITS] &= ~(1 << (index % BITS)))
+#define testbit(array, index)	(array[index/BITS] & (1U << (index % BITS)))
+#define setbit(array, index)	(array[index/BITS] |= (1U << (index % BITS)))
+#define clearbit(array, index)	(array[index/BITS] &= ~(1U << (index % BITS)))
 
  /* well known rooms */
 #define FINAL	275



CVS commit: src/games/battlestar

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 22 23:16:21 UTC 2014

Modified Files:
src/games/battlestar: extern.h

Log Message:
Use CHAR_BIT, not 8.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/games/battlestar/extern.h

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

Modified files:

Index: src/games/battlestar/extern.h
diff -u src/games/battlestar/extern.h:1.33 src/games/battlestar/extern.h:1.34
--- src/games/battlestar/extern.h:1.33	Fri Aug 26 06:18:17 2011
+++ src/games/battlestar/extern.h	Sat Mar 22 23:16:21 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.33 2011/08/26 06:18:17 dholland Exp $ */
+/*	$NetBSD: extern.h,v 1.34 2014/03/22 23:16:21 dholland Exp $ */
 
 /*
  * Copyright (c) 1983, 1993
@@ -38,10 +38,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
-#define BITS (8 * sizeof (int))
+#define BITS (CHAR_BIT * sizeof (int))
 
 #define OUTSIDE		(position > 68 && position < 246 && position != 218)
 #define rnd(x)		(rand() % (x))



CVS commit: src/games/backgammon/backgammon

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 22 23:10:36 UTC 2014

Modified Files:
src/games/backgammon/backgammon: main.c

Log Message:
don't declare ospeed; it's in 


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/games/backgammon/backgammon/main.c

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

Modified files:

Index: src/games/backgammon/backgammon/main.c
diff -u src/games/backgammon/backgammon/main.c:1.31 src/games/backgammon/backgammon/main.c:1.32
--- src/games/backgammon/backgammon/main.c:1.31	Sat Oct 13 19:25:22 2012
+++ src/games/backgammon/backgammon/main.c	Sat Mar 22 23:10:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.31 2012/10/13 19:25:22 dholland Exp $	*/
+/*	$NetBSD: main.c,v 1.32 2014/03/22 23:10:36 dholland Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)main.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: main.c,v 1.31 2012/10/13 19:25:22 dholland Exp $");
+__RCSID("$NetBSD: main.c,v 1.32 2014/03/22 23:10:36 dholland Exp $");
 #endif
 #endif/* not lint */
 
@@ -52,7 +52,6 @@ __RCSID("$NetBSD: main.c,v 1.31 2012/10/
 
 extern const char   *const instr[];		/* text of instructions */
 extern const char   *const message[];		/* update message */
-extern short ospeed;			/* tty output speed */
 
 static const char *const helpm[] = {		/* help message */
 	"Enter a space or newline to roll, or",



CVS commit: src/games/atc

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 22 22:58:56 UTC 2014

Modified Files:
src/games/atc: def.h extern.h input.c main.c struct.h update.c

Log Message:
Make the list of place types an enumeration. Use unsigned values for
place numbers.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/games/atc/def.h
cvs rdiff -u -r1.16 -r1.17 src/games/atc/extern.h
cvs rdiff -u -r1.27 -r1.28 src/games/atc/input.c
cvs rdiff -u -r1.21 -r1.22 src/games/atc/main.c
cvs rdiff -u -r1.9 -r1.10 src/games/atc/struct.h
cvs rdiff -u -r1.24 -r1.25 src/games/atc/update.c

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

Modified files:

Index: src/games/atc/def.h
diff -u src/games/atc/def.h:1.6 src/games/atc/def.h:1.7
--- src/games/atc/def.h:1.6	Thu Aug  7 09:36:53 2003
+++ src/games/atc/def.h	Sat Mar 22 22:58:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: def.h,v 1.6 2003/08/07 09:36:53 agc Exp $	*/
+/*	$NetBSD: def.h,v 1.7 2014/03/22 22:58:56 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -65,11 +65,6 @@
 #define D_UP		3
 #define D_DOWN		4
 
-#define T_NODEST	0
-#define T_BEACON	1
-#define T_EXIT		2
-#define T_AIRPORT	3
-
 #undef S_NONE
 #undef S_GONE
 #undef S_MARKED

Index: src/games/atc/extern.h
diff -u src/games/atc/extern.h:1.16 src/games/atc/extern.h:1.17
--- src/games/atc/extern.h:1.16	Wed Aug 12 04:48:03 2009
+++ src/games/atc/extern.h	Sat Mar 22 22:58:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.16 2009/08/12 04:48:03 dholland Exp $	*/
+/*	$NetBSD: extern.h,v 1.17 2014/03/22 22:58:56 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -61,7 +61,7 @@ extern struct termios	tty_start, tty_new
 
 extern DISPLACEMENT	displacement[MAXDIR];
 
-int		addplane(void);
+void		addplane(void);
 void		append(LIST *, PLANE *);
 void		check_adir(int, int, int);
 void		delete(LIST *, PLANE *);

Index: src/games/atc/input.c
diff -u src/games/atc/input.c:1.27 src/games/atc/input.c:1.28
--- src/games/atc/input.c:1.27	Sat Mar 22 22:47:07 2014
+++ src/games/atc/input.c	Sat Mar 22 22:58:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: input.c,v 1.27 2014/03/22 22:47:07 dholland Exp $	*/
+/*	$NetBSD: input.c,v 1.28 2014/03/22 22:58:56 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)input.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: input.c,v 1.27 2014/03/22 22:47:07 dholland Exp $");
+__RCSID("$NetBSD: input.c,v 1.28 2014/03/22 22:58:56 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -199,7 +199,8 @@ static PLANE p;
 static STACK stack[MAXDEPTH];
 static int level;
 static int tval;
-static int dest_type, dir;
+static int dir;
+static enum places dest_type;
 static unsigned dest_no;
 
 static int

Index: src/games/atc/main.c
diff -u src/games/atc/main.c:1.21 src/games/atc/main.c:1.22
--- src/games/atc/main.c:1.21	Fri Oct 12 10:44:20 2012
+++ src/games/atc/main.c	Sat Mar 22 22:58:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.21 2012/10/12 10:44:20 dholland Exp $	*/
+/*	$NetBSD: main.c,v 1.22 2014/03/22 22:58:56 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -51,7 +51,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 19
 #if 0
 static char sccsid[] = "@(#)main.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: main.c,v 1.21 2012/10/12 10:44:20 dholland Exp $");
+__RCSID("$NetBSD: main.c,v 1.22 2014/03/22 22:58:56 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -144,7 +144,7 @@ main(int argc, char *argv[])
 	init_gr();
 	setup_screen(sp);
 
-	(void)addplane();
+	addplane();
 
 	(void)signal(SIGINT, quit);
 	(void)signal(SIGQUIT, quit);

Index: src/games/atc/struct.h
diff -u src/games/atc/struct.h:1.9 src/games/atc/struct.h:1.10
--- src/games/atc/struct.h:1.9	Sat Mar 22 22:45:05 2014
+++ src/games/atc/struct.h	Sat Mar 22 22:58:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: struct.h,v 1.9 2014/03/22 22:45:05 dholland Exp $	*/
+/*	$NetBSD: struct.h,v 1.10 2014/03/22 22:58:56 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -72,15 +72,22 @@ typedef struct {
 	AIRPORT	*airport;
 } C_SCREEN;
 
+enum places {
+	T_NODEST = 0,
+	T_BEACON = 1,
+	T_EXIT = 2,
+	T_AIRPORT = 3
+};
+
 typedef struct plane {
 	struct plane	*next, *prev;
 	int		status;
 	int		plane_no;
 	int		plane_type;
-	int		orig_no;
-	int		orig_type;
-	int		dest_no;
-	int		dest_type;
+	unsigned orig_no;
+	enum places orig_type;
+	unsigned dest_no;
+	enum places dest_type;
 	int		altitude;
 	int		new_altitude;
 	int		dir;

Index: src/games/atc/update.c
diff -u src/games/atc/update.c:1.24 src/games/atc/update.c:1.25
--- src/games/atc/update.c:1.24	Sat Mar 22 22:45:05 2014
+++ src/games/atc/update.c	Sat Mar 22 22:58:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: update.c,v 1.24 2014/03/22 22:45:05 dholland Exp $	*/
+/*	$NetBSD: update.c,v 1.25 2014/03/22 22:58:56 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)update.c	8.1 (Berkeley) 5/31/93";
 #else
-__

CVS commit: src/games/atc

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 22 22:47:07 UTC 2014

Modified Files:
src/games/atc: input.c

Log Message:
use a more suitable type


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/games/atc/input.c

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

Modified files:

Index: src/games/atc/input.c
diff -u src/games/atc/input.c:1.26 src/games/atc/input.c:1.27
--- src/games/atc/input.c:1.26	Sat Mar 22 22:45:05 2014
+++ src/games/atc/input.c	Sat Mar 22 22:47:07 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: input.c,v 1.26 2014/03/22 22:45:05 dholland Exp $	*/
+/*	$NetBSD: input.c,v 1.27 2014/03/22 22:47:07 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)input.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: input.c,v 1.26 2014/03/22 22:45:05 dholland Exp $");
+__RCSID("$NetBSD: input.c,v 1.27 2014/03/22 22:47:07 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -199,7 +199,8 @@ static PLANE p;
 static STACK stack[MAXDEPTH];
 static int level;
 static int tval;
-static int dest_type, dest_no, dir;
+static int dest_type, dir;
+static unsigned dest_no;
 
 static int
 pop(void)



CVS commit: src/games/atc

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 22 22:45:05 UTC 2014

Modified Files:
src/games/atc: input.c struct.h update.c

Log Message:
use more suitable types


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/games/atc/input.c
cvs rdiff -u -r1.8 -r1.9 src/games/atc/struct.h
cvs rdiff -u -r1.23 -r1.24 src/games/atc/update.c

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

Modified files:

Index: src/games/atc/input.c
diff -u src/games/atc/input.c:1.25 src/games/atc/input.c:1.26
--- src/games/atc/input.c:1.25	Sat Mar 22 22:24:21 2014
+++ src/games/atc/input.c	Sat Mar 22 22:45:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: input.c,v 1.25 2014/03/22 22:24:21 dholland Exp $	*/
+/*	$NetBSD: input.c,v 1.26 2014/03/22 22:45:05 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)input.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: input.c,v 1.25 2014/03/22 22:24:21 dholland Exp $");
+__RCSID("$NetBSD: input.c,v 1.26 2014/03/22 22:45:05 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -393,7 +393,7 @@ setplane(int c)
 	if (pp == NULL)
 		return ("Unknown Plane");
 	(void)memcpy(&p, pp, sizeof (p));
-	p.delayd = 0;
+	p.delayd = false;
 	return (NULL);
 }
 
@@ -474,7 +474,7 @@ delayb(int ch)
 	ydiff = SGN(ydiff);
 	if (xdiff != displacement[p.dir].dx || ydiff != displacement[p.dir].dy)
 		return ("Beacon is not in flight path");
-	p.delayd = 1;
+	p.delayd = true;
 	p.delayd_no = bn;
 
 	if (dest_type != T_NODEST) {

Index: src/games/atc/struct.h
diff -u src/games/atc/struct.h:1.8 src/games/atc/struct.h:1.9
--- src/games/atc/struct.h:1.8	Sat Mar 22 22:33:35 2014
+++ src/games/atc/struct.h	Sat Mar 22 22:45:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: struct.h,v 1.8 2014/03/22 22:33:35 dholland Exp $	*/
+/*	$NetBSD: struct.h,v 1.9 2014/03/22 22:45:05 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -43,6 +43,8 @@
  * For more info on this and all of my stuff, mail edja...@berkeley.edu.
  */
 
+#include 
+
 typedef struct {
 	int	x, y;
 	int	dir;	/* used only sometimes */
@@ -86,8 +88,8 @@ typedef struct plane {
 	int		fuel;
 	int		xpos;
 	int		ypos;
-	int		delayd;
-	int		delayd_no;
+	bool delayd;
+	unsigned delayd_no;
 } PLANE;
 
 typedef struct {

Index: src/games/atc/update.c
diff -u src/games/atc/update.c:1.23 src/games/atc/update.c:1.24
--- src/games/atc/update.c:1.23	Sat Mar 22 22:24:21 2014
+++ src/games/atc/update.c	Sat Mar 22 22:45:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: update.c,v 1.23 2014/03/22 22:24:21 dholland Exp $	*/
+/*	$NetBSD: update.c,v 1.24 2014/03/22 22:45:05 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)update.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: update.c,v 1.23 2014/03/22 22:24:21 dholland Exp $");
+__RCSID("$NetBSD: update.c,v 1.24 2014/03/22 22:45:05 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -124,7 +124,7 @@ update(int dummy __unused)
 
 		if (pp->delayd && pp->xpos == sp->beacon[pp->delayd_no].x &&
 		pp->ypos == sp->beacon[pp->delayd_no].y) {
-			pp->delayd = 0;
+			pp->delayd = false;
 			if (pp->status == S_UNMARKED)
 pp->status = S_MARKED;
 		}
@@ -249,7 +249,7 @@ command(const PLANE *pp)
 	bp = strchr(buf, '\0');
 	bpsize = buf + sizeof(buf) - bp;
 	if (pp->delayd)
-		(void)snprintf(bp, bpsize, " @ B%d", pp->delayd_no);
+		(void)snprintf(bp, bpsize, " @ B%u", pp->delayd_no);
 
 	bp = strchr(buf, '\0');
 	bpsize = buf + sizeof(buf) - bp;



CVS commit: src/games/atc

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 22 22:33:35 UTC 2014

Modified Files:
src/games/atc: graphics.c struct.h

Log Message:
woops, more of previous.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/games/atc/graphics.c
cvs rdiff -u -r1.7 -r1.8 src/games/atc/struct.h

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

Modified files:

Index: src/games/atc/graphics.c
diff -u src/games/atc/graphics.c:1.17 src/games/atc/graphics.c:1.18
--- src/games/atc/graphics.c:1.17	Sat Mar 22 22:24:21 2014
+++ src/games/atc/graphics.c	Sat Mar 22 22:33:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: graphics.c,v 1.17 2014/03/22 22:24:21 dholland Exp $	*/
+/*	$NetBSD: graphics.c,v 1.18 2014/03/22 22:33:35 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)graphics.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: graphics.c,v 1.17 2014/03/22 22:24:21 dholland Exp $");
+__RCSID("$NetBSD: graphics.c,v 1.18 2014/03/22 22:33:35 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -166,10 +166,10 @@ setup_screen(const C_SCREEN *scp)
 	 * through beacons and exit points.
 	 */
 	str[0] = C_LINE;
-	for (i = 0; i < scp->num_lines; i++) {
+	for (iu = 0; iu < scp->num_lines; iu++) {
 		str[1] = ' ';
-		draw_line(radar, scp->line[i].p1.x, scp->line[i].p1.y,
-			scp->line[i].p2.x, scp->line[i].p2.y, str);
+		draw_line(radar, scp->line[iu].p1.x, scp->line[iu].p1.y,
+			scp->line[iu].p2.x, scp->line[iu].p2.y, str);
 	}
 
 	str[0] = C_TOPBOTTOM;

Index: src/games/atc/struct.h
diff -u src/games/atc/struct.h:1.7 src/games/atc/struct.h:1.8
--- src/games/atc/struct.h:1.7	Sat Mar 22 22:24:21 2014
+++ src/games/atc/struct.h	Sat Mar 22 22:33:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: struct.h,v 1.7 2014/03/22 22:24:21 dholland Exp $	*/
+/*	$NetBSD: struct.h,v 1.8 2014/03/22 22:33:35 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -61,7 +61,7 @@ typedef struct {
 	int	update_secs;
 	int	newplane_time;
 	unsigned num_exits;
-	int	num_lines;
+	unsigned num_lines;
 	unsigned num_beacons;
 	unsigned num_airports;
 	EXIT	*exit;



CVS commit: src/games/atc

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 22 22:24:21 UTC 2014

Modified Files:
src/games/atc: graphics.c input.c struct.h update.c

Log Message:
Make some things unsigned that should be (why would we need e.g. a
negative number of airports?) and remove some related bogus casts.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/games/atc/graphics.c
cvs rdiff -u -r1.24 -r1.25 src/games/atc/input.c
cvs rdiff -u -r1.6 -r1.7 src/games/atc/struct.h
cvs rdiff -u -r1.22 -r1.23 src/games/atc/update.c

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

Modified files:

Index: src/games/atc/graphics.c
diff -u src/games/atc/graphics.c:1.16 src/games/atc/graphics.c:1.17
--- src/games/atc/graphics.c:1.16	Wed Aug 12 04:48:03 2009
+++ src/games/atc/graphics.c	Sat Mar 22 22:24:21 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: graphics.c,v 1.16 2009/08/12 04:48:03 dholland Exp $	*/
+/*	$NetBSD: graphics.c,v 1.17 2014/03/22 22:24:21 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)graphics.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: graphics.c,v 1.16 2009/08/12 04:48:03 dholland Exp $");
+__RCSID("$NetBSD: graphics.c,v 1.17 2014/03/22 22:24:21 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -130,6 +130,7 @@ void
 setup_screen(const C_SCREEN *scp)
 {
 	int	i, j;
+	unsigned iu;
 	char	str[3];
 	const char *airstr;
 
@@ -193,22 +194,22 @@ setup_screen(const C_SCREEN *scp)
 	}
 
 	str[0] = C_BEACON;
-	for (i = 0; i < scp->num_beacons; i++) {
-		str[1] = '0' + i;
-		(void)wmove(radar, scp->beacon[i].y, scp->beacon[i].x * 2);
+	for (iu = 0; iu < scp->num_beacons; iu++) {
+		str[1] = '0' + iu;
+		(void)wmove(radar, scp->beacon[iu].y, scp->beacon[iu].x * 2);
 		(void)waddstr(radar, str);
 	}
 
-	for (i = 0; i < scp->num_exits; i++) {
-		(void)wmove(radar, scp->exit[i].y, scp->exit[i].x * 2);
-		(void)waddch(radar, '0' + i);
+	for (iu = 0; iu < scp->num_exits; iu++) {
+		(void)wmove(radar, scp->exit[iu].y, scp->exit[iu].x * 2);
+		(void)waddch(radar, '0' + iu);
 	}
 
 	airstr = "^?>?v?num_airports; i++) {
-		str[0] = airstr[scp->airport[i].dir];
-		str[1] = '0' + i;
-		(void)wmove(radar, scp->airport[i].y, scp->airport[i].x * 2);
+	for (iu = 0; iu < scp->num_airports; iu++) {
+		str[0] = airstr[scp->airport[iu].dir];
+		str[1] = '0' + iu;
+		(void)wmove(radar, scp->airport[iu].y, scp->airport[iu].x * 2);
 		(void)waddstr(radar, str);
 	}
 	

Index: src/games/atc/input.c
diff -u src/games/atc/input.c:1.24 src/games/atc/input.c:1.25
--- src/games/atc/input.c:1.24	Wed Aug 12 04:48:03 2009
+++ src/games/atc/input.c	Sat Mar 22 22:24:21 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: input.c,v 1.24 2009/08/12 04:48:03 dholland Exp $	*/
+/*	$NetBSD: input.c,v 1.25 2014/03/22 22:24:21 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)input.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: input.c,v 1.24 2009/08/12 04:48:03 dholland Exp $");
+__RCSID("$NetBSD: input.c,v 1.25 2014/03/22 22:24:21 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -459,36 +459,37 @@ Right(int c __unused)
 }
 
 static const char *
-delayb(int c)
+delayb(int ch)
 {
 	int	xdiff, ydiff;
+	unsigned bn;
 
-	c -= '0';
+	bn = ch -= '0';
 
-	if (c >= sp->num_beacons)
+	if (bn >= sp->num_beacons)
 		return ("Unknown beacon");
-	xdiff = sp->beacon[(int)c].x - p.xpos;
+	xdiff = sp->beacon[bn].x - p.xpos;
 	xdiff = SGN(xdiff);
-	ydiff = sp->beacon[(int)c].y - p.ypos;
+	ydiff = sp->beacon[bn].y - p.ypos;
 	ydiff = SGN(ydiff);
 	if (xdiff != displacement[p.dir].dx || ydiff != displacement[p.dir].dy)
 		return ("Beacon is not in flight path");
 	p.delayd = 1;
-	p.delayd_no = c;
+	p.delayd_no = bn;
 
 	if (dest_type != T_NODEST) {
 		switch (dest_type) {
 		case T_BEACON:
-			xdiff = sp->beacon[dest_no].x - sp->beacon[(int)c].x;
-			ydiff = sp->beacon[dest_no].y - sp->beacon[(int)c].y;
+			xdiff = sp->beacon[dest_no].x - sp->beacon[bn].x;
+			ydiff = sp->beacon[dest_no].y - sp->beacon[bn].y;
 			break;
 		case T_EXIT:
-			xdiff = sp->exit[dest_no].x - sp->beacon[(int)c].x;
-			ydiff = sp->exit[dest_no].y - sp->beacon[(int)c].y;
+			xdiff = sp->exit[dest_no].x - sp->beacon[bn].x;
+			ydiff = sp->exit[dest_no].y - sp->beacon[bn].y;
 			break;
 		case T_AIRPORT:
-			xdiff = sp->airport[dest_no].x - sp->beacon[(int)c].x;
-			ydiff = sp->airport[dest_no].y - sp->beacon[(int)c].y;
+			xdiff = sp->airport[dest_no].x - sp->beacon[bn].x;
+			ydiff = sp->airport[dest_no].y - sp->beacon[bn].y;
 			break;
 		default:
 			return ("Bad case in delayb!  Get help!");
@@ -587,28 +588,31 @@ setrelalt(int c)
 }
 
 static const char *
-benum(int c)
+benum(int ch)
 {
-	dest_no = c -= '0';
+	unsigned n;
+
+	n = ch - '0';
+	dest_no = n;
 
 	switch (dest_type) {
 	case T_BEACON:
-		if (c >= sp->num_beacons)
+		if (n >= sp->num_beacons)
 			return ("Unknown beacon");
-		p.new_dir =

CVS commit: src/games/atc

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 22 22:09:14 UTC 2014

Modified Files:
src/games/atc: grammar.y list.c

Log Message:
Don't cast the return value of malloc.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/games/atc/grammar.y
cvs rdiff -u -r1.7 -r1.8 src/games/atc/list.c

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

Modified files:

Index: src/games/atc/grammar.y
diff -u src/games/atc/grammar.y:1.10 src/games/atc/grammar.y:1.11
--- src/games/atc/grammar.y:1.10	Wed Aug 12 04:48:03 2009
+++ src/games/atc/grammar.y	Sat Mar 22 22:09:14 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: grammar.y,v 1.10 2009/08/12 04:48:03 dholland Exp $	*/
+/*	$NetBSD: grammar.y,v 1.11 2014/03/22 22:09:14 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -64,7 +64,7 @@
 #if 0
 static char sccsid[] = "@(#)grammar.y	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: grammar.y,v 1.10 2009/08/12 04:48:03 dholland Exp $");
+__RCSID("$NetBSD: grammar.y,v 1.11 2014/03/22 22:09:14 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -175,10 +175,10 @@ Bpoint:
 		{
 		if (sp->num_beacons % REALLOC == 0) {
 			if (sp->beacon == NULL)
-sp->beacon = (BEACON *) malloc((sp->num_beacons
+sp->beacon = malloc((sp->num_beacons
 	+ REALLOC) * sizeof (BEACON));
 			else
-sp->beacon = (BEACON *) realloc(sp->beacon,
+sp->beacon = realloc(sp->beacon,
 	(sp->num_beacons + REALLOC) * 
 	sizeof (BEACON));
 			if (sp->beacon == NULL)
@@ -205,10 +205,10 @@ Epoint:
 
 		if (sp->num_exits % REALLOC == 0) {
 			if (sp->exit == NULL)
-sp->exit = (EXIT *) malloc((sp->num_exits + 
+sp->exit = malloc((sp->num_exits + 
 	REALLOC) * sizeof (EXIT));
 			else
-sp->exit = (EXIT *) realloc(sp->exit,
+sp->exit = realloc(sp->exit,
 	(sp->num_exits + REALLOC) * 
 	sizeof (EXIT));
 			if (sp->exit == NULL)
@@ -238,10 +238,10 @@ Apoint:
 
 		if (sp->num_airports % REALLOC == 0) {
 			if (sp->airport == NULL)
-sp->airport=(AIRPORT *)malloc((sp->num_airports
+sp->airport = malloc((sp->num_airports
 	+ REALLOC) * sizeof(AIRPORT));
 			else
-sp->airport = (AIRPORT *) realloc(sp->airport,
+sp->airport = realloc(sp->airport,
 	(sp->num_airports + REALLOC) * 
 	sizeof(AIRPORT));
 			if (sp->airport == NULL)
@@ -268,10 +268,10 @@ Lline:
 		{
 		if (sp->num_lines % REALLOC == 0) {
 			if (sp->line == NULL)
-sp->line = (LINE *) malloc((sp->num_lines + 
+sp->line = malloc((sp->num_lines + 
 	REALLOC) * sizeof (LINE));
 			else
-sp->line = (LINE *) realloc(sp->line,
+sp->line = realloc(sp->line,
 	(sp->num_lines + REALLOC) *
 	sizeof (LINE));
 			if (sp->line == NULL)

Index: src/games/atc/list.c
diff -u src/games/atc/list.c:1.7 src/games/atc/list.c:1.8
--- src/games/atc/list.c:1.7	Fri Jul  1 00:48:34 2005
+++ src/games/atc/list.c	Sat Mar 22 22:09:14 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: list.c,v 1.7 2005/07/01 00:48:34 jmc Exp $	*/
+/*	$NetBSD: list.c,v 1.8 2014/03/22 22:09:14 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)list.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: list.c,v 1.7 2005/07/01 00:48:34 jmc Exp $");
+__RCSID("$NetBSD: list.c,v 1.8 2014/03/22 22:09:14 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -55,7 +55,7 @@ __RCSID("$NetBSD: list.c,v 1.7 2005/07/0
 PLANE *
 newplane(void)
 {
-	return ((PLANE *) calloc(1, sizeof (PLANE)));
+	return calloc(1, sizeof (PLANE));
 }
 
 void



CVS commit: src/games/adventure

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 22 22:04:40 UTC 2014

Modified Files:
src/games/adventure: save.c

Log Message:
Minor tidyup.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/games/adventure/save.c

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

Modified files:

Index: src/games/adventure/save.c
diff -u src/games/adventure/save.c:1.13 src/games/adventure/save.c:1.14
--- src/games/adventure/save.c:1.13	Sun Jan  8 18:16:00 2012
+++ src/games/adventure/save.c	Sat Mar 22 22:04:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: save.c,v 1.13 2012/01/08 18:16:00 dholland Exp $	*/
+/*	$NetBSD: save.c,v 1.14 2014/03/22 22:04:40 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)save.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: save.c,v 1.13 2012/01/08 18:16:00 dholland Exp $");
+__RCSID("$NetBSD: save.c,v 1.14 2014/03/22 22:04:40 dholland Exp $");
 #endif
 #endif/* not lint */
 
@@ -58,7 +58,7 @@ struct savefile {
 	FILE *f;
 	const char *name;
 	bool warned;
-	unsigned bintextpos;
+	size_t bintextpos;
 	uint32_t key;
 	struct crcstate crc;
 	unsigned char pad[8];
@@ -343,7 +343,7 @@ hash(const void *data, size_t datalen, u
 	for (i=0; i> 60);
-		val += udata[i] ^ 0xbeef;
+		val += udata[i] ^ 0xbeefU;
 	}
 
 	uval = (unsigned char *)&val;
@@ -454,7 +454,7 @@ savefile_cwrite(struct savefile *sf, con
 
 struct compat_saveinfo {
 	void   *address;
-	int width;
+	size_t  width;
 };
 
 static const struct compat_saveinfo compat_savearray[] =
@@ -530,7 +530,7 @@ compat_restore(const char *infile)
 	const struct compat_saveinfo *p;
 	char   *s;
 	longsum, cksum = 0;
-	int i;
+	size_t  i;
 	struct crcstate crc;
 
 	if ((in = fopen(infile, "rb")) == NULL) {



CVS commit: src/sys/arch/x68k

2014-03-22 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Mar 22 21:49:18 UTC 2014

Modified Files:
src/sys/arch/x68k/include: intr.h
src/sys/arch/x68k/x68k: locore.s machdep.c

Log Message:
Remove obsolete ssir stuff which was used for pre-5.0 softintr(9).

No visible problem on X68030.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x68k/include/intr.h
cvs rdiff -u -r1.116 -r1.117 src/sys/arch/x68k/x68k/locore.s
cvs rdiff -u -r1.187 -r1.188 src/sys/arch/x68k/x68k/machdep.c

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

Modified files:

Index: src/sys/arch/x68k/include/intr.h
diff -u src/sys/arch/x68k/include/intr.h:1.20 src/sys/arch/x68k/include/intr.h:1.21
--- src/sys/arch/x68k/include/intr.h:1.20	Mon Jun 23 01:49:31 2008
+++ src/sys/arch/x68k/include/intr.h	Sat Mar 22 21:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.20 2008/06/23 01:49:31 isaki Exp $	*/
+/*	$NetBSD: intr.h,v 1.21 2014/03/22 21:49:18 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -34,8 +34,7 @@
 
 #include 
 
-/* spl0 requires checking for software interrupts */
-void	spl0(void);
+#define spl0()		_spl0()
 
 #define splsoftbio()	splraise1()
 #define splsoftclock()	splraise1()
@@ -48,9 +47,6 @@ void	spl0(void);
 #define	splnone()	spl0()
 #define	splzs()		splraise5()	/* disallow serial interrupts */
 
-/* watch out for side effects */
-#define splx(s) ((s) & PSL_IPL ? _spl(s) : spl0())
-
 #define	IPL_NONE	0
 #define	IPL_SOFTCLOCK	1
 #define	IPL_SOFTBIO	2
@@ -82,4 +78,10 @@ splraiseipl(ipl_cookie_t icookie)
 	return _splraise(icookie._psl);
 }
 
+static inline void
+splx(int sr)
+{
+
+	__asm volatile("movew %0,%%sr" : : "di" (sr));
+}
 #endif /* !_X68K_INTR_H_ */

Index: src/sys/arch/x68k/x68k/locore.s
diff -u src/sys/arch/x68k/x68k/locore.s:1.116 src/sys/arch/x68k/x68k/locore.s:1.117
--- src/sys/arch/x68k/x68k/locore.s:1.116	Sat Mar 22 15:59:07 2014
+++ src/sys/arch/x68k/x68k/locore.s	Sat Mar 22 21:49:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.116 2014/03/22 15:59:07 tsutsui Exp $	*/
+/*	$NetBSD: locore.s,v 1.117 2014/03/22 21:49:18 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -502,14 +502,8 @@ ENTRY_NOPROFILE(trap0)
 	movl	%d0,%sp@-		| push syscall number
 	jbsr	_C_LABEL(syscall)	| handle it
 	addql	#4,%sp			| pop syscall arg
-	tstl	_C_LABEL(astpending)
-	jne	Lrei2
-	tstb	_C_LABEL(ssir)
-	jeq	Ltrap1
-	movw	#SPL1,%sr
-	tstb	_C_LABEL(ssir)
-	jne	Lsir1
-Ltrap1:
+	tstl	_C_LABEL(astpending)	| AST pending?
+	jne	Lrei			| yes, handle it via trap
 	movl	%sp@(FR_SP),%a0		| grab and restore
 	movl	%a0,%usp		|   user SP
 	moveml	%sp@+,#0x7FFF		| restore most registers
@@ -737,20 +731,23 @@ ENTRY_NOPROFILE(fdeject)
 
 ASENTRY_NOPROFILE(rei)
 	tstl	_C_LABEL(astpending)	| AST pending?
-	jeq	Lchksir			| no, go check for SIR
-Lrei1:
+	jne	1f			| no, done
+	rte
+1:
 	btst	#5,%sp@			| yes, are we returning to user mode?
-	jne	Lchksir			| no, go check for SIR
+	beq	2f			| no, done
+	rte
+2:
 	movw	#PSL_LOWIPL,%sr		| lower SPL
 	clrl	%sp@-			| stack adjust
 	moveml	#0x,%sp@-		| save all registers
 	movl	%usp,%a1		| including
 	movl	%a1,%sp@(FR_SP)		|the users SP
-Lrei2:
+Lrei:
 	clrl	%sp@-			| VA == none
 	clrl	%sp@-			| code == none
 	movl	#T_ASTFLT,%sp@-		| type == async system trap
-	pea	%sp@(12)		| fp = trap frame address
+	pea	%sp@(12)		| fp == trap frame address
 	jbsr	_C_LABEL(trap)		| go handle it
 	lea	%sp@(16),%sp		| pop value args
 	movl	%sp@(FR_SP),%a0		| restore user SP
@@ -771,38 +768,6 @@ Laststkadj:
 	moveml	%sp@+,#0x7FFF		| restore user registers
 	movl	%sp@,%sp		| and our SP
 	rte| and do real RTE
-Lchksir:
-	tstb	_C_LABEL(ssir)		| SIR pending?
-	jeq	Ldorte			| no, all done
-	movl	%d0,%sp@-		| need a scratch register
-	movw	%sp@(4),%d0		| get SR
-	andw	#PSL_IPL7,%d0		| mask all but IPL
-	jne	Lnosir			| came from interrupt, no can do
-	movl	%sp@+,%d0		| restore scratch register
-Lgotsir:
-	movw	#SPL1,%sr		| prevent others from servicing int
-	tstb	_C_LABEL(ssir)		| too late?
-	jeq	Ldorte			| yes, oh well...
-	clrl	%sp@-			| stack adjust
-	moveml	#0x,%sp@-		| save all registers
-	movl	%usp,%a1		| including
-	movl	%a1,%sp@(FR_SP)		|the users SP
-Lsir1:
-	clrl	%sp@-			| VA == none
-	clrl	%sp@-			| code == none
-	movl	#T_SSIR,%sp@-		| type == software interrupt
-	pea	%sp@(12)		| fp = trap frame address
-	jbsr	_C_LABEL(trap)		| go handle it
-	lea	%sp@(16),%sp		| pop value args
-	movl	%sp@(FR_SP),%a0		| restore
-	movl	%a0,%usp		|   user SP
-	moveml	%sp@+,#0x7FFF		| and all remaining registers
-	addql	#8,%sp			| pop SP and stack adjust
-	rte
-Lnosir:
-	movl	%sp@+,%d0		| restore scratch register
-Ldorte:
-	rte| real return
 
 /*
  * Use common m68k sigcode.
@@ -909,26 +874,6 @@ Lploadwskp:
 	rts
 
 /*
- * Set processor priority level calls.  Most are implemented with
- * inline asm expansions.  However, spl0 requires special handling
- *

CVS commit: src/sys/external/bsd/acpica/dist

2014-03-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Mar 22 21:42:44 UTC 2014

Modified Files:
src/sys/external/bsd/acpica/dist/compiler: aslanalyze.c aslcompiler.l
aslerror.c aslfileio.c aslfiles.c aslload.c asllookup.c aslpredef.c
aslprepkg.c aslsupport.l aslutils.c aslwalks.c aslxref.c
dtcompile.c dtfield.c dtsubtable.c dttable.c dtutils.c prutils.c
src/sys/external/bsd/acpica/dist/os_specific/service_layers:
oslinuxtbl.c
src/sys/external/bsd/acpica/dist/tools/acpidump: apfiles.c
src/sys/external/bsd/acpica/dist/tools/acpixtract: acpixtract.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 \
src/sys/external/bsd/acpica/dist/compiler/aslanalyze.c \
src/sys/external/bsd/acpica/dist/compiler/aslerror.c \
src/sys/external/bsd/acpica/dist/compiler/asllookup.c \
src/sys/external/bsd/acpica/dist/compiler/aslpredef.c \
src/sys/external/bsd/acpica/dist/compiler/dtcompile.c \
src/sys/external/bsd/acpica/dist/compiler/dtfield.c \
src/sys/external/bsd/acpica/dist/compiler/dtsubtable.c \
src/sys/external/bsd/acpica/dist/compiler/dttable.c \
src/sys/external/bsd/acpica/dist/compiler/dtutils.c
cvs rdiff -u -r1.1.1.3 -r1.2 \
src/sys/external/bsd/acpica/dist/compiler/aslcompiler.l \
src/sys/external/bsd/acpica/dist/compiler/aslfiles.c \
src/sys/external/bsd/acpica/dist/compiler/aslload.c \
src/sys/external/bsd/acpica/dist/compiler/aslwalks.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/sys/external/bsd/acpica/dist/compiler/aslfileio.c \
src/sys/external/bsd/acpica/dist/compiler/aslprepkg.c \
src/sys/external/bsd/acpica/dist/compiler/aslsupport.l \
src/sys/external/bsd/acpica/dist/compiler/aslxref.c \
src/sys/external/bsd/acpica/dist/compiler/prutils.c
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/acpica/dist/compiler/aslutils.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/sys/external/bsd/acpica/dist/os_specific/service_layers/oslinuxtbl.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/sys/external/bsd/acpica/dist/tools/acpidump/apfiles.c
cvs rdiff -u -r1.1.1.4 -r1.2 \
src/sys/external/bsd/acpica/dist/tools/acpixtract/acpixtract.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/external/bsd/acpica/dist/compiler/aslanalyze.c
diff -u src/sys/external/bsd/acpica/dist/compiler/aslanalyze.c:1.1.1.4 src/sys/external/bsd/acpica/dist/compiler/aslanalyze.c:1.2
--- src/sys/external/bsd/acpica/dist/compiler/aslanalyze.c:1.1.1.4	Fri Dec 27 13:46:04 2013
+++ src/sys/external/bsd/acpica/dist/compiler/aslanalyze.c	Sat Mar 22 17:42:44 2014
@@ -341,7 +341,7 @@ AnCheckMethodReturnValue (
  */
 if (ThisNodeBtype != 0)
 {
-sprintf (MsgBuffer,
+snprintf (MsgBuffer, sizeof(MsgBuffer),
 "Method returns [%s], %s operator requires [%s]",
 StringBuffer, OpInfo->Name, StringBuffer2);
 
Index: src/sys/external/bsd/acpica/dist/compiler/aslerror.c
diff -u src/sys/external/bsd/acpica/dist/compiler/aslerror.c:1.1.1.4 src/sys/external/bsd/acpica/dist/compiler/aslerror.c:1.2
--- src/sys/external/bsd/acpica/dist/compiler/aslerror.c:1.1.1.4	Fri Dec 27 13:46:05 2013
+++ src/sys/external/bsd/acpica/dist/compiler/aslerror.c	Sat Mar 22 17:42:44 2014
@@ -862,7 +862,7 @@ AslCoreSubsystemError (
 BOOLEAN Abort)
 {
 
-sprintf (MsgBuffer, "%s %s", AcpiFormatException (Status), ExtraMessage);
+snprintf (MsgBuffer, sizeof(MsgBuffer), "%s %s", AcpiFormatException (Status), ExtraMessage);
 
 if (Op)
 {
Index: src/sys/external/bsd/acpica/dist/compiler/asllookup.c
diff -u src/sys/external/bsd/acpica/dist/compiler/asllookup.c:1.1.1.4 src/sys/external/bsd/acpica/dist/compiler/asllookup.c:1.2
--- src/sys/external/bsd/acpica/dist/compiler/asllookup.c:1.1.1.4	Fri Dec 27 13:46:06 2013
+++ src/sys/external/bsd/acpica/dist/compiler/asllookup.c	Sat Mar 22 17:42:44 2014
@@ -163,7 +163,7 @@ LkIsObjectUsed (
  * Issue a remark even if it is a reserved name (starts
  * with an underscore).
  */
-sprintf (MsgBuffer, "Name is within method [%4.4s]",
+snprintf (MsgBuffer, sizeof(MsgBuffer), "Name is within method [%4.4s]",
 Next->Name.Ascii);
 AslError (ASL_REMARK, ASL_MSG_NOT_REFERENCED,
 LkGetNameOp (Node->Op), MsgBuffer);
Index: src/sys/external/bsd/acpica/dist/compiler/aslpredef.c
diff -u src/sys/external/bsd/acpica/dist/compiler/aslpredef.c:1.1.1.4 src/sys/external/bsd/acpica/dist/compiler/aslpredef.c:1.2
--- src/sys/external/bsd/acpica/dist/compiler/aslpredef.c:1.1.1.4	Fri Dec 27 13:46:07 2013
+++ src/sys/external/bsd/acpica/dist/compiler/aslpredef.c	Sat Mar 22 17:42:44 2014
@@ -114,7 +114,7 @@ ApCheckForPredefinedMethod (
 
 if (MethodInfo->NumArguments != 0)
 {
-   

CVS commit: src/sys/dev/usb

2014-03-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 22 20:56:04 UTC 2014

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

Log Message:
Replace the workque for status changes with an usb task queue (hint from
Nick Hudson) - simpler for this, and avoids some races.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/usb/umcs.c

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

Modified files:

Index: src/sys/dev/usb/umcs.c
diff -u src/sys/dev/usb/umcs.c:1.4 src/sys/dev/usb/umcs.c:1.5
--- src/sys/dev/usb/umcs.c:1.4	Mon Mar 17 21:21:57 2014
+++ src/sys/dev/usb/umcs.c	Sat Mar 22 20:56:04 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: umcs.c,v 1.4 2014/03/17 21:21:57 martin Exp $ */
+/* $NetBSD: umcs.c,v 1.5 2014/03/22 20:56:04 martin Exp $ */
 /* $FreeBSD: head/sys/dev/usb/serial/umcs.c 260559 2014-01-12 11:44:28Z hselasky $ */
 
 /*-
@@ -41,7 +41,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: umcs.c,v 1.4 2014/03/17 21:21:57 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umcs.c,v 1.5 2014/03/22 20:56:04 martin Exp $");
 
 #include 
 #include 
@@ -51,7 +51,6 @@ __KERNEL_RCSID(0, "$NetBSD: umcs.c,v 1.4
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -79,7 +78,9 @@ __KERNEL_RCSID(0, "$NetBSD: umcs.c,v 1.4
  */
 struct umcs7840_softc_oneport {
 	device_t sc_port_ucom;		/* ucom subdevice */
-	uint32_t sc_port_changed;	/* call ucom_status_change() */
+	volatile uint32_t		/* changes for this port have */
+		sc_port_changed;	/* been signaled,
+	   call ucom_status_change() */
 	unsigned int sc_port_phys;	/* physical port number */
 	uint8_t	sc_port_lcr;		/* local line control register */
 	uint8_t	sc_port_mcr;		/* local modem control register */
@@ -92,8 +93,7 @@ struct umcs7840_softc {
 	usbd_pipe_handle sc_intr_pipe;	/* interrupt pipe */
 	uint8_t *sc_intr_buf;		/* buffer for interrupt xfer */
 	unsigned int sc_intr_buflen;	/* size of buffer */
-	struct workqueue *sc_change_wq;	/* workqueue for status changes */
-	struct work sc_work;		/* work for said workqueue.  */
+	struct usb_task sc_change_task;	/* async status changes */
 	struct umcs7840_softc_oneport sc_ports[UMCS7840_MAX_PORTS];
 	/* data for each port */
 	uint8_t	sc_numports;		/* number of ports (subunits) */
@@ -114,7 +114,7 @@ static int umcs7840_match(device_t, cfda
 static void umcs7840_attach(device_t, device_t, void *);
 static int umcs7840_detach(device_t, int);
 static void umcs7840_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status);
-static void umcs7840_change_worker(struct work *w, void *arg);
+static void umcs7840_change_task(void *arg);
 static int umcs7840_activate(device_t, enum devact); 
 static void umcs7840_childdet(device_t, device_t);
 
@@ -294,11 +294,8 @@ umcs7840_attach(device_t parent, device_
 		return;
 	}
 
-	if (workqueue_create(&sc->sc_change_wq, "umcsq",
-		umcs7840_change_worker, sc, PRI_NONE, IPL_USB, WQ_MPSAFE)) {
-		aprint_error_dev(self, "workqueue creation failed\n");
-		return;
-}
+	usb_init_task(&sc->sc_change_task, umcs7840_change_task, sc,
+	USB_TASKQ_MPSAFE);
 
 	usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
 	sc->sc_dev);
@@ -534,8 +531,7 @@ umcs7840_detach(device_t self, int flags
 		kmem_free(sc->sc_intr_buf, sc->sc_intr_buflen);
 		sc->sc_intr_pipe = NULL;
 	}
-	if (sc->sc_change_wq != NULL)
-		workqueue_destroy(sc->sc_change_wq);
+	usb_rem_task(sc->sc_udev, &sc->sc_change_task);
 
 	/* detach children */
 	for (i = 0; i < sc->sc_numports; i++) {
@@ -856,8 +852,6 @@ umcs7840_port_close(void *self, int port
 	int ctrlreg = umcs7840_reg_ctrl(pn);
 	uint8_t data;
 
-	atomic_swap_32(&sc->sc_ports[portno].sc_port_changed, 0);
-
 	if (sc->sc_dying)
 		return;
 
@@ -879,13 +873,12 @@ umcs7840_intr(usbd_xfer_handle xfer, usb
 	struct umcs7840_softc *sc = priv;
 	u_char *buf = sc->sc_intr_buf;
 	int actlen;
-	int subunit, found;
+	int subunit;
 
 	if (status == USBD_NOT_STARTED || status == USBD_CANCELLED
 	|| status == USBD_IOERROR)
 		return;
 
-	found = 0;
 	if (status != USBD_NORMAL_COMPLETION) {
 		aprint_error_dev(sc->sc_dev,
 		"umcs7840_intr: abnormal status: %s\n",
@@ -896,6 +889,7 @@ umcs7840_intr(usbd_xfer_handle xfer, usb
 
 	usbd_get_xfer_status(xfer, NULL, NULL, &actlen, NULL);
 	if (actlen == 5 || actlen == 13) {
+		usb_rem_task(sc->sc_udev, &sc->sc_change_task);
 		/* Check status of all ports */
 		for (subunit = 0; subunit < sc->sc_numports; subunit++) {
 			uint8_t pn = sc->sc_ports[subunit].sc_port_phys;
@@ -910,19 +904,17 @@ umcs7840_intr(usbd_xfer_handle xfer, usb
 			case MCS7840_UART_ISR_RXHASDATA:
 			case MCS7840_UART_ISR_RXTIMEOUT:
 			case MCS7840_UART_ISR_MSCHANGE:
-atomic_swap_32(
-&sc->sc_ports[subunit].sc_port_changed,
-1);
-found++;
+sc->sc_ports[subunit].sc_port_changed = 1;
 break;
 			default:
 /* Do nothing */
 break;
 			}
 		}
-		if (found)
-			workqueue_enqueue(sc

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

2014-03-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 22 20:36:45 UTC 2014

Modified Files:
src/external/gpl3/gcc/dist/gcc: dse.c

Log Message:
Avoid undefined behaviour (which causes traps on VAX).


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/gpl3/gcc/dist/gcc/dse.c

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

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/dse.c
diff -u src/external/gpl3/gcc/dist/gcc/dse.c:1.1.1.2 src/external/gpl3/gcc/dist/gcc/dse.c:1.2
--- src/external/gpl3/gcc/dist/gcc/dse.c:1.1.1.2	Sat Mar  1 08:42:20 2014
+++ src/external/gpl3/gcc/dist/gcc/dse.c	Sat Mar 22 20:36:45 2014
@@ -290,6 +290,9 @@ static unsigned HOST_WIDE_INT
 lowpart_bitmask (int n)
 {
   unsigned HOST_WIDE_INT mask = ~(unsigned HOST_WIDE_INT) 0;
+  gcc_assert(n >= 0 && n <= HOST_BITS_PER_WIDE_INT);
+  if (n == 0)
+return 0;
   return mask >> (HOST_BITS_PER_WIDE_INT - n);
 }
 



CVS commit: src/games/adventure

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 22 20:07:05 UTC 2014

Modified Files:
src/games/adventure: init.c

Log Message:
tag decl() __noinline, as inlining it would defeat its purpose
(which is to not have interesting string literals appear in the
compiled binary)


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/games/adventure/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/games/adventure/init.c
diff -u src/games/adventure/init.c:1.20 src/games/adventure/init.c:1.21
--- src/games/adventure/init.c:1.20	Wed Aug 31 16:24:55 2011
+++ src/games/adventure/init.c	Sat Mar 22 20:07:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.20 2011/08/31 16:24:55 plunky Exp $	*/
+/*	$NetBSD: init.c,v 1.21 2014/03/22 20:07:05 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)init.c	8.1 (Berkeley) 6/2/93";
 #else
-__RCSID("$NetBSD: init.c,v 1.20 2011/08/31 16:24:55 plunky Exp $");
+__RCSID("$NetBSD: init.c,v 1.21 2014/03/22 20:07:05 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -137,7 +137,7 @@ init(void)
 	poof();
 }
 
-char *
+__noinline char *
 decr(int a, int b, int c, int d, int e)
 {
 	static char buf[6];



CVS commit: src/external/gpl3/gcc/usr.bin/cc1

2014-03-22 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Sat Mar 22 19:52:21 UTC 2014

Modified Files:
src/external/gpl3/gcc/usr.bin/cc1: Makefile

Log Message:
Remove (harmless) debug target committed by accident.

Pointed out by Matthew Green in private e-mail.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gcc/usr.bin/cc1/Makefile

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

Modified files:

Index: src/external/gpl3/gcc/usr.bin/cc1/Makefile
diff -u src/external/gpl3/gcc/usr.bin/cc1/Makefile:1.7 src/external/gpl3/gcc/usr.bin/cc1/Makefile:1.8
--- src/external/gpl3/gcc/usr.bin/cc1/Makefile:1.7	Sat Mar 22 17:57:47 2014
+++ src/external/gpl3/gcc/usr.bin/cc1/Makefile	Sat Mar 22 19:52:21 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.7 2014/03/22 17:57:47 tron Exp $
+#	$NetBSD: Makefile,v 1.8 2014/03/22 19:52:21 tron Exp $
 
 PROG=		cc1
 SRCS=		${G_C_OBJS:S,c-family/,,:S,c/,,:Nlibcpp.a:.o=.c} main.c ${PROG}-checksum.c
@@ -50,6 +50,3 @@ DPADD+=	${LIBMPC} ${LIBMPFR} ${LIBGMP} $
 
 .PATH: ${DIST}/gcc ${DIST}/gcc/c ${DIST}/gcc/c-family ${DIST}/gcc/config
 .PATH: ${G_out_file:H}
-
-gugu:
-	@echo ${COPTS}



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

2014-03-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sat Mar 22 19:38:46 UTC 2014

Modified Files:
src/common/lib/libc/arch/i386/string: ffs.S memchr.S memcmp.S memcpy.S
strcat.S strchr.S strcmp.S strcpy.S strlen.S strrchr.S
src/common/lib/libc/arch/i386/string/small: memcmp.S memset.S strchr.S
strcmp.S strcpy.S strlen.S

Log Message:
For all i386 string assembly functions that don't overlap use END() so
that symbol size information is available.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/arch/i386/string/ffs.S \
src/common/lib/libc/arch/i386/string/memchr.S \
src/common/lib/libc/arch/i386/string/strcat.S \
src/common/lib/libc/arch/i386/string/strcmp.S \
src/common/lib/libc/arch/i386/string/strcpy.S \
src/common/lib/libc/arch/i386/string/strlen.S
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/i386/string/memcmp.S \
src/common/lib/libc/arch/i386/string/strchr.S \
src/common/lib/libc/arch/i386/string/strrchr.S
cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/arch/i386/string/memcpy.S
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/arch/i386/string/small/memcmp.S \
src/common/lib/libc/arch/i386/string/small/memset.S \
src/common/lib/libc/arch/i386/string/small/strchr.S \
src/common/lib/libc/arch/i386/string/small/strcmp.S \
src/common/lib/libc/arch/i386/string/small/strcpy.S \
src/common/lib/libc/arch/i386/string/small/strlen.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/i386/string/ffs.S
diff -u src/common/lib/libc/arch/i386/string/ffs.S:1.1 src/common/lib/libc/arch/i386/string/ffs.S:1.2
--- src/common/lib/libc/arch/i386/string/ffs.S:1.1	Tue Dec 20 19:28:49 2005
+++ src/common/lib/libc/arch/i386/string/ffs.S	Sat Mar 22 19:38:46 2014
@@ -6,7 +6,7 @@
 #include 
 
 #if defined(LIBC_SCCS)
-	RCSID("$NetBSD: ffs.S,v 1.1 2005/12/20 19:28:49 christos Exp $")
+	RCSID("$NetBSD: ffs.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $")
 #endif
 
 ENTRY(ffs)
@@ -18,3 +18,4 @@ ENTRY(ffs)
 	_ALIGN_TEXT
 L1:	xorl	%eax,%eax		/* clear result */
 	ret
+END(ffs)
Index: src/common/lib/libc/arch/i386/string/memchr.S
diff -u src/common/lib/libc/arch/i386/string/memchr.S:1.1 src/common/lib/libc/arch/i386/string/memchr.S:1.2
--- src/common/lib/libc/arch/i386/string/memchr.S:1.1	Tue Dec 20 19:28:49 2005
+++ src/common/lib/libc/arch/i386/string/memchr.S	Sat Mar 22 19:38:46 2014
@@ -6,7 +6,7 @@
 #include 
 
 #if defined(LIBC_SCCS)
-	RCSID("$NetBSD: memchr.S,v 1.1 2005/12/20 19:28:49 christos Exp $")
+	RCSID("$NetBSD: memchr.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $")
 #endif
 
 ENTRY(memchr)
@@ -16,7 +16,7 @@ ENTRY(memchr)
 	movl	16(%esp),%esi
 
 	/*
-	 * Align to word boundary. 
+	 * Align to word boundary.
 	 * Consider unrolling loop?
 	 */
 	testl	%esi,%esi	/* nbytes == 0? */
@@ -107,3 +107,4 @@ ENTRY(memchr)
 .Ldone:
 	popl	%esi
 	ret
+END(memchr)
Index: src/common/lib/libc/arch/i386/string/strcat.S
diff -u src/common/lib/libc/arch/i386/string/strcat.S:1.1 src/common/lib/libc/arch/i386/string/strcat.S:1.2
--- src/common/lib/libc/arch/i386/string/strcat.S:1.1	Tue Dec 20 19:28:49 2005
+++ src/common/lib/libc/arch/i386/string/strcat.S	Sat Mar 22 19:38:46 2014
@@ -6,7 +6,7 @@
 #include 
 
 #if defined(LIBC_SCCS)
-	RCSID("$NetBSD: strcat.S,v 1.1 2005/12/20 19:28:49 christos Exp $")
+	RCSID("$NetBSD: strcat.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $")
 #endif
 
 ENTRY(strcat)
@@ -125,3 +125,4 @@ ENTRY(strcat)
 	movl	8(%esp),%eax
 	popl	%ebx
 	ret
+END(strcat)
Index: src/common/lib/libc/arch/i386/string/strcmp.S
diff -u src/common/lib/libc/arch/i386/string/strcmp.S:1.1 src/common/lib/libc/arch/i386/string/strcmp.S:1.2
--- src/common/lib/libc/arch/i386/string/strcmp.S:1.1	Tue Dec 20 19:28:49 2005
+++ src/common/lib/libc/arch/i386/string/strcmp.S	Sat Mar 22 19:38:46 2014
@@ -6,7 +6,7 @@
 #include 
 
 #if defined(LIBC_SCCS)
-	RCSID("$NetBSD: strcmp.S,v 1.1 2005/12/20 19:28:49 christos Exp $")
+	RCSID("$NetBSD: strcmp.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $")
 #endif
 
 ENTRY(strcmp)
@@ -75,3 +75,4 @@ ENTRY(strcmp)
 	popl	%ebx
 	popl	%esi
 	ret
+END(strcmp)
Index: src/common/lib/libc/arch/i386/string/strcpy.S
diff -u src/common/lib/libc/arch/i386/string/strcpy.S:1.1 src/common/lib/libc/arch/i386/string/strcpy.S:1.2
--- src/common/lib/libc/arch/i386/string/strcpy.S:1.1	Tue Dec 20 19:28:49 2005
+++ src/common/lib/libc/arch/i386/string/strcpy.S	Sat Mar 22 19:38:46 2014
@@ -6,7 +6,7 @@
 #include 
 
 #if defined(LIBC_SCCS)
-	RCSID("$NetBSD: strcpy.S,v 1.1 2005/12/20 19:28:49 christos Exp $")
+	RCSID("$NetBSD: strcpy.S,v 1.2 2014/03/22 19:38:46 jakllsch Exp $")
 #endif
 
 /*
@@ -14,7 +14,7 @@
  * source pointer is aligned to a word boundary, it then copies by
  * words until it finds a word containing a zero byte, and finally
  * copies by bytes until the end of the string is reached.
- *	
+ *
  * While thi

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

2014-03-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sat Mar 22 19:16:34 UTC 2014

Modified Files:
src/common/lib/libc/arch/x86_64/string: bcmp.S bcopy.S ffs.S memchr.S
memcmp.S strcat.S strchr.S strcmp.S strcpy.S strlen.S strrchr.S

Log Message:
For all x86_64 string assembly functions that don't overlap (i.e. every
one except memset and bzero) use END() so that symbol size information
is available.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/x86_64/string/bcmp.S \
src/common/lib/libc/arch/x86_64/string/memcmp.S \
src/common/lib/libc/arch/x86_64/string/strrchr.S
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/x86_64/string/bcopy.S \
src/common/lib/libc/arch/x86_64/string/ffs.S
cvs rdiff -u -r1.5 -r1.6 src/common/lib/libc/arch/x86_64/string/memchr.S \
src/common/lib/libc/arch/x86_64/string/strlen.S
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/arch/x86_64/string/strcat.S \
src/common/lib/libc/arch/x86_64/string/strcmp.S \
src/common/lib/libc/arch/x86_64/string/strcpy.S
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/arch/x86_64/string/strchr.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/x86_64/string/bcmp.S
diff -u src/common/lib/libc/arch/x86_64/string/bcmp.S:1.2 src/common/lib/libc/arch/x86_64/string/bcmp.S:1.3
--- src/common/lib/libc/arch/x86_64/string/bcmp.S:1.2	Mon Nov 12 18:41:59 2007
+++ src/common/lib/libc/arch/x86_64/string/bcmp.S	Sat Mar 22 19:16:34 2014
@@ -1,7 +1,7 @@
 #include 
 
 #if defined(LIBC_SCCS)
-	RCSID("$NetBSD: bcmp.S,v 1.2 2007/11/12 18:41:59 ad Exp $")
+	RCSID("$NetBSD: bcmp.S,v 1.3 2014/03/22 19:16:34 jakllsch Exp $")
 #endif
 
 ENTRY(bcmp)
@@ -21,3 +21,4 @@ ENTRY(bcmp)
 
 L1:	incl	%eax
 L2:	ret
+END(bcmp)
Index: src/common/lib/libc/arch/x86_64/string/memcmp.S
diff -u src/common/lib/libc/arch/x86_64/string/memcmp.S:1.2 src/common/lib/libc/arch/x86_64/string/memcmp.S:1.3
--- src/common/lib/libc/arch/x86_64/string/memcmp.S:1.2	Mon Nov 12 18:41:59 2007
+++ src/common/lib/libc/arch/x86_64/string/memcmp.S	Sat Mar 22 19:16:34 2014
@@ -7,7 +7,7 @@
 #include 
 
 #if defined(LIBC_SCCS)
-	RCSID("$NetBSD: memcmp.S,v 1.2 2007/11/12 18:41:59 ad Exp $")
+	RCSID("$NetBSD: memcmp.S,v 1.3 2014/03/22 19:16:34 jakllsch Exp $")
 #endif
 
 ENTRY(memcmp)
@@ -37,3 +37,4 @@ L6:	xorl	%eax,%eax		/* Perform unsigned 
 	movb	-1(%rsi),%dl
 	subl%edx,%eax
 	ret
+END(memcmp)
Index: src/common/lib/libc/arch/x86_64/string/strrchr.S
diff -u src/common/lib/libc/arch/x86_64/string/strrchr.S:1.2 src/common/lib/libc/arch/x86_64/string/strrchr.S:1.3
--- src/common/lib/libc/arch/x86_64/string/strrchr.S:1.2	Fri Jul 17 19:37:57 2009
+++ src/common/lib/libc/arch/x86_64/string/strrchr.S	Sat Mar 22 19:16:34 2014
@@ -6,7 +6,7 @@
 #include 
 
 #if defined(LIBC_SCCS)
-	RCSID("$NetBSD: strrchr.S,v 1.2 2009/07/17 19:37:57 dsl Exp $")
+	RCSID("$NetBSD: strrchr.S,v 1.3 2014/03/22 19:16:34 jakllsch Exp $")
 #endif
 
 ENTRY(strrchr)
@@ -120,5 +120,6 @@ ENTRY(strrchr)
 
 .Ldone:
 	ret
+END(strrchr)
 
 STRONG_ALIAS(rindex,strrchr)

Index: src/common/lib/libc/arch/x86_64/string/bcopy.S
diff -u src/common/lib/libc/arch/x86_64/string/bcopy.S:1.4 src/common/lib/libc/arch/x86_64/string/bcopy.S:1.5
--- src/common/lib/libc/arch/x86_64/string/bcopy.S:1.4	Sun Nov 22 17:25:47 2009
+++ src/common/lib/libc/arch/x86_64/string/bcopy.S	Sat Mar 22 19:16:34 2014
@@ -32,7 +32,7 @@
 #include 
 
 #if defined(LIBC_SCCS)
-	RCSID("$NetBSD: bcopy.S,v 1.4 2009/11/22 17:25:47 dsl Exp $")
+	RCSID("$NetBSD: bcopy.S,v 1.5 2014/03/22 19:16:34 jakllsch Exp $")
 #endif
 
 	/*
@@ -158,3 +158,13 @@ ENTRY(bcopy)
 	cld
 	ret
 #endif
+
+#ifdef MEMCOPY
+END(memcpy)
+#else
+#ifdef MEMMOVE
+END(memmove)
+#else
+END(bcopy)
+#endif
+#endif
Index: src/common/lib/libc/arch/x86_64/string/ffs.S
diff -u src/common/lib/libc/arch/x86_64/string/ffs.S:1.4 src/common/lib/libc/arch/x86_64/string/ffs.S:1.5
--- src/common/lib/libc/arch/x86_64/string/ffs.S:1.4	Mon Jul 20 15:21:00 2009
+++ src/common/lib/libc/arch/x86_64/string/ffs.S	Sat Mar 22 19:16:34 2014
@@ -7,7 +7,7 @@
 #include 
 
 #if defined(LIBC_SCCS)
-	RCSID("$NetBSD: ffs.S,v 1.4 2009/07/20 15:21:00 christos Exp $")
+	RCSID("$NetBSD: ffs.S,v 1.5 2014/03/22 19:16:34 jakllsch Exp $")
 #endif
 
 ENTRY(ffs)
@@ -18,3 +18,4 @@ ENTRY(ffs)
 
 1:	xorl	%eax,%eax		/* clear result */
 	ret
+END(ffs)

Index: src/common/lib/libc/arch/x86_64/string/memchr.S
diff -u src/common/lib/libc/arch/x86_64/string/memchr.S:1.5 src/common/lib/libc/arch/x86_64/string/memchr.S:1.6
--- src/common/lib/libc/arch/x86_64/string/memchr.S:1.5	Sat Aug  1 20:47:02 2009
+++ src/common/lib/libc/arch/x86_64/string/memchr.S	Sat Mar 22 19:16:34 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: memchr.S,v 1.5 2009/08/01 20:47:02 dsl Exp $	*/
+/*	$NetBSD: memchr.S,v 1.6 2014/03/22 19:16:34 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @

CVS commit: src/games/tetris

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 22 19:05:30 UTC 2014

Modified Files:
src/games/tetris: scores.c

Log Message:
Revert part of previous -r1.21 and fix the errno-handling bug instead.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/games/tetris/scores.c

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

Modified files:

Index: src/games/tetris/scores.c
diff -u src/games/tetris/scores.c:1.21 src/games/tetris/scores.c:1.22
--- src/games/tetris/scores.c:1.21	Sat Oct 19 17:23:08 2013
+++ src/games/tetris/scores.c	Sat Mar 22 19:05:30 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: scores.c,v 1.21 2013/10/19 17:23:08 christos Exp $	*/
+/*	$NetBSD: scores.c,v 1.22 2014/03/22 19:05:30 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -383,6 +383,7 @@ getscores(int *fdp)
 	mode_t mask;
 	const char *human;
 	int doflip;
+	int serrno;
 	ssize_t result;
 
 #ifdef ALLOW_SCORE_UPDATES
@@ -400,6 +401,7 @@ getscores(int *fdp)
 	setegid(egid);
 	mask = umask(S_IWOTH);
 	sd = open(_PATH_SCOREFILE, mint, 0666);
+	serrno = errno;
 	(void)umask(mask);
 	setegid(gid);
 	if (sd < 0) {
@@ -410,6 +412,7 @@ getscores(int *fdp)
 		 * trying to write it, don't fail -- we can still show
 		 * the player the score they got.
 		 */
+		errno = serrno;
 		if (fdp != NULL || errno != ENOENT) {
 			warn("Cannot open %s for %s", _PATH_SCOREFILE, human);
 		}



CVS commit: src/games/gomoku

2014-03-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 22 18:58:57 UTC 2014

Modified Files:
src/games/gomoku: bdisp.c gomoku.h

Log Message:
move extern decls to .h files


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/games/gomoku/bdisp.c
cvs rdiff -u -r1.19 -r1.20 src/games/gomoku/gomoku.h

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

Modified files:

Index: src/games/gomoku/bdisp.c
diff -u src/games/gomoku/bdisp.c:1.16 src/games/gomoku/bdisp.c:1.17
--- src/games/gomoku/bdisp.c:1.16	Sat Feb 18 06:57:23 2012
+++ src/games/gomoku/bdisp.c	Sat Mar 22 18:58:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bdisp.c,v 1.16 2012/02/18 06:57:23 matt Exp $	*/
+/*	$NetBSD: bdisp.c,v 1.17 2014/03/22 18:58:57 dholland Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)bdisp.c	8.2 (Berkeley) 5/3/95";
 #else
-__RCSID("$NetBSD: bdisp.c,v 1.16 2012/02/18 06:57:23 matt Exp $");
+__RCSID("$NetBSD: bdisp.c,v 1.17 2014/03/22 18:58:57 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -53,9 +53,6 @@ __RCSID("$NetBSD: bdisp.c,v 1.16 2012/02
 static	int	lastline;
 static	char	pcolor[] = "*O.?";
 
-extern int interactive;
-extern const char *plyr[];
-
 /*
  * Initialize screen display.
  */

Index: src/games/gomoku/gomoku.h
diff -u src/games/gomoku/gomoku.h:1.19 src/games/gomoku/gomoku.h:1.20
--- src/games/gomoku/gomoku.h:1.19	Mon Mar 29 04:28:47 2010
+++ src/games/gomoku/gomoku.h	Sat Mar 22 18:58:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: gomoku.h,v 1.19 2010/03/29 04:28:47 dholland Exp $	*/
+/*	$NetBSD: gomoku.h,v 1.20 2014/03/22 18:58:57 dholland Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -265,6 +265,9 @@ extern	int	movelog[BSZ * BSZ];		/* histo
 extern	int	movenum;
 extern	int	debug;
 
+extern int interactive;
+extern const char *plyr[];
+
 #define ASSERT(x)
 
 void	bdinit(struct spotstr *);



CVS commit: src/sys/arch/sandpoint/stand/altboot

2014-03-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sat Mar 22 18:54:28 UTC 2014

Modified Files:
src/sys/arch/sandpoint/stand/altboot: main.c

Log Message:
drop trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/sandpoint/stand/altboot/main.c

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

Modified files:

Index: src/sys/arch/sandpoint/stand/altboot/main.c
diff -u src/sys/arch/sandpoint/stand/altboot/main.c:1.23 src/sys/arch/sandpoint/stand/altboot/main.c:1.24
--- src/sys/arch/sandpoint/stand/altboot/main.c:1.23	Sun Jan  5 21:10:50 2014
+++ src/sys/arch/sandpoint/stand/altboot/main.c	Sat Mar 22 18:54:28 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.23 2014/01/05 21:10:50 jakllsch Exp $ */
+/* $NetBSD: main.c,v 1.24 2014/03/22 18:54:28 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -430,8 +430,8 @@ module_add(const char *name)
 
 	bm = alloc(sizeof(struct boot_module) + strlen(name) + 1);
 	if (bm == NULL) {
-		printf("couldn't allocate module %s\n", name); 
-		return; 
+		printf("couldn't allocate module %s\n", name);
+		return;
 	}
 
 	bm->bm_kmod = (char *)(bm + 1);
@@ -451,12 +451,12 @@ module_add(const char *name)
 #define alignpg(x)	(((x)+PAGE_SIZE-1) & ~(PAGE_SIZE-1))
 
 void
-module_load(const char *kernel_path) 
+module_load(const char *kernel_path)
 {
 	struct boot_module *bm;
 	struct bi_modulelist_entry *bi;
 	struct stat st;
-	char *p; 
+	char *p;
 	int size, fd;
 
 	strcpy(module_base, kernel_path);
@@ -496,7 +496,7 @@ module_load(const char *kernel_path) 
 		}
 		bm->bm_len = (int)st.st_size;
 		close(fd);
-		size += sizeof(struct bi_modulelist_entry); 
+		size += sizeof(struct bi_modulelist_entry);
 	}
 	if (size == 0)
 		return;



CVS commit: src/external/gpl3/gcc/usr.bin

2014-03-22 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Sat Mar 22 17:57:48 UTC 2014

Modified Files:
src/external/gpl3/gcc/usr.bin/cc1: Makefile
src/external/gpl3/gcc/usr.bin/cc1obj: Makefile
src/external/gpl3/gcc/usr.bin/cpp: Makefile
src/external/gpl3/gcc/usr.bin/g++: Makefile
src/external/gpl3/gcc/usr.bin/gcc: Makefile

Log Message:
Fix build with "HAVE_GCC=48" and "USE_SSP=yes".


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc/usr.bin/cc1/Makefile
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc/usr.bin/cc1obj/Makefile
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc/usr.bin/cpp/Makefile
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gcc/usr.bin/g++/Makefile
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gcc/usr.bin/gcc/Makefile

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

Modified files:

Index: src/external/gpl3/gcc/usr.bin/cc1/Makefile
diff -u src/external/gpl3/gcc/usr.bin/cc1/Makefile:1.6 src/external/gpl3/gcc/usr.bin/cc1/Makefile:1.7
--- src/external/gpl3/gcc/usr.bin/cc1/Makefile:1.6	Sat Mar  1 10:00:49 2014
+++ src/external/gpl3/gcc/usr.bin/cc1/Makefile	Sat Mar 22 17:57:47 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2014/03/01 10:00:49 mrg Exp $
+#	$NetBSD: Makefile,v 1.7 2014/03/22 17:57:47 tron Exp $
 
 PROG=		cc1
 SRCS=		${G_C_OBJS:S,c-family/,,:S,c/,,:Nlibcpp.a:.o=.c} main.c ${PROG}-checksum.c
@@ -31,7 +31,17 @@ CHECKSUM_OBJS=	${BACKENDOBJ}/libbackend.
 # VER_CPPFLAGS from Makefile.inc
 CPPFLAGS.c-cppbuiltin.c=	${VER_CPPFLAGS}
 
-COPTS+=	-Wno-stack-protector
+COPTS.c-ada-spec.c=	-Wno-stack-protector
+COPTS.c-aux-info.c=	-Wno-stack-protector
+COPTS.c-common.c=	-Wno-stack-protector
+COPTS.c-cppbuiltin.c=	-Wno-stack-protector
+COPTS.c-format.c=	-Wno-stack-protector
+COPTS.c-format.h=	-Wno-stack-protector
+COPTS.c-lex.c=		-Wno-stack-protector
+COPTS.c-opts.c=		-Wno-stack-protector
+COPTS.c-ppoutput.c=	-Wno-stack-protector
+COPTS.c-pragma.c=	-Wno-stack-protector
+COPTS.c-typeck.c=	-Wno-stack-protector
 
 CPPFLAGS.default-c.c+=	-I${BACKENDOBJ}
 
@@ -41,3 +51,5 @@ DPADD+=	${LIBMPC} ${LIBMPFR} ${LIBGMP} $
 .PATH: ${DIST}/gcc ${DIST}/gcc/c ${DIST}/gcc/c-family ${DIST}/gcc/config
 .PATH: ${G_out_file:H}
 
+gugu:
+	@echo ${COPTS}

Index: src/external/gpl3/gcc/usr.bin/cc1obj/Makefile
diff -u src/external/gpl3/gcc/usr.bin/cc1obj/Makefile:1.6 src/external/gpl3/gcc/usr.bin/cc1obj/Makefile:1.7
--- src/external/gpl3/gcc/usr.bin/cc1obj/Makefile:1.6	Sat Mar  1 10:00:49 2014
+++ src/external/gpl3/gcc/usr.bin/cc1obj/Makefile	Sat Mar 22 17:57:47 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2014/03/01 10:00:49 mrg Exp $
+#	$NetBSD: Makefile,v 1.7 2014/03/22 17:57:47 tron Exp $
 
 MYOBJS=		${G_OBJC_OBJS} ${G_C_AND_OBJC_OBJS} 
 PROG=		cc1obj
@@ -34,7 +34,18 @@ CHECKSUM_OBJS=	${BACKENDOBJ}/libbackend.
 # VER_CPPFLAGS from Makefile.inc
 CPPFLAGS.c-cppbuiltin.c=	${VER_CPPFLAGS}
 
-COPTS+=	-Wno-stack-protector
+COPTS.c-ada-spec.c+=			-Wno-stack-protector
+COPTS.c-aux-info.c+=			-Wno-stack-protector
+COPTS.c-common.c+=			-Wno-stack-protector
+COPTS.c-cppbuiltin.c+=			-Wno-stack-protector
+COPTS.c-format.c+=			-Wno-stack-protector
+COPTS.c-lex.c+=-Wno-stack-protector
+COPTS.c-ppoutput.c+=			-Wno-stack-protector
+COPTS.c-pragma.c+=			-Wno-stack-protector
+COPTS.c-typeck.c+=			-Wno-stack-protector
+COPTS.objc-act.c+=			-Wno-stack-protector
+COPTS.objc-gnu-runtime-abi-01.c+=	-Wno-stack-protector
+COPTS.objc-next-runtime-abi-01.c+=	-Wno-stack-protector
 
 LDADD+=	${LIBMPC} ${LIBMPFR} ${LIBGMP} -lintl -lz -lm
 DPADD+=	${LIBMPC} ${LIBMPFR} ${LIBGMP} ${LIBINTL} ${LIBZ} ${LIBM}

Index: src/external/gpl3/gcc/usr.bin/cpp/Makefile
diff -u src/external/gpl3/gcc/usr.bin/cpp/Makefile:1.6 src/external/gpl3/gcc/usr.bin/cpp/Makefile:1.7
--- src/external/gpl3/gcc/usr.bin/cpp/Makefile:1.6	Sat Mar  1 10:00:49 2014
+++ src/external/gpl3/gcc/usr.bin/cpp/Makefile	Sat Mar 22 17:57:48 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2014/03/01 10:00:49 mrg Exp $
+#	$NetBSD: Makefile,v 1.7 2014/03/22 17:57:48 tron Exp $
 
 PROG=		cpp
 SRCS=		cppspec.c ${G_GCC_OBJS:.o=.c}
@@ -26,6 +26,8 @@ DPADD+=		${LIBINTL}
 
 .include 
 
+COPTS.gcc.c=	-Wno-stack-protector
+
 .PATH: ${DIST}/gcc ${DIST}/gcc/c-family ${DIST}/gcc/doc
 
 cpp.info: gcc-vers.texi

Index: src/external/gpl3/gcc/usr.bin/g++/Makefile
diff -u src/external/gpl3/gcc/usr.bin/g++/Makefile:1.3 src/external/gpl3/gcc/usr.bin/g++/Makefile:1.4
--- src/external/gpl3/gcc/usr.bin/g++/Makefile:1.3	Sat Mar  1 10:00:49 2014
+++ src/external/gpl3/gcc/usr.bin/g++/Makefile	Sat Mar 22 17:57:48 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2014/03/01 10:00:49 mrg Exp $
+#	$NetBSD: Makefile,v 1.4 2014/03/22 17:57:48 tron Exp $
 
 PROG=		gplusplus
 PROGNAME=	g++
@@ -20,4 +20,6 @@ DPADD+=		${LIBINTL}
 
 .include "../Makefile.frontend"
 
+COPTS.gcc.c=	-Wno-stack-protector
+
 .PATH: ${DIST}/gcc/cp ${DIST}/gcc ${DIST}/gcc/cp

Index: src/external/gpl3/gcc/usr.bin/gcc/Makefile

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

2014-03-22 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Sat Mar 22 17:12:20 UTC 2014

Modified Files:
src/sys/arch/arm/cortex: pl310_reg.h

Log Message:
Add constant for a reserved bit 31 for the L2C_AUXCTL register for use in
masks


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/cortex/pl310_reg.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/cortex/pl310_reg.h
diff -u src/sys/arch/arm/cortex/pl310_reg.h:1.3 src/sys/arch/arm/cortex/pl310_reg.h:1.4
--- src/sys/arch/arm/cortex/pl310_reg.h:1.3	Sat Mar 22 16:39:20 2014
+++ src/sys/arch/arm/cortex/pl310_reg.h	Sat Mar 22 17:12:20 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: pl310_reg.h,v 1.3 2014/03/22 16:39:20 reinoud Exp $ */
+/* $NetBSD: pl310_reg.h,v 1.4 2014/03/22 17:12:20 reinoud Exp $ */
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -58,6 +58,7 @@
 #define	L2C_CTL			0x100
 #define	 CTL_ENABLE		__BIT(1)
 #define	L2C_AUXCTL		0x104
+#define  AUXCTL_RSVD31		__BIT(31)
 #define	 AUXCTL_EARLY_BRESP_EN	__BIT(30)
 #define	 AUXCTL_I_PREFETCH	__BIT(29)
 #define	 AUXCTL_D_PREFETCH	__BIT(28)



CVS commit: src/sys/arch/luna68k

2014-03-22 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Mar 22 16:52:07 UTC 2014

Modified Files:
src/sys/arch/luna68k/include: intr.h
src/sys/arch/luna68k/luna68k: isr.c locore.s

Log Message:
Remove obsolete ssir stuff which was used for pre-5.0 softintr(9).


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/luna68k/include/intr.h
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/luna68k/luna68k/isr.c
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/luna68k/luna68k/locore.s

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

Modified files:

Index: src/sys/arch/luna68k/include/intr.h
diff -u src/sys/arch/luna68k/include/intr.h:1.14 src/sys/arch/luna68k/include/intr.h:1.15
--- src/sys/arch/luna68k/include/intr.h:1.14	Sat Nov 26 04:40:51 2011
+++ src/sys/arch/luna68k/include/intr.h	Sat Mar 22 16:52:07 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.h,v 1.14 2011/11/26 04:40:51 tsutsui Exp $ */
+/* $NetBSD: intr.h,v 1.15 2014/03/22 16:52:07 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -35,10 +35,11 @@
 #ifdef _KERNEL
 
 /*
- * spl functions; all but spl0 are done in-line
+ * spl functions
  */
 #include 
 
+#define spl0()		_spl0()
 #define splnone()	spl0()
 #define splsoftclock()	splraise1()
 #define splsoftbio()	splraise1()
@@ -48,11 +49,6 @@
 #define splsched()	splraise5()
 #define splhigh()	spl7()
 
-/* watch out for side effects */
-#define splx(s) ((s) & PSL_IPL ? _spl(s) : spl0())
-
-int spl0(void);
-
 #define	IPL_NONE	0
 #define	IPL_SOFTCLOCK	1
 #define	IPL_SOFTBIO	2
@@ -84,6 +80,13 @@ splraiseipl(ipl_cookie_t icookie)
 	return _splraise(icookie._psl);
 }
 
+static inline void
+splx(int sr)
+{
+
+	__asm volatile("movew %0,%%sr" : : "di" (sr));
+}
+
 #endif /* _KERNEL */
 
 #endif	/* _MACHINE_INTR_H */

Index: src/sys/arch/luna68k/luna68k/isr.c
diff -u src/sys/arch/luna68k/luna68k/isr.c:1.21 src/sys/arch/luna68k/luna68k/isr.c:1.22
--- src/sys/arch/luna68k/luna68k/isr.c:1.21	Sat Nov 26 04:40:51 2011
+++ src/sys/arch/luna68k/luna68k/isr.c	Sat Mar 22 16:52:07 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: isr.c,v 1.21 2011/11/26 04:40:51 tsutsui Exp $	*/
+/*	$NetBSD: isr.c,v 1.22 2014/03/22 16:52:07 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: isr.c,v 1.21 2011/11/26 04:40:51 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isr.c,v 1.22 2014/03/22 16:52:07 tsutsui Exp $");
 
 /*
  * Link and dispatch interrupts.
@@ -50,7 +50,6 @@ __KERNEL_RCSID(0, "$NetBSD: isr.c,v 1.21
 isr_autovec_list_t isr_autovec[NISRAUTOVEC];
 struct	isr_vectored isr_vectored[NISRVECTORED];
 int	idepth;
-volatile int	ssir;
 
 extern	int intrcnt[];		/* from locore.s */
 extern	void (*vectab[])(void);

Index: src/sys/arch/luna68k/luna68k/locore.s
diff -u src/sys/arch/luna68k/luna68k/locore.s:1.58 src/sys/arch/luna68k/luna68k/locore.s:1.59
--- src/sys/arch/luna68k/luna68k/locore.s:1.58	Sat Mar 15 09:30:33 2014
+++ src/sys/arch/luna68k/luna68k/locore.s	Sat Mar 22 16:52:07 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.58 2014/03/15 09:30:33 tsutsui Exp $ */
+/* $NetBSD: locore.s,v 1.59 2014/03/22 16:52:07 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -451,14 +451,8 @@ ENTRY_NOPROFILE(trap0)
 	movl	%d0,%sp@-		| push syscall number
 	jbsr	_C_LABEL(syscall)	| handle it
 	addql	#4,%sp			| pop syscall arg
-	tstl	_C_LABEL(astpending)
-	jne	Lrei2
-	tstb	_C_LABEL(ssir)
-	jeq	Ltrap1
-	movw	#SPL1,%sr
-	tstb	_C_LABEL(ssir)
-	jne	Lsir1
-Ltrap1:
+	tstl	_C_LABEL(astpending)	| AST pending?
+	jne	Lrei			| yes, handle it via trap
 	movl	%sp@(FR_SP),%a0		| grab and restore
 	movl	%a0,%usp		|   user SP
 	moveml	%sp@+,#0x7FFF		| restore most registers
@@ -684,16 +678,19 @@ ENTRY_NOPROFILE(lev5intr)
 
 ASENTRY_NOPROFILE(rei)
 	tstl	_C_LABEL(astpending)	| AST pending?
-	jeq	Lchksir			| no, go check for SIR
-Lrei1:
+	jne	1f			| no, done
+	rte
+1:
 	btst	#5,%sp@			| yes, are we returning to user mode?
-	jne	Lchksir			| no, go check for SIR
+	jeq	2f			| no, done
+	rte
+2:
 	movw	#PSL_LOWIPL,%sr		| lower SPL
 	clrl	%sp@-			| stack adjust
 	moveml	#0x,%sp@-		| save all registers
 	movl	%usp,%a1		| including
 	movl	%a1,%sp@(FR_SP)		|the users SP
-Lrei2:
+Lrei:
 	clrl	%sp@-			| VA == none
 	clrl	%sp@-			| code == none
 	movl	#T_ASTFLT,%sp@-		| type == async system trap
@@ -718,38 +715,6 @@ Laststkadj:
 	moveml	%sp@+,#0x7FFF		| restore user registers
 	movl	%sp@,%sp		| and our SP
 	rte| and do real RTE
-Lchksir:
-	tstb	_C_LABEL(ssir)		| SIR pending?
-	jeq	Ldorte			| no, all done
-	movl	%d0,%sp@-		| need a scratch register
-	movw	%sp@(4),%d0		| get SR
-	andw	#PSL_IPL7,%d0		| mask all but IPL
-	jne	Lnosir			| came from interrupt, no can do
-	movl	%sp@+,%d0		| restore scratch register
-Lgotsir:
-	movw	#SPL1,%sr		| prevent others from servicing int
-	tstb	_C_LABEL(ssir)		| too late?
-	jeq	Ldorte			| 

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

2014-03-22 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Sat Mar 22 16:39:20 UTC 2014

Modified Files:
src/sys/arch/arm/cortex: pl310_reg.h

Log Message:
Add defines for the PL310's L2C_PREFETCH_CTL and L2C_POWER_CTL registers as
per r3p2 spec.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/cortex/pl310_reg.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/cortex/pl310_reg.h
diff -u src/sys/arch/arm/cortex/pl310_reg.h:1.2 src/sys/arch/arm/cortex/pl310_reg.h:1.3
--- src/sys/arch/arm/cortex/pl310_reg.h:1.2	Fri Sep  7 11:49:00 2012
+++ src/sys/arch/arm/cortex/pl310_reg.h	Sat Mar 22 16:39:20 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: pl310_reg.h,v 1.2 2012/09/07 11:49:00 matt Exp $ */
+/* $NetBSD: pl310_reg.h,v 1.3 2014/03/22 16:39:20 reinoud Exp $ */
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -134,6 +134,21 @@
 
 #define	L2C_DEBUG_CTL		0xf40
 #define	L2C_PREFETCH_CTL	0xf60
+#define  PREFETCHCTL_DBLLINEF_EN	__BIT(30)
+#define  PREFETCHCTL_INSTRPREF_EN	__BIT(29)
+#define  PREFETCHCTL_DATAPREF_EN	__BIT(28)
+#define  PREFETCHCTL_DBLLINEF_WRAP_DA	__BIT(27)
+#define  PREFETCHCTL_PREF_DROP_EN	__BIT(24)
+#define  PREFETCHCTL_INCRDBL_LINEF_EN	__BIT(23)
+#define  PREFETCHCTL_NOSAMEID_EXCL_SEQ_EN __BIT(21)
+#define  PREFETCHCTL_PREFETCH_OFFSET_0	0
+#define  PREFETCHCTL_PREFETCH_OFFSET_7	7
+#define  PREFETCHCTL_PREFETCH_OFFSET_15	15
+#define  PREFETCHCTL_PREFETCH_OFFSET_23	23
+#define  PREFETCHCTL_PREFETCH_OFFSET_31	31
+
 #define	L2C_POWER_CTL		0xf80
+#define  POWERCTL_DYNCLKGATE	__BIT(1)
+#define  POWERCTL_STANDBY	__BIT(0)
 
 #endif /* _ARM_CORTEX_PL310_REG_H_ */



CVS commit: src/sys/dev

2014-03-22 Thread Patrick Welche
Module Name:src
Committed By:   prlw1
Date:   Sat Mar 22 16:08:51 UTC 2014

Modified Files:
src/sys/dev: vnd.c

Log Message:
DIOCGDISKINFO support for vnd
Reviewed by apb@ and christos@


To generate a diff of this commit:
cvs rdiff -u -r1.228 -r1.229 src/sys/dev/vnd.c

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

Modified files:

Index: src/sys/dev/vnd.c
diff -u src/sys/dev/vnd.c:1.228 src/sys/dev/vnd.c:1.229
--- src/sys/dev/vnd.c:1.228	Sun Mar 16 05:20:26 2014
+++ src/sys/dev/vnd.c	Sat Mar 22 16:08:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.228 2014/03/16 05:20:26 dholland Exp $	*/
+/*	$NetBSD: vnd.c,v 1.229 2014/03/22 16:08:51 prlw1 Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.228 2014/03/16 05:20:26 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.229 2014/03/22 16:08:51 prlw1 Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vnd.h"
@@ -1059,6 +1059,10 @@ vndioctl(dev_t dev, u_long cmd, void *da
 		return ENXIO;
 	vio = (struct vnd_ioctl *)data;
 
+	error = disk_ioctl(&vnd->sc_dkdev, cmd, data, flag, l);
+	if (error != EPASSTHROUGH)
+		return (error);
+
 	/* Must be open for writes for these commands... */
 	switch (cmd) {
 	case VNDIOCSET:
@@ -2022,6 +2026,12 @@ vnd_set_geometry(struct vnd_softc *vnd)
 	dg->dg_ntracks = vnd->sc_geom.vng_ntracks;
 	dg->dg_ncylinders = vnd->sc_geom.vng_ncylinders;
 
+#ifdef DEBUG
+	if (vnddebug & VDB_LABEL) {
+		printf("dg->dg_secperunit: %" PRId64 "\n", dg->dg_secperunit);
+		printf("dg->dg_ncylinders: %u\n", dg->dg_ncylinders);
+	}
+#endif
 	disk_set_info(vnd->sc_dev, &vnd->sc_dkdev, NULL);
 }
 



CVS commit: src/sys/arch/x68k/x68k

2014-03-22 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Mar 22 15:59:07 UTC 2014

Modified Files:
src/sys/arch/x68k/x68k: locore.s

Log Message:
Use common m68k/busaddrerr.s for bus error and address error handlers.

No binary changes on GENERIC.
(though the previous revision has not been tested on 040/060 yet)


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/x68k/x68k/locore.s

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

Modified files:

Index: src/sys/arch/x68k/x68k/locore.s
diff -u src/sys/arch/x68k/x68k/locore.s:1.115 src/sys/arch/x68k/x68k/locore.s:1.116
--- src/sys/arch/x68k/x68k/locore.s:1.115	Fri Mar 14 20:24:24 2014
+++ src/sys/arch/x68k/x68k/locore.s	Sat Mar 22 15:59:07 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.115 2014/03/14 20:24:24 tsutsui Exp $	*/
+/*	$NetBSD: locore.s,v 1.116 2014/03/22 15:59:07 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -392,176 +392,10 @@ Lenab3:
  */
 #include 
 
-#if defined(M68040) || defined(M68060)
-ENTRY_NOPROFILE(addrerr4060)
-	clrl	%sp@-			| stack adjust count
-	moveml	#0x,%sp@-		| save user registers
-	movl	%usp,%a0		| save the user SP
-	movl	%a0,%sp@(FR_SP)		|   in the savearea
-	movl	%sp@(FR_HW+8),%sp@-
-	clrl	%sp@-			| dummy code
-	movl	#T_ADDRERR,%sp@-	| mark address error
-	jra	_ASM_LABEL(faultstkadj)	| and deal with it
-#endif
-
-#if defined(M68060)
-ENTRY_NOPROFILE(buserr60)		| XXX
-	clrl	%sp@-			| stack adjust count
-	moveml	%d0-%d7/%a0-%a7,%sp@-	| save user registers
-	movl	%usp,%a0		| save the user SP
-	movl	%a0,%sp@(FR_SP)		|   in the savearea
-	movel	%sp@(FR_HW+12),%d0	| FSLW
-	btst	#2,%d0			| branch prediction error?
-	jeq	Lnobpe
-	movc	%cacr,%d2
-	orl	#IC60_CABC,%d2		| clear all branch cache entries
-	movc	%d2,%cacr
-	movl	%d0,%d1
-	andl	#0x7ffd,%d1		| check other faults
-	jeq	_ASM_LABEL(faultstkadjnotrap2)
-Lnobpe:
-| we need to adjust for misaligned addresses
-	movl	%sp@(FR_HW+8),%d1	| grab VA
-	btst	#27,%d0			| check for mis-aligned access
-	jeq	Lberr3			| no, skip
-	addl	#28,%d1			| yes, get into next page
-	| operand case: 3,
-	| instruction case: 4+12+12
-	| XXX instr. case not done yet
-	andl	#PG_FRAME,%d1		| and truncate
-Lberr3:
-	movl	%d1,%sp@-
-	movl	%d0,%sp@-		| code is FSLW now.
-	andw	#0x1f80,%d0
-	jeq	Lberr60			| it is a bus error
-	movl	#T_MMUFLT,%sp@-		| show that we are an MMU fault
-	jra	_ASM_LABEL(faultstkadj)	| and deal with it
-Lberr60:
-	tstl	_C_LABEL(nofault)	| catch bus error?
-	jeq	Lisberr			| no, handle as usual
-	movl	_C_LABEL(nofault),%sp@-	| yes,
-	jbsr	_C_LABEL(longjmp)	|  longjmp(nofault)
-	/* NOTREACHED */
-#endif
-
-#if defined(M68040)
-ENTRY_NOPROFILE(buserr40)
-	clrl	%sp@-			| stack adjust count
-	moveml	%d0-%d7/%a0-%a7,%sp@-	| save user registers
-	movl	%usp,%a0		| save the user SP
-	movl	%a0,%sp@(FR_SP)		|   in the savearea
-	movl	%sp@(FR_HW+20),%d1	| get fault address
-	moveq	#0,%d0
-	movw	%sp@(FR_HW+12),%d0	| get SSW
-	btst	#11,%d0			| check for mis-aligned
-	jeq	Lbe1stpg		| no skip
-	addl	#3,%d1			| get into next page
-	andl	#PG_FRAME,%d1		| and truncate
-Lbe1stpg:
-	movl	%d1,%sp@-		| pass fault address.
-	movl	%d0,%sp@-		| pass SSW as code
-	btst	#10,%d0			| test ATC
-	jeq	Lberr40			| it is a bus error
-	movl	#T_MMUFLT,%sp@-		| show that we are an MMU fault
-	jra	_ASM_LABEL(faultstkadj)	| and deal with it
-Lberr40:
-	tstl	_C_LABEL(nofault)	| catch bus error?
-	jeq	Lisberr			| no, handle as usual
-	movl	_C_LABEL(nofault),%sp@-	| yes,
-	jbsr	_C_LABEL(longjmp)	|  longjmp(nofault)
-	/* NOTREACHED */
-#endif
-
-#if defined(M68020) || defined(M68030)
-ENTRY_NOPROFILE(busaddrerr2030)
-	clrl	%sp@-			| stack adjust count
-	moveml	%d0-%d7/%a0-%a7,%sp@-	| save user registers
-	movl	%usp,%a0		| save the user SP
-	movl	%a0,%sp@(FR_SP)		|   in the savearea
-	moveq	#0,%d0
-	movw	%sp@(FR_HW+10),%d0	| grab SSW for fault processing
-	btst	#12,%d0			| RB set?
-	jeq	LbeX0			| no, test RC
-	bset	#14,%d0			| yes, must set FB
-	movw	%d0,%sp@(FR_HW+10)	| for hardware too
-LbeX0:
-	btst	#13,%d0			| RC set?
-	jeq	LbeX1			| no, skip
-	bset	#15,%d0			| yes, must set FC
-	movw	%d0,%sp@(FR_HW+10)	| for hardware too
-LbeX1:
-	btst	#8,%d0			| data fault?
-	jeq	Lbe0			| no, check for hard cases
-	movl	%sp@(FR_HW+16),%d1	| fault address is as given in frame
-	jra	Lbe10			| thats it
-Lbe0:
-	btst	#4,%sp@(FR_HW+6)	| long (type B) stack frame?
-	jne	Lbe4			| yes, go handle
-	movl	%sp@(FR_HW+2),%d1	| no, can use save PC
-	btst	#14,%d0			| FB set?
-	jeq	Lbe3			| no, try FC
-	addql	#4,%d1			| yes, adjust address
-	jra	Lbe10			| done
-Lbe3:
-	btst	#15,%d0			| FC set?
-	jeq	Lbe10			| no, done
-	addql	#2,%d1			| yes, adjust address
-	jra	Lbe10			| done
-Lbe4:
-	movl	%sp@(FR_HW+36),%d1	| long format, use stage B address
-	btst	#15,%d0			| FC set?
-	jeq	Lbe10			| no, all done
-	subql	#2,%d1			| yes, adjust address
-Lbe10:
-	movl	%d1,%sp@-		| push fault VA
-	movl	%d0,%sp@-		| and padded SSW
-	mov

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

2014-03-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Mar 22 15:13:10 UTC 2014

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

Log Message:
Make sure r1 is preserved _rtld_bind_start.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/libexec/ld.elf_so/arch/vax/rtld_start.S

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

Modified files:

Index: src/libexec/ld.elf_so/arch/vax/rtld_start.S
diff -u src/libexec/ld.elf_so/arch/vax/rtld_start.S:1.21 src/libexec/ld.elf_so/arch/vax/rtld_start.S:1.22
--- src/libexec/ld.elf_so/arch/vax/rtld_start.S:1.21	Fri Mar 21 14:03:30 2014
+++ src/libexec/ld.elf_so/arch/vax/rtld_start.S	Sat Mar 22 15:13:10 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld_start.S,v 1.21 2014/03/21 14:03:30 matt Exp $	*/
+/*	$NetBSD: rtld_start.S,v 1.22 2014/03/22 15:13:10 matt Exp $	*/
 
 /*
  * Copyright 1996 Matt Thomas 
@@ -61,6 +61,7 @@ END(_rtld_start)
  * SP+0: obj entry points
  */
 ALTENTRY(_rtld_bind_start)
+	pushl	%r1		/* need to preserve r1 */
 	movq	-8(%fp),%r0	/* get addresses of plt.got & reloc index */
 	pushl	(%r1)		/* push relocation offset */
 	pushl	%r0		/* push address of obj entry */
@@ -95,7 +96,8 @@ ALTENTRY(_rtld_bind_start)
 11:	movl	%r1,16(%fp)	/* backup to the calls/callg */
 	jbc	$29,4(%fp),12f	/* skip if this was a callg */
 	clrl	(%ap)		/* clear argument count */
-12:	ret			/* return and redo the call */
+12:	movl	(%sp)+,%r1	/* restore r1 */
+	ret			/* return and redo the call */
 
 #if 1
 20:
@@ -114,11 +116,13 @@ ALTENTRY(_rtld_bind_start)
 	movq	4(%fp),%r2	/* fetch callframe status & saved AP */
 	movq	12(%fp),%r4	/* fetch callframe saved FP & PC */
 	insv	%r1,$16,$12,%r2	/* update save mask */
+	movl	(%sp)+,%fp	/* use fp to keep saved r1 */
 	movl	%ap,%sp		/* reset stack to top of callframe */
 22:	pushr	%r1		/* push registers */
 	movq	%r4,-(%sp)	/* push callframe saved FP & PC */
 	movq	%r2,-(%sp)	/* push callframe status & saved AP */
 	pushl	$0		/* push condition handler */
+	movl	%fp,%r1		/* restore r1 */
 	movl	%sp,%fp		/* sp == fp now */
 #if 1
 	jmp	2(%r0)		/* jump past entry mask */



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

2014-03-22 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Sat Mar 22 13:40:55 UTC 2014

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

Log Message:
Add a few xorg lint libraries.


To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.150 src/distrib/sets/lists/xcomp/mi

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

Modified files:

Index: src/distrib/sets/lists/xcomp/mi
diff -u src/distrib/sets/lists/xcomp/mi:1.149 src/distrib/sets/lists/xcomp/mi:1.150
--- src/distrib/sets/lists/xcomp/mi:1.149	Thu Mar 20 09:05:28 2014
+++ src/distrib/sets/lists/xcomp/mi	Sat Mar 22 13:40:55 2014
@@ -1,4 +1,4 @@
-#	 $NetBSD: mi,v 1.149 2014/03/20 09:05:28 mrg Exp $
+#	 $NetBSD: mi,v 1.150 2014/03/22 13:40:55 njoly Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -9320,12 +9320,15 @@
 ./usr/libdata/lint/llib-loldX.ln			-unknown-	lint,x11
 ./usr/libdata/lint/llib-lpciaccess.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-lpsres.ln			-unknown-	lint,x11
+./usr/libdata/lint/llib-lpthread-stubs.ln		-unknown-	lint,xorg
 ./usr/libdata/lint/llib-lre.ln-unknown-	lint,xorg
 ./usr/libdata/lint/llib-lxcb-composite.ln		-unknown-	lint,xorg
 ./usr/libdata/lint/llib-lxcb-damage.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-lxcb-dpms.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-lxcb-dri2.ln			-unknown-	lint,xorg
+./usr/libdata/lint/llib-lxcb-dri3.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-lxcb-glx.ln			-unknown-	lint,xorg
+./usr/libdata/lint/llib-lxcb-present.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-lxcb-randr.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-lxcb-record.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-lxcb-render.ln			-unknown-	lint,xorg
@@ -9338,6 +9341,7 @@
 ./usr/libdata/lint/llib-lxcb-xf86dri.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-lxcb-xfixes.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-lxcb-xinerama.ln		-unknown-	lint,xorg
+./usr/libdata/lint/llib-lxcb-xkb.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-lxcb-xtest.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-lxcb-xv.ln			-unknown-	lint,xorg
 ./usr/libdata/lint/llib-lxcb-xvmc.ln			-unknown-	lint,xorg



CVS commit: src/share/man/man9

2014-03-22 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Mar 22 11:35:03 UTC 2014

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

Log Message:
New sentence, new line; slight wording improvements.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/share/man/man9/ltsleep.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/ltsleep.9
diff -u src/share/man/man9/ltsleep.9:1.16 src/share/man/man9/ltsleep.9:1.17
--- src/share/man/man9/ltsleep.9:1.16	Sat Mar 22 11:25:54 2014
+++ src/share/man/man9/ltsleep.9	Sat Mar 22 11:35:03 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ltsleep.9,v 1.16 2014/03/22 11:25:54 skrll Exp $
+.\"	$NetBSD: ltsleep.9,v 1.17 2014/03/22 11:35:03 wiz Exp $
 .\"
 .\" Copyright (c) 1996, 2002, 2007 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -139,7 +139,8 @@ function takes an additional argument an
 .It Fa mtx
 A
 .Xr mutex 9
-representing the lock protecting the data-structures. On entry
+representing the lock protecting the data-structures.
+On entry
 .Fn mtsleep
 will release the lock and re-acquire the lock on return.
 .It Fa priority
@@ -191,7 +192,7 @@ If
 .Fn tsleep
 and
 .Fn mtsleep
-returns because of a timeout it returns
+return because of a timeout, the return value is
 .Er EWOULDBLOCK .
 .Sh MIGRATING TO CONDVAR
 Note the conversion from tsleep/wakeup into
@@ -200,7 +201,7 @@ should not be done mechanically i.e.
 .Dq blindly .
 Code logic should be understood before changing, and it may also need to be
 revisited for the change.
-Please also read
+Please also read the
 .Xr condvar 9
 man page.
 .Pp



CVS commit: src/share/man/man9

2014-03-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Mar 22 11:25:55 UTC 2014

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

Log Message:
Bump date for previous


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/share/man/man9/ltsleep.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/ltsleep.9
diff -u src/share/man/man9/ltsleep.9:1.15 src/share/man/man9/ltsleep.9:1.16
--- src/share/man/man9/ltsleep.9:1.15	Sat Mar 22 11:24:36 2014
+++ src/share/man/man9/ltsleep.9	Sat Mar 22 11:25:54 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ltsleep.9,v 1.15 2014/03/22 11:24:36 skrll Exp $
+.\"	$NetBSD: ltsleep.9,v 1.16 2014/03/22 11:25:54 skrll Exp $
 .\"
 .\" Copyright (c) 1996, 2002, 2007 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 28, 2012
+.Dd March 22, 2014
 .Dt LTSLEEP 9
 .Os
 .Sh NAME



CVS commit: src

2014-03-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Mar 22 11:24:36 UTC 2014

Modified Files:
src/distrib/sets/lists/comp: mi
src/share/man/man9: Makefile ltsleep.9

Log Message:
Add mtsleep(9) and a description of how it, tsleep(9), and wakeup(9)
should all be replaced with condvar(9).

While here clear out the lock(9) reference(s) and the obsoleted example.

Based on misc/48671


To generate a diff of this commit:
cvs rdiff -u -r1.1884 -r1.1885 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.375 -r1.376 src/share/man/man9/Makefile
cvs rdiff -u -r1.14 -r1.15 src/share/man/man9/ltsleep.9

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1884 src/distrib/sets/lists/comp/mi:1.1885
--- src/distrib/sets/lists/comp/mi:1.1884	Fri Mar 21 13:30:39 2014
+++ src/distrib/sets/lists/comp/mi	Sat Mar 22 11:24:35 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1884 2014/03/21 13:30:39 wiz Exp $
+#	$NetBSD: mi,v 1.1885 2014/03/22 11:24:35 skrll Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -10453,6 +10453,7 @@
 ./usr/share/man/cat9/mstohz.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/mtocl.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/mtod.0			comp-sys-catman		.cat
+./usr/share/man/cat9/mtsleep.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/mutex.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/mutex_destroy.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/mutex_enter.0		comp-sys-catman		.cat
@@ -17144,6 +17145,7 @@
 ./usr/share/man/html9/mstohz.html		comp-sys-htmlman	html
 ./usr/share/man/html9/mtocl.html		comp-sys-htmlman	html
 ./usr/share/man/html9/mtod.html			comp-sys-htmlman	html
+./usr/share/man/html9/mtsleep.html		comp-sys-htmlman	html
 ./usr/share/man/html9/mutex.html		comp-sys-htmlman	html
 ./usr/share/man/html9/mutex_destroy.html	comp-sys-htmlman	html
 ./usr/share/man/html9/mutex_enter.html		comp-sys-htmlman	html
@@ -23996,6 +23998,7 @@
 ./usr/share/man/man9/mstohz.9			comp-sys-man		.man
 ./usr/share/man/man9/mtocl.9			comp-sys-man		.man
 ./usr/share/man/man9/mtod.9			comp-sys-man		.man
+./usr/share/man/man9/mtsleep.9			comp-sys-man		.man
 ./usr/share/man/man9/mutex.9			comp-sys-man		.man
 ./usr/share/man/man9/mutex_destroy.9		comp-sys-man		.man
 ./usr/share/man/man9/mutex_enter.9		comp-sys-man		.man

Index: src/share/man/man9/Makefile
diff -u src/share/man/man9/Makefile:1.375 src/share/man/man9/Makefile:1.376
--- src/share/man/man9/Makefile:1.375	Tue Mar 18 10:21:47 2014
+++ src/share/man/man9/Makefile	Sat Mar 22 11:24:36 2014
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.375 2014/03/18 10:21:47 hannken Exp $
+#   $NetBSD: Makefile,v 1.376 2014/03/22 11:24:36 skrll Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -450,7 +450,7 @@ MLINKS+=lock.9 simple_lock_init.9 lock.9
 	lock.9 lockinit.9 lock.9 lockmgr.9 \
 	lock.9 lockstatus.9 lock.9 lockmgr_printinfo.9 lock.9 transferlockers.9 \
 	lock.9 spinlockinit.9 lock.9 spinlockmgr.9
-MLINKS+=ltsleep.9 wakeup.9 ltsleep.9 tsleep.9
+MLINKS+=ltsleep.9 wakeup.9 ltsleep.9 mtsleep.9 ltsleep.9 tsleep.9
 MLINKS+=malloc.9 MALLOC.9 malloc.9 realloc.9 malloc.9 free.9 malloc.9 FREE.9
 MLINKS+=malloc.9 malloc_roundup.9 malloc.9 malloc_type_attach.9
 MLINKS+=malloc.9 malloc_type_detach.9 malloc.9 malloc_type_setlimit.9

Index: src/share/man/man9/ltsleep.9
diff -u src/share/man/man9/ltsleep.9:1.14 src/share/man/man9/ltsleep.9:1.15
--- src/share/man/man9/ltsleep.9:1.14	Sat Jan 28 13:26:12 2012
+++ src/share/man/man9/ltsleep.9	Sat Mar 22 11:24:36 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ltsleep.9,v 1.14 2012/01/28 13:26:12 wiz Exp $
+.\"	$NetBSD: ltsleep.9,v 1.15 2014/03/22 11:24:36 skrll Exp $
 .\"
 .\" Copyright (c) 1996, 2002, 2007 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -32,12 +32,15 @@
 .Os
 .Sh NAME
 .Nm ltsleep ,
+.Nm mtsleep ,
 .Nm tsleep ,
 .Nm wakeup
 .Nd process context sleep and wakeup
 .Sh SYNOPSIS
 .In sys/proc.h
 .Ft int
+.Fn "mtsleep" "wchan_t ident" "pri_t priority" "const char *wmesg" "int timo" "kmutex_t *mtx"
+.Ft int
 .Fn "tsleep" "wchan_t ident" "pri_t priority" "const char *wmesg" "int timo"
 .Ft void
 .Fn "wakeup" "wchan_t ident"
@@ -58,7 +61,9 @@
 .Pp
 These functions implement voluntary context switching.
 .Fn tsleep
-is used throughout the kernel whenever processing in the current context
+and
+.Fn mtsleep
+are used throughout the kernel whenever processing in the current context
 can not continue for any of the following reasons:
 .Bl -bullet -offset indent
 .It
@@ -67,9 +72,6 @@ The current process needs to await the r
 The current process needs resources
 .Pq e.g., memory
 which are temporarily unavailable.
-.It
-The current process wants access to data-structures which are locked by
-other processes.
 .El
 .Pp
 The function
@@ -83,7 +85,9 @@ condition has cleared.
 .Pp
 The
 .Fn tsleep

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

2014-03-22 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Sat Mar 22 09:46:33 UTC 2014

Modified Files:
src/sys/arch/arm/imx: imx51_ccm.c imx51_ccmreg.h imx51_ccmvar.h
imx51_esdhc.c

Log Message:
Fix SDHC clocks.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/imx/imx51_ccm.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/imx51_ccmreg.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/imx51_ccmvar.h \
src/sys/arch/arm/imx/imx51_esdhc.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/imx/imx51_ccm.c
diff -u src/sys/arch/arm/imx/imx51_ccm.c:1.4 src/sys/arch/arm/imx/imx51_ccm.c:1.5
--- src/sys/arch/arm/imx/imx51_ccm.c:1.4	Sat Mar 22 09:28:08 2014
+++ src/sys/arch/arm/imx/imx51_ccm.c	Sat Mar 22 09:46:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx51_ccm.c,v 1.4 2014/03/22 09:28:08 hkenken Exp $	*/
+/*	$NetBSD: imx51_ccm.c,v 1.5 2014/03/22 09:46:33 hkenken Exp $	*/
 /*
  * Copyright (c) 2010, 2011, 2012  Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx51_ccm.c,v 1.4 2014/03/22 09:28:08 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx51_ccm.c,v 1.5 2014/03/22 09:46:33 hkenken Exp $");
 
 #include 
 #include 
@@ -294,6 +294,52 @@ imx51_get_clock(enum imx51_clock clk)
 break;
 			}
 		return freq;
+	case IMX51CLK_ESDHC2_CLK_ROOT:
+	case IMX51CLK_ESDHC4_CLK_ROOT:
+		cscmr1 = bus_space_read_4(iot, ioh, CCMC_CSCMR1);
+
+		sel = 0;
+		if (clk == IMX51CLK_ESDHC2_CLK_ROOT)
+			sel = __SHIFTOUT(cscmr1, CSCMR1_ESDHC2_CLK_SEL);
+		else if (clk == IMX51CLK_ESDHC4_CLK_ROOT)
+			sel = __SHIFTOUT(cscmr1, CSCMR1_ESDHC4_CLK_SEL);
+
+		if (sel == 0)
+			freq = imx51_get_clock(IMX51CLK_ESDHC1_CLK_ROOT);
+		else
+			freq = imx51_get_clock(IMX51CLK_ESDHC3_CLK_ROOT);
+
+		return freq;
+	case IMX51CLK_ESDHC1_CLK_ROOT:
+	case IMX51CLK_ESDHC3_CLK_ROOT:
+
+		cscdr1 = bus_space_read_4(iot, ioh, CCMC_CSCDR1);
+		cscmr1 = bus_space_read_4(iot, ioh, CCMC_CSCMR1);
+
+		sel = 0;
+		if (clk == IMX51CLK_ESDHC1_CLK_ROOT)
+			sel = __SHIFTOUT(cscmr1, CSCMR1_ESDHC1_CLK_SEL);
+		else if (clk == IMX51CLK_ESDHC3_CLK_ROOT)
+			sel = __SHIFTOUT(cscmr1, CSCMR1_ESDHC3_CLK_SEL);
+
+		switch (sel) {
+		case 0:
+		case 1:
+		case 2:
+			freq = imx51_get_clock(IMX51CLK_PLL1SW + sel);
+			break;
+		case 3:
+			freq = imx51_get_clock(IMX51CLK_LP_APM);
+			break;
+		}
+
+		if (clk == IMX51CLK_ESDHC1_CLK_ROOT)
+			freq = freq / (1 + __SHIFTOUT(cscdr1, CSCDR1_ESDHC1_CLK_PRED)) /
+			(1 + __SHIFTOUT(cscdr1, CSCDR1_ESDHC1_CLK_PODF));
+		else if (clk == IMX51CLK_ESDHC3_CLK_ROOT)
+			freq = freq / (1 + __SHIFTOUT(cscdr1, CSCDR1_ESDHC3_CLK_PRED)) /
+			(1 + __SHIFTOUT(cscdr1, CSCDR1_ESDHC3_CLK_PODF));
+		return freq;
 	case IMX51CLK_CSPI_CLK_ROOT:
 		cscmr1 = bus_space_read_4(iot, ioh, CCMC_CSCMR1);
 		cscdr2 = bus_space_read_4(iot, ioh, CCMC_CSCDR2);

Index: src/sys/arch/arm/imx/imx51_ccmreg.h
diff -u src/sys/arch/arm/imx/imx51_ccmreg.h:1.3 src/sys/arch/arm/imx/imx51_ccmreg.h:1.4
--- src/sys/arch/arm/imx/imx51_ccmreg.h:1.3	Sat Mar 22 09:28:08 2014
+++ src/sys/arch/arm/imx/imx51_ccmreg.h	Sat Mar 22 09:46:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx51_ccmreg.h,v 1.3 2014/03/22 09:28:08 hkenken Exp $	*/
+/*	$NetBSD: imx51_ccmreg.h,v 1.4 2014/03/22 09:46:33 hkenken Exp $	*/
 /*
  * Copyright (c) 2011, 2012  Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -85,9 +85,17 @@
 #define	CCMC_CSCMR1	0x001c
 #define	 CSCMR1_UART_CLK_SEL_SHIFT	24
 #define	 CSCMR1_UART_CLK_SEL_MASK	__BITS(25, CSCMR1_UART_CLK_SEL_SHIFT)
+#define	 CSCMR1_ESDHC1_CLK_SEL		__BITS(22, 21)
+#define	 CSCMR1_ESDHC2_CLK_SEL		__BIT(20)
+#define	 CSCMR1_ESDHC4_CLK_SEL		__BIT(19)
+#define	 CSCMR1_ESDHC3_CLK_SEL		__BITS(18, 16)
 #define	 CSCMR1_CSPI_CLK_SEL		__BITS(5, 4)
 #define	CCMC_CSCMR2	0x0020
 #define	CCMC_CSCDR1	0x0024
+#define	 CSCDR1_ESDHC3_CLK_PRED		__BITS(24, 22)
+#define	 CSCDR1_ESDHC3_CLK_PODF		__BITS(21, 19)
+#define	 CSCDR1_ESDHC1_CLK_PRED		__BITS(18, 16)
+#define	 CSCDR1_ESDHC1_CLK_PODF		__BITS(13, 11)
 #define	 CSCDR1_UART_CLK_PRED_SHIFT	3
 #define	 CSCDR1_UART_CLK_PRED_MASK	__BITS(5, CSCDR1_UART_CLK_PRED_SHIFT)
 #define	 CSCDR1_UART_CLK_PODF_SHIFT	0

Index: src/sys/arch/arm/imx/imx51_ccmvar.h
diff -u src/sys/arch/arm/imx/imx51_ccmvar.h:1.1 src/sys/arch/arm/imx/imx51_ccmvar.h:1.2
--- src/sys/arch/arm/imx/imx51_ccmvar.h:1.1	Tue Apr 17 09:33:31 2012
+++ src/sys/arch/arm/imx/imx51_ccmvar.h	Sat Mar 22 09:46:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx51_ccmvar.h,v 1.1 2012/04/17 09:33:31 bsh Exp $	*/
+/*	$NetBSD: imx51_ccmvar.h,v 1.2 2014/03/22 09:46:33 hkenken Exp $	*/
 /*
  * Copyright (c) 2012  Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -56,6 +56,7 @@ enum imx51_clock {
 	IMX51CLK_ESDHC1_CLK_ROOT,
 	IMX51CLK_ES

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

2014-03-22 Thread Kenichi Hashimoto
Module Name:src
Committed By:   hkenken
Date:   Sat Mar 22 09:28:08 UTC 2014

Modified Files:
src/sys/arch/arm/imx: files.imx51 imx51_ccm.c imx51_ccmreg.h
Added Files:
src/sys/arch/arm/imx: imx51_spi.c imxcspireg.h imxecspireg.h imxspi.c
imxspireg.h imxspivar.h

Log Message:
Add SPI driver.
i.MX51 have two eCSPI, and one CSPI.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/imx/files.imx51
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/imx51_ccm.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/imx51_ccmreg.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/imx/imx51_spi.c \
src/sys/arch/arm/imx/imxcspireg.h src/sys/arch/arm/imx/imxecspireg.h \
src/sys/arch/arm/imx/imxspi.c src/sys/arch/arm/imx/imxspireg.h \
src/sys/arch/arm/imx/imxspivar.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/imx/files.imx51
diff -u src/sys/arch/arm/imx/files.imx51:1.7 src/sys/arch/arm/imx/files.imx51:1.8
--- src/sys/arch/arm/imx/files.imx51:1.7	Sat Mar 22 05:19:18 2014
+++ src/sys/arch/arm/imx/files.imx51	Sat Mar 22 09:28:08 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files.imx51,v 1.7 2014/03/22 05:19:18 hkenken Exp $
+#	$NetBSD: files.imx51,v 1.8 2014/03/22 09:28:08 hkenken Exp $
 #
 # Configuration info for the Freescale i.MX51
 #
@@ -104,9 +104,15 @@ file	arch/arm/imx/imx51_esdhc.c		sdhc_ax
 # attach	imxi2c at aips with imxi2c_aips
 # file	arch/arm/imx/imxi2c_aips.c		imxi2c_aips
 
-# spi bus controlloer
-# device	imxspi: spibus
-# file	arch/arm/imx/imx51_spi.c		imxspi
+# SPI bus controlloer
+# attach of this driver need to be specified in paltform configuration
+# use flags to module version
+device  imxspi : spibus
+filearch/arm/imx/imxspi.c			imxspi
+defparam opt_imxspi.h   	IMXSPINSLAVES
+defparam opt_imxspi.hIMXSPI_DEBUG
+# attach	imxspi at axi with imx51_spi
+# file	arch/arm/imx/imx51_spi.c		imx51_spi
 
 # Smart Direct Memory Access Controller
 # device	imxsdma: dmover_service, bus_dma_generic

Index: src/sys/arch/arm/imx/imx51_ccm.c
diff -u src/sys/arch/arm/imx/imx51_ccm.c:1.3 src/sys/arch/arm/imx/imx51_ccm.c:1.4
--- src/sys/arch/arm/imx/imx51_ccm.c:1.3	Wed Sep 19 07:28:38 2012
+++ src/sys/arch/arm/imx/imx51_ccm.c	Sat Mar 22 09:28:08 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx51_ccm.c,v 1.3 2012/09/19 07:28:38 bsh Exp $	*/
+/*	$NetBSD: imx51_ccm.c,v 1.4 2014/03/22 09:28:08 hkenken Exp $	*/
 /*
  * Copyright (c) 2010, 2011, 2012  Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx51_ccm.c,v 1.3 2012/09/19 07:28:38 bsh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx51_ccm.c,v 1.4 2014/03/22 09:28:08 hkenken Exp $");
 
 #include 
 #include 
@@ -146,6 +146,7 @@ imx51_get_clock(enum imx51_clock clk)
 	uint32_t cacrr;	/* ARM clock root register */
 	uint32_t ccsr;
 	uint32_t cscdr1;
+	uint32_t cscdr2;
 	uint32_t cscmr1;
 	uint32_t cbcdr;
 	uint32_t cbcmr;
@@ -293,6 +294,26 @@ imx51_get_clock(enum imx51_clock clk)
 break;
 			}
 		return freq;
+	case IMX51CLK_CSPI_CLK_ROOT:
+		cscmr1 = bus_space_read_4(iot, ioh, CCMC_CSCMR1);
+		cscdr2 = bus_space_read_4(iot, ioh, CCMC_CSCDR2);
+
+		sel = __SHIFTOUT(cscmr1, CSCMR1_CSPI_CLK_SEL);
+		switch (sel) {
+		case 0:
+		case 1:
+		case 2:
+			freq = imx51_get_clock(IMX51CLK_PLL1SW + sel);
+			break;
+		case 3:
+			freq = imx51_get_clock(IMX51CLK_LP_APM);
+			break;
+		}
+
+		freq = freq / (1 + __SHIFTOUT(cscdr2, CSCDR2_ECSPI_CLK_PRED)) /
+		(1 + __SHIFTOUT(cscdr2, CSCDR2_ECSPI_CLK_PODF));
+
+		return freq;
 	default:
 		aprint_error_dev(ccm_softc->sc_dev,
 		"clock %d: not supported yet\n", clk);

Index: src/sys/arch/arm/imx/imx51_ccmreg.h
diff -u src/sys/arch/arm/imx/imx51_ccmreg.h:1.2 src/sys/arch/arm/imx/imx51_ccmreg.h:1.3
--- src/sys/arch/arm/imx/imx51_ccmreg.h:1.2	Sat Sep  1 00:07:32 2012
+++ src/sys/arch/arm/imx/imx51_ccmreg.h	Sat Mar 22 09:28:08 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx51_ccmreg.h,v 1.2 2012/09/01 00:07:32 matt Exp $	*/
+/*	$NetBSD: imx51_ccmreg.h,v 1.3 2014/03/22 09:28:08 hkenken Exp $	*/
 /*
  * Copyright (c) 2011, 2012  Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi for Genetec Corporation.
@@ -85,6 +85,7 @@
 #define	CCMC_CSCMR1	0x001c
 #define	 CSCMR1_UART_CLK_SEL_SHIFT	24
 #define	 CSCMR1_UART_CLK_SEL_MASK	__BITS(25, CSCMR1_UART_CLK_SEL_SHIFT)
+#define	 CSCMR1_CSPI_CLK_SEL		__BITS(5, 4)
 #define	CCMC_CSCMR2	0x0020
 #define	CCMC_CSCDR1	0x0024
 #define	 CSCDR1_UART_CLK_PRED_SHIFT	3
@@ -96,6 +97,8 @@
 #define	CCMC_CDCDR	0x0030
 #define	CCMC_CHSCCDR	0x0034		// i.MX6
 #define	CCMC_CSCDR2	0x0038
+#define	 CSCDR2_ECSPI_CLK_PRED		__BITS(27, 25)
+#define	 CSCDR2_ECSPI_CLK_PODF		__BITS(24, 19)
 #define	CCMC_CSCDR3	0x003c
 #define	CCMC_CSCDR4	0x0040
 #define	CCMC_CWDR	0x0044

Added files:

Index: src/sys/arch/arm/imx/imx51_spi.c
diff -u /d

CVS commit: src/sys

2014-03-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Mar 22 08:15:25 UTC 2014

Modified Files:
src/sys/compat/netbsd32: netbsd32_netbsd.c
src/sys/kern: vfs_syscalls.c

Log Message:
Fix a potential - but very unlikely - NULL pointer dereference.
(it does not introduce a new error code for open(), since
 pathbuf_copyin() is already there and can return ENOMEM)

Found by my code scanner.


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/sys/compat/netbsd32/netbsd32_netbsd.c
cvs rdiff -u -r1.476 -r1.477 src/sys/kern/vfs_syscalls.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_netbsd.c
diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.184 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.185
--- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.184	Mon Feb  3 13:20:20 2014
+++ src/sys/compat/netbsd32/netbsd32_netbsd.c	Sat Mar 22 08:15:25 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_netbsd.c,v 1.184 2014/02/03 13:20:20 manu Exp $	*/
+/*	$NetBSD: netbsd32_netbsd.c,v 1.185 2014/03/22 08:15:25 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.184 2014/02/03 13:20:20 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.185 2014/03/22 08:15:25 maxv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ddb.h"
@@ -241,8 +241,11 @@ netbsd32_open(struct lwp *l, const struc
 		error = pathbuf_copyin(SCARG(&ua, path), &pb);
 		if (error) 
 			return error; 
-	} else
+	} else {
 		pb = pathbuf_create(".");
+		if (pb == NULL)
+			return ENOMEM;
+	}
 
 error = do_open(l, NULL, pb, SCARG(&ua, flags), SCARG(&ua, mode), &fd);
 pathbuf_destroy(pb);

Index: src/sys/kern/vfs_syscalls.c
diff -u src/sys/kern/vfs_syscalls.c:1.476 src/sys/kern/vfs_syscalls.c:1.477
--- src/sys/kern/vfs_syscalls.c:1.476	Sat Feb 15 22:32:16 2014
+++ src/sys/kern/vfs_syscalls.c	Sat Mar 22 08:15:25 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls.c,v 1.476 2014/02/15 22:32:16 njoly Exp $	*/
+/*	$NetBSD: vfs_syscalls.c,v 1.477 2014/03/22 08:15:25 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.476 2014/02/15 22:32:16 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.477 2014/03/22 08:15:25 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_fileassoc.h"
@@ -1624,9 +1624,11 @@ do_sys_openat(lwp_t *l, int fdat, const 
 	int error;
 
 #ifdef COMPAT_10	/* XXX: and perhaps later */
-	if (path == NULL)
+	if (path == NULL) {
 		pb = pathbuf_create(".");
-	else
+		if (pb == NULL)
+			return ENOMEM;
+	} else
 #endif
 	{
 		error = pathbuf_copyin(path, &pb);



CVS commit: src/share/man/man4

2014-03-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Mar 22 07:49:06 UTC 2014

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

Log Message:
Remove reference to simplelock


To generate a diff of this commit:
cvs rdiff -u -r1.434 -r1.435 src/share/man/man4/options.4

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

Modified files:

Index: src/share/man/man4/options.4
diff -u src/share/man/man4/options.4:1.434 src/share/man/man4/options.4:1.435
--- src/share/man/man4/options.4:1.434	Sun Feb  2 08:34:39 2014
+++ src/share/man/man4/options.4	Sat Mar 22 07:49:06 2014
@@ -1,4 +1,4 @@
-.\"	$NetBSD: options.4,v 1.434 2014/02/02 08:34:39 wiz Exp $
+.\"	$NetBSD: options.4,v 1.435 2014/03/22 07:49:06 skrll Exp $
 .\"
 .\" Copyright (c) 1996
 .\" 	Perry E. Metzger.  All rights reserved.
@@ -30,7 +30,7 @@
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\"
-.Dd October 13, 2013
+.Dd March 22, 2014
 .Dt OPTIONS 4
 .Os
 .Sh NAME
@@ -611,7 +611,7 @@ structures is detected.
 These checks can decrease performance up to 15%.
 .It Cd options LOCKDEBUG
 Adds code to the kernel to detect incorrect use of locking primitives
-(mutex, rwlock, simplelock).
+(mutex, rwlock).
 This code will cause the kernel to check for dead lock conditions.
 It will also check for memory being freed to not contain initialised
 lock primitives.



CVS commit: src/sys/net

2014-03-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Mar 22 07:46:35 UTC 2014

Modified Files:
src/sys/net: route.c

Log Message:
'newrt' is not supposed to be NULL. Therefore, the NULL-check in the if()
is pointless; and even if 'newrt' were NULL, 'rt' would be dereferenced
later. This is not a bug.

CID 270855

ok christos@


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/sys/net/route.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/net/route.c
diff -u src/sys/net/route.c:1.128 src/sys/net/route.c:1.129
--- src/sys/net/route.c:1.128	Tue Feb 25 18:30:12 2014
+++ src/sys/net/route.c	Sat Mar 22 07:46:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.128 2014/02/25 18:30:12 pooka Exp $	*/
+/*	$NetBSD: route.c,v 1.129 2014/03/22 07:46:35 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -93,7 +93,7 @@
 #include "opt_route.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.128 2014/02/25 18:30:12 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.129 2014/03/22 07:46:35 maxv Exp $");
 
 #include 
 #include 
@@ -341,7 +341,8 @@ rtalloc1(const struct sockaddr *dst, int
 goto miss;
 			}
 			KASSERT(newrt != NULL);
-			if ((rt = newrt) && (rt->rt_flags & RTF_XRESOLVE)) {
+			rt = newrt;
+			if (rt->rt_flags & RTF_XRESOLVE) {
 msgtype = RTM_RESOLVE;
 goto miss;
 			}



CVS commit: src/sys/kern

2014-03-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Mar 22 07:27:22 UTC 2014

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

Log Message:
Small changes:
 - rename elf_load_file() to elf_load_interp()
 - use the correct type for 'nused'
 - remove useless cases
 - reorder a kmem_alloc

ok christos@


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/kern/exec_elf.c

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

Modified files:

Index: src/sys/kern/exec_elf.c
diff -u src/sys/kern/exec_elf.c:1.64 src/sys/kern/exec_elf.c:1.65
--- src/sys/kern/exec_elf.c:1.64	Sun Mar 16 07:57:25 2014
+++ src/sys/kern/exec_elf.c	Sat Mar 22 07:27:21 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_elf.c,v 1.64 2014/03/16 07:57:25 maxv Exp $	*/
+/*	$NetBSD: exec_elf.c,v 1.65 2014/03/22 07:27:21 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1994, 2000, 2005 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: exec_elf.c,v 1.64 2014/03/16 07:57:25 maxv Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exec_elf.c,v 1.65 2014/03/22 07:27:21 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pax.h"
@@ -90,7 +90,7 @@ extern struct emul emul_netbsd;
 
 #define elf_check_header	ELFNAME(check_header)
 #define elf_copyargs		ELFNAME(copyargs)
-#define elf_load_file		ELFNAME(load_file)
+#define elf_load_interp		ELFNAME(load_interp)
 #define elf_load_psection	ELFNAME(load_psection)
 #define exec_elf_makecmds	ELFNAME2(exec,makecmds)
 #define netbsd_elf_signature	ELFNAME2(netbsd,signature)
@@ -99,7 +99,7 @@ extern struct emul emul_netbsd;
 #define	elf_free_emul_arg	ELFNAME(free_emul_arg)
 
 static int
-elf_load_file(struct lwp *, struct exec_package *, char *,
+elf_load_interp(struct lwp *, struct exec_package *, char *,
 struct exec_vmcmd_set *, u_long *, Elf_Addr *);
 static void
 elf_load_psection(struct exec_vmcmd_set *, struct vnode *, const Elf_Phdr *,
@@ -396,14 +396,12 @@ elf_load_psection(struct exec_vmcmd_set 
 }
 
 /*
- * elf_load_file():
+ * elf_load_interp():
  *
- * Load a file (interpreter/library) pointed to by path
- * [stolen from coff_load_shlib()]. Made slightly generic
- * so it might be used externally.
+ * Load an interpreter pointed to by path.
  */
 static int
-elf_load_file(struct lwp *l, struct exec_package *epp, char *path,
+elf_load_interp(struct lwp *l, struct exec_package *epp, char *path,
 struct exec_vmcmd_set *vcset, u_long *entryoff, Elf_Addr *last)
 {
 	int error, i;
@@ -610,11 +608,6 @@ elf_load_file(struct lwp *l, struct exec
 			break;
 		}
 
-		case PT_DYNAMIC:
-		case PT_PHDR:
-		case PT_NOTE:
-			break;
-
 		default:
 			break;
 		}
@@ -659,7 +652,7 @@ exec_elf_makecmds(struct lwp *l, struct 
 	int error, i;
 	char *interp = NULL;
 	u_long phsize;
-	struct elf_args *ap = NULL;
+	struct elf_args *ap;
 	bool is_dyn = false;
 
 	if (epp->ep_hdrvalid < sizeof(Elf_Ehdr))
@@ -781,7 +774,6 @@ exec_elf_makecmds(struct lwp *l, struct 
 		case PT_INTERP:
 			/* Already did this one. */
 		case PT_DYNAMIC:
-			break;
 		case PT_NOTE:
 			break;
 		case PT_PHDR:
@@ -804,11 +796,6 @@ exec_elf_makecmds(struct lwp *l, struct 
 		goto bad;
 	}
 
-	if (interp || (epp->ep_flags & EXEC_FORCEAUX) != 0) {
-		ap = kmem_alloc(sizeof(*ap), KM_SLEEP);
-		ap->arg_interp = (vaddr_t)NULL;
-	}
-
 	if (epp->ep_daddr == ELFDEFNNAME(NO_ADDR)) {
 		epp->ep_daddr = round_page(end_text);
 		epp->ep_dsize = 0;
@@ -819,27 +806,32 @@ exec_elf_makecmds(struct lwp *l, struct 
 	 * its interpreter
 	 */
 	if (interp) {
-		int nused = epp->ep_vmcmds.evs_used;
+		u_int nused = epp->ep_vmcmds.evs_used;
 		u_long interp_offset = 0;
 
-		if ((error = elf_load_file(l, epp, interp,
+		if ((error = elf_load_interp(l, epp, interp,
 		&epp->ep_vmcmds, &interp_offset, &pos)) != 0) {
-			kmem_free(ap, sizeof(*ap));
 			goto bad;
 		}
 		if (epp->ep_vmcmds.evs_used == nused) {
-			/* elf_load_file() has not set up any new VMCMD */
-			kmem_free(ap, sizeof(*ap));
+			/* elf_load_interp() has not set up any new VMCMD */
 			error = ENOEXEC;
 			goto bad;
 		}
 
+		ap = kmem_alloc(sizeof(*ap), KM_SLEEP);
 		ap->arg_interp = epp->ep_vmcmds.evs_cmds[nused].ev_addr;
 		epp->ep_entryoffset = interp_offset;
 		epp->ep_entry = ap->arg_interp + interp_offset;
 		PNBUF_PUT(interp);
-	} else
+	} else {
 		epp->ep_entry = eh->e_entry;
+		if (epp->ep_flags & EXEC_FORCEAUX) {
+			ap = kmem_alloc(sizeof(*ap), KM_SLEEP);
+			ap->arg_interp = (vaddr_t)NULL;
+		} else
+			ap = NULL;
+	}
 
 	if (ap) {
 		ap->arg_phaddr = phdr ? phdr : computed_phdr;