CVS commit: src/lib/libmenu

2012-06-30 Thread Julian Fagir
Module Name:src
Committed By:   jdf
Date:   Sat Jun 30 09:25:55 UTC 2012

Modified Files:
src/lib/libmenu: menu_items.3 menu_new.3

Log Message:
Replace wrong variable type (s/ITEMS/ITEM).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libmenu/menu_items.3 \
src/lib/libmenu/menu_new.3

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

Modified files:

Index: src/lib/libmenu/menu_items.3
diff -u src/lib/libmenu/menu_items.3:1.9 src/lib/libmenu/menu_items.3:1.10
--- src/lib/libmenu/menu_items.3:1.9	Wed Apr 16 13:35:11 2003
+++ src/lib/libmenu/menu_items.3	Sat Jun 30 09:25:55 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: menu_items.3,v 1.9 2003/04/16 13:35:11 wiz Exp $
+.\	$NetBSD: menu_items.3,v 1.10 2012/06/30 09:25:55 jdf Exp $
 .\
 .\ Copyright (c) 1999
 .\	Brett Lymn - bl...@baea.com.au, brett_l...@yahoo.com.au
@@ -43,7 +43,7 @@
 .In menu.h
 .Ft int
 .Fn item_count MENU *menu
-.Ft ITEMS **
+.Ft ITEM **
 .Fn menu_items MENU *menu
 .Ft int
 .Fn set_menu_items MENU *menu ITEM **items
Index: src/lib/libmenu/menu_new.3
diff -u src/lib/libmenu/menu_new.3:1.9 src/lib/libmenu/menu_new.3:1.10
--- src/lib/libmenu/menu_new.3:1.9	Wed Apr 16 13:35:11 2003
+++ src/lib/libmenu/menu_new.3	Sat Jun 30 09:25:55 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: menu_new.3,v 1.9 2003/04/16 13:35:11 wiz Exp $
+.\	$NetBSD: menu_new.3,v 1.10 2012/06/30 09:25:55 jdf Exp $
 .\
 .\ Copyright (c) 1999
 .\	Brett Lymn - bl...@baea.com.au, brett_l...@yahoo.com.au
@@ -43,7 +43,7 @@
 .Ft int
 .Fn free_menu MENU *menu
 .Ft MENU *
-.Fn new_menu ITEMS **items
+.Fn new_menu ITEM **items
 .Sh DESCRIPTION
 The
 .Fn free_menu



CVS commit: [netbsd-6] src/share/mk

2012-06-30 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Jun 30 10:13:03 UTC 2012

Modified Files:
src/share/mk [netbsd-6]: bsd.sys.mk

