CVS commit: src/sys/kern

2010-06-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 26 06:43:14 UTC 2010

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

Log Message:
Rather than referring a global variable rootvnode in autoconf(9),
prepare and use an internal "root_is_mounted" flag for config_mountroot(9).

Should fix annoying dependency problem in librump reported by Paul Goyette
on current-users@:
http://mail-index.NetBSD.org/current-users/2010/06/25/msg013771.html


To generate a diff of this commit:
cvs rdiff -u -r1.207 -r1.208 src/sys/kern/subr_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/kern/subr_autoconf.c
diff -u src/sys/kern/subr_autoconf.c:1.207 src/sys/kern/subr_autoconf.c:1.208
--- src/sys/kern/subr_autoconf.c:1.207	Fri Jun 25 15:10:42 2010
+++ src/sys/kern/subr_autoconf.c	Sat Jun 26 06:43:13 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.207 2010/06/25 15:10:42 tsutsui Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.208 2010/06/26 06:43:13 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.207 2010/06/25 15:10:42 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.208 2010/06/26 06:43:13 tsutsui Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -98,7 +98,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -203,6 +202,7 @@
 struct deferred_config_head mountroot_config_queue =
 	TAILQ_HEAD_INITIALIZER(mountroot_config_queue);
 int mountroot_config_threads = 2;
+static bool root_is_mounted = false;
 
 static void config_process_deferred(struct deferred_config_head *, device_t);
 
