CVS commit: src/lib/libm

2011-04-12 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Apr 12 07:29:50 UTC 2011

Modified Files:
src/lib/libm: Makefile
src/lib/libm/man: ieee.3
Added Files:
src/lib/libm/man: nextafter.3

Log Message:
Split the nextafter(3) family of functions to their own page and properly
document these.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/lib/libm/Makefile
cvs rdiff -u -r1.22 -r1.23 src/lib/libm/man/ieee.3
cvs rdiff -u -r0 -r1.1 src/lib/libm/man/nextafter.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/libm/Makefile
diff -u src/lib/libm/Makefile:1.104 src/lib/libm/Makefile:1.105
--- src/lib/libm/Makefile:1.104	Sun Feb  6 00:44:09 2011
+++ src/lib/libm/Makefile	Tue Apr 12 07:29:50 2011
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.104 2011/02/06 00:44:09 christos Exp $
+#  $NetBSD: Makefile,v 1.105 2011/04/12 07:29:50 jruoho Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -203,7 +203,7 @@
 MAN+=	acos.3 acosh.3 asin.3 asinh.3 atan.3 atan2.3 atanh.3 ceil.3 \
 	cos.3 cosh.3 erf.3 exp.3 fabs.3 floor.3 fmod.3 frexp.3 hypot.3 ieee.3 \
 	ieee_test.3 isinff.3 j0.3 ldexp.3 lgamma.3 lrint.3 \
-	math.3 modf.3 rint.3 round.3 sin.3 sinh.3 \
+	math.3 modf.3 nextafter.3 rint.3 round.3 sin.3 sinh.3 \
 	sqrt.3 tan.3 tanh.3 trunc.3 fmax.3 fdim.3
 
 # fenv.h interface
@@ -244,8 +244,6 @@
 MLINKS+=ieee.3 copysign.3 ieee.3 copysignf.3 ieee.3 copysignl.3 	\
 	ieee.3 finite.3 ieee.3 finitef.3 \
 	ieee.3 ilogb.3 ieee.3 ilogbf.3	\
-	ieee.3 nextafter.3 ieee.3 nextafterf.3 ieee.3 nextafterl.3	\
-	ieee.3 nexttoward.3		\
 	ieee.3 remainder.3 ieee.3 remainderf.3 \
 	ieee.3 remquo.3 ieee.3 remquof.3\
 	ieee.3 scalbn.3 ieee.3 scalbnf.3
@@ -258,6 +256,9 @@
 MLINKS+=lgamma.3 lgammaf.3 lgamma.3 lgamma_r.3 lgamma.3 lgammaf_r.3 \
 	lgamma.3 gamma.3 lgamma.3 gammaf.3 lgamma.3 gamma_r.3 \
 	lgamma.3 gammaf_r.3
+MLINKS+=nextafter.3 nextafterf.3 \
+	nextafter.3 nextafterl.3 \
+	nextafter.3 nexttoward.3
 MLINKS+=lrint.3 lrintf.3 lrint.3 llrint.3 lrint.3 llrintf.3
 MLINKS+=rint.3 rintf.3
 MLINKS+=sin.3 sinf.3