Log Message:
Pull up following revision(s) (requested by abs in ticket #379):
share/mk/bsd.sys.mk: revision 1.216
Whatever -Wl,--fatal-warnings get-out-of-jail-free card gcc-4.5 gets,
give the same treatment to gcc-4.1.


To generate a diff of this commit:
cvs rdiff -u -r1.211 -r1.211.2.1 src/share/mk/bsd.sys.mk

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

Modified files:

Index: src/share/mk/bsd.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.211 src/share/mk/bsd.sys.mk:1.211.2.1
--- src/share/mk/bsd.sys.mk:1.211	Sat Jan 28 21:32:14 2012
+++ src/share/mk/bsd.sys.mk	Sat Jun 30 10:13:02 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.sys.mk,v 1.211 2012/01/28 21:32:14 christos Exp $
+#	$NetBSD: bsd.sys.mk,v 1.211.2.1 2012/06/30 10:13:02 bouyer Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -40,7 +40,7 @@ CFLAGS+=	-Wa,--fatal-warnings
 .if (!defined(MKPIC) || ${MKPIC} != no)  \
 (!defined(LDSTATIC) || ${LDSTATIC} != -static)
 # XXX there are some strange problems not yet resolved
-. if !defined(HAVE_GCC) || ${HAVE_GCC} != 45
+. if !defined(HAVE_GCC)
 LDFLAGS+=	-Wl,--fatal-warnings
 . endif
 .endif



CVS commit: [netbsd-6] src/doc

2012-06-30 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Jun 30 10:13:29 UTC 2012

Modified Files:
src/doc [netbsd-6]: CHANGES-6.0

Log Message:
ticket 379


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.144 -r1.1.2.145 src/doc/CHANGES-6.0

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

Modified files:

Index: src/doc/CHANGES-6.0
diff -u src/doc/CHANGES-6.0:1.1.2.144 src/doc/CHANGES-6.0:1.1.2.145
--- src/doc/CHANGES-6.0:1.1.2.144	Thu Jun 28 16:13:39 2012
+++ src/doc/CHANGES-6.0	Sat Jun 30 10:13:29 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0,v 1.1.2.144 2012/06/28 16:13:39 riz Exp $
+# $NetBSD: CHANGES-6.0,v 1.1.2.145 2012/06/30 10:13:29 bouyer Exp $
 
 A complete list of changes from the initial NetBSD 6.0 branch on 15 Feb 2012
 until the 6.0 release:
@@ -5936,3 +5936,9 @@ bin/stty/stty.c	1.22
 	Improve documentation and sync usage.
 	[wiz, ticket #364]
 
+share/mk/bsd.sys.mk1.216
+
+	Match Wl,--fatal-warnings behaviour in gcc-4.1 to that
+	of gcc 4.5; fix vax build.
+	[abs, ticket #379]
+



CVS commit: src/distrib/atari/floppies/common

2012-06-30 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 30 10:20:26 UTC 2012

Modified Files:
src/distrib/atari/floppies/common: dot.profile

Log Message:
Simply use mount -u to (re)mount root file system read-write
rather than denoting it using temporary /tmp/.root_writable file,
because it will never be removed if root file system is on floppy.
Fixes PR port-atari/37470.

Should be pulled up to netbsd-6.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/atari/floppies/common/dot.profile

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

Modified files:

Index: src/distrib/atari/floppies/common/dot.profile
diff -u src/distrib/atari/floppies/common/dot.profile:1.3 src/distrib/atari/floppies/common/dot.profile:1.4
--- src/distrib/atari/floppies/common/dot.profile:1.3	Mon Nov 17 20:14:35 2008
+++ src/distrib/atari/floppies/common/dot.profile	Sat Jun 30 10:20:26 2012
@@ -1,4 +1,4 @@
-# $NetBSD: dot.profile,v 1.3 2008/11/17 20:14:35 abs Exp $
+# $NetBSD: dot.profile,v 1.4 2012/06/30 10:20:26 tsutsui Exp $
 #
 # Copyright (c) 1995 Jason R. Thorpe
 # Copyright (c) 1994 Christopher G. Demetriou
@@ -47,16 +47,13 @@ export EDITOR
 umask 022
 
 makerootwritable() {
-	if [ ! -e /tmp/.root_writable ]; then
-		# note, only handles up to partition 'j'
-		rootdev=/dev/$(sysctl -n kern.root_device)$(sysctl -n kern.root_partition | sed y/0123456789/abcdefghij/)
-		if ! mount $rootdev / ; then
-		echo Unable to mount $rootdev read-write
-		exit 1
-		fi
-		cp /dev/null /tmp/.root_writable
-		echo Mounted $rootdev read-write
+	# note, only handles up to partition 'j'
+	rootdev=/dev/$(sysctl -n kern.root_device)$(sysctl -n kern.root_partition | sed y/0123456789/abcdefghij/)
+	if ! mount -u $rootdev / ; then
+	echo Unable to mount $rootdev read-write
+	exit 1
 	fi
+	echo Mounted $rootdev read-write
 }
 
 if [ X${DONEPROFILE} = X ]; then



CVS commit: src/sys/arch/atari/atari

2012-06-30 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 30 10:37:00 UTC 2012

Modified Files:
src/sys/arch/atari/atari: autoconf.c

Log Message:
Add a dirty hack for atari's ancient installation ramdisk:
 Forcibly configure md0, md1, and md2 devices before setroot()
 for atari's traditional auto-load from floppy on open md_root device
 which loads installation ramdisk image from floppy.
 md(4) has been changed dynamically configured at first open after 5.0
 and md devices won't appear in root device: prompt without this hack.
Tested on TT030.

Should be pulled up to netbsd-6.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/atari/atari/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/atari/atari/autoconf.c
diff -u src/sys/arch/atari/atari/autoconf.c:1.61 src/sys/arch/atari/atari/autoconf.c:1.62
--- src/sys/arch/atari/atari/autoconf.c:1.61	Sun Jun  5 17:09:18 2011
+++ src/sys/arch/atari/atari/autoconf.c	Sat Jun 30 10:37:00 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.61 2011/06/05 17:09:18 matt Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.62 2012/06/30 10:37:00 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1995 Leo Weppelman
@@ -31,7 +31,9 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.61 2011/06/05 17:09:18 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.62 2012/06/30 10:37:00 tsutsui Exp $);
+
+#include opt_md.h
 
 #include sys/param.h
 #include sys/systm.h
@@ -41,10 +43,17 @@ __KERNEL_RCSID(0, $NetBSD: autoconf.c,v
 #include sys/device.h
 #include sys/disklabel.h
 #include sys/disk.h
+#include sys/malloc.h
 #include machine/disklabel.h
 #include machine/cpu.h
 #include atari/atari/device.h
 
+#if defined(MEMORY_DISK_HOOKS)
+#include dev/md.h
+#endif
+
+#include ioconf.h
+
 static void findroot(void);
 int mbmatch(device_t, cfdata_t, void *);
 void mbattach(device_t, device_t, void *);
@@ -75,6 +84,41 @@ cpu_rootconf(void)
 {
 
 	findroot();
+#if defined(MEMORY_DISK_HOOKS)
+	/*
+	 * XXX
+	 * quick hacks for atari's traditional auto-load from floppy on open
+	 * installation md(4) ramdisk.
+	 * See sys/arch/atari/dev/md_root.c for details.
+	 */
+#define RAMD_NDEV	3	/* XXX */
+
+	if ((boothowto  RB_ASKNAME) != 0) {
+		int md_major, i;
+		dev_t md_dev;
+		cfdata_t cf;
+		struct md_softc *sc;
+
+		md_major = devsw_name2blk(md, NULL, 0);
+		if (md_major = 0) {
+			for (i = 0; i  RAMD_NDEV; i++) {
+md_dev = MAKEDISKDEV(md_major, i, RAW_PART);
+cf = malloc(sizeof(*cf), M_DEVBUF,
+M_ZERO|M_WAITOK);
+if (cf == NULL)
+	break;	/* XXX */
+cf-cf_name = md_cd.cd_name;
+cf-cf_atname = md_cd.cd_name;
+cf-cf_unit = i;
+cf-cf_fstate = FSTATE_STAR;
+/* XXX mutex */
+sc = device_private(config_attach_pseudo(cf));
+if (sc == NULL)
+	break;	/* XXX */
+			}
+		}
+	}
+#endif
 	setroot(booted_device, booted_partition);
 }
 



CVS commit: src/sys/dev

2012-06-30 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 30 10:52:32 UTC 2012

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

Log Message:
Make sure that disklabel of md(4) device is initialized
in the case where it's configured in MD md_open_hook().

Without this, msdosfs_mountfs() (which is called from msdosfs_mountroot())
will be called with uninitialized disklabel (d_secsize == 0) and
it gets panic: buf mem pool index 23 later on atari.
This is because getdisksize() doesn't check returned d_secsize value
and msdosfs_mountfs() blindly calls bread(9) with size==0 in that case.

Should be pulled up to netbsd-6 (at least for atari).


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

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

Modified files:

Index: src/sys/dev/md.c
diff -u src/sys/dev/md.c:1.66 src/sys/dev/md.c:1.67
--- src/sys/dev/md.c:1.66	Thu Nov 25 08:53:30 2010
+++ src/sys/dev/md.c	Sat Jun 30 10:52:31 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.66 2010/11/25 08:53:30 hannken Exp $	*/
+/*	$NetBSD: md.c,v 1.67 2012/06/30 10:52:31 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1995 Gordon W. Ross, Leo Weppelman.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: md.c,v 1.66 2010/11/25 08:53:30 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: md.c,v 1.67 2012/06/30 10:52:31 tsutsui Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_md.h
@@ -243,6 +243,9 @@ mdopen(dev_t dev, int flag, int fmt, str
 	cfdata_t cf;
 	struct md_softc *sc;
 	struct disk *dk;
+#ifdef	MEMORY_DISK_HOOKS
+	bool configured;
+#endif
 
 	mutex_enter(md_device_lock);
 	unit = MD_UNIT(dev);
@@ -274,7 +277,11 @@ mdopen(dev_t dev, int flag, int fmt, str
 
 #ifdef	MEMORY_DISK_HOOKS
 	/* Call the open hook to allow loading the device. */
+	configured = (sc-sc_type != MD_UNCONFIGURED);
 	md_open_hook(unit, sc-sc_md);
+	/* initialize disklabel if the device is configured in open hook */
+	if (!configured  sc-sc_type != MD_UNCONFIGURED)
+		md_set_disklabel(sc);
 #endif
 
 	/*



CVS commit: src/sys/fs/msdosfs

2012-06-30 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 30 11:01:42 UTC 2012

Modified Files:
src/sys/fs/msdosfs: msdosfs_vfsops.c

Log Message:
Add a sanity check if secsize returned from getdisksize() isn't bogus.
This prevent possible panic panic: buf mem pool index 23 later in
vfs_bio.c:buf_mempoolidx().
(I'm not sure if it's okay for getdisksize() to assume that
 partinfo taken from DIOCGPART is properly initialized
 on all disk(9) devices or not)

See also:
http://mail-index.NetBSD.org/source-changes/2012/06/30/msg035298.html


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/fs/msdosfs/msdosfs_vfsops.c

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

Modified files:

Index: src/sys/fs/msdosfs/msdosfs_vfsops.c
diff -u src/sys/fs/msdosfs/msdosfs_vfsops.c:1.94 src/sys/fs/msdosfs/msdosfs_vfsops.c:1.95
--- src/sys/fs/msdosfs/msdosfs_vfsops.c:1.94	Tue Mar 13 18:40:37 2012
+++ src/sys/fs/msdosfs/msdosfs_vfsops.c	Sat Jun 30 11:01:41 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vfsops.c,v 1.94 2012/03/13 18:40:37 elad Exp $	*/
+/*	$NetBSD: msdosfs_vfsops.c,v 1.95 2012/06/30 11:01:41 tsutsui Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_vfsops.c,v 1.94 2012/03/13 18:40:37 elad Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_vfsops.c,v 1.95 2012/06/30 11:01:41 tsutsui Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_compat_netbsd.h
@@ -493,7 +493,7 @@ msdosfs_mountfs(struct vnode *devvp, str
 		goto error_exit;
 
 	error = getdisksize(devvp, psize, secsize);
-	if (error) {
+	if (error || secsize == 0) {
 		if (argp-flags  MSDOSFSMNT_GEMDOSFS)
 			goto error_exit;
 



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

2012-06-30 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 30 12:42:37 UTC 2012

Modified Files:
src/sys/arch/atari/dev: clock.c

Log Message:
Fix buffer overrun (off by one). PR port-atari/42717


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/atari/dev/clock.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/atari/dev/clock.c
diff -u src/sys/arch/atari/dev/clock.c:1.53 src/sys/arch/atari/dev/clock.c:1.54
--- src/sys/arch/atari/dev/clock.c:1.53	Sun Jun  5 06:33:42 2011
+++ src/sys/arch/atari/dev/clock.c	Sat Jun 30 12:42:37 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.53 2011/06/05 06:33:42 tsutsui Exp $	*/
+/*	$NetBSD: clock.c,v 1.54 2012/06/30 12:42:37 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: clock.c,v 1.53 2011/06/05 06:33:42 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: clock.c,v 1.54 2012/06/30 12:42:37 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -505,7 +505,7 @@ rtcread(dev_t dev, struct uio *uio, int 
 	struct clock_softc	*sc;
 	mc_todregs		clkregs;
 	int			s, length;
-	char			buffer[16];
+	char			buffer[16 + 1];
 
 	sc = device_lookup_private(clock_cd, minor(dev));
 



CVS commit: src

2012-06-30 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Sat Jun 30 15:03:58 UTC 2012

Modified Files:
src/distrib/sets/lists/modules: md.amd64 md.i386
src/etc/etc.amd64: Makefile.inc
src/etc/etc.i386: Makefile.inc
src/sys/arch/usermode/conf: Makefile.usermode
src/sys/modules: Makefile
Added Files:
src/sys/arch/amd64/conf: GENERIC_USERMODE
src/sys/arch/i386/conf: GENERIC_USERMODE
Removed Files:
src/sys/arch/usermode/conf: GENERIC.amd64 GENERIC.i386

Log Message:
Move i386 and amd64 usermode configurations to their respective directories
and make the usermode kernels buildalbe under build.sh.

The resulting kernels are build and packaged correctly as are the associated
modules.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/distrib/sets/lists/modules/md.amd64
cvs rdiff -u -r1.38 -r1.39 src/distrib/sets/lists/modules/md.i386
cvs rdiff -u -r1.12 -r1.13 src/etc/etc.amd64/Makefile.inc
cvs rdiff -u -r1.65 -r1.66 src/etc/etc.i386/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/sys/arch/amd64/conf/GENERIC_USERMODE
cvs rdiff -u -r0 -r1.1 src/sys/arch/i386/conf/GENERIC_USERMODE
cvs rdiff -u -r1.3 -r0 src/sys/arch/usermode/conf/GENERIC.amd64
cvs rdiff -u -r1.5 -r0 src/sys/arch/usermode/conf/GENERIC.i386
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/usermode/conf/Makefile.usermode
cvs rdiff -u -r1.106 -r1.107 src/sys/modules/Makefile

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/modules/md.amd64
diff -u src/distrib/sets/lists/modules/md.amd64:1.32 src/distrib/sets/lists/modules/md.amd64:1.33
--- src/distrib/sets/lists/modules/md.amd64:1.32	Tue Jan 17 16:59:37 2012
+++ src/distrib/sets/lists/modules/md.amd64	Sat Jun 30 15:03:56 2012
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.32 2012/01/17 16:59:37 jakllsch Exp $
+# $NetBSD: md.amd64,v 1.33 2012/06/30 15:03:56 reinoud Exp $
 ./@MODULEDIR@/acpiacadbase-kernel-modules	kmod
 ./@MODULEDIR@/acpiacad/acpiacad.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/acpibatbase-kernel-modules	kmod
@@ -101,6 +101,8 @@
 ./@MODULEDIR@/powernow/powernow.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/pwdogbase-kernel-modules	kmod
 ./@MODULEDIR@/pwdog/pwdog.kmod			base-kernel-modules	kmod
+./@MODULEDIR@/syscallemu			base-kernel-modules	kmod
+./@MODULEDIR@/syscallemu/syscallemu.kmod	base-kernel-modules	kmod
 ./@MODULEDIR@/thinkpadbase-kernel-modules	kmod
 ./@MODULEDIR@/thinkpad/thinkpad.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/tprof_amdpmi			base-kernel-modules	kmod

Index: src/distrib/sets/lists/modules/md.i386
diff -u src/distrib/sets/lists/modules/md.i386:1.38 src/distrib/sets/lists/modules/md.i386:1.39
--- src/distrib/sets/lists/modules/md.i386:1.38	Tue Jan 17 16:59:38 2012
+++ src/distrib/sets/lists/modules/md.i386	Sat Jun 30 15:03:56 2012
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.38 2012/01/17 16:59:38 jakllsch Exp $
+# $NetBSD: md.i386,v 1.39 2012/06/30 15:03:56 reinoud Exp $
 ./@MODULEDIR@/acpiacadbase-kernel-modules	kmod
 ./@MODULEDIR@/acpiacad/acpiacad.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/acpibatbase-kernel-modules	kmod
@@ -121,6 +121,8 @@
 ./@MODULEDIR@/savagedrm/savagedrm.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/sisdrmbase-kernel-modules	kmod
 ./@MODULEDIR@/sisdrm/sisdrm.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/syscallemu			base-kernel-modules	kmod
+./@MODULEDIR@/syscallemu/syscallemu.kmod	base-kernel-modules	kmod
 ./@MODULEDIR@/tdfxdrmbase-kernel-modules	kmod
 ./@MODULEDIR@/tdfxdrm/tdfxdrm.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/thinkpadbase-kernel-modules	kmod

Index: src/etc/etc.amd64/Makefile.inc
diff -u src/etc/etc.amd64/Makefile.inc:1.12 src/etc/etc.amd64/Makefile.inc:1.13
--- src/etc/etc.amd64/Makefile.inc:1.12	Tue Jan 18 00:22:56 2011
+++ src/etc/etc.amd64/Makefile.inc	Sat Jun 30 15:03:57 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.12 2011/01/18 00:22:56 jym Exp $
+#	$NetBSD: Makefile.inc,v 1.13 2012/06/30 15:03:57 reinoud Exp $
 #
 #	etc.amd64/Makefile.inc -- amd64-specific etc Makefile targets
 #
@@ -8,6 +8,7 @@
 
 KERNEL_SETS=		GENERIC
 KERNEL_SETS+=		XEN3_DOM0 XEN3_DOMU
+KERNEL_SETS+=		GENERIC_USERMODE
 
 BUILD_KERNELS=		INSTALL INSTALL_XEN3_DOMU
 

Index: src/etc/etc.i386/Makefile.inc
diff -u src/etc/etc.i386/Makefile.inc:1.65 src/etc/etc.i386/Makefile.inc:1.66
--- src/etc/etc.i386/Makefile.inc:1.65	Thu Feb 10 00:43:20 2011
+++ src/etc/etc.i386/Makefile.inc	Sat Jun 30 15:03:57 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.65 2011/02/10 00:43:20 jym Exp $
+#	$NetBSD: Makefile.inc,v 1.66 2012/06/30 15:03:57 reinoud Exp $
 #
 #	etc.i386/Makefile.inc -- i386-specific etc Makefile targets
 #
@@ -12,6 +12,7 @@ KERNEL_SETS+=	XEN3_DOM0
 KERNEL_SETS+=	XEN3_DOMU
 KERNEL_SETS+=	XEN3PAE_DOM0
 KERNEL_SETS+=	XEN3PAE_DOMU
+KERNEL_SETS+=	GENERIC_USERMODE
 # KERNEL_SETS+=	GENERIC_TINY
 # KERNEL_SETS+=	GENERIC_PS2TINY
 

Index: 

CVS commit: src

2012-06-30 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 30 15:34:02 UTC 2012

Modified Files:
src/distrib/utils/sysinst: label.c
src/sbin/newfs: newfs.8 newfs.c

Log Message:
Use 32KB/4KB for default block/fragment size on = 128 GB partitions
for modern AFT disks.  No particular comments against PR install/46629.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/distrib/utils/sysinst/label.c
cvs rdiff -u -r1.82 -r1.83 src/sbin/newfs/newfs.8
cvs rdiff -u -r1.110 -r1.111 src/sbin/newfs/newfs.c

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

Modified files:

Index: src/distrib/utils/sysinst/label.c
diff -u src/distrib/utils/sysinst/label.c:1.61 src/distrib/utils/sysinst/label.c:1.62
--- src/distrib/utils/sysinst/label.c:1.61	Thu Jan  5 22:18:36 2012
+++ src/distrib/utils/sysinst/label.c	Sat Jun 30 15:34:01 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: label.c,v 1.61 2012/01/05 22:18:36 christos Exp $	*/
+/*	$NetBSD: label.c,v 1.62 2012/06/30 15:34:01 tsutsui Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: label.c,v 1.61 2012/01/05 22:18:36 christos Exp $);
+__RCSID($NetBSD: label.c,v 1.62 2012/06/30 15:34:01 tsutsui Exp $);
 #endif
 
 #include sys/types.h
@@ -213,8 +213,23 @@ set_ptype(partinfo *p, int fstype, int f
 	p-pi_fstype = fstype;
 	if (fstype == FS_BSDFFS || fstype == FS_BSDLFS) {
 		p-pi_frag = 8;
-		/* match newfs defaults for fragments size (2k if = 1024MB) */
-		p-pi_fsize = p-pi_size  1024*1024*1024 / 512 ? 2048 : 1024;
+		/*
+		 * match newfs defaults for fragments size:
+		 * fs size	frag size
+		 *  20 MB	0.5 KB
+		 *  1000 MB	1 KB
+		 *  128 GB	2 KB
+		 * = 128 GB	4 KB
+		 */
+	 	/* note pi_size is uint32_t so we have to avoid overflow */
+		if (p-pi_size  (20 * 1024 * (1024 / 512)))
+			p-pi_fsize = 512;
+		else if (p-pi_size  (1000 * 1024 * (1024 / 512)))
+			p-pi_fsize = 1024;
+		else if (p-pi_size  (128 * 1024 * 1024 * (1024 / 512)))
+			p-pi_fsize = 2048;
+		else
+			p-pi_fsize = 4096;
 	} else {
 		/* zero - fields not used */
 		p-pi_frag = 0;

Index: src/sbin/newfs/newfs.8
diff -u src/sbin/newfs/newfs.8:1.82 src/sbin/newfs/newfs.8:1.83
--- src/sbin/newfs/newfs.8:1.82	Sat May 14 19:46:10 2011
+++ src/sbin/newfs/newfs.8	Sat Jun 30 15:34:01 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: newfs.8,v 1.82 2011/05/14 19:46:10 dholland Exp $
+.\	$NetBSD: newfs.8,v 1.83 2012/06/30 15:34:01 tsutsui Exp $
 .\
 .\ Copyright (c) 1983, 1987, 1991, 1993, 1994
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\ @(#)newfs.8	8.6 (Berkeley) 5/3/95
 .\
-.Dd May 14, 2011
+.Dd June 30, 2012
 .Dt NEWFS 8
 .Os
 .Sh NAME
@@ -111,10 +111,12 @@ The default size depends upon the size o
 .Ar block-size
 .It \*[Lt] 20 MB
 4 KB
-.It \*[Lt] 1024 MB
+.It \*[Lt] 1000 MB
 8 KB
-.It \*[Gt]= 1024 MB
+.It \*[Lt] 128 GB
 16 KB
+.It \*[Gt]= 128 GB
+32 KB
 .El
 .It Fl d Ar maxbsize
 Set the maximum extent size to
@@ -151,10 +153,12 @@ The default size depends upon the size o
 .Ar frag-size
 .It \*[Lt] 20 MB
 0.5 KB
-.It \*[Lt] 1024 MB
+.It \*[Lt] 1000 MB
 1 KB
-.It \*[Gt]= 1024 MB
+.It \*[Lt] 128 GB
 2 KB
+.It \*[Gt]= 128 GB
+4 KB
 .El
 .It Fl G
 Treat garbage parameters as non-fatal.
@@ -182,10 +186,12 @@ bytes of data space:
 .Ar bytes-per-inode
 .It \*[Lt] 20 MB
 2 KB
-.It \*[Lt] 1024 MB
+.It \*[Lt] 1000 MB
 4 KB
-.It \*[Gt]= 1024 MB
+.It \*[Lt] 128 GB
 8 KB
+.It \*[Gt]= 128 GB
+16 KB
 .El
 .It Fl m Ar free-space
 The percentage of space reserved from normal users; the minimum free

Index: src/sbin/newfs/newfs.c
diff -u src/sbin/newfs/newfs.c:1.110 src/sbin/newfs/newfs.c:1.111
--- src/sbin/newfs/newfs.c:1.110	Mon Feb 13 12:59:56 2012
+++ src/sbin/newfs/newfs.c	Sat Jun 30 15:34:01 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: newfs.c,v 1.110 2012/02/13 12:59:56 wiz Exp $	*/
+/*	$NetBSD: newfs.c,v 1.111 2012/06/30 15:34:01 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1983, 1989, 1993, 1994
@@ -78,7 +78,7 @@ __COPYRIGHT(@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = @(#)newfs.c	8.13 (Berkeley) 5/1/95;
 #else
-__RCSID($NetBSD: newfs.c,v 1.110 2012/02/13 12:59:56 wiz Exp $);
+__RCSID($NetBSD: newfs.c,v 1.111 2012/06/30 15:34:01 tsutsui Exp $);
 #endif
 #endif /* not lint */
 
@@ -157,14 +157,17 @@ const char lmsg[] = %s: can't read disk
  */
 /*
  * For file systems smaller than SMALL_FSSIZE we use the S_DFL_* defaults,
- * otherwise if less than MEDIUM_FSSIZE use M_DFL_*, otherwise use
- * L_DFL_*.
+ * otherwise if less than MEDIUM_FSSIZE use M_DFL_*,
+ * otherwise if less than LARGE_FSSIZE use L_DFL_*,
+ * otherwise use LL_DFL_* especially for modern AFT disks.
  */
 #define	SMALL_FSSIZE	(20*1024*2)
 #define	S_DFL_FRAGSIZE	512
 #define	MEDIUM_FSSIZE	(1000*1024*2)
 #define	M_DFL_FRAGSIZE	1024
+#define	LARGE_FSSIZE	(128*1024*1024*2)
 #define	L_DFL_FRAGSIZE	2048
+#define	LL_DFL_FRAGSIZE	4096
 

CVS commit: src/usr.bin/fmt

2012-06-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun 30 21:31:15 UTC 2012

Modified Files:
src/usr.bin/fmt: fmt.1 fmt.c

Log Message:
add -w as an alias to -m


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/fmt/fmt.1
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/fmt/fmt.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/fmt/fmt.1
diff -u src/usr.bin/fmt/fmt.1:1.12 src/usr.bin/fmt/fmt.1:1.13
--- src/usr.bin/fmt/fmt.1:1.12	Tue Mar 10 16:23:47 2009
+++ src/usr.bin/fmt/fmt.1	Sat Jun 30 17:31:15 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: fmt.1,v 1.12 2009/03/10 20:23:47 joerg Exp $
+.\	$NetBSD: fmt.1,v 1.13 2012/06/30 21:31:15 christos Exp $
 .\
 .\ Copyright (c) 1980, 1990, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\ @(#)fmt.1	8.1 (Berkeley) 6/6/93
 .\
-.Dd May 29, 2007
+.Dd June 31, 2012
 .Dt FMT 1
 .Os
 .Sh NAME
@@ -47,6 +47,7 @@
 .Op Fl Cr
 .Op Fl g Ar goal
 .Op Fl m Ar maximum
+.Op Fl w Ar maximum
 .Op name ...
 .Sh DESCRIPTION
 .Nm
@@ -75,6 +76,8 @@ to center the text.
 New way to set the goal length.
 .It Fl m Ar maximum
 New way to set the maximum length.
+.It Fl w Ar maximum
+New way to set the maximum length.
 .It Fl r
 Raw mode; formats all lines and does not make exceptions for lines
 that start with a period or look like mail headers.

Index: src/usr.bin/fmt/fmt.c
diff -u src/usr.bin/fmt/fmt.c:1.31 src/usr.bin/fmt/fmt.c:1.32
--- src/usr.bin/fmt/fmt.c:1.31	Mon Jul 21 10:19:22 2008
+++ src/usr.bin/fmt/fmt.c	Sat Jun 30 17:31:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fmt.c,v 1.31 2008/07/21 14:19:22 lukem Exp $	*/
+/*	$NetBSD: fmt.c,v 1.32 2012/06/30 21:31:15 christos Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = @(#)fmt.c	8.1 (Berkeley) 7/20/93;
 #endif
-__RCSID($NetBSD: fmt.c,v 1.31 2008/07/21 14:19:22 lukem Exp $);
+__RCSID($NetBSD: fmt.c,v 1.32 2012/06/30 21:31:15 christos Exp $);
 #endif /* not lint */
 
 #include ctype.h
@@ -113,7 +113,7 @@ main(int argc, char **argv)
 	setprogname(*argv);
 	(void)setlocale(LC_ALL, );
 
-	while ((c = getopt(argc, argv, Cg:m:r)) != -1)
+	while ((c = getopt(argc, argv, Cg:m:rw:)) != -1)
 		switch (c) {
 		case 'C':
 			center++;
@@ -123,6 +123,7 @@ main(int argc, char **argv)
 			compat = 0;
 			break;
 		case 'm':
+		case 'w':
 			(void)getnum(optarg, max, max_length, 1);
 			compat = 0;
 			break;
@@ -175,7 +176,7 @@ static void
 usage(void)
 {
 	(void)fprintf(stderr,
-	Usage: %s [-Cr] [-g goal] [-m max] [files..]\n
+	Usage: %s [-Cr] [-g goal] [-m|w max] [files..]\n
 	\t %s [-Cr] [goal] [max] [files]\n,
 	getprogname(), getprogname());
 	exit(1);



CVS commit: src/sys/arch

2012-06-30 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Sat Jun 30 22:50:37 UTC 2012

Modified Files:
src/sys/arch/amd64/include: pmap.h
src/sys/arch/xen/include: xenpmap.h
src/sys/arch/xen/x86: x86_xpmap.c xen_bus_dma.c
src/sys/arch/xen/xen: balloon.c if_xennet_xenbus.c xen_machdep.c
xennetback_xenbus.c

Log Message:
Extend the xpmap API, as described in [1]. This change is mechanical and
avoids exposing the MD phys_to_machine/machine_to_phys tables directly.
Added:

- xpmap_ptom handles PFN (pseudo physical) to MFN (machine frame number)
translations, and is under control of the domain.
- xpmap_mtop is its counterpart (MFN to PFN), and is under control of
hypervisor.

xpmap_ptom_map()  map a pseudo-phys address to a machine address
xpmap_ptom_unmap()unmap a pseudo-phys address (invalidation)
xpmap_ptom_isvalid()  check for pseudo-phys address validity

The parameters are physical/machine addresses, like bus_dma/bus_space(9).
As x86 MFNs are tracked by u_long (Xen's choice) while machine addresses
can be 64 bits entities (PAE), use ptoa() to avoid truncation when bit
shifting by PAGE_SHIFT.

I kept the same namespace (xpmap_) to avoid code churn.

[1] http://mail-index.netbsd.org/port-xen/2009/05/09/msg004951.html

XXX will document ptoa/atop/trunc_page separately.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/amd64/include/pmap.h
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/xen/include/xenpmap.h
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/xen/x86/x86_xpmap.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/xen/x86/xen_bus_dma.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/xen/xen/balloon.c
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/xen/xen/if_xennet_xenbus.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/xen/xen/xen_machdep.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/xen/xen/xennetback_xenbus.c

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

Modified files:

Index: src/sys/arch/amd64/include/pmap.h
diff -u src/sys/arch/amd64/include/pmap.h:1.33 src/sys/arch/amd64/include/pmap.h:1.34
--- src/sys/arch/amd64/include/pmap.h:1.33	Mon Jun 11 15:18:26 2012
+++ src/sys/arch/amd64/include/pmap.h	Sat Jun 30 22:50:36 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.33 2012/06/11 15:18:26 chs Exp $	*/
+/*	$NetBSD: pmap.h,v 1.34 2012/06/30 22:50:36 jym Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -258,6 +258,7 @@ pmap_pte2pa(pt_entry_t pte)
 {
 	return xpmap_mtop_masked(pte  PG_FRAME);
 }
+
 static __inline void
 pmap_pte_set(pt_entry_t *pte, pt_entry_t npte)
 {

Index: src/sys/arch/xen/include/xenpmap.h
diff -u src/sys/arch/xen/include/xenpmap.h:1.36 src/sys/arch/xen/include/xenpmap.h:1.37
--- src/sys/arch/xen/include/xenpmap.h:1.36	Wed Jun 27 00:37:09 2012
+++ src/sys/arch/xen/include/xenpmap.h	Sat Jun 30 22:50:36 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: xenpmap.h,v 1.36 2012/06/27 00:37:09 jym Exp $	*/
+/*	$NetBSD: xenpmap.h,v 1.37 2012/06/30 22:50:36 jym Exp $	*/
 
 /*
  *
@@ -76,9 +76,6 @@ void xen_kpm_sync(struct pmap *, int);
 
 extern unsigned long *xpmap_phys_to_machine_mapping;
 
-#define mfn_to_pfn(mfn) (machine_to_phys_mapping[(mfn)])
-#define pfn_to_mfn(pfn) (xpmap_phys_to_machine_mapping[(pfn)])
-
 static __inline paddr_t
 xpmap_mtop_masked(paddr_t mpa)
 {
@@ -95,7 +92,8 @@ xpmap_mtop(paddr_t mpa)
 static __inline paddr_t
 xpmap_ptom_masked(paddr_t ppa)
 {
-	return (((paddr_t)xpmap_phys_to_machine_mapping[(ppa)  PAGE_SHIFT])
+	return (
+	(paddr_t)xpmap_phys_to_machine_mapping[ppa  PAGE_SHIFT]
 	 PAGE_SHIFT);
 }
 
@@ -105,6 +103,26 @@ xpmap_ptom(paddr_t ppa)
 	return (xpmap_ptom_masked(ppa) | (ppa  ~PG_FRAME));
 }
 
+static __inline void
+xpmap_ptom_map(paddr_t ppa, paddr_t mpa)
+{
+	xpmap_phys_to_machine_mapping[ppa  PAGE_SHIFT] = mpa  PAGE_SHIFT;
+}
+
+static __inline void
+xpmap_ptom_unmap(paddr_t ppa)
+{
+	xpmap_phys_to_machine_mapping[ppa  PAGE_SHIFT] = INVALID_P2M_ENTRY;
+}
+
+static __inline bool
+xpmap_ptom_isvalid(paddr_t ppa)
+{
+	return (
+	xpmap_phys_to_machine_mapping[ppa  PAGE_SHIFT]
+	!= INVALID_P2M_ENTRY);
+}
+
 static inline void
 MULTI_update_va_mapping(
 	multicall_entry_t *mcl, vaddr_t va,

Index: src/sys/arch/xen/x86/x86_xpmap.c
diff -u src/sys/arch/xen/x86/x86_xpmap.c:1.45 src/sys/arch/xen/x86/x86_xpmap.c:1.46
--- src/sys/arch/xen/x86/x86_xpmap.c:1.45	Wed Jun 27 00:37:10 2012
+++ src/sys/arch/xen/x86/x86_xpmap.c	Sat Jun 30 22:50:37 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_xpmap.c,v 1.45 2012/06/27 00:37:10 jym Exp $	*/
+/*	$NetBSD: x86_xpmap.c,v 1.46 2012/06/30 22:50:37 jym Exp $	*/
 
 /*
  * Copyright (c) 2006 Mathieu Ropert m...@adviseo.fr
@@ -69,7 +69,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: x86_xpmap.c,v 1.45 2012/06/27 00:37:10 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: x86_xpmap.c,v 1.46 2012/06/30 22:50:37 jym Exp $);
 
 #include opt_xen.h
 #include opt_ddb.h
@@ -1092,7 +1092,7 @@ xen_set_user_pgd(paddr_t 

CVS commit: src/sys/arch

2012-06-30 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sat Jun 30 23:33:10 UTC 2012

Modified Files:
src/sys/arch/amd64/amd64: trap.c
src/sys/arch/i386/i386: trap.c

Log Message:
trap: move out info printing to trap_print() on amd64, reduce the differences
between amd64 and i386, add lowest kernel stack address.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/amd64/amd64/trap.c
cvs rdiff -u -r1.263 -r1.264 src/sys/arch/i386/i386/trap.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/trap.c
diff -u src/sys/arch/amd64/amd64/trap.c:1.71 src/sys/arch/amd64/amd64/trap.c:1.72
--- src/sys/arch/amd64/amd64/trap.c:1.71	Tue May 22 21:14:37 2012
+++ src/sys/arch/amd64/amd64/trap.c	Sat Jun 30 23:33:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.71 2012/05/22 21:14:37 dsl Exp $	*/
+/*	$NetBSD: trap.c,v 1.72 2012/06/30 23:33:10 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.71 2012/05/22 21:14:37 dsl Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.72 2012/06/30 23:33:10 rmind Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -184,6 +184,27 @@ onfault_handler(const struct pcb *pcb, c
 	return NULL;
 }
 
+static void
+trap_print(const struct trapframe *frame, const lwp_t *l)
+{
+	const int type = frame-tf_trapno;
+
+	if (frame-tf_trapno  trap_types) {
+		printf(fatal %s, trap_type[type]);
+	} else {
+		printf(unknown trap %d, type);
+	}
+	printf( in %s mode\n, (type  T_USER) ? user : supervisor);
+
+	printf(trap type %d code %lx rip %lx cs %lx rflags %lx cr2 %lx 
+	ilevel %x rsp %lx\n,
+	type, frame-tf_err, (u_long)frame-tf_rip, frame-tf_cs,
+	frame-tf_rflags, rcr2(), curcpu()-ci_ilevel, frame-tf_rsp);
+
+	printf(curlwp %p pid %d lid %d lowest kstack %p\n,
+	l, l-l_proc-p_pid, l-l_lid, KSTACK_LOWEST_ADDR(l));
+}
+
 /*
  * trap(frame): exception, fault, and trap interface to BSD kernel.
  *
@@ -192,7 +213,6 @@ onfault_handler(const struct pcb *pcb, c
  * exception has been processed. Note that the effect is as if the arguments
  * were passed call by reference.
  */
-
 void
 trap(struct trapframe *frame)
 {
@@ -226,13 +246,7 @@ trap(struct trapframe *frame)
 
 #ifdef DEBUG
 	if (trapdebug) {
-		printf(trap %d code %lx eip %lx cs %lx rflags %lx cr2 %lx 
-		   cpl %x\n,
-		type, frame-tf_err, frame-tf_rip, frame-tf_cs,
-		frame-tf_rflags, rcr2(), curcpu()-ci_ilevel);
-		printf(curlwp %p%s, curlwp, curlwp ?   : \n);
-		if (curlwp)
-			printf(pid %d lid %d\n, l-l_proc-p_pid, l-l_lid);
+		trap_print(frame, l);
 	}
 #endif
 	if (type != T_NMI  !KERNELMODE(frame-tf_cs, frame-tf_rflags)) {
@@ -266,15 +280,8 @@ trap(struct trapframe *frame)
 
 	default:
 	we_re_toast:
-		if (frame-tf_trapno  trap_types)
-			printf(fatal %s, trap_type[frame-tf_trapno]);
-		else
-			printf(unknown trap %ld, (u_long)frame-tf_trapno);
-		printf( in %s mode\n, (type  T_USER) ? user : supervisor);
-		printf(trap type %d code %lx rip %lx cs %lx rflags %lx cr2 
-		%lx cpl %x rsp %lx\n,
-		type, frame-tf_err, (u_long)frame-tf_rip, frame-tf_cs,
-		frame-tf_rflags, rcr2(), curcpu()-ci_ilevel, frame-tf_rsp);
+		trap_print(frame, l);
+
 		if (kdb_trap(type, 0, frame))
 			return;
 		if (kgdb_trap(type, frame))

Index: src/sys/arch/i386/i386/trap.c
diff -u src/sys/arch/i386/i386/trap.c:1.263 src/sys/arch/i386/i386/trap.c:1.264
--- src/sys/arch/i386/i386/trap.c:1.263	Sun Feb 19 21:06:11 2012
+++ src/sys/arch/i386/i386/trap.c	Sat Jun 30 23:33:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.263 2012/02/19 21:06:11 rmind Exp $	*/
+/*	$NetBSD: trap.c,v 1.264 2012/06/30 23:33:10 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.263 2012/02/19 21:06:11 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.264 2012/06/30 23:33:10 rmind Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -262,16 +262,24 @@ onfault_handler(const struct pcb *pcb, c
 }
 
 static void
-trap_print(int type, struct trapframe *frame)
+trap_print(const struct trapframe *frame, const lwp_t *l)
 {
-	if (frame-tf_trapno  trap_types)
-		printf(fatal %s, trap_type[frame-tf_trapno]);
-	else
-		printf(unknown trap %d, frame-tf_trapno);
+	const int type = frame-tf_trapno;
+
+	if (frame-tf_trapno  trap_types) {
+		printf(fatal %s, trap_type[type]);
+	} else {
+		printf(unknown trap %d, type);
+	}
 	printf( in %s mode\n, (type  T_USER) ? user : supervisor);
-	printf(trap type %d code %x eip %x cs %x eflags %x cr2 %lx ilevel %x\n,
-	type, frame-tf_err, frame-tf_eip, frame-tf_cs,
-	frame-tf_eflags, (long)rcr2(), curcpu()-ci_ilevel);
+
+	printf(trap type %d code %x eip %x cs %x eflags %x cr2 %lx 
+	ilevel %x esp %x\n,
+	type, 

CVS commit: src/sys/arch/xen

2012-06-30 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Sat Jun 30 23:36:20 UTC 2012

Modified Files:
src/sys/arch/xen/x86: xen_bus_dma.c
src/sys/arch/xen/xen: balloon.c if_xennet_xenbus.c xengnt.c
xennetback_xenbus.c

Log Message:
Use setter to set xenguest_handles.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/xen/x86/xen_bus_dma.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/xen/xen/balloon.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/xen/xen/if_xennet_xenbus.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/xen/xen/xengnt.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/x86/xen_bus_dma.c
diff -u src/sys/arch/xen/x86/xen_bus_dma.c:1.25 src/sys/arch/xen/x86/xen_bus_dma.c:1.26
--- src/sys/arch/xen/x86/xen_bus_dma.c:1.25	Sat Jun 30 22:50:37 2012
+++ src/sys/arch/xen/x86/xen_bus_dma.c	Sat Jun 30 23:36:20 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_bus_dma.c,v 1.25 2012/06/30 22:50:37 jym Exp $	*/
+/*	$NetBSD: xen_bus_dma.c,v 1.26 2012/06/30 23:36:20 jym Exp $	*/
 /*	NetBSD bus_dma.c,v 1.21 2005/04/16 07:53:35 yamt Exp */
 
 /*-
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xen_bus_dma.c,v 1.25 2012/06/30 22:50:37 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: xen_bus_dma.c,v 1.26 2012/06/30 23:36:20 jym Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -91,7 +91,7 @@ _xen_alloc_contig(bus_size_t size, bus_s
 		pa = VM_PAGE_TO_PHYS(pg);
 		mfn = xpmap_ptom(pa)  PAGE_SHIFT;
 		xpmap_ptom_unmap(pa);
-		xenguest_handle(res.extent_start) = mfn;
+		set_xen_guest_handle(res.extent_start, mfn);
 		res.nr_extents = 1;
 		res.extent_order = 0;
 		res.address_bits = 0;
@@ -110,7 +110,7 @@ _xen_alloc_contig(bus_size_t size, bus_s
 		}
 	}
 	/* Get the new contiguous memory extent */
-	xenguest_handle(res.extent_start) = mfn;
+	set_xen_guest_handle(res.extent_start, mfn);
 	res.nr_extents = 1;
 	res.extent_order = order;
 	res.address_bits = get_order(high) + PAGE_SHIFT;
@@ -163,7 +163,7 @@ failed:
 	s = splvm();
 	for (pg = mlistp-tqh_first; pg != NULL; pg = pgnext) {
 		pgnext = pg-pageq.queue.tqe_next;
-		xenguest_handle(res.extent_start) = mfn;
+		set_xen_guest_handle(res.extent_start, mfn);
 		res.nr_extents = 1;
 		res.extent_order = 0;
 		res.address_bits = 32;

Index: src/sys/arch/xen/xen/balloon.c
diff -u src/sys/arch/xen/xen/balloon.c:1.15 src/sys/arch/xen/xen/balloon.c:1.16
--- src/sys/arch/xen/xen/balloon.c:1.15	Sat Jun 30 22:50:37 2012
+++ src/sys/arch/xen/xen/balloon.c	Sat Jun 30 23:36:20 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: balloon.c,v 1.15 2012/06/30 22:50:37 jym Exp $ */
+/* $NetBSD: balloon.c,v 1.16 2012/06/30 23:36:20 jym Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
 #define BALLOONDEBUG 0
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: balloon.c,v 1.15 2012/06/30 22:50:37 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: balloon.c,v 1.16 2012/06/30 23:36:20 jym Exp $);
 
 #include sys/inttypes.h
 #include sys/device.h
@@ -407,7 +407,7 @@ balloon_inflate(struct balloon_xenbus_so
 	}
 
 	/* Hand over pages to Hypervisor */
-	xenguest_handle(reservation.extent_start) = mfn_list;
+	set_xen_guest_handle(reservation.extent_start, mfn_list);
 	reservation.nr_extents = rpages;
 
 	s = splvm();
@@ -471,7 +471,7 @@ balloon_deflate(struct balloon_xenbus_so
 	}
 
 	/* reclaim pages from balloon */
-	xenguest_handle(reservation.extent_start) = mfn_list;
+	set_xen_guest_handle(reservation.extent_start, mfn_list);
 	reservation.nr_extents = tpages;
 
 	s = splvm();

Index: src/sys/arch/xen/xen/if_xennet_xenbus.c
diff -u src/sys/arch/xen/xen/if_xennet_xenbus.c:1.61 src/sys/arch/xen/xen/if_xennet_xenbus.c:1.62
--- src/sys/arch/xen/xen/if_xennet_xenbus.c:1.61	Sat Jun 30 22:50:37 2012
+++ src/sys/arch/xen/xen/if_xennet_xenbus.c	Sat Jun 30 23:36:20 2012
@@ -1,4 +1,4 @@
-/*  $NetBSD: if_xennet_xenbus.c,v 1.61 2012/06/30 22:50:37 jym Exp $  */
+/*  $NetBSD: if_xennet_xenbus.c,v 1.62 2012/06/30 23:36:20 jym Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -85,7 +85,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_xennet_xenbus.c,v 1.61 2012/06/30 22:50:37 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_xennet_xenbus.c,v 1.62 2012/06/30 23:36:20 jym Exp $);
 
 #include opt_xen.h
 #include opt_nfs_boot.h
@@ -754,7 +754,7 @@ out_loop:
 		xpq_flush_queue();
 		splx(s);
 		/* now decrease reservation */
-		xenguest_handle(reservation.extent_start) = xennet_pages;
+		set_xen_guest_handle(reservation.extent_start, xennet_pages);
 		reservation.nr_extents = i;
 		reservation.extent_order = 0;
 		reservation.address_bits = 0;
@@ -820,7 +820,8 @@ xennet_free_rx_buffer(struct xennet_xenb
 	 * transfer not complete, we lost the page.
 	 * Get one from hypervisor
 	 */
-	xenguest_handle(xenres.extent_start) = pfn;
+			

CVS commit: src/sys/dev/usb

2012-06-30 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sun Jul  1 04:20:26 UTC 2012

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
Add NTT DOCOMO L-02C entry.


To generate a diff of this commit:
cvs rdiff -u -r1.622 -r1.623 src/sys/dev/usb/usbdevs

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

Modified files:

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.622 src/sys/dev/usb/usbdevs:1.623
--- src/sys/dev/usb/usbdevs:1.622	Thu May 31 12:29:15 2012
+++ src/sys/dev/usb/usbdevs	Sun Jul  1 04:20:26 2012
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.622 2012/05/31 12:29:15 nonaka Exp $
+$NetBSD: usbdevs,v 1.623 2012/07/01 04:20:26 nonaka Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -2462,6 +2462,8 @@ product QTRONIX 980N		0x2011	Scorpion-98
 
 /* Qualcomm products */
 product QUALCOMM CDMA_MSM	0x6000	CDMA Technologies MSM phone
+product QUALCOMM NTT_DOCOMO_L02C_MODEM	0x618f	NTT DOCOMO L-02C
+product QUALCOMM NTT_DOCOMO_L02C_STORAGE	0x61dd	NTT DOCOMO L-02C
 product QUALCOMM MSM_HSDPA	0x6613	HSDPA MSM
 product QUALCOMM2 RWT_FCT   0x3100  RWT FCT-CDMA 2000 1xRTT modem
 product QUALCOMM2 CDMA_MSM	0x3196	CDMA Technologies MSM modem



CVS commit: src/sys/dev/usb

2012-06-30 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sun Jul  1 04:21:10 UTC 2012

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
regen.


To generate a diff of this commit:
cvs rdiff -u -r1.614 -r1.615 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.615 -r1.616 src/sys/dev/usb/usbdevs_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/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.614 src/sys/dev/usb/usbdevs.h:1.615
--- src/sys/dev/usb/usbdevs.h:1.614	Thu May 31 12:30:43 2012
+++ src/sys/dev/usb/usbdevs.h	Sun Jul  1 04:21:10 2012
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.614 2012/05/31 12:30:43 nonaka Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.615 2012/07/01 04:21:10 nonaka Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.622 2012/05/31 12:29:15 nonaka Exp
+ *	NetBSD: usbdevs,v 1.623 2012/07/01 04:20:26 nonaka Exp
  */
 
 /*
@@ -2469,6 +2469,8 @@
 
 /* Qualcomm products */
 #define	USB_PRODUCT_QUALCOMM_CDMA_MSM	0x6000		/* CDMA Technologies MSM phone */
+#define	USB_PRODUCT_QUALCOMM_NTT_DOCOMO_L02C_MODEM	0x618f		/* NTT DOCOMO L-02C */
+#define	USB_PRODUCT_QUALCOMM_NTT_DOCOMO_L02C_STORAGE	0x61dd		/* NTT DOCOMO L-02C */
 #define	USB_PRODUCT_QUALCOMM_MSM_HSDPA	0x6613		/* HSDPA MSM */
 #define	USB_PRODUCT_QUALCOMM2_RWT_FCT	0x3100		/* RWT FCT-CDMA 2000 1xRTT modem */
 #define	USB_PRODUCT_QUALCOMM2_CDMA_MSM	0x3196		/* CDMA Technologies MSM modem */

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.615 src/sys/dev/usb/usbdevs_data.h:1.616
--- src/sys/dev/usb/usbdevs_data.h:1.615	Thu May 31 12:30:43 2012
+++ src/sys/dev/usb/usbdevs_data.h	Sun Jul  1 04:21:10 2012
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.615 2012/05/31 12:30:43 nonaka Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.616 2012/07/01 04:21:10 nonaka Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.622 2012/05/31 12:29:15 nonaka Exp
+ *	NetBSD: usbdevs,v 1.623 2012/07/01 04:20:26 nonaka Exp
  */
 
 /*
@@ -7483,6 +7483,14 @@ const struct usb_product usb_products[] 
 	CDMA Technologies MSM phone,
 	},
 	{
+	USB_VENDOR_QUALCOMM, USB_PRODUCT_QUALCOMM_NTT_DOCOMO_L02C_MODEM,
+	NTT DOCOMO L-02C,
+	},
+	{
+	USB_VENDOR_QUALCOMM, USB_PRODUCT_QUALCOMM_NTT_DOCOMO_L02C_STORAGE,
+	NTT DOCOMO L-02C,
+	},
+	{
 	USB_VENDOR_QUALCOMM, USB_PRODUCT_QUALCOMM_MSM_HSDPA,
 	HSDPA MSM,
 	},
@@ -9523,4 +9531,4 @@ const struct usb_product usb_products[] 
 	Prestige,
 	},
 };
-const int usb_nproducts = 1858;
+const int usb_nproducts = 1860;