CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/marvell

2011-03-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 28 00:40:25 UTC 2011

Modified Files:
src/sys/arch/powerpc/marvell [matt-nb5-pq3]: extintr.c

Log Message:
Don't adjust ci_idepth since trap_subr does it.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.40.1 src/sys/arch/powerpc/marvell/extintr.c

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

Modified files:

Index: src/sys/arch/powerpc/marvell/extintr.c
diff -u src/sys/arch/powerpc/marvell/extintr.c:1.18 src/sys/arch/powerpc/marvell/extintr.c:1.18.40.1
--- src/sys/arch/powerpc/marvell/extintr.c:1.18	Mon Dec  3 15:34:13 2007
+++ src/sys/arch/powerpc/marvell/extintr.c	Mon Mar 28 00:40:25 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: extintr.c,v 1.18 2007/12/03 15:34:13 ad Exp $	*/
+/*	$NetBSD: extintr.c,v 1.18.40.1 2011/03/28 00:40:25 matt Exp $	*/
 
 /*
  * Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.18 2007/12/03 15:34:13 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: extintr.c,v 1.18.40.1 2011/03/28 00:40:25 matt Exp $");
 
 #include "opt_marvell.h"
 #include "opt_kgdb.h"
@@ -622,8 +622,6 @@
 
 #ifdef __HAVE_FAST_SOFTINTS
 #error don't count soft interrupts here
-#else
-	ci->ci_idepth++;
 #endif
 	EXT_INTR_STATS_DECL(tstart);
 	EXT_INTR_STATS_DEPTH();
@@ -653,7 +651,6 @@
 	intrframe = oframe;
 	intr_depth--;
 #endif
-	ci->ci_idepth--;
 }
 
 /*



CVS commit: src/libexec/ld.elf_so

2011-03-27 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Mar 28 00:37:41 UTC 2011

Modified Files:
src/libexec/ld.elf_so: rtld.c

Log Message:
Refine locking scheme around init/fini to not hold the exclusive lock.
Use a simple generation count instead and restart looking for work if it
changed (e.g. due to an dlopen call from an init function).
Leave the possible dlclose() race for now.


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/libexec/ld.elf_so/rtld.c

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

Modified files:

Index: src/libexec/ld.elf_so/rtld.c
diff -u src/libexec/ld.elf_so/rtld.c:1.146 src/libexec/ld.elf_so/rtld.c:1.147
--- src/libexec/ld.elf_so/rtld.c:1.146	Sun Mar 27 22:20:51 2011
+++ src/libexec/ld.elf_so/rtld.c	Mon Mar 28 00:37:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld.c,v 1.146 2011/03/27 22:20:51 joerg Exp $	 */
+/*	$NetBSD: rtld.c,v 1.147 2011/03/28 00:37:40 joerg Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: rtld.c,v 1.146 2011/03/27 22:20:51 joerg Exp $");
+__RCSID("$NetBSD: rtld.c,v 1.147 2011/03/28 00:37:40 joerg Exp $");
 #endif /* not lint */
 
 #include 
@@ -89,6 +89,7 @@
 Obj_Entry   _rtld_objself;	/* The dynamic linker shared object */
 u_int		_rtld_objcount;	/* Number of objects in _rtld_objlist */
 u_int		_rtld_objloads;	/* Number of objects loaded in _rtld_objlist */
+u_int		_rtld_objgen;	/* Generation count for _rtld_objlist */
 const char	_rtld_path[] = _PATH_RTLD;
 
 /* Initialize a fake symbol for resolving undefined weak references. */
@@ -139,9 +140,13 @@
 	Objlist_Entry *elm;
 	Objlist finilist;
 	Obj_Entry *obj;
+	void (*fini)(void);
+	u_int cur_objgen;
 
 	dbg(("_rtld_call_fini_functions(%d)", force));
 
+restart:
+	cur_objgen = ++_rtld_objgen;
 	SIMPLEQ_INIT(&finilist);
 	_rtld_initlist_tsort(&finilist, 1);
 
@@ -157,10 +162,20 @@
 		dbg (("calling fini function %s at %p",  obj->path,
 		(void *)obj->fini));
 		obj->fini_called = 1;
-		/* XXXlocking: exit point */
-		_rtld_mutex_may_recurse = true;
-		(*obj->fini)();
-		_rtld_mutex_may_recurse = false;
+		/*
+		 * XXX This can race against a concurrent dlclose().
+		 * XXX In that case, the object could be unmapped before
+		 * XXX the fini() call is done.
+		 */
+		fini = obj->fini;
+		_rtld_exclusive_exit();
+		(*fini)();
+		_rtld_exclusive_enter();
+		if (_rtld_objgen != cur_objgen) {
+			dbg(("restarting fini iteration"));
+			_rtld_objlist_clear(&finilist);
+			goto restart;
+		}
 	}
 
 	/* Second pass: objects marked with DF_1_INITFIRST. */
@@ -175,10 +190,16 @@
 		dbg (("calling fini function %s at %p (DF_1_INITFIRST)",
 		obj->path, (void *)obj->fini));
 		obj->fini_called = 1;
-		/* XXXlocking: exit point */
-		_rtld_mutex_may_recurse = true;
-		(*obj->fini)();
-		_rtld_mutex_may_recurse = false;
+		/* XXX See above for the race condition here */
+		fini = obj->fini;
+		_rtld_exclusive_exit();
+		(*fini)();
+		_rtld_exclusive_enter();
+		if (_rtld_objgen != cur_objgen) {
+			dbg(("restarting fini iteration"));
+			_rtld_objlist_clear(&finilist);
+			goto restart;
+		}
 	}
 
 _rtld_objlist_clear(&finilist);
@@ -190,8 +211,13 @@
 	Objlist_Entry *elm;
 	Objlist initlist;
 	Obj_Entry *obj;
+	void (*init)(void);
+	u_int cur_objgen;
 
 	dbg(("_rtld_call_init_functions()"));
+
+restart:
+	cur_objgen = ++_rtld_objgen;
 	SIMPLEQ_INIT(&initlist);
 	_rtld_initlist_tsort(&initlist, 0);
 
@@ -204,10 +230,15 @@
 		dbg (("calling init function %s at %p (DF_1_INITFIRST)",
 		obj->path, (void *)obj->init));
 		obj->init_called = 1;
-		/* XXXlocking: exit point */
-		_rtld_mutex_may_recurse = true;
-		(*obj->init)();
-		_rtld_mutex_may_recurse = false;
+		init = obj->init;
+		_rtld_exclusive_exit();
+		(*init)();
+		_rtld_exclusive_enter();
+		if (_rtld_objgen != cur_objgen) {
+			dbg(("restarting init iteration"));
+			_rtld_objlist_clear(&initlist);
+			goto restart;
+		}
 	}
 
 	/* Second pass: all other objects. */
@@ -219,10 +250,15 @@
 		dbg (("calling init function %s at %p",  obj->path,
 		(void *)obj->init));
 		obj->init_called = 1;
-		/* XXXlocking: exit point */
-		_rtld_mutex_may_recurse = true;
-		(*obj->init)();
-		_rtld_mutex_may_recurse = false;
+		init = obj->init;
+		_rtld_exclusive_exit();
+		(*init)();
+		_rtld_exclusive_enter();
+		if (_rtld_objgen != cur_objgen) {
+			dbg(("restarting init iteration"));
+			_rtld_objlist_clear(&initlist);
+			goto restart;
+		}
 	}
 
 _rtld_objlist_clear(&initlist);



CVS commit: src/usr.bin/units

2011-03-27 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Mar 28 00:14:51 UTC 2011

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

Log Message:
fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/units/units.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/units/units.1
diff -u src/usr.bin/units/units.1:1.13 src/usr.bin/units/units.1:1.14
--- src/usr.bin/units/units.1:1.13	Sun Sep 11 23:28:55 2005
+++ src/usr.bin/units/units.1	Mon Mar 28 00:14:51 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: units.1,v 1.13 2005/09/11 23:28:55 wiz Exp $
+.\"	$NetBSD: units.1,v 1.14 2011/03/28 00:14:51 dholland Exp $
 .Dd December 18, 2001
 .Dt UNITS 1
 .Os
@@ -148,7 +148,7 @@
 will not detect infinite loops that could be caused
 by careless unit definitions.
 .Pp
-Prefixes are defined in the same was as standard units, but with
+Prefixes are defined in the same way as standard units, but with
 a trailing dash at the end of the prefix name.
 .Sh FILES
 .Bl -tag -width /usr/share/misc/units.lib -compact



CVS commit: src/usr.bin/units

2011-03-27 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Mar 28 00:08:47 UTC 2011

Modified Files:
src/usr.bin/units: units.lib

Log Message:
Update radioactivity-related units from http://physics.nist.gov/cuu/Units/.
The prior definition of sievert was, as far as I can tell, entirely wrong.

