CVS commit: src

2010-12-19 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sun Dec 19 08:10:09 UTC 2010

Modified Files:
src/distrib/sets/lists/comp: mi
src/share/man/man3: Makefile attribute.3 offsetof.3 typeof.3
Added Files:
src/share/man/man3: __alignof__.3

Log Message:
Document the __alignof__ GNU extension.


To generate a diff of this commit:
cvs rdiff -u -r1.1554 -r1.1555 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.64 -r1.65 src/share/man/man3/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man3/__alignof__.3
cvs rdiff -u -r1.8 -r1.9 src/share/man/man3/attribute.3
cvs rdiff -u -r1.2 -r1.3 src/share/man/man3/offsetof.3
cvs rdiff -u -r1.1 -r1.2 src/share/man/man3/typeof.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.1554 src/distrib/sets/lists/comp/mi:1.1555
--- src/distrib/sets/lists/comp/mi:1.1554	Fri Dec 17 12:14:03 2010
+++ src/distrib/sets/lists/comp/mi	Sun Dec 19 08:10:07 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1554 2010/12/17 12:14:03 jruoho Exp $
+#	$NetBSD: mi,v 1.1555 2010/12/19 08:10:07 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -4906,6 +4906,7 @@
 ./usr/share/man/cat3/__UNCONST.0		comp-c-catman		.cat
 ./usr/share/man/cat3/__UNVOLATILE.0		comp-c-catman		.cat
 ./usr/share/man/cat3/__aligned.0		comp-c-catman		.cat
+./usr/share/man/cat3/__alignof__.0		comp-c-catman		.cat
 ./usr/share/man/cat3/__arraycount.0		comp-c-catman		.cat
 ./usr/share/man/cat3/__builtin_object_size.0	comp-c-catman		.cat
 ./usr/share/man/cat3/__cacheline_aligned.0	comp-c-catman		.cat
@@ -10994,6 +10995,7 @@
 ./usr/share/man/html3/__UNCONST.html		comp-c-htmlman		html
 ./usr/share/man/html3/__UNVOLATILE.html		comp-c-htmlman		html
 ./usr/share/man/html3/__aligned.html		comp-c-htmlman		html
+./usr/share/man/html3/__alignof__.html		comp-c-htmlman		html
 ./usr/share/man/html3/__arraycount.html		comp-c-htmlman		html
 ./usr/share/man/html3/__builtin_object_size.html	comp-c-htmlman		html
 ./usr/share/man/html3/__cacheline_aligned.html	comp-c-htmlman		html
@@ -16882,6 +16884,7 @@
 ./usr/share/man/man3/__UNCONST.3		comp-c-man		.man
 ./usr/share/man/man3/__UNVOLATILE.3		comp-c-man		.man
 ./usr/share/man/man3/__aligned.3		comp-c-man		.man
+./usr/share/man/man3/__alignof__.3		comp-c-man		.man
 ./usr/share/man/man3/__arraycount.3		comp-c-man		.man
 ./usr/share/man/man3/__builtin_object_size.3	comp-c-man		.man
 ./usr/share/man/man3/__cacheline_aligned.3	comp-c-man		.man

Index: src/share/man/man3/Makefile
diff -u src/share/man/man3/Makefile:1.64 src/share/man/man3/Makefile:1.65
--- src/share/man/man3/Makefile:1.64	Fri Dec 17 12:14:04 2010
+++ src/share/man/man3/Makefile	Sun Dec 19 08:10:08 2010
@@ -1,8 +1,8 @@
-#	$NetBSD: Makefile,v 1.64 2010/12/17 12:14:04 jruoho Exp $
+#	$NetBSD: Makefile,v 1.65 2010/12/19 08:10:08 jruoho Exp $
 #	@(#)Makefile	8.2 (Berkeley) 12/13/93
 
 MAN=	_DIAGASSERT.3 __CONCAT.3 __UNCONST.3 CMSG_DATA.3 \
-	__arraycount.3 __insn_barrier.3 \
+	__alignof__.3 __arraycount.3 __insn_barrier.3 \
 	assert.3 attribute.3 bits.3 bitstring.3 \
 	cdefs.3 dirent.3 dlfcn.3 dl_iterate_phdr.3 end.3 \
 	fast_divide32.3 ffs32.3 gcq.3 \

Index: src/share/man/man3/attribute.3
diff -u src/share/man/man3/attribute.3:1.8 src/share/man/man3/attribute.3:1.9
--- src/share/man/man3/attribute.3:1.8	Fri Dec 17 08:23:04 2010
+++ src/share/man/man3/attribute.3	Sun Dec 19 08:10:09 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: attribute.3,v 1.8 2010/12/17 08:23:04 jruoho Exp $
+.\ $NetBSD: attribute.3,v 1.9 2010/12/19 08:10:09 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 December 16, 2010
+.Dd December 19, 2010
 .Dt ATTRIBUTE 3
 .Os
 .Sh NAME
@@ -208,6 +208,9 @@
 The effectiveness of
 .Fn __aligned
 is largely dependent on the linker.
+The
+.Xr __alignof__ 3
+operator can be used to examine the alignment.
 .It Fn __section section
 The
 .Fn __section

Index: src/share/man/man3/offsetof.3
diff -u src/share/man/man3/offsetof.3:1.2 src/share/man/man3/offsetof.3:1.3
--- src/share/man/man3/offsetof.3:1.2	Sun Mar 21 12:36:21 2010
+++ src/share/man/man3/offsetof.3	Sun Dec 19 08:10:09 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: offsetof.3,v 1.2 2010/03/21 12:36:21 jruoho Exp $
+.\	$NetBSD: offsetof.3,v 1.3 2010/12/19 08:10:09 jruoho Exp $
 .\
 .\	$OpenBSD: offsetof.3,v 1.2 2010/02/18 18:30:19 jmc Exp $
 .\
@@ -17,7 +17,7 @@
 .\ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\
 .\
-.Dd February 18, 2010
+.Dd December 19, 2010
 .Dt OFFSETOF 3
 .Os
 .Sh NAME
@@ -42,7 +42,9 @@
 .Ar member
 is not aligned to a byte boundary (i.e. it is a bit-field).
 .Sh SEE ALSO
-.Xr stddef 3
+.Xr __alignof__ 3 ,
+.Xr stddef 3 ,
+.Xr typeof 3
 .Sh STANDARDS
 The
 .Fn 

CVS commit: src/share/man/man3

2010-12-19 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sun Dec 19 08:14:03 UTC 2010

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

Log Message:
A small fix.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man3/__alignof__.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/__alignof__.3
diff -u src/share/man/man3/__alignof__.3:1.1 src/share/man/man3/__alignof__.3:1.2
--- src/share/man/man3/__alignof__.3:1.1	Sun Dec 19 08:10:09 2010
+++ src/share/man/man3/__alignof__.3	Sun Dec 19 08:14:03 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: __alignof__.3,v 1.1 2010/12/19 08:10:09 jruoho Exp $
+.\ $NetBSD: __alignof__.3,v 1.2 2010/12/19 08:14:03 jruoho Exp $
 .\
 .\ Copyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
 .\ All rights reserved.
@@ -32,7 +32,7 @@
 .Nd GNU extension for alignment of an object
 .Sh SYNOPSIS
 .Ft int
-.Fn __alignof__ void type
+.Fn __alignof__ void x
 .Sh DESCRIPTION
 The
 .Fn __alignof__



CVS commit: src/lib/libc/ssp

2010-12-19 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sun Dec 19 08:21:36 UTC 2010

Modified Files:
src/lib/libc/ssp: __builtin_object_size.3

Log Message:
Fix SYNOPSIS, add CAVEATS.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/ssp/__builtin_object_size.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/ssp/__builtin_object_size.3
diff -u src/lib/libc/ssp/__builtin_object_size.3:1.6 src/lib/libc/ssp/__builtin_object_size.3:1.7
--- src/lib/libc/ssp/__builtin_object_size.3:1.6	Thu Dec 16 17:50:39 2010
+++ src/lib/libc/ssp/__builtin_object_size.3	Sun Dec 19 08:21:36 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: __builtin_object_size.3,v 1.6 2010/12/16 17:50:39 jruoho Exp $
+.\	$NetBSD: __builtin_object_size.3,v 1.7 2010/12/19 08:21:36 jruoho Exp $
 .\
 .\ Copyright (c) 2007 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -28,13 +28,13 @@
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
 .\
-.Dd December 16, 2010
+.Dd December 19, 2010
 .Dt __BUILTIN_OBJECT_SIZE 3
 .Os
 .Sh NAME
 .Nm __builtin_object_size
 .Nd return the size of the given object
-.Sh LIBRARY
+.Sh SYNOPSIS
 .Ft size_t
 .Fn __builtin_object_size void *ptr int type
 .Sh DESCRIPTION
@@ -85,3 +85,5 @@
 .Fn __builtin_object_size
 appeared in
 .Tn GCC 4.1 .
+.Sh CAVEATS
+This is a non-standard, compiler-specific extension.



CVS commit: src/lib/libc/ssp

2010-12-19 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sun Dec 19 08:28:40 UTC 2010

Modified Files:
src/lib/libc/ssp: ssp.3

Log Message:
Small modifications to wording, tidy up SEE ALSO.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/ssp/ssp.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/ssp/ssp.3
diff -u src/lib/libc/ssp/ssp.3:1.4 src/lib/libc/ssp/ssp.3:1.5
--- src/lib/libc/ssp/ssp.3:1.4	Sun May 25 20:07:14 2008
+++ src/lib/libc/ssp/ssp.3	Sun Dec 19 08:28:40 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: ssp.3,v 1.4 2008/05/25 20:07:14 wiz Exp $
+.\	$NetBSD: ssp.3,v 1.5 2010/12/19 08:28:40 jruoho Exp $
 .\
 .\ Copyright (c) 2007 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -28,7 +28,7 @@
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
 .\
-.Dd May 23, 2007
+.Dd December 19, 2010
 .Dt SSP 3
 .Os
 .Sh NAME
@@ -82,13 +82,13 @@
 .Dv _FORTIFY_SOURCE
 bounds checking is enabled as described below, the above functions get
 overwritten to use the
-.Xr gcc 1
 .Xr __builtin_object_size 3
 function to compute the size of
-.Fa str
-if known at compile time and perform bounds check on it in order
+.Fa str ,
+if known at compile time,
+and perform bounds check on it in order
 to avoid data buffer or stack buffer overflows.
-If an overflow is detected the routines will call
+If an overflow is detected, the routines will call
 .Xr abort 3 .
 .Pp
 To enable these function overrides the following should be added to the
@@ -110,13 +110,10 @@
 it will compute the minimum buffer size.
 .Sh SEE ALSO
 .Xr gcc 1 ,
-.Xr read 2 ,
-.Xr readlink 2 ,
 .Xr __builtin_object_size 3 ,
-.Xr abort 3 ,
-.Xr getcwd 3 ,
 .Xr stdio 3 ,
-.Xr string 3
+.Xr string 3 ,
+.Xr security 8
 .Sh HISTORY
 The
 .Nm ssp



CVS commit: src/share/man/man8

2010-12-19 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sun Dec 19 08:31:39 UTC 2010

Modified Files:
src/share/man/man8: security.8

Log Message:
Xref ssp(3) and clean SEE ALSO.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/share/man/man8/security.8

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/man8/security.8
diff -u src/share/man/man8/security.8:1.26 src/share/man/man8/security.8:1.27
--- src/share/man/man8/security.8:1.26	Wed Apr 21 06:00:06 2010
+++ src/share/man/man8/security.8	Sun Dec 19 08:31:38 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: security.8,v 1.26 2010/04/21 06:00:06 jruoho Exp $
+.\ $NetBSD: security.8,v 1.27 2010/12/19 08:31:38 jruoho Exp $
 .\
 .\ Copyright (c) 2006 Elad Efrat e...@netbsd.org
 .\ All rights reserved.