Index: src/lib/libm/man/ieee.3
diff -u src/lib/libm/man/ieee.3:1.22 src/lib/libm/man/ieee.3:1.23
--- src/lib/libm/man/ieee.3:1.22	Sun Feb  6 00:44:10 2011
+++ src/lib/libm/man/ieee.3	Tue Apr 12 07:29:50 2011
@@ -26,9 +26,9 @@
 .\ SUCH DAMAGE.
 .\
 .\ from: @(#)ieee.3	6.4 (Berkeley) 5/6/91
-.\	$NetBSD: ieee.3,v 1.22 2011/02/06 00:44:10 christos Exp $
+.\	$NetBSD: ieee.3,v 1.23 2011/04/12 07:29:50 jruoho Exp $
 .\
-.Dd February 25, 1994
+.Dd April 12, 2011
 .Dt IEEE 3
 .Os
 .Sh NAME
@@ -39,10 +39,6 @@
 .Nm finitef ,
 .Nm ilogb ,
 .Nm ilogbf ,
-.Nm nextafter ,
-.Nm nextafterf ,
-.Nm nextafterl ,
-.Nm nexttoward ,
 .Nm remainder ,
 .Nm remainderf ,
 .Nm scalbn ,
@@ -67,14 +63,6 @@
 .Ft int
 .Fn ilogbf float x
 .Ft double
-.Fn nextafter double x double y
-.Ft float
-.Fn nextafterf float x float y
-.Ft long double
-.Fn nextafterl long double x long double y
-.Ft double
-.Fn nexttoward double x long double y
-.Ft double
 .Fn remainder double x double y
 .Ft float
 .Fn remainderf float x float y
@@ -122,24 +110,6 @@
 returns
 .Dv INT_MIN .
 .Pp
-.Fn nextafter
-returns the next machine representable number from
-.Fa x
-in direction
-.Fa y .
-.Pp
-.Fn nexttoward
-is equivalent to
-.Fn nextafter ,
-except that the second parameter has type
-.Ft long double
-and the function returns
-.Dv y
-converted to the type of the function if
-.Dv x
-equals
-.Dv y .
-.Pp
 .Fn remainder
 returns the remainder
 .Fa r
@@ -199,7 +169,8 @@
 .Fa x Ns \(**(2** Ns Fa n )
 computed by exponent manipulation.
 .Sh SEE ALSO
-.Xr math 3
+.Xr math 3 ,
+.Xr nextafter 3
 .Sh STANDARDS
 .St -ieee754
 .Sh HISTORY

Added files:

Index: src/lib/libm/man/nextafter.3
diff -u /dev/null src/lib/libm/man/nextafter.3:1.1
--- /dev/null	Tue Apr 12 07:29:50 2011
+++ src/lib/libm/man/nextafter.3	Tue Apr 12 07:29:50 2011
@@ -0,0 +1,148 @@
+.\ $NetBSD: nextafter.3,v 1.1 2011/04/12 07:29:50 jruoho Exp $
+.\
+.\ Copyright (c) 2011 Jukka Ruohonen jruoho...@iki.fi
+.\ All rights reserved.
+.\
+.\ Redistribution and use in source and binary forms, with or without
+.\ modification, are permitted provided that the following conditions
+.\ are met:
+.\ 1. Redistributions of source code must retain the above copyright
+.\notice, this list of conditions and the following disclaimer.
+.\ 2. Redistributions in binary form must reproduce the above copyright
+.\notice, this list of conditions and the following disclaimer in the
+.\documentation and/or other materials provided with the distribution.
+.\
+.\ THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\ BE LIABLE FOR 

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

2011-04-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Apr 12 07:54:16 UTC 2011

Modified Files:
src/sys/arch/sparc/include: frame.h

Log Message:
make sparc/frame.h idempotent.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sparc/include/frame.h

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

Modified files:

Index: src/sys/arch/sparc/include/frame.h
diff -u src/sys/arch/sparc/include/frame.h:1.7 src/sys/arch/sparc/include/frame.h:1.8
--- src/sys/arch/sparc/include/frame.h:1.7	Sat Mar  4 02:56:21 2006
+++ src/sys/arch/sparc/include/frame.h	Tue Apr 12 07:54:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.7 2006/03/04 02:56:21 uwe Exp $ */
+/*	$NetBSD: frame.h,v 1.8 2011/04/12 07:54:16 mrg Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -40,6 +40,9 @@
  *	@(#)frame.h	8.1 (Berkeley) 6/11/93
  */
 
+#ifndef _SPARC_FRAME_H_
+#define _SPARC_FRAME_H_
+
 #if defined(_KERNEL_OPT)
 #include opt_sparc_arch.h
 #endif
@@ -132,3 +135,4 @@
  */
 #define BIAS	(2048-1)
 
+#endif /* _SPARC_FRAME_H_ */



CVS commit: src

2011-04-12 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Apr 12 08:22:49 UTC 2011

Modified Files:
src/distrib/sets/lists/comp: mi
src/share/man/man3: Makefile
Added Files:
src/share/man/man3: tm.3

Log Message:
Add a small summary parge for struct tm from time.h. Cf. timeval(3).


To generate a diff of this commit:
cvs rdiff -u -r1.1613 -r1.1614 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.74 -r1.75 src/share/man/man3/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man3/tm.3

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1613 src/distrib/sets/lists/comp/mi:1.1614
--- src/distrib/sets/lists/comp/mi:1.1613	Sun Apr 10 09:58:00 2011
+++ src/distrib/sets/lists/comp/mi	Tue Apr 12 08:22:48 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1613 2011/04/10 09:58:00 jruoho Exp $
+#	$NetBSD: mi,v 1.1614 2011/04/12 08:22:48 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -8596,6 +8596,7 @@
 ./usr/share/man/cat3/timespecsub.0		comp-c-catman		.cat
 ./usr/share/man/cat3/timeval.0			comp-c-catman		.cat
 ./usr/share/man/cat3/timezone.0			comp-c-catman		.cat
+./usr/share/man/cat3/tm.0			comp-c-catman		.cat
 ./usr/share/man/cat3/tmpfile.0			comp-c-catman		.cat
 ./usr/share/man/cat3/tmpnam.0			comp-c-catman		.cat
 ./usr/share/man/cat3/toascii.0			comp-c-catman		.cat
@@ -14603,6 +14604,7 @@
 ./usr/share/man/html3/timespecsub.html		comp-c-htmlman		html
 ./usr/share/man/html3/timeval.html		comp-c-htmlman		html
 ./usr/share/man/html3/timezone.html		comp-c-htmlman		html
+./usr/share/man/html3/tm.html			comp-c-htmlman		html
 ./usr/share/man/html3/tmpfile.html		comp-c-htmlman		html
 ./usr/share/man/html3/tmpnam.html		comp-c-htmlman		html
 ./usr/share/man/html3/toascii.html		comp-c-htmlman		html
@@ -20678,6 +20680,7 @@
 ./usr/share/man/man3/timespecsub.3		comp-c-man		.man
 ./usr/share/man/man3/timeval.3			comp-c-man		.man
 ./usr/share/man/man3/timezone.3			comp-c-man		.man
+./usr/share/man/man3/tm.3			comp-c-man		.man
 ./usr/share/man/man3/tmpfile.3			comp-c-man		.man
 ./usr/share/man/man3/tmpnam.3			comp-c-man		.man
 ./usr/share/man/man3/toascii.3			comp-c-man		.man

Index: src/share/man/man3/Makefile
diff -u src/share/man/man3/Makefile:1.74 src/share/man/man3/Makefile:1.75
--- src/share/man/man3/Makefile:1.74	Sun Apr 10 09:58:01 2011
+++ src/share/man/man3/Makefile	Tue Apr 12 08:22:49 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.74 2011/04/10 09:58:01 jruoho Exp $
+#	$NetBSD: Makefile,v 1.75 2011/04/12 08:22:49 jruoho Exp $
 #	@(#)Makefile	8.2 (Berkeley) 12/13/93
 
 MAN=	_DIAGASSERT.3 __CONCAT.3 __UNCONST.3 CMSG_DATA.3 \
@@ -12,7 +12,7 @@
 	ilog2.3 intro.3 inttypes.3 iso646.3 \
 	makedev.3 offsetof.3 param.3 paths.3 queue.3 rbtree.3 sigevent.3 \
 	stdarg.3 stdbool.3 stddef.3 stdint.3 stdlib.3 sysexits.3 \
-	tgmath.3 timeradd.3 timeval.3 tree.3 typeof.3 types.3 \
+	tgmath.3 timeradd.3 timeval.3 tm.3 tree.3 typeof.3 types.3 \
 	unistd.3 varargs.3
 
 USETBL=	# used by queue.3

Added files:

Index: src/share/man/man3/tm.3
diff -u /dev/null src/share/man/man3/tm.3:1.1
--- /dev/null	Tue Apr 12 08:22:49 2011
+++ src/share/man/man3/tm.3	Tue Apr 12 08:22:49 2011
@@ -0,0 +1,91 @@
+.\ $NetBSD: tm.3,v 1.1 2011/04/12 08:22:49 jruoho Exp $
+.\
+.\ Copyright (c) 2011 Jukka Ruohonen jruoho...@iki.fi
+.\ All rights reserved.
+.\
+.\ Redistribution and use in source and binary forms, with or without
+.\ modification, are permitted provided that the following conditions
+.\ are met:
+.\ 1. Redistributions of source code must retain the above copyright
+.\notice, this list of conditions and the following disclaimer.
+.\ 2. Redistributions in binary form must reproduce the above copyright
+.\notice, this list of conditions and the following disclaimer in the
+.\documentation and/or other materials provided with the distribution.
+.\
+.\ THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\ POSSIBILITY OF SUCH DAMAGE.
+.\
+.Dd April 12, 2011
+.Dt TM 3
+.Os
+.Sh NAME
+.Nm tm
+.Nd time structure
+.Sh SYNOPSIS
+.In time.h
+.Sh DESCRIPTION
+The
+.In time.h
+header defines the following structure:
+.Bd -literal 

CVS commit: src

2011-04-12 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Apr 12 08:39:26 UTC 2011

Modified Files:
src/lib/libc/time: ctime.3
src/share/man/man3: timeval.3 tm.3

Log Message:
Move some of the discussion from the messy ctime(3) to tm(3).


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/lib/libc/time/ctime.3
cvs rdiff -u -r1.11 -r1.12 src/share/man/man3/timeval.3
cvs rdiff -u -r1.1 -r1.2 src/share/man/man3/tm.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/time/ctime.3
diff -u src/lib/libc/time/ctime.3:1.38 src/lib/libc/time/ctime.3:1.39
--- src/lib/libc/time/ctime.3:1.38	Mon Jan 24 19:37:35 2011
+++ src/lib/libc/time/ctime.3	Tue Apr 12 08:39:26 2011
@@ -1,5 +1,8 @@
-.\ $NetBSD: ctime.3,v 1.38 2011/01/24 19:37:35 njoly Exp $
-.Dd December 14, 2010
+.\ $NetBSD: ctime.3,v 1.39 2011/04/12 08:39:26 jruoho Exp $
+.\
+.\ XXX: Lincense missing?
+.\
+.Dd April 12, 2011
 .Dt CTIME 3
 .Os
 .Sh NAME
@@ -103,7 +106,8 @@
 (such as Daylight Saving Time in the U.S.A.).
 After filling in the
 .Va tm
-structure,
+structure described in
+.Xr tm 3 ,
 .Fn localtime
 sets the
 .Fa tm_isdst Ns 'th
@@ -250,52 +254,6 @@
 .Fa tz
 argument previously returned by
 .Fa tzalloc .
-.Pp
-The structure (of type)
-.Va struct tm
-includes the following fields:
-.Bd -literal -offset indent
-int tm_sec;	/* seconds after the minute [0,61] */
-int tm_min;	/* minutes after the hour [0,59] */
-int tm_hour;	/* hours since midnight [0,23] */
-int tm_mday;	/* day of the month [1,31] */
-int tm_mon;	/* months since January [0,11] */
-int tm_year;	/* years since 1900 */
-int tm_wday;	/* day of week [0,6] (Sunday = 0) */
-int tm_yday;	/* day of year [0,365] (Jan 1 = 0) */
-int tm_isdst;	/* daylight savings flag */
-long tm_gmtoff;	/* offset from UTC in seconds */
-char *tm_zone;	/* abbreviation of timezone name */
-.Ed
-.Pp
-The
-.Fa tm_zone
-and
-.Fa tm_gmtoff
-fields exist, and are filled in, only if arrangements to do
-so were made when the library containing these functions was
-created.
-There is no guarantee that these fields will continue to exist
-in this form in future releases of this code.
-The
-.Fa tm_zone
-field will become invalid and point to freed storage if the corresponding
-.Va struct tm
-was returned by
-.Fn localtime_rz
-and the
-.Ft const timezone_t
-.Fa tz
-argument has been freed by
-.Fn tzfree .
-.Pp
-.Fa tm_isdst
-is non-zero if summer time is in effect.
-.Pp
-.Fa tm_gmtoff
-is the offset (in seconds) of the time represented
-from UTC, with positive values indicating east
-of the Prime Meridian.
 .Sh RETURN VALUES
 On success the
 .Fn asctime
@@ -401,6 +359,7 @@
 .Xr getenv 3 ,
 .Xr strftime 3 ,
 .Xr time 3 ,
+.Xr tm 3 ,
 .Xr tzset 3 ,
 .Xr tzfile 5
 .Sh STANDARDS

Index: src/share/man/man3/timeval.3
diff -u src/share/man/man3/timeval.3:1.11 src/share/man/man3/timeval.3:1.12
--- src/share/man/man3/timeval.3:1.11	Tue Jun  8 05:50:01 2010
+++ src/share/man/man3/timeval.3	Tue Apr 12 08:39:26 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: timeval.3,v 1.11 2010/06/08 05:50:01 jruoho Exp $
+.\ $NetBSD: timeval.3,v 1.12 2011/04/12 08:39:26 jruoho Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd June 8, 2010
+.Dd April 12, 2011
 .Dt TIMEVAL 3
 .Os
 .Sh NAME
@@ -185,4 +185,5 @@
 .Xr clock_gettime 2 .
 .Sh SEE ALSO
 .Xr timeradd 3 ,
+.Xr tm 3 ,
 .Xr bintime_add 9

Index: src/share/man/man3/tm.3
diff -u src/share/man/man3/tm.3:1.1 src/share/man/man3/tm.3:1.2
--- src/share/man/man3/tm.3:1.1	Tue Apr 12 08:22:49 2011
+++ src/share/man/man3/tm.3	Tue Apr 12 08:39:26 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: tm.3,v 1.1 2011/04/12 08:22:49 jruoho Exp $
+.\ $NetBSD: tm.3,v 1.2 2011/04/12 08:39:26 jruoho Exp $
 .\
 .\ Copyright (c) 2011 Jukka Ruohonen jruoho...@iki.fi
 .\ All rights reserved.
@@ -82,6 +82,34 @@
 .Va tm_zone
 are defined in
 .St -p1003.1-2008 .
+.Ss NetBSD Extensions
+The
+.Va tm_zone
+and
+.Va tm_gmtoff
+fields exist, and are filled in by applicable library routines,
+only if arrangements to do so were made when the library containing
+these functions was created.
+There is no guarantee that these fields will continue to exist
+in this form in future releases of
+. Nx .
+.Pp
+The
+.Fa tm_gmtoff
+field denotes the offset (in seconds) of the time represented
+from UTC, with positive values indicating east
+of the Prime Meridian.
+The
+.Vt tm_zone
+field will become invalid and point to freed storage if the corresponding
+.Va struct tm
+was returned by
+.Xr localtime_rz 3
+and the
+.Ft const timezone_t
+.Fa tz
+argument has been freed by
+.Xr tzfree 3 .
 .Sh SEE ALSO
 .Xr timeval 3
 .Sh STANDARDS



CVS commit: src/lib/libc/time

2011-04-12 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Apr 12 08:40:34 UTC 2011

Modified Files:
src/lib/libc/time: strptime.3

Log Message:
Xref tm(3).


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/lib/libc/time/strptime.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/time/strptime.3
diff -u src/lib/libc/time/strptime.3:1.28 src/lib/libc/time/strptime.3:1.29
--- src/lib/libc/time/strptime.3:1.28	Tue Apr 12 05:41:22 2011
+++ src/lib/libc/time/strptime.3	Tue Apr 12 08:40:34 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: strptime.3,v 1.28 2011/04/12 05:41:22 jruoho Exp $
+.\	$NetBSD: strptime.3,v 1.29 2011/04/12 08:40:34 jruoho Exp $
 .\
 .\ Copyright (c) 1997, 1998, 2008 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -323,7 +323,8 @@
 .Xr ctime 3 ,
 .Xr isspace 3 ,
 .Xr localtime 3 ,
-.Xr strftime 3
+.Xr strftime 3 ,
+.Xr tm 3
 .Sh STANDARDS
 The
 .Fn strptime



CVS commit: src/sys/ddb

2011-04-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Apr 12 08:42:12 UTC 2011

Modified Files:
src/sys/ddb: db_lwp.c db_print.c

Log Message:
include sys/cpu.h when using cpu specific info.  fixes building
these as part of sparc64 crash(8).


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/ddb/db_lwp.c
cvs rdiff -u -r1.27 -r1.28 src/sys/ddb/db_print.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/ddb/db_lwp.c
diff -u src/sys/ddb/db_lwp.c:1.6 src/sys/ddb/db_lwp.c:1.7
--- src/sys/ddb/db_lwp.c:1.6	Fri Jan 14 02:06:33 2011
+++ src/sys/ddb/db_lwp.c	Tue Apr 12 08:42:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_lwp.c,v 1.6 2011/01/14 02:06:33 rmind Exp $	*/
+/*	$NetBSD: db_lwp.c,v 1.7 2011/04/12 08:42:12 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_lwp.c,v 1.6 2011/01/14 02:06:33 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_lwp.c,v 1.7 2011/04/12 08:42:12 mrg Exp $);
 
 #ifndef _KERNEL
 #include stdbool.h
@@ -39,6 +39,7 @@
 #include sys/param.h
 #include sys/cpu.h
 #include sys/proc.h
+#include sys/cpu.h
 
 #include machine/pcb.h
 

Index: src/sys/ddb/db_print.c
diff -u src/sys/ddb/db_print.c:1.27 src/sys/ddb/db_print.c:1.28
--- src/sys/ddb/db_print.c:1.27	Sat Mar  7 22:02:17 2009
+++ src/sys/ddb/db_print.c	Tue Apr 12 08:42:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_print.c,v 1.27 2009/03/07 22:02:17 ad Exp $	*/
+/*	$NetBSD: db_print.c,v 1.28 2011/04/12 08:42:12 mrg Exp $	*/
 
 /*
  * Mach Operating System
@@ -34,10 +34,11 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_print.c,v 1.27 2009/03/07 22:02:17 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_print.c,v 1.28 2011/04/12 08:42:12 mrg Exp $);
 
 #include sys/param.h
 #include sys/proc.h
+#include sys/cpu.h
 
 #include ddb/ddb.h
 



CVS commit: src/lib/libc/time

2011-04-12 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Apr 12 13:46:39 UTC 2011

Modified Files:
src/lib/libc/time: ctime.3

Log Message:
Split out FUNCTIONS to make this tolerable to read. Also improve readability
with lists. Describe the functions in the order of appearance in SYNOPSIS.
Use CAVEATS instead of NOTES. Remove man page spam. Etc.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/lib/libc/time/ctime.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/time/ctime.3
diff -u src/lib/libc/time/ctime.3:1.39 src/lib/libc/time/ctime.3:1.40
--- src/lib/libc/time/ctime.3:1.39	Tue Apr 12 08:39:26 2011
+++ src/lib/libc/time/ctime.3	Tue Apr 12 13:46:38 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: ctime.3,v 1.39 2011/04/12 08:39:26 jruoho Exp $
+.\ $NetBSD: ctime.3,v 1.40 2011/04/12 13:46:38 jruoho Exp $
 .\
 .\ XXX: Lincense missing?
 .\
@@ -29,6 +29,10 @@
 .In time.h
 .Vt extern char *tzname[2];
 .Ft char *
+.Fn asctime const struct tm *tm
+.Ft char *
+.Fn asctime_r const struct tm restrict tm char * restrict buf
+.Ft char *
 .Fn ctime const time_t *clock
 .Ft char *
 .Fn ctime_r const time_t *clock  char *buf
@@ -36,131 +40,169 @@
 .Fn ctime_rz const timezone_t tz const time_t *clock  char *buf
 .Ft double
 .Fn difftime time_t time1 time_t time0
-.Ft char *
-.Fn asctime const struct tm *tm
-.Ft char *
-.Fn asctime_r const struct tm restrict tm char * restrict buf
+.Ft struct tm *
+.Fn gmtime const time_t *clock
+.Ft struct tm *
+.Fn gmtime_r const time_t * restrict clock struct tm * restrict result
 .Ft struct tm *
 .Fn localtime const time_t *clock
 .Ft struct tm *
 .Fn localtime_r const time_t * restrict clock struct tm * restrict result
 .Ft struct tm *
 .Fn localtime_rz const timezone_t tz const time_t * restrict clock struct tm * restrict result
-.Ft struct tm *
-.Fn gmtime const time_t *clock
-.Ft struct tm *
-.Fn gmtime_r const time_t * restrict clock struct tm * restrict result
 .Ft time_t
 .Fn mktime struct tm *tm
 .Ft time_t
 .Fn mktime_z const timezone_t tz struct tm *tm
 .Ft timezone_t
 .Fn tzalloc const char *zone
-.Ft const char *
-.Fn tzgetname const timezone_t tz int isdst
 .Ft void
 .Fn tzfree const timezone_t tz
+.Ft const char *
+.Fn tzgetname const timezone_t tz int isdst
 .Sh DESCRIPTION
+The
+.Nm
+family of functions provide various standard library routines
+to operate with time and conversions related to time.
+.Sh FUNCTIONS
+.Bl -tag -width abcd
+.It Fn asctime tm
+The
+.Fn asctime
+function converts a time value contained in the
+.Fa tm
+structure to a string with the following general format:
+.Bd -literal -offset indent
+.D1 Thu Nov 24 18:22:48 1986\en\e0
+.Ed
+.Pp
+The
+.Fa tm
+structure is described in
+.Xr tm 3 .
+.It Fn asctime_r tm buf
+The
+.Fn asctime_r
+has the same behavior as
+.Fn asctime ,
+but the result is stored to
+.Fa buf ,
+which should have a size of at least 26 bytes.
+.It Fn ctime clock
+The
 .Fn ctime
-converts a
+function converts a
 .Vt time_t ,
 pointed to by
 .Fa clock ,
-representing the time in seconds since
-00:00:00 UTC, 1970-01-01,
-and returns a pointer to a
-string of the form
-.D1 Thu Nov 24 18:22:48 1986\en\e0
+representing the time in seconds since 00:00:00 UTC, 1970-01-01,
+and returns a pointer to a string with the format described above.
 Years requiring fewer than four characters are padded with leading zeroes.
 For years longer than four characters, the string is of the form
+.Bd -literal -offset indent
 .D1 Thu Nov 24 18:22:48 81986\en\e0
+.Ed
+.Pp
 with five spaces before the year.
 These unusual formats are designed to make it less likely that older
 software that expects exactly 26 bytes of output will mistakenly output
 misleading values for out-of-range years.
-.Pp
+.It Fn ctime_r clock buf
+The
 .Fn ctime_r
 is similar to
 .Fn ctime ,
 except it places the result of the conversion on the
 .Fa buf
-argument which should be 26 or more bytes long, instead of using a global
-static buffer.
-.Pp
+argument, which should be 26 or more bytes long,
+instead of using a global static buffer.
+.It Fn ctime_rz tz clock buf
+The
 .Fn ctime_rz
-is similar to
+function is similar to
 .Fn ctime_r ,
 but it also takes a
 .Ft const timezone_t
-argument, returned by a previous call to
+argument, as returned by a previous call to
 .Fn tzalloc .
-.Pp
-.Fn localtime
-and
+.It Fn difftime time1 time2
+The
+.Fn difftime
+function returns the difference between two calendar times,
+.Fa ( time1 No - Fa time0 ) ,
+expressed in seconds.
+.It Fn gmtime clock
+The
 .Fn gmtime
-return pointers to
+function converts to Coordinated Universal Time
+.Pq Tn UTC
+and returns a pointer to the
 .Va tm
-structures, described below.
+structure described in
+.Xr tm 3 .
+.It Fn gmtime_r clock result
+The
+.Fn gmtime_r
+provides the same functionality as
+.Fn gmtime ,
+differing in that the caller must supply a buffer area
+.Fa result
+to which the 

CVS commit: src/share/man/man3

2011-04-12 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Apr 12 13:48:29 UTC 2011

Modified Files:
src/share/man/man3: tm.3

Log Message:
Put asctime(3) explicitly to SEE ALSO.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man3/tm.3

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/man3/tm.3
diff -u src/share/man/man3/tm.3:1.2 src/share/man/man3/tm.3:1.3
--- src/share/man/man3/tm.3:1.2	Tue Apr 12 08:39:26 2011
+++ src/share/man/man3/tm.3	Tue Apr 12 13:48:29 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: tm.3,v 1.2 2011/04/12 08:39:26 jruoho Exp $
+.\ $NetBSD: tm.3,v 1.3 2011/04/12 13:48:29 jruoho Exp $
 .\
 .\ Copyright (c) 2011 Jukka Ruohonen jruoho...@iki.fi
 .\ All rights reserved.
@@ -111,6 +111,7 @@
 argument has been freed by
 .Xr tzfree 3 .
 .Sh SEE ALSO
+.Xr asctime 3 ,
 .Xr timeval 3
 .Sh STANDARDS
 The



CVS commit: src/sys/arch/x68k/stand

2011-04-12 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Apr 12 14:07:35 UTC 2011

Modified Files:
src/sys/arch/x68k/stand/boot: Makefile srt0.S
src/sys/arch/x68k/stand/libsa: Makefile consio.c
Added Files:
src/sys/arch/x68k/stand/libsa: Makefile.inc

Log Message:
Make x68k bootloader to use MI libsa, libkern, and libz Makefiles in
src/sys/lib dirs for maintainability.  Tested on X68030, ok from isaki@.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/x68k/stand/boot/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x68k/stand/boot/srt0.S
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/x68k/stand/libsa/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/arch/x68k/stand/libsa/Makefile.inc
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x68k/stand/libsa/consio.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/x68k/stand/boot/Makefile
diff -u src/sys/arch/x68k/stand/boot/Makefile:1.19 src/sys/arch/x68k/stand/boot/Makefile:1.20
--- src/sys/arch/x68k/stand/boot/Makefile:1.19	Sat Jan 22 19:19:24 2011
+++ src/sys/arch/x68k/stand/boot/Makefile	Tue Apr 12 14:07:35 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.19 2011/01/22 19:19:24 joerg Exp $
+#	$NetBSD: Makefile,v 1.20 2011/04/12 14:07:35 tsutsui Exp $
 
 NOMAN=		# defined
 
@@ -44,12 +44,14 @@
 LINKFLAGS=	-N -static -T ${.CURDIR}/boot.ldscript
 LIBIOCS!=	cd $M/stand/libiocs  ${PRINTOBJDIR}
 LIBSA!=		cd $M/stand/libsa  ${PRINTOBJDIR}
-LDLIBS=		-L${LIBSA} -lsa -L${LIBIOCS} -liocs
+L=		${LIBSA}/lib
+LDLIBS= 	${L}/sa/libsa.a ${L}/kern/libkern.a ${L}/z/libz.a
+LDLIBS+=	${LIBIOCS}/libiocs.a
 
 .include ../Makefile.booters
 
 realall: ${PROG}
-${PROG}:	${OBJS} ${LIBSA}/libsa.a ${LIBIOCS}/libiocs.a
+${PROG}:	${OBJS} ${LDLIBS}
 	${_MKTARGET_LINK}
 	${LD} ${LINKFLAGS} -o ${PROG}.sym ${OBJS} ${LDLIBS}
 	${STRIP} -F ${BFDNAME} -o ${PROG} ${PROG}.sym

Index: src/sys/arch/x68k/stand/boot/srt0.S
diff -u src/sys/arch/x68k/stand/boot/srt0.S:1.1 src/sys/arch/x68k/stand/boot/srt0.S:1.2
--- src/sys/arch/x68k/stand/boot/srt0.S:1.1	Thu Sep 27 10:14:49 2001
+++ src/sys/arch/x68k/stand/boot/srt0.S	Tue Apr 12 14:07:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: srt0.S,v 1.1 2001/09/27 10:14:49 minoura Exp $	*/
+/*	$NetBSD: srt0.S,v 1.2 2011/04/12 14:07:35 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2001 Minoura Makoto
@@ -48,7 +48,7 @@
 	movl		%d6,%sp@-
 	jbsr		_C_LABEL(bootmain)
 
-ENTRY_NOPROFILE(exit)
+ENTRY_NOPROFILE(_rtt)
 	pea		%pc@(reboot_msg)
 	jbsr		_C_LABEL(printf)
 	jbsr		_C_LABEL(getchar)

Index: src/sys/arch/x68k/stand/libsa/Makefile
diff -u src/sys/arch/x68k/stand/libsa/Makefile:1.25 src/sys/arch/x68k/stand/libsa/Makefile:1.26
--- src/sys/arch/x68k/stand/libsa/Makefile:1.25	Thu Mar 19 10:19:33 2009
+++ src/sys/arch/x68k/stand/libsa/Makefile	Tue Apr 12 14:07:35 2011
@@ -1,43 +1,11 @@
-#	$NetBSD: Makefile,v 1.25 2009/03/19 10:19:33 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.26 2011/04/12 14:07:35 tsutsui Exp $
 
 S=		${.CURDIR}/../../../..
-LIBSADIR=	$S/lib/libsa
-LIBKERNDIR=	$S/lib/libkern
-LIBZDIR=	$S/lib/libz
-LIBZDIST=	$S/../common/dist/zlib
-
-LIB=		sa
-
-SRCS+=		alloc.c bcopy.c bzero.c errno.c getfile.c gets.c
-SRCS+=		memcmp.c memcpy.c memmove.c memset.c panic.c
-SRCS+=		printf.c snprintf.c sprintf.c subr_prf.c twiddle.c vsprintf.c
-
-SRCS+=		close.c closeall.c cread.c dev.c fstat.c ioctl.c lseek.c
-SRCS+=		open.c read.c stat.c
-SRCS+=		loadfile.c loadfile_aout.c loadfile_elf32.c
-SRCS+=		cd9660.c lfsv1.c lfsv2.c nfs.c ufs.c ufs_ls.c ustarfs.c
-SRCS+=		globals.c
-#SRCS+=		arp.c ether.c in_cksum.c net.c netif.c rpc.c udp.c
-#SRCS+=		bootp.c
-
-SRCS+=		ashldi3.c ashrdi3.c divdi3.c moddi3.c qdivrem.c
-SRCS+=		strcat.c strchr.c strcmp.c strcpy.c strerror.c strlen.c
-SRCS+=		strncmp.c strrchr.c
-
-SRCS+=		adler32.c crc32.c inffast.c
-SRCS+=		inflate.c inftrees.c uncompr.c
-
-SRCS+=		consio.c devopen.c parseutils.c sdcd.c fd.c fdsub.S chdsk.c
-SRCS+=		putimage.S
-
-NOPROFILE=	# defined
-NOPIC=		# defined
-NOLINT=		# defined
 
-CPPFLAGS+=	-I${.OBJDIR} -I${LIBSADIR} -I$S -I${LIBZDIR} -I${LIBZDIST}
+CPPFLAGS+=	-nostdinc -I${.OBJDIR} -I. -I${S}
 CPPFLAGS+=	-I${.CURDIR}/../libiocs -I${.CURDIR}/../common
 CPPFLAGS+=	-D_STANDALONE
-CPPFLAGS+=	-DHEAP_VARIABLE -D__INTERNAL_LIBSA_CREAD
+CPPFLAGS+=	-DHEAP_VARIABLE
 CPPFLAGS+=	-DHAVE_CHANGEDISK_HOOK
 CPPFLAGS+=	-DUSTAR_SECT_PER_CYL=16
 #CPPFLAGS+=	-DDEBUG
@@ -45,11 +13,33 @@
 .PATH:	${LIBSADIR} ${LIBKERNDIR} ${LIBZDIR} ${LIBZDIST}
 
 .include ../Makefile.booters
-.include ${S}/../common/lib/libc/Makefile.inc
 
 # only needed during build
 libinstall::
 
-.include bsd.own.mk
-.undef DESTDIR
-.include bsd.lib.mk
+.include bsd.prog.mk
+
+### find out what to use for libkern
+KERN_AS= library
+.include ${S}/lib/libkern/Makefile.inc
+LIBKERN= ${KERNLIB}
+
+### find out what to use for libz
+Z_AS= library
+.include ${S}/lib/libz/Makefile.inc
+LIBZ= ${ZLIB}
+
+### find out what to use for libsa
+SA_AS= library
+SAMISCMAKEFLAGS= 

CVS commit: src/common/lib/libc/gen

2011-04-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Apr 12 16:19:44 UTC 2011

Modified Files:
src/common/lib/libc/gen: rb.c

Log Message:
Add RCSIDs


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/common/lib/libc/gen/rb.c

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/libc/gen/rb.c
diff -u src/common/lib/libc/gen/rb.c:1.9 src/common/lib/libc/gen/rb.c:1.10
--- src/common/lib/libc/gen/rb.c:1.9	Wed Nov 17 13:19:32 2010
+++ src/common/lib/libc/gen/rb.c	Tue Apr 12 16:19:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rb.c,v 1.9 2010/11/17 13:19:32 tron Exp $	*/
+/*	$NetBSD: rb.c,v 1.10 2011/04/12 16:19:44 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -39,8 +39,10 @@
 #else
 #define KASSERT(s)	do { } while (/*CONSTCOND*/ 0)
 #endif
+__RCSID($NetBSD: rb.c,v 1.10 2011/04/12 16:19:44 matt Exp $);
 #else
 #include lib/libkern/libkern.h
+__KERNEL_RCSID(0, $NetBSD: rb.c,v 1.10 2011/04/12 16:19:44 matt Exp $);
 #endif
 
 #ifdef _LIBC



CVS commit: src/libexec/ld.elf_so/arch/arm

2011-04-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Apr 12 16:40:04 UTC 2011

Modified Files:
src/libexec/ld.elf_so/arch/arm: mdreloc.c

Log Message:
Add support for TLS relocations.
From Joerg Sonnenberger


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/libexec/ld.elf_so/arch/arm/mdreloc.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/arch/arm/mdreloc.c
diff -u src/libexec/ld.elf_so/arch/arm/mdreloc.c:1.35 src/libexec/ld.elf_so/arch/arm/mdreloc.c:1.36
--- src/libexec/ld.elf_so/arch/arm/mdreloc.c:1.35	Fri Mar 25 18:07:05 2011
+++ src/libexec/ld.elf_so/arch/arm/mdreloc.c	Tue Apr 12 16:40:04 2011
@@ -1,8 +1,8 @@
-/*	$NetBSD: mdreloc.c,v 1.35 2011/03/25 18:07:05 joerg Exp $	*/
+/*	$NetBSD: mdreloc.c,v 1.36 2011/04/12 16:40:04 matt Exp $	*/
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: mdreloc.c,v 1.35 2011/03/25 18:07:05 joerg Exp $);
+__RCSID($NetBSD: mdreloc.c,v 1.36 2011/04/12 16:40:04 matt Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -179,6 +179,61 @@
 			rdbg((COPY (avoid in main)));
 			break;
 
+#ifdef __HAVE_TLS_VARIANT_I
+		case R_TYPE(TLS_DTPOFF32):
+			def = _rtld_find_symdef(symnum, obj, defobj, false);
+			if (def == NULL)
+return -1;
+
+			tmp = (Elf_Addr)(def-st_value);
+			if (__predict_true(RELOC_ALIGNED_P(where)))
+*where = tmp;
+			else
+store_ptr(where, tmp);
+
+			rdbg((TLS_DTPOFF32 %s in %s -- %p,
+			obj-strtab + obj-symtab[symnum].st_name,
+			obj-path, (void *)tmp));
+
+			break;
+		case R_TYPE(TLS_DTPMOD32):
+			def = _rtld_find_symdef(symnum, obj, defobj, false);
+			if (def == NULL)
+return -1;
+
+			tmp = (Elf_Addr)(defobj-tlsindex);
+			if (__predict_true(RELOC_ALIGNED_P(where)))
+*where = tmp;
+			else
+store_ptr(where, tmp);
+
+			rdbg((TLS_DTPMOD32 %s in %s -- %p,
+			obj-strtab + obj-symtab[symnum].st_name,
+			obj-path, (void *)tmp));
+
+			break;
+
+		case R_TYPE(TLS_TPOFF32):
+			def = _rtld_find_symdef(symnum, obj, defobj, false);
+			if (def == NULL)
+return -1;
+
+			if (!defobj-tls_done 
+			_rtld_tls_offset_allocate(obj))
+return -1;
+
+			tmp = (Elf_Addr)def-st_value + defobj-tlsoffset +
+			sizeof(struct tls_tcb);
+			if (__predict_true(RELOC_ALIGNED_P(where)))
+*where = tmp;
+			else
+store_ptr(where, tmp);
+			rdbg((TLS_TPOFF32 %s in %s -- %p,
+			obj-strtab + obj-symtab[symnum].st_name,
+			obj-path, (void *)tmp));
+			break;
+#endif /* __HAVE_TLS_VARIANT_I */
+
 		default:
 			rdbg((sym = %lu, type = %lu, offset = %p, 
 			contents = %p, symbol = %s,



CVS commit: src/etc/mtree

2011-04-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Apr 12 17:07:52 UTC 2011

Modified Files:
src/etc/mtree: NetBSD.dist.tests

Log Message:
Add missing ./usr/libdata/debug/usr/tests/lib/libcurses


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/etc/mtree/NetBSD.dist.tests

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

Modified files:

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.37 src/etc/mtree/NetBSD.dist.tests:1.38
--- src/etc/mtree/NetBSD.dist.tests:1.37	Sun Apr 10 09:45:59 2011
+++ src/etc/mtree/NetBSD.dist.tests	Tue Apr 12 17:07:52 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.37 2011/04/10 09:45:59 blymn Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.38 2011/04/12 17:07:52 matt Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -66,6 +66,7 @@
 ./usr/libdata/debug/usr/tests/lib/libc/tls
 ./usr/libdata/debug/usr/tests/lib/libc/ttyio
 ./usr/libdata/debug/usr/tests/lib/libc/time
+./usr/libdata/debug/usr/tests/lib/libcurses
 ./usr/libdata/debug/usr/tests/lib/libdes
 ./usr/libdata/debug/usr/tests/lib/libevent
 ./usr/libdata/debug/usr/tests/lib/semaphore



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

2011-04-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Apr 12 17:10:51 UTC 2011

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

Log Message:
Fix MKDEBUG set lists.


To generate a diff of this commit:
cvs rdiff -u -r1.308 -r1.309 src/distrib/sets/lists/tests/mi

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.308 src/distrib/sets/lists/tests/mi:1.309
--- src/distrib/sets/lists/tests/mi:1.308	Mon Apr 11 10:55:26 2011
+++ src/distrib/sets/lists/tests/mi	Tue Apr 12 17:10:51 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.308 2011/04/11 10:55:26 martin Exp $
+# $NetBSD: mi,v 1.309 2011/04/12 17:10:51 matt Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -375,11 +375,11 @@
 ./usr/libdata/debug/usr/tests/lib/libc/ieeefp/t_round.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/ieeefp/t_subnormal.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/localetests-lib-debug
-./usr/libdata/debug/usr/tests/lib/libc/locale/t_ctype1			tests-lib-debug		debug,atf
-./usr/libdata/debug/usr/tests/lib/libc/locale/t_ctype2			tests-lib-debug		debug,atf
-./usr/libdata/debug/usr/tests/lib/libc/locale/t_mbtowc			tests-lib-debug		debug,atf
-./usr/libdata/debug/usr/tests/lib/libc/locale/t_wcstod			tests-lib-debug		debug,atf
-./usr/libdata/debug/usr/tests/lib/libc/locale/t_wctomb			tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/locale/t_ctype1.debug			tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/locale/t_ctype2.debug			tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/locale/t_mbtowc.debug			tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/locale/t_wcstod.debug			tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/locale/t_wctomb.debug			tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/inettests-lib-debug
 ./usr/libdata/debug/usr/tests/lib/libc/inet/t_inet_network.debug	tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/nettests-lib-debug
@@ -459,6 +459,9 @@
 ./usr/libdata/debug/usr/tests/lib/libc/timetests-lib-debug
 ./usr/libdata/debug/usr/tests/lib/libc/time/t_mktime.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/time/t_strptime.debug		tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libcursestests-lib-debug
+./usr/libdata/debug/usr/tests/lib/libcurses/director.debug		tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libcurses/slave.debug			tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libdestests-lib-debug
 ./usr/libdata/debug/usr/tests/lib/libdes/t_des.debug			tests-lib-debug		debug,atf,crypto
 ./usr/libdata/debug/usr/tests/lib/semaphoretests-lib-debug



CVS commit: src/sys/ddb

2011-04-12 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Tue Apr 12 17:46:38 UTC 2011

Modified Files:
src/sys/ddb: db_proc.c

Log Message:
Fix GENERIC_SUN4U build.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/ddb/db_proc.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/ddb/db_proc.c
diff -u src/sys/ddb/db_proc.c:1.4 src/sys/ddb/db_proc.c:1.5
--- src/sys/ddb/db_proc.c:1.4	Sun Apr 10 20:59:22 2011
+++ src/sys/ddb/db_proc.c	Tue Apr 12 17:46:38 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_proc.c,v 1.4 2011/04/10 20:59:22 christos Exp $	*/
+/*	$NetBSD: db_proc.c,v 1.5 2011/04/12 17:46:38 nakayama Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_proc.c,v 1.4 2011/04/10 20:59:22 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_proc.c,v 1.5 2011/04/12 17:46:38 nakayama Exp $);
 
 #ifndef _KERNEL
 #include stdbool.h
@@ -283,7 +283,7 @@
 
 	switch (*mode) {
 	case 'a':
-		lp = (lwp_t *)addr;
+		lp = (lwp_t *)(uintptr_t)addr;
 		db_printf(lwp_t %lx\n, (long)lp);
 		db_read_bytes((db_addr_t)lp, sizeof(l), (char *)l);
 		pp = l.l_proc;



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

2011-04-12 Thread Adam Hoka
Module Name:src
Committed By:   ahoka
Date:   Tue Apr 12 18:09:12 UTC 2011

Modified Files:
src/sys/arch/evbarm/conf: BEAGLEBOARD

Log Message:
add NAND_BBT


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/conf/BEAGLEBOARD

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/evbarm/conf/BEAGLEBOARD
diff -u src/sys/arch/evbarm/conf/BEAGLEBOARD:1.18 src/sys/arch/evbarm/conf/BEAGLEBOARD:1.19
--- src/sys/arch/evbarm/conf/BEAGLEBOARD:1.18	Sun Mar  6 17:08:22 2011
+++ src/sys/arch/evbarm/conf/BEAGLEBOARD	Tue Apr 12 18:09:11 2011
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: BEAGLEBOARD,v 1.18 2011/03/06 17:08:22 bouyer Exp $
+#	$NetBSD: BEAGLEBOARD,v 1.19 2011/04/12 18:09:11 ahoka Exp $
 #
 #	BEAGLEBOARD -- TI OMAP 3530 Eval Board Kernel
 #
@@ -190,6 +190,9 @@
 # NAND layer
 nand0		at nandbus?
 
+# use the bad block table
+options NAND_BBT
+
 # Define flash partitions for board
 flash0		at nand0 offset 0x0 size 0x8 readonly 1
 flash1		at nand0 offset 0x8 size 0x8 readonly 1



CVS commit: src/sys/arch/vax/vax

2011-04-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Apr 12 18:07:57 UTC 2011

Modified Files:
src/sys/arch/vax/vax: intvec.S

Log Message:
Add a CHMU handler to implement __lwp_getprivate_fast.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/vax/vax/intvec.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/vax/vax/intvec.S
diff -u src/sys/arch/vax/vax/intvec.S:1.19 src/sys/arch/vax/vax/intvec.S:1.20
--- src/sys/arch/vax/vax/intvec.S:1.19	Mon Dec 20 00:25:45 2010
+++ src/sys/arch/vax/vax/intvec.S	Tue Apr 12 18:07:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: intvec.S,v 1.19 2010/12/20 00:25:45 matt Exp $   */
+/*	$NetBSD: intvec.S,v 1.20 2011/04/12 18:07:57 matt Exp $   */
 
 /*
  * Copyright (c) 1994, 1997 Ludd, University of Lule}, Sweden.
@@ -105,9 +105,9 @@
 	NOVEC;			 	# Unused, 38
 	NOVEC;			 	# Unused, 3C
 	INTVEC(syscall, KSTACK)		# main syscall trap, chmk, 40
-	INTVEC(resopflt, KSTACK)	# chme, 44
-	INTVEC(resopflt, KSTACK)	# chms, 48
-	INTVEC(resopflt, KSTACK)	# chmu, 4C
+	INTVEC(chmx, KSTACK)		# chme, 44
+	INTVEC(chmx, KSTACK)		# chms, 48
+	INTVEC(chmu, KSTACK)		# chmu, 4C
 	NOVEC;# System Backplane Exception/BIerror, 50
 	INTVEC(cmrerr, ISTACK)		# Corrected Memory Read, 54
 	NOVEC;# System Backplane Alert/RXCD, 58
@@ -224,6 +224,27 @@
 	TRAPCALL(resadflt, T_RESADFLT)
 
 /*
+ * Use chmu to implement a fast _lwp_getprivate.
+ */
+SCBENTRY(chmu)
+	cmpl	(%sp), $1
+	bneq	1f
+	mfpr	$PR_SSP, %r0		# get curlwp
+	movl	L_PRIVATE(%r0), %r0	# get l_private
+	addl2	%sp, 4
+	rei
+1:
+	brw	Xchmx
+
+/*
+ * default handler for CHME and CHMS
+ */
+SCBENTRY(chmx)
+	clrl	(%sp)			# CHM code already on stack
+	pushl	$T_RESOPFLT
+	jbr	Xtrap
+
+/*
  * Translation fault, used only when simulating page reference bit.
  * Therefore it is done a fast revalidation of the page if it is
  * referenced. Trouble here is the hardware bug on KA650 CPUs that



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

2011-04-12 Thread Adam Hoka
Module Name:src
Committed By:   ahoka
Date:   Tue Apr 12 18:10:15 UTC 2011

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

Log Message:
avoid a crash when the display size is reported as 1x1
XXX this is hackish, it should be properly fixed instead


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/omap/omapfb.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/omapfb.c
diff -u src/sys/arch/arm/omap/omapfb.c:1.1 src/sys/arch/arm/omap/omapfb.c:1.2
--- src/sys/arch/arm/omap/omapfb.c:1.1	Tue Aug 31 19:03:55 2010
+++ src/sys/arch/arm/omap/omapfb.c	Tue Apr 12 18:10:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: omapfb.c,v 1.1 2010/08/31 19:03:55 macallan Exp $	*/
+/*	$NetBSD: omapfb.c,v 1.2 2011/04/12 18:10:15 ahoka Exp $	*/
 
 /*
  * Copyright (c) 2010 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: omapfb.c,v 1.1 2010/08/31 19:03:55 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: omapfb.c,v 1.2 2011/04/12 18:10:15 ahoka Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -179,6 +179,11 @@
 	sc-sc_depth = 16;
 	sc-sc_stride = sc-sc_width  1;
 
+	if (sc-sc_width == 1 || sc-sc_height == 1) {
+		aprint_error_dev(self, bogus display size, not attaching\n);
+		return;
+	}
+
 	printf(%s: firmware set up %d x %d\n, device_xname(self),
 	sc-sc_width, sc-sc_height);
 #if 0



CVS commit: src/sys/arch/vax/include

2011-04-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Apr 12 18:24:28 UTC 2011

Modified Files:
src/sys/arch/vax/include: mcontext.h

Log Message:
Add __lwp_getprivate_fast


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/vax/include/mcontext.h

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

Modified files:

Index: src/sys/arch/vax/include/mcontext.h
diff -u src/sys/arch/vax/include/mcontext.h:1.5 src/sys/arch/vax/include/mcontext.h:1.6
--- src/sys/arch/vax/include/mcontext.h:1.5	Mon Apr 28 20:23:39 2008
+++ src/sys/arch/vax/include/mcontext.h	Tue Apr 12 18:24:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcontext.h,v 1.5 2008/04/28 20:23:39 martin Exp $	*/
+/*	$NetBSD: mcontext.h,v 1.6 2011/04/12 18:24:28 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -70,4 +70,12 @@
 
 #define	_UC_MACHINE_SET_PC(uc, pc)	_UC_MACHINE_PC(uc) = (pc)
 
+static __inline void *
+__lwp_getprivate_fast(void)
+{
+	register void *tcb __asm(r0);
+	__asm(chmu $1 ::: r0);
+	return tcb;
+}
+
 #endif	/* !_VAX_MCONTEXT_H_ */



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

2011-04-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Apr 12 18:39:38 UTC 2011

Modified Files:
src/sys/arch/mips/mips: pmap_tlb.c

Log Message:
Dont bother taking out TLBINFO lock in pmap_tlb_asid_deactivate since the
atomic ops will DTRT with it.  Remove spl calls too.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/mips/pmap_tlb.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/mips/pmap_tlb.c
diff -u src/sys/arch/mips/mips/pmap_tlb.c:1.4 src/sys/arch/mips/mips/pmap_tlb.c:1.5
--- src/sys/arch/mips/mips/pmap_tlb.c:1.4	Wed Apr  6 05:35:37 2011
+++ src/sys/arch/mips/mips/pmap_tlb.c	Tue Apr 12 18:39:38 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.4 2011/04/06 05:35:37 matt Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.5 2011/04/12 18:39:38 matt Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap_tlb.c,v 1.4 2011/04/06 05:35:37 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_tlb.c,v 1.5 2011/04/12 18:39:38 matt Exp $);
 
 /*
  * Manages address spaces in a TLB.
@@ -812,15 +812,8 @@
 	 */
 	if (pm != pmap_kernel()  pm-pm_onproc != 0) {
 		struct cpu_info * const ci = curcpu();
-		struct pmap_tlb_info * const ti = ci-ci_tlb_info;
 		const uint32_t cpu_mask = 1  cpu_index(ci);
-		int s = splhigh();
 		KASSERT(!cpu_intr_p());
-		KASSERT(ti-ti_cpu_mask  cpu_mask);
-		TLBINFO_LOCK(ti);
-		KASSERTMSG(ci-ci_mtx_count  0,
-		(%s: cpu%d mtx count (%d) = 0,
-		__func__, cpu_index(ci), ci-ci_mtx_count));
 		KASSERTMSG(ci-ci_cpl = IPL_SCHED,
 		(%s: cpl (%d)  IPL_SCHED (%d),
 		__func__, ci-ci_cpl, IPL_SCHED));
@@ -832,10 +825,6 @@
 		 * be changed while this TLBs lock is held.
 		 */
 		atomic_and_32(pm-pm_onproc, ~cpu_mask);
-		KASSERT(curcpu() == ci);
-		KASSERT(curcpu()-ci_tlb_info == ti);
-		TLBINFO_UNLOCK(ti);
-		splx(s);
 		atomic_and_ulong(ci-ci_flags, ~CPUF_USERPMAP);
 	}
 #elif defined(DEBUG)



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

2011-04-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Apr 12 18:53:23 UTC 2011

Modified Files:
src/sys/arch/mips/mips: pmap_tlb.c

Log Message:
Get rid of an errant KASSERT


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/mips/mips/pmap_tlb.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/mips/pmap_tlb.c
diff -u src/sys/arch/mips/mips/pmap_tlb.c:1.5 src/sys/arch/mips/mips/pmap_tlb.c:1.6
--- src/sys/arch/mips/mips/pmap_tlb.c:1.5	Tue Apr 12 18:39:38 2011
+++ src/sys/arch/mips/mips/pmap_tlb.c	Tue Apr 12 18:53:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.5 2011/04/12 18:39:38 matt Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.6 2011/04/12 18:53:23 matt Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap_tlb.c,v 1.5 2011/04/12 18:39:38 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_tlb.c,v 1.6 2011/04/12 18:53:23 matt Exp $);
 
 /*
  * Manages address spaces in a TLB.
@@ -814,9 +814,6 @@
 		struct cpu_info * const ci = curcpu();
 		const uint32_t cpu_mask = 1  cpu_index(ci);
 		KASSERT(!cpu_intr_p());
-		KASSERTMSG(ci-ci_cpl = IPL_SCHED,
-		(%s: cpl (%d)  IPL_SCHED (%d),
-		__func__, ci-ci_cpl, IPL_SCHED));
 		KASSERTMSG(pm-pm_onproc  cpu_mask,
 		(%s: pmap %p onproc %#x doesn't include cpu %d (%p),
 		__func__, pm, pm-pm_onproc, cpu_index(ci), ci));



CVS commit: src/lib/librumphijack

2011-04-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 12 19:49:48 UTC 2011

Modified Files:
src/lib/librumphijack: hijack.c

Log Message:
Fix SSP builds (Vladimir Kirillov)


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/lib/librumphijack/hijack.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/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.86 src/lib/librumphijack/hijack.c:1.87
--- src/lib/librumphijack/hijack.c:1.86	Mon Mar 14 11:15:47 2011
+++ src/lib/librumphijack/hijack.c	Tue Apr 12 15:49:48 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.86 2011/03/14 15:15:47 pooka Exp $	*/
+/*  $NetBSD: hijack.c,v 1.87 2011/04/12 19:49:48 christos Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: hijack.c,v 1.86 2011/03/14 15:15:47 pooka Exp $);
+__RCSID($NetBSD: hijack.c,v 1.87 2011/04/12 19:49:48 christos Exp $);
 
 #define __ssp_weak_name(fun) _hijack_ ## fun
 
@@ -1972,6 +1972,7 @@
 
 #if _FORTIFY_SOURCE  0
 #define STUB(fun) __ssp_weak_name(fun)
+ssize_t STUB(readlink)(const char * __restrict, char * __restrict, size_t);
 ssize_t _sys_readlink(const char * __restrict, char * __restrict, size_t);
 ssize_t
 STUB(readlink)(const char * __restrict path, char * __restrict buf,
@@ -1980,6 +1981,7 @@
 	return _sys_readlink(path, buf, bufsiz);
 }
 
+char *STUB(getcwd)(char *, size_t);
 char *_sys_getcwd(char *, size_t);
 char *
 STUB(getcwd)(char *buf, size_t size)
@@ -2130,7 +2132,7 @@
 	(const char *, const char *),	\
 	(target, path))
 
-PATHCALL(ssize_t, readlink, DUALCALL_READLINK,\
+PATHCALL(ssize_t, _sys_readlink, DUALCALL_READLINK,			\
 	(const char *path, char *buf, size_t bufsiz),			\
 	(const char *, char *, size_t),	\
 	(path, buf, bufsiz))



CVS commit: src/lib/libpthread

2011-04-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 12 19:52:04 UTC 2011

Modified Files:
src/lib/libpthread: pthread_cancelstub.c

Log Message:
Fix SSP builds (Vladimir Kirillov)


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libpthread/pthread_cancelstub.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/libpthread/pthread_cancelstub.c
diff -u src/lib/libpthread/pthread_cancelstub.c:1.31 src/lib/libpthread/pthread_cancelstub.c:1.32
--- src/lib/libpthread/pthread_cancelstub.c:1.31	Wed Jan 26 13:48:57 2011
+++ src/lib/libpthread/pthread_cancelstub.c	Tue Apr 12 15:52:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_cancelstub.c,v 1.31 2011/01/26 18:48:57 christos Exp $	*/
+/*	$NetBSD: pthread_cancelstub.c,v 1.32 2011/04/12 19:52:04 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: pthread_cancelstub.c,v 1.31 2011/01/26 18:48:57 christos Exp $);
+__RCSID($NetBSD: pthread_cancelstub.c,v 1.32 2011/04/12 19:52:04 christos Exp $);
 
 #ifndef lint
 
@@ -472,7 +472,10 @@
 
 #if _FORTIFY_SOURCE  0
 #define STUB(fun) __ssp_weak_name(fun)
+
+ssize_t STUB(readlink)(const char * __restrict, char * __restrict, size_t);
 ssize_t _sys_readlink(const char * __restrict, char * __restrict, size_t);
+
 ssize_t
 STUB(readlink)(const char * __restrict path, char * __restrict buf,
 size_t bufsiz)
@@ -480,15 +483,16 @@
 	return _sys_readlink(path, buf, bufsiz);
 }
 
+char *STUB(getcwd)(char *, size_t);
 char *_sys_getcwd(char *, size_t);
+
 char *
 STUB(getcwd)(char *buf, size_t size)
 {
 	return _sys_getcwd(buf, size);
 }
-#else
-#define STUB(fun) fun
-#endif
+
+ssize_t STUB(read)(int, void *, size_t);
 
 ssize_t
 STUB(read)(int d, void *buf, size_t nbytes)
@@ -503,6 +507,9 @@
 
 	return retval;
 }
+#else
+#define STUB(fun) fun
+#endif
 
 ssize_t
 readv(int d, const struct iovec *iov, int iovcnt)



CVS commit: src/sys/kern

2011-04-12 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Tue Apr 12 20:37:26 UTC 2011

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

Log Message:
do_ksem_open: do not leak the file descriptor on error path.
sys__ksem_unlink: fix comment, release one lock ealier.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/kern/uipc_sem.c

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

Modified files:

Index: src/sys/kern/uipc_sem.c
diff -u src/sys/kern/uipc_sem.c:1.30 src/sys/kern/uipc_sem.c:1.31
--- src/sys/kern/uipc_sem.c:1.30	Mon Apr 11 22:31:43 2011
+++ src/sys/kern/uipc_sem.c	Tue Apr 12 20:37:25 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_sem.c,v 1.30 2011/04/11 22:31:43 rmind Exp $	*/
+/*	$NetBSD: uipc_sem.c,v 1.31 2011/04/12 20:37:25 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uipc_sem.c,v 1.30 2011/04/11 22:31:43 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: uipc_sem.c,v 1.31 2011/04/12 20:37:25 rmind Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -448,7 +448,8 @@
 		if ((oflag  O_CREAT) == 0) {
 			mutex_exit(ksem_lock);
 			KASSERT(ksnew == NULL);
-			return ENOENT;
+			error = ENOENT;
+			goto err;
 		}
 
 		/* Check for the limit locked. */
@@ -549,9 +550,10 @@
 		return error;
 	}
 
