CVS commit: src/usr.bin/make

2012-05-21 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Mon May 21 06:30:03 UTC 2012

Modified Files:
src/usr.bin/make: cond.c

Log Message:
In meta mode, level 0 can legitimately see  64 nested .if's


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/usr.bin/make/cond.c

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

Modified files:

Index: src/usr.bin/make/cond.c
diff -u src/usr.bin/make/cond.c:1.62 src/usr.bin/make/cond.c:1.63
--- src/usr.bin/make/cond.c:1.62	Tue Mar 29 17:19:22 2011
+++ src/usr.bin/make/cond.c	Mon May 21 06:30:02 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.62 2011/03/29 17:19:22 sjg Exp $	*/
+/*	$NetBSD: cond.c,v 1.63 2012/05/21 06:30:02 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = $NetBSD: cond.c,v 1.62 2011/03/29 17:19:22 sjg Exp $;
+static char rcsid[] = $NetBSD: cond.c,v 1.63 2012/05/21 06:30:02 sjg Exp $;
 #else
 #include sys/cdefs.h
 #ifndef lint
 #if 0
 static char sccsid[] = @(#)cond.c	8.2 (Berkeley) 1/2/94;
 #else
-__RCSID($NetBSD: cond.c,v 1.62 2011/03/29 17:19:22 sjg Exp $);
+__RCSID($NetBSD: cond.c,v 1.63 2012/05/21 06:30:02 sjg Exp $);
 #endif
 #endif /* not lint */
 #endif
@@ -1227,7 +1227,7 @@ do_Cond_EvalExpression(Boolean *value)
 int
 Cond_Eval(char *line)
 {
-#define	MAXIF	64	/* maximum depth of .if'ing */
+#define	MAXIF  128	/* maximum depth of .if'ing */
 enum if_states {
 	IF_ACTIVE,		/* .if or .elif part active */
 	ELSE_ACTIVE,		/* .else part active */



CVS commit: src/share/doc/smm/04.quotas

2012-05-21 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon May 21 06:30:18 UTC 2012

Modified Files:
src/share/doc/smm/04.quotas: quotas.ms

Log Message:
Typos, capitalization, and file systems.
(Not reviewed at the content level.)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/doc/smm/04.quotas/quotas.ms

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

Modified files:

Index: src/share/doc/smm/04.quotas/quotas.ms
diff -u src/share/doc/smm/04.quotas/quotas.ms:1.5 src/share/doc/smm/04.quotas/quotas.ms:1.6
--- src/share/doc/smm/04.quotas/quotas.ms:1.5	Mon May 21 05:53:28 2012
+++ src/share/doc/smm/04.quotas/quotas.ms	Mon May 21 06:30:18 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: quotas.ms,v 1.5 2012/05/21 05:53:28 dholland Exp $
+.\	$NetBSD: quotas.ms,v 1.6 2012/05/21 06:30:18 wiz Exp $
 .\
 .\ Copyright (c) 1983, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -271,7 +271,7 @@ quotas, in the following sections.
 .PP
 The first step in all cases, however, is to decide what file systems
 need to have quotas.
-Typically, only filesystems that house users' home directories,
+Typically, only file systems that house users' home directories,
 or other user files, will need quotas.
 Do not forget the mail spool.
 It may also prove useful to also include
@@ -544,8 +544,8 @@ configured individually; instead, one gr
 all users.
 .PP
 In the historic quota system the default values and the global grace
-period are stored in the quota entry for uid 
-(or gid)
+period are stored in the quota entry for UID 
+(or GID)
 0.
 This scheme partly shows through to the quota tools.
 It is also possible to attempt to establish quota configurations that
@@ -569,7 +569,7 @@ arise.
 It is possible to temporarily disable quota enforcement by using
 \fIquotaoff\fP\|(8).
 However, this also disables usage tracking.
-Consequentely, if this is done while the system is live, it is in
+Consequently, if this is done while the system is live, it is in
 general necessary to run
 \fIquotacheck\fP\|(8)
 to correct the usage information before running
@@ -699,7 +699,7 @@ Some implementation details for the hist
 The data in the quota files is an array of
 dquot
 structures, indexed by id
-(uid or gid).
+(UID or GID).
 There is an entry for every id on the system, whether or not
 a quota is configured for that id.
 If the id space is sparse, then the file may have holes in it.
@@ -732,7 +732,7 @@ currently active, and then the quota ent
 owned by users
 (or groups)
 who are not currently active.
-Each subsequent open of a file on the filesystem will
+Each subsequent open of a file on the file system will
 be accompanied by a pairing with its quota information.
 In most cases this information will be retained in core,
 either because the user who owns the file is running some
@@ -740,7 +740,7 @@ process, because other files are open ow
 user, or because some file (perhaps this one) was recently
 accessed.
 In memory, the quota information is kept hashed by id
-and filesystem, and retained in an LRU chain so recently
+and file system, and retained in an LRU chain so recently
 released data can be easily reclaimed.
 Information about those users whose last process has
 recently terminated is also retained in this way.
@@ -760,7 +760,7 @@ The historic quota system was loosely ba
 early scheme implemented at the University of New South
 Wales, and Sydney University in the mid 70's. That system
 implemented a single combined limit for both files and blocks
-on all filesystems.
+on all file systems.
 .PP
 A later system was implemented at the University of Melbourne
 by Robert Elz, but was not kept highly accurately.
@@ -771,7 +771,7 @@ The historic quota system was put into p
 in January 1982 at Melbourne.
 .\ It is actually just a small part of a much broader resource
 .\ control scheme, which is capable of controlling almost
-.\ anything that is usually uncontrolled in unix. The rest
+.\ anything that is usually uncontrolled in UNIX. The rest
 .\ of this is, as yet, still in a state where it is far too
 .\ subject to change to be considered for distribution.
 .PP



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

2012-05-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May 21 07:42:52 UTC 2012

Modified Files:
src/sys/arch/hppa/include: cpufunc.h

Log Message:
Provide hppa_{enable,disable}_irq


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/hppa/include/cpufunc.h

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

Modified files:

Index: src/sys/arch/hppa/include/cpufunc.h
diff -u src/sys/arch/hppa/include/cpufunc.h:1.16 src/sys/arch/hppa/include/cpufunc.h:1.17
--- src/sys/arch/hppa/include/cpufunc.h:1.16	Tue Apr  3 12:07:26 2012
+++ src/sys/arch/hppa/include/cpufunc.h	Mon May 21 07:42:51 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.h,v 1.16 2012/04/03 12:07:26 skrll Exp $	*/
+/*	$NetBSD: cpufunc.h,v 1.17 2012/05/21 07:42:51 skrll Exp $	*/
 
 /*	$OpenBSD: cpufunc.h,v 1.17 2000/05/15 17:22:40 mickey Exp $	*/
 
@@ -172,6 +172,18 @@ pdtlbe(pa_space_t sp, vaddr_t va)
 	__asm volatile(pdtlbe %%r0(%%sr1, %0):: r (va));
 }
 
+static __inline void
+hppa_disable_irq(void)
+{
+__asm volatile(rsm %0, %%r0 :: i (PSW_I) : memory);
+}
+
+static __inline void
+hppa_enable_irq(void)
+{
+__asm volatile(ssm %0, %%r0 :: i (PSW_I) : memory);
+}
+
 #ifdef _KERNEL
 extern int (*cpu_hpt_init)(vaddr_t, vsize_t);
 



CVS commit: src/sys/arch/hp700/hp700

2012-05-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May 21 08:14:58 UTC 2012

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

Log Message:
Use hppa_enable_irq


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/hp700/hp700/autoconf.c

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

Modified files:

Index: src/sys/arch/hp700/hp700/autoconf.c
diff -u src/sys/arch/hp700/hp700/autoconf.c:1.44 src/sys/arch/hp700/hp700/autoconf.c:1.45
--- src/sys/arch/hp700/hp700/autoconf.c:1.44	Sun Feb  5 08:31:53 2012
+++ src/sys/arch/hp700/hp700/autoconf.c	Mon May 21 08:14:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.44 2012/02/05 08:31:53 skrll Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.45 2012/05/21 08:14:58 skrll Exp $	*/
 
 /*	$OpenBSD: autoconf.c,v 1.15 2001/06/25 00:43:10 mickey Exp $	*/
 
@@ -86,7 +86,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.44 2012/02/05 08:31:53 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.45 2012/05/21 08:14:58 skrll Exp $);
 
 #include opt_kgdb.h
 #include opt_useleds.h