Caution: while "gray" and "sievert" have the same dimensionality,
they're not interchangeable -- you need to multiply by a fudge factor
that varies depending on the type of radiation and the tissue it's
affecting. (Dimensional analysis is often not a substitute for knowing
what you're doing.)

It would be nice if units had a way to warn users when they're trying
to do something that doesn't make sense, since there are lots of ways
to do so, but it doesn't, and it wouldn't be easy to arrange in the
general case.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/units/units.lib

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/units/units.lib
diff -u src/usr.bin/units/units.lib:1.14 src/usr.bin/units/units.lib:1.15
--- src/usr.bin/units/units.lib:1.14	Thu Feb 15 22:37:27 2007
+++ src/usr.bin/units/units.lib	Mon Mar 28 00:08:47 2011
@@ -1,4 +1,4 @@
-/	$NetBSD: units.lib,v 1.14 2007/02/15 22:37:27 dogcow Exp $
+/	$NetBSD: units.lib,v 1.15 2011/03/28 00:08:47 dholland Exp $
 
 / primitive units
 
@@ -378,6 +378,7 @@
 btu			britishthermalunit
 refrigeration		12000 btu/ton-hour
 buck			dollar
+Ci			curie
 cable			720 ft
 caliber			1e-2 in
 calorie			cal
@@ -430,6 +431,7 @@
 franklin		3.33564e-10 coul
 frigorie		kilocal
 furlong			220 yd
+Gy			gray
 galileo			1e-2 m/sec2
 gamma			1e-9 weber/m2
 gauss			1e-4 weber/m2
@@ -437,6 +439,7 @@
 geographicalmile	1852 m
 gilbert			7.95775e-1 amp
 gill			1|4 pt
+gray			joule/kg
 gross			144
 gunterschain		22 yd
 hand			4 in
@@ -518,17 +521,21 @@
 quartersection		1|4 mi2
 quintal			100 kg
 quire			25
+R			roentgen
 rackunit		1.75 in
 rad			100 erg/gm
 ream			500
 registerton		100 ft3
+rem			1e-2 sievert
 rhe			10 m2/nt-sec
-rontgen			2.58e-4 curie/kg
+roentgen		2.58e-4 coulomb/kg
+rontgen			roentgen
 rood			1.21e+3 yd
 rope			20 ft
 RU			rackunit
 rutherford		1e+6 /sec
 rydberg			1.36054e+1 ev
+Sv			sievert
 sabin			1 ft2
 sack			3 bu
 score			20
@@ -539,6 +546,7 @@
 shorthundredweight	100 lb
 shortquarter		25 lb
 siemens			/ohm
+sievert			joule/kg
 sigma			microsec
 skein			120 yd
 skot			1e-3 apostilb
@@ -627,7 +635,6 @@
 frenchfoot		16|15 ft
 frenchfeet		frenchfoot
 toise			6 frenchfeet
-sievert			8.4 rontgen
 candle			1.02 candela
 militarypace		2.5 feet
 metre			meter



CVS commit: src/lib/libc/gen

2011-03-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Mar 27 22:55:07 UTC 2011

Modified Files:
src/lib/libc/gen: fpgetmask.3

Log Message:
Whitespace and punctuation.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/gen/fpgetmask.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/libc/gen/fpgetmask.3
diff -u src/lib/libc/gen/fpgetmask.3:1.11 src/lib/libc/gen/fpgetmask.3:1.12
--- src/lib/libc/gen/fpgetmask.3:1.11	Sat Mar 26 19:51:42 2011
+++ src/lib/libc/gen/fpgetmask.3	Sun Mar 27 22:55:07 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fpgetmask.3,v 1.11 2011/03/26 19:51:42 christos Exp $
+.\"	$NetBSD: fpgetmask.3,v 1.12 2011/03/27 22:55:07 wiz Exp $
 .\"
 .\" Copyright (c) 1999 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -61,7 +61,7 @@
 .Ft fp_except_t
 .Fn fpsetsticky "fp_except_t sticky"
 .Sh DESCRIPTION
-A rounding mode 
+A rounding mode
 .Ft fp_rnd_t
 is one of:
 .Bl -column -offset indent FP_RZ
@@ -106,7 +106,7 @@
 .Fn fpgetmask
 function will return the current exception mask.
 .Pp
-The 
+The
 .Fn fpgetprec
 function will return the current floating point precision.
 The
@@ -159,7 +159,7 @@
 .Pq previous
 exception mask and exception history bits.
 .Sh SEE ALSO
-.Xr sigaction 2
+.Xr sigaction 2 ,
 .Xr fenv 3
 .Sh BUGS
 There is no way to return an unsupported value.



CVS commit: src/lib/librump

2011-03-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Mar 27 22:51:35 UTC 2011

Modified Files:
src/lib/librump: rump_sp.7

Log Message:
Oh no -- a space! get rid of it, quick.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/librump/rump_sp.7

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

Modified files:

Index: src/lib/librump/rump_sp.7
diff -u src/lib/librump/rump_sp.7:1.6 src/lib/librump/rump_sp.7:1.7
--- src/lib/librump/rump_sp.7:1.6	Fri Mar 25 16:13:05 2011
+++ src/lib/librump/rump_sp.7	Sun Mar 27 22:51:35 2011
@@ -1,4 +1,4 @@
-.\" $NetBSD: rump_sp.7,v 1.6 2011/03/25 16:13:05 pooka Exp $
+.\" $NetBSD: rump_sp.7,v 1.7 2011/03/27 22:51:35 wiz Exp $
 .\"
 .\" Copyright (c) 2010 Antti Kantee.  All rights reserved.
 .\"
@@ -67,7 +67,7 @@
 Also, almost any unmodified dynamically linked application
 (for example
 .Xr telnet 1
-or 
+or
 .Xr ls 1 )
 can be used as a rump kernel client with the help of system call hijacking.
 See



CVS commit: src/share/man/man4

2011-03-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Mar 27 22:47:40 UTC 2011

Modified Files:
src/share/man/man4: gtp.4

Log Message:
Add RCS Id.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/gtp.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/gtp.4
diff -u src/share/man/man4/gtp.4:1.1 src/share/man/man4/gtp.4:1.2
--- src/share/man/man4/gtp.4:1.1	Sun Mar 27 00:08:08 2011
+++ src/share/man/man4/gtp.4	Sun Mar 27 22:47:40 2011
@@ -1,3 +1,4 @@
+.\"	$NetBSD: gtp.4,v 1.2 2011/03/27 22:47:40 wiz Exp $
 .\"	$OpenBSD: gtp.4,v 1.9 2007/05/31 19:19:50 jmc Exp $
 .\"
 .\" Copyright (c) 2002 Vladimir Popov 



CVS commit: src/common/lib/libprop

2011-03-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Mar 27 22:45:31 UTC 2011

Modified Files:
src/common/lib/libprop: prop_dictionary_util.3

Log Message:
Fix a typo and a punctuation nit.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/common/lib/libprop/prop_dictionary_util.3

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

Modified files:

Index: src/common/lib/libprop/prop_dictionary_util.3
diff -u src/common/lib/libprop/prop_dictionary_util.3:1.5 src/common/lib/libprop/prop_dictionary_util.3:1.6
--- src/common/lib/libprop/prop_dictionary_util.3:1.5	Thu Mar 24 17:05:39 2011
+++ src/common/lib/libprop/prop_dictionary_util.3	Sun Mar 27 22:45:30 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: prop_dictionary_util.3,v 1.5 2011/03/24 17:05:39 bouyer Exp $
+.\"	$NetBSD: prop_dictionary_util.3,v 1.6 2011/03/27 22:45:30 wiz Exp $
 .\"
 .\" Copyright (c) 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -54,7 +54,7 @@
 .Nm prop_dictionary_get_cstring ,
 .Nm prop_dictionary_set_cstring ,
 .Nm prop_dictionary_get_cstring_nocopy ,
-.Nm prop_dictionary_set_cstring_nocopy,
+.Nm prop_dictionary_set_cstring_nocopy ,
 .Nm prop_dictionary_set_and_rel
 .Sh LIBRARY
 .Lb libprop
@@ -169,7 +169,7 @@
 .Pp
 The
 .Fn prop_dictionary_set_and_rel
-function adds the object to the dictionary and release it.
+function adds the object to the dictionary and releases it.
 The object is also released on failure.
 .Sh RETURN VALUES
 The



CVS commit: src/common/lib/libprop

2011-03-27 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Mar 27 22:44:47 UTC 2011

Modified Files:
src/common/lib/libprop: prop_array_util.3

Log Message:
Fix a typo and a punctuation nit.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/common/lib/libprop/prop_array_util.3

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

Modified files:

Index: src/common/lib/libprop/prop_array_util.3
diff -u src/common/lib/libprop/prop_array_util.3:1.5 src/common/lib/libprop/prop_array_util.3:1.6
--- src/common/lib/libprop/prop_array_util.3:1.5	Thu Mar 24 17:05:39 2011
+++ src/common/lib/libprop/prop_array_util.3	Sun Mar 27 22:44:47 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: prop_array_util.3,v 1.5 2011/03/24 17:05:39 bouyer Exp $
+.\"	$NetBSD: prop_array_util.3,v 1.6 2011/03/27 22:44:47 wiz Exp $
 .\"
 .\" Copyright (c) 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -61,7 +61,7 @@
 .Nm prop_array_get_cstring ,
 .Nm prop_array_set_cstring ,
 .Nm prop_array_get_cstring_nocopy ,
-.Nm prop_array_set_cstring_nocopy,
+.Nm prop_array_set_cstring_nocopy ,
 .Nm prop_array_add_and_rel
 .Sh LIBRARY
 .Lb libprop
@@ -197,7 +197,7 @@
 .Pp
 The
 .Fn prop_array_add_and_rel
-function adds the object to the end of the array and release it.
+function adds the object to the end of the array and releases it.
 The object is also released on failure.
 .Sh RETURN VALUES
 The



CVS commit: src/libexec/ld.elf_so

2011-03-27 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun Mar 27 22:20:51 UTC 2011

Modified Files:
src/libexec/ld.elf_so: rtld.c

Log Message:
exit, not enter


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.146 src/libexec/ld.elf_so/rtld.c

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

Modified files:

Index: src/libexec/ld.elf_so/rtld.c
diff -u src/libexec/ld.elf_so/rtld.c:1.145 src/libexec/ld.elf_so/rtld.c:1.146
--- src/libexec/ld.elf_so/rtld.c:1.145	Sun Mar 27 21:58:50 2011
+++ src/libexec/ld.elf_so/rtld.c	Sun Mar 27 22:20:51 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld.c,v 1.145 2011/03/27 21:58:50 joerg Exp $	 */
+/*	$NetBSD: rtld.c,v 1.146 2011/03/27 22:20:51 joerg Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: rtld.c,v 1.145 2011/03/27 21:58:50 joerg Exp $");
+__RCSID("$NetBSD: rtld.c,v 1.146 2011/03/27 22:20:51 joerg Exp $");
 #endif /* not lint */
 
 #include 
@@ -865,7 +865,7 @@
 	_rtld_debug.r_state = RT_CONSISTENT;
 	_rtld_debug_state();
 
-	_rtld_exclusive_enter();
+	_rtld_exclusive_exit();
 
 	return 0;
 }



CVS commit: src/libexec/ld.elf_so

2011-03-27 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun Mar 27 21:58:51 UTC 2011

Modified Files:
src/libexec/ld.elf_so: rtld.c

Log Message:
Handle _rtld_exit as full entry point since other threads may still be
running at the time.


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/libexec/ld.elf_so/rtld.c

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