-	/* Remove and destroy if no referenes. */
+	/* Remove from the global list. */
 	LIST_REMOVE(ks, ks_entry);
 	nsems--;
+	mutex_exit(ksem_lock);
 
 	refcnt = ks-ks_ref;
 	if (refcnt) {
@@ -559,7 +561,6 @@
 		ks-ks_flags |= KS_UNLINKED;
 	}
 	mutex_exit(ks-ks_lock);
-	mutex_exit(ksem_lock);
 
 	if (refcnt == 0) {
 		ksem_free(ks);



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

2011-04-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Apr 12 22:50:33 UTC 2011

Modified Files:
src/sys/arch/mips/mips: locore_mips3.S

Log Message:
Add mipsNN_cp0_watch{lo,hi}_{read,write}


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/mips/mips/locore_mips3.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/mips/mips/locore_mips3.S
diff -u src/sys/arch/mips/mips/locore_mips3.S:1.98 src/sys/arch/mips/mips/locore_mips3.S:1.99
--- src/sys/arch/mips/mips/locore_mips3.S:1.98	Tue Mar 15 07:39:22 2011
+++ src/sys/arch/mips/mips/locore_mips3.S	Tue Apr 12 22:50:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore_mips3.S,v 1.98 2011/03/15 07:39:22 matt Exp $	*/
+/*	$NetBSD: locore_mips3.S,v 1.99 2011/04/12 22:50:33 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Jonathan Stone (hereinafter referred to as the author)
@@ -124,6 +124,14 @@
 	.set	noreorder
 	.set	mips3
 
+#ifdef _LP64
+#define	_MFC0	dmfc0
+#define	_MTC0	dmtc0
+#else
+#define	_MFC0	mfc0
+#define	_MTC0	mtc0
+#endif
+
 	.text
 
 /*
@@ -224,7 +232,11 @@
 
 #if (MIPS32 + MIPS32R2 + MIPS64 + MIPS64R2)  0
 	.set push
+#ifdef _LP64
+	.set mips64
+#else
 	.set mips32
+#endif
 /*
  * uint32_t mipsNN_cp0_config1_read(void)
  *
@@ -268,15 +280,134 @@
 	 nop
 END(mipsNN_cp0_config3_read)
 
+/*
+ * uintptr_t mipsNN_cp0_watchlo_read(u_int sel)
+ *
+ *	Return the current value of the selected CP0 Watchlo register.
+ */
+LEAF(mipsNN_cp0_watchlo_read)
+	sll	a0, 2
+	PTR_LA	t9, 1f
+	PTR_ADDU t9, a0
+	jr	t9
+	 nop
+1:
+	jr	ra
+	 _MFC0	v0, MIPS_COP_0_WATCH_LO, 0
+	jr	ra
+	 _MFC0	v0, MIPS_COP_0_WATCH_LO, 1
+	jr	ra
+	 _MFC0	v0, MIPS_COP_0_WATCH_LO, 2
+	jr	ra
+	 _MFC0	v0, MIPS_COP_0_WATCH_LO, 3
+	jr	ra
+	 _MFC0	v0, MIPS_COP_0_WATCH_LO, 4
+	jr	ra
+	 _MFC0	v0, MIPS_COP_0_WATCH_LO, 5
+	jr	ra
+	 _MFC0	v0, MIPS_COP_0_WATCH_LO, 6
+	jr	ra
+	 _MFC0	v0, MIPS_COP_0_WATCH_LO, 7
+END(mipsNN_cp0_watchlo_read)
+
+/*
+ * void mipsNN_cp0_watchlo_write(u_int sel, uintptr_t val)
+ *
+ *	Set the current value of the selected CP0 WatchLo register.
+ */
+LEAF(mipsNN_cp0_watchlo_write)
+	sll	a0, 2
+	PTR_LA	t9, 1f
+	PTR_ADDU t9, a0
+	jr	t9
+	 nop
+1:
+	jr	ra
+	 _MTC0	a1, MIPS_COP_0_WATCH_LO, 0
+	jr	ra
+	 _MTC0	a1, MIPS_COP_0_WATCH_LO, 1
+	jr	ra
+	 _MTC0	a1, MIPS_COP_0_WATCH_LO, 2
+	jr	ra
+	 _MTC0	a1, MIPS_COP_0_WATCH_LO, 3
+	jr	ra
+	 _MTC0	a1, MIPS_COP_0_WATCH_LO, 4
+	jr	ra
+	 _MTC0	a1, MIPS_COP_0_WATCH_LO, 5
+	jr	ra
+	 _MTC0	a1, MIPS_COP_0_WATCH_LO, 6
+	jr	ra
+	 _MTC0	a1, MIPS_COP_0_WATCH_LO, 7
+END(mipsNN_cp0_watchlo_write)
+
+/*
+ * uint32_t mipsNN_cp0_watchhi_read(u_int sel)
+ *
+ *	Return the current value of the selected CP0 WatchHi register.
+ */
+LEAF(mipsNN_cp0_watchhi_read)
+	sll	a0, 2
+	PTR_LA	t9, 1f
+	PTR_ADDU t9, a0
+	jr	t9
+	 nop
+1:
+	jr	ra
+	 mfc0	v0, MIPS_COP_0_WATCH_HI, 0
+	jr	ra
+	 mfc0	v0, MIPS_COP_0_WATCH_HI, 1
+	jr	ra
+	 mfc0	v0, MIPS_COP_0_WATCH_HI, 2
+	jr	ra
+	 mfc0	v0, MIPS_COP_0_WATCH_HI, 3
+	jr	ra
+	 mfc0	v0, MIPS_COP_0_WATCH_HI, 4
+	jr	ra
+	 mfc0	v0, MIPS_COP_0_WATCH_HI, 5
+	jr	ra
+	 mfc0	v0, MIPS_COP_0_WATCH_HI, 6
+	jr	ra
+	 mfc0	v0, MIPS_COP_0_WATCH_HI, 7
+END(mipsNN_cp0_watchhi_read)
+
+/*
+ * void mipsNN_cp0_watchhi_write(u_int sel, uint32_t val)
+ *
+ *	Set the current value of the selected CP0 WatchHi register.
+ */
+LEAF(mipsNN_cp0_watchhi_write)
+	sll	a0, 2
+	PTR_LA	t9, 1f
+	PTR_ADDU t9, a0
+	jr	t9
+	 nop
+1:
+	jr	ra
+	 mtc0	a1, MIPS_COP_0_WATCH_HI, 0
+	jr	ra
+	 mtc0	a1, MIPS_COP_0_WATCH_HI, 1
+	jr	ra
+	 mtc0	a1, MIPS_COP_0_WATCH_HI, 2
+	jr	ra
+	 mtc0	a1, MIPS_COP_0_WATCH_HI, 3
+	jr	ra
+	 mtc0	a1, MIPS_COP_0_WATCH_HI, 4
+	jr	ra
+	 mtc0	a1, MIPS_COP_0_WATCH_HI, 5
+	jr	ra
+	 mtc0	a1, MIPS_COP_0_WATCH_HI, 6
+	jr	ra
+	 mtc0	a1, MIPS_COP_0_WATCH_HI, 7
+END(mipsNN_cp0_watchhi_write)
+
 #if (MIPS32R2 + MIPS64R2)  0
 /*
  * void mipsNN_cp0_userlocal_write(void *);
  *	Set the value of the CP0 USERLOCAL (TLB_CONTEXT, select 2) register.
  */
 LEAF(mipsNN_cp0_hwrena_write)
-	mtc0	a0, MIPS_COP_0_HWRENA
 	j	ra
-	 nop
+	 mtc0	a0, MIPS_COP_0_HWRENA
 END(mipsNN_cp0_hwrena_write)
 
 /*
@@ -284,15 +415,8 @@
  *	Set the value of the CP0 USERLOCAL (TLB_CONTEXT, select 2) register.
  */
 LEAF(mipsNN_cp0_userlocal_write)
-#if defined(_LP64)
-	.set	mips64r2
-	dmtc0	a0, MIPS_COP_0_TLB_CONTEXT, 2
-#else
-	.set	mips32r2
-	mtc0	a0, MIPS_COP_0_TLB_CONTEXT, 2
-#endif
 	j	ra
-	 nop
+	 _MTC0	a0, MIPS_COP_0_TLB_CONTEXT, 2
 END(mipsNN_cp0_userlocal_write)
 #endif /* (MIPS32R2 + MIPS64R2)  0 */
 	.set	pop



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

2011-04-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Apr 12 22:54:31 UTC 2011

Modified Files:
src/sys/arch/mips/include: locore.h

Log Message:
Add prototypes for mipsNN_cp0_watch{lo,hi}_{read,write}


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/mips/include/locore.h

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

Modified files:

Index: src/sys/arch/mips/include/locore.h
diff -u src/sys/arch/mips/include/locore.h:1.86 src/sys/arch/mips/include/locore.h:1.87
--- src/sys/arch/mips/include/locore.h:1.86	Wed Apr  6 05:43:11 2011
+++ src/sys/arch/mips/include/locore.h	Tue Apr 12 22:54:31 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.h,v 1.86 2011/04/06 05:43:11 matt Exp $ */
+/* $NetBSD: locore.h,v 1.87 2011/04/12 22:54:31 matt Exp $ */
 
 /*
  * This file should not be included by MI code!!!
@@ -148,6 +148,11 @@
 uint32_t mipsNN_cp0_config2_read(void);
 uint32_t mipsNN_cp0_config3_read(void);
 
+uintptr_t mipsNN_cp0_watchlo_read(u_int);
+void	mipsNN_cp0_watchlo_write(u_int, uintptr_t);
+uint32_t mipsNN_cp0_watchhi_read(u_int);
+void	mipsNN_cp0_watchhi_write(u_int, uint32_t);
+
 #if (MIPS32R2 + MIPS64R2)  0
 void	mipsNN_cp0_hwrena_write(uint32_t);
 void	mipsNN_cp0_userlocal_write(void *);



CVS commit: src/sys/arch/sparc64/include

2011-04-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Apr 13 03:22:49 UTC 2011

Modified Files:
src/sys/arch/sparc64/include: db_machdep.h

Log Message:
this needs sys/types.h in userspace.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/sparc64/include/db_machdep.h

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

Modified files:

Index: src/sys/arch/sparc64/include/db_machdep.h
diff -u src/sys/arch/sparc64/include/db_machdep.h:1.28 src/sys/arch/sparc64/include/db_machdep.h:1.29
--- src/sys/arch/sparc64/include/db_machdep.h:1.28	Mon Apr 11 10:41:17 2011
+++ src/sys/arch/sparc64/include/db_machdep.h	Wed Apr 13 03:22:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_machdep.h,v 1.28 2011/04/11 10:41:17 mrg Exp $ */
+/*	$NetBSD: db_machdep.h,v 1.29 2011/04/13 03:22:49 mrg Exp $ */
 
 /*
  * Mach Operating System
@@ -33,6 +33,8 @@
  * Machine-dependent defines for new kernel debugger.
  */
 
+#include sys/types.h
+
 #include uvm/uvm_extern.h
 
 #include machine/frame.h



CVS commit: src

2011-04-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Apr 13 03:24:29 UTC 2011

Modified Files:
src/distrib/sets/lists/comp: md.sparc64
src/sys/arch/sparc64/include: Makefile intr.h

Log Message:
install machine/intr.h for crash(8).

(we could avoid this, but it would require a lot of contortions that
make the header files ugly.  maybe someone else can figure out a less
ugly way of doing this later.)


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/distrib/sets/lists/comp/md.sparc64
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/sparc64/include/Makefile
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/sparc64/include/intr.h

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

Modified files:

Index: src/distrib/sets/lists/comp/md.sparc64
diff -u src/distrib/sets/lists/comp/md.sparc64:1.90 src/distrib/sets/lists/comp/md.sparc64:1.91
--- src/distrib/sets/lists/comp/md.sparc64:1.90	Thu Mar 24 17:05:41 2011
+++ src/distrib/sets/lists/comp/md.sparc64	Wed Apr 13 03:24:28 2011
@@ -1,4 +1,4 @@
-# $NetBSD: md.sparc64,v 1.90 2011/03/24 17:05:41 bouyer Exp $
+# $NetBSD: md.sparc64,v 1.91 2011/04/13 03:24:28 mrg Exp $
 ./usr/include/ieeefp.hcomp-c-include
 ./usr/include/sparccomp-c-include
 ./usr/include/sparc/_G_config.h			comp-obsolete		obsolete
@@ -93,6 +93,7 @@
 ./usr/include/sparc64/ieee.h			comp-c-include
 ./usr/include/sparc64/ieeefp.h			comp-c-include
 ./usr/include/sparc64/instr.h			comp-c-include
+./usr/include/sparc64/intr.h			comp-c-include
 ./usr/include/sparc64/int_const.h		comp-c-include
 ./usr/include/sparc64/int_fmtio.h		comp-c-include
 ./usr/include/sparc64/int_limits.h		comp-c-include

Index: src/sys/arch/sparc64/include/Makefile
diff -u src/sys/arch/sparc64/include/Makefile:1.25 src/sys/arch/sparc64/include/Makefile:1.26
--- src/sys/arch/sparc64/include/Makefile:1.25	Mon Jan 31 00:19:34 2011
+++ src/sys/arch/sparc64/include/Makefile	Wed Apr 13 03:24:28 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.25 2011/01/31 00:19:34 christos Exp $
+#	$NetBSD: Makefile,v 1.26 2011/04/13 03:24:28 mrg Exp $
 
 INCSDIR= /usr/include/sparc64
 
@@ -8,7 +8,7 @@
 	disklabel.h \
 	eeprom.h elf_machdep.h endian.h endian_machdep.h \
 	fenv.h float.h frame.h fsr.h \
-	idprom.h ieee.h ieeefp.h instr.h \
+	idprom.h ieee.h ieeefp.h instr.h intr.h \
 	int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \
 	joystick.h \
 	kbd.h kbio.h kcore.h \

Index: src/sys/arch/sparc64/include/intr.h
diff -u src/sys/arch/sparc64/include/intr.h:1.29 src/sys/arch/sparc64/include/intr.h:1.30
--- src/sys/arch/sparc64/include/intr.h:1.29	Mon May 24 09:49:17 2010
+++ src/sys/arch/sparc64/include/intr.h	Wed Apr 13 03:24:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.29 2010/05/24 09:49:17 martin Exp $ */
+/*	$NetBSD: intr.h,v 1.30 2011/04/13 03:24:28 mrg Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -32,6 +32,8 @@
 #ifndef _SPARC64_INTR_H_
 #define _SPARC64_INTR_H_
 
+#ifdef _KERNEL
+
 #if defined(_KERNEL_OPT)
 #include opt_multiprocessor.h
 #endif
@@ -76,6 +78,8 @@
 #endif	/* _LOCORE */
 #endif
 
+#endif /* _KERNEL */
+
 #define IPI_EVCNT_TLB_PTE	0
 #define IPI_EVCNT_FPU_SYNCH	1
 #define IPI_EVCNT_FPU_FLUSH	2



CVS commit: src/sys/arch/sparc64/sparc64

2011-04-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Apr 13 03:25:35 UTC 2011

Modified Files:
src/sys/arch/sparc64/sparc64: db_disasm.c

Log Message:
this needs db_user.h and stdlib.h in userland.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/sparc64/sparc64/db_disasm.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/sparc64/sparc64/db_disasm.c
diff -u src/sys/arch/sparc64/sparc64/db_disasm.c:1.15 src/sys/arch/sparc64/sparc64/db_disasm.c:1.16
--- src/sys/arch/sparc64/sparc64/db_disasm.c:1.15	Tue Nov 25 15:41:12 2008
+++ src/sys/arch/sparc64/sparc64/db_disasm.c	Wed Apr 13 03:25:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_disasm.c,v 1.15 2008/11/25 15:41:12 nakayama Exp $ */
+/*	$NetBSD: db_disasm.c,v 1.16 2011/04/13 03:25:35 mrg Exp $ */
 
 /*
  * Copyright (c) 1994 David S. Miller, da...@nadzieja.rutgers.edu
@@ -32,17 +32,22 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_disasm.c,v 1.15 2008/11/25 15:41:12 nakayama Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_disasm.c,v 1.16 2011/04/13 03:25:35 mrg Exp $);
 
 #include sys/param.h
 #include machine/db_machdep.h
 #include machine/instr.h
 #include ddb/db_sym.h
 #include ddb/db_interface.h
+#include ddb/db_user.h
 #include ddb/db_extern.h
 #include ddb/db_output.h
 #include ddb/db_access.h
 
+#ifndef _KERNEL
+#include stdlib.h
+#endif
+
 #ifndef V9
 #define V9
 #endif



CVS commit: src/sys/arch/sparc64/sparc64

2011-04-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Apr 13 03:29:03 UTC 2011

Modified Files:
src/sys/arch/sparc64/sparc64: db_interface.c db_trace.c

Log Message:
apply s/TRUE/true/; s/FALSE/false/;.  needed for userland.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/arch/sparc64/sparc64/db_interface.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/sparc64/sparc64/db_trace.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/sparc64/sparc64/db_interface.c
diff -u src/sys/arch/sparc64/sparc64/db_interface.c:1.126 src/sys/arch/sparc64/sparc64/db_interface.c:1.127
--- src/sys/arch/sparc64/sparc64/db_interface.c:1.126	Fri Jan 14 02:06:32 2011
+++ src/sys/arch/sparc64/sparc64/db_interface.c	Wed Apr 13 03:29:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.126 2011/01/14 02:06:32 rmind Exp $ */
+/*	$NetBSD: db_interface.c,v 1.127 2011/04/13 03:29:03 mrg Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.126 2011/01/14 02:06:32 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.127 2011/04/13 03:29:03 mrg Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -491,12 +491,12 @@
 
 	s = splhigh();
 	db_active++;
-	cnpollc(TRUE);
+	cnpollc(true);
 	/* Need to do spl stuff till cnpollc works */
 	db_dump_ts(0, 0, 0, 0);
 	db_trap(type, 0/*code*/);
 	ddb_restore_state();
-	cnpollc(FALSE);
+	cnpollc(false);
 	db_active--;
 
 	splx(s);
@@ -1370,7 +1370,7 @@
 insn.i_int = inst;
 
 if (insn.i_any.i_op != IOP_OP2)
-	return FALSE;
+	return false;
 
 switch (insn.i_op2.i_op2) {
   case IOP2_BPcc:
@@ -1379,10 +1379,10 @@
   case IOP2_FBPfcc:
   case IOP2_FBfcc:
   case IOP2_CBccc:
-	return TRUE;
+	return true;
 
   default:
-	return FALSE;
+	return false;
 }
 }
 