@@ -185,7 +185,7 @@ cpu_configure(void)
 
 	/* in spl*() we trust */
 	hp700_intr_init();
-	__asm volatile(ssm %0, %%r0 :: i (PSW_I));
+	hppa_enable_irq();
 	curcpu()-ci_psw |= PSW_I;
 	spl0();
 



CVS commit: src

2012-05-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 21 14:15:20 UTC 2012

Modified Files:
src/distrib/sets/lists/tests: mi
src/lib/libc/sys: _lwp_create.2
src/sys/arch/alpha/alpha: machdep.c
src/sys/arch/amd64/amd64: machdep.c netbsd32_machdep.c
process_machdep.c
src/sys/arch/amd64/include: mcontext.h
src/sys/arch/arm/arm: sig_machdep.c
src/sys/arch/hppa/hppa: hppa_machdep.c
src/sys/arch/i386/i386: machdep.c
src/sys/arch/m68k/m68k: sig_machdep.c
src/sys/arch/mips/mips: cpu_subr.c netbsd32_machdep.c
src/sys/arch/powerpc/powerpc: sig_machdep.c
src/sys/arch/sh3/sh3: sh3_machdep.c
src/sys/arch/sparc/sparc: machdep.c
src/sys/arch/sparc64/sparc64: machdep.c netbsd32_machdep.c
src/sys/arch/vax/vax: machdep.c
src/sys/compat/netbsd32: netbsd32_lwp.c
src/sys/compat/sys: ucontext.h
src/sys/kern: sys_lwp.c
src/sys/sys: lwp.h ucontext.h
src/tests/lib/libc/sys: Makefile
Added Files:
src/tests/lib/libc/sys: t_lwp_create.c

Log Message:
Calling _lwp_create() with a bogus ucontext could trigger a kernel
assertion failure (and thus a crash in DIAGNOSTIC kernels). Independently
discovered by YAMAMOTO Takashi and Joel Sing.

To avoid this, introduce a cpu_mcontext_validate() function and move all
sanity checks from cpu_setmcontext() there. Also untangle the netbsd32
compat mess slightly and add a cpu_mcontext32_validate() cousin there.

Add an exhaustive atf test case, based partly on code from Joel Sing.

Should finally fix the remaining open part of PR kern/43903.


To generate a diff of this commit:
cvs rdiff -u -r1.468 -r1.469 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/sys/_lwp_create.2
cvs rdiff -u -r1.338 -r1.339 src/sys/arch/alpha/alpha/machdep.c
cvs rdiff -u -r1.182 -r1.183 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/amd64/amd64/netbsd32_machdep.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/amd64/amd64/process_machdep.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/amd64/include/mcontext.h
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/arm/arm/sig_machdep.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/hppa/hppa/hppa_machdep.c
cvs rdiff -u -r1.726 -r1.727 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/m68k/m68k/sig_machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/mips/mips/cpu_subr.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mips/mips/netbsd32_machdep.c
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/powerpc/powerpc/sig_machdep.c
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/sh3/sh3/sh3_machdep.c
cvs rdiff -u -r1.318 -r1.319 src/sys/arch/sparc/sparc/machdep.c
cvs rdiff -u -r1.266 -r1.267 src/sys/arch/sparc64/sparc64/machdep.c
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/sparc64/sparc64/netbsd32_machdep.c
cvs rdiff -u -r1.187 -r1.188 src/sys/arch/vax/vax/machdep.c
cvs rdiff -u -r1.12 -r1.13 src/sys/compat/netbsd32/netbsd32_lwp.c
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/sys/ucontext.h
cvs rdiff -u -r1.53 -r1.54 src/sys/kern/sys_lwp.c
cvs rdiff -u -r1.160 -r1.161 src/sys/sys/lwp.h
cvs rdiff -u -r1.15 -r1.16 src/sys/sys/ucontext.h
cvs rdiff -u -r1.22 -r1.23 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/sys/t_lwp_create.c

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.468 src/distrib/sets/lists/tests/mi:1.469
--- src/distrib/sets/lists/tests/mi:1.468	Fri May 18 15:25:25 2012
+++ src/distrib/sets/lists/tests/mi	Mon May 21 14:15:16 2012
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.468 2012/05/18 15:25:25 jruoho Exp $
+# $NetBSD: mi,v 1.469 2012/05/21 14:15:16 martin Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -545,6 +545,7 @@
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_link.debug			tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_listen.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_lwp_ctl.debug		tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/sys/t_lwp_create.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_mincore.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_mkdir.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/sys/t_mkfifo.debug		tests-lib-debug		debug,atf
@@ -2444,6 +2445,7 @@
 ./usr/tests/lib/libc/sys/t_link			tests-lib-tests		atf
 ./usr/tests/lib/libc/sys/t_listen		tests-lib-tests		atf
 ./usr/tests/lib/libc/sys/t_lwp_ctl		tests-lib-tests		atf
+./usr/tests/lib/libc/sys/t_lwp_create		tests-lib-tests		atf
 ./usr/tests/lib/libc/sys/t_mincore		tests-lib-tests		atf
 ./usr/tests/lib/libc/sys/t_mkdir		tests-lib-tests		atf
 ./usr/tests/lib/libc/sys/t_mkfifo		tests-lib-tests		atf

Index: 

CVS commit: [netbsd-6] src

2012-05-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon May 21 15:25:59 UTC 2012

