CVS commit: src

2010-04-28 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Apr 28 07:35:31 UTC 2010

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

Log Message:
Document ffs32(), ffs64(), fls32(), and fls64() from .


To generate a diff of this commit:
cvs rdiff -u -r1.1436 -r1.1437 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.49 -r1.50 src/share/man/man3/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man3/ffs32.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.1436 src/distrib/sets/lists/comp/mi:1.1437
--- src/distrib/sets/lists/comp/mi:1.1436	Sun Apr 25 00:54:44 2010
+++ src/distrib/sets/lists/comp/mi	Wed Apr 28 07:35:30 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1436 2010/04/25 00:54:44 joerg Exp $
+#	$NetBSD: mi,v 1.1437 2010/04/28 07:35:30 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5746,6 +5746,8 @@
 ./usr/share/man/cat3/fetch.0			comp-c-catman		.cat
 ./usr/share/man/cat3/fflush.0			comp-c-catman		.cat
 ./usr/share/man/cat3/ffs.0			comp-c-catman		.cat
+./usr/share/man/cat3/ffs32.0			comp-c-catman		.cat
+./usr/share/man/cat3/ffs64.0			comp-c-catman		.cat
 ./usr/share/man/cat3/fgetc.0			comp-c-catman		.cat
 ./usr/share/man/cat3/fgetln.0			comp-c-catman		.cat
 ./usr/share/man/cat3/fgetpos.0			comp-c-catman		.cat
@@ -5779,6 +5781,8 @@
 ./usr/share/man/cat3/flockfile.0		comp-c-catman		.cat
 ./usr/share/man/cat3/floor.0			comp-c-catman		.cat
 ./usr/share/man/cat3/floorf.0			comp-c-catman		.cat
+./usr/share/man/cat3/fls32.0			comp-c-catman		.cat
+./usr/share/man/cat3/fls64.0			comp-c-catman		.cat
 ./usr/share/man/cat3/flushinp.0			comp-c-catman		.cat
 ./usr/share/man/cat3/flushok.0			comp-c-catman		.cat
 ./usr/share/man/cat3/fmax.0			comp-c-catman		.cat
@@ -11569,6 +11573,8 @@
 ./usr/share/man/html3/fetch.html		comp-c-htmlman		html
 ./usr/share/man/html3/fflush.html		comp-c-htmlman		html
 ./usr/share/man/html3/ffs.html			comp-c-htmlman		html
+./usr/share/man/html3/ffs32.html		comp-c-htmlman		html
+./usr/share/man/html3/ffs64.html		comp-c-htmlman		html
 ./usr/share/man/html3/fgetc.html		comp-c-htmlman		html
 ./usr/share/man/html3/fgetln.html		comp-c-htmlman		html
 ./usr/share/man/html3/fgetpos.html		comp-c-htmlman		html
@@ -11601,6 +11607,8 @@
 ./usr/share/man/html3/flockfile.html		comp-c-htmlman		html
 ./usr/share/man/html3/floor.html		comp-c-htmlman		html
 ./usr/share/man/html3/floorf.html		comp-c-htmlman		html
+./usr/share/man/html3/fls32.html		comp-c-htmlman		html
+./usr/share/man/html3/fls64.html		comp-c-htmlman		html
 ./usr/share/man/html3/flushinp.html		comp-c-htmlman		html
 ./usr/share/man/html3/flushok.html		comp-c-htmlman		html
 ./usr/share/man/html3/fmax.html			comp-c-htmlman		html
@@ -17302,6 +17310,8 @@
 ./usr/share/man/man3/fetch.3			comp-c-man		.man
 ./usr/share/man/man3/fflush.3			comp-c-man		.man
 ./usr/share/man/man3/ffs.3			comp-c-man		.man
+./usr/share/man/man3/ffs32.3			comp-c-man		.man
+./usr/share/man/man3/ffs64.3			comp-c-man		.man
 ./usr/share/man/man3/fgetc.3			comp-c-man		.man
 ./usr/share/man/man3/fgetln.3			comp-c-man		.man
 ./usr/share/man/man3/fgetpos.3			comp-c-man		.man
@@ -17335,6 +17345,8 @@
 ./usr/share/man/man3/flockfile.3		comp-c-man		.man
 ./usr/share/man/man3/floor.3			comp-c-man		.man
 ./usr/share/man/man3/floorf.3			comp-c-man		.man
+./usr/share/man/man3/fls32.3			comp-c-man		.man
+./usr/share/man/man3/fls64.3			comp-c-man		.man
 ./usr/share/man/man3/flushinp.3			comp-c-man		.man
 ./usr/share/man/man3/flushok.3			comp-c-man		.man
 ./usr/share/man/man3/fmax.3			comp-c-man		.man

Index: src/share/man/man3/Makefile
diff -u src/share/man/man3/Makefile:1.49 src/share/man/man3/Makefile:1.50
--- src/share/man/man3/Makefile:1.49	Thu Apr 22 06:48:29 2010
+++ src/share/man/man3/Makefile	Wed Apr 28 07:35:30 2010
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.49 2010/04/22 06:48:29 jruoho Exp $
+#	$NetBSD: Makefile,v 1.50 2010/04/28 07:35:30 jruoho Exp $
 #	@(#)Makefile	8.2 (Berkeley) 12/13/93
 
 MAN=	_DIAGASSERT.3 __CONCAT.3 __UNCONST.3 CMSG_DATA.3 \
 	__arraycount.3 assert.3 bits.3 bitstring.3 dlfcn.3 end.3 \
-	fast_divide32.3 gcq.3 intro.3 inttypes.3 iso646.3 offsetof.3 queue.3 \
-	rb.3 stdarg.3 stdbool.3 stddef.3 stdint.3 stdlib.3 sysexits.3 \
+	fast_divide32.3 ffs32.3 gcq.3 intro.3 inttypes.3 iso646.3 offsetof.3 \
+	queue.3 rb.3 stdarg.3 stdbool.3 stddef.3 stdint.3 stdlib.3 sysexits.3 \
 	tgmath.3 timeradd.3 tree.3 types.3 varargs.3
 
 USETBL=	# used by queue.3
@@ -29,6 +29,9 @@
 MLINKS+=end.3 edata.3 end.3 etext.3
 MLINKS+=fast_divide32.3 fast_divide32_prepare.3 \
 	fast_divide32.3 fast_remainder32.3
+MLINKS+=ffs32.3 ffs64.3 \
+	ffs32.3 fls32.3 \
+	ffs32.3 fls64.3
 MLINKS+=gcq.3 GCQ_INIT.3 \
 	gcq.3 GCQ_INIT_HEAD.3 \
 	gcq.3 gcq_init.3 \

Added files:

Index: src/share/man/man3/ffs32.

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

2010-04-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Apr 28 07:42:56 UTC 2010

Modified Files:
src/sys/rump/librump/rumpkern: emul.c

Log Message:
Make initial devsw a little more believable.  Especially adjust
max_sys_devsw, since it was previously a bit too much, given that
the correct value is 0.


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/sys/rump/librump/rumpkern/emul.c

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

Modified files:

Index: src/sys/rump/librump/rumpkern/emul.c
diff -u src/sys/rump/librump/rumpkern/emul.c:1.132 src/sys/rump/librump/rumpkern/emul.c:1.133
--- src/sys/rump/librump/rumpkern/emul.c:1.132	Wed Apr 21 20:07:02 2010
+++ src/sys/rump/librump/rumpkern/emul.c	Wed Apr 28 07:42:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: emul.c,v 1.132 2010/04/21 20:07:02 pooka Exp $	*/
+/*	$NetBSD: emul.c,v 1.133 2010/04/28 07:42:55 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.132 2010/04/21 20:07:02 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.133 2010/04/28 07:42:55 pooka Exp $");
 
 #include 
 #include 
@@ -75,16 +75,15 @@
 int boothowto = AB_SILENT;
 struct tty *constty;
 
-#define DEVSW_SIZE 255
-const struct bdevsw *bdevsw0[DEVSW_SIZE]; /* XXX storage size */
+const struct bdevsw *bdevsw0[1];
 const struct bdevsw **bdevsw = bdevsw0;
-const int sys_cdevsws = DEVSW_SIZE;
-int max_cdevsws = DEVSW_SIZE;
+const int sys_cdevsws = 0;
+int max_cdevsws = 1;
 
-const struct cdevsw *cdevsw0[DEVSW_SIZE]; /* XXX storage size */
+const struct cdevsw *cdevsw0[1];
 const struct cdevsw **cdevsw = cdevsw0;
-const int sys_bdevsws = DEVSW_SIZE;
-int max_bdevsws = DEVSW_SIZE;
+const int sys_bdevsws = 0;
+int max_bdevsws = 1;
 
 struct devsw_conv devsw_conv0;
 struct devsw_conv *devsw_conv = &devsw_conv0;



CVS commit: src/lib/libc/string

2010-04-28 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Apr 28 07:44:05 UTC 2010

Modified Files:
src/lib/libc/string: ffs.3

Log Message:
Reference ffs32(3). Also note POSIX compliance and the movement of the
header from  to .


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/string/ffs.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/string/ffs.3
diff -u src/lib/libc/string/ffs.3:1.11 src/lib/libc/string/ffs.3:1.12
--- src/lib/libc/string/ffs.3:1.11	Tue Jul 21 13:22:15 2009
+++ src/lib/libc/string/ffs.3	Wed Apr 28 07:44:04 2010
@@ -28,9 +28,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\" from: @(#)ffs.3	8.2 (Berkeley) 4/19/94
-.\"	$NetBSD: ffs.3,v 1.11 2009/07/21 13:22:15 wiz Exp $
+.\"	$NetBSD: ffs.3,v 1.12 2010/04/28 07:44:04 jruoho Exp $
 .\"
-.Dd July 21, 2009
+.Dd April 28, 2010
 .Dt FFS 3
 .Os
 .Sh NAME
@@ -53,9 +53,22 @@
 A return value of 0 means that the argument was zero.
 .Sh SEE ALSO
 .Xr bitstring 3 ,
+.Xr ffs32 3 ,
 .Xr popcount 3
+.Sh STANDARDS
+The
+.Fn ffs
+function conforms to
+.St -p1003.1-2001 .
 .Sh HISTORY
 The
 .Fn ffs
 function appeared in
 .Bx 4.3 .
+The prototype for it existed previously in the
+.In string.h header
+before it was moved to
+.In strings.h
+for
+.Tn POSIX
+compliance.



CVS commit: src/lib/libc/string

2010-04-28 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Apr 28 07:47:09 UTC 2010

Modified Files:
src/lib/libc/string: ffs.3

Log Message:
Only put the actual header for the .In line.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libc/string/ffs.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/string/ffs.3
diff -u src/lib/libc/string/ffs.3:1.12 src/lib/libc/string/ffs.3:1.13
--- src/lib/libc/string/ffs.3:1.12	Wed Apr 28 07:44:04 2010
+++ src/lib/libc/string/ffs.3	Wed Apr 28 07:47:09 2010
@@ -28,7 +28,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" from: @(#)ffs.3	8.2 (Berkeley) 4/19/94
-.\"	$NetBSD: ffs.3,v 1.12 2010/04/28 07:44:04 jruoho Exp $
+.\"	$NetBSD: ffs.3,v 1.13 2010/04/28 07:47:09 jruoho Exp $
 .\"
 .Dd April 28, 2010
 .Dt FFS 3
@@ -66,8 +66,8 @@
 function appeared in
 .Bx 4.3 .
 The prototype for it existed previously in the
-.In string.h header
-before it was moved to
+.In string.h
+header before it was moved to
 .In strings.h
 for
 .Tn POSIX



CVS commit: src/share/man/man3

2010-04-28 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Apr 28 07:56:54 UTC 2010

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

Log Message:
Fix typo in XXX-comment.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man3/ffs32.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/ffs32.3
diff -u src/share/man/man3/ffs32.3:1.1 src/share/man/man3/ffs32.3:1.2
--- src/share/man/man3/ffs32.3:1.1	Wed Apr 28 07:35:30 2010
+++ src/share/man/man3/ffs32.3	Wed Apr 28 07:56:54 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ffs32.3,v 1.1 2010/04/28 07:35:30 jruoho Exp $
+.\"	$NetBSD: ffs32.3,v 1.2 2010/04/28 07:56:54 jruoho Exp $
 .\"
 .\" Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -78,7 +78,7 @@
 for user applications.
 .\"
 .\" XXX: It is noted in the CVS history of  that MD-optimized
-.\"	  is a TODO. If those start appear, note it here.
+.\"	  is a TODO. If those start to appear, note it here.
 .\"
 .Sh EXAMPLES
 In the following example



CVS commit: [uebayasi-xip] src/sys/uvm

2010-04-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Apr 28 08:22:05 UTC 2010

Modified Files:
src/sys/uvm [uebayasi-xip]: uvm_extern.h uvm_object.h uvm_pglist.h

Log Message:
Don't expose uvm_page.h internal for usual uvm(9) users.


To generate a diff of this commit:
cvs rdiff -u -r1.161.2.2 -r1.161.2.3 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.26 -r1.26.18.1 src/sys/uvm/uvm_object.h
cvs rdiff -u -r1.7 -r1.7.18.1 src/sys/uvm/uvm_pglist.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/uvm/uvm_extern.h
diff -u src/sys/uvm/uvm_extern.h:1.161.2.2 src/sys/uvm/uvm_extern.h:1.161.2.3
--- src/sys/uvm/uvm_extern.h:1.161.2.2	Tue Apr 27 08:40:22 2010
+++ src/sys/uvm/uvm_extern.h	Wed Apr 28 08:22:04 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_extern.h,v 1.161.2.2 2010/04/27 08:40:22 uebayasi Exp $	*/
+/*	$NetBSD: uvm_extern.h,v 1.161.2.3 2010/04/28 08:22:04 uebayasi Exp $	*/
 
 /*
  *
@@ -476,7 +476,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Index: src/sys/uvm/uvm_object.h
diff -u src/sys/uvm/uvm_object.h:1.26 src/sys/uvm/uvm_object.h:1.26.18.1
--- src/sys/uvm/uvm_object.h:1.26	Wed Jun  4 15:06:04 2008
+++ src/sys/uvm/uvm_object.h	Wed Apr 28 08:22:05 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_object.h,v 1.26 2008/06/04 15:06:04 ad Exp $	*/
+/*	$NetBSD: uvm_object.h,v 1.26.18.1 2010/04/28 08:22:05 uebayasi Exp $	*/
 
 /*
  *
@@ -42,6 +42,7 @@
  */
 
 #include 
+#include 
 
 /*
  * uvm_object: all that is left of mach objects.

Index: src/sys/uvm/uvm_pglist.h
diff -u src/sys/uvm/uvm_pglist.h:1.7 src/sys/uvm/uvm_pglist.h:1.7.18.1
--- src/sys/uvm/uvm_pglist.h:1.7	Wed Jun  4 12:45:28 2008
+++ src/sys/uvm/uvm_pglist.h	Wed Apr 28 08:22:05 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.h,v 1.7 2008/06/04 12:45:28 ad Exp $	*/
+/*	$NetBSD: uvm_pglist.h,v 1.7.18.1 2010/04/28 08:22:05 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -36,6 +36,7 @@
  * This defines the type of a page queue, e.g. active list, inactive
  * list, etc.
  */
+struct vm_page;
 TAILQ_HEAD(pglist, vm_page);
 LIST_HEAD(pgflist, vm_page);
 



CVS commit: [uebayasi-xip] src/sys

2010-04-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Apr 28 08:25:33 UTC 2010

Modified Files:
src/sys/arch/i386/i386 [uebayasi-xip]: compat_16_machdep.c dumpsys.c
src/sys/arch/x86/x86 [uebayasi-xip]: bus_dma.c cpu.c
src/sys/uvm [uebayasi-xip]: uvm_meter.c

Log Message:
Adjustment for uvm/uvm_page.h.  More to follow later.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.2.1 src/sys/arch/i386/i386/compat_16_machdep.c
cvs rdiff -u -r1.8 -r1.8.2.1 src/sys/arch/i386/i386/dumpsys.c
cvs rdiff -u -r1.52 -r1.52.2.1 src/sys/arch/x86/x86/bus_dma.c
cvs rdiff -u -r1.66 -r1.66.2.1 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.50 -r1.50.2.1 src/sys/uvm/uvm_meter.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/i386/i386/compat_16_machdep.c
diff -u src/sys/arch/i386/i386/compat_16_machdep.c:1.20 src/sys/arch/i386/i386/compat_16_machdep.c:1.20.2.1
--- src/sys/arch/i386/i386/compat_16_machdep.c:1.20	Sat Nov 21 03:11:00 2009
+++ src/sys/arch/i386/i386/compat_16_machdep.c	Wed Apr 28 08:25:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_16_machdep.c,v 1.20 2009/11/21 03:11:00 rmind Exp $	*/
+/*	$NetBSD: compat_16_machdep.c,v 1.20.2.1 2010/04/28 08:25:33 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.20 2009/11/21 03:11:00 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.20.2.1 2010/04/28 08:25:33 uebayasi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_vm86.h"
@@ -52,7 +52,6 @@
 #include 
 #endif
 #include 
-#include 
 
 #include 
 #include 

Index: src/sys/arch/i386/i386/dumpsys.c
diff -u src/sys/arch/i386/i386/dumpsys.c:1.8 src/sys/arch/i386/i386/dumpsys.c:1.8.2.1
--- src/sys/arch/i386/i386/dumpsys.c:1.8	Sat Nov  7 07:27:44 2009
+++ src/sys/arch/i386/i386/dumpsys.c	Wed Apr 28 08:25:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dumpsys.c,v 1.8 2009/11/07 07:27:44 cegger Exp $	*/
+/*	$NetBSD: dumpsys.c,v 1.8.2.1 2010/04/28 08:25:33 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dumpsys.c,v 1.8 2009/11/07 07:27:44 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dumpsys.c,v 1.8.2.1 2010/04/28 08:25:33 uebayasi Exp $");
 
 #include 
 #include 
@@ -83,7 +83,6 @@
 #include 
 
 #include 
-#include 
 
 /*
  * Exports, needed by savecore, the debugger or elsewhere in the kernel.

Index: src/sys/arch/x86/x86/bus_dma.c
diff -u src/sys/arch/x86/x86/bus_dma.c:1.52 src/sys/arch/x86/x86/bus_dma.c:1.52.2.1
--- src/sys/arch/x86/x86/bus_dma.c:1.52	Fri Nov  6 23:10:10 2009
+++ src/sys/arch/x86/x86/bus_dma.c	Wed Apr 28 08:25:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.52 2009/11/06 23:10:10 dsl Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.52.2.1 2010/04/28 08:25:33 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2007 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.52 2009/11/06 23:10:10 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.52.2.1 2010/04/28 08:25:33 uebayasi Exp $");
 
 /*
  * The following is included because _bus_dma_uiomove is derived from
@@ -102,6 +102,7 @@
 #include 
 
 #include 
+#include 
 
 extern	paddr_t avail_end;
 

Index: src/sys/arch/x86/x86/cpu.c
diff -u src/sys/arch/x86/x86/cpu.c:1.66 src/sys/arch/x86/x86/cpu.c:1.66.2.1
--- src/sys/arch/x86/x86/cpu.c:1.66	Fri Jan  8 19:43:26 2010
+++ src/sys/arch/x86/x86/cpu.c	Wed Apr 28 08:25:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.66 2010/01/08 19:43:26 dyoung Exp $	*/
+/*	$NetBSD: cpu.c,v 1.66.2.1 2010/04/28 08:25:33 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.66 2010/01/08 19:43:26 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.66.2.1 2010/04/28 08:25:33 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"		/* for MPDEBUG */
@@ -85,6 +85,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 #include 

Index: src/sys/uvm/uvm_meter.c
diff -u src/sys/uvm/uvm_meter.c:1.50 src/sys/uvm/uvm_meter.c:1.50.2.1
--- src/sys/uvm/uvm_meter.c:1.50	Wed Oct 21 21:12:07 2009
+++ src/sys/uvm/uvm_meter.c	Wed Apr 28 08:25:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_meter.c,v 1.50 2009/10/21 21:12:07 rmind Exp $	*/
+/*	$NetBSD: uvm_meter.c,v 1.50.2.1 2010/04/28 08:25:33 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.50 2009/10/21 21:12:07 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.50.2.1 2010/04/28 08:25:33 uebayasi Exp $");
 
 #include 
 #include 
@@ -50,6 +50,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 /*



CVS commit: [uebayasi-xip] src/sys

2010-04-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Apr 28 08:31:07 UTC 2010

Modified Files:
src/sys/arch/acorn26/acorn26 [uebayasi-xip]: pmap.c
src/sys/arch/alpha/alpha [uebayasi-xip]: machdep.c pmap.c
src/sys/arch/amd64/amd64 [uebayasi-xip]: machdep.c
src/sys/arch/arm/arm32 [uebayasi-xip]: pmap.c
src/sys/arch/i386/i386 [uebayasi-xip]: machdep.c
src/sys/arch/ia64/ia64 [uebayasi-xip]: machdep.c pmap.c
src/sys/arch/m68k/m68k [uebayasi-xip]: pmap_motorola.c
src/sys/arch/mips/mips [uebayasi-xip]: mips_machdep.c pmap.c
src/sys/arch/powerpc/ibm4xx [uebayasi-xip]: pmap.c
src/sys/arch/powerpc/isa [uebayasi-xip]: isadma_machdep.c
src/sys/arch/powerpc/marvell [uebayasi-xip]: bus_dma.c
src/sys/arch/powerpc/oea [uebayasi-xip]: pmap.c
src/sys/arch/powerpc/powerpc [uebayasi-xip]: bus_dma.c
src/sys/arch/sh3/sh3 [uebayasi-xip]: mem.c pmap.c
src/sys/arch/vax/vax [uebayasi-xip]: pmap.c
src/sys/arch/x68k/x68k [uebayasi-xip]: machdep.c mem.c
src/sys/uvm [uebayasi-xip]: uvm_page.c uvm_page.h uvm_pglist.c

Log Message:
Always use struct vm_physseg *vm_physmem_ptrs[] in MD code.


To generate a diff of this commit:
cvs rdiff -u -r1.30.2.1 -r1.30.2.2 src/sys/arch/acorn26/acorn26/pmap.c
cvs rdiff -u -r1.325 -r1.325.2.1 src/sys/arch/alpha/alpha/machdep.c
cvs rdiff -u -r1.252.2.1 -r1.252.2.2 src/sys/arch/alpha/alpha/pmap.c
cvs rdiff -u -r1.141 -r1.141.2.1 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.211.2.10 -r1.211.2.11 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.681 -r1.681.2.1 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.22 -r1.22.2.1 src/sys/arch/ia64/ia64/machdep.c
cvs rdiff -u -r1.24.2.1 -r1.24.2.2 src/sys/arch/ia64/ia64/pmap.c
cvs rdiff -u -r1.55.2.1 -r1.55.2.2 src/sys/arch/m68k/m68k/pmap_motorola.c
cvs rdiff -u -r1.225 -r1.225.2.1 src/sys/arch/mips/mips/mips_machdep.c
cvs rdiff -u -r1.188.2.2 -r1.188.2.3 src/sys/arch/mips/mips/pmap.c
cvs rdiff -u -r1.60.2.1 -r1.60.2.2 src/sys/arch/powerpc/ibm4xx/pmap.c
cvs rdiff -u -r1.5 -r1.5.20.1 src/sys/arch/powerpc/isa/isadma_machdep.c
cvs rdiff -u -r1.20 -r1.20.2.1 src/sys/arch/powerpc/marvell/bus_dma.c
cvs rdiff -u -r1.69.2.1 -r1.69.2.2 src/sys/arch/powerpc/oea/pmap.c
cvs rdiff -u -r1.35 -r1.35.2.1 src/sys/arch/powerpc/powerpc/bus_dma.c
cvs rdiff -u -r1.26 -r1.26.64.1 src/sys/arch/sh3/sh3/mem.c
cvs rdiff -u -r1.74.2.2 -r1.74.2.3 src/sys/arch/sh3/sh3/pmap.c
cvs rdiff -u -r1.175 -r1.175.2.1 src/sys/arch/vax/vax/pmap.c
cvs rdiff -u -r1.164 -r1.164.2.1 src/sys/arch/x68k/x68k/machdep.c
cvs rdiff -u -r1.36 -r1.36.64.1 src/sys/arch/x68k/x68k/mem.c
cvs rdiff -u -r1.153.2.26 -r1.153.2.27 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.59.2.17 -r1.59.2.18 src/sys/uvm/uvm_page.h
cvs rdiff -u -r1.45.2.1 -r1.45.2.2 src/sys/uvm/uvm_pglist.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/acorn26/acorn26/pmap.c
diff -u src/sys/arch/acorn26/acorn26/pmap.c:1.30.2.1 src/sys/arch/acorn26/acorn26/pmap.c:1.30.2.2
--- src/sys/arch/acorn26/acorn26/pmap.c:1.30.2.1	Tue Apr 27 07:19:27 2010
+++ src/sys/arch/acorn26/acorn26/pmap.c	Wed Apr 28 08:31:05 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.30.2.1 2010/04/27 07:19:27 uebayasi Exp $ */
+/* $NetBSD: pmap.c,v 1.30.2.2 2010/04/28 08:31:05 uebayasi Exp $ */
 /*-
  * Copyright (c) 1997, 1998, 2000 Ben Harris
  * All rights reserved.
@@ -102,7 +102,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.30.2.1 2010/04/27 07:19:27 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.30.2.2 2010/04/28 08:31:05 uebayasi Exp $");
 
 #include  /* for cold */
 #include 