@@ -1396,13 +1396,13 @@
 
 switch (insn.i_any.i_op) {
   case IOP_CALL:
-	return TRUE;
+	return true;
 
   case IOP_reg:
 	return (insn.i_op3.i_op3 == IOP3_JMPL)  !db_inst_return(inst);
 
   default:
-	return FALSE;
+	return false;
 }
 }
 
@@ -1415,10 +1415,10 @@
 insn.i_int = inst;
 
 if (db_inst_call(inst))
-	return TRUE;
+	return true;
 
 if (insn.i_any.i_op != IOP_OP2)
-	return FALSE;
+	return false;
 
 switch (insn.i_op2.i_op2)
 {
@@ -1430,7 +1430,7 @@
 	return insn.i_branch.i_cond == Icc_A;
 
   default:
-	return FALSE;
+	return false;
 }
 }
 

Index: src/sys/arch/sparc64/sparc64/db_trace.c
diff -u src/sys/arch/sparc64/sparc64/db_trace.c:1.44 src/sys/arch/sparc64/sparc64/db_trace.c:1.45
--- src/sys/arch/sparc64/sparc64/db_trace.c:1.44	Thu Jul  1 02:38:27 2010
+++ src/sys/arch/sparc64/sparc64/db_trace.c	Wed Apr 13 03:29:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_trace.c,v 1.44 2010/07/01 02:38:27 rmind Exp $ */
+/*	$NetBSD: db_trace.c,v 1.45 2011/04/13 03:29:03 mrg Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_trace.c,v 1.44 2010/07/01 02:38:27 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_trace.c,v 1.45 2011/04/13 03:29:03 mrg Exp $);
 
 #include sys/param.h
 #include sys/proc.h
@@ -61,21 +61,21 @@
  	void		(*pr) (const char *, ...);
 {
 	vaddr_t		frame;
-	bool		kernel_only = TRUE;
-	bool		trace_thread = FALSE;
-	bool		lwpaddr = FALSE;
+	bool		kernel_only = true;
+	bool		trace_thread = false;
+	bool		lwpaddr = false;
 	char		c;
 	const char	*cp = modif;
 
 	while ((c = *cp++) != 0) {
 		if (c == 'a') {
-			lwpaddr = TRUE;
-			trace_thread = TRUE;
+			lwpaddr = true;
+			trace_thread = true;
 		}
 		if (c == 't')
-			trace_thread = TRUE;
+			trace_thread = true;
 		if (c == 'u')
-			kernel_only = FALSE;
+			kernel_only = false;
 	}
 
 	if (!have_addr)
@@ -282,13 +282,13 @@
 {
 	int		i;
 	uint64_t	frame, oldframe;
-	bool		kernel_only = TRUE;
+	bool		kernel_only = true;
 	char		c;
 	const char	*cp = modif;
 
 	while ((c = *cp++) != 0)
 		if (c == 'u')
-			kernel_only = FALSE;
+			kernel_only = false;
 
 	if (count == -1)
 		count = 65535;



CVS commit: src/sys/arch/sparc64/sparc64

2011-04-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Apr 13 03:32:29 UTC 2011

Modified Files:
src/sys/arch/sparc64/sparc64: db_trace.c

Log Message:
port to userspace.  needs stdbool.h, sys/cpu.h.  delete unused
ULOAD().  implement KLOAD() in terms of db_read_bytes() in userspace.
can't use proc_find_raw() in userspace; disable this functionality
for now.  use db_printf().


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/sparc64/sparc64/db_trace.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/sparc64/sparc64/db_trace.c
diff -u src/sys/arch/sparc64/sparc64/db_trace.c:1.45 src/sys/arch/sparc64/sparc64/db_trace.c:1.46
--- src/sys/arch/sparc64/sparc64/db_trace.c:1.45	Wed Apr 13 03:29:03 2011
+++ src/sys/arch/sparc64/sparc64/db_trace.c	Wed Apr 13 03:32:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_trace.c,v 1.45 2011/04/13 03:29:03 mrg Exp $ */
+/*	$NetBSD: db_trace.c,v 1.46 2011/04/13 03:32:28 mrg Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -28,10 +28,11 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_trace.c,v 1.45 2011/04/13 03:29:03 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_trace.c,v 1.46 2011/04/13 03:32:28 mrg Exp $);
 
 #include sys/param.h
 #include sys/proc.h
+#include sys/cpu.h
 #include sys/systm.h
 #include machine/db_machdep.h
 #include machine/ctlreg.h
@@ -41,6 +42,10 @@
 #include ddb/db_interface.h
 #include ddb/db_output.h
 
+#ifndef _KERNEL
+#include stdbool.h
+#endif
+
 void db_print_window(uint64_t);
 
 #if 0
@@ -49,8 +54,21 @@
 #define INKERNEL(va)	1	/* Everything's in the kernel now. 8^) */
 #endif
 