Modified Files:
src/distrib/sets/lists/tests [netbsd-6]: mi
src/lib/libc/sys [netbsd-6]: _lwp_create.2
src/sys/arch/alpha/alpha [netbsd-6]: machdep.c
src/sys/arch/amd64/amd64 [netbsd-6]: machdep.c netbsd32_machdep.c
process_machdep.c
src/sys/arch/amd64/include [netbsd-6]: mcontext.h
src/sys/arch/arm/arm [netbsd-6]: sig_machdep.c
src/sys/arch/hppa/hppa [netbsd-6]: hppa_machdep.c
src/sys/arch/i386/i386 [netbsd-6]: machdep.c
src/sys/arch/m68k/m68k [netbsd-6]: sig_machdep.c
src/sys/arch/mips/mips [netbsd-6]: cpu_subr.c netbsd32_machdep.c
src/sys/arch/powerpc/powerpc [netbsd-6]: sig_machdep.c
src/sys/arch/sh3/sh3 [netbsd-6]: sh3_machdep.c
src/sys/arch/sparc/sparc [netbsd-6]: machdep.c
src/sys/arch/sparc64/sparc64 [netbsd-6]: machdep.c netbsd32_machdep.c
src/sys/arch/vax/vax [netbsd-6]: machdep.c
src/sys/compat/netbsd32 [netbsd-6]: netbsd32_lwp.c
src/sys/compat/sys [netbsd-6]: ucontext.h
src/sys/kern [netbsd-6]: sys_lwp.c
src/sys/sys [netbsd-6]: lwp.h ucontext.h
src/tests/lib/libc/sys [netbsd-6]: Makefile
Added Files:
src/tests/lib/libc/sys [netbsd-6]: t_lwp_create.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #274):
sys/arch/amd64/amd64/process_machdep.c: revision 1.20
sys/kern/sys_lwp.c: revision 1.54
sys/arch/sparc64/sparc64/machdep.c: revision 1.267
sys/arch/mips/mips/cpu_subr.c: revision 1.16
sys/arch/vax/vax/machdep.c: revision 1.188
sys/sys/lwp.h: revision 1.161
sys/arch/sparc64/sparc64/netbsd32_machdep.c: revision 1.98
sys/arch/alpha/alpha/machdep.c: revision 1.339
sys/compat/sys/ucontext.h: revision 1.6
sys/arch/hppa/hppa/hppa_machdep.c: revision 1.28
distrib/sets/lists/tests/mi: revision 1.469
sys/arch/powerpc/powerpc/sig_machdep.c: revision 1.42
tests/lib/libc/sys/t_lwp_create.c: revision 1.1
tests/lib/libc/sys/Makefile: revision 1.23
sys/arch/arm/arm/sig_machdep.c: revision 1.42
sys/arch/amd64/include/mcontext.h: revision 1.15
sys/arch/amd64/amd64/machdep.c: revision 1.183
sys/arch/sh3/sh3/sh3_machdep.c: revision 1.99
sys/arch/i386/i386/machdep.c: revision 1.727
sys/compat/netbsd32/netbsd32_lwp.c: revision 1.13
sys/arch/sparc/sparc/machdep.c: revision 1.319
sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.76
sys/arch/m68k/m68k/sig_machdep.c: revision 1.49
sys/sys/ucontext.h: revision 1.16
sys/arch/mips/mips/netbsd32_machdep.c: revision 1.9
lib/libc/sys/_lwp_create.2: revision 1.5
Calling _lwp_create() with a bogus ucontext could trigger a kernel
assertion failure (and thus a crash in DIAGNOSTIC kernels). Independently
discovered by YAMAMOTO Takashi and Joel Sing.
To avoid this, introduce a cpu_mcontext_validate() function and move all
sanity checks from cpu_setmcontext() there. Also untangle the netbsd32
compat mess slightly and add a cpu_mcontext32_validate() cousin there.
Add an exhaustive atf test case, based partly on code from Joel Sing.
Should finally fix the remaining open part of PR kern/43903.


To generate a diff of this commit:
cvs rdiff -u -r1.439 -r1.439.2.1 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.4 -r1.4.24.1 src/lib/libc/sys/_lwp_create.2
cvs rdiff -u -r1.337 -r1.337.2.1 src/sys/arch/alpha/alpha/machdep.c
cvs rdiff -u -r1.175.2.4 -r1.175.2.5 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.74 -r1.74.10.1 src/sys/arch/amd64/amd64/netbsd32_machdep.c
cvs rdiff -u -r1.19 -r1.19.2.1 src/sys/arch/amd64/amd64/process_machdep.c
cvs rdiff -u -r1.14 -r1.14.10.1 src/sys/arch/amd64/include/mcontext.h
cvs rdiff -u -r1.41 -r1.41.2.1 src/sys/arch/arm/arm/sig_machdep.c
cvs rdiff -u -r1.26 -r1.26.2.1 src/sys/arch/hppa/hppa/hppa_machdep.c
cvs rdiff -u -r1.717.2.6 -r1.717.2.7 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.47 -r1.47.2.1 src/sys/arch/m68k/m68k/sig_machdep.c
cvs rdiff -u -r1.14 -r1.14.8.1 src/sys/arch/mips/mips/cpu_subr.c
cvs rdiff -u -r1.7 -r1.7.10.1 src/sys/arch/mips/mips/netbsd32_machdep.c
cvs rdiff -u -r1.41 -r1.41.8.1 src/sys/arch/powerpc/powerpc/sig_machdep.c
cvs rdiff -u -r1.97 -r1.97.2.1 src/sys/arch/sh3/sh3/sh3_machdep.c
cvs rdiff -u -r1.316 -r1.316.2.1 src/sys/arch/sparc/sparc/machdep.c
cvs rdiff -u -r1.265 -r1.265.2.1 src/sys/arch/sparc64/sparc64/machdep.c
cvs rdiff -u -r1.96 -r1.96.2.1 \
src/sys/arch/sparc64/sparc64/netbsd32_machdep.c
cvs rdiff -u -r1.185 -r1.185.2.1 src/sys/arch/vax/vax/machdep.c
cvs rdiff -u -r1.12 -r1.12.10.1 src/sys/compat/netbsd32/netbsd32_lwp.c
cvs rdiff -u -r1.4 -r1.4.10.1 src/sys/compat/sys/ucontext.h
cvs rdiff -u -r1.52 -r1.52.14.1 src/sys/kern/sys_lwp.c
cvs rdiff -u -r1.159 -r1.159.2.1 src/sys/sys/lwp.h
cvs rdiff -u -r1.13 -r1.13.10.1 

CVS commit: [netbsd-6] src/doc

2012-05-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon May 21 15:26:34 UTC 2012

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

Log Message:
Ticket 274.


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

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

Modified files:

Index: src/doc/CHANGES-6.0
diff -u src/doc/CHANGES-6.0:1.1.2.104 src/doc/CHANGES-6.0:1.1.2.105
--- src/doc/CHANGES-6.0:1.1.2.104	Sat May 19 17:33:09 2012
+++ src/doc/CHANGES-6.0	Mon May 21 15:26:33 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0,v 1.1.2.104 2012/05/19 17:33:09 riz Exp $
+# $NetBSD: CHANGES-6.0,v 1.1.2.105 2012/05/21 15:26:33 riz Exp $
 
 A complete list of changes from the initial NetBSD 6.0 branch on 15 Feb 2012
 until the 6.0 release:
@@ -2496,3 +2496,34 @@ usr.bin/login/common.h1.4 via patch
 	Fix clang build.
 	[christos, ticket #271]
 
+distrib/sets/lists/tests/mi			1.469 via patch
+lib/libc/sys/_lwp_create.2			1.5
+sys/arch/alpha/alpha/machdep.c			1.339
+sys/arch/amd64/amd64/machdep.c			1.183
+sys/arch/amd64/amd64/netbsd32_machdep.c		1.76
+sys/arch/amd64/amd64/process_machdep.c		1.20
+sys/arch/amd64/include/mcontext.h		1.15
+sys/arch/arm/arm/sig_machdep.c			1.42
+sys/arch/hppa/hppa/hppa_machdep.c		1.28
+sys/arch/i386/i386/machdep.c			1.727
+sys/arch/m68k/m68k/sig_machdep.c		1.49
+sys/arch/mips/mips/cpu_subr.c			1.16
+sys/arch/mips/mips/netbsd32_machdep.c		1.9
+sys/arch/powerpc/powerpc/sig_machdep.c		1.42
+sys/arch/sh3/sh3/sh3_machdep.c			1.99
+sys/arch/sparc/sparc/machdep.c			1.319
+sys/arch/sparc64/sparc64/machdep.c		1.267
+sys/arch/sparc64/sparc64/netbsd32_machdep.c	1.98
+sys/arch/vax/vax/machdep.c			1.188
+sys/compat/netbsd32/netbsd32_lwp.c		1.13
+sys/compat/sys/ucontext.h			1.6
+sys/kern/sys_lwp.c1.54 via patch
+sys/sys/lwp.h	1.161
+sys/sys/ucontext.h1.16
+tests/lib/libc/sys/Makefile			1.23 via patch
+tests/lib/libc/sys/t_lwp_create.c		1.1
+
+	Avoid KASSERT when calling _lwp_create() with bogus context.
+	PR#43903.
+	[martin, ticket #274]
+



CVS commit: [netbsd-6] src/sys

2012-05-21 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Mon May 21 16:49:54 UTC 2012

Modified Files:
src/sys/dev [netbsd-6]: rndpseudo.c
src/sys/kern [netbsd-6]: subr_cprng.c

Log Message:
Pull up:

  revision 1.10 src/sys/dev/rndpseudo.c
  revision 1.9  src/sys/kern/subr_cprng.c

(requested by tls in ticket 274).

  Fix two problems that could cause /dev/random to not wake up readers when
  entropy became available.


To generate a diff of this commit:
cvs rdiff -u -r1.6.2.2 -r1.6.2.3 src/sys/dev/rndpseudo.c
cvs rdiff -u -r1.5.2.2 -r1.5.2.3 src/sys/kern/subr_cprng.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/rndpseudo.c
diff -u src/sys/dev/rndpseudo.c:1.6.2.2 src/sys/dev/rndpseudo.c:1.6.2.3
--- src/sys/dev/rndpseudo.c:1.6.2.2	Fri Apr 20 23:35:20 2012
+++ src/sys/dev/rndpseudo.c	Mon May 21 16:49:54 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: rndpseudo.c,v 1.6.2.2 2012/04/20 23:35:20 riz Exp $	*/
+/*	$NetBSD: rndpseudo.c,v 1.6.2.3 2012/05/21 16:49:54 jdc Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rndpseudo.c,v 1.6.2.2 2012/04/20 23:35:20 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: rndpseudo.c,v 1.6.2.3 2012/05/21 16:49:54 jdc Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_compat_netbsd.h
@@ -309,14 +309,23 @@ rnd_read(struct file * fp, off_t *offp, 
 		/* XXX is this _really_ what's wanted? */
 		if (ctx-hard) {
 			n = MIN(want, strength - ctx-bytesonkey);
-			ctx-bytesonkey += n;
+			if (n  1) {
+			cprng_strong_deplete(cprng);
+			n = MIN(want, strength);
+			ctx-bytesonkey = 0;
+			membar_producer();
+			}
 		} else {
 			n = want;
 		}
 
 		nread = cprng_strong(cprng, bf, n,
  (fp-f_flag  FNONBLOCK) ? FNONBLOCK : 0);
-		if (nread != n) {
+
+		if (ctx-hard  nread  0) {
+			atomic_add_int(ctx-bytesonkey, nread);
+		}
+		if (nread  1) {
 			if (fp-f_flag  FNONBLOCK) {
 ret = EWOULDBLOCK;
 			} else {
@@ -331,12 +340,6 @@ rnd_read(struct file * fp, off_t *offp, 
 		}
 	}
 out:
-	if (ctx-bytesonkey = strength) {
-		/* Force reseed of underlying DRBG (prediction resistance) */
-		cprng_strong_deplete(cprng);
-		ctx-bytesonkey = 0;
-	}
-
 	pool_cache_put(rp_pc, bf);
 	return (ret);
 }

Index: src/sys/kern/subr_cprng.c
diff -u src/sys/kern/subr_cprng.c:1.5.2.2 src/sys/kern/subr_cprng.c:1.5.2.3
--- src/sys/kern/subr_cprng.c:1.5.2.2	Fri Apr 20 23:35:20 2012
+++ src/sys/kern/subr_cprng.c	Mon May 21 16:49:54 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_cprng.c,v 1.5.2.2 2012/04/20 23:35:20 riz Exp $ */
+/*	$NetBSD: subr_cprng.c,v 1.5.2.3 2012/05/21 16:49:54 jdc Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
 
 #include sys/cprng.h
 
-__KERNEL_RCSID(0, $NetBSD: subr_cprng.c,v 1.5.2.2 2012/04/20 23:35:20 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_cprng.c,v 1.5.2.3 2012/05/21 16:49:54 jdc Exp $);
 
 void
 cprng_init(void)
@@ -144,6 +144,9 @@ cprng_strong_reseed(void *const arg)
 #ifdef RND_VERBOSE
 	printf(cprng: sink %s cprng busy, no reseed\n, c-reseed.name);
 #endif
+	if (c-flags  CPRNG_USE_CV) {	/* XXX if flags change? */
+	cv_broadcast(c-cv);
+	}
 	return;
 	}
 
@@ -240,23 +243,32 @@ cprng_strong(cprng_strong_t *const c, vo
   failed., c-name);
 			}
 		} else {
-			if (!(flags  FNONBLOCK)  
-			 (c-flags  CPRNG_USE_CV)) {
-int wr;
+			int wr;
 
+			do {
 cprng_strong_sched_reseed(c);
-do {
-	wr = cv_wait_sig(c-cv, c-mtx);
-	if (wr == ERESTART) {
-		mutex_exit(c-mtx);
-		return 0;
-	}
-} while (nist_ctr_drbg_generate(c-drbg, p,
-len, cc,
-sizeof(cc)));
-			} else {
-len = 0;
-			}
+if ((flags  FNONBLOCK) ||
+!(c-flags  CPRNG_USE_CV)) {
+	len = 0;
+	break;
+}
+			/*
+			 * XXX There's a race with the cv_broadcast
+			 * XXX in cprng_strong_sched_reseed, because
+			 * XXX of the use of tryenter in that function.
+			 * XXX This timedwait hack works around it,
+			 * XXX at the expense of occasionaly polling
+			 * XXX for success on a /dev/random rekey.
+			 */
+wr = cv_timedwait_sig(c-cv, c-mtx,
+		  mstohz(100));
+if (wr == ERESTART) {
+	mutex_exit(c-mtx);
+	return 0;
+}
+			} while (nist_ctr_drbg_generate(c-drbg, p,
+			len, cc,
+			sizeof(cc)));
 		}
 	}
 



CVS commit: [netbsd-6] src/doc

2012-05-21 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Mon May 21 16:50:28 UTC 2012

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

Log Message:
Ticket 273.


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

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

Modified files:

Index: src/doc/CHANGES-6.0
diff -u src/doc/CHANGES-6.0:1.1.2.105 src/doc/CHANGES-6.0:1.1.2.106
--- src/doc/CHANGES-6.0:1.1.2.105	Mon May 21 15:26:33 2012
+++ src/doc/CHANGES-6.0	Mon May 21 16:50:28 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0,v 1.1.2.105 2012/05/21 15:26:33 riz Exp $
+# $NetBSD: CHANGES-6.0,v 1.1.2.106 2012/05/21 16:50:28 jdc Exp $
 
 A complete list of changes from the initial NetBSD 6.0 branch on 15 Feb 2012
 until the 6.0 release:
@@ -2527,3 +2527,9 @@ tests/lib/libc/sys/t_lwp_create.c		1.1
 	PR#43903.
 	[martin, ticket #274]
 
+sys/dev/rndpseudo.c1.10
+sys/kern/subr_cprng.c1.9
+
+	Fix two problems that could cause /dev/random to not wake up readers
+	when entropy became available.
+	[tls, ticket #273]



CVS commit: [netbsd-5] src/libexec/ld.elf_so/arch/hppa

2012-05-21 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Mon May 21 20:27:08 UTC 2012

Modified Files:
src/libexec/ld.elf_so/arch/hppa [netbsd-5]: hppa_reloc.c

Log Message:
libexec/ld.elf_so/arch/hppa/hppa_reloc.cpatch

Fix hppa problem introduced by ticket #1724.
[skrll, ticket #1761]


To generate a diff of this commit:
cvs rdiff -u -r1.27.4.2 -r1.27.4.3 \
src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c

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

Modified files:

Index: src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c
diff -u src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c:1.27.4.2 src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c:1.27.4.3
--- src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c:1.27.4.2	Fri Mar 30 19:23:35 2012
+++ src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c	Mon May 21 20:27:08 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: hppa_reloc.c,v 1.27.4.2 2012/03/30 19:23:35 bouyer Exp $	*/
+/*	$NetBSD: hppa_reloc.c,v 1.27.4.3 2012/05/21 20:27:08 jdc Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2004 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: hppa_reloc.c,v 1.27.4.2 2012/03/30 19:23:35 bouyer Exp $);
+__RCSID($NetBSD: hppa_reloc.c,v 1.27.4.3 2012/05/21 20:27:08 jdc Exp $);
 #endif /* not lint */
 
 #include stdlib.h
@@ -117,7 +117,7 @@ static SLIST_HEAD(hppa_plabel_head, _hpp
  * Because I'm hesitant to use NEW while relocating self,
  * this is a small pool of preallocated PLABELs.
  */
-#define	HPPA_PLABEL_PRE	(12)
+#define	HPPA_PLABEL_PRE	(32)
 static hppa_plabel hppa_plabel_pre[HPPA_PLABEL_PRE];
 static int hppa_plabel_pre_next = 0;
 



CVS commit: [netbsd-5] src/doc

2012-05-21 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Mon May 21 20:27:58 UTC 2012

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2

Log Message:
Ticket 1761.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.166 -r1.1.2.167 src/doc/CHANGES-5.2

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-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.166 src/doc/CHANGES-5.2:1.1.2.167
--- src/doc/CHANGES-5.2:1.1.2.166	Sun May 20 17:32:55 2012
+++ src/doc/CHANGES-5.2	Mon May 21 20:27:57 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.166 2012/05/20 17:32:55 riz Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.167 2012/05/21 20:27:57 jdc Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -6397,3 +6397,8 @@ usr.bin/pmap/pmap.hpatch
 	Fix build problem introduced by ticket #1759.
 	[jdc, ticket #1760]
 
+libexec/ld.elf_so/arch/hppa/hppa_reloc.c	patch
+
+	Fix hppa problem introduced by ticket #1724.
+	[skrll, ticket #1761]
+



CVS commit: src/sys/dev/ic

2012-05-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May 21 20:51:46 UTC 2012

Modified Files:
src/sys/dev/ic: com.c

Log Message:
Remove empty line.


To generate a diff of this commit:
cvs rdiff -u -r1.305 -r1.306 src/sys/dev/ic/com.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/com.c
diff -u src/sys/dev/ic/com.c:1.305 src/sys/dev/ic/com.c:1.306
--- src/sys/dev/ic/com.c:1.305	Sun Apr 22 16:00:45 2012
+++ src/sys/dev/ic/com.c	Mon May 21 20:51:46 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.305 2012/04/22 16:00:45 christos Exp $ */
+/* $NetBSD: com.c,v 1.306 2012/05/21 20:51:46 skrll Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: com.c,v 1.305 2012/04/22 16:00:45 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: com.c,v 1.306 2012/05/21 20:51:46 skrll Exp $);
 
 #include opt_com.h
 #include opt_ddb.h
@@ -788,7 +788,6 @@ comopen(dev_t dev, int flag, int mode, s
 
 		tp-t_dev = dev;
 
-
 		if (sc-enable) {
 			if ((*sc-enable)(sc)) {
 splx(s);



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

2012-05-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May 21 20:58:39 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: apic.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hp700/dev/apic.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/hp700/dev/apic.c
diff -u src/sys/arch/hp700/dev/apic.c:1.14 src/sys/arch/hp700/dev/apic.c:1.15
--- src/sys/arch/hp700/dev/apic.c:1.14	Sat Apr 14 10:43:19 2012
+++ src/sys/arch/hp700/dev/apic.c	Mon May 21 20:58:39 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: apic.c,v 1.14 2012/04/14 10:43:19 skrll Exp $	*/
+/*	$NetBSD: apic.c,v 1.15 2012/05/21 20:58:39 skrll Exp $	*/
 
 /*	$OpenBSD: apic.c,v 1.14 2011/05/01 21:59:39 kettenis Exp $	*/
 
@@ -141,7 +141,8 @@ apic_intr_map(const struct pci_attach_ar
 	if (sc-sc_irq[line] == 0)
 		sc-sc_irq[line] = hp700_intr_allocate_bit(ir_cpu);
 	*ihp = (line  APIC_INT_LINE_SHIFT) | sc-sc_irq[line];
-	return (APIC_INT_IRQ(*ihp) == 0);
+
+	return APIC_INT_IRQ(*ihp) == 0;
 }
 
 const char *
@@ -152,7 +153,7 @@ apic_intr_string(void *v, pci_intr_handl
 	snprintf(buf, sizeof(buf), line %ld irq %ld,
 	APIC_INT_LINE(ih), APIC_INT_IRQ(ih));
 
-	return (buf);
+	return buf;
 }
 
 void *
@@ -172,7 +173,7 @@ apic_intr_establish(void *v, pci_intr_ha
 
 	/* no mapping or bogus */
 	if (irq = 0 || irq  31)
-		return (NULL);
+		return NULL;
 
 	aiv = malloc(sizeof(struct apic_iv), M_DEVBUF, M_NOWAIT);
 	if (aiv == NULL)
@@ -234,7 +235,7 @@ apic_intr_establish(void *v, pci_intr_ha
 
 	apic_intr_list[irq] = aiv;
 
-	return (arg);
+	return arg;
 }
 
 void
@@ -262,7 +263,7 @@ apic_intr(void *v)
 	/* Signal EOI. */
 	elroy_write32(r-apic_eoi, htole32((31 - irq)  APIC_ENT0_VEC));
 
-	return (claimed);
+	return claimed;
 }
 
 void



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

2012-05-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May 21 21:15:39 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: cpu.c

Log Message:
Unwrap a line.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hp700/dev/cpu.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/hp700/dev/cpu.c
diff -u src/sys/arch/hp700/dev/cpu.c:1.23 src/sys/arch/hp700/dev/cpu.c:1.24
--- src/sys/arch/hp700/dev/cpu.c:1.23	Fri Apr  6 12:21:58 2012
+++ src/sys/arch/hp700/dev/cpu.c	Mon May 21 21:15:39 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.23 2012/04/06 12:21:58 skrll Exp $	*/
+/*	$NetBSD: cpu.c,v 1.24 2012/05/21 21:15:39 skrll Exp $	*/
 
 /*	$OpenBSD: cpu.c,v 1.29 2009/02/08 18:33:28 miod Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.23 2012/04/06 12:21:58 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.24 2012/05/21 21:15:39 skrll Exp $);
 
 #include opt_multiprocessor.h
 
@@ -168,8 +168,7 @@ cpuattach(device_t parent, device_t self
 
 	/* Allocate stack for spin up and FPU emulation. */
 	TAILQ_INIT(mlist);
-	error = uvm_pglistalloc(PAGE_SIZE, 0, -1L, PAGE_SIZE, 0, mlist, 1,
-	0);
+	error = uvm_pglistalloc(PAGE_SIZE, 0, -1L, PAGE_SIZE, 0, mlist, 1, 0);
 
 	if (error) {
 		aprint_error(: unable to allocate CPU stack!\n);



CVS commit: src/sys

2012-05-21 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Mon May 21 21:34:16 UTC 2012

Modified Files:
src/sys/arch/i386/stand/lib: exec.c
src/sys/arch/sandpoint/stand/altboot: main.c
src/sys/lib/libsa: ext2fs.c ffsv1.c ffsv2.c globals.c lfsv1.c lfsv2.c
stand.h ufs.c

Log Message:
Remove the code that tries to load the ffs kernel module during boot.
This is in line with the core decision than even modular kernels should
  contain the ffs code.
I've left in the code that tries to load nfs and ext2fs, but it
  isn't clear that is necessary.
Removes a warning message that (usually) flashes past to fast to read.
AFAICT all the relevant kernels contain ffs (and nfs for that matter).


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/i386/stand/lib/exec.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/sandpoint/stand/altboot/main.c
cvs rdiff -u -r1.12 -r1.13 src/sys/lib/libsa/ext2fs.c
cvs rdiff -u -r1.5 -r1.6 src/sys/lib/libsa/ffsv1.c src/sys/lib/libsa/ffsv2.c
cvs rdiff -u -r1.8 -r1.9 src/sys/lib/libsa/globals.c
cvs rdiff -u -r1.4 -r1.5 src/sys/lib/libsa/lfsv1.c src/sys/lib/libsa/lfsv2.c
cvs rdiff -u -r1.75 -r1.76 src/sys/lib/libsa/stand.h
cvs rdiff -u -r1.57 -r1.58 src/sys/lib/libsa/ufs.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/stand/lib/exec.c
diff -u src/sys/arch/i386/stand/lib/exec.c:1.49 src/sys/arch/i386/stand/lib/exec.c:1.50
--- src/sys/arch/i386/stand/lib/exec.c:1.49	Mon Nov 28 07:56:54 2011
+++ src/sys/arch/i386/stand/lib/exec.c	Mon May 21 21:34:16 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec.c,v 1.49 2011/11/28 07:56:54 tls Exp $	 */
+/*	$NetBSD: exec.c,v 1.50 2012/05/21 21:34:16 dsl Exp $	 */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -297,10 +297,9 @@ common_load_kernel(const char *file, u_l
 
 	close(fd);
 
-	/* Now we know the root fs type, load modules for it. */
-	module_add(fsmod);
-	if (fsmod2 != NULL  strcmp(fsmod, fsmod2) != 0)
-		module_add(fsmod2);
+	/* If the root fs type is unusual, load its module. */
+	if (fsmod != NULL)
+		module_add(fsmod);
 
 	/*
 	 * Gather some information for the kernel. Do this after the

Index: src/sys/arch/sandpoint/stand/altboot/main.c
diff -u src/sys/arch/sandpoint/stand/altboot/main.c:1.20 src/sys/arch/sandpoint/stand/altboot/main.c:1.21
--- src/sys/arch/sandpoint/stand/altboot/main.c:1.20	Fri Apr 27 00:35:43 2012
+++ src/sys/arch/sandpoint/stand/altboot/main.c	Mon May 21 21:34:16 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.20 2012/04/27 00:35:43 nisimura Exp $ */
+/* $NetBSD: main.c,v 1.21 2012/05/21 21:34:16 dsl Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -353,9 +353,8 @@ main(int argc, char *argv[], char *boota
 		}
 
 		if (modules_enabled) {
-			module_add(fsmod);
-			if (fsmod2 != NULL  strcmp(fsmod, fsmod2) != 0)
-module_add(fsmod2);
+			if (fsmod != NULL)
+module_add(fsmod);
 			kmodloadp = marks[MARK_END];
 			btinfo_modulelist = NULL;
 			module_load(bname);

Index: src/sys/lib/libsa/ext2fs.c
diff -u src/sys/lib/libsa/ext2fs.c:1.12 src/sys/lib/libsa/ext2fs.c:1.13
--- src/sys/lib/libsa/ext2fs.c:1.12	Mon Jan 16 18:44:13 2012
+++ src/sys/lib/libsa/ext2fs.c	Mon May 21 21:34:16 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ext2fs.c,v 1.12 2012/01/16 18:44:13 christos Exp $	*/
+/*	$NetBSD: ext2fs.c,v 1.13 2012/05/21 21:34:16 dsl Exp $	*/
 
 /*
  * Copyright (c) 1997 Manuel Bouyer.
@@ -713,10 +713,8 @@ ext2fs_open(const char *path, struct ope
 out:
 	if (rc)
 		ext2fs_close(f);
-	else {
+	else
 		fsmod = ext2fs;
-		fsmod2 = ffs;
-	}
 	return rc;
 }
 

Index: src/sys/lib/libsa/ffsv1.c
diff -u src/sys/lib/libsa/ffsv1.c:1.5 src/sys/lib/libsa/ffsv1.c:1.6
--- src/sys/lib/libsa/ffsv1.c:1.5	Sun Dec 25 06:09:08 2011
+++ src/sys/lib/libsa/ffsv1.c	Mon May 21 21:34:16 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: ffsv1.c,v 1.5 2011/12/25 06:09:08 tsutsui Exp $ */
+/* $NetBSD: ffsv1.c,v 1.6 2012/05/21 21:34:16 dsl Exp $ */
 
 #define LIBSA_FFSv1
 
@@ -15,6 +15,4 @@
 #define ufs_dinode	ufs1_dinode
 #define indp_t		int32_t
 
-#define	FSMOD		ffs
-
 #include ufs.c
Index: src/sys/lib/libsa/ffsv2.c
diff -u src/sys/lib/libsa/ffsv2.c:1.5 src/sys/lib/libsa/ffsv2.c:1.6
--- src/sys/lib/libsa/ffsv2.c:1.5	Sun Dec 25 06:09:08 2011
+++ src/sys/lib/libsa/ffsv2.c	Mon May 21 21:34:16 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: ffsv2.c,v 1.5 2011/12/25 06:09:08 tsutsui Exp $ */
+/* $NetBSD: ffsv2.c,v 1.6 2012/05/21 21:34:16 dsl Exp $ */
 
 #define LIBSA_FFSv2
 
@@ -15,6 +15,4 @@
 #define ufs_dinode	ufs2_dinode
 #define indp_t		int64_t
 
-#define	FSMOD		ffs
-
 #include ufs.c

Index: src/sys/lib/libsa/globals.c
diff -u src/sys/lib/libsa/globals.c:1.8 src/sys/lib/libsa/globals.c:1.9
--- src/sys/lib/libsa/globals.c:1.8	Wed Nov 19 12:36:41 2008
+++ src/sys/lib/libsa/globals.c	Mon May 21 21:34:16 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: globals.c,v 1.8 2008/11/19 12:36:41 ad Exp $	*/
+/*	$NetBSD: globals.c,v 1.9 

CVS commit: src/distrib/utils/sysinst

2012-05-21 Thread Julian Fagir
Module Name:src
Committed By:   jdf
Date:   Mon May 21 22:38:26 UTC 2012

Modified Files:
src/distrib/utils/sysinst: disks.c msg.mi.de msg.mi.en msg.mi.es
msg.mi.fr msg.mi.pl

Log Message:
Changed returncodes to -1 of mount_disks in case of error (before, they were
inverted).
Add message mount_failed to be displayed when a mount fails, offering the
opportunity to go on anyway (fix for PR install/12020).


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/distrib/utils/sysinst/disks.c
cvs rdiff -u -r1.67 -r1.68 src/distrib/utils/sysinst/msg.mi.de
cvs rdiff -u -r1.172 -r1.173 src/distrib/utils/sysinst/msg.mi.en
cvs rdiff -u -r1.43 -r1.44 src/distrib/utils/sysinst/msg.mi.es
cvs rdiff -u -r1.126 -r1.127 src/distrib/utils/sysinst/msg.mi.fr
cvs rdiff -u -r1.83 -r1.84 src/distrib/utils/sysinst/msg.mi.pl

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

Modified files:

Index: src/distrib/utils/sysinst/disks.c
diff -u src/distrib/utils/sysinst/disks.c:1.123 src/distrib/utils/sysinst/disks.c:1.124
--- src/distrib/utils/sysinst/disks.c:1.123	Mon Jan  9 01:51:47 2012
+++ src/distrib/utils/sysinst/disks.c	Mon May 21 22:38:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.123 2012/01/09 01:51:47 riz Exp $ */
+/*	$NetBSD: disks.c,v 1.124 2012/05/21 22:38:26 jdf Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -805,8 +805,12 @@ foundffs(struct data *list, size_t num)
 		return error;
 
 	error = target_mount(, list[0].u.s_val, ' '-'a', list[1].u.s_val);
-	if (error != 0)
-		return error;
+	if (error != 0) {
+		msg_display(MSG_mount_failed, list[0].u.s_val);
+		process_menu(MENU_noyes, NULL);
+		if (!yesno)
+			return error;
+	}
 	return 0;
 }
 
@@ -854,7 +858,9 @@ fsck_preen(const char *disk, int ptn, co
 	free(prog);
 	if (error != 0) {
 		msg_display(MSG_badfs, disk, ptn, error);
-		process_menu(MENU_ok, NULL);
+		process_menu(MENU_noyes, NULL);
+		if (yesno)
+			error = 0;
 		/* XXX at this point maybe we should run a full fsck? */
 	}
 	return error;
@@ -966,7 +972,7 @@ mount_disks(void)
 	else {
 		error = mount_root();
 		if (error != 0  error != EBUSY)
-			return 0;
+			return -1;
 	}
 
 	/* Check the target /etc/fstab exists before trying to parse it. */
@@ -974,7 +980,7 @@ mount_disks(void)
 	target_file_exists_p(/etc/fstab) == 0) {
 		msg_display(MSG_noetcfstab, diskdev);
 		process_menu(MENU_ok, NULL);
-		return 0;
+		return -1;
 	}
 
 
@@ -984,7 +990,7 @@ mount_disks(void)
 		/* error ! */
 		msg_display(MSG_badetcfstab, diskdev);
 		process_menu(MENU_ok, NULL);
-		return 0;
+		return -1;
 	}
 	error = walk(fstab, (size_t)fstabsize, fstabbuf, numfstabbuf);
 	free(fstab);

Index: src/distrib/utils/sysinst/msg.mi.de
diff -u src/distrib/utils/sysinst/msg.mi.de:1.67 src/distrib/utils/sysinst/msg.mi.de:1.68
--- src/distrib/utils/sysinst/msg.mi.de:1.67	Mon Apr 30 19:49:26 2012
+++ src/distrib/utils/sysinst/msg.mi.de	Mon May 21 22:38:25 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.de,v 1.67 2012/04/30 19:49:26 martin Exp $	*/
+/*	$NetBSD: msg.mi.de,v 1.68 2012/05/21 22:38:25 jdf Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -124,6 +124,9 @@ Wollen Sie die NetBSD Distributionssets 
 überschrieben werden!)
 }
 
+message mount_failed
+{Versuch, %s zu mounten ist fehlgeschlagen. Fortfahren?
+}
 
 message nodisk
 {Ich kann keine für NetBSD nutzbaren Festplatten finden.
@@ -711,9 +714,9 @@ message makedev
 
 message badfs
 {Das Dateisystem auf /dev/%s%c scheint kein BSD-Dateisystem zu sein,
-die Prüfung des Dateisystems (fsck) ist fehlgeschlagen.
+die Prüfung des Dateisystems (fsck) ist fehlgeschlagen (Fehler %d).
 
-Die Aktualisierung wird abgebrochen. (Fehlernummer %d.)
+Die Aktualisierung trotzdem fortsetzen?
 }
 
 message rootmissing

Index: src/distrib/utils/sysinst/msg.mi.en
diff -u src/distrib/utils/sysinst/msg.mi.en:1.172 src/distrib/utils/sysinst/msg.mi.en:1.173
--- src/distrib/utils/sysinst/msg.mi.en:1.172	Fri Apr  6 23:48:53 2012
+++ src/distrib/utils/sysinst/msg.mi.en	Mon May 21 22:38:25 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.en,v 1.172 2012/04/06 23:48:53 riz Exp $	*/
+/*	$NetBSD: msg.mi.en,v 1.173 2012/05/21 22:38:25 jdf Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -117,6 +117,9 @@ Do you really want to reinstall NetBSD d
 disks.)
 }
 
+message mount_failed
+{Mounting %s failed. Continue?
+}
 
 message nodisk
 {I can not find any hard disks for use by NetBSD.  You will be
@@ -680,7 +683,7 @@ message makedev
 
 message badfs
 {It appears that /dev/%s%c is not a BSD file system or the fsck was
-not successful.  The upgrade has been aborted.  (Error number %d.)
+not successful.  Try mounting it anyway?  (Error number %d.)
 }
 
 message rootmissing

Index: src/distrib/utils/sysinst/msg.mi.es
diff -u src/distrib/utils/sysinst/msg.mi.es:1.43 src/distrib/utils/sysinst/msg.mi.es:1.44
--- src/distrib/utils/sysinst/msg.mi.es:1.43	Fri 

CVS commit: src/sys

2012-05-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 22 02:40:06 UTC 2012

Modified Files:
src/sys/kern: exec_elf.c
src/sys/sys: exec_elf.h

Log Message:
- Recognize the SuSE ABI note.
- Restructure the code to do the checking in the appropriate note type,
and harmonize all the checks to be positive.
- Print only the tag data being careful not to overrun the allocated buffer.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/kern/exec_elf.c
cvs rdiff -u -r1.122 -r1.123 src/sys/sys/exec_elf.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/kern/exec_elf.c
diff -u src/sys/kern/exec_elf.c:1.38 src/sys/kern/exec_elf.c:1.39
--- src/sys/kern/exec_elf.c:1.38	Sun Apr  8 07:27:44 2012
+++ src/sys/kern/exec_elf.c	Mon May 21 22:40:05 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_elf.c,v 1.38 2012/04/08 11:27:44 martin Exp $	*/
+/*	$NetBSD: exec_elf.c,v 1.39 2012/05/22 02:40:05 christos Exp $	*/
 
 /*-
  * Copyright (c) 1994, 2000, 2005 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(1, $NetBSD: exec_elf.c,v 1.38 2012/04/08 11:27:44 martin Exp $);
+__KERNEL_RCSID(1, $NetBSD: exec_elf.c,v 1.39 2012/05/22 02:40:05 christos Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_pax.h
@@ -891,15 +891,40 @@ netbsd_elf_signature(struct lwp *l, stru
 			continue;
 
 		ndata = (char *)(np + 1);
+		unsigned int maxlen = (unsigned int)(shp-sh_size -
+		((char *)ndata - (char *)np));
+		if (maxlen  np-n_namesz)
+			goto bad;
 		switch (np-n_type) {
 		case ELF_NOTE_TYPE_NETBSD_TAG:
-			if (np-n_namesz != ELF_NOTE_NETBSD_NAMESZ ||
-			np-n_descsz != ELF_NOTE_NETBSD_DESCSZ ||
+			/*
+			 * It is us
+			 */
+			if (np-n_namesz == ELF_NOTE_NETBSD_NAMESZ 
+			np-n_descsz == ELF_NOTE_NETBSD_DESCSZ 
 			memcmp(ndata, ELF_NOTE_NETBSD_NAME,
-			ELF_NOTE_NETBSD_NAMESZ))
-goto bad;
-			isnetbsd = 1;
-			break;
+			ELF_NOTE_NETBSD_NAMESZ) == 0) {
+isnetbsd = 1;
+break;
+			}
+			/*
+			 * Ignore GNU tags
+			 */
+			if (np-n_namesz == ELF_NOTE_GNU_NAMESZ 
+			memcmp(ndata, ELF_NOTE_GNU_NAME,
+			ELF_NOTE_GNU_NAMESZ) == 0)
+break;
+			/*
+			 * Ignore SuSE tags
+			 */
+			if (np-n_namesz == ELF_NOTE_SUSE_NAMESZ 
+			memcmp(ndata, ELF_NOTE_SUSE_NAME,
+			ELF_NOTE_SUSE_NAMESZ) == 0)
+break;
+			/*
+			 * Dunno, warn for diagnostic
+			 */
+			goto bad;
 
 		case ELF_NOTE_TYPE_PAX_TAG:
 			if (np-n_namesz != ELF_NOTE_PAX_NAMESZ ||
@@ -907,26 +932,14 @@ netbsd_elf_signature(struct lwp *l, stru
 			memcmp(ndata, ELF_NOTE_PAX_NAME,
 			ELF_NOTE_PAX_NAMESZ)) {
 bad:
-			/*
-			 * Ignore GNU tags
-			 */
-			if (np-n_namesz == ELF_NOTE_GNU_NAMESZ 
-memcmp(ndata, ELF_NOTE_GNU_NAME,
-ELF_NOTE_GNU_NAMESZ) == 0)
-	break;
 #ifdef DIAGNOSTIC
-printf(%s: bad tag %d: 
-[%d %d, %d %d, %*.*s %*.*s]\n,
-epp-ep_kname,
-np-n_type,
-np-n_namesz, ELF_NOTE_PAX_NAMESZ,
-np-n_descsz, ELF_NOTE_PAX_DESCSZ,
-ELF_NOTE_PAX_NAMESZ,
-ELF_NOTE_PAX_NAMESZ,
-ndata,
-ELF_NOTE_PAX_NAMESZ,
-ELF_NOTE_PAX_NAMESZ,
-ELF_NOTE_PAX_NAME);
+			{
+int ns = MIN(np-n_namesz, maxlen);
+printf(%s: Unknown elf note type %d: 
+[namesz=%d, descsz=%d name=%*.*s]\n,
+epp-ep_kname, np-n_type, np-n_namesz,
+np-n_descsz, ns, ns, ndata);
+			}
 #endif
 continue;
 			}
@@ -935,7 +948,7 @@ bad:
 			sizeof(epp-ep_pax_flags));
 			break;
 
-		case ELF_NOTE_TYPE_SUSE_TAG:
+		case ELF_NOTE_TYPE_SUSE_VERSION_TAG:
 			break;
 
 		default:

Index: src/sys/sys/exec_elf.h
diff -u src/sys/sys/exec_elf.h:1.122 src/sys/sys/exec_elf.h:1.123
--- src/sys/sys/exec_elf.h:1.122	Sat Feb  4 13:12:02 2012
+++ src/sys/sys/exec_elf.h	Mon May 21 22:40:06 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_elf.h,v 1.122 2012/02/04 18:12:02 joerg Exp $	*/
+/*	$NetBSD: exec_elf.h,v 1.123 2012/05/22 02:40:06 christos Exp $	*/
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -805,6 +805,23 @@ typedef struct {
  */
 #define ELF_NOTE_TYPE_GNU_BUILD_ID	3
 
+/* SuSE-specific note type: ABI
+ * name: SuSE\0
+ * namesz: 5
+ * desc:
+ *	half[0] = MMmm
+ *
+ *	M = product major version
+ *	m = product minor version
+ * descsz: 2
+ */
+#define ELF_NOTE_TYPE_SUSE_TAG	1
+/* SuSE-specific note name and description sizes */
+#define ELF_NOTE_SUSE_NAMESZ	5
+#define ELF_NOTE_SUSE_DESCSZ	2
+/* SuSE-specific note name */
+#define ELF_NOTE_SUSE_NAME		SuSE\0
+
 /* SuSE-specific note type: version
  * name: SuSE\0\0\0\0
  * namesz: 8
@@ -817,12 +834,12 @@ typedef struct {
  *	m = product minor version
  * descsz: 8
  */
-#define ELF_NOTE_TYPE_SUSE_TAG		0x45537553	/* SuSE in LE */
+#define ELF_NOTE_TYPE_SUSE_VERSION_TAG	0x45537553	/* SuSE in LE */
 /* SuSE-specific note name and description sizes */
-#define ELF_NOTE_SUSE_NAMESZ		8
-#define 

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

2012-05-21 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Tue May 22 04:03:03 UTC 2012

Modified Files:
src/sys/arch/x68k/x68k: clock.c

Log Message:
With the freerunnnig mode, set 0 (=256count) not 0xff (=255count)
in Timer-D.  It fixes the clock ticked faster when timecounter uses
mfp (as default choice).  It was introduced in rev 1.24 in 2006.
Thanks tsutsui@ for many comments.
Should be pulled up to netbsd-6 and netbsd-5.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/x68k/x68k/clock.c

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

Modified files:

Index: src/sys/arch/x68k/x68k/clock.c
diff -u src/sys/arch/x68k/x68k/clock.c:1.33 src/sys/arch/x68k/x68k/clock.c:1.34
--- src/sys/arch/x68k/x68k/clock.c:1.33	Tue Feb  8 20:20:26 2011
+++ src/sys/arch/x68k/x68k/clock.c	Tue May 22 04:03:03 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.33 2011/02/08 20:20:26 rmind Exp $	*/
+/*	$NetBSD: clock.c,v 1.34 2012/05/22 04:03:03 isaki Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: clock.c,v 1.33 2011/02/08 20:20:26 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: clock.c,v 1.34 2012/05/22 04:03:03 isaki Exp $);
 
 #include clock.h
 
@@ -143,7 +143,7 @@ cpu_initclocks(void)
 	mfp_set_tcdr(CLOCKS_PER_SEC / hz);
 	mfp_bit_set_ierb(MFP_INTR_TIMER_C);
 
-	mfp_set_tddr(0xff);	/* maximum free run -- only 8 bits wide */
+	mfp_set_tddr(0);	/* maximum free run -- only 8 bits wide */
 	mfp_set_tcdcr(mfp_get_tcdcr() | 0x07);	/* 1/200 prescaler */
 
 	tc_init(tc);