@@ -299,11 +299,11 @@
 	addr = 0;
 	size = round_page(size);
 	for (i = 0; i < vm_nphysseg; i++) {
-		if (vm_physmem[i].avail_start < vm_physmem[i].avail_end) {
+		if (VM_PHYSMEM_PTR(i)->avail_start < VM_PHYSMEM_PTR(i)->avail_end) {
 			addr = (vaddr_t)
 			((char*)MEMC_PHYS_BASE +
-ptoa(vm_physmem[i].avail_start));
-			vm_physmem[i].avail_start++;
+ptoa(VM_PHYSMEM_PTR(i)->avail_start));
+			VM_PHYSMEM_PTR(i)->avail_start++;
 			break;
 		}
 	}

Index: src/sys/arch/alpha/alpha/machdep.c
diff -u src/sys/arch/alpha/alpha/machdep.c:1.325 src/sys/arch/alpha/alpha/machdep.c:1.325.2.1
--- src/sys/arch/alpha/alpha/machdep.c:1.325	Thu Dec 10 14:13:48 2009
+++ src/sys/arch/alpha/alpha/machdep.c	Wed Apr 28 08:31:05 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.325 2009/12/10 14:13:48 matt Exp $ */
+/* $NetBSD: machdep.c,v 1.325.2.1 2010/04/28 08:31:05 uebayasi Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.325 2009/12/10 14:13:48 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.325.2.1 2010/04/28 08:31:05 uebayasi Exp $");
 
 #include 
 #include 
@@ -605,7 +605,7 @@
 		vsize_t sz = (vs

CVS commit: [uebayasi-xip] src/sys/uvm

2010-04-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Apr 28 09:27:47 UTC 2010

Modified Files:
src/sys/uvm [uebayasi-xip]: uvm_page.c uvm_page.h

Log Message:
Manage struct vm_physseg as a list, which means that struct vm_physseg
objects don't move when a segment is added / removed.


To generate a diff of this commit:
cvs rdiff -u -r1.153.2.27 -r1.153.2.28 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.59.2.18 -r1.59.2.19 src/sys/uvm/uvm_page.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/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.153.2.27 src/sys/uvm/uvm_page.c:1.153.2.28
--- src/sys/uvm/uvm_page.c:1.153.2.27	Wed Apr 28 08:31:05 2010
+++ src/sys/uvm/uvm_page.c	Wed Apr 28 09:27:47 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.153.2.27 2010/04/28 08:31:05 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.153.2.28 2010/04/28 09:27:47 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.27 2010/04/28 08:31:05 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.28 2010/04/28 09:27:47 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -103,13 +103,19 @@
 /* XXXUEBS make these array of pointers */
 /* XXXUEBS merge these two */
 
+SIMPLEQ_HEAD(vm_physseg_freelist, vm_physseg);
+
 struct vm_physseg *vm_physmem_ptrs[VM_PHYSSEG_MAX];
-struct vm_physseg vm_physmem_store[VM_PHYSSEG_MAX];
 int vm_nphysmem = 0;
+static struct vm_physseg vm_physmem_store[VM_PHYSSEG_MAX];
+static struct vm_physseg_freelist vm_physmem_freelist =
+SIMPLEQ_HEAD_INITIALIZER(vm_physmem_freelist);
 #ifdef DEVICE_PAGE
 struct vm_physseg *vm_physdev_ptrs[VM_PHYSSEG_MAX];
-struct vm_physseg vm_physdev_store[VM_PHYSSEG_MAX];
 int vm_nphysdev = 0;
+static struct vm_physseg vm_physdev_store[VM_PHYSSEG_MAX];
+static struct vm_physseg_freelist vm_physdev_freelist =
+SIMPLEQ_HEAD_INITIALIZER(vm_physdev_freelist);
 #endif
 
 /*
@@ -753,7 +759,7 @@
  */
 
 static struct vm_physseg *
-uvm_page_physload_common(struct vm_physseg * const, int,
+uvm_page_physload_common(struct vm_physseg_freelist * const, struct vm_physseg **, int,
 const paddr_t, const paddr_t, const paddr_t, const paddr_t, const int);
 #if 0
 static void
@@ -762,7 +768,7 @@
 static void
 uvm_page_physseg_init(void);
 static struct vm_physseg *
-uvm_physseg_insert(struct vm_physseg *, int,
+uvm_physseg_insert(struct vm_physseg_freelist *, struct vm_physseg **, int,
 const paddr_t, const paddr_t);
 
 void *
@@ -772,8 +778,8 @@
 	struct vm_physseg *seg;
 	int lcv;
 
-	seg = uvm_page_physload_common(vm_physmem_store, vm_nphysmem, start, end,
-	avail_start, avail_end, free_list);
+	seg = uvm_page_physload_common(&vm_physmem_freelist, vm_physmem_ptrs,
+	vm_nphysmem, start, end, avail_start, avail_end, free_list);
 	KASSERT(seg != NULL);
 
 	seg->avail_start = avail_start;
@@ -804,8 +810,8 @@
 {
 	struct vm_physseg *seg;
 
-	seg = uvm_page_physload_common(vm_physdev, vm_nphysdev, start, end,
-	avail_start, avail_end, free_list);
+	seg = uvm_page_physload_common(&vm_physdev_freelist, vm_physdev_ptrs,
+	vm_nphysdev, start, end, avail_start, avail_end, free_list);
 	KASSERT(seg != NULL);
 
 	for (paddr_t pf = start; pf < end; pf++)
@@ -816,7 +822,8 @@
 #endif
 
 static struct vm_physseg *
-uvm_page_physload_common(struct vm_physseg * const segs, int nsegs,
+uvm_page_physload_common(struct vm_physseg_freelist *freelist,
+struct vm_physseg **segs, int nsegs,
 const paddr_t start, const paddr_t end,
 const paddr_t avail_start, const paddr_t avail_end, const int free_list)
 {
@@ -842,7 +849,7 @@
 		uvm_page_physseg_init();
 	}
 
-	ps = uvm_physseg_insert(segs, nsegs, start, end);
+	ps = uvm_physseg_insert(freelist, segs, nsegs, start, end);
 	KASSERT(ps != NULL);
 	ps->start = start;
 	ps->end = end;
@@ -856,37 +863,40 @@
 	int lcv;
 
 	for (lcv = 0; lcv < VM_PHYSSEG_MAX; lcv++) {
-		vm_physmem_ptrs[lcv] = &vm_physmem_store[lcv];
+		SIMPLEQ_INSERT_TAIL(&vm_physmem_freelist, &vm_physmem_store[lcv], list);
 	}
 #ifdef DEVICE_PAGE
 	for (lcv = 0; lcv < VM_PHYSSEG_MAX; lcv++) {
-		vm_physdev_ptrs[lcv] = &vm_physdev_store[lcv];
+		SIMPLEQ_INSERT_TAIL(&vm_physdev_freelist, &vm_physdev_store[lcv], list);
 	}
 #endif
 }
 
 static struct vm_physseg *
-uvm_physseg_insert(struct vm_physseg *segs, int nsegs,
-const paddr_t start, const paddr_t end)
+uvm_physseg_insert(struct vm_physseg_freelist *freelist,
+struct vm_physseg **segs, int nsegs, const paddr_t start, const paddr_t end)
 {
 	struct vm_physseg *ps;
 	int lcv;
 
+	ps = SIMPLEQ_FIRST(freelist);
+	KASSERT(ps != NULL);
+	SIMPLEQ_REMOVE_HEAD(freelist, list);
+
 #if (VM_PHYSSEG_STRAT == VM_PSTRAT_RANDOM)
 	/* random: put it at the end (easy!) */
-	ps = &segs[nsegs];
+	segs[nsegs] = ps;
 #elif (VM_PHYSSEG_STRAT == VM_PSTRAT_BSEARCH)
 	{

CVS commit: src

2010-04-28 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Wed Apr 28 09:55:25 UTC 2010

Modified Files:
src/distrib/sets/lists/base: md.amd64
src/distrib/sets/lists/comp: md.amd64
src/distrib/sets/lists/xcomp: md.amd64
src/etc/mtree: NetBSD.dist.x86_64

Log Message:
Fix MKDEBUG=yes library builds for amd64


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.64 -r1.65 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.20 -r1.21 src/distrib/sets/lists/xcomp/md.amd64
cvs rdiff -u -r1.1 -r1.2 src/etc/mtree/NetBSD.dist.x86_64

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/md.amd64
diff -u src/distrib/sets/lists/base/md.amd64:1.87 src/distrib/sets/lists/base/md.amd64:1.88
--- src/distrib/sets/lists/base/md.amd64:1.87	Sun Apr 25 00:54:44 2010
+++ src/distrib/sets/lists/base/md.amd64	Wed Apr 28 09:55:25 2010
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.87 2010/04/25 00:54:44 joerg Exp $
+# $NetBSD: md.amd64,v 1.88 2010/04/28 09:55:25 lukem Exp $
 ./dev/lms0	base-obsolete		obsolete
 ./dev/mms0	base-obsolete		obsolete
 ./libexec/ld.elf_so-i386			base-sys-shlib		compat,pic
@@ -240,6 +240,8 @@
 ./usr/lib/libx86_64.sobase-sys-shlib		pic
 ./usr/lib/libx86_64.so.0			base-sys-shlib		pic
 ./usr/lib/libx86_64.so.0.0			base-sys-shlib		pic
+./usr/libdata/debug/usr/lib/i386		base-compat-lib		compat
+./usr/libdata/debug/usr/lib/i386/i18n		base-compat-lib		compat
 ./usr/libexec/ld.elf_so-i386			base-sys-shlib		compat,pic
 ./usr/lkm/aps.o	base-obsolete		obsolete
 ./usr/lkm/compat_linux.o			base-obsolete		obsolete

Index: src/distrib/sets/lists/comp/md.amd64
diff -u src/distrib/sets/lists/comp/md.amd64:1.64 src/distrib/sets/lists/comp/md.amd64:1.65
--- src/distrib/sets/lists/comp/md.amd64:1.64	Wed Feb  3 15:34:37 2010
+++ src/distrib/sets/lists/comp/md.amd64	Wed Apr 28 09:55:25 2010
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.64 2010/02/03 15:34:37 roy Exp $
+# $NetBSD: md.amd64,v 1.65 2010/04/28 09:55:25 lukem Exp $
 ./usr/include/amd64comp-c-include
 ./usr/include/amd64/ansi.h			comp-c-include
 ./usr/include/amd64/aout_machdep.h		comp-c-include
@@ -704,6 +704,108 @@
 ./usr/lib/libx86_64_pic.a			comp-c-piclib		pic
 ./usr/libdata/debug/usr/bin/fdformat.debug	comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/iasl.debug		comp-util-debug		debug
+./usr/libdata/debug/usr/lib/i386/i18n/libBIG5.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libDECHanyu.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libEUC.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libEUCTW.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libGBK2K.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libHZ.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libISO2022.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libJOHAB.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libMSKanji.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libUES.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libUTF1632.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libUTF7.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libUTF8.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libVIQR.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libZW.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libiconv_none.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libiconv_std.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libmapper_646.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libmapper_none.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libmapper_parallel.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libmapper_serial.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libmapper_std.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/i18n/libmapper_zone.so.5.0.debug	comp-i18n-shlib		compat,pic,debug
+./usr/libdata/debug/usr/lib/i386/libasn1.so.8.0.debug	comp-compat-shlib	compat,pic,kerberos,debug
+./usr/libdata/debug/usr/lib/i386/libbfd.so.11.0.debug	comp-compat-shlib	compat,pic,binutils,debug
+./usr/libdata/debug/usr/lib/i386/libbind9.so.5.1.debug	comp-compat-shlib	compat,

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

2010-04-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Apr 28 11:34:18 UTC 2010

Modified Files:
src/sys/rump/librump/rumpkern: rump.c

Log Message:
If RUMP_NCPU is set, use that for virtual CPU count instead of
host CPU count.


To generate a diff of this commit:
cvs rdiff -u -r1.166 -r1.167 src/sys/rump/librump/rumpkern/rump.c

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

Modified files:

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.166 src/sys/rump/librump/rumpkern/rump.c:1.167
--- src/sys/rump/librump/rumpkern/rump.c:1.166	Wed Apr 28 00:43:16 2010
+++ src/sys/rump/librump/rumpkern/rump.c	Wed Apr 28 11:34:18 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.166 2010/04/28 00:43:16 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.167 2010/04/28 11:34:18 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.166 2010/04/28 00:43:16 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.167 2010/04/28 11:34:18 pooka Exp $");
 
 #include 
 #define ELFSIZE ARCH_ELFSIZE
@@ -219,10 +219,20 @@
 			boothowto = AB_VERBOSE;
 	}
 
+	if (rumpuser_getenv("RUMP_NCPU", buf, sizeof(buf), &error) == 0)
+		error = 0;
 	/* non-x86 is missing CPU_INFO_FOREACH() support */
 #if defined(__i386__) || defined(__x86_64__)
-	numcpu = rumpuser_getnhostcpu();
+	if (error == 0) {
+		numcpu = strtoll(buf, NULL, 10);
+		if (numcpu < 1)
+			numcpu = 1;
+	} else {
+		numcpu = rumpuser_getnhostcpu();
+	}
 #else
+	if (error == 0)
+		printf("NCPU limited to 1 on this host\n");
 	numcpu = 1;
 #endif
 	rump_cpus_bootstrap(numcpu);



CVS commit: src/share/man/man2

2010-04-28 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Apr 28 13:23:02 UTC 2010

Modified Files:
src/share/man/man2: ucontext.2

Log Message:
Improvements to markup.


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

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/man2/ucontext.2
diff -u src/share/man/man2/ucontext.2:1.3 src/share/man/man2/ucontext.2:1.4
--- src/share/man/man2/ucontext.2:1.3	Wed Apr 30 13:10:53 2008
+++ src/share/man/man2/ucontext.2	Wed Apr 28 13:23:02 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ucontext.2,v 1.3 2008/04/30 13:10:53 martin Exp $
+.\"	$NetBSD: ucontext.2,v 1.4 2010/04/28 13:23:02 jruoho Exp $
 .\"
 .\" Copyright (c) 2001 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 13, 2001
+.Dd April 28, 2010
 .Dt UCONTEXT 2
 .Os
 .Sh NAME
@@ -36,17 +36,21 @@
 .Sh SYNOPSIS
 .In ucontext.h
 .Sh DESCRIPTION
-.Nm ucontext_t
+The
+.Vt ucontext_t
 is a structure type which is used to describe the context of a
 thread of control within the execution of a process.
+A thread's context includes its stack, saved registers, and list of
+blocked signals.
 .Pp
-.Nm ucontext_t
-includes the following members:
+The
+.Vt ucontext_t
+structure includes the following members:
 .Bd -literal -offset indent
-ucontext_t *  uc_link
-sigset_t  uc_sigmask
-stack_t   uc_stack
-mcontext_tuc_mcontext
+ucontext_t *uc_link
+sigset_tuc_sigmask
+stack_t uc_stack
+mcontext_t  uc_mcontext
 .Ed
 .Pp
 The
@@ -57,7 +61,9 @@
 has returned.
 If
 .Fa uc_link
-is a null pointer, then the context is the main context,
+is a
+.Dv NULL
+pointer, then the context is the main context,
 and the process will exit with an exit status of 0 upon return.
 .Pp
 The



CVS commit: [uebayasi-xip] src/sys/uvm

2010-04-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Apr 28 13:28:43 UTC 2010

Modified Files:
src/sys/uvm [uebayasi-xip]: uvm_extern.h uvm_page.c

Log Message:
Initial support of uvm_page_physunload(9) and uvm_page_physunload_device(9).
Note that callers of these functions are responsible to ensure that the
segment is not used.


To generate a diff of this commit:
cvs rdiff -u -r1.161.2.3 -r1.161.2.4 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.153.2.28 -r1.153.2.29 src/sys/uvm/uvm_page.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/uvm/uvm_extern.h
diff -u src/sys/uvm/uvm_extern.h:1.161.2.3 src/sys/uvm/uvm_extern.h:1.161.2.4
--- src/sys/uvm/uvm_extern.h:1.161.2.3	Wed Apr 28 08:22:04 2010
+++ src/sys/uvm/uvm_extern.h	Wed Apr 28 13:28:42 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_extern.h,v 1.161.2.3 2010/04/28 08:22:04 uebayasi Exp $	*/
+/*	$NetBSD: uvm_extern.h,v 1.161.2.4 2010/04/28 13:28:42 uebayasi Exp $	*/
 
 /*
  *
@@ -722,8 +722,10 @@
 /* Actually, uvm_page_physload takes PF#s which need their own type */
 void			*uvm_page_physload(paddr_t, paddr_t,
 			paddr_t, paddr_t, int);
+void			uvm_page_physunload(void *);
 void			*uvm_page_physload_device(paddr_t, paddr_t,
 			paddr_t, paddr_t, int);
+void			uvm_page_physunload_device(void *);
 void			uvm_setpagesize(void);
 
 /* uvm_pager.c */

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.153.2.28 src/sys/uvm/uvm_page.c:1.153.2.29
--- src/sys/uvm/uvm_page.c:1.153.2.28	Wed Apr 28 09:27:47 2010
+++ src/sys/uvm/uvm_page.c	Wed Apr 28 13:28:43 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.153.2.28 2010/04/28 09:27:47 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.153.2.29 2010/04/28 13:28:43 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.28 2010/04/28 09:27:47 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.29 2010/04/28 13:28:43 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -176,10 +176,8 @@
 static void uvm_pageremove(struct uvm_object *, struct vm_page *);
 #ifdef DEVICE_PAGE
 static void vm_page_device_mdpage_insert(paddr_t);
-#if 0
 static void vm_page_device_mdpage_remove(paddr_t);
 #endif
-#endif
 
 /*
  * per-object tree of pages
@@ -761,15 +759,17 @@
 static struct vm_physseg *
 uvm_page_physload_common(struct vm_physseg_freelist * const, struct vm_physseg **, int,
 const paddr_t, const paddr_t, const paddr_t, const paddr_t, const int);
-#if 0
 static void
-uvm_page_physunload_common(struct vm_physseg * const);
-#endif
+uvm_page_physunload_common(struct vm_physseg_freelist *,
+struct vm_physseg **, struct vm_physseg *);
 static void
 uvm_page_physseg_init(void);
 static struct vm_physseg *
 uvm_physseg_insert(struct vm_physseg_freelist *, struct vm_physseg **, int,
 const paddr_t, const paddr_t);
+static void
+uvm_physseg_remove(struct vm_physseg_freelist *, struct vm_physseg **,
+struct vm_physseg *);
 
 void *
 uvm_page_physload(paddr_t start, paddr_t end, paddr_t avail_start,
@@ -803,6 +803,19 @@
 	return seg;
 }
 
+void
+uvm_page_physunload(void *cookie)
+{
+	struct vm_physseg *seg = cookie;
+
+	panic("memory unload is not supported yet");
+
+	/* XXX */
+
+	uvm_page_physunload_common(&vm_physmem_freelist, vm_physmem_ptrs, seg);
+	vm_nphysmem--;
+}
+
 #ifdef DEVICE_PAGE
 void *
 uvm_page_physload_device(paddr_t start, paddr_t end, paddr_t avail_start,
@@ -819,6 +832,17 @@
 	vm_nphysdev++;
 	return seg;
 }
+
+void
+uvm_page_physunload_device(void *cookie)
+{
+	struct vm_physseg *seg = cookie;
+
+	for (paddr_t pf = seg->start; pf < seg->end; pf++)
+		vm_page_device_mdpage_remove(pf);
+	uvm_page_physunload_common(&vm_physdev_freelist, vm_physdev_ptrs, seg);
+	vm_nphysdev--;
+}
 #endif
 
 static struct vm_physseg *
@@ -857,6 +881,14 @@
 	return ps;
 }
 
+void
+uvm_page_physunload_common(struct vm_physseg_freelist *freelist,
+struct vm_physseg **segs, struct vm_physseg *seg)
+{
+
+	uvm_physseg_remove(freelist, segs, seg);
+}
+
 static void
 uvm_page_physseg_init(void)
 {
@@ -917,6 +949,24 @@
 	return ps;
 }
 
+static void
+uvm_physseg_remove(struct vm_physseg_freelist *freelist, struct vm_physseg **segs,
+struct vm_physseg *seg)
+{
+	struct vm_physseg **segp;
+
+	for (segp = segs; segp < segs + VM_PHYSSEG_MAX; segp++)
+		if (*segp == seg)
+			break;
+	if (segp == segs + VM_PHYSSEG_MAX)
+		panic("unknown segment: %p", seg);
+	SIMPLEQ_INSERT_TAIL(freelist, seg, list);
+	while (segp < segs + VM_PHYSSEG_MAX) {
+		*segp = *(segp + 1);
+		segp++;
+	}
+}
+
 /*
  * vm_physseg_find: find vm_physseg structure that belongs to a PA
  */
@@ -1248,7 +1298,6 @@
 	mutex_spin_exit(lock);
 }
 
-#if 0
 static void
 vm_page_device_mdpage_remove(paddr_t pf)
 {
@@ -1275,7 +1324,6 @@
 	KASSERT(mde != NULL);
 	kmem_free(mde, sizeof(*mde));
 }
-

CVS commit: [uebayasi-xip] src/sys/dev

2010-04-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Apr 28 13:41:41 UTC 2010

Modified Files:
src/sys/dev [uebayasi-xip]: flash.c flashvar.h

Log Message:
At device attachment, register the given bus address region as possible
"managed" region using the new bus_space_physload_device(9) API.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/dev/flash.c
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/dev/flashvar.h

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

Modified files:

Index: src/sys/dev/flash.c
diff -u src/sys/dev/flash.c:1.1.2.4 src/sys/dev/flash.c:1.1.2.5
--- src/sys/dev/flash.c:1.1.2.4	Sun Feb 28 05:03:58 2010
+++ src/sys/dev/flash.c	Wed Apr 28 13:41:41 2010
@@ -1,4 +1,4 @@
-/*	$Id: flash.c,v 1.1.2.4 2010/02/28 05:03:58 uebayasi Exp $	*/
+/*	$Id: flash.c,v 1.1.2.5 2010/04/28 13:41:41 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2010 Tsubai Masanari.  All rights reserved.
@@ -237,6 +237,15 @@
 	sc->sc_size / 1024, sc->sc_wordsize * 8);
 #endif
 
+#ifdef XIP
+#ifndef __HAVE_BUS_SPACE_PHYSLOAD
+#error bus_space_physload_device(9) must be supported to use XIP!
+#else
+	sc->sc_phys = bus_space_physload_device(sc->sc_iot, sc->sc_addr, sc->sc_size,
+	PROT_READ | PROT_WRITE, BUS_SPACE_MAP_LINEAR);
+#endif
+#endif
+
 	disk_init(&sc->sc_dkdev, device_xname(&sc->sc_dev), NULL);
 	disk_attach(&sc->sc_dkdev);
 }

Index: src/sys/dev/flashvar.h
diff -u src/sys/dev/flashvar.h:1.1.2.2 src/sys/dev/flashvar.h:1.1.2.3
--- src/sys/dev/flashvar.h:1.1.2.2	Wed Feb 24 01:19:37 2010
+++ src/sys/dev/flashvar.h	Wed Apr 28 13:41:41 2010
@@ -1,4 +1,4 @@
-/*	$Id: flashvar.h,v 1.1.2.2 2010/02/24 01:19:37 uebayasi Exp $	*/
+/*	$Id: flashvar.h,v 1.1.2.3 2010/04/28 13:41:41 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2010 Tsubai Masanari.  All rights reserved.
@@ -50,6 +50,7 @@
 	int (*sc_program)(struct flash_softc *, u_long, u_long);
 	int (*sc_eraseblk)(struct flash_softc *, u_long);
 	struct flash_product *sc_product;
+	void *sc_phys;
 };
 
 int flash_map(struct flash_softc *, u_long);



CVS commit: src/crypto/external/bsd/netpgp/dist/bindings/perl

2010-04-28 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Wed Apr 28 14:01:27 UTC 2010

Modified Files:
src/crypto/external/bsd/netpgp/dist/bindings/perl: Makefile netpgp.h
netpgpperl.pm netpgpperl_wrap.c

Log Message:
refresh the perl bindings to catch up with the changes in the library


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/netpgp/dist/bindings/perl/Makefile \
src/crypto/external/bsd/netpgp/dist/bindings/perl/netpgpperl_wrap.c
cvs rdiff -u -r1.1 -r1.2 \
src/crypto/external/bsd/netpgp/dist/bindings/perl/netpgp.h \
src/crypto/external/bsd/netpgp/dist/bindings/perl/netpgpperl.pm

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/bindings/perl/Makefile
diff -u src/crypto/external/bsd/netpgp/dist/bindings/perl/Makefile:1.2 src/crypto/external/bsd/netpgp/dist/bindings/perl/Makefile:1.3
--- src/crypto/external/bsd/netpgp/dist/bindings/perl/Makefile:1.2	Tue Dec  1 20:44:50 2009
+++ src/crypto/external/bsd/netpgp/dist/bindings/perl/Makefile	Wed Apr 28 14:01:27 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2009/12/01 20:44:50 agc Exp $
+# $NetBSD: Makefile,v 1.3 2010/04/28 14:01:27 agc Exp $
 # Automatically generated by swigit wrapper script
 
 PREFIX=/usr/pkg
@@ -7,6 +7,7 @@
 SRCS=netpgpperl_wrap.c
 WARNS=0
 MKMAN=no
+MKLINT=no
 CPPFLAGS+=-I${PREFIX}/include
 CPPFLAGS+=-I/usr/pkg/lib/perl5/5.10.0/i386-netbsd-thread-multi/CORE
 LDFLAGS+=-L${PREFIX}/lib
Index: src/crypto/external/bsd/netpgp/dist/bindings/perl/netpgpperl_wrap.c
diff -u src/crypto/external/bsd/netpgp/dist/bindings/perl/netpgpperl_wrap.c:1.2 src/crypto/external/bsd/netpgp/dist/bindings/perl/netpgpperl_wrap.c:1.3
--- src/crypto/external/bsd/netpgp/dist/bindings/perl/netpgpperl_wrap.c:1.2	Tue Dec  1 20:44:50 2009
+++ src/crypto/external/bsd/netpgp/dist/bindings/perl/netpgpperl_wrap.c	Wed Apr 28 14:01:27 2010
@@ -2635,35 +2635,56 @@
 }
 
 
-XS(_wrap_netpgp_list_keys) {
+XS(_wrap_netpgp_incvar) {
   {
 netpgp_t *arg1 = (netpgp_t *) 0 ;
+char *arg2 = (char *) 0 ;
+int arg3 ;
 int result;
 void *argp1 = 0 ;
 int res1 = 0 ;
+int res2 ;
+char *buf2 = 0 ;
+int alloc2 = 0 ;
+int val3 ;
+int ecode3 = 0 ;
 int argvi = 0;
 dXSARGS;
 
-if ((items < 1) || (items > 1)) {
-  SWIG_croak("Usage: netpgp_list_keys(netpgp_t *);");
+if ((items < 3) || (items > 3)) {
+  SWIG_croak("Usage: netpgp_incvar(netpgp_t *,char const *,int const);");
 }
 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 |  0 );
 if (!SWIG_IsOK(res1)) {
-  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_list_keys" "', argument " "1"" of type '" "netpgp_t *""'"); 
+  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_incvar" "', argument " "1"" of type '" "netpgp_t *""'"); 
 }
 arg1 = (netpgp_t *)(argp1);
-result = (int)netpgp_list_keys(arg1);
+res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+if (!SWIG_IsOK(res2)) {
+  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_incvar" "', argument " "2"" of type '" "char const *""'");
+}
+arg2 = (char *)(buf2);
+ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
+if (!SWIG_IsOK(ecode3)) {
+  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "netpgp_incvar" "', argument " "3"" of type '" "int""'");
+} 
+arg3 = (int)(val3);
+result = (int)netpgp_incvar(arg1,(char const *)arg2,arg3);
 ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
 
+if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+
 XSRETURN(argvi);
   fail:
 
+if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+
 SWIG_croak_null();
   }
 }
 
 
-XS(_wrap_netpgp_list_sigs) {
+XS(_wrap_netpgp_unsetvar) {
   {
 netpgp_t *arg1 = (netpgp_t *) 0 ;
 char *arg2 = (char *) 0 ;
@@ -2677,19 +2698,19 @@
 dXSARGS;
 
 if ((items < 2) || (items > 2)) {
-  SWIG_croak("Usage: netpgp_list_sigs(netpgp_t *,char const *);");
+  SWIG_croak("Usage: netpgp_unsetvar(netpgp_t *,char const *);");
 }
 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 |  0 );
 if (!SWIG_IsOK(res1)) {
-  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_list_sigs" "', argument " "1"" of type '" "netpgp_t *""'"); 
+  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_unsetvar" "', argument " "1"" of type '" "netpgp_t *""'"); 
 }
 arg1 = (netpgp_t *)(argp1);
 res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
 if (!SWIG_IsOK(res2)) {
-  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_list_sigs" "', argument " "2"" of type '" "char const *""'");
+  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_unsetvar" "', argument " "2"" of type '" "ch

CVS commit: src

2010-04-28 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Apr 28 14:07:03 UTC 2010

Modified Files:
src/lib/libc/gen: makecontext.3
src/lib/libc/sys: getcontext.2
src/share/man/man2: ucontext.2

Log Message:
Note that the ucontext(2) et. al. were first moved from X/OPEN extensions to
the base POSIX-2001 and later marked as obsolete in POSIX-2008.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/gen/makecontext.3
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/sys/getcontext.2
cvs rdiff -u -r1.4 -r1.5 src/share/man/man2/ucontext.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/gen/makecontext.3
diff -u src/lib/libc/gen/makecontext.3:1.7 src/lib/libc/gen/makecontext.3:1.8
--- src/lib/libc/gen/makecontext.3:1.7	Mon Apr 20 08:37:22 2009
+++ src/lib/libc/gen/makecontext.3	Wed Apr 28 14:07:03 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: makecontext.3,v 1.7 2009/04/20 08:37:22 wiz Exp $
+.\"	$NetBSD: makecontext.3,v 1.8 2010/04/28 14:07:03 jruoho Exp $
 .\"
 .\" Copyright (c) 2001, 2009 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 April 16, 2009
+.Dd April 28, 2010
 .Dt MAKECONTEXT 3
 .Os
 .Sh NAME
@@ -133,7 +133,19 @@
 and
 .Fn swapcontext
 functions conform to
-.St -xsh5 .
+.St -xsh5
+and
+.St -p1003.1-2001 .
+.Pp
+The
+.St -p1003.1-2008
+revision marked the functions
+.Fn makecontext
+and
+.Fn swapcontext
+as obsolete, citing portability issues and recommending the use of
+.Tn POSIX
+threads instead.
 .Pp
 .Bf -symbolic
 The standard does not clearly define the type of integer arguments

Index: src/lib/libc/sys/getcontext.2
diff -u src/lib/libc/sys/getcontext.2:1.5 src/lib/libc/sys/getcontext.2:1.6
--- src/lib/libc/sys/getcontext.2:1.5	Wed Apr 30 13:10:51 2008
+++ src/lib/libc/sys/getcontext.2	Wed Apr 28 14:07:03 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getcontext.2,v 1.5 2008/04/30 13:10:51 martin Exp $
+.\"	$NetBSD: getcontext.2,v 1.6 2010/04/28 14:07:03 jruoho Exp $
 .\"
 .\" Copyright (c) 1999 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 October 28, 1999
+.Dd April 28, 2010
 .Dt GETCONTEXT 2
 .Os
 .Sh NAME
@@ -124,10 +124,22 @@
 and
 .Fn setcontext
 functions conform to
-.St -xsh5 .
+.St -xsh5
+and
+.St -p1003.1-2001 .
 The
 .Va errno
 indications are an extension to the standard.
+.Pp
+The
+.St -p1003.1-2008
+revision marked the functions
+.Fn getcontext
+and
+.Fn setcontext
+as obsolete, citing portability issues and recommending the use of
+.Tn POSIX
+threads instead.
 .Sh HISTORY
 The
 .Fn getcontext

Index: src/share/man/man2/ucontext.2
diff -u src/share/man/man2/ucontext.2:1.4 src/share/man/man2/ucontext.2:1.5
--- src/share/man/man2/ucontext.2:1.4	Wed Apr 28 13:23:02 2010
+++ src/share/man/man2/ucontext.2	Wed Apr 28 14:07:03 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ucontext.2,v 1.4 2010/04/28 13:23:02 jruoho Exp $
+.\"	$NetBSD: ucontext.2,v 1.5 2010/04/28 14:07:03 jruoho Exp $
 .\"
 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -96,13 +96,11 @@
 .Xr swapcontext 3
 .Sh STANDARDS
 The
-.Nm ucontext_t
+.Vt ucontext_t
 type conforms to
-.St -xsh5 .
-.Sh HISTORY
-The
-.Fn makecontext
+.St -xsh5
 and
-.Fn swapcontext
-functions first appeared in
-.At V.4 .
+.St -p1003.1-2001 .
+The
+.St -p1003.1-2008
+revision marked the accompanying functions as obsolescent.



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

2010-04-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Apr 28 14:23:58 UTC 2010

Modified Files:
src/sys/rump/librump/rumpkern: rump.c

Log Message:
Set l_sysent so that syscall autoload actually works instead of autocores.


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 src/sys/rump/librump/rumpkern/rump.c

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

Modified files:

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.167 src/sys/rump/librump/rumpkern/rump.c:1.168
--- src/sys/rump/librump/rumpkern/rump.c:1.167	Wed Apr 28 11:34:18 2010
+++ src/sys/rump/librump/rumpkern/rump.c	Wed Apr 28 14:23:57 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.167 2010/04/28 11:34:18 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.168 2010/04/28 14:23:57 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.167 2010/04/28 11:34:18 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.168 2010/04/28 14:23:57 pooka Exp $");
 
 #include 
 #define ELFSIZE ARCH_ELFSIZE
@@ -531,6 +531,7 @@
 	l->l_lid = lid;
 	l->l_fd = p->p_fd;
 	l->l_cpu = NULL;
+	l->l_sysent = rump_sysent;
 	lwp_initspecific(l);
 	LIST_INSERT_HEAD(&alllwp, l, l_list);
 



CVS commit: src/crypto/external/bsd/netpgp/dist/bindings/python

2010-04-28 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Wed Apr 28 14:41:13 UTC 2010

Modified Files:
src/crypto/external/bsd/netpgp/dist/bindings/python: Makefile netpgp.h
netpgppython.py netpgppython_wrap.c

Log Message:
update python bindings to work with newer library interface


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/crypto/external/bsd/netpgp/dist/bindings/python/Makefile \
src/crypto/external/bsd/netpgp/dist/bindings/python/netpgp.h \
src/crypto/external/bsd/netpgp/dist/bindings/python/netpgppython.py \
src/crypto/external/bsd/netpgp/dist/bindings/python/netpgppython_wrap.c

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/bindings/python/Makefile
diff -u src/crypto/external/bsd/netpgp/dist/bindings/python/Makefile:1.1 src/crypto/external/bsd/netpgp/dist/bindings/python/Makefile:1.2
--- src/crypto/external/bsd/netpgp/dist/bindings/python/Makefile:1.1	Wed Dec  2 00:32:06 2009
+++ src/crypto/external/bsd/netpgp/dist/bindings/python/Makefile	Wed Apr 28 14:41:13 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2009/12/02 00:32:06 agc Exp $
+# $NetBSD: Makefile,v 1.2 2010/04/28 14:41:13 agc Exp $
 # Automatically generated by swigit wrapper script
 
 PREFIX=/usr/pkg
@@ -13,3 +13,6 @@
 LDADD+=-lnetpgp
 
 .include 
+
+full:
+	ln libnetpgppython.so _netpgppython.so
Index: src/crypto/external/bsd/netpgp/dist/bindings/python/netpgp.h
diff -u src/crypto/external/bsd/netpgp/dist/bindings/python/netpgp.h:1.1 src/crypto/external/bsd/netpgp/dist/bindings/python/netpgp.h:1.2
--- src/crypto/external/bsd/netpgp/dist/bindings/python/netpgp.h:1.1	Wed Dec  2 00:32:06 2009
+++ src/crypto/external/bsd/netpgp/dist/bindings/python/netpgp.h	Wed Apr 28 14:41:13 2010
@@ -66,13 +66,17 @@
 /* variables */
 int netpgp_setvar(netpgp_t *, const char *, const char *);
 char *netpgp_getvar(netpgp_t *, const char *);
+int netpgp_incvar(netpgp_t *, const char *, const int);
+int netpgp_unsetvar(netpgp_t *, const char *);
+
+/* set home directory information */
+int netpgp_set_homedir(netpgp_t *, char *, const char *, const int);
 
 /* key management */
-int netpgp_list_keys(netpgp_t *);
-int netpgp_list_sigs(netpgp_t *, const char *);
+int netpgp_list_keys(netpgp_t *, const int);
 int netpgp_find_key(netpgp_t *, char *);
-char *netpgp_get_key(netpgp_t *, const char *);
-int netpgp_export_key(netpgp_t *, char *);
+char *netpgp_get_key(netpgp_t *, const char *, const char *);
+char *netpgp_export_key(netpgp_t *, char *);
 int netpgp_import_key(netpgp_t *, char *);
 int netpgp_generate_key(netpgp_t *, char *, int);
 
@@ -82,9 +86,17 @@
 int netpgp_sign_file(netpgp_t *, const char *, const char *, char *, int, int, int);
 int netpgp_verify_file(netpgp_t *, const char *, const char *, int);
 
-/* memory signing */
+/* memory signing and encryption */
 int netpgp_sign_memory(netpgp_t *, const char *, char *, size_t, char *, size_t, const unsigned, const unsigned);
-int netpgp_verify_memory(netpgp_t *, const void *, const size_t, const int);
+int netpgp_verify_memory(netpgp_t *, const void *, const size_t, void *, size_t, const int);
+int netpgp_encrypt_memory(netpgp_t *, const char *, void *, const size_t, char *, size_t, int);
+int netpgp_decrypt_memory(netpgp_t *, const void *, const size_t, char *, size_t, const int);
+
+/* match and hkp-related functions */
+int netpgp_match_keys(netpgp_t *, char *, const char *, void *, const int);
+int netpgp_match_pubkeys(netpgp_t *, char *, void *);
+
+int netpgp_validate_sigs(netpgp_t *);
 
 __END_DECLS
 
Index: src/crypto/external/bsd/netpgp/dist/bindings/python/netpgppython.py
diff -u src/crypto/external/bsd/netpgp/dist/bindings/python/netpgppython.py:1.1 src/crypto/external/bsd/netpgp/dist/bindings/python/netpgppython.py:1.2
--- src/crypto/external/bsd/netpgp/dist/bindings/python/netpgppython.py:1.1	Wed Dec  2 00:32:06 2009
+++ src/crypto/external/bsd/netpgp/dist/bindings/python/netpgppython.py	Wed Apr 28 14:41:13 2010
@@ -95,8 +95,10 @@
 netpgp_list_packets = _netpgppython.netpgp_list_packets
 netpgp_setvar = _netpgppython.netpgp_setvar
 netpgp_getvar = _netpgppython.netpgp_getvar
+netpgp_incvar = _netpgppython.netpgp_incvar
+netpgp_unsetvar = _netpgppython.netpgp_unsetvar
+netpgp_set_homedir = _netpgppython.netpgp_set_homedir
 netpgp_list_keys = _netpgppython.netpgp_list_keys
-netpgp_list_sigs = _netpgppython.netpgp_list_sigs
 netpgp_find_key = _netpgppython.netpgp_find_key
 netpgp_get_key = _netpgppython.netpgp_get_key
 netpgp_export_key = _netpgppython.netpgp_export_key
@@ -108,5 +110,10 @@
 netpgp_verify_file = _netpgppython.netpgp_verify_file
 netpgp_sign_memory = _netpgppython.netpgp_sign_memory
 netpgp_verify_memory = _netpgppython.netpgp_verify_memory
+netpgp_encrypt_memory = _netpgppython.netpgp_encrypt_memory
+netpgp_decrypt_memory = _netpgppython.netpgp_decrypt_memory
+netpgp_match_keys = _netpgppython.

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

2010-04-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Apr 28 14:51:08 UTC 2010

Modified Files:
src/sys/rump/librump/rumpkern: rump.c

Log Message:
Uncrack my brain, buggy let me !be.

In other words, make previous commit to this file actually work.
Funny how it's possible to fix things to not dump core and still
have them not work.


To generate a diff of this commit:
cvs rdiff -u -r1.168 -r1.169 src/sys/rump/librump/rumpkern/rump.c

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

Modified files:

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.168 src/sys/rump/librump/rumpkern/rump.c:1.169
--- src/sys/rump/librump/rumpkern/rump.c:1.168	Wed Apr 28 14:23:57 2010
+++ src/sys/rump/librump/rumpkern/rump.c	Wed Apr 28 14:51:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.168 2010/04/28 14:23:57 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.169 2010/04/28 14:51:07 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.168 2010/04/28 14:23:57 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.169 2010/04/28 14:51:07 pooka Exp $");
 
 #include 
 #define ELFSIZE ARCH_ELFSIZE
@@ -62,6 +62,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -531,7 +532,6 @@
 	l->l_lid = lid;
 	l->l_fd = p->p_fd;
 	l->l_cpu = NULL;
-	l->l_sysent = rump_sysent;
 	lwp_initspecific(l);
 	LIST_INSERT_HEAD(&alllwp, l, l_list);
 
@@ -759,7 +759,7 @@
 	callp = rump_sysent + num;
 	rump_schedule();
 	l = curlwp;
-	rv = callp->sy_call(l, (void *)data, retval);
+	rv = sy_call(callp, l, (void *)data, retval);
 	rump_unschedule();
 
 	return rv;



CVS commit: [uebayasi-xip] src/sys

2010-04-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Apr 28 14:56:14 UTC 2010

Modified Files:
src/sys/arch/arm/conf [uebayasi-xip]: files.arm
src/sys/arch/arm/imx [uebayasi-xip]: imx31_space.c
src/sys/arch/arm/include [uebayasi-xip]: bus.h
src/sys/arch/evbarm/conf [uebayasi-xip]: std.imx31
src/sys/dev [uebayasi-xip]: flash.c

Log Message:
Initial implemention of bus_space_physload(9) for NetBSD/arm (only i.MX31
for now).


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.97.2.1 src/sys/arch/arm/conf/files.arm
cvs rdiff -u -r1.3 -r1.3.2.1 src/sys/arch/arm/imx/imx31_space.c
cvs rdiff -u -r1.20 -r1.20.2.1 src/sys/arch/arm/include/bus.h
cvs rdiff -u -r1.3 -r1.3.2.1 src/sys/arch/evbarm/conf/std.imx31
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/dev/flash.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/conf/files.arm
diff -u src/sys/arch/arm/conf/files.arm:1.97 src/sys/arch/arm/conf/files.arm:1.97.2.1
--- src/sys/arch/arm/conf/files.arm:1.97	Sun Dec 27 05:14:56 2009
+++ src/sys/arch/arm/conf/files.arm	Wed Apr 28 14:56:13 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.arm,v 1.97 2009/12/27 05:14:56 uebayasi Exp $
+#	$NetBSD: files.arm,v 1.97.2.1 2010/04/28 14:56:13 uebayasi Exp $
 
 # temporary define to allow easy moving to ../arch/arm/arm32
 defflagARM32
@@ -37,6 +37,7 @@
 
 # Board-specific bus_space(9) definitions
 defflag  opt_arm_bus_space.h	__BUS_SPACE_HAS_STREAM_METHODS
+__BUS_SPACE_HAS_PHYSLOAD_METHODS
 
 # Floating point emulator
 defflagARMFPE

Index: src/sys/arch/arm/imx/imx31_space.c
diff -u src/sys/arch/arm/imx/imx31_space.c:1.3 src/sys/arch/arm/imx/imx31_space.c:1.3.2.1
--- src/sys/arch/arm/imx/imx31_space.c:1.3	Sat Nov  7 07:27:41 2009
+++ src/sys/arch/arm/imx/imx31_space.c	Wed Apr 28 14:56:14 2010
@@ -1,7 +1,7 @@
-/* $Id: imx31_space.c,v 1.3 2009/11/07 07:27:41 cegger Exp $ */
+/* $Id: imx31_space.c,v 1.3.2.1 2010/04/28 14:56:14 uebayasi Exp $ */
 
 /* derived from: */
-/*	$NetBSD: imx31_space.c,v 1.3 2009/11/07 07:27:41 cegger Exp $ */
+/*	$NetBSD: imx31_space.c,v 1.3.2.1 2010/04/28 14:56:14 uebayasi Exp $ */
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -104,7 +104,7 @@
 	imx31_bs_vaddr,
 
 	/* mmap */
-	bs_notimpl_bs_mmap,
+	imx31_bs_mmap,
 
 	/* barrier */
 	imx31_bs_barrier,
@@ -162,6 +162,12 @@
 	generic_armv4_bs_c_2,
 	bs_notimpl_bs_c_4,
 	bs_notimpl_bs_c_8,
+
+	/* physload */
+	imx31_bs_physload,
+	imx31_bs_physunload,
+	imx31_bs_physload_device,
+	imx31_bs_physunload_device,
 };
 
 int