+#ifdef _KERNEL
 #define	KLOAD(x)	probeget((paddr_t)(u_long)(x), ASI_PRIMARY, sizeof(x))	
-#define ULOAD(x)	probeget((paddr_t)(u_long)(x), ASI_AIUS, sizeof(x))	
+#else
+static long
+kload(db_addr_t addr)
+{
+	long val;
+
+	db_read_bytes(addr, sizeof val, (char *)val);
+
+	return val;
+}
+#define	KLOAD(x)	kload((db_addr_t)(u_long)(x))
+#define frame32 frame	/* XXX */
+#endif
 
 void
 db_stack_trace_print(addr, have_addr, count, modif, pr)
@@ -91,6 +109,7 @@
 (*pr)(trace: pid %d , p-p_pid);
 			} else {
 (*pr)(trace: pid %d , (int)addr);
+#ifdef _KERNEL
 p = proc_find_raw(addr);
 if (p == NULL) {
 	(*pr)(not found\n);
@@ -98,6 +117,11 @@
 }
 l = LIST_FIRST(p-p_lwps);
 KASSERT(l != NULL);
+#else
+(*pr)(no proc_find_raw() in crash\n);
+return;
+
+#endif
 			}
 			(*pr)(lid %d , l-l_lid);
 			pcb = lwp_getpcb(l);