Modified files:

Index: src/libexec/ld.elf_so/rtld.c
diff -u src/libexec/ld.elf_so/rtld.c:1.144 src/libexec/ld.elf_so/rtld.c:1.145
--- src/libexec/ld.elf_so/rtld.c:1.144	Sun Mar 27 13:15:34 2011
+++ src/libexec/ld.elf_so/rtld.c	Sun Mar 27 21:58:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld.c,v 1.144 2011/03/27 13:15:34 joerg Exp $	 */
+/*	$NetBSD: rtld.c,v 1.145 2011/03/27 21:58:50 joerg Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: rtld.c,v 1.144 2011/03/27 13:15:34 joerg Exp $");
+__RCSID("$NetBSD: rtld.c,v 1.145 2011/03/27 21:58:50 joerg Exp $");
 #endif /* not lint */
 
 #include 
@@ -304,7 +304,11 @@
 {
 	dbg(("rtld_exit()"));
 
+	_rtld_exclusive_enter();
+
 	_rtld_call_fini_functions(1);
+
+	_rtld_exclusive_exit();
 }
 
 /*



CVS commit: src/sys/netipsec

2011-03-27 Thread S.P.Zeidler
Module Name:src
Committed By:   spz
Date:   Sun Mar 27 21:56:57 UTC 2011

Modified Files:
src/sys/netipsec: xform_esp.c

Log Message:
fix compiling with IPSEC_DEBUG:
it's authsize not authlen in struct auth_hash


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/netipsec/xform_esp.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/netipsec/xform_esp.c
diff -u src/sys/netipsec/xform_esp.c:1.30 src/sys/netipsec/xform_esp.c:1.31
--- src/sys/netipsec/xform_esp.c:1.30	Fri Feb 25 20:13:10 2011
+++ src/sys/netipsec/xform_esp.c	Sun Mar 27 21:56:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: xform_esp.c,v 1.30 2011/02/25 20:13:10 drochner Exp $	*/
+/*	$NetBSD: xform_esp.c,v 1.31 2011/03/27 21:56:57 spz Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/xform_esp.c,v 1.2.2.1 2003/01/24 05:11:36 sam Exp $	*/
 /*	$OpenBSD: ip_esp.c,v 1.69 2001/06/26 06:18:59 angelos Exp $ */
 
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.30 2011/02/25 20:13:10 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_esp.c,v 1.31 2011/03/27 21:56:57 spz Exp $");
 
 #include "opt_inet.h"
 #ifdef __FreeBSD__
@@ -1001,8 +1001,8 @@
 		 */
 		esph = sav->tdb_authalgxform;
 		if (esph !=  NULL) {
-			m_copyback(m, m->m_pkthdr.len - esph->authlen,
-			esph->authlen, ipseczeroes);
+			m_copyback(m, m->m_pkthdr.len - esph->authsize,
+			esph->authsize, ipseczeroes);
 		}
 	}
 #endif



CVS commit: src/doc

2011-03-27 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Mar 27 21:41:08 UTC 2011

Modified Files:
src/doc: NetBSD-6

Log Message:
Reorganize this file a bit, and move some stuff to "will not make it" to
give at least some semblance of realism.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/doc/NetBSD-6

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

Modified files:

Index: src/doc/NetBSD-6
diff -u src/doc/NetBSD-6:1.4 src/doc/NetBSD-6:1.5
--- src/doc/NetBSD-6:1.4	Sun Mar 27 21:21:50 2011
+++ src/doc/NetBSD-6	Sun Mar 27 21:41:08 2011
@@ -4,13 +4,6 @@
 This file is managed by the release engineering team - please get in touch
 with them with any feedback.
 
-May not make 6.0
-
-+ XIP
-+ gaols
-+ sctp
-+ devfs
-
 Will be in 6.0
 --
 + ZFS - need an update on viability, needs work
@@ -48,6 +41,16 @@
 + Xen suspend/resume - jym working on it
 + TNF funding for release engineering
 
+May not make 6.0
+
++ XIP
+
+Will not be in 6.0
+--
++ gaols
++ sctp
++ devfs
+
 
 Alistair Crooks
 On behalf of core and releng teams



CVS commit: src/doc

2011-03-27 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Sun Mar 27 21:21:50 UTC 2011

Modified Files:
src/doc: NetBSD-6

Log Message:
Sync NetBSD-6 plans with reality - update on features that have been
completed.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/doc/NetBSD-6

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

Modified files:

Index: src/doc/NetBSD-6
diff -u src/doc/NetBSD-6:1.3 src/doc/NetBSD-6:1.4
--- src/doc/NetBSD-6:1.3	Wed Dec  8 03:57:24 2010
+++ src/doc/NetBSD-6	Sun Mar 27 21:21:50 2011
@@ -14,12 +14,12 @@
 Will be in 6.0
 --
 + ZFS - need an update on viability, needs work
-+ in-kernel iSCSI initiator, libisns and userland tools
++ in-kernel iSCSI initiator, and userland tools - libisns in repo and in build
 + 64-bit time_t
-+ rump
++ rump - pooka has declared interfaces stable
 + LVM/dmapper and tools
 + workable MIPS for all
-+ netpgp - maybe I am a bit biased in this?
++ netpgp - agc
 + able to use external compilers and toolchain
 + cleaned up files in repos - joerg
 + support for wide efficient regexps with tre
@@ -30,13 +30,13 @@
 + agreement and communication of tiered port system (before release) - pooka
 + other enhancements and new functionality in -current
 + tcp support in libsa? need to merge SoC project
-+ sasl - SoC project merged, needs to be hooked into the build
++ sasl - SoC project was merged
 + namei changes - dholland
-+ support for resizing ffs
-+ production support for fss - no longer experimental
++ support for resizing ffs - riz
++ production support for fss
 + Xen/SMP
 + automated test framework for testing releng autobuilds
-+ full functionality for NPF
++ full functionality for NPF - SMP-aware packet filter - rmind
 + fixed IPSEC NAT-T
 + GPT-aware bootloader for i386/amd64
 
@@ -51,4 +51,4 @@
 
 Alistair Crooks
 On behalf of core and releng teams
-Sat Nov 27 12:32:06 PST 2010
+Fri Mar 25 17:20:36 PDT 2011



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

2011-03-27 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Mar 27 21:16:52 UTC 2011

Modified Files:
src/sys/rump/librump/rumpvfs: rumpfs.c

Log Message:
Don't try to kmem_alloc() 0 bytes.  Without this change, some trivial
kernel modules were not loadable by rump_server.


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/rump/librump/rumpvfs/rumpfs.c

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

Modified files:

Index: src/sys/rump/librump/rumpvfs/rumpfs.c
diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.93 src/sys/rump/librump/rumpvfs/rumpfs.c:1.94
--- src/sys/rump/librump/rumpvfs/rumpfs.c:1.93	Mon Mar 21 16:41:09 2011
+++ src/sys/rump/librump/rumpvfs/rumpfs.c	Sun Mar 27 21:16:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpfs.c,v 1.93 2011/03/21 16:41:09 pooka Exp $	*/
+/*	$NetBSD: rumpfs.c,v 1.94 2011/03/27 21:16:52 riz Exp $	*/
 
 /*
  * Copyright (c) 2009, 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.93 2011/03/21 16:41:09 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.94 2011/03/27 21:16:52 riz Exp $");
 
 #include 
 #include 
@@ -1219,6 +1219,8 @@
 	int error = 0;
 
 	bufsize = uio->uio_resid;
+	if (bufsize == 0)
+		return 0;
 	buf = kmem_alloc(bufsize, KM_SLEEP);
 	if ((n = rumpuser_pread(rn->rn_readfd, buf, bufsize,
 	uio->uio_offset + rn->rn_offset, &error)) == -1)
@@ -1275,6 +1277,8 @@
 	int error = 0;
 
 	bufsize = uio->uio_resid;
+	if (bufsize == 0)
+		return 0;
 	buf = kmem_alloc(bufsize, KM_SLEEP);
 	error = uiomove(buf, bufsize, uio);
 	if (error)



CVS commit: src/usr.bin/make

2011-03-27 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Sun Mar 27 19:47:46 UTC 2011

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

Log Message:
Use curdirOk as the token


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/usr.bin/make/make.1
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/make/meta.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/make/make.1
diff -u src/usr.bin/make/make.1:1.184 src/usr.bin/make/make.1:1.185
--- src/usr.bin/make/make.1:1.184	Sun Mar 27 19:39:21 2011
+++ src/usr.bin/make/make.1	Sun Mar 27 19:47:46 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.184 2011/03/27 19:39:21 sjg Exp $
+.\"	$NetBSD: make.1,v 1.185 2011/03/27 19:47:46 sjg Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -780,7 +780,7 @@
 is available, the system calls which are of interest to
 .Nm .
 The captured output can be very useful when diagnosing errors.
-.It Pa curdir= Ar bf
+.It Pa curdirOk= Ar bf
 Normally
 .Nm
 will not create .meta files in

Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.12 src/usr.bin/make/meta.c:1.13
--- src/usr.bin/make/meta.c:1.12	Sun Mar 27 19:39:21 2011
+++ src/usr.bin/make/meta.c	Sun Mar 27 19:47:46 2011
@@ -550,8 +550,8 @@
 	writeMeta = FALSE;
 	if (strstr(make_mode, "nofilemon"))
 	useFilemon = FALSE;
-	if ((cp = strstr(make_mode, "curdir="))) {
-	metaCurdirOk = boolValue(&cp[7]);
+	if ((cp = strstr(make_mode, "curdirok="))) {
+	metaCurdirOk = boolValue(&cp[9]);
 	}
 	if (strstr(make_mode, "ignore-cmd"))
 	metaIgnoreCMDs = TRUE;



CVS commit: src/usr.bin/make

2011-03-27 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Sun Mar 27 19:39:21 UTC 2011

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

Log Message:
When .MAKE.MODE inlcudes 'meta'; 'curdir=true' enables creating .meta
files in .CURDIR - such as when running make in .OBJDIR with a generated
makefile.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/usr.bin/make/make.1
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/meta.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/make/make.1
diff -u src/usr.bin/make/make.1:1.183 src/usr.bin/make/make.1:1.184
--- src/usr.bin/make/make.1:1.183	Sat Feb 26 01:17:24 2011
+++ src/usr.bin/make/make.1	Sun Mar 27 19:39:21 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.183 2011/02/26 01:17:24 sjg Exp $
+.\"	$NetBSD: make.1,v 1.184 2011/03/27 19:39:21 sjg Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	from: @(#)make.1	8.4 (Berkeley) 3/19/94
 .\"
-.Dd February 25, 2011
+.Dd March 27, 2011
 .Dt MAKE 1
 .Os
 .Sh NAME
@@ -767,7 +767,7 @@
 .Bl -hang -width ignore-cmd
 .It Pa compat
 Like
-.Fl B
+.Fl B ,
 puts
 .Nm
 into "compat" mode.
@@ -780,6 +780,14 @@
 is available, the system calls which are of interest to
 .Nm .
 The captured output can be very useful when diagnosing errors.
+.It Pa curdir= Ar bf
+Normally
+.Nm
+will not create .meta files in
+.Ql Va .CURDIR .
+This can be overridden by setting
+.Va bf 
+to a value which represents True.
 .It Pa verbose
 If in "meta" mode, print a clue about the target being built.
 This is useful if the build is otherwise running silently.

Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.11 src/usr.bin/make/meta.c:1.12
--- src/usr.bin/make/meta.c:1.11	Sun Mar  6 17:41:11 2011
+++ src/usr.bin/make/meta.c	Sun Mar 27 19:39:21 2011
@@ -60,6 +60,7 @@
 static Boolean metaEnv = FALSE;		/* don't save env unless asked */
 static Boolean metaVerbose = FALSE;
 static Boolean metaIgnoreCMDs = FALSE;	/* ignore CMDs in .meta files */
