CVS commit: src/sys/fs/union

2011-10-18 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Oct 18 09:22:53 UTC 2011

Modified Files:
src/sys/fs/union: union_subr.c union_vnops.c

Log Message:
VOP_GETATTR() needs a shared lock at least.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/fs/union/union_subr.c
cvs rdiff -u -r1.46 -r1.47 src/sys/fs/union/union_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/fs/union/union_subr.c
diff -u src/sys/fs/union/union_subr.c:1.50 src/sys/fs/union/union_subr.c:1.51
--- src/sys/fs/union/union_subr.c:1.50	Tue Aug 23 07:39:37 2011
+++ src/sys/fs/union/union_subr.c	Tue Oct 18 09:22:53 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_subr.c,v 1.50 2011/08/23 07:39:37 hannken Exp $	*/
+/*	$NetBSD: union_subr.c,v 1.51 2011/10/18 09:22:53 hannken Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -72,7 +72,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: union_subr.c,v 1.50 2011/08/23 07:39:37 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: union_subr.c,v 1.51 2011/10/18 09:22:53 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -472,9 +472,13 @@ loop:
 	if (uppervp != NULLVP)
 		if (VOP_GETATTR(uppervp, va, FSCRED) == 0)
 			uppersz = va.va_size;
-	if (lowervp != NULLVP)
-		if (VOP_GETATTR(lowervp, va, FSCRED) == 0)
+	if (lowervp != NULLVP) {
+		vn_lock(lowervp, LK_SHARED | LK_RETRY);
+		error = VOP_GETATTR(lowervp, va, FSCRED);
+		VOP_UNLOCK(lowervp);
+		if (error == 0)
 			lowersz = va.va_size;
+	}
 	hash = UNION_HASH(uppervp, lowervp);
 
 	/*
@@ -1213,18 +1217,16 @@ union_readdirhook(struct vnode **vpp, st
 	if (vp-v_op != union_vnodeop_p)
 		return (0);
 
-	if ((lvp = union_dircache(vp, l)) == NULLVP)
-		return (0);
-
 	/*
 	 * If the directory is opaque,
 	 * then don't show lower entries
 	 */
 	error = VOP_GETATTR(vp, va, fp-f_cred);
-	if (error || (va.va_flags  OPAQUE)) {
-		vput(lvp);
-		return (error);
-	}
+	if (error || (va.va_flags  OPAQUE))
+		return error;
+
+	if ((lvp = union_dircache(vp, l)) == NULLVP)
+		return (0);
 
 	error = VOP_OPEN(lvp, FREAD, fp-f_cred);
 	if (error) {

Index: src/sys/fs/union/union_vnops.c
diff -u src/sys/fs/union/union_vnops.c:1.46 src/sys/fs/union/union_vnops.c:1.47
--- src/sys/fs/union/union_vnops.c:1.46	Tue Aug 23 07:39:37 2011
+++ src/sys/fs/union/union_vnops.c	Tue Oct 18 09:22:53 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_vnops.c,v 1.46 2011/08/23 07:39:37 hannken Exp $	*/
+/*	$NetBSD: union_vnops.c,v 1.47 2011/10/18 09:22:53 hannken Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993, 1994, 1995
@@ -72,7 +72,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: union_vnops.c,v 1.46 2011/08/23 07:39:37 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: union_vnops.c,v 1.47 2011/10/18 09:22:53 hannken Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -830,14 +830,6 @@ union_getattr(void *v)
 
 	vp = un-un_uppervp;
 	if (vp != NULLVP) {
-		/*
-		 * It's not clear whether VOP_GETATTR is to be
-		 * called with the vnode locked or not.  stat() calls
-		 * it with (vp) locked, and fstat calls it with
-		 * (vp) unlocked.
-		 * In the mean time, compensate here by checking
-		 * the union_node's lock flag.
-		 */
 		if (un-un_flags  UN_LOCKED)
 			FIXUP(un);
 
@@ -858,7 +850,11 @@ union_getattr(void *v)
 	}
 
 	if (vp != NULLVP) {
+		if (vp == un-un_lowervp)
+			vn_lock(vp, LK_SHARED | LK_RETRY);
 		error = VOP_GETATTR(vp, vap, ap-a_cred);
+		if (vp == un-un_lowervp)
+			VOP_UNLOCK(vp);
 		if (error)
 			return (error);
 		union_newsize(ap-a_vp, VNOVAL, vap-va_size);



CVS commit: src

2011-10-18 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Oct 18 09:50:25 UTC 2011

Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man4: Makefile
Added Files:
src/share/man/man4: vmt.4

Log Message:
Add vmt(4) from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.1348 -r1.1349 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.570 -r1.571 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man4/vmt.4

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/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1348 src/distrib/sets/lists/man/mi:1.1349
--- src/distrib/sets/lists/man/mi:1.1348	Tue Oct 11 19:34:39 2011
+++ src/distrib/sets/lists/man/mi	Tue Oct 18 09:50:24 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1348 2011/10/11 19:34:39 christos Exp $
+# $NetBSD: mi,v 1.1349 2011/10/18 09:50:24 wiz Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -1788,6 +1788,7 @@
 ./usr/share/man/cat4/vlan.0			man-sys-catman		.cat
 ./usr/share/man/cat4/vmmon.0			man-sys-catman		.cat
 ./usr/share/man/cat4/vmnet.0			man-sys-catman		.cat
+./usr/share/man/cat4/vmt.0			man-sys-catman		.cat
 ./usr/share/man/cat4/vnd.0			man-sys-catman		.cat
 ./usr/share/man/cat4/vr.0			man-sys-catman		.cat
 ./usr/share/man/cat4/vte.0			man-sys-catman		.cat
@@ -4544,6 +4545,7 @@
 ./usr/share/man/html4/vlan.html			man-sys-htmlman		html
 ./usr/share/man/html4/vmmon.html		man-sys-htmlman		html
 ./usr/share/man/html4/vmnet.html		man-sys-htmlman		html
+./usr/share/man/html4/vmt.html		man-sys-htmlman		html
 ./usr/share/man/html4/vnd.html			man-sys-htmlman		html
 ./usr/share/man/html4/vr.html			man-sys-htmlman		html
 ./usr/share/man/html4/vte.html			man-sys-htmlman		html
@@ -7235,6 +7237,7 @@
 ./usr/share/man/man4/vlan.4			man-sys-man		.man
 ./usr/share/man/man4/vmmon.4			man-sys-man		.man
 ./usr/share/man/man4/vmnet.4			man-sys-man		.man
+./usr/share/man/man4/vmt.4			man-sys-man		.man
 ./usr/share/man/man4/vnd.4			man-sys-man		.man
 ./usr/share/man/man4/vr.4			man-sys-man		.man
 ./usr/share/man/man4/vte.4			man-sys-man		.man

Index: src/share/man/man4/Makefile
diff -u src/share/man/man4/Makefile:1.570 src/share/man/man4/Makefile:1.571
--- src/share/man/man4/Makefile:1.570	Thu Sep 29 23:35:48 2011
+++ src/share/man/man4/Makefile	Tue Oct 18 09:50:24 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.570 2011/09/29 23:35:48 sjg Exp $
+#	$NetBSD: Makefile,v 1.571 2011/10/18 09:50:24 wiz Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -61,7 +61,7 @@ MAN=	aac.4 ac97.4 acardide.4 aceride.4 a
 	tp.4 tr.4 tra.4 trm.4 tty.4 tun.4 tqphy.4 twa.4 twe.4 txp.4 \
 	uark.4 ubsec.4 udp.4 uep.4 ug.4 uha.4 uk.4 ukphy.4 unix.4 userconf.4 \
 	vald.4 veriexec.4 vga.4 vge.4 viaide.4 video.4 virt.4 vlan.4 vmmon.4 \
-	vmnet.4 vnd.4 vr.4 vte.4 \
+	vmnet.4 vmt.4 vnd.4 vr.4 vte.4 \
 	wapbl.4 wb.4 wbsio.4 wd.4 wdc.4 wi.4 wm.4 wpi.4 \
 	wscons.4 wsdisplay.4 wsfont.4 wskbd.4 wsmouse.4 wsmux.4 \
 	xbox.4 xge.4 \

Added files:

Index: src/share/man/man4/vmt.4
diff -u /dev/null src/share/man/man4/vmt.4:1.1
--- /dev/null	Tue Oct 18 09:50:25 2011
+++ src/share/man/man4/vmt.4	Tue Oct 18 09:50:24 2011
@@ -0,0 +1,59 @@
+.\	$NetBSD: vmt.4,v 1.1 2011/10/18 09:50:24 wiz Exp $
+.\	$OpenBSD: vmt.4,v 1.4 2010/10/26 05:07:31 jmc Exp $
+.\
+.\ Copyright (c) 2008 Marco Peereboom ma...@openbsd.org
+.\ Text was heavily borrowed from the IPMI spec V1.5
+.\
+.\ Permission to use, copy, modify, and distribute this software for any
+.\ purpose with or without fee is hereby granted, provided that the above
+.\ copyright notice and this permission notice appear in all copies.
+.\
+.\ THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\ ACTION OF CONTRACT, NEGLIGENCE OR TORTIOUS ACTION, ARISING OUT OF
+.\ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.Dd October 18, 2011
+.Dt VMT 4
+.Os
+.Sh NAME
+.Nm vmt
+.Nd VMware Tools driver
+.Sh SYNOPSIS
+.Cd vmt0 at mainbus0
+.Sh DESCRIPTION
+The
+.Nm
+driver is a kernel level implementation of VMware Tools.
+VMware Tools are intended to provide better support for operating systems
+running inside virtual machines.
+.Pp
+.Nm
+handles shutdown and reboot requests from the host by signalling
+.Xr init 8
+with SIGUSR2 and SIGINT respectively.
+.Nm
+will log notifications that the guest has been suspended or resumed by the
+host.
+It also provides access to the host machine's clock as a timedelta sensor.
+.Pp
+.Nm
+reports the guest's hostname and first non-loopback IP address to the host.
+.Sh SEE ALSO

CVS commit: src

2011-10-18 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Oct 18 10:19:12 UTC 2011

Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man4: Makefile
src/share/man/man4/man4.x86: Makefile
Added Files:
src/share/man/man4/man4.x86: vmt.4
Removed Files:
src/share/man/man4: vmt.4

Log Message:
Move vmt(4) to x86 subdir.
No obsolete entries added for set lists since original import was just an
hour ago.


To generate a diff of this commit:
cvs rdiff -u -r1.1349 -r1.1350 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.571 -r1.572 src/share/man/man4/Makefile
cvs rdiff -u -r1.1 -r0 src/share/man/man4/vmt.4
cvs rdiff -u -r1.11 -r1.12 src/share/man/man4/man4.x86/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man4/man4.x86/vmt.4

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/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1349 src/distrib/sets/lists/man/mi:1.1350
--- src/distrib/sets/lists/man/mi:1.1349	Tue Oct 18 09:50:24 2011
+++ src/distrib/sets/lists/man/mi	Tue Oct 18 10:19:11 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1349 2011/10/18 09:50:24 wiz Exp $
+# $NetBSD: mi,v 1.1350 2011/10/18 10:19:11 wiz Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -64,8 +64,8 @@
 ./usr/share/man/cat1/atf-version.0		man-atf-catman		.cat,atf
 ./usr/share/man/cat1/atq.0			man-cron-catman		.cat
 ./usr/share/man/cat1/atrm.0			man-cron-catman		.cat
-./usr/share/man/cat1/audioctl.0			man-audio-catman	.cat
 ./usr/share/man/cat1/audiocfg.0			man-audio-catman	.cat
+./usr/share/man/cat1/audioctl.0			man-audio-catman	.cat
 ./usr/share/man/cat1/audioplay.0		man-audio-catman	.cat
 ./usr/share/man/cat1/audiorecord.0		man-audio-catman	.cat
 ./usr/share/man/cat1/audit-packages.0		man-obsolete		obsolete
@@ -101,9 +101,9 @@
 ./usr/share/man/cat1/chsh.0			man-util-catman		.cat
 ./usr/share/man/cat1/ci.0			man-rcs-catman		.cat
 ./usr/share/man/cat1/cksum.0			man-util-catman		.cat
+./usr/share/man/cat1/cleantags.0		man-util-catman		.cat
 ./usr/share/man/cat1/clear.0			man-util-catman		.cat
 ./usr/share/man/cat1/cmp.0			man-util-catman		.cat
-./usr/share/man/cat1/cleantags.0		man-util-catman		.cat
 ./usr/share/man/cat1/co.0			man-rcs-catman		.cat
 ./usr/share/man/cat1/col.0			man-util-catman		.cat
 ./usr/share/man/cat1/colcrt.0			man-util-catman		.cat
@@ -1788,7 +1788,6 @@
 ./usr/share/man/cat4/vlan.0			man-sys-catman		.cat
 ./usr/share/man/cat4/vmmon.0			man-sys-catman		.cat
 ./usr/share/man/cat4/vmnet.0			man-sys-catman		.cat
-./usr/share/man/cat4/vmt.0			man-sys-catman		.cat
 ./usr/share/man/cat4/vnd.0			man-sys-catman		.cat
 ./usr/share/man/cat4/vr.0			man-sys-catman		.cat
 ./usr/share/man/cat4/vte.0			man-sys-catman		.cat
@@ -1839,6 +1838,7 @@
 ./usr/share/man/cat4/x86/mem.0			man-sys-catman		.cat
 ./usr/share/man/cat4/x86/odcm.0			man-sys-catman		.cat
 ./usr/share/man/cat4/x86/powernow.0		man-sys-catman		.cat
+./usr/share/man/cat4/x86/vmt.0			man-sys-catman		.cat
 ./usr/share/man/cat4/xbd.0			man-sys-catman		.cat
 ./usr/share/man/cat4/xbdback.0			man-sys-catman		.cat
 ./usr/share/man/cat4/xbox.0			man-sys-catman		.cat
@@ -2982,8 +2982,8 @@
 ./usr/share/man/html1/atf-version.html		man-atf-htmlman		html,atf
 ./usr/share/man/html1/atq.html			man-cron-htmlman	html
 ./usr/share/man/html1/atrm.html			man-cron-htmlman	html
-./usr/share/man/html1/audioctl.html		man-audio-htmlman	html
 ./usr/share/man/html1/audiocfg.html		man-audio-htmlman	html
+./usr/share/man/html1/audioctl.html		man-audio-htmlman	html
 ./usr/share/man/html1/audioplay.html		man-audio-htmlman	html
 ./usr/share/man/html1/audiorecord.html		man-audio-htmlman	html
 ./usr/share/man/html1/audit-packages.html	man-obsolete		obsolete
@@ -3019,9 +3019,9 @@
 ./usr/share/man/html1/chsh.html			man-util-htmlman	html
 ./usr/share/man/html1/ci.html			man-rcs-htmlman		html
 ./usr/share/man/html1/cksum.html		man-util-htmlman	html
+./usr/share/man/html1/cleantags.html		man-util-htmlman	html
 ./usr/share/man/html1/clear.html		man-util-htmlman	html
 ./usr/share/man/html1/cmp.html			man-util-htmlman	html
-./usr/share/man/html1/cleantags.html		man-util-htmlman	html
 ./usr/share/man/html1/co.html			man-rcs-htmlman		html
 ./usr/share/man/html1/col.html			man-util-htmlman	html
 ./usr/share/man/html1/colcrt.html		man-util-htmlman	html
@@ -4042,8 +4042,8 @@
 ./usr/share/man/html4/lc.html			man-sys-htmlman		html
 ./usr/share/man/html4/ld.html			man-sys-htmlman		html
 ./usr/share/man/html4/le.html			man-sys-htmlman		html
-./usr/share/man/html4/lii.html			man-sys-htmlman		html
 ./usr/share/man/html4/lg3303.html		man-sys-htmlman		html
+./usr/share/man/html4/lii.html			man-sys-htmlman		html
 ./usr/share/man/html4/lkm.html			man-obsolete		obsolete
 ./usr/share/man/html4/lm.html			man-sys-htmlman		html
 ./usr/share/man/html4/lmc.html			man-sys-htmlman		html
@@ -4545,7 +4545,6 @@
 ./usr/share/man/html4/vlan.html			

CVS commit: src/share/man/man4/man4.x86

2011-10-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 18 11:31:55 UTC 2011

Modified Files:
src/share/man/man4/man4.x86: vmt.4

Log Message:
update vmt man page with netbsd changes


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/man4.x86/vmt.4

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

Modified files:

Index: src/share/man/man4/man4.x86/vmt.4
diff -u src/share/man/man4/man4.x86/vmt.4:1.1 src/share/man/man4/man4.x86/vmt.4:1.2
--- src/share/man/man4/man4.x86/vmt.4:1.1	Tue Oct 18 10:19:12 2011
+++ src/share/man/man4/man4.x86/vmt.4	Tue Oct 18 11:31:54 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: vmt.4,v 1.1 2011/10/18 10:19:12 wiz Exp $
+.\	$NetBSD: vmt.4,v 1.2 2011/10/18 11:31:54 jmcneill Exp $
 .\	$OpenBSD: vmt.4,v 1.4 2010/10/26 05:07:31 jmc Exp $
 .\
 .\ Copyright (c) 2008 Marco Peereboom ma...@openbsd.org
@@ -22,7 +22,7 @@
 .Nm vmt
 .Nd VMware Tools driver
 .Sh SYNOPSIS
-.Cd vmt0 at mainbus0
+.Cd vmt0 at cpufeaturebus*
 .Sh DESCRIPTION
 The
 .Nm
@@ -31,20 +31,22 @@ VMware Tools are intended to provide bet
 running inside virtual machines.
 .Pp
 .Nm
-handles shutdown and reboot requests from the host by signalling
-.Xr init 8
-with SIGUSR2 and SIGINT respectively.
+handles shutdown, reboot, resume requests from the host by sending
+events using
+.Xr sysmon_pswitch 9
+of type PSWITCH_TYPE_POWER, PSWITCH_TYPE_RESET, and PSWITCH_TYPE_SLEEP that
+can be handled by
+.Xr powerd 9 .
 .Nm
 will log notifications that the guest has been suspended or resumed by the
 host.
-It also provides access to the host machine's clock as a timedelta sensor.
+.\ It also provides access to the host machine's clock as a timedelta sensor.
 .Pp
 .Nm
 reports the guest's hostname and first non-loopback IP address to the host.
 .Sh SEE ALSO
-.Xr init 8 ,
-,\ .Xr sensorsd 8 ,
-.Xr sysctl 8
+.Xr cpu 4
+.Xr powerd 8
 .Sh HISTORY
 The
 .Nm



CVS commit: src/sys

2011-10-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 18 12:25:31 UTC 2011

Modified Files:
src/sys/kern: kern_module.c
src/sys/sys: module.h

Log Message:
Don't try to auto-unload modules unless they were auto-loaded.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/kern/kern_module.c
cvs rdiff -u -r1.27 -r1.28 src/sys/sys/module.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/kern_module.c
diff -u src/sys/kern/kern_module.c:1.82 src/sys/kern/kern_module.c:1.83
--- src/sys/kern/kern_module.c:1.82	Mon Sep 19 00:40:22 2011
+++ src/sys/kern/kern_module.c	Tue Oct 18 12:25:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_module.c,v 1.82 2011/09/19 00:40:22 pgoyette Exp $	*/
+/*	$NetBSD: kern_module.c,v 1.83 2011/10/18 12:25:31 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_module.c,v 1.82 2011/09/19 00:40:22 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_module.c,v 1.83 2011/10/18 12:25:31 jmcneill Exp $);
 
 #define _MODULE_INTERNAL
 
@@ -1089,6 +1089,7 @@ module_do_load(const char *name, bool is
 		 * a short delay.
 		 */
 		mod-mod_autotime = time_second + module_autotime;
+		mod-mod_flags |= MODFLG_AUTO_LOADED;
 		module_thread_kick();
 	}
 	depth--;