@@ -255,7 +279,7 @@
   f-fr_local[4], f-fr_local[5], f-fr_local[6], f-fr_local[7]);
 			db_printf(%8x %8x %8x %8x %8x %8x %8x=sp %8x=pc:,
   f-fr_arg[0], f-fr_arg[1], f-fr_arg[2], f-fr_arg[3],
-  f-fr_arg[4], f-fr_arg[5], f-fr_fp, f-fr_pc);
+  f-fr_arg[4], f-fr_arg[5], (unsigned)(uintptr_t)f-fr_fp, f-fr_pc);
 			db_printsym(f-fr_pc, DB_STGY_PROC, db_printf);
 			db_printf(\n);
 		} else {
@@ -272,7 +296,7 @@
   f-fr_arg[0], f-fr_arg[1], 
   f-fr_arg[2], f-fr_arg[3],
   f-fr_arg[4], f-fr_arg[5], 
-  f-fr_fp, f-fr_pc);
+  (unsigned)(uintptr_t)f-fr_fp, f-fr_pc);
 		}
 	}
 }
@@ -513,9 +537,9 @@
 	ts = DDB_REGS-db_ts[0];
 	tl = DDB_REGS-db_tl;
 	for (i=0; itl; i++) {
-		printf(%d tt=%lx tstate=%lx tpc=%p tnpc=%p\n,
-		   i+1, (long)ts[i].tt, (u_long)ts[i].tstate,
-		   (void*)(u_long)ts[i].tpc, (void*)(u_long)ts[i].tnpc);
+		db_printf(%d tt=%lx tstate=%lx tpc=%p tnpc=%p\n,
+		  i+1, (long)ts[i].tt, (u_long)ts[i].tstate,
+		  (void*)(u_long)ts[i].tpc, (void*)(u_long)ts[i].tnpc);
 	}
 
 }