+static Boolean metaCurdirOk = FALSE;	/* write .meta in .CURDIR Ok? */
 
 extern Boolean forceJobs;
 extern Boolean comatMake;
@@ -435,7 +436,7 @@
 	dname = objdir;
 
 /* If we aren't in the object directory, don't create a meta file. */
-if (strcmp(curdir, dname) == 0) {
+if (!metaCurdirOk && strcmp(curdir, dname) == 0) {
 	if (DEBUG(META))
 	fprintf(debug_file, "Skipping meta for %s: .OBJDIR == .CURDIR\n",
 		gn->name);
@@ -516,11 +517,25 @@
 return (mf.fp);
 }
 
+static Boolean
+boolValue(char *s)
+{
+switch(*s) {
+case '0':
+case 'N':
+case 'n':
+case 'F':
+case 'f':
+	return FALSE;
+}
+return TRUE;
+}
 
 void
 meta_init(const char *make_mode)
 {
 static int once = 0;
+char *cp;
 
 useMeta = TRUE;
 useFilemon = TRUE;
@@ -535,6 +550,9 @@
 	writeMeta = FALSE;
 	if (strstr(make_mode, "nofilemon"))
 	useFilemon = FALSE;
+	if ((cp = strstr(make_mode, "curdir="))) {
+	metaCurdirOk = boolValue(&cp[7]);
+	}
 	if (strstr(make_mode, "ignore-cmd"))
 	metaIgnoreCMDs = TRUE;
 	/* for backwards compatability */



CVS commit: src/sys/arch/sandpoint/stand/altboot

2011-03-27 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Mar 27 19:09:43 UTC 2011

Modified Files:
src/sys/arch/sandpoint/stand/altboot: rge.c

Log Message:
Fixed PHY access.
Support 8169SC/8110SC (as found on QNAP V200 boards).
Make frame receiving work (FRAMELEN <-> FRAMESIZE).
Driver works now, but not the first time after cold start.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sandpoint/stand/altboot/rge.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/sandpoint/stand/altboot/rge.c
diff -u src/sys/arch/sandpoint/stand/altboot/rge.c:1.2 src/sys/arch/sandpoint/stand/altboot/rge.c:1.3
--- src/sys/arch/sandpoint/stand/altboot/rge.c:1.2	Thu Jan 27 17:38:04 2011
+++ src/sys/arch/sandpoint/stand/altboot/rge.c	Sun Mar 27 19:09:43 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: rge.c,v 1.2 2011/01/27 17:38:04 phx Exp $ */
+/* $NetBSD: rge.c,v 1.3 2011/03/27 19:09:43 phx Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -133,6 +133,7 @@
 
 	v = pcicfgread(tag, PCI_ID_REG);
 	switch (v) {
+	case PCI_DEVICE(0x10ec, 0x8167):
 	case PCI_DEVICE(0x10ec, 0x8169):
 		return 1;
 	}
@@ -199,7 +200,7 @@
 	l->rcr = (07 << 13) | (07 << 8) | RCR_APM;
 	CSR_WRITE_1(l, RGE_CR, CR_TXEN | CR_RXEN);
 	CSR_WRITE_1(l, RGE_ETTHR, 0x3f);
-	CSR_WRITE_2(l, RGE_RMS, FRAMELEN);
+	CSR_WRITE_2(l, RGE_RMS, FRAMESIZE);
 	CSR_WRITE_4(l, RGE_TCR, l->tcr);
 	CSR_WRITE_4(l, RGE_RCR, l->rcr);
 	CSR_WRITE_4(l, RGE_TNPDS, VTOPHYS(txd));
@@ -208,7 +209,6 @@
 	CSR_WRITE_4(l, RGE_RDSAR + 4, 0); 
 	CSR_WRITE_2(l, RGE_ISR, ~0);
 	CSR_WRITE_2(l, RGE_IMR, 0);
-
 	return l;
 }
 
@@ -287,15 +287,16 @@
 static int
 mii_read(struct local *l, int phy, int reg)
 {
-	unsigned v, loop;
+	unsigned v;
 
 	v = reg << 16;
 	CSR_WRITE_4(l, RGE_PHYAR, v);
-	loop = 100;
+	DELAY(1000);
 	do {
+		DELAY(100);
 		v = CSR_READ_4(l, RGE_PHYAR);
 	} while ((v & (1U << 31)) == 0); /* wait for 0 -> 1 */
-	return v;
+	return v & 0x;
 }
 
 static void
@@ -305,7 +306,9 @@
 
 	v = (reg << 16) | (data & 0x) | (1U << 31);
 	CSR_WRITE_4(l, RGE_PHYAR, v);
+	DELAY(1000);
 	do {
+		DELAY(100);
 		v = CSR_READ_4(l, RGE_PHYAR);
 	} while (v & (1U << 31)); /* wait for 1 -> 0 */
 }