@@ -1273,8 +1274,14 @@ module_thread(void *cookie)
 		kernconfig_lock();
 		for (mod = TAILQ_FIRST(module_list); mod != NULL; mod = next) {
 			next = TAILQ_NEXT(mod, mod_chain);
+
+			/* skip built-in modules */
 			if (mod-mod_source == MODULE_SOURCE_KERNEL)
 continue;
+			/* skip modules that weren't auto-loaded */
+			if ((mod-mod_flags  MODFLG_AUTO_LOADED) == 0)
+continue;
+
 			if (uvmexp.free  uvmexp.freemin) {
 module_thread_ticks = hz;
 			} else if (mod-mod_autotime == 0) {
@@ -1285,6 +1292,7 @@ module_thread(void *cookie)
 			} else {
 mod-mod_autotime = 0;
 			}
+
 			/*
 			 * If this module wants to avoid autounload then
 			 * skip it.  Some modules can ping-pong in and out

Index: src/sys/sys/module.h
diff -u src/sys/sys/module.h:1.27 src/sys/sys/module.h:1.28
--- src/sys/sys/module.h:1.27	Sat Aug 13 21:04:07 2011
+++ src/sys/sys/module.h	Tue Oct 18 12:25:30 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: module.h,v 1.27 2011/08/13 21:04:07 christos Exp $	*/
+/*	$NetBSD: module.h,v 1.28 2011/10/18 12:25:30 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -92,6 +92,7 @@ typedef struct module {
 	u_int			mod_fbtentries;	/* DTrace FBT entrie count */
 	int			mod_flags;
 #define MODFLG_MUST_FORCE	0x01
+#define MODFLG_AUTO_LOADED	0x02
 
 } module_t;
 



CVS commit: src/doc

2011-10-18 Thread Jeremy C. Reed
Module Name:src
Committed By:   reed
Date:   Tue Oct 18 12:42:19 UTC 2011

Modified Files:
src/doc: 3RDPARTY

Log Message:
Add missing Notes: line for pdksh entry. (Noticed by Snader_LB on IRC.)


To generate a diff of this commit:
cvs rdiff -u -r1.879 -r1.880 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.879 src/doc/3RDPARTY:1.880
--- src/doc/3RDPARTY:1.879	Thu Oct 13 23:42:06 2011
+++ src/doc/3RDPARTY	Tue Oct 18 12:42:19 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.879 2011/10/13 23:42:06 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.880 2011/10/18 12:42:19 reed Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -859,6 +859,7 @@ Home Page:	http://www.cs.mun.ca/~michael
 Mailing List:
 Responsible:	jdolecek
 License:	Public domain
+Notes:
 pdksh-5.2.14-patches.1 and pdksh-5.2.14-patches.2 have been applied.
 
 Package:	PF (openbsd packet filter)



CVS commit: src/share/man/man9

2011-10-18 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Oct 18 14:12:05 UTC 2011

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

Log Message:
Note that manually loaded modules are not auto-unloaded.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/share/man/man9/module.9

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

Modified files:

Index: src/share/man/man9/module.9
diff -u src/share/man/man9/module.9:1.27 src/share/man/man9/module.9:1.28
--- src/share/man/man9/module.9:1.27	Sun Feb 13 16:50:16 2011
+++ src/share/man/man9/module.9	Tue Oct 18 14:12:04 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: module.9,v 1.27 2011/02/13 16:50:16 jym Exp $
+.\	$NetBSD: module.9,v 1.28 2011/10/18 14:12:04 jruoho Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd February 13, 2011
+.Dd October 18, 2011
 .Dt MODULE 9
 .Os
 .Sh NAME
@@ -414,6 +414,9 @@ command in its
 routine, or use
 .Fn module_hold
 to increment its reference count.
+Note however that modules loaded manually with
+.Xr modload 8
+are never auto-unloaded.
 .El
 .Sh CODE REFERENCES
 The core of the kernel module implementation is in



CVS commit: src/tests/lib/libm

2011-10-18 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Oct 18 14:16:42 UTC 2011

Modified Files:
src/tests/lib/libm: t_cosh.c t_sinh.c

Log Message:
Reduce tolerance even more.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libm/t_cosh.c \
src/tests/lib/libm/t_sinh.c

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

Modified files:

Index: src/tests/lib/libm/t_cosh.c
diff -u src/tests/lib/libm/t_cosh.c:1.3 src/tests/lib/libm/t_cosh.c:1.4
--- src/tests/lib/libm/t_cosh.c:1.3	Tue Oct 18 04:51:01 2011
+++ src/tests/lib/libm/t_cosh.c	Tue Oct 18 14:16:42 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: t_cosh.c,v 1.3 2011/10/18 04:51:01 jruoho Exp $ */
+/* $NetBSD: t_cosh.c,v 1.4 2011/10/18 14:16:42 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_cosh.c,v 1.3 2011/10/18 04:51:01 jruoho Exp $);
+__RCSID($NetBSD: t_cosh.c,v 1.4 2011/10/18 14:16:42 jruoho Exp $);
 
 #include atf-c.h
 #include math.h
@@ -163,7 +163,7 @@ ATF_TC_BODY(coshf_def, tc)
 {
 #ifndef __vax__
 	const double x[] = { 0.005, 0.05, 0.0, 1.0, 10.0, 20.0 };
-	const float eps = 1.0e-7;
+	const float eps = 1.0e-3;
 	float y, z;
 	size_t i;
 
Index: src/tests/lib/libm/t_sinh.c
diff -u src/tests/lib/libm/t_sinh.c:1.3 src/tests/lib/libm/t_sinh.c:1.4
--- src/tests/lib/libm/t_sinh.c:1.3	Tue Oct 18 04:51:01 2011
+++ src/tests/lib/libm/t_sinh.c	Tue Oct 18 14:16:42 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: t_sinh.c,v 1.3 2011/10/18 04:51:01 jruoho Exp $ */
+/* $NetBSD: t_sinh.c,v 1.4 2011/10/18 14:16:42 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_sinh.c,v 1.3 2011/10/18 04:51:01 jruoho Exp $);
+__RCSID($NetBSD: t_sinh.c,v 1.4 2011/10/18 14:16:42 jruoho Exp $);
 
 #include atf-c.h
 #include math.h
@@ -48,7 +48,7 @@ ATF_TC_BODY(sinh_def, tc)
 {
 #ifndef __vax__
 	const double x[] = { 0.005, 0.05, 0.0, 1.0, 10.0, 20.0 };
-	const double eps = 1.0e-8;
+	const double eps = 1.0e-4;
 	double y, z;
 	size_t i;
 
@@ -165,7 +165,7 @@ ATF_TC_BODY(sinhf_def, tc)
 {
 #ifndef __vax__
 	const float x[] = { 0.005, 0.05, 0.0, 1.0, 10.0, 20.0 };
-	const float eps = 1.0e-4;
+	const float eps = 1.0e-2;
 	float y, z;
 	size_t i;
 



CVS commit: src/share/man/man4/man4.x86

2011-10-18 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Oct 18 14:25:06 UTC 2011

Modified Files:
src/share/man/man4/man4.x86: vmt.4

Log Message:
Fix xref; comment out cpu(4) reference, does not exist.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/man4.x86/vmt.4

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

Modified files:

Index: src/share/man/man4/man4.x86/vmt.4
diff -u src/share/man/man4/man4.x86/vmt.4:1.2 src/share/man/man4/man4.x86/vmt.4:1.3
--- src/share/man/man4/man4.x86/vmt.4:1.2	Tue Oct 18 11:31:54 2011
+++ src/share/man/man4/man4.x86/vmt.4	Tue Oct 18 14:25:06 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: vmt.4,v 1.2 2011/10/18 11:31:54 jmcneill Exp $
+.\	$NetBSD: vmt.4,v 1.3 2011/10/18 14:25:06 wiz Exp $
 .\	$OpenBSD: vmt.4,v 1.4 2010/10/26 05:07:31 jmc Exp $
 .\
 .\ Copyright (c) 2008 Marco Peereboom ma...@openbsd.org
@@ -36,7 +36,7 @@ events using
 .Xr sysmon_pswitch 9
 of type PSWITCH_TYPE_POWER, PSWITCH_TYPE_RESET, and PSWITCH_TYPE_SLEEP that
 can be handled by
-.Xr powerd 9 .
+.Xr powerd 8 .
 .Nm
 will log notifications that the guest has been suspended or resumed by the
 host.
@@ -45,7 +45,7 @@ host.
 .Nm
 reports the guest's hostname and first non-loopback IP address to the host.
 .Sh SEE ALSO
-.Xr cpu 4
+.\ .Xr cpu 4 ,
 .Xr powerd 8
 .Sh HISTORY
 The



CVS commit: src/sys/fs/puffs

2011-10-18 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Tue Oct 18 15:39:09 UTC 2011

Modified Files:
src/sys/fs/puffs: puffs_msgif.c puffs_node.c puffs_vfsops.c
puffs_vnops.c

Log Message:
Make sure pagedaemon does not sleep for memory in puffs_vnop_sleep.
Add KASSERT on any sleeping memory allocation to check it cannot happen again.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/fs/puffs/puffs_msgif.c
cvs rdiff -u -r1.20 -r1.21 src/sys/fs/puffs/puffs_node.c
cvs rdiff -u -r1.98 -r1.99 src/sys/fs/puffs/puffs_vfsops.c
cvs rdiff -u -r1.158 -r1.159 src/sys/fs/puffs/puffs_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/fs/puffs/puffs_msgif.c
diff -u src/sys/fs/puffs/puffs_msgif.c:1.87 src/sys/fs/puffs/puffs_msgif.c:1.88
--- src/sys/fs/puffs/puffs_msgif.c:1.87	Sun Jul  3 08:57:43 2011
+++ src/sys/fs/puffs/puffs_msgif.c	Tue Oct 18 15:39:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_msgif.c,v 1.87 2011/07/03 08:57:43 mrg Exp $	*/
+/*	$NetBSD: puffs_msgif.c,v 1.88 2011/10/18 15:39:09 manu Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: puffs_msgif.c,v 1.87 2011/07/03 08:57:43 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: puffs_msgif.c,v 1.88 2011/10/18 15:39:09 manu Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -44,6 +44,8 @@ __KERNEL_RCSID(0, $NetBSD: puffs_msgif.
 #include sys/vnode.h
 #include sys/atomic.h
 
+#include uvm/uvm.h
+
 #include dev/putter/putter_sys.h
 
 #include fs/puffs/puffs_msgif.h
@@ -132,6 +134,10 @@ puffs_msgpark_alloc(int waitok)
 {
 	struct puffs_msgpark *park;
 
+#ifdef DIAGNOSTIC
+	if (curlwp == uvm.pagedaemon_lwp)
+		KASSERT(!waitok);
+#endif
 	park = pool_cache_get(parkpc, waitok ? PR_WAITOK : PR_NOWAIT);
 	if (park == NULL)
 		return park;
@@ -232,6 +238,10 @@ puffs_msgmem_alloc(size_t len, struct pu
 	struct puffs_msgpark *park;
 	void *m;
 
+#ifdef DIAGNOSTIC
+	if (curlwp == uvm.pagedaemon_lwp)
+		KASSERT(!cansleep);
+#endif
 	m = kmem_zalloc(len, cansleep ? KM_SLEEP : KM_NOSLEEP);
 	if (m == NULL) {
 		KASSERT(cansleep == 0);
@@ -950,6 +960,9 @@ puffs_msgif_dispatch(void *this, struct 
 		}
 		pf = (struct puffs_flush *)preq;
 
+#ifdef DIAGNOSTIC
+		KASSERT(curlwp != uvm.pagedaemon_lwp);
+#endif
 		psopr = kmem_alloc(sizeof(*psopr), KM_SLEEP);
 		memcpy(psopr-psopr_pf, pf, sizeof(*pf));
 		psopr-psopr_sopreq = PUFFS_SOPREQ_FLUSH;
@@ -973,6 +986,9 @@ puffs_msgif_dispatch(void *this, struct 
 
 		DPRINTF((dispatch: unmount 0x%x\n, preq-preq_optype));
 
+#ifdef DIAGNOSTIC
+		KASSERT(curlwp != uvm.pagedaemon_lwp);
+#endif
 		psopr = kmem_alloc(sizeof(*psopr), KM_SLEEP);
 		psopr-psopr_preq = *preq;
 		psopr-psopr_sopreq = PUFFS_SOPREQ_UNMOUNT;

Index: src/sys/fs/puffs/puffs_node.c
diff -u src/sys/fs/puffs/puffs_node.c:1.20 src/sys/fs/puffs/puffs_node.c:1.21
--- src/sys/fs/puffs/puffs_node.c:1.20	Mon Aug 29 04:12:45 2011
+++ src/sys/fs/puffs/puffs_node.c	Tue Oct 18 15:39:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_node.c,v 1.20 2011/08/29 04:12:45 manu Exp $	*/
+/*	$NetBSD: puffs_node.c,v 1.21 2011/10/18 15:39:09 manu Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: puffs_node.c,v 1.20 2011/08/29 04:12:45 manu Exp $);
+__KERNEL_RCSID(0, $NetBSD: puffs_node.c,v 1.21 2011/10/18 15:39:09 manu Exp $);
 
 #include sys/param.h
 #include sys/hash.h
@@ -40,6 +40,8 @@ __KERNEL_RCSID(0, $NetBSD: puffs_node.c
 #include sys/namei.h
 #include sys/vnode.h
 
+#include uvm/uvm.h
+
 #include fs/puffs/puffs_msgif.h
 #include fs/puffs/puffs_sys.h
 
@@ -228,6 +230,10 @@ puffs_newnode(struct mount *mp, struct v
 			return EPROTO;
 		}
 	}
+
+#ifdef DIAGNOSTIC
+	KASSERT(curlwp != uvm.pagedaemon_lwp);
+#endif
 	pnc = kmem_alloc(sizeof(struct puffs_newcookie), KM_SLEEP);
 	pnc-pnc_cookie = ck;
 	LIST_INSERT_HEAD(pmp-pmp_newcookie, pnc, pnc_entries);

Index: src/sys/fs/puffs/puffs_vfsops.c
diff -u src/sys/fs/puffs/puffs_vfsops.c:1.98 src/sys/fs/puffs/puffs_vfsops.c:1.99
--- src/sys/fs/puffs/puffs_vfsops.c:1.98	Fri Oct  7 09:35:05 2011
+++ src/sys/fs/puffs/puffs_vfsops.c	Tue Oct 18 15:39:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_vfsops.c,v 1.98 2011/10/07 09:35:05 hannken Exp $	*/
+/*	$NetBSD: puffs_vfsops.c,v 1.99 2011/10/18 15:39:09 manu Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: puffs_vfsops.c,v 1.98 2011/10/07 09:35:05 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: puffs_vfsops.c,v 1.99 2011/10/18 15:39:09 manu Exp $);
 
 #include sys/param.h
 #include sys/mount.h
@@ -44,6 +44,8 @@ __KERNEL_RCSID(0, $NetBSD: puffs_vfsops
 #include sys/module.h
 #include sys/kthread.h
 
+#include uvm/uvm.h
+
 #include dev/putter/putter_sys.h
 
 

CVS commit: src/lib/libperfuse

2011-10-18 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Tue Oct 18 15:47:32 UTC 2011

Modified Files:
src/lib/libperfuse: perfuse.c

Log Message:
mlockall is not necessary after all, once we have fixed a kernel bug involving
agedaemon sleeping form memory


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libperfuse/perfuse.c

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

Modified files:

Index: src/lib/libperfuse/perfuse.c
diff -u src/lib/libperfuse/perfuse.c:1.20 src/lib/libperfuse/perfuse.c:1.21
--- src/lib/libperfuse/perfuse.c:1.20	Fri Sep  9 22:51:44 2011
+++ src/lib/libperfuse/perfuse.c	Tue Oct 18 15:47:32 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: perfuse.c,v 1.20 2011/09/09 22:51:44 christos Exp $ */
+/*  $NetBSD: perfuse.c,v 1.21 2011/10/18 15:47:32 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -400,13 +400,6 @@ perfuse_init(pc, pmi)
 	struct puffs_node *pn_root;
 	struct puffs_pathobj *po_root;
 
-	/*
-	 * perfused needs to remain in memory. If it gets
-	 * swapped out, the kernel will deadlock when trying
-	 * to free memory backed by the PUFFS filesystem
-	 */
-	mlockall(MCL_CURRENT|MCL_FUTURE);
-
 	ps = init_state();
 	ps-ps_owner_uid = pmi-pmi_uid;
 