CVS commit: src/sys/arch/sparc64/sparc64

2011-04-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Apr 13 03:34:38 UTC 2011

Modified Files:
src/sys/arch/sparc64/sparc64: db_interface.c

Log Message:
port to userspace.  this needs db_user.h, stddef.h, stdbool.h and not
promlib.h.  put db_read/write_bytes() under _KERNEL.

XXX: for now, provide an empty db_machine_command_table[].

XXX2: this file puts a lot of it under #ifdef DDB, but i'm not sure
why this is done.  for now it makes it easier to port to userspace :)


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/sys/arch/sparc64/sparc64/db_interface.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/sparc64/sparc64/db_interface.c
diff -u src/sys/arch/sparc64/sparc64/db_interface.c:1.127 src/sys/arch/sparc64/sparc64/db_interface.c:1.128
--- src/sys/arch/sparc64/sparc64/db_interface.c:1.127	Wed Apr 13 03:29:03 2011
+++ src/sys/arch/sparc64/sparc64/db_interface.c	Wed Apr 13 03:34:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.127 2011/04/13 03:29:03 mrg Exp $ */
+/*	$NetBSD: db_interface.c,v 1.128 2011/04/13 03:34:37 mrg Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -34,10 +34,12 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.127 2011/04/13 03:29:03 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.128 2011/04/13 03:34:37 mrg Exp $);
 
+#ifdef _KERNEL_OPT
 #include opt_ddb.h
 #include opt_multiprocessor.h
+#endif
 
 #include sys/param.h
 #include sys/proc.h
@@ -53,6 +55,7 @@
 #include ddb/db_command.h
 #include ddb/db_sym.h
 #include ddb/db_variables.h
+#include ddb/db_user.h
 #include ddb/db_extern.h
 #include ddb/db_access.h
 #include ddb/db_output.h
@@ -61,12 +64,20 @@
 
 #include machine/instr.h
 #include machine/cpu.h
+#ifdef _KERNEL
 #include machine/promlib.h
+#endif
 #include machine/ctlreg.h
 #include machine/pmap.h
 #include machine/intr.h
+#include machine/vmparam.h
 
+#ifdef _KERNEL
 #include fb.h
+#else
+#include stddef.h
+#include stdbool.h
+#endif
 
 extern struct traptrace {
 	unsigned short tl:3,	/* Trap level */
