CVS commit: src/doc

2009-04-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Apr  5 06:50:12 UTC 2009

Modified Files:
src/doc: CHANGES.prev

Log Message:
Add some noticeable changes pulled up recently.


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

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

Modified files:

Index: src/doc/CHANGES.prev
diff -u src/doc/CHANGES.prev:1.93 src/doc/CHANGES.prev:1.94
--- src/doc/CHANGES.prev:1.93	Fri Mar 13 18:18:41 2009
+++ src/doc/CHANGES.prev	Sun Apr  5 06:50:11 2009
@@ -1,4 +1,4 @@
-LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.93 $>
+LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.94 $>
 
 
 Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8:
@@ -9882,4 +9882,40 @@
 		SGI's O2 workstations. [macallan 20090219]
 	mount_procfs(8): Default to -o linux. [pooka 20090223]
 	sgimips: build Xorg by default [macallan 20090223]
+	wm(4): Add support for 82574L. [sborrill 20090227]
 	azalia(4): Add proper Realtek ALC268 support. [jmcneill 20090228]
+	wm(4): Fix the multicast hash bug on ICH9. [msaitoh 20090228]
+	compat_sa: Disable PTHREAD_CONCURRENCY until the bugs are fixed.
+		[christos 20090306]
+	build.sh: In build.sh and bsd.own.mk, if uname -p fails, or
+		prints "unknown", or prints something that does not
+		look like an identifier, then use uname -m instead.
+		[apb 20090306]
+	ddb(4): Change value for ddb.onpanic to 0 in sysctl.conf(5).
+		[martin 20090311]
+	compat_sa: Disable SA via sysctl.conf(5), to keep binary compatibility
+		for incomplete (kernel only) updates. [martin 20090312]
+	atari: Use separate free lists for TT and ST ram, and give TT
+		a lower id so all TT ram will be used before any ST ram.
+		[abs 20090313]
+	cpuctl(8): Print some L2 cache size properly. [tsutsui 20090316]
+	re(4): Fix reset issue on newer 8168C/8111C/8102E chipes.
+		[tsutsui 20090320]
+	wdc(4): Work around a problem with PCMCIA adapter drivers (eg for hpc*)
+		which attach pcmcia devices before interrupts are enabled.
+		[drochner 20090321]
+	savecore(8): Use ksyms(4) if it's available. [tls 20090321]
+	httpd(8): Fix redirection core dump as reported in PR#41042.
+		[reinoud 20080323]
+	rc.conf(5), rc.d(8): Add flags to rc.d/ipfilter. [hannken 20090323]
+	ahcisata(4): Handle quirks of more NVIDIA MCP65 SATA controllers.
+		[dholland 20090327]
+	openssl(1): Apply patches from upstream to fix security problems,
+		ASN1 printing crash (CVE-2009-0590),
+		Incorrect Error Checking During CMS verification
+		(CVE-2009-0591), and Invalid ASN1 clearing check
+		(CVE-2009-0789). [drochner 20090327]
+	zx(4): Use bus_space(9) to access registers so that this works on gcc4.
+		[tsutsui 20090327]
+	sysctl(8): Add sysctl -w name?=value syntax which doesn't print
+		an error even if name does not exist. [christos 20090401]



CVS commit: src/sys/dev

2009-04-04 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Apr  5 03:37:07 UTC 2009

Modified Files:
src/sys/dev/ic: ne2000.c ne2000var.h
src/sys/dev/pcmcia: if_ne_pcmcia.c

Log Message:
Provide pmf(9) hooks that do what dopowerhooks(9) hook does.

XXX: Do NOT call pmf_class_network_register() yet, b/c db8320.c
doesn't provide if_stop method!


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/ic/ne2000.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/ic/ne2000var.h
cvs rdiff -u -r1.155 -r1.156 src/sys/dev/pcmcia/if_ne_pcmcia.c

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

Modified files:

Index: src/sys/dev/ic/ne2000.c
diff -u src/sys/dev/ic/ne2000.c:1.60 src/sys/dev/ic/ne2000.c:1.61
--- src/sys/dev/ic/ne2000.c:1.60	Sat Mar 14 15:36:17 2009
+++ src/sys/dev/ic/ne2000.c	Sun Apr  5 03:37:07 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ne2000.c,v 1.60 2009/03/14 15:36:17 dsl Exp $	*/
+/*	$NetBSD: ne2000.c,v 1.61 2009/04/05 03:37:07 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ne2000.c,v 1.60 2009/03/14 15:36:17 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ne2000.c,v 1.61 2009/04/05 03:37:07 uwe Exp $");
 
 #include "opt_ipkdb.h"
 
@@ -923,3 +923,38 @@
 	}
 	splx(s);
 }
+
+bool
+ne2000_suspend(device_t self PMF_FN_ARGS)
+{
+	struct ne2000_softc *sc = device_private(self);
+	struct dp8390_softc *dsc = &sc->sc_dp8390;
+	int s;
+
+	s = splnet();
+
+	dp8390_stop(dsc);
+	dp8390_disable(dsc);
+
+	splx(s);
+	return true;
+}
+
+bool
+ne2000_resume(device_t self PMF_FN_ARGS)
+{
+	struct ne2000_softc *sc = device_private(self);
+	struct dp8390_softc *dsc = &sc->sc_dp8390;
+	struct ifnet *ifp = &dsc->sc_ec.ec_if;
+	int s;
+
+	s = splnet();
+
+	if (ifp->if_flags & IFF_UP) {
+		if (dp8390_enable(dsc) == 0)
+			dp8390_init(dsc);
+	}
+
+	splx(s);
+	return true;
+}

Index: src/sys/dev/ic/ne2000var.h
diff -u src/sys/dev/ic/ne2000var.h:1.19 src/sys/dev/ic/ne2000var.h:1.20
--- src/sys/dev/ic/ne2000var.h:1.19	Mon Apr 28 20:23:50 2008
+++ src/sys/dev/ic/ne2000var.h	Sun Apr  5 03:37:07 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ne2000var.h,v 1.19 2008/04/28 20:23:50 martin Exp $	*/
+/*	$NetBSD: ne2000var.h,v 1.20 2009/04/05 03:37:07 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -60,6 +60,11 @@
 int	ne2000_ipkdb_attach(struct ipkdb_if *);
 #endif
 
+/* dopowerhooks(9) - deprecated */
 void	ne2000_power(int, void *);
 
+/* pmf(9) */
+bool ne2000_suspend(device_t PMF_FN_PROTO);
+bool ne2000_resume(device_t PMF_FN_PROTO);
+
 #endif /* _DEV_IC_NE2000VAR_H_ */

Index: src/sys/dev/pcmcia/if_ne_pcmcia.c
diff -u src/sys/dev/pcmcia/if_ne_pcmcia.c:1.155 src/sys/dev/pcmcia/if_ne_pcmcia.c:1.156
--- src/sys/dev/pcmcia/if_ne_pcmcia.c:1.155	Fri May 16 20:27:20 2008
+++ src/sys/dev/pcmcia/if_ne_pcmcia.c	Sun Apr  5 03:37:07 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ne_pcmcia.c,v 1.155 2008/05/16 20:27:20 jnemeth Exp $	*/
+/*	$NetBSD: if_ne_pcmcia.c,v 1.156 2009/04/05 03:37:07 uwe Exp $	*/
 
 /*
  * Copyright (c) 1997 Marc Horowitz.  All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ne_pcmcia.c,v 1.155 2008/05/16 20:27:20 jnemeth Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ne_pcmcia.c,v 1.156 2009/04/05 03:37:07 uwe Exp $");
 
 #include 
 #include 
@@ -733,12 +733,22 @@
 	if (ne2000_attach(nsc, enaddr))
 		goto fail2;
 
+	/* dopowerhooks(9) - deprecated, only called by hpcs* apmdev(4) */
 	psc->sc_powerhook = powerhook_establish(device_xname(self),
 	ne2000_power, nsc);
 	if (psc->sc_powerhook == NULL)
 		aprint_error_dev(self,
 		   "WARNING: unable to establish power hook\n");
 
+	/* pmf(9) power hooks */
+	if (!pmf_device_register(self, ne2000_suspend, ne2000_resume))
+		aprint_error_dev(self, "unable to establish power handler\n");
+	else {
+#if 0 /* XXX: notyet: if_stop is NULL! */
+		pmf_class_network_register(self, &dsc->sc_ec.ec_if);
+#endif
+	}
+
 	psc->sc_state = NE_PCMCIA_ATTACHED;
 	ne_pcmcia_disable(dsc);
 	return;



CVS commit: src/sys/dev/pcmcia

2009-04-04 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Apr  5 02:35:03 UTC 2009

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

Log Message:
Register with pmf(9), tell it we don't need anything.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/dev/pcmcia/wdc_pcmcia.c

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

Modified files:

Index: src/sys/dev/pcmcia/wdc_pcmcia.c
diff -u src/sys/dev/pcmcia/wdc_pcmcia.c:1.114 src/sys/dev/pcmcia/wdc_pcmcia.c:1.115
--- src/sys/dev/pcmcia/wdc_pcmcia.c:1.114	Sat Mar 21 12:35:17 2009
+++ src/sys/dev/pcmcia/wdc_pcmcia.c	Sun Apr  5 02:35:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: wdc_pcmcia.c,v 1.114 2009/03/21 12:35:17 drochner Exp $ */
+/*	$NetBSD: wdc_pcmcia.c,v 1.115 2009/04/05 02:35:03 uwe Exp $ */
 
 /*-
  * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wdc_pcmcia.c,v 1.114 2009/03/21 12:35:17 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_pcmcia.c,v 1.115 2009/04/05 02:35:03 uwe Exp $");
 
 #include 
 #include 
@@ -320,6 +320,10 @@
 	tsleep(wdc_pcmcia_attach, PWAIT, "wdcattach", hz / 2);
 
 	wdcattach(&sc->ata_channel);
+
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
+
 	config_pending_decr();
 	ata_delref(&sc->ata_channel);
 	sc->sc_state = WDC_PCMCIA_ATTACHED;
@@ -338,6 +342,8 @@
 	if (sc->sc_state != WDC_PCMCIA_ATTACHED)
 		return (0);
 
+	pmf_device_deregister(self);
+
 	if ((error = wdcdetach(self, flags)) != 0)
 		return (error);
 



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

2009-04-04 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Apr  5 02:29:40 UTC 2009

Modified Files:
src/sys/arch/hpcsh/dev: pfckbd.c

Log Message:
Register with pmf(9), tell it we don't need anything.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/hpcsh/dev/pfckbd.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/hpcsh/dev/pfckbd.c
diff -u src/sys/arch/hpcsh/dev/pfckbd.c:1.26 src/sys/arch/hpcsh/dev/pfckbd.c:1.27
--- src/sys/arch/hpcsh/dev/pfckbd.c:1.26	Wed Mar 18 10:22:30 2009
+++ src/sys/arch/hpcsh/dev/pfckbd.c	Sun Apr  5 02:29:40 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pfckbd.c,v 1.26 2009/03/18 10:22:30 cegger Exp $	*/
+/*	$NetBSD: pfckbd.c,v 1.27 2009/04/05 02:29:40 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  * currently, HP Jornada 680/690, HITACHI PERSONA HPW-50PAD only.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pfckbd.c,v 1.26 2009/03/18 10:22:30 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pfckbd.c,v 1.27 2009/04/05 02:29:40 uwe Exp $");
 
 #include "debug_hpcsh.h"
 
@@ -147,6 +147,9 @@
 	callout_init(&pfckbd_core.pc_soft_ch, 0);
 	callout_reset(&pfckbd_core.pc_soft_ch, 1,
 		  pfckbd_core.pc_callout, &pfckbd_core);
+
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }
 
 static void



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

2009-04-04 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Apr  5 02:23:00 UTC 2009

Modified Files:
src/sys/arch/hpcsh/dev: j6x0lcd.c

Log Message:
Register null hooks with pmf(9) for now, which is no worse than before
and allows us to test other things.  Power management is still done
via CONFIG_HOOK_POWERCONTROL_LCD.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hpcsh/dev/j6x0lcd.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/hpcsh/dev/j6x0lcd.c
diff -u src/sys/arch/hpcsh/dev/j6x0lcd.c:1.13 src/sys/arch/hpcsh/dev/j6x0lcd.c:1.14
--- src/sys/arch/hpcsh/dev/j6x0lcd.c:1.13	Fri Mar 28 01:19:12 2008
+++ src/sys/arch/hpcsh/dev/j6x0lcd.c	Sun Apr  5 02:23:00 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: j6x0lcd.c,v 1.13 2008/03/28 01:19:12 uwe Exp $ */
+/*	$NetBSD: j6x0lcd.c,v 1.14 2009/04/05 02:23:00 uwe Exp $ */
 
 /*
  * Copyright (c) 2004, 2005 Valeriy E. Ushakov
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: j6x0lcd.c,v 1.13 2008/03/28 01:19:12 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: j6x0lcd.c,v 1.14 2009/04/05 02:23:00 uwe Exp $");
 
 #include 
 #include 
@@ -277,6 +277,10 @@
 		CONFIG_HOOK_POWERCONTROL_LCD,
 		CONFIG_HOOK_SHARE,
 		j6x0lcd_power, sc);
+
+	/* XXX: TODO: don't rely on CONFIG_HOOK_POWERCONTROL_LCD */
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }
 
 



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

2009-04-04 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Apr  5 02:19:57 UTC 2009

Modified Files:
src/sys/arch/hpcsh/dev: j6x0tp.c

Log Message:
Register with pmf(9), tell it we don't need anything.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/hpcsh/dev/j6x0tp.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/hpcsh/dev/j6x0tp.c
diff -u src/sys/arch/hpcsh/dev/j6x0tp.c:1.22 src/sys/arch/hpcsh/dev/j6x0tp.c:1.23
--- src/sys/arch/hpcsh/dev/j6x0tp.c:1.22	Thu Mar 27 03:58:47 2008
+++ src/sys/arch/hpcsh/dev/j6x0tp.c	Sun Apr  5 02:19:57 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: j6x0tp.c,v 1.22 2008/03/27 03:58:47 uwe Exp $ */
+/*	$NetBSD: j6x0tp.c,v 1.23 2009/04/05 02:19:57 uwe Exp $ */
 
 /*
  * Copyright (c) 2003 Valeriy E. Ushakov
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: j6x0tp.c,v 1.22 2008/03/27 03:58:47 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: j6x0tp.c,v 1.23 2009/04/05 02:19:57 uwe Exp $");
 
 #include 
 #include 
@@ -279,6 +279,9 @@
 	intc_intr_establish(SH7709_INTEVT2_IRQ3, IST_EDGE, IPL_TTY,
 			j6x0tp_intr, sc);
 	intc_intr_disable(SH7709_INTEVT2_IRQ3);
+
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }
 
 



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

2009-04-04 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Apr  5 02:18:59 UTC 2009

Modified Files:
src/sys/arch/hpcsh/dev: j6x0pwr.c

Log Message:
Register with pmf(9), tell it we don't need anything.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hpcsh/dev/j6x0pwr.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/hpcsh/dev/j6x0pwr.c
diff -u src/sys/arch/hpcsh/dev/j6x0pwr.c:1.14 src/sys/arch/hpcsh/dev/j6x0pwr.c:1.15
--- src/sys/arch/hpcsh/dev/j6x0pwr.c:1.14	Thu Mar 27 03:34:14 2008
+++ src/sys/arch/hpcsh/dev/j6x0pwr.c	Sun Apr  5 02:18:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: j6x0pwr.c,v 1.14 2008/03/27 03:34:14 uwe Exp $ */
+/*	$NetBSD: j6x0pwr.c,v 1.15 2009/04/05 02:18:59 uwe Exp $ */
 
 /*
  * Copyright (c) 2003, 2006 Valeriy E. Ushakov
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: j6x0pwr.c,v 1.14 2008/03/27 03:34:14 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: j6x0pwr.c,v 1.15 2009/04/05 02:18:59 uwe Exp $");
 
 #include 
 #include 
@@ -187,6 +187,9 @@
 	j6x0pwr_intr, sc);
 
 	_reg_write_1(SH7709_PKDR, 0);	/* Green LED on */
+
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }
 
 



CVS commit: src/distrib/utils/sysinst

2009-04-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Apr  5 02:18:41 UTC 2009

Modified Files:
src/distrib/utils/sysinst: defs.h sizemultname.c

Log Message:
Remove unused check_partitions().
The similar check is done in check_one_root() in label.c.


To generate a diff of this commit:
cvs rdiff -u -r1.140 -r1.141 src/distrib/utils/sysinst/defs.h
cvs rdiff -u -r1.3 -r1.4 src/distrib/utils/sysinst/sizemultname.c

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/defs.h
diff -u src/distrib/utils/sysinst/defs.h:1.140 src/distrib/utils/sysinst/defs.h:1.141
--- src/distrib/utils/sysinst/defs.h:1.140	Sat Apr  4 11:24:24 2009
+++ src/distrib/utils/sysinst/defs.h	Sun Apr  5 02:18:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.140 2009/04/04 11:24:24 ad Exp $	*/
+/*	$NetBSD: defs.h,v 1.141 2009/04/05 02:18:41 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -413,7 +413,6 @@
 void	add_rc_conf(const char *, ...);
 void	add_sysctl_conf(const char *, ...);
 void	enable_rc_conf(void);
-int	check_partitions(void);
 void	set_sizemultname_cyl(void);
 void	set_sizemultname_meg(void);
 int	check_lfs_progs(void);

Index: src/distrib/utils/sysinst/sizemultname.c
diff -u src/distrib/utils/sysinst/sizemultname.c:1.3 src/distrib/utils/sysinst/sizemultname.c:1.4
--- src/distrib/utils/sysinst/sizemultname.c:1.3	Mon Jun 16 19:42:14 2003
+++ src/distrib/utils/sysinst/sizemultname.c	Sun Apr  5 02:18:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: sizemultname.c,v 1.3 2003/06/16 19:42:14 dsl Exp $	*/
+/*	$NetBSD: sizemultname.c,v 1.4 2009/04/05 02:18:41 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -52,23 +52,6 @@
 #include "msg_defs.h"
 #include "menu_defs.h"
 
-/*
- * check that there is at least a / somewhere.
- */
-int
-check_partitions(void)
-{
-	int i;
-
-	for (i = 0; i < getmaxpartitions(); i++)
-		if (PI_ISBSDFS(&bsdlabel[i]) &&
-		strcmp(bsdlabel[i].pi_mount, "/") == 0)
-			return 1;
-	msg_display(MSG_no_root_fs);
-	getchar();
-	return 0;
-}
-
 void
 set_sizemultname_cyl(void)
 {



CVS commit: src/sys/dev/hpc

2009-04-04 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Apr  5 02:17:18 UTC 2009

Modified Files:
src/sys/dev/hpc: hpckbd.c

Log Message:
Register with pmf(9), tell it we don't need anything.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/hpc/hpckbd.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/hpc/hpckbd.c
diff -u src/sys/dev/hpc/hpckbd.c:1.25 src/sys/dev/hpc/hpckbd.c:1.26
--- src/sys/dev/hpc/hpckbd.c:1.25	Mon Apr 28 20:23:48 2008
+++ src/sys/dev/hpc/hpckbd.c	Sun Apr  5 02:17:18 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpckbd.c,v 1.25 2008/04/28 20:23:48 martin Exp $ */
+/*	$NetBSD: hpckbd.c,v 1.26 2009/04/05 02:17:18 uwe Exp $ */
 
 /*-
  * Copyright (c) 1999-2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hpckbd.c,v 1.25 2008/04/28 20:23:48 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpckbd.c,v 1.26 2009/04/05 02:17:18 uwe Exp $");
 
 #include 
 #include 
@@ -182,6 +182,9 @@
 	wa.accessops = &hpckbd_accessops;
 	wa.accesscookie = sc->sc_core;
 	sc->sc_core->hc_wskbddev = config_found(self, &wa, wskbddevprint);
+
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }
 
 int



CVS commit: src/sys/dev/hpc

2009-04-04 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Apr  5 02:14:41 UTC 2009

Modified Files:
src/sys/dev/hpc: hpcfb.c

Log Message:
Register with pmf(9).  Thus we register with both dopowerhooks(9) and
pmf(9), but they are mutually exclusive (apm(4) vs apmdev(4)).

Express pmf(9) hooks in terms of dopowerhooks(9) hook - the reverse
would be more natural, but pmf hook signature is hidden behind
PMF_FN_ARGS/PMF_FN_CALL, so just go the least intrusive way for now.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/hpc/hpcfb.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/hpc/hpcfb.c
diff -u src/sys/dev/hpc/hpcfb.c:1.49 src/sys/dev/hpc/hpcfb.c:1.50
--- src/sys/dev/hpc/hpcfb.c:1.49	Sun Apr  5 01:48:47 2009
+++ src/sys/dev/hpc/hpcfb.c	Sun Apr  5 02:14:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpcfb.c,v 1.49 2009/04/05 01:48:47 uwe Exp $	*/
+/*	$NetBSD: hpcfb.c,v 1.50 2009/04/05 02:14:41 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1999
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hpcfb.c,v 1.49 2009/04/05 01:48:47 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpcfb.c,v 1.50 2009/04/05 02:14:41 uwe Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_hpcfb.h"
@@ -195,10 +195,14 @@
 static int	hpcfb_show_screen(void *, void *, int,
 		void (*) (void *, int, int), void *);
 static void hpcfb_pollc(void *, int);
-static void	hpcfb_power(int, void *);
 static void	hpcfb_cmap_reorder(struct hpcfb_fbconf *,
 		struct hpcfb_devconfig *);
 
+static void	hpcfb_power(int, void *);
+static bool	hpcfb_suspend(device_t PMF_FN_PROTO);
+static bool	hpcfb_resume(device_t PMF_FN_PROTO);
+
+
 voidhpcfb_cursor(void *, int, int, int);
 int hpcfb_mapchar(void *, int, unsigned int *);
 voidhpcfb_putchar(void *, int, int, u_int, long);
@@ -318,12 +322,6 @@
 	sc->sc_mapping = 0; /* XXX */
 	callout_init(&sc->sc_switch_callout, 0);
 
-	/* Add a power hook to power management */
-	sc->sc_powerhook = powerhook_establish(device_xname(sc->sc_dev),
-	hpcfb_power, sc);
-	if (sc->sc_powerhook == NULL)
-		aprint_error_dev(sc->sc_dev, "WARNING: unable to establish power hook\n");
-
 	wa.console = hpcfbconsole;
 	wa.scrdata = &hpcfb_screenlist;
 	wa.accessops = &hpcfb_accessops;
@@ -345,6 +343,20 @@
 		"hpcfb scroll support disabled\n");
 	}
 #endif /* HPCFB_JUMP */
+
+	/*
+	 * apmdev(4) uses dopowerhooks(9), apm(4) uses pmf(9), and the
+	 * two apm drivers are mutually exclusive.  Register power
+	 * hooks with both.
+	 */
+	sc->sc_powerhook = powerhook_establish(device_xname(sc->sc_dev),
+	hpcfb_power, sc);
+	if (sc->sc_powerhook == NULL)
+		aprint_error_dev(self,
+ "WARNING: unable to establish power hook\n");
+
+	if (!pmf_device_register(self, hpcfb_suspend, hpcfb_resume))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }
 
 #ifdef HPCFB_JUMP
@@ -659,6 +671,24 @@
 	}
 }
 