@@ -268,4 +274,44 @@
 	panic("imx31_io_bs_free(): not implemented\n");
 }
 
+paddr_t
+imx31_bs_mmap(void *t, bus_addr_t addr, off_t off, int prot, int flags)
+{
+
+	/* XXX */
+	return arm_btop(addr + off);
+}
+
+/* XXX generic */
+
+void *
+imx31_bs_physload(void *t, bus_addr_t addr, bus_size_t size, int prot, int flags)
+{
+	const paddr_t start = imx31_bs_mmap(t, addr, 0, prot, flags);
+	const paddr_t end = imx31_bs_mmap(t, addr + size, 0, prot, flags);
+
+	return uvm_page_physload(start, end, start, end, 0/* XXX freelist */);
+}
+
+void
+imx31_bs_physunload(void *t, void *phys)
+{
+
+	uvm_page_physunload(phys);
+}
+
+void *
+imx31_bs_physload_device(void *t, bus_addr_t addr, bus_size_t size, int prot, int flags)
+{
+	const paddr_t start = imx31_bs_mmap(t, addr, 0, prot, flags);
+	const paddr_t end = imx31_bs_mmap(t, addr + size, 0, prot, flags);
+
+	return uvm_page_physload_device(start, end, start, end, 0/* XXX freelist */);
+}
+
+void
+imx31_bs_physunload_device(void *t, void *phys)
+{
 
+	uvm_page_physunload_device(phys);
+}

Index: src/sys/arch/arm/include/bus.h
diff -u src/sys/arch/arm/include/bus.h:1.20 src/sys/arch/arm/include/bus.h:1.20.2.1
--- src/sys/arch/arm/include/bus.h:1.20	Sat Mar 14 14:45:55 2009
+++ src/sys/arch/arm/include/bus.h	Wed Apr 28 14:56:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.20 2009/03/14 14:45:55 dsl Exp $	*/
+/*	$NetBSD: bus.h,v 1.20.2.1 2010/04/28 14:56:14 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -271,6 +271,15 @@
 	void		(*bs_wr_8_s)(void *, bus_space_handle_t,
 			bus_size_t, const u_int64_t *, bus_size_t);
 #endif	/* __BUS_SPACE_HAS_STREAM_METHODS */
+
+#ifdef __BUS_SPACE_HAS_PHYSLOAD_METHODS
+	void *		(*bs_physload)(void *, bus_addr_t, bus_size_t,
+			int, int);
+	void		(*bs_physunload)(void *, void *);
+	void *		(*bs_physload_device)(void *, bus_addr_t, bus_size_t,
+			int, int);
+	void		(*bs_physunload_device)(void *, void *);
+#endif
 };
 
 
@@ -690,6 +699,19 @@
 	bus_size_t offset1, bus_space_handle_t bsh2,		\
 	bus_size_t offset2, bus_size_t count);
 
+#ifdef __BUS_SPACE_HAS_PHYSLOAD_METHODS
+#define bs_physload_proto(f)		\
+void *	__bs_c(f,_bs_physload)(void *t,	\
+	bus_addr_t addr, bus_size_t size, int prot, int flags);
+#define bs_physunload_proto(f)		\
+void	__bs_c(f,_bs_physunload)(

CVS commit: src/sys/dev/pci

2010-04-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr 28 15:56:25 UTC 2010

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

Log Message:
kill stray free. from Sverre Froyen.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/pci/if_iwn.c

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

Modified files:

Index: src/sys/dev/pci/if_iwn.c
diff -u src/sys/dev/pci/if_iwn.c:1.42 src/sys/dev/pci/if_iwn.c:1.43
--- src/sys/dev/pci/if_iwn.c:1.42	Fri Apr 23 16:56:20 2010
+++ src/sys/dev/pci/if_iwn.c	Wed Apr 28 11:56:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwn.c,v 1.42 2010/04/23 20:56:20 christos Exp $	*/
+/*	$NetBSD: if_iwn.c,v 1.43 2010/04/28 15:56:24 christos Exp $	*/
 /*	$OpenBSD: if_iwn.c,v 1.88 2010/04/10 08:37:36 damien Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  * adapters.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.42 2010/04/23 20:56:20 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.43 2010/04/28 15:56:24 christos Exp $");
 
 #define IWN_USE_RBUF	/* Use local storage for RX */
 #undef IWN_HWCRYPTO	/* XXX does not even compile yet */
@@ -5619,7 +5619,6 @@
 	if (IWN_FW_API(rev) <= 1) {
 		aprint_error_dev(sc->sc_dev,
 		"bad firmware, need API version >=2\n");
-		firmware_free(fw->data, fw->datasz);
 		goto out;
 	}
 	if (IWN_FW_API(rev) >= 3) {



CVS commit: [uebayasi-xip] src/sys

2010-04-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Apr 28 16:33:47 UTC 2010

Modified Files:
src/sys/dev [uebayasi-xip]: flash.c
src/sys/miscfs/genfs [uebayasi-xip]: genfs_io.c
src/sys/miscfs/specfs [uebayasi-xip]: specdev.h
src/sys/ufs/ffs [uebayasi-xip]: ffs_vfsops.c

Log Message:
When mounting a block device as XIP, pass registered struct vm_physseg
* as a cookie from the block device to the caller (== mount code).
struct vm_physseg * will be passed to XIP vnode pager
(genfs_do_getpages_xip()), then converted back to paddr_t.

(My future plan is to pass struct vm_physseg * back to the fault handler,
and to pmap_enter() as is.)


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/sys/dev/flash.c
cvs rdiff -u -r1.36.2.6 -r1.36.2.7 src/sys/miscfs/genfs/genfs_io.c
cvs rdiff -u -r1.39.2.1 -r1.39.2.2 src/sys/miscfs/specfs/specdev.h
cvs rdiff -u -r1.257.2.3 -r1.257.2.4 src/sys/ufs/ffs/ffs_vfsops.c

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

Modified files:

Index: src/sys/dev/flash.c
diff -u src/sys/dev/flash.c:1.1.2.6 src/sys/dev/flash.c:1.1.2.7
--- src/sys/dev/flash.c:1.1.2.6	Wed Apr 28 14:56:13 2010
+++ src/sys/dev/flash.c	Wed Apr 28 16:33:47 2010
@@ -1,4 +1,4 @@
-/*	$Id: flash.c,v 1.1.2.6 2010/04/28 14:56:13 uebayasi Exp $	*/
+/*	$Id: flash.c,v 1.1.2.7 2010/04/28 16:33:47 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2010 Tsubai Masanari.  All rights reserved.
@@ -100,8 +100,7 @@
 		if (sc->sc_addr == 0)
 			error = EINVAL;
 		else
-			*(paddr_t *)data = bus_space_mmap(sc->sc_iot,
-			sc->sc_addr, 0, 0/* XXX prot */, BUS_SPACE_MAP_LINEAR);
+			*(void **)data = sc->sc_phys;
 		break;
 #endif
 

Index: src/sys/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.36.2.6 src/sys/miscfs/genfs/genfs_io.c:1.36.2.7
--- src/sys/miscfs/genfs/genfs_io.c:1.36.2.6	Tue Mar 23 01:58:13 2010
+++ src/sys/miscfs/genfs/genfs_io.c	Wed Apr 28 16:33:47 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.36.2.6 2010/03/23 01:58:13 uebayasi Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.36.2.7 2010/04/28 16:33:47 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.36.2.6 2010/03/23 01:58:13 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.36.2.7 2010/04/28 16:33:47 uebayasi Exp $");
 
 #include "opt_device_page.h"
 #include "opt_xip.h"
@@ -812,8 +812,12 @@
 			/* unallocated page is redirected to read-only zero-filled page */
 			phys_addr = uvm_pageofzero_xip_phys_addr();
 		} else {
+			struct vm_physseg *seg;
+
+			seg = devvp->v_physseg;
+			KASSERT(seg != NULL);
 			/* bus_space_mmap cookie -> paddr_t */
-			phys_addr = pmap_phys_address(devvp->v_phys_addr) +
+			phys_addr = pmap_phys_address(seg->start) +
 			(blkno << dev_bshift) +
 			(off - (lbn << fs_bshift));
 		}