@@ -515,6 +526,7 @@
 }
 #endif	/* DDB */
 
+#ifdef _KERNEL
 /*
  * Read bytes from kernel address space for debugger.
  */
@@ -556,6 +568,7 @@
 	}
 
 }
+#endif
 
 #ifdef DDB
 void
@@ -1306,6 +1319,13 @@
 	{ DDB_ADD_CMD(NULL, NULL,   0,	NULL,NULL,NULL) }
 };
 
+#else	/* DDB */
+
+/* XXX */
+const struct db_command db_machine_command_table[] = {
+	{ DDB_ADD_CMD(NULL, NULL,   0,	NULL,NULL,NULL) }
+};
+
 #endif	/* DDB */
 
 /*
@@ -1358,7 +1378,8 @@
 
   default:
 	/* not a branch */
-	panic(branch_taken() on non-branch);
+	printf(branch_taken() on non-branch);
+	return pc;
 }
 }
 



CVS commit: src/sys/arch/sparc64/include

2011-04-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Apr 13 03:35:19 UTC 2011

Modified Files:
src/sys/arch/sparc64/include: cpu.h

Log Message:
export a bunch of things to _KMEMUSER as well.

XXX: should consolidate the curcpu/curlwp definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/sparc64/include/cpu.h

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

Modified files:

Index: src/sys/arch/sparc64/include/cpu.h
diff -u src/sys/arch/sparc64/include/cpu.h:1.94 src/sys/arch/sparc64/include/cpu.h:1.95
--- src/sys/arch/sparc64/include/cpu.h:1.94	Mon Jan 24 10:04:28 2011
+++ src/sys/arch/sparc64/include/cpu.h	Wed Apr 13 03:35:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.94 2011/01/24 10:04:28 martin Exp $ */
+/*	$NetBSD: cpu.h,v 1.95 2011/04/13 03:35:19 mrg Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -52,7 +52,7 @@
 #define	CPU_ARCH		4	/* integer: cpu architecture version */
 #define	CPU_MAXID		5	/* number of valid machdep ids */
 
-#ifdef _KERNEL
+#if defined(_KERNEL) || defined(_KMEMUSER)
 /*
  * Exported definitions unique to SPARC cpu support.
  */
@@ -66,11 +66,13 @@
 #include machine/reg.h
 #include machine/pte.h
 #include machine/intr.h
+#if defined(_KERNEL)
 #include machine/cpuset.h
-#include sparc64/sparc64/intreg.h
+#endif
 
 #include sys/cpu_data.h
 #include sys/evcnt.h
+
 /*
  * The cpu_info structure is part of a 64KB structure mapped both the kernel
  * pmap and a single locked TTE a CPUINFO_VA for that particular processor.
@@ -172,6 +174,10 @@
 	volatile void		*ci_ddb_regs;	/* DDB regs */
 };
 
+#endif /* _KERNEL || _KMEMUSER */
+
+#ifdef _KERNEL
+
 #define CPUF_PRIMARY	1
 
 /*
@@ -381,5 +387,15 @@
 int	fixalign(struct lwp *, struct trapframe64 *);
 int	emulinstr(vaddr_t, struct trapframe64 *);
 
+#else /* _KERNEL */
+
+/*
+ * XXX: provide some definitions for crash(8), probably can share
+ */
+#if defined(_KMEMUSER)
+#define	curcpu()	(((struct cpu_info *)CPUINFO_VA)-ci_self)
+#define curlwp		curcpu()-ci_curlwp
+#endif
+
 #endif /* _KERNEL */
 #endif /* _CPU_H_ */



CVS commit: src/sys/arch/sparc64/include

2011-04-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Apr 13 03:40:00 UTC 2011

Modified Files:
src/sys/arch/sparc64/include: cpu.h

Log Message:
re-include sparc64/sparc64/intreg.h in kernel mode.  it's necessary.


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/sparc64/include/cpu.h

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

Modified files:

Index: src/sys/arch/sparc64/include/cpu.h
diff -u src/sys/arch/sparc64/include/cpu.h:1.95 src/sys/arch/sparc64/include/cpu.h:1.96
--- src/sys/arch/sparc64/include/cpu.h:1.95	Wed Apr 13 03:35:19 2011
+++ src/sys/arch/sparc64/include/cpu.h	Wed Apr 13 03:40:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.95 2011/04/13 03:35:19 mrg Exp $ */
+/*	$NetBSD: cpu.h,v 1.96 2011/04/13 03:40:00 mrg Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -68,6 +68,7 @@
 #include machine/intr.h
 #if defined(_KERNEL)
 #include machine/cpuset.h
+#include sparc64/sparc64/intreg.h
 #endif
 
 #include sys/cpu_data.h



CVS commit: xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus

2011-04-12 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Wed Apr 13 05:14:00 UTC 2011

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus:
netbsdSbus.c

Log Message:
fix sbusDeviceTable to actually include driver names


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c

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

Modified files:

Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c
diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c:1.2 xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c:1.3
--- xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c:1.2	Fri Jun 26 18:17:42 2009
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c	Wed Apr 13 05:14:00 2011
@@ -54,22 +54,22 @@
 sbusDevicePtr *xf86SbusInfo = NULL;
 
 struct sbus_devtable sbusDeviceTable[] = {
-{ SBUS_DEVICE_BW2, FBTYPE_SUN2BW, bwtwo, Sun Monochrome (bwtwo) },
-{ SBUS_DEVICE_CG2, FBTYPE_SUN2COLOR, cgtwo, Sun Color2 (cgtwo) },
-{ SBUS_DEVICE_CG3, FBTYPE_SUN3COLOR, cgthree, Sun Color3 (cgthree) },
-{ SBUS_DEVICE_CG4, FBTYPE_SUN4COLOR, cgfour, Sun Color4 (cgfour) },
-{ SBUS_DEVICE_CG6, FBTYPE_SUNFAST_COLOR, cgsix, Sun GX },
-{ SBUS_DEVICE_CG8, FBTYPE_MEMCOLOR, cgeight, Sun CG8/RasterOps },
-{ SBUS_DEVICE_CG12, FBTYPE_SUNGP3, cgtwelve, Sun GS (cgtwelve) },
-{ SBUS_DEVICE_CG14, FBTYPE_MDICOLOR, cgfourteen, Sun SX },
-{ SBUS_DEVICE_GT, FBTYPE_SUNGT, gt, Sun Graphics Tower },
-{ SBUS_DEVICE_MGX, -1, mgx, Quantum 3D MGXplus },
-{ SBUS_DEVICE_LEO, FBTYPE_SUNLEO, leo, Sun ZX or Turbo ZX },
-{ SBUS_DEVICE_TCX, FBTYPE_TCXCOLOR, tcx, Sun TCX },
-{ SBUS_DEVICE_FFB, FBTYPE_CREATOR, ffb, Sun FFB },
-{ SBUS_DEVICE_FFB, FBTYPE_CREATOR, afb, Sun Elite3D },
-{ SBUS_DEVICE_P9100, FBTYPE_P9100, pnozz, Weitek P9100 },
-{ SBUS_DEVICE_AG10E, FBTYPE_AG10E, ag10e, Fujitsu AG-10e },
+{ SBUS_DEVICE_BW2, FBTYPE_SUN2BW, bwtwo, sunbw2, Sun Monochrome (bwtwo) },
+{ SBUS_DEVICE_CG2, FBTYPE_SUN2COLOR, cgtwo, NULL, Sun Color2 (cgtwo) },
+{ SBUS_DEVICE_CG3, FBTYPE_SUN3COLOR, cgthree, suncg3, Sun Color3 (cgthree) },
+{ SBUS_DEVICE_CG4, FBTYPE_SUN4COLOR, cgfour, NULL,  Sun Color4 (cgfour) },
+{ SBUS_DEVICE_CG6, FBTYPE_SUNFAST_COLOR, cgsix, suncg6, Sun GX },
+{ SBUS_DEVICE_CG8, FBTYPE_MEMCOLOR, cgeight, NULL, Sun CG8/RasterOps },
+{ SBUS_DEVICE_CG12, FBTYPE_SUNGP3, cgtwelve, NULL, Sun GS (cgtwelve) },
+{ SBUS_DEVICE_CG14, FBTYPE_MDICOLOR, cgfourteen, suncg14, Sun SX },
+{ SBUS_DEVICE_GT, FBTYPE_SUNGT, gt, NULL, Sun Graphics Tower },
+{ SBUS_DEVICE_MGX, -1, mgx, NULL, Quantum 3D MGXplus },
+{ SBUS_DEVICE_LEO, FBTYPE_SUNLEO, leo, sunleo, Sun ZX or Turbo ZX },
+{ SBUS_DEVICE_TCX, FBTYPE_TCXCOLOR, tcx, suntcx, Sun TCX or S24 },
+{ SBUS_DEVICE_FFB, FBTYPE_CREATOR, ffb, sunffb, Sun FFB },
+{ SBUS_DEVICE_FFB, FBTYPE_CREATOR, afb, sunffb, Sun Elite3D },
+{ SBUS_DEVICE_P9100, FBTYPE_P9100, pnozz, pnozz, Weitek P9100 },
+{ SBUS_DEVICE_AG10E, FBTYPE_AG10E, ag10e, ag10e, Fujitsu AG-10e },
 { 0, 0, NULL }
 };
 
@@ -139,6 +139,7 @@
 
 if (ioctl(promFd, OFIOCNEXTPROP, ofio)  0)
 	return 0;
+
 if (!ofio.of_buflen)
 	return 0;
 
@@ -557,9 +558,10 @@
 		break;
 	while ((*prop = 'A'  *prop = 'Z') || *prop == ',')
 		prop++;
-	for (i = 0; sbusDeviceTable[i].devId; i++)
+	for (i = 0; sbusDeviceTable[i].devId; i++) {
 		if (!strcmp(prop, sbusDeviceTable[i].promName))
 		break;
+	}
 	devId = sbusDeviceTable[i].devId;
 	if (!devId)
 		break;