CVS commit: src/usr.sbin/sa

2010-06-09 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Thu Jun 10 06:28:33 UTC 2010

Modified Files:
src/usr.sbin/sa: main.c pdb.c

Log Message:
sprinkle some const


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/sa/main.c
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/sa/pdb.c

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

Modified files:

Index: src/usr.sbin/sa/main.c
diff -u src/usr.sbin/sa/main.c:1.27 src/usr.sbin/sa/main.c:1.28
--- src/usr.sbin/sa/main.c:1.27	Thu Jun 10 06:17:21 2010
+++ src/usr.sbin/sa/main.c	Thu Jun 10 06:28:33 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.27 2010/06/10 06:17:21 dholland Exp $ */
+/* $NetBSD: main.c,v 1.28 2010/06/10 06:28:33 dholland Exp $ */
 
 /*
  * Copyright (c) 1994 Christopher G. Demetriou
@@ -39,7 +39,7 @@
 __COPYRIGHT("@(#) Copyright (c) 1994\
  Christopher G. Demetriou.  All rights reserved.");
 
-__RCSID("$NetBSD: main.c,v 1.27 2010/06/10 06:17:21 dholland Exp $");
+__RCSID("$NetBSD: main.c,v 1.28 2010/06/10 06:28:33 dholland Exp $");
 #endif
 
 /*
@@ -60,7 +60,7 @@
 #include "extern.h"
 #include "pathnames.h"
 
-static int acct_load(char *, int);
+static int acct_load(const char *, int);
 static u_quad_t decode_comp_t(comp_t);
 static int cmp_comm(const char *, const char *);
 static int cmp_usrsys(const DBT *, const DBT *);
@@ -295,7 +295,7 @@
 }
 
 static int
-acct_load(char *pn, int wr)
+acct_load(const char *pn, int wr)
 {
 	struct acct ac;
 	struct cmdinfo ci;

Index: src/usr.sbin/sa/pdb.c
diff -u src/usr.sbin/sa/pdb.c:1.15 src/usr.sbin/sa/pdb.c:1.16
--- src/usr.sbin/sa/pdb.c:1.15	Thu Jun 10 06:17:21 2010
+++ src/usr.sbin/sa/pdb.c	Thu Jun 10 06:28:33 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pdb.c,v 1.15 2010/06/10 06:17:21 dholland Exp $ */
+/* $NetBSD: pdb.c,v 1.16 2010/06/10 06:28:33 dholland Exp $ */
 
 /*
  * Copyright (c) 1994 Christopher G. Demetriou
@@ -36,7 +36,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: pdb.c,v 1.15 2010/06/10 06:17:21 dholland Exp $");
+__RCSID("$NetBSD: pdb.c,v 1.16 2010/06/10 06:28:33 dholland Exp $");
 #endif
 
 #include 
@@ -49,7 +49,7 @@
 #include "extern.h"
 #include "pathnames.h"
 
-static int check_junk(struct cmdinfo *);
+static int check_junk(const struct cmdinfo *);
 static void add_ci(const struct cmdinfo *, struct cmdinfo *);
 static void print_ci(const struct cmdinfo *, const struct cmdinfo *);
 
@@ -318,7 +318,7 @@
 }
 
 static int
-check_junk(struct cmdinfo *cip)
+check_junk(const struct cmdinfo *cip)
 {
 	char *cp;
 	size_t len;



CVS commit: src/usr.sbin/sa

2010-06-09 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Thu Jun 10 06:17:21 UTC 2010

Modified Files:
src/usr.sbin/sa: extern.h main.c pdb.c usrdb.c

Log Message:
ANSIfy function declarations


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/sa/extern.h
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/sa/main.c
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/sa/pdb.c
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/sa/usrdb.c

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

Modified files:

Index: src/usr.sbin/sa/extern.h
diff -u src/usr.sbin/sa/extern.h:1.8 src/usr.sbin/sa/extern.h:1.9
--- src/usr.sbin/sa/extern.h:1.8	Thu Jun 10 06:09:10 2010
+++ src/usr.sbin/sa/extern.h	Thu Jun 10 06:17:21 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.8 2010/06/10 06:09:10 dholland Exp $ */
+/* $NetBSD: extern.h,v 1.9 2010/06/10 06:17:21 dholland Exp $ */
 
 /*
  * Copyright (c) 1994 Christopher G. Demetriou
@@ -67,7 +67,6 @@
 typedef	int (*cmpf_t)(const DBT *, const DBT *);
 
 /* external functions in sa.c */
-int main(int argc, char **argv);
 const char *fmt(const DBT *);
 
 /* external functions in pdb.c */

Index: src/usr.sbin/sa/main.c
diff -u src/usr.sbin/sa/main.c:1.26 src/usr.sbin/sa/main.c:1.27
--- src/usr.sbin/sa/main.c:1.26	Thu Jun 10 06:09:10 2010
+++ src/usr.sbin/sa/main.c	Thu Jun 10 06:17:21 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.26 2010/06/10 06:09:10 dholland Exp $ */
+/* $NetBSD: main.c,v 1.27 2010/06/10 06:17:21 dholland Exp $ */
 
 /*
  * Copyright (c) 1994 Christopher G. Demetriou
@@ -39,7 +39,7 @@
 __COPYRIGHT("@(#) Copyright (c) 1994\
  Christopher G. Demetriou.  All rights reserved.");
 
-__RCSID("$NetBSD: main.c,v 1.26 2010/06/10 06:09:10 dholland Exp $");
+__RCSID("$NetBSD: main.c,v 1.27 2010/06/10 06:17:21 dholland Exp $");
 #endif
 
 /*
@@ -83,9 +83,7 @@
 cmpf_t   sa_cmp = cmp_usrsys;
 
 int
-main(argc, argv)
-	int argc;
-	char **argv;
+main(int argc, char **argv)
 {
 	int ch;
 	int error;
@@ -297,9 +295,7 @@
 }
 
 static int
-acct_load(pn, wr)
-	char *pn;
-	int wr;
+acct_load(char *pn, int wr)
 {
 	struct acct ac;
 	struct cmdinfo ci;
@@ -393,8 +389,7 @@
 
 /* sort commands, doing the right thing in terms of reversals */
 static int