Index: src/sys/miscfs/specfs/specdev.h
diff -u src/sys/miscfs/specfs/specdev.h:1.39.2.1 src/sys/miscfs/specfs/specdev.h:1.39.2.2
--- src/sys/miscfs/specfs/specdev.h:1.39.2.1	Tue Mar 23 01:58:13 2010
+++ src/sys/miscfs/specfs/specdev.h	Wed Apr 28 16:33:47 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: specdev.h,v 1.39.2.1 2010/03/23 01:58:13 uebayasi Exp $	*/
+/*	$NetBSD: specdev.h,v 1.39.2.2 2010/04/28 16:33:47 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
 	u_int		sd_opencnt;
 	u_int		sd_refcnt;
 	dev_t		sd_rdev;
-	paddr_t		sd_phys_addr;	/* XIP */
+	void		*sd_physseg;	/* XIP */
 } specdev_t;
 
 /*

Index: src/sys/ufs/ffs/ffs_vfsops.c
diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.257.2.3 src/sys/ufs/ffs/ffs_vfsops.c:1.257.2.4
--- src/sys/ufs/ffs/ffs_vfsops.c:1.257.2.3	Tue Mar 23 01:58:14 2010
+++ src/sys/ufs/ffs/ffs_vfsops.c	Wed Apr 28 16:33:47 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_vfsops.c,v 1.257.2.3 2010/03/23 01:58:14 uebayasi Exp $	*/
+/*	$NetBSD: ffs_vfsops.c,v 1.257.2.4 2010/04/28 16:33:47 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.257.2.3 2010/03/23 01:58:14 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.257.2.4 2010/04/28 16:33:47 uebayasi Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1175,16 +1175,16 @@
 	mp->mnt_flag |= MNT_LOCAL;
 	mp->mnt_iflag |= IMNT_MPSAFE;
 #ifdef XIP
-	paddr_t phys_addr = 0;
+	void *physseg = 0;
 	if (mp->mnt_flag & MNT_XIP) {
 		if ((mp->mnt_flag & MNT_RDONLY) == 0)
 			printf("XIP needs read-only mount\n");
 		else {
-			if ((VOP_IOCTL(devvp, DIOCGPHYSADDR, &phys_addr, FREAD,
+			if ((VOP_IOCTL(devvp, DIOCGPHYSADDR, &physseg, FREAD,
 			cred) == 0) &&
-			phys_addr != 0) {
+			physseg != NULL) {
 mp->mnt_iflag |= IMNT_XIP;
-devvp->v_phys_addr = phys_addr;	/* XXX */
+devvp->v_physseg = physseg;
 			} else
 printf("device doesn't support DIOCGPHYSADDR\n");
 		}



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

2010-04-28 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Apr 28 16:34:25 UTC 2010

Modified Files:
src/sys/rump/librump/rumpkern: vm.c

Log Message:
Instead of causing a catastrophic failure when uvm_loanuobjpages()
is called, just pretend it hit a wired page and return EBUSY.  This
should cause callers to use a non-loaning access path instead.

Fixes file read path of stock nfs kernel module (previously it was
easy to just frob the nfsd_use_loan boolean into the other position
by simple value assingment, but now that nfsserver can be autoloaded
at runtime into the rump kernel, that approach is a little more
challenging since the variable isn't available in application
linkage.  yes, things like adding a sysctl for the variable would
work, but now everything works out-of-the-box).


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/rump/librump/rumpkern/vm.c

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

Modified files:

Index: src/sys/rump/librump/rumpkern/vm.c
diff -u src/sys/rump/librump/rumpkern/vm.c:1.71 src/sys/rump/librump/rumpkern/vm.c:1.72
--- src/sys/rump/librump/rumpkern/vm.c:1.71	Wed Apr 21 16:16:31 2010
+++ src/sys/rump/librump/rumpkern/vm.c	Wed Apr 28 16:34:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm.c,v 1.71 2010/04/21 16:16:31 pooka Exp $	*/
+/*	$NetBSD: vm.c,v 1.72 2010/04/28 16:34:25 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.71 2010/04/21 16:16:31 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.72 2010/04/28 16:34:25 pooka Exp $");
 
 #include 
 #include 
@@ -508,7 +508,7 @@
 	struct vm_page **opp)
 {
 
-	panic("%s: unimplemented", __func__);
+	return EBUSY;
 }
 
 void



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

2010-04-28 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Apr 28 17:23:33 UTC 2010

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

Log Message:
Fix warnings for -DRBSMALL


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 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.4 src/common/lib/libc/gen/rb.c:1.5
--- src/common/lib/libc/gen/rb.c:1.4	Tue May 19 22:48:19 2009
+++ src/common/lib/libc/gen/rb.c	Wed Apr 28 17:23:33 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: rb.c,v 1.4 2009/05/19 22:48:19 yamt Exp $ */
+/* $NetBSD: rb.c,v 1.5 2010/04/28 17:23:33 joerg Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -472,7 +472,9 @@
 {
 	const unsigned int which = RB_POSITION(self);
 	struct rb_node *father = RB_FATHER(self);
+#ifndef RBSMALL
 	const bool was_root = RB_ROOT_P(rbt, self);
+#endif
 
 	KASSERT(rebalance || (RB_ROOT_P(rbt, self) || RB_RED_P(self)));
 	KASSERT(!rebalance || RB_BLACK_P(self));
@@ -676,7 +678,9 @@
 {
 	struct rb_node *father = RB_FATHER(self);
 	struct rb_node *son = self->rb_nodes[which];
+#ifndef RBSMALL
 	const bool was_root = RB_ROOT_P(rbt, self);
+#endif
 
 	KASSERT(which == RB_DIR_LEFT || which == RB_DIR_RIGHT);
 	KASSERT(RB_BLACK_P(self) && RB_RED_P(son));



CVS commit: src/sys/dev/acpi

2010-04-28 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Apr 28 17:52:17 UTC 2010

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

Log Message:
Add ASUS CUV4X-D. From Pierre Pronchery in PR #41351.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/acpi/acpi_quirks.c

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

Modified files:

Index: src/sys/dev/acpi/acpi_quirks.c
diff -u src/sys/dev/acpi/acpi_quirks.c:1.12 src/sys/dev/acpi/acpi_quirks.c:1.13
--- src/sys/dev/acpi/acpi_quirks.c:1.12	Mon Apr 12 18:55:27 2010
+++ src/sys/dev/acpi/acpi_quirks.c	Wed Apr 28 17:52:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_quirks.c,v 1.12 2010/04/12 18:55:27 jruoho Exp $	*/
+/*	$NetBSD: acpi_quirks.c,v 1.13 2010/04/28 17:52:17 jruoho Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: acpi_quirks.c,v 1.12 2010/04/12 18:55:27 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_quirks.c,v 1.13 2010/04/28 17:52:17 jruoho Exp $");
 
 #include "opt_acpi.h"
 
@@ -56,13 +56,19 @@
 static int acpi_rev_cmp(uint32_t, uint32_t, int);
 
 /*
- * XXX add more
+ * XXX: Add more.
  */
 static struct acpi_quirk acpi_quirks[] = {
+
+	{ ACPI_SIG_FADT, "ASUS  ", 0x30303031, AQ_LTE, "CUV4X-D ",
+	  ACPI_QUIRK_BROKEN },
+
 	{ ACPI_SIG_FADT, "PTLTD ", 0x0604, AQ_LTE, "  FACP  ",
 	  ACPI_QUIRK_BROKEN },
+
 	{ ACPI_SIG_FADT, "NVIDIA", 0x0604, AQ_EQ, "CK8 ",
 	  ACPI_QUIRK_IRQ0 },
+
 	{ ACPI_SIG_FADT, "HP", 0x06040012, AQ_LTE, "HWPC20F ",
 	  ACPI_QUIRK_BROKEN },
 };



CVS commit: src/games/factor

2010-04-28 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Wed Apr 28 18:04:31 UTC 2010

Modified Files:
src/games/factor: factor.c

Log Message:
rename pollard_pminus1->pollard_rho for consistency


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/games/factor/factor.c

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

Modified files:

Index: src/games/factor/factor.c
diff -u src/games/factor/factor.c:1.21 src/games/factor/factor.c:1.22
--- src/games/factor/factor.c:1.21	Tue Apr 27 18:11:19 2010
+++ src/games/factor/factor.c	Wed Apr 28 18:04:31 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: factor.c,v 1.21 2010/04/27 18:11:19 drochner Exp $	*/
+/*	$NetBSD: factor.c,v 1.22 2010/04/28 18:04:31 drochner Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)factor.c	8.4 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: factor.c,v 1.21 2010/04/27 18:11:19 drochner Exp $");
+__RCSID("$NetBSD: factor.c,v 1.22 2010/04/28 18:04:31 drochner Exp $");
 #endif
 #endif /* not lint */
 
@@ -112,7 +112,7 @@
 static void BN_print_dec_fp(FILE *, const BIGNUM *);
 static void usage(void) __dead;
 #ifdef HAVE_OPENSSL
-static void pollard_pminus1(BIGNUM *);	/* print factors for big numbers */
+static void pollard_rho(BIGNUM *);	/* print factors for big numbers */
 #else
 static char *BN_bn2dec(const BIGNUM *);
 static BN_ULONG BN_div_word(BIGNUM *, BN_ULONG);
@@ -237,7 +237,7 @@
 putchar(' ');
 BN_print_dec_fp(stdout, val);
 			} else
-pollard_pminus1(val);
+pollard_rho(val);
 #else
 			printf(" %s", BN_bn2dec(val));
 #endif
@@ -282,10 +282,8 @@
 
 
 #ifdef HAVE_OPENSSL
-/* pollard p-1, algorithm from Jim Gillogly, May 2000 */
-
 static void