@@ -25,7 +25,7 @@
 .\ (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 21, 2010
+.Dd December 19, 2010
 .Dt SECURITY 8
 .Os
 .Sh NAME
@@ -382,12 +382,10 @@
 # sysctl -w security.curtain=1
 .Ed
 .Sh SEE ALSO
-.Xr sysctl 3 ,
+.Xr ssp 3 ,
 .Xr options 4 ,
 .Xr paxctl 8 ,
 .Xr sysctl 8 ,
-.Xr veriexec 8 ,
-.Xr veriexecctl 8 ,
-.Xr veriexecgen 8
+.Xr veriexec 8
 .Sh AUTHORS
 .An Elad Efrat Aq e...@netbsd.org



CVS commit: src/sys/arch/amigappc/amigappc

2010-12-19 Thread Jukka Andberg
Module Name:src
Committed By:   jandberg
Date:   Sun Dec 19 08:32:33 UTC 2010

Modified Files:
src/sys/arch/amigappc/amigappc: machdep.c

Log Message:
Identify another type of BPPC correctly


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/amigappc/amigappc/machdep.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/amigappc/amigappc/machdep.c
diff -u src/sys/arch/amigappc/amigappc/machdep.c:1.44 src/sys/arch/amigappc/amigappc/machdep.c:1.45
--- src/sys/arch/amigappc/amigappc/machdep.c:1.44	Mon Nov  1 19:00:08 2010
+++ src/sys/arch/amigappc/amigappc/machdep.c	Sun Dec 19 08:32:33 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.44 2010/11/01 19:00:08 phx Exp $ */
+/* $NetBSD: machdep.c,v 1.45 2010/12/19 08:32:33 jandberg Exp $ */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.44 2010/11/01 19:00:08 phx Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.45 2010/12/19 08:32:33 jandberg Exp $);
 
 #include sys/param.h
 #include sys/mount.h
@@ -304,7 +304,7 @@
 		cpu = 603;
 		break;
 	case 7:
-		cpuname = 603e+;
+		cpuname = 603ev;
 		cpu = 603;
 		break;
 	case 9:
@@ -328,6 +328,7 @@
 	case 'F':
 		pup = [CS Mk.III];
 		break;
+	case 'H':
 	case 'I':
 		pup = [BlizzardPPC];
 		break;



CVS commit: src/share/man/man3

2010-12-19 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Dec 19 08:56:17 UTC 2010

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

Log Message:
Uppercase Dt argument, use \e for backslashes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man3/__alignof__.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/__alignof__.3
diff -u src/share/man/man3/__alignof__.3:1.2 src/share/man/man3/__alignof__.3:1.3
--- src/share/man/man3/__alignof__.3:1.2	Sun Dec 19 08:14:03 2010
+++ src/share/man/man3/__alignof__.3	Sun Dec 19 08:56:17 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: __alignof__.3,v 1.2 2010/12/19 08:14:03 jruoho Exp $
+.\ $NetBSD: __alignof__.3,v 1.3 2010/12/19 08:56:17 wiz Exp $
 .\
 .\ Copyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
 .\ All rights reserved.
@@ -25,7 +25,7 @@
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
 .Dd December 19, 2010
-.Dt __alignof__ 3
+.Dt __ALIGNOF__ 3
 .Os
 .Sh NAME
 .Nm __alignof__
@@ -61,7 +61,7 @@
 If the architecture aligns integers along 32-bit address boundaries,
 the following should print the value 4.
 .Bd -literal -offset indent
-(void)printf(\*[q]%d\\n\*[q], __alignof__(int));
+(void)printf(\*[q]%d\en\*[q], __alignof__(int));
 .Ed
 .Pp
 On the other hand, the following example probably prints the value 1,
@@ -73,7 +73,7 @@
 	char y;
 } a;
 
-(void)printf(\*[q]%d\\n\*[q], __alignof__(a.y));
+(void)printf(\*[q]%d\en\*[q], __alignof__(a.y));
 .Ed
 .Sh SEE ALSO
 .Xr gcc 1 ,



CVS commit: src

2010-12-19 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sun Dec 19 09:30:50 UTC 2010

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

Log Message:
Document the __builtin_return_address() GNU extension. Again this is well
justified due to the wide use of these non-standard extensions in the tree.


To generate a diff of this commit:
cvs rdiff -u -r1.1555 -r1.1556 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.65 -r1.66 src/share/man/man3/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man3/__builtin_return_address.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.1555 src/distrib/sets/lists/comp/mi:1.1556
--- src/distrib/sets/lists/comp/mi:1.1555	Sun Dec 19 08:10:07 2010
+++ src/distrib/sets/lists/comp/mi	Sun Dec 19 09:30:49 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1555 2010/12/19 08:10:07 jruoho Exp $
+#	$NetBSD: mi,v 1.1556 2010/12/19 09:30:49 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -4908,7 +4908,9 @@
 ./usr/share/man/cat3/__aligned.0		comp-c-catman		.cat
 ./usr/share/man/cat3/__alignof__.0		comp-c-catman		.cat
 ./usr/share/man/cat3/__arraycount.0		comp-c-catman		.cat
+./usr/share/man/cat3/__builtin_frame_address.0	comp-c-catman		.cat
 ./usr/share/man/cat3/__builtin_object_size.0	comp-c-catman		.cat
+./usr/share/man/cat3/__builtin_return_address.0	comp-c-catman		.cat
 ./usr/share/man/cat3/__cacheline_aligned.0	comp-c-catman		.cat
 ./usr/share/man/cat3/__constfunc.0		comp-c-catman		.cat
 ./usr/share/man/cat3/__dead.0			comp-c-catman		.cat
@@ -10997,7 +10999,9 @@
 ./usr/share/man/html3/__aligned.html		comp-c-htmlman		html
 ./usr/share/man/html3/__alignof__.html		comp-c-htmlman		html
 ./usr/share/man/html3/__arraycount.html		comp-c-htmlman		html
+./usr/share/man/html3/__builtin_frame_address.html	comp-c-htmlman		html
 ./usr/share/man/html3/__builtin_object_size.html	comp-c-htmlman		html
+./usr/share/man/html3/__builtin_return_address.html	comp-c-htmlman		html
 ./usr/share/man/html3/__cacheline_aligned.html	comp-c-htmlman		html
 ./usr/share/man/html3/__constfunc.html		comp-c-htmlman		html
 ./usr/share/man/html3/__dead.html		comp-c-htmlman		html
@@ -16886,7 +16890,9 @@
 ./usr/share/man/man3/__aligned.3		comp-c-man		.man
 ./usr/share/man/man3/__alignof__.3		comp-c-man		.man
 ./usr/share/man/man3/__arraycount.3		comp-c-man		.man
+./usr/share/man/man3/__builtin_frame_address.3	comp-c-man		.man
 ./usr/share/man/man3/__builtin_object_size.3	comp-c-man		.man
+./usr/share/man/man3/__builtin_return_address.3	comp-c-man		.man
 ./usr/share/man/man3/__cacheline_aligned.3	comp-c-man		.man
 ./usr/share/man/man3/__constfunc.3		comp-c-man		.man
 ./usr/share/man/man3/__dead.3			comp-c-man		.man

Index: src/share/man/man3/Makefile
diff -u src/share/man/man3/Makefile:1.65 src/share/man/man3/Makefile:1.66
--- src/share/man/man3/Makefile:1.65	Sun Dec 19 08:10:08 2010
+++ src/share/man/man3/Makefile	Sun Dec 19 09:30:50 2010
@@ -1,8 +1,9 @@
-#	$NetBSD: Makefile,v 1.65 2010/12/19 08:10:08 jruoho Exp $
+#	$NetBSD: Makefile,v 1.66 2010/12/19 09:30:50 jruoho Exp $
 #	@(#)Makefile	8.2 (Berkeley) 12/13/93
 
 MAN=	_DIAGASSERT.3 __CONCAT.3 __UNCONST.3 CMSG_DATA.3 \
-	__alignof__.3 __arraycount.3 __insn_barrier.3 \
+	__alignof__.3 __arraycount.3 \
+	__builtin_return_address.3 __insn_barrier.3 \
 	assert.3 attribute.3 bits.3 bitstring.3 \
 	cdefs.3 dirent.3 dlfcn.3 dl_iterate_phdr.3 end.3 \
 	fast_divide32.3 ffs32.3 gcq.3 \
@@ -15,6 +16,7 @@
 
 MLINKS+=__CONCAT.3 __STRING.3
 MLINKS+=__UNCONST.3 __UNVOLATILE.3
+MLINKS+=__builtin_return_address.3 __builtin_frame_address.3
 MLINKS+=attribute.3 __dead.3 \
 	attribute.3 __pure.3 \
 	attribute.3 __constfunc.3 \

Added files:

Index: src/share/man/man3/__builtin_return_address.3
diff -u /dev/null src/share/man/man3/__builtin_return_address.3:1.1
--- /dev/null	Sun Dec 19 09:30:50 2010
+++ src/share/man/man3/__builtin_return_address.3	Sun Dec 19 09:30:50 2010
@@ -0,0 +1,67 @@
+.\ $NetBSD: __builtin_return_address.3,v 1.1 2010/12/19 09:30:50 jruoho Exp $
+.\
+.\ Copyright (c) 2010 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 

CVS commit: src/lib/libc/ssp

2010-12-19 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sun Dec 19 09:33:52 UTC 2010

Modified Files:
src/lib/libc/ssp: __builtin_object_size.3

Log Message:
Xref __builtin_return_address(3).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/ssp/__builtin_object_size.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/ssp/__builtin_object_size.3
diff -u src/lib/libc/ssp/__builtin_object_size.3:1.7 src/lib/libc/ssp/__builtin_object_size.3:1.8
--- src/lib/libc/ssp/__builtin_object_size.3:1.7	Sun Dec 19 08:21:36 2010
+++ src/lib/libc/ssp/__builtin_object_size.3	Sun Dec 19 09:33:52 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: __builtin_object_size.3,v 1.7 2010/12/19 08:21:36 jruoho Exp $
+.\	$NetBSD: __builtin_object_size.3,v 1.8 2010/12/19 09:33:52 jruoho Exp $
 .\
 .\ Copyright (c) 2007 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -78,6 +78,7 @@
 .Dv \*[Am] 2 != 0 .
 .Sh SEE ALSO
 .Xr gcc 1 ,
+.Xr __builtin_return_address 3 ,
 .Xr attribute 3 ,
 .Xr ssp 3
 .Sh HISTORY



CVS commit: src

2010-12-19 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sun Dec 19 10:07:24 UTC 2010

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

Log Message:
Document __builtin_constant_p().


To generate a diff of this commit:
cvs rdiff -u -r1.1556 -r1.1557 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.66 -r1.67 src/share/man/man3/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man3/__builtin_constant_p.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.1556 src/distrib/sets/lists/comp/mi:1.1557
--- src/distrib/sets/lists/comp/mi:1.1556	Sun Dec 19 09:30:49 2010
+++ src/distrib/sets/lists/comp/mi	Sun Dec 19 10:07:23 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1556 2010/12/19 09:30:49 jruoho Exp $
+#	$NetBSD: mi,v 1.1557 2010/12/19 10:07:23 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -4908,6 +4908,7 @@
 ./usr/share/man/cat3/__aligned.0		comp-c-catman		.cat
 ./usr/share/man/cat3/__alignof__.0		comp-c-catman		.cat
 ./usr/share/man/cat3/__arraycount.0		comp-c-catman		.cat
+./usr/share/man/cat3/__builtin_constant_p.0	comp-c-catman		.cat
 ./usr/share/man/cat3/__builtin_frame_address.0	comp-c-catman		.cat
 ./usr/share/man/cat3/__builtin_object_size.0	comp-c-catman		.cat
 ./usr/share/man/cat3/__builtin_return_address.0	comp-c-catman		.cat
@@ -10999,6 +11000,7 @@
 ./usr/share/man/html3/__aligned.html		comp-c-htmlman		html
 ./usr/share/man/html3/__alignof__.html		comp-c-htmlman		html
 ./usr/share/man/html3/__arraycount.html		comp-c-htmlman		html
+./usr/share/man/html3/__builtin_constant_p.html		comp-c-htmlman		html
 ./usr/share/man/html3/__builtin_frame_address.html	comp-c-htmlman		html
 ./usr/share/man/html3/__builtin_object_size.html	comp-c-htmlman		html
 ./usr/share/man/html3/__builtin_return_address.html	comp-c-htmlman		html
@@ -16890,6 +16892,7 @@
 ./usr/share/man/man3/__aligned.3		comp-c-man		.man
 ./usr/share/man/man3/__alignof__.3		comp-c-man		.man
 ./usr/share/man/man3/__arraycount.3		comp-c-man		.man
+./usr/share/man/man3/__builtin_constant_p.3	comp-c-man		.man
 ./usr/share/man/man3/__builtin_frame_address.3	comp-c-man		.man
 ./usr/share/man/man3/__builtin_object_size.3	comp-c-man		.man
 ./usr/share/man/man3/__builtin_return_address.3	comp-c-man		.man

Index: src/share/man/man3/Makefile
diff -u src/share/man/man3/Makefile:1.66 src/share/man/man3/Makefile:1.67
--- src/share/man/man3/Makefile:1.66	Sun Dec 19 09:30:50 2010
+++ src/share/man/man3/Makefile	Sun Dec 19 10:07:24 2010
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.66 2010/12/19 09:30:50 jruoho Exp $
+#	$NetBSD: Makefile,v 1.67 2010/12/19 10:07:24 jruoho Exp $
 #	@(#)Makefile	8.2 (Berkeley) 12/13/93
 
 MAN=	_DIAGASSERT.3 __CONCAT.3 __UNCONST.3 CMSG_DATA.3 \
 	__alignof__.3 __arraycount.3 \