-cmp_comm(s1, s2)
-	const char *s1, *s2;
+cmp_comm(const char *s1, const char *s2)
 {
 	int rv;
 
@@ -406,8 +401,7 @@
 
 /* sort by total user and system time */
 static int
-cmp_usrsys(d1, d2)
-	const DBT *d1, *d2;
+cmp_usrsys(const DBT *d1, const DBT *d2)
 {
 	struct cmdinfo c1, c2;
 	u_quad_t t1, t2;
@@ -428,8 +422,7 @@
 
 /* sort by average user and system time */
 static int
-cmp_avgusrsys(d1, d2)
-	const DBT *d1, *d2;
+cmp_avgusrsys(const DBT *d1, const DBT *d2)
 {
 	struct cmdinfo c1, c2;
 	double t1, t2;
@@ -453,8 +446,7 @@
 
 /* sort by total number of disk I/O operations */
 static int
-cmp_dkio(d1, d2)
-	const DBT *d1, *d2;
+cmp_dkio(const DBT *d1, const DBT *d2)
 {
 	struct cmdinfo c1, c2;
 
@@ -471,8 +463,7 @@
 
 /* sort by average number of disk I/O operations */
 static int
-cmp_avgdkio(d1, d2)
-	const DBT *d1, *d2;
+cmp_avgdkio(const DBT *d1, const DBT *d2)
 {
 	struct cmdinfo c1, c2;
 	double n1, n2;
@@ -493,8 +484,7 @@
 
 /* sort by the CPU-storage integral */
 static int
-cmp_cpumem(d1, d2)
-	const DBT *d1, *d2;
+cmp_cpumem(const DBT *d1, const DBT *d2)
 {
 	struct cmdinfo c1, c2;
 
@@ -511,8 +501,7 @@
 
 /* sort by the CPU-time average memory usage */
 static int
-cmp_avgcpumem(d1, d2)
-	const DBT *d1, *d2;
+cmp_avgcpumem(const DBT *d1, const DBT *d2)
 {
 	struct cmdinfo c1, c2;
 	u_quad_t t1, t2;
@@ -537,8 +526,7 @@
 
 /* sort by the number of invocations */
 static int
-cmp_calls(d1, d2)
-	const DBT *d1, *d2;
+cmp_calls(const DBT *d1, const DBT *d2)
 {
 	struct cmdinfo c1, c2;
 
@@ -554,7 +542,7 @@
 }
 
 static void
-usage()
+usage(void)
 {
 
 	(void)fprintf(stderr,
@@ -564,8 +552,7 @@
 }
 
 const char *
-fmt(key)
-	const DBT *key;
+fmt(const DBT *key)
 {
 	static char *buf = NULL;
 	static size_t len = 0;

Index: src/usr.sbin/sa/pdb.c
diff -u src/usr.sbin/sa/pdb.c:1.14 src/usr.sbin/sa/pdb.c:1.15
--- src/usr.sbin/sa/pdb.c:1.14	Thu Jun 10 06:09:10 2010
+++ src/usr.sbin/sa/pdb.c	Thu Jun 10 06:17:21 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pdb.c,v 1.14 2010/06/10 06:09:10 dholland Exp $ */
+/* $NetBSD: pdb.c,v 1.15 2010/06/10 06:17:21 dholland Exp $ */
 
 /*
  * Copyright (c) 1994 Christopher G. Demetriou
@@ -36,7 +36,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: pdb.c,v 1.14 2010/06/10 06:09:10 dholland Exp $");
+__RCSID("$NetBSD: pdb.c,v 1.15 2010/06/10 06:17:21 dholland Exp $");
 #endif
 
 #include 
@@ -56,7 +56,7 @@
 static DB	*pacct_db;
 
 int
-pacct_init()
+pacct_init(void)
 {
 	DB *saved_pacct_db;
 	int error;
@@ -125,15 +125,14 @@
 }
 
 void
-pacct_destroy()
+pacct_destroy(void)
 {
 	if (DB_CLOSE(pacct_db) < 0)
 		warn("destroying process accounting stats");
 }
 
 int
-pacct_add(ci)
-	const struct cmdinfo *ci;
+pacct_add(const struct cmdinfo *ci)
 {
 	DBT key

CVS commit: src/usr.sbin/sa

2010-06-09 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Thu Jun 10 06:09:10 UTC 2010

Modified Files:
src/usr.sbin/sa: extern.h main.c pdb.c usrdb.c

Log Message:
de-__P()


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sa/extern.h
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/sa/main.c
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/sa/pdb.c
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/sa/usrdb.c

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

Modified files:

Index: src/usr.sbin/sa/extern.h
diff -u src/usr.sbin/sa/extern.h:1.7 src/usr.sbin/sa/extern.h:1.8
--- src/usr.sbin/sa/extern.h:1.7	Wed Nov 12 13:31:07 2003
+++ src/usr.sbin/sa/extern.h	Thu Jun 10 06:09:10 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.7 2003/11/12 13:31:07 grant Exp $ */
+/* $NetBSD: extern.h,v 1.8 2010/06/10 06:09:10 dholland Exp $ */
 
 /*
  * Copyright (c) 1994 Christopher G. Demetriou
@@ -64,25 +64,25 @@
 
 /* typedefs */
 
-typedef	int (*cmpf_t) __P((const DBT *, const DBT *));
+typedef	int (*cmpf_t)(const DBT *, const DBT *);
 
 /* external functions in sa.c */
-int	main		__P((int, char **));
-const char *fmt		__P((const DBT *));
+int main(int argc, char **argv);
+const char *fmt(const DBT *);
 
 /* external functions in pdb.c */
-int	pacct_init	__P((void));
-void	pacct_destroy	__P((void));
-int	pacct_add	__P((const struct cmdinfo *));
-int	pacct_update	__P((void));
-void	pacct_print	__P((void));
+int	pacct_init(void);
+void	pacct_destroy(void);
+int	pacct_add(const struct cmdinfo *);
+int	pacct_update(void);
+void	pacct_print(void);
 
 /* external functions in usrdb.c */
-int	usracct_init	__P((void));
-void	usracct_destroy	__P((void));
-int	usracct_add	__P((const struct cmdinfo *));
-int	usracct_update	__P((void));
-void	usracct_print	__P((void));
+int	usracct_init(void);
+void	usracct_destroy(void);
+int	usracct_add(const struct cmdinfo *);
+int	usracct_update(void);
+void	usracct_print(void);
 
 /* variables */
 

Index: src/usr.sbin/sa/main.c
diff -u src/usr.sbin/sa/main.c:1.25 src/usr.sbin/sa/main.c:1.26
--- src/usr.sbin/sa/main.c:1.25	Tue Nov 17 18:37:45 2009
+++ src/usr.sbin/sa/main.c	Thu Jun 10 06:09:10 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.25 2009/11/17 18:37:45 drochner Exp $ */
+/* $NetBSD: main.c,v 1.26 2010/06/10 06:09:10 dholland Exp $ */
 
 /*
  * Copyright (c) 1994 Christopher G. Demetriou
@@ -39,7 +39,7 @@
 __COPYRIGHT("@(#) Copyright (c) 1994\
  Christopher G. Demetriou.  All rights reserved.");
 
-__RCSID("$NetBSD: main.c,v 1.25 2009/11/17 18:37:45 drochner Exp $");
+__RCSID("$NetBSD: main.c,v 1.26 2010/06/10 06:09:10 dholland Exp $");
 #endif
 
 /*
@@ -60,17 +60,17 @@
 #include "extern.h"
 #include "pathnames.h"
 
-static int	acct_load	__P((char *, int));
-static u_quad_t	decode_comp_t	__P((comp_t));
-static int	cmp_comm	__P((const char *, const char *));
-static int	cmp_usrsys	__P((const DBT *, const DBT *));
-static int	cmp_avgusrsys	__P((const DBT *, const DBT *));
-static int	cmp_dkio	__P((const DBT *, const DBT *));
-static int	cmp_avgdkio	__P((const DBT *, const DBT *));
-static int	cmp_cpumem	__P((const DBT *, const DBT *));
-static int	cmp_avgcpumem	__P((const DBT *, const DBT *));
-static int	cmp_calls	__P((const DBT *, const DBT *));
-static void	usage		__P((void)) __dead;
+static int acct_load(char *, int);
+static u_quad_t decode_comp_t(comp_t);
+static int cmp_comm(const char *, const char *);
+static int cmp_usrsys(const DBT *, const DBT *);
+static int cmp_avgusrsys(const DBT *, const DBT *);
+static int cmp_dkio(const DBT *, const DBT *);
+static int cmp_avgdkio(const DBT *, const DBT *);
+static int cmp_cpumem(const DBT *, const DBT *);
+static int cmp_avgcpumem(const DBT *, const DBT *);
+static int cmp_calls(const DBT *, const DBT *);
+static void usage(void) __dead;
 
 int aflag, bflag, cflag, dflag, Dflag, fflag, iflag, jflag, kflag;
 int Kflag, lflag, mflag, qflag, rflag, sflag, tflag, uflag, vflag;

Index: src/usr.sbin/sa/pdb.c
diff -u src/usr.sbin/sa/pdb.c:1.13 src/usr.sbin/sa/pdb.c:1.14
--- src/usr.sbin/sa/pdb.c:1.13	Sat Apr 18 13:37:04 2009
+++ src/usr.sbin/sa/pdb.c	Thu Jun 10 06:09:10 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pdb.c,v 1.13 2009/04/18 13:37:04 lukem Exp $ */
+/* $NetBSD: pdb.c,v 1.14 2010/06/10 06:09:10 dholland Exp $ */
 
 /*
  * Copyright (c) 1994 Christopher G. Demetriou
@@ -36,7 +36,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: pdb.c,v 1.13 2009/04/18 13:37:04 lukem Exp $");
+__RCSID("$NetBSD: pdb.c,v 1.14 2010/06/10 06:09:10 dholland Exp $");
 #endif
 
 #include 
@@ -49,9 +49,9 @@
 #include "extern.h"
 #include "pathnames.h"
 
-static int check_junk __P((struct cmdinfo *));
-static void add_ci __P((const struct cmdinfo *, struct cmdinfo *));
-static void print_ci __P((const struct cmdinfo *, const struct cmdinfo *));
+static int check_junk(struct cmdinfo *);
+static void add_ci(const struct cmdinfo *, struct cmdinfo *);
+static void print_ci(const struct cmdinfo *, const s

CVS commit: src/usr.sbin/arp

2010-06-09 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Thu Jun 10 06:03:20 UTC 2010

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

Log Message:
Allow -f -, as per PR 10898.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/usr.sbin/arp/arp.c

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

Modified files:

Index: src/usr.sbin/arp/arp.c
diff -u src/usr.sbin/arp/arp.c:1.48 src/usr.sbin/arp/arp.c:1.49
--- src/usr.sbin/arp/arp.c:1.48	Thu Apr  2 21:02:06 2009
+++ src/usr.sbin/arp/arp.c	Thu Jun 10 06:03:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: arp.c,v 1.48 2009/04/02 21:02:06 christos Exp $ */
+/*	$NetBSD: arp.c,v 1.49 2010/06/10 06:03:20 dholland Exp $ */
 
 /*
  * Copyright (c) 1984, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)arp.c	8.3 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: arp.c,v 1.48 2009/04/02 21:02:06 christos Exp $");
+__RCSID("$NetBSD: arp.c,v 1.49 2010/06/10 06:03:20 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -195,8 +195,14 @@
 	int i, retval;
 	FILE *fp;
 
-	if ((fp = fopen(name, "r")) == NULL)
-		err(1, "cannot open %s", name);
+	if (!strcmp(name, "-")) {
+		fp = stdin;
+	} else {
+		fp = fopen(name, "r");
+		if (fp == NULL) {
+			err(1, "Cannot open %s", name);
+		}
+	}
 	retval = 0;
 	for (; (line = fparseln(fp, NULL, NULL, NULL, 0)) != NULL; free(line)) {
 		char **ap, *inputstring;
@@ -216,7 +222,8 @@
 		if (set(i, argv))
 			retval = 1;
 	}
-	(void)fclose(fp);
+	if (fp != stdin)
+		(void)fclose(fp);
 	return retval;
 }
 



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2010-06-09 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Thu Jun 10 05:45:50 UTC 2010

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: pmap.c

Log Message:
Move "space on 256MB sbmips" comment into alternate of #ifdef where it applies.
Matthew Green noticed this one, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.179.16.25 -r1.179.16.26 src/sys/arch/mips/mips/pmap.c

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

Modified files:

Index: src/sys/arch/mips/mips/pmap.c
diff -u src/sys/arch/mips/mips/pmap.c:1.179.16.25 src/sys/arch/mips/mips/pmap.c:1.179.16.26
--- src/sys/arch/mips/mips/pmap.c:1.179.16.25	Thu Jun 10 00:37:58 2010
+++ src/sys/arch/mips/mips/pmap.c	Thu Jun 10 05:45:50 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.179.16.25 2010/06/10 00:37:58 cliff Exp $	*/
+/*	$NetBSD: pmap.c,v 1.179.16.26 2010/06/10 05:45:50 cliff Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.179.16.25 2010/06/10 00:37:58 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.179.16.26 2010/06/10 05:45:50 cliff Exp $");
 
 /*
  *	Manages physical address maps.
@@ -517,10 +517,10 @@
 	poolpage.size = nkmempages + MCLBYTES * nmbclusters;
 	Sysmapsize += poolpage.size;
 #endif
-	/* XXX: else runs out of space on 256MB sbmips!! */
 #ifdef _LP64
 	Sysmapsize += physmem;
 #else
+	/* XXX: else runs out of space on 256MB sbmips!! */
 	Sysmapsize += 2;
 #endif
 



CVS commit: src/lib/libcurses

2010-06-09 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Thu Jun 10 05:24:56 UTC 2010

Modified Files:
src/lib/libcurses: screen.c

Log Message:
After consultation with jdc@, apply the patch from PR 42412 even though
the crash went away -- it's not clear that it went away for any reason
besides by accident.

The change is: use calloc instead of malloc for allocating SCREENs.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/lib/libcurses/screen.c

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

Modified files:

Index: src/lib/libcurses/screen.c
diff -u src/lib/libcurses/screen.c:1.22 src/lib/libcurses/screen.c:1.23
--- src/lib/libcurses/screen.c:1.22	Wed Feb  3 15:34:40 2010
+++ src/lib/libcurses/screen.c	Thu Jun 10 05:24:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: screen.c,v 1.22 2010/02/03 15:34:40 roy Exp $	*/
+/*	$NetBSD: screen.c,v 1.23 2010/06/10 05:24:55 dholland Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)screen.c	8.2 (blymn) 11/27/2001";
 #else
-__RCSID("$NetBSD: screen.c,v 1.22 2010/02/03 15:34:40 roy Exp $");
+__RCSID("$NetBSD: screen.c,v 1.23 2010/06/10 05:24:55 dholland Exp $");
 #endif
 #endif	/* not lint */
 
@@ -117,7 +117,7 @@
 	if ((type == NULL) && (sp = getenv("TERM")) == NULL)
 		return NULL;
 
-	if ((new_screen = (SCREEN *) malloc(sizeof(SCREEN))) == NULL)
+	if ((new_screen = calloc(1, sizeof(SCREEN))) == NULL)
 		return NULL;
 
 #ifdef DEBUG



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi

2010-06-09 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Thu Jun 10 01:11:26 UTC 2010

Modified Files:
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_cpu.c

Log Message:
- remove rmixl_spl_init_cpu calls from rmixl_intr_init_cpu
  because rmixl_intr_init_cpu only runs on cpu#0.
  rmixl_spl_init_cpu calls are now done in cpu_rmixl_atach (for cpu#0)
  or cpu_rmixl_hatch (for other cpus).
- add cpu_xls616_erratum to avoid count/compare conflict on XLS616
  XXX VERIFY WITH RMI
- rmixl_spl_init_cpu CPU#0 in attach, others in hatch
- remove splhi/splx for non-cpu#0 work in attach
  interrupts arent enabled yet anyway


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.11 -r1.1.2.12 src/sys/arch/mips/rmi/rmixl_cpu.c

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

Modified files:

Index: src/sys/arch/mips/rmi/rmixl_cpu.c
diff -u src/sys/arch/mips/rmi/rmixl_cpu.c:1.1.2.11 src/sys/arch/mips/rmi/rmixl_cpu.c:1.1.2.12
--- src/sys/arch/mips/rmi/rmixl_cpu.c:1.1.2.11	Sat May  1 06:10:04 2010
+++ src/sys/arch/mips/rmi/rmixl_cpu.c	Thu Jun 10 01:11:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_cpu.c,v 1.1.2.11 2010/05/01 06:10:04 cliff Exp $	*/
+/*	$NetBSD: rmixl_cpu.c,v 1.1.2.12 2010/06/10 01:11:26 cliff Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -38,7 +38,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rmixl_cpu.c,v 1.1.2.11 2010/05/01 06:10:04 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_cpu.c,v 1.1.2.12 2010/06/10 01:11:26 cliff Exp $");
 
 #include 
 #include 
@@ -90,6 +90,37 @@
 static struct rmixl_cpu_trampoline_args rmixl_cpu_trampoline_args;
 #endif
 
+/*
+ * cpu_xls616_erratum
+ *
+ * on the XLS616, COUNT/COMPARE clock regs seem to interact between
+ * threads on a core 
+ *
+ * the symptom of the error is retarded clock interrupts
+ * and very slow apparent system performance
+ *
+ * other XLS chips may have the same problem.
+ * we may need to add other PID checks.
+ */
+static inline bool
+cpu_xls616_erratum(device_t parent, struct cpucore_attach_args *ca)
+{
+	if (mips_options.mips_cpu->cpu_pid == MIPS_XLS616) {
+		if (ca->ca_thread > 0) {
+			aprint_error_dev(parent, "XLS616 CLOCK ERRATUM: "
+"deconfigure cpu%d\n", ca->ca_thread);
+			return true;
+		}
+	}
+	return false;
+}
+
+static bool
+cpu_rmixl_erratum(device_t parent, struct cpucore_attach_args *ca)
+{
+	return cpu_xls616_erratum(parent, ca);
+}
+
 static int
 cpu_rmixl_match(device_t parent, cfdata_t cf, void *aux)
 {
@@ -103,7 +134,8 @@
 #ifndef MULTIPROCESSOR
 	&& ca->ca_thread == 0
 #endif
-	&& (thread == CPUCORECF_THREAD_DEFAULT || thread == ca->ca_thread))
+	&& (thread == CPUCORECF_THREAD_DEFAULT || thread == ca->ca_thread)
+	&& (!cpu_rmixl_erratum(parent, ca)))
 			return 1;
 
 	return 0;
@@ -115,6 +147,7 @@
 	struct rmixl_cpu_softc * const sc = device_private(self);
 	struct cpucore_attach_args *ca = aux;
 	struct cpu_info *ci = NULL;
+	extern void rmixl_spl_init_cpu(void);
 
 	if (ca->ca_thread == 0 && ca->ca_core == 0) {
 		ci = curcpu();
@@ -122,6 +155,7 @@
 		sc->sc_ci = ci;
 		ci->ci_softc = (void *)sc;
 
+		rmixl_spl_init_cpu();	/* spl initialization for CPU#0 */
 		cpu_rmixl_attach_once(sc);
 
 #ifdef MULTIPROCESSOR
@@ -130,9 +164,6 @@
 		struct cpucore_softc * const ccsc = device_private(parent);
 		rmixlfw_psb_type_t psb_type = rmixl_configuration.rc_psb_type;
 		cpuid_t cpuid;
-		int s;
-
-		s = splhigh();
 
 		KASSERT(ca->ca_core < 8);
 		KASSERT(ca->ca_thread < 4);
@@ -164,9 +195,6 @@
 			aprint_error(": failed to hatch\n");
 			return;
 		}
-
-		splx(s);
-
 #endif	/* MULTIPROCESSOR */
 	}
 
@@ -233,6 +261,10 @@
 void
 cpu_rmixl_hatch(struct cpu_info *ci)
 {
+	extern void rmixl_spl_init_cpu(void);
+
+	rmixl_spl_init_cpu();	/* spl initialization for this CPU */
+
 	(void)splhigh();
 
 #ifdef DEBUG



CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/rmixl

2010-06-09 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Thu Jun 10 00:43:06 UTC 2010

Modified Files:
src/sys/arch/evbmips/rmixl [matt-nb5-mips64]: autoconf.c

Log Message:
- in findroot(), add "sd" to search for root
we are kind of lying about 'booted_device' here,
until we figure out how to get booted dev info from the firmware.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/evbmips/rmixl/autoconf.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/evbmips/rmixl/autoconf.c
diff -u src/sys/arch/evbmips/rmixl/autoconf.c:1.1.2.2 src/sys/arch/evbmips/rmixl/autoconf.c:1.1.2.3
--- src/sys/arch/evbmips/rmixl/autoconf.c:1.1.2.2	Thu Jan 14 00:40:35 2010
+++ src/sys/arch/evbmips/rmixl/autoconf.c	Thu Jun 10 00:43:06 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.1.2.2 2010/01/14 00:40:35 matt Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.1.2.3 2010/06/10 00:43:06 cliff Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.1.2.2 2010/01/14 00:40:35 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.1.2.3 2010/06/10 00:43:06 cliff Exp $");
 
 #include 
 #include 
@@ -92,7 +92,7 @@
 		for (dv = TAILQ_FIRST(&alldevs); dv != NULL;
 		 dv = TAILQ_NEXT(dv, dv_list))
 			if (device_class(dv) == DV_DISK &&
-			device_is_a(dv, "wd"))
+			(device_is_a(dv, "wd") || device_is_a(dv, "sd")))
 booted_device = dv;
 
 	/*



CVS commit: [matt-nb5-mips64] src/sys/kern

2010-06-09 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Thu Jun 10 00:42:16 UTC 2010

Modified Files:
src/sys/kern [matt-nb5-mips64]: kern_subr.c

Log Message:
- in setroot(), in the `root on  ...' case, if the lookup failed
and we have no rootdev, then we have to ASK.


To generate a diff of this commit:
cvs rdiff -u -r1.192.4.1.4.3 -r1.192.4.1.4.4 src/sys/kern/kern_subr.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/kern_subr.c
diff -u src/sys/kern/kern_subr.c:1.192.4.1.4.3 src/sys/kern/kern_subr.c:1.192.4.1.4.4
--- src/sys/kern/kern_subr.c:1.192.4.1.4.3	Tue Jun  8 18:29:11 2010
+++ src/sys/kern/kern_subr.c	Thu Jun 10 00:42:16 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_subr.c,v 1.192.4.1.4.3 2010/06/08 18:29:11 cliff Exp $	*/
+/*	$NetBSD: kern_subr.c,v 1.192.4.1.4.4 2010/06/10 00:42:16 cliff Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.192.4.1.4.3 2010/06/08 18:29:11 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.192.4.1.4.4 2010/06/10 00:42:16 cliff Exp $");
 
 #include "opt_ddb.h"
 #include "opt_md.h"
@@ -973,17 +973,28 @@
 		 * `root on  ...'
 		 */
 
+		dv = finddevice(rootspec);
+
+		/*
+		 * if the lookup failed and we have no rootdev
+		 * then we have to ask
+		 */
+		if (dv == NULL && rootdev == NODEV) {
+			printf("device %s not configured\n", rootspec);
+			boothowto |= RB_ASKNAME;
+			goto top;
+		}
+
 		/*
 		 * If it's a network interface, we can bail out
 		 * early.
 		 */
-		dv = finddevice(rootspec);
 		if (dv != NULL && device_class(dv) == DV_IFNET) {
 			rootdv = dv;
 			goto haveroot;
 		}
 
-		if (rootdev == NODEV &&
+		if (dv != NULL && rootdev == NODEV &&
 		device_class(dv) == DV_DISK && device_is_a(dv, "dk") &&
 		(majdev = devsw_name2blk(device_xname(dv), NULL, 0)) >= 0)
 			rootdev = makedev(majdev, device_unit(dv));



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi

2010-06-09 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Thu Jun 10 00:41:43 UTC 2010

Modified Files:
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_intr.c

Log Message:
- remove rmixl_spl_init_cpu calls from rmixl_intr_init_cpu
because rmixl_intr_init_cpu only runs on cpu#0.
rmixl_spl_init_cpu calls are now done in cpu_rmixl_atach (for cpu#0)
or cpu_rmixl_hatch (for other cpus).
- in evbmips_iointr, be sure to mask out count/compare interrupt
along with softints (these are handled elsewhere)
and improve coments
- fix bug in rmixl_send_ipi: 'cpus_running' is bit-indexed
by ci_index, not ci_cpuid


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.21 -r1.1.2.22 src/sys/arch/mips/rmi/rmixl_intr.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/mips/rmi/rmixl_intr.c
diff -u src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.21 src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.22
--- src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.21	Fri May 28 22:14:53 2010
+++ src/sys/arch/mips/rmi/rmixl_intr.c	Thu Jun 10 00:41:43 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_intr.c,v 1.1.2.21 2010/05/28 22:14:53 cliff Exp $	*/
+/*	$NetBSD: rmixl_intr.c,v 1.1.2.22 2010/06/10 00:41:43 cliff Exp $	*/
 
 /*-
  * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rmixl_intr.c,v 1.1.2.21 2010/05/28 22:14:53 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_intr.c,v 1.1.2.22 2010/06/10 00:41:43 cliff Exp $");
 
 #include "opt_ddb.h"
 #define	__INTR_PRIVATE
@@ -474,12 +474,9 @@
 rmixl_intr_init_cpu(struct cpu_info *ci)
 {
 	struct rmixl_cpu_softc *sc = (void *)ci->ci_softc;
-	extern void rmixl_spl_init_cpu(void);
 
 	KASSERT(sc != NULL);
 
-	rmixl_spl_init_cpu();
-
 	for (int vec=0; vec < NINTRVECS; vec++)
 		evcnt_attach_dynamic(&sc->sc_vec_evcnts[vec],
 			EVCNT_TYPE_INTR, NULL,
@@ -869,28 +866,39 @@
 		int vec;
 
 		asm volatile("dmfc0 %0, $9, 6;" : "=r"(eirr));
+		asm volatile("dmfc0 %0, $9, 7;" : "=r"(eimr));
 
 #ifdef IOINTR_DEBUG
-		asm volatile("dmfc0 %0, $9, 7;" : "=r"(eimr));
 		printf("%s: eirr %#"PRIx64", eimr %#"PRIx64", mask %#"PRIx64"\n",
 			__func__, eirr, eimr, ipl_eimr_map[ipl-1]);
 #endif	/* IOINTR_DEBUG */
 
+		/*
+		 * reduce eirr to
+		 * - ints that are enabled at or below this ipl
+		 * - exclude count/compare clock and soft ints
+		 *   they are handled elsewhere
+		 */
 		eirr &= ipl_eimr_map[ipl-1];
-		eirr &= ~ipl_eimr_map[ipl];		/* mask off higher ints */
-		eirr &= ~(MIPS_SOFT_INT_MASK >> 8);	/* mask off soft ints */
+		eirr &= ~ipl_eimr_map[ipl];
+		eirr &= ~((MIPS_INT_MASK_5 | MIPS_SOFT_INT_MASK) >> 8);
 		if (eirr == 0)
 			break;
 
 		vec = 63 - dclz(eirr);
 		ih = &rmixl_intrhand[vec];
-		KASSERT (ih->ih_ipl == ipl);
-
-		asm volatile("dmfc0 %0, $9, 7;" : "=r"(eimr));
-		asm volatile("dmtc0 $0, $9, 7;");
 		vecbit = 1ULL << vec;
+		KASSERT (ih->ih_ipl == ipl);
 		KASSERT ((vecbit & eimr) == 0);
 		KASSERT ((vecbit & RMIXL_EIRR_PRESERVE_MASK) == 0);
+
+		/*
+		 * ack in EIRR the irq we are about to handle
+		 * disable all interrupt to prevent a race that would allow
+		 * e.g. softints set from a higher interrupt getting
+		 * clobbered by the EIRR read-modify-write 
+		 */
+		asm volatile("dmtc0 $0, $9, 7;");
 		asm volatile("dmfc0 %0, $9, 6;" : "=r"(eirr));
 		eirr &= RMIXL_EIRR_PRESERVE_MASK;
 		eirr |= vecbit;
@@ -929,7 +937,7 @@
 	uint32_t r;
 	extern volatile u_long cpus_running;
 
-	if ((cpus_running & 1 << ci->ci_cpuid) == 0)
+	if ((cpus_running & 1 << ci->ci_index) == 0)
 		return -1;
 
 	KASSERT(tag < NIPIS);



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2010-06-09 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Thu Jun 10 00:38:11 UTC 2010

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: pmap_tlb.c

Log Message:
- fix typo in evcnt string


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.11 -r1.1.2.12 src/sys/arch/mips/mips/pmap_tlb.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/mips/mips/pmap_tlb.c
diff -u src/sys/arch/mips/mips/pmap_tlb.c:1.1.2.11 src/sys/arch/mips/mips/pmap_tlb.c:1.1.2.12
--- src/sys/arch/mips/mips/pmap_tlb.c:1.1.2.11	Tue May  4 17:14:17 2010
+++ src/sys/arch/mips/mips/pmap_tlb.c	Thu Jun 10 00:38:11 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.1.2.11 2010/05/04 17:14:17 matt Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.1.2.12 2010/06/10 00:38:11 cliff Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.1.2.11 2010/05/04 17:14:17 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.1.2.12 2010/06/10 00:38:11 cliff Exp $");
 
 /*
  * Manages address spaces in a TLB.
@@ -226,7 +226,7 @@
 	ti->ti_name, "icache sync asts");
 	evcnt_attach_dynamic(&ti->ti_evcnt_synci_all,
 	EVCNT_TYPE_MISC, &ti->ti_evcnt_synci_asts,
-	ti->ti_name, "iacche full syncs");
+	ti->ti_name, "icache full syncs");
 	evcnt_attach_dynamic(&ti->ti_evcnt_synci_pages,
 	EVCNT_TYPE_MISC, &ti->ti_evcnt_synci_asts,
 	ti->ti_name, "icache pages synced");



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2010-06-09 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Thu Jun 10 00:37:58 UTC 2010

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: pmap.c

Log Message:
in pmap_bootstrap:
- increase Sysmapsize to allow mapping all memory (e.g. for big tmpfs)
- when calculating mips_virtual_end, cast Sysmapsize to vaddr_t
before multiplying by NBPG to avoid overflow


To generate a diff of this commit:
cvs rdiff -u -r1.179.16.24 -r1.179.16.25 src/sys/arch/mips/mips/pmap.c

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

Modified files:

Index: src/sys/arch/mips/mips/pmap.c
diff -u src/sys/arch/mips/mips/pmap.c:1.179.16.24 src/sys/arch/mips/mips/pmap.c:1.179.16.25
--- src/sys/arch/mips/mips/pmap.c:1.179.16.24	Tue May  4 17:15:36 2010
+++ src/sys/arch/mips/mips/pmap.c	Thu Jun 10 00:37:58 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.179.16.24 2010/05/04 17:15:36 matt Exp $	*/
+/*	$NetBSD: pmap.c,v 1.179.16.25 2010/06/10 00:37:58 cliff Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.179.16.24 2010/05/04 17:15:36 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.179.16.25 2010/06/10 00:37:58 cliff Exp $");
 
 /*
  *	Manages physical address maps.
@@ -518,7 +518,11 @@
 	Sysmapsize += poolpage.size;
 #endif
 	/* XXX: else runs out of space on 256MB sbmips!! */
+#ifdef _LP64
+	Sysmapsize += physmem;
+#else
 	Sysmapsize += 2;
+#endif
 
 	/*
 	 * Initialize `FYI' variables.	Note we're relying on
@@ -528,7 +532,7 @@
 	 */
 	mips_avail_start = vm_physmem[0].start << PGSHIFT;
 	mips_avail_end = vm_physmem[vm_nphysseg - 1].end << PGSHIFT;
-	mips_virtual_end = VM_MIN_KERNEL_ADDRESS + Sysmapsize * NBPG;
+	mips_virtual_end = VM_MIN_KERNEL_ADDRESS + (vaddr_t)Sysmapsize * NBPG;
 #ifndef _LP64
 	if (mips_virtual_end > VM_MAX_KERNEL_ADDRESS) {
 		mips_virtual_end = VM_MAX_KERNEL_ADDRESS;



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2010-06-09 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Thu Jun 10 00:37:12 UTC 2010

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: mipsX_subr.S

Log Message:
in MIPSX(kern_intr), before "Call the interrupt handler",
store s1 to TF_BASE+TF_REG_SR(sp) to save STATUS there.
no big deal, it seems to be unused;  at least now it is unused correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.26.36.1.2.31 -r1.26.36.1.2.32 \
src/sys/arch/mips/mips/mipsX_subr.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/mips/mips/mipsX_subr.S
diff -u src/sys/arch/mips/mips/mipsX_subr.S:1.26.36.1.2.31 src/sys/arch/mips/mips/mipsX_subr.S:1.26.36.1.2.32
--- src/sys/arch/mips/mips/mipsX_subr.S:1.26.36.1.2.31	Wed Apr 28 03:14:45 2010
+++ src/sys/arch/mips/mips/mipsX_subr.S	Thu Jun 10 00:37:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mipsX_subr.S,v 1.26.36.1.2.31 2010/04/28 03:14:45 matt Exp $	*/
+/*	$NetBSD: mipsX_subr.S,v 1.26.36.1.2.32 2010/06/10 00:37:12 cliff Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -1084,7 +1084,7 @@
 	REG_S	t8, TF_BASE+TF_REG_T8(sp)	# MIPS_CURLWP
 	REG_S	t9, TF_BASE+TF_REG_T9(sp)
 	REG_S	ra, TF_BASE+TF_REG_RA(sp)
-	REG_S	a0, TF_BASE+TF_REG_SR(sp)
+	REG_S	s1, TF_BASE+TF_REG_SR(sp)
 	REG_S	v0, TF_BASE+TF_REG_MULLO(sp)
 	REG_S	v1, TF_BASE+TF_REG_MULHI(sp)
 /*



CVS commit: [matt-nb5-mips64] src/sys/arch/sbmips/sbmips

2010-06-09 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Thu Jun 10 00:35:18 UTC 2010

Modified Files:
src/sys/arch/sbmips/sbmips [matt-nb5-mips64]: machdep.c

Log Message:
- set mips_locoresw.lsw_bus_error = sibyte_bus_watch_check
- call sb1250_ipl_map_init() to set the ipl_sr_map for sbmips.


To generate a diff of this commit:
cvs rdiff -u -r1.38.10.8 -r1.38.10.9 src/sys/arch/sbmips/sbmips/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/sbmips/sbmips/machdep.c
diff -u src/sys/arch/sbmips/sbmips/machdep.c:1.38.10.8 src/sys/arch/sbmips/sbmips/machdep.c:1.38.10.9
--- src/sys/arch/sbmips/sbmips/machdep.c:1.38.10.8	Sun Mar 21 17:38:35 2010
+++ src/sys/arch/sbmips/sbmips/machdep.c	Thu Jun 10 00:35:18 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.38.10.8 2010/03/21 17:38:35 cliff Exp $ */
+/* $NetBSD: machdep.c,v 1.38.10.9 2010/06/10 00:35:18 cliff Exp $ */
 
 /*
  * Copyright 2000, 2001
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.38.10.8 2010/03/21 17:38:35 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.38.10.9 2010/06/10 00:35:18 cliff Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ddbparam.h"   /* for SYMTAB_SPACE */
@@ -101,6 +101,8 @@
 #endif /* XXXCGD */
 #include 
 
+#include 
+
 #include "ksyms.h"
 
 #if NKSYMS || defined(DDB) || defined(LKM)
@@ -219,6 +221,10 @@
 	 */
 	mips_vector_init(NULL);
 
+	mips_locoresw.lsw_bus_error = sibyte_bus_watch_check;
+
+	sb1250_ipl_map_init();
+
 #ifdef DEBUG
 	printf("fwhandle=%08X magic=%08X bootdata=%08X reserved=%08X\n",
 	(u_int)fwhandle, (u_int)magic, (u_int)bootdata, (u_int)reserved);



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2010-06-09 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Thu Jun 10 00:33:51 UTC 2010

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: trap.c

Log Message:
- in trap(), if traptype is bus error, call chip-specific bus error
handler in locoresw: (*mips_locoresw.lsw_bus_error)(cause)


To generate a diff of this commit:
cvs rdiff -u -r1.217.12.26 -r1.217.12.27 src/sys/arch/mips/mips/trap.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/mips/mips/trap.c
diff -u src/sys/arch/mips/mips/trap.c:1.217.12.26 src/sys/arch/mips/mips/trap.c:1.217.12.27
--- src/sys/arch/mips/mips/trap.c:1.217.12.26	Thu May  6 05:31:49 2010
+++ src/sys/arch/mips/mips/trap.c	Thu Jun 10 00:33:50 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.217.12.26 2010/05/06 05:31:49 matt Exp $	*/
+/*	$NetBSD: trap.c,v 1.217.12.27 2010/06/10 00:33:50 cliff Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -78,7 +78,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.217.12.26 2010/05/06 05:31:49 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.217.12.27 2010/06/10 00:33:50 cliff Exp $");
 
 #include "opt_cputype.h"	/* which mips CPU levels do we support? */
 #include "opt_ddb.h"
@@ -235,7 +235,10 @@
 			printf(" tf=%p ksp=%p ra=%#" PRIxREGISTER "\n",
 			   tf, tf+1, tf->tf_regs[_R_RA]);
 		}
-			
+
+		if ((TRAPTYPE(cause) == 6) || (TRAPTYPE(cause) == 7))
+			(void)(*mips_locoresw.lsw_bus_error)(cause);
+
 #if defined(DDB)
 		kdb_trap(type, &tf->tf_registers);
 		/* XXX force halt XXX */



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include

2010-06-09 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Thu Jun 10 00:32:11 UTC 2010

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: locore.h

Log Message:
- add lsw_bus_error to struct locoresw, provides hook to call
for chip-specific bus error handling/decode from e.g. trap()


To generate a diff of this commit:
cvs rdiff -u -r1.78.36.1.2.24 -r1.78.36.1.2.25 \
src/sys/arch/mips/include/locore.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/mips/include/locore.h
diff -u src/sys/arch/mips/include/locore.h:1.78.36.1.2.24 src/sys/arch/mips/include/locore.h:1.78.36.1.2.25
--- src/sys/arch/mips/include/locore.h:1.78.36.1.2.24	Tue May 11 22:08:02 2010
+++ src/sys/arch/mips/include/locore.h	Thu Jun 10 00:32:11 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.h,v 1.78.36.1.2.24 2010/05/11 22:08:02 matt Exp $ */
+/* $NetBSD: locore.h,v 1.78.36.1.2.25 2010/06/10 00:32:11 cliff Exp $ */
 
 /*
  * This file should not be included by MI code!!!
@@ -360,6 +360,7 @@
 	int		(*lsw_send_ipi)(struct cpu_info *, int);
 	void		(*lsw_cpu_offline_md)(void);
 	void		(*lsw_cpu_init)(struct cpu_info *);
+	int		(*lsw_bus_error)(unsigned int);
 };
 
 struct mips_vmfreelist {



CVS commit: [matt-nb5-mips64] src/sys/arch/mips

2010-06-09 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Thu Jun 10 00:30:02 UTC 2010

Modified Files:
src/sys/arch/mips/conf [matt-nb5-mips64]: files.sibyte
Added Files:
src/sys/arch/mips/sibyte/dev [matt-nb5-mips64]: sbbuswatch.c
sbbuswatchvar.h

Log Message:
add bus watcher support for sibyte


To generate a diff of this commit:
cvs rdiff -u -r1.5.124.3 -r1.5.124.4 src/sys/arch/mips/conf/files.sibyte
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/mips/sibyte/dev/sbbuswatch.c \
src/sys/arch/mips/sibyte/dev/sbbuswatchvar.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/mips/conf/files.sibyte
diff -u src/sys/arch/mips/conf/files.sibyte:1.5.124.3 src/sys/arch/mips/conf/files.sibyte:1.5.124.4
--- src/sys/arch/mips/conf/files.sibyte:1.5.124.3	Thu Jan 21 08:39:54 2010
+++ src/sys/arch/mips/conf/files.sibyte	Thu Jun 10 00:30:01 2010
@@ -67,3 +67,5 @@
 attach	m41t81rtc at smbus
 
 file	arch/sbmips/sbmips/rtc.c		xirtc | m41t81rtc
+
+file	arch/mips/sibyte/dev/sbbuswatch.c

Added files:

Index: src/sys/arch/mips/sibyte/dev/sbbuswatch.c
diff -u /dev/null src/sys/arch/mips/sibyte/dev/sbbuswatch.c:1.1.2.1
--- /dev/null	Thu Jun 10 00:30:02 2010
+++ src/sys/arch/mips/sibyte/dev/sbbuswatch.c	Thu Jun 10 00:30:01 2010
@@ -0,0 +1,111 @@
+/*	$NetBSD: sbbuswatch.c,v 1.1.2.1 2010/06/10 00:30:01 cliff Exp $	*/
+/*
+ * Copyright (c) 2010, The NetBSD Foundation, Inc.  All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Cliff Neighbors.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#define READ_REG(rp)(mips3_ld((volatile uint64_t *)(rp)))
+#define WRITE_REG(rp, val)  (mips3_sd((volatile uint64_t *)(rp), (val)))
+
+static void sibyte_bus_watch_intr(void *, uint32_t, vaddr_t);
+
+void
+sibyte_bus_watch_init(void)
+{
+	(void)READ_REG(MIPS_PHYS_TO_KSEG1(A_SCD_BUS_ERR_STATUS));
+	WRITE_REG(MIPS_PHYS_TO_KSEG1(A_BUS_L2_ERRORS), 0);
+	WRITE_REG(MIPS_PHYS_TO_KSEG1(A_BUS_MEM_IO_ERRORS), 0);
+
+	(void)cpu_intr_establish(K_INT_BAD_ECC, IPL_DDB,
+		sibyte_bus_watch_intr, (void *)K_INT_BAD_ECC);
+	(void)cpu_intr_establish(K_INT_COR_ECC, IPL_DDB,
+		sibyte_bus_watch_intr, (void *)K_INT_COR_ECC);
+	(void)cpu_intr_establish(K_INT_IO_BUS, IPL_DDB,
+		sibyte_bus_watch_intr, (void *)K_INT_IO_BUS);
+}
+
+int
+sibyte_bus_watch_check(unsigned int cause)
+{
+	uint64_t err_ctl;
+	uint64_t cache_err_i;
+	uint64_t cache_err_d;
+	uint64_t cache_err_dpa;
+	uint64_t bus_err_dpa;
+	uint32_t bus_err_status;
+	uint32_t l2_errors;
+	uint32_t mem_io_errors;
+
+	bus_err_status = READ_REG(
+		MIPS_PHYS_TO_KSEG1(A_SCD_BUS_ERR_STATUS));
+
+	if (bus_err_status == 0)
+		return 0;
+
+	l2_errors = READ_REG(
+		MIPS_PHYS_TO_KSEG1(A_BUS_L2_ERRORS));
+	if (l2_errors != 0)
+		WRITE_REG(MIPS_PHYS_TO_KSEG1(A_BUS_L2_ERRORS), 0);
+
+	mem_io_errors = READ_REG(
+		MIPS_PHYS_TO_KSEG1(A_BUS_MEM_IO_ERRORS));
+	if (mem_io_errors != 0)
+		WRITE_REG(MIPS_PHYS_TO_KSEG1(A_BUS_MEM_IO_ERRORS), 0);
+
+	asm volatile("dmfc0 %0, $26, 0;" : "=r"(err_ctl));
+	asm volatile("dmfc0 %0, $26, 1;" : "=r"(bus_err_dpa));
+	asm volatile("dmfc0 %0, $27, 0;" : "=r"(cache_err_i));
+	asm volatile("dmfc0 %0, $27, 1;" : "=r"(cache_err_d));
+	asm volatile("dmfc0 %0, $27, 3;" : "=r"(cache_err_dpa));
+
+	printf("bus_err_status=%#x\n", bus_err_status);
+	printf("l2_errors=%#x\n", l2_errors);
+	printf("mem_io_errors=%#x\n", mem_io_errors);
+	printf("err_ctl=%#"PRIx64"\n", err_ctl);
+	printf("bus_err_dpa=%#"PRIx64"\n", bus_err_dpa);
+	printf("cache_err_i=%#"PRIx64"\n",

CVS commit: src/external/lib

2010-06-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jun  9 23:02:44 UTC 2010

Modified Files:
src/external/lib: Makefile

Log Message:
we can have ldap without crypto


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/lib/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/lib/Makefile
diff -u src/external/lib/Makefile:1.15 src/external/lib/Makefile:1.16
--- src/external/lib/Makefile:1.15	Tue Dec 22 19:17:40 2009
+++ src/external/lib/Makefile	Wed Jun  9 19:02:44 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.15 2009/12/23 00:17:40 darran Exp $
+#	$NetBSD: Makefile,v 1.16 2010/06/09 23:02:44 christos Exp $
 
 #
 # This Makefile exists to provide a single point to build
@@ -18,11 +18,11 @@
 
 .if (${MKCRYPTO} != "no")
 SUBDIR+= ../../crypto/external/lib .WAIT
+.endif
 
 .if (${MKLDAP} != "no")
 SUBDIR+= ../bsd/openldap/lib
 .endif
-.endif
 
 .if (${MKISCSI} != "no")
 SUBDIR+=	../bsd/iscsi/lib	# depends on libpthread



CVS commit: src/usr.sbin/syslogd

2010-06-09 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Jun  9 21:55:42 UTC 2010

Modified Files:
src/usr.sbin/syslogd: Makefile extern.h syslogd.c

Log Message:
Allow syslogd to compile when MKCRYPTO=no.  No promises as to whether
it works or not, as this has been broken since late 2008, when the
"encrypted connections" support was added to syslogd.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/syslogd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/syslogd/extern.h
cvs rdiff -u -r1.99 -r1.100 src/usr.sbin/syslogd/syslogd.c

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

Modified files:

Index: src/usr.sbin/syslogd/Makefile
diff -u src/usr.sbin/syslogd/Makefile:1.22 src/usr.sbin/syslogd/Makefile:1.23
--- src/usr.sbin/syslogd/Makefile:1.22	Wed Apr 22 15:23:08 2009
+++ src/usr.sbin/syslogd/Makefile	Wed Jun  9 21:55:42 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.22 2009/04/22 15:23:08 lukem Exp $
+#	$NetBSD: Makefile,v 1.23 2010/06/09 21:55:42 riz Exp $
 #	from: @(#)Makefile	8.1 (Berkeley) 6/6/93
 .include 
 
@@ -26,6 +26,8 @@
 
 .if ${MKCRYPTO} != "no"
 LDADD+=	-lssl -lcrypto
+.else
+CPPFLAGS+=-DDISABLE_TLS -DDISABLE_SIGN
 .endif
 
 .include 

Index: src/usr.sbin/syslogd/extern.h
diff -u src/usr.sbin/syslogd/extern.h:1.2 src/usr.sbin/syslogd/extern.h:1.3
--- src/usr.sbin/syslogd/extern.h:1.2	Fri Nov  7 07:36:38 2008
+++ src/usr.sbin/syslogd/extern.h	Wed Jun  9 21:55:42 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.2 2008/11/07 07:36:38 minskim Exp $	*/
+/*	$NetBSD: extern.h,v 1.3 2010/06/09 21:55:42 riz Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -74,7 +74,9 @@
 extern void	schedule_event(struct event **, struct timeval *,
 void (*)(int, short, void *), void *);
 extern char*make_timestamp(time_t *, bool);
+#ifndef DISABLE_TLS
 extern struct filed *get_f_by_conninfo(struct tls_conn_settings *conn_info);
+#endif
 extern bool	message_queue_remove(struct filed *, struct buf_queue *);
 extern void	buf_msg_free(struct buf_msg *msg);
 extern void	message_queue_freeall(struct filed *);

Index: src/usr.sbin/syslogd/syslogd.c
diff -u src/usr.sbin/syslogd/syslogd.c:1.99 src/usr.sbin/syslogd/syslogd.c:1.100
--- src/usr.sbin/syslogd/syslogd.c:1.99	Fri Feb  6 21:09:46 2009
+++ src/usr.sbin/syslogd/syslogd.c	Wed Jun  9 21:55:42 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: syslogd.c,v 1.99 2009/02/06 21:09:46 mschuett Exp $	*/
+/*	$NetBSD: syslogd.c,v 1.100 2010/06/09 21:55:42 riz Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)syslogd.c	8.3 (Berkeley) 4/4/94";
 #else
-__RCSID("$NetBSD: syslogd.c,v 1.99 2009/02/06 21:09:46 mschuett Exp $");
+__RCSID("$NetBSD: syslogd.c,v 1.100 2010/06/09 21:55:42 riz Exp $");
 #endif
 #endif /* not lint */
 
@@ -2114,7 +2114,7 @@
 	int e = 0, len = 0;
 	size_t msglen, linelen, tlsprefixlen, prilen;
 	char *p, *line = NULL, *lineptr = NULL;
-#ifndef DISABLE_TLS
+#ifndef DISABLE_SIGN
 	bool newhash = false;
 #endif
 #define REPBUFSIZE 80
@@ -3248,8 +3248,8 @@
 	struct filed *f, *newf, **nextp, *f2;
 	char *p;
 	sigset_t newmask, omask;
-	char *tls_status_msg = NULL;
 #ifndef DISABLE_TLS
+	char *tls_status_msg = NULL;
 	struct peer_cred *cred = NULL;
 #endif /* !DISABLE_TLS */
 
@@ -3818,8 +3818,10 @@
 		break;
 
 	case '|':
+#ifndef DISABLE_SIGN
 		if (GlobalSign.sg == 3)
 			f->f_flags |= FFLAG_SIGN;
+#endif
 		f->f_un.f_pipe.f_pid = 0;
 		(void) strlcpy(f->f_un.f_pipe.f_pname, p + 1,
 		sizeof(f->f_un.f_pipe.f_pname));
@@ -4200,6 +4202,7 @@
 #define SQ_CHUNK_SIZE 250
 	size_t cnt = 0;
 
+#ifndef DISABLE_TLS
 	if (f->f_type == F_TLS) {
 		/* use a flag to prevent recursive calls to send_queue() */
 		if (f->f_un.f_tls.tls_conn->send_queue)
@@ -4209,6 +4212,7 @@
 	}
 	DPRINTF((D_DATA|D_CALL), "send_queue(f...@%p with %zu msgs, "
 		"c...@%p = %zu)\n", f, f->f_qelements, &cnt, cnt);
+#endif /* !DISABLE_TLS */
 
 	while ((qentry = STAILQ_FIRST(&f->f_qhead))) {
 #ifndef DISABLE_TLS
@@ -4246,8 +4250,11 @@
 			break;
 		}
 	}
+#ifndef DISABLE_TLS
 	if (f->f_type == F_TLS)
 		f->f_un.f_tls.tls_conn->send_queue = false;
+#endif
+
 }
 
 /*



CVS commit: src/doc

2010-06-09 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Wed Jun  9 21:54:21 UTC 2010

Modified Files:
src/doc: RESPONSIBLE

Log Message:
Take responsability for Postfix.


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/doc/RESPONSIBLE

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

Modified files:

Index: src/doc/RESPONSIBLE
diff -u src/doc/RESPONSIBLE:1.93 src/doc/RESPONSIBLE:1.94
--- src/doc/RESPONSIBLE:1.93	Sat Dec  5 16:29:11 2009
+++ src/doc/RESPONSIBLE	Wed Jun  9 21:54:21 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: RESPONSIBLE,v 1.93 2009/12/05 16:29:11 pooka Exp $
+#	$NetBSD: RESPONSIBLE,v 1.94 2010/06/09 21:54:21 tron Exp $
 
 List of sections of the system, and who is responsible for them (or at
 least considered an expert on them).
@@ -40,7 +40,7 @@
 pcc		ragge
 ping		christos
 ping6		core
-postfix		heas
+postfix		tron
 postinstall	core
 ppp(async)	christos
 ppp(sync)	martin?



CVS commit: src/distrib/notes/sandpoint

2010-06-09 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jun  9 21:49:41 UTC 2010

Modified Files:
src/distrib/notes/sandpoint: install prep

Log Message:
Fix a typo.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/distrib/notes/sandpoint/install
cvs rdiff -u -r1.4 -r1.5 src/distrib/notes/sandpoint/prep

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

Modified files:

Index: src/distrib/notes/sandpoint/install
diff -u src/distrib/notes/sandpoint/install:1.5 src/distrib/notes/sandpoint/install:1.6
--- src/distrib/notes/sandpoint/install:1.5	Wed Jun  9 17:37:23 2010
+++ src/distrib/notes/sandpoint/install	Wed Jun  9 21:49:41 2010
@@ -1,6 +1,6 @@
-.\"	$NetBSD: install,v 1.5 2010/06/09 17:37:23 phx Exp $
+.\"	$NetBSD: install,v 1.6 2010/06/09 21:49:41 wiz Exp $
 .
-.Ss2 Prerare the NFS server
+.Ss2 Prepare the NFS server
 .
 Set up an NFS server and copy the install kernel renamed into
 .Pa netbsd

Index: src/distrib/notes/sandpoint/prep
diff -u src/distrib/notes/sandpoint/prep:1.4 src/distrib/notes/sandpoint/prep:1.5
--- src/distrib/notes/sandpoint/prep:1.4	Wed Jun  9 17:37:23 2010
+++ src/distrib/notes/sandpoint/prep	Wed Jun  9 21:49:41 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: prep,v 1.4 2010/06/09 17:37:23 phx Exp $
+.\"	$NetBSD: prep,v 1.5 2010/06/09 21:49:41 wiz Exp $
 .
 To install
 .Nx \*V
@@ -16,7 +16,7 @@
 .Pa netboot.bin
 binary loads a
 .Nx
-kernel from the root parition of a local disk or from NFS.
+kernel from the root partition of a local disk or from NFS.
 This file should be made available by one of the following methods
 (depending on the firmware):
 .(bullet -compact



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

2010-06-09 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Wed Jun  9 21:36:45 UTC 2010

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

Log Message:
Add missing .debug extension.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/distrib/sets/lists/tests/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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.82 src/distrib/sets/lists/tests/mi:1.83
--- src/distrib/sets/lists/tests/mi:1.82	Wed Jun  9 13:44:22 2010
+++ src/distrib/sets/lists/tests/mi	Wed Jun  9 21:36:45 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.82 2010/06/09 13:44:22 pooka Exp $
+# $NetBSD: mi,v 1.83 2010/06/09 21:36:45 njoly Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -198,7 +198,7 @@
 ./usr/libdata/debug/usr/tests/net/sys/t_listen.debug			tests-net-debug		debug,atf
 ./usr/libdata/debug/usr/tests/rump	tests-syscall-debug
 ./usr/libdata/debug/usr/tests/rump/modautoloadtests-syscall-debug
-./usr/libdata/debug/usr/tests/rump/modautoload/t_modautoload		tests-syscall-debug	debug,atf
+./usr/libdata/debug/usr/tests/rump/modautoload/t_modautoload.debug	tests-syscall-debug	debug,atf
 ./usr/libdata/debug/usr/tests/rump/rumpkerntests-syscall-debug
 ./usr/libdata/debug/usr/tests/rump/rumpkern/t_modcmd.debug		tests-syscall-debug	debug,atf
 ./usr/libdata/debug/usr/tests/rump/rumpkern/t_modlinkset.debug		tests-syscall-debug	debug,atf



CVS commit: src/bin/ed

2010-06-09 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Jun  9 19:20:18 UTC 2010

Modified Files:
src/bin/ed: cbc.c

Log Message:
If the definition of a static function is #if DES, the declaration
of it should be too.  Fixes build of ed where MKCRYPTO=no.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/bin/ed/cbc.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/cbc.c
diff -u src/bin/ed/cbc.c:1.21 src/bin/ed/cbc.c:1.22
--- src/bin/ed/cbc.c:1.21	Sun Jul 26 02:07:12 2009
+++ src/bin/ed/cbc.c	Wed Jun  9 19:20:18 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cbc.c,v 1.21 2009/07/26 02:07:12 dholland Exp $	*/
+/*	$NetBSD: cbc.c,v 1.22 2010/06/09 19:20:18 riz 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.21 2009/07/26 02:07:12 dholland Exp $");
+__RCSID("$NetBSD: cbc.c,v 1.22 2010/06/09 19:20:18 riz Exp $");
 #endif
 #endif /* not lint */
 
@@ -141,12 +141,14 @@
 #endif
 
 
+#ifdef DES
 static void des_error(const char *);
 static int hex_to_binary(int, int);
 static void expand_des_key(char *, char *);
 static void set_des_key(char *);
 static int cbc_decode(char *, FILE *);
 static int cbc_encode(char *, int, FILE *);
+#endif
 
 
 /* init_des_cipher: initialize DES */



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

2010-06-09 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Jun  9 19:06:32 UTC 2010

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

Log Message:
Tag some manpages with "complex" so a build with "MKCOMPLEX=no" completes
successfully.


To generate a diff of this commit:
cvs rdiff -u -r1.1460 -r1.1461 src/distrib/sets/lists/comp/mi

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1460 src/distrib/sets/lists/comp/mi:1.1461
--- src/distrib/sets/lists/comp/mi:1.1460	Tue Jun  8 08:51:08 2010
+++ src/distrib/sets/lists/comp/mi	Wed Jun  9 19:06:31 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1460 2010/06/08 08:51:08 jruoho Exp $
+#	$NetBSD: mi,v 1.1461 2010/06/09 19:06:31 riz Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5230,36 +5230,36 @@
 ./usr/share/man/cat3/bufferevent_write_buffer.0	comp-c-catman		.cat
 ./usr/share/man/cat3/byteorder.0		comp-c-catman		.cat
 ./usr/share/man/cat3/bzero.0			comp-c-catman		.cat
-./usr/share/man/cat3/cabs.0			comp-c-catman		.cat
-./usr/share/man/cat3/cabsf.0			comp-c-catman		.cat
-./usr/share/man/cat3/cacos.0			comp-c-catman		.cat
-./usr/share/man/cat3/cacosf.0			comp-c-catman		.cat
-./usr/share/man/cat3/cacosh.0			comp-c-catman		.cat
-./usr/share/man/cat3/cacoshf.0			comp-c-catman		.cat
+./usr/share/man/cat3/cabs.0			comp-c-catman		complex,.cat
+./usr/share/man/cat3/cabsf.0			comp-c-catman		complex,.cat
+./usr/share/man/cat3/cacos.0			comp-c-catman		complex,.cat
+./usr/share/man/cat3/cacosf.0			comp-c-catman		complex,.cat
+./usr/share/man/cat3/cacosh.0			comp-c-catman		complex,.cat
+./usr/share/man/cat3/cacoshf.0			comp-c-catman		complex,.cat
 ./usr/share/man/cat3/calloc.0			comp-c-catman		.cat
 ./usr/share/man/cat3/callrpc.0			comp-c-catman		.cat
 ./usr/share/man/cat3/can_change_color.0		comp-c-catman		.cat
 ./usr/share/man/cat3/can_change_colors.0	comp-obsolete		obsolete
-./usr/share/man/cat3/carg.0			comp-c-catman		.cat
-./usr/share/man/cat3/cargf.0			comp-c-catman		.cat
-./usr/share/man/cat3/casin.0			comp-c-catman		.cat
-./usr/share/man/cat3/casinf.0			comp-c-catman		.cat
-./usr/share/man/cat3/casinh.0			comp-c-catman		.cat
-./usr/share/man/cat3/casinhf.0			comp-c-catman		.cat
-./usr/share/man/cat3/catan.0			comp-c-catman		.cat
-./usr/share/man/cat3/catanf.0			comp-c-catman		.cat
-./usr/share/man/cat3/catanh.0			comp-c-catman		.cat
-./usr/share/man/cat3/catanhf.0			comp-c-catman		.cat
+./usr/share/man/cat3/carg.0			comp-c-catman		complex,.cat
+./usr/share/man/cat3/cargf.0			comp-c-catman		complex,.cat
+./usr/share/man/cat3/casin.0			comp-c-catman		complex,.cat
+./usr/share/man/cat3/casinf.0			comp-c-catman		complex,.cat
+./usr/share/man/cat3/casinh.0			comp-c-catman		complex,.cat
+./usr/share/man/cat3/casinhf.0			comp-c-catman		complex,.cat
+./usr/share/man/cat3/catan.0			comp-c-catman		complex,.cat
+./usr/share/man/cat3/catanf.0			comp-c-catman		complex,.cat
+./usr/share/man/cat3/catanh.0			comp-c-catman		complex,.cat
+./usr/share/man/cat3/catanhf.0			comp-c-catman		complex,.cat
 ./usr/share/man/cat3/catclose.0			comp-c-catman		.cat
 ./usr/share/man/cat3/catgets.0			comp-c-catman		.cat
 ./usr/share/man/cat3/catopen.0			comp-c-catman		.cat
 ./usr/share/man/cat3/cbreak.0			comp-c-catman		.cat
 ./usr/share/man/cat3/cbrt.0			comp-c-catman		.cat
 ./usr/share/man/cat3/cbrtf.0			comp-c-catman		.cat
-./usr/share/man/cat3/ccos.0			comp-c-catman		.cat
-./usr/share/man/cat3/ccosf.0			comp-c-catman		.cat
-./usr/share/man/cat3/ccosh.0			comp-c-catman		.cat
-./usr/share/man/cat3/ccoshf.0			comp-c-catman		.cat
+./usr/share/man/cat3/ccos.0			comp-c-catman		complex,.cat
+./usr/share/man/cat3/ccosf.0			comp-c-catman		complex,.cat
+./usr/share/man/cat3/ccosh.0			comp-c-catman		complex,.cat
+./usr/share/man/cat3/ccoshf.0			comp-c-catman		complex,.cat
 ./usr/share/man/cat3/cdbr.0			comp-c-catman		.cat
 ./usr/share/man/cat3/cdbr_close.0		comp-c-catman		.cat
 ./usr/share/man/cat3/cdbr_entries.0		comp-c-catman		.cat
@@ -5303,8 +5303,8 @@
 ./usr/share/man/cat3/cdk_viewer.0		comp-obsolete		obsolete
 ./usr/share/man/cat3/ceil.0			comp-c-catman		.cat
 ./usr/share/man/cat3/ceilf.0			comp-c-catman		.cat
-./usr/share/man/cat3/cexp.0			comp-c-catman		.cat
-./usr/share/man/cat3/cexpf.0			comp-c-catman		.cat
+./usr/share/man/cat3/cexp.0			comp-c-catman		complex,.cat
+./usr/share/man/cat3/cexpf.0			comp-c-catman		complex,.cat
 ./usr/share/man/cat3/cfgetispeed.0		comp-c-catman		.cat
 ./usr/share/man/cat3/cfgetospeed.0		comp-c-catman		.cat
 ./usr/share/man/cat3/cfmakeraw.0		comp-c-catman		.cat
@@ -5322,8 +5322,8 @@
 ./usr/share/man/cat3/cgetstr.0			comp-c-catman		.cat
 ./usr/share/man/cat3/cgetustr.0			comp-c-catman		.cat
 ./usr/share/man/cat3/chgat.0			comp-c-catman		.cat
-./usr/share/man/cat3/cimag.0			comp-c-catman		.cat
-./usr/share/man/cat3/cimagf.0			comp-c-catman		.cat
+./usr/share/man/cat3/cima

CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2010-06-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun  9 18:16:27 UTC 2010

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: vm_machdep.c

Log Message:
only copy PK_32, left rest of p_flag along.


To generate a diff of this commit:
cvs rdiff -u -r1.121.6.1.2.15 -r1.121.6.1.2.16 \
src/sys/arch/mips/mips/vm_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/mips/mips/vm_machdep.c
diff -u src/sys/arch/mips/mips/vm_machdep.c:1.121.6.1.2.15 src/sys/arch/mips/mips/vm_machdep.c:1.121.6.1.2.16
--- src/sys/arch/mips/mips/vm_machdep.c:1.121.6.1.2.15	Wed Jun  9 14:20:00 2010
+++ src/sys/arch/mips/mips/vm_machdep.c	Wed Jun  9 18:16:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.121.6.1.2.15 2010/06/09 14:20:00 matt Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.121.6.1.2.16 2010/06/09 18:16:27 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -80,7 +80,7 @@
 #include "opt_coredump.h"
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.121.6.1.2.15 2010/06/09 14:20:00 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.121.6.1.2.16 2010/06/09 18:16:27 matt Exp $");
 
 #include 
 #include 
@@ -216,7 +216,7 @@
 {
 	p2->p_md.md_abi = p1->p_md.md_abi;
 #ifdef _LP64
-	p2->p_flag = p1->p_flag & PK_32;
+	p2->p_flag |= p1->p_flag & PK_32;
 #endif
 }
 



CVS commit: [matt-nb5-mips64] src/sys/compat/netbsd32

2010-06-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun  9 18:13:46 UTC 2010

Modified Files:
src/sys/compat/netbsd32 [matt-nb5-mips64]: netbsd32_conv.h
netbsd32_socket.c

Log Message:
Fix socket passing in netbsd32 compat.  unfdpasses and incoming ssh
interactive session now work.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.19.12.1 src/sys/compat/netbsd32/netbsd32_conv.h
cvs rdiff -u -r1.33 -r1.33.12.1 src/sys/compat/netbsd32/netbsd32_socket.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_conv.h
diff -u src/sys/compat/netbsd32/netbsd32_conv.h:1.19 src/sys/compat/netbsd32/netbsd32_conv.h:1.19.12.1
--- src/sys/compat/netbsd32/netbsd32_conv.h:1.19	Mon Jun  2 14:12:08 2008
+++ src/sys/compat/netbsd32/netbsd32_conv.h	Wed Jun  9 18:13:46 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_conv.h,v 1.19 2008/06/02 14:12:08 njoly Exp $	*/
+/*	$NetBSD: netbsd32_conv.h,v 1.19.12.1 2010/06/09 18:13:46 matt Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -234,6 +234,7 @@
 
 	mhp->msg_name = NETBSD32PTR64(mhp32->msg_name);
 	mhp->msg_namelen = mhp32->msg_namelen;
+	mhp->msg_iov = NETBSD32PTR64(mhp32->msg_iov);
 	mhp->msg_iovlen = (size_t)mhp32->msg_iovlen;
 	mhp->msg_control = NETBSD32PTR64(mhp32->msg_control);
 	mhp->msg_controllen = mhp32->msg_controllen;

Index: src/sys/compat/netbsd32/netbsd32_socket.c
diff -u src/sys/compat/netbsd32/netbsd32_socket.c:1.33 src/sys/compat/netbsd32/netbsd32_socket.c:1.33.12.1
--- src/sys/compat/netbsd32/netbsd32_socket.c:1.33	Tue Jun 24 11:18:15 2008
+++ src/sys/compat/netbsd32/netbsd32_socket.c	Wed Jun  9 18:13:46 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_socket.c,v 1.33 2008/06/24 11:18:15 ad Exp $	*/
+/*	$NetBSD: netbsd32_socket.c,v 1.33.12.1 2010/06/09 18:13:46 matt Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.33 2008/06/24 11:18:15 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.33.12.1 2010/06/09 18:13:46 matt Exp $");
 
 #include 
 #include 
@@ -77,6 +77,7 @@
 		   M_WAITOK);
 	} else 
 		iov = aiov;
+
 	msg.msg_flags = SCARG(uap, flags);
 	uiov = (struct iovec *)NETBSD32PTR64(msg.msg_iov);
 	error = netbsd32_to_iovecin((struct netbsd32_iovec *)uiov,
@@ -237,10 +238,8 @@
 		iov = (struct iovec *)malloc(
 		   sizeof(struct iovec) * (u_int)msg.msg_iovlen, M_IOV,
 		   M_WAITOK);
-	} else if ((u_int)msg.msg_iovlen > 0)
+	} else
 		iov = aiov;
-	else
-		return (EMSGSIZE);
 
 	error = netbsd32_to_iovecin((struct netbsd32_iovec *)msg.msg_iov,
    iov, msg.msg_iovlen);



CVS commit: src/distrib

2010-06-09 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Jun  9 17:37:24 UTC 2010

Modified Files:
src/distrib/notes/common: contents
src/distrib/notes/sandpoint: hardware install prep
src/distrib/sandpoint/md-kernel: Makefile
src/distrib/utils/sysinst/arch/sandpoint: md.c md.h msg.md.de msg.md.en
msg.md.es msg.md.fr msg.md.pl

Log Message:
Adapted sysinst and installation docs for modern NAS boxes.


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/distrib/notes/common/contents
cvs rdiff -u -r1.6 -r1.7 src/distrib/notes/sandpoint/hardware
cvs rdiff -u -r1.4 -r1.5 src/distrib/notes/sandpoint/install
cvs rdiff -u -r1.3 -r1.4 src/distrib/notes/sandpoint/prep
cvs rdiff -u -r1.1 -r1.2 src/distrib/sandpoint/md-kernel/Makefile
cvs rdiff -u -r1.30 -r1.31 src/distrib/utils/sysinst/arch/sandpoint/md.c
cvs rdiff -u -r1.12 -r1.13 src/distrib/utils/sysinst/arch/sandpoint/md.h
cvs rdiff -u -r1.4 -r1.5 src/distrib/utils/sysinst/arch/sandpoint/msg.md.de \
src/distrib/utils/sysinst/arch/sandpoint/msg.md.es
cvs rdiff -u -r1.10 -r1.11 src/distrib/utils/sysinst/arch/sandpoint/msg.md.en \
src/distrib/utils/sysinst/arch/sandpoint/msg.md.fr \
src/distrib/utils/sysinst/arch/sandpoint/msg.md.pl

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

Modified files:

Index: src/distrib/notes/common/contents
diff -u src/distrib/notes/common/contents:1.159 src/distrib/notes/common/contents:1.160
--- src/distrib/notes/common/contents:1.159	Thu Oct  8 05:28:22 2009
+++ src/distrib/notes/common/contents	Wed Jun  9 17:37:23 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: contents,v 1.159 2009/10/08 05:28:22 snj Exp $
+.\"	$NetBSD: contents,v 1.160 2010/06/09 17:37:23 phx Exp $
 .\"
 .\" Copyright (c) 1999-2005 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -49,7 +49,7 @@
 .	(tag kernel/ -compact \" binary/
 .		It Pa kernel/
 .		(tag netbsd.gz -compact \" binary/kernel
-.if !\n[atari]:\n[mac68k]:\n[sgimips]:\n[evbppc] \{\
+.if !\n[atari]:\n[mac68k]:\n[sgimips]:\n[evbppc]:\n[sandpoint] \{\
 .			It Pa netbsd-GENERIC.gz
 A gzipped
 .Nx
@@ -64,7 +64,7 @@
 .if \n[hpcmips] \{\
 This kernel runs on Vr41xx and TX3922 CPUs only.
 .\} \" hpcmips
-.\} \" !atari/mac68k/sgimips/evgppc
+.\} \" !atari/mac68k/sgimips/evbppc/sandpoint
 .if \n[alpha]:\n[macppc]:\n[sparc]:\n[sparc64]:\n[vax] \{\
 .			It Pa netbsd-GENERIC.MP.gz
 A gzipped
@@ -176,6 +176,16 @@
 .			It Pa netbsd-VME177.gz
 A kernel for MVME177 boards.
 .\}
+.if \n[sandpoint] \{\
+.			It Pa netbsd-GENERIC.gz
+A generic kernel suitable for most Sandpoint-based NAS products.
+.			It Pa netbsd-INSTALL.gz
+An install kernel for most Sandpoint-based NAS products.
+.			It Pa netbsd-INSTALL_KURO.gz
+An install kernel for KuroBox / LinkStation NAS boards.
+.			It Pa netbsd-KUROBOX.gz
+A kernel for KuroBox / LinkStation NAS boards.
+.\}
 .if \n[sparc] \{\
 .			It Pa netbsd-GENERIC_SCSI3.gz
 A kernel with SCSI ID 3 explicitly mapped to 
@@ -271,8 +281,7 @@
 Netbootable RAM disk kernel and the file system in the RAM disk; see below.
 .\}
 .if \n[alpha]:\n[amd64]:\n[amiga]:\n[atari]:\n[bebox]:\n[ews4800mips]:\
-\n[i386]:\n[news68k]:\n[newsmips]:\n[sparc]:\n[x68k]:\n[prep]:\
-\n[sandpoint] \{\
+\n[i386]:\n[news68k]:\n[newsmips]:\n[sparc]:\n[x68k]:\n[prep] \{\
 .		It Pa floppy/
 \*M boot and installation floppies; see below.
 .\}
@@ -306,12 +315,14 @@
 \*M boot and installation kernels; see installation section (Sysinst
 Method), below.
 .\}
-.if \n[amiga]:\n[atari]:\n[hp300]:\n[mvme68k]:\n[sparc]:\n[sparc64]:\n[sun2]:\n[sun3] \{\
+.if \n[amiga]:\n[atari]:\n[hp300]:\n[mvme68k]:\n[sparc]:\n[sparc64]:\
+\n[sun2]:\n[sun3] \{\
 .		It Pa miniroot/
 \*M miniroot file system image; see below.
 .\}
 .
-.if !\n[alpha]:\n[cats]:\n[evbppc]:\n[mvme68k]:\n[macppc]:\n[sgimips]:\n[sparc]:\n[xen] \{\
+.if !\n[alpha]:\n[cats]:\n[evbppc]:\n[mvme68k]:\n[macppc]:\n[sgimips]:\
+\n[sandpoint]:\n[sparc]:\n[xen] \{\
 .		It Pa misc/
 .
 Miscellaneous \*M installation utilities; see
@@ -355,6 +366,13 @@
 Tape boot programs, and a RAMDISK kernel; see below.
 .\}
 .
+.if \n[sandpoint] \{\
+.		It Pa netboot
+\*M bootloader in ELF format; see below
+.		It Pa netboot.bin
+\*M bootloader in binary format; see below
+.\}
+.
 .if \n[sgimips] \{\
 .		It Pa netboot/
 NFS-root images
@@ -781,6 +799,28 @@
 .showsize 4 8
 .\}
 .el \{\
+.ie \n[sandpoint] \{\
+.It Sy kern-GENERIC
+This set contains a
+.Nx*M
+\*V
+.Li GENERIC
+kernel for most Sandpoint-based NAS products, named
+.Pa /netbsd .
+.It Sy kern-KUROBOX
+This set contains a
+.Nx*M
+\*V
+.Li KUROBOX
+kernel for KuroBox / LinkStation boards, named
+.Pa /netbsd .
+.Pp
+You
+.Em must
+install one of these distribution sets for your machine.
+.showsize 2 4
+.\}
+.el \{\
 .ie \n[sgimips] \{\
 .It Sy kern-GENERIC32_IP2x
 This set contains a

Index: src/distrib/notes/sandpoint/hardware
diff -u src/distrib/notes/sandpoint/hardware:1.6 src/distrib/notes/sandpoint/hardw

CVS commit: src

2010-06-09 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed Jun  9 17:34:33 UTC 2010

Modified Files:
src/etc/etc.sandpoint: Makefile.inc
src/sys/arch/sandpoint/conf: GENERIC INSTALL KUROBOX
Added Files:
src/sys/arch/sandpoint/conf: INSTALL_KURO
Removed Files:
src/sys/arch/sandpoint/conf: GENERIC.NAS RAMDISK

Log Message:
The sandpoint port is now focussed on 824x based NAS boxes.
Replaced GENERIC by GENERIC.NAS.
Added INSTALL_KURO for KuroBox.
GENERIC.NAS and RAMDISK are no longer needed.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/etc/etc.sandpoint/Makefile.inc
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/sandpoint/conf/GENERIC
cvs rdiff -u -r1.14 -r0 src/sys/arch/sandpoint/conf/GENERIC.NAS
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sandpoint/conf/INSTALL
cvs rdiff -u -r0 -r1.1 src/sys/arch/sandpoint/conf/INSTALL_KURO
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sandpoint/conf/KUROBOX
cvs rdiff -u -r1.4 -r0 src/sys/arch/sandpoint/conf/RAMDISK

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

Modified files:

Index: src/etc/etc.sandpoint/Makefile.inc
diff -u src/etc/etc.sandpoint/Makefile.inc:1.12 src/etc/etc.sandpoint/Makefile.inc:1.13
--- src/etc/etc.sandpoint/Makefile.inc:1.12	Mon May 17 22:52:17 2010
+++ src/etc/etc.sandpoint/Makefile.inc	Wed Jun  9 17:34:32 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.12 2010/05/17 22:52:17 phx Exp $
+#	$NetBSD: Makefile.inc,v 1.13 2010/06/09 17:34:32 phx Exp $
 #
 #	etc.sandpoint/Makefile.inc -- sandpoint-specific etc Makefile targets
 #
@@ -6,7 +6,7 @@
 # If you change the list of distributed kernels, don't forget
 # to update the release documentation in distrib/notes/common/contents
 
-KERNEL_SETS=		GENERIC GENERIC.NAS KUROBOX
+KERNEL_SETS=		GENERIC KUROBOX
 KERNEL_SUFFIXES=	srec
 
-BUILD_KERNELS=  	INSTALL
+BUILD_KERNELS=  	INSTALL INSTALL_KURO

Index: src/sys/arch/sandpoint/conf/GENERIC
diff -u src/sys/arch/sandpoint/conf/GENERIC:1.47 src/sys/arch/sandpoint/conf/GENERIC:1.48
--- src/sys/arch/sandpoint/conf/GENERIC:1.47	Mon May 17 22:52:17 2010
+++ src/sys/arch/sandpoint/conf/GENERIC	Wed Jun  9 17:34:32 2010
@@ -1,6 +1,6 @@
-# $NetBSD: GENERIC,v 1.47 2010/05/17 22:52:17 phx Exp $
+# $NetBSD: GENERIC,v 1.48 2010/06/09 17:34:32 phx Exp $
 #
-# GENERIC machine description file
+# machine description file for GENERIC NAS
 # 
 # This machine description file is used to generate the default NetBSD
 # kernel.  The generic kernel does not include all options, subsystems
@@ -19,15 +19,14 @@
 # device.
 
 include 	"arch/sandpoint/conf/std.sandpoint"
-options 	PIC_I8259
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.47 $"
+#ident 		"GENERIC-$Revision: 1.48 $"
 
 maxusers	32
 
-options 	ALTIVEC		# Include AltiVec support
+#options 	ALTIVEC		# Include AltiVec support
 
 #options 	IPKDBUSERHACK	# Allow access to mapped memory via kgdb
 #options 	DEBUG_BY_TOOLS	# Allow debugging from toolsnet
@@ -72,6 +71,8 @@
 
 options 	MSGBUFSIZE=65536
 
+#options 	WAPBL
+
 file-system 	FFS		# UFS
 file-system 	EXT2FS		# second extended file system (linux)
 #file-system 	LFS		# log-structured file system
@@ -79,12 +80,12 @@
 file-system 	NFS		# Network File System client
 #file-system 	NTFS		# Windows/NT file system (experimental)
 #file-system 	CD9660		# ISO 9660 + Rock Ridge file system
-#file-system 	MSDOSFS		# MS-DOS file system
+file-system 	MSDOSFS		# MS-DOS file system
 file-system 	FDESC		# /dev/fd
 file-system 	KERNFS		# /kern
 file-system 	NULLFS		# loopback file system
 #file-system 	OVERLAY		# overlay file system
-#file-system 	PROCFS		# /proc
+file-system 	PROCFS		# /proc
 #file-system 	UMAPFS		# NULLFS + uid and gid remapping
 #file-system 	UNION		# union file system
 #file-system	CODA		# Coda File System; also needs vcoda (below)
@@ -130,14 +131,6 @@
 #pseudo-device	ipfilter
 pseudo-device	loop
 
-# mouse & keyboard multiplexor pseudo-devices
-#pseudo-device	wsmux
-
-#
-# accept filters
-pseudo-device   accf_data		# "dataready" accept filter
-pseudo-device   accf_http		# "httpready" accept filter
-
 # miscellaneous pseudo-devices
 pseudo-device	rnd			# /dev/random and in-kernel generator
 pseudo-device	vnd		
@@ -154,9 +147,9 @@
 #
 options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
 
-options 	PCIVERBOSE	# verbose PCI device messages
+#options 	PCIVERBOSE	# verbose PCI device messages
 #options 	PCI_CONFIG_DUMP	# verbosely dump PCI config space
-options 	PCI_NETBSD_CONFIGURE	# Have NetBSD configure PCI I/O & Mem
+#options 	PCI_NETBSD_CONFIGURE	# Have NetBSD configure PCI I/O & Mem
 
 mainbus0 at root
 
@@ -164,21 +157,16 @@
 pci*	at mainbus0 bus ?
 
 pchb*	at pci? dev ? function ?	# PCI host bridge
-pcib*	at pci? dev ? function ?	# Winbond 83C553 PCI-ISA bridges
 
 eumb*	at mainbus0
-com*	at eumb?
+com0	at eumb? unit 0			# console at 0x4500
+#com1	at eumb? unit 1
+satmgr0 at eumb? unit 1			# satmg

CVS commit: src

2010-06-09 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Wed Jun  9 17:29:15 UTC 2010

Modified Files:
src: UPDATING

Log Message:
minor clarification


To generate a diff of this commit:
cvs rdiff -u -r1.213 -r1.214 src/UPDATING

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

Modified files:

Index: src/UPDATING
diff -u src/UPDATING:1.213 src/UPDATING:1.214
--- src/UPDATING:1.213	Fri Jun  4 15:11:31 2010
+++ src/UPDATING	Wed Jun  9 17:29:15 2010
@@ -1,4 +1,4 @@
-$NetBSD: UPDATING,v 1.213 2010/06/04 15:11:31 jmmv Exp $
+$NetBSD: UPDATING,v 1.214 2010/06/09 17:29:15 dholland Exp $
 
 This file (UPDATING) is intended to be a brief reference to recent
 changes that might cause problems in the build process, and a guide for
@@ -29,7 +29,7 @@
 
 20100522:
 	private section of  was splitted, and now mklocale(1)
-	include ctype_local.h, so you have to make cleandir tools/mklocale.
+	include ctype_local.h, so you have to make cleandir in tools/mklocale.
 
 20100520:
 	The location of the xkb compiled descriptions has changed. Please



CVS commit: src/usr.bin/make

2010-06-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jun  9 16:58:23 UTC 2010

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

Log Message:
Explain variable expansion better. Requested by Aleksey Cheusov


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

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.174 src/usr.bin/make/make.1:1.175
--- src/usr.bin/make/make.1:1.174	Sun Jun  6 13:28:48 2010
+++ src/usr.bin/make/make.1	Wed Jun  9 12:58:22 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.174 2010/06/06 17:28:48 wiz Exp $
+.\"	$NetBSD: make.1,v 1.175 2010/06/09 16:58:22 christos Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	from: @(#)make.1	8.4 (Berkeley) 3/19/94
 .\"
-.Dd June 6, 2010
+.Dd June 9, 2010
 .Dt MAKE 1
 .Os
 .Sh NAME
@@ -536,11 +536,48 @@
 .Pq Ql \&$
 the string is expanded again.
 .Pp
-Variable substitution occurs at two distinct times, depending on where
+Variable substitution occurs at three distinct times, depending on where
 the variable is being used.
+.Bl -enum
+.It 
 Variables in dependency lines are expanded as the line is read.
+.It
 Variables in shell commands are expanded when the shell command is
 executed.
+.It
+.Dq .for
+loop index variables are expanded on each loop iteration. 
+Note that other variables are not expanded inside loops so 
+the following example code:
+.Bd -literal -offset indent
+
+.Dv .for i in 1 2 3
+a+= ${i}
+j=  ${i}
+b+= ${j}
+.Dv .endfor
+
+all:
+@echo ${a}
+	@echo ${b}
+
+.Ed
+will print:
+.Bd -literal -offset indent
+1 2 3
+3 3 3
+
+.Ed
+Because while ${a} contains
+.Dq 1 2 3
+after the loop is executed, ${b}
+contains
+.Dq ${j} ${j} ${j}
+which expands to
+.Dq 3 3 3
+since after the loop completes ${j} contains
+.Dq 3 .
+.El
 .Ss Variable classes
 The four different classes of variables (in order of increasing precedence)
 are:



CVS commit: [uebayasi-xip] src/sys/uvm

2010-06-09 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Jun  9 15:29:58 UTC 2010

Modified Files:
src/sys/uvm [uebayasi-xip]: uvm_fault.c

Log Message:
Fix build with DIAGNOSTIC.


To generate a diff of this commit:
cvs rdiff -u -r1.166.2.6 -r1.166.2.7 src/sys/uvm/uvm_fault.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/uvm/uvm_fault.c
diff -u src/sys/uvm/uvm_fault.c:1.166.2.6 src/sys/uvm/uvm_fault.c:1.166.2.7
--- src/sys/uvm/uvm_fault.c:1.166.2.6	Mon May 31 13:26:38 2010
+++ src/sys/uvm/uvm_fault.c	Wed Jun  9 15:29:58 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_fault.c,v 1.166.2.6 2010/05/31 13:26:38 uebayasi Exp $	*/
+/*	$NetBSD: uvm_fault.c,v 1.166.2.7 2010/06/09 15:29:58 uebayasi Exp $	*/
 
 /*
  *
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.166.2.6 2010/05/31 13:26:38 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.166.2.7 2010/06/09 15:29:58 uebayasi Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_direct_page.h"
@@ -1719,7 +1719,7 @@
 		if (curpg == NULL || curpg == PGO_DONTCARE) {
 			continue;
 		}
-		KASSERT(uvm_pageisdirect_p(uobjpage) || curpg->uobject == uobj);
+		KASSERT(uvm_pageisdirect_p(curpg) || curpg->uobject == uobj);
 
 		/*
 		 * if center page is resident and not PG_BUSY|PG_RELEASED
@@ -1732,7 +1732,7 @@
 			"(0x%x) with locked get",
 			curpg, 0,0,0);
 		} else {
-			bool readonly = uvm_pageisdirect_p(uobjpage)
+			bool readonly = uvm_pageisdirect_p(curpg)
 			|| (curpg->flags & PG_RDONLY)
 			|| (curpg->loan_count > 0)
 			|| UVM_OBJ_NEEDS_WRITEFAULT(curpg->uobject);



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips

2010-06-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun  9 14:25:30 UTC 2010

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: spl.S

Log Message:
Don't clear SOFT_INT bits in spl0.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/sys/arch/mips/mips/spl.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/mips/mips/spl.S
diff -u src/sys/arch/mips/mips/spl.S:1.1.2.6 src/sys/arch/mips/mips/spl.S:1.1.2.7
--- src/sys/arch/mips/mips/spl.S:1.1.2.6	Sun May 16 00:34:45 2010
+++ src/sys/arch/mips/mips/spl.S	Wed Jun  9 14:25:30 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: spl.S,v 1.1.2.6 2010/05/16 00:34:45 matt Exp $	*/
+/*	$NetBSD: spl.S,v 1.1.2.7 2010/06/09 14:25:30 matt Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #include 
 #include 
 
-RCSID("$NetBSD: spl.S,v 1.1.2.6 2010/05/16 00:34:45 matt Exp $")
+RCSID("$NetBSD: spl.S,v 1.1.2.7 2010/06/09 14:25:30 matt Exp $")
 
 #include "assym.h"
 
@@ -144,7 +144,7 @@
 	INT_L	v1, _C_LABEL(ipl_sr_map) + 4*IPL_NONE
 	xor	v1, MIPS_INT_MASK | MIPS_SR_INT_IE # invert and or in IE
 	PTR_L	a3, L_CPU(MIPS_CURLWP)
-	mtc0	zero, MIPS_COP_0_CAUSE		# clear SOFT_INT bits
+	#mtc0	zero, MIPS_COP_0_CAUSE		# clear SOFT_INT bits
 	COP0_SYNC
 	mfc0	v0, MIPS_COP_0_STATUS
 	nop



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include

2010-06-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun  9 14:24:12 UTC 2010

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: intr.h

Log Message:
Add a _IPL_NAMES(pfx) which is a list of strings corresponding to the
IPL names.


To generate a diff of this commit:
cvs rdiff -u -r1.3.96.12 -r1.3.96.13 src/sys/arch/mips/include/intr.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/mips/include/intr.h
diff -u src/sys/arch/mips/include/intr.h:1.3.96.12 src/sys/arch/mips/include/intr.h:1.3.96.13
--- src/sys/arch/mips/include/intr.h:1.3.96.12	Sun May 16 00:34:45 2010
+++ src/sys/arch/mips/include/intr.h	Wed Jun  9 14:24:12 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.h,v 1.3.96.12 2010/05/16 00:34:45 matt Exp $ */
+/* $NetBSD: intr.h,v 1.3.96.13 2010/06/09 14:24:12 matt Exp $ */
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -46,6 +46,8 @@
 #define	IPL_HIGH	(IPL_DDB+1)
 
 #define	_IPL_N		(IPL_HIGH+1)
+#define	_IPL_NAMES(pfx)	{ pfx"none", pfx"softclock/bio", pfx"softnet/serial", \
+			  pfx"vm", pfx"sched", pfx"ddb", pfx"high" }
 
 #define	IST_UNUSABLE	-1		/* interrupt cannot be used */
 #define	IST_NONE	0		/* none (dummy) */



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/sibyte

2010-06-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun  9 14:22:17 UTC 2010

Modified Files:
src/sys/arch/mips/sibyte/dev [matt-nb5-mips64]: sbgbus.c sbjcn.c
sbjcnvar.h sbobio.c sbscd.c sbscn.c sbscnvar.h sbsmbus.c sbtimer.c
sbwdog.c
src/sys/arch/mips/sibyte/pci [matt-nb5-mips64]: sbbrz.c

Log Message:
Update to the device NWO:
Use CFATTACH_DECL_NEW
struct device * -> device_t
struct cfdata * -> cfdata_t
printf -> aprint_normal_*
Use device_* accessors


To generate a diff of this commit:
cvs rdiff -u -r1.10.96.1 -r1.10.96.2 src/sys/arch/mips/sibyte/dev/sbgbus.c
cvs rdiff -u -r1.21.14.1 -r1.21.14.2 src/sys/arch/mips/sibyte/dev/sbjcn.c
cvs rdiff -u -r1.2 -r1.2.126.1 src/sys/arch/mips/sibyte/dev/sbjcnvar.h
cvs rdiff -u -r1.16.98.1 -r1.16.98.2 src/sys/arch/mips/sibyte/dev/sbobio.c
cvs rdiff -u -r1.14 -r1.14.14.1 src/sys/arch/mips/sibyte/dev/sbscd.c
cvs rdiff -u -r1.27.14.2 -r1.27.14.3 src/sys/arch/mips/sibyte/dev/sbscn.c
cvs rdiff -u -r1.3 -r1.3.88.1 src/sys/arch/mips/sibyte/dev/sbscnvar.h
cvs rdiff -u -r1.13 -r1.13.84.1 src/sys/arch/mips/sibyte/dev/sbsmbus.c
cvs rdiff -u -r1.13.28.2 -r1.13.28.3 src/sys/arch/mips/sibyte/dev/sbtimer.c
cvs rdiff -u -r1.7.94.2 -r1.7.94.3 src/sys/arch/mips/sibyte/dev/sbwdog.c
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/arch/mips/sibyte/pci/sbbrz.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/mips/sibyte/dev/sbgbus.c
diff -u src/sys/arch/mips/sibyte/dev/sbgbus.c:1.10.96.1 src/sys/arch/mips/sibyte/dev/sbgbus.c:1.10.96.2
--- src/sys/arch/mips/sibyte/dev/sbgbus.c:1.10.96.1	Mon Nov 23 18:28:46 2009
+++ src/sys/arch/mips/sibyte/dev/sbgbus.c	Wed Jun  9 14:22:16 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: sbgbus.c,v 1.10.96.1 2009/11/23 18:28:46 matt Exp $ */
+/* $NetBSD: sbgbus.c,v 1.10.96.2 2010/06/09 14:22:16 matt Exp $ */
 
 /*
  * Copyright 2000, 2001
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sbgbus.c,v 1.10.96.1 2009/11/23 18:28:46 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbgbus.c,v 1.10.96.2 2010/06/09 14:22:16 matt Exp $");
 
 #include 
 #include 
@@ -47,18 +47,17 @@
 
 extern struct cfdriver sbgbus_cd;
 
-static int	sbgbus_match(struct device *, struct cfdata *, void *);
-static void	sbgbus_attach(struct device *, struct device *, void *);
+static int	sbgbus_match(device_t, cfdata_t, void *);
+static void	sbgbus_attach(device_t, device_t, void *);
 
-CFATTACH_DECL(sbgbus, sizeof(struct device),
+CFATTACH_DECL_NEW(sbgbus, 0,
 sbgbus_match, sbgbus_attach, NULL, NULL);
 
-static int	sbgbussearch(struct device *, struct cfdata *,
-			 const int *, void *);
+static int	sbgbussearch(device_t, cfdata_t, const int *, void *);
 static int	sbgbusprint(void *, const char *);
 
 static int
-sbgbus_match(struct device *parent, struct cfdata *match, void *aux)
+sbgbus_match(device_t parent, cfdata_t match, void *aux)
 {
 	struct sbobio_attach_args *sap = aux;
 
@@ -69,7 +68,7 @@
 }
 
 static void
-sbgbus_attach(struct device *parent, struct device *self, void *aux)
+sbgbus_attach(device_t parent, device_t self, void *aux)
 {
 
 	/* Configure children using indirect configuration. */
@@ -95,7 +94,7 @@
 }
 
 static int
-sbgbussearch(struct device *parent, struct cfdata *cf,
+sbgbussearch(device_t parent, cfdata_t cf,
 	 const int *ldesc, void *aux)
 {
 	struct sbgbus_attach_args sga;

Index: src/sys/arch/mips/sibyte/dev/sbjcn.c
diff -u src/sys/arch/mips/sibyte/dev/sbjcn.c:1.21.14.1 src/sys/arch/mips/sibyte/dev/sbjcn.c:1.21.14.2
--- src/sys/arch/mips/sibyte/dev/sbjcn.c:1.21.14.1	Mon Nov 23 18:28:46 2009
+++ src/sys/arch/mips/sibyte/dev/sbjcn.c	Wed Jun  9 14:22:16 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: sbjcn.c,v 1.21.14.1 2009/11/23 18:28:46 matt Exp $ */
+/* $NetBSD: sbjcn.c,v 1.21.14.2 2010/06/09 14:22:16 matt Exp $ */
 
 /*
  * Copyright 2000, 2001
@@ -103,7 +103,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sbjcn.c,v 1.21.14.1 2009/11/23 18:28:46 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbjcn.c,v 1.21.14.2 2010/06/09 14:22:16 matt Exp $");
 
 #define	SBJCN_DEBUG
 
@@ -219,10 +219,10 @@
 void	sbjcn_kgdb_putc(void *, int);
 #endif /* KGDB */
 
-static int	sbjcn_match(struct device *, struct cfdata *, void *);
-static void	sbjcn_attach(struct device *, struct device *, void *);
+static int	sbjcn_match(device_t, cfdata_t, void *);
+static void	sbjcn_attach(device_t, device_t, void *);
 
-CFATTACH_DECL(sbjcn, sizeof(struct sbjcn_softc),
+CFATTACH_DECL_NEW(sbjcn, sizeof(struct sbjcn_softc),
 sbjcn_match, sbjcn_attach, NULL, NULL);
 
 #define	READ_REG(rp)		(mips3_ld((volatile uint64_t *)(rp)))
@@ -237,7 +237,7 @@
 
 
 static int
-sbjcn_match(struct device *parent, struct cfdata *match, void *aux)
+sbjcn_match(device_t parent, cfdata_t match, void *aux)
 {
 	struct sbscd_attach_args *sap = aux;
 
@@ -248,14 +248,15 @@
 }
 
 static void
-sbjcn_attach(struct device *parent, struct device *self, void *aux)
+sbjcn_attach(

CVS commit: [matt-nb5-mips64] src/sys/arch/mips

2010-06-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun  9 14:20:00 UTC 2010

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: cpu.h proc.h
src/sys/arch/mips/mips [matt-nb5-mips64]: mips_machdep.c vm_machdep.c

Log Message:
Add support for setting/clearing PK_32 on _LP64 kernels.  Make cpu_proc_fork
a real function and add it to vm_machdep.c and let it copy PK_32 on fork.
Properly clear/set PK_32 depending on ABI in setregs.  Lack of PX_32 use
tracked down by Cliff Neighbors.  [Ya! ps now works!]


To generate a diff of this commit:
cvs rdiff -u -r1.90.16.28 -r1.90.16.29 src/sys/arch/mips/include/cpu.h
cvs rdiff -u -r1.21.36.8 -r1.21.36.9 src/sys/arch/mips/include/proc.h
cvs rdiff -u -r1.205.4.1.2.1.2.46 -r1.205.4.1.2.1.2.47 \
src/sys/arch/mips/mips/mips_machdep.c
cvs rdiff -u -r1.121.6.1.2.14 -r1.121.6.1.2.15 \
src/sys/arch/mips/mips/vm_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/mips/include/cpu.h
diff -u src/sys/arch/mips/include/cpu.h:1.90.16.28 src/sys/arch/mips/include/cpu.h:1.90.16.29
--- src/sys/arch/mips/include/cpu.h:1.90.16.28	Sun Mar 21 18:17:21 2010
+++ src/sys/arch/mips/include/cpu.h	Wed Jun  9 14:20:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.90.16.28 2010/03/21 18:17:21 cliff Exp $	*/
+/*	$NetBSD: cpu.h,v 1.90.16.29 2010/06/09 14:20:00 matt Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -197,7 +197,6 @@
 #else
 #define	cpu_number()		(0L)
 #endif
-#define	cpu_proc_fork(p1, p2)	((void)((p2)->p_md.md_abi = (p1)->p_md.md_abi))
 
 /* XXX simonb
  * Should the following be in a cpu_info type structure?

Index: src/sys/arch/mips/include/proc.h
diff -u src/sys/arch/mips/include/proc.h:1.21.36.8 src/sys/arch/mips/include/proc.h:1.21.36.9
--- src/sys/arch/mips/include/proc.h:1.21.36.8	Sat May 15 20:27:48 2010
+++ src/sys/arch/mips/include/proc.h	Wed Jun  9 14:20:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.21.36.8 2010/05/15 20:27:48 matt Exp $	*/
+/*	$NetBSD: proc.h,v 1.21.36.9 2010/06/09 14:20:00 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -70,8 +70,11 @@
 #define	MDP_FPUSED	0x0001	/* floating point coprocessor used */
 
 #ifdef _KERNEL
+struct lwp;
+struct proc;
 /* kernel single-step emulation */
-int mips_singlestep(struct lwp *l);
+int	mips_singlestep(struct lwp *);
+void	cpu_proc_fork(struct proc *, struct proc *);
 
 #define	LWP0_CPU_INFO	&cpu_info_store	/* staticly set in lwp0 */
 #endif /* _KERNEL */

Index: src/sys/arch/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.46 src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.47
--- src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.46	Fri May 28 21:24:47 2010
+++ src/sys/arch/mips/mips/mips_machdep.c	Wed Jun  9 14:20:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.46 2010/05/28 21:24:47 matt Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.47 2010/06/09 14:20:00 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -112,7 +112,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.46 2010/05/28 21:24:47 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.47 2010/06/09 14:20:00 matt Exp $");
 
 #define	__INTR_PRIVATE
 
@@ -1228,7 +1228,8 @@
 void
 setregs(struct lwp *l, struct exec_package *pack, u_long stack)
 {
-	struct trapframe *tf = l->l_md.md_utf;
+	struct trapframe * const tf = l->l_md.md_utf;
+	struct proc * const p = l->l_proc;
 
 	memset(tf, 0, sizeof(struct trapframe));
 	tf->tf_regs[_R_SP] = (int)stack;
@@ -1239,14 +1240,26 @@
 	/*
 	 * allow 64bit ops in userland for non-O32 ABIs
 	 */
-	if (l->l_proc->p_md.md_abi == _MIPS_BSD_API_N32 && CPUISMIPS64) {
+	if (p->p_md.md_abi == _MIPS_BSD_API_N32 && CPUISMIPS64) {
 		tf->tf_regs[_R_SR] |= MIPS_SR_PX;
-	} else if (l->l_proc->p_md.md_abi != _MIPS_BSD_API_O32) {
+	} else if (p->p_md.md_abi != _MIPS_BSD_API_O32) {
 		tf->tf_regs[_R_SR] |= MIPS_SR_UX;
 	}
-	if (_MIPS_SIM_NEWABI_P(l->l_proc->p_md.md_abi))
+	if (_MIPS_SIM_NEWABI_P(p->p_md.md_abi))
 		tf->tf_regs[_R_SR] |= MIPS3_SR_FR;
 #endif
+#ifdef _LP64
+	/*
+	 * If we are using a 32-bit ABI on a 64-bit kernel, mark the process
+	 * that way.  If we aren't, clear it.
+	 */
+	if (p->p_md.md_abi == _MIPS_BSD_API_N32
+	|| p->p_md.md_abi == _MIPS_BSD_API_O32) {
+		p->p_flag |= PK_32;
+	} else {
+		p->p_flag &= ~PK_32;
+	}
+#endif
 	/*
 	 * Set up arguments for _start():
 	 *	_start(stack, obj, cleanup, ps_strings);
@@ -1259,7 +1272,7 @@
 	tf->tf_regs[_R_A0] = (intptr_t)stack;
 	tf->tf_regs[_R_A1] = 0;
 	tf->tf_regs[_R_A2] = 0;
-	tf->tf_regs[_R_A3] = (intptr_t)l->l_proc->p_psstr;
+	tf->tf_regs[_R_A3] = (intptr_t)p->p_psstr;
 
 	if (l->l_md.md_flags & MDP_FPUSED)
 		fpudiscard_lwp(l);
@@ -1662,7 +1675,9 @@
 	lwp0.l_md.md_utf = (struct trapframe *)(v + USPACE) - 1;
 #ifdef _LP64
 	lwp0.l_md.md_utf->tf

CVS commit: src

2010-06-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jun  9 14:08:17 UTC 2010

Modified Files:
src/lib/librumpuser: rumpuser.c
src/sys/rump/include/rump: rumpuser.h
src/sys/rump/librump/rumpkern: rump.c

Log Message:
Version rumpuser ABI with a lightweight mechanism.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/librumpuser/rumpuser.c
cvs rdiff -u -r1.44 -r1.45 src/sys/rump/include/rump/rumpuser.h
cvs rdiff -u -r1.176 -r1.177 src/sys/rump/librump/rumpkern/rump.c

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

Modified files:

Index: src/lib/librumpuser/rumpuser.c
diff -u src/lib/librumpuser/rumpuser.c:1.7 src/lib/librumpuser/rumpuser.c:1.8
--- src/lib/librumpuser/rumpuser.c:1.7	Wed Jun  9 11:35:36 2010
+++ src/lib/librumpuser/rumpuser.c	Wed Jun  9 14:08:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpuser.c,v 1.7 2010/06/09 11:35:36 pooka Exp $	*/
+/*	$NetBSD: rumpuser.c,v 1.8 2010/06/09 14:08:17 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007-2010 Antti Kantee.  All Rights Reserved.
@@ -27,7 +27,7 @@
 
 #include 
 #if !defined(lint)
-__RCSID("$NetBSD: rumpuser.c,v 1.7 2010/06/09 11:35:36 pooka Exp $");
+__RCSID("$NetBSD: rumpuser.c,v 1.8 2010/06/09 14:08:17 pooka Exp $");
 #endif /* !lint */
 
 /* thank the maker for this */
@@ -68,6 +68,13 @@
 #include "rumpuser_int.h"
 
 int
+rumpuser_getversion()
+{
+
+	return RUMPUSER_VERSION;
+}
+
+int
 rumpuser_getfileinfo(const char *path, uint64_t *sizep, int *ftp, int *error)
 {
 	struct stat sb;

Index: src/sys/rump/include/rump/rumpuser.h
diff -u src/sys/rump/include/rump/rumpuser.h:1.44 src/sys/rump/include/rump/rumpuser.h:1.45
--- src/sys/rump/include/rump/rumpuser.h:1.44	Wed Jun  9 11:35:36 2010
+++ src/sys/rump/include/rump/rumpuser.h	Wed Jun  9 14:08:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpuser.h,v 1.44 2010/06/09 11:35:36 pooka Exp $	*/
+/*	$NetBSD: rumpuser.h,v 1.45 2010/06/09 14:08:17 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -36,6 +36,9 @@
 #include 
 #endif
 
+#define RUMPUSER_VERSION 1
+int rumpuser_getversion(void);
+
 struct msghdr;
 struct pollfd;
 struct sockaddr;

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.176 src/sys/rump/librump/rumpkern/rump.c:1.177
--- src/sys/rump/librump/rumpkern/rump.c:1.176	Wed Jun  9 13:51:02 2010
+++ src/sys/rump/librump/rumpkern/rump.c	Wed Jun  9 14:08:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.176 2010/06/09 13:51:02 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.177 2010/06/09 14:08:17 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.176 2010/06/09 13:51:02 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.177 2010/06/09 14:08:17 pooka Exp $");
 
 #include 
 #define ELFSIZE ARCH_ELFSIZE
@@ -217,6 +217,13 @@
 	else
 		rump_inited = 1;
 
+	if (rumpuser_getversion() != RUMPUSER_VERSION) {
+		/* let's hope the ABI of rumpuser_dprintf is the same ;) */
+		rumpuser_dprintf("rumpuser version mismatch: %d vs. %d\n",
+		rumpuser_getversion(), RUMPUSER_VERSION);
+		return EPROGMISMATCH;
+	}
+
 	if (rumpuser_getenv("RUMP_VERBOSE", buf, sizeof(buf), &error) == 0) {
 		if (*buf != '0')
 			boothowto = AB_VERBOSE;



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

2010-06-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jun  9 13:51:02 UTC 2010

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

Log Message:
initialize specificdata for lwp0 too


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/rump/librump/rumpkern/rump.c

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

Modified files:

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.175 src/sys/rump/librump/rumpkern/rump.c:1.176
--- src/sys/rump/librump/rumpkern/rump.c:1.175	Thu Jun  3 10:56:20 2010
+++ src/sys/rump/librump/rumpkern/rump.c	Wed Jun  9 13:51:02 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.175 2010/06/03 10:56:20 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.176 2010/06/09 13:51:02 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.175 2010/06/03 10:56:20 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.176 2010/06/09 13:51:02 pooka Exp $");
 
 #include 
 #define ELFSIZE ARCH_ELFSIZE
@@ -313,7 +313,9 @@
 	LIST_INIT(&allproc);
 	LIST_INSERT_HEAD(&allproc, &proc0, p_list);
 	proc_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NONE);
+
 	lwpinit_specificdata();
+	lwp_initspecific(&lwp0);
 
 	mutex_init(&rump_limits.pl_lock, MUTEX_DEFAULT, IPL_NONE);
 	rump_limits.pl_rlimit[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;



CVS commit: src/share/man/man4

2010-06-09 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Jun  9 13:44:24 UTC 2010

Modified Files:
src/share/man/man4: aps.4 thinkpad.4

Log Message:
Reference aps(4) and thinkpad(4) with each other.

In aps(4) note that sensor values are refreshed every 0.5 seconds, which may
have a negative effect on battery life.

(Since the sensors are purely descriptive and no time-sensitive protective
measures are being carried out, it would probably be a good idea to remove
the whole callout(9) from the driver and let the sysmon's poll cycle take
over.)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/aps.4
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/thinkpad.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/aps.4
diff -u src/share/man/man4/aps.4:1.2 src/share/man/man4/aps.4:1.3
--- src/share/man/man4/aps.4:1.2	Tue Sep 11 22:27:04 2007
+++ src/share/man/man4/aps.4	Wed Jun  9 13:44:24 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: aps.4,v 1.2 2007/09/11 22:27:04 wiz Exp $
+.\"	$NetBSD: aps.4,v 1.3 2010/06/09 13:44:24 jruoho Exp $
 .\"	$OpenBSD: aps.4,v 1.7 2007/05/31 19:19:49 jmc Exp $
 .\"
 .\" Copyright (c) 2005 Jonathan Gray 
@@ -15,7 +15,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd September 11, 2007
+.Dd June 9, 2010
 .Dt APS 4
 .Os
 .Sh NAME
@@ -45,6 +45,7 @@
 .El
 .Sh SEE ALSO
 .Xr envsys 4 ,
+.Xr thinkpad 4 ,
 .Xr envstat 8
 .Sh HISTORY
 The
@@ -60,14 +61,24 @@
 driver was written by
 .An Jonathan Gray Aq j...@openbsd.org .
 .Sh CAVEATS
+Few issues can be mentioned.
+.Bl -bullet
+.It
 The
 .Nm
-driver does not yet maintain state and subsequently does not take
+driver does not maintain state and subsequently does not take
 evasive action when it thinks the hard drive is in danger.
-.Pp
+Possible actions would include spinning down the hard drive
+in case excessive tremor is detected by the sensors.
+.It
 The Y axis on X40 and possibly other models seems to be inverted.
 It is unknown how to distinguish between different versions of the
 accelerometer to compensate for this in the driver at this time.
-.Pp
+.It
+The sensor values are refreshed every 0.5 seconds.
+Because no protection measures are taken,
+this is unnecessary and may have a negative effect on battery life.
+.It
 As IBM provides no documentation, it is not known what all the available
 sensors are used for.
+.El

Index: src/share/man/man4/thinkpad.4
diff -u src/share/man/man4/thinkpad.4:1.1 src/share/man/man4/thinkpad.4:1.2
--- src/share/man/man4/thinkpad.4:1.1	Sat Oct 18 20:44:53 2008
+++ src/share/man/man4/thinkpad.4	Wed Jun  9 13:44:24 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: thinkpad.4,v 1.1 2008/10/18 20:44:53 jmcneill Exp $
+.\"	$NetBSD: thinkpad.4,v 1.2 2010/06/09 13:44:24 jruoho Exp $
 .\"
 .\" Copyright (c) 2008 Jared D. McNeill 
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 18, 2008
+.Dd June 9, 2010
 .Dt THINKPAD 4
 .Os
 .Sh NAME
@@ -40,6 +40,7 @@
 temperature and fan monitoring.
 .Sh SEE ALSO
 .Xr acpi 4 ,
+.Xr aps 4 ,
 .Xr pmf 9 ,
 .Xr sysmon_envsys 9
 .Sh HISTORY



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

2010-06-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jun  9 13:44:22 UTC 2010

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

Log Message:
take care of the usual pastos invisible to the human eye


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/distrib/sets/lists/tests/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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.81 src/distrib/sets/lists/tests/mi:1.82
--- src/distrib/sets/lists/tests/mi:1.81	Wed Jun  9 12:40:49 2010
+++ src/distrib/sets/lists/tests/mi	Wed Jun  9 13:44:22 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.81 2010/06/09 12:40:49 pooka Exp $
+# $NetBSD: mi,v 1.82 2010/06/09 13:44:22 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -198,7 +198,7 @@
 ./usr/libdata/debug/usr/tests/net/sys/t_listen.debug			tests-net-debug		debug,atf
 ./usr/libdata/debug/usr/tests/rump	tests-syscall-debug
 ./usr/libdata/debug/usr/tests/rump/modautoloadtests-syscall-debug
-./usr/libdata/debug/usr/tests/rump/modautoload/t_modautoload		tests-syscall-debug
+./usr/libdata/debug/usr/tests/rump/modautoload/t_modautoload		tests-syscall-debug	debug,atf
 ./usr/libdata/debug/usr/tests/rump/rumpkerntests-syscall-debug
 ./usr/libdata/debug/usr/tests/rump/rumpkern/t_modcmd.debug		tests-syscall-debug	debug,atf
 ./usr/libdata/debug/usr/tests/rump/rumpkern/t_modlinkset.debug		tests-syscall-debug	debug,atf



CVS commit: src/sys/dev/usb

2010-06-09 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Jun  9 13:33:13 UTC 2010

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

Log Message:
Revert previous - it was committed unintentionally along with other changes.


To generate a diff of this commit:
cvs rdiff -u -r1.207 -r1.208 src/sys/dev/usb/ohci.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/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.207 src/sys/dev/usb/ohci.c:1.208
--- src/sys/dev/usb/ohci.c:1.207	Sun Jun  6 18:58:26 2010
+++ src/sys/dev/usb/ohci.c	Wed Jun  9 13:33:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.207 2010/06/06 18:58:26 pgoyette Exp $	*/
+/*	$NetBSD: ohci.c,v 1.208 2010/06/09 13:33:13 pgoyette Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $	*/
 
 /*
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.207 2010/06/06 18:58:26 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.208 2010/06/09 13:33:13 pgoyette Exp $");
 
 #include 
 #include 
@@ -1291,8 +1291,7 @@
 			DPRINTFN(5,("add ITD %p\n", sitd));
 			continue;
 		}
-		printf("ohci_softintr: addr 0x%08lx not found", (u_long)done);
-		return;
+		panic("ohci_softintr: addr 0x%08lx not found", (u_long)done);
 	}
 
 	DPRINTFN(10,("ohci_softintr: sdone=%p sidone=%p\n", sdone, sidone));



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

2010-06-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jun  9 12:40:49 UTC 2010

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

Log Message:
+test


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/distrib/sets/lists/tests/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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.80 src/distrib/sets/lists/tests/mi:1.81
--- src/distrib/sets/lists/tests/mi:1.80	Mon Jun  7 03:43:50 2010
+++ src/distrib/sets/lists/tests/mi	Wed Jun  9 12:40:49 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.80 2010/06/07 03:43:50 riz Exp $
+# $NetBSD: mi,v 1.81 2010/06/09 12:40:49 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -197,6 +197,8 @@
 ./usr/libdata/debug/usr/tests/net/sys/t_connect.debug			tests-net-debug		debug,atf
 ./usr/libdata/debug/usr/tests/net/sys/t_listen.debug			tests-net-debug		debug,atf
 ./usr/libdata/debug/usr/tests/rump	tests-syscall-debug
+./usr/libdata/debug/usr/tests/rump/modautoloadtests-syscall-debug
+./usr/libdata/debug/usr/tests/rump/modautoload/t_modautoload		tests-syscall-debug
 ./usr/libdata/debug/usr/tests/rump/rumpkerntests-syscall-debug
 ./usr/libdata/debug/usr/tests/rump/rumpkern/t_modcmd.debug		tests-syscall-debug	debug,atf
 ./usr/libdata/debug/usr/tests/rump/rumpkern/t_modlinkset.debug		tests-syscall-debug	debug,atf
@@ -1119,6 +1121,9 @@
 ./usr/tests/net/sys/t_listen			tests-net-tests		atf
 ./usr/tests/rumptests-rump-tests
 ./usr/tests/rump/Atffile			tests-rump-tests	atf
+./usr/tests/rump/modautoload			tests-rump-tests
+./usr/tests/rump/modautoload/Atffile		tests-rump-tests	atf
+./usr/tests/rump/modautoload/t_modautoload	tests-rump-tests	atf
 ./usr/tests/rump/rumpkern			tests-rump-tests
 ./usr/tests/rump/rumpkern/Atffile		tests-rump-tests	atf
 ./usr/tests/rump/rumpkern/t_modcmd		tests-rump-tests	atf



CVS commit: src/etc/mtree

2010-06-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jun  9 12:38:15 UTC 2010

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

Log Message:
arbor days are here again


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

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

Modified files:

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.20 src/etc/mtree/NetBSD.dist.base:1.21
--- src/etc/mtree/NetBSD.dist.base:1.20	Fri Jun  4 08:35:35 2010
+++ src/etc/mtree/NetBSD.dist.base	Wed Jun  9 12:38:15 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.20 2010/06/04 08:35:35 jmmv Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.21 2010/06/09 12:38:15 pooka Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -225,6 +225,7 @@
 ./usr/libdata/debug/usr/tests/net/bpf
 ./usr/libdata/debug/usr/tests/net/sys
 ./usr/libdata/debug/usr/tests/rump
+./usr/libdata/debug/usr/tests/rump/modautoload
 ./usr/libdata/debug/usr/tests/rump/rumpkern
 ./usr/libdata/debug/usr/tests/syscall
 ./usr/libdata/debug/usr/tests/util
@@ -1123,6 +1124,7 @@
 ./usr/tests/net/bpf
 ./usr/tests/net/sys
 ./usr/tests/rump
+./usr/tests/rump/modautoload
 ./usr/tests/rump/rumpkern
 ./usr/tests/sys
 ./usr/tests/sys/rc



CVS commit: src/tests/rump

2010-06-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jun  9 12:35:46 UTC 2010

Modified Files:
src/tests/rump: Atffile Makefile
Added Files:
src/tests/rump/modautoload: Atffile Makefile t_modautoload.c

Log Message:
Add a test which checks autoloading modules from the host's
/stand/arch/vers/kmods works in rump (and that the result is usable ;).

On i386 this "just works".  For amd64, due to -mcmodel=kernel,
things are a little more complicated.  We must have the entire rump
kernel loaded in the lower 2GB.  Currently, this can be done either
by using the non-PIC version for the rump kernel compiled with
-mcmodel=small, or, as njoly pointed out, using netbsd32, which
causes vm_default_addr() to give something in the lower 2GB and
therefore shared libs "magically" getting loaded there.  I guess
it would be possible to put a suggested vaddr into the rump kernel
libs and make ld.elf_so map memory from the suggested address if
present ... but that's another show.

Also thanks to tron for access to an amd64 so that I could verify
the test works.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/rump/Atffile src/tests/rump/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/rump/modautoload/Atffile \
src/tests/rump/modautoload/Makefile \
src/tests/rump/modautoload/t_modautoload.c

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

Modified files:

Index: src/tests/rump/Atffile
diff -u src/tests/rump/Atffile:1.2 src/tests/rump/Atffile:1.3
--- src/tests/rump/Atffile:1.2	Mon May 31 23:32:50 2010
+++ src/tests/rump/Atffile	Wed Jun  9 12:35:45 2010
@@ -1,6 +1,7 @@
 Content-Type: application/X-atf-atffile; version="1"
-X-NetBSD-Id: "$NetBSD: Atffile,v 1.2 2010/05/31 23:32:50 pooka Exp $"
+X-NetBSD-Id: "$NetBSD: Atffile,v 1.3 2010/06/09 12:35:45 pooka Exp $"
 
 prop: test-suite = "NetBSD"
 
-tp-glob: rumpkern
+tp: modautoload
+tp: rumpkern
Index: src/tests/rump/Makefile
diff -u src/tests/rump/Makefile:1.2 src/tests/rump/Makefile:1.3
--- src/tests/rump/Makefile:1.2	Mon May 31 23:32:50 2010
+++ src/tests/rump/Makefile	Wed Jun  9 12:35:45 2010
@@ -1,11 +1,11 @@
-#	$NetBSD: Makefile,v 1.2 2010/05/31 23:32:50 pooka Exp $
+#	$NetBSD: Makefile,v 1.3 2010/06/09 12:35:45 pooka Exp $
 #
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/rump
 
-SUBDIR=	kernspace .WAIT rumpkern
+SUBDIR=	kernspace .WAIT rumpkern modautoload
 
 .include 
 .include 

Added files:

Index: src/tests/rump/modautoload/Atffile
diff -u /dev/null src/tests/rump/modautoload/Atffile:1.1
--- /dev/null	Wed Jun  9 12:35:46 2010
+++ src/tests/rump/modautoload/Atffile	Wed Jun  9 12:35:45 2010
@@ -0,0 +1,6 @@
+Content-Type: application/X-atf-atffile; version="1"
+X-NetBSD-Id: "$NetBSD: Atffile,v 1.1 2010/06/09 12:35:45 pooka Exp $"
+
+prop: test-suite = "NetBSD"
+
+tp-glob: t_*
Index: src/tests/rump/modautoload/Makefile
diff -u /dev/null src/tests/rump/modautoload/Makefile:1.1
--- /dev/null	Wed Jun  9 12:35:46 2010
+++ src/tests/rump/modautoload/Makefile	Wed Jun  9 12:35:45 2010
@@ -0,0 +1,24 @@
+#	$NetBSD: Makefile,v 1.1 2010/06/09 12:35:45 pooka Exp $
+#
+
+TESTSDIR=	${TESTSBASE}/rump/modautoload
+
+TESTS_C=	t_modautoload
+
+.include 
+.ifdef RUMPKMOD
+CPPFLAGS+=	-DHAVE_HOST_MODULES
+.endif
+
+# Note: we link the rump kernel into the application to make this work
+# on amd64.  This is the reason we keep this test in its own
+# subdirectory -- otherwise the LDADD lines would get a little hairy.
+LDFLAGS+=	-Wl,-E
+LDADD+=		-Wl,--whole-archive	${DESTDIR}/usr/lib/librumpvfs.a	\
+	${DESTDIR}/usr/lib/librump.a	\
+		-Wl,--no-whole-archive
+LDADD+=		-lrumpuser -lpthread
+
+WARNS=	4
+
+.include 
Index: src/tests/rump/modautoload/t_modautoload.c
diff -u /dev/null src/tests/rump/modautoload/t_modautoload.c:1.1
--- /dev/null	Wed Jun  9 12:35:46 2010
+++ src/tests/rump/modautoload/t_modautoload.c	Wed Jun  9 12:35:45 2010
@@ -0,0 +1,76 @@
+/*	$NetBSD: t_modautoload.c,v 1.1 2010/06/09 12:35:45 pooka Exp $	*/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include "../../h_macros.h"
+
+ATF_TC(modautoload);
+ATF_TC_HEAD(modautoload, tc)
+{
+
+	atf_tc_set_md_var(tc, "descr", "tests that kernel module "
+	"autoload works in rump");
+}
+
+static void
+mountkernfs(void)
+{
+
+#ifndef HAVE_HOST_MODULES
+	atf_tc_skip("host kernel modules not supported on this architecture");
+#endif
+
+	rump_init();
+
+	if (rump_sys_mkdir("/kern", 0777) == -1)
+		atf_tc_fail_errno("mkdir /kern");
+	if (rump_sys_mount(MOUNT_KERNFS, "/kern", 0, NULL, 0) == -1)
+		atf_tc_fail_errno("could not mount kernfs");
+}
+
+/*
+ * Why use kernfs here?  It talks to plenty of other parts with the
+ * kernel (e.g. vfs_attach() in modcmd), but is still easy to verify
+ * it's working correctly.
+ */
+
+#define MAGICNUM 1323
+ATF_TC_BODY(modautoload, tc)
+{
+	extern int rumpns_hz;
+

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

2010-06-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jun  9 12:02:37 UTC 2010

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

Log Message:
On amd64, allocate module_map memory from the lowest 2GB.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/rump/librump/rumpkern/vm.c

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

Modified files:

Index: src/sys/rump/librump/rumpkern/vm.c
diff -u src/sys/rump/librump/rumpkern/vm.c:1.81 src/sys/rump/librump/rumpkern/vm.c:1.82
--- src/sys/rump/librump/rumpkern/vm.c:1.81	Wed Jun  9 11:35:36 2010
+++ src/sys/rump/librump/rumpkern/vm.c	Wed Jun  9 12:02:37 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm.c,v 1.81 2010/06/09 11:35:36 pooka Exp $	*/
+/*	$NetBSD: vm.c,v 1.82 2010/06/09 12:02:37 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007-2010 Antti Kantee.  All Rights Reserved.
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.81 2010/06/09 11:35:36 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.82 2010/06/09 12:02:37 pooka Exp $");
 
 #include 
 #include 
@@ -528,15 +528,39 @@
 vaddr_t
 uvm_km_alloc(struct vm_map *map, vsize_t size, vsize_t align, uvm_flag_t flags)
 {
-	void *rv;
+	void *rv, *desired = NULL;
 	int alignbit, error;
 
+#ifdef __x86_64__
+	/*
+	 * On amd64, allocate all module memory from the lowest 2GB.
+	 * This is because NetBSD kernel modules are compiled
+	 * with -mcmodel=kernel and reserve only 4 bytes for
+	 * offsets.  If we load code compiled with -mcmodel=kernel
+	 * anywhere except the lowest or highest 2GB, it will not
+	 * work.  Since userspace does not have access to the highest
+	 * 2GB, use the lowest 2GB.
+	 * 
+	 * Note: this assumes the rump kernel resides in
+	 * the lowest 2GB as well.
+	 *
+	 * Note2: yes, it's a quick hack, but since this the only
+	 * place where we care about the map we're allocating from,
+	 * just use a simple "if" instead of coming up with a fancy
+	 * generic solution.
+	 */
+	extern struct vm_map *module_map;
+	if (map == module_map) {
+		desired = (void *)(0x8000 - size);
+	}
+#endif
+
 	alignbit = 0;
 	if (align) {
 		alignbit = ffs(align)-1;
 	}
 
-	rv = rumpuser_anonmmap(NULL, size, alignbit, flags & UVM_KMF_EXEC,
+	rv = rumpuser_anonmmap(desired, size, alignbit, flags & UVM_KMF_EXEC,
 	&error);
 	if (rv == NULL) {
 		if (flags & (UVM_KMF_CANFAIL | UVM_KMF_NOWAIT))



CVS commit: src

2010-06-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jun  9 11:35:36 UTC 2010

Modified Files:
src/lib/librumpuser: rumpuser.c
src/sys/rump/include/rump: rumpuser.h
src/sys/rump/librump/rumpkern: vm.c

Log Message:
Add the ability to specify a preferred address the "map anon memory"
hypercall.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/librumpuser/rumpuser.c
cvs rdiff -u -r1.43 -r1.44 src/sys/rump/include/rump/rumpuser.h
cvs rdiff -u -r1.80 -r1.81 src/sys/rump/librump/rumpkern/vm.c

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

Modified files:

Index: src/lib/librumpuser/rumpuser.c
diff -u src/lib/librumpuser/rumpuser.c:1.6 src/lib/librumpuser/rumpuser.c:1.7
--- src/lib/librumpuser/rumpuser.c:1.6	Wed Jun  2 18:15:35 2010
+++ src/lib/librumpuser/rumpuser.c	Wed Jun  9 11:35:36 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpuser.c,v 1.6 2010/06/02 18:15:35 pooka Exp $	*/
+/*	$NetBSD: rumpuser.c,v 1.7 2010/06/09 11:35:36 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007-2010 Antti Kantee.  All Rights Reserved.
@@ -27,7 +27,7 @@
 
 #include 
 #if !defined(lint)
-__RCSID("$NetBSD: rumpuser.c,v 1.6 2010/06/02 18:15:35 pooka Exp $");
+__RCSID("$NetBSD: rumpuser.c,v 1.7 2010/06/09 11:35:36 pooka Exp $");
 #endif /* !lint */
 
 /* thank the maker for this */
@@ -229,7 +229,8 @@
 }
 
 void *
-rumpuser_anonmmap(size_t size, int alignbit, int exec, int *error)
+rumpuser_anonmmap(void *prefaddr, size_t size, int alignbit,
+	int exec, int *error)
 {
 	void *rv;
 	int prot;
@@ -238,7 +239,8 @@
 	if (exec)
 		prot |= PROT_EXEC;
 	/* XXX: MAP_ALIGNED() is not portable */
-	rv = mmap(NULL, size, prot, MAP_ANON | MAP_ALIGNED(alignbit), -1, 0);
+	rv = mmap(prefaddr, size, prot,
+	MAP_ANON | MAP_ALIGNED(alignbit), -1, 0);
 	if (rv == MAP_FAILED) {
 		*error = errno;
 		return NULL;

Index: src/sys/rump/include/rump/rumpuser.h
diff -u src/sys/rump/include/rump/rumpuser.h:1.43 src/sys/rump/include/rump/rumpuser.h:1.44
--- src/sys/rump/include/rump/rumpuser.h:1.43	Tue Jun  1 20:11:33 2010
+++ src/sys/rump/include/rump/rumpuser.h	Wed Jun  9 11:35:36 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpuser.h,v 1.43 2010/06/01 20:11:33 pooka Exp $	*/
+/*	$NetBSD: rumpuser.h,v 1.44 2010/06/09 11:35:36 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -55,7 +55,7 @@
 void *rumpuser_realloc(void *, size_t);
 void rumpuser_free(void *);
 
-void *rumpuser_anonmmap(size_t, int, int, int *);
+void *rumpuser_anonmmap(void *, size_t, int, int, int *);
 #define RUMPUSER_FILEMMAP_READ		0x01
 #define RUMPUSER_FILEMMAP_WRITE		0x02
 #define RUMPUSER_FILEMMAP_TRUNCATE	0x04

Index: src/sys/rump/librump/rumpkern/vm.c
diff -u src/sys/rump/librump/rumpkern/vm.c:1.80 src/sys/rump/librump/rumpkern/vm.c:1.81
--- src/sys/rump/librump/rumpkern/vm.c:1.80	Thu Jun  3 10:56:20 2010
+++ src/sys/rump/librump/rumpkern/vm.c	Wed Jun  9 11:35:36 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm.c,v 1.80 2010/06/03 10:56:20 pooka Exp $	*/
+/*	$NetBSD: vm.c,v 1.81 2010/06/09 11:35:36 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007-2010 Antti Kantee.  All Rights Reserved.
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.80 2010/06/03 10:56:20 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.81 2010/06/09 11:35:36 pooka Exp $");
 
 #include 
 #include 
@@ -289,7 +289,7 @@
 	if (*addr != 0)
 		panic("uvm_mmap() variant unsupported");
 
-	uaddr = rumpuser_anonmmap(size, 0, 0, &error);
+	uaddr = rumpuser_anonmmap(NULL, size, 0, 0, &error);
 	if (uaddr == NULL)
 		return error;
 
@@ -536,7 +536,8 @@
 		alignbit = ffs(align)-1;
 	}
 
-	rv = rumpuser_anonmmap(size, alignbit, flags & UVM_KMF_EXEC, &error);
+	rv = rumpuser_anonmmap(NULL, size, alignbit, flags & UVM_KMF_EXEC,
+	&error);
 	if (rv == NULL) {
 		if (flags & (UVM_KMF_CANFAIL | UVM_KMF_NOWAIT))
 			return 0;



CVS commit: src/tests/fs/nullfs

2010-06-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jun  9 08:37:16 UTC 2010

Modified Files:
src/tests/fs/nullfs: t_basic.c

Log Message:
``twistymount'' regression test for scenario described in PR kern/43439


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/nullfs/t_basic.c

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

Modified files:

Index: src/tests/fs/nullfs/t_basic.c
diff -u src/tests/fs/nullfs/t_basic.c:1.2 src/tests/fs/nullfs/t_basic.c:1.3
--- src/tests/fs/nullfs/t_basic.c:1.2	Mon May 31 23:44:54 2010
+++ src/tests/fs/nullfs/t_basic.c	Wed Jun  9 08:37:16 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_basic.c,v 1.2 2010/05/31 23:44:54 pooka Exp $	*/
+/*	$NetBSD: t_basic.c,v 1.3 2010/06/09 08:37:16 pooka Exp $	*/
 
 #include 
 #include 
@@ -58,9 +58,20 @@
 	return EPROGMISMATCH;
 }
 
-ATF_TC_BODY(basic, tc)
+static void
+mountnull(const char *what, const char *mp, int flags)
 {
 	struct null_args nargs;
+
+	memset(&nargs, 0, sizeof(nargs));
+	nargs.nulla_target = __UNCONST(what);
+	if (rump_sys_mount(MOUNT_NULL, mp, flags, &nargs, sizeof(nargs)) == -1)
+		atf_tc_fail_errno("could not mount nullfs");
+
+}
+
+ATF_TC_BODY(basic, tc)
+{
 	struct tmpfs_args targs;
 	struct stat sb;
 	int error;
@@ -78,10 +89,7 @@
 	if (rump_sys_mount(MOUNT_TMPFS, "/td1", 0, &targs, sizeof(targs)) == -1)
 		atf_tc_fail_errno("could not mount tmpfs td1");
 
-	memset(&nargs, 0, sizeof(nargs));
-	nargs.nulla_target = __UNCONST("/td1");
-	if (rump_sys_mount(MOUNT_NULL, "/td2", 0, &nargs, sizeof(nargs)) == -1)
-		atf_tc_fail_errno("could not mount nullfs");
+	mountnull("/td1", "/td2", 0);
 
 	/* test unnull -> null */
 	xput_tfile("/td1/tensti", "jeppe");
@@ -119,8 +127,48 @@
 	/* done */
 }
 
+ATF_TC(twistymount);
+ATF_TC_HEAD(twistymount, tc)
+{
+
+	/* this is expected to fail until the PR is fixed */
+	atf_tc_set_md_var(tc, "descr", "\"recursive\" mounts deadlock"
+	" (kern/43439)");
+}
+
+/*
+ * Mapping to identifiers in kern/43439:
+ *  /td		= /home/current/pkgsrc
+ *  /td/dist	= /home/current/pkgsrc/distiles
+ *  /mp		= /usr/pkgsrc
+ *  /mp/dist	= /usr/pkgsrc/distfiles -- "created" by first null mount
+ */
+
+ATF_TC_BODY(twistymount, tc)
+{
+	int mkd = 0;
+
+	rump_init();
+
+	if (rump_sys_mkdir("/td", 0777) == -1)
+		atf_tc_fail_errno("mkdir %d", mkd++);
+	if (rump_sys_mkdir("/td/dist", 0777) == -1)
+		atf_tc_fail_errno("mkdir %d", mkd++);
+	if (rump_sys_mkdir("/mp", 0777) == -1)
+		atf_tc_fail_errno("mkdir %d", mkd++);
+
+	/* MNT_RDONLY doesn't matter, but just for compat with the PR */
+	mountnull("/td", "/mp", MNT_RDONLY);
+	mountnull("/td/dist", "/mp/dist", 0);
+
+	/* if we didn't get a locking-against-meself panic, we passed */
+}
+
 ATF_TP_ADD_TCS(tp)
 {
+
 	ATF_TP_ADD_TC(tp, basic);
-	return 0; /*XXX?*/
+	ATF_TP_ADD_TC(tp, twistymount);
+
+	return atf_no_error();
 }



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

2010-06-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jun  9 07:54:13 UTC 2010

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

Log Message:
Similarly to cv_wait, fail if trying to cv_wait_sig() without threads.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/rump/librump/rumpkern/locks.c

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

Modified files:

Index: src/sys/rump/librump/rumpkern/locks.c
diff -u src/sys/rump/librump/rumpkern/locks.c:1.41 src/sys/rump/librump/rumpkern/locks.c:1.42
--- src/sys/rump/librump/rumpkern/locks.c:1.41	Tue May 18 15:12:19 2010
+++ src/sys/rump/librump/rumpkern/locks.c	Wed Jun  9 07:54:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: locks.c,v 1.41 2010/05/18 15:12:19 pooka Exp $	*/
+/*	$NetBSD: locks.c,v 1.42 2010/06/09 07:54:13 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: locks.c,v 1.41 2010/05/18 15:12:19 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locks.c,v 1.42 2010/06/09 07:54:13 pooka Exp $");
 
 #include 
 #include 
@@ -206,7 +206,7 @@
 cv_wait(kcondvar_t *cv, kmutex_t *mtx)
 {
 
-	if (rump_threads == 0)
+	if (__predict_false(rump_threads == 0))
 		panic("cv_wait without threads");
 	rumpuser_cv_wait(RUMPCV(cv), RUMPMTX(mtx));
 }
@@ -215,6 +215,8 @@
 cv_wait_sig(kcondvar_t *cv, kmutex_t *mtx)
 {
 
+	if (__predict_false(rump_threads == 0))
+		panic("cv_wait without threads");
 	rumpuser_cv_wait(RUMPCV(cv), RUMPMTX(mtx));
 	return 0;
 }
@@ -225,19 +227,19 @@
 	struct timespec ts, tick;
 	extern int hz;
 
-	/*
-	 * XXX: this fetches rump kernel time, but rumpuser_cv_timedwait
-	 * uses host time.
-	 */
-	nanotime(&ts);
-	tick.tv_sec = ticks / hz;
-	tick.tv_nsec = (ticks % hz) * (10/hz);
-	timespecadd(&ts, &tick, &ts);
-
 	if (ticks == 0) {
 		cv_wait(cv, mtx);
 		return 0;
 	} else {
+		/*
+		 * XXX: this fetches rump kernel time, but
+		 * rumpuser_cv_timedwait uses host time.
+		 */
+		nanotime(&ts);
+		tick.tv_sec = ticks / hz;
+		tick.tv_nsec = (ticks % hz) * (10/hz);
+		timespecadd(&ts, &tick, &ts);
+
 		if (rumpuser_cv_timedwait(RUMPCV(cv), RUMPMTX(mtx),
 		ts.tv_sec, ts.tv_nsec))
 			return EWOULDBLOCK;