-pollard_pminus1(BIGNUM *val)
+pollard_rho(BIGNUM *val)
 {
 	BIGNUM *x, *y, *tmp, *num;
 	BN_ULONG a;
@@ -327,7 +325,7 @@
 BN_print_dec_fp(stdout, tmp);
 putchar(')');
 #endif
-pollard_pminus1(BN_dup(tmp));
+pollard_rho(BN_dup(tmp));
 #ifdef DEBUG
 printf(" (back)");
 #endif



CVS commit: src/sys

2010-04-28 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Apr 28 19:17:05 UTC 2010

Modified Files:
src/sys/arch/amd64/amd64: busfunc.S genassym.cf mainbus.c
src/sys/arch/i386/i386: apmbios.c busfunc.S genassym.cf ipkdb_glue.c
mainbus.c
src/sys/arch/i386/isa: isapnp_machdep.c
src/sys/arch/i386/pci: pceb.c pcibios.c pcmb.c
src/sys/arch/i386/pnpbios: pnpbios.c
src/sys/arch/i386/xbox: xbox.c xboxfb.c
src/sys/arch/x86/include: bus.h
src/sys/arch/x86/pci: pcib.c
src/sys/arch/x86/x86: acpi_machdep.c bus_space.c consinit.c
genfb_machdep.c
src/sys/arch/xen/x86: consinit.c mainbus.c
src/sys/arch/xen/xen: hypervisor.c xpci_xenbus.c
src/sys/compat/ndis: nbcompat.h
src/sys/dev/if_ndis: if_ndis_pci.c
src/sys/dev/pci: puccn.c

Log Message:
On x86, change the bus_space_tag_t to a pointer to a struct
bus_space_tag.  For now, bus_space_tag's only member is
bst_type, the type of space, which is either X86_BUS_SPACE_IO
or X86_BUS_SPACE_MEM.  In the future, new bus_space_tag members
will refer to override-functions installed by a new function,
bus_space_tag_create(9).

Add pointers to constant struct bus_space_tag, x86_bus_space_io and
x86_bus_space_mem.  Use them to replace most uses of X86_BUS_SPACE_IO
and X86_BUS_SPACE_MEM.

Add an x86-specific bus_space_is_equal(9) implementation that compares
the two tags' bst_type.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/amd64/amd64/busfunc.S
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/amd64/amd64/genassym.cf
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/amd64/amd64/mainbus.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/i386/i386/apmbios.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/i386/busfunc.S
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/i386/i386/genassym.cf
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/i386/i386/ipkdb_glue.c
cvs rdiff -u -r1.89 -r1.90 src/sys/arch/i386/i386/mainbus.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/i386/isa/isapnp_machdep.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/i386/pci/pceb.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/i386/pci/pcibios.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/i386/pci/pcmb.c
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/i386/pnpbios/pnpbios.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/i386/xbox/xbox.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/i386/xbox/xboxfb.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/x86/include/bus.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x86/pci/pcib.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/x86/x86/acpi_machdep.c \
src/sys/arch/x86/x86/bus_space.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x86/x86/consinit.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/x86/x86/genfb_machdep.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/xen/x86/consinit.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/xen/x86/mainbus.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/xen/xen/hypervisor.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/xen/xen/xpci_xenbus.c
cvs rdiff -u -r1.12 -r1.13 src/sys/compat/ndis/nbcompat.h
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/if_ndis/if_ndis_pci.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/puccn.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/busfunc.S
diff -u src/sys/arch/amd64/amd64/busfunc.S:1.7 src/sys/arch/amd64/amd64/busfunc.S:1.8
--- src/sys/arch/amd64/amd64/busfunc.S:1.7	Sun May 25 15:56:12 2008
+++ src/sys/arch/amd64/amd64/busfunc.S	Wed Apr 28 19:17:03 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: busfunc.S,v 1.7 2008/05/25 15:56:12 chs Exp $	*/
+/*	$NetBSD: busfunc.S,v 1.8 2010/04/28 19:17:03 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
  */
 ENTRY(bus_space_read_1)
 	addq	%rsi, %rdx
-	testl	%edi, %edi
+	cmpl	$X86_BUS_SPACE_IO, BST_TYPE(%rdi)
 	je	1f
 	movzbl	(%rdx), %eax
 	ret
@@ -67,7 +67,7 @@
  */
 ENTRY(bus_space_read_2)
 	addq	%rsi, %rdx
-	testl	%edi, %edi
+	cmpl	$X86_BUS_SPACE_IO, BST_TYPE(%rdi)
 	je	1f
 	movzwl	(%rdx), %eax
 	ret
@@ -82,7 +82,7 @@
  */
 ENTRY(bus_space_read_4)
 	addq	%rsi, %rdx
-	testl	%edi, %edi
+	cmpl	$X86_BUS_SPACE_IO, BST_TYPE(%rdi)
 	je	1f
 	movl	(%rdx), %eax
 	ret
@@ -96,7 +96,7 @@
  */
 ENTRY(bus_space_read_8)
 	addq	%rsi, %rdx
-	testl	%edi, %edi
+	cmpl	$X86_BUS_SPACE_IO, BST_TYPE(%rdi)
 	je	.Ldopanic
 	movq	(%rdx), %rax
 	ret
@@ -112,7 +112,7 @@
  */
 ENTRY(bus_space_write_1)
 	addq	%rsi, %rdx
-	testl	%edi, %edi
+	cmpl	$X86_BUS_SPACE_IO, BST_TYPE(%rdi)
 	je	1f
 	movb	%cl, (%rdx)
 	ret
@@ -127,7 +127,7 @@
  */
 ENTRY(bus_space_write_2)
 	addq	%rsi, %rdx
-	testl	%edi, %edi
+	cmpl	$X86_BUS_SPACE_IO, BST_TYPE(%rdi)
 	je	1f
 	movw	%cx, (%rdx)
 	ret
@@ -142,7 +142,7 @@
  */
 ENTRY(bus_space_write_4)
 	addq	%rsi, %rdx
-	testl	%edi, %edi
+	cmpl	$X86_BUS_SPACE_IO, BST_TYPE(%rdi)
 	je	1f
 	movl	%ecx, (%rdx)
 	ret
@@ -157,7 +157,7 @@
  */
 ENTRY(bus_space_write_8)
 	addq	%rsi, %rdx
-	testl	%edi, %edi
+	cmpl	$X86_BUS_SPACE_IO, BST

CVS commit: src/share/man/man3

2010-04-28 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Apr 28 19:47:34 UTC 2010

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

Log Message:
Two small grammar fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man3/ffs32.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/ffs32.3
diff -u src/share/man/man3/ffs32.3:1.2 src/share/man/man3/ffs32.3:1.3
--- src/share/man/man3/ffs32.3:1.2	Wed Apr 28 07:56:54 2010
+++ src/share/man/man3/ffs32.3	Wed Apr 28 19:47:34 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ffs32.3,v 1.2 2010/04/28 07:56:54 jruoho Exp $
+.\"	$NetBSD: ffs32.3,v 1.3 2010/04/28 19:47:34 jruoho Exp $
 .\"
 .\" Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -51,7 +51,7 @@
 .Fn ffs32
 and
 .Fn ffs64
-functions find the first bit set from
+functions find the first bit set in
 .Fa n
 and return the index of that bit.
 Conversely,
@@ -59,7 +59,7 @@
 .Fn fls32
 and
 .Fn fls64
-functions return the last bit set in
+functions find the last bit set in
 .Fa n ,
 returning the index of the bit.
 .Pp



CVS commit: src/sys/sys

2010-04-28 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Apr 28 19:51:16 UTC 2010

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

Log Message:
Cosmetic: delete whitespace at end of line.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/sys/bus_proto.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/bus_proto.h
diff -u src/sys/sys/bus_proto.h:1.3 src/sys/sys/bus_proto.h:1.4
--- src/sys/sys/bus_proto.h:1.3	Sat Sep 19 16:34:07 2009
+++ src/sys/sys/bus_proto.h	Wed Apr 28 19:51:16 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_proto.h,v 1.3 2009/09/19 16:34:07 pooka Exp $	*/
+/*	$NetBSD: bus_proto.h,v 1.4 2010/04/28 19:51:16 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001, 2007 The NetBSD Foundation, Inc.
@@ -320,5 +320,5 @@
 int	bus_dmatag_subregion(bus_dma_tag_t, bus_addr_t, bus_addr_t,
 			 bus_dma_tag_t *, int);
 void	bus_dmatag_destroy(bus_dma_tag_t);
-   
+
 #endif	/* _SYS_BUS_PROTO_H_ */



CVS commit: src/sys/arch/amd64

2010-04-28 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Apr 28 20:22:46 UTC 2010

Modified Files:
src/sys/arch/amd64: Makefile

Log Message:
Fix 'tags' target.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/amd64/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/amd64/Makefile
diff -u src/sys/arch/amd64/Makefile:1.5 src/sys/arch/amd64/Makefile:1.6
--- src/sys/arch/amd64/Makefile:1.5	Sun Oct 26 02:14:59 2008
+++ src/sys/arch/amd64/Makefile	Wed Apr 28 20:22:46 2010
@@ -1,13 +1,11 @@
-#	$NetBSD: Makefile,v 1.5 2008/10/26 02:14:59 mrg Exp $
+#	$NetBSD: Makefile,v 1.6 2010/04/28 20:22:46 dyoung Exp $
 
 # Makefile for amd64 tags file and boot blocks
 
 TAMD64=		${SYSDIR}/arch/amd64/tags
 SAMD64=		${SYSDIR}/arch/amd64/amd64/*.[ch] \
-		${SYSDIR}/arch/amd64/include/*.h \
-		${SYSDIR}/arch/amd64/isa/*.[ch] \
-		${SYSDIR}/arch/amd64/pci/*.[ch]
-AAMD64=		${SYSDIR}/arch/amd64/amd64/*.s ${SYSDIR}/arch/amd64/isa/*.s
+		${SYSDIR}/arch/amd64/include/*.h
+AAMD64=		${SYSDIR}/arch/amd64/amd64/*.S
 
 # Directories in which to place tags links
 DAMD64=		amd64 isa include pci
@@ -15,8 +13,11 @@
 .include "../../kern/Make.tags.inc"
 
 tags:
-	rm -f ${TAMD64}
-	-echo ${SAMD64} ${COMM} | xargs ctags -wadtf ${TAMD64}
+	-rm -f ${TAMD64}
+	-echo ${SAMD64} | xargs ctags -wadtf ${TAMD64}
+	-find -H ${SYSDIR}/external/intel-public/acpica/dist/ -name '*.[ch]' | \
+	sort -t / -u | xargs ctags -wadtf ${TAMD64}
+	-${FINDCOMM} | xargs ctags -wadtf ${TAMD64}
 	egrep "^ENTRY(.*)|^ALTENTRY(.*)" ${AAMD64} | \
 	${TOOL_SED} -e \
 		"s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 \1 /^\2(\3\4$$/;" \



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

2010-04-28 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Apr 28 20:27:36 UTC 2010

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

Log Message:
#include  instead of  here to get all of the
MI prototypes.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/x86/x86/bus_space.c

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

Modified files:

Index: src/sys/arch/x86/x86/bus_space.c
diff -u src/sys/arch/x86/x86/bus_space.c:1.27 src/sys/arch/x86/x86/bus_space.c:1.28
--- src/sys/arch/x86/x86/bus_space.c:1.27	Wed Apr 28 19:17:04 2010
+++ src/sys/arch/x86/x86/bus_space.c	Wed Apr 28 20:27:36 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space.c,v 1.27 2010/04/28 19:17:04 dyoung Exp $	*/
+/*	$NetBSD: bus_space.c,v 1.28 2010/04/28 20:27:36 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.27 2010/04/28 19:17:04 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.28 2010/04/28 20:27:36 dyoung Exp $");
 
 #include 
 #include 
@@ -42,7 +42,7 @@
 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 



CVS commit: src/sys

2010-04-28 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Apr 28 20:33:52 UTC 2010

Modified Files:
src/sys/dev/pci: pcivar.h
src/sys/kern: kern_stub.c

Log Message:
Add data types, function prototypes, and stub implementations
for pci_chipset_tag_create() and pci_chipset_tag_destroy().  On
architectures that support it, an MI PCI bus driver can override the
architecture's default pci(9) and pci_intr(9) implementation.

Coming up next: documentation.
After that: x86 implementation.
Last but not least: make cbb(4) use MI PCI overrides.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/sys/dev/pci/pcivar.h
cvs rdiff -u -r1.27 -r1.28 src/sys/kern/kern_stub.c

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

Modified files:

Index: src/sys/dev/pci/pcivar.h
diff -u src/sys/dev/pci/pcivar.h:1.85 src/sys/dev/pci/pcivar.h:1.86
--- src/sys/dev/pci/pcivar.h:1.85	Fri Mar 12 21:55:05 2010
+++ src/sys/dev/pci/pcivar.h	Wed Apr 28 20:33:52 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcivar.h,v 1.85 2010/03/12 21:55:05 matt Exp $	*/
+/*	$NetBSD: pcivar.h,v 1.86 2010/04/28 20:33:52 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -59,6 +59,37 @@
  */
 #include 
 
+enum pci_override_idx {
+	  PCI_OVERRIDE_CONF_READ		= __BIT(0)
+	, PCI_OVERRIDE_CONF_WRITE		= __BIT(1)
+	, PCI_OVERRIDE_INTR_MAP			= __BIT(2)
+	, PCI_OVERRIDE_INTR_STRING		= __BIT(3)
+	, PCI_OVERRIDE_INTR_EVCNT		= __BIT(4)
+	, PCI_OVERRIDE_INTR_ESTABLISH		= __BIT(5)
+	, PCI_OVERRIDE_INTR_DISESTABLISH	= __BIT(6)
+	, PCI_OVERRIDE_MAKE_TAG			= __BIT(7)
+	, PCI_OVERRIDE_DECOMPOSE_TAG		= __BIT(8)
+};
+
+/* Only add new fields to the end of this structure! */
+struct pci_overrides {
+	pcireg_t (*ov_conf_read)(void *, pci_chipset_tag_t, pcitag_t, int);
+	void (*ov_conf_write)(void *, pci_chipset_tag_t, pcitag_t, int,
+	pcireg_t);
+	int (*ov_intr_map)(void *, struct pci_attach_args *,
+	   pci_intr_handle_t *);
+	const char *(*ov_intr_string)(void *, pci_chipset_tag_t,
+	pci_intr_handle_t);
+	const struct evcnt *(*ov_intr_evcnt)(void *, pci_chipset_tag_t,
+	pci_intr_handle_t);
+	void *(*ov_intr_establish)(void *, pci_chipset_tag_t, pci_intr_handle_t,
+	int, int (*)(void *), void *);
+	void (*ov_intr_disestablish)(void *, pci_chipset_tag_t, void *);
+	pcitag_t (*ov_make_tag)(void *, pci_chipset_tag_t, int, int, int);
+	void (*ov_decompose_tag)(void *, pci_chipset_tag_t, pcitag_t,
+	int *, int *, int *);
+};
+
 /*
  * PCI bus attach arguments.
  */
@@ -260,6 +291,10 @@
 int	pci_activate(pci_chipset_tag_t, pcitag_t, device_t,
 int (*)(pci_chipset_tag_t, pcitag_t, device_t, pcireg_t));
 int	pci_activate_null(pci_chipset_tag_t, pcitag_t, device_t, pcireg_t);
+int	pci_chipset_tag_create(pci_chipset_tag_t, uint64_t,
+	   const struct pci_overrides *,
+	   void *, pci_chipset_tag_t *);
+void	pci_chipset_tag_destroy(pci_chipset_tag_t);
 
 /*
  * Device abstraction for inheritance by elanpci(4), for example.

Index: src/sys/kern/kern_stub.c
diff -u src/sys/kern/kern_stub.c:1.27 src/sys/kern/kern_stub.c:1.28
--- src/sys/kern/kern_stub.c:1.27	Mon Apr 26 22:58:53 2010
+++ src/sys/kern/kern_stub.c	Wed Apr 28 20:33:52 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_stub.c,v 1.27 2010/04/26 22:58:53 pooka Exp $	*/
+/*	$NetBSD: kern_stub.c,v 1.28 2010/04/28 20:33:52 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_stub.c,v 1.27 2010/04/26 22:58:53 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_stub.c,v 1.28 2010/04/28 20:33:52 dyoung Exp $");
 
 #include "opt_ptrace.h"
 #include "opt_ktrace.h"
@@ -125,6 +125,8 @@
 __weak_alias(spldebug_start, voidop);
 __weak_alias(spldebug_stop, voidop);
 __weak_alias(machdep_init,nullop);
+__weak_alias(pci_chipset_tag_create, eopnotsupp);
+__weak_alias(pci_chipset_tag_destroy, voidop);
 __weak_alias(bus_space_tag_create, eopnotsupp);
 __weak_alias(bus_space_tag_destroy, voidop);
 __weak_alias(bus_space_is_equal, default_bus_space_is_equal);



CVS commit: src/doc

2010-04-28 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed Apr 28 20:34:37 UTC 2010

Modified Files:
src/doc: 3RDPARTY

Log Message:
ACPICA 20100428 is out.


To generate a diff of this commit:
cvs rdiff -u -r1.759 -r1.760 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.759 src/doc/3RDPARTY:1.760
--- src/doc/3RDPARTY:1.759	Sat Apr 17 12:44:38 2010
+++ src/doc/3RDPARTY	Wed Apr 28 20:34:37 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.759 2010/04/17 12:44:38 tron Exp $
+#	$NetBSD: 3RDPARTY,v 1.760 2010/04/28 20:34:37 jruoho Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -26,7 +26,7 @@
 
 Package:	acpica
 Version:	20100121
-Current Vers:	20100331
+Current Vers:	20100428
 Maintainer:	INTEL
 Archive Site:	http://www.acpica.org/downloads/unix_source_code.php
 Home Page:	http://www.acpica.org/



CVS commit: src/share/man/man9

2010-04-28 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Apr 28 21:15:47 UTC 2010

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

Log Message:
Document pci_chipset_tag_create(9) and pci_chipset_tag_destroy(9).


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/share/man/man9/pci.9

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

Modified files:

Index: src/share/man/man9/pci.9
diff -u src/share/man/man9/pci.9:1.30 src/share/man/man9/pci.9:1.31
--- src/share/man/man9/pci.9:1.30	Thu Feb 11 18:11:37 2010
+++ src/share/man/man9/pci.9	Wed Apr 28 21:15:47 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: pci.9,v 1.30 2010/02/11 18:11:37 dyoung Exp $
+.\" $NetBSD: pci.9,v 1.31 2010/04/28 21:15:47 dyoung Exp $
 .\"
 .\" Copyright (c) 2001, 2003 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,12 +27,14 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 11, 2010
+.Dd April 28, 2010
 .Dt PCI 9
 .Os
 .Sh NAME
 .Nm PCI ,
 .Nm pci_activate ,
+.Nm pci_chipset_tag_create ,
+.Nm pci_chipset_tag_destroy ,
 .Nm pci_conf_read ,
 .Nm pci_conf_write ,
 .Nm pci_conf_print ,
@@ -69,6 +71,11 @@
 .Fn pci_activate "pci_chipset_tag_t pc" "pcitag_t tag" "device_t dev" \
 "int (*wakeup)(pci_chipset_tag_t pc, pcitag_t tag" \
 "\t\tdevice_t dev, pcireg_t reg)"
+.Ft int
+.Fn pci_chipset_tag_create "pci_chipset_tag_t opc" "uint64_t present" \
+"const struct pci_overrides *ov" "void *ctx" "pci_chipset_tag_t *pcp"
+.Ft void
+.Fn pci_chipset_tag_destroy "pci_chipset_tag_t pc"
 .Ft pcireg_t
 .Fn pci_conf_read "pci_chipset_tag_t pc" "pcitag_t tag" "int reg"
 .Ft void
@@ -213,6 +220,35 @@
 .Bd -literal
 	pcireg_t reg[16];			/* pci conf register */
 .Ed
+.It Fa struct pci_overrides
+Stores pointers to functions that override the architecture's
+default
+.Xr pci 9
+and
+.Xr pci_intr 9
+implementation.
+It contains the following members:
+.Bd -literal
+	pcireg_t (*ov_conf_read)(void *,
+	pci_chipset_tag_t, pcitag_t, int);
+	void (*ov_conf_write)(void *,
+	pci_chipset_tag_t, pcitag_t, int, pcireg_t);
+	int (*ov_intr_map)(void *,
+	   struct pci_attach_args *, pci_intr_handle_t *);
+	const char *(*ov_intr_string)(void *,
+	pci_chipset_tag_t, pci_intr_handle_t);
+	const struct evcnt *(*ov_intr_evcnt)(void *,
+	pci_chipset_tag_t, pci_intr_handle_t);
+	void *(*ov_intr_establish)(void *,
+	pci_chipset_tag_t, pci_intr_handle_t,
+	int, int (*)(void *), void *);
+	void (*ov_intr_disestablish)(void *,
+	pci_chipset_tag_t, void *);
+	pcitag_t (*ov_make_tag)(void *,
+	pci_chipset_tag_t, int, int, int);
+	void (*ov_decompose_tag)(void *,
+	pci_chipset_tag_t, pcitag_t, int *, int *, int *);
+.Ed
 .El
 .Sh FUNCTIONS
 .Bl -tag -width compact
@@ -226,6 +262,98 @@
 is
 .Dv NULL
 then restoring from state D3 is going to fail.
+.It Fn pci_chipset_tag_create "opc" "present" "ov" "ctx" "pcp"
+Create a copy of the tag
+.Fa opc
+at
+.Fa *pcp .
+Except for the behavior
+overridden by
+.Fa ov ,
+.Fa *pcp
+inherits the behavior of
+.Fa opc
+under
+.Nm
+calls.
+.Pp
+.Fa ov
+contains function pointers corresponding to
+.Nm
+routines.
+Each function pointer has a corresponding bit in
+.Fa present ,
+and if that bit is 1, the function pointer overrides the corresponding
+.Nm
+call for the new tag.
+Any combination of these bits may be set in
+.Fa present :
+.Pp
+.Bl -tag -width PCI_OVERRIDE_INTR_DISESTABLISH -compact
+.It Dv PCI_OVERRIDE_CONF_READ
+.It Dv PCI_OVERRIDE_CONF_WRITE
+.It Dv PCI_OVERRIDE_INTR_MAP
+.It Dv PCI_OVERRIDE_INTR_STRING
+.It Dv PCI_OVERRIDE_INTR_EVCNT
+.It Dv PCI_OVERRIDE_INTR_ESTABLISH
+.It Dv PCI_OVERRIDE_INTR_DISESTABLISH
+.It Dv PCI_OVERRIDE_MAKE_TAG
+.It Dv PCI_OVERRIDE_DECOMPOSE_TAG
+.El
+.Pp
+.Fn pci_chipset_tag_create
+does not copy
+.Fa ov .
+After a new tag is created
+by
+.Fn pci_chipset_tag_create ,
+.Fa ov
+must not be destroyed until after the
+tag is destroyed by
+.Fn pci_chipset_tag_destroy .
+.Pp
+The first argument of every override-function is a
+.Vt "void *" ,
+and
+.Fa ctx
+is passed in that argument.
+.Pp
+Return 0 if the call succeeds.
+Return
+.Dv EOPNOTSUPP
+if the architecture does not support overrides.
+Return
+.Dv EINVAL
+if
+.Fa present
+is 0, if
+.Fa ov
+is
+.Dv NULL ,
+or if
+.Fa present
+indicates that an override is present, but the corresponding override
+in
+.Fa ov
+is
+.Dv NULL .
+.Pp
+If the call does not succeed,
+.Fa *pcp
+is undefined.
+.It Fn pci_chipset_tag_destroy "pc"
+Destroy a tag,
+.Fa pc ,
+created by a prior call to
+.Fn pci_chipset_tag_create .
+If
+.Fa pc
+was not created by
+.Fn pci_chipset_tag_create ,
+results are undefined.
+If
+.Fa pc
+was already destroyed, results are undefined.
 .It Fn pci_conf_read "pc" "tag" "reg"
 Read from register
 .Fa reg



CVS commit: src/sys/arch/x86

2010-04-28 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Apr 28 21:27:14 UTC 2010

Modified Files:
src/sys/arch/x86/include: pci_machdep_common.h
src/sys/arch/x86/pci: pci_intr_machdep.c pci_machdep.c

Log Message:
Provide an x86 implementation of pci_chipset_tag_create(9) and
pci_chipset_tag_destroy(9).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/include/pci_machdep_common.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/x86/pci/pci_intr_machdep.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/x86/pci/pci_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/x86/include/pci_machdep_common.h
diff -u src/sys/arch/x86/include/pci_machdep_common.h:1.2 src/sys/arch/x86/include/pci_machdep_common.h:1.3
--- src/sys/arch/x86/include/pci_machdep_common.h:1.2	Sat Mar 20 00:02:59 2010
+++ src/sys/arch/x86/include/pci_machdep_common.h	Wed Apr 28 21:27:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep_common.h,v 1.2 2010/03/20 00:02:59 dyoung Exp $	*/
+/*	$NetBSD: pci_machdep_common.h,v 1.3 2010/04/28 21:27:14 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -74,31 +74,9 @@
 
 struct pci_chipset_tag {
 	pci_chipset_tag_t pc_super;
-	pcireg_t (*pc_conf_read)(pci_chipset_tag_t, pcitag_t, int);
-
-	void (*pc_conf_write)(pci_chipset_tag_t, pcitag_t, int, pcireg_t);
-
-#if 0
-	int (*pc_find_rom)(struct pci_attach_args *, bus_space_tag_t,
-	bus_space_handle_t, int, bus_space_handle_t *, bus_space_size_t *);
-#endif
-
-	int (*pc_intr_map)(struct pci_attach_args *, pci_intr_handle_t *);
-
-	const char *(*pc_intr_string)(pci_chipset_tag_t, pci_intr_handle_t);
-
-	const struct evcnt *(*pc_intr_evcnt)(pci_chipset_tag_t,
-	pci_intr_handle_t);
-
-	void *(*pc_intr_establish)(pci_chipset_tag_t, pci_intr_handle_t, int,
-	int (*)(void *), void *);
-
-	void (*pc_intr_disestablish)(pci_chipset_tag_t, void *);
-
-	pcitag_t (*pc_make_tag)(pci_chipset_tag_t, int, int, int);
-
-	void (*pc_decompose_tag)(pci_chipset_tag_t, pcitag_t,
-	int *, int *, int *);
+	uint64_t pc_present;
+	const struct pci_overrides *pc_ov;
+	void *pc_ctx;
 };
 
 /*

Index: src/sys/arch/x86/pci/pci_intr_machdep.c
diff -u src/sys/arch/x86/pci/pci_intr_machdep.c:1.16 src/sys/arch/x86/pci/pci_intr_machdep.c:1.17
--- src/sys/arch/x86/pci/pci_intr_machdep.c:1.16	Sun Mar 14 20:19:06 2010
+++ src/sys/arch/x86/pci/pci_intr_machdep.c	Wed Apr 28 21:27:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_intr_machdep.c,v 1.16 2010/03/14 20:19:06 dyoung Exp $	*/
+/*	$NetBSD: pci_intr_machdep.c,v 1.17 2010/04/28 21:27:14 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2009 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.16 2010/03/14 20:19:06 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.17 2010/04/28 21:27:14 dyoung Exp $");
 
 #include 
 #include 
@@ -122,8 +122,8 @@
 #endif
 
 	if ((pc = pa->pa_pc) != NULL) {
-		if (pc->pc_intr_map != NULL)
-			return (*pc->pc_intr_map)(pa, ihp);
+		if ((pc->pc_present & PCI_OVERRIDE_INTR_MAP) != 0)
+			return (*pc->pc_ov->ov_intr_map)(pc->pc_ctx, pa, ihp);
 		if (pc->pc_super != NULL) {
 			struct pci_attach_args paclone = *pa;
 			paclone.pa_pc = pc->pc_super;
@@ -217,9 +217,10 @@
 const char *
 pci_intr_string(pci_chipset_tag_t pc, pci_intr_handle_t ih)
 {
+
 	if (pc != NULL) {
-		if (pc->pc_intr_string != NULL)
-			return (*pc->pc_intr_string)(pc, ih);
+		if ((pc->pc_present & PCI_OVERRIDE_INTR_STRING) != 0)
+			return (*pc->pc_ov->ov_intr_string)(pc->pc_ctx, pc, ih);
 		if (pc->pc_super != NULL)
 			return pci_intr_string(pc->pc_super, ih);
 	}
@@ -233,8 +234,8 @@
 {
 
 	if (pc != NULL) {
-		if (pc->pc_intr_evcnt != NULL)
-			return (*pc->pc_intr_evcnt)(pc, ih);
+		if ((pc->pc_present & PCI_OVERRIDE_INTR_EVCNT) != 0)
+			return (*pc->pc_ov->ov_intr_evcnt)(pc->pc_ctx, pc, ih);
 		if (pc->pc_super != NULL)
 			return pci_intr_evcnt(pc->pc_super, ih);
 	}
@@ -274,9 +275,9 @@
 	bool mpsafe;
 
 	if (pc != NULL) {
-		if (pc->pc_intr_establish != NULL) {
-			return (*pc->pc_intr_establish)(pc, ih, level, func,
-			arg);
+		if ((pc->pc_present & PCI_OVERRIDE_INTR_ESTABLISH) != 0) {
+			return (*pc->pc_ov->ov_intr_establish)(pc->pc_ctx,
+			pc, ih, level, func, arg);
 		}
 		if (pc->pc_super != NULL) {
 			return pci_intr_establish(pc->pc_super, ih, level, func,
@@ -313,8 +314,9 @@
 {
 
 	if (pc != NULL) {
-		if (pc->pc_intr_disestablish != NULL) {
-			(*pc->pc_intr_disestablish)(pc, cookie);
+		if ((pc->pc_present & PCI_OVERRIDE_INTR_ESTABLISH) != 0) {
+			(*pc->pc_ov->ov_intr_disestablish)(pc->pc_ctx,
+			pc, cookie);
 			return;
 		}
 		if (pc->pc_super != NULL) {

Index: src/sys/arch/x86/pci/pci_machdep.c
diff -u src/sys/arch/x86/pci/pci_machdep.c:1.42 src/sys/arch/x86/pci/pci_machdep.c:1.43
--- src/sys/arch/x86/pci/pci_machdep.c:1.42	Tue Apr 

CVS commit: src/sys/dev/pci

2010-04-28 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Apr 28 22:00:39 UTC 2010

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

Log Message:
To reduce differences between ath(4)'s PCI attachment and its CardBus
attachment, delete several unnecessary #includes, re-order subroutines,
move around line breaks, change to different names for the same
constant, et cetera.  Comparing this version of if_ath_pci.c with my
uncommitted version of if_ath_cardbus.c, only about five lines are
different.


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

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

Modified files:

Index: src/sys/dev/pci/if_ath_pci.c
diff -u src/sys/dev/pci/if_ath_pci.c:1.37 src/sys/dev/pci/if_ath_pci.c:1.38
--- src/sys/dev/pci/if_ath_pci.c:1.37	Wed Feb 24 22:38:00 2010
+++ src/sys/dev/pci/if_ath_pci.c	Wed Apr 28 22:00:39 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ath_pci.c,v 1.37 2010/02/24 22:38:00 dyoung Exp $	*/
+/*	$NetBSD: if_ath_pci.c,v 1.38 2010/04/28 22:00:39 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -37,12 +37,7 @@
  */
 
 #include 
-#ifdef __FreeBSD__
-__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath_pci.c,v 1.11 2005/01/18 18:08:16 sam Exp $");
-#endif
-#ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: if_ath_pci.c,v 1.37 2010/02/24 22:38:00 dyoung Exp $");
-#endif
+__KERNEL_RCSID(0, "$NetBSD: if_ath_pci.c,v 1.38 2010/04/28 22:00:39 dyoung Exp $");
 
 /*
  * PCI/Cardbus front-end for the Atheros Wireless LAN controller driver.
@@ -50,24 +45,10 @@
 
 #include 
 #include 
-#include 
-#include 
 #include 
-#include 
 #include 
 #include 
 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-
-#ifdef INET
-#include 
-#endif
-
 #include 
 
 #include 
@@ -78,43 +59,37 @@
 #include 
 
 /*
- * PCI glue.
+ * PCI configuration space registers
  */
+#define	ATH_PCI_MMBA		0x10	/* memory mapped base */
 
 struct ath_pci_softc {
 	struct ath_softc	sc_sc;
 	pci_chipset_tag_t	sc_pc;
-	pcitag_t		sc_pcitag; 
+	pcitag_t		sc_tag;
 	pci_intr_handle_t	sc_pih;
-	void			*sc_ih;		/* interrupt handler */
+	void			*sc_ih;
 	bus_space_tag_t		sc_iot;
 	bus_space_handle_t	sc_ioh;
 	bus_size_t		sc_mapsz;
 };
 
-#define	BS_BAR	0x10
+static void	ath_pci_attach(device_t, device_t, void *);
+static int	ath_pci_detach(device_t, int);
+static int	ath_pci_match(device_t, cfdata_t, void *);
+static bool	ath_pci_setup(struct ath_pci_softc *);
 
-static void ath_pci_attach(device_t, device_t, void *);
-static int ath_pci_detach(device_t, int);
-static int ath_pci_match(device_t, cfdata_t, void *);
-
-CFATTACH_DECL_NEW(ath_pci,
-sizeof(struct ath_pci_softc),
-ath_pci_match,
-ath_pci_attach,
-ath_pci_detach,
-NULL);
+CFATTACH_DECL_NEW(ath_pci, sizeof(struct ath_pci_softc),
+ath_pci_match, ath_pci_attach, ath_pci_detach, NULL);
 
 static int
 ath_pci_match(device_t parent, cfdata_t match, void *aux)
 {
-	const char* devname;
+	const char *devname;
 	struct pci_attach_args *pa = aux;
 
 	devname = ath_hal_probe(PCI_VENDOR(pa->pa_id), PCI_PRODUCT(pa->pa_id));
-	if (devname != NULL)
-		return 1;
-	return 0;
+	return (devname != NULL) ? 1 : 0;
 }
 
 static bool
@@ -123,9 +98,10 @@
 	struct ath_pci_softc *sc = device_private(self);
 
 	ath_suspend(&sc->sc_sc);
-	pci_intr_disestablish(sc->sc_pc, sc->sc_ih);
-	sc->sc_ih = NULL;
-
+	if (sc->sc_ih != NULL) {
+		pci_intr_disestablish(sc->sc_pc, sc->sc_ih);
+		sc->sc_ih = NULL;
+	}
 	return true;
 }
 
@@ -143,59 +119,6 @@
 	return ath_resume(&sc->sc_sc);
 }
 