-	__builtin_return_address.3 __insn_barrier.3 \
+	__builtin_constant_p.3 __builtin_return_address.3 __insn_barrier.3 \
 	assert.3 attribute.3 bits.3 bitstring.3 \
 	cdefs.3 dirent.3 dlfcn.3 dl_iterate_phdr.3 end.3 \
 	fast_divide32.3 ffs32.3 gcq.3 \

Added files:

Index: src/share/man/man3/__builtin_constant_p.3
diff -u /dev/null src/share/man/man3/__builtin_constant_p.3:1.1
--- /dev/null	Sun Dec 19 10:07:24 2010
+++ src/share/man/man3/__builtin_constant_p.3	Sun Dec 19 10:07:24 2010
@@ -0,0 +1,78 @@
+.\ $NetBSD: __builtin_constant_p.3,v 1.1 2010/12/19 10:07:24 jruoho Exp $
+.\
+.\ Copyright (c) 2010 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.
+.\

CVS commit: src/share/man/man3

2010-12-19 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sun Dec 19 10:08:44 UTC 2010

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

Log Message:
Fix xref.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man3/__builtin_constant_p.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/__builtin_constant_p.3
diff -u src/share/man/man3/__builtin_constant_p.3:1.1 src/share/man/man3/__builtin_constant_p.3:1.2
--- src/share/man/man3/__builtin_constant_p.3:1.1	Sun Dec 19 10:07:24 2010
+++ src/share/man/man3/__builtin_constant_p.3	Sun Dec 19 10:08:44 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: __builtin_constant_p.3,v 1.1 2010/12/19 10:07:24 jruoho Exp $
+.\ $NetBSD: __builtin_constant_p.3,v 1.2 2010/12/19 10:08:44 jruoho Exp $
 .\
 .\ Copyright (c) 2010 Jukka Ruohonen jruoho...@iki.fi
 .\ All rights reserved.
@@ -61,7 +61,7 @@
 fold the computation if it involves a constant,
 but a function call is needed otherwise.
 For instance,
-.Xr bswap 16
+.Xr bswap16 3
 is defined in
 .Nx
 as:



CVS commit: src/sys/arch/amigappc/amigappc

2010-12-19 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Dec 19 11:05:06 UTC 2010

Modified Files:
src/sys/arch/amigappc/amigappc: machdep.c

Log Message:
The 604e User's Manual states that the PLL_CFG settings are compatible with
the 603e, so we just need a single pll-table. Also, the PLL_CFG settings in
the 603e manual seem to be partly wrong, leading to some misdetected cpu
clocks for the BPPC cards.
Patch by Radoslaw Kujawa.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/amigappc/amigappc/machdep.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/amigappc/amigappc/machdep.c
diff -u src/sys/arch/amigappc/amigappc/machdep.c:1.45 src/sys/arch/amigappc/amigappc/machdep.c:1.46
--- src/sys/arch/amigappc/amigappc/machdep.c:1.45	Sun Dec 19 08:32:33 2010
+++ src/sys/arch/amigappc/amigappc/machdep.c	Sun Dec 19 11:05:06 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.45 2010/12/19 08:32:33 jandberg Exp $ */
+/* $NetBSD: machdep.c,v 1.46 2010/12/19 11:05:06 phx Exp $ */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.45 2010/12/19 08:32:33 jandberg Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.46 2010/12/19 11:05:06 phx Exp $);
 
 #include sys/param.h
 #include sys/mount.h
@@ -243,15 +243,10 @@
 
 	/* handlers for all 6 Amiga interrupt levels */
 	intr_establish(1, IST_LEVEL, IPL_BIO, lev1_intr, NULL);
-
 	intr_establish(2, IST_LEVEL, IPL_BIO, ports_intr, isr_ports);
-
 	intr_establish(3, IST_LEVEL, IPL_TTY, lev3_intr, NULL);
-
 	intr_establish(4, IST_LEVEL, IPL_AUDIO, lev4_intr, NULL);
-
 	intr_establish(5, IST_LEVEL, IPL_SERIAL, lev5_intr, NULL);
-
 	intr_establish(6, IST_LEVEL, IPL_SERIAL, exter_intr, isr_exter);
 }
 