+static bool
+hpcfb_suspend(device_t self PMF_FN_ARGS)
+{
+	struct hpcfb_softc *sc = device_private(self);
+
+	hpcfb_power(PWR_SOFTSUSPEND, sc);
+	return true;
+}
+
+static bool
+hpcfb_resume(device_t self PMF_FN_ARGS)
+{
+	struct hpcfb_softc *sc = device_private(self);
+
+	hpcfb_power(PWR_SOFTRESUME, sc);
+	return true;
+}
+
 void
 hpcfb_refresh_screen(struct hpcfb_softc *sc)
 {



CVS commit: src/sys/dev/hpc

2009-04-04 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Apr  5 02:04:40 UTC 2009

Modified Files:
src/sys/dev/hpc: hpcapm.c

Log Message:
Register with pmf(9), tell it we don't need anything.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/hpc/hpcapm.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/hpc/hpcapm.c
diff -u src/sys/dev/hpc/hpcapm.c:1.15 src/sys/dev/hpc/hpcapm.c:1.16
--- src/sys/dev/hpc/hpcapm.c:1.15	Fri Apr  3 04:13:17 2009
+++ src/sys/dev/hpc/hpcapm.c	Sun Apr  5 02:04:40 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpcapm.c,v 1.15 2009/04/03 04:13:17 uwe Exp $	*/
+/*	$NetBSD: hpcapm.c,v 1.16 2009/04/05 02:04:40 uwe Exp $	*/
 
 /*
  * Copyright (c) 2000 Takemura Shin
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hpcapm.c,v 1.15 2009/04/03 04:13:17 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpcapm.c,v 1.16 2009/04/05 02:04:40 uwe Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_hpcapm.h"
@@ -153,6 +153,9 @@
 	aaa.apm_detail = 0x0102;
 
 	sc->sc_apmdev = config_found_ia(self, "apmdevif", &aaa, apmprint);
+
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }
 
 static int



CVS commit: src/sys/dev/hpc

2009-04-04 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Apr  5 01:48:47 UTC 2009

Modified Files:
src/sys/dev/hpc: hpcfb.c

Log Message:
Split device_t and softc.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/hpc/hpcfb.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/hpc/hpcfb.c
diff -u src/sys/dev/hpc/hpcfb.c:1.48 src/sys/dev/hpc/hpcfb.c:1.49
--- src/sys/dev/hpc/hpcfb.c:1.48	Sat Mar 14 21:04:19 2009
+++ src/sys/dev/hpc/hpcfb.c	Sun Apr  5 01:48:47 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpcfb.c,v 1.48 2009/03/14 21:04:19 dsl Exp $	*/
+/*	$NetBSD: hpcfb.c,v 1.49 2009/04/05 01:48:47 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1999
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hpcfb.c,v 1.48 2009/03/14 21:04:19 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpcfb.c,v 1.49 2009/04/05 01:48:47 uwe Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_hpcfb.h"
@@ -153,12 +153,12 @@
 #define HPCFB_MAX_JUMP 5
 
 struct hpcfb_softc {
-	struct	device sc_dev;
+	device_t sc_dev;
 	struct	hpcfb_devconfig *sc_dc;	/* device configuration */
 	const struct hpcfb_accessops	*sc_accessops;
 	void *sc_accessctx;
 	void *sc_powerhook;	/* power management hook */
-	struct device *sc_wsdisplay;
+	device_t sc_wsdisplay;
 	int sc_screen_resumed;
 	int sc_polling;
 	int sc_mapping;
@@ -174,8 +174,8 @@
 /*
  *  function prototypes
  */
-int	hpcfbmatch(struct device *, struct cfdata *, void *);
-void	hpcfbattach(struct device *, struct device *, void *);
+int	hpcfbmatch(device_t, cfdata_t, void *);
+void	hpcfbattach(device_t, device_t, void *);
 int	hpcfbprint(void *, const char *);
 
 int	hpcfb_ioctl(void *, void *, u_long, void *, int, struct lwp *);
@@ -231,7 +231,7 @@
 /*
  *  static variables
  */
-CFATTACH_DECL(hpcfb, sizeof(struct hpcfb_softc),
+CFATTACH_DECL_NEW(hpcfb, sizeof(struct hpcfb_softc),
 hpcfbmatch, hpcfbattach, NULL, NULL);
 
 struct wsscreen_descr hpcfb_stdscreen = {
@@ -280,20 +280,21 @@
  */
 
 int
-hpcfbmatch(struct device *parent,
-	   struct cfdata *match, void *aux)
+hpcfbmatch(device_t parent, cfdata_t match, void *aux)
 {
 	return (1);
 }
 
 void
-hpcfbattach(struct device *parent,
-	struct device *self, void *aux)
+hpcfbattach(device_t parent, device_t self, void *aux)
 {
-	struct hpcfb_softc *sc = device_private(self);
+	struct hpcfb_softc *sc;
 	struct hpcfb_attach_args *ha = aux;
 	struct wsemuldisplaydev_attach_args wa;
 
+	sc = device_private(self);
+	sc->sc_dev = self;
+
 	sc->sc_accessops = ha->ha_accessops;
 	sc->sc_accessctx = ha->ha_accessctx;
 	sc->sc_nfbconf = ha->ha_nfbconf;
@@ -318,10 +319,10 @@
 	callout_init(&sc->sc_switch_callout, 0);
 
 	/* Add a power hook to power management */
-	sc->sc_powerhook = powerhook_establish(device_xname(&sc->sc_dev),
+	sc->sc_powerhook = powerhook_establish(device_xname(sc->sc_dev),
 	hpcfb_power, sc);
 	if (sc->sc_powerhook == NULL)
-		aprint_error_dev(&sc->sc_dev, "WARNING: unable to establish power hook\n");
+		aprint_error_dev(sc->sc_dev, "WARNING: unable to establish power hook\n");
 
 	wa.console = hpcfbconsole;
 	wa.scrdata = &hpcfb_screenlist;
@@ -335,12 +336,12 @@
 	 * Create a kernel thread to scroll,
 	 */
 	if (kthread_create(PRI_NONE, 0, NULL, hpcfb_thread, sc,
-	&sc->sc_thread, "%s", device_xname(&sc->sc_dev)) != 0) {
+	&sc->sc_thread, "%s", device_xname(sc->sc_dev)) != 0) {
 		/*
 		 * We were unable to create the HPCFB thread; bail out.
 		 */
 		sc->sc_thread = 0;
-		aprint_error_dev(&sc->sc_dev, "unable to create thread, kernel "
+		aprint_error_dev(sc->sc_dev, "unable to create thread, kernel "
 		"hpcfb scroll support disabled\n");
 	}
 #endif /* HPCFB_JUMP */



CVS commit: src/sys/arch

2009-04-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Apr  5 00:57:56 UTC 2009

Modified Files:
src/sys/arch/amd64/include: types.h
src/sys/arch/i386/include: types.h

Log Message:
Use #define consistently.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/amd64/include/types.h
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/i386/include/types.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/amd64/include/types.h
diff -u src/sys/arch/amd64/include/types.h:1.30 src/sys/arch/amd64/include/types.h:1.31
--- src/sys/arch/amd64/include/types.h:1.30	Sun Apr  5 00:54:21 2009
+++ src/sys/arch/amd64/include/types.h	Sun Apr  5 00:57:56 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.30 2009/04/05 00:54:21 tsutsui Exp $	*/
+/*	$NetBSD: types.h,v 1.31 2009/04/05 00:57:56 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -75,11 +75,11 @@
 #define	__HAVE_MINIMAL_EMUL
 #define	__HAVE_ATOMIC64_OPS
 #define	__HAVE_ATOMIC_AS_MEMBAR
-#define __HAVE_CPU_LWP_SETPRIVATE
+#define	__HAVE_CPU_LWP_SETPRIVATE
 
 #ifdef _KERNEL_OPT
 #include "opt_xen.h"
-#define __HAVE_RAS
+#define	__HAVE_RAS
 #endif
 
 #else	/*	!__x86_64__	*/

Index: src/sys/arch/i386/include/types.h
diff -u src/sys/arch/i386/include/types.h:1.63 src/sys/arch/i386/include/types.h:1.64
--- src/sys/arch/i386/include/types.h:1.63	Sun Apr  5 00:54:21 2009
+++ src/sys/arch/i386/include/types.h	Sun Apr  5 00:57:56 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.63 2009/04/05 00:54:21 tsutsui Exp $	*/
+/*	$NetBSD: types.h,v 1.64 2009/04/05 00:57:56 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -86,7 +86,7 @@
 #define	__HAVE_CPU_LWP_SETPRIVATE
 
 #if defined(_KERNEL)
-#define __HAVE_RAS
+#define	__HAVE_RAS
 #endif
 
 #endif	/* _I386_MACHTYPES_H_ */



CVS commit: src/sys/arch/hpcsh/dev/hd64461

2009-04-04 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Apr  5 00:56:20 UTC 2009

Modified Files:
src/sys/arch/hpcsh/dev/hd64461: hd64461.c hd64461pcmcia.c
hd64461video.c

Log Message:
Register null hooks with pmf(9) for now, which is no worse than before
and allows us to test other things.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hpcsh/dev/hd64461/hd64461.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/hpcsh/dev/hd64461/hd64461pcmcia.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/hpcsh/dev/hd64461/hd64461video.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/hpcsh/dev/hd64461/hd64461.c
diff -u src/sys/arch/hpcsh/dev/hd64461/hd64461.c:1.21 src/sys/arch/hpcsh/dev/hd64461/hd64461.c:1.22
--- src/sys/arch/hpcsh/dev/hd64461/hd64461.c:1.21	Sun Mar 22 02:25:11 2009
+++ src/sys/arch/hpcsh/dev/hd64461/hd64461.c	Sun Apr  5 00:56:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hd64461.c,v 1.21 2009/03/22 02:25:11 uwe Exp $	*/
+/*	$NetBSD: hd64461.c,v 1.22 2009/04/05 00:56:20 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hd64461.c,v 1.21 2009/03/22 02:25:11 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hd64461.c,v 1.22 2009/04/05 00:56:20 uwe Exp $");
 
 #include 
 #include 
@@ -125,6 +125,10 @@
 		ha.ha_module_id = i;
 		config_found(self, &ha, hd64461_print);
 	}
+
+	/* XXX: TODO */
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }
 
 STATIC int

Index: src/sys/arch/hpcsh/dev/hd64461/hd64461pcmcia.c
diff -u src/sys/arch/hpcsh/dev/hd64461/hd64461pcmcia.c:1.45 src/sys/arch/hpcsh/dev/hd64461/hd64461pcmcia.c:1.46
--- src/sys/arch/hpcsh/dev/hd64461/hd64461pcmcia.c:1.45	Sat Mar 21 02:23:03 2009
+++ src/sys/arch/hpcsh/dev/hd64461/hd64461pcmcia.c	Sun Apr  5 00:56:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hd64461pcmcia.c,v 1.45 2009/03/21 02:23:03 uwe Exp $	*/
+/*	$NetBSD: hd64461pcmcia.c,v 1.46 2009/04/05 00:56:20 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hd64461pcmcia.c,v 1.45 2009/03/21 02:23:03 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hd64461pcmcia.c,v 1.46 2009/04/05 00:56:20 uwe Exp $");
 
 #include "opt_hd64461pcmcia.h"
 
@@ -272,6 +272,10 @@
 	KASSERT(error == 0);
 
 	config_pending_incr();
+
+	/* XXX: TODO */
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }
 
 STATIC void

Index: src/sys/arch/hpcsh/dev/hd64461/hd64461video.c
diff -u src/sys/arch/hpcsh/dev/hd64461/hd64461video.c:1.51 src/sys/arch/hpcsh/dev/hd64461/hd64461video.c:1.52
--- src/sys/arch/hpcsh/dev/hd64461/hd64461video.c:1.51	Wed Mar 18 02:49:34 2009
+++ src/sys/arch/hpcsh/dev/hd64461/hd64461video.c	Sun Apr  5 00:56:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hd64461video.c,v 1.51 2009/03/18 02:49:34 uwe Exp $	*/
+/*	$NetBSD: hd64461video.c,v 1.52 2009/04/05 00:56:20 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hd64461video.c,v 1.51 2009/03/18 02:49:34 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hd64461video.c,v 1.52 2009/04/05 00:56:20 uwe Exp $");
 
 #include "opt_hd64461video.h"
 // #define HD64461VIDEO_HWACCEL
@@ -271,6 +271,21 @@
 	hfa.ha_dspconflist = &hd64461video_chip.hd;
 	
 	config_found(self, &hfa, hpcfbprint);
+
+	/*
+	 * XXX: TODO: for now this device manages power using
+	 * config_hook(9) registered with hpcapm(4).
+	 *
+	 * We cannot yet switch it to pmf(9) hooks because only apm(4)
+	 * uses them, apmdev(4) doesn't, but hpcapm(4) is the parent
+	 * device for both, so its hooks are always run.
+	 *
+	 * We probably want to register shutdown hook with pmf(9) to
+	 * make sure display is powered on before we reboot in case we
+	 * end up in ddb early on.
+	 */
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }
 
 /* console support */



CVS commit: src/sys/arch

2009-04-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Apr  5 00:54:21 UTC 2009

Modified Files:
src/sys/arch/amd64/include: types.h
src/sys/arch/i386/include: types.h

Log Message:
Remove __HAVE_UFS2_BOOT since it belongs to sysinst for now.
"Feel free to change it" by a...@.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/amd64/include/types.h
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/i386/include/types.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/amd64/include/types.h
diff -u src/sys/arch/amd64/include/types.h:1.29 src/sys/arch/amd64/include/types.h:1.30
--- src/sys/arch/amd64/include/types.h:1.29	Sat Apr  4 10:36:09 2009
+++ src/sys/arch/amd64/include/types.h	Sun Apr  5 00:54:21 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.29 2009/04/04 10:36:09 ad Exp $	*/
+/*	$NetBSD: types.h,v 1.30 2009/04/05 00:54:21 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -76,7 +76,6 @@
 #define	__HAVE_ATOMIC64_OPS
 #define	__HAVE_ATOMIC_AS_MEMBAR
 #define __HAVE_CPU_LWP_SETPRIVATE
-#define	__HAVE_UFS2_BOOT
 
 #ifdef _KERNEL_OPT
 #include "opt_xen.h"

Index: src/sys/arch/i386/include/types.h
diff -u src/sys/arch/i386/include/types.h:1.62 src/sys/arch/i386/include/types.h:1.63
--- src/sys/arch/i386/include/types.h:1.62	Sat Apr  4 10:36:08 2009
+++ src/sys/arch/i386/include/types.h	Sun Apr  5 00:54:21 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.62 2009/04/04 10:36:08 ad Exp $	*/
+/*	$NetBSD: types.h,v 1.63 2009/04/05 00:54:21 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -84,7 +84,6 @@
 #define	__HAVE_ATOMIC64_OPS
 #define	__HAVE_ATOMIC_AS_MEMBAR
 #define	__HAVE_CPU_LWP_SETPRIVATE
-#define	__HAVE_UFS2_BOOT
 
 #if defined(_KERNEL)
 #define __HAVE_RAS



CVS commit: src/distrib/utils/sysinst

2009-04-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Apr  5 00:50:52 UTC 2009

Modified Files:
src/distrib/utils/sysinst: bsddisklabel.c
src/distrib/utils/sysinst/arch/amd64: md.h
src/distrib/utils/sysinst/arch/i386: md.h

Log Message:
- introduce machine dependent DEFAULT_UFS2 and HAVE_UFS2_BOOT flags in md.h
- use those flags to change default ffs type, rather than adding
  __HAVE_UFS2_BOOT in 

Okay'ed by martin@, briefly tested on i386.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/distrib/utils/sysinst/bsddisklabel.c
cvs rdiff -u -r1.23 -r1.24 src/distrib/utils/sysinst/arch/amd64/md.h
cvs rdiff -u -r1.64 -r1.65 src/distrib/utils/sysinst/arch/i386/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/bsddisklabel.c
diff -u src/distrib/utils/sysinst/bsddisklabel.c:1.49 src/distrib/utils/sysinst/bsddisklabel.c:1.50
--- src/distrib/utils/sysinst/bsddisklabel.c:1.49	Sat Apr  4 11:34:09 2009
+++ src/distrib/utils/sysinst/bsddisklabel.c	Sun Apr  5 00:50:51 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.49 2009/04/04 11:34:09 ad Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.50 2009/04/05 00:50:51 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -131,8 +131,11 @@
 		/* Default to logging, UFS2. */
 		if (p->pi_fstype == FS_BSDFFS) {
 			p->pi_flags |= PIF_LOG;
-#ifdef __HAVE_UFS2_BOOT
-			p->pi_flags |= PIF_FFSv2;
+#ifdef DEFAULT_UFS2
+#ifndef HAVE_UFS2_BOOT
+			if (strcmp(mountpt, "/") != 0)
+#endif
+p->pi_flags |= PIF_FFSv2;
 #endif
 		}
 	}

Index: src/distrib/utils/sysinst/arch/amd64/md.h
diff -u src/distrib/utils/sysinst/arch/amd64/md.h:1.23 src/distrib/utils/sysinst/arch/amd64/md.h:1.24
--- src/distrib/utils/sysinst/arch/amd64/md.h:1.23	Sat Apr  4 11:04:28 2009
+++ src/distrib/utils/sysinst/arch/amd64/md.h	Sun Apr  5 00:50:52 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.23 2009/04/04 11:04:28 ad Exp $	*/
+/*	$NetBSD: md.h,v 1.24 2009/04/05 00:50:52 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -53,6 +53,10 @@
 #define	DEFUSRSIZE	0
 #define	DEFSWAPSIZE	(-1)
 
+/* use UFS2 by default for ffs */
+#define	DEFAULT_UFS2
+#define	HAVE_UFS2_BOOT
+
 /* Megs required for a full X installation. */
 #define XNEEDMB 50
 

Index: src/distrib/utils/sysinst/arch/i386/md.h
diff -u src/distrib/utils/sysinst/arch/i386/md.h:1.64 src/distrib/utils/sysinst/arch/i386/md.h:1.65
--- src/distrib/utils/sysinst/arch/i386/md.h:1.64	Sat Apr  4 11:04:28 2009
+++ src/distrib/utils/sysinst/arch/i386/md.h	Sun Apr  5 00:50:52 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.64 2009/04/04 11:04:28 ad Exp $	*/
+/*	$NetBSD: md.h,v 1.65 2009/04/05 00:50:52 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -54,6 +54,10 @@
 #define	DEFSWAPSIZE	(-1)
 #define	DEFROOTSIZE	32
 
+/* use UFS2 by default for ffs */
+#define	DEFAULT_UFS2
+#define	HAVE_UFS2_BOOT
+
 /* Megs required for a full X installation. */
 #define XNEEDMB 50
 



CVS commit: src/sys/dev/hpc

2009-04-04 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Apr  5 00:34:42 UTC 2009

Modified Files:
src/sys/dev/hpc: btnmgr.c

Log Message:
Register with pmf(9), tell it we don't need anything.
btnmgr(4) is just a hub for other devices to plug into with
config_hook(9), there is no real hardware to manage.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/hpc/btnmgr.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/hpc/btnmgr.c
diff -u src/sys/dev/hpc/btnmgr.c:1.22 src/sys/dev/hpc/btnmgr.c:1.23
--- src/sys/dev/hpc/btnmgr.c:1.22	Fri Oct 19 11:59:42 2007
+++ src/sys/dev/hpc/btnmgr.c	Sun Apr  5 00:34:42 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: btnmgr.c,v 1.22 2007/10/19 11:59:42 ad Exp $	*/
+/*	$NetBSD: btnmgr.c,v 1.23 2009/04/05 00:34:42 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1999
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: btnmgr.c,v 1.22 2007/10/19 11:59:42 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btnmgr.c,v 1.23 2009/04/05 00:34:42 uwe Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_btnmgr.h"
@@ -211,6 +211,9 @@
 	wa.accesscookie = sc;
 
 	sc->sc_wskbddev = config_found(self, &wa, wskbddevprint);
+
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }
 
 static int



CVS commit: src/sys/arch/sh3/sh3

2009-04-04 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Apr  5 00:04:52 UTC 2009

Modified Files:
src/sys/arch/sh3/sh3: cpu.c

Log Message:
Register with pmf(9), tell it we don't need anything.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/sh3/sh3/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/sh3/sh3/cpu.c
diff -u src/sys/arch/sh3/sh3/cpu.c:1.13 src/sys/arch/sh3/sh3/cpu.c:1.14
--- src/sys/arch/sh3/sh3/cpu.c:1.13	Mon Apr 28 20:23:35 2008
+++ src/sys/arch/sh3/sh3/cpu.c	Sun Apr  5 00:04:51 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.13 2008/04/28 20:23:35 martin Exp $	*/
+/*	$NetBSD: cpu.c,v 1.14 2009/04/05 00:04:51 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.13 2008/04/28 20:23:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.14 2009/04/05 00:04:51 uwe Exp $");
 
 #include 
 #include 
@@ -77,4 +77,7 @@
 
 	sh_cache_information();
 	sh_mmu_information();
+
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }



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

2009-04-04 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Apr  5 00:26:00 UTC 2009

Modified Files:
src/sys/arch/sh3/dev: shb.c

Log Message:
Register null hooks with pmf(9) for now, which is no worse than before
and allows us to test other things.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/sh3/dev/shb.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/sh3/dev/shb.c
diff -u src/sys/arch/sh3/dev/shb.c:1.13 src/sys/arch/sh3/dev/shb.c:1.14
--- src/sys/arch/sh3/dev/shb.c:1.13	Mon Apr 28 20:23:35 2008
+++ src/sys/arch/sh3/dev/shb.c	Sun Apr  5 00:25:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: shb.c,v 1.13 2008/04/28 20:23:35 martin Exp $	*/
+/*	$NetBSD: shb.c,v 1.14 2009/04/05 00:25:59 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: shb.c,v 1.13 2008/04/28 20:23:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: shb.c,v 1.14 2009/04/05 00:25:59 uwe Exp $");
 
 #include 
 #include 
@@ -65,6 +65,13 @@
 	aprint_normal("\n");
 
 	config_search_ia(shb_search, self, "shb", NULL);
+
+	/*
+	 * XXX: TODO: provide hooks to manage on-chip modules.  For
+	 * now register null hooks which is no worse than before.
+	 */
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }
 
 static int



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

2009-04-04 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Apr  5 00:22:53 UTC 2009

Modified Files:
src/sys/arch/sh3/dev: scif.c

Log Message:
Register null hooks with pmf(9) for now, which is no worse than before
and allows us to test other things.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/sh3/dev/scif.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/sh3/dev/scif.c
diff -u src/sys/arch/sh3/dev/scif.c:1.58 src/sys/arch/sh3/dev/scif.c:1.59
--- src/sys/arch/sh3/dev/scif.c:1.58	Wed Mar 18 10:22:36 2009
+++ src/sys/arch/sh3/dev/scif.c	Sun Apr  5 00:22:53 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: scif.c,v 1.58 2009/03/18 10:22:36 cegger Exp $ */
+/*	$NetBSD: scif.c,v 1.59 2009/04/05 00:22:53 uwe Exp $ */
 
 /*-
  * Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu.  All rights reserved.
@@ -93,7 +93,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.58 2009/03/18 10:22:36 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.59 2009/04/05 00:22:53 uwe Exp $");
 
 #include "opt_kgdb.h"
 #include "opt_scif.h"
@@ -494,6 +494,10 @@
 	sc->sc_ebuf = sc->sc_rbuf + (scif_rbuf_size << 1);
 
 	tty_attach(tp);
+
+	/* XXX: TODO */
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }
 
 /*



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

2009-04-04 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Apr  5 00:22:28 UTC 2009

Modified Files:
src/sys/arch/sh3/dev: adc.c

Log Message:
Register null hooks with pmf(9) for now, which is no worse than before
and allows us to test other things.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sh3/dev/adc.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/sh3/dev/adc.c
diff -u src/sys/arch/sh3/dev/adc.c:1.10 src/sys/arch/sh3/dev/adc.c:1.11
--- src/sys/arch/sh3/dev/adc.c:1.10	Tue Dec 16 22:35:25 2008
+++ src/sys/arch/sh3/dev/adc.c	Sun Apr  5 00:22:27 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: adc.c,v 1.10 2008/12/16 22:35:25 christos Exp $ */
+/*	$NetBSD: adc.c,v 1.11 2009/04/05 00:22:27 uwe Exp $ */
 
 /*
  * Copyright (c) 2003 Valeriy E. Ushakov
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: adc.c,v 1.10 2008/12/16 22:35:25 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adc.c,v 1.11 2009/04/05 00:22:27 uwe Exp $");
 
 #include 
 #include 
@@ -79,6 +79,15 @@
 	aprint_normal("\n");
 
 	config_search_ia(adc_search, self, "adc", NULL);
+
+	/*
+	 * XXX: TODO: provide hooks to manage power.  For now register
+	 * null hooks which is no worse than before.
+	 *
+	 * NB: ADC registers are reset by standby!
+	 */
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }
 
 



CVS commit: src/sys/arch/hpcsh/hpcsh

2009-04-04 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat Apr  4 23:45:24 UTC 2009

Modified Files:
src/sys/arch/hpcsh/hpcsh: mainbus.c

Log Message:
Register with pmf(9), tell it we don't need anything.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/hpcsh/hpcsh/mainbus.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/hpcsh/hpcsh/mainbus.c
diff -u src/sys/arch/hpcsh/hpcsh/mainbus.c:1.19 src/sys/arch/hpcsh/hpcsh/mainbus.c:1.20
--- src/sys/arch/hpcsh/hpcsh/mainbus.c:1.19	Mon Apr 28 20:23:22 2008
+++ src/sys/arch/hpcsh/hpcsh/mainbus.c	Sat Apr  4 23:45:24 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.19 2008/04/28 20:23:22 martin Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.20 2009/04/04 23:45:24 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.19 2008/04/28 20:23:22 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.20 2009/04/04 23:45:24 uwe Exp $");
 
 #include 
 #include 
@@ -70,6 +70,9 @@
 
 	/* APM */
 	config_found_ia(self, "hpcapmif", NULL, mainbus_print);
+
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }
 
 static int



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

2009-04-04 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sun Apr  5 00:17:57 UTC 2009

Modified Files:
src/sys/arch/sh3/dev: rtc.c

Log Message:
Register with pmf(9), tell it we don't need anything.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sh3/dev/rtc.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/sh3/dev/rtc.c
diff -u src/sys/arch/sh3/dev/rtc.c:1.6 src/sys/arch/sh3/dev/rtc.c:1.7
--- src/sys/arch/sh3/dev/rtc.c:1.6	Tue Dec 16 22:35:25 2008
+++ src/sys/arch/sh3/dev/rtc.c	Sun Apr  5 00:17:56 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtc.c,v 1.6 2008/12/16 22:35:25 christos Exp $ */
+/*	$NetBSD: rtc.c,v 1.7 2009/04/05 00:17:56 uwe Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtc.c,v 1.6 2008/12/16 22:35:25 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtc.c,v 1.7 2009/04/05 00:17:56 uwe Exp $");
 
 #include 
 #include 
@@ -127,6 +127,9 @@
 		rtc_gettime_ymdhms(&sc->sc_todr, &dt);
 	}
 #endif
+
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }
 
 



CVS commit: [netbsd-5] src/dist/nvi/vi

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 23:47:47 UTC 2009

Modified Files:
src/dist/nvi/vi [netbsd-5]: v_at.c

Log Message:
Pull up following revision(s) (requested by jld in ticket #668):
dist/nvi/vi/v_at.c: revision 1.3
Make vi's '@' command work again; a precedence warning fix in r1.2 added
parens in the wrong place such that '@' did nothing.  Needs pullup to -5.
Reported by Ed Ravin; fixes PR 41134.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2.6.1 -r1.1.1.2.6.2 src/dist/nvi/vi/v_at.c

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

Modified files:

Index: src/dist/nvi/vi/v_at.c
diff -u src/dist/nvi/vi/v_at.c:1.1.1.2.6.1 src/dist/nvi/vi/v_at.c:1.1.1.2.6.2
--- src/dist/nvi/vi/v_at.c:1.1.1.2.6.1	Tue Jan 20 02:41:13 2009
+++ src/dist/nvi/vi/v_at.c	Sat Apr  4 23:47:47 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: v_at.c,v 1.1.1.2.6.1 2009/01/20 02:41:13 snj Exp $ */
+/*	$NetBSD: v_at.c,v 1.1.1.2.6.2 2009/04/04 23:47:47 snj Exp $ */
 
 /*-
  * Copyright (c) 1992, 1993, 1994
@@ -94,9 +94,9 @@
 	for (tp = cbp->textq.cqh_last;
 	tp != (void *)&cbp->textq; tp = tp->q.cqe_prev) {
 		static CHAR_T nl[] = { '\n', 0 };
-		if ((F_ISSET(cbp, CB_LMODE) ||
-		((tp->q.cqe_next != (void *)&cbp->textq) &&
-		v_event_push(sp, NULL, nl, 1, 0))) ||
+		if (((F_ISSET(cbp, CB_LMODE) ||
+		tp->q.cqe_next != (void *)&cbp->textq) &&
+		v_event_push(sp, NULL, nl, 1, 0)) ||
 		v_event_push(sp, NULL, tp->lb, tp->len, 0))
 			return (1);
 	}



CVS commit: [netbsd-5] src/usr.sbin/envstat

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 23:40:22 UTC 2009

Modified Files:
src/usr.sbin/envstat [netbsd-5]: envstat.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #666):
usr.sbin/envstat/envstat.c: revision 1.72
fix pasto: don't print the critcap when the warncap was asked. Also off by
one in length. From Anon-Ymous.
XXX: Should pull up to 5.0


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.70.4.1 src/usr.sbin/envstat/envstat.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/envstat/envstat.c
diff -u src/usr.sbin/envstat/envstat.c:1.70 src/usr.sbin/envstat/envstat.c:1.70.4.1
--- src/usr.sbin/envstat/envstat.c:1.70	Fri Aug 22 11:27:50 2008
+++ src/usr.sbin/envstat/envstat.c	Sat Apr  4 23:40:22 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: envstat.c,v 1.70 2008/08/22 11:27:50 pgoyette Exp $ */
+/* $NetBSD: envstat.c,v 1.70.4.1 2009/04/04 23:40:22 snj Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -27,7 +27,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: envstat.c,v 1.70 2008/08/22 11:27:50 pgoyette Exp $");
+__RCSID("$NetBSD: envstat.c,v 1.70.4.1 2009/04/04 23:40:22 snj Exp $");
 #endif /* not lint */
 
 #include 
@@ -981,9 +981,9 @@
 		ilen = 16 + 1;
 	}
 	if (sensor->warncap_value) {
-		ilen = 24 + 2;
+		ilen = 24 + 2 - 1;
 		(void)printf("%*.2f%% ", (int)ilen,
-		(sensor->critcap_value * 100.0) /
+		(sensor->warncap_value * 100.0) /
 		sensor->max_value);
 		ilen = 8;
 	}