@@ -337,17 +340,9 @@
 static void
 mii_initphy(struct local *l)
 {
-	int phy, ctl, sts, bound;
+	int bound, ctl, phy, sts;
 
-	for (phy = 0; phy < 32; phy++) {
-		ctl = mii_read(l, phy, MII_BMCR);
-		sts = mii_read(l, phy, MII_BMSR);
-		if (ctl != 0x && sts != 0x)
-			goto found;
-	}
-	printf("MII: no PHY found\n");
-	return;
-  found:
+	phy = 7;	/* internal rgephy, always at 7 */
 	ctl = mii_read(l, phy, MII_BMCR);
 	mii_write(l, phy, MII_BMCR, ctl | BMCR_RESET);
 	bound = 100;



CVS commit: src/sys/arch

2011-03-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar 27 18:47:09 UTC 2011

Modified Files:
src/sys/arch/sparc/include: trap.h
src/sys/arch/sparc/sparc: syscall.c
src/sys/arch/sparc64/include: trap.h
src/sys/arch/sparc64/sparc64: syscall.c

Log Message:
On second thought do not use bit 13 as a flag for syscall numbers, userland
typically sets those from a 13bit signed integer immediate field in the
instruction, so would need to jump through hoops (ok, small hoops) to
avoid sign extension.
Use a combination of the existing syscall flags instead.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/sparc/include/trap.h
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sparc/sparc/syscall.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sparc64/include/trap.h
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/sparc64/sparc64/syscall.c

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

Modified files:

Index: src/sys/arch/sparc/include/trap.h
diff -u src/sys/arch/sparc/include/trap.h:1.17 src/sys/arch/sparc/include/trap.h:1.18
--- src/sys/arch/sparc/include/trap.h:1.17	Wed Mar 23 20:41:30 2011
+++ src/sys/arch/sparc/include/trap.h	Sun Mar 27 18:47:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.h,v 1.17 2011/03/23 20:41:30 martin Exp $ */
+/*	$NetBSD: trap.h,v 1.18 2011/03/27 18:47:08 martin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -131,7 +131,7 @@
 /* flags to system call (flags in %g1 along with syscall number) */
 #define	SYSCALL_G2RFLAG	0x400	/* on success, return to %g2 rather than npc */
 #define	SYSCALL_G7RFLAG	0x800	/* use %g7 as above (deprecated) */
-#define	SYSCALL_G5RFLAG	0x1000	/* use %g5 as above (only ABI compatible way) */
+#define	SYSCALL_G5RFLAG	0xc00	/* use %g5 as above (only ABI compatible way) */
 
 /*
  * `software trap' macros to keep people happy (sparc v8 manual says not

Index: src/sys/arch/sparc/sparc/syscall.c
diff -u src/sys/arch/sparc/sparc/syscall.c:1.24 src/sys/arch/sparc/sparc/syscall.c:1.25
--- src/sys/arch/sparc/sparc/syscall.c:1.24	Wed Mar 23 20:41:31 2011
+++ src/sys/arch/sparc/sparc/syscall.c	Sun Mar 27 18:47:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.24 2011/03/23 20:41:31 martin Exp $ */
+/*	$NetBSD: syscall.c,v 1.25 2011/03/27 18:47:09 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -49,7 +49,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.24 2011/03/23 20:41:31 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.25 2011/03/27 18:47:09 martin Exp $");
 
 #include "opt_sparc_arch.h"
 #include "opt_multiprocessor.h"
@@ -250,7 +250,8 @@
 		tf->tf_out[1] = rval.o[1];
 		if (new) {
 			/* jmp %g5, (or %g2 or %g7, deprecated) on success */
-			if (new & SYSCALL_G5RFLAG)
+			if (__predict_true((new & SYSCALL_G5RFLAG)
+		== SYSCALL_G5RFLAG))
 i = tf->tf_global[5];
 			else if (new & SYSCALL_G2RFLAG)
 i = tf->tf_global[2];
@@ -340,7 +341,8 @@
 		tf->tf_out[1] = rval.o[1];
 		if (new) {
 			/* jmp %g5, (or %g2 or %g7, deprecated) on success */
-			if (new & SYSCALL_G5RFLAG)
+			if (__predict_true((new & SYSCALL_G5RFLAG) ==
+	SYSCALL_G5RFLAG))
 i = tf->tf_global[5];
 			else if (new & SYSCALL_G2RFLAG)
 i = tf->tf_global[2];

Index: src/sys/arch/sparc64/include/trap.h
diff -u src/sys/arch/sparc64/include/trap.h:1.8 src/sys/arch/sparc64/include/trap.h:1.9
--- src/sys/arch/sparc64/include/trap.h:1.8	Wed Mar 23 20:41:31 2011
+++ src/sys/arch/sparc64/include/trap.h	Sun Mar 27 18:47:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.h,v 1.8 2011/03/23 20:41:31 martin Exp $ */
+/*	$NetBSD: trap.h,v 1.9 2011/03/27 18:47:09 martin Exp $ */
 
 /*
  * Copyright (c) 1996-1999 Eduardo Horvath
@@ -142,7 +142,7 @@
 /* flags to system call (flags in %g1 along with syscall number) */
 #define	SYSCALL_G2RFLAG	0x400	/* on success, return to %g2 rather than npc */
 #define	SYSCALL_G7RFLAG	0x800	/* use %g7 as above (deprecated) */
-#define	SYSCALL_G5RFLAG	0x1000	/* use %g5 as above (only ABI compatible way) */
+#define	SYSCALL_G5RFLAG	0xc00	/* use %g5 as above (only ABI compatible way) */
 
 /*
  * `software trap' macros to keep people happy (sparc v8 manual says not

Index: src/sys/arch/sparc64/sparc64/syscall.c
diff -u src/sys/arch/sparc64/sparc64/syscall.c:1.38 src/sys/arch/sparc64/sparc64/syscall.c:1.39
--- src/sys/arch/sparc64/sparc64/syscall.c:1.38	Wed Mar 23 20:41:31 2011
+++ src/sys/arch/sparc64/sparc64/syscall.c	Sun Mar 27 18:47:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.38 2011/03/23 20:41:31 martin Exp $ */
+/*	$NetBSD: syscall.c,v 1.39 2011/03/27 18:47:09 martin Exp $ */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.38 2011/03/23 20:41:31 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.39 2011/03/27 18:47:09 martin Exp $");
 
 #include "opt_sa.h"
 
@@ -130,7 +130,8 @@
 	int new = *code & (SYSCALL_G7RFLAG|SYSCALL_G2RFLAG|SYSCALL_G5RFLAG

CVS commit: src/usr.sbin/repquota

2011-03-27 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Mar 27 17:15:17 UTC 2011

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

Log Message:
Make sure to not report quotas for a class if we didn't get valid datas
from kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/repquota/repquota.c

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

Modified files:

Index: src/usr.sbin/repquota/repquota.c
diff -u src/usr.sbin/repquota/repquota.c:1.30 src/usr.sbin/repquota/repquota.c:1.31
--- src/usr.sbin/repquota/repquota.c:1.30	Thu Mar 24 17:05:47 2011
+++ src/usr.sbin/repquota/repquota.c	Sun Mar 27 17:15:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: repquota.c,v 1.30 2011/03/24 17:05:47 bouyer Exp $	*/
+/*	$NetBSD: repquota.c,v 1.31 2011/03/27 17:15:17 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)repquota.c	8.2 (Berkeley) 11/22/94";
 #else
-__RCSID("$NetBSD: repquota.c,v 1.30 2011/03/24 17:05:47 bouyer Exp $");
+__RCSID("$NetBSD: repquota.c,v 1.31 2011/03/27 17:15:17 bouyer Exp $");
 #endif
 #endif /* not lint */
 
@@ -284,8 +284,9 @@
 		if (dataiter == NULL)
 			err(1, "prop_array_iterator");
 
-		valid[class] = 1;
+		valid[class] = 0;
 		while ((data = prop_object_iterator_next(dataiter)) != NULL) {
+			valid[class] = 1;
 			strid = NULL;
 			if (!prop_dictionary_get_uint32(data, "id", &id)) {
 if (!prop_dictionary_get_cstring_nocopy(data,
@@ -317,7 +318,7 @@
 	}
 	prop_object_iterator_release(cmditer);
 	prop_object_release(dict);
-	if (xflag == 0)
+	if (xflag == 0 && valid[class])
 		printquotas(class, vfs, version);
 	return 0;
 }



CVS commit: src/tests/lib/libpthread

2011-03-27 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sun Mar 27 16:45:16 UTC 2011

Modified Files:
src/tests/lib/libpthread: t_cond.c

Log Message:
Add a test case for pthread_cond_timedwait(3) failures reported by
Sad Clouds in PR lib/44756. This was discussed also in:

http://mail-index.netbsd.org/tech-userlevel/2011/03/17/msg004689.html


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libpthread/t_cond.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/libpthread/t_cond.c
diff -u src/tests/lib/libpthread/t_cond.c:1.2 src/tests/lib/libpthread/t_cond.c:1.3
--- src/tests/lib/libpthread/t_cond.c:1.2	Wed Nov  3 16:10:22 2010
+++ src/tests/lib/libpthread/t_cond.c	Sun Mar 27 16:45:15 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: t_cond.c,v 1.2 2010/11/03 16:10:22 christos Exp $ */
+/* $NetBSD: t_cond.c,v 1.3 2011/03/27 16:45:15 jruoho Exp $ */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_cond.c,v 1.2 2010/11/03 16:10:22 christos Exp $");
+__RCSID("$NetBSD: t_cond.c,v 1.3 2011/03/27 16:45:15 jruoho Exp $");
 
 #include 
 
@@ -306,6 +306,66 @@
 }
 
 static void *
+pthread_cond_timedwait_func(void *arg)
+{
+	struct timespec ts;
+	size_t i = 0;
+	int rv;
+
+	for (;;) {
+
+		if (i++ >= 1)
+			pthread_exit(NULL);
+
+		(void)memset(&ts, 0, sizeof(struct timespec));
+
+		ATF_REQUIRE(clock_gettime(CLOCK_REALTIME, &ts) == 0);
+
+		/*
+		 * Set to one second in the past:
+		 * pthread_cond_timedwait(3) should
+		 * return ETIMEDOUT immediately.
+		 */
+		ts.tv_sec = ts.tv_sec - 1;
+
+		PTHREAD_REQUIRE(pthread_mutex_lock(&static_mutex));
+		rv = pthread_cond_timedwait(&static_cond, &static_mutex, &ts);
+
+		/*
+		 * Sometimes we catch ESRCH.
+		 * This should never happen.
+		 */
+		ATF_REQUIRE(rv == ETIMEDOUT);
+		PTHREAD_REQUIRE(pthread_mutex_unlock(&static_mutex));
+	}
+}
+
+ATF_TC(cond_timedwait_race);
+ATF_TC_HEAD(cond_timedwait_race, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Test pthread_cond_timedwait(3)");
+
+}
+ATF_TC_BODY(cond_timedwait_race, tc)
+{
+	pthread_t tid[64];
+	size_t i;
+
+	atf_tc_expect_fail("PR lib/44756");
+
+	for (i = 0; i < __arraycount(tid); i++) {
+
+		PTHREAD_REQUIRE(pthread_create(&tid[i], NULL,
+			pthread_cond_timedwait_func, NULL));
+	}
+
+	for (i = 0; i < __arraycount(tid); i++) {
+
+		PTHREAD_REQUIRE(pthread_join(tid[i], NULL));
+	}
+}
+
+static void *
 broadcast_threadfunc(void *arg)
 {
 	printf("2: Second thread.\n");
@@ -502,6 +562,7 @@
 	ATF_TP_ADD_TC(tp, signal_before_unlock);
 	ATF_TP_ADD_TC(tp, signal_before_unlock_static_init);
 	ATF_TP_ADD_TC(tp, signal_wait_race);
+	ATF_TP_ADD_TC(tp, cond_timedwait_race);
 	ATF_TP_ADD_TC(tp, broadcast);
 	ATF_TP_ADD_TC(tp, bogus_timedwaits);
 	ATF_TP_ADD_TC(tp, destroy_after_cancel);



CVS commit: src/share/mk

2011-03-27 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Sun Mar 27 14:22:03 UTC 2011

Modified Files:
src/share/mk: bsd.test.mk

Log Message:
if not including  then we need to clean up our own mess


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/share/mk/bsd.test.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.test.mk
diff -u src/share/mk/bsd.test.mk:1.16 src/share/mk/bsd.test.mk:1.17
--- src/share/mk/bsd.test.mk:1.16	Sun Feb 20 20:16:01 2011
+++ src/share/mk/bsd.test.mk	Sun Mar 27 14:22:02 2011
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.test.mk,v 1.16 2011/02/20 20:16:01 jmmv Exp $
+# $NetBSD: bsd.test.mk,v 1.17 2011/03/27 14:22:02 plunky Exp $
 #
 
 .include 
@@ -83,6 +83,10 @@
 
 .if !empty(SCRIPTS) || !empty(PROGS) || !empty(PROGS_CXX)
 .  include 
+.else
+cleandir:	cleantest
+cleantest:	.PHONY
+	rm -f ${CLEANFILES}
 .endif
 
 #



CVS commit: src/sys/arch/mips/rmi

2011-03-27 Thread Adam Hoka
Module Name:src
Committed By:   ahoka
Date:   Sun Mar 27 13:36:50 UTC 2011

Modified Files:
src/sys/arch/mips/rmi: rmixl_nand.c

Log Message:
use nand_init_interface


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/rmi/rmixl_nand.c

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

Modified files:

Index: src/sys/arch/mips/rmi/rmixl_nand.c
diff -u src/sys/arch/mips/rmi/rmixl_nand.c:1.4 src/sys/arch/mips/rmi/rmixl_nand.c:1.5
--- src/sys/arch/mips/rmi/rmixl_nand.c:1.4	Fri Mar 18 20:23:26 2011
+++ src/sys/arch/mips/rmi/rmixl_nand.c	Sun Mar 27 13:36:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_nand.c,v 1.4 2011/03/18 20:23:26 cliff Exp $	*/
+/*	$NetBSD: rmixl_nand.c,v 1.5 2011/03/27 13:36:50 ahoka Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rmixl_nand.c,v 1.4 2011/03/18 20:23:26 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_nand.c,v 1.5 2011/03/27 13:36:50 ahoka Exp $");
 
 #include "opt_flash.h"
 
@@ -202,7 +202,8 @@
 	}
 	aprint_debug_dev(self, "bus width %d bits\n", 8 * sc->sc_buswidth);
 
-	sc->sc_nand_if.select = nand_default_select;
+	nand_init_interface(&sc->sc_nand_if);
+
 	sc->sc_nand_if.command = rmixl_nand_command;
 	sc->sc_nand_if.address = rmixl_nand_address;
 	sc->sc_nand_if.read_buf_byte = rmixl_nand_read_buf;
@@ -215,12 +216,8 @@
 	sc->sc_nand_if.write_word = rmixl_nand_write_word;
 	sc->sc_nand_if.busy = rmixl_nand_busy;
 
-	sc->sc_nand_if.ecc_compute = nand_default_ecc_compute;
-	sc->sc_nand_if.ecc_correct = nand_default_ecc_correct;
-	sc->sc_nand_if.ecc_prepare = NULL;
 	sc->sc_nand_if.ecc.necc_code_size = 3;
 	sc->sc_nand_if.ecc.necc_block_size = 256;
-	sc->sc_nand_if.ecc.necc_type = NAND_ECC_TYPE_SW;
 
 	/*
 	 * reset to get NAND into known state



CVS commit: src/sys/arch/arm/omap

2011-03-27 Thread Adam Hoka
Module Name:src
Committed By:   ahoka
Date:   Sun Mar 27 13:35:39 UTC 2011

Modified Files:
src/sys/arch/arm/omap: omap2_nand.c

Log Message:
Use nand_init_interface, which is required now.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/omap/omap2_nand.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/arm/omap/omap2_nand.c
diff -u src/sys/arch/arm/omap/omap2_nand.c:1.1 src/sys/arch/arm/omap/omap2_nand.c:1.2
--- src/sys/arch/arm/omap/omap2_nand.c:1.1	Sat Feb 26 18:07:18 2011
+++ src/sys/arch/arm/omap/omap2_nand.c	Sun Mar 27 13:35:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap2_nand.c,v 1.1 2011/02/26 18:07:18 ahoka Exp $	*/
+/*	$NetBSD: omap2_nand.c,v 1.2 2011/03/27 13:35:39 ahoka Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap2_nand.c,v 1.1 2011/02/26 18:07:18 ahoka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap2_nand.c,v 1.2 2011/03/27 13:35:39 ahoka Exp $");
 
 #include "opt_omap.h"
 #include "opt_flash.h"
@@ -249,7 +249,8 @@
 		panic("invalid buswidth reported by config1");
 	}
 
-	sc->sc_nand_if.select = &nand_default_select;
+	nand_init_interface(&sc->sc_nand_if);
+
 	sc->sc_nand_if.command = &omap2_nand_command;
 	sc->sc_nand_if.address = &omap2_nand_address;
 	sc->sc_nand_if.read_buf_byte = &omap2_nand_read_buf_byte;
@@ -271,12 +272,8 @@
 	sc->sc_nand_if.ecc.necc_block_size = 512;
 	sc->sc_nand_if.ecc.necc_type = NAND_ECC_TYPE_HW;
 #else
-	sc->sc_nand_if.ecc_compute = &nand_default_ecc_compute;
-	sc->sc_nand_if.ecc_correct = &nand_default_ecc_correct;
-	sc->sc_nand_if.ecc_prepare = NULL;
 	sc->sc_nand_if.ecc.necc_code_size = 3;
 	sc->sc_nand_if.ecc.necc_block_size = 256;
-	sc->sc_nand_if.ecc.necc_type = NAND_ECC_TYPE_SW;
 #endif	/* OMAP2_NAND_HARDWARE_ECC */
 
 	if (!pmf_device_register1(sc->sc_dev, NULL, NULL, NULL))



CVS commit: src/sys/dev/nand

2011-03-27 Thread Adam Hoka
Module Name:src
Committed By:   ahoka
Date:   Sun Mar 27 13:33:04 UTC 2011

Modified Files:
src/sys/dev/nand: files.nand nand.c nand.h nandemulator.c

Log Message:
Add support for redifining page read and program functions by drivers.
Some controllers implement read/write in one step, so this is required
to support those.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/nand/files.nand
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/nand/nand.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/nand/nand.h
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/nand/nandemulator.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/nand/files.nand
diff -u src/sys/dev/nand/files.nand:1.2 src/sys/dev/nand/files.nand:1.3
--- src/sys/dev/nand/files.nand:1.2	Wed Mar  9 10:05:08 2011
+++ src/sys/dev/nand/files.nand	Sun Mar 27 13:33:04 2011
@@ -1,4 +1,4 @@
-# $NetBSD: files.nand,v 1.2 2011/03/09 10:05:08 ahoka Exp $
+# $NetBSD: files.nand,v 1.3 2011/03/27 13:33:04 ahoka Exp $
 
 define	nandbus	{ }
 
@@ -15,3 +15,5 @@
 file	dev/nand/nandemulator.c	nandemulator
 
 defflag opt_nand.h		NAND_BBT
+defflag opt_nand.h		NAND_DEBUG
+defflag opt_nand.h		NAND_VERBOSE

Index: src/sys/dev/nand/nand.c
diff -u src/sys/dev/nand/nand.c:1.5 src/sys/dev/nand/nand.c:1.6
--- src/sys/dev/nand/nand.c:1.5	Wed Mar  9 12:33:59 2011
+++ src/sys/dev/nand/nand.c	Sun Mar 27 13:33:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: nand.c,v 1.5 2011/03/09 12:33:59 ahoka Exp $	*/
+/*	$NetBSD: nand.c,v 1.6 2011/03/27 13:33:04 ahoka Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -34,7 +34,7 @@
 /* Common driver for NAND chips implementing the ONFI 2.2 specification */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nand.c,v 1.5 2011/03/09 12:33:59 ahoka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nand.c,v 1.6 2011/03/27 13:33:04 ahoka Exp $");
 
 #include "locators.h"
 
@@ -63,9 +63,7 @@
 static int nand_search(device_t, cfdata_t, const int *, void *);
 static void nand_address_row(device_t, size_t);
 static void nand_address_column(device_t, size_t, size_t);
-static void nand_readid(device_t, struct nand_chip *);
-static void nand_read_parameter_page(device_t, struct nand_chip *);
-static const char *nand_midtoname(int);
+static int nand_fill_chip_structure(device_t, struct nand_chip *);
 static int nand_scan_media(device_t, struct nand_chip *);
 static bool nand_check_wp(device_t);
 
@@ -79,6 +77,7 @@
 int nand_cachesync_timeout = 1;
 int nand_cachesync_nodenum;
 
+#ifdef NAND_VERBOSE
 const struct nand_manufacturer nand_mfrs[] = {
 	{ NAND_MFR_AMD,		"AMD" },
 	{ NAND_MFR_FUJITSU,	"Fujitsu" },
@@ -92,6 +91,22 @@
 	{ NAND_MFR_UNKNOWN,	"Unknown" }
 };
 
+static const char *
+nand_midtoname(int id)
+{
+	int i;
+
+	for (i = 0; nand_mfrs[i].id != 0; i++) {
+		if (nand_mfrs[i].id == id)
+			return nand_mfrs[i].name;
+	}
+
+	KASSERT(nand_mfrs[i].id == 0);
+
+	return nand_mfrs[i].name;
+}
+#endif
+
 /* ARGSUSED */
 int
 nand_match(device_t parent, cfdata_t match, void *aux)
@@ -108,7 +123,7 @@
 	struct nand_chip *chip = &sc->sc_chip;
 
 	sc->sc_dev = self;
-	sc->nand_dev = parent;
+	sc->controller_dev = parent;
 	sc->nand_if = naa->naa_nand_if;
 
 	aprint_naive("\n");
@@ -238,6 +253,7 @@
 	return UNCONF;
 }
 
+/* ask for a nand driver to attach to the controller */
 device_t
 nand_attach_mi(struct nand_interface *nand_if, device_t parent)
 {
@@ -245,23 +261,50 @@
 
 	KASSERT(nand_if != NULL);
 
+	/* fill the defaults if we have null pointers */
+	if (nand_if->program_page == NULL) {
+		nand_if->program_page = &nand_default_program_page;
+	}
+
+	if (nand_if->read_page == NULL) {
+		nand_if->read_page = &nand_default_read_page;
+	}
+
 	arg.naa_nand_if = nand_if;
 	return config_found_ia(parent, "nandbus", &arg, nand_print);
 }
 
-static const char *
-nand_midtoname(int id)
+/* default everything to reasonable values, to ease future api changes */
+void
+nand_init_interface(struct nand_interface *interface)
 {
-	int i;
-
-	for (i = 0; nand_mfrs[i].id != 0; i++) {
-		if (nand_mfrs[i].id == id)
-			return nand_mfrs[i].name;
-	}
-
-	KASSERT(nand_mfrs[i].id == 0);
+	interface->select = &nand_default_select;
+	interface->command = NULL;
+	interface->address = NULL;
+	interface->read_buf_byte = NULL;
+	interface->read_buf_word = NULL;
+	interface->read_byte = NULL;
+	interface->read_word = NULL;
+	interface->write_buf_byte = NULL;
+	interface->write_buf_word = NULL;
+	interface->write_byte = NULL;
+	interface->write_word = NULL;
+	interface->busy = NULL;
+
+	/*-
+	 * most drivers dont want to change this, but some implement
+	 * read/program in one step
+	 */
+	interface->program_page = &nand_default_program_page;
+	interface->read_page = &nand_default_read_page;
 
-	return nand_mfrs[i].name;
+	/* default to soft ecc, that should work everywhere */
+	interface->ecc_compute = &nand_default_ecc_compute;
+	interface->ecc_correct = &nand_default_ecc_correct;
+	inter

CVS commit: src/libexec/ld.elf_so

2011-03-27 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun Mar 27 13:15:34 UTC 2011

Modified Files:
src/libexec/ld.elf_so: rtld.c

Log Message:
Add some debug messages for explicit rtld entry points


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/libexec/ld.elf_so/rtld.c

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

Modified files:

Index: src/libexec/ld.elf_so/rtld.c
diff -u src/libexec/ld.elf_so/rtld.c:1.143 src/libexec/ld.elf_so/rtld.c:1.144
--- src/libexec/ld.elf_so/rtld.c:1.143	Sun Mar 27 13:14:42 2011
+++ src/libexec/ld.elf_so/rtld.c	Sun Mar 27 13:15:34 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld.c,v 1.143 2011/03/27 13:14:42 joerg Exp $	 */
+/*	$NetBSD: rtld.c,v 1.144 2011/03/27 13:15:34 joerg Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: rtld.c,v 1.143 2011/03/27 13:14:42 joerg Exp $");
+__RCSID("$NetBSD: rtld.c,v 1.144 2011/03/27 13:15:34 joerg Exp $");
 #endif /* not lint */
 
 #include 
@@ -841,6 +841,7 @@
 {
 	Obj_Entry *root;
 
+	dbg(("dlclose of %p", handle));
 
 	_rtld_exclusive_enter();
 
@@ -885,6 +886,8 @@
 	bool nodelete;
 	bool now;
 
+	dbg(("dlopen of %s %d", name, mode));
+
 	_rtld_exclusive_enter();
 
 	flags |= (mode & RTLD_GLOBAL) ? _RTLD_GLOBAL : 0;
@@ -985,6 +988,8 @@
 	void *retaddr;
 	DoneList donelist; 
 
+	dbg(("dlsym of %s in %p", name, handle));
+
 	lookup_mutex_enter();
 
 	hash = _rtld_elf_hash(name);
@@ -1095,6 +1100,8 @@
 	void *symbol_addr;
 	unsigned long symoffset;
 
+	dbg(("dladdr of %p", addr));
+
 	lookup_mutex_enter();
 
 #ifdef __HAVE_FUNCTION_DESCRIPTORS
@@ -1163,6 +1170,8 @@
 	const Obj_Entry *obj;
 	void *retaddr;
 
+	dbg(("dlinfo for %p %d", handle, req));
+
 	_rtld_shared_enter();
 
 	if (handle == RTLD_SELF) {
@@ -1211,6 +1220,8 @@
 	const Obj_Entry *obj;
 	int error = 0;
 
+	dbg(("dl_iterate_phdr"));
+
 	_rtld_shared_enter();
 
 	for (obj = _rtld_objlist;  obj != NULL;  obj = obj->next) {



CVS commit: src/libexec/ld.elf_so

2011-03-27 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun Mar 27 13:14:42 UTC 2011

Modified Files:
src/libexec/ld.elf_so: rtld.c

Log Message:
Locking around dlclose()


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/libexec/ld.elf_so/rtld.c

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

Modified files:

Index: src/libexec/ld.elf_so/rtld.c
diff -u src/libexec/ld.elf_so/rtld.c:1.142 src/libexec/ld.elf_so/rtld.c:1.143
--- src/libexec/ld.elf_so/rtld.c:1.142	Sat Mar 26 21:40:37 2011
+++ src/libexec/ld.elf_so/rtld.c	Sun Mar 27 13:14:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld.c,v 1.142 2011/03/26 21:40:37 joerg Exp $	 */
+/*	$NetBSD: rtld.c,v 1.143 2011/03/27 13:14:42 joerg Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: rtld.c,v 1.142 2011/03/26 21:40:37 joerg Exp $");
+__RCSID("$NetBSD: rtld.c,v 1.143 2011/03/27 13:14:42 joerg Exp $");
 #endif /* not lint */
 
 #include 
@@ -839,10 +839,17 @@
 int
 dlclose(void *handle)
 {
-	Obj_Entry *root = _rtld_dlcheck(handle);
+	Obj_Entry *root;
 
-	if (root == NULL)
+
+	_rtld_exclusive_enter();
+
+	root = _rtld_dlcheck(handle);
+
+	if (root == NULL) {
+		_rtld_exclusive_exit();
 		return -1;
+	}
 
 	_rtld_debug.r_state = RT_DELETE;
 	_rtld_debug_state();
@@ -853,6 +860,8 @@
 	_rtld_debug.r_state = RT_CONSISTENT;
 	_rtld_debug_state();
 
+	_rtld_exclusive_enter();
+
 	return 0;
 }
 



CVS commit: src/lib/libutil

2011-03-27 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Sun Mar 27 12:53:17 UTC 2011

Modified Files:
src/lib/libutil: raise_default_signal.3

Log Message:
Fix sigprocmask section (3 -> 2).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libutil/raise_default_signal.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/libutil/raise_default_signal.3
diff -u src/lib/libutil/raise_default_signal.3:1.2 src/lib/libutil/raise_default_signal.3:1.3
--- src/lib/libutil/raise_default_signal.3:1.2	Wed Apr 30 13:10:52 2008
+++ src/lib/libutil/raise_default_signal.3	Sun Mar 27 12:53:16 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: raise_default_signal.3,v 1.2 2008/04/30 13:10:52 martin Exp $
+.\"	$NetBSD: raise_default_signal.3,v 1.3 2011/03/27 12:53:16 njoly Exp $
 .\"
 .\" Copyright (c) 2007 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -60,7 +60,7 @@
 .Bl -enum -offset indent
 .It
 Block all signals, using
-.Xr sigprocmask 3 .
+.Xr sigprocmask 2 .
 .It
 Set the signal handler for signal
 .Fa sig



CVS commit: src/lib/libarch/m68k

2011-03-27 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Sun Mar 27 12:48:41 UTC 2011

Modified Files:
src/lib/libarch/m68k: m68k_sync_icache.2

Log Message:
Fix xref, arm32_sync_icache -> arm_sync_icache.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libarch/m68k/m68k_sync_icache.2

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

Modified files:

Index: src/lib/libarch/m68k/m68k_sync_icache.2
diff -u src/lib/libarch/m68k/m68k_sync_icache.2:1.10 src/lib/libarch/m68k/m68k_sync_icache.2:1.11
--- src/lib/libarch/m68k/m68k_sync_icache.2:1.10	Wed Apr 30 13:10:50 2008
+++ src/lib/libarch/m68k/m68k_sync_icache.2	Sun Mar 27 12:48:41 2011
@@ -1,4 +1,4 @@
-.\" $NetBSD: m68k_sync_icache.2,v 1.10 2008/04/30 13:10:50 martin Exp $
+.\" $NetBSD: m68k_sync_icache.2,v 1.11 2011/03/27 12:48:41 njoly Exp $
 .\"
 .\" Copyright (c) 1999 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -57,7 +57,7 @@
 .Pp
 The call always succeeds.
 .Sh SEE ALSO
-.Xr arm32_sync_icache 2
+.Xr arm_sync_icache 2
 .Sh HISTORY
 .Fn m68k_sync_icache
 appeared first in



CVS commit: src/share/man/man4

2011-03-27 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Sun Mar 27 12:45:28 UTC 2011

Modified Files:
src/share/man/man4: radio.4

Log Message:
Adjust for mr(4) man page removal, switch to gtp(4) instead.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/share/man/man4/radio.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/radio.4
diff -u src/share/man/man4/radio.4:1.11 src/share/man/man4/radio.4:1.12
--- src/share/man/man4/radio.4:1.11	Mon Dec 26 19:48:12 2005
+++ src/share/man/man4/radio.4	Sun Mar 27 12:45:28 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: radio.4,v 1.11 2005/12/26 19:48:12 perry Exp $
+.\"	$NetBSD: radio.4,v 1.12 2011/03/27 12:45:28 njoly Exp $
 .\"	$RuOBSD: radio.4,v 1.4 2001/10/26 05:38:43 form Exp $
 .\"	$OpenBSD: radio.4,v 1.3 2001/12/05 10:58:54 mickey Exp $
 .\"
@@ -34,7 +34,7 @@
 .Sh SYNOPSIS
 .Cd "radio* at az?"
 .Cd "radio* at bktr?"
-.Cd "radio* at mr?"
+.Cd "radio* at gtp?"
 .Cd "radio* at rt?"
 .Cd "radio* at rtii?"
 .Cd "radio* at sf2r?"
@@ -160,7 +160,7 @@
 .Xr ioctl 2 ,
 .Xr az 4 ,
 .Xr bktr 4 ,
-.Xr mr 4 ,
+.Xr gtp 4 ,
 .Xr rt 4 ,
 .Xr rtii 4 ,
 .Xr sf2r 4 ,



CVS commit: src/lib/libc/gdtoa

2011-03-27 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sun Mar 27 11:21:55 UTC 2011

Modified Files:
src/lib/libc/gdtoa: strtod.c

Log Message:
Fix this so that it builds for vax; where the compiler balks at the
mixture of a union and a double in an expression (imagine that!)
I see other similar uses, and how they pass through for other ports
is beyond me, but I have not touched them in this round.

OK'ed by christos@


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/gdtoa/strtod.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/libc/gdtoa/strtod.c
diff -u src/lib/libc/gdtoa/strtod.c:1.7 src/lib/libc/gdtoa/strtod.c:1.8
--- src/lib/libc/gdtoa/strtod.c:1.7	Mon Mar 21 12:53:50 2011
+++ src/lib/libc/gdtoa/strtod.c	Sun Mar 27 11:21:54 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: strtod.c,v 1.7 2011/03/21 12:53:50 christos Exp $ */
+/* $NetBSD: strtod.c,v 1.8 2011/03/27 11:21:54 he Exp $ */
 
 /
 
@@ -1000,7 +1000,7 @@
 dval(&rv0) = dval(&rv);
 word0(&rv) += P*Exp_msk1;
 dval(&adj) = dval(&aadj1) * ulp(&rv);
-dval(&rv) += adj;
+dval(&rv) += dval(&adj);
 #ifdef IBM
 if ((word0(&rv) & Exp_mask) <  P*Exp_msk1)
 #else
@@ -1019,7 +1019,7 @@
 }
 			else {
 dval(&adj) = dval(&aadj1) * ulp(&rv);
-dval(&rv) += adj;
+dval(&rv) += dval(&adj);
 }
 #else /*Sudden_Underflow*/
 			/* Compute dval(&adj) so that the IEEE rounding rules will



CVS commit: src/tests/dev/scsipi

2011-03-27 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Mar 27 08:53:57 UTC 2011

Modified Files:
src/tests/dev/scsipi: t_cd.c

Log Message:
validate that getrawpartition() didn't fail.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/dev/scsipi/t_cd.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/dev/scsipi/t_cd.c
diff -u src/tests/dev/scsipi/t_cd.c:1.2 src/tests/dev/scsipi/t_cd.c:1.3
--- src/tests/dev/scsipi/t_cd.c:1.2	Sat Sep 11 16:03:41 2010
+++ src/tests/dev/scsipi/t_cd.c	Sun Mar 27 08:53:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_cd.c,v 1.2 2010/09/11 16:03:41 martin Exp $	*/
+/*	$NetBSD: t_cd.c,v 1.3 2011/03/27 08:53:56 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -50,9 +50,10 @@
 ATF_TC_BODY(noisyeject, tc)
 {
 	static char fname[] = "/dev/rcd0_";
-	int fd, arg = 0;
+	int part, fd, arg = 0;
 
-	fname[strlen(fname)-1] = 'a' + getrawpartition();
+	RL(part = getrawpartition());
+	fname[strlen(fname)-1] = 'a' + part;
 	rump_init();
 	RL(fd = rump_sys_open(fname, O_RDWR));
 	RL(rump_sys_ioctl(fd, DIOCEJECT, &arg));



CVS commit: src/sys/dev/acpi

2011-03-27 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Mar 27 08:52:25 UTC 2011

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

Log Message:
Use wireless function key to toggle not only bluetooth but also
telephony (GPRS/UMTS/..) like other operating systems.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/acpi/thinkpad_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/thinkpad_acpi.c
diff -u src/sys/dev/acpi/thinkpad_acpi.c:1.34 src/sys/dev/acpi/thinkpad_acpi.c:1.35
--- src/sys/dev/acpi/thinkpad_acpi.c:1.34	Wed Feb 16 08:35:51 2011
+++ src/sys/dev/acpi/thinkpad_acpi.c	Sun Mar 27 08:52:25 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: thinkpad_acpi.c,v 1.34 2011/02/16 08:35:51 jruoho Exp $ */
+/* $NetBSD: thinkpad_acpi.c,v 1.35 2011/03/27 08:52:25 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.34 2011/02/16 08:35:51 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.35 2011/03/27 08:52:25 mlelstv Exp $");
 
 #include 
 #include 
@@ -582,6 +582,7 @@
 {
 	/* Ignore return value, as the hardware may not support bluetooth */
 	(void)AcpiEvaluateObject(sc->sc_node->ad_handle, "BTGL", NULL, NULL);
+	(void)AcpiEvaluateObject(sc->sc_node->ad_handle, "GWAN", NULL, NULL);
 }
 
 static uint8_t



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/powerpc

2011-03-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Mar 27 08:47:10 UTC 2011

Modified Files:
src/sys/arch/powerpc/powerpc [matt-nb5-pq3]: trap_subr.S

Log Message:
Don't store the new idepth into the trapframe, use the idepth at the start
of the interrupt.


To generate a diff of this commit:
cvs rdiff -u -r1.65.16.4 -r1.65.16.5 src/sys/arch/powerpc/powerpc/trap_subr.S

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

Modified files:

Index: src/sys/arch/powerpc/powerpc/trap_subr.S
diff -u src/sys/arch/powerpc/powerpc/trap_subr.S:1.65.16.4 src/sys/arch/powerpc/powerpc/trap_subr.S:1.65.16.5
--- src/sys/arch/powerpc/powerpc/trap_subr.S:1.65.16.4	Fri Jan 28 04:37:25 2011
+++ src/sys/arch/powerpc/powerpc/trap_subr.S	Sun Mar 27 08:47:10 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap_subr.S,v 1.65.16.4 2011/01/28 04:37:25 matt Exp $	*/
+/*	$NetBSD: trap_subr.S,v 1.65.16.5 2011/03/27 08:47:10 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -1110,8 +1110,8 @@
 	ldreg	%r11,(savearea+CPUSAVE_SRR0)(%r2); /* get saved SRR0 */	\
 	ldreg	%r12,(savearea+CPUSAVE_SRR1)(%r2); /* get saved SRR1 */	\
 	ldint	%r3,CI_IDEPTH(%r2);	\
-	addi	%r3,%r3,1;		\
-	stint	%r3,CI_IDEPTH(%r2);	\
+	addi	%r4,%r3,1;		\
+	stint	%r4,CI_IDEPTH(%r2);	\
 	stint	%r3,FRAME_IDEPTH(%r1);	\
 	mfxer	%r3;			\
 	mfctr	%r4;			\



CVS commit: src/sys/external/bsd/drm

2011-03-27 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Mar 27 08:45:12 UTC 2011

Modified Files:
src/sys/external/bsd/drm/conf: files.drm
src/sys/external/bsd/drm/dist/shared-core: radeon_cp.c

Log Message:
Make code compile when the kernel has no support for AGP. For now this also
rules out PCIE support without AGP because all the code is drm_agpsupport.c


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm/conf/files.drm
cvs rdiff -u -r1.9 -r1.10 \
src/sys/external/bsd/drm/dist/shared-core/radeon_cp.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/external/bsd/drm/conf/files.drm
diff -u src/sys/external/bsd/drm/conf/files.drm:1.6 src/sys/external/bsd/drm/conf/files.drm:1.7
--- src/sys/external/bsd/drm/conf/files.drm:1.6	Fri Feb 18 14:26:09 2011
+++ src/sys/external/bsd/drm/conf/files.drm	Sun Mar 27 08:45:11 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.drm,v 1.6 2011/02/18 14:26:09 jmcneill Exp $
+#	$NetBSD: files.drm,v 1.7 2011/03/27 08:45:11 mlelstv Exp $
 
 # direct rendering modules
 define	drmbase
@@ -8,7 +8,7 @@
 
 makeoptions	drmbase		CPPFLAGS+="-I$S/external/bsd/drm/dist/bsd-core -I$S/external/bsd/drm/dist/shared-core"
 
-file	external/bsd/drm/dist/bsd-core/drm_agpsupport.c		drmbase
+file	external/bsd/drm/dist/bsd-core/drm_agpsupport.c		drmbase & agp
 file	external/bsd/drm/dist/bsd-core/drm_auth.c		drmbase
 file	external/bsd/drm/dist/bsd-core/drm_bufs.c		drmbase
 file	external/bsd/drm/dist/bsd-core/drm_context.c		drmbase

Index: src/sys/external/bsd/drm/dist/shared-core/radeon_cp.c
diff -u src/sys/external/bsd/drm/dist/shared-core/radeon_cp.c:1.9 src/sys/external/bsd/drm/dist/shared-core/radeon_cp.c:1.10
--- src/sys/external/bsd/drm/dist/shared-core/radeon_cp.c:1.9	Sat Nov  6 22:06:10 2010
+++ src/sys/external/bsd/drm/dist/shared-core/radeon_cp.c	Sun Mar 27 08:45:11 2011
@@ -2006,11 +2006,13 @@
 	}
 
 	dev_priv->chip_family = flags & RADEON_FAMILY_MASK;
+#if !defined(__NetBSD__) || NAGP > 0
 	if (drm_device_is_agp(dev))
 		dev_priv->flags |= RADEON_IS_AGP;
 	else if (drm_device_is_pcie(dev))
 		dev_priv->flags |= RADEON_IS_PCIE;
 	else
+#endif
 		dev_priv->flags |= RADEON_IS_PCI;
 
 	ret = drm_vblank_init(dev, 2);



CVS commit: src/sys/ufs/ffs

2011-03-27 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Mar 27 08:04:50 UTC 2011

Modified Files:
src/sys/ufs/ffs: ffs_vfsops.c

Log Message:
Don't abort when APPLE_UFS autodetection cannot read the apple ufs label
due to sector size or alignment problems. Autodetection is only a safety
measure, you should mark the filesystem type in the BSD disklabel.


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

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

Modified files:

Index: src/sys/ufs/ffs/ffs_vfsops.c
diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.264 src/sys/ufs/ffs/ffs_vfsops.c:1.265
--- src/sys/ufs/ffs/ffs_vfsops.c:1.264	Sun Mar  6 17:08:38 2011
+++ src/sys/ufs/ffs/ffs_vfsops.c	Sun Mar 27 08:04:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_vfsops.c,v 1.264 2011/03/06 17:08:38 bouyer Exp $	*/
+/*	$NetBSD: ffs_vfsops.c,v 1.265 2011/03/27 08:04:50 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.264 2011/03/06 17:08:38 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.265 2011/03/27 08:04:50 mlelstv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -678,17 +678,22 @@
 	else {
 		/* Manually look for an apple ufs label, and if a valid one
 		 * is found, then treat it like an Apple UFS filesystem anyway
+		 *
+		 * EINVAL is most probably a blocksize or alignment problem,
+		 * it is unlikely that this is an Apple UFS filesystem then.
 		 */
 		error = bread(devvp, (daddr_t)(APPLEUFS_LABEL_OFFSET / DEV_BSIZE),
 			APPLEUFS_LABEL_SIZE, cred, 0, &bp);
-		if (error) {
+		if (error && error != EINVAL) {
 			brelse(bp, 0);
 			return (error);
 		}
-		error = ffs_appleufs_validate(fs->fs_fsmnt,
-			(struct appleufslabel *)bp->b_data, NULL);
-		if (error == 0)
-			ump->um_flags |= UFS_ISAPPLEUFS;
+		if (error == 0) {
+			error = ffs_appleufs_validate(fs->fs_fsmnt,
+(struct appleufslabel *)bp->b_data, NULL);
+			if (error == 0)
+ump->um_flags |= UFS_ISAPPLEUFS;
+		}
 		brelse(bp, 0);
 		bp = NULL;
 	}