@@ -259,17 +254,12 @@
 amigappc_identify(void)
 {
 	extern u_long ns_per_tick, ticks_per_sec;
-	static const unsigned char pll603[] = {
-		10, 10, 10, 10, 20, 20, 25, 00,
-		30, 00, 40, 00, 15, 00, 35, 00
-	};
-	static const unsigned char pll604[] = {
+	static const unsigned char pll[] = {
 		10, 10, 70, 10, 20, 65, 25, 45,
 		30, 55, 40, 50, 15, 60, 35, 00
 	};
 	const char *cpuname, *mach, *p5type_p, *pup;
 	u_long busclock, cpuclock;
-	int cpu;
 	register int pvr, hid1;
 
 	/* PowerUp ROM id location */
@@ -289,32 +279,26 @@
 	else
 		mach = Amiga 1200;
 
-	/* find CPU type - BlizzardPPC has 603e, CyberstormPPC has 604e */
+	/* find CPU type - BlizzardPPC has 603e/603ev, CyberstormPPC has 604e */
 	switch (pvr  16) {
 	case 3:
 		cpuname = 603;
-		cpu = 603;
 		break;
 	case 4:
 		cpuname = 604;
-		cpu = 604;
 		break;
 	case 6:
 		cpuname = 603e;
-		cpu = 603;
 		break;
 	case 7:
 		cpuname = 603ev;
-		cpu = 603;
 		break;
 	case 9:
 	case 10:
 		cpuname = 604e;
-		cpu = 604;
 		break;
 	default:
 		cpuname = unknown;
-		cpu = 604;
 		break;
 	}
 
@@ -349,10 +333,7 @@
 	}
 
 	/* compute cpuclock based on PLL configuration */
-	if (cpu == 603)
-		cpuclock = busclock * pll603[hid128  0xf] / 10;
-	else /* 604 */
-		cpuclock = busclock * pll604[hid128  0xf] / 10;
+	cpuclock = busclock * pll[hid128  0xf] / 10;
 
 	snprintf(model, sizeof(model),
 	%s %s (%s v%d.%d %lu MHz, busclk %lu MHz),



CVS commit: src/external/mit/xorg/tools/bdftopcf

2010-12-19 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Dec 19 13:04:54 UTC 2010

Modified Files:
src/external/mit/xorg/tools/bdftopcf: Makefile

Log Message:
Disable bzip2 support in tools bdftopcf(1).
We don't use bzip2 fonts on build and some OS doesn't have bzip2 headers.
Ok'ed by mrg@, martin@, fixes PR/44138.

Should be pulled up to netbsd-5 (and netbsd-5-1).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/mit/xorg/tools/bdftopcf/Makefile

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

Modified files:

Index: src/external/mit/xorg/tools/bdftopcf/Makefile
diff -u src/external/mit/xorg/tools/bdftopcf/Makefile:1.4 src/external/mit/xorg/tools/bdftopcf/Makefile:1.5
--- src/external/mit/xorg/tools/bdftopcf/Makefile:1.4	Sat Aug 14 11:12:16 2010
+++ src/external/mit/xorg/tools/bdftopcf/Makefile	Sun Dec 19 13:04:54 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2010/08/14 11:12:16 mrg Exp $
+#	$NetBSD: Makefile,v 1.5 2010/12/19 13:04:54 tsutsui Exp $
 
 NOMAN=		1
 
@@ -16,7 +16,7 @@
 		-I${DESTDIR}${X11INCDIR}/X11/fonts \
 		-I${DESTDIR}${X11INCDIR}/freetype2 \
 		-I${X11SRCDIR.Xfont}/src/stubs \
-		-DBDFFORMAT -DPCFFORMAT -DSNFFORMAT -DX_GZIP_FONT_COMPRESSION -DX_BZIP2_FONT_COMPRESSION \
+		-DBDFFORMAT -DPCFFORMAT -DSNFFORMAT -DX_GZIP_FONT_COMPRESSION \
 		-DFONT_ENCODINGS_DIRECTORY=\${X11FONTDIR}/encodings/encodings.dir\
 
 .PATH:		${X11SRCDIR.Xfont}/src/bitmap
@@ -24,12 +24,12 @@
 		pcfread.c pcfwrite.c
 
 .PATH:		${X11SRCDIR.Xfont}/src/fontfile
-SRCS+=		bufio.c decompress.c defaults.c fileio.c filewr.c gunzip.c bunzip2.c
+SRCS+=		bufio.c decompress.c defaults.c fileio.c filewr.c gunzip.c
 
 .PATH:		${X11SRCDIR.Xfont}/src/util
 SRCS+=		atom.c fontaccel.c private.c utilbitmap.c
 
-LDADD+=		-lz -lbz2
+LDADD+=		-lz
 
 .include bsd.x11.mk
 .include bsd.hostprog.mk



CVS commit: src/sys/arch/amigappc/amigappc

2010-12-19 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Dec 19 14:46:10 UTC 2010

Modified Files:
src/sys/arch/amigappc/amigappc: machdep.c

Log Message:
Fixed serial RBF interrupt.
We have to call ser_fastint() instead of ser_intr().


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/amigappc/amigappc/machdep.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/amigappc/amigappc/machdep.c
diff -u src/sys/arch/amigappc/amigappc/machdep.c:1.46 src/sys/arch/amigappc/amigappc/machdep.c:1.47
--- src/sys/arch/amigappc/amigappc/machdep.c:1.46	Sun Dec 19 11:05:06 2010
+++ src/sys/arch/amigappc/amigappc/machdep.c	Sun Dec 19 14:46:10 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.46 2010/12/19 11:05:06 phx Exp $ */
+/* $NetBSD: machdep.c,v 1.47 2010/12/19 14:46:10 phx Exp $ */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.46 2010/12/19 11:05:06 phx Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.47 2010/12/19 14:46:10 phx Exp $);
 
 #include sys/param.h
 #include sys/mount.h
@@ -68,7 +68,7 @@
 extern void setup_amiga_intr(void);
 #if NSER  0
 extern void ser_outintr(void);
-extern void serintr(void);
+extern void ser_fastint(void);
 #endif
 #if NFD  0
 extern void fdintr(int);
@@ -227,12 +227,9 @@
 static int
 lev5_intr(void *arg)
 {
-	unsigned short ireq;
 
-	ireq = custom.intreqr;
-	if (ireq  INTF_RBF)
-		serintr();
-	if (ireq  INTF_DSKSYNC)
+	ser_fastint();
+	if (custom.intreqr  INTF_DSKSYNC)
 		custom.intreq = INTF_DSKSYNC;
 	return 0;
 }



CVS commit: src/doc

2010-12-19 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Dec 19 15:57:26 UTC 2010

Modified Files:
src/doc: CHANGES

Log Message:
amigappc onboard serial works


To generate a diff of this commit:
cvs rdiff -u -r1.1475 -r1.1476 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1475 src/doc/CHANGES:1.1476
--- src/doc/CHANGES:1.1475	Sat Dec 18 09:37:05 2010
+++ src/doc/CHANGES	Sun Dec 19 15:57:25 2010
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1475 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1476 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -814,3 +814,4 @@
 		don't require locking and can operate on user-specified
 		timezones as opposed to having to alter the environment
 		to change a timezone. [christos 20101216]
+	amigappc: Made onboard serial interface work. [20101219]



CVS commit: src/doc

2010-12-19 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Sun Dec 19 15:58:15 UTC 2010

Modified Files:
src/doc: CHANGES

Log Message:
Fixed typo.


To generate a diff of this commit:
cvs rdiff -u -r1.1476 -r1.1477 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1476 src/doc/CHANGES:1.1477
--- src/doc/CHANGES:1.1476	Sun Dec 19 15:57:25 2010
+++ src/doc/CHANGES	Sun Dec 19 15:58:14 2010
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1476 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1477 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -814,4 +814,4 @@
 		don't require locking and can operate on user-specified
 		timezones as opposed to having to alter the environment
 		to change a timezone. [christos 20101216]
-	amigappc: Made onboard serial interface work. [20101219]
+	amigappc: Made onboard serial interface work. [phx 20101219]



CVS commit: src/usr.sbin/acpitools/acpidump

2010-12-19 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Sun Dec 19 16:25:16 UTC 2010

Modified Files:
src/usr.sbin/acpitools/acpidump: acpi.c

Log Message:
Fix theoretical buffer overflow by using MAXPATHLEN for realpath(3).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/acpitools/acpidump/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/usr.sbin/acpitools/acpidump/acpi.c
diff -u src/usr.sbin/acpitools/acpidump/acpi.c:1.5 src/usr.sbin/acpitools/acpidump/acpi.c:1.6
--- src/usr.sbin/acpitools/acpidump/acpi.c:1.5	Tue Dec 22 08:44:03 2009
+++ src/usr.sbin/acpitools/acpidump/acpi.c	Sun Dec 19 16:25:16 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi.c,v 1.5 2009/12/22 08:44:03 cegger Exp $ */
+/* $NetBSD: acpi.c,v 1.6 2010/12/19 16:25:16 jruoho Exp $ */
 
 /*-
  * Copyright (c) 1998 Doug Rabson
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: acpi.c,v 1.5 2009/12/22 08:44:03 cegger Exp $);
+__RCSID($NetBSD: acpi.c,v 1.6 2010/12/19 16:25:16 jruoho Exp $);
 
 #include sys/param.h
 #include sys/endian.h
@@ -2335,7 +2335,7 @@
 void
 aml_disassemble(ACPI_TABLE_HEADER *rsdt, ACPI_TABLE_HEADER *dsdp)
 {
-	char buf[PATH_MAX], tmpstr[PATH_MAX];
+	char buf[MAXPATHLEN], tmpstr[MAXPATHLEN];
 	const char *tmpdir;
 	char *tmpext;
 	FILE *fp;



CVS commit: src/lib/libc/sys

2010-12-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 19 16:54:10 UTC 2010

Modified Files:
src/lib/libc/sys: ioctl.2

Log Message:
Make the ioctl prototype reflect reality and explain why. Also mention that
the generic file descriptor manipulation ioctls are superceded by the
equivalent fcntl one.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libc/sys/ioctl.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/libc/sys/ioctl.2
diff -u src/lib/libc/sys/ioctl.2:1.21 src/lib/libc/sys/ioctl.2:1.22
--- src/lib/libc/sys/ioctl.2:1.21	Tue May 11 12:17:18 2010
+++ src/lib/libc/sys/ioctl.2	Sun Dec 19 11:54:10 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: ioctl.2,v 1.21 2010/05/11 16:17:18 mbalmer Exp $
+.\	$NetBSD: ioctl.2,v 1.22 2010/12/19 16:54:10 christos Exp $
 .\
 .\ Copyright (c) 1980, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\ @(#)ioctl.2	8.2 (Berkeley) 12/11/93
 .\
-.Dd May 11, 2010
+.Dd December 19, 2010
 .Dt IOCTL 2
 .Os
 .Sh NAME
@@ -40,7 +40,7 @@
 .Sh SYNOPSIS
 .In sys/ioctl.h
 .Ft int
-.Fn ioctl int d unsigned long request void *argp
+.Fn ioctl int d unsigned long request ...
 .Sh DESCRIPTION
 The
 .Fn ioctl
@@ -54,20 +54,26 @@
 .Fa d
 must be an open file descriptor.
 .Pp
-An  ioctl
+An
+.Fn ioctl
 .Fa request
 has encoded in it whether the argument is an
-.Dq in
-parameter
+.Dq in ,
+.Dq out ,
 or
-.Dq out
-parameter, and the size of the argument
-.Fa argp
+.Dq inout
+parameter, and the size of the first varyadic argument
 in bytes.
-Macros and defines used in specifying an ioctl
+Note that there can be only one varyadic argument but cannot be represented as
+a
+.Ft void *
+argument in the prototype because this would require a cast to pass integral
+types without warnings.
+Macros and defines used in specifying an
+.Fn ioctl
 .Fa request
-are located in the file
-.Ao Pa sys/ioctl.h Ac .
+are located in the header
+.In sys/ioctl.h .
 .Sh GENERIC IOCTLS
 Some ioctls are applicable to any file descriptor.
 These include:
@@ -76,11 +82,25 @@
 Set close-on-exec flag.
 The file will be closed when
 .Xr exec 3
-is invoked.
+is invoked
+(This is equivalent to
+.Fn fcntl
+.Dv F_SETFD
+.Dv FD_CLOEXEC
+and the
+.Fn fcntl
+form should be preferred).
 .It Dv FIONCLEX
 Clear close-on-exec flag.
 The file will remain open across
-.Xr exec 3 .
+.Xr exec 3 
+(This is equivalent to
+.Fn fcntl
+.Dv F_SETFD
+.Dv 0
+and the
+.Fn fcntl
+form should be preferred).
 .El
 .Pp
 Some generic ioctls are not implemented for all types of file
@@ -115,13 +135,29 @@
 .Xr read 2
 or
 .Xr write 2
-calls return \-1 and set
+calls return
+.Dv \-1
+and set
 .Va errno
 to
 .Er EAGAIN
-immediately when no data is available.
+immediately when no data is available
+(This is equivalent to
+.Fn fcntl
+.Dv F_SETFL
+.Dv O_NONBLOCK
+and the
+.Fn fcntl
+form should be preferred).
 .It Dv FIOASYNC int
-Set asynchronous I/O mode if the argument is non-zero.
+Set asynchronous I/O mode if the argument is non-zero
+(This is equivalent to
+.Fn fcntl
+.Dv F_SETFL
+.Dv O_ASYNC
+and the
+.Fn fcntl
+form should be preferred).
 In asynchronous mode, the process or process group specified by
 .Dv FIOSETOWN
 will start receiving
@@ -134,7 +170,14 @@
 .It Dv FIOSETOWN, FIOGETOWN int
 Set/get the process or the process group (if negative) that should receive
 .Dv SIGIO
-signals when data is available.
+signals when data is available
+(This is equivalent to
+.Fn fcntl
+.Dv F_SETOWN
+.Ft pid_t 
+and the
+.Ft fcntl
+form should be preferred).
 .El
 .Sh RETURN VALUES
 If an error has occurred, a value of \-1 is returned and



CVS commit: src/libexec/ld.elf_so

2010-12-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 19 17:17:50 UTC 2010

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

Log Message:
Remove unnecessary #ifdef RTLD_DEBUG


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 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.134 src/libexec/ld.elf_so/rtld.c:1.135
--- src/libexec/ld.elf_so/rtld.c:1.134	Thu Dec 16 22:47:27 2010
+++ src/libexec/ld.elf_so/rtld.c	Sun Dec 19 17:17:50 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld.c,v 1.134 2010/12/16 22:47:27 joerg Exp $	 */
+/*	$NetBSD: rtld.c,v 1.135 2010/12/19 17:17:50 skrll Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: rtld.c,v 1.134 2010/12/16 22:47:27 joerg Exp $);
+__RCSID($NetBSD: rtld.c,v 1.135 2010/12/19 17:17:50 skrll Exp $);
 #endif /* not lint */
 
 #include err.h
@@ -744,9 +744,7 @@
 		linkp = _rtld_objlist-next;
 		while ((obj = *linkp) != NULL) {
 			if (obj-refcount == 0) {
-#ifdef RTLD_DEBUG
 dbg((unloading \%s\, obj-path));
-#endif
 if (obj-ehdr != MAP_FAILED)
 	munmap(obj-ehdr, _rtld_pagesz);
 munmap(obj-mapbase, obj-mapsize);



CVS commit: src/sys/arch/i386/stand/lib

2010-12-19 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Dec 19 17:18:23 UTC 2010

Modified Files:
src/sys/arch/i386/stand/lib: realprot.S

Log Message:
Compute real/protected %sp/%esp offset in 'gdt_fixup' using all 32-bits.
Allows the case of %ss being less than %cs to work.
Also, completely save and restore the general-purpose registers we use.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/lib/realprot.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/i386/stand/lib/realprot.S
diff -u src/sys/arch/i386/stand/lib/realprot.S:1.9 src/sys/arch/i386/stand/lib/realprot.S:1.10
--- src/sys/arch/i386/stand/lib/realprot.S:1.9	Sat Nov 21 11:54:47 2009
+++ src/sys/arch/i386/stand/lib/realprot.S	Sun Dec 19 17:18:23 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: realprot.S,v 1.9 2009/11/21 11:54:47 dsl Exp $	*/
+/*	$NetBSD: realprot.S,v 1.10 2010/12/19 17:18:23 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -90,18 +90,18 @@
 	.global	gdt_fixup
 gdt_fixup:
 	.code16
-	push	%ax
-	push	%dx
+	pushl	%eax
+	pushl	%edx
 
 	xorl	%eax, %eax
 	mov	%cs, %ax
 	mov	%ax, ourseg
 	/* sort out stuff for %ss != %ds */
+	xorl	%edx, %edx
 	movw	%ss, %dx
 	movw	%dx, stkseg
-	subw	%ax, %dx
-	shll	$16, %edx
-	shrl	$12, %edx
+	subl	%eax, %edx
+	shll	$4, %edx
 	movl	%edx, stkdif
 
 	/* fix up GDT entries for bootstrap */
@@ -121,8 +121,8 @@
 	addl	$gdt, %eax
 	movl	%eax, gdtarg+2
 
-	pop	%dx
-	pop	%ax
+	popl	%edx
+	popl	%eax
 	ret
 
 /*



CVS commit: src/libexec/ld.elf_so

2010-12-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 19 17:26:51 UTC 2010

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

Log Message:
Sprinkle some KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/libexec/ld.elf_so/load.c
cvs rdiff -u -r1.135 -r1.136 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/load.c
diff -u src/libexec/ld.elf_so/load.c:1.40 src/libexec/ld.elf_so/load.c:1.41
--- src/libexec/ld.elf_so/load.c:1.40	Thu Dec 16 19:59:39 2010
+++ src/libexec/ld.elf_so/load.c	Sun Dec 19 17:26:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: load.c,v 1.40 2010/12/16 19:59:39 skrll Exp $	 */
+/*	$NetBSD: load.c,v 1.41 2010/12/19 17:26:51 skrll Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: load.c,v 1.40 2010/12/16 19:59:39 skrll Exp $);
+__RCSID($NetBSD: load.c,v 1.41 2010/12/19 17:26:51 skrll Exp $);
 #endif /* not lint */
 
 #include err.h
@@ -318,6 +318,6 @@
 		xfree(buf);
 	}
 
-	return (status);
+	return status;
 }
 #endif

Index: src/libexec/ld.elf_so/rtld.c
diff -u src/libexec/ld.elf_so/rtld.c:1.135 src/libexec/ld.elf_so/rtld.c:1.136
--- src/libexec/ld.elf_so/rtld.c:1.135	Sun Dec 19 17:17:50 2010
+++ src/libexec/ld.elf_so/rtld.c	Sun Dec 19 17:26:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld.c,v 1.135 2010/12/19 17:17:50 skrll Exp $	 */
+/*	$NetBSD: rtld.c,v 1.136 2010/12/19 17:26:51 skrll Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: rtld.c,v 1.135 2010/12/19 17:17:50 skrll Exp $);
+__RCSID($NetBSD: rtld.c,v 1.136 2010/12/19 17:26:51 skrll Exp $);
 #endif /* not lint */
 
 #include err.h
@@ -868,7 +868,7 @@
 
 	if (def != NULL)
 		return obj-relocbase + def-st_value;
-	return(NULL);
+	return NULL;
 }
 
 #ifdef __powerpc__



CVS commit: src/lib/libc/sys

2010-12-19 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Dec 19 22:19:27 UTC 2010

Modified Files:
src/lib/libc/sys: ioctl.2

Log Message:
Remove trailing whitespace; sort errors; spell variadic like
Wikipedia or GNU libc.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/lib/libc/sys/ioctl.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/libc/sys/ioctl.2
diff -u src/lib/libc/sys/ioctl.2:1.22 src/lib/libc/sys/ioctl.2:1.23
--- src/lib/libc/sys/ioctl.2:1.22	Sun Dec 19 16:54:10 2010
+++ src/lib/libc/sys/ioctl.2	Sun Dec 19 22:19:27 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: ioctl.2,v 1.22 2010/12/19 16:54:10 christos Exp $
+.\	$NetBSD: ioctl.2,v 1.23 2010/12/19 22:19:27 wiz Exp $
 .\
 .\ Copyright (c) 1980, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -62,9 +62,9 @@
 .Dq out ,
 or
 .Dq inout
-parameter, and the size of the first varyadic argument
+parameter, and the size of the first variadic argument
 in bytes.
-Note that there can be only one varyadic argument but cannot be represented as
+Note that there can be only one variadic argument but cannot be represented as
 a
 .Ft void *
 argument in the prototype because this would require a cast to pass integral
@@ -93,7 +93,7 @@
 .It Dv FIONCLEX
 Clear close-on-exec flag.
 The file will remain open across