@@ -1006,7 +1006,7 @@
 	}
 
 	if (sensor->critcap_value) {
-		ilen = 24 + 2;
+		ilen = 24 + 2 - 1;
 		(void)printf("%*.2f%% ", (int)ilen,
 		(sensor->critcap_value * 100.0) /
 		sensor->max_value);



CVS commit: [netbsd-5] src/doc

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 23:56:06 UTC 2009

Modified Files:
src/doc [netbsd-5]: CHANGES-5.0

Log Message:
Tickets 658, 661, and 666-668.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.126 -r1.1.2.127 src/doc/CHANGES-5.0

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

Modified files:

Index: src/doc/CHANGES-5.0
diff -u src/doc/CHANGES-5.0:1.1.2.126 src/doc/CHANGES-5.0:1.1.2.127
--- src/doc/CHANGES-5.0:1.1.2.126	Sat Apr  4 18:28:14 2009
+++ src/doc/CHANGES-5.0	Sat Apr  4 23:56:06 2009
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.0,v 1.1.2.126 2009/04/04 18:28:14 snj Exp $
+# $NetBSD: CHANGES-5.0,v 1.1.2.127 2009/04/04 23:56:06 snj Exp $
 
 A complete list of changes from the initial NetBSD 5.0 branch on October 2008
 until the 5.0 release:
@@ -5816,3 +5816,68 @@
 	is positive.
 	[plunky, ticket #665]
 
+sys/dev/ccd.c	1.133 via patch
+sys/dev/ccdvar.h1.31
+
+	Fix problems with ccd:
+	- Pending async I/O was tossed on unconfigure
+	- It could exhaust memory under heavy I/O load.
+	- If memory allocation failed, disk transfers could stall.
+	- v_numoutput was updated without v_interlock held.
+
+	Additionally:
+	- Make it MPSAFE.
+	- Use kmem_alloc().
+	[ad, ticket #658]
+
+sys/arch/xen/xen/xenevt.c			1.32
+sys/compat/svr4/svr4_net.c			1.56
+sys/compat/svr4_32/svr4_32_net.c		1.19
+sys/dev/dmover/dmover_io.c			1.32
+sys/dev/putter/putter.c1.21
+sys/kern/kern_descrip.c1.190
+sys/kern/kern_drvctl.c1.23
+sys/kern/kern_event.c1.64
+sys/kern/sys_mqueue.c1.14
+sys/kern/sys_pipe.c1.109
+sys/kern/sys_socket.c1.59
+sys/kern/uipc_socket.c1.188
+sys/kern/uipc_syscalls.c			1.136
+sys/kern/vfs_vnops.c1.164
+sys/net/bpf.c	1.144
+sys/net/if_tap.c1.55
+sys/opencrypto/cryptodev.c			1.47
+sys/sys/file.h	1.67
+sys/sys/param.h	patch
+sys/sys/socketvar.h1.119
+
+	Add fileops::fo_drain(), to be called from fd_close() when
+	there is more than one active reference to a file descriptor.
+	It should dislodge threads sleeping while holding a reference
+	to the descriptor. For now, only implemented for sockets.
+
+	Fixes the case of a multithreaded process doing something like
+	the following, which would have hung until the process got a
+	signal.
+	thr0	accept(fd, ...)
+	thr1	close(fd)
+	[ad, ticket #661]
+
+usr.sbin/envstat/envstat.c			1.72
+
+	Fix pasto: don't print the critcap when the warncap was asked.
+	Also fix an off by one in length.
+	[christos, ticket #666]
+
+libexec/makewhatis/makewhatis.c			1.47
+
+	Fix false positive in duplicate detection.
+	[apb, ticket #667]
+
+dist/nvi/vi/v_at.c1.3
+
+	Make vi's '@' command work again; a precedence warning fix in
+	r1.2 added parens in the wrong place such that '@' did nothing.
+	Fixes PR 41134.
+	[jld, ticket #668]
+



CVS commit: [netbsd-5] src/libexec/makewhatis

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 23:42:49 UTC 2009

Modified Files:
src/libexec/makewhatis [netbsd-5]: makewhatis.c

Log Message:
Pull up following revision(s) (requested by apb in ticket #667):
libexec/makewhatis/makewhatis.c: revision 1.47
In addwhatis(), two items should not be treated as duplicates unless
both the "data" and "prefix" elements are identical.  For example, the
two lines
amiga/boot (8) - system bootstrapping procedures
amd64/boot (8) - system bootstrapping procedures
both appear with data = "boot (8) - system bootstrapping procedures" but
with different values for prefix, and we do not want to reject one of
them as a duplicate.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.44.4.1 src/libexec/makewhatis/makewhatis.c

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

Modified files:

Index: src/libexec/makewhatis/makewhatis.c
diff -u src/libexec/makewhatis/makewhatis.c:1.44 src/libexec/makewhatis/makewhatis.c:1.44.4.1
--- src/libexec/makewhatis/makewhatis.c:1.44	Sun Jul 20 01:09:07 2008
+++ src/libexec/makewhatis/makewhatis.c	Sat Apr  4 23:42:48 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: makewhatis.c,v 1.44 2008/07/20 01:09:07 lukem Exp $	*/
+/*	$NetBSD: makewhatis.c,v 1.44.4.1 2009/04/04 23:42:48 snj Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #if !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1999\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: makewhatis.c,v 1.44 2008/07/20 01:09:07 lukem Exp $");
+__RCSID("$NetBSD: makewhatis.c,v 1.44.4.1 2009/04/04 23:42:48 snj Exp $");
 #endif /* not lint */
 
 #include 
@@ -477,6 +477,7 @@
 
 	while ((wi = *tree) != NULL) {
 		result = strcmp(data, wi->wi_data);
+		if (result == 0) result = strcmp(prefix, wi->wi_prefix);
 		if (result == 0) return;
 		tree = result < 0 ? &wi->wi_left : &wi->wi_right;
 	}



CVS commit: [netbsd-5] src/sys

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 23:36:28 UTC 2009

Modified Files:
src/sys/arch/xen/xen [netbsd-5]: xenevt.c
src/sys/compat/svr4 [netbsd-5]: svr4_net.c
src/sys/compat/svr4_32 [netbsd-5]: svr4_32_net.c
src/sys/dev/dmover [netbsd-5]: dmover_io.c
src/sys/dev/putter [netbsd-5]: putter.c
src/sys/kern [netbsd-5]: kern_descrip.c kern_drvctl.c kern_event.c
sys_mqueue.c sys_pipe.c sys_socket.c uipc_socket.c uipc_syscalls.c
vfs_vnops.c
src/sys/net [netbsd-5]: bpf.c if_tap.c
src/sys/opencrypto [netbsd-5]: cryptodev.c
src/sys/sys [netbsd-5]: file.h param.h socketvar.h

Log Message:
Pull up following revision(s) (requested by ad in ticket #661):
sys/arch/xen/xen/xenevt.c: revision 1.32
sys/compat/svr4/svr4_net.c: revision 1.56
sys/compat/svr4_32/svr4_32_net.c: revision 1.19
sys/dev/dmover/dmover_io.c: revision 1.32
sys/dev/putter/putter.c: revision 1.21
sys/kern/kern_descrip.c: revision 1.190
sys/kern/kern_drvctl.c: revision 1.23
sys/kern/kern_event.c: revision 1.64
sys/kern/sys_mqueue.c: revision 1.14
sys/kern/sys_pipe.c: revision 1.109
sys/kern/sys_socket.c: revision 1.59
sys/kern/uipc_syscalls.c: revision 1.136
sys/kern/vfs_vnops.c: revision 1.164
sys/kern/uipc_socket.c: revision 1.188
sys/net/bpf.c: revision 1.144
sys/net/if_tap.c: revision 1.55
sys/opencrypto/cryptodev.c: revision 1.47
sys/sys/file.h: revision 1.67
sys/sys/param.h: patch
sys/sys/socketvar.h: revision 1.119
Add fileops::fo_drain(), to be called from fd_close() when there is more
than one active reference to a file descriptor. It should dislodge threads
sleeping while holding a reference to the descriptor. Implemented only for
sockets but should be extended to pipes, fifos, etc.
Fixes the case of a multithreaded process doing something like the
following, which would have hung until the process got a signal.
thr0accept(fd, ...)
thr1close(fd)


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.29.4.1 src/sys/arch/xen/xen/xenevt.c
cvs rdiff -u -r1.53 -r1.53.10.1 src/sys/compat/svr4/svr4_net.c
cvs rdiff -u -r1.18 -r1.18.10.1 src/sys/compat/svr4_32/svr4_32_net.c
cvs rdiff -u -r1.31 -r1.31.14.1 src/sys/dev/dmover/dmover_io.c
cvs rdiff -u -r1.16 -r1.16.4.1 src/sys/dev/putter/putter.c
cvs rdiff -u -r1.182.6.5 -r1.182.6.6 src/sys/kern/kern_descrip.c
cvs rdiff -u -r1.19.6.1 -r1.19.6.2 src/sys/kern/kern_drvctl.c
cvs rdiff -u -r1.60 -r1.60.6.1 src/sys/kern/kern_event.c
cvs rdiff -u -r1.12 -r1.12.4.1 src/sys/kern/sys_mqueue.c
cvs rdiff -u -r1.103.4.4 -r1.103.4.5 src/sys/kern/sys_pipe.c
cvs rdiff -u -r1.58 -r1.58.10.1 src/sys/kern/sys_socket.c
cvs rdiff -u -r1.177.4.1 -r1.177.4.2 src/sys/kern/uipc_socket.c
cvs rdiff -u -r1.134.4.1 -r1.134.4.2 src/sys/kern/uipc_syscalls.c
cvs rdiff -u -r1.160 -r1.160.4.1 src/sys/kern/vfs_vnops.c
cvs rdiff -u -r1.141 -r1.141.6.1 src/sys/net/bpf.c
cvs rdiff -u -r1.47.4.5 -r1.47.4.6 src/sys/net/if_tap.c
cvs rdiff -u -r1.44.8.1 -r1.44.8.2 src/sys/opencrypto/cryptodev.c
cvs rdiff -u -r1.65.6.1 -r1.65.6.2 src/sys/sys/file.h
cvs rdiff -u -r1.330.4.6 -r1.330.4.7 src/sys/sys/param.h
cvs rdiff -u -r1.116.4.1 -r1.116.4.2 src/sys/sys/socketvar.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/xen/xen/xenevt.c
diff -u src/sys/arch/xen/xen/xenevt.c:1.29 src/sys/arch/xen/xen/xenevt.c:1.29.4.1
--- src/sys/arch/xen/xen/xenevt.c:1.29	Fri Sep  5 13:37:24 2008
+++ src/sys/arch/xen/xen/xenevt.c	Sat Apr  4 23:36:27 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: xenevt.c,v 1.29 2008/09/05 13:37:24 tron Exp $  */
+/*  $NetBSD: xenevt.c,v 1.29.4.1 2009/04/04 23:36:27 snj Exp $  */
 
 /*
  * Copyright (c) 2005 Manuel Bouyer.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xenevt.c,v 1.29 2008/09/05 13:37:24 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xenevt.c,v 1.29.4.1 2009/04/04 23:36:27 snj Exp $");
 
 #include "opt_xen.h"
 #include 
@@ -80,14 +80,15 @@
 /* static int	xenevt_fkqfilter(struct file *, struct knote *); */
 
 static const struct fileops xenevt_fileops = {
-	xenevt_fread,
-	xenevt_fwrite,
-	xenevt_fioctl,
-	fnullop_fcntl,
-	xenevt_fpoll,
-	fbadop_stat,
-	xenevt_fclose,
-	/* xenevt_fkqfilter */ fnullop_kqfilter
+	.fo_read = xenevt_fread,
+	.fo_write = xenevt_fwrite,
+	.fo_ioctl = xenevt_fioctl,
+	.fo_fcntl = fnullop_fcntl,
+	.fo_poll = xenevt_fpoll,
+	.fo_stat = fbadop_stat,
+	.fo_close = xenevt_fclose,
+	.fo_kqfilter = /* xenevt_fkqfilter */ fnullop_kqfilter,
+	.fo_drain = fnullop_drain,
 };
 
 dev_type_open(xenevtopen);

Index: src/sys/compat/svr4/svr4_net.c
diff -u src/sys/compat/svr4/svr4_net.c:1.53 src/sys/compat/svr4/svr4_net.c:1.53.10.1
--- src/sys/compat/svr4/svr4_net.c:1.53	Mon Apr 28 20:23:45 2008
+++ src/sys/

CVS commit: src/external/bsd/fetch/dist/libfetch

2009-04-04 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Apr  4 23:26:06 UTC 2009

Update of /cvsroot/src/external/bsd/fetch/dist/libfetch
In directory ivanova.netbsd.org:/tmp/cvs-serv23341

Log Message:
Reimport libfetch-2.23 from pkgsrc, at least one change was lost.

Status:

Vendor Tag: PKGSRC
Release Tags:   libfetch-2-23

U src/external/bsd/fetch/dist/libfetch/common.c
U src/external/bsd/fetch/dist/libfetch/common.h
U src/external/bsd/fetch/dist/libfetch/errlist.sh
U src/external/bsd/fetch/dist/libfetch/fetch.3
U src/external/bsd/fetch/dist/libfetch/fetch.c
U src/external/bsd/fetch/dist/libfetch/fetch.cat3
U src/external/bsd/fetch/dist/libfetch/fetch.h
U src/external/bsd/fetch/dist/libfetch/file.c
U src/external/bsd/fetch/dist/libfetch/ftp.c
U src/external/bsd/fetch/dist/libfetch/ftp.errors
U src/external/bsd/fetch/dist/libfetch/http.c
U src/external/bsd/fetch/dist/libfetch/http.errors

No conflicts created by this import



CVS commit: src/distrib/alpha/instkernel/ramdisk

2009-04-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Apr  4 23:24:07 UTC 2009

Modified Files:
src/distrib/alpha/instkernel/ramdisk: list

Log Message:
Also put bootxx_ffsv2 into installation ramdisk.

XXX: is it worth to put bootxx_lfs nowadays?


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/distrib/alpha/instkernel/ramdisk/list

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

Modified files:

Index: src/distrib/alpha/instkernel/ramdisk/list
diff -u src/distrib/alpha/instkernel/ramdisk/list:1.28 src/distrib/alpha/instkernel/ramdisk/list:1.29
--- src/distrib/alpha/instkernel/ramdisk/list:1.28	Sun Mar 29 12:19:43 2009
+++ src/distrib/alpha/instkernel/ramdisk/list	Sat Apr  4 23:24:07 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: list,v 1.28 2009/03/29 12:19:43 tsutsui Exp $
+#	$NetBSD: list,v 1.29 2009/04/04 23:24:07 tsutsui Exp $
 
 SRCDIRS	bin sbin usr.bin/less usr.bin usr.sbin
 
@@ -64,6 +64,7 @@
 # we need the boot blocks /usr/mdec
 COPY	${DESTDIR}/usr/mdec/boot		usr/mdec/boot
 COPY	${DESTDIR}/usr/mdec/bootxx_ffs		usr/mdec/bootxx_ffs
+COPY	${DESTDIR}/usr/mdec/bootxx_ffsv2	usr/mdec/bootxx_ffsv2
 
 # various files that we need in /etc for the install
 COPY	${NETBSDSRCDIR}/etc/group		etc/group



CVS commit: src/sys/arch/x86/pci

2009-04-04 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Apr  4 23:13:18 UTC 2009

Modified Files:
src/sys/arch/x86/pci: ichlpcib.c

Log Message:
Restore SpeedStep settings on shutdown. Some BIOSes don't like it, if
SpeedStep is enabled and powerdown fails otherwise. Fixes PR kern/40487.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/x86/pci/ichlpcib.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/x86/pci/ichlpcib.c
diff -u src/sys/arch/x86/pci/ichlpcib.c:1.15 src/sys/arch/x86/pci/ichlpcib.c:1.16
--- src/sys/arch/x86/pci/ichlpcib.c:1.15	Tue Mar  3 06:05:28 2009
+++ src/sys/arch/x86/pci/ichlpcib.c	Sat Apr  4 23:13:18 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichlpcib.c,v 1.15 2009/03/03 06:05:28 mrg Exp $	*/
+/*	$NetBSD: ichlpcib.c,v 1.16 2009/04/04 23:13:18 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.15 2009/03/03 06:05:28 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.16 2009/04/04 23:13:18 joerg Exp $");
 
 #include 
 #include 
@@ -86,6 +86,9 @@
 	uint32_t		sc_hpet_reg;
 #endif
 
+	/* Speedstep */
+	pcireg_t		sc_pmcon_orig;
+
 	/* Power management */
 	pcireg_t		sc_pirq[2];
 	pcireg_t		sc_pmcon;
@@ -96,6 +99,7 @@
 static void lpcibattach(device_t, device_t, void *);
 static bool lpcib_suspend(device_t PMF_FN_PROTO);
 static bool lpcib_resume(device_t PMF_FN_PROTO);
+static bool lpcib_shutdown(device_t, int);
 
 static void pmtimer_configure(device_t);
 
@@ -205,6 +209,9 @@
 		return;
 	}
 
+	sc->sc_pmcon_orig = pci_conf_read(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag,
+	LPCIB_PCI_GEN_PMCON_1);
+
 	/* For ICH6 and later, always enable RCBA */
 	if (sc->sc_has_rcba) {
 		pcireg_t rcba;
@@ -241,11 +248,23 @@
 #endif
 
 	/* Install power handler */
-	if (!pmf_device_register(self, lpcib_suspend, lpcib_resume))
+	if (!pmf_device_register1(self, lpcib_suspend, lpcib_resume,
+	lpcib_shutdown))
 		aprint_error_dev(self, "couldn't establish power handler\n");
 }
 
 static bool
+lpcib_shutdown(device_t dv, int howto)
+{
+	struct lpcib_softc *sc = device_private(dv);
+
+	pci_conf_write(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag,
+	LPCIB_PCI_GEN_PMCON_1, sc->sc_pmcon_orig);
+
+	return true;
+}
+
+static bool
 lpcib_suspend(device_t dv PMF_FN_ARGS)
 {
 	struct lpcib_softc *sc = device_private(dv);



CVS commit: [netbsd-5] src/sys/dev

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 23:04:57 UTC 2009

Modified Files:
src/sys/dev [netbsd-5]: ccd.c ccdvar.h

Log Message:
Pull up following revision(s) (requested by ad in ticket #658):
sys/dev/ccd.c: revision 1.133 via patch
sys/dev/ccdvar.h: revision 1.31
Fix problems with ccd:
- Pending async I/O was tossed on unconfigure (should not happen, but..)
- It could exhaust memory under heavy I/O load.
- If memory allocation failed, disk transfers could stall.
- v_numoutput was updated without v_interlock held.
Additionally:
- Make it MPSAFE.
- Use kmem_alloc().


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.129.10.1 src/sys/dev/ccd.c
cvs rdiff -u -r1.30 -r1.30.10.1 src/sys/dev/ccdvar.h

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

Modified files:

Index: src/sys/dev/ccd.c
diff -u src/sys/dev/ccd.c:1.129 src/sys/dev/ccd.c:1.129.10.1
--- src/sys/dev/ccd.c:1.129	Mon Apr 28 20:23:46 2008
+++ src/sys/dev/ccd.c	Sat Apr  4 23:04:57 2009
@@ -1,11 +1,11 @@
-/*	$NetBSD: ccd.c,v 1.129 2008/04/28 20:23:46 martin Exp $	*/
+/*	$NetBSD: ccd.c,v 1.129.10.1 2009/04/04 23:04:57 snj Exp $	*/
 
 /*-
- * Copyright (c) 1996, 1997, 1998, 1999, 2007 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996, 1997, 1998, 1999, 2007, 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe.
+ * by Jason R. Thorpe, and by Andrew Doran.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -109,24 +109,33 @@
 /*
  * "Concatenated" disk driver.
  *
- * Dynamic configuration and disklabel support by:
- *	Jason R. Thorpe 
- *	Numerical Aerodynamic Simulation Facility
- *	Mail Stop 258-6
- *	NASA Ames Research Center
- *	Moffett Field, CA 94035
+ * Notes on concurrency:
+ *
+ * => sc_dvlock serializes access to the device nodes, excluding block I/O.
+ *
+ * => sc_iolock serializes access to (sc_flags & CCDF_INITED), disk stats,
+ *sc_stop, sc_bufq and b_resid from master buffers.
+ *
+ * => a combination of CCDF_INITED, sc_inflight, and sc_iolock is used to
+ *serialize I/O and configuration changes.
+ *
+ * => the in-core disk label does not change while the device is open.
+ *
+ * On memory consumption: ccd fans out I/O requests and so needs to
+ * allocate memory.  If the system is desperately low on memory, we
+ * single thread I/O.
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.129 2008/04/28 20:23:46 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.129.10.1 2009/04/04 23:04:57 snj Exp $");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -141,6 +150,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -169,10 +180,10 @@
 };
 
 /* component buffer pool */
-static struct pool ccd_cbufpool;
+static pool_cache_t ccd_cache;
 
-#define	CCD_GETBUF()		pool_get(&ccd_cbufpool, PR_NOWAIT)
-#define	CCD_PUTBUF(cbp)		pool_put(&ccd_cbufpool, cbp)
+#define	CCD_GETBUF()		pool_cache_get(ccd_cache, PR_WAITOK)
+#define	CCD_PUTBUF(cbp)		pool_cache_put(ccd_cache, cbp)
 
 #define CCDLABELDEV(dev)	\
 	(MAKEDISKDEV(major((dev)), ccdunit((dev)), RAW_PART))
@@ -183,9 +194,7 @@
 /* called by biodone() at interrupt time */
 static void	ccdiodone(struct buf *);
 
-static void	ccdstart(struct ccd_softc *);
 static void	ccdinterleave(struct ccd_softc *);
-static void	ccdintr(struct ccd_softc *, struct buf *);
 static int	ccdinit(struct ccd_softc *, char **, struct vnode **,
 		struct lwp *);
 static struct ccdbuf *ccdbuffer(struct ccd_softc *, struct buf *,
@@ -193,6 +202,8 @@
 static void	ccdgetdefaultlabel(struct ccd_softc *, struct disklabel *);
 static void	ccdgetdisklabel(dev_t);
 static void	ccdmakedisklabel(struct ccd_softc *);
+static void	ccdstart(struct ccd_softc *);
+static void	ccdthread(void *);
 
 static dev_type_open(ccdopen);
 static dev_type_close(ccdclose);
@@ -200,16 +211,30 @@
 static dev_type_write(ccdwrite);
 static dev_type_ioctl(ccdioctl);
 static dev_type_strategy(ccdstrategy);
-static dev_type_dump(ccddump);
 static dev_type_size(ccdsize);
 
 const struct bdevsw ccd_bdevsw = {
-	ccdopen, ccdclose, ccdstrategy, ccdioctl, ccddump, ccdsize, D_DISK
+	.d_open = ccdopen,
+	.d_close = ccdclose,
+	.d_strategy = ccdstrategy,
+	.d_ioctl = ccdioctl,
+	.d_dump = nodump,
+	.d_psize = ccdsize,
+	.d_flag = D_DISK | D_MPSAFE
 };
 
 const struct cdevsw ccd_cdevsw = {
-	ccdopen, ccdclose, ccdread, ccdwrite, ccdioctl,
-	nostop, notty, nopoll, nommap, nokqfilter, D_DISK
+	.d_open = ccdopen,
+	.d_close = ccdclose,
+	.d_read = ccdread,
+	.d_write = ccdwrite,
+	.d_ioctl = ccdioctl,
+	.d_stop = nostop,
+	.d_tty = notty,
+	.d_poll = nopoll,
+	.d_mmap = nommap,
+	.d_kqfilter = nokqfilter,
+	.d_f

CVS commit: src/sys/kern

2009-04-04 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Apr  4 22:34:03 UTC 2009

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

Log Message:
Update the big comment block.


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/sys/kern/kern_lwp.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_lwp.c
diff -u src/sys/kern/kern_lwp.c:1.128 src/sys/kern/kern_lwp.c:1.129
--- src/sys/kern/kern_lwp.c:1.128	Tue Mar  3 21:55:06 2009
+++ src/sys/kern/kern_lwp.c	Sat Apr  4 22:34:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lwp.c,v 1.128 2009/03/03 21:55:06 rmind Exp $	*/
+/*	$NetBSD: kern_lwp.c,v 1.129 2009/04/04 22:34:03 ad Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -86,7 +86,7 @@
  *	LSZOMB:
  *
  *		Dead or dying: the LWP has released most of its resources
- *		and is: a) about to switch away into oblivion b) has already
+ *		and is about to switch away into oblivion, or has already
  *		switched away.  When it switches away, its few remaining
  *		resources can be collected.
  *
@@ -121,22 +121,23 @@
  *	LWPs may transition states in the following ways:
  *
  *	 RUN ---> ONPROC		ONPROC -> RUN
- *		> STOPPED			> SLEEP
- *		> SUSPENDED			> STOPPED
+ *		> SLEEP
+ *		> STOPPED
  *		> SUSPENDED
  *		> ZOMB
+ *		> IDL (special cases)
  *
  *	 STOPPED ---> RUN		SUSPENDED --> RUN
- *	> SLEEP			> SLEEP
+ *	> SLEEP
  *
  *	 SLEEP -> ONPROC		IDL > RUN
  *		> RUN			> SUSPENDED
  *		> STOPPED			> STOPPED
- *		> SUSPENDED
+ *		> ONPROC (special cases)
  *
- *	Other state transitions are possible with kernel threads (eg
- *	ONPROC -> IDL), but only happen under tightly controlled
- *	circumstances the side effects are understood.
+ *	Some state transitions are only possible with kernel threads (eg
+ *	ONPROC -> IDL) and happen under tightly controlled circumstances
+ *	free of unwanted side effects.
  *
  * Migration
  *
@@ -162,17 +163,17 @@
  *	LSONPROC, LSZOMB:
  *
  *		Always covered by spc_lwplock, which protects running LWPs.
- *		This is a per-CPU lock.
+ *		This is a per-CPU lock and matches lwp::l_cpu.
  *
  *	LSIDL, LSRUN:
  *
  *		Always covered by spc_mutex, which protects the run queues.
- *		This is a per-CPU lock.
+ *		This is a per-CPU lock and matches lwp::l_cpu.
  *
  *	LSSLEEP:
  *
  *		Covered by a lock associated with the sleep queue that the
- *		LWP resides on.
+ *		LWP resides on.  Matches lwp::l_sleepq::sq_mutex.
  *
  *	LSSTOP, LSSUSPENDED:
  *
@@ -196,17 +197,20 @@
  *
  *		LSIDL, LSZOMB, LSSTOP, LSSUSPENDED
  *
+ *	(But not always for kernel threads.  There are some special cases
+ *	as mentioned above.  See kern_softint.c.)
+ *
  *	Note that an LWP is considered running or likely to run soon if in
  *	one of the following states.  This affects the value of p_nrlwps:
  *
  *		LSRUN, LSONPROC, LSSLEEP
  *
  *	p_lock does not need to be held when transitioning among these
- *	three states.
+ *	three states, hence p_lock is rarely taken for state transitions.
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.128 2009/03/03 21:55:06 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.129 2009/04/04 22:34:03 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_lockdebug.h"



CVS commit: src/sbin/drvctl

2009-04-04 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Apr  4 22:05:47 UTC 2009

Modified Files:
src/sbin/drvctl: drvctl.8 drvctl.c

Log Message:
If drvctl -l is used without argument, print the root device nodes.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sbin/drvctl/drvctl.8
cvs rdiff -u -r1.7 -r1.8 src/sbin/drvctl/drvctl.c

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

Modified files:

Index: src/sbin/drvctl/drvctl.8
diff -u src/sbin/drvctl/drvctl.8:1.5 src/sbin/drvctl/drvctl.8:1.6
--- src/sbin/drvctl/drvctl.8:1.5	Sat Feb 16 02:00:37 2008
+++ src/sbin/drvctl/drvctl.8	Sat Apr  4 22:05:47 2009
@@ -1,4 +1,4 @@
-.\" $NetBSD: drvctl.8,v 1.5 2008/02/16 02:00:37 dyoung Exp $
+.\" $NetBSD: drvctl.8,v 1.6 2009/04/04 22:05:47 joerg Exp $
 .\"
 .\" Copyright (c) 2004
 .\" 	Matthias Drochner.  All rights reserved.
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd Feburary 15, 2008
+.Dd April 4, 2009
 .Dt DRVCTL 8
 .Os
 .Sh NAME
@@ -41,7 +41,7 @@
 .Ar device
 .Nm
 .Fl l
-.Ar device
+.Op Ar device
 .Nm
 .Fl p
 .Ar device
@@ -78,6 +78,9 @@
 List the children of the device specified by the
 .Ar device
 argument.
+If
+.Ar device
+is not specified, query for roots of the device tree instead.
 .It Fl p
 Get the properties for the device specified by the
 .Ar device

Index: src/sbin/drvctl/drvctl.c
diff -u src/sbin/drvctl/drvctl.c:1.7 src/sbin/drvctl/drvctl.c:1.8
--- src/sbin/drvctl/drvctl.c:1.7	Mon Mar 16 13:35:37 2009
+++ src/sbin/drvctl/drvctl.c	Sat Apr  4 22:05:47 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: drvctl.c,v 1.7 2009/03/16 13:35:37 lukem Exp $ */
+/* $NetBSD: drvctl.c,v 1.8 2009/04/04 22:05:47 joerg Exp $ */
 
 /*
  * Copyright (c) 2004
@@ -49,7 +49,7 @@
 
 	fprintf(stderr, "Usage: %s -r [-a attribute] busdevice [locator ...]\n"
 	"   %s -d device\n"
-	"   %s -l device\n"
+	"   %s -l [device]\n"
 	"   %s -p device\n"
 	"   %s -Q device\n"
 	"   %s -R device\n"
@@ -104,7 +104,7 @@
 	argc -= optind;
 	argv += optind;
 
-	if (argc < 1 || mode == 0)
+	if ((argc < 1 && mode != 'l') || mode == 0)
 		usage();
 
 	fd = open(DRVCTLDEV, OPEN_MODE(mode), 0);
@@ -134,7 +134,10 @@
 			err(3, "DRVDETACHDEV");
 		break;
 	case 'l':
-		strlcpy(laa.l_devname, argv[0], sizeof(laa.l_devname));
+		if (argc == 0)
+			*laa.l_devname = '\0';
+		else
+			strlcpy(laa.l_devname, argv[0], sizeof(laa.l_devname));
 
 		if (ioctl(fd, DRVLISTDEV, &laa) == -1)
 			err(3, "DRVLISTDEV");
@@ -149,8 +152,10 @@
 		if (laa.l_children > children)
 			err(6, "DRVLISTDEV: number of children grew");
 
-		for (i = 0; i < (int)laa.l_children; i++)
-			printf("%s %s\n", laa.l_devname, laa.l_childname[i]);
+		for (i = 0; i < (int)laa.l_children; i++) {
+			printf("%s%s%s\n", laa.l_devname, (argc ? " " : ""),
+			laa.l_childname[i]);
+		}
 		break;
 	case 'r':
 		memset(&raa, 0, sizeof(raa));



CVS commit: src/usr.sbin/mtree

2009-04-04 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Sat Apr  4 21:49:49 UTC 2009

Modified Files:
src/usr.sbin/mtree: mtree.h spec.c

Log Message:
Tags are internally stored with leading and trailing commas, for ease
of using strcmp(3) to check them against inclusion or exclusion lists.
Don't output the leading or trailing commas.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/mtree/mtree.h
cvs rdiff -u -r1.69 -r1.70 src/usr.sbin/mtree/spec.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/mtree/mtree.h
diff -u src/usr.sbin/mtree/mtree.h:1.26 src/usr.sbin/mtree/mtree.h:1.27
--- src/usr.sbin/mtree/mtree.h:1.26	Sun Feb  4 08:03:18 2007
+++ src/usr.sbin/mtree/mtree.h	Sat Apr  4 21:49:49 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: mtree.h,v 1.26 2007/02/04 08:03:18 elad Exp $	*/
+/*	$NetBSD: mtree.h,v 1.27 2009/04/04 21:49:49 apb Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -59,7 +59,9 @@
 	char	*sha256digest;			/* SHA256 digest */
 	char	*sha384digest;			/* SHA384 digest */
 	char	*sha512digest;			/* SHA512 digest */
-	char	*tags;/* tags, comma delimited */
+	char	*tags;/* tags, comma delimited,
+		 * also with leading and
+		 * trailing commas */
 	size_t	lineno;/* line # entry came from */
 
 #define	F_CKSUM		0x0001		/* cksum(1) check sum */

Index: src/usr.sbin/mtree/spec.c
diff -u src/usr.sbin/mtree/spec.c:1.69 src/usr.sbin/mtree/spec.c:1.70
--- src/usr.sbin/mtree/spec.c:1.69	Fri Apr  3 21:18:59 2009
+++ src/usr.sbin/mtree/spec.c	Sat Apr  4 21:49:49 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: spec.c,v 1.69 2009/04/03 21:18:59 apb Exp $	*/
+/*	$NetBSD: spec.c,v 1.70 2009/04/04 21:49:49 apb Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -67,7 +67,7 @@
 #if 0
 static char sccsid[] = "@(#)spec.c	8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: spec.c,v 1.69 2009/04/03 21:18:59 apb Exp $");
+__RCSID("$NetBSD: spec.c,v 1.70 2009/04/04 21:49:49 apb Exp $");
 #endif
 #endif /* not lint */
 
@@ -290,6 +290,7 @@
 	char	path[MAXPATHLEN];
 	const char *name;
 	char	*str;
+	char	*p, *q;
 
 	for (cur = root; cur != NULL; cur = cur->next) {
 		if (cur->type != F_DIR && !matchtags(cur))
@@ -358,8 +359,16 @@
 			printf("ignore ");
 		if (MATCHFLAG(F_OPT))
 			printf("optional ");
-		if (MATCHFLAG(F_TAGS))
-			printf("tags=%s ", cur->tags);
+		if (MATCHFLAG(F_TAGS)) {
+			/* don't output leading or trailing commas */
+			p = cur->tags;
+			while (*p == ',')
+p++;
+			q = p + strlen(p);
+			while(q > p && q[-1] == ',')
+q--;
+			printf("tags=%.*s ", q - p, p);
+		}
 		puts(pathlast ? vispath(path) : "");
 
 		if (cur->child)



CVS commit: src/sys/kern

2009-04-04 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Apr  4 21:49:05 UTC 2009

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

Log Message:
Allow querying for root devices in the tree by specifying an empty
device name. Ensure that l_devname is NUL-terminated and fail otherwise.
OK cube@


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/kern/kern_drvctl.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_drvctl.c
diff -u src/sys/kern/kern_drvctl.c:1.23 src/sys/kern/kern_drvctl.c:1.24
--- src/sys/kern/kern_drvctl.c:1.23	Sat Apr  4 10:12:51 2009
+++ src/sys/kern/kern_drvctl.c	Sat Apr  4 21:49:05 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_drvctl.c,v 1.23 2009/04/04 10:12:51 ad Exp $ */
+/* $NetBSD: kern_drvctl.c,v 1.24 2009/04/04 21:49:05 joerg Exp $ */
 
 /*
  * Copyright (c) 2004
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_drvctl.c,v 1.23 2009/04/04 10:12:51 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_drvctl.c,v 1.24 2009/04/04 21:49:05 joerg Exp $");
 
 #include 
 #include 
@@ -197,7 +197,11 @@
 	deviter_t di;
 	int cnt = 0, idx, error = 0;
 
-	if ((d = device_find_by_xname(l->l_devname)) == NULL)
+	if (*l->l_devname == '\0')
+		d = (device_t)NULL;
+	else if (memchr(l->l_devname, 0, sizeof(l->l_devname)) == NULL)
+		return EINVAL;
+	else if ((d = device_find_by_xname(l->l_devname)) == NULL)
 		return ENXIO;
 
 	for (child = deviter_first(&di, 0); child != NULL;



CVS commit: src/usr.sbin/envstat

2009-04-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  4 18:43:01 UTC 2009

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

Log Message:
fix pasto: don't print the critcap when the warncap was asked. Also off by
one in length. From Anon-Ymous.
XXX: Should pull up to 5.0


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/usr.sbin/envstat/envstat.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/envstat/envstat.c
diff -u src/usr.sbin/envstat/envstat.c:1.71 src/usr.sbin/envstat/envstat.c:1.72
--- src/usr.sbin/envstat/envstat.c:1.71	Sat Feb 14 11:08:22 2009
+++ src/usr.sbin/envstat/envstat.c	Sat Apr  4 14:43:01 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: envstat.c,v 1.71 2009/02/14 16:08:22 ahoka Exp $ */
+/* $NetBSD: envstat.c,v 1.72 2009/04/04 18:43:01 christos Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -27,7 +27,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: envstat.c,v 1.71 2009/02/14 16:08:22 ahoka Exp $");
+__RCSID("$NetBSD: envstat.c,v 1.72 2009/04/04 18:43:01 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -990,9 +990,9 @@
 		ilen = 16 + 1;
 	}
 	if (sensor->warncap_value) {
-		ilen = 24 + 2;
+		ilen = 24 + 2 - 1;
 		(void)printf("%*.2f%% ", (int)ilen,
-		(sensor->critcap_value * 100.0) /
+		(sensor->warncap_value * 100.0) /
 		sensor->max_value);
 		ilen = 8;
 	}
@@ -1015,7 +1015,7 @@
 	}
 
 	if (sensor->critcap_value) {
-		ilen = 24 + 2;
+		ilen = 24 + 2 - 1;
 		(void)printf("%*.2f%% ", (int)ilen,
 		(sensor->critcap_value * 100.0) /
 		sensor->max_value);



CVS commit: [netbsd-5] src/doc

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 18:28:14 UTC 2009

Modified Files:
src/doc [netbsd-5]: CHANGES-5.0

Log Message:
Tickets 651-657, 659, and 662-665.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.125 -r1.1.2.126 src/doc/CHANGES-5.0

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

Modified files:

Index: src/doc/CHANGES-5.0
diff -u src/doc/CHANGES-5.0:1.1.2.125 src/doc/CHANGES-5.0:1.1.2.126
--- src/doc/CHANGES-5.0:1.1.2.125	Fri Apr  3 18:04:06 2009
+++ src/doc/CHANGES-5.0	Sat Apr  4 18:28:14 2009
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.0,v 1.1.2.125 2009/04/03 18:04:06 snj Exp $
+# $NetBSD: CHANGES-5.0,v 1.1.2.126 2009/04/04 18:28:14 snj Exp $
 
 A complete list of changes from the initial NetBSD 5.0 branch on October 2008
 until the 5.0 release:
@@ -5686,3 +5686,133 @@
 	proxyarp setting on 64 bit hosts.
 	[christos, ticket #650]
 
+sys/kern/subr_workqueue.c			1.27
+
+	workqueue_finiqueue: our stack could be swapped out while
+	enqueued to a worker thread.
+	[ad, ticket #651]
+
+sys/dev/raidframe/rf_disks.c			1.71
+sys/dev/raidframe/rf_netbsdkintf.c		1.260
+
+	Switch various printfs from %ld and %d to PRIu64, etc. to be
+	more consistent about types.
+	[sborrill, ticket #652]
+
+sys/dev/cgd.c	1.57
+sys/dev/vnd.c	1.194, 1.195
+
+	vnd(4): handle the DIOCCACHESYNC ioctl by calling VOP_FSYNC() on
+	the underlying file.  Addresses PR 41015.
+	cgd(4): handle the DIOCCACHESYNC ioctl by passing it through
+	to the underlying disk.  Addresses PR 41016.
+	[apb, ticket #653]
+
+distrib/sets/maketars1.66
+
+	Explicitly sort entries on preparing set files from METALOG.
+	METALOG could have different order due to install(1) race
+	on parallel builds, and mtree(8) doesn't sort files.
+	[tsutsui, ticket #654]
+
+sys/ufs/ffs/ffs_vfsops.c			1.245 via patch
+sys/ufs/ffs/ffs_vnops.c1.112 via patch
+
+	fsync:
+	- atime updates were not being synced.
+	ffs_sync:
+	- In some cases the sync vnode was acting like now dead
+	/usr/sbin/update.  It was examining vnodes that it should have
+	ignored.
+	- It would find dirty inodes and try to flush them. Often
+	ffs_fsync() cheerfully ignored the flush request due to the
+	fsync bug. Such inodes remained dirty and were repeatedly
+	re-examined by the syncer until vnode reclaim or system shutdown.
+	- We were marking our place in the per-mount vnode list even
+	though in most cases there was not flush to perform. While not
+	a bug, this wasted CPU cycles because a TAILQ_NEXT would have
+	sufficed.
+	[add, ticket #655]
+
+sys/arch/amd64/amd64/gdt.c			1.21 via patch
+sys/arch/amd64/amd64/machdep.c			1.129 via patch
+sys/arch/i386/i386/gdt.c			1.47 via patch
+sys/arch/i386/i386/kvm86.c			1.17 via patch
+sys/arch/i386/i386/locore.S			1.85 via patch
+sys/arch/i386/i386/machdep.c			1.666 via patch
+sys/arch/i386/i386/vector.S			1.45 via patch
+sys/arch/i386/include/pcb.h			1.47 via patch
+sys/arch/x86/include/pmap.h			1.22 via patch
+sys/arch/x86/include/sysarch.h			1.8 via patch
+sys/arch/x86/x86/pmap.c1.80 via patch
+sys/arch/x86/x86/sys_machdep.c			1.17 via patch
+sys/compat/linux/arch/i386/linux_machdep.c	1.143 via patch
+sys/kern/init_main.c1.384 via patch
+
+	Fix numerous problems:
+	1. LDT updates are not atomic.
+	2. Number of processes running with private LDTs and/or I/O
+	bitmaps is not capped. System with high maxprocs can be paniced.
+	3. LDTR can be leaked over context switch.
+	4. GDT slot allocations can race, giving the same LDT slot to
+	two procs.
+	5. Incomplete interrupt/trap frames can be stacked.
+	6. In some rare cases segment faults are not handled correctly.
+	Fixes PR port-i386/40143.
+	[ad, ticket #656]
+
+sys/kern/subr_disk.c1.95
+sys/kern/subr_iostat.c1.17
+sys/sys/disk.h	1.52
+sys/sys/iostat.h1.10
+
+	Add disk_isbusy(), iostat_isbusy().
+	[ad, ticket #657]
+
+distrib/sets/sets.subr1.82
+
+	All non-error messages printed to stderr by makeplist must
+	begin with "DEBUG:", or else regpkg assumes that they are
+	error messages.  Make the verbose messages printed by the
+	list_set_files function follow that convention.
+	Fixes PR 41077.
+	[apb, ticket #659]
+
+sys/net/if_bridge.c1.65-1.68
+sys/net/if_bridgevar.h1.14
+
+	Fix for if_start() and pfil_hook() being called from hardware
+	interrupt context (reported on various mailing-lists, and part
+	of PR kern/41114, causing panic in pf(4) and possibly ipf(4)
+	when BRIDGE_IPF is used).  Defer bridge_forward() to a software
+	interrupt; bridge_input() enqueues mbufs to ifp->if_snd which
+	is handled in bridge_forward().
+	[bouyer, ticket #660]
+
+sys/ufs/lfs/lfs_vfsops.c			1.272
+
+	Turn up the volume on the warning message a bit.
+	[ad, ticket #662]
+
+sys/fs/union/union_vfsops.c			1.59
+
+	Turn up the volume on the warning message a bit and note that
+	unionfs can corrupt the underlying file system. This is an old
+	problem but is now much easier to trig

CVS commit: [netbsd-5] src/sbin/ifconfig

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 18:22:54 UTC 2009

Modified Files:
src/sbin/ifconfig [netbsd-5]: ifconfig.c

Log Message:
Pull up following revision(s) (requested by plunky in ticket #665):
sbin/ifconfig/ifconfig.c: revision 1.215
Because the IFF_NOARP flag is a negative option it needs to be negated
when being applied from the "arp" option which itself is positive.
problem demonstrated by
# ifconfig tap3 create
# ifconfig tap3
tap3: flags=8802 mtu 1500
address: f2:0b:a4:7f:44:03
media: Ethernet autoselect
# ifconfig tap3 arp
# ifconfig tap3
tap3: flags=8882 mtu 1500
address: f2:0b:a4:7f:44:03
media: Ethernet autoselect
# ifconfig tap3 -arp
# ifconfig tap3
tap3: flags=8802 mtu 1500
address: f2:0b:a4:7f:44:03
media: Ethernet autoselect
# ifconfig tap3 destroy
#


To generate a diff of this commit:
cvs rdiff -u -r1.213 -r1.213.2.1 src/sbin/ifconfig/ifconfig.c

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

Modified files:

Index: src/sbin/ifconfig/ifconfig.c
diff -u src/sbin/ifconfig/ifconfig.c:1.213 src/sbin/ifconfig/ifconfig.c:1.213.2.1
--- src/sbin/ifconfig/ifconfig.c:1.213	Fri Aug  1 22:29:13 2008
+++ src/sbin/ifconfig/ifconfig.c	Sat Apr  4 18:22:54 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ifconfig.c,v 1.213 2008/08/01 22:29:13 dyoung Exp $	*/
+/*	$NetBSD: ifconfig.c,v 1.213.2.1 2009/04/04 18:22:54 snj Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1983, 1993\
  The Regents of the University of California.  All rights reserved.");
-__RCSID("$NetBSD: ifconfig.c,v 1.213 2008/08/01 22:29:13 dyoung Exp $");
+__RCSID("$NetBSD: ifconfig.c,v 1.213.2.1 2009/04/04 18:22:54 snj Exp $");
 #endif /* not lint */
 
 #include 
@@ -131,7 +131,7 @@
 static void usage(void);
 
 static const struct kwinst ifflagskw[] = {
-	  IFKW("arp", IFF_NOARP)
+	  IFKW("arp", -IFF_NOARP)
 	, IFKW("debug", IFF_DEBUG)
 	, IFKW("link0", IFF_LINK0)
 	, IFKW("link1", IFF_LINK1)



CVS commit: [netbsd-5] src/sys/miscfs/genfs

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 18:14:50 UTC 2009

Modified Files:
src/sys/miscfs/genfs [netbsd-5]: genfs_io.c

Log Message:
Pull up following revision(s) (requested by joerg in ticket #664):
sys/miscfs/genfs/genfs_io.c: revision 1.16
Check that the filesystem acutally uses WAPBL before initiating a
transaction for the directio case. Fixes PR 39929 and similiar issues
seen with PostgreSQL.


To generate a diff of this commit:
cvs rdiff -u -r1.13.4.1 -r1.13.4.2 src/sys/miscfs/genfs/genfs_io.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/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.13.4.1 src/sys/miscfs/genfs/genfs_io.c:1.13.4.2
--- src/sys/miscfs/genfs/genfs_io.c:1.13.4.1	Sun Nov  2 23:08:56 2008
+++ src/sys/miscfs/genfs/genfs_io.c	Sat Apr  4 18:14:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.13.4.1 2008/11/02 23:08:56 snj Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.13.4.2 2009/04/04 18:14:50 snj Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.13.4.1 2008/11/02 23:08:56 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.13.4.2 2009/04/04 18:14:50 snj Exp $");
 
 #include 
 #include 
@@ -1559,6 +1559,8 @@
 	size_t len;
 	const int mask = DEV_BSIZE - 1;
 	int error;
+	bool need_wapbl = (vp->v_mount && vp->v_mount->mnt_wapbl &&
+	(ioflag & IO_JOURNALLOCKED) == 0);
 
 	/*
 	 * We only support direct I/O to user space for now.
@@ -1580,7 +1582,7 @@
 		return;
 	}
 
-	if ((ioflag & IO_JOURNALLOCKED) == 0) {
+	if (need_wapbl) {
 		error = WAPBL_BEGIN(vp->v_mount);
 		if (error)
 			return;
@@ -1632,7 +1634,7 @@
 		uio->uio_resid -= len;
 	}
 
-	if ((ioflag & IO_JOURNALLOCKED) == 0)
+	if (need_wapbl)
 		WAPBL_END(vp->v_mount);
 }
 



CVS commit: [netbsd-5] src/sys/fs/union

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 18:12:55 UTC 2009

Modified Files:
src/sys/fs/union [netbsd-5]: union_vfsops.c

Log Message:
Pull up following revision(s) (requested by ad in ticket #663):
sys/fs/union/union_vfsops.c: revision 1.59
Turn up the volume on the warning message a bit and note that unionfs can
corrupt the underlying file system. This is an old problem but is now
much easier to trigger because VFS has gone fully multithreaded.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.57.6.1 src/sys/fs/union/union_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/union/union_vfsops.c
diff -u src/sys/fs/union/union_vfsops.c:1.57 src/sys/fs/union/union_vfsops.c:1.57.6.1
--- src/sys/fs/union/union_vfsops.c:1.57	Sat Jun 28 01:34:05 2008
+++ src/sys/fs/union/union_vfsops.c	Sat Apr  4 18:12:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_vfsops.c,v 1.57 2008/06/28 01:34:05 rumble Exp $	*/
+/*	$NetBSD: union_vfsops.c,v 1.57.6.1 2009/04/04 18:12:55 snj Exp $	*/
 
 /*
  * Copyright (c) 1994 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.57 2008/06/28 01:34:05 rumble Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.57.6.1 2009/04/04 18:12:55 snj Exp $");
 
 #include 
 #include 
@@ -149,8 +149,8 @@
 		goto bad;
 	}
 
-	printf("WARNING: the union file system is experimental and "
-	"may be unstable\n");
+	printf("WARNING: the union file system is experimental\n"
+	"WARNING: it can cause crashes and file system corruption\n");
 
 	lowerrootvp = mp->mnt_vnodecovered;
 	VREF(lowerrootvp);



CVS commit: [netbsd-5] src/sys/ufs/lfs

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 18:11:17 UTC 2009

Modified Files:
src/sys/ufs/lfs [netbsd-5]: lfs_vfsops.c

Log Message:
Pull up following revision(s) (requested by ad in ticket #662):
sys/ufs/lfs/lfs_vfsops.c: revision 1.272
Turn up the volume on the warning message a bit.


To generate a diff of this commit:
cvs rdiff -u -r1.267 -r1.267.6.1 src/sys/ufs/lfs/lfs_vfsops.c

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

Modified files:

Index: src/sys/ufs/lfs/lfs_vfsops.c
diff -u src/sys/ufs/lfs/lfs_vfsops.c:1.267 src/sys/ufs/lfs/lfs_vfsops.c:1.267.6.1
--- src/sys/ufs/lfs/lfs_vfsops.c:1.267	Sat Jun 28 15:50:20 2008
+++ src/sys/ufs/lfs/lfs_vfsops.c	Sat Apr  4 18:11:17 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_vfsops.c,v 1.267 2008/06/28 15:50:20 rumble Exp $	*/
+/*	$NetBSD: lfs_vfsops.c,v 1.267.6.1 2009/04/04 18:11:17 snj Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.267 2008/06/28 15:50:20 rumble Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.267.6.1 2009/04/04 18:11:17 snj Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_lfs.h"
@@ -1046,8 +1046,8 @@
 	lfs_writerd, NULL, NULL, "lfs_writer") != 0)
 		panic("fork lfs_writer");
 
-	printf("WARNING: the log-structured file system is experimental and "
-	"may be unstable\n");
+	printf("WARNING: the log-structured file system is experimental\n"
+	"WARNING: it may cause system crashes and/or corrupt data\n");
 
 	return (0);
 



CVS commit: [netbsd-5] src/sys/net

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 18:03:06 UTC 2009

Modified Files:
src/sys/net [netbsd-5]: if_bridge.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #660):
sys/net/if_bridge.c: revision 1.68
Fix another typo


To generate a diff of this commit:
cvs rdiff -u -r1.62.6.3 -r1.62.6.4 src/sys/net/if_bridge.c

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

Modified files:

Index: src/sys/net/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.62.6.3 src/sys/net/if_bridge.c:1.62.6.4
--- src/sys/net/if_bridge.c:1.62.6.3	Sat Apr  4 18:02:21 2009
+++ src/sys/net/if_bridge.c	Sat Apr  4 18:03:06 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.62.6.3 2009/04/04 18:02:21 snj Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.62.6.4 2009/04/04 18:03:06 snj Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.62.6.3 2009/04/04 18:02:21 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.62.6.4 2009/04/04 18:03:06 snj Exp $");
 
 #include "opt_bridge_ipf.h"
 #include "opt_inet.h"
@@ -92,7 +92,7 @@
 #include 
 #include 
 #include 
-#include  /* for softnet_lock */
+#include  /* for softnet_lock */
 #include 
 #include 
 #include 



CVS commit: [netbsd-5] src/sys/net

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 18:02:21 UTC 2009

Modified Files:
src/sys/net [netbsd-5]: if_bridge.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #660):
sys/net/if_bridge.c: revision 1.67
Fix a comment, and make it build.


To generate a diff of this commit:
cvs rdiff -u -r1.62.6.2 -r1.62.6.3 src/sys/net/if_bridge.c

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

Modified files:

Index: src/sys/net/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.62.6.2 src/sys/net/if_bridge.c:1.62.6.3
--- src/sys/net/if_bridge.c:1.62.6.2	Sat Apr  4 18:01:25 2009
+++ src/sys/net/if_bridge.c	Sat Apr  4 18:02:21 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.62.6.2 2009/04/04 18:01:25 snj Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.62.6.3 2009/04/04 18:02:21 snj Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.62.6.2 2009/04/04 18:01:25 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.62.6.3 2009/04/04 18:02:21 snj Exp $");
 
 #include "opt_bridge_ipf.h"
 #include "opt_inet.h"
@@ -92,6 +92,7 @@
 #include 
 #include 
 #include 
+#include  /* for softnet_lock */
 #include 
 #include 
 #include 
@@ -1453,7 +1454,7 @@
  *
  *	Receive input from a member interface.  Queue the packet for
  *	bridging if it is not for us.
- *	should be called at splbio()
+ *	should be called at splnet()
  */
 struct mbuf *
 bridge_input(struct ifnet *ifp, struct mbuf *m)



CVS commit: [netbsd-5] src/sys/net

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 18:01:25 UTC 2009

Modified Files:
src/sys/net [netbsd-5]: if_bridge.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #660):
sys/net/if_bridge.c: revision 1.66
Fixes from Masao Uebayashi


To generate a diff of this commit:
cvs rdiff -u -r1.62.6.1 -r1.62.6.2 src/sys/net/if_bridge.c

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

Modified files:

Index: src/sys/net/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.62.6.1 src/sys/net/if_bridge.c:1.62.6.2
--- src/sys/net/if_bridge.c:1.62.6.1	Sat Apr  4 18:00:03 2009
+++ src/sys/net/if_bridge.c	Sat Apr  4 18:01:25 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.62.6.1 2009/04/04 18:00:03 snj Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.62.6.2 2009/04/04 18:01:25 snj Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.62.6.1 2009/04/04 18:00:03 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.62.6.2 2009/04/04 18:01:25 snj Exp $");
 
 #include "opt_bridge_ipf.h"
 #include "opt_inet.h"
@@ -419,8 +419,6 @@
 	/* Tear down the routing table. */
 	bridge_rtable_fini(sc);
 
-
-
 	softint_disestablish(sc->sc_softintr);
 
 	free(sc, M_DEVBUF);
@@ -1320,10 +1318,13 @@
 	struct ether_header *eh;
 	int s;
 
-	if ((sc->sc_if.if_flags & IFF_RUNNING) == 0)
+	mutex_enter(softnet_lock);
+	if ((sc->sc_if.if_flags & IFF_RUNNING) == 0) {
+		mutex_exit(softnet_lock);
 		return;
+	}
 
-	s = splbio();
+	s = splnet();
 	while (1) {
 		IFQ_POLL(&sc->sc_if.if_snd, m);
 		if (m == NULL)
@@ -1444,6 +1445,7 @@
 		bridge_enqueue(sc, dst_if, m, 1);
 	}
 	splx(s);
+	mutex_exit(softnet_lock);
 }
 
 /*



CVS commit: [netbsd-5] src/sys/net

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 18:00:03 UTC 2009

Modified Files:
src/sys/net [netbsd-5]: if_bridge.c if_bridgevar.h

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #660):
sys/net/if_bridge.c: revision 1.65
sys/net/if_bridgevar.h: revision 1.14
Fix for if_start() and pfil_hook() being called from hardware interrupt
context (reported on various mailing-lists, and part of PR kern/41114,
causing panic in pf(4) and possibly ipf(4) when BRIDGE_IPF is used).
Defer bridge_forward() to a software interrupt; bridge_input() enqueues
mbufs to ifp->if_snd which is handled in bridge_forward().


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.62.6.1 src/sys/net/if_bridge.c
cvs rdiff -u -r1.11 -r1.11.46.1 src/sys/net/if_bridgevar.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/net/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.62 src/sys/net/if_bridge.c:1.62.6.1
--- src/sys/net/if_bridge.c:1.62	Sun Jun 15 16:37:21 2008
+++ src/sys/net/if_bridge.c	Sat Apr  4 18:00:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.62 2008/06/15 16:37:21 christos Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.62.6.1 2009/04/04 18:00:03 snj Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.62 2008/06/15 16:37:21 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.62.6.1 2009/04/04 18:00:03 snj Exp $");
 
 #include "opt_bridge_ipf.h"
 #include "opt_inet.h"
@@ -97,6 +97,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #if NBPFILTER > 0
 #include 
@@ -185,7 +186,7 @@
 static void	bridge_stop(struct ifnet *, int);
 static void	bridge_start(struct ifnet *);
 
-static void	bridge_forward(struct bridge_softc *, struct mbuf *m);
+static void	bridge_forward(void *);
 
 static void	bridge_timer(void *);
 
@@ -350,6 +351,13 @@
 	sc->sc_hold_time = BSTP_DEFAULT_HOLD_TIME;
 	sc->sc_filter_flags = 0;
 
+	/* software interrupt to do the work */
+	sc->sc_softintr = softint_establish(SOFTINT_NET, bridge_forward, sc);
+	if (sc->sc_softintr == NULL) {
+		free(sc, M_DEVBUF);
+		return ENOMEM;
+	}
+
 	/* Initialize our routing table. */
 	bridge_rtable_init(sc);
 
@@ -370,6 +378,7 @@
 	ifp->if_addrlen = 0;
 	ifp->if_dlt = DLT_EN10MB;
 	ifp->if_hdrlen = ETHER_HDR_LEN;
+	IFQ_SET_READY(&ifp->if_snd);
 
 	if_attach(ifp);
 
@@ -410,6 +419,10 @@
 	/* Tear down the routing table. */
 	bridge_rtable_fini(sc);
 
+
+
+	softint_disestablish(sc->sc_softintr);
+
 	free(sc, M_DEVBUF);
 
 	return (0);
@@ -1298,124 +1311,139 @@
  *	The forwarding function of the bridge.
  */
 static void
-bridge_forward(struct bridge_softc *sc, struct mbuf *m)
+bridge_forward(void *v)
 {
+	struct bridge_softc *sc = v;
+	struct mbuf *m;
 	struct bridge_iflist *bif;
 	struct ifnet *src_if, *dst_if;
 	struct ether_header *eh;
+	int s;
 
-	src_if = m->m_pkthdr.rcvif;
+	if ((sc->sc_if.if_flags & IFF_RUNNING) == 0)
+		return;
 
-	sc->sc_if.if_ipackets++;
-	sc->sc_if.if_ibytes += m->m_pkthdr.len;
+	s = splbio();
+	while (1) {
+		IFQ_POLL(&sc->sc_if.if_snd, m);
+		if (m == NULL)
+			break;
+		IFQ_DEQUEUE(&sc->sc_if.if_snd, m);
 
-	/*
-	 * Look up the bridge_iflist.
-	 */
-	bif = bridge_lookup_member_if(sc, src_if);
-	if (bif == NULL) {
-		/* Interface is not a bridge member (anymore?) */
-		m_freem(m);
-		return;
-	}
+		src_if = m->m_pkthdr.rcvif;
 
-	if (bif->bif_flags & IFBIF_STP) {
-		switch (bif->bif_state) {
-		case BSTP_IFSTATE_BLOCKING:
-		case BSTP_IFSTATE_LISTENING:
-		case BSTP_IFSTATE_DISABLED:
+		sc->sc_if.if_ipackets++;
+		sc->sc_if.if_ibytes += m->m_pkthdr.len;
+
+		/*
+		 * Look up the bridge_iflist.
+		 */
+		bif = bridge_lookup_member_if(sc, src_if);
+		if (bif == NULL) {
+			/* Interface is not a bridge member (anymore?) */
 			m_freem(m);
-			return;
+			continue;
 		}
-	}
 
-	eh = mtod(m, struct ether_header *);
-
-	/*
-	 * If the interface is learning, and the source
-	 * address is valid and not multicast, record
-	 * the address.
-	 */
-	if ((bif->bif_flags & IFBIF_LEARNING) != 0 &&
-	ETHER_IS_MULTICAST(eh->ether_shost) == 0 &&
-	(eh->ether_shost[0] == 0 &&
-	 eh->ether_shost[1] == 0 &&
-	 eh->ether_shost[2] == 0 &&
-	 eh->ether_shost[3] == 0 &&
-	 eh->ether_shost[4] == 0 &&
-	 eh->ether_shost[5] == 0) == 0) {
-		(void) bridge_rtupdate(sc, eh->ether_shost,
-		src_if, 0, IFBAF_DYNAMIC);
-	}
+		if (bif->bif_flags & IFBIF_STP) {
+			switch (bif->bif_state) {
+			case BSTP_IFSTATE_BLOCKING:
+			case BSTP_IFSTATE_LISTENING:
+			case BSTP_IFSTATE_DISABLED:
+m_freem(m);
+continue;
+			}
+		}
 
-	if ((bif->bif_flags & IFBIF_STP) != 0 &&
-	bif->bif_state == BSTP_IFSTATE_LEARNING) {
-		m_freem(m);
-		return;
-	}
+		eh = mtod(m, struct ether_header *);
 
-	/*
-	 * At this point, the port either doesn't participate
-	 * in spanning tree or it is in the forwarding

CVS commit: [netbsd-5] src/distrib/sets

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 17:56:13 UTC 2009

Modified Files:
src/distrib/sets [netbsd-5]: sets.subr

Log Message:
Pull up following revision(s) (requested by apb in ticket #659):
distrib/sets/sets.subr: revision 1.82
All non-error messages printed to stderr by makeplist must begin with
"DEBUG:", or else regpkg assumes that they are error messages.  Make the
verbose messages printed by the list_set_files function follow that
convention.  Fixes PR 41077 from Lloyd Parkes.


To generate a diff of this commit:
cvs rdiff -u -r1.71.2.3 -r1.71.2.4 src/distrib/sets/sets.subr

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/sets.subr
diff -u src/distrib/sets/sets.subr:1.71.2.3 src/distrib/sets/sets.subr:1.71.2.4
--- src/distrib/sets/sets.subr:1.71.2.3	Fri Jan 16 21:41:06 2009
+++ src/distrib/sets/sets.subr	Sat Apr  4 17:56:13 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: sets.subr,v 1.71.2.3 2009/01/16 21:41:06 bouyer Exp $
+#	$NetBSD: sets.subr,v 1.71.2.4 2009/04/04 17:56:13 snj Exp $
 #
 
 #
@@ -228,7 +228,7 @@
 # In each file, a record consists of a path and a System Package name,
 # separated by whitespace. E.g.,
 #
-# 	# $NetBSD: sets.subr,v 1.71.2.3 2009/01/16 21:41:06 bouyer Exp $
+# 	# $NetBSD: sets.subr,v 1.71.2.4 2009/04/04 17:56:13 snj Exp $
 # 	.			base-sys-root	[keyword[,...]]
 # 	./altroot		base-sys-root
 # 	./bin			base-sys-root
@@ -315,7 +315,7 @@
 		for l in $list; do
 			echo $l
 			if $verbose; then
-echo $l >&2
+echo >&2 "DEBUG: list_set_files: $l"
 			fi
 		done
 	done | xargs cat | ${SED} ${SUBST} | \



CVS commit: [netbsd-5] src/sys

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 17:49:21 UTC 2009

Modified Files:
src/sys/kern [netbsd-5]: subr_disk.c subr_iostat.c
src/sys/sys [netbsd-5]: disk.h iostat.h

Log Message:
Pull up following revision(s) (requested by ad in ticket #657):
sys/kern/subr_disk.c: revision 1.95
sys/kern/subr_iostat.c: revision 1.17
sys/sys/disk.h: revision 1.52
sys/sys/iostat.h: revision 1.10
Add disk_isbusy(), iostat_isbusy().


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.93.10.1 src/sys/kern/subr_disk.c
cvs rdiff -u -r1.15 -r1.15.8.1 src/sys/kern/subr_iostat.c
cvs rdiff -u -r1.51 -r1.51.10.1 src/sys/sys/disk.h
cvs rdiff -u -r1.9 -r1.9.10.1 src/sys/sys/iostat.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/subr_disk.c
diff -u src/sys/kern/subr_disk.c:1.93 src/sys/kern/subr_disk.c:1.93.10.1
--- src/sys/kern/subr_disk.c:1.93	Mon Apr 28 20:24:04 2008
+++ src/sys/kern/subr_disk.c	Sat Apr  4 17:49:21 2009
@@ -1,7 +1,7 @@
-/*	$NetBSD: subr_disk.c,v 1.93 2008/04/28 20:24:04 martin Exp $	*/
+/*	$NetBSD: subr_disk.c,v 1.93.10.1 2009/04/04 17:49:21 snj Exp $	*/
 
 /*-
- * Copyright (c) 1996, 1997, 1999, 2000 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.93 2008/04/28 20:24:04 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.93.10.1 2009/04/04 17:49:21 snj Exp $");
 
 #include 
 #include 
@@ -277,6 +277,16 @@
 }
 
 /*
+ * Return true if disk has an I/O operation in flight.
+ */
+bool
+disk_isbusy(struct disk *diskp)
+{
+
+	return iostat_isbusy(diskp->dk_stats);
+}
+
+/*
  * Set the physical blocksize of a disk, in bytes.
  * Only necessary if blocksize != DEV_BSIZE.
  */

Index: src/sys/kern/subr_iostat.c
diff -u src/sys/kern/subr_iostat.c:1.15 src/sys/kern/subr_iostat.c:1.15.8.1
--- src/sys/kern/subr_iostat.c:1.15	Tue May 20 16:03:31 2008
+++ src/sys/kern/subr_iostat.c	Sat Apr  4 17:49:21 2009
@@ -1,8 +1,8 @@
-/*	$NetBSD: subr_iostat.c,v 1.15 2008/05/20 16:03:31 ad Exp $	*/
+/*	$NetBSD: subr_iostat.c,v 1.15.8.1 2009/04/04 17:49:21 snj Exp $	*/
 /*	NetBSD: subr_disk.c,v 1.69 2005/05/29 22:24:15 christos Exp	*/
 
 /*-
- * Copyright (c) 1996, 1997, 1999, 2000 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_iostat.c,v 1.15 2008/05/20 16:03:31 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_iostat.c,v 1.15.8.1 2009/04/04 17:49:21 snj Exp $");
 
 #include 
 #include 
@@ -223,6 +223,16 @@
 }
 
 /*
+ * Return non-zero if a device has an I/O request in flight.
+ */
+bool
+iostat_isbusy(struct io_stats *stats)
+{
+
+	return stats->io_busy != 0;
+}
+
+/*
  * Increment the seek counter.  This does look almost redundant but it
  * abstracts the stats gathering.
  */

Index: src/sys/sys/disk.h
diff -u src/sys/sys/disk.h:1.51 src/sys/sys/disk.h:1.51.10.1
--- src/sys/sys/disk.h:1.51	Mon Apr 28 20:24:10 2008
+++ src/sys/sys/disk.h	Sat Apr  4 17:49:21 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: disk.h,v 1.51 2008/04/28 20:24:10 martin Exp $	*/
+/*	$NetBSD: disk.h,v 1.51.10.1 2009/04/04 17:49:21 snj Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 2004 The NetBSD Foundation, Inc.
@@ -502,6 +502,7 @@
 void	disk_destroy(struct disk *);
 void	disk_busy(struct disk *);
 void	disk_unbusy(struct disk *, long, int);
+bool	disk_isbusy(struct disk *);
 void	disk_blocksize(struct disk *, int);
 struct disk *disk_find(const char *);
 int	disk_ioctl(struct disk *, u_long, void *, int, struct lwp *);

Index: src/sys/sys/iostat.h
diff -u src/sys/sys/iostat.h:1.9 src/sys/sys/iostat.h:1.9.10.1
--- src/sys/sys/iostat.h:1.9	Mon Apr 28 20:24:10 2008
+++ src/sys/sys/iostat.h	Sat Apr  4 17:49:21 2009
@@ -1,7 +1,7 @@
-/*	$NetBSD: iostat.h,v 1.9 2008/04/28 20:24:10 martin Exp $	*/
+/*	$NetBSD: iostat.h,v 1.9.10.1 2009/04/04 17:49:21 snj Exp $	*/
 
 /*-
- * Copyright (c) 1996, 1997, 2004 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996, 1997, 2004, 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -98,6 +98,7 @@
 void	iostat_init(void);
 void	iostat_busy(struct io_stats *);
 void	iostat_unbusy(struct io_stats *, long, int);
+bool	iostat_isbusy(struct io_stats *);
 struct io_stats *iostat_find(const char *);
 struct io_stats *iostat_alloc(int32_t, void *, const char *);
 void	iostat_free(struct io_stats *);



CVS commit: [netbsd-5] src/sys

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 17:39:10 UTC 2009

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-5]: gdt.c machdep.c
src/sys/arch/i386/i386 [netbsd-5]: gdt.c kvm86.c locore.S machdep.c
svr4_sigcode.S vector.S
src/sys/arch/i386/include [netbsd-5]: pcb.h
src/sys/arch/x86/include [netbsd-5]: pmap.h sysarch.h
src/sys/arch/x86/x86 [netbsd-5]: pmap.c sys_machdep.c
src/sys/compat/linux/arch/i386 [netbsd-5]: linux_machdep.c
src/sys/kern [netbsd-5]: init_main.c

Log Message:
Pull up following revision(s) (requested by ad in ticket #656):
sys/arch/amd64/amd64/gdt.c: revision 1.21 via patch
sys/arch/amd64/amd64/machdep.c: revision 1.129 via patch
sys/arch/i386/i386/gdt.c: revision 1.47 via patch
sys/arch/i386/i386/kvm86.c: revision 1.17 via patch
sys/arch/i386/i386/locore.S: revision 1.85 via patch
sys/arch/i386/i386/machdep.c: revision 1.666 via patch
sys/arch/i386/i386/vector.S: revision 1.45 via patch
sys/arch/i386/include/pcb.h: revision 1.47 via patch
sys/arch/x86/include/pmap.h: revision 1.22 via patch
sys/arch/x86/include/sysarch.h: revision 1.8 via patch
sys/arch/x86/x86/pmap.c: revision 1.80 via patch
sys/arch/x86/x86/sys_machdep.c: revision 1.17 via patch
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.143 via patch
sys/kern/init_main.c: revision 1.384 via patch
PR port-i386/40143 Viewing an mpeg transport stream with mplayer causes crash
Fix numerous problems:
1. LDT updates are not atomic.
2. Number of processes running with private LDTs and/or I/O bitmaps
   is not capped. System with high maxprocs can be paniced.
3. LDTR can be leaked over context switch.
4. GDT slot allocations can race, giving the same LDT slot to two procs.
5. Incomplete interrupt/trap frames can be stacked.
6. In some rare cases segment faults are not handled correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.19.8.1 src/sys/arch/amd64/amd64/gdt.c
cvs rdiff -u -r1.102.4.9 -r1.102.4.10 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.45 -r1.45.10.1 src/sys/arch/i386/i386/gdt.c
cvs rdiff -u -r1.15 -r1.15.12.1 src/sys/arch/i386/i386/kvm86.c
cvs rdiff -u -r1.78.4.2 -r1.78.4.3 src/sys/arch/i386/i386/locore.S
cvs rdiff -u -r1.644.4.9 -r1.644.4.10 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.12 -r1.12.10.1 src/sys/arch/i386/i386/svr4_sigcode.S
cvs rdiff -u -r1.42.6.1 -r1.42.6.2 src/sys/arch/i386/i386/vector.S
cvs rdiff -u -r1.46 -r1.46.4.1 src/sys/arch/i386/include/pcb.h
cvs rdiff -u -r1.20 -r1.20.4.1 src/sys/arch/x86/include/pmap.h
cvs rdiff -u -r1.7 -r1.7.10.1 src/sys/arch/x86/include/sysarch.h
cvs rdiff -u -r1.74 -r1.74.4.1 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.15 -r1.15.8.1 src/sys/arch/x86/x86/sys_machdep.c
cvs rdiff -u -r1.141 -r1.141.4.1 \
src/sys/compat/linux/arch/i386/linux_machdep.c
cvs rdiff -u -r1.371.2.2 -r1.371.2.3 src/sys/kern/init_main.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/gdt.c
diff -u src/sys/arch/amd64/amd64/gdt.c:1.19 src/sys/arch/amd64/amd64/gdt.c:1.19.8.1
--- src/sys/arch/amd64/amd64/gdt.c:1.19	Sun May 11 15:32:20 2008
+++ src/sys/arch/amd64/amd64/gdt.c	Sat Apr  4 17:39:09 2009
@@ -1,11 +1,11 @@
-/*	$NetBSD: gdt.c,v 1.19 2008/05/11 15:32:20 ad Exp $	*/
+/*	$NetBSD: gdt.c,v 1.19.8.1 2009/04/04 17:39:09 snj Exp $	*/
 
 /*-
- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996, 1997, 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
- * by John T. Kohl and Charles M. Hannum.
+ * by John T. Kohl, by Charles M. Hannum, and by Andrew Doran.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.19 2008/05/11 15:32:20 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.19.8.1 2009/04/04 17:39:09 snj Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_xen.h"
@@ -47,6 +47,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -63,38 +64,11 @@
 int gdt_next;		/* next available slot for sweeping */
 int gdt_free;		/* next free slot; terminated with GNULL_SEL */
 
-kmutex_t gdt_lock_store;
-
-static inline void gdt_lock(void);
-static inline void gdt_unlock(void);
 void gdt_init(void);
 void gdt_grow(void);
 int gdt_get_slot(void);
 void gdt_put_slot(int);
 
-/*
- * Lock and unlock the GDT, to avoid races in case gdt_{ge,pu}t_slot() sleep
- * waiting for memory.
- *
- * Note that the locking done here is not sufficient for multiprocessor
- * systems.  A freshly allocated slot will still be of type SDT_SYSNULL for
- * some time after the GDT is unlocked, s

CVS commit: [netbsd-5] src/sys/ufs/ffs

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 17:38:30 UTC 2009

Modified Files:
src/sys/ufs/ffs [netbsd-5]: ffs_vfsops.c

Log Message:
Pull up following revision(s) (requested by add in ticket #655):
sys/ufs/ffs/ffs_vfsops.c: revision 1.245 via patch
fsync:
- atime updates were not being synced.
ffs_sync:
- In some cases the sync vnode was acting like now dead /usr/sbin/update.
  It was examining vnodes that it should have ignored.
- It would find dirty inodes and try to flush them. Often ffs_fsync()
  cheerfully ignored the flush request due to the fsync bug. Such inodes
  remained dirty and were repeatedly re-examined by the syncer until
  vnode reclaim or system shutdown.
- We were marking our place in the per-mount vnode list even though in
  most cases there was not flush to perform. While not a bug, this wasted
  CPU cycles because a TAILQ_NEXT would have sufficed.


To generate a diff of this commit:
cvs rdiff -u -r1.239.2.2 -r1.239.2.3 src/sys/ufs/ffs/ffs_vfsops.c

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

Modified files:

Index: src/sys/ufs/ffs/ffs_vfsops.c
diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.239.2.2 src/sys/ufs/ffs/ffs_vfsops.c:1.239.2.3
--- src/sys/ufs/ffs/ffs_vfsops.c:1.239.2.2	Fri Mar 27 17:18:17 2009
+++ src/sys/ufs/ffs/ffs_vfsops.c	Sat Apr  4 17:38:30 2009
@@ -1,11 +1,11 @@
-/*	$NetBSD: ffs_vfsops.c,v 1.239.2.2 2009/03/27 17:18:17 msaitoh Exp $	*/
+/*	$NetBSD: ffs_vfsops.c,v 1.239.2.3 2009/04/04 17:38:30 snj Exp $	*/
 
 /*-
- * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
- * by Wasabi Systems, Inc.
+ * by Wasabi Systems, Inc, and by Andrew Doran.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.239.2.2 2009/03/27 17:18:17 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.239.2.3 2009/04/04 17:38:30 snj Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1663,7 +1663,7 @@
 ffs_sync(struct mount *mp, int waitfor, kauth_cred_t cred)
 {
 	struct lwp *l = curlwp;
-	struct vnode *vp, *mvp;
+	struct vnode *vp, *mvp, *nvp;
 	struct inode *ip;
 	struct ufsmount *ump = VFSTOUFS(mp);
 	struct fs *fs;
@@ -1689,18 +1689,32 @@
 	 * NOTE: not using the TAILQ_FOREACH here since in this loop vgone()
 	 * and vclean() can be called indirectly
 	 */
-	for (vp = TAILQ_FIRST(&mp->mnt_vnodelist); vp; vp = vunmark(mvp)) {
-		vmark(mvp, vp);
+	for (vp = TAILQ_FIRST(&mp->mnt_vnodelist); vp; vp = nvp) {
+		nvp = TAILQ_NEXT(vp, v_mntvnodes);
 		/*
 		 * If the vnode that we are about to sync is no longer
 		 * associated with this mount point, start over.
 		 */
-		if (vp->v_mount != mp || vismarker(vp))
+		if (vp->v_mount != mp)
+			goto loop;
+		/*
+		 * Don't interfere with concurrent scans of this FS.
+		 */
+		if (vismarker(vp))
 			continue;
 		mutex_enter(&vp->v_interlock);
 		ip = VTOI(vp);
 
 		/*
+		 * Skip the vnode/inode if inaccessible.
+		 */
+		if (ip == NULL || (vp->v_iflag & (VI_XLOCK | VI_CLEAN)) != 0 ||
+		vp->v_type == VNON) {
+			mutex_exit(&vp->v_interlock);
+			continue;
+		}
+
+		/*
 		 * We deliberately update inode times here.  This will
 		 * prevent a massive queue of updates accumulating, only
 		 * to be handled by a call to unmount.
@@ -1709,14 +1723,16 @@
 		 * out.  Adjustment needed to allow registering vnodes for
 		 * sync when the vnode is clean, but the inode dirty.  Or
 		 * have ufs itself trickle out inode updates.
-		 */
-		if (ip == NULL || (vp->v_iflag & (VI_XLOCK | VI_CLEAN)) != 0 ||
-		vp->v_type == VNON || ((ip->i_flag &
-		(IN_ACCESS | IN_CHANGE | IN_UPDATE | IN_MODIFY |
-		IN_MODIFIED | IN_ACCESSED)) == 0 &&
-		LIST_EMPTY(&vp->v_dirtyblkhd) &&
-		UVM_OBJ_IS_CLEAN(&vp->v_uobj)))
-		{
+		 *
+		 * If doing a lazy sync, we don't care about metadata or
+		 * data updates, because they are handled by each vnode's
+		 * synclist entry.  In this case we are only interested in
+		 * writing back modified inodes.
+		 */
+		if ((ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_UPDATE |
+		IN_MODIFY | IN_MODIFIED | IN_ACCESSED)) == 0 &&
+		(waitfor == MNT_LAZY || (LIST_EMPTY(&vp->v_dirtyblkhd) &&
+		UVM_OBJ_IS_CLEAN(&vp->v_uobj {
 			mutex_exit(&vp->v_interlock);
 			continue;
 		}
@@ -1725,17 +1741,18 @@
 			mutex_exit(&vp->v_interlock);
 			continue;
 		}
+		vmark(mvp, vp);
 		mutex_exit(&mntvnode_lock);
 		error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK);
 		if (error) {
 			mutex_enter(&mntvnode_lock);
+			nvp = vunmark(mvp);
 			if (error == ENOENT) {
-(void)vunmark(mvp);
 goto loop;
 			}
 			continue;
 		}
-		if (vp->v_type == VREG && waitfor == MNT_LAZY) {

CVS commit: src/usr.sbin/cron

2009-04-04 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Apr  4 17:30:00 UTC 2009

Modified Files:
src/usr.sbin/cron: crontab.5

Log Message:
Convert to mdoc. Bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/cron/crontab.5

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/cron/crontab.5
diff -u src/usr.sbin/cron/crontab.5:1.12 src/usr.sbin/cron/crontab.5:1.13
--- src/usr.sbin/cron/crontab.5:1.12	Sat Apr  4 16:05:10 2009
+++ src/usr.sbin/cron/crontab.5	Sat Apr  4 17:29:59 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: crontab.5,v 1.12 2009/04/04 16:05:10 perry Exp $
+.\"	$NetBSD: crontab.5,v 1.13 2009/04/04 17:29:59 wiz Exp $
 .\"
 .\"/* Copyright 1988,1990,1993,1994 by Paul Vixie
 .\" * All rights reserved
@@ -19,199 +19,275 @@
 .\"
 .\" Id: crontab.5,v 2.4 1994/01/15 20:43:43 vixie Exp
 .\"
-.TH CRONTAB 5 "24 January 1994"
-.UC 4
-.SH NAME
-crontab \- tables for driving cron
-.SH DESCRIPTION
+.Dd April 4, 2009
+.Dt CRONTAB 5
+.Os
+.Sh NAME
+.Nm crontab
+.Nd tables for driving cron
+.Sh DESCRIPTION
 A
-.I crontab
+.Nm
 file contains instructions to the
-.IR cron (8)
-daemon of the general form: ``run this command at this time on this date''.
-Each user has their own crontab, and commands in any given crontab will be
-executed as the user who owns the crontab.  Uucp and News will usually have
-their own crontabs, eliminating the need for explicitly running
-.IR su (1)
+.Xr cron 8
+daemon of the general form:
+.Dq run this command at this time on this date .
+Each user has their own crontab, and commands in any given crontab
+will be executed as the user who owns the crontab.
+Uucp and News will usually have their own crontabs, eliminating
+the need for explicitly running
+.Xr su 1
 as part of a cron command.
-.PP
-Blank lines and leading spaces and tabs are ignored.  Lines whose first
-non-space character is a pound-sign (#) are comments, and are ignored.
+.Pp
+Blank lines and leading spaces and tabs are ignored.
+Lines whose first non-space character is a pound-sign
+.Pq Sq #
+are comments, and are ignored.
 Note that comments are not allowed on the same line as cron commands, since
-they will be taken to be part of the command.  Similarly, comments are not
+they will be taken to be part of the command.
+Similarly, comments are not
 allowed on the same line as environment variable settings.
-.PP
-An active line in a crontab will be either an environment setting or a cron
-command.  An environment setting is of the form,
-.PP
+.Pp
+An active line in a crontab will be either an environment setting
+or a cron command.
+An environment setting is of the form,
+.Bd -literal
 name = value
-.PP
-where the spaces around the equal-sign (=) are optional, and any subsequent
-non-leading spaces in
-.I value
+.Ed
+where the spaces around the equal-sign
+.Pq Sq =
+are optional, and any subsequent non-leading spaces in
+.Ar value
 will be part of the value assigned to
-.IR name .
+.Ar name .
 The
-.I value
-string may be placed in quotes (single or double, but matching) to preserve
-leading or trailing blanks.  The
-.I name
-string may also be placed in quotes (single or double, but matching) to preserve
-leading, trailing or inner blanks.
-.PP
-Several environment variables are set up
-automatically by the
-.IR cron (8)
+.Ar value
+string may be placed in quotes (single or double, but matching) to
+preserve leading or trailing blanks.
+The
+.Ar name
+string may also be placed in quotes (single or double, but matching)
+to preserve leading, trailing or inner blanks.
+.Pp
+Several environment variables are set up automatically by the
+.Xr cron 8
 daemon.
-SHELL is set to /bin/sh, and LOGNAME and HOME are set from the /etc/passwd
+.Ev SHELL
+is set to
+.Pa /bin/sh ,
+and
+.Ev LOGNAME
+and
+.Ev HOME
+are set from the
+.Pa /etc/passwd
 line of the crontab's owner.
-HOME and SHELL may be overridden by settings in the crontab; LOGNAME may not.
-.PP
-(Another note: the LOGNAME variable is sometimes called USER on BSD systems...
-on these systems, USER will be set also.)
-.PP
-In addition to LOGNAME, HOME, and SHELL,
-.IR cron (8)
-will look at MAILTO if it has any reason to send mail as a result of running
-commands in ``this'' crontab.  If MAILTO is defined (and non-empty), mail is
-sent to the user so named.  If MAILTO is defined but empty (MAILTO=""), no
-mail will be sent.  Otherwise mail is sent to the owner of the crontab.  This
-option is useful if you decide on /bin/mail instead of /usr/lib/sendmail as
-your mailer when you install cron -- /bin/mail doesn't do aliasing, and UUCP
-usually doesn't read its mail.
-.PP
+.Ev HOME
+and
+.Ev SHELL
+may be overridden by settings in the crontab;
+.Ev LOGNAME
+may not.
+.Pp
+(Another note: the
+.Ev LOGNAME
+variable is sometimes called
+.Ev USER
+on BSD systems...  on these systems,
+.Ev USER
+will be set also.)
+.Pp
+In additio

CVS commit: [netbsd-5] src/sys/ufs/ffs

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 17:27:16 UTC 2009

Modified Files:
src/sys/ufs/ffs [netbsd-5]: ffs_vnops.c

Log Message:
Pull up following revision(s) (requested by add in ticket #655):
sys/ufs/ffs/ffs_vfsops.c: revision 1.245 via patch
sys/ufs/ffs/ffs_vnops.c: revision 1.112 via patch
fsync:
- atime updates were not being synced.
ffs_sync:
- In some cases the sync vnode was acting like now dead /usr/sbin/update.
  It was examining vnodes that it should have ignored.
- It would find dirty inodes and try to flush them. Often ffs_fsync()
  cheerfully ignored the flush request due to the fsync bug. Such inodes
  remained dirty and were repeatedly re-examined by the syncer until
  vnode reclaim or system shutdown.
- We were marking our place in the per-mount vnode list even though in
  most cases there was not flush to perform. While not a bug, this wasted
  CPU cycles because a TAILQ_NEXT would have sufficed.


To generate a diff of this commit:
cvs rdiff -u -r1.104.4.6 -r1.104.4.7 src/sys/ufs/ffs/ffs_vnops.c

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

Modified files:

Index: src/sys/ufs/ffs/ffs_vnops.c
diff -u src/sys/ufs/ffs/ffs_vnops.c:1.104.4.6 src/sys/ufs/ffs/ffs_vnops.c:1.104.4.7
--- src/sys/ufs/ffs/ffs_vnops.c:1.104.4.6	Tue Feb 24 04:13:35 2009
+++ src/sys/ufs/ffs/ffs_vnops.c	Sat Apr  4 17:27:16 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_vnops.c,v 1.104.4.6 2009/02/24 04:13:35 snj Exp $	*/
+/*	$NetBSD: ffs_vnops.c,v 1.104.4.7 2009/04/04 17:27:16 snj Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffs_vnops.c,v 1.104.4.6 2009/02/24 04:13:35 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vnops.c,v 1.104.4.7 2009/04/04 17:27:16 snj Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -338,8 +338,8 @@
 fstrans_done(vp->v_mount);
 return error;
 			}
-			error = ffs_update(vp, NULL, NULL,
-(ap->a_flags & FSYNC_WAIT) ? UPDATE_WAIT : 0);
+			error = ffs_update(vp, NULL, NULL, UPDATE_CLOSE |
+			((ap->a_flags & FSYNC_WAIT) ? UPDATE_WAIT : 0));
 			UFS_WAPBL_END(mp);
 		}
 		if (error || (ap->a_flags & FSYNC_NOLOG) != 0) {
@@ -383,9 +383,9 @@
 		mutex_exit(&vp->v_interlock);
 	}
 
-	error = ffs_update(vp, NULL, NULL,
-	((ap->a_flags & (FSYNC_WAIT | FSYNC_DATAONLY)) == FSYNC_WAIT)
-	? UPDATE_WAIT : 0);
+	error = ffs_update(vp, NULL, NULL, UPDATE_CLOSE |
+	(((ap->a_flags & (FSYNC_WAIT | FSYNC_DATAONLY)) == FSYNC_WAIT)
+	? UPDATE_WAIT : 0));
 
 	if (error == 0 && ap->a_flags & FSYNC_CACHE) {
 		int l = 0;
@@ -462,8 +462,8 @@
 			error = UFS_WAPBL_BEGIN(mp);
 			if (error)
 return error;
-			error = ffs_update(vp, NULL, NULL,
-			(flags & FSYNC_WAIT) ? UPDATE_WAIT : 0);
+			error = ffs_update(vp, NULL, NULL, UPDATE_CLOSE |
+			((flags & FSYNC_WAIT) ? UPDATE_WAIT : 0));
 			UFS_WAPBL_END(mp);
 		}
 		if (error || (flags & FSYNC_NOLOG) != 0)
@@ -574,7 +574,7 @@
 		waitfor = 0;
 	else
 		waitfor = (flags & FSYNC_WAIT) != 0 ? UPDATE_WAIT : 0;
-	error = ffs_update(vp, NULL, NULL, waitfor);
+	error = ffs_update(vp, NULL, NULL, UPDATE_CLOSE | waitfor);
 
 	if (error == 0 && (flags & FSYNC_CACHE) != 0) {
 		(void)VOP_IOCTL(VTOI(vp)->i_devvp, DIOCCACHESYNC, &i, FWRITE,



CVS commit: [netbsd-5] src/distrib/sets

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 17:22:48 UTC 2009

Modified Files:
src/distrib/sets [netbsd-5]: maketars

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #654):
distrib/sets/maketars: revision 1.66
Explicitly sort entries on preparing set files from METALOG.
METALOG could have different order due to install(1) race
on parallel builds, and mtree(8) doesn't sort files.
Should fix inconsistent shared sets among builds as seen in
/pub/NetBSD-daily/netbsd-5/20090401Z/shared/ and
/pub/NetBSD-daily/netbsd-5/200904010002Z/shared/ dirs.
Okay'ed by s...@.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.64.6.1 src/distrib/sets/maketars

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/maketars
diff -u src/distrib/sets/maketars:1.64 src/distrib/sets/maketars:1.64.6.1
--- src/distrib/sets/maketars:1.64	Sun Mar 16 07:02:22 2008
+++ src/distrib/sets/maketars	Sat Apr  4 17:22:48 2009
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: maketars,v 1.64 2008/03/16 07:02:22 lukem Exp $
+# $NetBSD: maketars,v 1.64.6.1 2009/04/04 17:22:48 snj Exp $
 #
 # Make release tar files for some or all lists.  Usage:
 # maketars [-b] [-x] [-i installdir] [-a arch] [-m machine] [-s setsdir]
@@ -148,7 +148,8 @@
 		(
 			echo "/set uname=root gname=wheel"
 			${AWK} -f "${rundir}/join.awk" \
-"${SDIR}/flist.${setname}.full" "${metalog}"
+"${SDIR}/flist.${setname}.full" "${metalog}" \
+| ${SORT} -u
 			echo "./etc/mtree/set.${setname} type=file mode=0444"
 		) > "${setlistdir}/set.${setname}"
 		# We deliberately do not add set.${setname} to ${metalog},



CVS commit: [netbsd-5] src/sys/dev

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 17:20:00 UTC 2009

Modified Files:
src/sys/dev [netbsd-5]: vnd.c

Log Message:
Pull up following revision(s) (requested by apb in ticket #653):
sys/dev/vnd.c: revision 1.195
Add FSYNC_CACHE flag to the VOP_FSYNC() call for the DIOCCACHESYNC ioctl.
PR 41015.


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

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

Modified files:

Index: src/sys/dev/vnd.c
diff -u src/sys/dev/vnd.c:1.187.4.2 src/sys/dev/vnd.c:1.187.4.3
--- src/sys/dev/vnd.c:1.187.4.2	Sat Apr  4 17:17:38 2009
+++ src/sys/dev/vnd.c	Sat Apr  4 17:20:00 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.187.4.2 2009/04/04 17:17:38 snj Exp $	*/
+/*	$NetBSD: vnd.c,v 1.187.4.3 2009/04/04 17:20:00 snj Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.187.4.2 2009/04/04 17:17:38 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.187.4.3 2009/04/04 17:20:00 snj Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "fs_nfs.h"
@@ -1443,10 +1443,11 @@
 		memcpy(data, &newlabel, sizeof (struct olddisklabel));
 		break;
 #endif
+
 	case DIOCCACHESYNC:
 		vn_lock(vnd->sc_vp, LK_EXCLUSIVE | LK_RETRY);
 		error = VOP_FSYNC(vnd->sc_vp, vnd->sc_cred,
-		FSYNC_WAIT|FSYNC_DATAONLY, 0, 0);
+		FSYNC_WAIT | FSYNC_DATAONLY | FSYNC_CACHE, 0, 0);
 		VOP_UNLOCK(vnd->sc_vp, 0);
 		return error;
 



CVS commit: [netbsd-5] src/sys/dev

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 17:18:53 UTC 2009

Modified Files:
src/sys/dev [netbsd-5]: cgd.c

Log Message:
Pull up following revision(s) (requested by apb in ticket #653):
sys/dev/cgd.c: revision 1.57
Pass DIOCCACHESYNC ioctl down to the underlying disk.
Addresses PR 41016.


To generate a diff of this commit:
cvs rdiff -u -r1.53.4.1 -r1.53.4.2 src/sys/dev/cgd.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/cgd.c
diff -u src/sys/dev/cgd.c:1.53.4.1 src/sys/dev/cgd.c:1.53.4.2
--- src/sys/dev/cgd.c:1.53.4.1	Sun Nov 23 21:10:46 2008
+++ src/sys/dev/cgd.c	Sat Apr  4 17:18:53 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.53.4.1 2008/11/23 21:10:46 riz Exp $ */
+/* $NetBSD: cgd.c,v 1.53.4.2 2009/04/04 17:18:53 snj Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.53.4.1 2008/11/23 21:10:46 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.53.4.2 2009/04/04 17:18:53 snj Exp $");
 
 #include 
 #include 
@@ -461,6 +461,21 @@
 		}
 		ret = cgd_ioctl_clr(cs, data, l);
 		break;
+
+	case DIOCCACHESYNC:
+		/*
+		 * XXX Do we really need to care about having a writable
+		 * file descriptor here?
+		 */
+		if ((flag & FWRITE) == 0)
+			return (EBADF);
+
+		/*
+		 * We pass this call down to the underlying disk.
+		 */
+		ret = VOP_IOCTL(cs->sc_tvn, cmd, data, flag, l->l_cred);
+		break;
+
 	default:
 		ret = dk_ioctl(di, dksc, dev, cmd, data, flag, l);
 		break;



CVS commit: [netbsd-5] src/sys/dev

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 17:17:38 UTC 2009

Modified Files:
src/sys/dev [netbsd-5]: vnd.c

Log Message:
Pull up following revision(s) (requested by apb in ticket #653):
sys/dev/vnd.c: revision 1.194
PR/41015: Alan Barrett: vnd driver does not implement DIOCCACHESYNC


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

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

Modified files:

Index: src/sys/dev/vnd.c
diff -u src/sys/dev/vnd.c:1.187.4.1 src/sys/dev/vnd.c:1.187.4.2
--- src/sys/dev/vnd.c:1.187.4.1	Thu Nov 20 03:42:11 2008
+++ src/sys/dev/vnd.c	Sat Apr  4 17:17:38 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.187.4.1 2008/11/20 03:42:11 snj Exp $	*/
+/*	$NetBSD: vnd.c,v 1.187.4.2 2009/04/04 17:17:38 snj Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.187.4.1 2008/11/20 03:42:11 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.187.4.2 2009/04/04 17:17:38 snj Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "fs_nfs.h"
@@ -1004,6 +1004,7 @@
 	case DIOCKLABEL:
 	case DIOCWLABEL:
 	case DIOCGDEFLABEL:
+	case DIOCCACHESYNC:
 #ifdef __HAVE_OLD_DISKLABEL
 	case ODIOCGDINFO:
 	case ODIOCSDINFO:
@@ -1442,6 +1443,12 @@
 		memcpy(data, &newlabel, sizeof (struct olddisklabel));
 		break;
 #endif
+	case DIOCCACHESYNC:
+		vn_lock(vnd->sc_vp, LK_EXCLUSIVE | LK_RETRY);
+		error = VOP_FSYNC(vnd->sc_vp, vnd->sc_cred,
+		FSYNC_WAIT|FSYNC_DATAONLY, 0, 0);
+		VOP_UNLOCK(vnd->sc_vp, 0);
+		return error;
 
 	default:
 		return (ENOTTY);



CVS commit: [netbsd-5] src/sys/dev/raidframe

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 17:15:14 UTC 2009

Modified Files:
src/sys/dev/raidframe [netbsd-5]: rf_disks.c rf_netbsdkintf.c

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #652):
sys/dev/raidframe/rf_disks.c: revision 1.71
sys/dev/raidframe/rf_netbsdkintf.c: revision 1.260
Switch various printfs from %ld and %d to PRIu64, etc. to be more consistent
about types (for instance uint32_t was being printed with %d).


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.70.10.1 src/sys/dev/raidframe/rf_disks.c
cvs rdiff -u -r1.250.4.3 -r1.250.4.4 src/sys/dev/raidframe/rf_netbsdkintf.c

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

Modified files:

Index: src/sys/dev/raidframe/rf_disks.c
diff -u src/sys/dev/raidframe/rf_disks.c:1.70 src/sys/dev/raidframe/rf_disks.c:1.70.10.1
--- src/sys/dev/raidframe/rf_disks.c:1.70	Mon Apr 28 20:23:56 2008
+++ src/sys/dev/raidframe/rf_disks.c	Sat Apr  4 17:15:14 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_disks.c,v 1.70 2008/04/28 20:23:56 martin Exp $	*/
+/*	$NetBSD: rf_disks.c,v 1.70.10.1 2009/04/04 17:15:14 snj Exp $	*/
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -60,7 +60,7 @@
  ***/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rf_disks.c,v 1.70 2008/04/28 20:23:56 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_disks.c,v 1.70.10.1 2009/04/04 17:15:14 snj Exp $");
 
 #include 
 
@@ -143,9 +143,9 @@
 		} else {
 			if (disks[c].numBlocks < min_numblks)
 min_numblks = disks[c].numBlocks;
-			DPRINTF6("Disk at col %d: dev %s numBlocks %ld blockSize %d (%ld MB)\n",
+			DPRINTF6("Disk at col %d: dev %s numBlocks %" PRIu64 " blockSize %d (%ld MB)\n",
  c, disks[c].devname,
- (long int) disks[c].numBlocks,
+ disks[c].numBlocks,
  disks[c].blockSize,
  (long int) disks[c].numBlocks *
  disks[c].blockSize / 1024 / 1024);
@@ -253,9 +253,9 @@
 		} else {
 			disks[i].status = rf_ds_spare;	/* change status to
 			 * spare */
-			DPRINTF6("Spare Disk %d: dev %s numBlocks %ld blockSize %d (%ld MB)\n", i,
+			DPRINTF6("Spare Disk %d: dev %s numBlocks %" PRIu64 " blockSize %d (%ld MB)\n", i,
 			disks[i].devname,
-			(long int) disks[i].numBlocks, disks[i].blockSize,
+			disks[i].numBlocks, disks[i].blockSize,
 			(long int) disks[i].numBlocks *
  disks[i].blockSize / 1024 / 1024);
 		}
@@ -271,17 +271,17 @@
 			goto fail;
 		}
 		if (disks[i].numBlocks < raidPtr->sectorsPerDisk) {
-			RF_ERRORMSG3("Spare disk %s (%d blocks) is too small to serve as a spare (need %ld blocks)\n",
+			RF_ERRORMSG3("Spare disk %s (%d blocks) is too small to serve as a spare (need %" PRIu64 " blocks)\n",
  disks[i].devname, disks[i].blockSize,
- (long int) raidPtr->sectorsPerDisk);
+ raidPtr->sectorsPerDisk);
 			ret = EINVAL;
 			goto fail;
 		} else
 			if (disks[i].numBlocks > raidPtr->sectorsPerDisk) {
-RF_ERRORMSG3("Warning: truncating spare disk %s to %ld blocks (from %ld)\n",
+RF_ERRORMSG3("Warning: truncating spare disk %s to %" PRIu64 " blocks (from %" PRIu64 ")\n",
 disks[i].devname,
-(long int) raidPtr->sectorsPerDisk,
-(long int) disks[i].numBlocks);
+raidPtr->sectorsPerDisk,
+disks[i].numBlocks);
 
 disks[i].numBlocks = raidPtr->sectorsPerDisk;
 			}
@@ -980,9 +980,10 @@
 		goto fail;
 	} else {
 		disks[spare_number].status = rf_ds_spare;
-		DPRINTF6("Spare Disk %d: dev %s numBlocks %ld blockSize %d (%ld MB)\n", spare_number,
+		DPRINTF6("Spare Disk %d: dev %s numBlocks %" PRIu64 " blockSize %d (%ld MB)\n",
+			 spare_number,
 			 disks[spare_number].devname,
-			 (long int) disks[spare_number].numBlocks,
+			 disks[spare_number].numBlocks,
 			 disks[spare_number].blockSize,
 			 (long int) disks[spare_number].numBlocks *
 			 disks[spare_number].blockSize / 1024 / 1024);
@@ -998,20 +999,20 @@
 		goto fail;
 	}
 	if (disks[spare_number].numBlocks < raidPtr->sectorsPerDisk) {
-		RF_ERRORMSG3("Spare disk %s (%d blocks) is too small to serve as a spare (need %ld blocks)\n",
+		RF_ERRORMSG3("Spare disk %s (%d blocks) is too small to serve as a spare (need %" PRIu64 " blocks)\n",
 			 disks[spare_number].devname,
 			 disks[spare_number].blockSize,
-			 (long int) raidPtr->sectorsPerDisk);
+			 raidPtr->sectorsPerDisk);
 		rf_close_component(raidPtr, raidPtr->raid_cinfo[raidPtr->numCol+spare_number].ci_vp, 0);
 		ret = EINVAL;
 		goto fail;
 	} else {
 		if (disks[spare_number].numBlocks >
 		raidPtr->sectorsPerDisk) {
-			RF_ERRORMSG3("Warning: truncating spare disk %s to %ld blocks (from %ld)\n",
+			RF_ERRORMSG3("Warning: truncating spare disk %s to %" PRIu64 " blocks (from %" PRIu64 ")\n",
 			disks[spare_number].devname,
-			(long int) raidPtr->sectorsPerDisk,
-			(long int) disks[spare_nu

CVS commit: src/sbin/ifconfig

2009-04-04 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Sat Apr  4 17:10:20 UTC 2009

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

Log Message:
Because the IFF_NOARP flag is a negative option it needs to be negated
when being applied from the "arp" option which itself is positive.

problem demonstrated by

# ifconfig tap3 create
# ifconfig tap3
tap3: flags=8802 mtu 1500
address: f2:0b:a4:7f:44:03
media: Ethernet autoselect
# ifconfig tap3 arp
# ifconfig tap3
tap3: flags=8882 mtu 1500
address: f2:0b:a4:7f:44:03
media: Ethernet autoselect
# ifconfig tap3 -arp
# ifconfig tap3
tap3: flags=8802 mtu 1500
address: f2:0b:a4:7f:44:03
media: Ethernet autoselect
# ifconfig tap3 destroy
#


To generate a diff of this commit:
cvs rdiff -u -r1.214 -r1.215 src/sbin/ifconfig/ifconfig.c

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

Modified files:

Index: src/sbin/ifconfig/ifconfig.c
diff -u src/sbin/ifconfig/ifconfig.c:1.214 src/sbin/ifconfig/ifconfig.c:1.215
--- src/sbin/ifconfig/ifconfig.c:1.214	Sun Jan 18 00:24:29 2009
+++ src/sbin/ifconfig/ifconfig.c	Sat Apr  4 17:10:19 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ifconfig.c,v 1.214 2009/01/18 00:24:29 lukem Exp $	*/
+/*	$NetBSD: ifconfig.c,v 1.215 2009/04/04 17:10:19 plunky Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1983, 1993\
  The Regents of the University of California.  All rights reserved.");
-__RCSID("$NetBSD: ifconfig.c,v 1.214 2009/01/18 00:24:29 lukem Exp $");
+__RCSID("$NetBSD: ifconfig.c,v 1.215 2009/04/04 17:10:19 plunky Exp $");
 #endif /* not lint */
 
 #include 
@@ -131,7 +131,7 @@
 static void usage(void);
 
 static const struct kwinst ifflagskw[] = {
-	  IFKW("arp", IFF_NOARP)
+	  IFKW("arp", -IFF_NOARP)
 	, IFKW("debug", IFF_DEBUG)
 	, IFKW("link0", IFF_LINK0)
 	, IFKW("link1", IFF_LINK1)



CVS commit: [netbsd-5] src/sys/kern

2009-04-04 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr  4 16:58:26 UTC 2009

Modified Files:
src/sys/kern [netbsd-5]: subr_workqueue.c

Log Message:
Pull up following revision(s) (requested by ad in ticket #651):
sys/kern/subr_workqueue.c: revision 1.27
workqueue_finiqueue: our stack could be swapped out while enqueued to
a worker thread.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.4.1 src/sys/kern/subr_workqueue.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_workqueue.c
diff -u src/sys/kern/subr_workqueue.c:1.26 src/sys/kern/subr_workqueue.c:1.26.4.1
--- src/sys/kern/subr_workqueue.c:1.26	Mon Sep 15 10:43:29 2008
+++ src/sys/kern/subr_workqueue.c	Sat Apr  4 16:58:25 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_workqueue.c,v 1.26 2008/09/15 10:43:29 rmind Exp $	*/
+/*	$NetBSD: subr_workqueue.c,v 1.26.4.1 2009/04/04 16:58:25 snj Exp $	*/
 
 /*-
  * Copyright (c)2002, 2005, 2006, 2007 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.26 2008/09/15 10:43:29 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.26.4.1 2009/04/04 16:58:25 snj Exp $");
 
 #include 
 #include 
@@ -40,6 +40,8 @@
 #include 
 #include 
 
+#include 
+
 typedef struct work_impl {
 	SIMPLEQ_ENTRY(work_impl) wk_entry;
 } work_impl_t;
@@ -203,12 +205,15 @@
 workqueue_finiqueue(struct workqueue *wq, struct workqueue_queue *q)
 {
 	struct workqueue_exitargs wqe;
+	lwp_t *l;
 
 	KASSERT(wq->wq_func == workqueue_exit);
 
 	wqe.wqe_q = q;
 	KASSERT(SIMPLEQ_EMPTY(&q->q_queue));
 	KASSERT(q->q_worker != NULL);
+	l = curlwp;
+	uvm_lwp_hold(l);	
 	mutex_enter(&q->q_mutex);
 	SIMPLEQ_INSERT_TAIL(&q->q_queue, &wqe.wqe_wk, wk_entry);
 	cv_signal(&q->q_cv);
@@ -216,6 +221,7 @@
 		cv_wait(&q->q_cv, &q->q_mutex);
 	}
 	mutex_exit(&q->q_mutex);
+	uvm_lwp_rele(l);	
 	mutex_destroy(&q->q_mutex);
 	cv_destroy(&q->q_cv);
 }



CVS commit: src/usr.sbin/cron

2009-04-04 Thread Perry E. Metzger
Module Name:src
Committed By:   perry
Date:   Sat Apr  4 16:05:10 UTC 2009

Modified Files:
src/usr.sbin/cron: crontab.5 entry.c

Log Message:
New feature: "?" for time specifications, means a single time selected at
random from within the range at file read time. Very useful if you
want to avoid having a fleet of machines melt a server by all trying to
contact it at a precise time every morning. See docs for details.

Reviewed by: christos, apb, vixie, others.

XXX apb suggests, quite reasonably, that ?10-16/2 should mean
something like 10,12,14,16 or 11,13,15. I'm too lazy to do it right
now, but it should be done.

XXX vixie suggests, quite reasonably, that if you're using "?" one
should delay randomly by 0-59 seconds. In the modern NTP world, you
could imagine that with a million well synchronized machines the
second just at the minute would be hit quite hard. I'm too lazy to do
it right now, but it should be done.

XXX cron needs to be updated to Vixie's cron 4.1 code.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/cron/crontab.5
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/cron/entry.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/cron/crontab.5
diff -u src/usr.sbin/cron/crontab.5:1.11 src/usr.sbin/cron/crontab.5:1.12
--- src/usr.sbin/cron/crontab.5:1.11	Thu Sep  2 11:41:27 2004
+++ src/usr.sbin/cron/crontab.5	Sat Apr  4 16:05:10 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: crontab.5,v 1.11 2004/09/02 11:41:27 jmmv Exp $
+.\"	$NetBSD: crontab.5,v 1.12 2009/04/04 16:05:10 perry Exp $
 .\"
 .\"/* Copyright 1988,1990,1993,1994 by Paul Vixie
 .\" * All rights reserved
@@ -135,6 +135,20 @@
 8-11 for an ``hours'' entry specifies execution at hours 8, 9, 10
 and 11.
 .PP
+A field may begin with a question mark (?), which indicates a
+single value randomly selected when the crontab file is read.
+If the field contains only a question mark, the value is randomly
+selected from the range of all possible values for the field.
+If the question mark precedes a range, the value is randomly selected
+from the range.
+For example, ``? ?2-5 * * *'' specifies that a task will be performed
+daily between 2:00am and and 5:59am at a time randomly selected when
+the crontab file is first read.
+As just one example, this feature can be used to prevent a large
+number of hosts from contacting a server simultaneously and
+overloading it by staggering the time at which a download script is
+executed.
+.PP
 Lists are allowed.  A list is a set of numbers (or ranges)
 separated by commas.  Examples: ``1,2,5,9'', ``0-4,8-12''.
 .PP
@@ -211,6 +225,7 @@
 0 22 * * 1-5mail -s "It's 10pm" joe%Joe,%%Where are your kids?%
 23 0-23/2 * * * echo "run 23 minutes after midn, 2am, 4am ..., everyday"
 5 4 * * sun echo "run at 5 after 4 every sunday"
+? ?2-4 1,15 * * echo "random between 2am-4:59am on the 1st and 15th"
 .fi
 .SH SEE ALSO
 cron(8), crontab(1)

Index: src/usr.sbin/cron/entry.c
diff -u src/usr.sbin/cron/entry.c:1.9 src/usr.sbin/cron/entry.c:1.10
--- src/usr.sbin/cron/entry.c:1.9	Sat Feb 16 07:26:00 2008
+++ src/usr.sbin/cron/entry.c	Sat Apr  4 16:05:10 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: entry.c,v 1.9 2008/02/16 07:26:00 matt Exp $	*/
+/*	$NetBSD: entry.c,v 1.10 2009/04/04 16:05:10 perry Exp $	*/
 
 /* Copyright 1988,1990,1993,1994 by Paul Vixie
  * All rights reserved
@@ -22,7 +22,7 @@
 #if 0
 static char rcsid[] = "Id: entry.c,v 2.12 1994/01/17 03:20:37 vixie Exp";
 #else
-__RCSID("$NetBSD: entry.c,v 1.9 2008/02/16 07:26:00 matt Exp $");
+__RCSID("$NetBSD: entry.c,v 1.10 2009/04/04 16:05:10 perry Exp $");
 #endif
 #endif
 
@@ -358,6 +358,18 @@
 }
 
 
+static int
+random_with_range(int low, int high)
+{
+	/* Kind of crappy error detection, but...
+	 */
+	if (low >= high)
+		return low;
+	else
+		return arc4random() % (high - low + 1) + low;
+}
+
+
 static char
 get_range(bitstr_t *bits,   /* one bit per flag, default=FALSE */
   int low,  /* bounds, impl. offset for bitstr */
@@ -371,24 +383,44 @@
 
 	int	i;
 	int	num1, num2, num3;
+	int	qmark, star;
+
+	qmark = star = FALSE;
 
 	Debug(DPARS|DEXT, ("get_range()...entering, exit won't show\n"))
 
 	if (ch == '*') {
 		/* '*' means "first-last" but can still be modified by /step
 		 */
+		star = TRUE;
 		num1 = low;
 		num2 = high;
 		ch = get_char(file);
 		if (ch == EOF)
 			return EOF;
-	} else {
+	} else if (ch == '?') {
+		qmark = TRUE;
+		ch = get_char(file);
+		if (ch == EOF)
+			return EOF;
+		if (!isdigit(ch)) {
+			num1 = random_with_range(low, high);
+			if (EOF == set_element(bits, low, high, num1))
+return EOF;
+			return ch;
+		}
+	}
+
+	if (!star) {
 		if (EOF == (ch = get_number(&num1, low, names, ch, file)))
 			return EOF;
 
 		if (ch != '-') {
 			/* not a range, it's a single number.
+			 * a single number after '?' is bogus.
 			 */
+			if (qmark)
+return EOF;
 			if (EOF == set_element(bits, low, high,

CVS commit: src/sys/net

2009-04-04 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Apr  4 15:53:49 UTC 2009

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

Log Message:
Fix another typo


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/net/if_bridge.c

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

Modified files:

Index: src/sys/net/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.67 src/sys/net/if_bridge.c:1.68
--- src/sys/net/if_bridge.c:1.67	Sat Apr  4 15:47:28 2009
+++ src/sys/net/if_bridge.c	Sat Apr  4 15:53:49 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.67 2009/04/04 15:47:28 bouyer Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.68 2009/04/04 15:53:49 bouyer Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.67 2009/04/04 15:47:28 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.68 2009/04/04 15:53:49 bouyer Exp $");
 
 #include "opt_bridge_ipf.h"
 #include "opt_inet.h"
@@ -92,7 +92,7 @@
 #include 
 #include 
 #include 
-#include  /* for softnet_lock */
+#include  /* for softnet_lock */
 #include 
 #include 
 #include 



CVS commit: src/sys/net

2009-04-04 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Apr  4 15:47:28 UTC 2009

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

Log Message:
Fix a comment, and make it build.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/net/if_bridge.c

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

Modified files:

Index: src/sys/net/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.66 src/sys/net/if_bridge.c:1.67
--- src/sys/net/if_bridge.c:1.66	Sat Apr  4 15:31:47 2009
+++ src/sys/net/if_bridge.c	Sat Apr  4 15:47:28 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.66 2009/04/04 15:31:47 bouyer Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.67 2009/04/04 15:47:28 bouyer Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.66 2009/04/04 15:31:47 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.67 2009/04/04 15:47:28 bouyer Exp $");
 
 #include "opt_bridge_ipf.h"
 #include "opt_inet.h"
@@ -92,6 +92,7 @@
 #include 
 #include 
 #include 
+#include  /* for softnet_lock */
 #include 
 #include 
 #include 
@@ -1460,7 +1461,7 @@
  *
  *	Receive input from a member interface.  Queue the packet for
  *	bridging if it is not for us.
- *	should be called at splbio()
+ *	should be called at splnet()
  */
 struct mbuf *
 bridge_input(struct ifnet *ifp, struct mbuf *m)



CVS commit: src/sys/net

2009-04-04 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Apr  4 15:31:47 UTC 2009

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

Log Message:
Fixes from Masao Uebayashi


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/net/if_bridge.c

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

Modified files:

Index: src/sys/net/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.65 src/sys/net/if_bridge.c:1.66
--- src/sys/net/if_bridge.c:1.65	Sat Apr  4 10:00:23 2009
+++ src/sys/net/if_bridge.c	Sat Apr  4 15:31:47 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.65 2009/04/04 10:00:23 bouyer Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.66 2009/04/04 15:31:47 bouyer Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.65 2009/04/04 10:00:23 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.66 2009/04/04 15:31:47 bouyer Exp $");
 
 #include "opt_bridge_ipf.h"
 #include "opt_inet.h"
@@ -419,8 +419,6 @@
 	/* Tear down the routing table. */
 	bridge_rtable_fini(sc);
 
-
-
 	softint_disestablish(sc->sc_softintr);
 
 	free(sc, M_DEVBUF);
@@ -1327,10 +1325,13 @@
 	struct ether_header *eh;
 	int s;
 
-	if ((sc->sc_if.if_flags & IFF_RUNNING) == 0)
+	mutex_enter(softnet_lock);
+	if ((sc->sc_if.if_flags & IFF_RUNNING) == 0) {
+		mutex_exit(softnet_lock);
 		return;
+	}
 
-	s = splbio();
+	s = splnet();
 	while (1) {
 		IFQ_POLL(&sc->sc_if.if_snd, m);
 		if (m == NULL)
@@ -1451,6 +1452,7 @@
 		bridge_enqueue(sc, dst_if, m, 1);
 	}
 	splx(s);
+	mutex_exit(softnet_lock);
 }
 
 /*



CVS commit: src/lib/libc/rpc

2009-04-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  4 15:31:08 UTC 2009

Modified Files:
src/lib/libc/rpc: rpc_internal.h

Log Message:
PR/41138: Henning Petersen: Redundant declarations in rpc_internal.h
While here remove __P, KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/rpc/rpc_internal.h

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

Modified files:

Index: src/lib/libc/rpc/rpc_internal.h
diff -u src/lib/libc/rpc/rpc_internal.h:1.5 src/lib/libc/rpc/rpc_internal.h:1.6
--- src/lib/libc/rpc/rpc_internal.h:1.5	Mon Apr 28 16:23:00 2008
+++ src/lib/libc/rpc/rpc_internal.h	Sat Apr  4 11:31:08 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rpc_internal.h,v 1.5 2008/04/28 20:23:00 martin Exp $	*/
+/*	$NetBSD: rpc_internal.h,v 1.6 2009/04/04 15:31:08 christos Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -33,36 +33,32 @@
  * These are not exported interfaces.
  */
 
-bool_t __xdrrec_getrec __P((XDR *, enum xprt_stat *, bool_t));
-bool_t __xdrrec_setnonblock __P((XDR *, int));
-void __xprt_unregister_unlocked __P((SVCXPRT *));
-bool_t __svc_clean_idle __P((fd_set *, int, bool_t));
-
-bool_t __xdrrec_getrec __P((XDR *, enum xprt_stat *, bool_t));
-bool_t __xdrrec_setnonblock __P((XDR *, int));
-
-u_int __rpc_get_a_size __P((int));
-int __rpc_dtbsize __P((void));
-struct netconfig * __rpcgettp __P((int));
-int  __rpc_get_default_domain __P((char **));
-
-char *__rpc_taddr2uaddr_af __P((int, const struct netbuf *));
-struct netbuf *__rpc_uaddr2taddr_af __P((int, const char *));
-int __rpc_fixup_addr __P((struct netbuf *, const struct netbuf *));
-int __rpc_sockinfo2netid __P((struct __rpc_sockinfo *, const char **));
-int __rpc_seman2socktype __P((int));
-int __rpc_socktype2seman __P((int));
-void *rpc_nullproc __P((CLIENT *));
-int __rpc_sockisbound __P((int));
-
-struct netbuf *__rpcb_findaddr __P((rpcprog_t, rpcvers_t,
-const struct netconfig *,
-const char *, CLIENT **));
-bool_t __rpc_control __P((int,void *));
+bool_t __xdrrec_getrec(XDR *, enum xprt_stat *, bool_t);
+bool_t __xdrrec_setnonblock(XDR *, int);
+void __xprt_unregister_unlocked(SVCXPRT *);
+bool_t __svc_clean_idle(fd_set *, int, bool_t);
+
+u_int __rpc_get_a_size(int);
+int __rpc_dtbsize(void);
+struct netconfig *__rpcgettp(int);
+int  __rpc_get_default_domain(char **);
+
+char *__rpc_taddr2uaddr_af(int, const struct netbuf *);
+struct netbuf *__rpc_uaddr2taddr_af(int, const char *);
+int __rpc_fixup_addr(struct netbuf *, const struct netbuf *);
+int __rpc_sockinfo2netid(struct __rpc_sockinfo *, const char **);
+int __rpc_seman2socktype(int);
+int __rpc_socktype2seman(int);
+void *rpc_nullproc(CLIENT *);
+int __rpc_sockisbound(int);
+
+struct netbuf *__rpcb_findaddr(rpcprog_t, rpcvers_t, const struct netconfig *,
+const char *, CLIENT **);
+bool_t __rpc_control(int, void *);
 
-char *_get_next_token __P((char *, int));
+char *_get_next_token(char *, int);
 
-u_int32_t __rpc_getxid __P((void));
+u_int32_t __rpc_getxid(void);
 #define __RPC_GETXID()	(__rpc_getxid())
 
 extern SVCXPRT **__svc_xports;



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

2009-04-04 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Sat Apr  4 15:27:48 UTC 2009

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

Log Message:
Mention html versions of recently-added bit* man pages


To generate a diff of this commit:
cvs rdiff -u -r1.1241 -r1.1242 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.1241 src/distrib/sets/lists/comp/mi:1.1242
--- src/distrib/sets/lists/comp/mi:1.1241	Sat Apr  4 01:45:18 2009
+++ src/distrib/sets/lists/comp/mi	Sat Apr  4 15:27:48 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1241 2009/04/04 01:45:18 perry Exp $
+#	$NetBSD: mi,v 1.1242 2009/04/04 15:27:48 apb Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -10272,7 +10272,17 @@
 ./usr/share/man/html3/bindresvport.html		comp-c-htmlman		html
 ./usr/share/man/html3/bindresvport_sa.html	comp-c-htmlman		html
 ./usr/share/man/html3/bindtextdomain.html	comp-c-htmlman		html
+./usr/share/man/html3/bit_alloc.html		comp-c-htmlman		html
+./usr/share/man/html3/bit_clear.html		comp-c-htmlman		html
+./usr/share/man/html3/bit_decl.html		comp-c-htmlman		html
+./usr/share/man/html3/bit_ffc.html		comp-c-htmlman		html
+./usr/share/man/html3/bit_ffs.html		comp-c-htmlman		html
+./usr/share/man/html3/bit_nclear.html		comp-c-htmlman		html
+./usr/share/man/html3/bit_nset.html		comp-c-htmlman		html
+./usr/share/man/html3/bit_set.html		comp-c-htmlman		html
+./usr/share/man/html3/bit_test.html		comp-c-htmlman		html
 ./usr/share/man/html3/bits.html			comp-c-htmlman		html
+./usr/share/man/html3/bitstr_size.html		comp-c-htmlman		html
 ./usr/share/man/html3/bitstring.html		comp-c-htmlman		html
 ./usr/share/man/html3/bkgd.html			comp-c-htmlman		html
 ./usr/share/man/html3/bkgdset.html		comp-c-htmlman		html



CVS commit: xsrc/external/mit/freetype/dist/src/gzip

2009-04-04 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Sat Apr  4 15:25:19 UTC 2009

Modified Files:
xsrc/external/mit/freetype/dist/src/gzip: ftgzip.c

Log Message:
FIx build with SSP


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
xsrc/external/mit/freetype/dist/src/gzip/ftgzip.c

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

Modified files:

Index: xsrc/external/mit/freetype/dist/src/gzip/ftgzip.c
diff -u xsrc/external/mit/freetype/dist/src/gzip/ftgzip.c:1.1.1.1 xsrc/external/mit/freetype/dist/src/gzip/ftgzip.c:1.2
--- xsrc/external/mit/freetype/dist/src/gzip/ftgzip.c:1.1.1.1	Tue Jul 29 22:36:07 2008
+++ xsrc/external/mit/freetype/dist/src/gzip/ftgzip.c	Sat Apr  4 11:25:19 2009
@@ -352,7 +352,7 @@
 FT_Stream  stream  = zip->source;
 FT_ULong   size;
 
-
+#undef read	/* XXX: for SSP */
 if ( stream->read )
 {
   size = stream->read( stream, stream->pos, zip->input,



CVS commit: src/doc

2009-04-04 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Apr  4 12:30:43 UTC 2009

Modified Files:
src/doc: 3RDPARTY

Log Message:
Cannot remember why I thought cron-4.3 was out -- downgrade to 4.1.
Noted by perry.


To generate a diff of this commit:
cvs rdiff -u -r1.679 -r1.680 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.679 src/doc/3RDPARTY:1.680
--- src/doc/3RDPARTY:1.679	Thu Mar 26 03:15:05 2009
+++ src/doc/3RDPARTY	Sat Apr  4 12:30:43 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.679 2009/03/26 03:15:05 taca Exp $
+#	$NetBSD: 3RDPARTY,v 1.680 2009/04/04 12:30:43 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -186,7 +186,7 @@
 
 Package:	cron
 Version:	3.0
-Current Vers:	4.3
+Current Vers:	4.1
 Maintainer:	Paul Vixie 
 Archive Site:	ftp://ftp.isc.org/isc/cron/
 Home Page:



CVS commit: src/distrib/utils/sysinst

2009-04-04 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Apr  4 11:34:09 UTC 2009

Modified Files:
src/distrib/utils/sysinst: bsddisklabel.c

Log Message:
Back out the / change. This is an incorrigible. Any change to that would
make it more user friendly is likely to (a) trigger complaints from elitist
morons (b) overflow RAM disks everywhere.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/distrib/utils/sysinst/bsddisklabel.c

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/bsddisklabel.c
diff -u src/distrib/utils/sysinst/bsddisklabel.c:1.48 src/distrib/utils/sysinst/bsddisklabel.c:1.49
--- src/distrib/utils/sysinst/bsddisklabel.c:1.48	Sat Apr  4 11:24:24 2009
+++ src/distrib/utils/sysinst/bsddisklabel.c	Sat Apr  4 11:34:09 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.48 2009/04/04 11:24:24 ad Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.49 2009/04/04 11:34:09 ad Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -444,12 +444,6 @@
 			pi.free_space -= i;
 		}
 
-		/* If no /usr and still free space, give to / */
-		if (pi.ptn_sizes[PI_USR].size == 0 && pi.free_space != 0) {
-			pi.ptn_sizes[PI_ROOT].size += pi.free_space;
-			pi.free_space = 0;
-		}
-
 		/* Ensure all of / is readable by the system boot code */
 		i = pi.ptn_sizes[PI_ROOT].limit;
 		if (i != 0 && (i -= pi.ptn_sizes[PI_ROOT].size) < 0) {



CVS commit: src/distrib/utils/sysinst

2009-04-04 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Apr  4 11:24:24 UTC 2009

Modified Files:
src/distrib/utils/sysinst: bsddisklabel.c defs.h util.c

Log Message:
- Improve on previous.
- If no /usr and the disk still has free space, give it to /


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/distrib/utils/sysinst/bsddisklabel.c
cvs rdiff -u -r1.139 -r1.140 src/distrib/utils/sysinst/defs.h
cvs rdiff -u -r1.156 -r1.157 src/distrib/utils/sysinst/util.c

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/bsddisklabel.c
diff -u src/distrib/utils/sysinst/bsddisklabel.c:1.47 src/distrib/utils/sysinst/bsddisklabel.c:1.48
--- src/distrib/utils/sysinst/bsddisklabel.c:1.47	Sat Apr  4 11:04:28 2009
+++ src/distrib/utils/sysinst/bsddisklabel.c	Sat Apr  4 11:24:24 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.47 2009/04/04 11:04:28 ad Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.48 2009/04/04 11:24:24 ad Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -380,8 +380,9 @@
 		} else {
 #if DEFSWAPSIZE == -1
 			/* Dynamic swap size. */
-			pi.ptn_sizes[PI_SWAP].dflt_size = (get_mem_size() >> 20);
-			pi.ptn_sizes[PI_SWAP].size = pi.ptn_sizes[PI_SWAP].dflt_size;
+			pi.ptn_sizes[PI_SWAP].dflt_size = get_ramsize();
+			pi.ptn_sizes[PI_SWAP].size =
+			pi.ptn_sizes[PI_SWAP].dflt_size;
 #endif
 		}
 			
@@ -443,6 +444,12 @@
 			pi.free_space -= i;
 		}
 
+		/* If no /usr and still free space, give to / */
+		if (pi.ptn_sizes[PI_USR].size == 0 && pi.free_space != 0) {
+			pi.ptn_sizes[PI_ROOT].size += pi.free_space;
+			pi.free_space = 0;
+		}
+
 		/* Ensure all of / is readable by the system boot code */
 		i = pi.ptn_sizes[PI_ROOT].limit;
 		if (i != 0 && (i -= pi.ptn_sizes[PI_ROOT].size) < 0) {

Index: src/distrib/utils/sysinst/defs.h
diff -u src/distrib/utils/sysinst/defs.h:1.139 src/distrib/utils/sysinst/defs.h:1.140
--- src/distrib/utils/sysinst/defs.h:1.139	Sat Apr  4 11:04:28 2009
+++ src/distrib/utils/sysinst/defs.h	Sat Apr  4 11:24:24 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.139 2009/04/04 11:04:28 ad Exp $	*/
+/*	$NetBSD: defs.h,v 1.140 2009/04/04 11:24:24 ad Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -420,7 +420,6 @@
 void	init_set_status(int);
 void	customise_sets(void);
 void	umount_mnt2(void);
-uint64_t get_mem_size(void);
 
 /* from target.c */
 const	char *concat_paths(const char *, const char *);

Index: src/distrib/utils/sysinst/util.c
diff -u src/distrib/utils/sysinst/util.c:1.156 src/distrib/utils/sysinst/util.c:1.157
--- src/distrib/utils/sysinst/util.c:1.156	Sat Apr  4 11:04:28 2009
+++ src/distrib/utils/sysinst/util.c	Sat Apr  4 11:24:24 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.156 2009/04/04 11:04:28 ad Exp $	*/
+/*	$NetBSD: util.c,v 1.157 2009/04/04 11:24:24 ad Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1318,16 +1318,3 @@
 		access("/sbin/mount_lfs", X_OK) == 0 &&
 		access("/sbin/newfs_lfs", X_OK) == 0);
 }
-
-uint64_t
-get_mem_size(void)
-{
-	int mib[2] = { CTL_HW, HW_PHYSMEM64 };
-	uint64_t v;
-	size_t sz;
-
-	v = 128*1024*1024;
-	sz = sizeof(v);
-	(void)sysctl(mib, 2, &v, &sz, NULL, 0);
-	return v;
-}



CVS commit: src/distrib/utils/sysinst

2009-04-04 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Apr  4 11:04:28 UTC 2009

Modified Files:
src/distrib/utils/sysinst: bsddisklabel.c defs.h util.c
src/distrib/utils/sysinst/arch/amd64: md.h
src/distrib/utils/sysinst/arch/i386: md.h

Log Message:
Calculate swap size dynamically if DEFSWAPSIZE == -1. Default to RAM size.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/distrib/utils/sysinst/bsddisklabel.c
cvs rdiff -u -r1.138 -r1.139 src/distrib/utils/sysinst/defs.h
cvs rdiff -u -r1.155 -r1.156 src/distrib/utils/sysinst/util.c
cvs rdiff -u -r1.22 -r1.23 src/distrib/utils/sysinst/arch/amd64/md.h
cvs rdiff -u -r1.63 -r1.64 src/distrib/utils/sysinst/arch/i386/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/bsddisklabel.c
diff -u src/distrib/utils/sysinst/bsddisklabel.c:1.46 src/distrib/utils/sysinst/bsddisklabel.c:1.47
--- src/distrib/utils/sysinst/bsddisklabel.c:1.46	Sat Apr  4 10:38:00 2009
+++ src/distrib/utils/sysinst/bsddisklabel.c	Sat Apr  4 11:04:28 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.46 2009/04/04 10:38:00 ad Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.47 2009/04/04 11:04:28 ad Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -74,10 +74,6 @@
 #define PART_USR	PART_ANY
 #endif
 
-#ifndef DEFSWAPRAM
-#define DEFSWAPRAM	32
-#endif
-
 #ifndef DEFVARSIZE
 #define DEFVARSIZE	32
 #endif
@@ -378,8 +374,17 @@
 	msg_table_add(MSG_ptnheaders);
 
 	if (pi.menu_no < 0) {
-		/* If there is a swap partition elsewhere, don't add one here.*/		if (no_swap)
+		/* If there is a swap partition elsewhere, don't add one here.*/
+		if (no_swap) {
 			pi.ptn_sizes[PI_SWAP].size = 0;
+		} else {
+#if DEFSWAPSIZE == -1
+			/* Dynamic swap size. */
+			pi.ptn_sizes[PI_SWAP].dflt_size = (get_mem_size() >> 20);
+			pi.ptn_sizes[PI_SWAP].size = pi.ptn_sizes[PI_SWAP].dflt_size;
+#endif
+		}
+			
 		/* If installing X increase default size of /usr */
 		if (set_X11_selected())
 			pi.ptn_sizes[PI_USR].dflt_size += XNEEDMB;

Index: src/distrib/utils/sysinst/defs.h
diff -u src/distrib/utils/sysinst/defs.h:1.138 src/distrib/utils/sysinst/defs.h:1.139
--- src/distrib/utils/sysinst/defs.h:1.138	Sun Feb 22 11:21:55 2009
+++ src/distrib/utils/sysinst/defs.h	Sat Apr  4 11:04:28 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.138 2009/02/22 11:21:55 ad Exp $	*/
+/*	$NetBSD: defs.h,v 1.139 2009/04/04 11:04:28 ad Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -420,6 +420,7 @@
 void	init_set_status(int);
 void	customise_sets(void);
 void	umount_mnt2(void);
+uint64_t get_mem_size(void);
 
 /* from target.c */
 const	char *concat_paths(const char *, const char *);

Index: src/distrib/utils/sysinst/util.c
diff -u src/distrib/utils/sysinst/util.c:1.155 src/distrib/utils/sysinst/util.c:1.156
--- src/distrib/utils/sysinst/util.c:1.155	Wed Feb 11 20:33:14 2009
+++ src/distrib/utils/sysinst/util.c	Sat Apr  4 11:04:28 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.155 2009/02/11 20:33:14 abs Exp $	*/
+/*	$NetBSD: util.c,v 1.156 2009/04/04 11:04:28 ad Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1318,3 +1318,16 @@
 		access("/sbin/mount_lfs", X_OK) == 0 &&
 		access("/sbin/newfs_lfs", X_OK) == 0);
 }
+
+uint64_t
+get_mem_size(void)
+{
+	int mib[2] = { CTL_HW, HW_PHYSMEM64 };
+	uint64_t v;
+	size_t sz;
+
+	v = 128*1024*1024;
+	sz = sizeof(v);
+	(void)sysctl(mib, 2, &v, &sz, NULL, 0);
+	return v;
+}

Index: src/distrib/utils/sysinst/arch/amd64/md.h
diff -u src/distrib/utils/sysinst/arch/amd64/md.h:1.22 src/distrib/utils/sysinst/arch/amd64/md.h:1.23
--- src/distrib/utils/sysinst/arch/amd64/md.h:1.22	Thu Dec 20 23:32:24 2007
+++ src/distrib/utils/sysinst/arch/amd64/md.h	Sat Apr  4 11:04:28 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.22 2007/12/20 23:32:24 ad Exp $	*/
+/*	$NetBSD: md.h,v 1.23 2009/04/04 11:04:28 ad Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -50,7 +50,8 @@
 #include "mbr.h"
 
 /* constants and defines */
-
+#define	DEFUSRSIZE	0
+#define	DEFSWAPSIZE	(-1)
 
 /* Megs required for a full X installation. */
 #define XNEEDMB 50

Index: src/distrib/utils/sysinst/arch/i386/md.h
diff -u src/distrib/utils/sysinst/arch/i386/md.h:1.63 src/distrib/utils/sysinst/arch/i386/md.h:1.64
--- src/distrib/utils/sysinst/arch/i386/md.h:1.63	Wed Apr 30 15:29:11 2008
+++ src/distrib/utils/sysinst/arch/i386/md.h	Sat Apr  4 11:04:28 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.h,v 1.63 2008/04/30 15:29:11 ad Exp $	*/
+/*	$NetBSD: md.h,v 1.64 2009/04/04 11:04:28 ad Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -50,8 +50,9 @@
 #include "mbr.h"
 
 /* constants and defines */
-
-#define DEFROOTSIZE	32
+#define	DEFUSRSIZE	0
+#define	DEFSWAPSIZE	(-1)
+#define	DEFROOTSIZE	32
 
 /* Megs required for a full X installation. */
 #define XNEEDMB 50



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

2009-04-04 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Apr  4 11:03:24 UTC 2009

Modified Files:
src/distrib/utils/sysinst/arch/i386: md.c

Log Message:
Assume that extended int13 support is available if we have no diskinfo.


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/distrib/utils/sysinst/arch/i386/md.c

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/i386/md.c
diff -u src/distrib/utils/sysinst/arch/i386/md.c:1.119 src/distrib/utils/sysinst/arch/i386/md.c:1.120
--- src/distrib/utils/sysinst/arch/i386/md.c:1.119	Tue Oct  7 09:58:15 2008
+++ src/distrib/utils/sysinst/arch/i386/md.c	Sat Apr  4 11:03:24 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.119 2008/10/07 09:58:15 abs Exp $ */
+/*	$NetBSD: md.c,v 1.120 2009/04/04 11:03:24 ad Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -96,7 +96,7 @@
 		return 0;
 
 	root_limit = 0;
-	if (biosdisk == NULL || !(biosdisk->bi_flags & BIFLAG_EXTINT13)) {
+	if (biosdisk != NULL && (biosdisk->bi_flags & BIFLAG_EXTINT13) == 0) {
 		if (mbr_root_above_chs()) {
 			msg_display(MSG_partabovechs);
 			process_menu(MENU_noyes, NULL);



CVS commit: src/distrib/utils/sysinst

2009-04-04 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Apr  4 10:38:00 UTC 2009

Modified Files:
src/distrib/utils/sysinst: bsddisklabel.c

Log Message:
- Default to UFS2 if the platform can boot from it.
- Default logging on.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/distrib/utils/sysinst/bsddisklabel.c

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/bsddisklabel.c
diff -u src/distrib/utils/sysinst/bsddisklabel.c:1.45 src/distrib/utils/sysinst/bsddisklabel.c:1.46
--- src/distrib/utils/sysinst/bsddisklabel.c:1.45	Sat May 24 11:06:53 2008
+++ src/distrib/utils/sysinst/bsddisklabel.c	Sat Apr  4 10:38:00 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.45 2008/05/24 11:06:53 martin Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.46 2009/04/04 10:38:00 ad Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -132,6 +132,13 @@
 		}
 		strlcpy(p->pi_mount, mountpt, sizeof p->pi_mount);
 		p->pi_flags |= PIF_MOUNT;
+		/* Default to logging, UFS2. */
+		if (p->pi_fstype == FS_BSDFFS) {
+			p->pi_flags |= PIF_LOG;
+#ifdef __HAVE_UFS2_BOOT
+			p->pi_flags |= PIF_FFSv2;
+#endif
+		}
 	}
 
 	return ptn;



CVS commit: src/sys/arch

2009-04-04 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Apr  4 10:36:09 UTC 2009

Modified Files:
src/sys/arch/amd64/include: types.h
src/sys/arch/i386/include: types.h

Log Message:
+__HAVE_UFS2_BOOT


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/amd64/include/types.h
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/i386/include/types.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/amd64/include/types.h
diff -u src/sys/arch/amd64/include/types.h:1.28 src/sys/arch/amd64/include/types.h:1.29
--- src/sys/arch/amd64/include/types.h:1.28	Sun Mar 29 09:24:52 2009
+++ src/sys/arch/amd64/include/types.h	Sat Apr  4 10:36:09 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.28 2009/03/29 09:24:52 ad Exp $	*/
+/*	$NetBSD: types.h,v 1.29 2009/04/04 10:36:09 ad Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -76,6 +76,7 @@
 #define	__HAVE_ATOMIC64_OPS
 #define	__HAVE_ATOMIC_AS_MEMBAR
 #define __HAVE_CPU_LWP_SETPRIVATE
+#define	__HAVE_UFS2_BOOT
 
 #ifdef _KERNEL_OPT
 #include "opt_xen.h"

Index: src/sys/arch/i386/include/types.h
diff -u src/sys/arch/i386/include/types.h:1.61 src/sys/arch/i386/include/types.h:1.62
--- src/sys/arch/i386/include/types.h:1.61	Sun Mar 29 09:24:52 2009
+++ src/sys/arch/i386/include/types.h	Sat Apr  4 10:36:08 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.61 2009/03/29 09:24:52 ad Exp $	*/
+/*	$NetBSD: types.h,v 1.62 2009/04/04 10:36:08 ad Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -84,6 +84,7 @@
 #define	__HAVE_ATOMIC64_OPS
 #define	__HAVE_ATOMIC_AS_MEMBAR
 #define	__HAVE_CPU_LWP_SETPRIVATE
+#define	__HAVE_UFS2_BOOT
 
 #if defined(_KERNEL)
 #define __HAVE_RAS



CVS commit: src/sys/ufs/lfs

2009-04-04 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Apr  4 10:33:59 UTC 2009

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

Log Message:
Turn up the volume on the warning message a bit.


To generate a diff of this commit:
cvs rdiff -u -r1.271 -r1.272 src/sys/ufs/lfs/lfs_vfsops.c

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

Modified files:

Index: src/sys/ufs/lfs/lfs_vfsops.c
diff -u src/sys/ufs/lfs/lfs_vfsops.c:1.271 src/sys/ufs/lfs/lfs_vfsops.c:1.272
--- src/sys/ufs/lfs/lfs_vfsops.c:1.271	Sun Mar 15 21:30:57 2009
+++ src/sys/ufs/lfs/lfs_vfsops.c	Sat Apr  4 10:33:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_vfsops.c,v 1.271 2009/03/15 21:30:57 cegger Exp $	*/
+/*	$NetBSD: lfs_vfsops.c,v 1.272 2009/04/04 10:33:59 ad Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.271 2009/03/15 21:30:57 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.272 2009/04/04 10:33:59 ad Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_lfs.h"
@@ -1047,8 +1047,8 @@
 	lfs_writerd, NULL, NULL, "lfs_writer") != 0)
 		panic("fork lfs_writer");
 
-	printf("WARNING: the log-structured file system is experimental and "
-	"may be unstable\n");
+	printf("WARNING: the log-structured file system is experimental\n"
+	"WARNING: it may cause system crashes and/or corrupt data\n");
 
 	return (0);
 



CVS commit: src/sys/fs/union

2009-04-04 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Apr  4 10:32:49 UTC 2009

Modified Files:
src/sys/fs/union: union_vfsops.c

Log Message:
Turn up the volume on the warning message a bit and note that unionfs can
corrupt the underlying file system. This is an old problem but is now
much easier to trigger because VFS has gone fully multithreaded.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/fs/union/union_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/union/union_vfsops.c
diff -u src/sys/fs/union/union_vfsops.c:1.58 src/sys/fs/union/union_vfsops.c:1.59
--- src/sys/fs/union/union_vfsops.c:1.58	Fri Dec  5 13:05:37 2008
+++ src/sys/fs/union/union_vfsops.c	Sat Apr  4 10:32:49 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_vfsops.c,v 1.58 2008/12/05 13:05:37 ad Exp $	*/
+/*	$NetBSD: union_vfsops.c,v 1.59 2009/04/04 10:32:49 ad Exp $	*/
 
 /*
  * Copyright (c) 1994 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.58 2008/12/05 13:05:37 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.59 2009/04/04 10:32:49 ad Exp $");
 
 #include 
 #include 
@@ -149,8 +149,8 @@
 		goto bad;
 	}
 
-	printf("WARNING: the union file system is experimental and "
-	"may be unstable\n");
+	printf("WARNING: the union file system is experimental\n"
+	"WARNING: it can cause crashes and file system corruption\n");
 
 	lowerrootvp = mp->mnt_vnodecovered;
 	VREF(lowerrootvp);



CVS commit: src/sys/sys

2009-04-04 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Apr  4 10:13:30 UTC 2009

Modified Files:
src/sys/sys: param.h

Log Message:
5.99.10 struct fileops changed for f_drain. I have added a couple of spares.


To generate a diff of this commit:
cvs rdiff -u -r1.342 -r1.343 src/sys/sys/param.h

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

Modified files:

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.342 src/sys/sys/param.h:1.343
--- src/sys/sys/param.h:1.342	Sun Mar 29 01:12:22 2009
+++ src/sys/sys/param.h	Sat Apr  4 10:13:30 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.342 2009/03/29 01:12:22 mrg Exp $	*/
+/*	$NetBSD: param.h,v 1.343 2009/04/04 10:13:30 ad Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -63,7 +63,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	599000900	/* NetBSD 5.99.9 */
+#define	__NetBSD_Version__	599001000	/* NetBSD 5.99.10 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys

2009-04-04 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Apr  4 10:12:52 UTC 2009

Modified Files:
src/sys/arch/xen/xen: xenevt.c
src/sys/compat/svr4: svr4_net.c
src/sys/compat/svr4_32: svr4_32_net.c
src/sys/dev/dmover: dmover_io.c
src/sys/dev/putter: putter.c
src/sys/kern: kern_descrip.c kern_drvctl.c kern_event.c sys_mqueue.c
sys_pipe.c sys_socket.c uipc_socket.c uipc_syscalls.c vfs_vnops.c
src/sys/net: bpf.c if_tap.c
src/sys/opencrypto: cryptodev.c
src/sys/sys: file.h socketvar.h

Log Message:
Add fileops::fo_drain(), to be called from fd_close() when there is more
than one active reference to a file descriptor. It should dislodge threads
sleeping while holding a reference to the descriptor. Implemented only for
sockets but should be extended to pipes, fifos, etc.

Fixes the case of a multithreaded process doing something like the
following, which would have hung until the process got a signal.

thr0accept(fd, ...)
thr1close(fd)


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/xen/xen/xenevt.c
cvs rdiff -u -r1.55 -r1.56 src/sys/compat/svr4/svr4_net.c
cvs rdiff -u -r1.18 -r1.19 src/sys/compat/svr4_32/svr4_32_net.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/dmover/dmover_io.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/putter/putter.c
cvs rdiff -u -r1.189 -r1.190 src/sys/kern/kern_descrip.c
cvs rdiff -u -r1.22 -r1.23 src/sys/kern/kern_drvctl.c
cvs rdiff -u -r1.63 -r1.64 src/sys/kern/kern_event.c
cvs rdiff -u -r1.13 -r1.14 src/sys/kern/sys_mqueue.c
cvs rdiff -u -r1.108 -r1.109 src/sys/kern/sys_pipe.c
cvs rdiff -u -r1.58 -r1.59 src/sys/kern/sys_socket.c
cvs rdiff -u -r1.187 -r1.188 src/sys/kern/uipc_socket.c
cvs rdiff -u -r1.135 -r1.136 src/sys/kern/uipc_syscalls.c
cvs rdiff -u -r1.163 -r1.164 src/sys/kern/vfs_vnops.c
cvs rdiff -u -r1.143 -r1.144 src/sys/net/bpf.c
cvs rdiff -u -r1.54 -r1.55 src/sys/net/if_tap.c
cvs rdiff -u -r1.46 -r1.47 src/sys/opencrypto/cryptodev.c
cvs rdiff -u -r1.66 -r1.67 src/sys/sys/file.h
cvs rdiff -u -r1.118 -r1.119 src/sys/sys/socketvar.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/xen/xen/xenevt.c
diff -u src/sys/arch/xen/xen/xenevt.c:1.31 src/sys/arch/xen/xen/xenevt.c:1.32
--- src/sys/arch/xen/xen/xenevt.c:1.31	Tue Mar 10 20:05:31 2009
+++ src/sys/arch/xen/xen/xenevt.c	Sat Apr  4 10:12:51 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: xenevt.c,v 1.31 2009/03/10 20:05:31 bouyer Exp $  */
+/*  $NetBSD: xenevt.c,v 1.32 2009/04/04 10:12:51 ad Exp $  */
 
 /*
  * Copyright (c) 2005 Manuel Bouyer.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xenevt.c,v 1.31 2009/03/10 20:05:31 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xenevt.c,v 1.32 2009/04/04 10:12:51 ad Exp $");
 
 #include "opt_xen.h"
 #include 
@@ -80,14 +80,15 @@
 /* static int	xenevt_fkqfilter(struct file *, struct knote *); */
 
 static const struct fileops xenevt_fileops = {
-	xenevt_fread,
-	xenevt_fwrite,
-	xenevt_fioctl,
-	fnullop_fcntl,
-	xenevt_fpoll,
-	fbadop_stat,
-	xenevt_fclose,
-	/* xenevt_fkqfilter */ fnullop_kqfilter
+	.fo_read = xenevt_fread,
+	.fo_write = xenevt_fwrite,
+	.fo_ioctl = xenevt_fioctl,
+	.fo_fcntl = fnullop_fcntl,
+	.fo_poll = xenevt_fpoll,
+	.fo_stat = fbadop_stat,
+	.fo_close = xenevt_fclose,
+	.fo_kqfilter = /* xenevt_fkqfilter */ fnullop_kqfilter,
+	.fo_drain = fnullop_drain,
 };
 
 dev_type_open(xenevtopen);

Index: src/sys/compat/svr4/svr4_net.c
diff -u src/sys/compat/svr4/svr4_net.c:1.55 src/sys/compat/svr4/svr4_net.c:1.56
--- src/sys/compat/svr4/svr4_net.c:1.55	Thu Jan 22 16:10:19 2009
+++ src/sys/compat/svr4/svr4_net.c	Sat Apr  4 10:12:51 2009
@@ -1,7 +1,7 @@
-/*	$NetBSD: svr4_net.c,v 1.55 2009/01/22 16:10:19 cegger Exp $	*/
+/*	$NetBSD: svr4_net.c,v 1.56 2009/04/04 10:12:51 ad Exp $	*/
 
 /*-
- * Copyright (c) 1994, 2008 The NetBSD Foundation, Inc.
+ * Copyright (c) 1994, 2008, 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_net.c,v 1.55 2009/01/22 16:10:19 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_net.c,v 1.56 2009/04/04 10:12:51 ad Exp $");
 
 #define COMPAT_SVR4 1
 
@@ -100,8 +100,15 @@
 int svr4_soo_close(file_t *);
 
 static const struct fileops svr4_netops = {
-	soo_read, soo_write, soo_ioctl, soo_fcntl, soo_poll,
-	soo_stat, svr4_soo_close, soo_kqfilter
+	.fo_read = soo_read,
+	.fo_write = soo_write,
+	.fo_ioctl = soo_ioctl,
+	.fo_fcntl = soo_fcntl,
+	.fo_poll = soo_poll,
+	.fo_stat = soo_stat,
+	.fo_close = svr4_soo_close,
+	.fo_kqfilter = soo_kqfilter,
+	.fo_drain = soo_drain,
 };
 
 

Index: src/sys/compat/svr4_32/svr4_32_net.c
diff -u src/sys/compat/svr4_32/svr4_32_net.c:1.18 src/sys/compat/svr4_32/svr4_32_net.c:1.19
--- src/sys/compat/svr4_32/svr4_32_net.c:1.18	Mon Apr 28

CVS commit: src/distrib/sets

2009-04-04 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Sat Apr  4 10:08:08 UTC 2009

Modified Files:
src/distrib/sets: sets.subr

Log Message:
All non-error messages printed to stderr by makeplist must begin with
"DEBUG:", or else regpkg assumes that they are error messages.  Make the
verbose messages printed by the list_set_files function follow that
convention.  Fixes PR 41077 from Lloyd Parkes.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/distrib/sets/sets.subr

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/sets.subr
diff -u src/distrib/sets/sets.subr:1.81 src/distrib/sets/sets.subr:1.82
--- src/distrib/sets/sets.subr:1.81	Sat Jan 24 22:14:44 2009
+++ src/distrib/sets/sets.subr	Sat Apr  4 10:08:08 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: sets.subr,v 1.81 2009/01/24 22:14:44 rmind Exp $
+#	$NetBSD: sets.subr,v 1.82 2009/04/04 10:08:08 apb Exp $
 #
 
 #
@@ -227,7 +227,7 @@
 # In each file, a record consists of a path and a System Package name,
 # separated by whitespace. E.g.,
 #
-# 	# $NetBSD: sets.subr,v 1.81 2009/01/24 22:14:44 rmind Exp $
+# 	# $NetBSD: sets.subr,v 1.82 2009/04/04 10:08:08 apb Exp $
 # 	.			base-sys-root	[keyword[,...]]
 # 	./altroot		base-sys-root
 # 	./bin			base-sys-root
@@ -313,7 +313,7 @@
 		for l in $list; do
 			echo $l
 			if $verbose; then
-echo $l >&2
+echo >&2 "DEBUG: list_set_files: $l"
 			fi
 		done
 	done | xargs cat | ${SED} ${SUBST} | \



CVS commit: src/sys/net

2009-04-04 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Apr  4 10:00:23 UTC 2009

Modified Files:
src/sys/net: if_bridge.c if_bridgevar.h

Log Message:
Fix for if_start() and pfil_hook() being called from hardware interrupt
context (reported on various mailing-lists, and part of PR kern/41114,
causing panic in pf(4) and possibly ipf(4) when BRIDGE_IPF is used).
Defer bridge_forward() to a software interrupt; bridge_input() enqueues
mbufs to ifp->if_snd which is handled in bridge_forward().


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/net/if_bridge.c
cvs rdiff -u -r1.13 -r1.14 src/sys/net/if_bridgevar.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/net/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.64 src/sys/net/if_bridge.c:1.65
--- src/sys/net/if_bridge.c:1.64	Sun Jan 18 10:28:55 2009
+++ src/sys/net/if_bridge.c	Sat Apr  4 10:00:23 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.64 2009/01/18 10:28:55 mrg Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.65 2009/04/04 10:00:23 bouyer Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.64 2009/01/18 10:28:55 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.65 2009/04/04 10:00:23 bouyer Exp $");
 
 #include "opt_bridge_ipf.h"
 #include "opt_inet.h"
@@ -97,6 +97,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #if NBPFILTER > 0
 #include 
@@ -185,7 +186,7 @@
 static void	bridge_stop(struct ifnet *, int);
 static void	bridge_start(struct ifnet *);
 
-static void	bridge_forward(struct bridge_softc *, struct mbuf *m);
+static void	bridge_forward(void *);
 
 static void	bridge_timer(void *);
 
@@ -350,6 +351,13 @@
 	sc->sc_hold_time = BSTP_DEFAULT_HOLD_TIME;
 	sc->sc_filter_flags = 0;
 
+	/* software interrupt to do the work */
+	sc->sc_softintr = softint_establish(SOFTINT_NET, bridge_forward, sc);
+	if (sc->sc_softintr == NULL) {
+		free(sc, M_DEVBUF);
+		return ENOMEM;
+	}
+
 	/* Initialize our routing table. */
 	bridge_rtable_init(sc);
 
@@ -370,6 +378,7 @@
 	ifp->if_addrlen = 0;
 	ifp->if_dlt = DLT_EN10MB;
 	ifp->if_hdrlen = ETHER_HDR_LEN;
+	IFQ_SET_READY(&ifp->if_snd);
 
 	if_attach(ifp);
 
@@ -410,6 +419,10 @@
 	/* Tear down the routing table. */
 	bridge_rtable_fini(sc);
 
+
+
+	softint_disestablish(sc->sc_softintr);
+
 	free(sc, M_DEVBUF);
 
 	return (0);
@@ -1305,124 +1318,139 @@
  *	The forwarding function of the bridge.
  */
 static void
-bridge_forward(struct bridge_softc *sc, struct mbuf *m)
+bridge_forward(void *v)
 {
+	struct bridge_softc *sc = v;
+	struct mbuf *m;
 	struct bridge_iflist *bif;
 	struct ifnet *src_if, *dst_if;
 	struct ether_header *eh;
+	int s;
 
-	src_if = m->m_pkthdr.rcvif;
+	if ((sc->sc_if.if_flags & IFF_RUNNING) == 0)
+		return;
 
-	sc->sc_if.if_ipackets++;
-	sc->sc_if.if_ibytes += m->m_pkthdr.len;
+	s = splbio();
+	while (1) {
+		IFQ_POLL(&sc->sc_if.if_snd, m);
+		if (m == NULL)
+			break;
+		IFQ_DEQUEUE(&sc->sc_if.if_snd, m);
 
-	/*
-	 * Look up the bridge_iflist.
-	 */
-	bif = bridge_lookup_member_if(sc, src_if);
-	if (bif == NULL) {
-		/* Interface is not a bridge member (anymore?) */
-		m_freem(m);
-		return;
-	}
+		src_if = m->m_pkthdr.rcvif;
 
-	if (bif->bif_flags & IFBIF_STP) {
-		switch (bif->bif_state) {
-		case BSTP_IFSTATE_BLOCKING:
-		case BSTP_IFSTATE_LISTENING:
-		case BSTP_IFSTATE_DISABLED:
+		sc->sc_if.if_ipackets++;
+		sc->sc_if.if_ibytes += m->m_pkthdr.len;
+
+		/*
+		 * Look up the bridge_iflist.
+		 */
+		bif = bridge_lookup_member_if(sc, src_if);
+		if (bif == NULL) {
+			/* Interface is not a bridge member (anymore?) */
 			m_freem(m);
-			return;
+			continue;
 		}
-	}
 
-	eh = mtod(m, struct ether_header *);
-
-	/*
-	 * If the interface is learning, and the source
-	 * address is valid and not multicast, record
-	 * the address.
-	 */
-	if ((bif->bif_flags & IFBIF_LEARNING) != 0 &&
-	ETHER_IS_MULTICAST(eh->ether_shost) == 0 &&
-	(eh->ether_shost[0] == 0 &&
-	 eh->ether_shost[1] == 0 &&
-	 eh->ether_shost[2] == 0 &&
-	 eh->ether_shost[3] == 0 &&
-	 eh->ether_shost[4] == 0 &&
-	 eh->ether_shost[5] == 0) == 0) {
-		(void) bridge_rtupdate(sc, eh->ether_shost,
-		src_if, 0, IFBAF_DYNAMIC);
-	}
+		if (bif->bif_flags & IFBIF_STP) {
+			switch (bif->bif_state) {
+			case BSTP_IFSTATE_BLOCKING:
+			case BSTP_IFSTATE_LISTENING:
+			case BSTP_IFSTATE_DISABLED:
+m_freem(m);
+continue;
+			}
+		}
 
-	if ((bif->bif_flags & IFBIF_STP) != 0 &&
-	bif->bif_state == BSTP_IFSTATE_LEARNING) {
-		m_freem(m);
-		return;
-	}
+		eh = mtod(m, struct ether_header *);
 
-	/*
-	 * At this point, the port either doesn't participate
-	 * in spanning tree or it is in the forwarding state.
-	 */
+		/*
+		 * If the interface is learning, and the source
+		 * address is valid and not multicast, record
+		 * the address.
+		 */
+		if ((bif->bif_flags & IFBIF_LEARNING) != 

CVS commit: src/sys/dev

2009-04-04 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Apr  4 08:29:39 UTC 2009

Modified Files:
src/sys/dev: ccd.c ccdvar.h

Log Message:
Fix problems with ccd:

- Pending async I/O was tossed on unconfigure (should not happen, but..)
- It could exhaust memory under heavy I/O load.
- If memory allocation failed, disk transfers could stall.
- v_numoutput was updated without v_interlock held.

Additionally:

- Make it MPSAFE.
- Use kmem_alloc().


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/sys/dev/ccd.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/ccdvar.h

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

Modified files:

Index: src/sys/dev/ccd.c
diff -u src/sys/dev/ccd.c:1.132 src/sys/dev/ccd.c:1.133
--- src/sys/dev/ccd.c:1.132	Tue Jan 13 13:35:52 2009
+++ src/sys/dev/ccd.c	Sat Apr  4 08:29:39 2009
@@ -1,11 +1,11 @@
-/*	$NetBSD: ccd.c,v 1.132 2009/01/13 13:35:52 yamt Exp $	*/
+/*	$NetBSD: ccd.c,v 1.133 2009/04/04 08:29:39 ad Exp $	*/
 
 /*-
- * Copyright (c) 1996, 1997, 1998, 1999, 2007 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996, 1997, 1998, 1999, 2007, 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe.
+ * by Jason R. Thorpe, and by Andrew Doran.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -109,24 +109,33 @@
 /*
  * "Concatenated" disk driver.
  *
- * Dynamic configuration and disklabel support by:
- *	Jason R. Thorpe 
- *	Numerical Aerodynamic Simulation Facility
- *	Mail Stop 258-6
- *	NASA Ames Research Center
- *	Moffett Field, CA 94035
+ * Notes on concurrency:
+ *
+ * => sc_dvlock serializes access to the device nodes, excluding block I/O.
+ *
+ * => sc_iolock serializes access to (sc_flags & CCDF_INITED), disk stats,
+ *sc_stop, sc_bufq and b_resid from master buffers.
+ *
+ * => a combination of CCDF_INITED, sc_inflight, and sc_iolock is used to
+ *serialize I/O and configuration changes.
+ *
+ * => the in-core disk label does not change while the device is open.
+ *
+ * On memory consumption: ccd fans out I/O requests and so needs to
+ * allocate memory.  If the system is desperately low on memory, we
+ * single thread I/O.
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.132 2009/01/13 13:35:52 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ccd.c,v 1.133 2009/04/04 08:29:39 ad Exp $");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -141,6 +150,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -169,10 +180,10 @@
 };
 
 /* component buffer pool */
-static struct pool ccd_cbufpool;
+static pool_cache_t ccd_cache;
 
-#define	CCD_GETBUF()		pool_get(&ccd_cbufpool, PR_NOWAIT)
-#define	CCD_PUTBUF(cbp)		pool_put(&ccd_cbufpool, cbp)
+#define	CCD_GETBUF()		pool_cache_get(ccd_cache, PR_WAITOK)
+#define	CCD_PUTBUF(cbp)		pool_cache_put(ccd_cache, cbp)
 
 #define CCDLABELDEV(dev)	\
 	(MAKEDISKDEV(major((dev)), ccdunit((dev)), RAW_PART))
@@ -183,9 +194,7 @@
 /* called by biodone() at interrupt time */
 static void	ccdiodone(struct buf *);
 
-static void	ccdstart(struct ccd_softc *);
 static void	ccdinterleave(struct ccd_softc *);
-static void	ccdintr(struct ccd_softc *, struct buf *);
 static int	ccdinit(struct ccd_softc *, char **, struct vnode **,
 		struct lwp *);
 static struct ccdbuf *ccdbuffer(struct ccd_softc *, struct buf *,
@@ -193,6 +202,8 @@
 static void	ccdgetdefaultlabel(struct ccd_softc *, struct disklabel *);
 static void	ccdgetdisklabel(dev_t);
 static void	ccdmakedisklabel(struct ccd_softc *);
+static void	ccdstart(struct ccd_softc *);
+static void	ccdthread(void *);
 
 static dev_type_open(ccdopen);
 static dev_type_close(ccdclose);
@@ -200,16 +211,30 @@
 static dev_type_write(ccdwrite);
 static dev_type_ioctl(ccdioctl);
 static dev_type_strategy(ccdstrategy);
-static dev_type_dump(ccddump);
 static dev_type_size(ccdsize);
 
 const struct bdevsw ccd_bdevsw = {
-	ccdopen, ccdclose, ccdstrategy, ccdioctl, ccddump, ccdsize, D_DISK
+	.d_open = ccdopen,
+	.d_close = ccdclose,
+	.d_strategy = ccdstrategy,
+	.d_ioctl = ccdioctl,
+	.d_dump = nodump,
+	.d_psize = ccdsize,
+	.d_flag = D_DISK | D_MPSAFE
 };
 
 const struct cdevsw ccd_cdevsw = {
-	ccdopen, ccdclose, ccdread, ccdwrite, ccdioctl,
-	nostop, notty, nopoll, nommap, nokqfilter, D_DISK
+	.d_open = ccdopen,
+	.d_close = ccdclose,
+	.d_read = ccdread,
+	.d_write = ccdwrite,
+	.d_ioctl = ccdioctl,
+	.d_stop = nostop,
+	.d_tty = notty,
+	.d_poll = nopoll,
+	.d_mmap = nommap,
+	.d_kqfilter = nokqfilter,
+	.d_flag = D_DISK | D_MPSAFE
 };
 
 #ifdef DEBUG
@@ -238,8 +263,7 @@
 		return;
 	}
 
-	ccd_softc = (struct ccd_softc *)malloc(num * ccd_softc_elemsize,
-	M_DEVBUF, M_NOWAIT|M_ZERO);
+	ccd_soft

CVS commit: src/sys

2009-04-04 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Apr  4 07:30:10 UTC 2009

Modified Files:
src/sys/kern: subr_disk.c subr_iostat.c
src/sys/sys: disk.h iostat.h

Log Message:
Add disk_isbusy(), iostat_isbusy().


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/kern/subr_disk.c
cvs rdiff -u -r1.16 -r1.17 src/sys/kern/subr_iostat.c
cvs rdiff -u -r1.51 -r1.52 src/sys/sys/disk.h
cvs rdiff -u -r1.9 -r1.10 src/sys/sys/iostat.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/subr_disk.c
diff -u src/sys/kern/subr_disk.c:1.94 src/sys/kern/subr_disk.c:1.95
--- src/sys/kern/subr_disk.c:1.94	Thu Jan 22 14:38:35 2009
+++ src/sys/kern/subr_disk.c	Sat Apr  4 07:30:10 2009
@@ -1,7 +1,7 @@
-/*	$NetBSD: subr_disk.c,v 1.94 2009/01/22 14:38:35 yamt Exp $	*/
+/*	$NetBSD: subr_disk.c,v 1.95 2009/04/04 07:30:10 ad Exp $	*/
 
 /*-
- * Copyright (c) 1996, 1997, 1999, 2000 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.94 2009/01/22 14:38:35 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.95 2009/04/04 07:30:10 ad Exp $");
 
 #include 
 #include 
@@ -272,6 +272,16 @@
 }
 
 /*
+ * Return true if disk has an I/O operation in flight.
+ */
+bool
+disk_isbusy(struct disk *diskp)
+{
+
+	return iostat_isbusy(diskp->dk_stats);
+}
+
+/*
  * Set the physical blocksize of a disk, in bytes.
  * Only necessary if blocksize != DEV_BSIZE.
  */

Index: src/sys/kern/subr_iostat.c
diff -u src/sys/kern/subr_iostat.c:1.16 src/sys/kern/subr_iostat.c:1.17
--- src/sys/kern/subr_iostat.c:1.16	Thu Jan 22 14:38:35 2009
+++ src/sys/kern/subr_iostat.c	Sat Apr  4 07:30:10 2009
@@ -1,8 +1,8 @@
-/*	$NetBSD: subr_iostat.c,v 1.16 2009/01/22 14:38:35 yamt Exp $	*/
+/*	$NetBSD: subr_iostat.c,v 1.17 2009/04/04 07:30:10 ad Exp $	*/
 /*	NetBSD: subr_disk.c,v 1.69 2005/05/29 22:24:15 christos Exp	*/
 
 /*-
- * Copyright (c) 1996, 1997, 1999, 2000 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_iostat.c,v 1.16 2009/01/22 14:38:35 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_iostat.c,v 1.17 2009/04/04 07:30:10 ad Exp $");
 
 #include 
 #include 
@@ -223,6 +223,16 @@
 }
 
 /*
+ * Return non-zero if a device has an I/O request in flight.
+ */
+bool
+iostat_isbusy(struct io_stats *stats)
+{
+
+	return stats->io_busy != 0;
+}
+
+/*
  * Increment the seek counter.  This does look almost redundant but it
  * abstracts the stats gathering.
  */

Index: src/sys/sys/disk.h
diff -u src/sys/sys/disk.h:1.51 src/sys/sys/disk.h:1.52
--- src/sys/sys/disk.h:1.51	Mon Apr 28 20:24:10 2008
+++ src/sys/sys/disk.h	Sat Apr  4 07:30:09 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: disk.h,v 1.51 2008/04/28 20:24:10 martin Exp $	*/
+/*	$NetBSD: disk.h,v 1.52 2009/04/04 07:30:09 ad Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 2004 The NetBSD Foundation, Inc.
@@ -502,6 +502,7 @@
 void	disk_destroy(struct disk *);
 void	disk_busy(struct disk *);
 void	disk_unbusy(struct disk *, long, int);
+bool	disk_isbusy(struct disk *);
 void	disk_blocksize(struct disk *, int);
 struct disk *disk_find(const char *);
 int	disk_ioctl(struct disk *, u_long, void *, int, struct lwp *);

Index: src/sys/sys/iostat.h
diff -u src/sys/sys/iostat.h:1.9 src/sys/sys/iostat.h:1.10
--- src/sys/sys/iostat.h:1.9	Mon Apr 28 20:24:10 2008
+++ src/sys/sys/iostat.h	Sat Apr  4 07:30:09 2009
@@ -1,7 +1,7 @@
-/*	$NetBSD: iostat.h,v 1.9 2008/04/28 20:24:10 martin Exp $	*/
+/*	$NetBSD: iostat.h,v 1.10 2009/04/04 07:30:09 ad Exp $	*/
 
 /*-
- * Copyright (c) 1996, 1997, 2004 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996, 1997, 2004, 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -98,6 +98,7 @@
 void	iostat_init(void);
 void	iostat_busy(struct io_stats *);
 void	iostat_unbusy(struct io_stats *, long, int);
+bool	iostat_isbusy(struct io_stats *);
 struct io_stats *iostat_find(const char *);
 struct io_stats *iostat_alloc(int32_t, void *, const char *);
 void	iostat_free(struct io_stats *);