CVS commit: src/sys/fs/udf

2011-10-18 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Oct 18 20:20:30 UTC 2011

Modified Files:
src/sys/fs/udf: udf_vnops.c

Log Message:
VOP_GETATTR() needs a shared lock at least.

While here fix a typo (fvp - tvp).


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/fs/udf/udf_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/fs/udf/udf_vnops.c
diff -u src/sys/fs/udf/udf_vnops.c:1.67 src/sys/fs/udf/udf_vnops.c:1.68
--- src/sys/fs/udf/udf_vnops.c:1.67	Tue Sep 27 01:33:30 2011
+++ src/sys/fs/udf/udf_vnops.c	Tue Oct 18 20:20:29 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_vnops.c,v 1.67 2011/09/27 01:33:30 christos Exp $ */
+/* $NetBSD: udf_vnops.c,v 1.68 2011/10/18 20:20:29 hannken Exp $ */
 
 /*
  * Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -32,7 +32,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__KERNEL_RCSID(0, $NetBSD: udf_vnops.c,v 1.67 2011/09/27 01:33:30 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: udf_vnops.c,v 1.68 2011/10/18 20:20:29 hannken Exp $);
 #endif /* not lint */
 
 
@@ -1978,13 +1978,15 @@ udf_rename(void *v)
 	}
 
 	/* get info about the node to be moved */
+	vn_lock(fvp, LK_SHARED | LK_RETRY);
 	error = VOP_GETATTR(fvp, fvap, FSCRED);