-.Xr exec 3 
+.Xr exec 3
 (This is equivalent to
 .Fn fcntl
 .Dv F_SETFD
@@ -174,7 +174,7 @@
 (This is equivalent to
 .Fn fcntl
 .Dv F_SETOWN
-.Ft pid_t 
+.Ft pid_t
 and the
 .Ft fcntl
 form should be preferred).
@@ -190,23 +190,22 @@
 .It Bq Er EBADF
 .Fa d
 is not a valid descriptor.
+.It Bq Er EFAULT
+.Fa argp
+points outside the process's allocated address space.
+.It Bq Er EINVAL
+.Fa request
+or
+.Fa argp
+is not valid.
 .It Bq Er ENOTTY
 .Fa d
 is not associated with a character
-special device.
-.It Bq Er ENOTTY
-The specified request does not apply to the kind
+special device; or
+the specified request does not apply to the kind
 of object that the descriptor
 .Fa d
 references.
-.It Bq Er EINVAL
-.Fa request
-or
-.Fa argp
-is not valid.
-.It Bq Er EFAULT
-.Fa argp
-points outside the process's allocated address space.
 .El
 .Sh SEE ALSO
 .Xr mt 1 ,



CVS commit: src/usr.sbin/powerd

2010-12-19 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Dec 19 22:52:08 UTC 2010

Modified Files:
src/usr.sbin/powerd: Makefile powerd.c
Added Files:
src/usr.sbin/powerd: powerd_hostops.c powerd_rumpops.c prog_ops.h

Log Message:
Rump-ify powerd.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/powerd/Makefile
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/powerd/powerd.c
cvs rdiff -u -r0 -r1.1 src/usr.sbin/powerd/powerd_hostops.c \
src/usr.sbin/powerd/powerd_rumpops.c src/usr.sbin/powerd/prog_ops.h

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/powerd/Makefile
diff -u src/usr.sbin/powerd/Makefile:1.5 src/usr.sbin/powerd/Makefile:1.6
--- src/usr.sbin/powerd/Makefile:1.5	Wed Apr 22 15:23:06 2009
+++ src/usr.sbin/powerd/Makefile	Sun Dec 19 22:52:08 2010
@@ -1,8 +1,14 @@
-#	$NetBSD: Makefile,v 1.5 2009/04/22 15:23:06 lukem Exp $
+#	$NetBSD: Makefile,v 1.6 2010/12/19 22:52:08 pgoyette Exp $
 
 PROG=	powerd
 SRCS=	powerd.c
 
+RUMPPRG=	powerd
+
+.PATH: ${.CURDIR}/../../common/lib/libprop
+CPPFLAGS+=	-DRUMP_ACTION
+RUMPSRCS+=	prop_kern.c
+
 DPADD+=	${LIBPROP} ${LIBUTIL}
 LDADD+=	-lprop -lutil
 

Index: src/usr.sbin/powerd/powerd.c
diff -u src/usr.sbin/powerd/powerd.c:1.15 src/usr.sbin/powerd/powerd.c:1.16
--- src/usr.sbin/powerd/powerd.c:1.15	Wed Dec 15 17:12:40 2010
+++ src/usr.sbin/powerd/powerd.c	Sun Dec 19 22:52:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: powerd.c,v 1.15 2010/12/15 17:12:40 pgoyette Exp $	*/
+/*	$NetBSD: powerd.c,v 1.16 2010/12/19 22:52:08 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -42,10 +42,12 @@
 #define SYSLOG_NAMES
 
 #include sys/cdefs.h
+#include sys/ioctl.h
 #include sys/param.h
 #include sys/event.h
 #include sys/power.h
 #include sys/wait.h
+#include err.h
 #include errno.h
 #include fcntl.h
 #include paths.h
@@ -59,6 +61,8 @@
 #include stdarg.h
 #include string.h
 
+#include prog_ops.h
+
 int	debug, no_scripts;
 
 static int kq;
@@ -88,6 +92,9 @@
 
 	setprogname(*argv);
 
+	if (prog_init  prog_init() == -1)
+		err(1, init failed);
+
 	while ((ch = getopt(argc, argv, dn)) != -1) {
 		switch (ch) {
 		case 'd':
@@ -115,24 +122,24 @@
 		(void)pidfile(NULL);
 	}
 
-	if ((kq = kqueue()) == -1) {
+	if ((kq = prog_kqueue()) == -1) {
 		powerd_log(LOG_ERR, kqueue: %s, strerror(errno));
 		exit(EX_OSERR);
 	}
 
-	if ((fd = open(_PATH_POWER, O_RDONLY|O_NONBLOCK, 0600)) == -1) {
+	if ((fd = prog_open(_PATH_POWER, O_RDONLY|O_NONBLOCK, 0600)) == -1) {
 		powerd_log(LOG_ERR, open %s: %s, _PATH_POWER,
 		strerror(errno));
 		exit(EX_OSERR);
 	}
 
-	if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) {
+	if (prog_fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) {
 		powerd_log(LOG_ERR, Cannot set close on exec in power fd: %s,
 		strerror(errno));
 		exit(EX_OSERR);
 	}
 
-	if (ioctl(fd, POWER_IOC_GET_TYPE, power_type) == -1) {
+	if (prog_ioctl(fd, POWER_IOC_GET_TYPE, power_type) == -1) {
 		powerd_log(LOG_ERR, POWER_IOC_GET_TYPE: %s, strerror(errno));
 		exit(EX_OSERR);
 	}
@@ -254,7 +261,7 @@
 {
 	int rv;
 
-	while ((rv = kevent(kq, nchanges ? changebuf : NULL, nchanges,
+	while ((rv = prog_kevent(kq, nchanges ? changebuf : NULL, nchanges,
 	events, nevents, NULL))  0) {
 		nchanges = 0;
 		if (errno != EINTR) {
@@ -278,7 +285,7 @@
 		ev-data, ev-data  1 ? s : );
 
  again:
-	if (read(fd, pev, sizeof(pev)) != sizeof(pev)) {
+	if (prog_read(fd, pev, sizeof(pev)) != sizeof(pev)) {
 		if (errno == EWOULDBLOCK)
 			return;
 		powerd_log(LOG_ERR, read of %s: %s, _PATH_POWER,

Added files:

Index: src/usr.sbin/powerd/powerd_hostops.c
diff -u /dev/null src/usr.sbin/powerd/powerd_hostops.c:1.1
--- /dev/null	Sun Dec 19 22:52:08 2010
+++ src/usr.sbin/powerd/powerd_hostops.c	Sun Dec 19 22:52:08 2010
@@ -0,0 +1,51 @@
+/*	$NetBSD: powerd_hostops.c,v 1.1 2010/12/19 22:52:08 pgoyette Exp $ */
+
+/*
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * 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
+ 

CVS commit: src/distrib/sets/lists

2010-12-19 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Dec 19 22:53:20 UTC 2010

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

Log Message:
Add rump versions of usr.sbin/powerd


To generate a diff of this commit:
cvs rdiff -u -r1.908 -r1.909 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.1557 -r1.1558 src/distrib/sets/lists/comp/mi

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.908 src/distrib/sets/lists/base/mi:1.909
--- src/distrib/sets/lists/base/mi:1.908	Fri Dec 17 09:54:27 2010
+++ src/distrib/sets/lists/base/mi	Sun Dec 19 22:53:19 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.908 2010/12/17 09:54:27 jruoho Exp $
+# $NetBSD: mi,v 1.909 2010/12/19 22:53:19 pgoyette Exp $
 #
 # Note:	Don't delete entries from here - mark them as obsolete instead,
 #	unless otherwise stated below.
@@ -1313,6 +1313,7 @@
 ./usr/sbin/postqueuebase-postfix-bin	postfix
 ./usr/sbin/postsuperbase-postfix-bin	postfix
 ./usr/sbin/powerdbase-sysutil-bin
+./usr/sbin/rump.powerdbase-sysutil-bin
 ./usr/sbin/pppd	base-ppp-bin
 ./usr/sbin/pppdumpbase-ppp-bin
 ./usr/sbin/pppoectlbase-obsolete		obsolete

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1557 src/distrib/sets/lists/comp/mi:1.1558
--- src/distrib/sets/lists/comp/mi:1.1557	Sun Dec 19 10:07:23 2010
+++ src/distrib/sets/lists/comp/mi	Sun Dec 19 22:53:19 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1557 2010/12/19 10:07:23 jruoho Exp $
+#	$NetBSD: mi,v 1.1558 2010/12/19 22:53:19 pgoyette Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -3741,6 +3741,7 @@
 ./usr/libdata/debug/usr/sbin/postqueue.debug	comp-postfix-debug	postfix,debug
 ./usr/libdata/debug/usr/sbin/postsuper.debug	comp-postfix-debug	postfix,debug
 ./usr/libdata/debug/usr/sbin/powerd.debug	comp-sysutil-debug	debug
+./usr/libdata/debug/usr/sbin/rump.powerd.debug	comp-sysutil-debug	debug
 ./usr/libdata/debug/usr/sbin/pppd.debug		comp-ppp-debug		debug
 ./usr/libdata/debug/usr/sbin/pppdump.debug	comp-ppp-debug		debug
 ./usr/libdata/debug/usr/sbin/pppstats.debug	comp-ppp-debug		debug



CVS commit: src/sbin/resize_ffs

2010-12-19 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Sun Dec 19 23:22:46 UTC 2010

Modified Files:
src/sbin/resize_ffs: resize_ffs.8

Log Message:
Add missing .Os macro.


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

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

Modified files:

Index: src/sbin/resize_ffs/resize_ffs.8
diff -u src/sbin/resize_ffs/resize_ffs.8:1.6 src/sbin/resize_ffs/resize_ffs.8:1.7
--- src/sbin/resize_ffs/resize_ffs.8:1.6	Tue Dec 14 21:49:21 2010
+++ src/sbin/resize_ffs/resize_ffs.8	Sun Dec 19 23:22:46 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: resize_ffs.8,v 1.6 2010/12/14 21:49:21 wiz Exp $
+.\ $NetBSD: resize_ffs.8,v 1.7 2010/12/19 23:22:46 njoly Exp $
 .\
 .\ As its sole author, I explicitly place this man page in the public
 .\ domain.  Anyone may use it in any way for any purpose (though I would
@@ -11,6 +11,7 @@
 .\
 .Dd October 30, 2010
 .Dt RESIZE_FFS 8
+.Os
 .Sh NAME
 .Nm resize_ffs
 .Nd resize an on-disk file system



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

2010-12-19 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Sun Dec 19 23:23:36 UTC 2010

Modified Files:
src/sys/arch/xen/x86: x86_xpmap.c

Log Message:
Need the successful count (for AMI debugging)


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/xen/x86/x86_xpmap.c

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

Modified files:

Index: src/sys/arch/xen/x86/x86_xpmap.c
diff -u src/sys/arch/xen/x86/x86_xpmap.c:1.21 src/sys/arch/xen/x86/x86_xpmap.c:1.22
--- src/sys/arch/xen/x86/x86_xpmap.c:1.21	Sat Jul 24 00:45:56 2010
+++ src/sys/arch/xen/x86/x86_xpmap.c	Sun Dec 19 23:23:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_xpmap.c,v 1.21 2010/07/24 00:45:56 jym Exp $	*/
+/*	$NetBSD: x86_xpmap.c,v 1.22 2010/12/19 23:23:35 jym Exp $	*/
 
 /*
  * Copyright (c) 2006 Mathieu Ropert m...@adviseo.fr
@@ -69,7 +69,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: x86_xpmap.c,v 1.21 2010/07/24 00:45:56 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: x86_xpmap.c,v 1.22 2010/12/19 23:23:35 jym Exp $);
 
 #include opt_xen.h
 #include opt_ddb.h
@@ -175,7 +175,8 @@
 		xpq_queue[i].ptr, xpq_queue[i].val));
 	if (xpq_idx != 0 
 	HYPERVISOR_mmu_update_self(xpq_queue, xpq_idx, ok)  0) {
-		printf(xpq_flush_queue: %d entries \n, xpq_idx);
+		printf(xpq_flush_queue: %d entries (%d successful)\n,
+		xpq_idx, ok);
 		for (i = 0; i  xpq_idx; i++)
 			printf(0x%016 PRIx64 : 0x%016 PRIx64 \n,
 			   xpq_queue[i].ptr, xpq_queue[i].val);



CVS commit: src/sys/kern

2010-12-19 Thread YAMAMOTO Takashi
Module Name:src
Committed By:   yamt
Date:   Mon Dec 20 00:12:47 UTC 2010

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

Log Message:
revert vfs_lookup.c rev.1.126 for now because some problems are reported
on source-changes-d@ (thanks pooka) and i don't think i can take a look at
them in a timely manner.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/kern/vfs_lookup.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/vfs_lookup.c
diff -u src/sys/kern/vfs_lookup.c:1.126 src/sys/kern/vfs_lookup.c:1.127
--- src/sys/kern/vfs_lookup.c:1.126	Fri Dec 17 22:34:04 2010
+++ src/sys/kern/vfs_lookup.c	Mon Dec 20 00:12:46 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.126 2010/12/17 22:34:04 yamt Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.127 2010/12/20 00:12:46 yamt Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_lookup.c,v 1.126 2010/12/17 22:34:04 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_lookup.c,v 1.127 2010/12/20 00:12:46 yamt Exp $);
 
 #include opt_magiclinks.h
 
@@ -696,7 +696,6 @@
 		}
 		return error;
 	}
-	KASSERT(VOP_ISLOCKED(state-namei_startdir) == LK_EXCLUSIVE);
 
 	/* Loop through symbolic links */
 	for (;;) {
@@ -905,11 +904,6 @@
 	return 0;
 }
 
-/*
- * lookup_parsepath: consume a component name from state-ndp and prepare
- * state-cnp for it.
- */
-
 static int
 lookup_parsepath(struct namei_state *state)
 {
@@ -928,12 +922,16 @@
 	 * cnp-cn_nameptr for callers that need the name. Callers needing
 	 * the name set the SAVENAME flag. When done, they assume
 	 * responsibility for freeing the pathname buffer.
+	 *
+	 * At this point, our only vnode state is that dp is held and locked.
 	 */
 	cnp-cn_consume = 0;
 	cp = NULL;
 	cnp-cn_hash = namei_hash(cnp-cn_nameptr, cp);
 	cnp-cn_namelen = cp - cnp-cn_nameptr;
 	if (cnp-cn_namelen  NAME_MAX) {
+		vput(state-dp);
+		ndp-ni_dvp = NULL;
 		return ENAMETOOLONG;
 	}
 #ifdef NAMEI_DIAGNOSTIC
@@ -984,21 +982,6 @@
 	return 0;
 }
 
-/*
- * lookup_once: look up the vnode for the next component name (state-cnp).
- *
- * takes care of dot-dot, cross-mount, and MNT_UNION.
- *
- * inputs:
- *	state-dp	the parent vnode
- *	state-cnp	the componentname to lookup
- *
- * outputs:
- *	state-dp	the result vnode
- *	ndp-ni_vp	updated to state-dp
- *	ndp-ni_dvp	updated to the parent directory vnode
- */
-
 static int
 lookup_once(struct namei_state *state)
 {
@@ -1153,8 +1136,6 @@
 	 * state-dp and ndp-ni_dvp are both locked and held,
 	 * and may be the same vnode.
 	 */
-	KASSERT(VOP_ISLOCKED(state-dp) == LK_EXCLUSIVE);
-	KASSERT(VOP_ISLOCKED(ndp-ni_dvp) == LK_EXCLUSIVE);
 
 	/*
 	 * Check to see if the vnode has been mounted on;
@@ -1176,9 +1157,10 @@
 			vn_lock(ndp-ni_dvp, LK_EXCLUSIVE | LK_RETRY);
 			return error;
 		}
-		vrele(ndp-ni_dvp);
-		vref(tdp);
-		ndp-ni_dvp = ndp-ni_vp = state-dp = tdp;
+		VOP_UNLOCK(tdp);
+		ndp-ni_vp = state-dp = tdp;
+		vn_lock(ndp-ni_dvp, LK_EXCLUSIVE | LK_RETRY);
+		vn_lock(ndp-ni_vp, LK_EXCLUSIVE | LK_RETRY);
 	}
 
 	return 0;
@@ -1205,14 +1187,8 @@
 	}
 
 dirloop:
-	/*
-	 * At this point, our only vnode state is that dp is held and locked.
-	 */
-	KASSERT(VOP_ISLOCKED(state-dp) == LK_EXCLUSIVE);
-	KASSERT(ndp-ni_dvp == NULL);
 	error = lookup_parsepath(state);
 	if (error) {
-		vput(state-dp);
 		goto bad;
 	}
 
@@ -1259,7 +1235,6 @@
 		} else {
 			vput(ndp-ni_dvp);
 		}
-		ndp-ni_dvp = NULL;
 		goto dirloop;
 	}
 



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