-static int
-ath_pci_setup(struct ath_pci_softc *sc)
-{
-	pcireg_t bhlc, csr, icr, lattimer;
-	/*
-	 * Enable memory mapping and bus mastering.
-	 */
-	csr = pci_conf_read(sc->sc_pc, sc->sc_pcitag, PCI_COMMAND_STATUS_REG);
-	csr |= PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_MEM_ENABLE;
-	pci_conf_write(sc->sc_pc, sc->sc_pcitag, PCI_COMMAND_STATUS_REG, csr);
-	csr = pci_conf_read(sc->sc_pc, sc->sc_pcitag, PCI_COMMAND_STATUS_REG);
-
-	if ((csr & PCI_COMMAND_MEM_ENABLE) == 0) {
-		aprint_error("couldn't enable memory mapping\n");
-		return 0;
-	}
-	if ((csr & PCI_COMMAND_MASTER_ENABLE) == 0) {
-		aprint_error("couldn't enable bus mastering\n");
-		return 0;
-	}
-
-	/*
-	 * XXX Both this comment and code are replicated in
-	 * XXX cardbus_rescan().
-	 *
-	 * Make sure the latency timer is set to some reasonable
-	 * value.
-	 *
-	 * I will set the initial value of the Latency Timer here.
-	 *
-	 * While a PCI device owns the bus, its Latency Timer counts
-	 * down bus cycles from its initial value to 0.  Minimum
-	 * Grant tells for how long the device wants to own the
-	 * bus once it gets access, in units of 250ns.
-	 *
-	 * On a 33 MHz bus, there are 8 cycles per 250ns.  So I
-	 * multiply the Minimum Grant by 8 to find out the initial
-	 * value of the Latency Timer.
-	 *
-	 * I never set a Latency Timer less than 0x10, since that
-	 * is what the old code did.
-	 *

CVS commit: src/sys/dev/pci

2010-04-28 Thread Hubert Feyrer
Module Name:src
Committed By:   hubertf
Date:   Wed Apr 28 22:08:58 UTC 2010

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

Log Message:
Silence for boot -z


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/dev/pci/if_vr.c

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

Modified files:

Index: src/sys/dev/pci/if_vr.c
diff -u src/sys/dev/pci/if_vr.c:1.104 src/sys/dev/pci/if_vr.c:1.105
--- src/sys/dev/pci/if_vr.c:1.104	Mon Apr  5 07:20:28 2010
+++ src/sys/dev/pci/if_vr.c	Wed Apr 28 22:08:58 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vr.c,v 1.104 2010/04/05 07:20:28 joerg Exp $	*/
+/*	$NetBSD: if_vr.c,v 1.105 2010/04/28 22:08:58 hubertf Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.104 2010/04/05 07:20:28 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.105 2010/04/28 22:08:58 hubertf Exp $");
 
 #include "rnd.h"
 
@@ -1587,7 +1587,7 @@
 	/*
 	 * A Rhine chip was detected. Inform the world.
 	 */
-	printf("%s: Ethernet address: %s\n",
+	aprint_normal("%s: Ethernet address: %s\n",
 		device_xname(self), ether_sprintf(eaddr));
 
 	memcpy(sc->vr_enaddr, eaddr, ETHER_ADDR_LEN);



CVS commit: src

2010-04-28 Thread Hubert Feyrer
Module Name:src
Committed By:   hubertf
Date:   Wed Apr 28 22:21:51 UTC 2010

Modified Files:
src/doc: CHANGES
src/libexec/tftpd: tftpd.8 tftpd.c

Log Message:
tftpd(8): Add -w so files can be uploaded without requiring them
to be created before the upload. See the section on security
considerations before enabling. [hubertf 20100429]

Addresses PR bin/43164.


To generate a diff of this commit:
cvs rdiff -u -r1.1383 -r1.1384 src/doc/CHANGES
cvs rdiff -u -r1.24 -r1.25 src/libexec/tftpd/tftpd.8
cvs rdiff -u -r1.36 -r1.37 src/libexec/tftpd/tftpd.c

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.1383 src/doc/CHANGES:1.1384
--- src/doc/CHANGES:1.1383	Sun Apr 25 00:57:12 2010
+++ src/doc/CHANGES	Wed Apr 28 22:21:51 2010
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1383 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1384 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -599,3 +599,6 @@
 		The database cache for services(5) has been updated to use
 		this. services_mkdb(8) can still be used to create the old
 		format. [joerg 20100425]
+	tftpd(8): Add -w so files can be uploaded without requiring them
+		to be created before the upload. See the section on security 
+		considerations before enabling. [hubertf 20100429]

Index: src/libexec/tftpd/tftpd.8
diff -u src/libexec/tftpd/tftpd.8:1.24 src/libexec/tftpd/tftpd.8:1.25
--- src/libexec/tftpd/tftpd.8:1.24	Fri Jan  8 23:27:08 2010
+++ src/libexec/tftpd/tftpd.8	Wed Apr 28 22:21:51 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: tftpd.8,v 1.24 2010/01/08 23:27:08 wiz Exp $
+.\"	$NetBSD: tftpd.8,v 1.25 2010/04/28 22:21:51 hubertf Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	from: @(#)tftpd.8	8.1 (Berkeley) 6/4/93
 .\"
-.Dd January 8, 2010
+.Dd April 22, 2010
 .Dt TFTPD 8
 .Os
 .Sh NAME
@@ -44,6 +44,7 @@
 .Op Fl p Ar pathsep
 .Op Fl s Ar directory
 .Op Fl u Ar user
+.Op Fl w
 .Op Ar directory ...
 .Sh DESCRIPTION
 .Nm
@@ -70,7 +71,10 @@
 or containing
 .Dq Pa /../
 are not allowed.
-Files may be written to only if they already exist and are publicly writable.
+Unless option
+.Fl w
+is used,
+files may be written to only if they already exist and are publicly writable.
 .Pp
 Note that this extends the concept of
 .Qq public
@@ -148,6 +152,9 @@
 isn't also given, change the gid to that of
 .Ar user
 as well.
+.It Fl w
+Allow unrestricted writing of new files, with no need for
+a prior existance.
 .El
 .Sh SEE ALSO
 .Xr tftp 1 ,
@@ -232,3 +239,9 @@
 sort of file-access restrictions in place.
 The exact methods are specific to each site and therefore
 difficult to document here.
+.Pp
+If unrestricted file upload is enabled via the
+.Fl w
+option, care should be taken that this can be used
+to fill up disk space in an uncontrolled manner
+if this is used in an insecure environment.

Index: src/libexec/tftpd/tftpd.c
diff -u src/libexec/tftpd/tftpd.c:1.36 src/libexec/tftpd/tftpd.c:1.37
--- src/libexec/tftpd/tftpd.c:1.36	Sat Jan  9 10:46:31 2010
+++ src/libexec/tftpd/tftpd.c	Wed Apr 28 22:21:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: tftpd.c,v 1.36 2010/01/09 10:46:31 mbalmer Exp $	*/
+/*	$NetBSD: tftpd.c,v 1.37 2010/04/28 22:21:51 hubertf Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -36,7 +36,7 @@
 #if 0
 static char sccsid[] = "@(#)tftpd.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: tftpd.c,v 1.36 2010/01/09 10:46:31 mbalmer Exp $");
+__RCSID("$NetBSD: tftpd.c,v 1.37 2010/04/28 22:21:51 hubertf Exp $");
 #endif
 #endif /* not lint */
 
@@ -109,6 +109,7 @@
 static int	secure;
 static char	pathsep = '\0';
 static char	*securedir;
+static int	unrestricted_writes;/* uploaded files don't have to exist */
 
 struct formats;
 
@@ -171,7 +172,7 @@
 	curuid = getuid();
 	curgid = getgid();
 
-	while ((ch = getopt(argc, argv, "dg:lnp:s:u:w:")) != -1)
+	while ((ch = getopt(argc, argv, "dg:lnp:s:u:w")) != -1)
 		switch (ch) {
 		case 'd':
 			debug++;
@@ -204,6 +205,10 @@
 			tgtuser = optarg;
 			break;
 
+		case 'w':
+			unrestricted_writes = 1;
+			break;
+
 		default:
 			usage();
 			break;
@@ -739,6 +744,8 @@
 	static char	 pathname[MAXPATHLEN];
 	char		*filename;
 	int		 fd;
+	int		 create = 0;
+	int		 trunc = 0;
 
 	filename = *filep;
 
@@ -804,21 +811,45 @@
 return (EACCESS);
 			*filep = filename = pathname;
 		} else {
+			int stat_rc;
+
 			/*
 			 * If there's no directory list, take our cue from the
 			 * absolute file request check above (*filename == '/'),
 			 * and allow access to anything.
 			 */
-			if (stat(filename, &stbuf) < 0)
-return (errno == ENOENT ? ENOTFOUND : EACCESS);
-			if (!S_ISREG(stbuf.st_mode))
-return (ENOTFOUND);
+			stat_rc = stat(filename, &stbuf);
 			if (mode == RRQ) {
+/* Read reque

CVS commit: src/sys/dev/ic

2010-04-28 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Wed Apr 28 22:45:27 UTC 2010

Modified Files:
src/sys/dev/ic: mpt.c mpt.h mpt_debug.c mpt_netbsd.c

Log Message:
add byte-swapping so that this works on BE platforms.
the logic is based on the current freebsd driver.
fixes PR 42870.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/ic/mpt.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/ic/mpt.h src/sys/dev/ic/mpt_debug.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/ic/mpt_netbsd.c

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

Modified files:

Index: src/sys/dev/ic/mpt.c
diff -u src/sys/dev/ic/mpt.c:1.13 src/sys/dev/ic/mpt.c:1.14
--- src/sys/dev/ic/mpt.c:1.13	Sat Apr 18 14:58:02 2009
+++ src/sys/dev/ic/mpt.c	Wed Apr 28 22:45:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mpt.c,v 1.13 2009/04/18 14:58:02 tsutsui Exp $	*/
+/*	$NetBSD: mpt.c,v 1.14 2010/04/28 22:45:27 chs Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001 by Greg Ansley
@@ -27,6 +27,75 @@
 /*
  * Additional Copyright (c) 2002 by Matthew Jacob under same license.
  */
+/*-
+ * Copyright (c) 2002, 2006 by Matthew Jacob
+ * 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 at minimum a disclaimer
+ *substantially similar to the "NO WARRANTY" disclaimer below
+ *("Disclaimer") and any redistribution must be conditioned upon including
+ *a substantially similar Disclaimer requirement for further binary
+ *redistribution.
+ * 3. Neither the names of the above listed copyright holders nor the names
+ *of any contributors may be used to endorse or promote products derived
+ *from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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 THE COPYRIGHT
+ * OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Support from Chris Ellsworth in order to make SAS adapters work
+ * is gratefully acknowledged.
+ *
+ *
+ * Support from LSI-Logic has also gone a great deal toward making this a
+ * workable subsystem and is gratefully acknowledged.
+ */
+/*-
+ * Copyright (c) 2004, Avid Technology, Inc. and its contributors.
+ * Copyright (c) 2005, WHEEL Sp. z o.o.
+ * Copyright (c) 2004, 2005 Justin T. Gibbs
+ * 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 at minimum a disclaimer
+ *substantially similar to the "NO WARRANTY" disclaimer below
+ *("Disclaimer") and any redistribution must be conditioned upon including
+ *a substantially similar Disclaimer requirement for further binary
+ *redistribution.
+ * 3. Neither the names of the above listed copyright holders nor the names
+ *of any contributors may be used to endorse or promote products derived
+ *from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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 THE COPYRIGHT
+ * OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
 

CVS commit: src/sys/sys

2010-04-28 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Apr 28 23:46:37 UTC 2010

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

Log Message:
Bump kernel version for bus_space_tag_t changes on x86.


To generate a diff of this commit:
cvs rdiff -u -r1.362 -r1.363 src/sys/sys/param.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/param.h
diff -u src/sys/sys/param.h:1.362 src/sys/sys/param.h:1.363
--- src/sys/sys/param.h:1.362	Sat Apr 10 19:04:59 2010
+++ src/sys/sys/param.h	Wed Apr 28 23:46:37 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.362 2010/04/10 19:04:59 pgoyette Exp $	*/
+/*	$NetBSD: param.h,v 1.363 2010/04/28 23:46:37 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -63,7 +63,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	599002700	/* NetBSD 5.99.27 */
+#define	__NetBSD_Version__	599002800	/* NetBSD 5.99.28 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys/arch/hpcarm/hpcarm

2010-04-28 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Thu Apr 29 01:54:26 UTC 2010

Modified Files:
src/sys/arch/hpcarm/hpcarm: hpc_machdep.c pxa2x0_hpc_machdep.c

Log Message:
WS003SH is normally reseted.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/hpcarm/hpcarm/hpc_machdep.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_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/hpcarm/hpcarm/hpc_machdep.c
diff -u src/sys/arch/hpcarm/hpcarm/hpc_machdep.c:1.97 src/sys/arch/hpcarm/hpcarm/hpc_machdep.c:1.98
--- src/sys/arch/hpcarm/hpcarm/hpc_machdep.c:1.97	Sat Apr 17 13:36:21 2010
+++ src/sys/arch/hpcarm/hpcarm/hpc_machdep.c	Thu Apr 29 01:54:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpc_machdep.c,v 1.97 2010/04/17 13:36:21 nonaka Exp $	*/
+/*	$NetBSD: hpc_machdep.c,v 1.98 2010/04/29 01:54:26 nonaka Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hpc_machdep.c,v 1.97 2010/04/17 13:36:21 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpc_machdep.c,v 1.98 2010/04/29 01:54:26 nonaka Exp $");
 
 #include 
 #include 
@@ -89,6 +89,8 @@
 void (*__sleep_func)(void *);
 void *__sleep_ctx;
 
+void (*__cpu_reset)(void) = cpu_reset;
+
 #ifdef BOOT_DUMP
 void	dumppages(char *, int);
 #endif
@@ -114,7 +116,7 @@
 		printf("Please press any key to reboot.\n\n");
 		cngetc();
 		printf("rebooting...\n");
-		cpu_reset();
+		__cpu_reset();
 		/* NOTREACHED */
 	}
 
@@ -157,7 +159,7 @@
 	}
 
 	printf("rebooting...\n");
-	cpu_reset();
+	__cpu_reset();
 	/* NOTREACHED */
 }
 

Index: src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c
diff -u src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c:1.2 src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c:1.3
--- src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c:1.2	Sat Apr 24 21:52:34 2010
+++ src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c	Thu Apr 29 01:54:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_hpc_machdep.c,v 1.2 2010/04/24 21:52:34 nonaka Exp $	*/
+/*	$NetBSD: pxa2x0_hpc_machdep.c,v 1.3 2010/04/29 01:54:26 nonaka Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_hpc_machdep.c,v 1.2 2010/04/24 21:52:34 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_hpc_machdep.c,v 1.3 2010/04/29 01:54:26 nonaka Exp $");
 
 #include "opt_ddb.h"
 #include "opt_dram_pages.h"
@@ -185,6 +185,8 @@
 extern void (*__sleep_func)(void *);
 extern void *__sleep_ctx;
 
+extern void (*__cpu_reset)(void);
+
 #ifdef DEBUG_BEFOREMMU
 static void	fakecninit(void);
 #endif
@@ -260,6 +262,15 @@
 #undef	_A
 #undef	_S
 
+static void
+ws003sh_cpu_reset(void)
+{
+
+		pxa2x0_gpio_set_function(89, GPIO_OUT | GPIO_SET);
+		for (;;)
+continue;
+}
+
 static struct pxa2x0_gpioconf ws003sh_boarddep_gpioconf[] = {
 	{  41, GPIO_ALT_FN_1_IN },	/* FFRXD */
 	{  99, GPIO_ALT_FN_3_OUT },	/* FFTXD */
@@ -392,8 +403,10 @@
 			 || (bi->platid_machine == PLATID_MACH_SHARP_WZERO3_WS007SH)
 			 || (bi->platid_machine == PLATID_MACH_SHARP_WZERO3_WS011SH)
 			 || (bi->platid_machine == PLATID_MACH_SHARP_WZERO3_WS020SH)) {
-if (bi->platid_machine == PLATID_MACH_SHARP_WZERO3_WS003SH) {
+if (bi->platid_machine == PLATID_MACH_SHARP_WZERO3_WS003SH
+ || bi->platid_machine == PLATID_MACH_SHARP_WZERO3_WS004SH) {
 	pxa2x0_gpio_config(ws003sh_gpioconf);
+	__cpu_reset = ws003sh_cpu_reset;
 } else if (bi->platid_machine == PLATID_MACH_SHARP_WZERO3_WS007SH) {
 	pxa2x0_gpio_config(ws007sh_gpioconf);
 } else if (bi->platid_machine == PLATID_MACH_SHARP_WZERO3_WS011SH) {



CVS commit: src/sys/arch/hpcarm/hpcarm

2010-04-28 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Thu Apr 29 01:58:51 UTC 2010

Modified Files:
src/sys/arch/hpcarm/hpcarm: pxa2x0_hpc_machdep.c

Log Message:
use platid_match().


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_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/hpcarm/hpcarm/pxa2x0_hpc_machdep.c
diff -u src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c:1.3 src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c:1.4
--- src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c:1.3	Thu Apr 29 01:54:26 2010
+++ src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c	Thu Apr 29 01:58:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_hpc_machdep.c,v 1.3 2010/04/29 01:54:26 nonaka Exp $	*/
+/*	$NetBSD: pxa2x0_hpc_machdep.c,v 1.4 2010/04/29 01:58:51 nonaka Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_hpc_machdep.c,v 1.3 2010/04/29 01:54:26 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_hpc_machdep.c,v 1.4 2010/04/29 01:58:51 nonaka Exp $");
 
 #include "opt_ddb.h"
 #include "opt_dram_pages.h"
@@ -396,40 +396,36 @@
 	pxa2x0_clkman_bootstrap(PXA2X0_CLKMAN_VBASE);
 	pxa2x0_gpio_bootstrap(PXA2X0_GPIO_VBASE);
 
-	if (bi->magic == BOOTINFO_MAGIC) {
-		if (bi->platid_cpu == PLATID_CPU_ARM_XSCALE_PXA270) {
-			if ((bi->platid_machine == PLATID_MACH_SHARP_WZERO3_WS003SH)
-			 || (bi->platid_machine == PLATID_MACH_SHARP_WZERO3_WS004SH)
-			 || (bi->platid_machine == PLATID_MACH_SHARP_WZERO3_WS007SH)
-			 || (bi->platid_machine == PLATID_MACH_SHARP_WZERO3_WS011SH)
-			 || (bi->platid_machine == PLATID_MACH_SHARP_WZERO3_WS020SH)) {
-if (bi->platid_machine == PLATID_MACH_SHARP_WZERO3_WS003SH
- || bi->platid_machine == PLATID_MACH_SHARP_WZERO3_WS004SH) {
-	pxa2x0_gpio_config(ws003sh_gpioconf);
-	__cpu_reset = ws003sh_cpu_reset;
-} else if (bi->platid_machine == PLATID_MACH_SHARP_WZERO3_WS007SH) {
-	pxa2x0_gpio_config(ws007sh_gpioconf);
-} else if (bi->platid_machine == PLATID_MACH_SHARP_WZERO3_WS011SH) {
-	pxa2x0_gpio_config(ws011sh_gpioconf);
-}
-pxa2x0_clkman_config(CKEN_FFUART, 1);
-pxa2x0_clkman_config(CKEN_NSSP, 1); /* XXXOST */
-pxa2x0_clkman_config(CKEN_USBHC, 0);
-pxa2x0_clkman_config(CKEN_USBDC, 0);
-pxa2x0_clkman_config(CKEN_AC97, 0);
-pxa2x0_clkman_config(CKEN_SSP, 0);
-pxa2x0_clkman_config(CKEN_HWUART, 0);
-pxa2x0_clkman_config(CKEN_STUART, 0);
-pxa2x0_clkman_config(CKEN_BTUART, 0);
-pxa2x0_clkman_config(CKEN_I2S, 0);
-pxa2x0_clkman_config(CKEN_MMC, 0);
-pxa2x0_clkman_config(CKEN_FICP, 0);
-pxa2x0_clkman_config(CKEN_I2C, 0);
-pxa2x0_clkman_config(CKEN_PWM1, 0);
-if (bi->platid_machine != PLATID_MACH_SHARP_WZERO3_WS011SH) {
-	pxa2x0_clkman_config(CKEN_PWM0, 0); /* WS011SH: DON'T DISABLE */
-}
-			}
+	if (platid_match(&platid, &platid_mask_MACH_SHARP_WZERO3_WS003SH)
+	 || platid_match(&platid, &platid_mask_MACH_SHARP_WZERO3_WS004SH)
+	 || platid_match(&platid, &platid_mask_MACH_SHARP_WZERO3_WS007SH)
+	 || platid_match(&platid, &platid_mask_MACH_SHARP_WZERO3_WS011SH)
+	 || platid_match(&platid, &platid_mask_MACH_SHARP_WZERO3_WS020SH)) {
+		if (platid_match(&platid, &platid_mask_MACH_SHARP_WZERO3_WS003SH)
+		 || platid_match(&platid, &platid_mask_MACH_SHARP_WZERO3_WS004SH)) {
+			pxa2x0_gpio_config(ws003sh_gpioconf);
+			__cpu_reset = ws003sh_cpu_reset;
+		} else if (platid_match(&platid, &platid_mask_MACH_SHARP_WZERO3_WS007SH)) {
+			pxa2x0_gpio_config(ws007sh_gpioconf);
+		} else if (platid_match(&platid, &platid_mask_MACH_SHARP_WZERO3_WS011SH)) {
+			pxa2x0_gpio_config(ws011sh_gpioconf);
+		}
+		pxa2x0_clkman_config(CKEN_FFUART, 1);
+		pxa2x0_clkman_config(CKEN_NSSP, 1); /* XXXOST */
+		pxa2x0_clkman_config(CKEN_USBHC, 0);
+		pxa2x0_clkman_config(CKEN_USBDC, 0);
+		pxa2x0_clkman_config(CKEN_AC97, 0);
+		pxa2x0_clkman_config(CKEN_SSP, 0);
+		pxa2x0_clkman_config(CKEN_HWUART, 0);
+		pxa2x0_clkman_config(CKEN_STUART, 0);
+		pxa2x0_clkman_config(CKEN_BTUART, 0);
+		pxa2x0_clkman_config(CKEN_I2S, 0);
+		pxa2x0_clkman_config(CKEN_MMC, 0);
+		pxa2x0_clkman_config(CKEN_FICP, 0);
+		pxa2x0_clkman_config(CKEN_I2C, 0);
+		pxa2x0_clkman_config(CKEN_PWM1, 0);
+		if (!platid_match(&platid, &platid_mask_MACH_SHARP_WZERO3_WS011SH)) {
+			pxa2x0_clkman_config(CKEN_PWM0, 0); /* WS011SH: DON'T DISABLE */
 		}
 	}
 



CVS commit: [uebayasi-xip] src/sys/uvm

2010-04-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Apr 29 02:35:14 UTC 2010

Modified Files:
src/sys/uvm [uebayasi-xip]: uvm_page.c

Log Message:
FIx an off-by-one in my new code.


To generate a diff of this commit:
cvs rdiff -u -r1.153.2.29 -r1.153.2.30 src/sys/uvm/uvm_page.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/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.153.2.29 src/sys/uvm/uvm_page.c:1.153.2.30
--- src/sys/uvm/uvm_page.c:1.153.2.29	Wed Apr 28 13:28:43 2010
+++ src/sys/uvm/uvm_page.c	Thu Apr 29 02:35:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.153.2.29 2010/04/28 13:28:43 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.153.2.30 2010/04/29 02:35:14 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.29 2010/04/28 13:28:43 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.30 2010/04/29 02:35:14 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -961,10 +961,11 @@
 	if (segp == segs + VM_PHYSSEG_MAX)
 		panic("unknown segment: %p", seg);
 	SIMPLEQ_INSERT_TAIL(freelist, seg, list);
-	while (segp < segs + VM_PHYSSEG_MAX) {
+	while (segp + 1 < segs + VM_PHYSSEG_MAX) {
 		*segp = *(segp + 1);
 		segp++;
 	}
+	*(segp + VM_PHYSSEG_MAX - 1) = NULL;
 }
 
 /*



CVS commit: [uebayasi-xip] src/sys/uvm

2010-04-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Apr 29 02:37:09 UTC 2010

Modified Files:
src/sys/uvm [uebayasi-xip]: uvm_page.c

Log Message:
Fold long lines.


To generate a diff of this commit:
cvs rdiff -u -r1.153.2.30 -r1.153.2.31 src/sys/uvm/uvm_page.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/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.153.2.30 src/sys/uvm/uvm_page.c:1.153.2.31
--- src/sys/uvm/uvm_page.c:1.153.2.30	Thu Apr 29 02:35:14 2010
+++ src/sys/uvm/uvm_page.c	Thu Apr 29 02:37:09 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.153.2.30 2010/04/29 02:35:14 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.153.2.31 2010/04/29 02:37:09 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.30 2010/04/29 02:35:14 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.31 2010/04/29 02:37:09 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -797,7 +797,8 @@
 		seg->endpg = NULL;
 		seg->free_list = free_list;	/* XXX */
 	} else {
-		panic("uvm_page_physload: tried to add RAM after uvm_page_init");
+		panic("uvm_page_physload: "
+		"tried to add RAM after uvm_page_init");
 	}
 	vm_nphysmem++;
 	return seg;
@@ -895,11 +896,13 @@
 	int lcv;
 
 	for (lcv = 0; lcv < VM_PHYSSEG_MAX; lcv++) {
-		SIMPLEQ_INSERT_TAIL(&vm_physmem_freelist, &vm_physmem_store[lcv], list);
+		SIMPLEQ_INSERT_TAIL(&vm_physmem_freelist,
+		&vm_physmem_store[lcv], list);
 	}
 #ifdef DEVICE_PAGE
 	for (lcv = 0; lcv < VM_PHYSSEG_MAX; lcv++) {
-		SIMPLEQ_INSERT_TAIL(&vm_physdev_freelist, &vm_physdev_store[lcv], list);
+		SIMPLEQ_INSERT_TAIL(&vm_physdev_freelist,
+		&vm_physdev_store[lcv], list);
 	}
 #endif
 }



CVS commit: [uebayasi-xip] src/sys/uvm

2010-04-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Apr 29 03:00:48 UTC 2010

Modified Files:
src/sys/uvm [uebayasi-xip]: uvm_page.c

Log Message:
Fix thinko in previous.


To generate a diff of this commit:
cvs rdiff -u -r1.153.2.31 -r1.153.2.32 src/sys/uvm/uvm_page.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/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.153.2.31 src/sys/uvm/uvm_page.c:1.153.2.32
--- src/sys/uvm/uvm_page.c:1.153.2.31	Thu Apr 29 02:37:09 2010
+++ src/sys/uvm/uvm_page.c	Thu Apr 29 03:00:47 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.153.2.31 2010/04/29 02:37:09 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.153.2.32 2010/04/29 03:00:47 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.31 2010/04/29 02:37:09 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.32 2010/04/29 03:00:47 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -757,8 +757,9 @@
  */
 
 static struct vm_physseg *
-uvm_page_physload_common(struct vm_physseg_freelist * const, struct vm_physseg **, int,
-const paddr_t, const paddr_t, const paddr_t, const paddr_t, const int);
+uvm_page_physload_common(struct vm_physseg_freelist * const,
+struct vm_physseg **, int,
+const paddr_t, const paddr_t, const paddr_t, const paddr_t);
 static void
 uvm_page_physunload_common(struct vm_physseg_freelist *,
 struct vm_physseg **, struct vm_physseg *);
@@ -778,8 +779,11 @@
 	struct vm_physseg *seg;
 	int lcv;
 
+	if (free_list >= VM_NFREELIST || free_list < VM_FREELIST_DEFAULT)
+		panic("uvm_page_physload: bad free list %d", free_list);
+
 	seg = uvm_page_physload_common(&vm_physmem_freelist, vm_physmem_ptrs,
-	vm_nphysmem, start, end, avail_start, avail_end, free_list);
+	vm_nphysmem, start, end, avail_start, avail_end);
 	KASSERT(seg != NULL);
 
 	seg->avail_start = avail_start;
@@ -820,14 +824,16 @@
 #ifdef DEVICE_PAGE
 void *
 uvm_page_physload_device(paddr_t start, paddr_t end, paddr_t avail_start,
-paddr_t avail_end, int free_list)
+paddr_t avail_end, int prot, int flags)
 {
 	struct vm_physseg *seg;
 
 	seg = uvm_page_physload_common(&vm_physdev_freelist, vm_physdev_ptrs,
-	vm_nphysdev, start, end, avail_start, avail_end, free_list);
+	vm_nphysdev, start, end, avail_start, avail_end);
 	KASSERT(seg != NULL);
 
+	seg->prot = prot;
+	seg->flags = flags;	/* XXXUEBS BUS_SPACE_MAP_* */
 	for (paddr_t pf = start; pf < end; pf++)
 		vm_page_device_mdpage_insert(pf);
 	vm_nphysdev++;
