CVS commit: src/sys/conf

2012-03-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar 25 09:15:20 UTC 2012

Modified Files:
src/sys/conf: Makefile.kern.inc

Log Message:
Redo rev 1.154 by using an explicit MKSHNOECHO that does not output anything.


To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.156 src/sys/conf/Makefile.kern.inc

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

Modified files:

Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.155 src/sys/conf/Makefile.kern.inc:1.156
--- src/sys/conf/Makefile.kern.inc:1.155	Sun Mar 25 06:55:20 2012
+++ src/sys/conf/Makefile.kern.inc	Sun Mar 25 09:15:20 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.155 2012/03/25 06:55:20 joerg Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.156 2012/03/25 09:15:20 martin Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -37,6 +37,7 @@ GENASSYM?=	${TOOL_GENASSYM:Ugenassym}
 _MKMSG?=		@\#
 _MKSHMSG?=		echo
 _MKSHECHO?=		echo
+_MKSHNOECHO=		:
 _MKMSG_CREATE?=		:
 _MKTARGET_COMPILE?=	:
 _MKTARGET_CREATE?=	:
@@ -136,7 +137,7 @@ COMPILE_CTFCONVERT=	${_MKSHECHO}\
 			${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
 			${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
 .else
-COMPILE_CTFCONVERT=
+COMPILE_CTFCONVERT=	${_MKSHNOECHO}
 .endif
 
 # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or



CVS commit: src/external/bsd/ipf/dist/lib

2012-03-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar 25 09:50:45 UTC 2012

Modified Files:
src/external/bsd/ipf/dist/lib: printaps.c

Log Message:
PRIu64 is not the right format string for unsigned long long.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ipf/dist/lib/printaps.c

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

Modified files:

Index: src/external/bsd/ipf/dist/lib/printaps.c
diff -u src/external/bsd/ipf/dist/lib/printaps.c:1.1.1.1 src/external/bsd/ipf/dist/lib/printaps.c:1.2
--- src/external/bsd/ipf/dist/lib/printaps.c:1.1.1.1	Fri Mar 23 21:20:09 2012
+++ src/external/bsd/ipf/dist/lib/printaps.c	Sun Mar 25 09:50:45 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: printaps.c,v 1.1.1.1 2012/03/23 21:20:09 christos Exp $	*/
+/*	$NetBSD: printaps.c,v 1.2 2012/03/25 09:50:45 martin Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -35,7 +35,7 @@ printaps(aps, opts, proto)
 	PRINTF(\tproxy %s/%d use %d flags %x\n, apr.apr_label,
 		apr.apr_p, apr.apr_ref, apr.apr_flags);
 #ifdef	USE_QUAD_T
-	PRINTF(%PRIu64 pkts %PRIu64, (unsigned long long)ap.aps_bytes,
+	PRINTF(%llu pkts %llu, (unsigned long long)ap.aps_bytes,
 		(unsigned long long)ap.aps_pkts);
 #else
 	PRINTF(%lu pkts %lu, ap.aps_bytes, ap.aps_pkts);



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

2012-03-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar 25 13:44:05 UTC 2012

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

Log Message:
Make 32bit kernels compilable


To generate a diff of this commit:
cvs rdiff -u -r1.172 -r1.173 src/sys/arch/sparc64/sparc64/trap.c

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/trap.c
diff -u src/sys/arch/sparc64/sparc64/trap.c:1.172 src/sys/arch/sparc64/sparc64/trap.c:1.173
--- src/sys/arch/sparc64/sparc64/trap.c:1.172	Sun Mar 25 01:41:03 2012
+++ src/sys/arch/sparc64/sparc64/trap.c	Sun Mar 25 13:44:04 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.172 2012/03/25 01:41:03 mrg Exp $ */
+/*	$NetBSD: trap.c,v 1.173 2012/03/25 13:44:04 martin Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.172 2012/03/25 01:41:03 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.173 2012/03/25 13:44:04 martin Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -1158,7 +1158,7 @@ kfault:
 /* Disable traptrace for printf */
 trap_trace_dis = 1;
 (void) splhigh();
-printf(cpu%d: data fault: pc=%lx rpc=%lx addr=%lx\n,
+printf(cpu%d: data fault: pc=%lx rpc=%PRIu64 addr=%lx\n,
 cpu_number(), pc, tf-tf_in[7], addr);
 DEBUGGER(type, tf);
 panic(kernel fault);



CVS commit: src

2012-04-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Apr  8 11:27:46 UTC 2012

Modified Files:
src/lib/libc/gen: posix_spawn_fileactions.c
src/sys/compat/netbsd32: netbsd32.h netbsd32_execve.c syscalls.master
src/sys/kern: exec_elf.c kern_exec.c kern_exit.c
src/sys/sys: exec.h spawn.h
src/sys/uvm: uvm_extern.h uvm_glue.c uvm_map.c
src/tests/lib/libc/gen/posix_spawn: t_fileactions.c

Log Message:
Rework posix_spawn locking and memory management:
 - always provide a vmspace for the new proc, initially borrowing from proc0
   (this part fixes PR 46286)
 - increase parallelism between parent and child if arguments allow this,
   avoiding a potential deadlock on exec_lock
 - add a new flag for userland to request old (lockstepped) behaviour for
   better error reporting
 - adapt test cases to the previous two and add a new variant to test the
   diagnostics flag
 - fix a few memory (and lock) leaks
 - provide netbsd32 compat


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/gen/posix_spawn_fileactions.c
cvs rdiff -u -r1.94 -r1.95 src/sys/compat/netbsd32/netbsd32.h \
src/sys/compat/netbsd32/syscalls.master
cvs rdiff -u -r1.33 -r1.34 src/sys/compat/netbsd32/netbsd32_execve.c
cvs rdiff -u -r1.37 -r1.38 src/sys/kern/exec_elf.c
cvs rdiff -u -r1.347 -r1.348 src/sys/kern/kern_exec.c
cvs rdiff -u -r1.237 -r1.238 src/sys/kern/kern_exit.c
cvs rdiff -u -r1.134 -r1.135 src/sys/sys/exec.h
cvs rdiff -u -r1.1 -r1.2 src/sys/sys/spawn.h
cvs rdiff -u -r1.182 -r1.183 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.158 -r1.159 src/sys/uvm/uvm_glue.c
cvs rdiff -u -r1.316 -r1.317 src/sys/uvm/uvm_map.c
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/gen/posix_spawn/t_fileactions.c

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

Modified files:

Index: src/lib/libc/gen/posix_spawn_fileactions.c
diff -u src/lib/libc/gen/posix_spawn_fileactions.c:1.1 src/lib/libc/gen/posix_spawn_fileactions.c:1.2
--- src/lib/libc/gen/posix_spawn_fileactions.c:1.1	Sat Feb 11 23:31:24 2012
+++ src/lib/libc/gen/posix_spawn_fileactions.c	Sun Apr  8 11:27:44 2012
@@ -25,7 +25,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: posix_spawn_fileactions.c,v 1.1 2012/02/11 23:31:24 martin Exp $);
+__RCSID($NetBSD: posix_spawn_fileactions.c,v 1.2 2012/04/08 11:27:44 martin Exp $);
 
 #include namespace.h
 
@@ -62,7 +62,7 @@ posix_spawn_file_actions_init(posix_spaw
 int
 posix_spawn_file_actions_destroy(posix_spawn_file_actions_t *fa)
 {
-	int i;
+	unsigned int i;
 
 	if (fa == NULL)
 		return (-1);
@@ -80,7 +80,7 @@ static int
 posix_spawn_file_actions_getentry(posix_spawn_file_actions_t *fa)
 {
 	if (fa == NULL)
-		return (-1);
+		return -1;
 
 	if (fa-len  fa-size)
 		return fa-len;
@@ -89,7 +89,7 @@ posix_spawn_file_actions_getentry(posix_
 			sizeof(struct posix_spawn_file_actions_entry));
 
 	if (fa-fae == NULL)
-		return (-1);
+		return -1;
 
 	fa-size += MIN_SIZE;
 

Index: src/sys/compat/netbsd32/netbsd32.h
diff -u src/sys/compat/netbsd32/netbsd32.h:1.94 src/sys/compat/netbsd32/netbsd32.h:1.95
--- src/sys/compat/netbsd32/netbsd32.h:1.94	Tue Mar  6 07:37:05 2012
+++ src/sys/compat/netbsd32/netbsd32.h	Sun Apr  8 11:27:44 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.94 2012/03/06 07:37:05 macallan Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.95 2012/04/08 11:27:44 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -151,6 +151,10 @@ typedef netbsd32_pointer_t netbsd32_lwpi
 typedef netbsd32_pointer_t netbsd32_ucontextp;
 typedef netbsd32_pointer_t netbsd32_caddr_t;
 typedef netbsd32_pointer_t netbsd32_lwpctlp;
+typedef netbsd32_pointer_t netbsd32_posix_spawn_file_actionsp;
+typedef netbsd32_pointer_t netbsd32_posix_spawnattrp;
+typedef netbsd32_pointer_t netbsd32_posix_spawn_file_actions_entryp;
+typedef netbsd32_pointer_t netbsd32_pid_tp;
 
 /*
  * now, the compatibility structures and their fake pointer types.
@@ -941,6 +945,28 @@ struct netbsd32_msdosfs_args {
 	int	gmtoff;		/* v3: offset from UTC in seconds */
 };
 
+struct netbsd32_posix_spawn_file_actions_entry {
+	enum { FAE32_OPEN, FAE32_DUP2, FAE32_CLOSE } fae_action;
+
+	int fae_fildes;
+	union {
+		struct {
+			netbsd32_charp path;
+			int oflag;
+			mode_t mode;
+		} open;
+		struct {
+			int newfildes;
+		} dup2;
+	} fae_data;
+};
+
+struct netbsd32_posix_spawn_file_actions {
+	unsigned int size;	/* size of fae array */
+	unsigned int len;	/* how many slots are used */
+	netbsd32_posix_spawn_file_actions_entryp fae;
+};
+
 #if 0
 int	netbsd32_kevent(struct lwp *, void *, register_t *);
 #endif
Index: src/sys/compat/netbsd32/syscalls.master
diff -u src/sys/compat/netbsd32/syscalls.master:1.94 src/sys/compat/netbsd32/syscalls.master:1.95
--- src/sys/compat/netbsd32/syscalls.master:1.94	Sat Mar 10 21:51:59 2012
+++ src/sys/compat/netbsd32/syscalls.master	Sun Apr  8 11:27:44 2012
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.94 

CVS commit: src/sys/compat/netbsd32

2012-04-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Apr  8 11:28:13 UTC 2012

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_sysent.c

Log Message:
Regen (posix_spawn)


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/compat/netbsd32/netbsd32_syscall.h \
src/sys/compat/netbsd32/netbsd32_syscallargs.h
cvs rdiff -u -r1.101 -r1.102 src/sys/compat/netbsd32/netbsd32_syscalls.c \
src/sys/compat/netbsd32/netbsd32_sysent.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/compat/netbsd32/netbsd32_syscall.h
diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.102 src/sys/compat/netbsd32/netbsd32_syscall.h:1.103
--- src/sys/compat/netbsd32/netbsd32_syscall.h:1.102	Sat Mar 10 21:51:58 2012
+++ src/sys/compat/netbsd32/netbsd32_syscall.h	Sun Apr  8 11:28:12 2012
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.102 2012/03/10 21:51:58 joerg Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.103 2012/04/08 11:28:12 martin Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.93 2012/03/08 21:55:45 joerg Exp
+ * created from	NetBSD: syscalls.master,v 1.95 2012/04/08 11:27:44 martin Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALL_H_
@@ -1239,6 +1239,9 @@
 /* syscall: netbsd32___quotactl ret: int args: const netbsd32_charp netbsd32_voidp */
 #define	NETBSD32_SYS_netbsd32___quotactl	473
 
-#define	NETBSD32_SYS_MAXSYSCALL	474
+/* syscall: netbsd32_posix_spawn ret: int args: netbsd32_pid_tp const netbsd32_charp const netbsd32_posix_spawn_file_actionsp const netbsd32_posix_spawnattrp netbsd32_charpp netbsd32_charpp */
+#define	NETBSD32_SYS_netbsd32_posix_spawn	474
+
+#define	NETBSD32_SYS_MAXSYSCALL	475
 #define	NETBSD32_SYS_NSYSENT	512
 #endif /* _NETBSD32_SYS_SYSCALL_H_ */
Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h
diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.102 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.103
--- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.102	Sat Mar 10 21:51:58 2012
+++ src/sys/compat/netbsd32/netbsd32_syscallargs.h	Sun Apr  8 11:28:12 2012
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.102 2012/03/10 21:51:58 joerg Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.103 2012/04/08 11:28:12 martin Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.93 2012/03/08 21:55:45 joerg Exp
+ * created from	NetBSD: syscalls.master,v 1.95 2012/04/08 11:27:44 martin Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALLARGS_H_
@@ -2438,6 +2438,16 @@ struct netbsd32___quotactl_args {
 };
 check_syscall_args(netbsd32___quotactl)
 
+struct netbsd32_posix_spawn_args {
+	syscallarg(netbsd32_pid_tp) pid;
+	syscallarg(const netbsd32_charp) path;
+	syscallarg(const netbsd32_posix_spawn_file_actionsp) file_actions;
+	syscallarg(const netbsd32_posix_spawnattrp) attrp;
+	syscallarg(netbsd32_charpp) argv;
+	syscallarg(netbsd32_charpp) envp;
+};
+check_syscall_args(netbsd32_posix_spawn)
+
 /*
  * System call prototypes.
  */
@@ -3243,4 +3253,6 @@ int	netbsd32_futimens(struct lwp *, cons
 
 int	netbsd32___quotactl(struct lwp *, const struct netbsd32___quotactl_args *, register_t *);
 
+int	netbsd32_posix_spawn(struct lwp *, const struct netbsd32_posix_spawn_args *, register_t *);
+
 #endif /* _NETBSD32_SYS_SYSCALLARGS_H_ */

Index: src/sys/compat/netbsd32/netbsd32_syscalls.c
diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.101 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.102
--- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.101	Sat Mar 10 21:51:58 2012
+++ src/sys/compat/netbsd32/netbsd32_syscalls.c	Sun Apr  8 11:28:12 2012
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_syscalls.c,v 1.101 2012/03/10 21:51:58 joerg Exp $ */
+/* $NetBSD: netbsd32_syscalls.c,v 1.102 2012/04/08 11:28:12 martin Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.93 2012/03/08 21:55:45 joerg Exp
+ * created from	NetBSD: syscalls.master,v 1.95 2012/04/08 11:27:44 martin Exp
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netbsd32_syscalls.c,v 1.101 2012/03/10 21:51:58 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: netbsd32_syscalls.c,v 1.102 2012/04/08 11:28:12 martin Exp $);
 
 #if defined(_KERNEL_OPT)
 #if defined(_KERNEL_OPT)
@@ -571,7 +571,7 @@ const char *const netbsd32_syscallnames[
 	/* 471 */	netbsd32_unlinkat,
 	/* 472 */	netbsd32_futimens,
 	/* 473 */	netbsd32___quotactl,
-	/* 474 */	# filler,
+	/* 474 */	netbsd32_posix_spawn,
 	/* 475 */	# filler,
 	/* 476 */	# filler,
 	/* 477 */	# filler,
Index: src/sys/compat/netbsd32/netbsd32_sysent.c
diff -u src/sys/compat/netbsd32/netbsd32_sysent.c:1.101 

CVS commit: src

2012-04-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr  9 19:42:07 UTC 2012

Modified Files:
src/sys/kern: kern_exec.c
src/tests/lib/libc/gen/posix_spawn: t_fileactions.c

Log Message:
Fix asynchronous posix_spawn child exit status (and test for it).


To generate a diff of this commit:
cvs rdiff -u -r1.348 -r1.349 src/sys/kern/kern_exec.c
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/gen/posix_spawn/t_fileactions.c

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

Modified files:

Index: src/sys/kern/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.348 src/sys/kern/kern_exec.c:1.349
--- src/sys/kern/kern_exec.c:1.348	Sun Apr  8 11:27:44 2012
+++ src/sys/kern/kern_exec.c	Mon Apr  9 19:42:06 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.348 2012/04/08 11:27:44 martin Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.349 2012/04/09 19:42:06 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_exec.c,v 1.348 2012/04/08 11:27:44 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_exec.c,v 1.349 2012/04/09 19:42:06 martin Exp $);
 
 #include opt_exec.h
 #include opt_ktrace.h
@@ -2003,7 +2003,7 @@ spawn_return(void *arg)
 	 * A NetBSD specific workaround is POSIX_SPAWN_RETURNERROR as
 	 * flag bit in the attrp argument to posix_spawn(2), see above.
 	 */
-	exit1(l, W_EXITCODE(127, SIGABRT));
+	exit1(l, W_EXITCODE(127, 0));
 }
 
 void

Index: src/tests/lib/libc/gen/posix_spawn/t_fileactions.c
diff -u src/tests/lib/libc/gen/posix_spawn/t_fileactions.c:1.4 src/tests/lib/libc/gen/posix_spawn/t_fileactions.c:1.5
--- src/tests/lib/libc/gen/posix_spawn/t_fileactions.c:1.4	Sun Apr  8 11:27:46 2012
+++ src/tests/lib/libc/gen/posix_spawn/t_fileactions.c	Mon Apr  9 19:42:07 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fileactions.c,v 1.4 2012/04/08 11:27:46 martin Exp $ */
+/* $NetBSD: t_fileactions.c,v 1.5 2012/04/09 19:42:07 martin Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -237,8 +237,7 @@ ATF_TC_BODY(t_spawn_open_nonexistent, tc
 		 * return exit code 127
 		 */
 		waitpid(pid, status, 0);
-		ATF_REQUIRE(WEXITSTATUS(status) == 127);
-		
+		ATF_REQUIRE(WIFEXITED(status)  WEXITSTATUS(status) == 127);
 	} else {
 		/*
 		 * The error has been noticed early enough, no child has



CVS commit: src/sys/kern

2012-04-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Apr 15 15:35:01 UTC 2012

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

Log Message:
Fix leak in a posix_spawn error path, from Greg Oster.


To generate a diff of this commit:
cvs rdiff -u -r1.349 -r1.350 src/sys/kern/kern_exec.c

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

Modified files:

Index: src/sys/kern/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.349 src/sys/kern/kern_exec.c:1.350
--- src/sys/kern/kern_exec.c:1.349	Mon Apr  9 19:42:06 2012
+++ src/sys/kern/kern_exec.c	Sun Apr 15 15:35:00 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.349 2012/04/09 19:42:06 martin Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.350 2012/04/15 15:35:00 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_exec.c,v 1.349 2012/04/09 19:42:06 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_exec.c,v 1.350 2012/04/15 15:35:00 martin Exp $);
 
 #include opt_exec.h
 #include opt_ktrace.h
@@ -1978,8 +1978,16 @@ spawn_return(void *arg)
 	return;
 
  report_error:
- 	if (have_reflock)
+ 	if (have_reflock) {
+ 		/*
+		 * We have not passed through execve_runproc(),
+		 * which would have released the p_reflock and also
+		 * taken ownership of the sed_exec part of spawn_data,
+		 * so release/free both here.
+		 */
 		rw_exit(l-l_proc-p_reflock);
+		execve_free_data(spawn_data-sed_exec);
+	}
 
 	if (parent_is_waiting) {
 		/* pass error to parent */



CVS commit: src/sys

2012-04-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Apr 15 19:07:40 UTC 2012

Modified Files:
src/sys/kern: subr_kmem.c
src/sys/sys: debug.h

Log Message:
We don't support KMEM_GUARD nor FREECHECK yet with rump, so disable them
in debug builds of the rump kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/kern/subr_kmem.c
cvs rdiff -u -r1.3 -r1.4 src/sys/sys/debug.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/subr_kmem.c
diff -u src/sys/kern/subr_kmem.c:1.44 src/sys/kern/subr_kmem.c:1.45
--- src/sys/kern/subr_kmem.c:1.44	Fri Apr 13 06:27:02 2012
+++ src/sys/kern/subr_kmem.c	Sun Apr 15 19:07:40 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kmem.c,v 1.44 2012/04/13 06:27:02 mrg Exp $	*/
+/*	$NetBSD: subr_kmem.c,v 1.45 2012/04/15 19:07:40 martin Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_kmem.c,v 1.44 2012/04/13 06:27:02 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_kmem.c,v 1.45 2012/04/15 19:07:40 martin Exp $);
 
 #include sys/param.h
 #include sys/callback.h
@@ -121,7 +121,7 @@ static const struct kmem_cache_info {
 static pool_cache_t kmem_cache[KMEM_CACHE_COUNT] __cacheline_aligned;
 static size_t kmem_cache_maxidx __read_mostly;
 
-#if defined(DEBUG)
+#if defined(DEBUG)  defined(_HARDKERNEL)
 #ifndef KMEM_GUARD_DEPTH
 #define KMEM_GUARD_DEPTH 0
 #endif

Index: src/sys/sys/debug.h
diff -u src/sys/sys/debug.h:1.3 src/sys/sys/debug.h:1.4
--- src/sys/sys/debug.h:1.3	Mon Apr 28 20:24:10 2008
+++ src/sys/sys/debug.h	Sun Apr 15 19:07:40 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: debug.h,v 1.3 2008/04/28 20:24:10 martin Exp $	*/
+/*	$NetBSD: debug.h,v 1.4 2012/04/15 19:07:40 martin Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@ void	debug_init(void);
 void	freecheck_out(void **, void *);
 void	freecheck_in(void **, void *);
 
-#ifdef DEBUG
+#if defined(DEBUG)  defined(_HARDKERNEL)
 #define	FREECHECK_OUT(h, a)	freecheck_out((h), (a))
 #define	FREECHECK_IN(h, a)	freecheck_in((h), (a))
 #else



CVS commit: src/tests/modules/k_helper3

2012-04-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Apr 17 21:39:19 UTC 2012

Modified Files:
src/tests/modules/k_helper3: k_helper3.c

Log Message:
While we need an absolute path when loading a module (including the .kmod
extension), we want the shortname w/o extension for the unload.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/modules/k_helper3/k_helper3.c

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

Modified files:

Index: src/tests/modules/k_helper3/k_helper3.c
diff -u src/tests/modules/k_helper3/k_helper3.c:1.2 src/tests/modules/k_helper3/k_helper3.c:1.3
--- src/tests/modules/k_helper3/k_helper3.c:1.2	Tue Apr 17 05:18:54 2012
+++ src/tests/modules/k_helper3/k_helper3.c	Tue Apr 17 21:39:19 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: k_helper3.c,v 1.2 2012/04/17 05:18:54 jruoho Exp $ */
+/*	$NetBSD: k_helper3.c,v 1.3 2012/04/17 21:39:19 martin Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: k_helper3.c,v 1.2 2012/04/17 05:18:54 jruoho Exp $);
+__RCSID($NetBSD: k_helper3.c,v 1.3 2012/04/17 21:39:19 martin Exp $);
 
 #include sys/module.h
 
@@ -58,7 +58,7 @@ main(int argc, char *argv[])
 static __printflike(1, 2) int
 load(const char *fmt, ...)
 {
-	char filename[MAXPATHLEN], *propsstr;
+	char filename[MAXPATHLEN], *propsstr, *shortname, *dot;
 	prop_dictionary_t props;
 	modctl_load_t ml;
 	int serrno, rv;
@@ -86,7 +86,15 @@ load(const char *fmt, ...)
 	if (rv != 0)
 		serrno = errno;
 
-	(void)modctl(MODCTL_UNLOAD, filename);
+	shortname = strrchr(filename, '/');
+	if (shortname != NULL)
+		shortname++;
+	else
+		shortname = filename;
+	dot = strrchr(shortname, '.');
+	if (dot)
+		*dot = 0;
+	(void)modctl(MODCTL_UNLOAD, shortname);
 
 	free(propsstr);
 



CVS commit: src/lib/librumphijack

2012-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Apr 18 10:37:37 UTC 2012

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

Log Message:
poll(), pollts() and select() all return int values, but in the hijack
emulation of them these get passed as exit values from a pthread as
a void* (c.f. pthread_join(), pthread_exit()).
Do not use the address of an int variable for these, but provide the address
of a void* and assign the value afterwards.
Fixes hijacking of pollts/select on 64bit big endian hosts.
Spotted by and fix from pooka.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/lib/librumphijack/hijack.c

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

Modified files:

Index: src/lib/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.91 src/lib/librumphijack/hijack.c:1.92
--- src/lib/librumphijack/hijack.c:1.91	Wed Feb  1 05:34:41 2012
+++ src/lib/librumphijack/hijack.c	Wed Apr 18 10:37:37 2012
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.91 2012/02/01 05:34:41 dholland Exp $	*/
+/*  $NetBSD: hijack.c,v 1.92 2012/04/18 10:37:37 martin Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
 #undef _FORTIFY_SOURCE
 
 #include sys/cdefs.h
-__RCSID($NetBSD: hijack.c,v 1.91 2012/02/01 05:34:41 dholland Exp $);
+__RCSID($NetBSD: hijack.c,v 1.92 2012/04/18 10:37:37 martin Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -1654,7 +1654,7 @@ hostpoll(void *arg)
 		parg-errnum = errno;
 	rump_sys_write(parg-pipefd, rv, sizeof(rv));
 
-	return (void *)(intptr_t)rv;
+	return (void *)rv;
 }
 
 int
@@ -1676,8 +1676,8 @@ REALPOLLTS(struct pollfd *fds, nfds_t nf
 		struct pollfd *pfd_host = NULL, *pfd_rump = NULL;
 		int rpipe[2] = {-1,-1}, hpipe[2] = {-1,-1};
 		struct pollarg parg;
-		uintptr_t lrv;
-		int sverrno = 0, trv;
+		void *trv_val;
+		int sverrno = 0, lrv, trv;
 
 		/*
 		 * ok, this is where it gets tricky.  We must support
@@ -1770,7 +1770,8 @@ REALPOLLTS(struct pollfd *fds, nfds_t nf
 		lrv = op_pollts(pfd_rump, nfds+1, ts, NULL);
 		sverrno = errno;
 		write(hpipe[1], rv, sizeof(rv));
-		pthread_join(pt, (void *)trv);
+		pthread_join(pt, trv_val);
+		trv = (int)(intptr_t)trv_val;
 
 		/* check who won and merge results */
 		if (lrv != 0  pfd_host[nfds].revents  POLLIN) {



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

2012-04-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Apr 22 08:52:26 UTC 2012

Modified Files:
src/tests/lib/libc/gen: t_siginfo.c

Log Message:
Do not compare si_addr (address of faulting instruction) against the
unaligned data address causing the fault - this will always fail.
If anybody knows a portable way to get the data address involved in the
fault, please fix the test case as originally intended.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/tests/lib/libc/gen/t_siginfo.c

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

Modified files:

Index: src/tests/lib/libc/gen/t_siginfo.c
diff -u src/tests/lib/libc/gen/t_siginfo.c:1.15 src/tests/lib/libc/gen/t_siginfo.c:1.16
--- src/tests/lib/libc/gen/t_siginfo.c:1.15	Fri Apr 20 00:40:31 2012
+++ src/tests/lib/libc/gen/t_siginfo.c	Sun Apr 22 08:52:26 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_siginfo.c,v 1.15 2012/04/20 00:40:31 jym Exp $ */
+/* $NetBSD: t_siginfo.c,v 1.16 2012/04/22 08:52:26 martin Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -418,13 +418,26 @@ sigbus_action(int signo, siginfo_t *info
 	ATF_REQUIRE_EQ(info-si_errno, 0);
 	ATF_REQUIRE_EQ(info-si_code, BUS_ADRALN);
 
+#if 0
 	if (strcmp(atf_config_get(atf_arch), i386) == 0 ||
 	strcmp(atf_config_get(atf_arch), x86_64) == 0) {
 		atf_tc_expect_fail(x86 architecture does not correctly 
 		report the address where the unaligned access occured);
 	}
 
+	/*
+	 * XXX: This is bogus: si_addr is documented as the text address
+	 * where the fault occurs, addr is the faulting data address,
+	 * see TOG about siginfo_t:
+	 *
+	 *	void *	si_addr	Address of faulting instruction.
+	 *
+	 * Is there a portable way to get the accessed data address from
+	 * the handler?
+	 */
 	ATF_REQUIRE_EQ(info-si_addr, (void *)addr);
+#endif
+
 	atf_tc_pass();
 	/* NOTREACHED */
 }



CVS commit: src/usr.bin/login

2012-04-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 23 09:27:36 UTC 2012

Modified Files:
src/usr.bin/login: login_pam.c

Log Message:
trimusername (which does not exist) probably was meant to be called
trimloginname (which does exist, at least)


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/login/login_pam.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/login/login_pam.c
diff -u src/usr.bin/login/login_pam.c:1.21 src/usr.bin/login/login_pam.c:1.22
--- src/usr.bin/login/login_pam.c:1.21	Sun Apr 22 23:26:19 2012
+++ src/usr.bin/login/login_pam.c	Mon Apr 23 09:27:36 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: login_pam.c,v 1.21 2012/04/22 23:26:19 christos Exp $   */
+/* $NetBSD: login_pam.c,v 1.22 2012/04/23 09:27:36 martin Exp $   */
 
 /*-
  * Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = @(#)login.c	8.4 (Berkeley) 4/2/94;
 #endif
-__RCSID($NetBSD: login_pam.c,v 1.21 2012/04/22 23:26:19 christos Exp $);
+__RCSID($NetBSD: login_pam.c,v 1.22 2012/04/23 09:27:36 martin Exp $);
 #endif /* not lint */
 
 /*
@@ -240,7 +240,7 @@ main(int argc, char *argv[])
 	for (cnt = 0;; ask = 1) {
 		if (ask) {
 			fflag = 0;
-			username = trimusername(getloginname());
+			username = trimloginname(getloginname());
 		}
 		rootlogin = 0;
 		auth_passed = 0;



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

2012-04-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 23 15:07:56 UTC 2012

Modified Files:
src/tests/lib/libc/gen: t_siginfo.c

Log Message:
Revert previous, si_addr is expected to be the faulting *data* address
(mmm, consistent standards).
Add a few tweaks to prevent the compiler's optimizer outsmarting the test.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/tests/lib/libc/gen/t_siginfo.c

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

Modified files:

Index: src/tests/lib/libc/gen/t_siginfo.c
diff -u src/tests/lib/libc/gen/t_siginfo.c:1.16 src/tests/lib/libc/gen/t_siginfo.c:1.17
--- src/tests/lib/libc/gen/t_siginfo.c:1.16	Sun Apr 22 08:52:26 2012
+++ src/tests/lib/libc/gen/t_siginfo.c	Mon Apr 23 15:07:56 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_siginfo.c,v 1.16 2012/04/22 08:52:26 martin Exp $ */
+/* $NetBSD: t_siginfo.c,v 1.17 2012/04/23 15:07:56 martin Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@
 #endif
 
 /* for sigbus */
-char *addr;
+volatile char *addr;
 
 /* for sigchild */
 pid_t child;
@@ -412,31 +412,19 @@ static void
 sigbus_action(int signo, siginfo_t *info, void *ptr)
 {
 
+	printf(si_addr = %p\n, info-si_addr);
 	sig_debug(signo, info, (ucontext_t *)ptr);
 
 	ATF_REQUIRE_EQ(info-si_signo, SIGBUS);
 	ATF_REQUIRE_EQ(info-si_errno, 0);
 	ATF_REQUIRE_EQ(info-si_code, BUS_ADRALN);
 
-#if 0
 	if (strcmp(atf_config_get(atf_arch), i386) == 0 ||
 	strcmp(atf_config_get(atf_arch), x86_64) == 0) {
 		atf_tc_expect_fail(x86 architecture does not correctly 
 		report the address where the unaligned access occured);
 	}
-
-	/*
-	 * XXX: This is bogus: si_addr is documented as the text address
-	 * where the fault occurs, addr is the faulting data address,
-	 * see TOG about siginfo_t:
-	 *
-	 *	void *	si_addr	Address of faulting instruction.
-	 *
-	 * Is there a portable way to get the accessed data address from
-	 * the handler?
-	 */
-	ATF_REQUIRE_EQ(info-si_addr, (void *)addr);
-#endif
+	ATF_REQUIRE_EQ(info-si_addr, (volatile void *)addr);
 
 	atf_tc_pass();
 	/* NOTREACHED */
@@ -480,6 +468,7 @@ ATF_TC_BODY(sigbus_adraln, tc)
 
 	/* Force an unaligned access */
 	addr++;
+	printf(now trying to access unaligned address %p\n, addr);
 	ATF_REQUIRE_EQ(*(volatile int *)addr, 0);
 
 	atf_tc_fail(Test did not fault as expected);



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

2012-04-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 23 15:09:13 UTC 2012

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

Log Message:
Report faulting data address with SIGBUS (instead of the faulting instruction)


To generate a diff of this commit:
cvs rdiff -u -r1.174 -r1.175 src/sys/arch/sparc64/sparc64/trap.c

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/trap.c
diff -u src/sys/arch/sparc64/sparc64/trap.c:1.174 src/sys/arch/sparc64/sparc64/trap.c:1.175
--- src/sys/arch/sparc64/sparc64/trap.c:1.174	Sun Mar 25 15:40:32 2012
+++ src/sys/arch/sparc64/sparc64/trap.c	Mon Apr 23 15:09:13 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.174 2012/03/25 15:40:32 nakayama Exp $ */
+/*	$NetBSD: trap.c,v 1.175 2012/04/23 15:09:13 martin Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.174 2012/03/25 15:40:32 nakayama Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.175 2012/04/23 15:09:13 martin Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -730,7 +730,6 @@ badtrap:
 		   l-l_proc-p_pid, l-l_lid, l-l_proc-p_comm, fmt64(dsfsr), fmt64(dsfar),
 		   fmt64(isfsr), pc);
 #endif
-		}
 		
 #if defined(DDB)  defined(DEBUG)
 		if (trapdebug  TDB_STOPSIG) {
@@ -747,7 +746,8 @@ badtrap:
 		sig = SIGBUS;
 		ksi.ksi_trap = type;
 		ksi.ksi_code = BUS_ADRALN;
-		ksi.ksi_addr = (void *)pc;
+		ksi.ksi_addr = (void*)dsfar;
+		}
 		break;
 
 	case T_FP_IEEE_754:
@@ -1560,7 +1560,7 @@ text_access_error(struct trapframe64 *tf
 		ksi.ksi_signo = SIGBUS;
 		ksi.ksi_code = BUS_OBJERR;
 		ksi.ksi_trap = type;
-		ksi.ksi_addr = (void *)pc;
+		ksi.ksi_addr = (void *)afva;
 		trapsignal(l, ksi);
 	}
 



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

2012-04-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Apr 25 19:58:07 UTC 2012

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

Log Message:
Fix 32bit build


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/arch/sparc64/sparc64/trap.c

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/trap.c
diff -u src/sys/arch/sparc64/sparc64/trap.c:1.175 src/sys/arch/sparc64/sparc64/trap.c:1.176
--- src/sys/arch/sparc64/sparc64/trap.c:1.175	Mon Apr 23 15:09:13 2012
+++ src/sys/arch/sparc64/sparc64/trap.c	Wed Apr 25 19:58:07 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.175 2012/04/23 15:09:13 martin Exp $ */
+/*	$NetBSD: trap.c,v 1.176 2012/04/25 19:58:07 martin Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.175 2012/04/23 15:09:13 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.176 2012/04/25 19:58:07 martin Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -746,7 +746,7 @@ badtrap:
 		sig = SIGBUS;
 		ksi.ksi_trap = type;
 		ksi.ksi_code = BUS_ADRALN;
-		ksi.ksi_addr = (void*)dsfar;
+		ksi.ksi_addr = (void*)(intptr_t)dsfar;
 		}
 		break;
 



CVS commit: src/usr.sbin/sup/source

2012-04-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Apr 25 22:35:00 UTC 2012

Modified Files:
src/usr.sbin/sup/source: supscan.c

Log Message:
errs might be clobbered by longjmp, so declare it volatile.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/sup/source/supscan.c

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

Modified files:

Index: src/usr.sbin/sup/source/supscan.c
diff -u src/usr.sbin/sup/source/supscan.c:1.21 src/usr.sbin/sup/source/supscan.c:1.22
--- src/usr.sbin/sup/source/supscan.c:1.21	Wed Apr 25 18:07:45 2012
+++ src/usr.sbin/sup/source/supscan.c	Wed Apr 25 22:35:00 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: supscan.c,v 1.21 2012/04/25 18:07:45 christos Exp $	*/
+/*	$NetBSD: supscan.c,v 1.22 2012/04/25 22:35:00 martin Exp $	*/
 
 /*
  * Copyright (c) 1992 Carnegie Mellon University
@@ -171,7 +171,7 @@ int
 main(int argc, char **argv)
 {
 	SCAN_COLLECTION * volatile c;	/* Avoid longjmp clobbering */
-	int errs;
+	volatile int errs;
 #ifdef RLIMIT_DATA
 	struct rlimit dlim;
 



CVS commit: src/sys/dev/sun

2012-04-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Apr 27 09:30:13 UTC 2012

Modified Files:
src/sys/dev/sun: kbd.c

Log Message:
Make it compilable without envsys


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/sun/kbd.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/sun/kbd.c
diff -u src/sys/dev/sun/kbd.c:1.64 src/sys/dev/sun/kbd.c:1.65
--- src/sys/dev/sun/kbd.c:1.64	Thu Apr 26 00:50:10 2012
+++ src/sys/dev/sun/kbd.c	Fri Apr 27 09:30:13 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kbd.c,v 1.64 2012/04/26 00:50:10 macallan Exp $	*/
+/*	$NetBSD: kbd.c,v 1.65 2012/04/27 09:30:13 martin Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -47,7 +47,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kbd.c,v 1.64 2012/04/26 00:50:10 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: kbd.c,v 1.65 2012/04/27 09:30:13 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -79,6 +79,7 @@ __KERNEL_RCSID(0, $NetBSD: kbd.c,v 1.64
 #include ioconf.h
 #include locators.h
 #include opt_sunkbd.h
+#include sysmon_envsys.h
 
 dev_type_open(kbdopen);
 dev_type_close(kbdclose);
@@ -153,7 +154,9 @@ static void	kbd_input_wskbd(struct kbd_s
 /* firm events input */
 static void	kbd_input_event(struct kbd_softc *, int);
 
+#if NSYSMON_ENVSYS
 static void	kbd_powerbutton(void *);
+#endif
 
 /
  *  Entry points for /dev/kbd
@@ -927,11 +930,13 @@ kbd_input_wskbd(struct kbd_softc *k, int
 return;
 #endif
 			case 0x30:
+#if NSYSMON_ENVSYS
 if (k-k_isconsole)
 	k-k_ev = KEY_UP(code) ?
 	PSWITCH_EVENT_RELEASED :
 	PSWITCH_EVENT_PRESSED;
 	sysmon_task_queue_sched(0, kbd_powerbutton, k);
+#endif
 return;
 		}
 	}
@@ -1074,6 +1079,7 @@ kbd_wskbd_attach(struct kbd_softc *k, in
 {
 	k-k_isconsole = isconsole;
 	if (isconsole) {
+#if NSYSMON_ENVSYS
 		sysmon_task_queue_init();
 		memset(k-k_sm_pbutton, 0, sizeof(struct sysmon_pswitch));
 		k-k_sm_pbutton.smpsw_name = device_xname(k-k_dev);
@@ -1081,10 +1087,12 @@ kbd_wskbd_attach(struct kbd_softc *k, in
 		if (sysmon_pswitch_register(k-k_sm_pbutton) != 0)
 			aprint_error_dev(k-k_dev,
 			unable to register power button with sysmon\n);
+#endif
 	}
 	config_interrupts(k-k_dev, kbd_enable);
 }
 
+#if NSYSMON_ENVSYS
 static void
 kbd_powerbutton(void *cookie)
 {
@@ -1092,5 +1100,6 @@ kbd_powerbutton(void *cookie)
 
 	sysmon_pswitch_event(k-k_sm_pbutton, k-k_ev);
 }
+#endif
 
 #endif



CVS commit: src/distrib/utils/sysinst

2012-04-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 30 19:43:46 UTC 2012

Modified Files:
src/distrib/utils/sysinst: msg.mi.de

Log Message:
Translate enable_binpkg


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/distrib/utils/sysinst/msg.mi.de

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/msg.mi.de
diff -u src/distrib/utils/sysinst/msg.mi.de:1.65 src/distrib/utils/sysinst/msg.mi.de:1.66
--- src/distrib/utils/sysinst/msg.mi.de:1.65	Fri Apr  6 23:48:53 2012
+++ src/distrib/utils/sysinst/msg.mi.de	Mon Apr 30 19:43:45 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.de,v 1.65 2012/04/06 23:48:53 riz Exp $	*/
+/*	$NetBSD: msg.mi.de,v 1.66 2012/04/30 19:43:45 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1068,7 +1068,7 @@ message abandoned {Abgebrochen}
 message empty {***LEER***}
 message timezone {Zeitzone}
 message change_rootpw {root-Passwort setzen}
-message enable_binpkg {Enable installation of binary packages}
+message enable_binpkg {Installation von Binärpaketen vorbereiten}
 message enable_sshd {sshd aktivieren}
 message enable_ntpd {ntpd aktivieren}
 message run_ntpdate {ntpdate beim Starten ausführen}



CVS commit: src/distrib/utils/sysinst

2012-04-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 30 19:49:26 UTC 2012

Modified Files:
src/distrib/utils/sysinst: msg.mi.de

Log Message:
Add missing white spaces at end of line (meaning forced line breaks)


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/distrib/utils/sysinst/msg.mi.de

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/msg.mi.de
diff -u src/distrib/utils/sysinst/msg.mi.de:1.66 src/distrib/utils/sysinst/msg.mi.de:1.67
--- src/distrib/utils/sysinst/msg.mi.de:1.66	Mon Apr 30 19:43:45 2012
+++ src/distrib/utils/sysinst/msg.mi.de	Mon Apr 30 19:49:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.de,v 1.66 2012/04/30 19:43:45 martin Exp $	*/
+/*	$NetBSD: msg.mi.de,v 1.67 2012/04/30 19:49:26 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -563,34 +563,34 @@ message net_media
 message netok
 {Nachfolgend sehen Sie die aktuellen Netzwerkeinstellungen.
 
-DNS-Domain:		%s
-Hostname:		%s
-Netzwerkadapter:	%s
-IP-Adresse:		%s
-Netzmaske:		%s
-IPv4-Nameserver:	%s
-IPv4-Gateway:		%s
-Verbindungstyp:		%s
+DNS-Domain:		%s 
+Hostname:		%s 
+Netzwerkadapter:	%s 
+IP-Adresse:		%s 
+Netzmaske:		%s 
+IPv4-Nameserver:	%s 
+IPv4-Gateway:		%s 
+Verbindungstyp:		%s 
 }
 
 message netok_slip
 {Sie haben die folgenden Daten gewählt. Sind diese Daten OK?
 
-DNS-Domain:		%s
-Hostname:		%s
-Netzwerkadapter:	%s
-IP-Adresse:		%s
-IP-Adresse des Servers:	%s
-Netzmaske:		%s
-IPv4-Nameserver:	%s
-IPv4-Gateway:		%s
-Verbindungstyp:		%s
+DNS-Domain:		%s 
+Hostname:		%s 
+Netzwerkadapter:	%s 
+IP-Adresse:		%s 
+IP-Adresse des Servers:	%s 
+Netzmaske:		%s 
+IPv4-Nameserver:	%s 
+IPv4-Gateway:		%s 
+Verbindungstyp:		%s 
 }
 
 message netokv6
 {
-IPv6-Autokonfiguration:	%s
-IPv6-Nameserver:	%s
+IPv6-Autokonfiguration:	%s 
+IPv6-Nameserver:	%s 
 }
 
 message netok_ok



CVS commit: src/sys/arch/sparc

2012-05-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May  1 09:40:16 UTC 2012

Modified Files:
src/sys/arch/sparc/include: cpu.h
src/sys/arch/sparc/sparc: emul.c trap.c

Log Message:
On unaligned access, provide the data address to the signal handler, instead
of the faulting instructions address.


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/arch/sparc/include/cpu.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/sparc/sparc/emul.c
cvs rdiff -u -r1.189 -r1.190 src/sys/arch/sparc/sparc/trap.c

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

Modified files:

Index: src/sys/arch/sparc/include/cpu.h
diff -u src/sys/arch/sparc/include/cpu.h:1.93 src/sys/arch/sparc/include/cpu.h:1.94
--- src/sys/arch/sparc/include/cpu.h:1.93	Sun Feb 19 21:06:28 2012
+++ src/sys/arch/sparc/include/cpu.h	Tue May  1 09:40:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.93 2012/02/19 21:06:28 rmind Exp $ */
+/*	$NetBSD: cpu.h,v 1.94 2012/05/01 09:40:15 martin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -236,7 +236,7 @@ void kgdb_panic(void);
 
 /* emul.c */
 struct trapframe;
-int fixalign(struct lwp *, struct trapframe *);
+int fixalign(struct lwp *, struct trapframe *, void **);
 int emulinstr(int, struct trapframe *);
 
 /* cpu.c */

Index: src/sys/arch/sparc/sparc/emul.c
diff -u src/sys/arch/sparc/sparc/emul.c:1.16 src/sys/arch/sparc/sparc/emul.c:1.17
--- src/sys/arch/sparc/sparc/emul.c:1.16	Mon Apr 28 20:23:36 2008
+++ src/sys/arch/sparc/sparc/emul.c	Tue May  1 09:40:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: emul.c,v 1.16 2008/04/28 20:23:36 martin Exp $	*/
+/*	$NetBSD: emul.c,v 1.17 2012/05/01 09:40:15 martin Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: emul.c,v 1.16 2008/04/28 20:23:36 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: emul.c,v 1.17 2012/05/01 09:40:15 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -212,10 +212,12 @@ muldiv(struct trapframe *tf,
  * Code to handle alignment faults on the sparc. This is enabled by sending
  * a fixalign trap. Such code is generated by compiling with cc -misalign
  * on SunOS, but we don't have such a feature yet on our gcc.
+ * If data_address is passed, do not emulate the instruction but just report
+ * back the VA (this is used for signal delivery).
  */
 
 int
-fixalign(struct lwp *l, struct trapframe *tf)
+fixalign(struct lwp *l, struct trapframe *tf, void **data_address)
 {
 	static u_char sizedef[] = { 0x4, 0xff, 0x2, 0x8 };
 
@@ -282,6 +284,12 @@ fixalign(struct lwp *l, struct trapframe
 
 	rs1 += rs2;
 
+	/* Only querying faulting data address? */
+	if (data_address) {
+		*data_address = (void*)rs1;
+		return 0;
+	}
+
 #ifdef DEBUG_EMUL
 	uprintf(memalign 0x%x: %s%c%c %c%d, %c%d, , code.i_int,
 	op.bits.st ? st : ld, us[op.bits.sgn],

Index: src/sys/arch/sparc/sparc/trap.c
diff -u src/sys/arch/sparc/sparc/trap.c:1.189 src/sys/arch/sparc/sparc/trap.c:1.190
--- src/sys/arch/sparc/sparc/trap.c:1.189	Sun Feb 19 21:06:29 2012
+++ src/sys/arch/sparc/sparc/trap.c	Tue May  1 09:40:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.189 2012/02/19 21:06:29 rmind Exp $ */
+/*	$NetBSD: trap.c,v 1.190 2012/05/01 09:40:15 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -49,7 +49,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.189 2012/02/19 21:06:29 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.190 2012/05/01 09:40:15 martin Exp $);
 
 #include opt_ddb.h
 #include opt_compat_svr4.h
@@ -565,7 +565,7 @@ badtrap:
 
 	case T_ALIGN:
 		if ((p-p_md.md_flags  MDP_FIXALIGN) != 0) {
-			n = fixalign(l, tf);
+			n = fixalign(l, tf, NULL);
 			if (n == 0) {
 ADVANCE;
 break;
@@ -575,7 +575,7 @@ badtrap:
 		KSI_INIT_TRAP(ksi);
 		ksi.ksi_trap = type;
 		ksi.ksi_code = BUS_ADRALN;
-		ksi.ksi_addr = (void *)pc;
+		fixalign(l, tf, ksi.ksi_addr);
 		break;
 
 	case T_FPE:



CVS commit: src/sys/netinet

2012-05-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May  1 15:09:36 UTC 2012

Modified Files:
src/sys/netinet: ip_mroute.c

Log Message:
Explicitly include sys/kmem.h


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/sys/netinet/ip_mroute.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/netinet/ip_mroute.c
diff -u src/sys/netinet/ip_mroute.c:1.124 src/sys/netinet/ip_mroute.c:1.125
--- src/sys/netinet/ip_mroute.c:1.124	Mon Apr 30 22:51:28 2012
+++ src/sys/netinet/ip_mroute.c	Tue May  1 15:09:36 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_mroute.c,v 1.124 2012/04/30 22:51:28 rmind Exp $	*/
+/*	$NetBSD: ip_mroute.c,v 1.125 2012/05/01 15:09:36 martin Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -93,7 +93,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ip_mroute.c,v 1.124 2012/04/30 22:51:28 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: ip_mroute.c,v 1.125 2012/05/01 15:09:36 martin Exp $);
 
 #include opt_inet.h
 #include opt_ipsec.h
@@ -113,6 +113,7 @@ __KERNEL_RCSID(0, $NetBSD: ip_mroute.c,
 #include sys/errno.h
 #include sys/time.h
 #include sys/kernel.h
+#include sys/kmem.h
 #include sys/ioctl.h
 #include sys/syslog.h
 



CVS commit: src/sys/rump/dev/lib/libscsitest

2012-05-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun May  6 16:33:02 UTC 2012

Modified Files:
src/sys/rump/dev/lib/libscsitest: scsitest.c

Log Message:
If we are not delivering a host iso file (USE_TOSI_ISO is undefined), use
-1 as file descriptor initially. The -2 value confused a few other checks
later and led to inconsistent media present reports.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/dev/lib/libscsitest/scsitest.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/dev/lib/libscsitest/scsitest.c
diff -u src/sys/rump/dev/lib/libscsitest/scsitest.c:1.1 src/sys/rump/dev/lib/libscsitest/scsitest.c:1.2
--- src/sys/rump/dev/lib/libscsitest/scsitest.c:1.1	Tue Aug 24 11:23:35 2010
+++ src/sys/rump/dev/lib/libscsitest/scsitest.c	Sun May  6 16:33:02 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsitest.c,v 1.1 2010/08/24 11:23:35 pooka Exp $	*/
+/*	$NetBSD: scsitest.c,v 1.2 2012/05/06 16:33:02 martin Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: scsitest.c,v 1.1 2010/08/24 11:23:35 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: scsitest.c,v 1.2 2012/05/06 16:33:02 martin Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -221,7 +221,7 @@ scsitest_match(struct device *parent, st
 	if ((isofd = rumpuser_open(MYCDISO, O_RDWR, error)) == -1)
 		return 0;
 #else
-	isofd = -2;
+	isofd = -1;
 #endif
 
 	return 1;



CVS commit: src/sys/dev/scsipi

2012-05-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun May  6 16:42:20 UTC 2012

Modified Files:
src/sys/dev/scsipi: cd.c

Log Message:
In cdopen: make the test for media presence always silent. In all cases
requiring a message, we will most likely get that from the spinup attempt
anyway.
This avoids the spurious Check Condition on CDB, Not Ready, Medium Not
Present, Tray Closed messages at boot/shutdown time.


To generate a diff of this commit:
cvs rdiff -u -r1.307 -r1.308 src/sys/dev/scsipi/cd.c

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

Modified files:

Index: src/sys/dev/scsipi/cd.c
diff -u src/sys/dev/scsipi/cd.c:1.307 src/sys/dev/scsipi/cd.c:1.308
--- src/sys/dev/scsipi/cd.c:1.307	Thu Apr 19 17:45:20 2012
+++ src/sys/dev/scsipi/cd.c	Sun May  6 16:42:19 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd.c,v 1.307 2012/04/19 17:45:20 bouyer Exp $	*/
+/*	$NetBSD: cd.c,v 1.308 2012/05/06 16:42:19 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation,
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cd.c,v 1.307 2012/04/19 17:45:20 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: cd.c,v 1.308 2012/05/06 16:42:19 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -382,17 +382,10 @@ cdopen(dev_t dev, int flag, int fmt, str
 			goto bad3;
 		}
 	} else {
-		int silent;
-
-		if (rawpart)
-			silent = XS_CTL_SILENT;
-		else
-			silent = 0;
-
 		/* Check that it is still responding and ok. */
 		error = scsipi_test_unit_ready(periph,
 		XS_CTL_IGNORE_ILLEGAL_REQUEST | XS_CTL_IGNORE_MEDIA_CHANGE |
-		silent);
+		XS_CTL_SILENT);
 
 		/*
 		 * Start the pack spinning if necessary. Always allow the
@@ -401,6 +394,12 @@ cdopen(dev_t dev, int flag, int fmt, str
 		 */
 		if (error == EIO) {
 			int error2;
+			int silent;
+
+			if (rawpart)
+silent = XS_CTL_SILENT;
+			else
+silent = 0;
 
 			error2 = scsipi_start(periph, SSS_START, silent);
 			switch (error2) {



CVS commit: src/sys/rump/dev/lib/libscsitest

2012-05-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun May  6 16:58:31 UTC 2012

Modified Files:
src/sys/rump/dev/lib/libscsitest: scsitest.c

Log Message:
Revert previous and add a comment - I misunderstood what this code is
emulating.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/dev/lib/libscsitest/scsitest.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/dev/lib/libscsitest/scsitest.c
diff -u src/sys/rump/dev/lib/libscsitest/scsitest.c:1.2 src/sys/rump/dev/lib/libscsitest/scsitest.c:1.3
--- src/sys/rump/dev/lib/libscsitest/scsitest.c:1.2	Sun May  6 16:33:02 2012
+++ src/sys/rump/dev/lib/libscsitest/scsitest.c	Sun May  6 16:58:31 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsitest.c,v 1.2 2012/05/06 16:33:02 martin Exp $	*/
+/*	$NetBSD: scsitest.c,v 1.3 2012/05/06 16:58:31 martin Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: scsitest.c,v 1.2 2012/05/06 16:33:02 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: scsitest.c,v 1.3 2012/05/06 16:58:31 martin Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -221,7 +221,10 @@ scsitest_match(struct device *parent, st
 	if ((isofd = rumpuser_open(MYCDISO, O_RDWR, error)) == -1)
 		return 0;
 #else
-	isofd = -1;
+	/*
+	 * We pretend to have a medium present initially, so != -1.
+	 */
+	isofd = -2;
 #endif
 
 	return 1;



CVS commit: src/sys/dev/scsipi

2012-05-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun May  6 17:23:10 UTC 2012

Modified Files:
src/sys/dev/scsipi: cd.c

Log Message:
When ejecting a medium, invalidate the in core disklabel - it is not
meaningfull anymore. This makes the following cdclose() use silent
mode and finally fixes PR kern/43785.


To generate a diff of this commit:
cvs rdiff -u -r1.308 -r1.309 src/sys/dev/scsipi/cd.c

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

Modified files:

Index: src/sys/dev/scsipi/cd.c
diff -u src/sys/dev/scsipi/cd.c:1.308 src/sys/dev/scsipi/cd.c:1.309
--- src/sys/dev/scsipi/cd.c:1.308	Sun May  6 16:42:19 2012
+++ src/sys/dev/scsipi/cd.c	Sun May  6 17:23:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd.c,v 1.308 2012/05/06 16:42:19 martin Exp $	*/
+/*	$NetBSD: cd.c,v 1.309 2012/05/06 17:23:10 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation,
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cd.c,v 1.308 2012/05/06 16:42:19 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: cd.c,v 1.309 2012/05/06 17:23:10 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1570,7 +1570,24 @@ cdioctl(dev_t dev, u_long cmd, void *add
 		/* FALLTHROUGH */
 	case CDIOCEJECT: /* FALLTHROUGH */
 	case ODIOCEJECT:
-		return (scsipi_start(periph, SSS_STOP|SSS_LOEJ, 0));
+		error = scsipi_start(periph, SSS_STOP|SSS_LOEJ, 0);
+		if (error == 0) {
+			int i;
+
+			/*
+			 * We have just successfully ejected the medium,
+			 * all partitions cached are meaningless now.
+			 * Make sure cdclose() will do silent operations
+			 * now by marking all partitions unused.
+			 * Before any real access, a new (default-)disk-
+			 * label will be generated anyway.
+			 */
+			for (i = 0; i  cd-sc_dk.dk_label-d_npartitions;
+			i++)
+cd-sc_dk.dk_label-d_partitions[i].p_fstype =
+	FS_UNUSED;
+		}
+		return error;
 	case DIOCCACHESYNC:
 		/* SYNCHRONISE CACHES command */
 		return (cdcachesync(periph, 0));



CVS commit: src/tests/dev/scsipi

2012-05-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun May  6 17:27:22 UTC 2012

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

Log Message:
Comment out the expected failure, as it does not trigger anymore.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/dev/scsipi/t_cd.c

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

Modified files:

Index: src/tests/dev/scsipi/t_cd.c
diff -u src/tests/dev/scsipi/t_cd.c:1.3 src/tests/dev/scsipi/t_cd.c:1.4
--- src/tests/dev/scsipi/t_cd.c:1.3	Sun Mar 27 08:53:56 2011
+++ src/tests/dev/scsipi/t_cd.c	Sun May  6 17:27:22 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_cd.c,v 1.3 2011/03/27 08:53:56 mlelstv Exp $	*/
+/*	$NetBSD: t_cd.c,v 1.4 2012/05/06 17:27:22 martin Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -60,7 +60,7 @@ ATF_TC_BODY(noisyeject, tc)
 
 	ATF_REQUIRE_EQ(rump_scsitest_err[RUMP_SCSITEST_NOISYSYNC], 0);
 	RL(rump_sys_close(fd));
-	atf_tc_expect_fail(PR kern/43785);
+	// atf_tc_expect_fail(PR kern/43785);
 	ATF_REQUIRE_EQ(rump_scsitest_err[RUMP_SCSITEST_NOISYSYNC], 0);
 }
 



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

2012-05-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May  8 13:22:37 UTC 2012

Modified Files:
src/distrib/sets/lists/modules: md.evbppc

Log Message:
Add a few modules in booke/4xx compat lists - should fix the evbppc build.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/distrib/sets/lists/modules/md.evbppc

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/modules/md.evbppc
diff -u src/distrib/sets/lists/modules/md.evbppc:1.21 src/distrib/sets/lists/modules/md.evbppc:1.22
--- src/distrib/sets/lists/modules/md.evbppc:1.21	Thu Apr 26 22:09:53 2012
+++ src/distrib/sets/lists/modules/md.evbppc	Tue May  8 13:22:36 2012
@@ -1,4 +1,4 @@
-# $NetBSD: md.evbppc,v 1.21 2012/04/26 22:09:53 he Exp $
+# $NetBSD: md.evbppc,v 1.22 2012/05/08 13:22:36 martin Exp $
 ./stand/powerpc-4xx			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules	base-kernel-modules	kmod,compatmodules
@@ -70,6 +70,8 @@
 ./stand/powerpc-4xx/@OSRELEASE@/modules/gpiosim/gpiosim.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/hfsbase-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/hfs/hfs.kmod			base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/if_axe	base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/if_axe/if_axe.kmod			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/iicbase-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/iic/iic.kmod			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/iscsibase-kernel-modules	kmod,compatmodules
@@ -170,6 +172,8 @@
 ./stand/powerpc-4xx/@OSRELEASE@/modules/union/union.kmod			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/usbverbose			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/usbverbose/usbverbose.kmod	base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/vcoda	base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/vcoda/vcoda.kmod			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/v7fs base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/v7fs/v7fs.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/vnd base-kernel-modules	kmod,compatmodules
@@ -247,6 +251,8 @@
 ./stand/powerpc-booke/@OSRELEASE@/modules/gpiosim/gpiosim.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-booke/@OSRELEASE@/modules/hfsbase-kernel-modules	kmod,compatmodules
 ./stand/powerpc-booke/@OSRELEASE@/modules/hfs/hfs.kmod			base-kernel-modules	kmod,compatmodules
+./stand/powerpc-booke/@OSRELEASE@/if_axebase-kernel-modules	kmod,compatmodules
+./stand/powerpc-booke/@OSRELEASE@/if_axe/if_axe.kmod			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-booke/@OSRELEASE@/modules/iicbase-kernel-modules	kmod,compatmodules
 ./stand/powerpc-booke/@OSRELEASE@/modules/iic/iic.kmod			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-booke/@OSRELEASE@/modules/iscsibase-kernel-modules	kmod,compatmodules



CVS commit: src/distrib/utils/sysinst

2012-05-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May  8 13:51:34 UTC 2012

Modified Files:
src/distrib/utils/sysinst: util.c

Log Message:
Fix harmless error preventing auto-finding non-ISO9660 formatted CD
partitions (when offering sets from CD).


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/distrib/utils/sysinst/util.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/utils/sysinst/util.c
diff -u src/distrib/utils/sysinst/util.c:1.177 src/distrib/utils/sysinst/util.c:1.178
--- src/distrib/utils/sysinst/util.c:1.177	Mon Apr  9 23:18:31 2012
+++ src/distrib/utils/sysinst/util.c	Tue May  8 13:51:34 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.177 2012/04/09 23:18:31 jdf Exp $	*/
+/*	$NetBSD: util.c,v 1.178 2012/05/08 13:51:34 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -431,7 +431,8 @@ get_available_cds(void)
 		if (error == 0) {
 			for (part = 0; part  label.d_npartitions; part++) {
 if (label.d_partitions[part].p_fstype
-!= FS_ISO9660)
+	== FS_UNUSED
+|| label.d_partitions[part].p_size == 0)
 	continue;
 if (label.d_partitions[part].p_fstype
 == FS_ISO9660) {



CVS commit: src/sys/dev/ic

2012-05-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May  9 07:52:52 UTC 2012

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

Log Message:
PR port-acorn32/46435: type mismatch, padbuf should be unsigned char.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/ic/seeq8005.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/seeq8005.c
diff -u src/sys/dev/ic/seeq8005.c:1.46 src/sys/dev/ic/seeq8005.c:1.47
--- src/sys/dev/ic/seeq8005.c:1.46	Thu Feb  2 19:43:03 2012
+++ src/sys/dev/ic/seeq8005.c	Wed May  9 07:52:52 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: seeq8005.c,v 1.46 2012/02/02 19:43:03 tls Exp $ */
+/* $NetBSD: seeq8005.c,v 1.47 2012/05/09 07:52:52 martin Exp $ */
 
 /*
  * Copyright (c) 2000, 2001 Ben Harris
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: seeq8005.c,v 1.46 2012/02/02 19:43:03 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: seeq8005.c,v 1.47 2012/05/09 07:52:52 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -153,7 +153,7 @@ static void ea_mc_reset_8005(struct seeq
 static int ea_mediachange(struct ifnet *);
 static void ea_mediastatus(struct ifnet *, struct ifmediareq *);
 
-static char* padbuf = NULL;
+static u_char* padbuf = NULL;
 
 
 /*



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

2012-05-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May  9 08:17:33 UTC 2012

Modified Files:
src/distrib/sets/lists/modules: md.evbppc

Log Message:
Retry previous, but with proper path this time.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/distrib/sets/lists/modules/md.evbppc

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/modules/md.evbppc
diff -u src/distrib/sets/lists/modules/md.evbppc:1.22 src/distrib/sets/lists/modules/md.evbppc:1.23
--- src/distrib/sets/lists/modules/md.evbppc:1.22	Tue May  8 13:22:36 2012
+++ src/distrib/sets/lists/modules/md.evbppc	Wed May  9 08:17:33 2012
@@ -1,4 +1,4 @@
-# $NetBSD: md.evbppc,v 1.22 2012/05/08 13:22:36 martin Exp $
+# $NetBSD: md.evbppc,v 1.23 2012/05/09 08:17:33 martin Exp $
 ./stand/powerpc-4xx			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules	base-kernel-modules	kmod,compatmodules
@@ -70,8 +70,8 @@
 ./stand/powerpc-4xx/@OSRELEASE@/modules/gpiosim/gpiosim.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/hfsbase-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/hfs/hfs.kmod			base-kernel-modules	kmod,compatmodules
-./stand/powerpc-4xx/@OSRELEASE@/if_axe	base-kernel-modules	kmod,compatmodules
-./stand/powerpc-4xx/@OSRELEASE@/if_axe/if_axe.kmod			base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/if_axebase-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/if_axe/if_axe.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/iicbase-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/iic/iic.kmod			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/iscsibase-kernel-modules	kmod,compatmodules
@@ -172,8 +172,8 @@
 ./stand/powerpc-4xx/@OSRELEASE@/modules/union/union.kmod			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/usbverbose			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/usbverbose/usbverbose.kmod	base-kernel-modules	kmod,compatmodules
-./stand/powerpc-4xx/@OSRELEASE@/vcoda	base-kernel-modules	kmod,compatmodules
-./stand/powerpc-4xx/@OSRELEASE@/vcoda/vcoda.kmod			base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/vcodabase-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/vcoda/vcoda.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/v7fs base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/v7fs/v7fs.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/vnd base-kernel-modules	kmod,compatmodules
@@ -251,8 +251,8 @@
 ./stand/powerpc-booke/@OSRELEASE@/modules/gpiosim/gpiosim.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-booke/@OSRELEASE@/modules/hfsbase-kernel-modules	kmod,compatmodules
 ./stand/powerpc-booke/@OSRELEASE@/modules/hfs/hfs.kmod			base-kernel-modules	kmod,compatmodules
-./stand/powerpc-booke/@OSRELEASE@/if_axebase-kernel-modules	kmod,compatmodules
-./stand/powerpc-booke/@OSRELEASE@/if_axe/if_axe.kmod			base-kernel-modules	kmod,compatmodules
+./stand/powerpc-booke/@OSRELEASE@/modules/if_axe			base-kernel-modules	kmod,compatmodules
+./stand/powerpc-booke/@OSRELEASE@/modules/if_axe/if_axe.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-booke/@OSRELEASE@/modules/iicbase-kernel-modules	kmod,compatmodules
 ./stand/powerpc-booke/@OSRELEASE@/modules/iic/iic.kmod			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-booke/@OSRELEASE@/modules/iscsibase-kernel-modules	kmod,compatmodules



CVS commit: src/distrib/utils/sysinst/arch/i386

2012-05-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 15 08:47:53 UTC 2012

Modified Files:
src/distrib/utils/sysinst/arch/i386: msg.md.de

Log Message:
Tweak a few grammar errors


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/distrib/utils/sysinst/arch/i386/msg.md.de

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/arch/i386/msg.md.de
diff -u src/distrib/utils/sysinst/arch/i386/msg.md.de:1.22 src/distrib/utils/sysinst/arch/i386/msg.md.de:1.23
--- src/distrib/utils/sysinst/arch/i386/msg.md.de:1.22	Sat Mar  3 02:41:25 2012
+++ src/distrib/utils/sysinst/arch/i386/msg.md.de	Tue May 15 08:47:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.de,v 1.22 2012/03/03 02:41:25 tsutsui Exp $	*/
+/*	$NetBSD: msg.md.de,v 1.23 2012/05/15 08:47:53 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -55,22 +55,22 @@ message getboottype
 
 Normale Bootblöcke benutzen die BIOS Konsolenschnittstelle als Konsole
 (meistens der Monitor und die Tastatur). Serielle Bootblöcke benutzen den
-ersten seriellen Anschluss als Konsole.
+gewählten seriellen Anschluss als Konsole.
 
 Selektierter Bootblock: }
 
 message console_PC {BIOS Konsole}
-message console_com {Serieller Anschluss com%d mit %d baud}
+message console_com {Serielle Konsole an com%d mit %d baud}
 message console_unchanged {Unverändert}
 
 message Bootblocks_selection
 {Auswahl der Bootblöcke}
-message Use_normal_bootblocks	{BIOS Konsole benutzen}
-message Use_serial_com0		{Serieller Anschluss com0 benutzen}
-message Use_serial_com1		{Serieller Anschluss com1 benutzen}
-message Use_serial_com2		{Serieller Anschluss com2 benutzen}
-message Use_serial_com3		{Serieller Anschluss com3 benutzen}
-message serial_baud_rate	{Serielle baud Rate}
+message Use_normal_bootblocks	{BIOS Konsole}
+message Use_serial_com0		{Serielle Konsole an com0}
+message Use_serial_com1		{Serielle Konsole an com1}
+message Use_serial_com2		{Serielle Konsole an com2}
+message Use_serial_com3		{Serielle Konsole an com3}
+message serial_baud_rate	{Serielle Geschwindigkeit wählen...}
 message Use_existing_bootblocks	{Vorhandene Bootblöcke benutzen}
 
 message dobootblks



CVS commit: src/sys/kern

2012-05-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 16 09:41:11 UTC 2012

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

Log Message:
Make sure we can deliver two file descriptors for pipe2() before we set
up anything special (like close on exec).
Fixes PR kern/46457.


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/sys/kern/sys_pipe.c

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

Modified files:

Index: src/sys/kern/sys_pipe.c
diff -u src/sys/kern/sys_pipe.c:1.135 src/sys/kern/sys_pipe.c:1.136
--- src/sys/kern/sys_pipe.c:1.135	Wed Jan 25 00:28:36 2012
+++ src/sys/kern/sys_pipe.c	Wed May 16 09:41:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_pipe.c,v 1.135 2012/01/25 00:28:36 christos Exp $	*/
+/*	$NetBSD: sys_pipe.c,v 1.136 2012/05/16 09:41:11 martin Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sys_pipe.c,v 1.135 2012/01/25 00:28:36 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: sys_pipe.c,v 1.136 2012/05/16 09:41:11 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -267,21 +267,23 @@ pipe1(struct lwp *l, register_t *retval,
 	if (error)
 		goto free2;
 	retval[0] = fd;
-	rf-f_flag = FREAD | flags;
-	rf-f_type = DTYPE_PIPE;
-	rf-f_data = (void *)rpipe;
-	rf-f_ops = pipeops;
-	fd_set_exclose(l, fd, (flags  O_CLOEXEC) != 0);
 
 	error = fd_allocfile(wf, fd);
 	if (error)
 		goto free3;
 	retval[1] = fd;
+
+	rf-f_flag = FREAD | flags;
+	rf-f_type = DTYPE_PIPE;
+	rf-f_data = (void *)rpipe;
+	rf-f_ops = pipeops;
+	fd_set_exclose(l, (int)retval[0], (flags  O_CLOEXEC) != 0);
+
 	wf-f_flag = FWRITE | flags;
 	wf-f_type = DTYPE_PIPE;
 	wf-f_data = (void *)wpipe;
 	wf-f_ops = pipeops;
-	fd_set_exclose(l, fd, (flags  O_CLOEXEC) != 0);
+	fd_set_exclose(l, (int)retval[1], (flags  O_CLOEXEC) != 0);
 
 	rpipe-pipe_peer = wpipe;
 	wpipe-pipe_peer = rpipe;



CVS commit: src/tests/lib/libc/sys

2012-05-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 16 09:51:59 UTC 2012

Modified Files:
src/tests/lib/libc/sys: t_pipe2.c

Log Message:
Enable the test for PR kern/46457 now that it does not crash the
kernel any more.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/sys/t_pipe2.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_pipe2.c
diff -u src/tests/lib/libc/sys/t_pipe2.c:1.4 src/tests/lib/libc/sys/t_pipe2.c:1.5
--- src/tests/lib/libc/sys/t_pipe2.c:1.4	Wed May 16 09:06:35 2012
+++ src/tests/lib/libc/sys/t_pipe2.c	Wed May 16 09:51:58 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_pipe2.c,v 1.4 2012/05/16 09:06:35 jruoho Exp $ */
+/* $NetBSD: t_pipe2.c,v 1.5 2012/05/16 09:51:58 martin Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -36,13 +36,14 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_pipe2.c,v 1.4 2012/05/16 09:06:35 jruoho Exp $);
+__RCSID($NetBSD: t_pipe2.c,v 1.5 2012/05/16 09:51:58 martin Exp $);
 
 #include atf-c.h
 #include fcntl.h
 #include unistd.h
 #include stdlib.h
 #include errno.h
+#include sys/resource.h
 
 static void
 run(int flags)
@@ -107,10 +108,19 @@ ATF_TC_HEAD(pipe2_consume, tc)
 
 ATF_TC_BODY(pipe2_consume, tc)
 {
-	const size_t n = 200;
-	size_t i;
+	struct rlimit rl;
+	size_t i, n;
 
-	atf_tc_skip(The test case causes a panic (PR PR kern/46457));
+	getrlimit(RLIMIT_NOFILE, rl);
+	/*
+	 * Each pipe2 call will allocate two filedescriptors, make sure we
+	 * run into the limit...
+	 */
+	n = rl.rlim_cur/2+1;
+
+	/*
+	 * atf_tc_skip(The test case causes a panic (PR PR kern/46457));
+	 */
 
 	for (i = 0; i  n; i++) {
 



CVS commit: src/tests/lib/libc/sys

2012-05-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 16 13:48:35 UTC 2012

Modified Files:
src/tests/lib/libc/sys: t_pipe2.c

Log Message:
Simplify the test for PR kern/4645 and make it independend of resource
settings.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libc/sys/t_pipe2.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_pipe2.c
diff -u src/tests/lib/libc/sys/t_pipe2.c:1.6 src/tests/lib/libc/sys/t_pipe2.c:1.7
--- src/tests/lib/libc/sys/t_pipe2.c:1.6	Wed May 16 11:45:08 2012
+++ src/tests/lib/libc/sys/t_pipe2.c	Wed May 16 13:48:35 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_pipe2.c,v 1.6 2012/05/16 11:45:08 wiz Exp $ */
+/* $NetBSD: t_pipe2.c,v 1.7 2012/05/16 13:48:35 martin Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_pipe2.c,v 1.6 2012/05/16 11:45:08 wiz Exp $);
+__RCSID($NetBSD: t_pipe2.c,v 1.7 2012/05/16 13:48:35 martin Exp $);
 
 #include atf-c.h
 #include fcntl.h
@@ -109,26 +109,27 @@ ATF_TC_HEAD(pipe2_consume, tc)
 ATF_TC_BODY(pipe2_consume, tc)
 {
 	struct rlimit rl;
-	size_t i, n;
+	int err, filedes[2];
 
-	getrlimit(RLIMIT_NOFILE, rl);
+	err = fcntl(4, F_CLOSEM);
+	ATF_REQUIRE(err == 0);
+
+	err = getrlimit(RLIMIT_NOFILE, rl);
+	ATF_REQUIRE(err == 0);
 	/*
-	 * Each pipe2 call will allocate two filedescriptors, make sure we
-	 * run into the limit...
+	 * The heart of this test is to run against the number of open
+	 * file descriptor limit in the middle of a pipe2() call - i.e.
+	 * before the call only a single descriptor may be openend.
 	 */
-	n = rl.rlim_cur/2+1;
+	rl.rlim_cur = 4;
+	err = setrlimit(RLIMIT_NOFILE, rl);
+	ATF_REQUIRE(err == 0);
 
 	/*
 	 * atf_tc_skip(The test case causes a panic (PR kern/46457));
 	 */
-
-	for (i = 0; i  n; i++) {
-
-		int fildes[2];
-
-		if (pipe2(fildes, O_CLOEXEC) == -1)
-			return;
-	}
+	err = pipe2(filedes, O_CLOEXEC);
+	ATF_REQUIRE(err == -1);
 }
 
 ATF_TC(pipe2_nonblock);



CVS commit: src/tests/lib/libc/sys

2012-05-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 16 19:13:00 UTC 2012

Modified Files:
src/tests/lib/libc/sys: t_mmap.c

Log Message:
mmap_block:
do not use a hardcoded block device list, but query the kernel for attached
disks instead, then try to mmap the raw partition.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/sys/t_mmap.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_mmap.c
diff -u src/tests/lib/libc/sys/t_mmap.c:1.4 src/tests/lib/libc/sys/t_mmap.c:1.5
--- src/tests/lib/libc/sys/t_mmap.c:1.4	Tue Mar 13 06:37:03 2012
+++ src/tests/lib/libc/sys/t_mmap.c	Wed May 16 19:12:59 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mmap.c,v 1.4 2012/03/13 06:37:03 jruoho Exp $ */
+/* $NetBSD: t_mmap.c,v 1.5 2012/05/16 19:12:59 martin Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
  * SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_mmap.c,v 1.4 2012/03/13 06:37:03 jruoho Exp $);
+__RCSID($NetBSD: t_mmap.c,v 1.5 2012/05/16 19:12:59 martin Exp $);
 
 #include sys/param.h
 #include sys/mman.h
@@ -71,6 +71,8 @@ __RCSID($NetBSD: t_mmap.c,v 1.4 2012/03
 #include stdlib.h
 #include string.h
 #include unistd.h
+#include paths.h
+#include machine/disklabel.h
 
 static long	page = 0;
 static char	path[] = mmap;
@@ -157,26 +159,35 @@ ATF_TC(mmap_block);
 ATF_TC_HEAD(mmap_block, tc)
 {
 	atf_tc_set_md_var(tc, descr, Test mmap(2) with a block device);
+	atf_tc_set_md_var(tc, require.user, root);
 }
 
 ATF_TC_BODY(mmap_block, tc)
 {
-	static const char *dev[] = { /dev/wd0c, /dev/wd0d, /dev/wd0g };
-	char *map;
-	size_t i;
-	int fd;
+	static const int mib[] = { CTL_HW, HW_DISKNAMES };
+	static const unsigned int miblen = __arraycount(mib);
+	char *map, *dk, *drives, dev[PATH_MAX];
+	size_t len;
+	int fd = -1;
 
 	atf_tc_skip(The test case causes a panic (PR kern/38889));
 
-	for (i = 0; i  __arraycount(dev); i++) {
+	ATF_REQUIRE(sysctl(mib, miblen, NULL, len, NULL, 0) == 0);
+	drives = malloc(len);
+	ATF_REQUIRE(drives != NULL);
+	ATF_REQUIRE(sysctl(mib, miblen, drives, len, NULL, 0) == 0);
+	for (dk = strtok(drives,  ); dk != NULL; dk = strtok(NULL,  )) {
+		sprintf(dev, _PATH_DEV %s%c, dk, 'a'+RAW_PART);
+		fprintf(stderr, trying: %s\n, dev);
 
-		if ((fd = open(dev[i], O_RDONLY)) = 0) {
-			(void)fprintf(stderr, using %s\n, dev[i]);
+		if ((fd = open(dev, O_RDONLY)) = 0) {
+			(void)fprintf(stderr, using %s\n, dev);
 			break;
 		}
 	}
+	free(drives);
 
-	if (i == __arraycount(dev))
+	if (fd  0)
 		atf_tc_skip(failed to find suitable block device);
 
 	map = mmap(NULL, 4096, PROT_READ, MAP_FILE, fd, 0);



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: src/tests/lib/libc/sys

2012-05-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 22 09:23:39 UTC 2012

Modified Files:
src/tests/lib/libc/sys: t_lwp_create.c

Log Message:
Typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 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/tests/lib/libc/sys/t_lwp_create.c
diff -u src/tests/lib/libc/sys/t_lwp_create.c:1.1 src/tests/lib/libc/sys/t_lwp_create.c:1.2
--- src/tests/lib/libc/sys/t_lwp_create.c:1.1	Mon May 21 14:15:19 2012
+++ src/tests/lib/libc/sys/t_lwp_create.c	Tue May 22 09:23:39 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_lwp_create.c,v 1.1 2012/05/21 14:15:19 martin Exp $ */
+/* $NetBSD: t_lwp_create.c,v 1.2 2012/05/22 09:23:39 martin Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@ static void lwp_main_func(void* arg)
 }
 
 /*
- * Hard to docment - see usage examples below
+ * Hard to document - see usage examples below.
  */
 #define INVALID_UCONTEXT(ARCH,NAME,DESC)	\
 static void ARCH##_##NAME(ucontext_t *);	\



CVS commit: src/sys/dev/usb

2012-05-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 22 19:11:22 UTC 2012

Modified Files:
src/sys/dev/usb: usb_subr.c

Log Message:
Include opt_usb.h for USB_DEBUG.


To generate a diff of this commit:
cvs rdiff -u -r1.180 -r1.181 src/sys/dev/usb/usb_subr.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/usb/usb_subr.c
diff -u src/sys/dev/usb/usb_subr.c:1.180 src/sys/dev/usb/usb_subr.c:1.181
--- src/sys/dev/usb/usb_subr.c:1.180	Thu Jun  9 19:08:33 2011
+++ src/sys/dev/usb/usb_subr.c	Tue May 22 19:11:21 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_subr.c,v 1.180 2011/06/09 19:08:33 matt Exp $	*/
+/*	$NetBSD: usb_subr.c,v 1.181 2012/05/22 19:11:21 martin Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $	*/
 
 /*
@@ -32,10 +32,11 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: usb_subr.c,v 1.180 2011/06/09 19:08:33 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: usb_subr.c,v 1.181 2012/05/22 19:11:21 martin Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_usbverbose.h
+#include opt_usb.h
 
 #include sys/param.h
 #include sys/systm.h



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

2012-05-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 23 14:59:21 UTC 2012

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

Log Message:
Recently uvm_page_locked_p() leaked outside of uvm/MD code, so rump
needs to provide one.


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 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.125 src/sys/rump/librump/rumpkern/vm.c:1.126
--- src/sys/rump/librump/rumpkern/vm.c:1.125	Sat Mar 17 17:58:38 2012
+++ src/sys/rump/librump/rumpkern/vm.c	Wed May 23 14:59:21 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm.c,v 1.125 2012/03/17 17:58:38 hannken Exp $	*/
+/*	$NetBSD: vm.c,v 1.126 2012/05/23 14:59:21 martin Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vm.c,v 1.125 2012/03/17 17:58:38 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: vm.c,v 1.126 2012/05/23 14:59:21 martin Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -354,6 +354,16 @@ uvmspace_init(struct vmspace *vm, struct
 	vm-vm_refcnt = 1;
 }
 
+bool
+uvm_page_locked_p(struct vm_page *pg)
+{
+
+	if (pg-uobject != NULL) {
+		return mutex_owned(pg-uobject-vmobjlock);
+	}
+	return true;
+}
+
 void
 uvm_pagewire(struct vm_page *pg)
 {



CVS commit: src/tests/lib/libc/sys

2012-05-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 23 16:08:32 UTC 2012

Modified Files:
src/tests/lib/libc/sys: t_mincore.c

Log Message:
Simplify creation of a temporary file slightly, fix sizeof(buf) confusion
when buf is a pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/sys/t_mincore.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_mincore.c
diff -u src/tests/lib/libc/sys/t_mincore.c:1.4 src/tests/lib/libc/sys/t_mincore.c:1.5
--- src/tests/lib/libc/sys/t_mincore.c:1.4	Wed Mar 14 11:50:52 2012
+++ src/tests/lib/libc/sys/t_mincore.c	Wed May 23 16:08:32 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mincore.c,v 1.4 2012/03/14 11:50:52 jruoho Exp $ */
+/* $NetBSD: t_mincore.c,v 1.5 2012/05/23 16:08:32 martin Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_mincore.c,v 1.4 2012/03/14 11:50:52 jruoho Exp $);
+__RCSID($NetBSD: t_mincore.c,v 1.5 2012/05/23 16:08:32 martin Exp $);
 
 #include sys/mman.h
 #include sys/shm.h
@@ -141,7 +141,6 @@ ATF_TC_BODY(mincore_resid, tc)
 	void *addr, *addr2, *addr3, *buf;
 	size_t npgs = 0;
 	struct stat st;
-	ssize_t tot;
 	int fd, rv;
 
 	(void)memset(st, 0, sizeof(struct stat));
@@ -152,15 +151,8 @@ ATF_TC_BODY(mincore_resid, tc)
 	ATF_REQUIRE(fd = 0);
 	ATF_REQUIRE(buf != NULL);
 
-	tot = 0;
-
-	while (tot  page) {
-
-		rv = write(fd, buf, sizeof(buf));
-		ATF_REQUIRE(rv = 0);
-
-		tot += rv;
-	}
+	rv = write(fd, buf, page * 5);
+	ATF_REQUIRE(rv = 0);
 
 	ATF_REQUIRE(fd = 0);
 	ATF_REQUIRE(fstat(fd, st) == 0);



CVS commit: src/tests/lib/libexecinfo

2012-05-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun May 27 22:57:24 UTC 2012

Modified Files:
src/tests/lib/libexecinfo: Makefile

Log Message:
Fix destination directory


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libexecinfo/Makefile

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

Modified files:

Index: src/tests/lib/libexecinfo/Makefile
diff -u src/tests/lib/libexecinfo/Makefile:1.1 src/tests/lib/libexecinfo/Makefile:1.2
--- src/tests/lib/libexecinfo/Makefile:1.1	Sun May 27 18:47:18 2012
+++ src/tests/lib/libexecinfo/Makefile	Sun May 27 22:57:24 2012
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.1 2012/05/27 18:47:18 christos Exp $
+# $NetBSD: Makefile,v 1.2 2012/05/27 22:57:24 martin Exp $
 
 .include bsd.own.mk
 
-TESTSDIR=	${TESTSBASE}/lib/libm
+TESTSDIR=	${TESTSBASE}/lib/libexecinfo
 
 TESTS_C+=	t_backtrace
 



CVS commit: src/etc/mtree

2012-05-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun May 27 23:03:24 UTC 2012

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

Log Message:
Add new test directory


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

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

Modified files:

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.76 src/etc/mtree/NetBSD.dist.tests:1.77
--- src/etc/mtree/NetBSD.dist.tests:1.76	Fri May 18 15:25:26 2012
+++ src/etc/mtree/NetBSD.dist.tests	Sun May 27 23:03:24 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.76 2012/05/18 15:25:26 jruoho Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.77 2012/05/27 23:03:24 martin Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -75,6 +75,7 @@
 ./usr/libdata/debug/usr/tests/lib/libcurses
 ./usr/libdata/debug/usr/tests/lib/libdes
 ./usr/libdata/debug/usr/tests/lib/libevent
+./usr/libdata/debug/usr/tests/lib/libexecinfo
 ./usr/libdata/debug/usr/tests/lib/semaphore
 ./usr/libdata/debug/usr/tests/lib/semaphore/pthread
 ./usr/libdata/debug/usr/tests/lib/libm
@@ -216,6 +217,7 @@
 ./usr/tests/lib/semaphore
 ./usr/tests/lib/semaphore/pthread
 ./usr/tests/lib/libevent
+./usr/tests/lib/libexecinfo
 ./usr/tests/lib/libm
 ./usr/tests/lib/libobjc
 ./usr/tests/lib/libposix



CVS commit: src/tests/lib/libexecinfo

2012-05-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 28 09:51:34 UTC 2012

Modified Files:
src/tests/lib/libexecinfo: t_backtrace.c

Log Message:
Not a good idea to continue testing if basic assertions fail - only will
cause core dumps later.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libexecinfo/t_backtrace.c

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

Modified files:

Index: src/tests/lib/libexecinfo/t_backtrace.c
diff -u src/tests/lib/libexecinfo/t_backtrace.c:1.1 src/tests/lib/libexecinfo/t_backtrace.c:1.2
--- src/tests/lib/libexecinfo/t_backtrace.c:1.1	Sun May 27 18:47:18 2012
+++ src/tests/lib/libexecinfo/t_backtrace.c	Mon May 28 09:51:34 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_backtrace.c,v 1.1 2012/05/27 18:47:18 christos Exp $	*/
+/*	$NetBSD: t_backtrace.c,v 1.2 2012/05/28 09:51:34 martin Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_backtrace.c,v 1.1 2012/05/27 18:47:18 christos Exp $);
+__RCSID($NetBSD: t_backtrace.c,v 1.2 2012/05/28 09:51:34 martin Exp $);
 
 #include atf-c.h
 #include string.h
@@ -50,7 +50,7 @@ myfunc3(size_t ncalls)
 	char **strings;
 
 	nptrs = backtrace(buffer, __arraycount(buffer));
-	ATF_CHECK_EQ(nptrs, ncalls + 8);
+	ATF_REQUIRE_EQ(nptrs, ncalls + 8);
 
 	strings = backtrace_symbols_fmt(buffer, nptrs, %n);
 



CVS commit: src/sys/arch

2012-05-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 28 19:24:30 UTC 2012

Modified Files:
src/sys/arch/sparc/include: bootinfo.h
src/sys/arch/sparc/sparc: autoconf.c
src/sys/arch/sparc/stand/boot: boot.c
src/sys/arch/sparc/stand/ofwboot: boot.c
src/sys/arch/sparc64/include: bootinfo.h
src/sys/arch/sparc64/sparc64: autoconf.c

Log Message:
Pass the boothowto from the bootloader to the kernel.
If (an old) bootloader did not pass the flags, check explicitly if we
missed RB_USERCONF and invoke userconf_prompt() in MD code, as MI code
already missed it.
This fixes PR 46466.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sparc/include/bootinfo.h
cvs rdiff -u -r1.242 -r1.243 src/sys/arch/sparc/sparc/autoconf.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/sparc/stand/boot/boot.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/sparc/stand/ofwboot/boot.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sparc64/include/bootinfo.h
cvs rdiff -u -r1.185 -r1.186 src/sys/arch/sparc64/sparc64/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/sparc/include/bootinfo.h
diff -u src/sys/arch/sparc/include/bootinfo.h:1.5 src/sys/arch/sparc/include/bootinfo.h:1.6
--- src/sys/arch/sparc/include/bootinfo.h:1.5	Sat Mar  4 03:39:02 2006
+++ src/sys/arch/sparc/include/bootinfo.h	Mon May 28 19:24:29 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootinfo.h,v 1.5 2006/03/04 03:39:02 uwe Exp $	*/
+/*	$NetBSD: bootinfo.h,v 1.6 2012/05/28 19:24:29 martin Exp $	*/
 
 /*
  * Copyright (c) 1997
@@ -42,6 +42,7 @@ struct btinfo_common {
 #define BTINFO_MAGIC		1
 #define BTINFO_SYMTAB		2
 #define BTINFO_KERNELFILE	3
+#define BTINFO_BOOTHOWTO	4
 
 struct btinfo_magic {
 	struct btinfo_common common;
@@ -60,6 +61,11 @@ struct btinfo_kernelfile {
 	char name[1];	/* variable length */
 };
 
+struct btinfo_boothowto {
+	struct btinfo_common common;
+	int boothowto;
+};
+
 #ifdef _KERNEL
 void *lookup_bootinfo(int);
 #endif

Index: src/sys/arch/sparc/sparc/autoconf.c
diff -u src/sys/arch/sparc/sparc/autoconf.c:1.242 src/sys/arch/sparc/sparc/autoconf.c:1.243
--- src/sys/arch/sparc/sparc/autoconf.c:1.242	Sun Jul 17 23:18:23 2011
+++ src/sys/arch/sparc/sparc/autoconf.c	Mon May 28 19:24:29 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.242 2011/07/17 23:18:23 mrg Exp $ */
+/*	$NetBSD: autoconf.c,v 1.243 2012/05/28 19:24:29 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.242 2011/07/17 23:18:23 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.243 2012/05/28 19:24:29 martin Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -75,6 +75,7 @@ __KERNEL_RCSID(0, $NetBSD: autoconf.c,v
 #include sys/msgbuf.h
 #include sys/boot_flag.h
 #include sys/ksyms.h
+#include sys/userconf.h
 
 #include net/if.h
 #include net/if_ether.h
@@ -270,6 +271,7 @@ bootstrap(void)
 #else
 	extern int end[];
 #endif
+	struct btinfo_boothowto *bi_howto;
 
 	prom_init();
 
@@ -352,6 +354,11 @@ bootstrap(void)
 		(void*)bi_sym-esym);
 	}
 #endif
+
+	if ((bi_howto = lookup_bootinfo(BTINFO_BOOTHOWTO)) != NULL) {
+		boothowto = bi_howto-boothowto;
+printf(initialized boothowt from bootloader: %x\n, boothowto);
+	}
 }
 
 #if defined(SUN4M)  !defined(MSIIEP)
@@ -915,12 +922,21 @@ void
 cpu_configure(void)
 {
 	struct pcb *pcb0;
+	bool userconf = (boothowto  RB_USERCONF) != 0;
 
 	/* initialise the softintr system */
 	sparc_softintr_init();
 
 	/* build the bootpath */
 	bootpath_build();
+	if (((boothowto  RB_USERCONF) != 0)  !userconf)
+		/*
+		 * Old bootloaders do not pass boothowto, and MI code
+		 * has already handled userconfig before we get here
+		 * and finally fetch the right options. So if we missed
+		 * it, just do it here.
+ 		 */
+		userconf_prompt();
 
 #if defined(SUN4)
 	if (CPU_ISSUN4) {

Index: src/sys/arch/sparc/stand/boot/boot.c
diff -u src/sys/arch/sparc/stand/boot/boot.c:1.27 src/sys/arch/sparc/stand/boot/boot.c:1.28
--- src/sys/arch/sparc/stand/boot/boot.c:1.27	Sat Jan 22 19:19:23 2011
+++ src/sys/arch/sparc/stand/boot/boot.c	Mon May 28 19:24:29 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.27 2011/01/22 19:19:23 joerg Exp $ */
+/*	$NetBSD: boot.c,v 1.28 2012/05/28 19:24:29 martin Exp $ */
 
 /*-
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -244,6 +244,7 @@ main(void)
 	const char *k;
 	u_long	marks[MARK_MAX], bootinfo;
 	struct btinfo_symtab bi_sym;
+	struct btinfo_boothowto bi_howto;
 	void	*arg;
 
 #ifdef HEAP_VARIABLE
@@ -337,6 +338,10 @@ main(void)
 	bi_sym.esym = marks[MARK_END]  loadaddrmask;
 	bi_add(bi_sym, BTINFO_SYMTAB, sizeof(bi_sym));
 
+	/* Add boothowto */
+	bi_howto.boothowto = boothowto;
+	bi_add(bi_howto, BTINFO_BOOTHOWTO, sizeof(bi_howto));
+
 	/* Add kernel path to bootinfo */
 	i = sizeof(struct btinfo_common) + strlen(kernel) + 1;
 	/* Impose limit (somewhat arbitrary) */

Index: 

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

2012-05-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 28 21:09:52 UTC 2012

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

Log Message:
Ooops, remove definitions duplicated in sparc/bootinfo.h


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sparc64/include/bootinfo.h

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

Modified files:

Index: src/sys/arch/sparc64/include/bootinfo.h
diff -u src/sys/arch/sparc64/include/bootinfo.h:1.6 src/sys/arch/sparc64/include/bootinfo.h:1.7
--- src/sys/arch/sparc64/include/bootinfo.h:1.6	Mon May 28 19:24:30 2012
+++ src/sys/arch/sparc64/include/bootinfo.h	Mon May 28 21:09:52 2012
@@ -1,4 +1,4 @@
-/*   $NetBSD: bootinfo.h,v 1.6 2012/05/28 19:24:30 martin Exp $*/
+/*   $NetBSD: bootinfo.h,v 1.7 2012/05/28 21:09:52 martin Exp $*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -98,7 +98,6 @@
 #define BTINFO_ITLB			103
 #define BTINFO_KERNEND			104
 #define BTINFO_BOOTDEV			105
-#define BTINFO_BOOTHOWTO		106
 
 #define LOOKUP_BOOTINFO(btp, info) \
 do { \
@@ -132,9 +131,4 @@ struct btinfo_bootdev {
 	char name[1];
 };
 
-struct btinfo_boothowto {
-	struct btinfo_common common;
-	int boothowto;
-};
-
 #endif /* _BOOTINFO_H_ */



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

2012-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 29 15:42:42 UTC 2012

Modified Files:
src/distrib/sets/lists/base: ad.mips64eb ad.mips64el

Log Message:
Add n64/o32 versions of libexecinfo


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/distrib/sets/lists/base/ad.mips64eb
cvs rdiff -u -r1.89 -r1.90 src/distrib/sets/lists/base/ad.mips64el

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/ad.mips64eb
diff -u src/distrib/sets/lists/base/ad.mips64eb:1.90 src/distrib/sets/lists/base/ad.mips64eb:1.91
--- src/distrib/sets/lists/base/ad.mips64eb:1.90	Wed May  2 02:43:00 2012
+++ src/distrib/sets/lists/base/ad.mips64eb	Tue May 29 15:42:42 2012
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips64eb,v 1.90 2012/05/02 02:43:00 christos Exp $
+# $NetBSD: ad.mips64eb,v 1.91 2012/05/29 15:42:42 martin Exp $
 ./libexec/ld.elf_so-64base-compat-shlib	compat,pic
 ./libexec/ld.elf_so-o32base-sysutil-bin	compat,pic
 ./usr/lib/64	base-compat-lib
@@ -63,6 +63,8 @@
 ./usr/lib/64/libbluetooth.so.4.2		base-compat-shlib	compat,pic
 ./usr/lib/64/libbsdmalloc.so.0			base-compat-shlib	compat,pic
 ./usr/lib/64/libbsdmalloc.so.0.0		base-compat-shlib	compat,pic
+./usr/lib/64/libexecinfo.so.0			base-compat-shlib	compat,pic
+./usr/lib/64/libexecinfo.so.0.0			base-compat-shlib	compat,pic
 ./usr/lib/64/libbz2.so.1			base-compat-shlib	compat,pic
 ./usr/lib/64/libbz2.so.1.1			base-compat-shlib	compat,pic
 ./usr/lib/64/libc.so.12base-compat-shlib	compat,pic
@@ -568,6 +570,8 @@
 ./usr/lib/o32/libwind.so.0.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/o32/libwrap.so.1			base-compat-shlib	compat,pic
 ./usr/lib/o32/libwrap.so.1.0			base-compat-shlib	compat,pic
+./usr/lib/o32/libexecinfo.so.0			base-compat-shlib	compat,pic
+./usr/lib/o32/libexecinfo.so.0.0		base-compat-shlib	compat,pic
 ./usr/lib/o32/libz.so.1base-compat-shlib	compat,pic
 ./usr/lib/o32/libz.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/o32/luabase-compat-shlib	compat

Index: src/distrib/sets/lists/base/ad.mips64el
diff -u src/distrib/sets/lists/base/ad.mips64el:1.89 src/distrib/sets/lists/base/ad.mips64el:1.90
--- src/distrib/sets/lists/base/ad.mips64el:1.89	Wed May  2 02:43:00 2012
+++ src/distrib/sets/lists/base/ad.mips64el	Tue May 29 15:42:42 2012
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips64el,v 1.89 2012/05/02 02:43:00 christos Exp $
+# $NetBSD: ad.mips64el,v 1.90 2012/05/29 15:42:42 martin Exp $
 ./libexec/ld.elf_so-64base-compat-shlib	compat,pic
 ./libexec/ld.elf_so-o32base-sysutil-bin	compat,pic
 ./usr/lib/64	base-compat-lib
@@ -270,6 +270,8 @@
 ./usr/lib/64/libwind.so.0.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/64/libwrap.so.1			base-compat-shlib	compat,pic
 ./usr/lib/64/libwrap.so.1.0			base-compat-shlib	compat,pic
+./usr/lib/64/libexecinfo.so.0			base-compat-shlib	compat,pic
+./usr/lib/64/libexecinfo.so.0.0			base-compat-shlib	compat,pic
 ./usr/lib/64/libz.so.1base-compat-shlib	compat,pic
 ./usr/lib/64/libz.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/64/luabase-compat-shlib	compat
@@ -568,6 +570,8 @@
 ./usr/lib/o32/libwind.so.0.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/o32/libwrap.so.1			base-compat-shlib	compat,pic
 ./usr/lib/o32/libwrap.so.1.0			base-compat-shlib	compat,pic
+./usr/lib/o32/libexecinfo.so.0			base-compat-shlib	compat,pic
+./usr/lib/o32/libexecinfo.so.0.0		base-compat-shlib	compat,pic
 ./usr/lib/o32/libz.so.1base-compat-shlib	compat,pic
 ./usr/lib/o32/libz.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/o32/luabase-compat-shlib	compat



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

2012-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 29 22:43:24 UTC 2012

Modified Files:
src/distrib/sets/lists/base: md.sparc64

Log Message:
Add 32bit libexecinfo version


To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.156 src/distrib/sets/lists/base/md.sparc64

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.sparc64
diff -u src/distrib/sets/lists/base/md.sparc64:1.155 src/distrib/sets/lists/base/md.sparc64:1.156
--- src/distrib/sets/lists/base/md.sparc64:1.155	Wed May  2 02:43:00 2012
+++ src/distrib/sets/lists/base/md.sparc64	Tue May 29 22:43:24 2012
@@ -1,4 +1,4 @@
-# $NetBSD: md.sparc64,v 1.155 2012/05/02 02:43:00 christos Exp $
+# $NetBSD: md.sparc64,v 1.156 2012/05/29 22:43:24 martin Exp $
 ./libexec/ld.elf_so-sparc			base-sysutil-bin	compat,pic
 ./sbin/edlabel	base-sysutil-root	obsolete
 ./usr/bin/fdformatbase-util-bin
@@ -271,6 +271,8 @@
 ./usr/lib/sparc/libwind.so.0.0			base-compat-shlib	compat,pic,kerberos
 ./usr/lib/sparc/libwrap.so.1			base-compat-shlib	compat,pic
 ./usr/lib/sparc/libwrap.so.1.0			base-compat-shlib	compat,pic
+./usr/lib/sparc/libexecinfo.so.0		base-compat-shlib	compat,pic
+./usr/lib/sparc/libexecinfo.so.0.0 		base-compat-shlib	compat,pic
 ./usr/lib/sparc/libz.so.1			base-compat-shlib	compat,pic
 ./usr/lib/sparc/libz.so.1.0			base-compat-shlib	compat,pic
 ./usr/lib/sparc/luabase-compat-shlib	compat



CVS commit: src/tests/lib/libexecinfo

2012-05-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 30 06:01:22 UTC 2012

Modified Files:
src/tests/lib/libexecinfo: t_backtrace.c

Log Message:
Skip test on non-amd64 machines for now, pointing to PR 46490.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libexecinfo/t_backtrace.c

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

Modified files:

Index: src/tests/lib/libexecinfo/t_backtrace.c
diff -u src/tests/lib/libexecinfo/t_backtrace.c:1.2 src/tests/lib/libexecinfo/t_backtrace.c:1.3
--- src/tests/lib/libexecinfo/t_backtrace.c:1.2	Mon May 28 09:51:34 2012
+++ src/tests/lib/libexecinfo/t_backtrace.c	Wed May 30 06:01:22 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_backtrace.c,v 1.2 2012/05/28 09:51:34 martin Exp $	*/
+/*	$NetBSD: t_backtrace.c,v 1.3 2012/05/30 06:01:22 martin Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,9 +29,10 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_backtrace.c,v 1.2 2012/05/28 09:51:34 martin Exp $);
+__RCSID($NetBSD: t_backtrace.c,v 1.3 2012/05/30 06:01:22 martin Exp $);
 
 #include atf-c.h
+#include atf-c/config.h
 #include string.h
 #include stdlib.h
 #include execinfo.h
@@ -96,6 +97,12 @@ ATF_TC_HEAD(backtrace_fmt_basic, tc)
 
 ATF_TC_BODY(backtrace_fmt_basic, tc)
 {
+	const char *arch = atf_config_get(atf_machine);
+
+if (strcmp(arch, amd64) != 0)
+	atf_tc_skip(PR toolchain/46490: libexecinfo only
+		 works on amd64 currently);
+
 	myfunc(12);
 }
 



CVS commit: src/external/bsd/tmux/dist

2012-05-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May 31 19:14:56 UTC 2012

Modified Files:
src/external/bsd/tmux/dist: tmux.c

Log Message:
Make sure to have file descriptors 0-2 open before doing further setup.
Otherwise strange invocations could trick us into passing the event
descriptor as, for example, stdin to the server.
See PR 46463 for details.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/tmux/dist/tmux.c

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

Modified files:

Index: src/external/bsd/tmux/dist/tmux.c
diff -u src/external/bsd/tmux/dist/tmux.c:1.1.1.2 src/external/bsd/tmux/dist/tmux.c:1.2
--- src/external/bsd/tmux/dist/tmux.c:1.1.1.2	Wed Aug 17 18:40:05 2011
+++ src/external/bsd/tmux/dist/tmux.c	Thu May 31 19:14:56 2012
@@ -1,4 +1,4 @@
-/* $Id: tmux.c,v 1.1.1.2 2011/08/17 18:40:05 jmmv Exp $ */
+/* $Id: tmux.c,v 1.2 2012/05/31 19:14:56 martin Exp $ */
 
 /*
  * Copyright (c) 2007 Nicholas Marriott n...@users.sourceforge.net
@@ -213,6 +213,22 @@ shell_exec(const char *shell, const char
 	fatal(execl failed);
 }
 
+static void
+init_std_fds(void)
+{
+	int fd;
+
+	/*
+	 * Make sure the standard file descriptors are populated, so we
+	 * don't end up forwarding (for example) the event descriptor
+	 * instead of stdin to the server.
+	 */
+
+	while ((fd = open(/dev/null, O_RDWR)) = 2)
+		;
+	close(fd);	 
+}
+
 int
 main(int argc, char **argv)
 {
@@ -283,6 +299,7 @@ main(int argc, char **argv)
 	if (shell_cmd != NULL  argc != 0)
 		usage();
 
+	init_std_fds();
 	log_open_tty(debug_level);
 
 	if (!(flags  IDENTIFY_UTF8)) {



CVS commit: src/tests/lib/libc/sys

2012-05-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May 31 20:31:07 UTC 2012

Modified Files:
src/tests/lib/libc/sys: t_kevent.c

Log Message:
Add a (skipped for now) test case for PR 46463


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/sys/t_kevent.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_kevent.c
diff -u src/tests/lib/libc/sys/t_kevent.c:1.2 src/tests/lib/libc/sys/t_kevent.c:1.3
--- src/tests/lib/libc/sys/t_kevent.c:1.2	Sun Mar 18 07:00:52 2012
+++ src/tests/lib/libc/sys/t_kevent.c	Thu May 31 20:31:07 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_kevent.c,v 1.2 2012/03/18 07:00:52 jruoho Exp $ */
+/*	$NetBSD: t_kevent.c,v 1.3 2012/05/31 20:31:07 martin Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_kevent.c,v 1.2 2012/03/18 07:00:52 jruoho Exp $);
+__RCSID($NetBSD: t_kevent.c,v 1.3 2012/05/31 20:31:07 martin Exp $);
 
 #include sys/types.h
 #include sys/event.h
@@ -37,6 +37,14 @@ __RCSID($NetBSD: t_kevent.c,v 1.2 2012/
 #include atf-c.h
 #include time.h
 #include stdio.h
+#include stdlib.h
+#include string.h
+#include unistd.h
+#include err.h
+#include sys/event.h
+#include sys/time.h
+#include sys/socket.h
+#include sys/wait.h
 
 ATF_TC(kevent_zerotimer);
 ATF_TC_HEAD(kevent_zerotimer, tc)
@@ -56,10 +64,80 @@ ATF_TC_BODY(kevent_zerotimer, tc)
 	ATF_REQUIRE(kevent(kq, NULL, 0, ev, 1, NULL) == 1);
 }
 
+ATF_TC(kqueue_desc_passing);
+ATF_TC_HEAD(kqueue_desc_passing, tc)
+{
+	atf_tc_set_md_var(tc, descr, Checks that passing a kqueue to 
+		another process does not crash the kernel (PR 46463));
+}
+
+ATF_TC_BODY(kqueue_desc_passing, tc)
+{
+	pid_t child;
+	int s[2], storage, status, kq;
+	struct cmsghdr *msg;
+	struct iovec iov;
+	struct msghdr m;
+	struct kevent ev;
+
+	ATF_REQUIRE((kq = kqueue()) != -1);
+
+	atf_tc_skip(crashes kernel (PR 46463));
+
+	ATF_REQUIRE(socketpair(AF_LOCAL, SOCK_STREAM, 0, s) != -1);
+	msg = malloc(CMSG_SPACE(sizeof(int)));
+	m.msg_iov = iov;
+	m.msg_iovlen = 1;
+	m.msg_name = NULL;
+	m.msg_namelen = 0;
+	m.msg_control = msg;
+	m.msg_controllen = CMSG_SPACE(sizeof(int));
+
+	child = fork();
+	if (child == 0) {
+		close(s[0]);
+
+		iov.iov_base = storage;
+		iov.iov_len = sizeof(int);
+		m.msg_iov = iov;
+		m.msg_iovlen = 1;
+
+		if (recvmsg(s[1], m, 0) == -1)
+			err(1, child: could not recvmsg);
+
+		kq = *(int *)CMSG_DATA(msg);
+		printf(child (pid %d): received kq fd %d\n, getpid(), kq);
+		exit(0);
+	}
+
+	close(s[1]);
+
+	iov.iov_base = storage;
+	iov.iov_len = sizeof(int);
+
+	msg-cmsg_level = SOL_SOCKET;
+	msg-cmsg_type = SCM_RIGHTS;
+	msg-cmsg_len = CMSG_LEN(sizeof(int));
+
+	*(int *)CMSG_DATA(msg) = kq;
+
+	EV_SET(ev, 1, EVFILT_TIMER, EV_ADD|EV_ENABLE, 0, 1, 0);
+	ATF_CHECK(kevent(kq, ev, 1, NULL, 0, NULL) != -1);
+
+	printf(parent (pid %d): sending kq fd %d\n, getpid(), kq);
+	ATF_REQUIRE(sendmsg(s[0], m, 0) != -1);
+
+	close(kq);
+
+	waitpid(child, status, 0);
+	ATF_CHECK(WIFEXITED(status)  WEXITSTATUS(status)==0);
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 
 	ATF_TP_ADD_TC(tp, kevent_zerotimer);
+	ATF_TP_ADD_TC(tp, kqueue_desc_passing);
 
 	return atf_no_error();
 }



CVS commit: src/sys/uvm

2012-06-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jun  1 14:52:49 UTC 2012

Modified Files:
src/sys/uvm: uvm_vnode.c

Log Message:
Only use generic readahead on VREG vnodes, the space used to store the
context is not valid on other types.
Prevents the crash reported in PR kern/38889, but does not fix the
mmap of block devices, more work is needed (no size on VBLK vnodes).


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/uvm/uvm_vnode.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_vnode.c
diff -u src/sys/uvm/uvm_vnode.c:1.97 src/sys/uvm/uvm_vnode.c:1.98
--- src/sys/uvm/uvm_vnode.c:1.97	Tue Sep  6 16:41:55 2011
+++ src/sys/uvm/uvm_vnode.c	Fri Jun  1 14:52:48 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_vnode.c,v 1.97 2011/09/06 16:41:55 matt Exp $	*/
+/*	$NetBSD: uvm_vnode.c,v 1.98 2012/06/01 14:52:48 martin Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -45,7 +45,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_vnode.c,v 1.97 2011/09/06 16:41:55 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_vnode.c,v 1.98 2012/06/01 14:52:48 martin Exp $);
 
 #include opt_uvmhist.h
 
@@ -170,7 +170,8 @@ uvn_get(struct uvm_object *uobj, voff_t 
 
 	UVMHIST_LOG(ubchist, vp %p off 0x%x, vp, (int)offset, 0,0);
 
-	if ((access_type  VM_PROT_WRITE) == 0  (flags  PGO_LOCKED) == 0) {
+	if (vp-v_type == VREG  (access_type  VM_PROT_WRITE) == 0
+	 (flags  PGO_LOCKED) == 0) {
 		vn_ra_allocctx(vp);
 		uvm_ra_request(vp-v_ractx, advice, uobj, offset,
 		*npagesp  PAGE_SHIFT);



CVS commit: src/tests/lib/libc/sys

2012-06-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jun  1 15:59:22 UTC 2012

Modified Files:
src/tests/lib/libc/sys: t_mmap.c

Log Message:
Do not skip the block device mmap test, as it does not crash
the kernel any more. Mark it as expected failure instead.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/sys/t_mmap.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_mmap.c
diff -u src/tests/lib/libc/sys/t_mmap.c:1.5 src/tests/lib/libc/sys/t_mmap.c:1.6
--- src/tests/lib/libc/sys/t_mmap.c:1.5	Wed May 16 19:12:59 2012
+++ src/tests/lib/libc/sys/t_mmap.c	Fri Jun  1 15:59:21 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mmap.c,v 1.5 2012/05/16 19:12:59 martin Exp $ */
+/* $NetBSD: t_mmap.c,v 1.6 2012/06/01 15:59:21 martin Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
  * SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_mmap.c,v 1.5 2012/05/16 19:12:59 martin Exp $);
+__RCSID($NetBSD: t_mmap.c,v 1.6 2012/06/01 15:59:21 martin Exp $);
 
 #include sys/param.h
 #include sys/mman.h
@@ -170,7 +170,8 @@ ATF_TC_BODY(mmap_block, tc)
 	size_t len;
 	int fd = -1;
 
-	atf_tc_skip(The test case causes a panic (PR kern/38889));
+	atf_tc_expect_signal(SIGSEGV, mmap of block devices does not work 
+	(PR kern/38889));
 
 	ATF_REQUIRE(sysctl(mib, miblen, NULL, len, NULL, 0) == 0);
 	drives = malloc(len);



CVS commit: src/sys/dev/splash

2012-06-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jun  2 14:24:00 UTC 2012

Modified Files:
src/sys/dev/splash: splash.c

Log Message:
Nat Sloss in PR kern/46516: advance fb pointer by stride, not logical
width of the splash image.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/splash/splash.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/splash/splash.c
diff -u src/sys/dev/splash/splash.c:1.11 src/sys/dev/splash/splash.c:1.12
--- src/sys/dev/splash/splash.c:1.11	Tue Feb  8 23:28:24 2011
+++ src/sys/dev/splash/splash.c	Sat Jun  2 14:24:00 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: splash.c,v 1.11 2011/02/08 23:28:24 jmcneill Exp $ */
+/* $NetBSD: splash.c,v 1.12 2012/06/02 14:24:00 martin Exp $ */
 
 /*-
  * Copyright (c) 2006 Jared D. McNeill jmcne...@invisible.ca
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: splash.c,v 1.11 2011/02/08 23:28:24 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: splash.c,v 1.12 2012/06/02 14:24:00 martin Exp $);
 
 #include opt_splash.h
 
@@ -271,7 +271,7 @@ splash_render8(struct splash_info *si, c
 			fb[x] = SPLASH_INDEX(pix[0], pix[1], pix[2]) +
 SPLASH_CMAP_OFFSET;
 		}
-		fb += si-si_width;
+		fb += si-si_stride;
 	}
 
 	/* If we've just written to the shadow fb, copy it to the display */



CVS commit: src/sys/kern

2012-06-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jun  2 15:54:02 UTC 2012

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

Log Message:
Remove an unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/kern/kern_event.c

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

Modified files:

Index: src/sys/kern/kern_event.c
diff -u src/sys/kern/kern_event.c:1.75 src/sys/kern/kern_event.c:1.76
--- src/sys/kern/kern_event.c:1.75	Wed Jan 25 00:28:35 2012
+++ src/sys/kern/kern_event.c	Sat Jun  2 15:54:02 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_event.c,v 1.75 2012/01/25 00:28:35 christos Exp $	*/
+/*	$NetBSD: kern_event.c,v 1.76 2012/06/02 15:54:02 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_event.c,v 1.75 2012/01/25 00:28:35 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_event.c,v 1.76 2012/06/02 15:54:02 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1454,7 +1454,6 @@ static int
 kqueue_kqfilter(file_t *fp, struct knote *kn)
 {
 	struct kqueue *kq;
-	filedesc_t *fdp;
 
 	kq = ((file_t *)kn-kn_obj)-f_data;
 
@@ -1464,7 +1463,6 @@ kqueue_kqfilter(file_t *fp, struct knote
 		return 1;
 
 	kn-kn_fop = kqread_filtops;
-	fdp = curlwp-l_fd;
 	mutex_enter(kq-kq_lock);
 	SLIST_INSERT_HEAD(kq-kq_sel.sel_klist, kn, kn_selnext);
 	mutex_exit(kq-kq_lock);



CVS commit: src/sys/kern

2012-06-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jun  2 16:16:16 UTC 2012

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

Log Message:
Stopgap fix for PR kern/46463: disallow passing of kqueue descriptors
via SCM_RIGHT anxiliary socket messages.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sys/kern/uipc_usrreq.c

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

Modified files:

Index: src/sys/kern/uipc_usrreq.c
diff -u src/sys/kern/uipc_usrreq.c:1.136 src/sys/kern/uipc_usrreq.c:1.137
--- src/sys/kern/uipc_usrreq.c:1.136	Sun Jun 26 16:42:43 2011
+++ src/sys/kern/uipc_usrreq.c	Sat Jun  2 16:16:16 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_usrreq.c,v 1.136 2011/06/26 16:42:43 christos Exp $	*/
+/*	$NetBSD: uipc_usrreq.c,v 1.137 2012/06/02 16:16:16 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2004, 2008, 2009 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uipc_usrreq.c,v 1.136 2011/06/26 16:42:43 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: uipc_usrreq.c,v 1.137 2012/06/02 16:16:16 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1382,7 +1382,10 @@ unp_internalize(struct mbuf **controlp)
 			error = EAGAIN;
 			goto out;
 		}
-		if ((fp = fd_getfile(fd)) == NULL) {
+		if ((fp = fd_getfile(fd)) == NULL
+		|| fp-f_type == DTYPE_KQUEUE) {
+			if (fp)
+				fd_putfile(fd);
 			atomic_dec_uint(unp_rights);
 			nfds = i;
 			error = EBADF;



CVS commit: src/tests/lib/libc/sys

2012-06-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jun  2 16:52:18 UTC 2012

Modified Files:
src/tests/lib/libc/sys: t_kevent.c

Log Message:
adapt to new reality


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_kevent.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_kevent.c
diff -u src/tests/lib/libc/sys/t_kevent.c:1.3 src/tests/lib/libc/sys/t_kevent.c:1.4
--- src/tests/lib/libc/sys/t_kevent.c:1.3	Thu May 31 20:31:07 2012
+++ src/tests/lib/libc/sys/t_kevent.c	Sat Jun  2 16:52:18 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_kevent.c,v 1.3 2012/05/31 20:31:07 martin Exp $ */
+/*	$NetBSD: t_kevent.c,v 1.4 2012/06/02 16:52:18 martin Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,12 +29,13 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_kevent.c,v 1.3 2012/05/31 20:31:07 martin Exp $);
+__RCSID($NetBSD: t_kevent.c,v 1.4 2012/06/02 16:52:18 martin Exp $);
 
 #include sys/types.h
 #include sys/event.h
 
 #include atf-c.h
+#include errno.h
 #include time.h
 #include stdio.h
 #include stdlib.h
@@ -82,7 +83,7 @@ ATF_TC_BODY(kqueue_desc_passing, tc)
 
 	ATF_REQUIRE((kq = kqueue()) != -1);
 
-	atf_tc_skip(crashes kernel (PR 46463));
+	// atf_tc_skip(crashes kernel (PR 46463));
 
 	ATF_REQUIRE(socketpair(AF_LOCAL, SOCK_STREAM, 0, s) != -1);
 	msg = malloc(CMSG_SPACE(sizeof(int)));
@@ -125,7 +126,10 @@ ATF_TC_BODY(kqueue_desc_passing, tc)
 	ATF_CHECK(kevent(kq, ev, 1, NULL, 0, NULL) != -1);
 
 	printf(parent (pid %d): sending kq fd %d\n, getpid(), kq);
-	ATF_REQUIRE(sendmsg(s[0], m, 0) != -1);
+	if (sendmsg(s[0], m, 0) == -1) {
+		ATF_REQUIRE_EQ_MSG(errno, EBADF, errno is %d, errno);
+		atf_tc_skip(PR kern/46523);
+	}
 
 	close(kq);
 



CVS commit: src/tests/lib/libc/sys

2012-06-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun  5 08:44:22 UTC 2012

Modified Files:
src/tests/lib/libc/sys: Makefile t_mincore.c

Log Message:
Try to estimate the number of locked pages the mincore() test will need and
check it against resource limits, skipping the tests if it probably is too
low.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/sys/t_mincore.c

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

Modified files:

Index: src/tests/lib/libc/sys/Makefile
diff -u src/tests/lib/libc/sys/Makefile:1.23 src/tests/lib/libc/sys/Makefile:1.24
--- src/tests/lib/libc/sys/Makefile:1.23	Mon May 21 14:15:19 2012
+++ src/tests/lib/libc/sys/Makefile	Tue Jun  5 08:44:21 2012
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2012/05/21 14:15:19 martin Exp $
+# $NetBSD: Makefile,v 1.24 2012/06/05 08:44:21 martin Exp $
 
 MKMAN=	no
 
@@ -66,6 +66,7 @@ SRCS.t_mprotect=	t_mprotect.c ${SRCS_EXE
 
 LDADD.t_getpid+=-lpthread
 LDADD.t_posix_fadvise+= -lrumpvfs -lrump -lrumpuser -lpthread
+LDADD.t_mincore+=	-lkvm
 
 WARNS=			4
 

Index: src/tests/lib/libc/sys/t_mincore.c
diff -u src/tests/lib/libc/sys/t_mincore.c:1.5 src/tests/lib/libc/sys/t_mincore.c:1.6
--- src/tests/lib/libc/sys/t_mincore.c:1.5	Wed May 23 16:08:32 2012
+++ src/tests/lib/libc/sys/t_mincore.c	Tue Jun  5 08:44:21 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mincore.c,v 1.5 2012/05/23 16:08:32 martin Exp $ */
+/* $NetBSD: t_mincore.c,v 1.6 2012/06/05 08:44:21 martin Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_mincore.c,v 1.5 2012/05/23 16:08:32 martin Exp $);
+__RCSID($NetBSD: t_mincore.c,v 1.6 2012/06/05 08:44:21 martin Exp $);
 
 #include sys/mman.h
 #include sys/shm.h
@@ -67,10 +67,13 @@ __RCSID($NetBSD: t_mincore.c,v 1.5 2012
 #include atf-c.h
 #include errno.h
 #include fcntl.h
+#include kvm.h
 #include stdio.h
 #include stdlib.h
 #include string.h
 #include unistd.h
+#include sys/resource.h
+#include sys/sysctl.h
 
 static long		page = 0;
 static const char	path[] = mincore;
@@ -101,6 +104,28 @@ check_residency(void *addr, size_t npgs)
 	return resident;
 }
 
+/*
+ * Get an estimate of the current VM size
+ */
+static size_t
+vm_cur_pages(void)
+{
+	size_t res = 0;
+	kvm_t *kvm;
+	struct kinfo_proc2 *pi;
+	int cnt;
+
+	kvm = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, getprogname());
+	if (kvm == NULL)
+		return 0;
+	pi = kvm_getproc2(kvm, KERN_PROC_PID, getpid(), sizeof(*pi), cnt);
+	if (pi  cnt = 1)
+		res = pi[0].p_vm_vsize;
+	kvm_close(kvm);
+
+	return res;
+}
+
 ATF_TC(mincore_err);
 ATF_TC_HEAD(mincore_err, tc)
 {
@@ -142,6 +167,25 @@ ATF_TC_BODY(mincore_resid, tc)
 	size_t npgs = 0;
 	struct stat st;
 	int fd, rv;
+	struct rlimit rlim;
+	size_t needed_pages, limit_pages;
+
+	ATF_REQUIRE(getrlimit(RLIMIT_MEMLOCK, rlim) == 0);
+	limit_pages = rlim.rlim_cur / page;
+	/*
+	 * We can not exactly predict the number of pages resulting from
+	 * the test and the mlockall() call below.
+	 * Get a safe upper bound instead...
+	 */
+	needed_pages = vm_cur_pages();
+	/* we certainly will gow  by 128 pages */
+	needed_pages += 128;
+	/* add a bit of safety room */
+	needed_pages += 12;
+
+	if (needed_pages = limit_pages)
+		atf_tc_skip(too low limits on locked memory (may need %zu 
+		pages, limit is %zu pages), needed_pages, limit_pages);
 
 	(void)memset(st, 0, sizeof(struct stat));
 



CVS commit: src/sys/kern

2012-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun  6 11:20:22 UTC 2012

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

Log Message:
Henning Petersen in PR kern/46552: include cosmetics


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/sys/kern/kern_proc.c

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

Modified files:

Index: src/sys/kern/kern_proc.c
diff -u src/sys/kern/kern_proc.c:1.184 src/sys/kern/kern_proc.c:1.185
--- src/sys/kern/kern_proc.c:1.184	Tue Jun  5 08:23:05 2012
+++ src/sys/kern/kern_proc.c	Wed Jun  6 11:20:21 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_proc.c,v 1.184 2012/06/05 08:23:05 martin Exp $	*/
+/*	$NetBSD: kern_proc.c,v 1.185 2012/06/06 11:20:21 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_proc.c,v 1.184 2012/06/05 08:23:05 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_proc.c,v 1.185 2012/06/06 11:20:21 martin Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_kstack.h
@@ -90,7 +90,7 @@ __KERNEL_RCSID(0, $NetBSD: kern_proc.c,
 #include sys/signalvar.h
 #include sys/ras.h
 #include sys/filedesc.h
-#include sys/syscall_stats.h
+#include sys/syscall_stats.h
 #include sys/kauth.h
 #include sys/sleepq.h
 #include sys/atomic.h
@@ -101,7 +101,6 @@ __KERNEL_RCSID(0, $NetBSD: kern_proc.c,
 #include sys/cpu.h
 
 #include uvm/uvm_extern.h
-#include uvm/uvm_extern.h
 
 #ifdef COMPAT_NETBSD32
 #include compat/netbsd32/netbsd32.h



CVS commit: src

2012-06-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun  6 21:23:10 UTC 2012

Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/tests/usr.bin: Makefile
Added Files:
src/tests/usr.bin/infocmp: Makefile t_terminfo.sh

Log Message:
Add a basic test for infocmp - this would have cought todays terminfo
lossage (PR lib/46553).


To generate a diff of this commit:
cvs rdiff -u -r1.472 -r1.473 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.77 -r1.78 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.14 -r1.15 src/tests/usr.bin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/infocmp/Makefile \
src/tests/usr.bin/infocmp/t_terminfo.sh

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.472 src/distrib/sets/lists/tests/mi:1.473
--- src/distrib/sets/lists/tests/mi:1.472	Sun Jun  3 23:19:10 2012
+++ src/distrib/sets/lists/tests/mi	Wed Jun  6 21:23:10 2012
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.472 2012/06/03 23:19:10 joerg Exp $
+# $NetBSD: mi,v 1.473 2012/06/06 21:23:10 martin Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -3081,6 +3081,9 @@
 ./usr/tests/usr.bin/id/t_groups			tests-usr.bin-tests	atf
 ./usr/tests/usr.bin/id/t_id			tests-usr.bin-tests	atf
 ./usr/tests/usr.bin/id/t_whoami			tests-usr.bin-tests	atf
+./usr/tests/usr.bin/infocmp			tests-usr.bin-tests
+./usr/tests/usr.bin/infocmp/Atffile		tests-usr.bin-tests	atf
+./usr/tests/usr.bin/infocmp/t_terminfo		tests-usr.bin-tests	atf
 ./usr/tests/usr.bin/jottests-usr.bin-tests
 ./usr/tests/usr.bin/jot/Atffile			tests-usr.bin-tests	atf
 ./usr/tests/usr.bin/jot/d_basic.out		tests-usr.bin-tests	atf

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.77 src/etc/mtree/NetBSD.dist.tests:1.78
--- src/etc/mtree/NetBSD.dist.tests:1.77	Sun May 27 23:03:24 2012
+++ src/etc/mtree/NetBSD.dist.tests	Wed Jun  6 21:23:10 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.77 2012/05/27 23:03:24 martin Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.78 2012/06/06 21:23:10 martin Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -285,6 +285,7 @@
 ./usr/tests/usr.bin/grep
 ./usr/tests/usr.bin/gzip
 ./usr/tests/usr.bin/id
+./usr/tests/usr.bin/infocmp
 ./usr/tests/usr.bin/jot
 ./usr/tests/usr.bin/m4
 ./usr/tests/usr.bin/make

Index: src/tests/usr.bin/Makefile
diff -u src/tests/usr.bin/Makefile:1.14 src/tests/usr.bin/Makefile:1.15
--- src/tests/usr.bin/Makefile:1.14	Fri May 18 15:25:25 2012
+++ src/tests/usr.bin/Makefile	Wed Jun  6 21:23:10 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.14 2012/05/18 15:25:25 jruoho Exp $
+#	$NetBSD: Makefile,v 1.15 2012/06/06 21:23:10 martin Exp $
 #
 
 .include bsd.own.mk
@@ -6,7 +6,7 @@
 TESTSDIR=   ${TESTSBASE}/usr.bin
 
 TESTS_SUBDIRS=	awk basename bzip2 cc cmp config cut \
-		diff dirname find grep gzip id jot m4 make mkdep \
+		diff dirname find grep gzip id infocmp jot m4 make mkdep \
 		pr rump_server shmif_dumpbus sdiff sed sort tmux unifdef xlint
 
 .include bsd.test.mk

Added files:

Index: src/tests/usr.bin/infocmp/Makefile
diff -u /dev/null src/tests/usr.bin/infocmp/Makefile:1.1
--- /dev/null	Wed Jun  6 21:23:10 2012
+++ src/tests/usr.bin/infocmp/Makefile	Wed Jun  6 21:23:10 2012
@@ -0,0 +1,9 @@
+# $NetBSD: Makefile,v 1.1 2012/06/06 21:23:10 martin Exp $
+
+.include bsd.own.mk
+
+TESTSDIR=	${TESTSBASE}/usr.bin/infocmp
+
+TESTS_SH=	t_terminfo
+
+.include bsd.test.mk
Index: src/tests/usr.bin/infocmp/t_terminfo.sh
diff -u /dev/null src/tests/usr.bin/infocmp/t_terminfo.sh:1.1
--- /dev/null	Wed Jun  6 21:23:10 2012
+++ src/tests/usr.bin/infocmp/t_terminfo.sh	Wed Jun  6 21:23:10 2012
@@ -0,0 +1,62 @@
+#	$NetBSD: t_terminfo.sh,v 1.1 2012/06/06 21:23:10 martin Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS 

CVS commit: src/tests/lib/libc/sys

2012-06-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun  7 09:59:51 UTC 2012

Modified Files:
src/tests/lib/libc/sys: Makefile t_mincore.c

Log Message:
Revert previous - instead of guessing the amount of needed memory locked
limits (often way too high) and skipping the test case if in doubt,
raise the limits as far as we can, and fix a few places in the test where
we could run into the limits and either skip or fail with a reasonable
message.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libc/sys/t_mincore.c

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

Modified files:

Index: src/tests/lib/libc/sys/Makefile
diff -u src/tests/lib/libc/sys/Makefile:1.24 src/tests/lib/libc/sys/Makefile:1.25
--- src/tests/lib/libc/sys/Makefile:1.24	Tue Jun  5 08:44:21 2012
+++ src/tests/lib/libc/sys/Makefile	Thu Jun  7 09:59:51 2012
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.24 2012/06/05 08:44:21 martin Exp $
+# $NetBSD: Makefile,v 1.25 2012/06/07 09:59:51 martin Exp $
 
 MKMAN=	no
 
@@ -66,7 +66,6 @@ SRCS.t_mprotect=	t_mprotect.c ${SRCS_EXE
 
 LDADD.t_getpid+=-lpthread
 LDADD.t_posix_fadvise+= -lrumpvfs -lrump -lrumpuser -lpthread
-LDADD.t_mincore+=	-lkvm
 
 WARNS=			4
 

Index: src/tests/lib/libc/sys/t_mincore.c
diff -u src/tests/lib/libc/sys/t_mincore.c:1.6 src/tests/lib/libc/sys/t_mincore.c:1.7
--- src/tests/lib/libc/sys/t_mincore.c:1.6	Tue Jun  5 08:44:21 2012
+++ src/tests/lib/libc/sys/t_mincore.c	Thu Jun  7 09:59:51 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mincore.c,v 1.6 2012/06/05 08:44:21 martin Exp $ */
+/* $NetBSD: t_mincore.c,v 1.7 2012/06/07 09:59:51 martin Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_mincore.c,v 1.6 2012/06/05 08:44:21 martin Exp $);
+__RCSID($NetBSD: t_mincore.c,v 1.7 2012/06/07 09:59:51 martin Exp $);
 
 #include sys/mman.h
 #include sys/shm.h
@@ -73,7 +73,6 @@ __RCSID($NetBSD: t_mincore.c,v 1.6 2012
 #include string.h
 #include unistd.h
 #include sys/resource.h
-#include sys/sysctl.h
 
 static long		page = 0;
 static const char	path[] = mincore;
@@ -95,8 +94,10 @@ check_residency(void *addr, size_t npgs)
 		if (vec[i] != 0)
 			resident++;
 
+#if 0
 		(void)fprintf(stderr, page 0x%p is %sresident\n,
 		(char *)addr + (i * page), vec[i] ?  : not );
+#endif
 	}
 
 	free(vec);
@@ -104,28 +105,6 @@ check_residency(void *addr, size_t npgs)
 	return resident;
 }
 
-/*
- * Get an estimate of the current VM size
- */
-static size_t
-vm_cur_pages(void)
-{
-	size_t res = 0;
-	kvm_t *kvm;
-	struct kinfo_proc2 *pi;
-	int cnt;
-
-	kvm = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, getprogname());
-	if (kvm == NULL)
-		return 0;
-	pi = kvm_getproc2(kvm, KERN_PROC_PID, getpid(), sizeof(*pi), cnt);
-	if (pi  cnt = 1)
-		res = pi[0].p_vm_vsize;
-	kvm_close(kvm);
-
-	return res;
-}
-
 ATF_TC(mincore_err);
 ATF_TC_HEAD(mincore_err, tc)
 {
@@ -164,28 +143,14 @@ ATF_TC_HEAD(mincore_resid, tc)
 ATF_TC_BODY(mincore_resid, tc)
 {
 	void *addr, *addr2, *addr3, *buf;
-	size_t npgs = 0;
+	size_t npgs = 0, resident;
 	struct stat st;
 	int fd, rv;
 	struct rlimit rlim;
-	size_t needed_pages, limit_pages;
 
 	ATF_REQUIRE(getrlimit(RLIMIT_MEMLOCK, rlim) == 0);
-	limit_pages = rlim.rlim_cur / page;
-	/*
-	 * We can not exactly predict the number of pages resulting from
-	 * the test and the mlockall() call below.
-	 * Get a safe upper bound instead...
-	 */
-	needed_pages = vm_cur_pages();
-	/* we certainly will gow  by 128 pages */
-	needed_pages += 128;
-	/* add a bit of safety room */
-	needed_pages += 12;
-
-	if (needed_pages = limit_pages)
-		atf_tc_skip(too low limits on locked memory (may need %zu 
-		pages, limit is %zu pages), needed_pages, limit_pages);
+	rlim.rlim_cur = rlim.rlim_max;
+	ATF_REQUIRE(setrlimit(RLIMIT_MEMLOCK, rlim) == 0);
 
 	(void)memset(st, 0, sizeof(struct stat));
 
@@ -215,7 +180,9 @@ ATF_TC_BODY(mincore_resid, tc)
 
 	(void)check_residency(addr, npgs);
 
-	ATF_REQUIRE(mlock(addr, npgs * page) == 0);
+	rv = mlock(addr, npgs * page);
+	if (rv == -1  errno == EAGAIN)
+		atf_tc_skip(hit process resource limits);
 	ATF_REQUIRE(munmap(addr, st.st_size) == 0);
 
 	npgs = 128;
@@ -224,7 +191,8 @@ ATF_TC_BODY(mincore_resid, tc)
 	MAP_ANON | MAP_PRIVATE | MAP_WIRED, -1, (off_t)0);
 
 	if (addr == MAP_FAILED)
-		return;
+		atf_tc_fail(could not mmap wired anonymous test area, system 
+		might be low on memory);
 
 	ATF_REQUIRE(check_residency(addr, npgs) == npgs);
 	ATF_REQUIRE(munmap(addr, npgs * page) == 0);
@@ -234,8 +202,7 @@ ATF_TC_BODY(mincore_resid, tc)
 	addr = mmap(NULL, npgs * page, PROT_READ | PROT_WRITE,
 	MAP_ANON | MAP_PRIVATE, -1, (off_t)0);
 
-	if (addr == MAP_FAILED)
-		return;
+	ATF_REQUIRE(addr != MAP_FAILED);
 
 	/*
 	 * Check that the in-core pages match the locked pages.

CVS commit: src/tests/lib/libc/sys

2012-06-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jun  8 07:18:58 UTC 2012

Modified Files:
src/tests/lib/libc/sys: t_mincore.c

Log Message:
Degrade all intermediate failures due to memory/resource shortage to
skip instead of fail - only if we get through to the real meat, we
can tell wether mlockall/mincore work or not.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/sys/t_mincore.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_mincore.c
diff -u src/tests/lib/libc/sys/t_mincore.c:1.7 src/tests/lib/libc/sys/t_mincore.c:1.8
--- src/tests/lib/libc/sys/t_mincore.c:1.7	Thu Jun  7 09:59:51 2012
+++ src/tests/lib/libc/sys/t_mincore.c	Fri Jun  8 07:18:58 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mincore.c,v 1.7 2012/06/07 09:59:51 martin Exp $ */
+/* $NetBSD: t_mincore.c,v 1.8 2012/06/08 07:18:58 martin Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_mincore.c,v 1.7 2012/06/07 09:59:51 martin Exp $);
+__RCSID($NetBSD: t_mincore.c,v 1.8 2012/06/08 07:18:58 martin Exp $);
 
 #include sys/mman.h
 #include sys/shm.h
@@ -191,7 +191,7 @@ ATF_TC_BODY(mincore_resid, tc)
 	MAP_ANON | MAP_PRIVATE | MAP_WIRED, -1, (off_t)0);
 
 	if (addr == MAP_FAILED)
-		atf_tc_fail(could not mmap wired anonymous test area, system 
+		atf_tc_skip(could not mmap wired anonymous test area, system 
 		might be low on memory);
 
 	ATF_REQUIRE(check_residency(addr, npgs) == npgs);
@@ -225,7 +225,7 @@ ATF_TC_BODY(mincore_resid, tc)
 	addr3 = mmap(NULL, npgs * page, PROT_NONE, MAP_ANON, -1, (off_t)0);
 
 	if (addr2 == MAP_FAILED || addr3 == MAP_FAILED)
-		atf_tc_fail(could not mmap more anonymous test pages with 
+		atf_tc_skip(could not mmap more anonymous test pages with 
 		mlockall(MCL_FUTURE) in effect, system 
 		might be low on memory);
 



CVS commit: src/lib/libc/citrus

2012-06-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jun  8 07:49:42 UTC 2012

Modified Files:
src/lib/libc/citrus: citrus_mapper.c

Log Message:
Henning Petersen in PR lib/46560: fix memory leak in error path


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

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

Modified files:

Index: src/lib/libc/citrus/citrus_mapper.c
diff -u src/lib/libc/citrus/citrus_mapper.c:1.9 src/lib/libc/citrus/citrus_mapper.c:1.10
--- src/lib/libc/citrus/citrus_mapper.c:1.9	Sat Nov 19 18:43:40 2011
+++ src/lib/libc/citrus/citrus_mapper.c	Fri Jun  8 07:49:42 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_mapper.c,v 1.9 2011/11/19 18:43:40 tnozaki Exp $	*/
+/*	$NetBSD: citrus_mapper.c,v 1.10 2012/06/08 07:49:42 martin Exp $	*/
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: citrus_mapper.c,v 1.9 2011/11/19 18:43:40 tnozaki Exp $);
+__RCSID($NetBSD: citrus_mapper.c,v 1.10 2012/06/08 07:49:42 martin Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -102,6 +102,7 @@ _citrus_mapper_create_area(
 	}
 	ma-ma_dir = strdup(area);
 	if (ma-ma_dir == NULL) {
+		free(ma);
 		ret = errno;
 		goto quit;
 	}



CVS commit: src/lib/libc/net

2012-06-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jun  8 07:54:14 UTC 2012

Modified Files:
src/lib/libc/net: getaddrinfo.c

Log Message:
Henning Petersen in PR lib/46561: cosmetic change: avoid self assignement.


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/lib/libc/net/getaddrinfo.c

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

Modified files:

Index: src/lib/libc/net/getaddrinfo.c
diff -u src/lib/libc/net/getaddrinfo.c:1.100 src/lib/libc/net/getaddrinfo.c:1.101
--- src/lib/libc/net/getaddrinfo.c:1.100	Tue Mar 20 12:04:01 2012
+++ src/lib/libc/net/getaddrinfo.c	Fri Jun  8 07:54:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: getaddrinfo.c,v 1.100 2012/03/20 12:04:01 kardel Exp $	*/
+/*	$NetBSD: getaddrinfo.c,v 1.101 2012/06/08 07:54:14 martin Exp $	*/
 /*	$KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $	*/
 
 /*
@@ -55,7 +55,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: getaddrinfo.c,v 1.100 2012/03/20 12:04:01 kardel Exp $);
+__RCSID($NetBSD: getaddrinfo.c,v 1.101 2012/06/08 07:54:14 martin Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -436,7 +436,7 @@ getaddrinfo(const char *hostname, const 
 		}
 		error = get_portmatch(pai, servname, svd);
 		if (error)
-			ERR(error);
+			goto bad;
 
 		*pai = ai0;
 	}



CVS commit: src/usr.bin/config

2012-06-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jun  8 08:56:45 UTC 2012

Modified Files:
src/usr.bin/config: defs.h mkmakefile.c

Log Message:
If we build several kernel (variants) within the same build directory, bad
things may happen in a parallel build - especially with rules like the
automatic size adjustment for SYMTAB_SPACE, see long standing failure of
evbarm on the build cluster.
Easy fix: .WAIT for each config to complete, before going on with the
next. Low impact, only minor loss of paralellism, and only in cases where
needed.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/usr.bin/config/defs.h
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/config/mkmakefile.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/config/defs.h
diff -u src/usr.bin/config/defs.h:1.43 src/usr.bin/config/defs.h:1.44
--- src/usr.bin/config/defs.h:1.43	Mon Mar 12 03:04:56 2012
+++ src/usr.bin/config/defs.h	Fri Jun  8 08:56:45 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.43 2012/03/12 03:04:56 dholland Exp $	*/
+/*	$NetBSD: defs.h,v 1.44 2012/06/08 08:56:45 martin Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -481,7 +481,7 @@ struct	hashtab *cdevmtab;	/* character d
 
 TAILQ_HEAD(, devbase)	allbases;	/* list of all devbase structures */
 TAILQ_HEAD(, deva)	alldevas;	/* list of all devbase attachments */
-TAILQ_HEAD(, config)	allcf;		/* list of configured kernels */
+TAILQ_HEAD(conftq, config) allcf;	/* list of configured kernels */
 TAILQ_HEAD(, devi)	alldevi,	/* list of all instances */
 			allpseudo;	/* list of all pseudo-devices */
 TAILQ_HEAD(, devm)	alldevms;	/* list of all device-majors */

Index: src/usr.bin/config/mkmakefile.c
diff -u src/usr.bin/config/mkmakefile.c:1.14 src/usr.bin/config/mkmakefile.c:1.15
--- src/usr.bin/config/mkmakefile.c:1.14	Sun Mar 11 08:21:53 2012
+++ src/usr.bin/config/mkmakefile.c	Fri Jun  8 08:56:45 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkmakefile.c,v 1.14 2012/03/11 08:21:53 dholland Exp $	*/
+/*	$NetBSD: mkmakefile.c,v 1.15 2012/06/08 08:56:45 martin Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -512,6 +512,13 @@ emitload(FILE *fp)
 	fputs(.MAIN: all\nall:, fp);
 	TAILQ_FOREACH(cf, allcf, cf_next) {
 		fprintf(fp,  %s, cf-cf_name);
+		/*
+		 * If we generate multiple configs inside the same build directory
+		 * with a parallel build, strange things may happen, so sequentialize
+		 * them.
+		 */
+		if (cf != TAILQ_LAST(allcf,conftq))
+			fprintf(fp,  .WAIT);
 	}
 	fputs(\n\n, fp);
 	TAILQ_FOREACH(cf, allcf, cf_next) {



CVS commit: src/games/colorbars

2012-06-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Jun  9 09:22:21 UTC 2012

Modified Files:
src/games/colorbars: Makefile

Log Message:
Add missing terminfo


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/games/colorbars/Makefile

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

Modified files:

Index: src/games/colorbars/Makefile
diff -u src/games/colorbars/Makefile:1.2 src/games/colorbars/Makefile:1.3
--- src/games/colorbars/Makefile:1.2	Wed Jun  6 00:34:32 2012
+++ src/games/colorbars/Makefile	Sat Jun  9 09:22:21 2012
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.2 2012/06/06 00:34:32 christos Exp $
+# $NetBSD: Makefile,v 1.3 2012/06/09 09:22:21 martin Exp $
 
 WARNS?=	4
 PROG=  colorbars
 MAN=   colorbars.6
-DPADD= ${LIBCURSES}
-LDADD= -lcurses
+DPADD=	${LIBCURSES} ${LIBTERMINFO}
+LDADD=	-lcurses -lterminfo
 
 .include bsd.prog.mk



CVS commit: src/external/mit/xorg/bin/xdm/config

2012-06-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun 13 19:44:14 UTC 2012

Modified Files:
src/external/mit/xorg/bin/xdm/config: Makefile
Added Files:
src/external/mit/xorg/bin/xdm/config: NetBSD-flag.png.uue
Removed Files:
src/external/mit/xorg/bin/xdm/config: NetBSD-flag.png

Log Message:
On second thought, do not store a binary file in the repository, instead
use the uuencoded version.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/mit/xorg/bin/xdm/config/Makefile
cvs rdiff -u -r1.1 -r0 src/external/mit/xorg/bin/xdm/config/NetBSD-flag.png
cvs rdiff -u -r0 -r1.1 \
src/external/mit/xorg/bin/xdm/config/NetBSD-flag.png.uue

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

Modified files:

Index: src/external/mit/xorg/bin/xdm/config/Makefile
diff -u src/external/mit/xorg/bin/xdm/config/Makefile:1.11 src/external/mit/xorg/bin/xdm/config/Makefile:1.12
--- src/external/mit/xorg/bin/xdm/config/Makefile:1.11	Wed Jun 13 18:51:35 2012
+++ src/external/mit/xorg/bin/xdm/config/Makefile	Wed Jun 13 19:44:14 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.11 2012/06/13 18:51:35 martin Exp $
+#	$NetBSD: Makefile,v 1.12 2012/06/13 19:44:14 martin Exp $
 
 .include bsd.own.mk
 
@@ -9,6 +9,7 @@ DEFAULTVT=vt05
 DEFAULTVT=	# defined empty
 .endif
 
+UUDECODE_FILES=	NetBSD-flag.png
 CPPSCRIPTS=	Xresources Xreset Xservers.ws Xsession Xstartup xdm-config 
 
 CPPSCRIPTFLAGS_Xresources=	-DXPM -DBITMAPDIR=${X11INCDIR}/X11/pixmaps \

Added files:

Index: src/external/mit/xorg/bin/xdm/config/NetBSD-flag.png.uue
diff -u /dev/null src/external/mit/xorg/bin/xdm/config/NetBSD-flag.png.uue:1.1
--- /dev/null	Wed Jun 13 19:44:14 2012
+++ src/external/mit/xorg/bin/xdm/config/NetBSD-flag.png.uue	Wed Jun 13 19:44:14 2012
@@ -0,0 +1,165 @@
+begin 644 NetBSD-flag.png
+MB5!.1PT*@H-24A$4@```+D```6`8```5RF_7!(67,```L3
+M```+$P$`FIP8```*3VE#0U!0:]T;W-H;W`@24-#('!R;V9I;4``'C:G5-G
+M5%/I%CWWWO12XB`E$MO4A4((%)BX`4D28J(0D02H@AH=D54$1144$\B@
+MB`..CH,%5$L#(H*V`?D(:*.@Z.(BLK[X7NC:]:\]^;-_K77/NL\YVSSP?`
+M`R62#-1-8`,J4($#Q\3X0N0($*)'``$`BS9%S_2,!`/A^/#PK(L`'
+MO@`!-,+`#`39O`,!R'_P_J0IE`8$`!TD3A+(`4`$!ZCD*F`$!`8=
+MF93`*`$`#+8V+C`%`M``G?^;3`(=^)E[`0!;E$5`:1``398A$`@[
+M`*S/5HI%`%@P`!1F2\0Y`-@M`#!)5V9(`+W`,#.$`NR``@,`#!1B(4I``1[
+M`#((R-X`(29`!1\E\\2NN$.J``!XF;(\N20Y18%;UQ!U=7+AXHSDD7
+M*Q0V80)AFD`NPGF93*!-`_@\\P``*1%1'@@_/],X.KL[.-HZV#E\MZK\
+M_R)B8N/^Y^K$```.%T?M'^+^SH`[!H!M_J(E[@1H7@N@=?+9K(/0+4`
+MH.G:5_-P^'X\/$6AD+G9V7DY-A*Q$);8I7??YGPE_`5_UL^7X\_/?UX+[B
+M)($R78%'!/C@PLST3*4SY()A+YH]'_++__P=TR+$26*Y6H4XU$28Y$
+MFHSS,J4BB4*2*4ETO]DXM\L^P,^WS4`LH^`7N1+:A=8P/V2R06'3`XO`
+M`/*[;\'4*`@#@B#X]W_^\__4@)0`9DF20``7D0D+E3*LS_'```1*!
+M*K!!_3!S`!AS!!=S!_Q@-H1),30A!F2`'')@*:R0BBS;`=*F`O
+MU$`=-,!1:(:3`XNPE6X#CUP#_IA)[!*+R!01!R`@382':B`%BBE@CC@@7
+MF87X(%(!!*+)#)B!11(DN1-4@Q4HI4(%5('?(]@(YAUQNI$[R``R@OR
+MO$QE(R43W4#+5#N:@WH1H@O09'0QFH\6H)O0K0:/8PVH?0JV@/VH\^
+M0\PP.@8!S/$;#`NQL-L3@L9-CR[$BK`RKQAJP5JP#NXGU8\^Q=P02@47`
+M38$=T(@81Y!2%A,6$[82*@@'0T$=H)-PD#A%')R*3J$NT)KH1^088C(Q
+MAUA(+/6$H\3+Q![B$/$-R02B4,R)[F0`DFQI%32$M)TFY2(^DLJ9LT2!HC
+MD\G:9NR!SF4+`KR(7DG3#Y#/D^0A\EL*G6)`:3X4^(H4LIJ2AGE$.4T
+MY09EF#)!5:.:4MVHH501-8]:0JVAME*O48H$S1UFCG-@Q9)2Z6MHI73F@7
+M:/=IK^ATNA'=E1Y.E]!7TLOI1^B7Z`/T=PP-AA6#QXAG*!F;`89QEW*^8
+M3*89TXL9QU0P-S'KF.9#YEO55@JMBI\%9'*I5*E2:5RHO5*FJIJKJ@M5
+M\U7+5(^I7E-]KD95,U/CJ0G4EJM5JIU0ZU,;4VI.ZB'JFH;U0_I'Y9_8D
+M6-,PT]#I%@L5_CO,8@V,9LW@L(6L-JX9U@37$)K'-V7QV*KN8_1V[BSVJ
+MJ:$Y0S-*,US4O.49C\'XYAQ^)QT3@GG**7\WZ*WA3O*(IZ8T3+DQ95QK
+MJI:7EEBK2*M1JT?KO3:N[:=IKU%NUG[@0Y!QTHG7='9X_.!9WG4]E3W:*
+MIQ9-/3KUKBZJ:Z4;H;M$=[]NI^Z8GKY@)Y,;Z?;WG^AQ]+_U4_6WZI_5'
+M#%@LPPD!ML,SA@\Q35Q;SP=+\?;\5%#7-`0Z5AE67X821N=$\H]5C48/
+MCG7.,DXVW;:C)@8F(29+3I-[II23;FF*:8[3#M,Q\W,S:+-UIDUFSTQ
+MUS+GF^;UYO?MV!:%HLMJBVN5)LN1:IEGNMKQNA5HY6:5855I=LT:MG:TE
+MUKNMNZ1I[E.DTZKGM9GP[#QMLFVJ;9L.78!MNNMFVV?6%G8A=GM\6NP^Z3
+MO9-]NGV-_3T'#8?9#JL=6AU^[1R%#I6.MZ:SISN/WW%]);I+V=8SQ#/V#/C
+MMA/+*1IG5.;TT=G%VYX/SB(N)2X+++I^+IL;QMW(O1*=/5Q7%ZTO6=
+MF[.;PNVHVZ_N-NYI[H?G\PTGRF63-ST,/(0^!1Y=$_Y^5,O?K'Y/0T^!
+M9[7G(R]C+Y%7K=PMZ5WJO=A[Q^]CYRG^,^XSPWWC+65_,-\WR+?+3\-O
+MGE^%WT-_(_]D_WK_T0G@4!9P.)@4!6P+[^'I\(;^./SK;9?:RVU!C*Y
+M015!CX*M@N7!K2%HR.R0K2'WYYC.DYI#H50?NC6T`=AYF+PWX,)X6'A5
+M/XYPB%@:T37-7?1W$-SWT3Z1)9$WIMG,4\YKRU*-2H^JBYJ/-HWNC2Z/\8N
+M9EG,U5B=6$EL2QPY+BJN-FYLOM_\[?.'XIWB^-[%Y@OR%UP:'.PO2%IQ:I
+M+A(L.I9`3(A..)3P01`JJ!:,)?(3=R6.GG')G(B_1-M(V$-*AY.\D@J
+M37J2[)\-7DDQ3.E+.6YAID+Q,#4S=FSJ%IIV(TR/3J],8.2D9!Q0JHA
+M39.V9^IGYF9VRZQEA;+^Q6Z+MR\E0?):[.0K`59+0JV0J;H5%HHURH'LF=E
+M5V:_S8G*.9:KGBO-[RSRMN0-YSOG__M$L(2X9*VI89+5RT=6.:]KHYLCQQ
+M=L*XQ4%*X96!JP\N(JV*FW53ZOM5YN?KTFDUK@5[!RH+!M0%KZPM5N6%
+M?OU^U=3U@O6=^U8?JG1L^%8F*KA3;%Y5?]@HW'CEX=ORK^9W)2TJ:O$
+MN63/9M)FZ;+9Y;#I:JE^:7#FX-V=JT#=]6M.WU]D7;+Y?-*-N[@[9#N:._
+M/+B\9:?)SLT[/U2D5/14^E0V[M+=M6'7^[1[AM[O/8T[-7;6[SW_3[)OMM5
+M`55-U6;59?M)^[/W/ZZ)JNGXEOMM7:U.;7'MQP/2`_T'(PZVU[G4U1W2/512

CVS commit: src/etc

2012-06-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun 13 20:49:15 UTC 2012

Modified Files:
src/etc/etc.acorn26: ttys
src/etc/etc.acorn32: ttys
src/etc/etc.alpha: ttys
src/etc/etc.amd64: ttys
src/etc/etc.amiga: ttys
src/etc/etc.amigappc: ttys
src/etc/etc.arc: ttys
src/etc/etc.atari: ttys
src/etc/etc.cats: ttys
src/etc/etc.evbarm: ttys
src/etc/etc.hp300: ttys
src/etc/etc.hpcarm: ttys
src/etc/etc.hpcmips: ttys
src/etc/etc.hpcsh: ttys
src/etc/etc.i386: ttys
src/etc/etc.ibmnws: ttys
src/etc/etc.iyonix: ttys
src/etc/etc.mac68k: ttys
src/etc/etc.mvmeppc: ttys
src/etc/etc.netwinder: ttys
src/etc/etc.newsmips: ttys
src/etc/etc.next68k: ttys
src/etc/etc.ofppc: ttys
src/etc/etc.pmax: ttys
src/etc/etc.prep: ttys
src/etc/etc.rs6000: ttys
src/etc/etc.sgimips: ttys
src/etc/etc.shark: ttys
src/etc/etc.zaurus: ttys

Log Message:
Per discussion on tech-userlevel, finally fix PR 10127:
move all ttyE* entries that use vt100 emulation to wsvt25 term type.
The terminfo vt220 entry lacked (correctly) a delete key entry, which
was a regression against the netbsd-5 termcap entry. On the other hand,
only a very small number of foreign systems lacks support for wsvt25
nowadays.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/etc/etc.acorn26/ttys
cvs rdiff -u -r1.8 -r1.9 src/etc/etc.acorn32/ttys
cvs rdiff -u -r1.11 -r1.12 src/etc/etc.alpha/ttys
cvs rdiff -u -r1.5 -r1.6 src/etc/etc.amd64/ttys
cvs rdiff -u -r1.23 -r1.24 src/etc/etc.amiga/ttys
cvs rdiff -u -r1.2 -r1.3 src/etc/etc.amigappc/ttys
cvs rdiff -u -r1.7 -r1.8 src/etc/etc.arc/ttys
cvs rdiff -u -r1.9 -r1.10 src/etc/etc.atari/ttys
cvs rdiff -u -r1.6 -r1.7 src/etc/etc.cats/ttys
cvs rdiff -u -r1.6 -r1.7 src/etc/etc.evbarm/ttys
cvs rdiff -u -r1.15 -r1.16 src/etc/etc.hp300/ttys
cvs rdiff -u -r1.5 -r1.6 src/etc/etc.hpcarm/ttys
cvs rdiff -u -r1.9 -r1.10 src/etc/etc.hpcmips/ttys
cvs rdiff -u -r1.10 -r1.11 src/etc/etc.hpcsh/ttys
cvs rdiff -u -r1.19 -r1.20 src/etc/etc.i386/ttys
cvs rdiff -u -r1.3 -r1.4 src/etc/etc.ibmnws/ttys
cvs rdiff -u -r1.3 -r1.4 src/etc/etc.iyonix/ttys
cvs rdiff -u -r1.19 -r1.20 src/etc/etc.mac68k/ttys
cvs rdiff -u -r1.5 -r1.6 src/etc/etc.mvmeppc/ttys
cvs rdiff -u -r1.7 -r1.8 src/etc/etc.netwinder/ttys
cvs rdiff -u -r1.8 -r1.9 src/etc/etc.newsmips/ttys
cvs rdiff -u -r1.9 -r1.10 src/etc/etc.next68k/ttys
cvs rdiff -u -r1.8 -r1.9 src/etc/etc.ofppc/ttys
cvs rdiff -u -r1.14 -r1.15 src/etc/etc.pmax/ttys
cvs rdiff -u -r1.7 -r1.8 src/etc/etc.prep/ttys
cvs rdiff -u -r1.1 -r1.2 src/etc/etc.rs6000/ttys
cvs rdiff -u -r1.9 -r1.10 src/etc/etc.sgimips/ttys
cvs rdiff -u -r1.7 -r1.8 src/etc/etc.shark/ttys
cvs rdiff -u -r1.2 -r1.3 src/etc/etc.zaurus/ttys

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

Modified files:

Index: src/etc/etc.acorn26/ttys
diff -u src/etc/etc.acorn26/ttys:1.3 src/etc/etc.acorn26/ttys:1.4
--- src/etc/etc.acorn26/ttys:1.3	Tue Oct  7 10:00:00 2008
+++ src/etc/etc.acorn26/ttys	Wed Jun 13 20:49:11 2012
@@ -1,11 +1,11 @@
 #
 #	from: @(#)ttys	5.1 (Berkeley) 4/17/89
-#	$NetBSD: ttys,v 1.3 2008/10/07 10:00:00 abs Exp $
+#	$NetBSD: ttys,v 1.4 2012/06/13 20:49:11 martin Exp $
 #
 # name	gettytype	status		comments
 #
-constty	/usr/libexec/getty Pc		vt220	off secure
-ttyE0	/usr/libexec/getty Pc		vt220	on secure
-ttyE1	/usr/libexec/getty Pc		vt220	off secure
-ttyE2	/usr/libexec/getty Pc		vt220	off secure
-ttyE3	/usr/libexec/getty Pc		vt220	off secure
+constty	/usr/libexec/getty Pc		wsvt25	off secure
+ttyE0	/usr/libexec/getty Pc		wsvt25	on secure
+ttyE1	/usr/libexec/getty Pc		wsvt25	off secure
+ttyE2	/usr/libexec/getty Pc		wsvt25	off secure
+ttyE3	/usr/libexec/getty Pc		wsvt25	off secure

Index: src/etc/etc.acorn32/ttys
diff -u src/etc/etc.acorn32/ttys:1.8 src/etc/etc.acorn32/ttys:1.9
--- src/etc/etc.acorn32/ttys:1.8	Tue Oct  7 10:00:00 2008
+++ src/etc/etc.acorn32/ttys	Wed Jun 13 20:49:12 2012
@@ -1,15 +1,15 @@
 #
 #	from: @(#)ttys	5.1 (Berkeley) 4/17/89
-#	$NetBSD: ttys,v 1.8 2008/10/07 10:00:00 abs Exp $
+#	$NetBSD: ttys,v 1.9 2012/06/13 20:49:12 martin Exp $
 #
 # name	gettytype	status		comments
 #
 console	/usr/libexec/getty Pc		vt100	off secure
 constty	/usr/libexec/getty Pc		vt100	off secure
-ttyE0	/usr/libexec/getty Pc		vt220	on secure
-ttyE1	/usr/libexec/getty Pc		vt220	on secure
-ttyE2	/usr/libexec/getty Pc		vt220	on secure
-ttyE3	/usr/libexec/getty Pc		vt220	on secure
+ttyE0	/usr/libexec/getty Pc		wsvt25	on secure
+ttyE1	/usr/libexec/getty Pc		wsvt25	on secure
+ttyE2	/usr/libexec/getty Pc		wsvt25	on secure
+ttyE3	/usr/libexec/getty Pc		wsvt25	on secure
 tty00	/usr/libexec/getty std.9600	unknown off secure
 tty01	/usr/libexec/getty std.9600	unknown off secure
 tty02	/usr/libexec/getty std.9600	unknown off secure

Index: 

CVS commit: src/sys/kern

2012-06-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jun 14 20:18:16 UTC 2012

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

Log Message:
Do not try to find the wedge we booted from if opendisk(booted_device)
failed.


To generate a diff of this commit:
cvs rdiff -u -r1.443 -r1.444 src/sys/kern/init_main.c

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

Modified files:

Index: src/sys/kern/init_main.c
diff -u src/sys/kern/init_main.c:1.443 src/sys/kern/init_main.c:1.444
--- src/sys/kern/init_main.c:1.443	Sun Jun 10 17:05:18 2012
+++ src/sys/kern/init_main.c	Thu Jun 14 20:18:16 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.443 2012/06/10 17:05:18 mlelstv Exp $	*/
+/*	$NetBSD: init_main.c,v 1.444 2012/06/14 20:18:16 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: init_main.c,v 1.443 2012/06/10 17:05:18 mlelstv Exp $);
+__KERNEL_RCSID(0, $NetBSD: init_main.c,v 1.444 2012/06/14 20:18:16 martin Exp $);
 
 #include opt_ddb.h
 #include opt_ipsec.h
@@ -852,6 +852,10 @@ rootconf_handle_wedges(void)
 		 * the disklabel.
 		 */
 		vp = opendisk(booted_device);
+
+		if (vp == NULL)
+			return;
+
 		error = VOP_IOCTL(vp, DIOCGPART, dpart, FREAD, NOCRED);
 		VOP_CLOSE(vp, FREAD, NOCRED);
 		vput(vp);



CVS commit: src/external/gpl3/gcc/dist/gcc

2012-06-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun 17 13:43:30 UTC 2012

Modified Files:
src/external/gpl3/gcc/dist/gcc: ChangeLog reload.c reload1.c

Log Message:
Apply upstream revision 175141: setjmp vs. unchanged register values;
should fix PR toolchain/45837.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gcc/dist/gcc/ChangeLog
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gcc/dist/gcc/reload.c \
src/external/gpl3/gcc/dist/gcc/reload1.c

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

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/ChangeLog
diff -u src/external/gpl3/gcc/dist/gcc/ChangeLog:1.2 src/external/gpl3/gcc/dist/gcc/ChangeLog:1.3
--- src/external/gpl3/gcc/dist/gcc/ChangeLog:1.2	Fri Dec  2 09:44:48 2011
+++ src/external/gpl3/gcc/dist/gcc/ChangeLog	Sun Jun 17 13:43:30 2012
@@ -5,6 +5,17 @@
 	* config/pa/pa.h (LEGITIMATE_CONSTANT_P): Return false for
 	TLS_MODEL_GLOBAL_DYNAMIC and TLS_MODEL_LOCAL_DYNAMIC symbol references.
 
+2011-06-17  Hans-Peter Nilsson  h...@axis.com
+
+	Backport from mainline
+	2011-06-17  Hans-Peter Nilsson  h...@axis.com
+
+	PR rtl-optimization/48542
+	* reload.c (find_equiv_reg): Stop looking when finding a
+	setjmp-type call.
+	* reload1.c (reload_as_needed): Invalidate all reload
+	registers when crossing a setjmp-type call.
+
 2011-04-28  Release Manager
 
 	* GCC 4.5.3 released.

Index: src/external/gpl3/gcc/dist/gcc/reload.c
diff -u src/external/gpl3/gcc/dist/gcc/reload.c:1.1.1.1 src/external/gpl3/gcc/dist/gcc/reload.c:1.2
--- src/external/gpl3/gcc/dist/gcc/reload.c:1.1.1.1	Tue Jun 21 01:20:14 2011
+++ src/external/gpl3/gcc/dist/gcc/reload.c	Sun Jun 17 13:43:30 2012
@@ -6795,6 +6795,15 @@ find_equiv_reg (rtx goal, rtx insn, enum
 	  || num  PARAM_VALUE (PARAM_MAX_RELOAD_SEARCH_INSNS))
 	return 0;
 
+  /* Don't reuse register contents from before a setjmp-type
+	 function call; on the second return (from the longjmp) it
+	 might have been clobbered by a later reuse.  It doesn't
+	 seem worthwhile to actually go and see if it is actually
+	 reused even if that information would be readily available;
+	 just don't reuse it across the setjmp call.  */
+  if (CALL_P (p)  find_reg_note (p, REG_SETJMP, NULL_RTX))
+	return 0;
+
   if (NONJUMP_INSN_P (p)
 	  /* If we don't want spill regs ...  */
 	   (! (reload_reg_p != 0
Index: src/external/gpl3/gcc/dist/gcc/reload1.c
diff -u src/external/gpl3/gcc/dist/gcc/reload1.c:1.1.1.1 src/external/gpl3/gcc/dist/gcc/reload1.c:1.2
--- src/external/gpl3/gcc/dist/gcc/reload1.c:1.1.1.1	Tue Jun 21 01:19:55 2011
+++ src/external/gpl3/gcc/dist/gcc/reload1.c	Sun Jun 17 13:43:30 2012
@@ -4487,6 +4487,13 @@ reload_as_needed (int live_known)
 	{
 	  AND_COMPL_HARD_REG_SET (reg_reloaded_valid, call_used_reg_set);
 	  AND_COMPL_HARD_REG_SET (reg_reloaded_valid, reg_reloaded_call_part_clobbered);
+
+	  /* If this is a call to a setjmp-type function, we must not
+	 reuse any reload reg contents across the call; that will
+	 just be clobbered by other uses of the register in later
+	 code, before the longjmp.  */
+	  if (find_reg_note (insn, REG_SETJMP, NULL_RTX))
+	CLEAR_HARD_REG_SET (reg_reloaded_valid);
 	}
 }
 



CVS commit: src/distrib

2012-06-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun 17 14:59:15 UTC 2012

Modified Files:
src/distrib/amd64/ramdisks/common: list.ramdisk
src/distrib/i386/ramdisks/common: list.ramdisk

Log Message:
Add support for ext2fs to i386/amd64 ramdisks.
This is usefull for setup with various xen hosting providers.
Prompted by Blair Sadewitz.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/distrib/amd64/ramdisks/common/list.ramdisk
cvs rdiff -u -r1.21 -r1.22 src/distrib/i386/ramdisks/common/list.ramdisk

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

Modified files:

Index: src/distrib/amd64/ramdisks/common/list.ramdisk
diff -u src/distrib/amd64/ramdisks/common/list.ramdisk:1.16 src/distrib/amd64/ramdisks/common/list.ramdisk:1.17
--- src/distrib/amd64/ramdisks/common/list.ramdisk:1.16	Sun Jul  3 23:11:32 2011
+++ src/distrib/amd64/ramdisks/common/list.ramdisk	Sun Jun 17 14:59:15 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: list.ramdisk,v 1.16 2011/07/03 23:11:32 tron Exp $
+#	$NetBSD: list.ramdisk,v 1.17 2012/06/17 14:59:15 martin Exp $
 
 SRCDIRS	external/bsd/less/bin
 SRCDIRS	bin sbin usr.bin usr.sbin libexec
@@ -28,12 +28,14 @@ PROG	sbin/init
 PROG	sbin/mknod
 PROG	sbin/mount
 PROG	sbin/mount_cd9660
+PROG	sbin/mount_ext2fs
 PROG	sbin/mount_ffs
 # PROG	sbin/mount_kernfs
 PROG	sbin/mount_msdos
 PROG	sbin/mount_nfs
 PROG	sbin/mount_tmpfs
 PROG	sbin/newfs	sbin/mount_mfs
+PROG	sbin/newfs_ext2fs
 PROG	sbin/ping
 PROG	sbin/reboot	sbin/halt
 PROG	sbin/route

Index: src/distrib/i386/ramdisks/common/list.ramdisk
diff -u src/distrib/i386/ramdisks/common/list.ramdisk:1.21 src/distrib/i386/ramdisks/common/list.ramdisk:1.22
--- src/distrib/i386/ramdisks/common/list.ramdisk:1.21	Sun Jul  3 23:11:33 2011
+++ src/distrib/i386/ramdisks/common/list.ramdisk	Sun Jun 17 14:59:15 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: list.ramdisk,v 1.21 2011/07/03 23:11:33 tron Exp $
+#	$NetBSD: list.ramdisk,v 1.22 2012/06/17 14:59:15 martin Exp $
 
 SRCDIRS	external/bsd/less/bin
 SRCDIRS	bin sbin usr.bin usr.sbin libexec
@@ -27,6 +27,7 @@ PROG	sbin/ifconfig
 PROG	sbin/init
 PROG	sbin/mknod
 PROG	sbin/mount
+PROG	sbin/mount_ext2fs
 PROG	sbin/mount_cd9660
 PROG	sbin/mount_ffs
 # PROG	sbin/mount_kernfs
@@ -34,6 +35,7 @@ PROG	sbin/mount_msdos
 PROG	sbin/mount_nfs
 PROG	sbin/mount_tmpfs
 PROG	sbin/newfs	sbin/mount_mfs
+PROG	sbin/newfs_ext2fs
 PROG	sbin/ping
 PROG	sbin/reboot	sbin/halt
 PROG	sbin/route



CVS commit: src/sys/dev/ic

2012-06-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jun 18 21:23:56 UTC 2012

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

Log Message:
When issuing a non-dma command, make sure to set the remaining length of
command to be transfered via dma (sc_cmdlen) to zero upfront, otherwise we
might get confused on command completition interrupt (no dma active but still
data left to transfer).


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/sys/dev/ic/ncr53c9x.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/ncr53c9x.c
diff -u src/sys/dev/ic/ncr53c9x.c:1.144 src/sys/dev/ic/ncr53c9x.c:1.145
--- src/sys/dev/ic/ncr53c9x.c:1.144	Sat Mar 10 20:54:20 2012
+++ src/sys/dev/ic/ncr53c9x.c	Mon Jun 18 21:23:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ncr53c9x.c,v 1.144 2012/03/10 20:54:20 mrg Exp $	*/
+/*	$NetBSD: ncr53c9x.c,v 1.145 2012/06/18 21:23:56 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ncr53c9x.c,v 1.144 2012/03/10 20:54:20 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: ncr53c9x.c,v 1.145 2012/06/18 21:23:56 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -735,6 +735,7 @@ ncr53c9x_select(struct ncr53c9x_softc *s
 		} else {
 			ncr53c9x_wrfifo(sc, (uint8_t *)ecb-cmd.cmd,
 			ecb-clen);
+			sc-sc_cmdlen = 0;
 			NCRCMD(sc, NCRCMD_SELNATN);
 		}
 		return;
@@ -804,6 +805,7 @@ ncr53c9x_select(struct ncr53c9x_softc *s
 	 */
 
 	/* Now get the command into the FIFO */
+	sc-sc_cmdlen = 0;
 	ncr53c9x_wrfifo(sc, cmd, clen);
 
 	/* And get the targets attention */
@@ -2054,6 +2056,7 @@ ncr53c9x_msgout(struct ncr53c9x_softc *s
 		 */
 		ncr53c9x_flushfifo(sc);
 		ncr53c9x_wrfifo(sc, sc-sc_omp, sc-sc_omlen);
+		sc-sc_cmdlen = 0;
 		NCRCMD(sc, NCRCMD_TRANS);
 	} else {
 		/* (re)send the message */
@@ -2759,6 +2762,7 @@ msgin:
 		} else {
 			ncr53c9x_wrfifo(sc, (uint8_t *)ecb-cmd.cmd,
 			ecb-clen);
+			sc-sc_cmdlen = 0;
 			NCRCMD(sc, NCRCMD_TRANS);
 		}
 		sc-sc_prevphase = COMMAND_PHASE;



CVS commit: src/sys/dev/iscsi

2012-06-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jun 19 14:19:46 UTC 2012

Modified Files:
src/sys/dev/iscsi: iscsi_send.c

Log Message:
assemble_login_parameters() has a strange error reporting convention:
errors are positive numbers, so = 0 is good, not = ...
This makes CHAP authenticated iscsi logins work.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/iscsi/iscsi_send.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/iscsi/iscsi_send.c
diff -u src/sys/dev/iscsi/iscsi_send.c:1.3 src/sys/dev/iscsi/iscsi_send.c:1.4
--- src/sys/dev/iscsi/iscsi_send.c:1.3	Sat Jun  9 06:19:58 2012
+++ src/sys/dev/iscsi/iscsi_send.c	Tue Jun 19 14:19:46 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsi_send.c,v 1.3 2012/06/09 06:19:58 mlelstv Exp $	*/
+/*	$NetBSD: iscsi_send.c,v 1.4 2012/06/19 14:19:46 martin Exp $	*/
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -1113,7 +1113,7 @@ send_login(connection_t *conn)
 		return conn-terminating;
 	}
 
-	if ((rc = assemble_login_parameters(conn, ccb, pdu)) = 0) {
+	if ((rc = assemble_login_parameters(conn, ccb, pdu)) = 0) {
 		init_login_pdu(conn, pdu, !rc);
 		setup_tx_uio(pdu, pdu-temp_data_len, pdu-temp_data, FALSE);
 		send_pdu(ccb, pdu, CCBDISP_WAIT, PDUDISP_FREE);



CVS commit: src/sbin/iscsictl

2012-06-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun 20 08:11:12 UTC 2012

Modified Files:
src/sbin/iscsictl: iscsic_driverif.c

Log Message:
Avoid printing values past the end of the buffer, and a size_t underflow.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sbin/iscsictl/iscsic_driverif.c

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

Modified files:

Index: src/sbin/iscsictl/iscsic_driverif.c
diff -u src/sbin/iscsictl/iscsic_driverif.c:1.2 src/sbin/iscsictl/iscsic_driverif.c:1.3
--- src/sbin/iscsictl/iscsic_driverif.c:1.2	Sun Oct 30 18:40:06 2011
+++ src/sbin/iscsictl/iscsic_driverif.c	Wed Jun 20 08:11:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsic_driverif.c,v 1.2 2011/10/30 18:40:06 christos Exp $	*/
+/*	$NetBSD: iscsic_driverif.c,v 1.3 2012/06/20 08:11:11 martin Exp $	*/
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -305,9 +305,13 @@ dump_data(const char *title, const void 
 		}
 		printf( ');
 		for (i = 0; i  nelem; i++) {
+			if (i = len)
+break;
 			printf(%c, isprint(bp[i]) ? bp[i] : ' ');
 		}
 		printf('\n);
+		if (len  16)
+			break;
 		len -= 16;
 		bp += 16;
 	}



CVS commit: src/sbin/iscsictl

2012-06-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun 20 08:19:49 UTC 2012

Modified Files:
src/sbin/iscsictl: iscsic_driverif.c

Log Message:
Fix previous


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sbin/iscsictl/iscsic_driverif.c

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

Modified files:

Index: src/sbin/iscsictl/iscsic_driverif.c
diff -u src/sbin/iscsictl/iscsic_driverif.c:1.3 src/sbin/iscsictl/iscsic_driverif.c:1.4
--- src/sbin/iscsictl/iscsic_driverif.c:1.3	Wed Jun 20 08:11:11 2012
+++ src/sbin/iscsictl/iscsic_driverif.c	Wed Jun 20 08:19:49 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsic_driverif.c,v 1.3 2012/06/20 08:11:11 martin Exp $	*/
+/*	$NetBSD: iscsic_driverif.c,v 1.4 2012/06/20 08:19:49 martin Exp $	*/
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -298,7 +298,10 @@ dump_data(const char *title, const void 
 		printf(  );
 
 		for (i = 0; i  nelem; i++) {
-			printf(%02x , bp[i]);
+			if (i = len)
+printf(   );
+			else
+printf(%02x , bp[i]);
 		}
 		for (i = nelem; i  16; i++) {
 			printf(   );



CVS commit: src/sys/compat/linux/common

2012-06-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jun 22 08:47:48 UTC 2012

Modified Files:
src/sys/compat/linux/common: linux_socketcall.c

Log Message:
From the parse errors that you just do not see as a human department:
build fix.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/compat/linux/common/linux_socketcall.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/compat/linux/common/linux_socketcall.c
diff -u src/sys/compat/linux/common/linux_socketcall.c:1.41 src/sys/compat/linux/common/linux_socketcall.c:1.42
--- src/sys/compat/linux/common/linux_socketcall.c:1.41	Thu Jun 21 17:55:15 2012
+++ src/sys/compat/linux/common/linux_socketcall.c	Fri Jun 22 08:47:47 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_socketcall.c,v 1.41 2012/06/21 17:55:15 christos Exp $	*/
+/*	$NetBSD: linux_socketcall.c,v 1.42 2012/06/22 08:47:47 martin Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: linux_socketcall.c,v 1.41 2012/06/21 17:55:15 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: linux_socketcall.c,v 1.42 2012/06/22 08:47:47 martin Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -96,8 +96,8 @@ static const struct {
 	{L(connect),	sizeof(struct linux_sys_connect_args)},		/* 3 */
 	{L(listen),	sizeof(struct linux_sys_listen_args)},		/* 4 */
 	{L(accept),	sizeof(struct linux_sys_accept_args)},		/* 5 */
-	{L(getsockname),sizeof(struct linux_sys_getsockname_args)},	/* 6 */
-	{L(getpeername),sizeof(struct linux_sys_getpeername_args)},	/* 7 */
+	{L(getsockname),sizeof(struct linux_sys_getsockname_args)},	/* 6 */
+	{L(getpeername),sizeof(struct linux_sys_getpeername_args)},	/* 7 */
 	{L(socketpair),sizeof(struct linux_sys_socketpair_args)},	/* 8 */
 	{L(send),	sizeof(struct linux_sys_send_args)},		/* 9 */
 	{L(recv),	sizeof(struct linux_sys_recv_args)},		/* 10 */



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

2013-01-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jan 15 10:18:38 UTC 2013

Modified Files:
src/sys/arch/vax/vax: syscall.c

Log Message:
Make this compile with TRAPDEBUG enabled.
Pointed out by Holm Tiffe.


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

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

Modified files:

Index: src/sys/arch/vax/vax/syscall.c
diff -u src/sys/arch/vax/vax/syscall.c:1.21 src/sys/arch/vax/vax/syscall.c:1.22
--- src/sys/arch/vax/vax/syscall.c:1.21	Sun Feb 19 21:06:33 2012
+++ src/sys/arch/vax/vax/syscall.c	Tue Jan 15 10:18:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.21 2012/02/19 21:06:33 rmind Exp $ */
+/*	$NetBSD: syscall.c,v 1.22 2013/01/15 10:18:38 martin Exp $ */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -33,7 +33,7 @@
  /* All bugs are subject to removal without further notice */
 		
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.21 2012/02/19 21:06:33 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.22 2013/01/15 10:18:38 martin Exp $);
 
 #include opt_multiprocessor.h
 
@@ -77,7 +77,7 @@ syscall(struct trapframe *tf)
 
 	TDB((trap syscall %s pc %lx, psl %lx, sp %lx, pid %d, frame %p\n,
 	syscallnames[tf-tf_code], tf-tf_pc, tf-tf_psl,tf-tf_sp,
-	p-p_pid,frame));
+	p-p_pid,tf));
 
 	curcpu()-ci_data.cpu_nsyscall++;
  
@@ -111,7 +111,7 @@ syscall(struct trapframe *tf)
 
 	TDB((return %s pc %lx, psl %lx, sp %lx, pid %d, err %d r0 %d, r1 %d, 
 	tf %p\n, syscallnames[tf-tf_code], tf-tf_pc, tf-tf_psl,
-	tf-tf_sp, p-p_pid, error, rval[0], rval[1], exptr));
+	tf-tf_sp, p-p_pid, error, rval[0], rval[1], tf));
 bad:
 	switch (error) {
 	case 0:



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

2013-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jan 23 12:19:03 UTC 2013

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s

Log Message:
Sligthly clean up the (by default unused) #ifdef TRAPS_USE_IG


To generate a diff of this commit:
cvs rdiff -u -r1.345 -r1.346 src/sys/arch/sparc64/sparc64/locore.s

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.345 src/sys/arch/sparc64/sparc64/locore.s:1.346
--- src/sys/arch/sparc64/sparc64/locore.s:1.345	Sat Nov 10 01:47:25 2012
+++ src/sys/arch/sparc64/sparc64/locore.s	Wed Jan 23 12:19:02 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.345 2012/11/10 01:47:25 nakayama Exp $	*/
+/*	$NetBSD: locore.s,v 1.346 2013/01/23 12:19:02 martin Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -1743,9 +1743,10 @@ winfixfill:
  *
  * The following is duplicated from datafault:
  */
-	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate	! We need to save volatile stuff to AG regs
 #ifdef TRAPS_USE_IG
-	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! We need to save volatile stuff to AG regs
+	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! We need to save volatile stuff to interrupt globals
+#else
+	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate	! We need to save volatile stuff to alternate globals
 #endif
 	wr	%g0, ASI_DMMU, %asi			! We need to re-load trap info
 	ldxa	[%g0 + TLB_TAG_ACCESS] %asi, %g1	! Get fault address from tag access register
@@ -2106,9 +2107,10 @@ winfixsave:
 	wrpr	%g1, %cwp
 	andn	%g2, CWP, %g2
 	wrpr	%g1, %g2, %tstate
-	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate
 #ifdef TRAPS_USE_IG
 	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! DEBUG
+#else
+	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate
 #endif
 	mov	%g6, %sp
 	done
@@ -2129,9 +2131,10 @@ winfixsave:
  *
  */
 datafault:
-	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate	! We need to save volatile stuff to AG regs
 #ifdef TRAPS_USE_IG
-	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! We need to save volatile stuff to AG regs
+	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! We need to save volatile stuff to interrupt globals
+#else
+	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate	! We need to save volatile stuff to alternate globals
 #endif
 	wr	%g0, ASI_DMMU, %asi			! We need to re-load trap info
 	ldxa	[%g0 + TLB_TAG_ACCESS] %asi, %g1	! Get fault address from tag access register
@@ -2374,9 +2377,10 @@ instr_miss:
  */
 
 textfault:
-	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate	! We need to save volatile stuff to AG regs
 #ifdef TRAPS_USE_IG
-	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! We need to save volatile stuff to AG regs
+	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! We need to save volatile stuff to interrupt globals
+#else
+	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate	! We need to save volatile stuff to alternate globals
 #endif
 	wr	%g0, ASI_IMMU, %asi
 	ldxa	[%g0 + TLB_TAG_ACCESS] %asi, %g1	! Get fault address from tag access register
@@ -3588,9 +3592,10 @@ return_from_trap:
 	ldx	[%sp + CC64FSZ + STKB + TF_G + (6*8)], %g6
 	ldx	[%sp + CC64FSZ + STKB + TF_G + (7*8)], %g7
 	/* Switch to alternate globals and load outs */
-	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate
 #ifdef TRAPS_USE_IG
 	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! DEBUG
+#else
+	wrpr	%g0, PSTATE_KERN|PSTATE_AG, %pstate
 #endif
 	ldx	[%sp + CC64FSZ + STKB + TF_O + (0*8)], %i0
 	ldx	[%sp + CC64FSZ + STKB + TF_O + (1*8)], %i1



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

2013-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jan 23 21:03:25 UTC 2013

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s mp_subr.S

Log Message:
Fix sparc64_ipi_ccall by adding proper trap setup.
Fixes xcall(9) problems, as exposed by pserialize(9). Noticed by
J. Hannken-Illjes, cause pointed out by Takeshi Nakayama.


To generate a diff of this commit:
cvs rdiff -u -r1.346 -r1.347 src/sys/arch/sparc64/sparc64/locore.s
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sparc64/sparc64/mp_subr.S

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.346 src/sys/arch/sparc64/sparc64/locore.s:1.347
--- src/sys/arch/sparc64/sparc64/locore.s:1.346	Wed Jan 23 12:19:02 2013
+++ src/sys/arch/sparc64/sparc64/locore.s	Wed Jan 23 21:03:25 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.346 2013/01/23 12:19:02 martin Exp $	*/
+/*	$NetBSD: locore.s,v 1.347 2013/01/23 21:03:25 martin Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -6283,6 +6283,67 @@ ENTRY(OF_val2sym32)
 #endif /* _LP64 */
 #endif /* DDB */
 
+
+#if defined(MULTIPROCESSOR)
+/*
+ * IPI target function to setup a C compatible environment and call a MI function.
+ *
+ * On entry:
+ *	We are on one of the alternate set of globals
+ *	%g2 = function to call
+ *	%g3 = single argument to called function
+ */
+ENTRY(sparc64_ipi_ccall)
+#ifdef TRAPS_USE_IG
+	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! DEBUG
+#endif
+	TRAP_SETUP(-CC64FSZ-TF_SIZE)
+
+#ifdef DEBUG
+	rdpr	%tt, %o1	! debug
+	sth	%o1, [%sp + CC64FSZ + STKB + TF_TT]! debug
+#endif
+	mov	%g3, %o0			! save argument of function to call
+	mov	%g2, %o5			! save function pointer
+
+	wrpr	%g0, PSTATE_KERN, %pstate	! Get back to normal globals
+	stx	%g1, [%sp + CC64FSZ + STKB + TF_G + ( 1*8)]
+	mov	%g1, %o1			! code
+	rdpr	%tpc, %o2			! (pc)
+	stx	%g2, [%sp + CC64FSZ + STKB + TF_G + ( 2*8)]
+	rdpr	%tstate, %g1
+	stx	%g3, [%sp + CC64FSZ + STKB + TF_G + ( 3*8)]
+	rdpr	%tnpc, %o3
+	stx	%g4, [%sp + CC64FSZ + STKB + TF_G + ( 4*8)]
+	rd	%y, %o4
+	stx	%g5, [%sp + CC64FSZ + STKB + TF_G + ( 5*8)]
+	stx	%g6, [%sp + CC64FSZ + STKB + TF_G + ( 6*8)]
+	wrpr	%g0, 0, %tl			! return to tl=0
+	stx	%g7, [%sp + CC64FSZ + STKB + TF_G + ( 7*8)]
+
+	stx	%g1, [%sp + CC64FSZ + STKB + TF_TSTATE]
+	stx	%o2, [%sp + CC64FSZ + STKB + TF_PC]
+	stx	%o3, [%sp + CC64FSZ + STKB + TF_NPC]
+	st	%o4, [%sp + CC64FSZ + STKB + TF_Y]
+
+	rdpr	%pil, %g5
+	stb	%g5, [%sp + CC64FSZ + STKB + TF_PIL]
+	stb	%g5, [%sp + CC64FSZ + STKB + TF_OLDPIL]
+
+	!! In the EMBEDANY memory model %g4 points to the start of the data segment.
+	!! In our case we need to clear it before calling any C-code
+	clr	%g4
+	wr	%g0, ASI_NUCLEUS, %asi			! default kernel ASI
+
+	call %o5	! call function
+	 nop
+
+	ba,a	return_from_trap			! and return from IPI
+	 nop
+
+#endif
+
+
 	.data
 	_ALIGN
 #if NKSYMS || defined(DDB) || defined(LKM)

Index: src/sys/arch/sparc64/sparc64/mp_subr.S
diff -u src/sys/arch/sparc64/sparc64/mp_subr.S:1.3 src/sys/arch/sparc64/sparc64/mp_subr.S:1.4
--- src/sys/arch/sparc64/sparc64/mp_subr.S:1.3	Tue Jul 12 07:51:34 2011
+++ src/sys/arch/sparc64/sparc64/mp_subr.S	Wed Jan 23 21:03:25 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mp_subr.S,v 1.3 2011/07/12 07:51:34 mrg Exp $	*/
+/*	$NetBSD: mp_subr.S,v 1.4 2013/01/23 21:03:25 martin Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -410,22 +410,4 @@ ENTRY(sparc64_ipi_dcache_flush_page_us)
 	ba,a	ret_from_intr_vector
 	 nop
 
-/*
- * Setup a C compatible environment and call a MI function.
- *
- * On entry:
- *	%g2 = function to call
- *	%g3 = single argument to called function
- */
-ENTRY(sparc64_ipi_ccall)
-	save %sp, -CC64FSZ-16, %sp			! create a stack frame
-	stx %g2, [%fp + BIAS -16 + 0]			! save function pointer
-	stx %g3, [%fp + BIAS -16 + 8]			! and argument
-	wrpr%g0, PSTATE_KERN, %pstate		! switch globals
-	ldx [%fp + BIAS -16 + 0], %l0			! reload function
-	call %l0	! call function
-	 ldx [%fp + BIAS -16 + 8], %o0			! reload argument 
-	restore		! pop stack frame
-	ba,a	ret_from_intr_vector			! and return from IPI
-	 nop
 #endif



CVS commit: src/usr.sbin/makefs/msdos

2013-01-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan 27 12:25:13 UTC 2013

Modified Files:
src/usr.sbin/makefs/msdos: msdosfs_vnops.c

Log Message:
Make it compile on 32bit AND 64bit archs.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/makefs/msdos/msdosfs_vnops.c

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

Modified files:

Index: src/usr.sbin/makefs/msdos/msdosfs_vnops.c
diff -u src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.5 src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.6
--- src/usr.sbin/makefs/msdos/msdosfs_vnops.c:1.5	Sun Jan 27 10:07:23 2013
+++ src/usr.sbin/makefs/msdos/msdosfs_vnops.c	Sun Jan 27 12:25:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vnops.c,v 1.5 2013/01/27 10:07:23 mbalmer Exp $	*/
+/*	$NetBSD: msdosfs_vnops.c,v 1.6 2013/01/27 12:25:13 martin Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -51,7 +51,7 @@
 #endif
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.5 2013/01/27 10:07:23 mbalmer Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_vnops.c,v 1.6 2013/01/27 12:25:13 martin Exp $);
 
 #include sys/param.h
 #include sys/mman.h
@@ -177,7 +177,7 @@ msdosfs_wfile(const char *path, struct d
 	int error, fd;
 	size_t osize = dep-de_FileSize;
 	struct stat *st = node-inode-st;
-	off_t nsize = st-st_size;
+	size_t nsize;
 	size_t offs = 0;
 	struct msdosfsmount *pmp = dep-de_pmp;
 	struct buf *bp;
@@ -188,15 +188,16 @@ msdosfs_wfile(const char *path, struct d
 	printf(msdosfs_write(): diroff %lu, dirclust %lu, startcluster %lu\n,
 	dep-de_diroffset, dep-de_dirclust, dep-de_StartCluster);
 #endif
-	if (nsize == 0)
+	if (st-st_size == 0)
 		return 0;
 
 	/* Don't bother to try to write files larger than the fs limit */
-	if (nsize  MSDOSFS_FILESIZE_MAX) {
+	if (st-st_size  (off_t)min(MSDOSFS_FILESIZE_MAX,__SIZE_MAX__)) {
 		errno = EFBIG;
 		return -1;
 	}
 
+	nsize = st-st_size;
 	if (nsize  osize) {
 		if ((error = deextend(dep, nsize, NULL)) != 0) {
 			errno = error;



CVS commit: src/libexec/ld.aout_so

2013-02-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Feb  5 15:19:18 UTC 2013

Modified Files:
src/libexec/ld.aout_so: Makefile

Log Message:
Make sure UUDECODE_FILES is empty if we do not have an old ld.so_aout
(on architectures that never used a.out)


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/libexec/ld.aout_so/Makefile

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.aout_so/Makefile
diff -u src/libexec/ld.aout_so/Makefile:1.48 src/libexec/ld.aout_so/Makefile:1.49
--- src/libexec/ld.aout_so/Makefile:1.48	Tue Feb  5 07:22:59 2013
+++ src/libexec/ld.aout_so/Makefile	Tue Feb  5 15:19:18 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.48 2013/02/05 07:22:59 matt Exp $
+#	$NetBSD: Makefile,v 1.49 2013/02/05 15:19:18 martin Exp $
 
 .include bsd.own.mk			# for MKPIC definition
 .include bsd.endian.mk		# for TARGET_ENDIANNESS
@@ -20,6 +20,8 @@ all dependall: ${FILES}
 
 ld.so:	${UUDECODE_FILES}
 
+.else
+UUDECODE_FILES=
 .endif
 .endif
 



CVS commit: src/external/mit/xorg/lib/pixman

2013-02-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 11 09:26:07 UTC 2013

Modified Files:
src/external/mit/xorg/lib/pixman: Makefile

Log Message:
Enable SSE2 support for amd64


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/external/mit/xorg/lib/pixman/Makefile

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

Modified files:

Index: src/external/mit/xorg/lib/pixman/Makefile
diff -u src/external/mit/xorg/lib/pixman/Makefile:1.19 src/external/mit/xorg/lib/pixman/Makefile:1.20
--- src/external/mit/xorg/lib/pixman/Makefile:1.19	Thu Feb  7 13:33:50 2013
+++ src/external/mit/xorg/lib/pixman/Makefile	Mon Feb 11 09:26:07 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.19 2013/02/07 13:33:50 macallan Exp $
+#	$NetBSD: Makefile,v 1.20 2013/02/11 09:26:07 martin Exp $
 
 NOLINT=	1	# defined
 
@@ -43,16 +43,14 @@ SRCS=	\
 # XXX
 
 .if ${MACHINE_ARCH} == i386
-# SSE2 requires a gcc = 4.2
+# SSE2 does not work, for unknown reasons
 SRCS+= pixman-mmx.c
 COPTS.pixman-mmx.c=	-mmmx -fvisibility=hidden
 MKDEPFLAGS+=		-mmmx -fvisibility=hidden
 .elif ${MACHINE_ARCH} == x86_64
-SRCS+=	pixman-mmx.c
-# XXX sse2 is broken with pixman 0.21.2; GCC generates unaligned accesses
-#SRCS+=	pixman-sse2.c
-COPTS.pixman-mmx.c=	-mmmx -fvisibility=hidden
-#COPTS.pixman-sse2.c=	-msse2 -fvisibility=hidden
+SRCS+=	pixman-sse2.c
+COPTS.pixman-sse2.c=	-msse2 -fvisibility=hidden
+CPPFLAGS+=	-DUSE_SSE2
 .endif
 
 .if ${MACHINE_ARCH} == powerpc



CVS commit: src/lib/libm/src

2013-02-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Feb 12 08:21:49 UTC 2013

Modified Files:
src/lib/libm/src: s_fma.c

Log Message:
Use __weak_alias instead of __weak_reference (obvious pasto)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/src/s_fma.c

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

Modified files:

Index: src/lib/libm/src/s_fma.c
diff -u src/lib/libm/src/s_fma.c:1.3 src/lib/libm/src/s_fma.c:1.4
--- src/lib/libm/src/s_fma.c:1.3	Mon Feb 11 02:45:27 2013
+++ src/lib/libm/src/s_fma.c	Tue Feb 12 08:21:48 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_fma.c,v 1.3 2013/02/11 02:45:27 christos Exp $	*/
+/*	$NetBSD: s_fma.c,v 1.4 2013/02/12 08:21:48 martin Exp $	*/
 
 /*-
  * Copyright (c) 2005-2011 David Schultz d...@freebsd.org
@@ -30,7 +30,7 @@
 #if 0
 __FBSDID($FreeBSD: src/lib/msun/src/s_fma.c,v 1.8 2011/10/21 06:30:43 das Exp $);
 #else
-__RCSID($NetBSD: s_fma.c,v 1.3 2013/02/11 02:45:27 christos Exp $);
+__RCSID($NetBSD: s_fma.c,v 1.4 2013/02/12 08:21:48 martin Exp $);
 #endif
 
 #include machine/ieee.h
@@ -289,5 +289,5 @@ fma(double x, double y, double z)
 }
 
 #ifndef __HAVE_LONG_DOUBLE
-__weak_reference(fma, fmal);
+__weak_alias(fma, fmal)
 #endif



CVS commit: src/lib/libm

2013-02-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Feb 12 21:40:19 UTC 2013

Modified Files:
src/lib/libm: Makefile
src/lib/libm/src: s_fmal.c s_frexpl.c

Log Message:
Use __HAVE_LONG_DOUBLE instead of EXT_EXPBITS and include s_nextafterl.c
as well as s_frexpl.c in the global list of common sources - as we
seem to have no arch redefining the standard double variant, it seems
unlikely we will have on redefining the long double version in assembler.


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/lib/libm/Makefile
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/s_fmal.c \
src/lib/libm/src/s_frexpl.c

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

Modified files:

Index: src/lib/libm/Makefile
diff -u src/lib/libm/Makefile:1.132 src/lib/libm/Makefile:1.133
--- src/lib/libm/Makefile:1.132	Mon Feb 11 17:55:01 2013
+++ src/lib/libm/Makefile	Tue Feb 12 21:40:18 2013
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.132 2013/02/11 17:55:01 matt Exp $
+#  $NetBSD: Makefile,v 1.133 2013/02/12 21:40:18 martin Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -68,9 +68,9 @@ COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
 .endif
 .PATH:	${.CURDIR}/arch/i387
 
-COMMON_SRCS+= fenv.c s_nextafterl.c s_nexttoward.c s_nexttowardf.c \
+COMMON_SRCS+= fenv.c s_nexttoward.c s_nexttowardf.c \
 	s_nearbyint.c s_rintl.c \
-	s_scalbln.c s_frexpl.c # s_nan.c
+	s_scalbln.c # s_nan.c
 COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
 
 ARCH_SRCS = e_acos.S e_asin.S e_atan2.S e_exp.S e_expf.S e_fmod.S e_log.S \
@@ -155,7 +155,7 @@ COMMON_SRCS+= b_exp.c b_log.c b_tgamma.c
 	s_floor.c s_floorf.c s_frexpf.c s_ilogb.c s_ilogbf.c s_ilogbl.c \
 	s_isinff.c s_isnanf.c s_ldexpf.c s_lib_version.c s_log1p.c \
 	s_log1pf.c s_logb.c s_logbf.c s_logbl.c \
-	s_matherr.c s_modff.c s_nextafter.c \
+	s_matherr.c s_modff.c s_nextafter.c s_nextafterl.c \
 	s_nextafterf.c s_remquo.c s_remquof.c s_rint.c s_rintf.c s_round.c s_roundf.c s_scalbn.c \
 	s_scalbnf.c s_scalbnl.c s_signgam.c s_significand.c s_significandf.c s_sin.c \
 	s_sinf.c s_tan.c s_tanf.c s_tanh.c s_tanhf.c s_tgammaf.c s_trunc.c s_truncf.c \
@@ -169,7 +169,7 @@ COMMON_SRCS+= b_exp.c b_log.c b_tgamma.c
 	w_pow.c w_powf.c w_remainder.c w_remainderf.c w_scalb.c w_scalbf.c \
 	w_sinh.c w_sinhf.c w_sqrt.c w_sqrtf.c \
 	lrint.c lrintf.c llrint.c llrintf.c lround.c lroundf.c llround.c \
-	llroundf.c s_frexp.c s_ldexp.c s_modf.c \
+	llroundf.c s_frexp.c s_frexpl.c s_ldexp.c s_modf.c \
 	s_fmax.c s_fmaxf.c s_fmaxl.c \
 	s_fmin.c s_fminf.c s_fminl.c s_fdim.c
 

Index: src/lib/libm/src/s_fmal.c
diff -u src/lib/libm/src/s_fmal.c:1.2 src/lib/libm/src/s_fmal.c:1.3
--- src/lib/libm/src/s_fmal.c:1.2	Mon Feb 11 01:29:58 2013
+++ src/lib/libm/src/s_fmal.c	Tue Feb 12 21:40:19 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_fmal.c,v 1.2 2013/02/11 01:29:58 christos Exp $	*/
+/*	$NetBSD: s_fmal.c,v 1.3 2013/02/12 21:40:19 martin Exp $	*/
 
 /*-
  * Copyright (c) 2005-2011 David Schultz d...@freebsd.org
@@ -30,7 +30,7 @@
 #if 0
 __FBSDID($FreeBSD: src/lib/msun/src/s_fmal.c,v 1.7 2011/10/21 06:30:43 das Exp $);
 #else
-__RCSID($NetBSD: s_fmal.c,v 1.2 2013/02/11 01:29:58 christos Exp $);
+__RCSID($NetBSD: s_fmal.c,v 1.3 2013/02/12 21:40:19 martin Exp $);
 #endif
 
 #include machine/ieee.h
@@ -40,7 +40,7 @@ __RCSID($NetBSD: s_fmal.c,v 1.2 2013/02
 
 #include math_private.h
 
-#ifdef EXT_EXPBITS
+#ifdef __HAVE_LONG_DOUBLE
 /*
  * A struct dd represents a floating-point number with twice the precision
  * of a long double.  We maintain the invariant that hi stores the high-order
Index: src/lib/libm/src/s_frexpl.c
diff -u src/lib/libm/src/s_frexpl.c:1.2 src/lib/libm/src/s_frexpl.c:1.3
--- src/lib/libm/src/s_frexpl.c:1.2	Mon Feb 11 01:47:04 2013
+++ src/lib/libm/src/s_frexpl.c	Tue Feb 12 21:40:19 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_frexpl.c,v 1.2 2013/02/11 01:47:04 christos Exp $	*/
+/*	$NetBSD: s_frexpl.c,v 1.3 2013/02/12 21:40:19 martin Exp $	*/
 
 /*-
  * Copyright (c) 2004-2005 David Schultz d...@freebsd.org
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: s_frexpl.c,v 1.2 2013/02/11 01:47:04 christos Exp $);
+__RCSID($NetBSD: s_frexpl.c,v 1.3 2013/02/12 21:40:19 martin Exp $);
 
 #include machine/ieee.h
 #include float.h
@@ -37,7 +37,7 @@ __RCSID($NetBSD: s_frexpl.c,v 1.2 2013/
 
 #include math_private.h
 
-#ifdef EXT_EXPBITS
+#ifdef __HAVE_LONG_DOUBLE
 #if LDBL_MAX_EXP != 0x4000
 #error Unsupported long double format
 #endif



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

2013-02-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 14 12:14:14 UTC 2013

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

Log Message:
Rearrange the special mainbus device list to allow for optional entries.
Fixes a panic on all SUN4M machines w/o an sx graphics adapter.
XXX the ignore devices at mainbus list seems to be ignored - or am I
missing something?


To generate a diff of this commit:
cvs rdiff -u -r1.248 -r1.249 src/sys/arch/sparc/sparc/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/sparc/sparc/autoconf.c
diff -u src/sys/arch/sparc/sparc/autoconf.c:1.248 src/sys/arch/sparc/sparc/autoconf.c:1.249
--- src/sys/arch/sparc/sparc/autoconf.c:1.248	Tue Feb  5 22:03:16 2013
+++ src/sys/arch/sparc/sparc/autoconf.c	Thu Feb 14 12:14:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.248 2013/02/05 22:03:16 macallan Exp $ */
+/*	$NetBSD: autoconf.c,v 1.249 2013/02/14 12:14:13 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.248 2013/02/05 22:03:16 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.249 2013/02/14 12:14:13 martin Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -1091,84 +1091,90 @@ mainbus_attach(device_t parent, device_t
 extern struct sparc_bus_dma_tag mainbus_dma_tag;
 extern struct sparc_bus_space_tag mainbus_space_tag;
 
+	struct boot_special {
+		const char *const dev;
+#define BS_EARLY	1	/* attach device early */
+#define	BS_IGNORE	2	/* ignore root device */
+#define	BS_OPTIONAL	4	/* device not alwas present */
+		unsigned int flags;
+	};
+
 	struct mainbus_attach_args ma;
 	char namebuf[32];
 #if defined(SUN4C) || defined(SUN4M) || defined(SUN4D)
-	const char *const *ssp, *sp = NULL;
+	const char *sp = NULL;
 	int node0, node;
-	const char *const *openboot_special;
+	const struct boot_special *openboot_special, *ssp;
 #endif
 
 #if defined(SUN4C)
-	static const char *const openboot_special4c[] = {
-		/* find these first (end with empty string) */
-		memory-error,	/* as early as convenient, in case of error */
-		eeprom,
-		counter-timer,
-		auxiliary-io,
-		,
-
-		/* ignore these (end with NULL) */
-		aliases,
-		interrupt-enable,
-		memory,
-		openprom,
-		options,
-		packages,
-		virtual-memory,
-		NULL
+	static const struct boot_special openboot_special4c[] = {
+		/* find these first */
+		{ memory-error, BS_EARLY },
+			/* as early as convenient, in case of error */
+		{ eeprom, BS_EARLY },
+		{ counter-timer, BS_EARLY },
+		{ auxiliary-io, BS_EARLY },
+
+		/* ignore these */
+		{ aliases, BS_IGNORE },
+		{ interrupt-enable, BS_IGNORE },
+		{ memory, BS_IGNORE },
+		{ openprom, BS_IGNORE },
+		{ options, BS_IGNORE },
+		{ packages, BS_IGNORE },
+		{ virtual-memory, BS_IGNORE },
+
+		/* sentinel */
+		{ NULL, 0 }
 	};
 #else
 #define openboot_special4c	((void *)0)
 #endif
 #if defined(SUN4M)
-	static const char *const openboot_special4m[] = {
+	static const struct boot_special openboot_special4m[] = {
 		/* find these first */
-#if !defined(MSIIEP)
-		SUNW,sx,
-		obio,		/* smart enough to get eeprom/etc mapped */
-#else
-		pci,		/* ms-IIep */
-#endif
-		,
+		{ SUNW,sx, BS_EARLY|BS_OPTIONAL },
+		{ obio, BS_EARLY|BS_OPTIONAL },
+/* smart enough to get eeprom/etc mapped */
+		{ pci, BS_EARLY|BS_OPTIONAL },	/* ms-IIep */
 
-		/* ignore these (end with NULL) */
 		/*
 		 * These are _root_ devices to ignore. Others must be handled
 		 * elsewhere.
 		 */
-		virtual-memory,
-		aliases,
-		chosen,		/* OpenFirmware */
-		memory,
-		openprom,
-		options,
-		packages,
-		udp,			/* OFW in Krups */
+		{ virtual-memory, BS_IGNORE },
+		{ aliases, BS_IGNORE },
+		{ chosen, BS_IGNORE },	/* OpenFirmware */
+		{ memory, BS_IGNORE },
+		{ openprom, BS_IGNORE },
+		{ options, BS_IGNORE },
+		{ packages, BS_IGNORE },
+		{ udp, BS_IGNORE },		/* OFW in Krups */
 		/* we also skip any nodes with device_type == cpu */
-		NULL
+
+		{ NULL, 0 }
 	};
 #else
 #define openboot_special4m	((void *)0)
 #endif
 #if defined(SUN4D)
-	static const char *const openboot_special4d[] = {
-		,
-
-		/* ignore these (end with NULL) */
+	static const struct boot_special openboot_special4d[] = {
 		/*
 		 * These are _root_ devices to ignore. Others must be handled
 		 * elsewhere.
 		 */
-		mem-unit,	/* XXX might need this for memory errors */
-		boards,
-		openprom,
-		virtual-memory,
-		memory,
-		aliases,
-		options,
-		packages,
-		NULL
+		{ mem-unit, BS_IGNORE },
+			/* XXX might need this for memory errors */
+		{ boards, BS_IGNORE },
+		{ openprom, BS_IGNORE },
+		{ virtual-memory, BS_IGNORE },
+		{ memory, BS_IGNORE },
+		{ aliases, BS_IGNORE },
+		{ options, BS_IGNORE },
+		{ packages, BS_IGNORE },
+
+		{ NULL, 0 }
 	};
 #else
 #define	openboot_special4d	((void *)0)
@@ -1282,10 +1288,12 @@ extern struct sparc_bus_space_tag mainbu
 		config_found(dev, (void *)ma, mbprint);
 

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

2013-02-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 14 12:44:16 UTC 2013

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

Log Message:
Fix thinko in previous (and misleading comment): stop ignoring table
entries for to be ignored devices.


To generate a diff of this commit:
cvs rdiff -u -r1.249 -r1.250 src/sys/arch/sparc/sparc/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/sparc/sparc/autoconf.c
diff -u src/sys/arch/sparc/sparc/autoconf.c:1.249 src/sys/arch/sparc/sparc/autoconf.c:1.250
--- src/sys/arch/sparc/sparc/autoconf.c:1.249	Thu Feb 14 12:14:13 2013
+++ src/sys/arch/sparc/sparc/autoconf.c	Thu Feb 14 12:44:16 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.249 2013/02/14 12:14:13 martin Exp $ */
+/*	$NetBSD: autoconf.c,v 1.250 2013/02/14 12:44:16 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.249 2013/02/14 12:14:13 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.250 2013/02/14 12:44:16 martin Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -1340,12 +1340,14 @@ extern struct sparc_bus_space_tag mainbu
 		cp = prom_getpropstringA(node, name, namebuf, sizeof namebuf);
 		DPRINTF(ACDB_PROBE, ( name %s\n, namebuf));
 		for (ssp = openboot_special; (sp = ssp-dev) != NULL; ssp++) {
-			if (!(ssp-flags  BS_EARLY)) continue;
+			if (!(ssp-flags  (BS_EARLY|BS_IGNORE))) continue;
 			if (strcmp(cp, sp) == 0)
 break;
 		}
 		if (sp != NULL)
-			continue; /* an early device already configured */
+			continue;
+			/* an early device already configured, or an
+			   ignored device */
 
 		memset(ma, 0, sizeof ma);
 		ma.ma_bustag = mainbus_space_tag;



CVS commit: src/external/public-domain/sqlite

2013-02-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 14 17:12:24 UTC 2013

Modified Files:
src/external/public-domain/sqlite/bin: Makefile
src/external/public-domain/sqlite/dist: sqlite3.c

Log Message:
When converting long double values to decimal, convert to int via a call
to floor(), so the conversion does not depend on current rounding mode.
Fixes PR port-sparc64/47535.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/public-domain/sqlite/bin/Makefile
cvs rdiff -u -r1.6 -r1.7 src/external/public-domain/sqlite/dist/sqlite3.c

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

Modified files:

Index: src/external/public-domain/sqlite/bin/Makefile
diff -u src/external/public-domain/sqlite/bin/Makefile:1.3 src/external/public-domain/sqlite/bin/Makefile:1.4
--- src/external/public-domain/sqlite/bin/Makefile:1.3	Sun Dec 16 20:31:07 2012
+++ src/external/public-domain/sqlite/bin/Makefile	Thu Feb 14 17:12:23 2013
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.3 2012/12/16 20:31:07 christos Exp $
+# $NetBSD: Makefile,v 1.4 2013/02/14 17:12:23 martin Exp $
 
 PROG=		sqlite3
 
 SRCS=		shell.c
 
 DPADD+=		${LIBSQLITE3} ${LIBEDIT} ${LIBTERIMINFO}
-LDADD+=		-lsqlite3 -ledit -lterminfo
+LDADD+=		-lsqlite3 -ledit -lterminfo -lm
 
 BINDIR=		/usr/bin
 

Index: src/external/public-domain/sqlite/dist/sqlite3.c
diff -u src/external/public-domain/sqlite/dist/sqlite3.c:1.6 src/external/public-domain/sqlite/dist/sqlite3.c:1.7
--- src/external/public-domain/sqlite/dist/sqlite3.c:1.6	Mon Feb  6 17:24:49 2012
+++ src/external/public-domain/sqlite/dist/sqlite3.c	Thu Feb 14 17:12:23 2013
@@ -19422,11 +19422,14 @@ static const et_info fmtinfo[] = {
 ** 16 (the number of significant digits in a 64-bit float) '0' is
 ** always returned.
 */
+#ifdef SQLITE_HAVE_ISNAN
+# include math.h
+#endif
 static char et_getdigit(LONGDOUBLE_TYPE *val, int *cnt){
   int digit;
   LONGDOUBLE_TYPE d;
   if( (*cnt)++ = 16 ) return '0';
-  digit = (int)*val;
+  digit = (int)floor(*val);
   d = digit;
   digit += '0';
   *val = (*val - d)*10.0;
@@ -20998,9 +21001,6 @@ SQLITE_PRIVATE void sqlite3UtfSelfTest(v
 **
 */
 /* #include stdarg.h */
-#ifdef SQLITE_HAVE_ISNAN
-# include math.h
-#endif
 
 /*
 ** Routine needed to support the testcase() macro.
@@ -132872,7 +132872,7 @@ SQLITE_API int sqlite3_extension_init(
 **May you share freely, never taking more than you give.
 **
 *
-** $Id: sqlite3.c,v 1.6 2012/02/06 17:24:49 matt Exp $
+** $Id: sqlite3.c,v 1.7 2013/02/14 17:12:23 martin Exp $
 **
 ** This file implements an integration between the ICU library 
 ** (International Components for Unicode, an open-source library 



CVS commit: src/external/public-domain/sqlite/lib

2013-02-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 15 07:59:37 UTC 2013

Modified Files:
src/external/public-domain/sqlite/lib: Makefile

Log Message:
Backout libm dependency here as well (assuming it was meant for the
backed-out use of floor() I added/removed yesterday)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/public-domain/sqlite/lib/Makefile

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

Modified files:

Index: src/external/public-domain/sqlite/lib/Makefile
diff -u src/external/public-domain/sqlite/lib/Makefile:1.2 src/external/public-domain/sqlite/lib/Makefile:1.3
--- src/external/public-domain/sqlite/lib/Makefile:1.2	Thu Feb 14 19:18:38 2013
+++ src/external/public-domain/sqlite/lib/Makefile	Fri Feb 15 07:59:36 2013
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2013/02/14 19:18:38 matt Exp $
+# $NetBSD: Makefile,v 1.3 2013/02/15 07:59:36 martin Exp $
 
 LIB=		sqlite3
 INCS=		sqlite3.h sqlite3ext.h
@@ -8,8 +8,6 @@ SRCS=		sqlite3.c
 
 CFLAGS+=	-DNDEBUG
 
-LIBDPLIBS+=	m	${NETBSDSRCDIR}/lib/libm
-
 FILES+=			sqlite3.pc
 FILESOWN_sqlite3.pc=	${BINOWN}
 FILESGRP_sqlite3.pc=	${BINGRP}



CVS commit: src/lib/libc/arch/sparc64/softfloat

2013-02-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 15 09:24:05 UTC 2013

Modified Files:
src/lib/libc/arch/sparc64/softfloat: qp.c

Log Message:
Make all conversions from 128bit (long double) floats to integral types
use rounding towards zero (casts to int/long are not affected by current
rounding mode).
Fixes PR port-sparc64/47535.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/sparc64/softfloat/qp.c

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

Modified files:

Index: src/lib/libc/arch/sparc64/softfloat/qp.c
diff -u src/lib/libc/arch/sparc64/softfloat/qp.c:1.9 src/lib/libc/arch/sparc64/softfloat/qp.c:1.10
--- src/lib/libc/arch/sparc64/softfloat/qp.c:1.9	Sat Mar 17 20:48:59 2012
+++ src/lib/libc/arch/sparc64/softfloat/qp.c	Fri Feb 15 09:24:05 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: qp.c,v 1.9 2012/03/17 20:48:59 martin Exp $ */
+/* $NetBSD: qp.c,v 1.10 2013/02/15 09:24:05 martin Exp $ */
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -194,7 +194,7 @@ _Qp_qtod(float128 *a)
 int
 _Qp_qtoi(float128 *a)
 {
-	return float128_to_int32(*a);
+	return float128_to_int32_round_to_zero(*a);
 }
 
 
@@ -215,7 +215,7 @@ float
 unsigned int
 _Qp_qtoui(float128 *a)
 {
-	return (unsigned int)float128_to_int64(*a);
+	return (unsigned int)float128_to_int64_round_to_zero(*a);
 }
 
 



CVS commit: src/external/gpl3/gdb/dist/gdb

2013-02-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Feb 16 18:06:44 UTC 2013

Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-thread.c

Log Message:
When searching for an active thread (e.g. right after switching to threaded
mode), if no lwp is signaled, just stay with the current (inferior_ptid.lwp).
This fixes gdb -p to a threaded process with all threads active.
Previously we eroneously restored an lwp of 0 (returned as sentinel from
ptrace) to inferior_ptid.lwp, which then would not match any thread in
thread_list and caused assertion failures.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/gpl3/gdb/dist/gdb/nbsd-thread.c

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

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/nbsd-thread.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-thread.c:1.16 src/external/gpl3/gdb/dist/gdb/nbsd-thread.c:1.17
--- src/external/gpl3/gdb/dist/gdb/nbsd-thread.c:1.16	Sat Apr 21 00:16:35 2012
+++ src/external/gpl3/gdb/dist/gdb/nbsd-thread.c	Sat Feb 16 18:06:43 2013
@@ -282,6 +282,9 @@ find_active_thread (void)
   while ((val != -1)  (pl.pl_lwpid != 0) 
 	 (pl.pl_event != PL_EVENT_SIGNAL))
 	val = ptrace (PT_LWPINFO, GET_PID(inferior_ptid), (void *)pl, sizeof(pl));
+  if (pl.pl_lwpid == 0)
+	/* found no active thread, stay with current */
+	pl.pl_lwpid = inferior_ptid.lwp;
 }
   else
 {



CVS commit: src/sys

2013-02-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Feb 19 09:04:55 UTC 2013

Modified Files:
src/sys/rump/librump/rumpkern: emul.c rump.c rump_private.h
src/sys/rump/librump/rumpkern/arch/i386: rumpcpu.c
src/sys/sys: xcall.h

Log Message:
Stopgap fix to make rump cooperate with pserialize, may be revisited later.
Patch from pooka, ok: rmind. No related regressions in a complete atf test
run (which works again with this, even on non x86 SMP machines).


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.153 src/sys/rump/librump/rumpkern/emul.c
cvs rdiff -u -r1.250 -r1.251 src/sys/rump/librump/rumpkern/rump.c
cvs rdiff -u -r1.72 -r1.73 src/sys/rump/librump/rumpkern/rump_private.h
cvs rdiff -u -r1.9 -r1.10 src/sys/rump/librump/rumpkern/arch/i386/rumpcpu.c
cvs rdiff -u -r1.4 -r1.5 src/sys/sys/xcall.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/emul.c
diff -u src/sys/rump/librump/rumpkern/emul.c:1.152 src/sys/rump/librump/rumpkern/emul.c:1.153
--- src/sys/rump/librump/rumpkern/emul.c:1.152	Sun Jan 20 17:09:47 2013
+++ src/sys/rump/librump/rumpkern/emul.c	Tue Feb 19 09:04:54 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: emul.c,v 1.152 2013/01/20 17:09:47 rmind Exp $	*/
+/*	$NetBSD: emul.c,v 1.153 2013/02/19 09:04:54 martin Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: emul.c,v 1.152 2013/01/20 17:09:47 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: emul.c,v 1.153 2013/02/19 09:04:54 martin Exp $);
 
 #include sys/param.h
 #include sys/null.h
@@ -281,37 +281,6 @@ syscall_intern(struct proc *p)
 }
 #endif
 
-void
-xc_send_ipi(struct cpu_info *ci)
-{
-	const struct cpu_info *curci = curcpu();
-	CPU_INFO_ITERATOR cii;
-
-	/*
-	 * IPI are considered asynchronous, therefore no need to wait for
-	 * unicast call delivery (nor the order of calls matters).  Our LWP
-	 * needs to be bound to the CPU, since xc_unicast(9) may block.
-	 *
-	 * WARNING: These must be low-priority calls, as this routine is
-	 * used to emulate high-priority (XC_HIGHPRI) mechanism.
-	 */
-
-	if (ci) {
-		KASSERT(curci != ci);
-		(void)xc_unicast(0, (xcfunc_t)xc_ipi_handler, NULL, NULL, ci);
-		return;
-	}
-
-	curlwp-l_pflag |= LP_BOUND;
-	for (CPU_INFO_FOREACH(cii, ci)) {
-		if (curci == ci) {
-			continue;
-		}
-		(void)xc_unicast(0, (xcfunc_t)xc_ipi_handler, NULL, NULL, ci);
-	}
-	curlwp-l_pflag = ~LP_BOUND;
-}
-
 int
 trace_enter(register_t code, const register_t *args, int narg)
 {

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.250 src/sys/rump/librump/rumpkern/rump.c:1.251
--- src/sys/rump/librump/rumpkern/rump.c:1.250	Mon Jan 14 16:52:35 2013
+++ src/sys/rump/librump/rumpkern/rump.c	Tue Feb 19 09:04:54 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.250 2013/01/14 16:52:35 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.251 2013/02/19 09:04:54 martin Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.250 2013/01/14 16:52:35 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.251 2013/02/19 09:04:54 martin Exp $);
 
 #include sys/systm.h
 #define ELFSIZE ARCH_ELFSIZE
@@ -892,3 +892,23 @@ rump_allbetsareoff_setid(pid_t pid, int 
 	l-l_lid = lid;
 	p-p_pid = pid;
 }
+
+#include sys/pserialize.h
+
+static void
+ipiemu(void *a1, void *a2)
+{
+
+	xc__highpri_intr(NULL);
+	pserialize_switchpoint();
+}
+
+void
+rump_xc_highpri(struct cpu_info *ci)
+{
+
+	if (ci)
+		xc_unicast(0, ipiemu, NULL, NULL, ci);
+	else
+		xc_broadcast(0, ipiemu, NULL, NULL);
+}

Index: src/sys/rump/librump/rumpkern/rump_private.h
diff -u src/sys/rump/librump/rumpkern/rump_private.h:1.72 src/sys/rump/librump/rumpkern/rump_private.h:1.73
--- src/sys/rump/librump/rumpkern/rump_private.h:1.72	Mon Jan 14 16:45:47 2013
+++ src/sys/rump/librump/rumpkern/rump_private.h	Tue Feb 19 09:04:54 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_private.h,v 1.72 2013/01/14 16:45:47 pooka Exp $	*/
+/*	$NetBSD: rump_private.h,v 1.73 2013/02/19 09:04:54 martin Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -139,4 +139,6 @@ void	rump_softint_run(struct cpu_info *)
 void	*rump_hypermalloc(size_t, int, bool, const char *);
 void	rump_hyperfree(void *, size_t);
 
+void	rump_xc_highpri(struct cpu_info *);
+
 #endif /* _SYS_RUMP_PRIVATE_H_ */

Index: src/sys/rump/librump/rumpkern/arch/i386/rumpcpu.c
diff -u src/sys/rump/librump/rumpkern/arch/i386/rumpcpu.c:1.9 src/sys/rump/librump/rumpkern/arch/i386/rumpcpu.c:1.10
--- src/sys/rump/librump/rumpkern/arch/i386/rumpcpu.c:1.9	Wed Apr 28 00:34:25 2010
+++ src/sys/rump/librump/rumpkern/arch/i386/rumpcpu.c	Tue Feb 19 09:04:54 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpcpu.c,v 1.9 2010/04/28 00:34:25 pooka Exp $	*/
+/*	$NetBSD: 

CVS commit: src/sys/kern

2013-02-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Feb 19 11:20:17 UTC 2013

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

Log Message:
Oops, accidently did not commit this part of pooka's change.


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

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

Modified files:

Index: src/sys/kern/subr_xcall.c
diff -u src/sys/kern/subr_xcall.c:1.13 src/sys/kern/subr_xcall.c:1.14
--- src/sys/kern/subr_xcall.c:1.13	Fri May 13 22:16:44 2011
+++ src/sys/kern/subr_xcall.c	Tue Feb 19 11:20:17 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_xcall.c,v 1.13 2011/05/13 22:16:44 rmind Exp $	*/
+/*	$NetBSD: subr_xcall.c,v 1.14 2013/02/19 11:20:17 martin Exp $	*/
 
 /*-
  * Copyright (c) 2007-2010 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
  
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_xcall.c,v 1.13 2011/05/13 22:16:44 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_xcall.c,v 1.14 2013/02/19 11:20:17 martin Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -85,6 +85,10 @@ __KERNEL_RCSID(0, $NetBSD: subr_xcall.c
 #include sys/kthread.h
 #include sys/cpu.h
 
+#ifdef _RUMPKERNEL
+#include rump_private.h
+#endif
+
 /* Cross-call state box. */
 typedef struct {
 	kmutex_t	xc_lock;
@@ -113,7 +117,6 @@ static struct evcnt	xc_broadcast_ev	__ca
 
 static void		xc_init(void);
 static void		xc_thread(void *);
-static void		xc_highpri_intr(void *);
 
 static inline uint64_t	xc_highpri(xcfunc_t, void *, void *, struct cpu_info *);
 static inline uint64_t	xc_lowpri(xcfunc_t, void *, void *, struct cpu_info *);
@@ -137,7 +140,7 @@ xc_init(void)
 	mutex_init(xchi-xc_lock, MUTEX_DEFAULT, IPL_SOFTCLOCK);
 	cv_init(xchi-xc_busy, xchicv);
 	xc_sih = softint_establish(SOFTINT_CLOCK | SOFTINT_MPSAFE,
-	xc_highpri_intr, NULL);
+	xc__highpri_intr, NULL);
 	KASSERT(xc_sih != NULL);
 
 	evcnt_attach_dynamic(xc_unicast_ev, EVCNT_TYPE_MISC, NULL,
@@ -329,23 +332,23 @@ xc_thread(void *cookie)
 void
 xc_ipi_handler(void)
 {
-	/* Executes xc_highpri_intr() via software interrupt. */
+	/* Executes xc__highpri_intr() via software interrupt. */
 	softint_schedule(xc_sih);
 }
 
 /*
- * xc_highpri_intr:
+ * xc__highpri_intr:
  *
  *	A software interrupt handler for high priority calls.
  */
-static void
-xc_highpri_intr(void *dummy)
+void
+xc__highpri_intr(void *dummy)
 {
 	xc_state_t *xc = xc_high_pri;
 	void *arg1, *arg2;
 	xcfunc_t func;
 
-	KASSERT(cpu_softintr_p());
+	KASSERT(!cpu_intr_p());
 	/*
 	 * Lock-less fetch of function and its arguments.
 	 * Safe since it cannot change at this point.
@@ -396,6 +399,9 @@ xc_highpri(xcfunc_t func, void *arg1, vo
 	 * Note: it will handle the local CPU case.
 	 */
 
+#ifdef _RUMPKERNEL
+	rump_xc_highpri(ci);
+#else
 #ifdef MULTIPROCESSOR
 	kpreempt_disable();
 	if (curcpu() == ci) {
@@ -414,6 +420,7 @@ xc_highpri(xcfunc_t func, void *arg1, vo
 	KASSERT(curcpu() == ci);
 	xc_ipi_handler();
 #endif
+#endif
 
 	/* Indicate a high priority ticket. */
 	return (where | XC_PRI_BIT);



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

2013-02-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 21 08:07:25 UTC 2013

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

Log Message:
Add PCVT compat (for X console switching) and another font (purely
esthetical). From maccalan@.


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/arch/sparc64/conf/GENERIC

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

Modified files:

Index: src/sys/arch/sparc64/conf/GENERIC
diff -u src/sys/arch/sparc64/conf/GENERIC:1.158 src/sys/arch/sparc64/conf/GENERIC:1.159
--- src/sys/arch/sparc64/conf/GENERIC:1.158	Wed Feb 20 19:35:46 2013
+++ src/sys/arch/sparc64/conf/GENERIC	Thu Feb 21 08:07:24 2013
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.158 2013/02/20 19:35:46 macallan Exp $
+# $NetBSD: GENERIC,v 1.159 2013/02/21 08:07:24 martin Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include	arch/sparc64/conf/std.sparc64
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.158 $
+#ident 		GENERIC-$Revision: 1.159 $
 
 maxusers	64
 
@@ -929,9 +929,11 @@ options 	WS_DEFAULT_BG=WSCOL_LIGHT_WHITE
 options 	WSDISPLAY_COMPAT_PCVT		# emulate some ioctls
 options 	WSDISPLAY_COMPAT_SYSCONS	# emulate some more ioctls
 options 	WSDISPLAY_COMPAT_USL		# wsconscfg VT handling
+options 	WSDISPLAY_COMPAT_PCVT		# emulate some ioctls
 options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
 options 	WSDISPLAY_DEFAULTSCREENS=4
 options 	FONT_GALLANT12x22		# PROM font look-alike
+options 	FONT_DROID_SANS_MONO12x22	# antialiased font
 
  Other device configuration
 



CVS commit: src/external/mit/xorg/bin/xdm/config

2013-02-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 21 08:20:19 UTC 2013

Modified Files:
src/external/mit/xorg/bin/xdm/config: Makefile

Log Message:
Make the Xdm default config use vt05 for all arches that can switch
consoles while in X.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/mit/xorg/bin/xdm/config/Makefile

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

Modified files:

Index: src/external/mit/xorg/bin/xdm/config/Makefile
diff -u src/external/mit/xorg/bin/xdm/config/Makefile:1.12 src/external/mit/xorg/bin/xdm/config/Makefile:1.13
--- src/external/mit/xorg/bin/xdm/config/Makefile:1.12	Wed Jun 13 19:44:14 2012
+++ src/external/mit/xorg/bin/xdm/config/Makefile	Thu Feb 21 08:20:19 2013
@@ -1,9 +1,21 @@
-#	$NetBSD: Makefile,v 1.12 2012/06/13 19:44:14 martin Exp $
+#	$NetBSD: Makefile,v 1.13 2013/02/21 08:20:19 martin Exp $
 
 .include bsd.own.mk
 
-# native only gives DEFAULTVT for i386 and amd64.
-.if ${MACHINE_ARCH} == i386 || ${MACHINE_ARCH} == x86_64 || ${MACHINE} == cats
+# DEFAULTVT for all arches that are able to switch virtual consoles
+# while in X (currently this needs WSDISPLAY_COMPAT_USL and
+# WSDISPLAY_COMPAT_PCVT, this might change soon)
+.if	   ${MACHINE_ARCH} == x86_64 \
+	|| ${MACHINE_ARCH} == cats \
+	|| ${MACHINE_ARCH} == hp700 \
+	|| ${MACHINE_ARCH} == hpcmips \
+	|| ${MACHINE_ARCH} == hpcsh \
+	|| ${MACHINE_ARCH} == i386 \
+	|| ${MACHINE_ARCH} == netwinder \
+	|| ${MACHINE_ARCH} == shark \
+	|| ${MACHINE_ARCH} == sparc \
+	|| ${MACHINE_ARCH} == sparc64 \
+	|| ${MACHINE_ARCH} == zaurus
 DEFAULTVT=vt05
 .else
 DEFAULTVT=	# defined empty



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

2013-02-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 21 09:04:24 UTC 2013

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

Log Message:
Remove duplciate WSDISPLAY_COMPAT_PCVT - no idea how that sneaked in.
Thanks to Nick Hudson for the quick catch.


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/sys/arch/sparc64/conf/GENERIC

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

Modified files:

Index: src/sys/arch/sparc64/conf/GENERIC
diff -u src/sys/arch/sparc64/conf/GENERIC:1.159 src/sys/arch/sparc64/conf/GENERIC:1.160
--- src/sys/arch/sparc64/conf/GENERIC:1.159	Thu Feb 21 08:07:24 2013
+++ src/sys/arch/sparc64/conf/GENERIC	Thu Feb 21 09:04:22 2013
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.159 2013/02/21 08:07:24 martin Exp $
+# $NetBSD: GENERIC,v 1.160 2013/02/21 09:04:22 martin Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include	arch/sparc64/conf/std.sparc64
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.159 $
+#ident 		GENERIC-$Revision: 1.160 $
 
 maxusers	64
 
@@ -929,7 +929,6 @@ options 	WS_DEFAULT_BG=WSCOL_LIGHT_WHITE
 options 	WSDISPLAY_COMPAT_PCVT		# emulate some ioctls
 options 	WSDISPLAY_COMPAT_SYSCONS	# emulate some more ioctls
 options 	WSDISPLAY_COMPAT_USL		# wsconscfg VT handling
-options 	WSDISPLAY_COMPAT_PCVT		# emulate some ioctls
 options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
 options 	WSDISPLAY_DEFAULTSCREENS=4
 options 	FONT_GALLANT12x22		# PROM font look-alike



CVS commit: src/sys/dev/ic

2013-02-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb 27 09:29:21 UTC 2013

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

Log Message:
Disable ICBOPT_FAST_POST for ISP 2100.
Fixes PR kern/47302. From Matthew Jacob.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sys/dev/ic/isp.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/isp.c
diff -u src/sys/dev/ic/isp.c:1.122 src/sys/dev/ic/isp.c:1.123
--- src/sys/dev/ic/isp.c:1.122	Mon Feb 28 17:17:55 2011
+++ src/sys/dev/ic/isp.c	Wed Feb 27 09:29:21 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: isp.c,v 1.122 2011/02/28 17:17:55 mjacob Exp $ */
+/* $NetBSD: isp.c,v 1.123 2013/02/27 09:29:21 martin Exp $ */
 /*
  * Machine and OS Independent (well, as best as possible)
  * code for the Qlogic ISP SCSI adapters.
@@ -43,7 +43,7 @@
  */
 #ifdef	__NetBSD__
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: isp.c,v 1.122 2011/02/28 17:17:55 mjacob Exp $);
+__KERNEL_RCSID(0, $NetBSD: isp.c,v 1.123 2013/02/27 09:29:21 martin Exp $);
 #include dev/ic/isp_netbsd.h
 #endif
 #ifdef	__FreeBSD__
@@ -1580,7 +1580,13 @@ isp_fibre_init(ispsoftc_t *isp)
 	 *
 	 * NB: for the 2300, ICBOPT_EXTENDED is required.
 	 */
-	if (IS_2200(isp) || IS_23XX(isp)) {
+	if (IS_2100(isp)) {
+		/*
+		 * We can't have Fast Posting any more- we now
+		 * have 32 bit handles.
+		 */
+		icbp-icb_fwoptions = ~ICBOPT_FAST_POST;
+	} else if (IS_2200(isp) || IS_23XX(isp)) {
 		icbp-icb_fwoptions |= ICBOPT_EXTENDED;
 		/*
 		 * Prefer or force Point-To-Point instead Loop?



CVS commit: src/sys/secmodel/extensions

2013-02-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 28 15:23:25 UTC 2013

Modified Files:
src/sys/secmodel/extensions: secmodel_extensions.c

Log Message:
Make the callback deal with embryonic connections which do not have
credentials yet. Fixes PR kern/47598.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/secmodel/extensions/secmodel_extensions.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/secmodel/extensions/secmodel_extensions.c
diff -u src/sys/secmodel/extensions/secmodel_extensions.c:1.4 src/sys/secmodel/extensions/secmodel_extensions.c:1.5
--- src/sys/secmodel/extensions/secmodel_extensions.c:1.4	Mon Jan 28 00:51:29 2013
+++ src/sys/secmodel/extensions/secmodel_extensions.c	Thu Feb 28 15:23:24 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: secmodel_extensions.c,v 1.4 2013/01/28 00:51:29 jym Exp $ */
+/* $NetBSD: secmodel_extensions.c,v 1.5 2013/02/28 15:23:24 martin Exp $ */
 /*-
  * Copyright (c) 2011 Elad Efrat e...@netbsd.org
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: secmodel_extensions.c,v 1.4 2013/01/28 00:51:29 jym Exp $);
+__KERNEL_RCSID(0, $NetBSD: secmodel_extensions.c,v 1.5 2013/02/28 15:23:24 martin Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -481,6 +481,9 @@ secmodel_extensions_network_cb(kauth_cre
 	if (curtain != 0) {
 		struct socket *so = (struct socket *)arg1;
 
+		if (__predict_false(so == NULL || so-so_cred == NULL))
+			return KAUTH_RESULT_DENY;
+
 		if (!kauth_cred_uidmatch(cred, so-so_cred)) {
 			int error;
 			bool isroot = false;



CVS commit: src/tests/kernel

2013-02-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 28 15:31:23 UTC 2013

Modified Files:
src/tests/kernel: Makefile
Added Files:
src/tests/kernel: t_kauth_pr_47598.c

Log Message:
Add a testprogram for PR 47598.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/tests/kernel/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/kernel/t_kauth_pr_47598.c

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

Modified files:

Index: src/tests/kernel/Makefile
diff -u src/tests/kernel/Makefile:1.31 src/tests/kernel/Makefile:1.32
--- src/tests/kernel/Makefile:1.31	Wed Nov  7 16:36:49 2012
+++ src/tests/kernel/Makefile	Thu Feb 28 15:31:22 2013
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.31 2012/11/07 16:36:49 pgoyette Exp $
+# $NetBSD: Makefile,v 1.32 2013/02/28 15:31:22 martin Exp $
 
 NOMAN=		# defined
 
@@ -13,6 +13,7 @@ TESTS_C+=	t_pty
 TESTS_C+=	t_mqueue
 TESTS_C+=	t_sysv
 TESTS_C+=	t_subr_prf
+TESTS_C+=	t_kauth_pr_47598
 
 TESTS_SH=	t_umount
 TESTS_SH+=	t_ps_strings

Added files:

Index: src/tests/kernel/t_kauth_pr_47598.c
diff -u /dev/null src/tests/kernel/t_kauth_pr_47598.c:1.1
--- /dev/null	Thu Feb 28 15:31:23 2013
+++ src/tests/kernel/t_kauth_pr_47598.c	Thu Feb 28 15:31:22 2013
@@ -0,0 +1,127 @@
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include sys/cdefs.h
+__COPYRIGHT(@(#) Copyright (c) 2013\
+ The NetBSD Foundation, inc. All rights reserved.);
+__RCSID($NetBSD: t_kauth_pr_47598.c,v 1.1 2013/02/28 15:31:22 martin Exp $);
+
+#include errno.h
+#include unistd.h
+#include stdio.h
+#include stdlib.h
+#include sys/sysctl.h
+#include sys/socket.h
+#include netinet/in.h
+#include arpa/inet.h
+#include atf-c.h
+
+/*
+ * PR kern/47598: if security.models.extensions.curtain = 1 we crash when
+ * doing a netstat while an embryonic (not yet fully accepted) connection
+ * exists.
+ * This has been fixed with rev. 1.5 of
+ *   src/sys/secmodel/extensions/secmodel_extensions.c.
+ */
+
+
+ATF_TC(kauth_curtain);
+ATF_TC_HEAD(kauth_curtain, tc)
+{
+	atf_tc_set_md_var(tc, require.user, root);
+	atf_tc_set_md_var(tc, require.progs, netstat);
+	atf_tc_set_md_var(tc, descr,
+	Checks for kernel crash with curtain active (PR kern/47598));
+}
+
+ATF_TC_BODY(kauth_curtain, tc)
+{
+	static const char curtain_name[] = security.models.bsd44.curtain;
+
+	int old_curtain, new_curtain = 1, s, s2, err;
+	size_t old_curtain_len = sizeof(old_curtain), slen;
+	struct sockaddr_in sa;
+
+	/*
+	 * save old value of curtain and enable it
+	 */
+	if (sysctlbyname(curtain_name, old_curtain, old_curtain_len,
+	new_curtain, sizeof(new_curtain)) != 0)
+		atf_tc_fail(failed to enable %s, curtain_name);
+
+	/*
+	 * create a socket and bind it to some arbitray free port
+	 */
+	s = socket(PF_INET, SOCK_STREAM|SOCK_NONBLOCK, 0);
+	ATF_REQUIRE(s != -1);
+	memset(sa, 0, sizeof(sa));
+	sa.sin_family = AF_INET;
+	sa.sin_len = sizeof(sa);
+	sa.sin_addr.s_addr = inet_addr(127.0.0.1);
+	ATF_REQUIRE(bind(s, (struct sockaddr *)sa, sizeof(sa))==0);
+	ATF_REQUIRE(listen(s, 16)==0);
+
+	/*
+	 * extract address and open a connection to the port
+	 */
+	slen = sizeof(sa);
+	ATF_REQUIRE(getsockname(s, (struct sockaddr *)sa, slen)==0);
+	s2 = socket(PF_INET, SOCK_STREAM|SOCK_NONBLOCK, 0);
+	ATF_REQUIRE(s2 != -1);
+	printf(port is %d\n, ntohs(sa.sin_port));
+	err = connect(s2, (struct sockaddr *)sa, sizeof(sa));
+	ATF_REQUIRE_MSG(err == -1  errno == EINPROGRESS,
+	conect returned %d with errno %d, err, errno);
+	fflush(stdout);
+	fflush(stderr);
+
+	/*
+	 * we now have a pending, not yet accepted connection - run 

CVS commit: src/distrib/sets/lists

2013-02-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 28 15:36:08 UTC 2013

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

Log Message:
Add new testprogram


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.525 -r1.526 src/distrib/sets/lists/tests/mi

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

Modified files:

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.10 src/distrib/sets/lists/debug/mi:1.11
--- src/distrib/sets/lists/debug/mi:1.10	Tue Feb 26 17:08:20 2013
+++ src/distrib/sets/lists/debug/mi	Thu Feb 28 15:36:06 2013
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.10 2013/02/26 17:08:20 christos Exp $
+# $NetBSD: mi,v 1.11 2013/02/28 15:36:06 martin Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/libdata/debug/bin/cat.debug		comp-util-debug		debug
 ./usr/libdata/debug/bin/chio.debug		comp-util-debug		debug
@@ -1327,6 +1327,7 @@
 ./usr/libdata/debug/usr/tests/kernel/t_extattrctl.debug			tests-kernel-tests	debug,atf,rump
 ./usr/libdata/debug/usr/tests/kernel/t_extent.debug			tests-kernel-tests	debug,atf
 ./usr/libdata/debug/usr/tests/kernel/t_filedesc.debug			tests-kernel-tests	debug,atf,rump
+./usr/libdata/debug/usr/tests/kernel/t_kauth_pr_47598.debug		tests-kernel-tests	debug,atf
 ./usr/libdata/debug/usr/tests/kernel/t_lock.debug			tests-kernel-tests	debug,atf
 ./usr/libdata/debug/usr/tests/kernel/t_lockf.debug			tests-kernel-tests	debug,atf
 ./usr/libdata/debug/usr/tests/kernel/t_lwpctl.debug			tests-obsolete		obsolete

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.525 src/distrib/sets/lists/tests/mi:1.526
--- src/distrib/sets/lists/tests/mi:1.525	Tue Feb 26 17:08:21 2013
+++ src/distrib/sets/lists/tests/mi	Thu Feb 28 15:36:07 2013
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.525 2013/02/26 17:08:21 christos Exp $
+# $NetBSD: mi,v 1.526 2013/02/28 15:36:07 martin Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -1581,6 +1581,7 @@
 ./usr/tests/kernel/t_extattrctl			tests-kernel-tests		atf,rump
 ./usr/tests/kernel/t_extent			tests-kernel-tests		atf
 ./usr/tests/kernel/t_filedesc			tests-kernel-tests		atf,rump
+./usr/tests/kernel/t_kauth_pr_47598		tests-kernel-tests		atf
 ./usr/tests/kernel/t_lock			tests-kernel-tests		atf
 ./usr/tests/kernel/t_lockf			tests-kernel-tests		atf
 ./usr/tests/kernel/t_lwpctl			tests-obsolete			obsolete



CVS commit: src/tests/kernel

2013-02-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 28 20:41:22 UTC 2013

Modified Files:
src/tests/kernel: t_kauth_pr_47598.c

Log Message:
getsockname() needs a socklen_t, not a size_t


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/kernel/t_kauth_pr_47598.c

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

Modified files:

Index: src/tests/kernel/t_kauth_pr_47598.c
diff -u src/tests/kernel/t_kauth_pr_47598.c:1.1 src/tests/kernel/t_kauth_pr_47598.c:1.2
--- src/tests/kernel/t_kauth_pr_47598.c:1.1	Thu Feb 28 15:31:22 2013
+++ src/tests/kernel/t_kauth_pr_47598.c	Thu Feb 28 20:41:21 2013
@@ -27,7 +27,7 @@
 #include sys/cdefs.h
 __COPYRIGHT(@(#) Copyright (c) 2013\
  The NetBSD Foundation, inc. All rights reserved.);
-__RCSID($NetBSD: t_kauth_pr_47598.c,v 1.1 2013/02/28 15:31:22 martin Exp $);
+__RCSID($NetBSD: t_kauth_pr_47598.c,v 1.2 2013/02/28 20:41:21 martin Exp $);
 
 #include errno.h
 #include unistd.h
@@ -62,7 +62,8 @@ ATF_TC_BODY(kauth_curtain, tc)
 	static const char curtain_name[] = security.models.bsd44.curtain;
 
 	int old_curtain, new_curtain = 1, s, s2, err;
-	size_t old_curtain_len = sizeof(old_curtain), slen;
+	size_t old_curtain_len = sizeof(old_curtain);
+	socklen_t slen;
 	struct sockaddr_in sa;
 
 	/*



CVS commit: src/usr.sbin/zic

2013-03-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar  5 10:19:58 UTC 2013

Modified Files:
src/usr.sbin/zic: Makefile

Log Message:
Add back NOGCCERROR for older gcc versions to fix the vax build


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/zic/Makefile

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

Modified files:

Index: src/usr.sbin/zic/Makefile
diff -u src/usr.sbin/zic/Makefile:1.11 src/usr.sbin/zic/Makefile:1.12
--- src/usr.sbin/zic/Makefile:1.11	Sat Mar  2 21:38:19 2013
+++ src/usr.sbin/zic/Makefile	Tue Mar  5 10:19:58 2013
@@ -1,9 +1,17 @@
-#	$NetBSD: Makefile,v 1.11 2013/03/02 21:38:19 christos Exp $
+#	$NetBSD: Makefile,v 1.12 2013/03/05 10:19:58 martin Exp $
 
 .include Makefile.inc
 
+.if defined(HAVE_GCC)  ${HAVE_GCC} = 45
 COPTS.zic.c	+= -Wno-format-nonliteral
 COPTS.scheck.c	+= -Wno-format-nonliteral
+.else
+# warning with older gcc:
+# comparison is always false due to limited range of data type
+# and no way to make it shut up?
+WARNS= 0
+NOGCCERROR=1
+.endif
 
 .include bsd.own.mk
 



<    3   4   5   6   7   8   9   10   11   12   >