2010-12-19 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Dec 20 00:14:41 UTC 2010

Modified Files:
src/sys/arch/ofppc/conf: GENERIC

Log Message:
Add siisata (but make sure wd0 is still on viaide)


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/sys/arch/ofppc/conf/GENERIC

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/ofppc/conf/GENERIC
diff -u src/sys/arch/ofppc/conf/GENERIC:1.132 src/sys/arch/ofppc/conf/GENERIC:1.133
--- src/sys/arch/ofppc/conf/GENERIC:1.132	Fri Dec 10 21:27:21 2010
+++ src/sys/arch/ofppc/conf/GENERIC	Mon Dec 20 00:14:40 2010
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.132 2010/12/10 21:27:21 phx Exp $
+# $NetBSD: GENERIC,v 1.133 2010/12/20 00:14:40 matt Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.132 $
+#ident 		GENERIC-$Revision: 1.133 $
 
 maxusers	32
 
@@ -253,8 +253,11 @@
 # PCI IDE controllers
 pciide*		at pci? dev ? function ? flags 0x
 viaide*		at pci? dev ? function ?	# VIA/AMD/Nvidia IDE controllers
+siisata*	at pci? dev ? function ?
 
 # ATA (IDE) bus support
+atabus0		at viaide0 channel 0
+atabus1		at viaide0 channel 1
 atabus*		at ata?
 
 # IDE drives
@@ -268,6 +271,7 @@
 # 0x0fac means 'use PIO mode 4, DMA mode 2, disable UltraDMA'.
 # (0xc=1100, 0xa=1010, 0xf=)
 # 0x means use whatever the drive claims to support.
+wd0	at atabus0 drive 0 flags 0x
 wd*	at atabus? drive ? flags 0x
 
 # ATAPI bus support



CVS commit: src/sys/arch/i386/stand/boot

2010-12-19 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Dec 20 00:39:06 UTC 2010

Modified Files:
src/sys/arch/i386/stand/boot: biosboot.S

Log Message:
We want a literal 0x86 in %ah for this int $0x15 delay,
not the value of the byte at 0x86.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/stand/boot/biosboot.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/i386/stand/boot/biosboot.S
diff -u src/sys/arch/i386/stand/boot/biosboot.S:1.6 src/sys/arch/i386/stand/boot/biosboot.S:1.7
--- src/sys/arch/i386/stand/boot/biosboot.S:1.6	Mon Apr 28 20:23:25 2008
+++ src/sys/arch/i386/stand/boot/biosboot.S	Mon Dec 20 00:39:06 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: biosboot.S,v 1.6 2008/04/28 20:23:25 martin Exp $	*/
+/*	$NetBSD: biosboot.S,v 1.7 2010/12/20 00:39:06 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -132,7 +132,7 @@
 	call	prot_to_real
 	.code16
 loopstop:
-	movb	0x86, %ah		/* delay for about a second */
+	movb	$0x86, %ah		/* delay for about a second */
 	movw	$16, %cx
 	int	$0x15
 	int	$0x18			/* might be a boot fail entry */



CVS commit: src/sbin/resize_ffs

2010-12-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Dec 20 00:49:23 UTC 2010

Modified Files:
src/sbin/resize_ffs: resize_ffs.8

Log Message:
Revert previous - inadvertant commit to wrong repository.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sbin/resize_ffs/resize_ffs.8

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

Modified files:

Index: src/sbin/resize_ffs/resize_ffs.8
diff -u src/sbin/resize_ffs/resize_ffs.8:1.8 src/sbin/resize_ffs/resize_ffs.8:1.9
--- src/sbin/resize_ffs/resize_ffs.8:1.8	Mon Dec 20 00:44:53 2010
+++ src/sbin/resize_ffs/resize_ffs.8	Mon Dec 20 00:49:23 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: resize_ffs.8,v 1.8 2010/12/20 00:44:53 riz Exp $
+.\ $NetBSD: resize_ffs.8,v 1.9 2010/12/20 00:49:23 riz Exp $
 .\
 .\ As its sole author, I explicitly place this man page in the public
 .\ domain.  Anyone may use it in any way for any purpose (though I would
@@ -9,12 +9,12 @@
 .\  X  Against HTML   mo...@rodents.montreal.qc.ca
 .\ / \ Email!   7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
 .\
-.Dd December 18, 2010
+.Dd October 30, 2010
 .Dt RESIZE_FFS 8
 .Os
 .Sh NAME
 .Nm resize_ffs
-.Nd resize a file system on disk or in a file
+.Nd resize an on-disk file system
 .Sh SYNOPSIS
 .Nm
 .Op Fl y
@@ -24,7 +24,7 @@
 .Nm
 resizes a file system on disk.
 .Ar file-system-raw-device
-is the name of the raw disk device or file where the file system resides;
+is the name of the raw disk device where the file system resides;
 (Sectors are almost always 512 bytes, and
 .Nm
 can both grow and shrink file systems.
@@ -66,6 +66,10 @@
 .Nm .
 .El
 .Sh WARNING
+.Nm
+should still be considered experimental.
+It still needs to be validated with a rigorous regression test
+suite.
 .Em Interrupting
 .Nm
 .Em may leave your file system in an inconsistent state and require a
@@ -84,7 +88,16 @@
 It's probably wise to
 .Xr fsck 8
 the file system before and after, just to be safe.
-You should be aware that just because
+.\ Remove this when (if) fsck gets fixed.
+.Pp
+There is a bug somewhere in
+.Xr fsck 8 ;
+it does not check certain data structures enough.
+A past version of this program had a bug that produced corrupted
+rotation layout summary tables, which would panic the kernel.
+This bug is believed fixed, and there are currently no
+known bugs in the program.
+However, you should be aware that just because
 .Xr fsck 8
 is happy with the file system does not mean it is intact.
 .Sh EXIT STATUS
@@ -120,6 +133,9 @@
 .Sx WARNING
 section above.
 .Sh BUGS
+Has not been tested and probably won't work on opposite-endian file
+systems.
+.Pp
 Can fail to shrink a file system when there actually is enough space,
 because it does not distinguish between a block allocated as a block
 and a block fully occupied by two or more frags.
@@ -130,4 +146,4 @@
 Has no intelligence whatever when it comes to allocating blocks to copy
 data into when shrinking.
 .Pp
-Doesn't shrink FFSv2 file systems.
+Doesn't work with FFSv2 file systems.



CVS commit: src/sys/arch/i386/stand/boot

2010-12-19 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Dec 20 00:55:10 UTC 2010

Modified Files:
src/sys/arch/i386/stand/boot: Makefile.boot

Log Message:
Move the bottom of the heap off the top of the stack. Also, increase the heap
size by 64KiB.  These changes allows gzipped Xen with gzipped Dom0 kernels
to successfully boot.  I also suspect this will cure the amd64 CD boot issue
without disabling ext2fs support.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/i386/stand/boot/Makefile.boot

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/i386/stand/boot/Makefile.boot
diff -u src/sys/arch/i386/stand/boot/Makefile.boot:1.46 src/sys/arch/i386/stand/boot/Makefile.boot:1.47
--- src/sys/arch/i386/stand/boot/Makefile.boot:1.46	Sat Dec 11 08:20:17 2010
+++ src/sys/arch/i386/stand/boot/Makefile.boot	Mon Dec 20 00:55:10 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.boot,v 1.46 2010/12/11 08:20:17 mrg Exp $
+# $NetBSD: Makefile.boot,v 1.47 2010/12/20 00:55:10 jakllsch Exp $
 
 S=	${.CURDIR}/../../../../..
 
@@ -72,10 +72,7 @@
 CPPFLAGS+= -DSUPPORT_CD9660
 CPPFLAGS+= -DSUPPORT_USTARFS
 CPPFLAGS+= -DSUPPORT_DOSFS
-# XXX this bloats(?) /boot and it can't boot from cd anymore
-.if ${MACHINE_ARCH} != x86_64
 CPPFLAGS+= -DSUPPORT_EXT2FS
-.endif
 CPPFLAGS+= -DPASS_BIOSGEOM
 CPPFLAGS+= -DPASS_MEMMAP
 #CPPFLAGS+= -DBOOTPASSWD
@@ -84,7 +81,7 @@
 # The biosboot code is linked to 'virtual' address of zero and is
 # loaded at physical address 0x1.
 # XXX The heap values should be determined from _end.
-SAMISCCPPFLAGS+= -DHEAP_START=0x3 -DHEAP_LIMIT=0x5
+SAMISCCPPFLAGS+= -DHEAP_START=0x4 -DHEAP_LIMIT=0x7
 SAMISCMAKEFLAGS+= SA_USE_CREAD=yes	# Read compressed kernels
 SAMISCMAKEFLAGS+= SA_INCLUDE_NET=no	# Netboot via TFTP, NFS
 



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

2010-12-19 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Dec 20 01:12:45 UTC 2010

Modified Files:
src/sys/arch/i386/stand/boot: boot2.c
src/sys/arch/i386/stand/dosboot: main.c
src/sys/arch/i386/stand/lib: Makefile
src/sys/arch/i386/stand/lib/crt/dos: start_dos.S
src/sys/arch/i386/stand/netboot: main.c start_rom.S
src/sys/arch/i386/stand/pxeboot: main.c start_pxe.S
Removed Files:
src/sys/arch/i386/stand/lib: panic.c

Log Message:
MI libsa provides panic() and exit() functions, no need to provide our own.
As MI libsa exit() calls panic() with a exit message, don't use it if we
print our own farewell or have already panic()ed.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/i386/stand/boot/boot2.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/i386/stand/dosboot/main.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/i386/stand/lib/Makefile
cvs rdiff -u -r1.7 -r0 src/sys/arch/i386/stand/lib/panic.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/lib/crt/dos/start_dos.S
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/i386/stand/netboot/main.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/netboot/start_rom.S
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/i386/stand/pxeboot/main.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/i386/stand/pxeboot/start_pxe.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/i386/stand/boot/boot2.c
diff -u src/sys/arch/i386/stand/boot/boot2.c:1.49 src/sys/arch/i386/stand/boot/boot2.c:1.50
--- src/sys/arch/i386/stand/boot/boot2.c:1.49	Sat Nov  6 23:07:46 2010
+++ src/sys/arch/i386/stand/boot/boot2.c	Mon Dec 20 01:12:44 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot2.c,v 1.49 2010/11/06 23:07:46 jym Exp $	*/
+/*	$NetBSD: boot2.c,v 1.50 2010/12/20 01:12:44 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -414,7 +414,6 @@
 	reboot();
 	/* Note: we shouldn't get to this point! */
 	panic(Could not reboot!);
-	exit(0);
 }
 
 void

Index: src/sys/arch/i386/stand/dosboot/main.c
diff -u src/sys/arch/i386/stand/dosboot/main.c:1.29 src/sys/arch/i386/stand/dosboot/main.c:1.30
--- src/sys/arch/i386/stand/dosboot/main.c:1.29	Sat Mar 21 15:01:56 2009
+++ src/sys/arch/i386/stand/dosboot/main.c	Mon Dec 20 01:12:44 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.29 2009/03/21 15:01:56 ad Exp $	 */
+/*	$NetBSD: main.c,v 1.30 2010/12/20 01:12:44 jakllsch Exp $	 */
 
 /*
  * Copyright (c) 1996, 1997
@@ -337,7 +337,7 @@
 command_quit(char *arg)
 {
 	printf(Exiting... goodbye...\n);
-	exit(0);
+	_rtt();
 }
 
 void

Index: src/sys/arch/i386/stand/lib/Makefile
diff -u src/sys/arch/i386/stand/lib/Makefile:1.29 src/sys/arch/i386/stand/lib/Makefile:1.30
--- src/sys/arch/i386/stand/lib/Makefile:1.29	Thu Nov 19 22:13:17 2009
+++ src/sys/arch/i386/stand/lib/Makefile	Mon Dec 20 01:12:44 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.29 2009/11/19 22:13:17 dsl Exp $
+#	$NetBSD: Makefile,v 1.30 2010/12/20 01:12:44 jakllsch Exp $
 
 S?=	${.CURDIR}/../../../..
 
@@ -21,7 +21,7 @@
 SRCS+= biosmem.S getextmemx.c biosmemx.S printmemlist.c
 SRCS+= pread.c menuutils.c parseutils.c
 SRCS+= bootinfo.c bootinfo_biosgeom.c bootinfo_memmap.c
-SRCS+= startprog.S multiboot.S panic.c
+SRCS+= startprog.S multiboot.S
 SRCS+= biosgetsystime.S cpufunc.S bootmenu.c
 SRCS+= realprot.S message.S message32.S dump_eax.S pvcopy.S putstr.S
 SRCS+= rasops.c vbe.c biosvbe.S

Index: src/sys/arch/i386/stand/lib/crt/dos/start_dos.S
diff -u src/sys/arch/i386/stand/lib/crt/dos/start_dos.S:1.9 src/sys/arch/i386/stand/lib/crt/dos/start_dos.S:1.10
--- src/sys/arch/i386/stand/lib/crt/dos/start_dos.S:1.9	Sun Mar  4 05:59:59 2007
+++ src/sys/arch/i386/stand/lib/crt/dos/start_dos.S	Mon Dec 20 01:12:44 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: start_dos.S,v 1.9 2007/03/04 05:59:59 christos Exp $	*/
+/*	$NetBSD: start_dos.S,v 1.10 2010/12/20 01:12:44 jakllsch Exp $	*/
 	
 /*
  * startup for DOS .COM programs
@@ -188,7 +188,7 @@
 	stosb
 
 	call	_C_LABEL(doscommain)
-ENTRY(exit)
+ENTRY(_rtt)
 	call	_C_LABEL(prot_to_real)
 	.code16
 ENTRY(exit16)

Index: src/sys/arch/i386/stand/netboot/main.c
diff -u src/sys/arch/i386/stand/netboot/main.c:1.17 src/sys/arch/i386/stand/netboot/main.c:1.18
--- src/sys/arch/i386/stand/netboot/main.c:1.17	Sat Mar 21 15:01:56 2009
+++ src/sys/arch/i386/stand/netboot/main.c	Mon Dec 20 01:12:44 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.17 2009/03/21 15:01:56 ad Exp $	 */
+/*	$NetBSD: main.c,v 1.18 2010/12/20 01:12:44 jakllsch Exp $	 */
 
 /*
  * Copyright (c) 1996
@@ -123,7 +123,7 @@
 command_quit(char *arg)
 {
 	printf(Exiting... goodbye...\n);
-	exit(0);
+	_rtt();
 }
 
 void

Index: src/sys/arch/i386/stand/netboot/start_rom.S
diff -u src/sys/arch/i386/stand/netboot/start_rom.S:1.2 src/sys/arch/i386/stand/netboot/start_rom.S:1.3
--- src/sys/arch/i386/stand/netboot/start_rom.S:1.2	Sun Dec 11 12:17:49 2005
+++ src/sys/arch/i386/stand/netboot/start_rom.S	Mon Dec 

CVS commit: src/usr.bin/vmstat

2010-12-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 20 04:25:03 UTC 2010

Modified Files:
src/usr.bin/vmstat: Makefile vmstat.c

Log Message:
make this work with the per-cpu counters.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/vmstat/Makefile
cvs rdiff -u -r1.170 -r1.171 src/usr.bin/vmstat/vmstat.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/vmstat/Makefile
diff -u src/usr.bin/vmstat/Makefile:1.27 src/usr.bin/vmstat/Makefile:1.28
--- src/usr.bin/vmstat/Makefile:1.27	Tue Apr 14 18:15:28 2009
+++ src/usr.bin/vmstat/Makefile	Sun Dec 19 23:25:03 2010
@@ -1,9 +1,11 @@
-#	$NetBSD: Makefile,v 1.27 2009/04/14 22:15:28 lukem Exp $
+#	$NetBSD: Makefile,v 1.28 2010/12/20 04:25:03 christos Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
 
+.include bsd.own.mk
 USE_FORT?= yes	# setgid
 PROG=	vmstat
 
+CPPFLAGS+=-D_KMEMUSER -I${NETBSDSRCDIR}/sys
 SRCS=	drvstats.c vmstat.c
 MAN=	vmstat.1
 DPADD=	${LIBKVM}

Index: src/usr.bin/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.170 src/usr.bin/vmstat/vmstat.c:1.171
--- src/usr.bin/vmstat/vmstat.c:1.170	Mon Oct 18 15:39:32 2010
+++ src/usr.bin/vmstat/vmstat.c	Sun Dec 19 23:25:03 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.170 2010/10/18 19:39:32 christos Exp $ */
+/* $NetBSD: vmstat.c,v 1.171 2010/12/20 04:25:03 christos Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
 #if 0
 static char sccsid[] = @(#)vmstat.c	8.2 (Berkeley) 3/1/95;
 #else
-__RCSID($NetBSD: vmstat.c,v 1.170 2010/10/18 19:39:32 christos Exp $);
+__RCSID($NetBSD: vmstat.c,v 1.171 2010/12/20 04:25:03 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -93,6 +93,8 @@
 #include sys/sysctl.h
 #include sys/time.h
 #include sys/user.h
+#include sys/queue.h
+#include sys/cpu.h
 
 #include uvm/uvm_extern.h
 #include uvm/uvm_stat.h
@@ -154,7 +156,9 @@
 	{ .n_name = _time_second },
 #define X_TIME		10
 	{ .n_name = _time },
-#define	X_NL_SIZE	11
+#define X_CPU_QUEUE	11
+	{ .n_name = _cpu_queue },
+#define	X_NL_SIZE	12
 	{ .n_name = NULL },
 };
 
@@ -226,7 +230,17 @@
 
 #define KILO	1024	
 
+struct cpu_counter {
+	uint64_t nintr;
+	uint64_t nsyscall;
+	uint64_t nswtch;
+	uint64_t nfault;
+	uint64_t ntrap;
+	uint64_t nsoft;
+} cpucounter, ocpucounter;
+
 struct	uvmexp uvmexp, ouvmexp;
+struct  cpuqueue cpu_queue;
 int	ndrives;
 
 int	winlines = 20;
@@ -263,6 +277,7 @@
 } while (/* CONSTCOND */0)
 
 void	cpustats(int *);
+void	cpucounters(struct cpu_counter *);
 void	deref_kptr(const void *, void *, size_t, const char *);
 void	drvstats(int *);
 void	doevcnt(int verbose);
@@ -664,6 +679,8 @@
 	if (!hz)
 		kread(namelist, X_HZ, hz, sizeof(hz));
 
+	kread(namelist, X_CPU_QUEUE, cpu_queue, sizeof(cpu_queue));
+
 	for (hdrcnt = 1;;) {
 		if (!--hdrcnt)
 			printhdr();
@@ -687,6 +704,7 @@
 (void)memset(total, 0, sizeof(total));
 			}
 		}
+		cpucounters(cpucounter);
 		ovflw = 0;
 		PRWORD(ovflw,  %*d, 2, 1, total.t_rq - 1);
 		PRWORD(ovflw,  %*d, 2, 1, total.t_dw + total.t_pw);
@@ -695,7 +713,7 @@
 		PRWORD(ovflw,  %*ld, 9, 1, pgtok(total.t_avm));
 		PRWORD(ovflw,  %*ld, 7, 1, pgtok(total.t_free));
 		PRWORD(ovflw,  %*ld, 5, 1,
-		rate(uvmexp.faults - ouvmexp.faults));
+		rate(cpucounter.nfault - ocpucounter.nfault));
 		PRWORD(ovflw,  %*ld, 4, 1,
 		rate(uvmexp.pdreact - ouvmexp.pdreact));
 		PRWORD(ovflw,  %*ld, 4, 1,
@@ -708,17 +726,17 @@
 		rate(uvmexp.pdscans - ouvmexp.pdscans));
 		drvstats(ovflw);
 		PRWORD(ovflw,  %*ld, 5, 1,
-		rate(uvmexp.intrs - ouvmexp.intrs));
+		rate(cpucounter.nintr - ocpucounter.nintr));
 		PRWORD(ovflw,  %*ld, 5, 1,
-		rate(uvmexp.syscalls - ouvmexp.syscalls));
+		rate(cpucounter.nsyscall - ocpucounter.nsyscall));
 		PRWORD(ovflw,  %*ld, 4, 1,
-		rate(uvmexp.swtch - ouvmexp.swtch));
+		rate(cpucounter.nswtch - ocpucounter.nswtch));
 		cpustats(ovflw);
 		(void)putchar('\n');
 		(void)fflush(stdout);
 		if (reps = 0  --reps = 0)
 			break;