@@ -476,6 +476,9 @@
 {
 	int i;
 
+	if (!root_is_mounted)
+		root_is_mounted = true;
+
 	for (i = 0; i < mountroot_config_threads; i++) {
 		(void)kthread_create(PRI_NONE, 0, NULL,
 		config_mountroot_thread, NULL, NULL, "config");
@@ -1887,7 +1890,7 @@
 	/*
 	 * If root file system is mounted, callback now.
 	 */
-	if (rootvnode != NULL) {
+	if (root_is_mounted) {
 		(*func)(dev);
 		return;
 	}



CVS commit: src/sys/arch/newsmips

2010-06-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 26 03:49:52 UTC 2010

Modified Files:
src/sys/arch/newsmips/apbus: zs_ap.c
src/sys/arch/newsmips/include: z8530var.h

Log Message:
Um, fix botch in previous.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/newsmips/apbus/zs_ap.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/newsmips/include/z8530var.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/newsmips/apbus/zs_ap.c
diff -u src/sys/arch/newsmips/apbus/zs_ap.c:1.26 src/sys/arch/newsmips/apbus/zs_ap.c:1.27
--- src/sys/arch/newsmips/apbus/zs_ap.c:1.26	Sat Jun 26 03:44:49 2010
+++ src/sys/arch/newsmips/apbus/zs_ap.c	Sat Jun 26 03:49:52 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs_ap.c,v 1.26 2010/06/26 03:44:49 tsutsui Exp $	*/
+/*	$NetBSD: zs_ap.c,v 1.27 2010/06/26 03:49:52 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zs_ap.c,v 1.26 2010/06/26 03:44:49 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs_ap.c,v 1.27 2010/06/26 03:49:52 tsutsui Exp $");
 
 #include 
 #include 
@@ -296,7 +296,8 @@
 	/*
 	 * Now safe to install interrupt handlers.
 	 */
-	zsc->zsc_si = softint_establish(SOFTINT_SERIAL, zssoft, zsc);
+	zsc->zsc_si = softint_establish(SOFTINT_SERIAL,
+	(void (*)(void *))zsc_intr_soft, zsc);
 	apbus_intr_establish(1, /* interrupt level ( 0 or 1 ) */
 	NEWS5000_INT1_SCC, 0, /* priority */
 	zshard_ap, zsc, apa->apa_name, apa->apa_ctlnum);

Index: src/sys/arch/newsmips/include/z8530var.h
diff -u src/sys/arch/newsmips/include/z8530var.h:1.10 src/sys/arch/newsmips/include/z8530var.h:1.11
--- src/sys/arch/newsmips/include/z8530var.h:1.10	Sat Mar 29 19:15:35 2008
+++ src/sys/arch/newsmips/include/z8530var.h	Sat Jun 26 03:49:52 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: z8530var.h,v 1.10 2008/03/29 19:15:35 tsutsui Exp $	*/
+/*	$NetBSD: z8530var.h,v 1.11 2010/06/26 03:49:52 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -111,7 +111,6 @@
 
 int zs_print(void *, const char *);
 int zshard(void *);
-void zssoft(void*);
 int zs_get_speed(struct zs_chanstate *);
 void (*zs_delay)(void);
 



CVS commit: src/sys/arch/newsmips

2010-06-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 26 03:44:49 UTC 2010

Modified Files:
src/sys/arch/newsmips/apbus: zs_ap.c
src/sys/arch/newsmips/dev: zs.c zs_hb.c

Log Message:
Pull a similar fix from sparc/dev/zs.c rev 1.119:
 Establish interrupt handlers with proper softc per each zs device
 rather than sharing them among all zs devices and searching softc
 in handlers, to avoid possible recursive lock.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/newsmips/apbus/zs_ap.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/newsmips/dev/zs.c \
src/sys/arch/newsmips/dev/zs_hb.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/newsmips/apbus/zs_ap.c
diff -u src/sys/arch/newsmips/apbus/zs_ap.c:1.25 src/sys/arch/newsmips/apbus/zs_ap.c:1.26
--- src/sys/arch/newsmips/apbus/zs_ap.c:1.25	Mon Apr 28 20:23:30 2008
+++ src/sys/arch/newsmips/apbus/zs_ap.c	Sat Jun 26 03:44:49 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs_ap.c,v 1.25 2008/04/28 20:23:30 martin Exp $	*/
+/*	$NetBSD: zs_ap.c,v 1.26 2010/06/26 03:44:49 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zs_ap.c,v 1.25 2008/04/28 20:23:30 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs_ap.c,v 1.26 2010/06/26 03:44:49 tsutsui Exp $");
 
 #include 
 #include 
@@ -213,7 +213,6 @@
 	volatile u_int *portBctl = (void *)(apa->apa_hwbase + PORTB_OFFSET);
 	volatile u_int *portActl = (void *)(apa->apa_hwbase + PORTA_OFFSET);
 	volatile u_int *esccregs = (void *)(apa->apa_hwbase + ESCC_REG);
-	static int didintr;
 
 	zsc->zsc_dev = self;
 	zs_unit = device_unit(self);
@@ -295,20 +294,12 @@
 	}
 
 	/*
-	 * Now safe to install interrupt handlers.  Note the arguments
-	 * to the interrupt handlers aren't used.  Note, we only do this
-	 * once since both SCCs interrupt at the same level and vector.
+	 * Now safe to install interrupt handlers.
 	 */
-	if (!didintr) {
-		didintr = 1;
-
-		zsc->zsc_si = softint_establish(SOFTINT_SERIAL, zssoft, zsc);
-		apbus_intr_establish(1, /* interrupt level ( 0 or 1 ) */
- NEWS5000_INT1_SCC,
- 0, /* priority */
- zshard_ap, zsc,
- apa->apa_name, apa->apa_ctlnum);
-	}
+	zsc->zsc_si = softint_establish(SOFTINT_SERIAL, zssoft, zsc);
+	apbus_intr_establish(1, /* interrupt level ( 0 or 1 ) */
+	NEWS5000_INT1_SCC, 0, /* priority */
+	zshard_ap, zsc, apa->apa_name, apa->apa_ctlnum);
 	/* XXX; evcnt_attach() ? */
 
 #if 0

Index: src/sys/arch/newsmips/dev/zs.c
diff -u src/sys/arch/newsmips/dev/zs.c:1.25 src/sys/arch/newsmips/dev/zs.c:1.26
--- src/sys/arch/newsmips/dev/zs.c:1.25	Fri Jun 13 12:26:35 2008
+++ src/sys/arch/newsmips/dev/zs.c	Sat Jun 26 03:44:49 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs.c,v 1.25 2008/06/13 12:26:35 cegger Exp $	*/
+/*	$NetBSD: zs.c,v 1.26 2010/06/26 03:44:49 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.25 2008/06/13 12:26:35 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.26 2010/06/26 03:44:49 tsutsui Exp $");
 
 #include "opt_ddb.h"
 
@@ -80,51 +80,24 @@
 }
 
 /*
- * Our ZS chips all share a common, autovectored interrupt,
- * so we have to look at all of them on each interrupt.
+ * Our ZS chips all share a common interrupt level,
+ * but we establish zshard handler per each ZS chips
+ * to avoid holding unnecessary locks in interrupt context.
  */
 int
 zshard(void *arg)
 {
-	struct zsc_softc *zsc;
-	int unit, rval, softreq;
+	struct zsc_softc *zsc = arg;
+	int rval;
 
-	rval = 0;
-	for (unit = 0; unit < zsc_cd.cd_ndevs; unit++) {
-		zsc = device_lookup_private(&zsc_cd, unit);
-		if (zsc == NULL)
-			continue;
-		rval |= zsc_intr_hard(zsc);
-		softreq =  zsc->zsc_cs[0]->cs_softreq;
-		softreq |= zsc->zsc_cs[1]->cs_softreq;
-		if (softreq)
-			softint_schedule(zsc->zsc_si);
-	}
+	rval = zsc_intr_hard(zsc);
+	if (zsc->zsc_cs[0]->cs_softreq || zsc->zsc_cs[1]->cs_softreq)
+		softint_schedule(zsc->zsc_si);
 
 	return rval;
 }
 
 /*
- * Similar scheme as for zshard (look at all of them)
- */
-void
-zssoft(void *arg)
-{
-	struct zsc_softc *zsc;
-	int s, unit;
-
-	/* Make sure we call the tty layer at spltty. */
-	s = spltty();
-	for (unit = 0; unit < zsc_cd.cd_ndevs; unit++) {
-		zsc = device_lookup_private(&zsc_cd, unit);
-		if (zsc == NULL)
-			continue;
-		(void)zsc_intr_soft(zsc);
-	}
-	splx(s);
-}
-
-/*
  * Compute the current baud rate given a ZS channel.
  */
 int
Index: src/sys/arch/newsmips/dev/zs_hb.c
diff -u src/sys/arch/newsmips/dev/zs_hb.c:1.25 src/sys/arch/newsmips/dev/zs_hb.c:1.26
--- src/sys/arch/newsmips/dev/zs_hb.c:1.25	Mon Apr 28 20:23:30 2008
+++ src/sys/arch/newsmips/dev/zs_hb.c	Sat Jun 26 03:44:49 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs_hb.c,v 1.25 2008/04/28 20:23:30 martin Exp $	*/
+/*	$NetBSD: zs_hb.c,v 1.26 2010/06/26 03

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

2010-06-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 26 03:39:54 UTC 2010

Modified Files:
src/sys/arch/sparc/dev: zs.c

Log Message:
Remove an unused variable.


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/sparc/dev/zs.c

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

Modified files:

Index: src/sys/arch/sparc/dev/zs.c
diff -u src/sys/arch/sparc/dev/zs.c:1.119 src/sys/arch/sparc/dev/zs.c:1.120
--- src/sys/arch/sparc/dev/zs.c:1.119	Sat Jun 26 01:42:57 2010
+++ src/sys/arch/sparc/dev/zs.c	Sat Jun 26 03:39:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs.c,v 1.119 2010/06/26 01:42:57 tsutsui Exp $	*/
+/*	$NetBSD: zs.c,v 1.120 2010/06/26 03:39:53 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.119 2010/06/26 01:42:57 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.120 2010/06/26 03:39:53 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -608,8 +608,6 @@
 	return (UNCONF);
 }
 
-static volatile int zssoftpending;
-
 /*
  * Our ZS chips all share a common interrupt level,
  * but we establish zshard handler per each ZS chips



CVS commit: src/sys/fs/tmpfs

2010-06-25 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sat Jun 26 03:38:14 UTC 2010

Modified Files:
src/sys/fs/tmpfs: tmpfs_vfsops.c

Log Message:
tmpfs_statvfs: hold accounting lock, since tmpfs_pages_avail() and
tmpfs_bytes_max() may fluctuate while in calculations.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/fs/tmpfs/tmpfs_vfsops.c

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

Modified files:

Index: src/sys/fs/tmpfs/tmpfs_vfsops.c
diff -u src/sys/fs/tmpfs/tmpfs_vfsops.c:1.45 src/sys/fs/tmpfs/tmpfs_vfsops.c:1.46
--- src/sys/fs/tmpfs/tmpfs_vfsops.c:1.45	Tue Jun 22 18:32:08 2010
+++ src/sys/fs/tmpfs/tmpfs_vfsops.c	Sat Jun 26 03:38:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_vfsops.c,v 1.45 2010/06/22 18:32:08 rmind Exp $	*/
+/*	$NetBSD: tmpfs_vfsops.c,v 1.46 2010/06/26 03:38:14 rmind Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.45 2010/06/22 18:32:08 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.46 2010/06/26 03:38:14 rmind Exp $");
 
 #include 
 #include 
@@ -325,23 +325,27 @@
 static int
 tmpfs_statvfs(struct mount *mp, struct statvfs *sbp)
 {
-	fsfilcnt_t freenodes;
 	struct tmpfs_mount *tmp;
+	fsfilcnt_t freenodes;
+	size_t avail;
 
 	tmp = VFS_TO_TMPFS(mp);
 
 	sbp->f_iosize = sbp->f_frsize = sbp->f_bsize = PAGE_SIZE;
 
+	mutex_enter(&tmp->tm_acc_lock);
+	avail =  tmpfs_pages_avail(tmp);
 	sbp->f_blocks = (tmpfs_bytes_max(tmp) >> PAGE_SHIFT);
-	sbp->f_bavail = sbp->f_bfree = tmpfs_pages_avail(tmp);
+	sbp->f_bavail = sbp->f_bfree = avail;
 	sbp->f_bresvd = 0;
 
 	freenodes = MIN(tmp->tm_nodes_max - tmp->tm_nodes_cnt,
-	tmpfs_pages_avail(tmp) * PAGE_SIZE / sizeof(struct tmpfs_node));
+	avail * PAGE_SIZE / sizeof(struct tmpfs_node));
 
 	sbp->f_files = tmp->tm_nodes_cnt + freenodes;
 	sbp->f_favail = sbp->f_ffree = freenodes;
 	sbp->f_fresvd = 0;
+	mutex_exit(&tmp->tm_acc_lock);
 
 	copy_statvfs_info(sbp, mp);
 



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

2010-06-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 26 01:48:57 UTC 2010

Modified Files:
src/sys/arch/sun3/dev: zs.c

Log Message:
Pull a similar fix from sparc/dev/zs.c rev 1.119:
 Establish interrupt handlers with proper softc per each zs device
 rather than sharing them among all zs devices and searching softc
 in handlers, to avoid possible recursive lock.


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/sun3/dev/zs.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/sun3/dev/zs.c
diff -u src/sys/arch/sun3/dev/zs.c:1.84 src/sys/arch/sun3/dev/zs.c:1.85
--- src/sys/arch/sun3/dev/zs.c:1.84	Fri Jun 13 13:11:42 2008
+++ src/sys/arch/sun3/dev/zs.c	Sat Jun 26 01:48:57 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs.c,v 1.84 2008/06/13 13:11:42 cegger Exp $	*/
+/*	$NetBSD: zs.c,v 1.85 2010/06/26 01:48:57 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.84 2008/06/13 13:11:42 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.85 2010/06/26 01:48:57 tsutsui Exp $");
 
 #include "opt_kgdb.h"
 
@@ -260,7 +260,6 @@
 	volatile struct zschan *zc;
 	struct zs_chanstate *cs;
 	int s, zs_unit, channel;
-	static int didintr;
 
 	zsc->zsc_dev = self;
 	zs_unit = device_unit(self);
@@ -331,14 +330,9 @@
 	}
 
 	/*
-	 * Now safe to install interrupt handlers.  Note the arguments
-	 * to the interrupt handlers aren't used.  Note, we only do this
-	 * once since both SCCs interrupt at the same level and vector.
+	 * Now safe to install interrupt handlers.
 	 */
-	if (!didintr) {
-		didintr = 1;
-		isr_add_autovect(zshard, NULL, ca->ca_intpri);
-	}
+	isr_add_autovect(zshard, zsc, ca->ca_intpri);
 	zsc->zs_si = softint_establish(SOFTINT_SERIAL,
 	(void (*)(void *))zsc_intr_soft, zsc);
 	/* XXX; evcnt_attach() ? */
@@ -382,25 +376,18 @@
 
 /*
  * Our ZS chips all share a common, autovectored interrupt,
- * so we have to look at all of them on each interrupt.
+ * but we establish zshard handler per each ZS chip
+ * to avoid holding unnecessary locks in interrupt context.
  */
 static int 
 zshard(void *arg)
 {
-	struct zsc_softc *zsc;
-	int unit, rval, softreq;
+	struct zsc_softc *zsc = arg;
+	int rval;
 
-	rval = 0;
-	for (unit = 0; unit < zsc_cd.cd_ndevs; unit++) {
-		zsc = device_lookup_private(&zsc_cd, unit);
-		if (zsc == NULL)
-			continue;
-		rval |= zsc_intr_hard(zsc);
-		softreq  = zsc->zsc_cs[0]->cs_softreq;
-		softreq |= zsc->zsc_cs[1]->cs_softreq;
-		if (softreq)
-			softint_schedule(zsc->zs_si);
-	}
+	rval = zsc_intr_hard(zsc);
+	if (zsc->zsc_cs[0]->cs_softreq || zsc->zsc_cs[1]->cs_softreq)
+		softint_schedule(zsc->zs_si);
 
 	return (rval);
 }



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

2010-06-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 26 01:42:57 UTC 2010

Modified Files:
src/sys/arch/sparc/dev: zs.c

Log Message:
Establish interrupt handlers with proper softc per each zs device
rather than sharing them among all zs devices and searching softc
in handlers.

The latter method is derived from ancient sun3 zs driver which tried
to reduce overhead on autovectored interrupts, but nowadays such hack
might cause recursive global locks on modern SMP capable framework.

Fixes "5.99.30 sparc panic during startup" reported by Hauke Fath
on tech-kern@:
http://mail-index.NetBSD.org/tech-kern/2010/06/19/msg008374.html
and also tested by Jochen Kunz on SS20 with both serial and kbd console.

Ok'ed by mrg@ and dyo...@.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/arch/sparc/dev/zs.c

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

Modified files:

Index: src/sys/arch/sparc/dev/zs.c
diff -u src/sys/arch/sparc/dev/zs.c:1.118 src/sys/arch/sparc/dev/zs.c:1.119
--- src/sys/arch/sparc/dev/zs.c:1.118	Fri Jun  4 06:04:15 2010
+++ src/sys/arch/sparc/dev/zs.c	Sat Jun 26 01:42:57 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs.c,v 1.118 2010/06/04 06:04:15 macallan Exp $	*/
+/*	$NetBSD: zs.c,v 1.119 2010/06/26 01:42:57 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.118 2010/06/04 06:04:15 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.119 2010/06/26 01:42:57 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -171,12 +171,8 @@
 
 extern struct cfdriver zs_cd;
 
-/* softintr(9) cookie, shared by all instances of this driver */
-static void *zs_sicookie;
-
 /* Interrupt handlers. */
 static int zshard(void *);
-static void zssoft(void *);
 
 static int zs_get_speed(struct zs_chanstate *);
 
@@ -396,7 +392,6 @@
 	struct zsc_attach_args zsc_args;
 	struct zs_chanstate *cs;
 	int channel;
-	static int didintr, prevpri;
 #if (NKBD > 0) || (NMS > 0)
 	int ch0_is_cons = 0;
 #endif
@@ -407,12 +402,11 @@
 		return;
 	}
 
-	if (!didintr) {
-		zs_sicookie = softint_establish(SOFTINT_SERIAL, zssoft, NULL);
-		if (zs_sicookie == NULL) {
-			aprint_error(": cannot establish soft int handler\n");
-			return;
-		}
+	zsc->zsc_sicookie = softint_establish(SOFTINT_SERIAL,
+	(void (*)(void *))zsc_intr_soft, zsc);
+	if (zsc->zsc_sicookie == NULL) {
+		aprint_error(": cannot establish soft int handler\n");
+		return;
 	}
 	aprint_normal(" softpri %d\n", IPL_SOFTSERIAL);
 
@@ -566,17 +560,9 @@
 	}
 
 	/*
-	 * Now safe to install interrupt handlers.  Note the arguments
-	 * to the interrupt handlers aren't used.  Note, we only do this
-	 * once since both SCCs interrupt at the same level and vector.
+	 * Now safe to install interrupt handlers.
 	 */
-	if (!didintr) {
-		didintr = 1;
-		prevpri = pri;
-		bus_intr_establish(zsc->zsc_bustag, pri, IPL_SERIAL,
-   zshard, NULL);
-	} else if (pri != prevpri)
-		panic("broken zs interrupt scheme");
+	bus_intr_establish(zsc->zsc_bustag, pri, IPL_SERIAL, zshard, zsc);
 
 	evcnt_attach_dynamic(&zsc->zsc_intrcnt, EVCNT_TYPE_INTR, NULL,
 	device_xname(zsc->zsc_dev), "intr");
@@ -625,81 +611,29 @@
 static volatile int zssoftpending;
 
 /*
- * Our ZS chips all share a common, autovectored interrupt,
- * so we have to look at all of them on each interrupt.
+ * Our ZS chips all share a common interrupt level,
+ * but we establish zshard handler per each ZS chips
+ * to avoid holding unnecessary locks in interrupt context.
  */
 static int
 zshard(void *arg)
 {
-	struct zsc_softc *zsc;
-	int unit, rr3, rval, softreq;
+	struct zsc_softc *zsc = arg;
+	int rr3, rval;
 
-	rval = softreq = 0;
-	for (unit = 0; unit < zs_cd.cd_ndevs; unit++) {
-		struct zs_chanstate *cs;
-
-		zsc = device_lookup_private(&zs_cd, unit);
-		if (zsc == NULL)
-			continue;
-		rr3 = zsc_intr_hard(zsc);
-		/* Count up the interrupts. */
-		if (rr3) {
-			rval |= rr3;
-			zsc->zsc_intrcnt.ev_count++;
-		}
-		if ((cs = zsc->zsc_cs[0]) != NULL)
-			softreq |= cs->cs_softreq;
-		if ((cs = zsc->zsc_cs[1]) != NULL)
-			softreq |= cs->cs_softreq;
-	}
-
-	/* We are at splzs here, so no need to lock. */
-	if (softreq && (zssoftpending == 0)) {
-		zssoftpending = 1;
-		softint_schedule(zs_sicookie);
+	rval = 0;
+	rr3 = zsc_intr_hard(zsc);
+	/* Count up the interrupts. */
+	if (rr3) {
+		rval = rr3;
+		zsc->zsc_intrcnt.ev_count++;
 	}
+	if (zsc->zsc_cs[0]->cs_softreq || zsc->zsc_cs[1]->cs_softreq)
+		softint_schedule(zsc->zsc_sicookie);
 	return (rval);
 }
 
 /*
- * Similar scheme as for zshard (look at all of them)
- */
-static void
-zssoft(void *arg)
-{
-	struct zsc_softc *zsc;
-	int unit;
-
-	/* This is not the only ISR on this IPL. */
-	if (zssoftpending == 0)
-		return;
-
-	/*
-	 * The soft intr. bit will be set by zshard only if
-	 * the variable zssoftpending is zero.  The order of
-	 * these next 

CVS commit: src/sys/arch/hpcarm

2010-06-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 26 00:25:02 UTC 2010

Modified Files:
src/sys/arch/hpcarm/conf: JORNADA720 JORNADA820 WZERO3
src/sys/arch/hpcarm/hpcarm: pxa2x0_hpc_machdep.c sa11x0_hpc_machdep.c

Log Message:
If options RTC_OFFSET is not specified use bootinfo->timezone passed
by hpcboot.exe as well as other hpc* ports.  Noticed by u...@.
Also comment out options RTC_OFFSET=0 lines and note about this
in kernel config files.  Tested on WS003SH.

XXX: dup code among pxa2x0_hpc_machdep.c and sa11x0_hpc_machdep.c


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/hpcarm/conf/JORNADA720
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hpcarm/conf/JORNADA820
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/hpcarm/conf/WZERO3
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_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/hpcarm/conf/JORNADA720
diff -u src/sys/arch/hpcarm/conf/JORNADA720:1.78 src/sys/arch/hpcarm/conf/JORNADA720:1.79
--- src/sys/arch/hpcarm/conf/JORNADA720:1.78	Sat May 22 19:02:08 2010
+++ src/sys/arch/hpcarm/conf/JORNADA720	Sat Jun 26 00:25:02 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: JORNADA720,v 1.78 2010/05/22 19:02:08 plunky Exp $
+#	$NetBSD: JORNADA720,v 1.79 2010/06/26 00:25:02 tsutsui Exp $
 #
 #	JORNADA -- Windows-CE based jornada 720
 #
@@ -7,14 +7,15 @@
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.78 $"
+#ident 		"GENERIC-$Revision: 1.79 $"
 
 # estimated number of users
 maxusers	32
 
 # Standard system options
 
-options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
+#options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
+# (default timezone is passed from hpcboot)
 #options 	NTP		# NTP phase/frequency locked loop
 
 # CPU options

Index: src/sys/arch/hpcarm/conf/JORNADA820
diff -u src/sys/arch/hpcarm/conf/JORNADA820:1.18 src/sys/arch/hpcarm/conf/JORNADA820:1.19
--- src/sys/arch/hpcarm/conf/JORNADA820:1.18	Sat Apr 17 13:36:21 2010
+++ src/sys/arch/hpcarm/conf/JORNADA820	Sat Jun 26 00:25:02 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: JORNADA820,v 1.18 2010/04/17 13:36:21 nonaka Exp $
+#	$NetBSD: JORNADA820,v 1.19 2010/06/26 00:25:02 tsutsui Exp $
 #
 #	JORNADA -- Windows-CE based jornada 820
 #
@@ -7,14 +7,15 @@
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.18 $"
+#ident 		"GENERIC-$Revision: 1.19 $"
 
 # estimated number of users
 maxusers	32
 
 # Standard system options
 
-options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
+#options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
+# (default timezone is passed from hpcboot)
 #options 	NTP		# NTP phase/frequency locked loop
 
 # CPU options

Index: src/sys/arch/hpcarm/conf/WZERO3
diff -u src/sys/arch/hpcarm/conf/WZERO3:1.8 src/sys/arch/hpcarm/conf/WZERO3:1.9
--- src/sys/arch/hpcarm/conf/WZERO3:1.8	Fri Jun 25 17:53:28 2010
+++ src/sys/arch/hpcarm/conf/WZERO3	Sat Jun 26 00:25:02 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: WZERO3,v 1.8 2010/06/25 17:53:28 tsutsui Exp $
+#	$NetBSD: WZERO3,v 1.9 2010/06/26 00:25:02 tsutsui Exp $
 #
 #	WZERO3 -- Sharp Windows Mobile 5 based PDA
 #
@@ -7,14 +7,15 @@
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.8 $"
+#ident 		"GENERIC-$Revision: 1.9 $"
 
 # estimated number of users
 maxusers	32
 
 # Standard system options
 
-options 	RTC_OFFSET=-540	# hardware clock is this many mins. west of GMT
+#options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
+# (default timezone is passed from hpcboot)
 #options 	NTP		# NTP phase/frequency locked loop
 
 # CPU options

Index: src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c
diff -u src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c:1.7 src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c:1.8
--- src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c:1.7	Thu May 13 21:01:59 2010
+++ src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c	Sat Jun 26 00:25:02 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_hpc_machdep.c,v 1.7 2010/05/13 21:01:59 nonaka Exp $	*/
+/*	$NetBSD: pxa2x0_hpc_machdep.c,v 1.8 2010/06/26 00:25:02 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_hpc_machdep.c,v 1.7 2010/05/13 21:01:59 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_hpc_machdep.c,v 1.8 2010/06/26 00:25:02 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_dram_pages.h"
@@ -418,6 +418,16 @@
 		platid.dw.dw1 = bootinfo->platid_machine;
 	}
 
+#ifndef RTC_OFFSET
+	/*
+	 * rtc_offset from bootinfo.timezone set by hpcboot.exe
+	 */
+	if (rtc_offset == 0 &&
+	(bootinfo->timezone > (-12 * 60) &&
+	 bootinfo->timezone <= (12 

CVS commit: src/external/bsd/pkg_install/dist/lib

2010-06-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Jun 26 00:17:13 UTC 2010

Modified Files:
src/external/bsd/pkg_install/dist/lib: lib.h version.h

Log Message:
Merge for pkg_install-20100616


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/pkg_install/dist/lib/lib.h \
src/external/bsd/pkg_install/dist/lib/version.h

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

Modified files:

Index: src/external/bsd/pkg_install/dist/lib/lib.h
diff -u src/external/bsd/pkg_install/dist/lib/lib.h:1.5 src/external/bsd/pkg_install/dist/lib/lib.h:1.6
--- src/external/bsd/pkg_install/dist/lib/lib.h:1.5	Fri Apr 23 20:55:31 2010
+++ src/external/bsd/pkg_install/dist/lib/lib.h	Sat Jun 26 00:17:13 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: lib.h,v 1.5 2010/04/23 20:55:31 joerg Exp $ */
+/* $NetBSD: lib.h,v 1.6 2010/06/26 00:17:13 joerg Exp $ */
 
 /* from FreeBSD Id: lib.h,v 1.25 1997/10/08 07:48:03 charnier Exp */
 
@@ -380,7 +380,7 @@
 struct pkg_vulnerabilities *read_pkg_vulnerabilities_memory(void *, size_t, int);
 void free_pkg_vulnerabilities(struct pkg_vulnerabilities *);
 int audit_package(struct pkg_vulnerabilities *, const char *, const char *,
-int, int);
+int);
 
 /* Parse configuration file */
 void pkg_install_config(void);
@@ -430,6 +430,7 @@
 extern const char *cert_chain_file;
 extern const char *certs_packages;
 extern const char *certs_pkg_vulnerabilities;
+extern const char *check_eol;
 extern const char *check_vulnerabilities;
 extern const char *config_file;
 extern const char *config_pkg_dbdir;
Index: src/external/bsd/pkg_install/dist/lib/version.h
diff -u src/external/bsd/pkg_install/dist/lib/version.h:1.5 src/external/bsd/pkg_install/dist/lib/version.h:1.6
--- src/external/bsd/pkg_install/dist/lib/version.h:1.5	Fri Apr 23 20:55:31 2010
+++ src/external/bsd/pkg_install/dist/lib/version.h	Sat Jun 26 00:17:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: version.h,v 1.5 2010/04/23 20:55:31 joerg Exp $	*/
+/*	$NetBSD: version.h,v 1.6 2010/06/26 00:17:13 joerg Exp $	*/
 
 /*
  * Copyright (c) 2001 Thomas Klausner.  All rights reserved.
@@ -27,6 +27,6 @@
 #ifndef _INST_LIB_VERSION_H_
 #define _INST_LIB_VERSION_H_
 
-#define PKGTOOLS_VERSION 20100421
+#define PKGTOOLS_VERSION 20100616
 
 #endif /* _INST_LIB_VERSION_H_ */



CVS commit: src/external/bsd/pkg_install/dist

2010-06-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Jun 26 00:14:35 UTC 2010

Update of /cvsroot/src/external/bsd/pkg_install/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv28981

Log Message:
pkg_install-20100616:
- Recognize -C for pkg_add like the rest of the tools do
- Do the existing check for pkg_add -f, it makes the combination of
  -f and -U a bit less surprising
- Fix option handling for CHECK_VULNERABILITIES (from spz@)
- Make end-of-life check the default. pkg_install.conf(5) can be used
  to override the default. The existing admin -e & co continue to work as
  before.

Status:

Vendor Tag: PKGSRC
Release Tags:   pkg_install-20100616

U src/external/bsd/pkg_install/dist/add/add.h
U src/external/bsd/pkg_install/dist/add/main.c
U src/external/bsd/pkg_install/dist/add/perform.c
U src/external/bsd/pkg_install/dist/add/pkg_add.1
U src/external/bsd/pkg_install/dist/admin/admin.h
U src/external/bsd/pkg_install/dist/admin/audit-packages.8
U src/external/bsd/pkg_install/dist/admin/audit-packages.sh.in
U src/external/bsd/pkg_install/dist/admin/audit.c
U src/external/bsd/pkg_install/dist/admin/check.c
U src/external/bsd/pkg_install/dist/admin/download-vulnerability-list.8
U src/external/bsd/pkg_install/dist/admin/download-vulnerability-list.sh.in
U src/external/bsd/pkg_install/dist/admin/main.c
U src/external/bsd/pkg_install/dist/admin/pkg_admin.1
U src/external/bsd/pkg_install/dist/bpm/bpm.1
U src/external/bsd/pkg_install/dist/bpm/bpm.sh.in
U src/external/bsd/pkg_install/dist/create/build.c
U src/external/bsd/pkg_install/dist/create/create.h
U src/external/bsd/pkg_install/dist/create/main.c
U src/external/bsd/pkg_install/dist/create/perform.c
U src/external/bsd/pkg_install/dist/create/pkg_create.1
U src/external/bsd/pkg_install/dist/create/pl.c
U src/external/bsd/pkg_install/dist/create/util.c
U src/external/bsd/pkg_install/dist/delete/pkg_delete.1
U src/external/bsd/pkg_install/dist/delete/pkg_delete.c
U src/external/bsd/pkg_install/dist/info/info.h
U src/external/bsd/pkg_install/dist/info/main.c
U src/external/bsd/pkg_install/dist/info/perform.c
U src/external/bsd/pkg_install/dist/info/pkg_info.1
U src/external/bsd/pkg_install/dist/info/show.c
U src/external/bsd/pkg_install/dist/lib/automatic.c
U src/external/bsd/pkg_install/dist/lib/config.h.in
U src/external/bsd/pkg_install/dist/lib/conflicts.c
U src/external/bsd/pkg_install/dist/lib/defs.h
U src/external/bsd/pkg_install/dist/lib/dewey.c
U src/external/bsd/pkg_install/dist/lib/dewey.h
U src/external/bsd/pkg_install/dist/lib/fexec.c
U src/external/bsd/pkg_install/dist/lib/file.c
U src/external/bsd/pkg_install/dist/lib/global.c
U src/external/bsd/pkg_install/dist/lib/gpgsig.c
U src/external/bsd/pkg_install/dist/lib/iterate.c
C src/external/bsd/pkg_install/dist/lib/lib.h
U src/external/bsd/pkg_install/dist/lib/license.c
U src/external/bsd/pkg_install/dist/lib/lpkg.c
U src/external/bsd/pkg_install/dist/lib/opattern.c
U src/external/bsd/pkg_install/dist/lib/parse-config.c
U src/external/bsd/pkg_install/dist/lib/pkcs7.c
U src/external/bsd/pkg_install/dist/lib/pkg_install.conf.5.in
U src/external/bsd/pkg_install/dist/lib/pkg_io.c
U src/external/bsd/pkg_install/dist/lib/pkg_signature.c
U src/external/bsd/pkg_install/dist/lib/pkg_summary.5
U src/external/bsd/pkg_install/dist/lib/pkgdb.c
U src/external/bsd/pkg_install/dist/lib/pkgsrc.7
U src/external/bsd/pkg_install/dist/lib/plist.c
U src/external/bsd/pkg_install/dist/lib/remove.c
U src/external/bsd/pkg_install/dist/lib/str.c
U src/external/bsd/pkg_install/dist/lib/var.c
U src/external/bsd/pkg_install/dist/lib/version.c
C src/external/bsd/pkg_install/dist/lib/version.h
U src/external/bsd/pkg_install/dist/lib/vulnerabilities-file.c
U src/external/bsd/pkg_install/dist/lib/xwrapper.c
U src/external/bsd/pkg_install/dist/x509/pkgsrc.cnf
U src/external/bsd/pkg_install/dist/x509/pkgsrc.sh
U src/external/bsd/pkg_install/dist/x509/signing.txt

2 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jPKGSRC:yesterday -jPKGSRC 
src/external/bsd/pkg_install/dist



CVS commit: src/sys/arch/powerpc/pic

2010-06-25 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Fri Jun 25 19:00:06 UTC 2010

Modified Files:
src/sys/arch/powerpc/pic: ipi.c

Log Message:
Add missing sys/xcall.h inclusion, remove sys/malloc.h one.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/pic/ipi.c

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

Modified files:

Index: src/sys/arch/powerpc/pic/ipi.c
diff -u src/sys/arch/powerpc/pic/ipi.c:1.5 src/sys/arch/powerpc/pic/ipi.c:1.6
--- src/sys/arch/powerpc/pic/ipi.c:1.5	Tue Jun 22 18:29:02 2010
+++ src/sys/arch/powerpc/pic/ipi.c	Fri Jun 25 19:00:05 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: ipi.c,v 1.5 2010/06/22 18:29:02 rmind Exp $ */
+/* $NetBSD: ipi.c,v 1.6 2010/06/25 19:00:05 rmind Exp $ */
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipi.c,v 1.5 2010/06/22 18:29:02 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipi.c,v 1.6 2010/06/25 19:00:05 rmind Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_pic.h"
@@ -37,8 +37,8 @@
 #include "opt_altivec.h"
 
 #include 
-#include 
 #include 
+#include 
 
 #include 
 #include 



CVS commit: src/crypto/external/bsd/netpgp/dist/src/lib

2010-06-25 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Fri Jun 25 18:30:16 UTC 2010

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/lib: misc.c

Log Message:
Fix build problems on LP64 platforms - thanks to Paul Goyette for the nudge.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/crypto/external/bsd/netpgp/dist/src/lib/misc.c

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/lib/misc.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/misc.c:1.31 src/crypto/external/bsd/netpgp/dist/src/lib/misc.c:1.32
--- src/crypto/external/bsd/netpgp/dist/src/lib/misc.c:1.31	Fri Jun 25 03:37:27 2010
+++ src/crypto/external/bsd/netpgp/dist/src/lib/misc.c	Fri Jun 25 18:30:16 2010
@@ -57,7 +57,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: misc.c,v 1.31 2010/06/25 03:37:27 agc Exp $");
+__RCSID("$NetBSD: misc.c,v 1.32 2010/06/25 18:30:16 agc Exp $");
 #endif
 
 #include 
@@ -1099,10 +1099,10 @@
 	char	line[LINELEN + 1];
 
 	(void) fprintf(fp, "%s%s", (header) ? header : "", (header) ? "\n" : "");
-	(void) fprintf(fp, "[%d chars]\n", length);
+	(void) fprintf(fp, "[%" PRIsize "u char%s]\n", length, (length == 1) ? "" : "s");
 	for (i = 0 ; i < length ; i++) {
 		if (i % LINELEN == 0) {
-			(void) fprintf(fp, "%.5d | ", i);
+			(void) fprintf(fp, "%.5" PRIsize "u | ", i);
 		}
 		(void) fprintf(fp, "%.02x ", (uint8_t)src[i]);
 		line[i % LINELEN] = (isprint(src[i])) ? src[i] : '.';



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

2010-06-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jun 25 17:53:28 UTC 2010

Modified Files:
src/sys/arch/hpcarm/conf: WZERO3

Log Message:
Add several USB Ethernet devices.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hpcarm/conf/WZERO3

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/hpcarm/conf/WZERO3
diff -u src/sys/arch/hpcarm/conf/WZERO3:1.7 src/sys/arch/hpcarm/conf/WZERO3:1.8
--- src/sys/arch/hpcarm/conf/WZERO3:1.7	Fri Jun 25 17:42:02 2010
+++ src/sys/arch/hpcarm/conf/WZERO3	Fri Jun 25 17:53:28 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: WZERO3,v 1.7 2010/06/25 17:42:02 tsutsui Exp $
+#	$NetBSD: WZERO3,v 1.8 2010/06/25 17:53:28 tsutsui Exp $
 #
 #	WZERO3 -- Sharp Windows Mobile 5 based PDA
 #
@@ -7,7 +7,7 @@
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.7 $"
+#ident 		"GENERIC-$Revision: 1.8 $"
 
 # estimated number of users
 maxusers	32
@@ -225,6 +225,25 @@
 umass* at uhub? port ? configuration ? interface ?
 wd* at umass?
 
+# USB Ethernet adapters
+aue*	at uhub? port ?		# ADMtek AN986 Pegasus based adapters
+axe*	at uhub? port ?		# ASIX AX88172 based adapters
+cdce*	at uhub? port ?		# CDC, Ethernet Networking Control Model
+cue*	at uhub? port ?		# CATC USB-EL1201A based adapters
+kue*	at uhub? port ?		# Kawasaki LSI KL5KUSB101B based adapters
+udav*	at uhub? port ?	 	# Davicom DM9601 based adapters
+url*	at uhub? port ?		# Realtek RTL8150L based adapters
+
+rlphy*	at mii? phy ?		# Realtek 8139/8201L PHYs
+ukphy*  at mii? phy ?		# generic unknown PHYs
+urlphy* at mii? phy ?		# Realtek RTL8150L internal PHYs
+
+# USB 802.11 adapters
+atu*	at uhub? port ?		# Atmel AT76C50XX based adapters
+#ral*	at uhub? port ?		# Ralink Technology RT25x0 802.11a/b/g
+rum*	at uhub? port ?		# Ralink Technology RT2501/RT2601 802.11a/b/g
+zyd*	at uhub? port ?		# Zydas ZD1211
+
 # SCSI bus support
 scsibus* at scsi?
 



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

2010-06-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jun 25 17:42:02 UTC 2010

Modified Files:
src/sys/arch/hpcarm/conf: WZERO3

Log Message:
Enable options DDB, which is enabled in other kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hpcarm/conf/WZERO3

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/hpcarm/conf/WZERO3
diff -u src/sys/arch/hpcarm/conf/WZERO3:1.6 src/sys/arch/hpcarm/conf/WZERO3:1.7
--- src/sys/arch/hpcarm/conf/WZERO3:1.6	Fri Jun 25 17:40:32 2010
+++ src/sys/arch/hpcarm/conf/WZERO3	Fri Jun 25 17:42:02 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: WZERO3,v 1.6 2010/06/25 17:40:32 tsutsui Exp $
+#	$NetBSD: WZERO3,v 1.7 2010/06/25 17:42:02 tsutsui Exp $
 #
 #	WZERO3 -- Sharp Windows Mobile 5 based PDA
 #
@@ -7,7 +7,7 @@
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.6 $"
+#ident 		"GENERIC-$Revision: 1.7 $"
 
 # estimated number of users
 maxusers	32
@@ -138,7 +138,7 @@
 options 	DIAGNOSTIC	# internal consistency checks
 #options 	DEBUG		# expensive debugging checks/support
 #options 	PMAP_DEBUG	# Enable pmap_debug_level code
-#options 	DDB		# in-kernel debugger
+options 	DDB		# in-kernel debugger
 #options 	DDB_HISTORY_SIZE=512	# Enable history editing in DDB
 #makeoptions	DEBUG="-g"	# compile full symbol table
 



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

2010-06-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jun 25 17:40:33 UTC 2010

Modified Files:
src/sys/arch/hpcarm/conf: WZERO3

Log Message:
Set options RTC_OFFSET=-540 since Windows Mobile stores localtime
into the RTC and we can assume most W-ZERO3 users live in JST timezone.

XXX: Probably it would be better to allow a kernel getting RTC_OFFSET value
XXX: via bootinfo set by boot(8) or boot.cfg(5).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hpcarm/conf/WZERO3

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/hpcarm/conf/WZERO3
diff -u src/sys/arch/hpcarm/conf/WZERO3:1.5 src/sys/arch/hpcarm/conf/WZERO3:1.6
--- src/sys/arch/hpcarm/conf/WZERO3:1.5	Sun May 30 10:00:27 2010
+++ src/sys/arch/hpcarm/conf/WZERO3	Fri Jun 25 17:40:32 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: WZERO3,v 1.5 2010/05/30 10:00:27 nonaka Exp $
+#	$NetBSD: WZERO3,v 1.6 2010/06/25 17:40:32 tsutsui Exp $
 #
 #	WZERO3 -- Sharp Windows Mobile 5 based PDA
 #
@@ -7,14 +7,14 @@
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.5 $"
+#ident 		"GENERIC-$Revision: 1.6 $"
 
 # estimated number of users
 maxusers	32
 
 # Standard system options
 
-options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
+options 	RTC_OFFSET=-540	# hardware clock is this many mins. west of GMT
 #options 	NTP		# NTP phase/frequency locked loop
 
 # CPU options



CVS commit: src/gnu/lib/libstdc++-v3_4

2010-06-25 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Jun 25 16:54:25 UTC 2010

Modified Files:
src/gnu/lib/libstdc++-v3_4: Makefile

Log Message:
Explicitly link libstdc++ against libm as found by Arnaud Lacombe.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/gnu/lib/libstdc++-v3_4/Makefile

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

Modified files:

Index: src/gnu/lib/libstdc++-v3_4/Makefile
diff -u src/gnu/lib/libstdc++-v3_4/Makefile:1.4 src/gnu/lib/libstdc++-v3_4/Makefile:1.5
--- src/gnu/lib/libstdc++-v3_4/Makefile:1.4	Sun Jan 11 03:09:35 2009
+++ src/gnu/lib/libstdc++-v3_4/Makefile	Fri Jun 25 16:54:25 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2009/01/11 03:09:35 christos Exp $
+#	$NetBSD: Makefile,v 1.5 2010/06/25 16:54:25 joerg Exp $
 
 REQUIRETOOLS=	yes
 NOLINT=		# defined
@@ -6,6 +6,9 @@
 .include 
 
 LIB=		stdc++
+LDADD=		-lgcc_s
+
+LIBDPLIBS+=	m ${.CURDIR}/../../../lib/libm
 
 .if exists(${.CURDIR}/arch/${MACHINE_ARCH}/defs.mk) && ${MKGCC} != "no"
 .include "${.CURDIR}/arch/${MACHINE_ARCH}/defs.mk"



CVS commit: src/sys/arch/i386/stand/lib

2010-06-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jun 25 15:35:08 UTC 2010

Modified Files:
src/sys/arch/i386/stand/lib: biosdisk.c exec.c libi386.h pcio.c vbe.c

Log Message:
Add wait_sec() which uses BIOS function call INT 1Ah/AH=00h (GET SYSTEMTIME)
and use it for large delays (in seconds) instead of delay() that uses
INT 15h/AH=86h (WAIT) in microsecond because the latter one can't provide
precise delays on emulators.
Fixes PR port-i386/43156 (NetBSD bootloader countdown runs at 1/20 speed
in qemu 0.12).

No particular comments on the PR and port-i...@.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/i386/stand/lib/biosdisk.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/i386/stand/lib/exec.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/i386/stand/lib/libi386.h
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/i386/stand/lib/pcio.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/stand/lib/vbe.c

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

Modified files:

Index: src/sys/arch/i386/stand/lib/biosdisk.c
diff -u src/sys/arch/i386/stand/lib/biosdisk.c:1.30 src/sys/arch/i386/stand/lib/biosdisk.c:1.31
--- src/sys/arch/i386/stand/lib/biosdisk.c:1.30	Tue Oct 20 14:49:03 2009
+++ src/sys/arch/i386/stand/lib/biosdisk.c	Fri Jun 25 15:35:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: biosdisk.c,v 1.30 2009/10/20 14:49:03 jmcneill Exp $	*/
+/*	$NetBSD: biosdisk.c,v 1.31 2010/06/25 15:35:08 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998
@@ -509,7 +509,7 @@
 
 	/* let the floppy drive go off */
 	if (d->ll.type == BIOSDISK_TYPE_FD)
-		delay(300);	/* 2s is enough on all PCs I found */
+		wait_sec(3);	/* 2s is enough on all PCs I found */
 
 	dealloc(d, sizeof(struct biosdisk));
 	f->f_devdata = NULL;

Index: src/sys/arch/i386/stand/lib/exec.c
diff -u src/sys/arch/i386/stand/lib/exec.c:1.42 src/sys/arch/i386/stand/lib/exec.c:1.43
--- src/sys/arch/i386/stand/lib/exec.c:1.42	Mon Sep 14 11:56:27 2009
+++ src/sys/arch/i386/stand/lib/exec.c	Fri Jun 25 15:35:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec.c,v 1.42 2009/09/14 11:56:27 jmcneill Exp $	 */
+/*	$NetBSD: exec.c,v 1.43 2010/06/25 15:35:08 tsutsui Exp $	 */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -125,7 +125,7 @@
 #define	PAGE_SIZE	4096
 #endif
 
-#define MODULE_WARNING_DELAY	500
+#define MODULE_WARNING_SEC	5
 
 extern struct btinfo_console btinfo_console;
 
@@ -486,7 +486,7 @@
 	btinfo_modulelist = alloc(len);
 	if (btinfo_modulelist == NULL) {
 		printf("WARNING: couldn't allocate module list\n");
-		delay(MODULE_WARNING_DELAY);
+		wait_sec(MODULE_WARNING_SEC);
 		return;
 	}
 	memset(btinfo_modulelist, 0, len);
@@ -530,7 +530,7 @@
 		printf("WARNING: %d module%s failed to load\n",
 		nfail, nfail == 1 ? "" : "s");
 #if notyet
-		delay(MODULE_WARNING_DELAY);
+		wait_sec(MODULE_WARNING_SEC);
 #endif
 	}
 }

Index: src/sys/arch/i386/stand/lib/libi386.h
diff -u src/sys/arch/i386/stand/lib/libi386.h:1.32 src/sys/arch/i386/stand/lib/libi386.h:1.33
--- src/sys/arch/i386/stand/lib/libi386.h:1.32	Sun Sep 13 22:45:27 2009
+++ src/sys/arch/i386/stand/lib/libi386.h	Fri Jun 25 15:35:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: libi386.h,v 1.32 2009/09/13 22:45:27 jmcneill Exp $	*/
+/*	$NetBSD: libi386.h,v 1.33 2010/06/25 15:35:08 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1996
@@ -69,6 +69,7 @@
 #define CONSDEV_AUTO (-1)
 int iskey(int);
 char awaitkey(int, int);
+void wait_sec(int);
 
 /* this is in "user code"! */
 int parsebootfile(const char *, char **, char **, int *, int *, const char **);

Index: src/sys/arch/i386/stand/lib/pcio.c
diff -u src/sys/arch/i386/stand/lib/pcio.c:1.27 src/sys/arch/i386/stand/lib/pcio.c:1.28
--- src/sys/arch/i386/stand/lib/pcio.c:1.27	Wed Aug 26 13:28:48 2009
+++ src/sys/arch/i386/stand/lib/pcio.c	Fri Jun 25 15:35:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcio.c,v 1.27 2009/08/26 13:28:48 jmcneill Exp $	 */
+/*	$NetBSD: pcio.c,v 1.28 2010/06/25 15:35:08 tsutsui Exp $	 */
 
 /*
  * Copyright (c) 1996, 1997
@@ -371,3 +371,10 @@
 
 	return c;
 }
+
+void
+wait_sec(int sec)
+{
+
+	wait(sec * 100);
+}

Index: src/sys/arch/i386/stand/lib/vbe.c
diff -u src/sys/arch/i386/stand/lib/vbe.c:1.5 src/sys/arch/i386/stand/lib/vbe.c:1.6
--- src/sys/arch/i386/stand/lib/vbe.c:1.5	Tue Oct 20 14:47:33 2009
+++ src/sys/arch/i386/stand/lib/vbe.c	Fri Jun 25 15:35:08 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: vbe.c,v 1.5 2009/10/20 14:47:33 jmcneill Exp $ */
+/* $NetBSD: vbe.c,v 1.6 2010/06/25 15:35:08 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2009 Jared D. McNeill 
@@ -172,7 +172,7 @@
 		if (ret) {
 			printf("WARNING: failed to set VBE mode 0x%x\n",
 			vbestate.modenum);
-			delay(500);
+			wait_sec(5);
 		}
 	}
 	return ret;



CVS commit: src

2010-06-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jun 25 15:16:14 UTC 2010

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

Log Message:
Add config_mountroot(9) in autoconf(9) man page and LINKS for it.


To generate a diff of this commit:
cvs rdiff -u -r1.1472 -r1.1473 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.333 -r1.334 src/share/man/man9/Makefile
cvs rdiff -u -r1.26 -r1.27 src/share/man/man9/autoconf.9

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1472 src/distrib/sets/lists/comp/mi:1.1473
--- src/distrib/sets/lists/comp/mi:1.1472	Mon Jun 21 21:46:58 2010
+++ src/distrib/sets/lists/comp/mi	Fri Jun 25 15:16:13 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1472 2010/06/21 21:46:58 pooka Exp $
+#	$NetBSD: mi,v 1.1473 2010/06/25 15:16:13 tsutsui Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -8902,6 +8902,7 @@
 ./usr/share/man/cat9/config_found_sm_loc.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/config_interrupts.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/config_match.0		comp-sys-catman		.cat
+./usr/share/man/cat9/config_mountroot.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/config_pending_decr.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/config_pending_incr.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/config_search.0		comp-obsolete		obsolete
@@ -14671,6 +14672,7 @@
 ./usr/share/man/html9/config_found_sm_loc.html	comp-sys-htmlman	html
 ./usr/share/man/html9/config_interrupts.html	comp-sys-htmlman	html
 ./usr/share/man/html9/config_match.html		comp-sys-htmlman	html
+./usr/share/man/html9/config_mountroot.html	comp-sys-htmlman	html
 ./usr/share/man/html9/config_pending_decr.html	comp-sys-htmlman	html
 ./usr/share/man/html9/config_pending_incr.html	comp-sys-htmlman	html
 ./usr/share/man/html9/config_search_ia.html	comp-sys-htmlman	html
@@ -20559,6 +20561,7 @@
 ./usr/share/man/man9/config_found_sm_loc.9	comp-sys-man		.man
 ./usr/share/man/man9/config_interrupts.9	comp-sys-man		.man
 ./usr/share/man/man9/config_match.9		comp-sys-man		.man
+./usr/share/man/man9/config_mountroot.9		comp-sys-man		.man
 ./usr/share/man/man9/config_pending_decr.9	comp-sys-man		.man
 ./usr/share/man/man9/config_pending_incr.9	comp-sys-man		.man
 ./usr/share/man/man9/config_search.9		comp-obsolete		obsolete

Index: src/share/man/man9/Makefile
diff -u src/share/man/man9/Makefile:1.333 src/share/man/man9/Makefile:1.334
--- src/share/man/man9/Makefile:1.333	Fri Jun 18 16:29:01 2010
+++ src/share/man/man9/Makefile	Fri Jun 25 15:16:14 2010
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.333 2010/06/18 16:29:01 hannken Exp $
+#   $NetBSD: Makefile,v 1.334 2010/06/25 15:16:14 tsutsui Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -101,6 +101,7 @@
 	autoconf.9 config_deactivate.9 \
 	autoconf.9 config_defer.9 \
 	autoconf.9 config_interrupts.9 \
+	autoconf.9 config_mountroot.9 \
 	autoconf.9 config_pending_incr.9 \
 	autoconf.9 config_pending_decr.9 \
 	autoconf.9 config_finalize_register.9

Index: src/share/man/man9/autoconf.9
diff -u src/share/man/man9/autoconf.9:1.26 src/share/man/man9/autoconf.9:1.27
--- src/share/man/man9/autoconf.9:1.26	Mon Dec  7 23:50:39 2009
+++ src/share/man/man9/autoconf.9	Fri Jun 25 15:16:14 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: autoconf.9,v 1.26 2009/12/07 23:50:39 dyoung Exp $
+.\" $NetBSD: autoconf.9,v 1.27 2010/06/25 15:16:14 tsutsui Exp $
 .\"
 .\" Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 7, 2009
+.Dd June 26, 2010
 .Dt AUTOCONF 9
 .Os
 .Sh NAME
@@ -45,6 +45,7 @@
 .Nm config_deactivate ,
 .Nm config_defer ,
 .Nm config_interrupts ,
+.Nm config_mountroot ,
 .Nm config_pending_incr ,
 .Nm config_pending_decr ,
 .Nm config_finalize_register
@@ -86,6 +87,8 @@
 .Ft void
 .Fn config_interrupts "device_t dev" "void (*func)(device_t)"
 .Ft void
+.Fn config_mountroot "device_t dev" "void (*func)(device_t)"
+.Ft void
 .Fn config_pending_incr
 .Ft void
 .Fn config_pending_decr
@@ -369,6 +372,15 @@
 .Fa func
 is called with the argument
 .Fa dev .
+.It Fn config_mountroot "dev" "func"
+Called by the child to defer the remainder of its configuration until
+the root file system is mounted.
+At this point, the function
+.Fa func
+is called with the argument
+.Fa dev .
+This is used for devices that need to load firmware image from
+a mounted file system.
 .It Fn config_pending_incr
 Increment the
 .Va config_pending



CVS commit: src/sys

2010-06-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jun 25 15:10:43 UTC 2010

Modified Files:
src/sys/kern: init_main.c subr_autoconf.c
src/sys/sys: device.h

Log Message:
Add config_mountroot(9), which defers device configuration
after mountroot(), like config_interrupt(9) that defers
configuration after interrupts are enabled.
This will be used for devices that require firmware loaded
from the root file system by firmload(9) to complete device
initialization (getting MAC address etc).

No objection on tech-kern@:
http://mail-index.NetBSD.org/tech-kern/2010/06/18/msg008370.html
and will also fix PR kern/43125.


To generate a diff of this commit:
cvs rdiff -u -r1.420 -r1.421 src/sys/kern/init_main.c
cvs rdiff -u -r1.206 -r1.207 src/sys/kern/subr_autoconf.c
cvs rdiff -u -r1.136 -r1.137 src/sys/sys/device.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/kern/init_main.c
diff -u src/sys/kern/init_main.c:1.420 src/sys/kern/init_main.c:1.421
--- src/sys/kern/init_main.c:1.420	Thu Jun 10 20:54:53 2010
+++ src/sys/kern/init_main.c	Fri Jun 25 15:10:42 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.420 2010/06/10 20:54:53 pooka Exp $	*/
+/*	$NetBSD: init_main.c,v 1.421 2010/06/25 15:10:42 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.420 2010/06/10 20:54:53 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.421 2010/06/25 15:10:42 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ipsec.h"
@@ -266,6 +266,7 @@
 static void start_init(void *);
 static void configure(void);
 static void configure2(void);
+static void configure3(void);
 void main(void);
 
 /*
@@ -626,6 +627,8 @@
 	} while (error != 0);
 	mountroothook_destroy();
 
+	configure3();
+
 	/*
 	 * Initialise the time-of-day clock, passing the time recorded
 	 * in the root filesystem (if any) for use by systems that
@@ -783,6 +786,20 @@
 }
 
 static void
+configure3(void)
+{
+
+	/*
+	 * Create threads to call back and finish configuration for
+	 * devices that want the mounted root file system.
+	 */
+	config_create_mountrootthreads();
+
+	/* Get the threads going and into any sleeps before continuing. */
+	yield();
+}
+
+static void
 check_console(struct lwp *l)
 {
 	struct vnode *vp;

Index: src/sys/kern/subr_autoconf.c
diff -u src/sys/kern/subr_autoconf.c:1.206 src/sys/kern/subr_autoconf.c:1.207
--- src/sys/kern/subr_autoconf.c:1.206	Fri Apr 30 21:17:22 2010
+++ src/sys/kern/subr_autoconf.c	Fri Jun 25 15:10:42 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.206 2010/04/30 21:17:22 dyoung Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.207 2010/06/25 15:10:42 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.206 2010/04/30 21:17:22 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.207 2010/06/25 15:10:42 tsutsui Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -200,6 +200,9 @@
 struct deferred_config_head interrupt_config_queue =
 	TAILQ_HEAD_INITIALIZER(interrupt_config_queue);
 int interrupt_config_threads = 8;
+struct deferred_config_head mountroot_config_queue =
+	TAILQ_HEAD_INITIALIZER(mountroot_config_queue);
+int mountroot_config_threads = 2;
 
 static void config_process_deferred(struct deferred_config_head *, device_t);
 
@@ -427,6 +430,7 @@
 {
 	config_process_deferred(&deferred_config_queue, dev);
 	config_process_deferred(&interrupt_config_queue, dev);
+	config_process_deferred(&mountroot_config_queue, dev);
 }
 
 static void
@@ -454,6 +458,30 @@
 	}
 }
 
+static void
+config_mountroot_thread(void *cookie)
+{
+	struct deferred_config *dc;
+
+	while ((dc = TAILQ_FIRST(&mountroot_config_queue)) != NULL) {
+		TAILQ_REMOVE(&mountroot_config_queue, dc, dc_queue);
+		(*dc->dc_func)(dc->dc_dev);
+		kmem_free(dc, sizeof(*dc));
+	}
+	kthread_exit(0);
+}
+
+void
+config_create_mountrootthreads()
+{
+	int i;
+
+	for (i = 0; i < mountroot_config_threads; i++) {
+		(void)kthread_create(PRI_NONE, 0, NULL,
+		config_mountroot_thread, NULL, NULL, "config");
+	}
+}
+
 /*
  * Announce device attach/detach to userland listeners.
  */
@@ -1848,6 +1876,39 @@
 }
 
 /*
+ * Defer some autoconfiguration for a device until after root file system
+ * is mounted (to load firmware etc).
+ */
+void
+config_mountroot(device_t dev, void (*func)(device_t))
+{
+	struct deferred_config *dc;
+
+	/*
+	 * If root file system is mounted, callback now.
+	 */
+	if (rootvnode != NULL) {
+		(*func)(dev);
+		return;
+	}
+
+#ifdef DIAGNOSTIC
+	TAILQ_FOREACH(dc, &mountroot_config_queue, dc_queue) {
+		if (dc->dc_dev == dev)
+			panic("%s: deferred twice", __func__);
+	}
+#endif
+
+	dc = kmem_alloc(sizeof(*dc), KM_SLEEP);
+	if (dc == NULL)
+		panic("%s: unable to allocate callback", __func__);
+
+	dc

CVS commit: src/distrib/utils/sysinst/arch/sparc64

2010-06-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jun 25 10:21:50 UTC 2010

Modified Files:
src/distrib/utils/sysinst/arch/sparc64: md.h

Log Message:
Re-enable LFS as /, now that booting from it works with the sysinst default
FS parameters.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/distrib/utils/sysinst/arch/sparc64/md.h

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

Modified files:

Index: src/distrib/utils/sysinst/arch/sparc64/md.h
diff -u src/distrib/utils/sysinst/arch/sparc64/md.h:1.18 src/distrib/utils/sysinst/arch/sparc64/md.h:1.19
--- src/distrib/utils/sysinst/arch/sparc64/md.h:1.18	Mon Apr  5 22:53:02 2010
+++ src/distrib/utils/sysinst/arch/sparc64/md.h	Fri Jun 25 10:21:50 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.18 2010/04/05 22:53:02 martin Exp $	*/
+/*	$NetBSD: md.h,v 1.19 2010/06/25 10:21:50 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -66,9 +66,6 @@
 /* allow using tmpfs for /tmp instead of mfs */
 #define HAVE_TMPFS
 
-/* disable LFS support, despite providing the lfs utilities */
-#define	NO_LFS
-
 /*
  * Default filesets to fetch and install during installation
  * or upgrade.



CVS commit: src/sys/ufs/lfs

2010-06-25 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Fri Jun 25 10:03:52 UTC 2010

Modified Files:
src/sys/ufs/lfs: lfs_subr.c

Log Message:
Undo last commit and don't try to lock vnodes in lfs_unmark_dirop()
as we may deadlock trying to write the superblock.

Should fix PR #43503 Can't create device nodes on LFS.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/ufs/lfs/lfs_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/ufs/lfs/lfs_subr.c
diff -u src/sys/ufs/lfs/lfs_subr.c:1.75 src/sys/ufs/lfs/lfs_subr.c:1.76
--- src/sys/ufs/lfs/lfs_subr.c:1.75	Thu Jun 24 07:54:47 2010
+++ src/sys/ufs/lfs/lfs_subr.c	Fri Jun 25 10:03:52 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_subr.c,v 1.75 2010/06/24 07:54:47 hannken Exp $	*/
+/*	$NetBSD: lfs_subr.c,v 1.76 2010/06/25 10:03:52 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.75 2010/06/24 07:54:47 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.76 2010/06/25 10:03:52 hannken Exp $");
 
 #include 
 #include 
@@ -362,8 +362,6 @@
 		nip = TAILQ_NEXT(ip, i_lfs_dchain);
 		vp = ITOV(ip);
 		if ((VTOI(vp)->i_flag & (IN_ADIROP | IN_ALLMOD)) == 0) {
-			if (vn_lock(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_RETRY))
-continue;
 			--lfs_dirvcount;
 			--fs->lfs_dirvcount;
 			vp->v_uflag &= ~VU_DIROP;
@@ -371,7 +369,7 @@
 			wakeup(&lfs_dirvcount);
 			fs->lfs_unlockvp = vp;
 			mutex_exit(&lfs_lock);
-			vput(vp);
+			vrele(vp);
 			mutex_enter(&lfs_lock);
 			fs->lfs_unlockvp = NULL;
 		}



CVS commit: src/crypto/external/bsd/netpgp/dist/src/netpgpkeys

2010-06-25 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jun 25 07:40:35 UTC 2010

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/netpgpkeys: netpgpkeys.1

Log Message:
Remove trailing whitespace. Use command without path (not
necessary on NetBSD, wrong if installed from pkgsrc). Bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
src/crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.1

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.1
diff -u src/crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.1:1.12 src/crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.1:1.13
--- src/crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.1:1.12	Fri Jun 25 03:37:28 2010
+++ src/crypto/external/bsd/netpgp/dist/src/netpgpkeys/netpgpkeys.1	Fri Jun 25 07:40:35 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: netpgpkeys.1,v 1.12 2010/06/25 03:37:28 agc Exp $
+.\" $NetBSD: netpgpkeys.1,v 1.13 2010/06/25 07:40:35 wiz Exp $
 .\"
 .\" Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 31, 2010
+.Dd June 25, 2010
 .Dt NETPGPKEYS 1
 .Os
 .Sh NAME
@@ -313,13 +313,13 @@
 or 2 if any other error occurs.
 .Sh EXAMPLES
 .Bd -literal
-% /usr/bin/netpgpkeys --ssh-keys --sshkeyfile=/etc/ssh/ssh_host_rsa_key.pub --list-keys --hash=md5
+% netpgpkeys --ssh-keys --sshkeyfile=/etc/ssh/ssh_host_rsa_key.pub --list-keys --hash=md5
 1 key
-pub 1024/RSA (Encrypt or Sign) fcdd1c608bef4c4b 2008-08-11 
-Key fingerprint: e935 902d ebf1 76ba fcdd 1c60 8bef 4c4b 
+pub 1024/RSA (Encrypt or Sign) fcdd1c608bef4c4b 2008-08-11
+Key fingerprint: e935 902d ebf1 76ba fcdd 1c60 8bef 4c4b
 uid  osx-vm1.crowthorne.alistaircrooks.co.uk (/etc/ssh/ssh_host_rsa_key.pub) 
 
-% ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub 
+% ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub
 1024 e9:35:90:2d:eb:f1:76:ba:fc:dd:1c:60:8b:ef:4c:4b /etc/ssh/ssh_host_rsa_key.pub (RSA)
 %
 .Ed