@@ -850,15 +856,13 @@
 uvm_page_physload_common(struct vm_physseg_freelist *freelist,
 struct vm_physseg **segs, int nsegs,
 const paddr_t start, const paddr_t end,
-const paddr_t avail_start, const paddr_t avail_end, const int free_list)
+const paddr_t avail_start, const paddr_t avail_end)
 {
 	struct vm_physseg *ps;
 	static int uvm_page_physseg_inited;
 
 	if (uvmexp.pagesize == 0)
 		panic("uvm_page_physload: page size not set!");
-	if (free_list >= VM_NFREELIST || free_list < VM_FREELIST_DEFAULT)
-		panic("uvm_page_physload: bad free list %d", free_list);
 	if (start >= end)
 		panic("uvm_page_physload: start >= end");
 	if (nsegs == VM_PHYSSEG_MAX)
@@ -968,7 +972,7 @@
 		*segp = *(segp + 1);
 		segp++;
 	}
-	*(segp + VM_PHYSSEG_MAX - 1) = NULL;
+	*segp = NULL;
 }
 
 /*



CVS commit: [uebayasi-xip] src/sys/uvm

2010-04-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Apr 29 03:07:54 UTC 2010

Modified Files:
src/sys/uvm [uebayasi-xip]: uvm_page.c

Log Message:
Revert previous; unintended changes mixed.


To generate a diff of this commit:
cvs rdiff -u -r1.153.2.32 -r1.153.2.33 src/sys/uvm/uvm_page.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/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.153.2.32 src/sys/uvm/uvm_page.c:1.153.2.33
--- src/sys/uvm/uvm_page.c:1.153.2.32	Thu Apr 29 03:00:47 2010
+++ src/sys/uvm/uvm_page.c	Thu Apr 29 03:07:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.153.2.32 2010/04/29 03:00:47 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.153.2.33 2010/04/29 03:07:53 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.32 2010/04/29 03:00:47 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.33 2010/04/29 03:07:53 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -757,9 +757,8 @@
  */
 
 static struct vm_physseg *
-uvm_page_physload_common(struct vm_physseg_freelist * const,
-struct vm_physseg **, int,
-const paddr_t, const paddr_t, const paddr_t, const paddr_t);
+uvm_page_physload_common(struct vm_physseg_freelist * const, struct vm_physseg **, int,
+const paddr_t, const paddr_t, const paddr_t, const paddr_t, const int);
 static void
 uvm_page_physunload_common(struct vm_physseg_freelist *,
 struct vm_physseg **, struct vm_physseg *);
@@ -779,11 +778,8 @@
 	struct vm_physseg *seg;
 	int lcv;
 
-	if (free_list >= VM_NFREELIST || free_list < VM_FREELIST_DEFAULT)
-		panic("uvm_page_physload: bad free list %d", free_list);
-
 	seg = uvm_page_physload_common(&vm_physmem_freelist, vm_physmem_ptrs,
-	vm_nphysmem, start, end, avail_start, avail_end);
+	vm_nphysmem, start, end, avail_start, avail_end, free_list);
 	KASSERT(seg != NULL);
 
 	seg->avail_start = avail_start;
@@ -824,16 +820,14 @@
 #ifdef DEVICE_PAGE
 void *
 uvm_page_physload_device(paddr_t start, paddr_t end, paddr_t avail_start,
-paddr_t avail_end, int prot, int flags)
+paddr_t avail_end, int free_list)
 {
 	struct vm_physseg *seg;
 
 	seg = uvm_page_physload_common(&vm_physdev_freelist, vm_physdev_ptrs,
-	vm_nphysdev, start, end, avail_start, avail_end);
+	vm_nphysdev, start, end, avail_start, avail_end, free_list);
 	KASSERT(seg != NULL);
 
-	seg->prot = prot;
-	seg->flags = flags;	/* XXXUEBS BUS_SPACE_MAP_* */
 	for (paddr_t pf = start; pf < end; pf++)
 		vm_page_device_mdpage_insert(pf);
 	vm_nphysdev++;
@@ -856,13 +850,15 @@
 uvm_page_physload_common(struct vm_physseg_freelist *freelist,
 struct vm_physseg **segs, int nsegs,
 const paddr_t start, const paddr_t end,
-const paddr_t avail_start, const paddr_t avail_end)
+const paddr_t avail_start, const paddr_t avail_end, const int free_list)
 {
 	struct vm_physseg *ps;
 	static int uvm_page_physseg_inited;
 
 	if (uvmexp.pagesize == 0)
 		panic("uvm_page_physload: page size not set!");
+	if (free_list >= VM_NFREELIST || free_list < VM_FREELIST_DEFAULT)
+		panic("uvm_page_physload: bad free list %d", free_list);
 	if (start >= end)
 		panic("uvm_page_physload: start >= end");
 	if (nsegs == VM_PHYSSEG_MAX)
@@ -972,7 +968,7 @@
 		*segp = *(segp + 1);
 		segp++;
 	}
-	*segp = NULL;
+	*(segp + VM_PHYSSEG_MAX - 1) = NULL;
 }
 
 /*



CVS commit: [uebayasi-xip] src/sys/uvm

2010-04-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Apr 29 03:10:13 UTC 2010

Modified Files:
src/sys/uvm [uebayasi-xip]: uvm_page.c

Log Message:
Fix a thinko in Rev. 1.153.2.30.


To generate a diff of this commit:
cvs rdiff -u -r1.153.2.33 -r1.153.2.34 src/sys/uvm/uvm_page.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/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.153.2.33 src/sys/uvm/uvm_page.c:1.153.2.34
--- src/sys/uvm/uvm_page.c:1.153.2.33	Thu Apr 29 03:07:53 2010
+++ src/sys/uvm/uvm_page.c	Thu Apr 29 03:10:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.153.2.33 2010/04/29 03:07:53 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.153.2.34 2010/04/29 03:10:13 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.33 2010/04/29 03:07:53 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.34 2010/04/29 03:10:13 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -968,7 +968,7 @@
 		*segp = *(segp + 1);
 		segp++;
 	}
-	*(segp + VM_PHYSSEG_MAX - 1) = NULL;
+	*segp = NULL;
 }
 
 /*



CVS commit: [uebayasi-xip] src/sys/uvm

2010-04-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Apr 29 03:15:11 UTC 2010

Modified Files:
src/sys/uvm [uebayasi-xip]: uvm_extern.h uvm_page.c uvm_page.h

Log Message:
"int free_list" (VM_FREELIST_*) is specific to struct vm_page (memory
page).  Handle it only in memory physseg parts.

Record device page's properties in struct vm_physseg for future uses.
For example, framebuffers that is capable of some accelarated bus access
(e.g. write-combining) should register its capability through "int
flags".


To generate a diff of this commit:
cvs rdiff -u -r1.161.2.4 -r1.161.2.5 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.153.2.34 -r1.153.2.35 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.59.2.19 -r1.59.2.20 src/sys/uvm/uvm_page.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/uvm/uvm_extern.h
diff -u src/sys/uvm/uvm_extern.h:1.161.2.4 src/sys/uvm/uvm_extern.h:1.161.2.5
--- src/sys/uvm/uvm_extern.h:1.161.2.4	Wed Apr 28 13:28:42 2010
+++ src/sys/uvm/uvm_extern.h	Thu Apr 29 03:15:10 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_extern.h,v 1.161.2.4 2010/04/28 13:28:42 uebayasi Exp $	*/
+/*	$NetBSD: uvm_extern.h,v 1.161.2.5 2010/04/29 03:15:10 uebayasi Exp $	*/
 
 /*
  *
@@ -724,7 +724,7 @@
 			paddr_t, paddr_t, int);
 void			uvm_page_physunload(void *);
 void			*uvm_page_physload_device(paddr_t, paddr_t,
-			paddr_t, paddr_t, int);
+			paddr_t, paddr_t, int, int);
 void			uvm_page_physunload_device(void *);
 void			uvm_setpagesize(void);
 

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.153.2.34 src/sys/uvm/uvm_page.c:1.153.2.35
--- src/sys/uvm/uvm_page.c:1.153.2.34	Thu Apr 29 03:10:13 2010
+++ src/sys/uvm/uvm_page.c	Thu Apr 29 03:15:11 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.153.2.34 2010/04/29 03:10:13 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.153.2.35 2010/04/29 03:15:11 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.34 2010/04/29 03:10:13 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.35 2010/04/29 03:15:11 uebayasi Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -757,8 +757,9 @@
  */
 
 static struct vm_physseg *
-uvm_page_physload_common(struct vm_physseg_freelist * const, struct vm_physseg **, int,
-const paddr_t, const paddr_t, const paddr_t, const paddr_t, const int);
+uvm_page_physload_common(struct vm_physseg_freelist * const,
+struct vm_physseg **, int,
+const paddr_t, const paddr_t, const paddr_t, const paddr_t);
 static void
 uvm_page_physunload_common(struct vm_physseg_freelist *,
 struct vm_physseg **, struct vm_physseg *);
@@ -778,8 +779,11 @@
 	struct vm_physseg *seg;
 	int lcv;
 
+	if (free_list >= VM_NFREELIST || free_list < VM_FREELIST_DEFAULT)
+		panic("uvm_page_physload: bad free list %d", free_list);
+
 	seg = uvm_page_physload_common(&vm_physmem_freelist, vm_physmem_ptrs,
-	vm_nphysmem, start, end, avail_start, avail_end, free_list);
+	vm_nphysmem, start, end, avail_start, avail_end);
 	KASSERT(seg != NULL);
 
 	seg->avail_start = avail_start;
@@ -820,14 +824,16 @@
 #ifdef DEVICE_PAGE
 void *
 uvm_page_physload_device(paddr_t start, paddr_t end, paddr_t avail_start,
-paddr_t avail_end, int free_list)
+paddr_t avail_end, int prot, int flags)
 {
 	struct vm_physseg *seg;
 
 	seg = uvm_page_physload_common(&vm_physdev_freelist, vm_physdev_ptrs,
-	vm_nphysdev, start, end, avail_start, avail_end, free_list);
+	vm_nphysdev, start, end, avail_start, avail_end);
 	KASSERT(seg != NULL);
 
+	seg->prot = prot;
+	seg->flags = flags;	/* XXXUEBS BUS_SPACE_MAP_* */
 	for (paddr_t pf = start; pf < end; pf++)
 		vm_page_device_mdpage_insert(pf);
 	vm_nphysdev++;