-		ouvmexp = uvmexp;
+		ocpucounter = cpucounter;
 		uptime = interval-tv_sec;
 		/*
 		 * We round upward to avoid losing low-frequency events
@@ -784,6 +802,7 @@
 	struct uvmexp_sysctl uvmexp2;
 	size_t ssize;
 	int active_kernel;
+	struct cpu_counter cc;
 
 	/*
 	 * The active and inactive variables
@@ -832,12 +851,14 @@
 	(void)printf(%9u swap pages in use\n, uvmexp.swpginuse);
 	(void)printf(%9u swap allocations\n, uvmexp.nswget);
 
-	(void)printf(%9u total faults taken\n, uvmexp.faults);
-	(void)printf(%9u traps\n, uvmexp.traps);
-	(void)printf(%9u device interrupts\n, uvmexp.intrs);
-	(void)printf(%9u CPU context switches\n, uvmexp.swtch);
-	(void)printf(%9u software interrupts\n, uvmexp.softs);
-	(void)printf(%9u system calls\n, uvmexp.syscalls);
+	kread(namelist, X_CPU_QUEUE, cpu_queue, sizeof(cpu_queue));
+	cpucounters(cc);
+	(void)printf(%9 PRIu64  total faults taken\n, cc.nfault);
+	

CVS commit: src/sys/sys

2010-12-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 20 04:27:35 UTC 2010

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

Log Message:
Add a little #ifdef _KERNEL so that vmstat can use this file. Also userland
does not know about lwp_t, so use struct lwp.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/sys/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/sys/cpu.h
diff -u src/sys/sys/cpu.h:1.31 src/sys/sys/cpu.h:1.32
--- src/sys/sys/cpu.h:1.31	Tue Jan 12 20:57:17 2010
+++ src/sys/sys/cpu.h	Sun Dec 19 23:27:35 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.31 2010/01/13 01:57:17 mrg Exp $	*/
+/*	$NetBSD: cpu.h,v 1.32 2010/12/20 04:27:35 christos Exp $	*/
 
 /*-
  * Copyright (c) 2007 YAMAMOTO Takashi,
@@ -37,6 +37,7 @@
 
 struct cpu_info;
 
+#ifdef _KERNEL
 #ifndef cpu_idle
 void cpu_idle(void);
 #endif
@@ -68,7 +69,7 @@
 void	cpu_offline_md(void);
 #endif
 
-lwp_t	*cpu_switchto(lwp_t *, lwp_t *, bool);
+struct lwp *cpu_switchto(struct lwp *, struct lwp *, bool);
 struct	cpu_info *cpu_lookup(u_int);
 int	cpu_setstate(struct cpu_info *, bool);
 int	cpu_setintr(struct cpu_info *, bool);
@@ -77,12 +78,14 @@
 bool	cpu_kpreempt_enter(uintptr_t, int);
 void	cpu_kpreempt_exit(uintptr_t);
 bool	cpu_kpreempt_disabled(void);
-int	cpu_lwp_setprivate(lwp_t *, void *);
+int	cpu_lwp_setprivate(struct lwp *, void *);
 void	cpu_intr_redistribute(void);
 u_int	cpu_intr_count(struct cpu_info *);
+#endif
 
 CIRCLEQ_HEAD(cpuqueue, cpu_info);
 
+#ifdef _KERNEL
 extern kmutex_t cpu_lock;
 extern u_int maxcpus;
 extern struct cpuqueue cpu_queue;
@@ -98,7 +101,7 @@
 {
 	return ci-ci_data.cpu_name;
 }
-
+#endif
 #endif	/* !_LOCORE */
 
 /* flags for cpu_need_resched */



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

2010-12-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 20 04:29:29 UTC 2010

Modified Files:
src/distrib/sets/lists/comp: md.amd64 md.i386

Log Message:
To use x86/cpu.h struct cpu_info from userland, we need via_padlock.h installed.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.114 -r1.115 src/distrib/sets/lists/comp/md.i386

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.amd64
diff -u src/distrib/sets/lists/comp/md.amd64:1.88 src/distrib/sets/lists/comp/md.amd64:1.89
--- src/distrib/sets/lists/comp/md.amd64:1.88	Thu Dec 16 13:42:49 2010
+++ src/distrib/sets/lists/comp/md.amd64	Sun Dec 19 23:29:29 2010
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.88 2010/12/16 18:42:49 christos Exp $
+# $NetBSD: md.amd64,v 1.89 2010/12/20 04:29:29 christos Exp $
 ./usr/include/amd64comp-c-include
 ./usr/include/amd64/ansi.h			comp-c-include
 ./usr/include/amd64/aout_machdep.h		comp-c-include
@@ -228,6 +228,7 @@
 ./usr/include/x86/specialreg.h			comp-c-include
 ./usr/include/x86/sysarch.h			comp-c-include
 ./usr/include/x86/trap.h			comp-c-include
+./usr/include/x86/via_padlock.h			comp-c-include
 ./usr/include/xencomp-c-include
 ./usr/include/xen/xenio.h			comp-c-include
 ./usr/include/xen/xenio3.h			comp-c-include

Index: src/distrib/sets/lists/comp/md.i386
diff -u src/distrib/sets/lists/comp/md.i386:1.114 src/distrib/sets/lists/comp/md.i386:1.115
--- src/distrib/sets/lists/comp/md.i386:1.114	Sat Jul 31 17:47:52 2010
+++ src/distrib/sets/lists/comp/md.i386	Sun Dec 19 23:29:29 2010
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.114 2010/07/31 21:47:52 joerg Exp $
+# $NetBSD: md.i386,v 1.115 2010/12/20 04:29:29 christos Exp $
 ./usr/include/emmintrin.h			comp-c-include		gcccmds
 ./usr/include/i386comp-c-include
 ./usr/include/i386/_G_config.h			comp-obsolete		obsolete
@@ -110,6 +110,7 @@
 ./usr/include/x86/specialreg.h			comp-c-include
 ./usr/include/x86/sysarch.h			comp-c-include
 ./usr/include/x86/trap.h			comp-c-include
+./usr/include/x86/via_padlock.h			comp-c-include
 ./usr/include/xencomp-c-include
 ./usr/include/xen/xenio.h			comp-c-include
 ./usr/include/xen/xenio3.h			comp-c-include



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

2010-12-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 20 04:29:56 UTC 2010

Modified Files:
src/sys/arch/x86/include: Makefile

Log Message:
To use x86/cpu.h struct cpu_info from userland, we need via_padlock.h installed.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/x86/include/Makefile

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

Modified files:

Index: src/sys/arch/x86/include/Makefile
diff -u src/sys/arch/x86/include/Makefile:1.14 src/sys/arch/x86/include/Makefile:1.15
--- src/sys/arch/x86/include/Makefile:1.14	Tue Jul  6 20:10:14 2010
+++ src/sys/arch/x86/include/Makefile	Sun Dec 19 23:29:56 2010
@@ -1,4 +1,4 @@
-# 	$NetBSD: Makefile,v 1.14 2010/07/07 00:10:14 njoly Exp $
+# 	$NetBSD: Makefile,v 1.15 2010/12/20 04:29:56 christos Exp $
 
 INCSDIR=/usr/include/x86
 
@@ -21,6 +21,7 @@
 	rwlock.h \
 	specialreg.h \
 	sysarch.h \
-	trap.h
+	trap.h \
+	via_padlock.h
 
 .include bsd.kinc.mk



CVS commit: src

2010-12-19 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Dec 20 04:56:18 UTC 2010

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/dev/sysmon: Makefile
Added Files:
src/tests/dev/sysmon: t_swsensor.sh

Log Message:
Add a rump-based set of tests for sysmon_envsys(8) + powerd(8) + swsensor(4)


To generate a diff of this commit:
cvs rdiff -u -r1.180 -r1.181 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.1 -r1.2 src/tests/dev/sysmon/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/dev/sysmon/t_swsensor.sh

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.180 src/distrib/sets/lists/tests/mi:1.181
--- src/distrib/sets/lists/tests/mi:1.180	Fri Dec 17 19:13:48 2010
+++ src/distrib/sets/lists/tests/mi	Mon Dec 20 04:56:18 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.180 2010/12/17 19:13:48 pooka Exp $
+# $NetBSD: mi,v 1.181 2010/12/20 04:56:18 pgoyette Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -223,6 +223,7 @@
 ./usr/libdata/debug/usr/tests/dev/scsipi	tests-fs-debug
 ./usr/libdata/debug/usr/tests/dev/scsipi/t_cd.debug			tests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/dev/sysmon	tests-fs-debug
+./usr/libdata/debug/usr/tests/dev/sysmon/t_swsensor.debug		tests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/dev/sysmon/t_swwdog.debug			tests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/fs/ffs	tests-fs-debug
 ./usr/libdata/debug/usr/tests/fs/ffs/t_fifos.debug			tests-fs-debug		debug,atf
@@ -1056,6 +1057,7 @@
 ./usr/tests/dev/scsipi/t_cd			tests-fs-tests		atf
 ./usr/tests/dev/sysmontests-fs-tests
 ./usr/tests/dev/sysmon/Atffile			tests-fs-tests		atf
+./usr/tests/dev/sysmon/t_swsensor		tests-fs-tests		atf
 ./usr/tests/dev/sysmon/t_swwdog			tests-fs-tests		atf
 ./usr/tests/fs	tests-fs-tests
 ./usr/tests/fs/Atffiletests-fs-tests		atf

Index: src/tests/dev/sysmon/Makefile
diff -u src/tests/dev/sysmon/Makefile:1.1 src/tests/dev/sysmon/Makefile:1.2
--- src/tests/dev/sysmon/Makefile:1.1	Fri Aug  6 16:13:26 2010
+++ src/tests/dev/sysmon/Makefile	Mon Dec 20 04:56:18 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2010/08/06 16:13:26 pooka Exp $
+#	$NetBSD: Makefile,v 1.2 2010/12/20 04:56:18 pgoyette Exp $
 #
 
 .include bsd.own.mk
@@ -13,4 +13,6 @@
 
 WARNS=	4
 
+TESTS_SH=	t_swsensor
+
 .include bsd.test.mk

Added files:

Index: src/tests/dev/sysmon/t_swsensor.sh
diff -u /dev/null src/tests/dev/sysmon/t_swsensor.sh:1.1
--- /dev/null	Mon Dec 20 04:56:18 2010
+++ src/tests/dev/sysmon/t_swsensor.sh	Mon Dec 20 04:56:18 2010
@@ -0,0 +1,302 @@
+# $NetBSD: t_swsensor.sh,v 1.1 2010/12/20 04:56:18 pgoyette Exp $
+
+get_sensor_info() {
+	rump.envstat -x | \
+	sed -e \;swsensor;,\;/array;p -e d
+}
+
+get_sensor_key() {
+	get_sensor_info | grep -A1 $1 | grep integer | sed -e 's;[/a-z]*;;g'
+}
+
+get_powerd_event_count() {
+	grep not running powerd.log | wc -l
+}
+
+check_powerd_event() {
+	event=$(grep not running powerd.log | \
+		sed -e $1p -e d )
+	event=${event##*//}
+	script=${event%% *}
+	event=${event#* }
+	device=${event%% *}
+	event=${event#* }
+	state=${event%% *}
+	sensor=${event#* }
+	sensor=${sensor% *}
+
+	if [ ${script} != sensor_indicator ] ; then
+		echo Event uses wrong script: ${script}
+	elif [ ${device} != swsensor ] ; then
+		echo Event uses wrong device: ${device}
+	elif [ ${sensor} != sensor ] ; then
+		echo Event uses wrong sensor: ${sensor}
+	elif [ ${state} != $2 ] ; then
+		echo Event uses wrong state: ${state}
+	fi
+}
+
+# Start the rump server, then load the swsensor module with the
+# requested properties
+
+start_rump() {
+	rump_allserver ${RUMP_SERVER}
+	if [ $( get_sensor_info | wc -l ) -ne 0 ] ; then
+		rump.modunload swsensor
+		rump.modload -f $1 swsensor
+	else
+		rump.modload $1 swsensor
+	fi
+	return $?
+}
+
+common_head() {
+	atf_set	descr		$1
+	atf_set	timeout		60
+	atf_set	require.progs	rump.powerd rump.envstat rump.modload   \
+rump.halt   rump.sysctl  rump_allserver \
+sed grep
+	atf_set	require.user	root
+}
+
+common_cleanup() {
+	if [ -n $(jobs) ] ; then
+		kill %1			# get rid of our rump.powerd
+	fi
+
+	rump.modunload swsensor
+	rump.halt
+	rm -f ${RUMP_SERVER}
+}
+
+create_envsys_conf_files() {
+	cat  ENV0  env0.conf
+	swsensor {
+		refresh-timeout = 2s;
+	}
+ENV0
+	cat  ENV1  env1.conf
+	swsensor {
+		sensor0 { critical-min = $(( $1 - $2 )); }
+	}
+ENV1
+	cat  ENV2  env2.conf
+	swsensor {
+		sensor0 { critical-min = $1; }
+	}
+ENV2
+}
+
+# Test body common to all sensors
+#	$1	sensor mode
+#	$2	initial sensor value
+#	$3	initial limit
+#	$4	amount to lower limit
+#	$5	difference from limit to trigger event
+
+common_body() {
+	if [ $1 -ne 0 ] ; then
+		atf_skip rump.modload doesn't pass proplist attributes
+	fi
+
+	# Start the rump-server process and load the module
+	start_rump -i mode=$1 -i