+	VOP_UNLOCK(fvp);
 	KASSERT(error == 0);
 
 	/* check when to delete the old already existing entry */
 	if (tvp) {
 		/* get info about the node to be moved to */
-		error = VOP_GETATTR(fvp, tvap, FSCRED);
+		error = VOP_GETATTR(tvp, tvap, FSCRED);
 		KASSERT(error == 0);
 
 		/* if both dirs, make sure the destination is empty */



CVS commit: src/usr.bin/pmap

2011-10-18 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Tue Oct 18 20:54:57 UTC 2011

Modified Files:
src/usr.bin/pmap: main.c

Log Message:
Disallow printing of kernel mappings if we are not root.

pid 0 is a special case for kill(pid, 0), and unlikely to be the
correct test there. This follows the procfs mem rights changes that
happened some time ago.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/pmap/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/usr.bin/pmap/main.c
diff -u src/usr.bin/pmap/main.c:1.21 src/usr.bin/pmap/main.c:1.22
--- src/usr.bin/pmap/main.c:1.21	Thu Jun 23 22:50:53 2011
+++ src/usr.bin/pmap/main.c	Tue Oct 18 20:54:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.21 2011/06/23 22:50:53 christos Exp $ */
+/*	$NetBSD: main.c,v 1.22 2011/10/18 20:54:56 jym Exp $ */
 
 /*
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: main.c,v 1.21 2011/06/23 22:50:53 christos Exp $);
+__RCSID($NetBSD: main.c,v 1.22 2011/10/18 20:54:56 jym Exp $);
 #endif
 
 #include sys/param.h
@@ -308,15 +308,23 @@ main(int argc, char *argv[])
 			}
 		}
 
+		/*
+		 * Only print mappings for processes we can send a signal(7)
+		 * to, or kernel mappings if we are root
+		 */
+		if (kill(pid, 0) == -1 ||
+		   (pid == 0  getuid() != 0)) {
+			errno = EPERM;
+			warn(%d, pid);
+			pid = -1;
+			continue;
+
+		}
+
 		/* find the process id */
 		if (pid == 0)
 			kproc = NULL;
 		else {
-			if (kill(pid, 0) == -1) {
-warn(%d, pid);
-pid = -1;
-continue;
-			}
 			kproc = kvm_getproc2(kd, KERN_PROC_PID, pid,
 	 sizeof(struct kinfo_proc2), rc);
 			if (kproc == NULL || rc == 0) {



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

2011-10-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 18 21:41:25 UTC 2011

Modified Files:
src/sys/arch/x86/x86: vmt.c

Log Message:
report guest type of other for i386 and other-64 for amd64


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x86/x86/vmt.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/x86/vmt.c
diff -u src/sys/arch/x86/x86/vmt.c:1.4 src/sys/arch/x86/x86/vmt.c:1.5
--- src/sys/arch/x86/x86/vmt.c:1.4	Tue Oct 18 00:31:07 2011
+++ src/sys/arch/x86/x86/vmt.c	Tue Oct 18 21:41:25 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: vmt.c,v 1.4 2011/10/18 00:31:07 jmcneill Exp $ */
+/* $NetBSD: vmt.c,v 1.5 2011/10/18 21:41:25 jmcneill Exp $ */
 /* $OpenBSD: vmt.c,v 1.11 2011/01/27 21:29:25 dtucker Exp $ */
 
 /*
@@ -46,6 +46,13 @@
 
 /* #define VMT_DEBUG */
 
+/* OS name to report to host */
+#ifdef __i386__
+#define VM_OS_NAME	other
+#else
+#define VM_OS_NAME	other-64
+#endif
+
 /* The magic number, always occupies the EAX register. */
 #define VM_MAGIC			0x564D5868
 
@@ -423,10 +430,10 @@ vmt_update_guest_info(struct vmt_softc *
 
 		/*
 		 * host doesn't like it if we send an OS name it doesn't recognise,
-		 * so use the closest match, which happens to be FreeBSD.
+		 * so use other for i386 and other-64 for amd64
 		 */
 		if (vm_rpc_send_rpci_tx(sc, SetGuestInfo  %d %s,
-		VM_GUEST_INFO_OS_NAME, FreeBSD) != 0) {
+		VM_GUEST_INFO_OS_NAME, VM_OS_NAME) != 0) {
 			device_printf(sc-sc_dev, unable to set guest OS\n);
 			sc-sc_rpc_error = 1;
 		}



CVS commit: src/sys/dev/pci

2011-10-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue Oct 18 23:04:35 UTC 2011

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

Log Message:
Reduce differences from if_ath_cardbus.c.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/pci/if_ath_pci.c

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

Modified files:

Index: src/sys/dev/pci/if_ath_pci.c
diff -u src/sys/dev/pci/if_ath_pci.c:1.44 src/sys/dev/pci/if_ath_pci.c:1.45
--- src/sys/dev/pci/if_ath_pci.c:1.44	Fri Oct  7 20:47:42 2011
+++ src/sys/dev/pci/if_ath_pci.c	Tue Oct 18 23:04:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ath_pci.c,v 1.44 2011/10/07 20:47:42 dyoung Exp $	*/
+/*	$NetBSD: if_ath_pci.c,v 1.45 2011/10/18 23:04:35 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -35,9 +35,35 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGES.
  */
+/*
+ * Copyright (c) 2003
+ *	Ichiro FUKUHARA ich...@ichiro.org.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ICHIRO FUKUHARA ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ICHIRO FUKUHARA OR THE VOICES IN HIS HEAD BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ath_pci.c,v 1.44 2011/10/07 20:47:42 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ath_pci.c,v 1.45 2011/10/18 23:04:35 dyoung Exp $);
 
 /*
  * PCI/Cardbus front-end for the Atheros Wireless LAN controller driver.



CVS commit: src/sys/arch/x86

2011-10-18 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Tue Oct 18 23:14:28 UTC 2011

Modified Files:
src/sys/arch/x86/include: pmap.h
src/sys/arch/x86/x86: pmap.c

Log Message:
Make pmaps (list of non-kernel pmaps) and pmaps_lock externally
visible. Required by pmap MD code that could reside in other
files, notably Xen's pmap.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/x86/include/pmap.h
cvs rdiff -u -r1.135 -r1.136 src/sys/arch/x86/x86/pmap.c

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

Modified files:

Index: src/sys/arch/x86/include/pmap.h
diff -u src/sys/arch/x86/include/pmap.h:1.42 src/sys/arch/x86/include/pmap.h:1.43
--- src/sys/arch/x86/include/pmap.h:1.42	Tue Sep 20 00:12:23 2011
+++ src/sys/arch/x86/include/pmap.h	Tue Oct 18 23:14:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.42 2011/09/20 00:12:23 jym Exp $	*/
+/*	$NetBSD: pmap.h,v 1.43 2011/10/18 23:14:28 jym Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -119,6 +119,12 @@
 LIST_HEAD(pmap_head, pmap); /* struct pmap_head: head of a pmap list */
 
 /*
+ * linked list of all non-kernel pmaps
+ */
+extern struct pmap_head pmaps;
+extern kmutex_t pmaps_lock;/* protects pmaps */
+
+/*
  * the pmap structure
  *
  * note that the pm_obj contains the lock pointer, the reference count,
@@ -245,6 +251,8 @@ u_int		x86_mmap_flags(paddr_t);
 
 bool		pmap_is_curpmap(struct pmap *);
 
+void		pmap_invalidate_pool_caches(void);
+
 vaddr_t reserve_dumppages(vaddr_t); /* XXX: not a pmap fn */
 
 typedef enum tlbwhy {

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.135 src/sys/arch/x86/x86/pmap.c:1.136
--- src/sys/arch/x86/x86/pmap.c:1.135	Tue Oct 11 23:53:31 2011
+++ src/sys/arch/x86/x86/pmap.c	Tue Oct 18 23:14:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.135 2011/10/11 23:53:31 yamt Exp $	*/
+/*	$NetBSD: pmap.c,v 1.136 2011/10/18 23:14:28 jym Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.135 2011/10/11 23:53:31 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.136 2011/10/18 23:14:28 jym Exp $);
 
 #include opt_user_ldt.h
 #include opt_lockdebug.h
@@ -325,7 +325,8 @@ pd_entry_t * const normal_pdes[] = PDES_
 
 long nkptp[] = NKPTP_INITIALIZER;
 
-static kmutex_t pmaps_lock;
+struct pmap_head pmaps;
+kmutex_t pmaps_lock;
 
 static vaddr_t pmap_maxkvaddr;
 
@@ -481,12 +482,6 @@ static vaddr_t virtual_avail __read_most
 static vaddr_t virtual_end __read_mostly;	/* VA of last free KVA */
 
 /*
- * linked list of all non-kernel pmaps
- */
-
-static struct pmap_head pmaps;
-
-/*
  * pool that pmap structures are allocated from
  */
 



CVS commit: src/sys/dev/pci

2011-10-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 18 23:23:07 UTC 2011

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
add a couple vmware product IDs


To generate a diff of this commit:
cvs rdiff -u -r1.1100 -r1.1101 src/sys/dev/pci/pcidevs

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

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1100 src/sys/dev/pci/pcidevs:1.1101
--- src/sys/dev/pci/pcidevs:1.1100	Thu Oct  6 22:13:35 2011
+++ src/sys/dev/pci/pcidevs	Tue Oct 18 23:23:07 2011
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1100 2011/10/06 22:13:35 jmcneill Exp $
+$NetBSD: pcidevs,v 1.1101 2011/10/18 23:23:07 jmcneill Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -4772,8 +4772,11 @@ product VLSI 82C975	0x0200	82C975
 product VLSI 82C925	0x0280	82C925
 
 /* VMware products */
-product VMWARE VIRTUAL	0x0710	Virtual SVGA
 product VMWARE VIRTUAL2 0x0405	Virtual SVGA II
+product VMWARE VIRTUAL	0x0710	Virtual SVGA
+product VMWARE VMCI	0x0740	Virtual Machine Communication Interface
+product VMWARE PCIB	0x0790	PCI Bridge
+product VMWARE PCIE	0x07a0	PCI Express Root Port
 
 /* Weitek products */
 product WEITEK P9000	0x9001	P9000



CVS commit: src/sys/dev/pci

2011-10-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 18 23:23:21 UTC 2011

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.1095 -r1.1096 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1094 -r1.1095 src/sys/dev/pci/pcidevs_data.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/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.1095 src/sys/dev/pci/pcidevs.h:1.1096
--- src/sys/dev/pci/pcidevs.h:1.1095	Thu Oct  6 22:13:50 2011
+++ src/sys/dev/pci/pcidevs.h	Tue Oct 18 23:23:20 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.1095 2011/10/06 22:13:50 jmcneill Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.1096 2011/10/18 23:23:20 jmcneill Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1100 2011/10/06 22:13:35 jmcneill Exp
+ *	NetBSD: pcidevs,v 1.1101 2011/10/18 23:23:07 jmcneill Exp
  */
 
 /*
@@ -4779,8 +4779,11 @@
 #define	PCI_PRODUCT_VLSI_82C925	0x0280		/* 82C925 */
 
 /* VMware products */
-#define	PCI_PRODUCT_VMWARE_VIRTUAL	0x0710		/* Virtual SVGA */
 #define	PCI_PRODUCT_VMWARE_VIRTUAL2	0x0405		/* Virtual SVGA II */
+#define	PCI_PRODUCT_VMWARE_VIRTUAL	0x0710		/* Virtual SVGA */
+#define	PCI_PRODUCT_VMWARE_VMCI	0x0740		/* Virtual Machine Communication Interface */
+#define	PCI_PRODUCT_VMWARE_PCIB	0x0790		/* PCI Bridge */
+#define	PCI_PRODUCT_VMWARE_PCIE	0x07a0		/* PCI Express Root Port */
 
 /* Weitek products */
 #define	PCI_PRODUCT_WEITEK_P9000	0x9001		/* P9000 */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.1094 src/sys/dev/pci/pcidevs_data.h:1.1095
--- src/sys/dev/pci/pcidevs_data.h:1.1094	Thu Oct  6 22:13:50 2011
+++ src/sys/dev/pci/pcidevs_data.h	Tue Oct 18 23:23:20 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.1094 2011/10/06 22:13:50 jmcneill Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.1095 2011/10/18 23:23:20 jmcneill Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1100 2011/10/06 22:13:35 jmcneill Exp
+ *	NetBSD: pcidevs,v 1.1101 2011/10/18 23:23:07 jmcneill Exp
  */
 
 /*
@@ -7804,94 +7804,100 @@ static const uint16_t pci_products[] = {
 	27556, 0,
 	PCI_VENDOR_VLSI, PCI_PRODUCT_VLSI_82C925, 
 	27563, 0,
-	PCI_VENDOR_VMWARE, PCI_PRODUCT_VMWARE_VIRTUAL, 
-	19790, 27570, 0,
 	PCI_VENDOR_VMWARE, PCI_PRODUCT_VMWARE_VIRTUAL2, 
 	19790, 27570, 7256, 0,
+	PCI_VENDOR_VMWARE, PCI_PRODUCT_VMWARE_VIRTUAL, 
+	19790, 27570, 0,
+	PCI_VENDOR_VMWARE, PCI_PRODUCT_VMWARE_VMCI, 
+	19790, 27575, 27583, 3027, 0,
+	PCI_VENDOR_VMWARE, PCI_PRODUCT_VMWARE_PCIB, 
+	615, 6259, 0,
+	PCI_VENDOR_VMWARE, PCI_PRODUCT_VMWARE_PCIE, 
+	615, 4329, 7666, 9725, 0,
 	PCI_VENDOR_WEITEK, PCI_PRODUCT_WEITEK_P9000, 
-	27575, 0,
+	27597, 0,
 	PCI_VENDOR_WEITEK, PCI_PRODUCT_WEITEK_P9100, 
-	27581, 0,
+	27603, 0,
 	PCI_VENDOR_WD, PCI_PRODUCT_WD_WD33C193A, 
-	27587, 0,
+	27609, 0,
 	PCI_VENDOR_WD, PCI_PRODUCT_WD_WD33C196A, 
-	27597, 0,
+	27619, 0,
 	PCI_VENDOR_WD, PCI_PRODUCT_WD_WD33C197A, 
-	27607, 0,
+	27629, 0,
 	PCI_VENDOR_WD, PCI_PRODUCT_WD_WD7193, 
-	27617, 0,
+	27639, 0,
 	PCI_VENDOR_WD, PCI_PRODUCT_WD_WD7197, 
-	27624, 0,
+	27646, 0,
 	PCI_VENDOR_WD, PCI_PRODUCT_WD_WD33C296A, 
-	27631, 0,
+	27653, 0,
 	PCI_VENDOR_WD, PCI_PRODUCT_WD_WD34C296, 
-	27641, 0,
+	27663, 0,
 	PCI_VENDOR_WD, PCI_PRODUCT_WD_90C, 
-	27650, 0,
+	27672, 0,
 	PCI_VENDOR_WINBOND, PCI_PRODUCT_WINBOND_W83769F, 
-	27654, 0,
+	27676, 0,
 	PCI_VENDOR_WINBOND, PCI_PRODUCT_WINBOND_W83C553F_0, 
-	27662, 6533, 6259, 0,
+	27684, 6533, 6259, 0,
 	PCI_VENDOR_WINBOND, PCI_PRODUCT_WINBOND_W83C553F_1, 
-	27662, 6322, 6151, 0,
+	27684, 6322, 6151, 0,
 	PCI_VENDOR_WINBOND, PCI_PRODUCT_WINBOND_W89C840F, 
-	27671, 5515, 5413, 0,
+	27693, 5515, 5413, 0,
 	PCI_VENDOR_WINBOND, PCI_PRODUCT_WINBOND_W89C940F, 
-	27680, 5413, 0,
+	27702, 5413, 0,
 	PCI_VENDOR_WINBOND, PCI_PRODUCT_WINBOND_W89C940F_1, 
-	27680, 5413, 0,
+	27702, 5413, 0,
 	PCI_VENDOR_WINBOND, PCI_PRODUCT_WINBOND_W6692, 
-	27689, 8507, 0,
+	27711, 8507, 0,
 	PCI_VENDOR_WORKBIT, PCI_PRODUCT_WORKBIT_NJSC32BI, 
 	18912, 6366, 0,
 	PCI_VENDOR_WORKBIT, PCI_PRODUCT_WORKBIT_NJATA32BI, 
 	18891, 6322, 0,
 	PCI_VENDOR_WORKBIT, PCI_PRODUCT_WORKBIT_NJSC32UDE, 
-	27695, 6366, 0,
+	27717, 6366, 0,
 	PCI_VENDOR_WORKBIT, PCI_PRODUCT_WORKBIT_NJSC32BI_KME, 
-	18912, 6366, 27711, 0,
+	18912, 6366, 27733, 0,
 	PCI_VENDOR_WORKBIT, PCI_PRODUCT_WORKBIT_NJATA32BI_KME, 
-	18891, 6322, 27711, 0,
+	18891, 6322, 27733, 0,
 	PCI_VENDOR_WORKBIT, 

CVS commit: src/sys/arch

2011-10-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue Oct 18 23:25:20 UTC 2011

Modified Files:
src/sys/arch/x86/x86: x86_stub.c
Added Files:
src/sys/arch/amd64/include: autoconf.h
src/sys/arch/i386/include: autoconf.h
src/sys/arch/x86/include: autoconf.h

Log Message:
Define some optional routines that will help device_register() to
register ISA  PCI devices.  Add stub implementations of the routines.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.3 src/sys/arch/amd64/include/autoconf.h
cvs rdiff -u -r0 -r1.3 src/sys/arch/i386/include/autoconf.h
cvs rdiff -u -r0 -r1.3 src/sys/arch/x86/include/autoconf.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/x86/x86_stub.c

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

Modified files:

Index: src/sys/arch/x86/x86/x86_stub.c
diff -u src/sys/arch/x86/x86/x86_stub.c:1.1 src/sys/arch/x86/x86/x86_stub.c:1.2
--- src/sys/arch/x86/x86/x86_stub.c:1.1	Sun Apr  3 22:29:27 2011
+++ src/sys/arch/x86/x86/x86_stub.c	Tue Oct 18 23:25:20 2011
@@ -1,13 +1,16 @@
-/* $NetBSD: x86_stub.c,v 1.1 2011/04/03 22:29:27 dyoung Exp $ */
+/* $NetBSD: x86_stub.c,v 1.2 2011/10/18 23:25:20 dyoung Exp $ */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: x86_stub.c,v 1.1 2011/04/03 22:29:27 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: x86_stub.c,v 1.2 2011/10/18 23:25:20 dyoung Exp $);
 
 #include sys/param.h
 #include sys/systm.h
 #include sys/kgdb.h
 
+#include machine/autoconf.h
+
 int x86_nullop(void);
+void *x86_zeroop(void);
 void x86_voidop(void);
 
 void
@@ -21,8 +24,17 @@ x86_nullop(void)
 	return 0;
 }
 
-__weak_alias(kdb_trap, x86_nullop);
-__weak_alias(kgdb_disconnected, x86_nullop);
-__weak_alias(kgdb_trap, x86_nullop);
+void *
+x86_zeroop(void)
+{
+	return NULL;
+}
+
+__weak_alias(device_pci_props_register, x86_voidop);
+__weak_alias(device_pci_register, x86_nullop);
+__weak_alias(device_isa_register, x86_nullop);
+__weak_alias(kdb_trap, x86_zeroop);
+__weak_alias(kgdb_disconnected, x86_zeroop);
+__weak_alias(kgdb_trap, x86_zeroop);
 __weak_alias(mca_nmi, x86_voidop);
 __weak_alias(x86_nmi, x86_voidop);

Added files:

Index: src/sys/arch/amd64/include/autoconf.h
diff -u /dev/null src/sys/arch/amd64/include/autoconf.h:1.3
--- /dev/null	Tue Oct 18 23:25:21 2011
+++ src/sys/arch/amd64/include/autoconf.h	Tue Oct 18 23:25:20 2011
@@ -0,0 +1,3 @@
+/*	$NetBSD: autoconf.h,v 1.3 2011/10/18 23:25:20 dyoung Exp $	*/
+
+#include x86/autoconf.h

Index: src/sys/arch/i386/include/autoconf.h
diff -u /dev/null src/sys/arch/i386/include/autoconf.h:1.3
--- /dev/null	Tue Oct 18 23:25:21 2011
+++ src/sys/arch/i386/include/autoconf.h	Tue Oct 18 23:25:20 2011
@@ -0,0 +1,3 @@
+/*	$NetBSD: autoconf.h,v 1.3 2011/10/18 23:25:20 dyoung Exp $	*/
+
+#include x86/autoconf.h

Index: src/sys/arch/x86/include/autoconf.h
diff -u /dev/null src/sys/arch/x86/include/autoconf.h:1.3
--- /dev/null	Tue Oct 18 23:25:21 2011
+++ src/sys/arch/x86/include/autoconf.h	Tue Oct 18 23:25:20 2011
@@ -0,0 +1,11 @@
+/* $NetBSD: autoconf.h,v 1.3 2011/10/18 23:25:20 dyoung Exp $ */
+#ifndef _X86_AUTOCONF_H_
+#define _X86_AUTOCONF_H_
+
+#include sys/device.h
+
+void device_pci_props_register(device_t, void *);
+device_t device_pci_register(device_t, void *);
+device_t device_isa_register(device_t, void *);
+
+#endif /* _X86_AUTOCONF_H_ */



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

2011-10-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue Oct 18 23:30:54 UTC 2011

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

Log Message:
Add an implementation of device_pci_props_register().


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/pci/pci_ranges.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/pci_ranges.c
diff -u src/sys/arch/x86/pci/pci_ranges.c:1.2 src/sys/arch/x86/pci/pci_ranges.c:1.3
--- src/sys/arch/x86/pci/pci_ranges.c:1.2	Tue Sep 13 18:09:52 2011
+++ src/sys/arch/x86/pci/pci_ranges.c	Tue Oct 18 23:30:54 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_ranges.c,v 1.2 2011/09/13 18:09:52 dyoung Exp $	*/
+/*	$NetBSD: pci_ranges.c,v 1.3 2011/10/18 23:30:54 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pci_ranges.c,v 1.2 2011/09/13 18:09:52 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: pci_ranges.c,v 1.3 2011/10/18 23:30:54 dyoung Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -47,6 +47,8 @@ __KERNEL_RCSID(0, $NetBSD: pci_ranges.c
 #include dev/pci/pcireg.h
 #include dev/pci/pccbbreg.h
 
+#include machine/autoconf.h
+
 typedef enum pci_alloc_regtype {
 	  PCI_ALLOC_REGTYPE_NONE = 0
 	, PCI_ALLOC_REGTYPE_BAR = 1
@@ -956,3 +958,63 @@ pci_ranges_infer(pci_chipset_tag_t pc, i
 		prop_object_release(memdict);
 	/* XXX release iorsvns, memrsvns */
 }
+
+static bool
+pcibus_rsvn_predicate(void *arg, prop_dictionary_t rsvn)
+{
+	struct pcibus_attach_args *pba = arg;
+	uint8_t bus;
+
+	if (!prop_dictionary_get_uint8(rsvn, bus, bus))
+		return false;
+
+	return pba-pba_bus = bus  bus = pba-pba_sub;
+}
+
+static bool
+pci_rsvn_predicate(void *arg, prop_dictionary_t rsvn)
+{
+	struct pci_attach_args *pa = arg;
+	uint8_t bus, device, function;
+	bool rc;
+
+	rc = prop_dictionary_get_uint8(rsvn, bus, bus) 
+	prop_dictionary_get_uint8(rsvn, device, device) 
+	prop_dictionary_get_uint8(rsvn, function, function);
+
+	if (!rc)
+		return false;
+
+	return pa-pa_bus == bus  pa-pa_device == device 
+	pa-pa_function == function;
+}
+
+void
+device_pci_props_register(device_t dev, void *aux)
+{
+	cfdata_t cf;
+	prop_dictionary_t dict;
+
+	cf = (device_parent(dev) != NULL) ? device_cfdata(dev) : NULL;
+#if 0
+	aprint_normal_dev(dev, is%s a pci, parent %p, cf %p, ifattr %s\n,
+	device_is_a(dev, pci) ?  :  not,
+	(const void *)device_parent(dev),
+	cf,
+	cf != NULL ? cfdata_ifattr(cf) : );
+#endif
+	if (pci_rsrc_dict == NULL)
+		return;
+
+	if (!device_is_a(dev, pci) 
+	(cf == NULL || strcmp(cfdata_ifattr(cf), pci) != 0))
+		return;
+
+	dict = pci_rsrc_filter(pci_rsrc_dict,
+	device_is_a(dev, pci) ? pcibus_rsvn_predicate
+: pci_rsvn_predicate, aux);
+	if (dict == NULL)
+		return;
+	(void)prop_dictionary_set(device_properties(dev),
+	pci-resources, dict);
+}



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

2011-10-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue Oct 18 23:41:45 UTC 2011

Modified Files:
src/sys/arch/x86/x86: x86_stub.c

Log Message:
Use the right return types for x86_nullop() and x86_zeroop().


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/x86/x86_stub.c

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

Modified files:

Index: src/sys/arch/x86/x86/x86_stub.c
diff -u src/sys/arch/x86/x86/x86_stub.c:1.2 src/sys/arch/x86/x86/x86_stub.c:1.3
--- src/sys/arch/x86/x86/x86_stub.c:1.2	Tue Oct 18 23:25:20 2011
+++ src/sys/arch/x86/x86/x86_stub.c	Tue Oct 18 23:41:45 2011
@@ -1,7 +1,7 @@
-/* $NetBSD: x86_stub.c,v 1.2 2011/10/18 23:25:20 dyoung Exp $ */
+/* $NetBSD: x86_stub.c,v 1.3 2011/10/18 23:41:45 dyoung Exp $ */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: x86_stub.c,v 1.2 2011/10/18 23:25:20 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: x86_stub.c,v 1.3 2011/10/18 23:41:45 dyoung Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -9,8 +9,8 @@ __KERNEL_RCSID(0, $NetBSD: x86_stub.c,v
 
 #include machine/autoconf.h
 
-int x86_nullop(void);
-void *x86_zeroop(void);
+int x86_zeroop(void);
+void *x86_nullop(void);
 void x86_voidop(void);
 
 void
@@ -18,16 +18,16 @@ x86_voidop(void)
 {
 }
 
-int
+void *
 x86_nullop(void)
 {
-	return 0;
+	return NULL;
 }
 
-void *
+int
 x86_zeroop(void)
 {
-	return NULL;
+	return 0;
 }
 
 __weak_alias(device_pci_props_register, x86_voidop);



CVS commit: src/sys/arch

2011-10-18 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Tue Oct 18 23:43:06 UTC 2011

Modified Files:
src/sys/arch/x86/x86: pmap.c
src/sys/arch/xen/x86: xen_pmap.c

Log Message:
Move Xen specific functions out of x86 native pmap to xen_pmap.c.

Provide a wrapper to trigger pmap pool_cache(9) invalidations without
exposing the caches to outside world.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/xen/x86/xen_pmap.c

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

Modified files:

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.136 src/sys/arch/x86/x86/pmap.c:1.137
--- src/sys/arch/x86/x86/pmap.c:1.136	Tue Oct 18 23:14:28 2011
+++ src/sys/arch/x86/x86/pmap.c	Tue Oct 18 23:43:06 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.136 2011/10/18 23:14:28 jym Exp $	*/
+/*	$NetBSD: pmap.c,v 1.137 2011/10/18 23:43:06 jym Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.136 2011/10/18 23:14:28 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.137 2011/10/18 23:43:06 jym Exp $);
 
 #include opt_user_ldt.h
 #include opt_lockdebug.h
@@ -4412,118 +4412,18 @@ x86_mmap_flags(paddr_t mdpgno)
 	return pflag;
 }
 
-#ifdef XEN
 /*
- * Flush all APDP entries found in pmaps
- * Required during Xen save/restore operations, as it does not
- * handle alternative recursive mappings properly
+ * Invalidates pool_cache(9) used by pmap(9).
  */
 void
-pmap_unmap_all_apdp_pdes(void)
+pmap_invalidate_pool_caches(void)
 {
-
-	int i;
-	int s;
-	struct pmap *pm;
-
-	s = splvm();
-
-	pmap_unmap_apdp();
-
-	mutex_enter(pmaps_lock);
-	/*
-	 * Set APDP entries to 0 in all pmaps.
-	 * Note that for PAE kernels, this only clears the APDP entries
-	 * found in the L2 shadow pages, as pmap_pdirpa() is used to obtain
-	 * the PA of the pmap-pm_pdir[] pages (forming the 4 contiguous
-	 * pages of PAE PD: 3 for user space, 1 for the L2 kernel shadow page)
-	 */
-	LIST_FOREACH(pm, pmaps, pm_list) {
-		for (i = 0; i  PDP_SIZE; i++) {
-			xpq_queue_pte_update(
-			xpmap_ptom(pmap_pdirpa(pm, PDIR_SLOT_APTE + i)), 0);
-		}
-	}
-	mutex_exit(pmaps_lock);
-
-	xpq_flush_queue();
-
-	splx(s);
-
-}
-
-#ifdef PAE
-/*
- * NetBSD uses L2 shadow pages to support PAE with Xen. However, Xen does not
- * handle them correctly during save/restore, leading to incorrect page
- * tracking and pinning during restore.
- * For save/restore to succeed, two functions are introduced:
- * - pmap_map_recursive_entries(), used by resume code to set the recursive
- *   mapping entries to their correct value
- * - pmap_unmap_recursive_entries(), used by suspend code to clear all
- *   PDIR_SLOT_PTE entries
- */
-void
-pmap_map_recursive_entries(void)
-{
-
-	int i;
-	struct pmap *pm;
-
-	mutex_enter(pmaps_lock);
-
-	LIST_FOREACH(pm, pmaps, pm_list) {
-		for (i = 0; i  PDP_SIZE; i++) {
-			xpq_queue_pte_update(
-			xpmap_ptom(pmap_pdirpa(pm, PDIR_SLOT_PTE + i)),
-			xpmap_ptom((pm)-pm_pdirpa[i]) | PG_V);
-		}
-	}
-
-	mutex_exit(pmaps_lock);
-
-	for (i = 0; i  PDP_SIZE; i++) {
-		xpq_queue_pte_update(
-		xpmap_ptom(pmap_pdirpa(pmap_kernel(), PDIR_SLOT_PTE + i)),
-		xpmap_ptom(pmap_kernel()-pm_pdirpa[i]) | PG_V);
-	}
-
-	xpq_flush_queue();
-}
-
-void
-pmap_unmap_recursive_entries(void)
-{
-
-	int i;
-	struct pmap *pm;
-
+#ifdef XEN
 	/*
 	 * We must invalidate all shadow pages found inside the pmap_pdp_cache.
 	 * They are technically considered by Xen as L2 pages, although they
 	 * are not currently found inside pmaps list.
 	 */
 	pool_cache_invalidate(pmap_pdp_cache);
-
-	mutex_enter(pmaps_lock);
-
-	LIST_FOREACH(pm, pmaps, pm_list) {
-		for (i = 0; i  PDP_SIZE; i++) {
-			xpq_queue_pte_update(
-			xpmap_ptom(pmap_pdirpa(pm, PDIR_SLOT_PTE + i)), 0);
-		}
-	}
-
-	mutex_exit(pmaps_lock);
-
-	/* do it for pmap_kernel() too! */
-	for (i = 0; i  PDP_SIZE; i++)
-		xpq_queue_pte_update(
-		xpmap_ptom(pmap_pdirpa(pmap_kernel(), PDIR_SLOT_PTE + i)),
-		0);
-
-	xpq_flush_queue();
-
+#endif
 }
-#endif /* PAE */
-#endif /* XEN */

Index: src/sys/arch/xen/x86/xen_pmap.c
diff -u src/sys/arch/xen/x86/xen_pmap.c:1.5 src/sys/arch/xen/x86/xen_pmap.c:1.6
--- src/sys/arch/xen/x86/xen_pmap.c:1.5	Tue Sep 20 00:12:24 2011
+++ src/sys/arch/xen/x86/xen_pmap.c	Tue Oct 18 23:43:06 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_pmap.c,v 1.5 2011/09/20 00:12:24 jym Exp $	*/
+/*	$NetBSD: xen_pmap.c,v 1.6 2011/10/18 23:43:06 jym Exp $	*/
 
 /*
  * Copyright (c) 2007 Manuel Bouyer.
@@ -102,7 +102,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xen_pmap.c,v 1.5 2011/09/20 00:12:24 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: xen_pmap.c,v 1.6 2011/10/18 23:43:06 jym Exp $);
 
 #include opt_user_ldt.h
 #include opt_lockdebug.h
@@ -440,3 +440,113 @@ pmap_extract_ma(struct pmap *pmap, vaddr
 
 

CVS commit: src/sys/arch/x86

2011-10-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Tue Oct 18 23:43:36 UTC 2011

Modified Files:
src/sys/arch/x86/isa: isa_machdep.c
src/sys/arch/x86/pci: pci_machdep.c
src/sys/arch/x86/x86: x86_autoconf.c

Log Message:
Factor device_isa_register() and device_pci_register() out of
device_register() and stick the new routines into isa_machdep.c and
pci_machdep.c, respectively.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/x86/isa/isa_machdep.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/x86/pci/pci_machdep.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/x86/x86/x86_autoconf.c

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

Modified files:

Index: src/sys/arch/x86/isa/isa_machdep.c
diff -u src/sys/arch/x86/isa/isa_machdep.c:1.30 src/sys/arch/x86/isa/isa_machdep.c:1.31
--- src/sys/arch/x86/isa/isa_machdep.c:1.30	Thu Sep  1 15:10:31 2011
+++ src/sys/arch/x86/isa/isa_machdep.c	Tue Oct 18 23:43:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: isa_machdep.c,v 1.30 2011/09/01 15:10:31 christos Exp $	*/
+/*	$NetBSD: isa_machdep.c,v 1.31 2011/10/18 23:43:36 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: isa_machdep.c,v 1.30 2011/09/01 15:10:31 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: isa_machdep.c,v 1.31 2011/10/18 23:43:36 dyoung Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -80,12 +80,16 @@ __KERNEL_RCSID(0, $NetBSD: isa_machdep.
 #include machine/bus_private.h
 #include machine/pio.h
 #include machine/cpufunc.h
+#include machine/autoconf.h
+#include machine/bootinfo.h
 
 #include dev/isa/isareg.h
 #include dev/isa/isavar.h
 
 #include uvm/uvm_extern.h
 
+#include acpica.h
+#include opt_acpi.h
 #include ioapic.h
 
 #if NIOAPIC  0
@@ -335,3 +339,48 @@ _isa_dma_may_bounce(bus_dma_tag_t t, bus
 		*cookieflagsp |= X86_DMA_MIGHT_NEED_BOUNCE;
 	return 0;
 }
+
+device_t
+device_isa_register(device_t dev, void *aux)
+{
+
+	/*
+	 * Handle network interfaces here, the attachment information is
+	 * not available driver-independently later.
+	 *
+	 * For disks, there is nothing useful available at attach time.
+	 */
+	if (device_class(dev) == DV_IFNET) {
+		struct btinfo_netif *bin = lookup_bootinfo(BTINFO_NETIF);
+		if (bin == NULL)
+			return NULL;
+
+		/*
+		 * We don't check the driver name against the device name
+		 * passed by the boot ROM.  The ROM should stay usable if
+		 * the driver becomes obsolete.  The physical attachment
+		 * information (checked below) must be sufficient to
+		 * idenfity the device.
+		 */
+		if (bin-bus == BI_BUS_ISA 
+		device_is_a(device_parent(dev), isa)) {
+			struct isa_attach_args *iaa = aux;
+
+			/* Compare IO base address */
+			/* XXXJRT What about multiple IO addrs? */
+			if (iaa-ia_nio  0 
+			bin-addr.iobase == iaa-ia_io[0].ir_addr)
+				return dev;
+		}
+	}
+#if NACPICA  0
+#if notyet
+	if (device_is_a(dev, isa)  acpi_active) {
+		if (!(AcpiGbl_FADT.BootFlags  ACPI_FADT_LEGACY_DEVICES))
+			prop_dictionary_set_bool(device_properties(dev),
+			no-legacy-devices, true);
+	}
+#endif
+#endif /* NACPICA  0 */
+	return NULL;
+}

Index: src/sys/arch/x86/pci/pci_machdep.c
diff -u src/sys/arch/x86/pci/pci_machdep.c:1.51 src/sys/arch/x86/pci/pci_machdep.c:1.52
--- src/sys/arch/x86/pci/pci_machdep.c:1.51	Tue Sep 13 17:58:42 2011
+++ src/sys/arch/x86/pci/pci_machdep.c	Tue Oct 18 23:43:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.51 2011/09/13 17:58:42 dyoung Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.52 2011/10/18 23:43:36 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pci_machdep.c,v 1.51 2011/09/13 17:58:42 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: pci_machdep.c,v 1.52 2011/10/18 23:43:36 dyoung Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -98,10 +98,34 @@ __KERNEL_RCSID(0, $NetBSD: pci_machdep.
 #include dev/pci/pcireg.h
 #include dev/pci/pccbbreg.h
 #include dev/pci/pcidevs.h
+#include dev/pci/genfb_pcivar.h
+
+#include dev/wsfb/genfbvar.h
+#include arch/x86/include/genfb_machdep.h
+#include dev/ic/vgareg.h
 
 #include acpica.h
-#include opt_mpbios.h
+#include genfb.h
+#include isa.h
 #include opt_acpi.h
+#include opt_ddb.h
+#include opt_mpbios.h
+#include opt_vga.h
+#include pci.h
+#include wsdisplay.h
+
+#ifdef DDB
+#include machine/db_machdep.h
+#include ddb/db_sym.h
+#include ddb/db_extern.h
+#endif
+
+#ifdef VGA_POST
+#include x86/vga_post.h
+#endif
+
+#include machine/autoconf.h
+#include machine/bootinfo.h
 
 #ifdef MPBIOS
 #include machine/mpbiosvar.h
@@ -221,6 +245,18 @@ static struct pci_conf_lock cl0 = {
 
 static struct pci_conf_lock * const cl = cl0;
 
+#if NGENFB  0  NACPICA  0  defined(VGA_POST)
+extern int acpi_md_vbios_reset;
+extern int acpi_md_vesa_modenum;
+#endif
+
+static struct 

CVS commit: src/sys/dev/acpi

2011-10-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 18 23:47:26 UTC 2011

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

Log Message:
clear fixed events and disable GPEs before re-enabling interrupts on resume
from S1


To generate a diff of this commit:
cvs rdiff -u -r1.250 -r1.251 src/sys/dev/acpi/acpi.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/acpi/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.250 src/sys/dev/acpi/acpi.c:1.251
--- src/sys/dev/acpi/acpi.c:1.250	Fri Aug  5 18:59:44 2011
+++ src/sys/dev/acpi/acpi.c	Tue Oct 18 23:47:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.250 2011/08/05 18:59:44 jakllsch Exp $	*/
+/*	$NetBSD: acpi.c,v 1.251 2011/10/18 23:47:26 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi.c,v 1.250 2011/08/05 18:59:44 jakllsch Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi.c,v 1.251 2011/10/18 23:47:26 jmcneill Exp $);
 
 #include opt_acpi.h
 #include opt_pcifixup.h
@@ -1386,6 +1386,17 @@ acpi_enter_sleep_state(int state)
 aprint_error_dev(sc-sc_dev, failed to 
 enter S1: %s\n, AcpiFormatException(rv));
 
+			/*
+			 * Clear fixed events and disable all GPEs before
+			 * interrupts are enabled.
+			 */
+			AcpiClearEvent(ACPI_EVENT_PMTIMER);
+			AcpiClearEvent(ACPI_EVENT_GLOBAL);
+			AcpiClearEvent(ACPI_EVENT_POWER_BUTTON);
+			AcpiClearEvent(ACPI_EVENT_SLEEP_BUTTON);
+			AcpiClearEvent(ACPI_EVENT_RTC);
+			AcpiHwDisableAllGpes();
+
 			acpi_md_OsEnableInterrupt();
 			rv = AcpiLeaveSleepState(state);
 



CVS commit: src/usr.bin/last

2011-10-18 Thread Jeremy C. Reed
Module Name:src
Committed By:   reed
Date:   Wed Oct 19 00:27:40 UTC 2011

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

Log Message:
patch from from Snader_LB via IRC.

- mention  The following options are available:

- improve grammar

- provide useful tip about -x


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/last/last.1

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

Modified files:

Index: src/usr.bin/last/last.1
diff -u src/usr.bin/last/last.1:1.18 src/usr.bin/last/last.1:1.19
--- src/usr.bin/last/last.1:1.18	Fri Jul 27 16:59:25 2007
+++ src/usr.bin/last/last.1	Wed Oct 19 00:27:40 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: last.1,v 1.18 2007/07/27 16:59:25 reed Exp $
+.\	$NetBSD: last.1,v 1.19 2011/10/19 00:27:40 reed Exp $
 .\
 .\ Copyright (c) 1980, 1990, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\ @(#)last.1	8.1 (Berkeley) 6/6/93
 .\
-.Dd December 27, 2006
+.Dd October 18, 2011
 .Dt LAST 1
 .Os
 .Sh NAME
@@ -63,6 +63,8 @@ a crash or shutdown,
 .Nm
 will so indicate.
 .Pp
+The following options are available:
+.Pp
 .Bl -tag -width xHxhostsizexx
 .It Fl Ar n
 Limits the report to
@@ -111,10 +113,11 @@ Tty names may be given fully or abbrevia
 is equivalent to
 .Dq Li last -t tty03 .
 .It Fl x
-Assume that the file given is
+Assume that the file given is in
 .Xr wtmpx 5
 format, even if the filename does not end with an
 .Sq x .
+Also useful when reading such format from standard input.
 .El
 .Pp
 If multiple arguments are given, the information which applies to any of the



CVS commit: src/sys/net

2011-10-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Oct 19 01:34:37 UTC 2011

Modified Files:
src/sys/net: if.c if.h

Log Message:
Start to untangle the ifnet ioctls mess.

Add ifnet functions, if_mcast_op(), if_flags_set(), and if_addr_init()
for adding/deleting multicast addresses, modifying the if_flags,
and initializing local/remote addresses.  Make ifpromisc() use
if_flags_set().  Protocols and network drivers should use these
instead of ifp-if_ioctl() calls.  Subsequent commits will
replace ifp-if_ioctl(SIOCADDMULTI| SIOCDELMULTI| SIOCSIFDSTADDR|
SIOCINITIFADDR| SIOCSIFFLAGS) calls with calls to the new functions.

Use a mutex(9) to synchronize ifp-if_ioctl() calls originating in
userland.  Also synchronize ifp-if_ioctl() calls with ifnet detachment
and reclamation.


To generate a diff of this commit:
cvs rdiff -u -r1.251 -r1.252 src/sys/net/if.c
cvs rdiff -u -r1.151 -r1.152 src/sys/net/if.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.c
diff -u src/sys/net/if.c:1.251 src/sys/net/if.c:1.252
--- src/sys/net/if.c:1.251	Fri Aug 12 22:09:36 2011
+++ src/sys/net/if.c	Wed Oct 19 01:34:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.251 2011/08/12 22:09:36 dyoung Exp $	*/
+/*	$NetBSD: if.c,v 1.252 2011/10/19 01:34:37 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if.c,v 1.251 2011/08/12 22:09:36 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: if.c,v 1.252 2011/10/19 01:34:37 dyoung Exp $);
 
 #include opt_inet.h
 
@@ -168,6 +168,8 @@ struct pfil_head if_pfil;	/* packet filt
 
 static kauth_listener_t if_listener;
 
+static int ifioctl_attach(struct ifnet *);
+static void ifioctl_detach(struct ifnet *);
 static void if_detach_queues(struct ifnet *, struct ifqueue *);
 static void sysctl_sndq_setup(struct sysctllog **, const char *,
 struct ifaltq *);
@@ -292,6 +294,7 @@ int
 if_nullioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
 
+	cv_signal(ifp-if_ioctl_emptied);
 	return ENXIO;
 }
 
@@ -497,8 +500,8 @@ if_attach(struct ifnet *ifp)
 	}
 	TAILQ_INIT(ifp-if_addrlist);
 	TAILQ_INSERT_TAIL(ifnet, ifp, if_list);
-	if (ifp-if_ioctl == NULL)
-		ifp-if_ioctl = ifioctl_common;
+
+	ifioctl_attach(ifp);	/* XXX ifioctl_attach can fail! */ 
 
 	mutex_enter(index_gen_mtx);
 	ifp-if_index_gen = index_gen++;
@@ -842,6 +845,8 @@ again:
 
 	TAILQ_REMOVE(ifnet, ifp, if_list);
 
+	ifioctl_detach(ifp);
+
 	/*
 	 * remove packets that came from ifp, from software interrupt queues.
 	 */
@@ -1403,8 +1408,7 @@ int
 ifpromisc(struct ifnet *ifp, int pswitch)
 {
 	int pcount, ret;
-	short flags;
-	struct ifreq ifr;
+	short flags, nflags;
 
 	pcount = ifp-if_pcount;
 	flags = ifp-if_flags;
@@ -1416,29 +1420,26 @@ ifpromisc(struct ifnet *ifp, int pswitch
 		 */
 		if (ifp-if_pcount++ != 0)
 			return 0;
-		ifp-if_flags |= IFF_PROMISC;
-		if ((ifp-if_flags  IFF_UP) == 0)
+		nflags = ifp-if_flags | IFF_PROMISC;
+		if ((nflags  IFF_UP) == 0)
 			return 0;
 	} else {
 		if (--ifp-if_pcount  0)
 			return 0;
-		ifp-if_flags = ~IFF_PROMISC;
+		nflags = ifp-if_flags  ~IFF_PROMISC;
 		/*
 		 * If the device is not configured up, we should not need to
 		 * turn off promiscuous mode (device should have turned it
 		 * off when interface went down; and will look at IFF_PROMISC
 		 * again next time interface comes up).
 		 */
-		if ((ifp-if_flags  IFF_UP) == 0)
+		if ((nflags  IFF_UP) == 0)
 			return 0;
 	}
-	memset(ifr, 0, sizeof(ifr));
-	ifr.ifr_flags = ifp-if_flags;
-	ret = (*ifp-if_ioctl)(ifp, SIOCSIFFLAGS, ifr);
+	ret = if_flags_set(ifp, nflags);
 	/* Restore interface state if not successful. */
 	if (ret != 0) {
 		ifp-if_pcount = pcount;
-		ifp-if_flags = flags;
 	}
 	return ret;
 }
@@ -1801,11 +1802,15 @@ ifioctl(struct socket *so, u_long cmd, v
 
 	oif_flags = ifp-if_flags;
 
+	uint64_t *nenter = percpu_getref(ifp-if_ioctl_nenter);
+	(*nenter)++;
+	percpu_putref(ifp-if_ioctl_nenter);
+	mutex_enter(ifp-if_ioctl_lock);
 	error = (*ifp-if_ioctl)(ifp, cmd, data);
 	if (error != ENOTTY)
 		;
 	else if (so-so_proto == NULL)
-		return EOPNOTSUPP;
+		error = EOPNOTSUPP;
 	else {
 #ifdef COMPAT_OSOCK
 		error = compat_ifioctl(so, ocmd, cmd, data, l);
@@ -1830,9 +1835,55 @@ ifioctl(struct socket *so, u_long cmd, v
 		ifreqn2o(oifr, ifr);
 #endif
 
+	ifp-if_ioctl_nexit++;
+	mutex_exit(ifp-if_ioctl_lock);
 	return error;
 }
 
+static void
+ifioctl_sum(void *p, void *arg, struct cpu_info *ci)
+{
+	uint64_t *sum = arg, *nenter = p;
+
+	*sum += *nenter;
+}
+
+static uint64_t
+ifioctl_entrances(struct ifnet *ifp)
+{
+	uint64_t sum = 0;
+
+	percpu_foreach(ifp-if_ioctl_nenter, ifioctl_sum, sum);
+
+	return sum;
+}
+
+static int
+ifioctl_attach(struct ifnet *ifp)
+{
+	if (ifp-if_ioctl == NULL)
+		ifp-if_ioctl = ifioctl_common;
+
+	ifp-if_ioctl_nenter = percpu_alloc(sizeof(uint64_t));
+	if 

CVS commit: src/sys/fs/puffs

2011-10-18 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Wed Oct 19 01:39:29 UTC 2011

Modified Files:
src/sys/fs/puffs: puffs_msgif.c puffs_node.c puffs_vfsops.c
puffs_vnops.c

Log Message:
Remove #ifdef DIAGNOSTIC guards around KASSERT, as the macro contains them


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/fs/puffs/puffs_msgif.c
cvs rdiff -u -r1.21 -r1.22 src/sys/fs/puffs/puffs_node.c
cvs rdiff -u -r1.99 -r1.100 src/sys/fs/puffs/puffs_vfsops.c
cvs rdiff -u -r1.159 -r1.160 src/sys/fs/puffs/puffs_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/fs/puffs/puffs_msgif.c
diff -u src/sys/fs/puffs/puffs_msgif.c:1.88 src/sys/fs/puffs/puffs_msgif.c:1.89
--- src/sys/fs/puffs/puffs_msgif.c:1.88	Tue Oct 18 15:39:09 2011
+++ src/sys/fs/puffs/puffs_msgif.c	Wed Oct 19 01:39:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_msgif.c,v 1.88 2011/10/18 15:39:09 manu Exp $	*/
+/*	$NetBSD: puffs_msgif.c,v 1.89 2011/10/19 01:39:29 manu Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: puffs_msgif.c,v 1.88 2011/10/18 15:39:09 manu Exp $);
+__KERNEL_RCSID(0, $NetBSD: puffs_msgif.c,v 1.89 2011/10/19 01:39:29 manu Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -134,10 +134,8 @@ puffs_msgpark_alloc(int waitok)
 {
 	struct puffs_msgpark *park;
 
-#ifdef DIAGNOSTIC
-	if (curlwp == uvm.pagedaemon_lwp)
-		KASSERT(!waitok);
-#endif
+	KASSERT(curlwp != uvm.pagedaemon_lwp || !waitok);
+
 	park = pool_cache_get(parkpc, waitok ? PR_WAITOK : PR_NOWAIT);
 	if (park == NULL)
 		return park;
@@ -238,10 +236,7 @@ puffs_msgmem_alloc(size_t len, struct pu
 	struct puffs_msgpark *park;
 	void *m;
 
-#ifdef DIAGNOSTIC
-	if (curlwp == uvm.pagedaemon_lwp)
-		KASSERT(!cansleep);
-#endif
+	KASSERT(curlwp != uvm.pagedaemon_lwp || !cansleep);
 	m = kmem_zalloc(len, cansleep ? KM_SLEEP : KM_NOSLEEP);
 	if (m == NULL) {
 		KASSERT(cansleep == 0);
@@ -960,9 +955,7 @@ puffs_msgif_dispatch(void *this, struct 
 		}
 		pf = (struct puffs_flush *)preq;
 
-#ifdef DIAGNOSTIC
 		KASSERT(curlwp != uvm.pagedaemon_lwp);
-#endif
 		psopr = kmem_alloc(sizeof(*psopr), KM_SLEEP);
 		memcpy(psopr-psopr_pf, pf, sizeof(*pf));
 		psopr-psopr_sopreq = PUFFS_SOPREQ_FLUSH;
@@ -986,9 +979,7 @@ puffs_msgif_dispatch(void *this, struct 
 
 		DPRINTF((dispatch: unmount 0x%x\n, preq-preq_optype));
 
-#ifdef DIAGNOSTIC
 		KASSERT(curlwp != uvm.pagedaemon_lwp);
-#endif
 		psopr = kmem_alloc(sizeof(*psopr), KM_SLEEP);
 		psopr-psopr_preq = *preq;
 		psopr-psopr_sopreq = PUFFS_SOPREQ_UNMOUNT;

Index: src/sys/fs/puffs/puffs_node.c
diff -u src/sys/fs/puffs/puffs_node.c:1.21 src/sys/fs/puffs/puffs_node.c:1.22
--- src/sys/fs/puffs/puffs_node.c:1.21	Tue Oct 18 15:39:09 2011
+++ src/sys/fs/puffs/puffs_node.c	Wed Oct 19 01:39:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_node.c,v 1.21 2011/10/18 15:39:09 manu Exp $	*/
+/*	$NetBSD: puffs_node.c,v 1.22 2011/10/19 01:39:29 manu Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: puffs_node.c,v 1.21 2011/10/18 15:39:09 manu Exp $);
+__KERNEL_RCSID(0, $NetBSD: puffs_node.c,v 1.22 2011/10/19 01:39:29 manu Exp $);
 
 #include sys/param.h
 #include sys/hash.h
@@ -231,9 +231,7 @@ puffs_newnode(struct mount *mp, struct v
 		}
 	}
 
-#ifdef DIAGNOSTIC
 	KASSERT(curlwp != uvm.pagedaemon_lwp);
-#endif
 	pnc = kmem_alloc(sizeof(struct puffs_newcookie), KM_SLEEP);
 	pnc-pnc_cookie = ck;
 	LIST_INSERT_HEAD(pmp-pmp_newcookie, pnc, pnc_entries);

Index: src/sys/fs/puffs/puffs_vfsops.c
diff -u src/sys/fs/puffs/puffs_vfsops.c:1.99 src/sys/fs/puffs/puffs_vfsops.c:1.100
--- src/sys/fs/puffs/puffs_vfsops.c:1.99	Tue Oct 18 15:39:09 2011
+++ src/sys/fs/puffs/puffs_vfsops.c	Wed Oct 19 01:39:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_vfsops.c,v 1.99 2011/10/18 15:39:09 manu Exp $	*/
+/*	$NetBSD: puffs_vfsops.c,v 1.100 2011/10/19 01:39:29 manu Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: puffs_vfsops.c,v 1.99 2011/10/18 15:39:09 manu Exp $);
+__KERNEL_RCSID(0, $NetBSD: puffs_vfsops.c,v 1.100 2011/10/19 01:39:29 manu Exp $);
 
 #include sys/param.h
 #include sys/mount.h
@@ -235,9 +235,7 @@ puffs_vfsop_mount(struct mount *mp, cons
 	copy_statvfs_info(args-pa_svfsb, mp);
 	(void)memcpy(mp-mnt_stat, args-pa_svfsb, sizeof(mp-mnt_stat));
 
-#ifdef DIAGNOSTIC
 	KASSERT(curlwp != uvm.pagedaemon_lwp);
-#endif  
 	pmp = kmem_zalloc(sizeof(struct puffs_mount), KM_SLEEP);
 
 	mp-mnt_fs_bshift = DEV_BSHIFT;
@@ -419,9 +417,7 @@ puffs_vfsop_unmount(struct mount *mp, in
 		 * Release kernel thread now that there is nothing
 		 * it would be wanting to lock.
 		 */
-#ifdef DIAGNOSTIC
 		KASSERT(curlwp != 

CVS commit: src/sys/net

2011-10-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Oct 19 01:46:43 UTC 2011

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

Log Message:
Extract subroutines ifioctl_enter() and ifioctl_exit().


To generate a diff of this commit:
cvs rdiff -u -r1.252 -r1.253 src/sys/net/if.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.c
diff -u src/sys/net/if.c:1.252 src/sys/net/if.c:1.253
--- src/sys/net/if.c:1.252	Wed Oct 19 01:34:37 2011
+++ src/sys/net/if.c	Wed Oct 19 01:46:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.252 2011/10/19 01:34:37 dyoung Exp $	*/
+/*	$NetBSD: if.c,v 1.253 2011/10/19 01:46:43 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if.c,v 1.252 2011/10/19 01:34:37 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: if.c,v 1.253 2011/10/19 01:46:43 dyoung Exp $);
 
 #include opt_inet.h
 
@@ -170,6 +170,8 @@ static kauth_listener_t if_listener;
 
 static int ifioctl_attach(struct ifnet *);
 static void ifioctl_detach(struct ifnet *);
+static void ifioctl_enter(struct ifnet *);
+static void ifioctl_exit(struct ifnet *);
 static void if_detach_queues(struct ifnet *, struct ifqueue *);
 static void sysctl_sndq_setup(struct sysctllog **, const char *,
 struct ifaltq *);
@@ -1694,6 +1696,22 @@ ifaddrpref_ioctl(struct socket *so, u_lo
 	}
 }
 
+static void
+ifioctl_enter(struct ifnet *ifp)
+{
+	uint64_t *nenter = percpu_getref(ifp-if_ioctl_nenter);
+	(*nenter)++;
+	percpu_putref(ifp-if_ioctl_nenter);
+	mutex_enter(ifp-if_ioctl_lock);
+}
+
+static void
+ifioctl_exit(struct ifnet *ifp)
+{
+	ifp-if_ioctl_nexit++;
+	mutex_exit(ifp-if_ioctl_lock);
+}
+
 /*
  * Interface ioctls.
  */
@@ -1802,10 +1820,7 @@ ifioctl(struct socket *so, u_long cmd, v
 
 	oif_flags = ifp-if_flags;
 
-	uint64_t *nenter = percpu_getref(ifp-if_ioctl_nenter);
-	(*nenter)++;
-	percpu_putref(ifp-if_ioctl_nenter);
-	mutex_enter(ifp-if_ioctl_lock);
+	ifioctl_enter(ifp);
 	error = (*ifp-if_ioctl)(ifp, cmd, data);
 	if (error != ENOTTY)
 		;
@@ -1835,8 +1850,7 @@ ifioctl(struct socket *so, u_long cmd, v
 		ifreqn2o(oifr, ifr);
 #endif
 
-	ifp-if_ioctl_nexit++;
-	mutex_exit(ifp-if_ioctl_lock);
+	ifioctl_exit(ifp);
 	return error;
 }
 



CVS commit: src/sys/net

2011-10-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Oct 19 01:48:30 UTC 2011

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

Log Message:
Use if_mcast_op() and if_flags_set() instead of calling ifp-if_ioctl().


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/net/if_vlan.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_vlan.c
diff -u src/sys/net/if_vlan.c:1.67 src/sys/net/if_vlan.c:1.68
--- src/sys/net/if_vlan.c:1.67	Fri Apr  8 13:56:51 2011
+++ src/sys/net/if_vlan.c	Wed Oct 19 01:48:30 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vlan.c,v 1.67 2011/04/08 13:56:51 sborrill Exp $	*/
+/*	$NetBSD: if_vlan.c,v 1.68 2011/10/19 01:48:30 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_vlan.c,v 1.67 2011/04/08 13:56:51 sborrill Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_vlan.c,v 1.68 2011/10/19 01:48:30 dyoung Exp $);
 
 #include opt_inet.h
 
@@ -469,24 +469,6 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd
 	s = splnet();
 
 	switch (cmd) {
-	case SIOCINITIFADDR:
-		if (ifv-ifv_p != NULL) {
-			ifp-if_flags |= IFF_UP;
-
-			switch (ifa-ifa_addr-sa_family) {
-#ifdef INET
-			case AF_INET:
-arp_ifinit(ifp, ifa);
-break;
-#endif
-			default:
-break;
-			}
-		} else {
-			error = EINVAL;
-		}
-		break;
-
 	case SIOCSIFMTU:
 		if (ifv-ifv_p == NULL)
 			error = EINVAL;
@@ -569,6 +551,19 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd
 		if ((error = ifioctl_common(ifp, cmd, data)) == ENETRESET)
 			error = 0;
 		break;
+	case SIOCINITIFADDR:
+		if (ifv-ifv_p == NULL) {
+			error = EINVAL;
+			break;
+		}
+
+		ifp-if_flags |= IFF_UP;
+#ifdef INET
+		if (ifa-ifa_addr-sa_family == AF_INET)
+			arp_ifinit(ifp, ifa);
+#endif
+		break;
+
 	default:
 		error = ether_ioctl(ifp, cmd, data);
 	}



CVS commit: src/sys/net/agr

2011-10-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Oct 19 01:49:50 UTC 2011

Modified Files:
src/sys/net/agr: if_agr.c if_agrether.c

Log Message:
Use if_flags_set() and if_addr_init() instead of ifp-if_ioctl().


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/net/agr/if_agr.c
cvs rdiff -u -r1.8 -r1.9 src/sys/net/agr/if_agrether.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/agr/if_agr.c
diff -u src/sys/net/agr/if_agr.c:1.29 src/sys/net/agr/if_agr.c:1.30
--- src/sys/net/agr/if_agr.c:1.29	Wed Aug 11 11:47:29 2010
+++ src/sys/net/agr/if_agr.c	Wed Oct 19 01:49:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_agr.c,v 1.29 2010/08/11 11:47:29 pgoyette Exp $	*/
+/*	$NetBSD: if_agr.c,v 1.30 2011/10/19 01:49:50 dyoung Exp $	*/
 
 /*-
  * Copyright (c)2005 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_agr.c,v 1.29 2010/08/11 11:47:29 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_agr.c,v 1.30 2011/10/19 01:49:50 dyoung Exp $);
 
 #include opt_inet.h
 
@@ -235,7 +235,6 @@ agr_vlan_add(struct agr_port *port, void
 {
 	struct ifnet *ifp = port-port_ifp;
 	struct ethercom *ec_port = (void *)ifp;
-	struct ifreq ifr;
 	int error=0;
 
 	if (ec_port-ec_nvlans++ == 0 
@@ -246,9 +245,7 @@ agr_vlan_add(struct agr_port *port, void
 		 */
 		ec_port-ec_capenable |= ETHERCAP_VLAN_MTU;
 		if (p-if_flags  IFF_UP) {
-			ifr.ifr_flags = p-if_flags;
-			error = (*p-if_ioctl)(p, SIOCSIFFLAGS,
-			(void *) ifr);
+			error = if_flags_set(p, p-if_flags);
 			if (error) {
 if (ec_port-ec_nvlans-- == 1)
 	ec_port-ec_capenable =
@@ -268,7 +265,6 @@ static int
 agr_vlan_del(struct agr_port *port, void *arg)
 {
 	struct ethercom *ec_port = (void *)port-port_ifp;
-	struct ifreq ifr;
 
 	/* Disable vlan support */
 	if (ec_port-ec_nvlans-- == 1) {
@@ -277,9 +273,8 @@ agr_vlan_del(struct agr_port *port, void
 		 */
 		ec_port-ec_capenable = ~ETHERCAP_VLAN_MTU;
 		if (port-port_ifp-if_flags  IFF_UP) {
-			ifr.ifr_flags = port-port_ifp-if_flags;
-			(void) (*port-port_ifp-if_ioctl)(port-port_ifp,
-			SIOCSIFFLAGS, (void *) ifr);
+			(void)if_flags_set(port-port_ifp,
+			port-port_ifp-if_flags);
 		}
 	}
 
@@ -641,10 +636,10 @@ agr_addport(struct ifnet *ifp, struct if
 	 * of each port to that of the first port. No need for arps 
 	 * since there are no inet addresses assigned to the ports.
 	 */
-	error = (*ifp_port-if_ioctl)(ifp_port, SIOCINITIFADDR, ifp-if_dl);
+	error = if_addr_init(ifp_port, ifp-if_dl, true);
 
 	if (error) {
-		printf(%s: SIOCINITIFADDR error %d\n, __func__, error);
+		printf(%s: if_addr_init error %d\n, __func__, error);
 		goto cleanup;
 	}
 	port-port_flags |= AGRPORT_LADDRCHANGED;

Index: src/sys/net/agr/if_agrether.c
diff -u src/sys/net/agr/if_agrether.c:1.8 src/sys/net/agr/if_agrether.c:1.9
--- src/sys/net/agr/if_agrether.c:1.8	Tue Jun  9 22:26:49 2009
+++ src/sys/net/agr/if_agrether.c	Wed Oct 19 01:49:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_agrether.c,v 1.8 2009/06/09 22:26:49 yamt Exp $	*/
+/*	$NetBSD: if_agrether.c,v 1.9 2011/10/19 01:49:50 dyoung Exp $	*/
 
 /*-
  * Copyright (c)2005 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_agrether.c,v 1.8 2009/06/09 22:26:49 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_agrether.c,v 1.9 2011/10/19 01:49:50 dyoung Exp $);
 
 #include sys/param.h
 #include sys/callout.h
@@ -175,9 +175,7 @@ agrether_portinit(struct agr_softc *sc, 
 		 */
 		ec_port-ec_capenable |= ETHERCAP_VLAN_MTU;
 		if (p-if_flags  IFF_UP) {
-			ifr.ifr_flags = p-if_flags;
-			error = (*p-if_ioctl)(p, SIOCSIFFLAGS,
-			(void *) ifr);
+			error = if_flags_set(p, p-if_flags);
 			if (error) {
 if (ec_port-ec_nvlans-- == 1)
 	ec_port-ec_capenable =
@@ -234,9 +232,8 @@ agrether_portfini(struct agr_softc *sc, 
 		 */
 		ec_port-ec_capenable = ~ETHERCAP_VLAN_MTU;
 		if (port-port_ifp-if_flags  IFF_UP) {
-			ifr.ifr_flags = port-port_ifp-if_flags;
-			(void) (*port-port_ifp-if_ioctl)(port-port_ifp,
-			SIOCSIFFLAGS, (void *) ifr);
+			(void)if_flags_set(port-port_ifp,
+			port-port_ifp-if_flags);
 		}
 	}
 



CVS commit: src/sys/netatalk

2011-10-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Oct 19 01:50:27 UTC 2011

Modified Files:
src/sys/netatalk: at_control.c

Log Message:
Use if_addr_init() instead of ifp-if_ioctl().


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/netatalk/at_control.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/netatalk/at_control.c
diff -u src/sys/netatalk/at_control.c:1.33 src/sys/netatalk/at_control.c:1.34
--- src/sys/netatalk/at_control.c:1.33	Sat Jan 30 21:48:30 2010
+++ src/sys/netatalk/at_control.c	Wed Oct 19 01:50:27 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: at_control.c,v 1.33 2010/01/30 21:48:30 is Exp $	 */
+/*	$NetBSD: at_control.c,v 1.34 2011/10/19 01:50:27 dyoung Exp $	 */
 
 /*
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: at_control.c,v 1.33 2010/01/30 21:48:30 is Exp $);
+__KERNEL_RCSID(0, $NetBSD: at_control.c,v 1.34 2011/10/19 01:50:27 dyoung Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -575,7 +575,7 @@ at_ifinit(struct ifnet *ifp, struct at_i
 	 * Now that we have selected an address, we need to tell the
 	 * interface about it, just in case it needs to adjust something.
 	 */
-	if ((error = (*ifp-if_ioctl)(ifp, SIOCINITIFADDR, aa)) != 0) {
+	if ((error = if_addr_init(ifp, aa-aa_ifa, true)) != 0) {
 		/*
 		 * of course this could mean that it objects violently
 		 * so if it does, we back out again..



CVS commit: src/sys/netinet

2011-10-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Oct 19 01:52:22 UTC 2011

Modified Files:
src/sys/netinet: in.c ip_carp.c ip_mroute.c

Log Message:
Use if_addr_init() and if_mcast_op() instead of ifp-if_ioctl().


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/sys/netinet/in.c
cvs rdiff -u -r1.45 -r1.46 src/sys/netinet/ip_carp.c
cvs rdiff -u -r1.120 -r1.121 src/sys/netinet/ip_mroute.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/netinet/in.c
diff -u src/sys/netinet/in.c:1.138 src/sys/netinet/in.c:1.139
--- src/sys/netinet/in.c:1.138	Sat May 15 05:02:46 2010
+++ src/sys/netinet/in.c	Wed Oct 19 01:52:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: in.c,v 1.138 2010/05/15 05:02:46 oki Exp $	*/
+/*	$NetBSD: in.c,v 1.139 2011/10/19 01:52:22 dyoung Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: in.c,v 1.138 2010/05/15 05:02:46 oki Exp $);
+__KERNEL_RCSID(0, $NetBSD: in.c,v 1.139 2011/10/19 01:52:22 dyoung Exp $);
 
 #include opt_inet.h
 #include opt_inet_conf.h
@@ -454,7 +454,7 @@ in_control(struct socket *so, u_long cmd
 			return (EINVAL);
 		oldaddr = ia-ia_dstaddr;
 		ia-ia_dstaddr = *satocsin(ifreq_getdstaddr(cmd, ifr));
-		if ((error = (*ifp-if_ioctl)(ifp, SIOCSIFDSTADDR, ia)) != 0) {
+		if ((error = if_addr_init(ifp, ia-ia_ifa, false)) != 0) {
 			ia-ia_dstaddr = oldaddr;
 			return error;
 		}
@@ -813,7 +813,7 @@ in_ifinit(struct ifnet *ifp, struct in_i
 	 * if this is its first address,
 	 * and to validate the address if necessary.
 	 */
-	if ((error = (*ifp-if_ioctl)(ifp, SIOCINITIFADDR, ia)) != 0)
+	if ((error = if_addr_init(ifp, ia-ia_ifa, true)) != 0)
 		goto bad;
 	splx(s);
 	if (scrub) {
@@ -1045,7 +1045,6 @@ in_addmulti(struct in_addr *ap, struct i
 {
 	struct sockaddr_in sin;
 	struct in_multi *inm;
-	struct ifreq ifr;
 	int s = splsoftnet();
 
 	/*
@@ -1078,8 +1077,7 @@ in_addmulti(struct in_addr *ap, struct i
 		 * filter appropriately for the new address.
 		 */
 		sockaddr_in_init(sin, ap, 0);
-		ifreq_setaddr(SIOCADDMULTI, ifr, sintosa(sin));
-		if ((*ifp-if_ioctl)(ifp, SIOCADDMULTI, ifr) != 0) {
+		if (if_mcast_op(ifp, SIOCADDMULTI, sintosa(sin)) != 0) {
 			LIST_REMOVE(inm, inm_list);
 			pool_put(inmulti_pool, inm);
 			splx(s);
@@ -1107,7 +1105,6 @@ void
 in_delmulti(struct in_multi *inm)
 {
 	struct sockaddr_in sin;
-	struct ifreq ifr;
 	int s = splsoftnet();
 
 	if (--inm-inm_refcount == 0) {
@@ -1126,8 +1123,7 @@ in_delmulti(struct in_multi *inm)
 		 * filter.
 		 */
 		sockaddr_in_init(sin, inm-inm_addr, 0);
-		ifreq_setaddr(SIOCDELMULTI, ifr, sintosa(sin));
-		(*inm-inm_ifp-if_ioctl)(inm-inm_ifp, SIOCDELMULTI, ifr);
+		if_mcast_op(inm-inm_ifp, SIOCDELMULTI, sintosa(sin));
 		pool_put(inmulti_pool, inm);
 	}
 	splx(s);

Index: src/sys/netinet/ip_carp.c
diff -u src/sys/netinet/ip_carp.c:1.45 src/sys/netinet/ip_carp.c:1.46
--- src/sys/netinet/ip_carp.c:1.45	Sun Jul 17 20:54:53 2011
+++ src/sys/netinet/ip_carp.c	Wed Oct 19 01:52:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_carp.c,v 1.45 2011/07/17 20:54:53 joerg Exp $	*/
+/*	$NetBSD: ip_carp.c,v 1.46 2011/10/19 01:52:22 dyoung Exp $	*/
 /*	$OpenBSD: ip_carp.c,v 1.113 2005/11/04 08:11:54 mcbride Exp $	*/
 
 /*
@@ -30,7 +30,7 @@
 #include opt_inet.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ip_carp.c,v 1.45 2011/07/17 20:54:53 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: ip_carp.c,v 1.46 2011/10/19 01:52:22 dyoung Exp $);
 
 /*
  * TODO:
@@ -2151,7 +2151,7 @@ carp_ether_addmulti(struct carp_softc *s
 	memcpy(mc-mc_addr, sa, sa-sa_len);
 	LIST_INSERT_HEAD(sc-carp_mc_listhead, mc, mc_entries);
 
-	error = (*ifp-if_ioctl)(ifp, SIOCADDMULTI, ifr);
+	error = if_mcast_op(ifp, SIOCADDMULTI, sa);
 	if (error != 0)
 		goto ioctl_failed;
 
@@ -2203,7 +2203,7 @@ carp_ether_delmulti(struct carp_softc *s
 		return (error);
 
 	/* We no longer use this multicast address.  Tell parent so. */
-	error = (*ifp-if_ioctl)(ifp, SIOCDELMULTI, ifr);
+	error = if_mcast_op(ifp, SIOCDELMULTI, sa);
 	if (error == 0) {
 		/* And forget about this address. */
 		LIST_REMOVE(mc, mc_entries);
@@ -,22 +,12 @@ carp_ether_purgemulti(struct carp_softc 
 {
 	struct ifnet *ifp = sc-sc_carpdev;		/* Parent. */
 	struct carp_mc_entry *mc;
-	union {
-		struct ifreq ifreq;
-		struct {
-			char ifr_name[IFNAMSIZ];
-			struct sockaddr_storage ifr_ss;
-		} ifreq_storage;
-	} u;
-	struct ifreq *ifr = u.ifreq;
 
 	if (ifp == NULL)
 		return;
 
-	memcpy(ifr-ifr_name, ifp-if_xname, IFNAMSIZ);
 	while ((mc = LIST_FIRST(sc-carp_mc_listhead)) != NULL) {
-		memcpy(ifr-ifr_addr, mc-mc_addr, mc-mc_addr.ss_len);
-		(void)(*ifp-if_ioctl)(ifp, SIOCDELMULTI, ifr);
+		(void)if_mcast_op(ifp, SIOCDELMULTI, sstosa(mc-mc_addr));
 		LIST_REMOVE(mc, mc_entries);
 		free(mc, M_DEVBUF);
 	}

Index: src/sys/netinet/ip_mroute.c
diff -u 

CVS commit: src/sys/netinet6

2011-10-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Oct 19 01:53:08 UTC 2011

Modified Files:
src/sys/netinet6: in6.c ip6_mroute.c mld6.c

Log Message:
Use if_addr_init() and if_mcast_op() instead of ifp-if_ioctl().


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/netinet6/in6.c
cvs rdiff -u -r1.101 -r1.102 src/sys/netinet6/ip6_mroute.c
cvs rdiff -u -r1.53 -r1.54 src/sys/netinet6/mld6.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/netinet6/in6.c
diff -u src/sys/netinet6/in6.c:1.157 src/sys/netinet6/in6.c:1.158
--- src/sys/netinet6/in6.c:1.157	Sun Feb  6 19:12:55 2011
+++ src/sys/netinet6/in6.c	Wed Oct 19 01:53:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6.c,v 1.157 2011/02/06 19:12:55 dyoung Exp $	*/
+/*	$NetBSD: in6.c,v 1.158 2011/10/19 01:53:07 dyoung Exp $	*/
 /*	$KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: in6.c,v 1.157 2011/02/06 19:12:55 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: in6.c,v 1.158 2011/10/19 01:53:07 dyoung Exp $);
 
 #include opt_inet.h
 #include opt_pfil_hooks.h
@@ -1753,8 +1753,8 @@ in6_ifinit(struct ifnet *ifp, struct in6
 
 	ia-ia_addr = *sin6;
 
-	if (ifacount = 1  
-	(error = (*ifp-if_ioctl)(ifp, SIOCINITIFADDR, ia)) != 0) {
+	if (ifacount = 1 
+	(error = if_addr_init(ifp, ia-ia_ifa, true)) != 0) {
 		splx(s);
 		return error;
 	}

Index: src/sys/netinet6/ip6_mroute.c
diff -u src/sys/netinet6/ip6_mroute.c:1.101 src/sys/netinet6/ip6_mroute.c:1.102
--- src/sys/netinet6/ip6_mroute.c:1.101	Wed Aug 31 18:31:03 2011
+++ src/sys/netinet6/ip6_mroute.c	Wed Oct 19 01:53:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_mroute.c,v 1.101 2011/08/31 18:31:03 plunky Exp $	*/
+/*	$NetBSD: ip6_mroute.c,v 1.102 2011/10/19 01:53:07 dyoung Exp $	*/
 /*	$KAME: ip6_mroute.c,v 1.49 2001/07/25 09:21:18 jinmei Exp $	*/
 
 /*
@@ -117,7 +117,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ip6_mroute.c,v 1.101 2011/08/31 18:31:03 plunky Exp $);
+__KERNEL_RCSID(0, $NetBSD: ip6_mroute.c,v 1.102 2011/10/19 01:53:07 dyoung Exp $);
 
 #include opt_inet.h
 #include opt_mrouting.h
@@ -512,7 +512,7 @@ ip6_mrouter_done(void)
 	mifi_t mifi;
 	int i;
 	struct ifnet *ifp;
-	struct in6_ifreq ifr;
+	struct sockaddr_in6 sin6;
 	struct mf6c *rt;
 	struct rtdetq *rte;
 	int s;
@@ -538,10 +538,11 @@ ip6_mrouter_done(void)
 		for (mifi = 0; mifi  nummifs; mifi++) {
 			if (mif6table[mifi].m6_ifp 
 			!(mif6table[mifi].m6_flags  MIFF_REGISTER)) {
-ifr.ifr_addr.sin6_family = AF_INET6;
-ifr.ifr_addr.sin6_addr= in6addr_any;
+sin6.sin6_family = AF_INET6;
+sin6.sin6_addr = in6addr_any;
 ifp = mif6table[mifi].m6_ifp;
-(*ifp-if_ioctl)(ifp, SIOCDELMULTI, ifr);
+if_mcast_op(ifp, SIOCDELMULTI,
+sin6tocsa(sin6));
 			}
 		}
 	}
@@ -643,7 +644,7 @@ add_m6if(struct mif6ctl *mifcp)
 {
 	struct mif6 *mifp;
 	struct ifnet *ifp;
-	struct in6_ifreq ifr;
+	struct sockaddr_in6 sin6;
 	int error, s;
 #ifdef notyet
 	struct tbf *m_tbf = tbftable + mifcp-mif6c_mifi;
@@ -686,9 +687,9 @@ add_m6if(struct mif6ctl *mifcp)
 		 * Enable promiscuous reception of all IPv6 multicasts
 		 * from the interface.
 		 */
-		ifr.ifr_addr.sin6_family = AF_INET6;
-		ifr.ifr_addr.sin6_addr = in6addr_any;
-		error = (*ifp-if_ioctl)(ifp, SIOCADDMULTI, ifr);
+		sin6.sin6_family = AF_INET6;
+		sin6.sin6_addr = in6addr_any;
+		error = if_mcast_op(ifp, SIOCADDMULTI, sin6tosa(sin6));
 		splx(s);
 		if (error)
 			return error;
@@ -731,7 +732,7 @@ del_m6if(mifi_t *mifip)
 	struct mif6 *mifp = mif6table + *mifip;
 	mifi_t mifi;
 	struct ifnet *ifp;
-	struct in6_ifreq ifr;
+	struct sockaddr_in6 sin6;
 	int s;
 
 	if (*mifip = nummifs)
@@ -748,9 +749,9 @@ del_m6if(mifi_t *mifip)
 		 */
 		ifp = mifp-m6_ifp;
 
-		ifr.ifr_addr.sin6_family = AF_INET6;
-		ifr.ifr_addr.sin6_addr = in6addr_any;
-		(*ifp-if_ioctl)(ifp, SIOCDELMULTI, ifr);
+		sin6.sin6_family = AF_INET6;
+		sin6.sin6_addr = in6addr_any;
+		if_mcast_op(ifp, SIOCDELMULTI, sin6tosa(sin6));
 	} else {
 		if (reg_mif_num != (mifi_t)-1) {
 			if_detach(multicast_register_if6);

Index: src/sys/netinet6/mld6.c
diff -u src/sys/netinet6/mld6.c:1.53 src/sys/netinet6/mld6.c:1.54
--- src/sys/netinet6/mld6.c:1.53	Wed Aug 31 18:31:03 2011
+++ src/sys/netinet6/mld6.c	Wed Oct 19 01:53:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mld6.c,v 1.53 2011/08/31 18:31:03 plunky Exp $	*/
+/*	$NetBSD: mld6.c,v 1.54 2011/10/19 01:53:07 dyoung Exp $	*/
 /*	$KAME: mld6.c,v 1.25 2001/01/16 14:14:18 itojun Exp $	*/
 
 /*
@@ -102,7 +102,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mld6.c,v 1.53 2011/08/31 18:31:03 plunky Exp $);
+__KERNEL_RCSID(0, $NetBSD: mld6.c,v 1.54 2011/10/19 01:53:07 dyoung Exp $);
 
 #include opt_inet.h
 
@@ -616,7 +616,7 @@ in6_addmulti(struct in6_addr *maddr6, st
 	int *errorp, int timer)
 {
 	struct	in6_ifaddr *ia;
-	struct	in6_ifreq 

CVS commit: src/sys/netiso

2011-10-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Oct 19 01:53:35 UTC 2011

Modified Files:
src/sys/netiso: iso.c iso_snpac.c

Log Message:
Use if_addr_init() and if_mcast_op() instead of ifp-if_ioctl().


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/netiso/iso.c
cvs rdiff -u -r1.53 -r1.54 src/sys/netiso/iso_snpac.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/netiso/iso.c
diff -u src/sys/netiso/iso.c:1.57 src/sys/netiso/iso.c:1.58
--- src/sys/netiso/iso.c:1.57	Fri Aug  7 14:04:34 2009
+++ src/sys/netiso/iso.c	Wed Oct 19 01:53:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: iso.c,v 1.57 2009/08/07 14:04:34 wiz Exp $	*/
+/*	$NetBSD: iso.c,v 1.58 2011/10/19 01:53:35 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@ SOFTWARE.
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: iso.c,v 1.57 2009/08/07 14:04:34 wiz Exp $);
+__KERNEL_RCSID(0, $NetBSD: iso.c,v 1.58 2011/10/19 01:53:35 dyoung Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -649,7 +649,7 @@ iso_ifinit(struct ifnet *ifp, struct iso
 	 * if this is its first address,
 	 * and to validate the address if necessary.
 	 */
-	if ((error = (*ifp-if_ioctl)(ifp, SIOCINITIFADDR, ia)) != 0) {
+	if ((error = if_addr_init(ifp, ia-ia_ifa, true)) != 0) {
 		splx(s);
 		ia-ia_addr = oldaddr;
 		return (error);

Index: src/sys/netiso/iso_snpac.c
diff -u src/sys/netiso/iso_snpac.c:1.53 src/sys/netiso/iso_snpac.c:1.54
--- src/sys/netiso/iso_snpac.c:1.53	Thu Apr 16 21:37:17 2009
+++ src/sys/netiso/iso_snpac.c	Wed Oct 19 01:53:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: iso_snpac.c,v 1.53 2009/04/16 21:37:17 elad Exp $	*/
+/*	$NetBSD: iso_snpac.c,v 1.54 2011/10/19 01:53:35 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -59,7 +59,7 @@ SOFTWARE.
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: iso_snpac.c,v 1.53 2009/04/16 21:37:17 elad Exp $);
+__KERNEL_RCSID(0, $NetBSD: iso_snpac.c,v 1.54 2011/10/19 01:53:35 dyoung Exp $);
 
 #include opt_iso.h
 #ifdef ISO
@@ -275,18 +275,18 @@ iso_setmcasts(struct ifnet *ifp, int req
 {
 	static const char * const addrlist[] =
 	{all_es_snpa, all_is_snpa, all_l1is_snpa, all_l2is_snpa, 0};
-	struct ifreq ifr;
+	struct sockaddr sa;
 	const char *const *cpp;
 
-	(void)memset(ifr, 0, sizeof(ifr));
+	(void)memset(sa, 0, sizeof(sa));
 	for (cpp = addrlist; *cpp; cpp++) {
-		(void)memcpy(ifr.ifr_addr.sa_data, *cpp, 6);
+		(void)memcpy(sa.sa_data, *cpp, 6);
 		if (req == RTM_ADD  
-		(*ifp-if_ioctl)(ifp, SIOCADDMULTI, ifr) != 0)
+		if_mcast_op(ifp, SIOCADDMULTI, sa) != 0)
 			printf(iso_setmcasts: %s unable to add mcast\n,
 			ifp-if_xname);
 		else if (req == RTM_DELETE  
-		(*ifp-if_ioctl)(ifp, SIOCDELMULTI, ifr) != 0)
+		if_mcast_op(ifp, SIOCDELMULTI, sa) != 0)
 			printf(iso_setmcasts: %s unable to delete mcast\n,
 			ifp-if_xname);
 	}



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

2011-10-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Oct 19 05:01:43 UTC 2011

Modified Files:
src/sys/arch/x86/x86: x86_stub.c

Log Message:
Create a stub implementation of pci_ranges_infer().


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/x86/x86/x86_stub.c

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

Modified files:

Index: src/sys/arch/x86/x86/x86_stub.c
diff -u src/sys/arch/x86/x86/x86_stub.c:1.3 src/sys/arch/x86/x86/x86_stub.c:1.4
--- src/sys/arch/x86/x86/x86_stub.c:1.3	Tue Oct 18 23:41:45 2011
+++ src/sys/arch/x86/x86/x86_stub.c	Wed Oct 19 05:01:43 2011
@@ -1,13 +1,14 @@
-/* $NetBSD: x86_stub.c,v 1.3 2011/10/18 23:41:45 dyoung Exp $ */
+/* $NetBSD: x86_stub.c,v 1.4 2011/10/19 05:01:43 dyoung Exp $ */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: x86_stub.c,v 1.3 2011/10/18 23:41:45 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: x86_stub.c,v 1.4 2011/10/19 05:01:43 dyoung Exp $);
 
 #include sys/param.h
 #include sys/systm.h
 #include sys/kgdb.h
 
 #include machine/autoconf.h
+#include dev/pci/pcivar.h
 
 int x86_zeroop(void);
 void *x86_nullop(void);
@@ -30,11 +31,12 @@ x86_zeroop(void)
 	return 0;
 }
 
+__weak_alias(device_isa_register, x86_nullop);
 __weak_alias(device_pci_props_register, x86_voidop);
 __weak_alias(device_pci_register, x86_nullop);
-__weak_alias(device_isa_register, x86_nullop);
 __weak_alias(kdb_trap, x86_zeroop);
 __weak_alias(kgdb_disconnected, x86_zeroop);
 __weak_alias(kgdb_trap, x86_zeroop);
 __weak_alias(mca_nmi, x86_voidop);
+__weak_alias(pci_ranges_infer, x86_voidop);
 __weak_alias(x86_nmi, x86_voidop);



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

2011-10-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Oct 19 05:22:25 UTC 2011

Modified Files:
src/sys/arch/x86/conf: files.x86

Log Message:
Don't link pci_ranges.c with x86 kernels for now, it's using a
pcibus_attach_args member that I haven't added, yet.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/x86/conf/files.x86

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/conf/files.x86
diff -u src/sys/arch/x86/conf/files.x86:1.74 src/sys/arch/x86/conf/files.x86:1.75
--- src/sys/arch/x86/conf/files.x86:1.74	Mon Oct 17 23:24:05 2011
+++ src/sys/arch/x86/conf/files.x86	Wed Oct 19 05:22:25 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.x86,v 1.74 2011/10/17 23:24:05 jmcneill Exp $
+#	$NetBSD: files.x86,v 1.75 2011/10/19 05:22:25 dyoung Exp $
 
 # options for MP configuration through the MP spec
 defflag opt_mpbios.h MPBIOS MPVERBOSE MPDEBUG MPBIOS_SCANPCI
@@ -129,7 +129,7 @@ file	arch/x86/x86/tprof_pmi.c	tprof_pmi
 file	arch/x86/x86/tprof_amdpmi.c	tprof_amdpmi
 
 file	arch/x86/pci/pci_machdep.c	pci
-file	arch/x86/pci/pci_ranges.c	pci
+#file	arch/x86/pci/pci_ranges.c	pci
 file	arch/x86/pci/pci_intr_machdep.c	pci
 
 file	arch/x86/pci/pciide_machdep.c	pciide_common