@@ -850,15 +856,13 @@
 uvm_page_physload_common(struct vm_physseg_freelist *freelist,
 struct vm_physseg **segs, int nsegs,
 const paddr_t start, const paddr_t end,
-const paddr_t avail_start, const paddr_t avail_end, const int free_list)
+const paddr_t avail_start, const paddr_t avail_end)
 {
 	struct vm_physseg *ps;
 	static int uvm_page_physseg_inited;
 
 	if (uvmexp.pagesize == 0)
 		panic("uvm_page_physload: page size not set!");
-	if (free_list >= VM_NFREELIST || free_list < VM_FREELIST_DEFAULT)
-		panic("uvm_page_physload: bad free list %d", free_list);
 	if (start >= end)
 		panic("uvm_page_physload: start >= end");
 	if (nsegs == VM_PHYSSEG_MAX)

Index: src/sys/uvm/uvm_page.h
diff -u src/sys/uvm/uvm_page.h:1.59.2.19 src/sys/uvm/uvm_page.h:1.59.2.20
--- src/sys/uvm/uvm_page.h:1.59.2.19	Wed Apr 28 09:27:47 2010
+++ src/sys/uvm/uvm_page.h	Thu Apr 29 03:15:11 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.h,v 1.59.2.19 2010/04/28 09:27:47 uebayasi Exp $	*/
+/*	$NetBSD: uvm_page.h,v 1.59.2.20 2010/04/29 03:15:11 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washing

CVS commit: [uebayasi-xip] src/sys/arch/arm/imx

2010-04-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Apr 29 03:16:18 UTC 2010

Modified Files:
src/sys/arch/arm/imx [uebayasi-xip]: imx31_space.c

Log Message:
Adapt to the new uvm_page_physload_device(9).


To generate a diff of this commit:
cvs rdiff -u -r1.3.2.1 -r1.3.2.2 src/sys/arch/arm/imx/imx31_space.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/imx/imx31_space.c
diff -u src/sys/arch/arm/imx/imx31_space.c:1.3.2.1 src/sys/arch/arm/imx/imx31_space.c:1.3.2.2
--- src/sys/arch/arm/imx/imx31_space.c:1.3.2.1	Wed Apr 28 14:56:14 2010
+++ src/sys/arch/arm/imx/imx31_space.c	Thu Apr 29 03:16:18 2010
@@ -1,7 +1,7 @@
-/* $Id: imx31_space.c,v 1.3.2.1 2010/04/28 14:56:14 uebayasi Exp $ */
+/* $Id: imx31_space.c,v 1.3.2.2 2010/04/29 03:16:18 uebayasi Exp $ */
 
 /* derived from: */
-/*	$NetBSD: imx31_space.c,v 1.3.2.1 2010/04/28 14:56:14 uebayasi Exp $ */
+/*	$NetBSD: imx31_space.c,v 1.3.2.2 2010/04/29 03:16:18 uebayasi Exp $ */
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -287,6 +287,7 @@
 void *
 imx31_bs_physload(void *t, bus_addr_t addr, bus_size_t size, int prot, int flags)
 {
+	/* XXX */
 	const paddr_t start = imx31_bs_mmap(t, addr, 0, prot, flags);
 	const paddr_t end = imx31_bs_mmap(t, addr + size, 0, prot, flags);
 
@@ -303,10 +304,11 @@
 void *
 imx31_bs_physload_device(void *t, bus_addr_t addr, bus_size_t size, int prot, int flags)
 {
+	/* XXX */
 	const paddr_t start = imx31_bs_mmap(t, addr, 0, prot, flags);
 	const paddr_t end = imx31_bs_mmap(t, addr + size, 0, prot, flags);
 
-	return uvm_page_physload_device(start, end, start, end, 0/* XXX freelist */);
+	return uvm_page_physload_device(start, end, start, end, prot, flags);
 }
 
 void



CVS commit: src/sys/arch/hpcarm/hpcarm

2010-04-28 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Thu Apr 29 04:12:48 UTC 2010

Modified Files:
src/sys/arch/hpcarm/hpcarm: pxa2x0_hpc_machdep.c

Log Message:
fix indent.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_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/hpcarm/hpcarm/pxa2x0_hpc_machdep.c
diff -u src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c:1.4 src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c:1.5
--- src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c:1.4	Thu Apr 29 01:58:51 2010
+++ src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c	Thu Apr 29 04:12:48 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pxa2x0_hpc_machdep.c,v 1.4 2010/04/29 01:58:51 nonaka Exp $	*/
+/*	$NetBSD: pxa2x0_hpc_machdep.c,v 1.5 2010/04/29 04:12:48 nonaka Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0_hpc_machdep.c,v 1.4 2010/04/29 01:58:51 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0_hpc_machdep.c,v 1.5 2010/04/29 04:12:48 nonaka Exp $");
 
 #include "opt_ddb.h"
 #include "opt_dram_pages.h"
@@ -266,9 +266,9 @@
 ws003sh_cpu_reset(void)
 {
 
-		pxa2x0_gpio_set_function(89, GPIO_OUT | GPIO_SET);
-		for (;;)
-continue;
+	pxa2x0_gpio_set_function(89, GPIO_OUT | GPIO_SET);
+	for (;;)
+		continue;
 }
 
 static struct pxa2x0_gpioconf ws003sh_boarddep_gpioconf[] = {



CVS commit: src/lib/libc/string

2010-04-28 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Apr 29 05:42:04 UTC 2010

Modified Files:
src/lib/libc/string: swab.3

Log Message:
Note the recent changes.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libc/string/swab.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/string/swab.3
diff -u src/lib/libc/string/swab.3:1.12 src/lib/libc/string/swab.3:1.13
--- src/lib/libc/string/swab.3:1.12	Sat Apr 17 20:29:20 2010
+++ src/lib/libc/string/swab.3	Thu Apr 29 05:42:04 2010
@@ -26,9 +26,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\" from: @(#)swab.3	8.1 (Berkeley) 6/4/93
-.\"	$NetBSD: swab.3,v 1.12 2010/04/17 20:29:20 wiz Exp $
+.\"	$NetBSD: swab.3,v 1.13 2010/04/29 05:42:04 jruoho Exp $
 .\"
-.Dd April 17, 2010
+.Dd April 29, 2010
 .Dt SWAB 3
 .Os
 .Sh NAME
@@ -39,7 +39,7 @@
 .Sh SYNOPSIS
 .In unistd.h
 .Ft void
-.Fn swab "const void * restrict src" "void * restrict dst" "size_t len"
+.Fn swab "const void * restrict src" "void * restrict dst" "ssize_t len"
 .Sh DESCRIPTION
 The function
 .Fn swab
@@ -65,8 +65,27 @@
 .Sh SEE ALSO
 .Xr bzero 3 ,
 .Xr memset 3
+.Sh STANDARDS
+The
+.Fn swab
+function conforms to
+.St -p1003.1-2001 .
 .Sh HISTORY
 A
 .Fn swab
 function appeared in
 .At v7 .
+It was originally documented to be
+.Dq useful for carrying binary data between PDP11's and other machines .
+.Pp
+In
+.Nx 6.0
+the type of
+.Fa len
+was changed from
+.Vt size_t
+to
+.Vt ssize_t
+for
+.Tn POSIX
+compliance.



CVS commit: src

2010-04-28 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Apr 29 06:07:35 UTC 2010

Modified Files:
src/lib/libc/gen: makecontext.3 ualarm.3
src/lib/libc/sys: getcontext.2
src/share/man/man2: ucontext.2

Log Message:
Properly mark the standard that "deprecated" all of these.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/gen/makecontext.3
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/gen/ualarm.3
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/sys/getcontext.2
cvs rdiff -u -r1.5 -r1.6 src/share/man/man2/ucontext.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/gen/makecontext.3
diff -u src/lib/libc/gen/makecontext.3:1.8 src/lib/libc/gen/makecontext.3:1.9
--- src/lib/libc/gen/makecontext.3:1.8	Wed Apr 28 14:07:03 2010
+++ src/lib/libc/gen/makecontext.3	Thu Apr 29 06:07:35 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: makecontext.3,v 1.8 2010/04/28 14:07:03 jruoho Exp $
+.\"	$NetBSD: makecontext.3,v 1.9 2010/04/29 06:07:35 jruoho Exp $
 .\"
 .\" Copyright (c) 2001, 2009 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 April 28, 2010
+.Dd April 29, 2010
 .Dt MAKECONTEXT 3
 .Os
 .Sh NAME
@@ -138,7 +138,7 @@
 .St -p1003.1-2001 .
 .Pp
 The
-.St -p1003.1-2008
+.St -p1003.1-2004
 revision marked the functions
 .Fn makecontext
 and
@@ -146,6 +146,9 @@
 as obsolete, citing portability issues and recommending the use of
 .Tn POSIX
 threads instead.
+The
+.St -p1003.1-2008
+revision removed the functions from the specification.
 .Pp
 .Bf -symbolic
 The standard does not clearly define the type of integer arguments

Index: src/lib/libc/gen/ualarm.3
diff -u src/lib/libc/gen/ualarm.3:1.17 src/lib/libc/gen/ualarm.3:1.18
--- src/lib/libc/gen/ualarm.3:1.17	Thu Aug  7 16:42:58 2003
+++ src/lib/libc/gen/ualarm.3	Thu Apr 29 06:07:35 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ualarm.3,v 1.17 2003/08/07 16:42:58 agc Exp $
+.\"	$NetBSD: ualarm.3,v 1.18 2010/04/29 06:07:35 jruoho Exp $
 .\"
 .\" Copyright (c) 1986, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)ualarm.3	8.2 (Berkeley) 4/19/94
 .\"
-.Dd April 19, 1994
+.Dd April 29, 2010
 .Dt UALARM 3
 .Os
 .Sh NAME
@@ -92,7 +92,15 @@
 The
 .Fn ualarm
 functions conforms to
-.St -xpg4.2 .
+.St -xpg4.2
+and
+.St -p1003.1-2001 .
+The latter standard marked
+.Fn ualarm
+as obsolescent and a later revision,
+.St -p1003.1-2008 ,
+removed the specification of
+.Fn ualarm .
 .Sh HISTORY
 The
 .Fn ualarm

Index: src/lib/libc/sys/getcontext.2
diff -u src/lib/libc/sys/getcontext.2:1.6 src/lib/libc/sys/getcontext.2:1.7
--- src/lib/libc/sys/getcontext.2:1.6	Wed Apr 28 14:07:03 2010
+++ src/lib/libc/sys/getcontext.2	Thu Apr 29 06:07:35 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getcontext.2,v 1.6 2010/04/28 14:07:03 jruoho Exp $
+.\"	$NetBSD: getcontext.2,v 1.7 2010/04/29 06:07:35 jruoho Exp $
 .\"
 .\" Copyright (c) 1999 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -132,7 +132,7 @@
 indications are an extension to the standard.
 .Pp
 The
-.St -p1003.1-2008
+.St -p1003.1-2004
 revision marked the functions
 .Fn getcontext
 and
@@ -140,6 +140,9 @@
 as obsolete, citing portability issues and recommending the use of
 .Tn POSIX
 threads instead.
+The
+.St -p1003.1-2008
+revision removed the functions from the specification.
 .Sh HISTORY
 The
 .Fn getcontext

Index: src/share/man/man2/ucontext.2
diff -u src/share/man/man2/ucontext.2:1.5 src/share/man/man2/ucontext.2:1.6
--- src/share/man/man2/ucontext.2:1.5	Wed Apr 28 14:07:03 2010
+++ src/share/man/man2/ucontext.2	Thu Apr 29 06:07:35 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ucontext.2,v 1.5 2010/04/28 14:07:03 jruoho Exp $
+.\"	$NetBSD: ucontext.2,v 1.6 2010/04/29 06:07:35 jruoho Exp $
 .\"
 .\" Copyright (c) 2001 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 April 28, 2010
+.Dd April 29, 2010
 .Dt UCONTEXT 2
 .Os
 .Sh NAME
@@ -103,4 +103,6 @@
 .St -p1003.1-2001 .
 The
 .St -p1003.1-2008
-revision marked the accompanying functions as obsolescent.
+revision removed the
+.Vt ucontext_t
+from the specification.



CVS commit: [uebayasi-xip] src/sys/dev

2010-04-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Apr 29 06:29:29 UTC 2010

Modified Files:
src/sys/dev [uebayasi-xip]: flash.c

Log Message:
Don't specify anything in "int flags" of bus_space_physload_device(9)
for now.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.7 -r1.1.2.8 src/sys/dev/flash.c

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

Modified files:

Index: src/sys/dev/flash.c
diff -u src/sys/dev/flash.c:1.1.2.7 src/sys/dev/flash.c:1.1.2.8
--- src/sys/dev/flash.c:1.1.2.7	Wed Apr 28 16:33:47 2010
+++ src/sys/dev/flash.c	Thu Apr 29 06:29:29 2010
@@ -1,4 +1,4 @@
-/*	$Id: flash.c,v 1.1.2.7 2010/04/28 16:33:47 uebayasi Exp $	*/
+/*	$Id: flash.c,v 1.1.2.8 2010/04/29 06:29:29 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2010 Tsubai Masanari.  All rights reserved.
@@ -241,7 +241,7 @@
 #error bus_space_physload_device(9) must be supported to use XIP!
 #else
 	sc->sc_phys = bus_space_physload_device(sc->sc_iot, sc->sc_addr, sc->sc_size,
-	PROT_READ | PROT_WRITE, BUS_SPACE_MAP_LINEAR);
+	PROT_READ | PROT_WRITE, 0);
 #endif
 #endif
 



CVS commit: [uebayasi-xip] src/sys/rump/librump/rumpkern

2010-04-28 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Apr 29 06:31:13 UTC 2010

Modified Files:
src/sys/rump/librump/rumpkern [uebayasi-xip]: vm.c
Added Files:
src/sys/rump/librump/rumpkern/opt [uebayasi-xip]: opt_device_page.h
opt_xip.h

Log Message:
Fix build of rump.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.70.2.1 src/sys/rump/librump/rumpkern/vm.c
cvs rdiff -u -r0 -r1.1.2.1 \
src/sys/rump/librump/rumpkern/opt/opt_device_page.h \
src/sys/rump/librump/rumpkern/opt/opt_xip.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/rump/librump/rumpkern/vm.c
diff -u src/sys/rump/librump/rumpkern/vm.c:1.70 src/sys/rump/librump/rumpkern/vm.c:1.70.2.1
--- src/sys/rump/librump/rumpkern/vm.c:1.70	Fri Dec  4 17:57:16 2009
+++ src/sys/rump/librump/rumpkern/vm.c	Thu Apr 29 06:31:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm.c,v 1.70 2009/12/04 17:57:16 pooka Exp $	*/
+/*	$NetBSD: vm.c,v 1.70.2.1 2010/04/29 06:31:13 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.70 2009/12/04 17:57:16 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.70.2.1 2010/04/29 06:31:13 uebayasi Exp $");
 
 #include 
 #include 
@@ -694,3 +694,10 @@
 
 	/* nada */
 }
+
+paddr_t
+uvm_vm_page_to_phys(const struct vm_page *pg)
+{
+
+	return 0;
+}

Added files:

Index: src/sys/rump/librump/rumpkern/opt/opt_device_page.h
diff -u /dev/null src/sys/rump/librump/rumpkern/opt/opt_device_page.h:1.1.2.1
--- /dev/null	Thu Apr 29 06:31:13 2010
+++ src/sys/rump/librump/rumpkern/opt/opt_device_page.h	Thu Apr 29 06:31:13 2010
@@ -0,0 +1 @@
+/*	$NetBSD: opt_device_page.h,v 1.1.2.1 2010/04/29 06:31:13 uebayasi Exp $	*/
Index: src/sys/rump/librump/rumpkern/opt/opt_xip.h
diff -u /dev/null src/sys/rump/librump/rumpkern/opt/opt_xip.h:1.1.2.1
--- /dev/null	Thu Apr 29 06:31:13 2010
+++ src/sys/rump/librump/rumpkern/opt/opt_xip.h	Thu Apr 29 06:31:13 2010
@@ -0,0 +1 @@
+/*	$NetBSD: opt_xip.h,v 1.1.2.1 2010/04/29 06:31:13 uebayasi Exp $	*/



CVS commit: src/usr.bin/unzip

2010-04-28 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Apr 29 06:32:19 UTC 2010

Modified Files:
src/usr.bin/unzip: unzip.c

Log Message:
Switch to the less restrictive binary detection algorithm from zip 3.0e.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/unzip/unzip.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/unzip/unzip.c
diff -u src/usr.bin/unzip/unzip.c:1.12 src/usr.bin/unzip/unzip.c:1.13
--- src/usr.bin/unzip/unzip.c:1.12	Thu Feb 18 15:51:57 2010
+++ src/usr.bin/unzip/unzip.c	Thu Apr 29 06:32:19 2010
@@ -1,7 +1,7 @@
-/* $NetBSD: unzip.c,v 1.12 2010/02/18 15:51:57 joerg Exp $ */
+/* $NetBSD: unzip.c,v 1.13 2010/04/29 06:32:19 joerg Exp $ */
 
 /*-
- * Copyright (c) 2009 Joerg Sonnenberger 
+ * Copyright (c) 2009, 2010 Joerg Sonnenberger 
  * Copyright (c) 2007-2008 Dag-Erling Coïdan Smørgrav
  * All rights reserved.
  *
@@ -37,7 +37,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: unzip.c,v 1.12 2010/02/18 15:51:57 joerg Exp $");
+__RCSID("$NetBSD: unzip.c,v 1.13 2010/04/29 06:32:19 joerg Exp $");
 
 #include 
 #include 
@@ -459,6 +459,34 @@
 }
 
 /*
+ * Detect binary files by a combination of character white list and
+ * black list. NUL bytes and other control codes without use in text files
+ * result directly in switching the file to binary mode. Otherwise, at least
+ * one white-listed byte has to be found.
+ *
+ * Black-listed: 0..6, 14..25, 28..31
+ * White-listed: 9..10, 13, >= 32
+ *
+ * See the proginfo/txtvsbin.txt in the zip sources for a detailed discussion.
+ */
+#define BYTE_IS_BINARY(x)	((x) < 32 && (0xf3ffc07fU & (1U << (x
+#define	BYTE_IS_TEXT(x)		((x) >= 32 || (0x2600U & (1U << (x
+
+static int
+check_binary(const unsigned char *buf, size_t len)
+{
+	int rv;
+	for (rv = 1; len--; ++buf) {
+		if (BYTE_IS_BINARY(*buf))
+			return 1;
+		if (BYTE_IS_TEXT(*buf))
+			rv = 0;
+	}
+
+	return rv;
+}
+
+/*
  * Extract a regular file.
  */
 static void
@@ -544,11 +572,9 @@
 		 * guess wrong, we print a warning message later.
 		 */
 		if (a_opt && n == 0) {
-			for (p = buffer; p < end; ++p) {
-if (!isascii((unsigned char)*p)) {
-	text = 0;
-	break;
-}
+			if (check_binary(buffer, len)) {
+text = 0;
+break;
 			}
 		}
 
@@ -562,7 +588,7 @@
 		/* hard case: convert \r\n to \n (sigh...) */
 		for (p = buffer; p < end; p = q + 1) {
 			for (q = p; q < end; q++) {
-if (!warn && !isascii(*q)) {
+if (!warn && BYTE_IS_BINARY(*q)) {
 	warningx("%s may be corrupted due"
 	" to weak text file detection"
 	" heuristic", *path);



CVS commit: src/sys/dev/pci

2010-04-28 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Apr 29 06:41:28 UTC 2010

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

Log Message:
Adds hw quirk for SUN firewire controllers.  From FreeBSD.
  Thanks for ceg...@.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/pci/fwohci_pci.c

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

Modified files:

Index: src/sys/dev/pci/fwohci_pci.c
diff -u src/sys/dev/pci/fwohci_pci.c:1.38 src/sys/dev/pci/fwohci_pci.c:1.39
--- src/sys/dev/pci/fwohci_pci.c:1.38	Sat Apr 24 11:26:15 2010
+++ src/sys/dev/pci/fwohci_pci.c	Thu Apr 29 06:41:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwohci_pci.c,v 1.38 2010/04/24 11:26:15 kiyohara Exp $	*/
+/*	$NetBSD: fwohci_pci.c,v 1.39 2010/04/29 06:41:27 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fwohci_pci.c,v 1.38 2010/04/24 11:26:15 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwohci_pci.c,v 1.39 2010/04/29 06:41:27 kiyohara Exp $");
 
 #include 
 #include 
@@ -99,7 +99,7 @@
 	char devinfo[256];
 	char const *intrstr;
 	pci_intr_handle_t ih;
-	u_int32_t csr;
+	uint32_t csr;
 
 	aprint_naive(": IEEE 1394 Controller\n");
 
@@ -125,8 +125,17 @@
 
 	/* Enable the device. */
 	csr = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
-	pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
-	csr | PCI_COMMAND_MASTER_ENABLE);
+	csr |= PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_MEM_ENABLE;
+	pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, csr);
+
+	/*
+	 * Some Sun FireWire controllers have their intpin register
+	 * bogusly set to 0, although it should be 3. Correct that.
+	 */
+	if ((PCI_VENDOR(pa->pa_id) == PCI_VENDOR_SUN) &&
+	(PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_SUN_FIREWIRE))
+		if (pa->pa_intrpin == 0)
+			pa->pa_intrpin = 3;
 
 	/* Map and establish the interrupt. */
 	if (pci_intr_map(pa, &ih)) {



CVS commit: src/sys/dev/ieee1394

2010-04-28 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Apr 29 06:51:26 UTC 2010

Modified Files:
src/sys/dev/ieee1394: sbp.c sbp.h

Log Message:
+ Use structs scsipi_inquiry_data/scsi_sense_data instead of scsi3_inquiry_data/
  scsi3_sense_data.
+ s/switch()/switch ()/.
+ Change args for printf().  ("FUNCNAME ...") -> ("%s ...\n", __func__, ...)
+ Indent.
+ Remove unnecessary cast.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/ieee1394/sbp.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/ieee1394/sbp.h

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

Modified files:

Index: src/sys/dev/ieee1394/sbp.c
diff -u src/sys/dev/ieee1394/sbp.c:1.29 src/sys/dev/ieee1394/sbp.c:1.30
--- src/sys/dev/ieee1394/sbp.c:1.29	Mon Mar 29 03:05:28 2010
+++ src/sys/dev/ieee1394/sbp.c	Thu Apr 29 06:51:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbp.c,v 1.29 2010/03/29 03:05:28 kiyohara Exp $	*/
+/*	$NetBSD: sbp.c,v 1.30 2010/04/29 06:51:26 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sbp.c,v 1.29 2010/03/29 03:05:28 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbp.c,v 1.30 2010/04/29 06:51:26 kiyohara Exp $");
 
 
 #include 
@@ -92,10 +92,10 @@
  * 48-64(16): bus_id, node_id
  */
 #define SBP_BIND_HI 0x1
-#define SBP_DEV2ADDR(u, l) \
-	(((u_int64_t)SBP_BIND_HI << 32) \
-	| (((u) & 0x3fff) << 10) \
-	| (((l) & 0xff) << 2))
+#define SBP_DEV2ADDR(u, l)		 \
+	(((uint64_t)SBP_BIND_HI << 32)	|\
+	 (((u) & 0x3fff) << 10)		|\
+	 (((l) & 0xff) << 2))
 #define SBP_ADDR2UNIT(a)	(((a) >> 10) & 0x3fff)
 #define SBP_ADDR2LUN(a)		(((a) >> 2) & 0xff)
 #define SBP_INITIATOR 7
@@ -937,7 +937,7 @@
 	int i;
 
 SBP_DEBUG(1)
-	printf("sbp_probe_target %d\n", target->target_id);
+	printf("%s %d\n", __func__, target->target_id);
 END_DEBUG
 
 	sbp_alloc_lun(target);
@@ -1484,7 +1484,7 @@
 	ocb->flags = OCB_ACT_MGM;
 	ocb->sdev = sdev;
 
-	memset((void *)ocb->orb, 0, sizeof(ocb->orb));
+	memset(ocb->orb, 0, sizeof(ocb->orb));
 	ocb->orb[6] = htonl((nid << 16) | SBP_BIND_HI);
 	ocb->orb[7] = htonl(SBP_DEV2ADDR(dv_unit, sdev->lun_id));
 
@@ -1579,8 +1579,7 @@
 sbp_scsi_status(struct sbp_status *sbp_status, struct sbp_ocb *ocb)
 {
 	struct sbp_cmd_status *sbp_cmd_status;
-	scsi3_sense_data_t sense =
-	(scsi3_sense_data_t)&ocb->xs->sense.scsi_sense;
+	struct scsi_sense_data *sense = &ocb->xs->sense.scsi_sense;
 
 	sbp_cmd_status = (struct sbp_cmd_status *)sbp_status->data;
 
@@ -1608,7 +1607,7 @@
 		else
 			sense->response_code = SSD_RCODE_DEFERRED;
 		if (sbp_cmd_status->valid)
-			sense->response_code |= SSD_RESPONSE_CODE_VALID;
+			sense->response_code |= SSD_RCODE_VALID;
 		sense->flags = sbp_cmd_status->s_key;
 		if (sbp_cmd_status->mark)
 			sense->flags |= SSD_FILEMARK;
@@ -1617,25 +1616,25 @@
 		if (sbp_cmd_status->ill_len)
 			sense->flags |= SSD_ILI;
 
-		memcpy(sense->information, &sbp_cmd_status->info, 4);
+		memcpy(sense->info, &sbp_cmd_status->info, 4);
 
 		if (sbp_status->len <= 1)
 			/* XXX not scsi status. shouldn't be happened */
-			sense->asl = 0;
+			sense->extra_len = 0;
 		else if (sbp_status->len <= 4)
 			/* add_sense_code(_qual), info, cmd_spec_info */
-			sense->asl = 6;
+			sense->extra_len = 6;
 		else
 			/* fru, sense_key_spec */
-			sense->asl = 10;
+			sense->extra_len = 10;
 
 		memcpy(sense->csi, &sbp_cmd_status->cdb, 4);
 
 		sense->asc = sbp_cmd_status->s_code;
 		sense->ascq = sbp_cmd_status->s_qlfr;
-		sense->fruc = sbp_cmd_status->fru;
+		sense->fru = sbp_cmd_status->fru;
 
-		memcpy(sense->sks, sbp_cmd_status->s_keydep, 3);
+		memcpy(sense->sks.sks_bytes, sbp_cmd_status->s_keydep, 3);
 		ocb->xs->error = XS_SENSE;
 		ocb->xs->xs_status = sbp_cmd_status->status;
 /*
@@ -1663,7 +1662,8 @@
 {
 	struct scsipi_xfer *xs = ocb->xs;
 	struct sbp_dev *sdev;
-	scsi3_inquiry_data_t inq = (scsi3_inquiry_data_t)xs->data;
+	struct scsipi_inquiry_data *inq =
+	(struct scsipi_inquiry_data *)xs->data;
 
 	sdev = ocb->sdev;
 
@@ -1709,9 +1709,9 @@
 	 * XXX CAM also checks SCP_QUEUE_DQUE flag in the control mode page.
 	 */
 	if (sbp_tags > 0)
-		inq->flags[1] |= SID_CmdQue;
+		inq->flags3 |= SID_CmdQue;
 	else if (sbp_tags < 0)
-		inq->flags[1] &= ~SID_CmdQue;
+		inq->flags3 &= ~SID_CmdQue;
 
 }
 
@@ -1818,7 +1818,7 @@
 END_DEBUG
 		printf("%s:%s\n", device_xname(sc->sc_fd.dev), sdev->bustgtlun);
 		status = sbp_status->status;
-		switch(sbp_status->resp) {
+		switch (sbp_status->resp) {
 		case SBP_REQ_CMP:
 			if (status > MAX_ORB_STATUS0)
 printf("%s\n", orb_status0[MAX_ORB_STATUS0]);
@@ -1853,17 +1853,17 @@
 	if (ocb == NULL)
 		goto done;
 
-	switch(ntohl(ocb->orb[4]) & ORB_FMT_MSK) {
+	switch (ntohl(ocb->orb[4]) & ORB_FMT_MSK) {
 	case ORB_FMT_NOP:
 		break;
 	case ORB_FMT_VED:
 		break;
 	case ORB_FMT_STD:
-		switch(ocb->flags) {
+		switch (ocb->flags) {
 		case OC

CVS commit: src/sys/dev/ieee1394

2010-04-28 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Apr 29 06:53:13 UTC 2010

Modified Files:
src/sys/dev/ieee1394: fwohci.c

Log Message:
+ Fix typo.
+ Call aprint_error_dev() instead of aprint_error().


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/sys/dev/ieee1394/fwohci.c

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

Modified files:

Index: src/sys/dev/ieee1394/fwohci.c
diff -u src/sys/dev/ieee1394/fwohci.c:1.124 src/sys/dev/ieee1394/fwohci.c:1.125
--- src/sys/dev/ieee1394/fwohci.c:1.124	Mon Apr 19 07:00:58 2010
+++ src/sys/dev/ieee1394/fwohci.c	Thu Apr 29 06:53:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwohci.c,v 1.124 2010/04/19 07:00:58 kiyohara Exp $	*/
+/*	$NetBSD: fwohci.c,v 1.125 2010/04/29 06:53:13 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fwohci.c,v 1.124 2010/04/19 07:00:58 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwohci.c,v 1.125 2010/04/29 06:53:13 kiyohara Exp $");
 
 #include 
 #include 
@@ -2010,7 +2010,7 @@
 			/* allow from all nodes */
 			OWRITE(sc, OHCI_PREQHI, 0x7fff);
 			OWRITE(sc, OHCI_PREQLO, 0x);
-			/* 0 to 4GB regison */
+			/* 0 to 4GB region */
 			OWRITE(sc, OHCI_PREQUPPER, 0x1);
 		}
 		/* Set ATRetries register */
@@ -2027,7 +2027,7 @@
 		aprint_normal_dev(fc->dev, "node_id=0x%08x, gen=%d, ",
 		node_id, (plen >> 16) & 0xff);
 		if (!(node_id & OHCI_NODE_VALID)) {
-			aprint_error("Bus reset failure\n");
+			aprint_error_dev(fc->dev, "Bus reset failure\n");
 			goto sidout;
 		}
 



CVS commit: src/sys/dev/ieee1394

2010-04-28 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Apr 29 06:53:49 UTC 2010

Modified Files:
src/sys/dev/ieee1394: fwdev.c

Log Message:
Remove unnecessary cast.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/ieee1394/fwdev.c

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

Modified files:

Index: src/sys/dev/ieee1394/fwdev.c
diff -u src/sys/dev/ieee1394/fwdev.c:1.18 src/sys/dev/ieee1394/fwdev.c:1.19
--- src/sys/dev/ieee1394/fwdev.c:1.18	Mon Mar 29 03:05:27 2010
+++ src/sys/dev/ieee1394/fwdev.c	Thu Apr 29 06:53:48 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwdev.c,v 1.18 2010/03/29 03:05:27 kiyohara Exp $	*/
+/*	$NetBSD: fwdev.c,v 1.19 2010/04/29 06:53:48 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fwdev.c,v 1.18 2010/03/29 03:05:27 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwdev.c,v 1.19 2010/04/29 06:53:48 kiyohara Exp $");
 
 #include 
 #include 
@@ -511,10 +511,10 @@
 			break;
 		}
 
-		memcpy((void *)&xfer->send.hdr, fp, tinfo->hdr_len);
+		memcpy(&xfer->send.hdr, fp, tinfo->hdr_len);
 		if (pay_len > 0)
-			memcpy((void *)xfer->send.payload,
-			(char *)fp + tinfo->hdr_len, pay_len);
+			memcpy(xfer->send.payload, (char *)fp + tinfo->hdr_len,
+			pay_len);
 		xfer->send.spd = asyreq->req.sped;
 		xfer->hand = fw_xferwake;
 



CVS commit: src/lib/libc

2010-04-28 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Apr 29 06:54:26 UTC 2010

Modified Files:
src/lib/libc/gen: getcwd.3
src/lib/libc/stdio: mktemp.3
src/lib/libc/string: bcmp.3 bcopy.3 bzero.3 index.3 rindex.3

Log Message:
Add some STANDARDS lingo, mainly to note the functions that have been
removed from POSIX (2008).


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/gen/getcwd.3
cvs rdiff -u -r1.25 -r1.26 src/lib/libc/stdio/mktemp.3
cvs rdiff -u -r1.12 -r1.13 src/lib/libc/string/bcmp.3 \
src/lib/libc/string/bzero.3 src/lib/libc/string/index.3
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/string/bcopy.3 \
src/lib/libc/string/rindex.3

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

Modified files:

Index: src/lib/libc/gen/getcwd.3
diff -u src/lib/libc/gen/getcwd.3:1.17 src/lib/libc/gen/getcwd.3:1.18
--- src/lib/libc/gen/getcwd.3:1.17	Mon Mar 22 19:30:53 2010
+++ src/lib/libc/gen/getcwd.3	Thu Apr 29 06:54:26 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getcwd.3,v 1.17 2010/03/22 19:30:53 joerg Exp $
+.\"	$NetBSD: getcwd.3,v 1.18 2010/04/29 06:54:26 jruoho Exp $
 .\"
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)getcwd.3	8.2 (Berkeley) 12/11/93
 .\"
-.Dd December 11, 1993
+.Dd April 29, 2010
 .Dt GETCWD 3
 .Os
 .Sh NAME
@@ -132,10 +132,24 @@
 .Xr strerror 3
 .Sh STANDARDS
 The
+.Fn getwd
+and
 .Fn getcwd
-function
-conforms to
+functions conform to
 .St -p1003.1-90 .
+The
+.St -p1003.1-2004
+revision marked
+.Fn getwd
+as legacy and recommended the use of
+.Fn getcwd
+instead.
+The
+.St -p1003.1-2008
+revision removed
+.Fn getwd
+from the specification.
+.Pp
 The ability to specify a
 .Dv NULL
 pointer and have

Index: src/lib/libc/stdio/mktemp.3
diff -u src/lib/libc/stdio/mktemp.3:1.25 src/lib/libc/stdio/mktemp.3:1.26
--- src/lib/libc/stdio/mktemp.3:1.25	Fri Aug  4 20:55:45 2006
+++ src/lib/libc/stdio/mktemp.3	Thu Apr 29 06:54:26 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mktemp.3,v 1.25 2006/08/04 20:55:45 jld Exp $
+.\"	$NetBSD: mktemp.3,v 1.26 2010/04/29 06:54:26 jruoho Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)mktemp.3	8.1 (Berkeley) 6/4/93
 .\"
-.Dd July 28, 1998
+.Dd April 29, 2010
 .Dt MKTEMP 3
 .Os
 .Sh NAME
@@ -249,6 +249,23 @@
 .Xr open 2 ,
 .Xr stat 2 ,
 .Xr umask 2
+.Sh STANDARDS
+The
+.Fn mktemp
+conforms to
+.St -p1003.1-2001 .
+It was however removed from the specification in the
+.St -p1003.1-2008
+revision.
+The
+.Fn mkstemp
+and
+.Fn mkdtemp
+conform to
+.St -p1003.1-2004
+and
+.St -p1003.1-2008 ,
+respectively.
 .Sh HISTORY
 A
 .Fn mktemp
@@ -310,5 +327,3 @@
 or
 .Fn mkdtemp
 instead.
-.\" .SH STANDARDS
-.\" .St -p1003.1-2003

Index: src/lib/libc/string/bcmp.3
diff -u src/lib/libc/string/bcmp.3:1.12 src/lib/libc/string/bcmp.3:1.13
--- src/lib/libc/string/bcmp.3:1.12	Thu Aug  7 16:43:46 2003
+++ src/lib/libc/string/bcmp.3	Thu Apr 29 06:54:26 2010
@@ -28,9 +28,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\" from: @(#)bcmp.3	8.1 (Berkeley) 6/4/93
-.\"	$NetBSD: bcmp.3,v 1.12 2003/08/07 16:43:46 agc Exp $
+.\"	$NetBSD: bcmp.3,v 1.13 2010/04/29 06:54:26 jruoho Exp $
 .\"
-.Dd June 4, 1993
+.Dd April 29, 2010
 .Dt BCMP 3
 .Os
 .Sh NAME
@@ -63,6 +63,21 @@
 .Xr strcmp 3 ,
 .Xr strcoll 3 ,
 .Xr strxfrm 3
+.Sh STANDARDS
+The
+.Fn bcmp
+function conforms to
+.St -p1003.1-2001 .
+The
+.St -p1003.1-2004
+revision marked it as legacy and recommended the use of
+.Xr memcmp 3
+instead.
+The
+.St -p1003.1-2008
+revision removed
+.Fn bcmp
+from the specification.
 .Sh HISTORY
 A
 .Fn bcmp
Index: src/lib/libc/string/bzero.3
diff -u src/lib/libc/string/bzero.3:1.12 src/lib/libc/string/bzero.3:1.13
--- src/lib/libc/string/bzero.3:1.12	Thu Aug  7 16:43:47 2003
+++ src/lib/libc/string/bzero.3	Thu Apr 29 06:54:26 2010
@@ -29,9 +29,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\" from: @(#)bzero.3	8.1 (Berkeley) 6/4/93
-.\"	$NetBSD: bzero.3,v 1.12 2003/08/07 16:43:47 agc Exp $
+.\"	$NetBSD: bzero.3,v 1.13 2010/04/29 06:54:26 jruoho Exp $
 .\"
-.Dd June 4, 1993
+.Dd April 29, 2010
 .Dt BZERO 3
 .Os
 .Sh NAME
@@ -59,6 +59,21 @@
 .Sh SEE ALSO
 .Xr memset 3 ,
 .Xr swab 3
+.Sh STANDARDS
+The
+.Fn bzero
+function conforms to
+.St -p1003.1-2001 .
+The
+.St -p1003.1-2004
+revision marked it as legacy and recommended the use of
+.Xr memset 3
+instead.
+The
+.St -p1003.1-2008
+revision removed
+.Fn bzero
+from the specification.
 .Sh HISTORY
 A
 .Fn bzero
Index: src/lib/libc/string/index.3
diff -u src/lib/libc/string/index.3:1.12 src/lib/libc/string/index.3:1.13
--- src/lib/libc/string/index.3:1.12	Mon Oct 16 08:48:45 2006
+++ src/lib/libc/string/index.3	Thu Apr 29 06:54:26 2010
@@ -28,9 +28,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\" from: @(#)index.3	8.1 (Berkeley) 6/4/93
-.\"	$NetBSD: index.3,v 1.12 2006/10/16 08:48:45 wiz Exp $
+.\"	$NetB

CVS commit: src/sys/dev/ieee1394

2010-04-28 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Thu Apr 29 06:56:00 UTC 2010

Modified Files:
src/sys/dev/ieee1394: fwdma.c

Log Message:
Call malloc(M_ZERO) instead of malloc() and memset().


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/ieee1394/fwdma.c

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

Modified files:

Index: src/sys/dev/ieee1394/fwdma.c
diff -u src/sys/dev/ieee1394/fwdma.c:1.13 src/sys/dev/ieee1394/fwdma.c:1.14
--- src/sys/dev/ieee1394/fwdma.c:1.13	Mon Mar 29 03:05:27 2010
+++ src/sys/dev/ieee1394/fwdma.c	Thu Apr 29 06:56:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwdma.c,v 1.13 2010/03/29 03:05:27 kiyohara Exp $	*/
+/*	$NetBSD: fwdma.c,v 1.14 2010/04/29 06:56:00 kiyohara Exp $	*/
 /*-
  * Copyright (c) 2003
  * 	Hidetoshi Shimokawa. All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fwdma.c,v 1.13 2010/03/29 03:05:27 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwdma.c,v 1.14 2010/04/29 06:56:00 kiyohara Exp $");
 #if defined(__FreeBSD__)
 __FBSDID("$FreeBSD: src/sys/dev/firewire/fwdma.c,v 1.9 2007/06/06 14:31:36 simokawa Exp $");
 #endif
@@ -141,7 +141,8 @@
 	struct fwdma_alloc_multi *am;
 	struct fwdma_seg *seg;
 	bus_size_t ssize;
-	int nseg, size;
+	size_t size;
+	int nseg;
 
 	if (esize > PAGE_SIZE) {
 		/* round up to PAGE_SIZE */
@@ -154,12 +155,11 @@
 	}
 	size = sizeof(struct fwdma_alloc_multi) +
 	sizeof(struct fwdma_seg) * nseg;
-	am = (struct fwdma_alloc_multi *)malloc(size, M_FW, M_WAITOK);
+	am = (struct fwdma_alloc_multi *)malloc(size, M_FW, M_WAITOK | M_ZERO);
 	if (am == NULL) {
 		aprint_error_dev(fc->dev, "malloc failed\n");
 		return NULL;
 	}
-	memset(am, 0, size);
 	am->ssize = ssize;
 	am->esize = esize;
 	am->nseg = 0;