CVS commit: src/sys/arch

2013-06-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 26 06:31:53 UTC 2013

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

Log Message:
Use sy_invoke


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/arm/arm/syscall.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/powerpc/powerpc/syscall.c
cvs rdiff -u -r1.22 -r1.23 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/arm/arm/syscall.c
diff -u src/sys/arch/arm/arm/syscall.c:1.56 src/sys/arch/arm/arm/syscall.c:1.57
--- src/sys/arch/arm/arm/syscall.c:1.56	Thu Aug 16 17:35:01 2012
+++ src/sys/arch/arm/arm/syscall.c	Wed Jun 26 06:31:53 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.56 2012/08/16 17:35:01 matt Exp $	*/
+/*	$NetBSD: syscall.c,v 1.57 2013/06/26 06:31:53 matt Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
 
 #include sys/param.h
 
-__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.56 2012/08/16 17:35:01 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.57 2013/06/26 06:31:53 matt Exp $);
 
 #include sys/device.h
 #include sys/errno.h
@@ -254,17 +254,7 @@ syscall(struct trapframe *tf, lwp_t *l, 
 		args = tf-tf_r0;
 	}
 
-	if (!__predict_false(p-p_trace_enabled)
-	|| __predict_false(callp-sy_flags  SYCALL_INDIRECT)
-	|| (error = trace_enter(code, args, nargs)) == 0) {
-		rval[0] = 0;
-		rval[1] = 0;
-		error = (*callp-sy_call)(l, args, rval);
-	}
-
-	if (__predict_false(p-p_trace_enabled)
-	|| !__predict_false(callp-sy_flags  SYCALL_INDIRECT))
-		trace_exit(code, rval, error);
+	error = sy_invoke(callp, l, args, rval, code);
 
 	switch (error) {
 	case 0:

Index: src/sys/arch/powerpc/powerpc/syscall.c
diff -u src/sys/arch/powerpc/powerpc/syscall.c:1.51 src/sys/arch/powerpc/powerpc/syscall.c:1.52
--- src/sys/arch/powerpc/powerpc/syscall.c:1.51	Fri Jul 20 14:21:20 2012
+++ src/sys/arch/powerpc/powerpc/syscall.c	Wed Jun 26 06:31:53 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.51 2012/07/20 14:21:20 matt Exp $	*/
+/*	$NetBSD: syscall.c,v 1.52 2013/06/26 06:31:53 matt Exp $	*/
 
 /*
  * Copyright (C) 2002 Matt Thomas
@@ -61,7 +61,7 @@
 #define EMULNAME(x)	(x)
 #define EMULNAMEU(x)	(x)
 
-__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.51 2012/07/20 14:21:20 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.52 2013/06/26 06:31:53 matt Exp $);
 
 void
 child_return(void *arg)
@@ -144,18 +144,7 @@ EMULNAME(syscall)(struct trapframe *tf)
 		params = args;
 	}
 
-	if (!__predict_false(p-p_trace_enabled)
-	|| __predict_false(callp-sy_flags  SYCALL_INDIRECT)
-	|| (error = trace_enter(realcode, params, callp-sy_narg)) == 0) {
-		rval[0] = 0;
-		rval[1] = 0;
-		error = sy_call(callp, l, params, rval);
-	}
-
-	if (__predict_false(p-p_trace_enabled)
-	 !__predict_false(callp-sy_flags  SYCALL_INDIRECT)) {
-		trace_exit(code, rval, error);
-	}
+	error = sy_invoke(callp, l, params, rval, code);
 
 	if (__predict_true(error == 0)) {
 		tf-tf_fixreg[FIRSTARG] = rval[0];

Index: src/sys/arch/vax/vax/syscall.c
diff -u src/sys/arch/vax/vax/syscall.c:1.22 src/sys/arch/vax/vax/syscall.c:1.23
--- src/sys/arch/vax/vax/syscall.c:1.22	Tue Jan 15 10:18:38 2013
+++ src/sys/arch/vax/vax/syscall.c	Wed Jun 26 06:31:53 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.22 2013/01/15 10:18:38 martin Exp $ */
+/*	$NetBSD: syscall.c,v 1.23 2013/06/26 06:31:53 matt 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.22 2013/01/15 10:18:38 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.23 2013/06/26 06:31:53 matt Exp $);
 
 #include opt_multiprocessor.h
 
@@ -103,11 +103,7 @@ syscall(struct trapframe *tf)
 	 * Only trace if tracing is enabled and the syscall isn't indirect
 	 * (SYS_syscall or SYS___syscall)
 	 */
-	if (__predict_true(!p-p_trace_enabled)
-	|| __predict_false(callp-sy_flags  SYCALL_INDIRECT)
-	|| (error = trace_enter(tf-tf_code, args, callp-sy_narg)) == 0) {
-		error = sy_call(callp, curlwp, args, rval);
-	}
+	error = sy_invoke(callp, curlwp, args, rval, tf-tf_code);
 
 	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,
@@ -134,10 +130,6 @@ bad:
 		break;
 	}
 
-	if (__predict_false(p-p_trace_enabled)
-	 __predict_true(!(callp-sy_flags  SYCALL_INDIRECT)))
-		trace_exit(tf-tf_code, rval, error);
-
 	userret(l, tf, oticks);
 }
 



CVS commit: src/sys/sys

2013-06-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 26 08:30:40 UTC 2013

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

Log Message:
Add a comment for a kludge keeping sbrk working on mips.


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

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

Modified files:

Index: src/sys/sys/syscallvar.h
diff -u src/sys/sys/syscallvar.h:1.6 src/sys/sys/syscallvar.h:1.7
--- src/sys/sys/syscallvar.h:1.6	Tue Jun 25 17:38:06 2013
+++ src/sys/sys/syscallvar.h	Wed Jun 26 08:30:40 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscallvar.h,v 1.6 2013/06/25 17:38:06 matt Exp $	*/
+/*	$NetBSD: syscallvar.h,v 1.7 2013/06/26 08:30:40 matt Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -74,7 +74,13 @@ sy_invoke(const struct sysent *sy, struc
 || __predict_false(sy-sy_flags  SYCALL_INDIRECT)
 || (error = trace_enter(code, uap, sy-sy_narg)) == 0) {
 rval[0] = 0;
+#if !defined(__mips__)
+		/*
+		 * Due to the mips userland code for SYS_break needing v1 to be
+		 * preserved, we can't clear this on mips. 
+		 */
 rval[1] = 0;
+#endif
 error = sy_call(sy, l, uap, rval);
 }   
 



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

2013-06-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 26 08:38:03 UTC 2013

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

Log Message:
Use sy_invoke


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/mips/mips/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/mips/mips/syscall.c
diff -u src/sys/arch/mips/mips/syscall.c:1.47 src/sys/arch/mips/mips/syscall.c:1.48
--- src/sys/arch/mips/mips/syscall.c:1.47	Sun Feb 19 21:06:19 2012
+++ src/sys/arch/mips/mips/syscall.c	Wed Jun 26 08:38:03 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.47 2012/02/19 21:06:19 rmind Exp $	*/
+/*	$NetBSD: syscall.c,v 1.48 2013/06/26 08:38:03 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.47 2012/02/19 21:06:19 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.48 2013/06/26 08:38:03 matt Exp $);
 
 #include sys/param.h
 #include sys/cpu.h
@@ -122,7 +122,6 @@ EMULNAME(syscall)(struct lwp *l, u_int s
 	mips_reg_t *fargs = reg-r_regs[_R_A0];
 	register_t *args = NULL;
 	register_t copyargs[2+SYS_MAXSYSARGS];
-	mips_reg_t saved_v0;
 	vaddr_t usp;
 	size_t nargs;
 	const struct sysent *callp;
@@ -149,9 +148,8 @@ EMULNAME(syscall)(struct lwp *l, u_int s
 		reg-r_regs[_R_PC] = pc + sizeof(uint32_t);
 
 	callp = p-p_emul-e_sysent;
-	saved_v0 = code = reg-r_regs[_R_V0];
-
-	code -= SYSCALL_SHIFT;
+	const mips_reg_t saved_v0 = reg-r_regs[_R_V0];
+	code = saved_v0 - SYSCALL_SHIFT;
 
 	if (code == SYS_syscall
 	|| (code == SYS___syscall  abi != _MIPS_BSD_API_O32)) {
@@ -176,7 +174,6 @@ EMULNAME(syscall)(struct lwp *l, u_int s
 		callp += code;
 
 	nargs = callp-sy_narg;
-	reg-r_regs[_R_V0] = 0;
 #if !defined(__mips_o32)
 	if (abi != _MIPS_BSD_API_O32) {
 #endif
@@ -316,13 +313,8 @@ EMULNAME(syscall)(struct lwp *l, u_int s
 	printf(\n);
 #endif
 
-	if (__predict_false(p-p_trace_enabled)
-	 (error = trace_enter(code, args, nargs)) != 0)
-		goto out;
-
-	error = (*callp-sy_call)(l, args, reg-r_regs[_R_V0]);
+	error = sy_invoke(callp, l, args, reg-r_regs[_R_V0], code);
 
-out:
 	switch (error) {
 	case 0:
 #if !defined(__mips_o32)
@@ -368,9 +360,6 @@ EMULNAME(syscall)(struct lwp *l, u_int s
 		break;
 	}
 
-	if (__predict_false(p-p_trace_enabled))
-		trace_exit(code, reg-r_regs[_R_V0], error);
-
 	KASSERT(l-l_blcnt == 0);
 	KASSERT(curcpu()-ci_biglock_count == 0);
 



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

2013-06-26 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Wed Jun 26 12:07:22 UTC 2013

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

Log Message:
Fix catpage (consttime_memcmp.0 - consttime_memequal.0)


To generate a diff of this commit:
cvs rdiff -u -r1.1827 -r1.1828 src/distrib/sets/lists/comp/mi

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1827 src/distrib/sets/lists/comp/mi:1.1828
--- src/distrib/sets/lists/comp/mi:1.1827	Mon Jun 24 04:21:19 2013
+++ src/distrib/sets/lists/comp/mi	Wed Jun 26 12:07:21 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1827 2013/06/24 04:21:19 riastradh Exp $
+#	$NetBSD: mi,v 1.1828 2013/06/26 12:07:21 njoly Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -5160,7 +5160,7 @@
 ./usr/share/man/cat3/conjf.0			comp-c-catman		complex,.cat
 ./usr/share/man/cat3/conjl.0			comp-c-catman		complex,.cat
 ./usr/share/man/cat3/consttime_bcmp.0		comp-obsolete		obsolete
-./usr/share/man/cat3/consttime_memcmp.0		comp-c-catman		.cat
+./usr/share/man/cat3/consttime_memequal.0	comp-c-catman		.cat
 ./usr/share/man/cat3/copysign.0			comp-c-catman		.cat
 ./usr/share/man/cat3/copysignf.0		comp-c-catman		.cat
 ./usr/share/man/cat3/copysignl.0		comp-c-catman		.cat



CVS commit: xsrc/external/mit/libXt/dist/src

2013-06-26 Thread Thomas Klausner
Module Name:xsrc
Committed By:   wiz
Date:   Wed Jun 26 13:54:36 UTC 2013

Modified Files:
xsrc/external/mit/libXt/dist/src: ResConfig.c

Log Message:
Fix unsigned vs. signed char warnings (needed for clang).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/libXt/dist/src/ResConfig.c

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

Modified files:

Index: xsrc/external/mit/libXt/dist/src/ResConfig.c
diff -u xsrc/external/mit/libXt/dist/src/ResConfig.c:1.2 xsrc/external/mit/libXt/dist/src/ResConfig.c:1.3
--- xsrc/external/mit/libXt/dist/src/ResConfig.c:1.2	Sun Jun  2 03:07:08 2013
+++ xsrc/external/mit/libXt/dist/src/ResConfig.c	Wed Jun 26 13:54:36 2013
@@ -892,7 +892,7 @@ _XtResourceConfigurationEH (
 	int		actual_format;
 	unsigned long	nitems;
 	unsigned long	leftover;
-	unsigned char	*data = NULL;
+	char		*data = NULL;
 	unsigned long	resource_len;
 	char		*data_ptr;
 	char		*resource;
@@ -952,7 +952,7 @@ _XtResourceConfigurationEH (
 		pd-rcm_data, 0L, 8192L,
 		TRUE, XA_STRING,
 		actual_type, actual_format, nitems, leftover,
-		data ) == Success  actual_type == XA_STRING
+		(unsigned char **)data ) == Success  actual_type == XA_STRING
 			actual_format == 8) {
 	/*
 	 *  data format is:



CVS commit: src/sys/arch/alpha/alpha

2013-06-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 26 15:09:59 UTC 2013

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

Log Message:
Use sy_invoke


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/alpha/alpha/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/alpha/alpha/syscall.c
diff -u src/sys/arch/alpha/alpha/syscall.c:1.41 src/sys/arch/alpha/alpha/syscall.c:1.42
--- src/sys/arch/alpha/alpha/syscall.c:1.41	Sun Jul 22 14:02:11 2012
+++ src/sys/arch/alpha/alpha/syscall.c	Wed Jun 26 15:09:59 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: syscall.c,v 1.41 2012/07/22 14:02:11 matt Exp $ */
+/* $NetBSD: syscall.c,v 1.42 2013/06/26 15:09:59 matt Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -89,7 +89,7 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.41 2012/07/22 14:02:11 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.42 2013/06/26 15:09:59 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -190,19 +190,7 @@ syscall(struct lwp *l, uint64_t code, st
 	}
 	args += hidden;
 
-	if (!__predict_false(p-p_trace_enabled)
-	|| __predict_false(callp-sy_flags  SYCALL_INDIRECT)
-	|| (error = trace_enter(code, args, callp-sy_narg)) == 0) {
-		rval[0] = 0;
-		rval[1] = 0;
-		error = sy_call(callp, l, args, rval);
-	}
-
-	if (__predict_false(p-p_trace_enabled)
-	 !__predict_false(callp-sy_flags  SYCALL_INDIRECT)) {
-		trace_exit(code, rval, error);
-	}
-
+	error = sy_invoke(callp, l, args, rval, code);
 
 	if (__predict_true(error == 0)) {
 		tf-tf_regs[FRAME_V0] = rval[0];



CVS commit: src/sys/arch/usermode/usermode

2013-06-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 26 15:11:30 UTC 2013

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

Log Message:
Use sy_invoke


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/usermode/usermode/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/usermode/usermode/syscall.c
diff -u src/sys/arch/usermode/usermode/syscall.c:1.23 src/sys/arch/usermode/usermode/syscall.c:1.24
--- src/sys/arch/usermode/usermode/syscall.c:1.23	Mon Feb 13 19:15:59 2012
+++ src/sys/arch/usermode/usermode/syscall.c	Wed Jun 26 15:11:30 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: syscall.c,v 1.23 2012/02/13 19:15:59 reinoud Exp $ */
+/* $NetBSD: syscall.c,v 1.24 2013/06/26 15:11:30 matt Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.23 2012/02/13 19:15:59 reinoud Exp $);
+__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.24 2013/06/26 15:11:30 matt Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -131,16 +131,7 @@ syscall(void)
 	md_syscall_inc_pc(ucp, opcode);
 
 	if (!error) {
-		if (!__predict_false(p-p_trace_enabled)
-		|| __predict_false(callp-sy_flags  SYCALL_INDIRECT)
-		|| (error = trace_enter(code, args, callp-sy_narg)) == 0) {
-			error = (*callp-sy_call)(l, args, rval);
-		}
-
-		if (__predict_false(p-p_trace_enabled)
-		 !__predict_false(callp-sy_flags  SYCALL_INDIRECT)) {
-			trace_exit(code, rval, error);
-		}
+		error = sy_invoke(callp, l, args, rval, code);
 	}
 
 	syscall_retvals_print(l, curlwp, code, nargs, args, error, rval);



CVS commit: src/distrib/zaurus/ramdisk

2013-06-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jun 26 15:53:48 UTC 2013

Modified Files:
src/distrib/zaurus/ramdisk: list

Log Message:
comment out a few more to make things fit again


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/distrib/zaurus/ramdisk/list

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

Modified files:

Index: src/distrib/zaurus/ramdisk/list
diff -u src/distrib/zaurus/ramdisk/list:1.19 src/distrib/zaurus/ramdisk/list:1.20
--- src/distrib/zaurus/ramdisk/list:1.19	Sun Jul  3 19:11:34 2011
+++ src/distrib/zaurus/ramdisk/list	Wed Jun 26 11:53:48 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: list,v 1.19 2011/07/03 23:11:34 tron Exp $
+#	$NetBSD: list,v 1.20 2013/06/26 15:53:48 christos Exp $
 
 # external/bsd/less/bin has to be first, otherwise the ramdisk.mk generation fails
 SRCDIRS external/bsd/less/bin bin sbin usr.bin usr.sbin
@@ -16,7 +16,7 @@ PROG	bin/mkdir
 PROG	bin/mv
 PROG	bin/pax		usr/bin/tar
 PROG	bin/pwd
-PROG	bin/rcmd
+#PROG	bin/rcmd
 PROG	bin/rm
 PROG	bin/sh
 PROG	bin/stty
@@ -41,7 +41,7 @@ PROG	sbin/ping
 PROG	sbin/reboot	sbin/halt
 PROG	sbin/restore	sbin/rrestore
 PROG	sbin/route
-PROG	sbin/scsictl
+#PROG	sbin/scsictl
 PROG	sbin/shutdown
 #PROG	sbin/slattach
 PROG	sbin/swapctl



CVS commit: src/sys/arch/sh3/sh3

2013-06-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 26 16:28:51 UTC 2013

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

Log Message:
Collapse syscall_fancy/syscall_plain to syscall and p_trace_enabled.
Use sy_invoke


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/sh3/sh3/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/sh3/sh3/syscall.c
diff -u src/sys/arch/sh3/sh3/syscall.c:1.14 src/sys/arch/sh3/sh3/syscall.c:1.15
--- src/sys/arch/sh3/sh3/syscall.c:1.14	Sun Feb 19 21:06:27 2012
+++ src/sys/arch/sh3/sh3/syscall.c	Wed Jun 26 16:28:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.14 2012/02/19 21:06:27 rmind Exp $	*/
+/*	$NetBSD: syscall.c,v 1.15 2013/06/26 16:28:51 matt Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
@@ -88,17 +88,14 @@
 
 #include uvm/uvm_extern.h
 
-static void syscall_plain(struct lwp *, struct trapframe *);
-static void syscall_fancy(struct lwp *, struct trapframe *);
+static void syscall(struct lwp *, struct trapframe *);
 
 void
 syscall_intern(struct proc *p)
 {
 
-	if (trace_is_enabled(p))
-		p-p_md.md_syscall = syscall_fancy;
-	else
-		p-p_md.md_syscall = syscall_plain;
+	p-p_trace_enabled = trace_is_enabled(p);
+	p-p_md.md_syscall = syscall;
 }
 
 
@@ -108,7 +105,7 @@ syscall_intern(struct proc *p)
  *	tf ... full user context.
  */
 static void
-syscall_plain(struct lwp *l, struct trapframe *tf)
+syscall(struct lwp *l, struct trapframe *tf)
 {
 	struct proc *p = l-l_proc;
 	void *params;
@@ -205,7 +202,7 @@ syscall_plain(struct lwp *l, struct trap
 
 	rval[0] = 0;
 	rval[1] = tf-tf_r1;
-	error = sy_call(callp, l, args, rval);
+	error = sy_invoke(callp, l, args, rval, code);
 
 	switch (error) {
 	case 0:
@@ -235,140 +232,3 @@ syscall_plain(struct lwp *l, struct trap
 	userret(l);
 }
 
-
-/*
- * Like syscall_plain but with trace_enter/trace_exit.
- */
-static void
-syscall_fancy(struct lwp *l, struct trapframe *tf)
-{
-	struct proc *p = l-l_proc;
-	void *params;
-	const struct sysent *callp;
-	int error, opc, nsys;
-	size_t argsize;
-	register_t code, args[8], rval[2], ocode;
-
-	curcpu()-ci_data.cpu_nsyscall++;
-
-	opc = tf-tf_spc;
-	ocode = code = tf-tf_r0;
-
-	nsys = p-p_emul-e_nsysent;
-	callp = p-p_emul-e_sysent;
-	params = (void *)tf-tf_r15;
-
-	switch (code) {
-	case SYS_syscall:
-		/*
-		 * Code is first argument, followed by actual args.
-		 */
-	code = tf-tf_r4;  /* fuword(params); */
-		/* params += sizeof(int); */
-		break;
-	case SYS___syscall:
-		/*
-		 * Like syscall, but code is a quad, so as to maintain
-		 * quad alignment for the rest of the arguments.
-		 */
-		if (callp != sysent)
-			break;
-		/* fuword(params + _QUAD_LOWWORD * sizeof(int)); */
-#if _BYTE_ORDER == BIG_ENDIAN
-		code = tf-tf_r5;
-#else
-		code = tf-tf_r4;
-#endif
-		/* params += sizeof(quad_t); */
-		break;
-	default:
-		break;
-	}
-	if (code  0 || code = nsys)
-		callp += p-p_emul-e_nosys;		/* illegal */
-	else
-		callp += code;
-	argsize = callp-sy_argsize;
-
-	if (ocode == SYS_syscall) {
-		if (argsize) {
-			args[0] = tf-tf_r5;
-			args[1] = tf-tf_r6;
-			args[2] = tf-tf_r7;
-			if (argsize  3 * sizeof(int)) {
-argsize -= 3 * sizeof(int);
-error = copyin(params, (void *)args[3],
-	   argsize);
-			} else
-error = 0;
-		} else
-			error = 0;
-	}
-	else if (ocode == SYS___syscall) {
-		if (argsize) {
-			args[0] = tf-tf_r6;
-			args[1] = tf-tf_r7;
-			if (argsize  2 * sizeof(int)) {
-argsize -= 2 * sizeof(int);
-error = copyin(params, (void *)args[2],
-	   argsize);
-			} else
-error = 0;
-		} else
-			error = 0;
-	} else {
-		if (argsize) {
-			args[0] = tf-tf_r4;
-			args[1] = tf-tf_r5;
-			args[2] = tf-tf_r6;
-			args[3] = tf-tf_r7;
-			if (argsize  4 * sizeof(int)) {
-argsize -= 4 * sizeof(int);
-error = copyin(params, (void *)args[4],
-	   argsize);
-			} else
-error = 0;
-		} else
-			error = 0;
-	}
-
-	if (error)
-		goto bad;
-
-	if ((error = trace_enter(code, args, callp-sy_narg)) != 0)
-		goto out;
-
-	rval[0] = 0;
-	rval[1] = tf-tf_r1;
-	error = sy_call(callp, l, args, rval);
-out:
-	switch (error) {
-	case 0:
-		tf-tf_r0 = rval[0];
-		tf-tf_r1 = rval[1];
-		tf-tf_ssr |= PSL_TBIT;	/* T bit */
-
-		break;
-	case ERESTART:
-		/* 2 = TRAPA instruction size */
-		tf-tf_spc = opc - 2;
-
-		break;
-	case EJUSTRETURN:
-		/* nothing to do */
-		break;
-	default:
-	bad:
-		if (p-p_emul-e_errno)
-			error = p-p_emul-e_errno[error];
-		tf-tf_r0 = error;
-		tf-tf_ssr = ~PSL_TBIT;	/* T bit */
-
-		break;
-	}
-
-
-	trace_exit(code, rval, error);
-
-	userret(l);
-}



CVS commit: src/sys/compat/ibcs2

2013-06-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jun 26 16:29:50 UTC 2013

Modified Files:
src/sys/compat/ibcs2: ibcs2_syscall.h ibcs2_syscallargs.h
ibcs2_syscalls.c ibcs2_sysent.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/compat/ibcs2/ibcs2_syscall.h
cvs rdiff -u -r1.49 -r1.50 src/sys/compat/ibcs2/ibcs2_syscallargs.h \
src/sys/compat/ibcs2/ibcs2_syscalls.c
cvs rdiff -u -r1.50 -r1.51 src/sys/compat/ibcs2/ibcs2_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/ibcs2/ibcs2_syscall.h
diff -u src/sys/compat/ibcs2/ibcs2_syscall.h:1.48 src/sys/compat/ibcs2/ibcs2_syscall.h:1.49
--- src/sys/compat/ibcs2/ibcs2_syscall.h:1.48	Sun Dec 13 19:58:36 2009
+++ src/sys/compat/ibcs2/ibcs2_syscall.h	Wed Jun 26 12:29:50 2013
@@ -1,10 +1,10 @@
-/* $NetBSD: ibcs2_syscall.h,v 1.48 2009/12/14 00:58:36 matt Exp $ */
+/* $NetBSD: ibcs2_syscall.h,v 1.49 2013/06/26 16:29:50 christos Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.37 2009/01/13 22:27:43 pooka Exp
+ * created from	NetBSD: syscalls.master,v 1.40 2013/06/26 16:29:41 christos Exp
  */
 
 #ifndef _IBCS2_SYS_SYSCALL_H_

Index: src/sys/compat/ibcs2/ibcs2_syscallargs.h
diff -u src/sys/compat/ibcs2/ibcs2_syscallargs.h:1.49 src/sys/compat/ibcs2/ibcs2_syscallargs.h:1.50
--- src/sys/compat/ibcs2/ibcs2_syscallargs.h:1.49	Sun Dec 13 19:58:36 2009
+++ src/sys/compat/ibcs2/ibcs2_syscallargs.h	Wed Jun 26 12:29:50 2013
@@ -1,10 +1,10 @@
-/* $NetBSD: ibcs2_syscallargs.h,v 1.49 2009/12/14 00:58:36 matt Exp $ */
+/* $NetBSD: ibcs2_syscallargs.h,v 1.50 2013/06/26 16:29:50 christos Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.37 2009/01/13 22:27:43 pooka Exp
+ * created from	NetBSD: syscalls.master,v 1.40 2013/06/26 16:29:41 christos Exp
  */
 
 #ifndef _IBCS2_SYS_SYSCALLARGS_H_
@@ -27,7 +27,7 @@
 	}
 
 #undef check_syscall_args
-#define check_syscall_args(call) \
+#define check_syscall_args(call) /*LINTED*/ \
 	typedef char call##_check_args[sizeof (struct call##_args) \
 		= IBCS2_SYS_MAXSYSARGS * sizeof (register_t) ? 1 : -1];
 
Index: src/sys/compat/ibcs2/ibcs2_syscalls.c
diff -u src/sys/compat/ibcs2/ibcs2_syscalls.c:1.49 src/sys/compat/ibcs2/ibcs2_syscalls.c:1.50
--- src/sys/compat/ibcs2/ibcs2_syscalls.c:1.49	Sun Dec 13 19:58:36 2009
+++ src/sys/compat/ibcs2/ibcs2_syscalls.c	Wed Jun 26 12:29:50 2013
@@ -1,14 +1,14 @@
-/* $NetBSD: ibcs2_syscalls.c,v 1.49 2009/12/14 00:58:36 matt Exp $ */
+/* $NetBSD: ibcs2_syscalls.c,v 1.50 2013/06/26 16:29:50 christos Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.37 2009/01/13 22:27:43 pooka Exp
+ * created from	NetBSD: syscalls.master,v 1.40 2013/06/26 16:29:41 christos Exp
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ibcs2_syscalls.c,v 1.49 2009/12/14 00:58:36 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: ibcs2_syscalls.c,v 1.50 2013/06/26 16:29:50 christos Exp $);
 
 #if defined(_KERNEL_OPT)
 #if defined(_KERNEL_OPT)
@@ -122,43 +122,43 @@ const char *const ibcs2_syscallnames[] =
 	/*  79 */	rmdir,
 	/*  80 */	mkdir,
 	/*  81 */	getdents,
-	/*  82 */	#82 (unimplemented),
-	/*  83 */	#83 (unimplemented),
+	/*  82 */	#82 (unimplemented libattach),
+	/*  83 */	#83 (unimplemented libdetach),
 	/*  84 */	sysfs,
 	/*  85 */	getmsg,
 	/*  86 */	putmsg,
 	/*  87 */	poll,
-	/*  88 */	#88 (unimplemented),
-	/*  89 */	#89 (unimplemented),
+	/*  88 */	#88 (unimplemented unknown),
+	/*  89 */	#89 (unimplemented secure),
 	/*  90 */	symlink,
 	/*  91 */	lstat,
 	/*  92 */	readlink,
 	/*  93 */	fchmod,
 	/*  94 */	fchown,
-	/*  95 */	#95 (unimplemented),
+	/*  95 */	#95 (unimplemented sigprocmask),
 	/*  96 */	sigreturn,
 	/*  97 */	sigaltstack,
-	/*  98 */	#98 (unimplemented),
-	/*  99 */	#99 (unimplemented),
+	/*  98 */	#98 (unimplemented sigaction),
+	/*  99 */	#99 (unimplemented sigpending),
 	/* 100 */	#100 (unimplemented getcontext/setcontext/sigsetjmp),
-	/* 101 */	#101 (unimplemented),
-	/* 102 */	#102 (unimplemented),
+	/* 101 */	#101 (unimplemented envsys),
+	/* 102 */	#102 (unimplemented evtrapret),
 	/* 103 */	statvfs,
 	/* 104 */	fstatvfs,
-	/* 105 */	#105 (unimplemented),
-	/* 106 */	#106 (unimplemented),
-	/* 107 */	#107 (unimplemented waitid),
-	/* 108 */	#108 (unimplemented sigsendset),
-	/* 109 */	#109 (unimplemented),
-	/* 110 */	#110 (unimplemented),
-	/* 111 */	#111 (unimplemented),
-	/* 112 */	#112 (unimplemented priocntl),
-	/* 113 */	#113 (unimplemented),
-	/* 114 */	#114 (unimplemented),
+	/* 105 */	#105 (unimplemented isc),
+	/* 106 */	#106 (unimplemented nfssys),
+	/* 107 */	#107 (unimplemented waitsys),
+	/* 108 */	#108 (unimplemented 

CVS commit: src/sys/compat/ibcs2

2013-06-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jun 26 16:29:41 UTC 2013

Modified Files:
src/sys/compat/ibcs2: syscalls.master

Log Message:
remove dups document more. From FreeBSD. Still there is disagreement as
to where sigreturn is.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/compat/ibcs2/syscalls.master

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/ibcs2/syscalls.master
diff -u src/sys/compat/ibcs2/syscalls.master:1.39 src/sys/compat/ibcs2/syscalls.master:1.40
--- src/sys/compat/ibcs2/syscalls.master:1.39	Tue Jun 25 00:10:17 2013
+++ src/sys/compat/ibcs2/syscalls.master	Wed Jun 26 12:29:41 2013
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.39 2013/06/25 04:10:17 riz Exp $
+	$NetBSD: syscalls.master,v 1.40 2013/06/26 16:29:41 christos Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -172,10 +172,8 @@
 			struct ibcs2_stropts *dat, int flags); }
 87	NOARGS		{ int|sys||poll(struct pollfd *fds, u_int nfds, \
 			int timeout); }
-88	STD		{ int|ibcs2_sys||lstat(const char *path, \
-			struct ibcs2_stat *st); }
-89	NOARGS		{ int|sys||symlink(const char *path, \
-			const char *link); }
+88	UNIMPL		unknown
+89	UNIMPL		secure
 90	NOARGS		{ int|sys||symlink(const char *path, \
 			const char *link); }
 91	STD		{ int|ibcs2_sys||lstat(const char *path, \
@@ -200,7 +198,7 @@
 			struct ibcs2_statvfs *buf); }
 104	STD		{ int|ibcs2_sys||fstatvfs(int fd, \
 			struct ibcs2_statvfs *buf); }
-105	UNIMPL
+105	UNIMPL		isc
 106	UNIMPL		nfssys
 107	UNIMPL		waitsys
 108	UNIMPL		sigsendsys



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

2013-06-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 26 16:53:34 UTC 2013

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

Log Message:
Use sy_invoke.
Collapse syscall_fancy and syscall_plain into syscall.
Use p_trace_enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/sparc/sparc/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/sparc/sparc/syscall.c
diff -u src/sys/arch/sparc/sparc/syscall.c:1.27 src/sys/arch/sparc/sparc/syscall.c:1.28
--- src/sys/arch/sparc/sparc/syscall.c:1.27	Sun Feb 19 21:06:29 2012
+++ src/sys/arch/sparc/sparc/syscall.c	Wed Jun 26 16:53:34 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.27 2012/02/19 21:06:29 rmind Exp $ */
+/*	$NetBSD: syscall.c,v 1.28 2013/06/26 16:53:34 matt Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -49,7 +49,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.27 2012/02/19 21:06:29 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.28 2013/06/26 16:53:34 matt Exp $);
 
 #include opt_sparc_arch.h
 #include opt_multiprocessor.h
@@ -99,8 +99,7 @@ static inline int getargs(struct proc *p
 #ifdef FPU_DEBUG
 static inline void save_fpu(struct trapframe *);
 #endif
-void syscall_plain(register_t, struct trapframe *, register_t);
-void syscall_fancy(register_t, struct trapframe *, register_t);
+void syscall(register_t, struct trapframe *, register_t);
 
 static inline int
 handle_new(struct trapframe *tf, register_t *code)
@@ -187,10 +186,8 @@ void
 syscall_intern(struct proc *p)
 {
 
-	if (trace_is_enabled(p))
-		p-p_md.md_syscall = syscall_fancy;
-	else
-		p-p_md.md_syscall = syscall_plain;
+	p-p_trace_enabled = trace_is_enabled(p);
+	p-p_md.md_syscall = syscall;
 }
 
 /*
@@ -202,7 +199,7 @@ syscall_intern(struct proc *p)
  * thing that made the system call, and are named that way here.
  */
 void
-syscall_plain(register_t code, struct trapframe *tf, register_t pc)
+syscall(register_t code, struct trapframe *tf, register_t pc)
 {
 	const struct sysent *callp;
 	struct proc *p;
@@ -232,7 +229,7 @@ syscall_plain(register_t code, struct tr
 	rval.o[0] = 0;
 	rval.o[1] = tf-tf_out[1];
 
-	error = sy_call(callp, l, args, rval.o);
+	error = sy_invoke(callp, l, args.i, rval.o, code);
 
 	switch (error) {
 	case 0:
@@ -241,91 +238,6 @@ syscall_plain(register_t code, struct tr
 		tf-tf_out[1] = rval.o[1];
 		if (new) {
 			/* jmp %g5, (or %g2 or %g7, deprecated) on success */
-			if (__predict_true((new  SYSCALL_G5RFLAG)
-		== SYSCALL_G5RFLAG))
-i = tf-tf_global[5];
-			else if (new  SYSCALL_G2RFLAG)
-i = tf-tf_global[2];
-			else
-i = tf-tf_global[7];
-			if (i  3) {
-error = EINVAL;
-goto bad;
-			}
-		} else {
-			/* old system call convention: clear C on success */
-			tf-tf_psr = ~PSR_C;	/* success */
-			i = tf-tf_npc;
-		}
-		tf-tf_pc = i;
-		tf-tf_npc = i + 4;
-		break;
-
-	case ERESTART:
-	case EJUSTRETURN:
-		/* nothing to do */
-		break;
-
-	default:
-	bad:
-		if (p-p_emul-e_errno)
-			error = p-p_emul-e_errno[error];
-		tf-tf_out[0] = error;
-		tf-tf_psr |= PSR_C;	/* fail */
-		i = tf-tf_npc;
-		tf-tf_pc = i;
-		tf-tf_npc = i + 4;
-		break;
-	}
-
-	userret(l, pc, sticks);
-	share_fpu(l, tf);
-}
-
-void
-syscall_fancy(register_t code, struct trapframe *tf, register_t pc)
-{
-	const struct sysent *callp;
-	struct proc *p;
-	struct lwp *l;
-	int error, new;
-	union args args;
-	union rval rval;
-	register_t i;
-	u_quad_t sticks;
-
-	curcpu()-ci_data.cpu_nsyscall++;	/* XXXSMP */
-	l = curlwp;
-	p = l-l_proc;
-	LWP_CACHE_CREDS(l, p);
-
-	sticks = p-p_sticks;
-	l-l_md.md_tf = tf;
-
-#ifdef FPU_DEBUG
-	save_fpu(tf);
-#endif
-	new = handle_new(tf, code);
-
-	if ((error = getargs(p, tf, code, callp, args)) != 0)
-		goto bad;
-
-	if ((error = trace_enter(code, args.i, callp-sy_narg)) != 0)
-		goto out;
-
-	rval.o[0] = 0;
-	rval.o[1] = tf-tf_out[1];
-
-	error = sy_call(callp, l, args, rval.o);
-
-out:
-	switch (error) {
-	case 0:
-		/* Note: fork() does not return here in the child */
-		tf-tf_out[0] = rval.o[0];
-		tf-tf_out[1] = rval.o[1];
-		if (new) {
-			/* jmp %g5, (or %g2 or %g7, deprecated) on success */
 			if (__predict_true((new  SYSCALL_G5RFLAG) ==
 	SYSCALL_G5RFLAG))
 i = tf-tf_global[5];
@@ -363,8 +275,6 @@ out:
 		break;
 	}
 
-	trace_exit(code, rval.o, error);
-
 	userret(l, pc, sticks);
 	share_fpu(l, tf);
 }



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

2013-06-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jun 26 17:10:23 UTC 2013

Modified Files:
src/sys/rump/librump/rumpnet: net_stub.c

Log Message:
Remove the route_info weak alias.  It's unnecessary since 2011
and confused Linux ld.so, thus preventing dlopen() of librumpnet.
Reported in private email by Justin Cormack.

Also, g/c a few other stubs which are no longer necessary.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/rump/librump/rumpnet/net_stub.c

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

Modified files:

Index: src/sys/rump/librump/rumpnet/net_stub.c
diff -u src/sys/rump/librump/rumpnet/net_stub.c:1.13 src/sys/rump/librump/rumpnet/net_stub.c:1.14
--- src/sys/rump/librump/rumpnet/net_stub.c:1.13	Sun Aug  5 15:36:19 2012
+++ src/sys/rump/librump/rumpnet/net_stub.c	Wed Jun 26 17:10:23 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: net_stub.c,v 1.13 2012/08/05 15:36:19 pooka Exp $	*/
+/*	$NetBSD: net_stub.c,v 1.14 2013/06/26 17:10:23 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: net_stub.c,v 1.13 2012/08/05 15:36:19 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: net_stub.c,v 1.14 2013/06/26 17:10:23 pooka Exp $);
 
 #include sys/param.h
 #include sys/protosw.h
@@ -46,14 +46,10 @@ __rumpnet_stub(void)
 	panic(component not available);
 }
 __weak_alias(rtioctl,__rumpnet_stub);
-__weak_alias(rt_walktree,__rumpnet_stub);
 __weak_alias(rtrequest,__rumpnet_stub);
 __weak_alias(ifioctl,__rumpnet_stub);
 __weak_alias(ifunit,__rumpnet_stub);
 __weak_alias(ifreq_setaddr,__rumpnet_stub);
-__weak_alias(rt_msg1,__rumpnet_stub);
-__weak_alias(route_enqueue,__rumpnet_stub);
-__weak_alias(route_info,__rumpnet_stub);
 
 /*
  * Weak symbols so that we can optionally leave components out.



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

2013-06-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 26 17:18:52 UTC 2013

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

Log Message:
Use sy_invoke


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x86/x86/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/x86/x86/syscall.c
diff -u src/sys/arch/x86/x86/syscall.c:1.11 src/sys/arch/x86/x86/syscall.c:1.12
--- src/sys/arch/x86/x86/syscall.c:1.11	Tue Jul 10 21:18:07 2012
+++ src/sys/arch/x86/x86/syscall.c	Wed Jun 26 17:18:52 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.11 2012/07/10 21:18:07 dsl Exp $	*/
+/*	$NetBSD: syscall.c,v 1.12 2013/06/26 17:18:52 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.11 2012/07/10 21:18:07 dsl Exp $);
+__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.12 2013/06/26 17:18:52 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -153,18 +153,7 @@ syscall(struct trapframe *frame)
 			goto bad;
 	}
 #endif
-	if (!__predict_false(p-p_trace_enabled)
-	|| __predict_false(callp-sy_flags  SYCALL_INDIRECT)
-	|| (error = trace_enter(code, args, callp-sy_narg)) == 0) {
-		rval[0] = 0;
-		rval[1] = 0;
-		error = sy_call(callp, l, args, rval);
-	}
-
-	if (__predict_false(p-p_trace_enabled)
-	 !__predict_false(callp-sy_flags  SYCALL_INDIRECT)) {
-		trace_exit(code, rval, error);
-	}
+	error = sy_invoke(callp, l, args, rval, code);
 
 	if (__predict_true(error == 0)) {
 		X86_TF_RAX(frame) = rval[0];



CVS commit: src/sbin/modstat

2013-06-26 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Jun 26 17:55:38 UTC 2013

Modified Files:
src/sbin/modstat: main.c modstat.8

Log Message:
Display the load address of modules. PR bin/47951.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sbin/modstat/main.c
cvs rdiff -u -r1.11 -r1.12 src/sbin/modstat/modstat.8

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

Modified files:

Index: src/sbin/modstat/main.c
diff -u src/sbin/modstat/main.c:1.15 src/sbin/modstat/main.c:1.16
--- src/sbin/modstat/main.c:1.15	Tue Aug  7 01:19:05 2012
+++ src/sbin/modstat/main.c	Wed Jun 26 17:55:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.15 2012/08/07 01:19:05 jnemeth Exp $	*/
+/*	$NetBSD: main.c,v 1.16 2013/06/26 17:55:38 riz Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: main.c,v 1.15 2012/08/07 01:19:05 jnemeth Exp $);
+__RCSID($NetBSD: main.c,v 1.16 2013/06/26 17:55:38 riz Exp $);
 #endif /* !lint */
 
 #include sys/module.h
@@ -175,9 +175,9 @@ main(int argc, char **argv)
 		if (maxnamelen  namelen)
 			maxnamelen = namelen;
 	}
-	printf(%-*s %-10s %-10s %-5s %-8s %s\n,
-	(int)maxnamelen, NAME, CLASS, SOURCE, REFS, SIZE,
-	REQUIRES);
+	printf(%-*s %-10s %-10s %-5s %-16s %-8s %s \n,
+	(int)maxnamelen, NAME, CLASS, SOURCE, REFS, ADDRESS,
+	SIZE, REQUIRES);
 	for (ms = iov.iov_base; len != 0; ms++, len--) {
 		const char *class;
 		const char *source;
@@ -204,9 +204,9 @@ main(int argc, char **argv)
 		else
 			source = UNKNOWN;
 
-		printf(%-*s %-10s %-10s %-5d %-8s %s\n,
+		printf(%-*s %-10s %-10s %-5d %-16 PRIx64  %-8s %s\n,
 		(int)maxnamelen, ms-ms_name, class, source, ms-ms_refcnt,
-		sbuf, ms-ms_required);
+		ms-ms_addr, sbuf, ms-ms_required);
 	}
 
 	exit(EXIT_SUCCESS);

Index: src/sbin/modstat/modstat.8
diff -u src/sbin/modstat/modstat.8:1.11 src/sbin/modstat/modstat.8:1.12
--- src/sbin/modstat/modstat.8:1.11	Sun Aug 12 17:20:19 2012
+++ src/sbin/modstat/modstat.8	Wed Jun 26 17:55:38 2013
@@ -1,4 +1,4 @@
-.\ $NetBSD: modstat.8,v 1.11 2012/08/12 17:20:19 wiz Exp $
+.\ $NetBSD: modstat.8,v 1.12 2013/06/26 17:55:38 riz Exp $
 .\
 .\ Copyright (c) 1993 Christopher G. Demetriou
 .\ All rights reserved.
@@ -32,7 +32,7 @@
 .\
 .\ Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp
 .\
-.Dd August 6, 2012
+.Dd June 26, 2013
 .Dt MODSTAT 8
 .Os
 .Sh NAME
@@ -92,6 +92,9 @@ Size of the module in bytes.
 .It Li REFS
 Number of references held on the module.
 Disabled builtin modules will show a count of \-1 here.
+.It Li ADDRESS
+The kernel address at which the module is loaded.
+Builtin modules will show 0 here.
 .It Li REQUIRES
 Additional modules that must be present.
 .El



CVS commit: src/sys/kern

2013-06-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jun 26 18:47:26 UTC 2013

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

Log Message:
If the MBR is a protective MBR, don't bother looking at it.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/kern/subr_disk_mbr.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_disk_mbr.c
diff -u src/sys/kern/subr_disk_mbr.c:1.45 src/sys/kern/subr_disk_mbr.c:1.46
--- src/sys/kern/subr_disk_mbr.c:1.45	Wed Oct  3 07:05:51 2012
+++ src/sys/kern/subr_disk_mbr.c	Wed Jun 26 18:47:26 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_disk_mbr.c,v 1.45 2012/10/03 07:05:51 mlelstv Exp $	*/
+/*	$NetBSD: subr_disk_mbr.c,v 1.46 2013/06/26 18:47:26 matt Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -54,7 +54,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_disk_mbr.c,v 1.45 2012/10/03 07:05:51 mlelstv Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_disk_mbr.c,v 1.46 2013/06/26 18:47:26 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -160,6 +160,15 @@ scan_mbr(mbr_args_t *a, int (*actn)(mbr_
 		if (mbr-mbr_magic != htole16(MBR_MAGIC))
 			return SCAN_CONTINUE;
 
+		/*
+		 * If this is a protective MBR, bail now.
+		 */
+		if (mbr-mbr_parts[0].mbrp_type == MBR_PTYPE_PMBR
+		 mbr-mbr_parts[1].mbrp_type == MBR_PTYPE_UNUSED
+		 mbr-mbr_parts[2].mbrp_type == MBR_PTYPE_UNUSED
+		 mbr-mbr_parts[3].mbrp_type == MBR_PTYPE_UNUSED)
+			return SCAN_CONTINUE;
+
 		/* Copy data out of buffer so action can use bp */
 		memcpy(ptns, mbr-mbr_parts, sizeof ptns);
 



CVS commit: src/tests/fs/common

2013-06-26 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Jun 26 19:29:24 UTC 2013

Modified Files:
src/tests/fs/common: Makefile h_fsmacros.h
Added Files:
src/tests/fs/common: fstest_udf.c

Log Message:
Add UDF as one of the filesytems to test. Might help understand why rump is
misbehaving on it.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/fs/common/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/fs/common/fstest_udf.c
cvs rdiff -u -r1.37 -r1.38 src/tests/fs/common/h_fsmacros.h

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

Modified files:

Index: src/tests/fs/common/Makefile
diff -u src/tests/fs/common/Makefile:1.10 src/tests/fs/common/Makefile:1.11
--- src/tests/fs/common/Makefile:1.10	Tue Mar  5 19:58:33 2013
+++ src/tests/fs/common/Makefile	Wed Jun 26 19:29:24 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.10 2013/03/05 19:58:33 christos Exp $
+#	$NetBSD: Makefile,v 1.11 2013/06/26 19:29:24 reinoud Exp $
 #
 
 .include bsd.own.mk
@@ -6,7 +6,7 @@
 LIB=	vfstest
 SRCS=	fstest_ext2fs.c fstest_ffs.c fstest_lfs.c fstest_msdosfs.c	\
 	fstest_nfs.c fstest_puffs.c fstest_rumpfs.c fstest_sysvbfs.c	\
-	fstest_tmpfs.c fstest_v7fs.c
+	fstest_tmpfs.c fstest_udf.c fstest_v7fs.c
 
 .if (${MKZFS} != no)
 SRCS+=	fstest_zfs.c

Index: src/tests/fs/common/h_fsmacros.h
diff -u src/tests/fs/common/h_fsmacros.h:1.37 src/tests/fs/common/h_fsmacros.h:1.38
--- src/tests/fs/common/h_fsmacros.h:1.37	Sat Mar 16 05:24:59 2013
+++ src/tests/fs/common/h_fsmacros.h	Wed Jun 26 19:29:24 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_fsmacros.h,v 1.37 2013/03/16 05:24:59 jmmv Exp $	*/
+/*	$NetBSD: h_fsmacros.h,v 1.38 2013/06/26 19:29:24 reinoud Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -61,6 +61,7 @@ FSPROTOS(puffs);
 FSPROTOS(rumpfs);
 FSPROTOS(sysvbfs);
 FSPROTOS(tmpfs);
+FSPROTOS(udf);
 FSPROTOS(v7fs);
 FSPROTOS(zfs);
 
@@ -175,6 +176,7 @@ do {	\
   ATF_TC_FSADD(rumpfs,MOUNT_RUMPFS,func,desc)\
   ATF_TC_FSADD(sysvbfs,MOUNT_SYSVBFS,func,desc)\
   ATF_TC_FSADD(tmpfs,MOUNT_TMPFS,func,desc)\
+  ATF_TC_FSADD(udf,MOUNT_UDF,func,desc)\
   ATF_TC_FSADD(v7fs,MOUNT_V7FS,func,desc)
 
 #define ATF_TP_FSAPPLY_NOZFS(func)	\
@@ -189,6 +191,7 @@ do {	\
   ATF_TP_FSADD(rumpfs,func);		\
   ATF_TP_FSADD(sysvbfs,func);		\
   ATF_TP_FSADD(tmpfs,func);		\
+  ATF_TP_FSADD(udf,func);		\
   ATF_TP_FSADD(v7fs,func);
 
 /* XXX: this will not scale */
@@ -228,6 +231,7 @@ do {	\
   ATF_TC_FSADD_RO(nfs,MOUNT_NFS,func,desc,gen)\
   ATF_TC_FSADD_RO(nfsro,MOUNT_NFS,func,desc,gen)			\
   ATF_TC_FSADD_RO(sysvbfs,MOUNT_SYSVBFS,func,desc,gen)			\
+  ATF_TC_FSADD_RO(udf,MOUNT_UDF,func,desc,gen)			\
   ATF_TC_FSADD_RO(v7fs,MOUNT_V7FS,func,desc,gen)
 
 #define ATF_TP_FSAPPLY_RO(func)		\
@@ -238,6 +242,7 @@ do {	\
   ATF_TP_FSADD(nfs,func);		\
   ATF_TP_FSADD(nfsro,func);		\
   ATF_TP_FSADD(sysvbfs,func);		\
+  ATF_TP_FSADD(udf,func);		\
   ATF_TP_FSADD(v7fs,func);
 
 #define ATF_FSAPPLY(func,desc)		\
@@ -286,6 +291,8 @@ atf_check_fstype(const atf_tc_t *tc, con
 (strcmp(atf_tc_get_md_var(tc, X-fs.type), sysvbfs) == 0)
 #define FSTYPE_TMPFS(tc)\
 (strcmp(atf_tc_get_md_var(tc, X-fs.type), tmpfs) == 0)
+#define FSTYPE_UDF(tc)\
+(strcmp(atf_tc_get_md_var(tc, X-fs.type), udf) == 0)
 #define FSTYPE_V7FS(tc)\
 (strcmp(atf_tc_get_md_var(tc, X-fs.type), v7fs) == 0)
 #define FSTYPE_ZFS(tc)\

Added files:

Index: src/tests/fs/common/fstest_udf.c
diff -u /dev/null src/tests/fs/common/fstest_udf.c:1.1
--- /dev/null	Wed Jun 26 19:29:24 2013
+++ src/tests/fs/common/fstest_udf.c	Wed Jun 26 19:29:24 2013
@@ -0,0 +1,149 @@
+/*	$NetBSD: fstest_udf.c,v 1.1 2013/06/26 19:29:24 reinoud Exp $	*/
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nicolas Joly.
+ *
+ * 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 

CVS commit: src/usr.bin/make

2013-06-26 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Wed Jun 26 20:20:37 UTC 2013

Modified Files:
src/usr.bin/make: make.1

Log Message:
fix a typo


To generate a diff of this commit:
cvs rdiff -u -r1.217 -r1.218 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.217 src/usr.bin/make/make.1:1.218
--- src/usr.bin/make/make.1:1.217	Tue Jun 25 07:08:10 2013
+++ src/usr.bin/make/make.1	Wed Jun 26 20:20:36 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: make.1,v 1.217 2013/06/25 07:08:10 wiz Exp $
+.\	$NetBSD: make.1,v 1.218 2013/06/26 20:20:36 agc Exp $
 .\
 .\ Copyright (c) 1990, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -1303,7 +1303,7 @@ should start and end with a period.
 For example.
 .Dl ${LINKS:@.LINK.@${LN} ${TARGET} ${.LINK.}@}
 .Pp
-However a single character varaiable is often more readable:
+However a single character variable is often more readable:
 .Dl ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@}
 .It Cm \:U Ns Ar newval
 If the variable is undefined



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

2013-06-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jun 26 20:52:28 UTC 2013

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

Log Message:
PR/47967: Jeff Rizzo: Add a probe for QEMU to disable it from claiming it
has MSR_TSC. Fixes DTRACE crashing because it returned a frequency of 0.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/x86/x86/identcpu.c

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

Modified files:

Index: src/sys/arch/x86/x86/identcpu.c
diff -u src/sys/arch/x86/x86/identcpu.c:1.32 src/sys/arch/x86/x86/identcpu.c:1.33
--- src/sys/arch/x86/x86/identcpu.c:1.32	Sat Jun 16 13:30:19 2012
+++ src/sys/arch/x86/x86/identcpu.c	Wed Jun 26 16:52:28 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: identcpu.c,v 1.32 2012/06/16 17:30:19 chs Exp $	*/
+/*	$NetBSD: identcpu.c,v 1.33 2013/06/26 20:52:28 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: identcpu.c,v 1.32 2012/06/16 17:30:19 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: identcpu.c,v 1.33 2013/06/26 20:52:28 christos Exp $);
 
 #include opt_xen.h
 
@@ -563,6 +563,17 @@ cpu_probe_geode(struct cpu_info *ci)
 }
 
 static void
+cpu_probe_qemu(struct cpu_info *ci)
+{
+   if (memcmp(QEMU Virtual CPU, cpu_brand_string, 16) != 0)
+   return;
+
+   /* if QEMU does not implement MSR_TSC, disable the TSC */
+   ci-ci_feat_val[0] = ~CPUID_MSR;
+   cpu_feature[0] = ~CPUID_MSR;
+}
+
+static void
 cpu_probe_vortex86(struct cpu_info *ci)
 {
 #define PCI_MODE1_ADDRESS_REG	0x0cf8
@@ -709,6 +720,7 @@ cpu_probe(struct cpu_info *ci)
 	cpu_probe_c3(ci);
 	cpu_probe_geode(ci);
 	cpu_probe_vortex86(ci);
+	cpu_probe_qemu(ci);
 
 	x86_cpu_topology(ci);
 



CVS commit: src/share/examples/npf

2013-06-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jun 26 21:33:56 UTC 2013

Modified Files:
src/share/examples/npf: Makefile
Added Files:
src/share/examples/npf: l2tp-gw.conf

Log Message:
add an L2TP Gateway example.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/examples/npf/Makefile
cvs rdiff -u -r0 -r1.1 src/share/examples/npf/l2tp-gw.conf

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

Modified files:

Index: src/share/examples/npf/Makefile
diff -u src/share/examples/npf/Makefile:1.1 src/share/examples/npf/Makefile:1.2
--- src/share/examples/npf/Makefile:1.1	Wed Aug 22 02:45:16 2012
+++ src/share/examples/npf/Makefile	Wed Jun 26 17:33:56 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2012/08/22 06:45:16 spz Exp $
+#	$NetBSD: Makefile,v 1.2 2013/06/26 21:33:56 christos Exp $
 
 NOOBJ=	# defined
 
@@ -6,6 +6,7 @@ NOOBJ=	# defined
 
 .if ${MKSHARE} != no
 FILES=		host-npf.conf soho_gw-npf.conf hashtablefile treetablefile
+FILES+=		l2tp-gw.conf
 FILESDIR=	/usr/share/examples/npf
 .endif
 

Added files:

Index: src/share/examples/npf/l2tp-gw.conf
diff -u /dev/null src/share/examples/npf/l2tp-gw.conf:1.1
--- /dev/null	Wed Jun 26 17:33:56 2013
+++ src/share/examples/npf/l2tp-gw.conf	Wed Jun 26 17:33:56 2013
@@ -0,0 +1,146 @@
+# ex0 - (internal) network interface
+#	192.168.2.254/24
+# hme0 - (external) connection to Two Sigma
+#	74.66.0.142/24
+
+$int_if = sk0
+$ext_if = bge0
+
+alg icmp
+
+#
+# NAT for all.
+#
+map $ext_if dynamic 192.168.1.0/24 - inet4($ext_if)
+
+#table 1 type tree file /etc/npf_problem_sites
+
+procedure log {
+	log: npflog0
+}
+
+group (name external, interface $ext_if) {
+	#
+	# Allow DHCP requests (even to reserved addresses).
+	#
+	pass out final proto udp from any port bootpc to any port bootps
+	pass in final proto udp from any port bootps to any port bootpc
+	pass in final proto udp from any port bootps to 255.255.255.255 port bootpc
+	#
+	# Allow DNS queries
+	#
+	pass stateful out final proto udp to any port domain
+
+	# Problem sites.
+	#block in final from 1 apply log
+
+	#
+	# Block IANA-reserved addresses from entering or exiting
+	#
+	block in final from 10.0.0.0/8 apply log
+	block in final from 172.16.0.0/12 apply log
+	block in final from 192.168.0.0/16 apply log
+	#
+	block out final to 10.0.0.0/8 apply log
+	block out final to 172.16.0.0/12 apply log
+	block out final to 192.168.0.0/16 apply log
+	#
+	pass stateful out final proto tcp all
+	pass stateful out final proto udp all
+	pass stateful out final proto icmp all
+	pass stateful out final proto ipv6-icmp all
+
+	block in final proto tcp to 192.168.2.255 apply log
+
+	#
+	# Prevent IP spoofing attacks on the firewall.
+	#
+	block in final from 127.0.0.1 apply log
+
+	#
+	# L2TP/IPSEC-NAT-T Tunnels.
+	#
+	pass in final proto udp from any to inet4($ext_if) port isakmp
+	pass in final proto esp from any to inet4($ext_if)
+	pass out final proto esp from any to inet4($ext_if)
+	pass in final proto ah from any to inet4($ext_if)
+	pass in final from any to inet4($ext_if) port ipsec-nat-t
+
+	#
+	# Pass multicast.
+	# IGMP uses 224.0.0.1.
+	#
+	pass in final proto igmp all
+	pass in final from any to 224.0.0.0/4
+
+	#
+	# Pass established connections.
+	#
+	pass in final proto tcp flags A/A all
+	pass in final proto tcp flags R/R all
+	#
+	# VNC
+	#
+	pass in final proto tcp from any to any port 5500
+
+	#
+	# Web servers
+	#
+	#pass in final proto tcp from any to A/M port http
+
+	#
+	# Services on localhost.
+	#
+	#pass in final proto udp from any port ntp
+	#pass in final to any port imap
+	#pass in final to any port domain
+	#pass in final proto tcp to any port smtp
+	#pass in final proto tcp to any port auth
+	#pass in final proto tcp to any port ssh
+	#pass in final proto tcp to any port bgp
+	#pass in final proto tcp to any port ftp
+	#pass in final proto tcp to any port ftp-data
+	#pass in final proto udp to any port isakmp
+	#pass in final proto udp to any port 8001
+	#pass in final proto tcp to inet4($ext_if) port www
+
+	#
+	# Handle traceroute gracefully for up-to 30 hops away.
+	# FIXME: port-unr for ICMP is not yet supported.
+	#
+	block return-icmp in final proto udp to any port 33433-33524 apply log
+
+	#
+	# Only allow selected ICMP types.
+	#
+	pass in final proto icmp icmp-type echo all
+	pass in final proto icmp icmp-type timxceed all
+	pass in final proto icmp icmp-type unreach all
+	pass in final proto icmp icmp-type echoreply all
+	pass in final proto icmp icmp-type sourcequench all
+	pass in final proto icmp icmp-type paramprob all
+	pass in final proto ipv6-icmp all
+
+	#
+	# Send back a reset for new connections on tcp.
+	#
+	block return-rst in final proto tcp flags S/SA all apply log
+}
+
+group (name internal, interface $int_if) {
+	# Pass everything to internal networks,
+	# should be ok, because we are nat'ed.
+	pass final all
+}
+
+group (default) {
+	# Loopback 

CVS commit: src/share/examples/npf

2013-06-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jun 26 21:36:39 UTC 2013

Modified Files:
src/share/examples/npf: Makefile
Added Files:
src/share/examples/npf: l2tp_gw-npf.conf

Log Message:
rename to follow suit.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/examples/npf/Makefile
cvs rdiff -u -r0 -r1.1 src/share/examples/npf/l2tp_gw-npf.conf

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

Modified files:

Index: src/share/examples/npf/Makefile
diff -u src/share/examples/npf/Makefile:1.2 src/share/examples/npf/Makefile:1.3
--- src/share/examples/npf/Makefile:1.2	Wed Jun 26 17:33:56 2013
+++ src/share/examples/npf/Makefile	Wed Jun 26 17:36:39 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2013/06/26 21:33:56 christos Exp $
+#	$NetBSD: Makefile,v 1.3 2013/06/26 21:36:39 christos Exp $
 
 NOOBJ=	# defined
 
@@ -6,7 +6,7 @@ NOOBJ=	# defined
 
 .if ${MKSHARE} != no
 FILES=		host-npf.conf soho_gw-npf.conf hashtablefile treetablefile
-FILES+=		l2tp-gw.conf
+FILES+=		l2tp_gw-npf.conf
 FILESDIR=	/usr/share/examples/npf
 .endif
 

Added files:

Index: src/share/examples/npf/l2tp_gw-npf.conf
diff -u /dev/null src/share/examples/npf/l2tp_gw-npf.conf:1.1
--- /dev/null	Wed Jun 26 17:36:39 2013
+++ src/share/examples/npf/l2tp_gw-npf.conf	Wed Jun 26 17:36:39 2013
@@ -0,0 +1,146 @@
+# ex0 - (internal) network interface
+#	192.168.2.254/24
+# hme0 - (external) connection to Two Sigma
+#	74.66.0.142/24
+
+$int_if = sk0
+$ext_if = bge0
+
+alg icmp
+
+#
+# NAT for all.
+#
+map $ext_if dynamic 192.168.1.0/24 - inet4($ext_if)
+
+#table 1 type tree file /etc/npf_problem_sites
+
+procedure log {
+	log: npflog0
+}
+
+group (name external, interface $ext_if) {
+	#
+	# Allow DHCP requests (even to reserved addresses).
+	#
+	pass out final proto udp from any port bootpc to any port bootps
+	pass in final proto udp from any port bootps to any port bootpc
+	pass in final proto udp from any port bootps to 255.255.255.255 port bootpc
+	#
+	# Allow DNS queries
+	#
+	pass stateful out final proto udp to any port domain
+
+	# Problem sites.
+	#block in final from 1 apply log
+
+	#
+	# Block IANA-reserved addresses from entering or exiting
+	#
+	block in final from 10.0.0.0/8 apply log
+	block in final from 172.16.0.0/12 apply log
+	block in final from 192.168.0.0/16 apply log
+	#
+	block out final to 10.0.0.0/8 apply log
+	block out final to 172.16.0.0/12 apply log
+	block out final to 192.168.0.0/16 apply log
+	#
+	pass stateful out final proto tcp all
+	pass stateful out final proto udp all
+	pass stateful out final proto icmp all
+	pass stateful out final proto ipv6-icmp all
+
+	block in final proto tcp to 192.168.2.255 apply log
+
+	#
+	# Prevent IP spoofing attacks on the firewall.
+	#
+	block in final from 127.0.0.1 apply log
+
+	#
+	# L2TP/IPSEC-NAT-T Tunnels.
+	#
+	pass in final proto udp from any to inet4($ext_if) port isakmp
+	pass in final proto esp from any to inet4($ext_if)
+	pass out final proto esp from any to inet4($ext_if)
+	pass in final proto ah from any to inet4($ext_if)
+	pass in final from any to inet4($ext_if) port ipsec-nat-t
+
+	#
+	# Pass multicast.
+	# IGMP uses 224.0.0.1.
+	#
+	pass in final proto igmp all
+	pass in final from any to 224.0.0.0/4
+
+	#
+	# Pass established connections.
+	#
+	pass in final proto tcp flags A/A all
+	pass in final proto tcp flags R/R all
+	#
+	# VNC
+	#
+	pass in final proto tcp from any to any port 5500
+
+	#
+	# Web servers
+	#
+	#pass in final proto tcp from any to A/M port http
+
+	#
+	# Services on localhost.
+	#
+	#pass in final proto udp from any port ntp
+	#pass in final to any port imap
+	#pass in final to any port domain
+	#pass in final proto tcp to any port smtp
+	#pass in final proto tcp to any port auth
+	#pass in final proto tcp to any port ssh
+	#pass in final proto tcp to any port bgp
+	#pass in final proto tcp to any port ftp
+	#pass in final proto tcp to any port ftp-data
+	#pass in final proto udp to any port isakmp
+	#pass in final proto udp to any port 8001
+	#pass in final proto tcp to inet4($ext_if) port www
+
+	#
+	# Handle traceroute gracefully for up-to 30 hops away.
+	# FIXME: port-unr for ICMP is not yet supported.
+	#
+	block return-icmp in final proto udp to any port 33433-33524 apply log
+
+	#
+	# Only allow selected ICMP types.
+	#
+	pass in final proto icmp icmp-type echo all
+	pass in final proto icmp icmp-type timxceed all
+	pass in final proto icmp icmp-type unreach all
+	pass in final proto icmp icmp-type echoreply all
+	pass in final proto icmp icmp-type sourcequench all
+	pass in final proto icmp icmp-type paramprob all
+	pass in final proto ipv6-icmp all
+
+	#
+	# Send back a reset for new connections on tcp.
+	#
+	block return-rst in final proto tcp flags S/SA all apply log
+}
+
+group (name internal, interface $int_if) {
+	# Pass everything to internal networks,
+	# should be ok, because we are nat'ed.
+	pass final all

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

2013-06-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jun 26 21:38:10 UTC 2013

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

Log Message:
add example for l2tp gateway.


To generate a diff of this commit:
cvs rdiff -u -r1.1033 -r1.1034 src/distrib/sets/lists/base/mi

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

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1033 src/distrib/sets/lists/base/mi:1.1034
--- src/distrib/sets/lists/base/mi:1.1033	Fri Jun 21 17:09:34 2013
+++ src/distrib/sets/lists/base/mi	Wed Jun 26 17:38:10 2013
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1033 2013/06/21 21:09:34 roy Exp $
+# $NetBSD: mi,v 1.1034 2013/06/26 21:38:10 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as obsolete instead,
 #	unless otherwise stated below.
@@ -1732,9 +1732,10 @@
 ./usr/share/examples/mount_portal		base-miscfs-examples
 ./usr/share/examples/named			base-obsolete	obsolete
 ./usr/share/examples/npf			base-netutil-examples
+./usr/share/examples/npf/hashtablefile		base-netutil-examples
 ./usr/share/examples/npf/host-npf.conf		base-netutil-examples
+./usr/share/examples/npf/l2tp_gw-npf.conf	base-netutil-examples
 ./usr/share/examples/npf/soho_gw-npf.conf	base-netutil-examples
-./usr/share/examples/npf/hashtablefile		base-netutil-examples
 ./usr/share/examples/npf/treetablefile		base-netutil-examples
 ./usr/share/examples/openssl			base-crypto-examples
 ./usr/share/examples/pfbase-netutil-examples



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

2013-06-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jun 27 00:37:35 UTC 2013

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

Log Message:
detect a bad msr tsc and don't use it.


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

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

Modified files:

Index: src/sys/arch/x86/x86/tsc.c
diff -u src/sys/arch/x86/x86/tsc.c:1.30 src/sys/arch/x86/x86/tsc.c:1.31
--- src/sys/arch/x86/x86/tsc.c:1.30	Mon Aug  8 13:00:23 2011
+++ src/sys/arch/x86/x86/tsc.c	Wed Jun 26 20:37:34 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: tsc.c,v 1.30 2011/08/08 17:00:23 jmcneill Exp $	*/
+/*	$NetBSD: tsc.c,v 1.31 2013/06/27 00:37:34 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tsc.c,v 1.30 2011/08/08 17:00:23 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: tsc.c,v 1.31 2013/06/27 00:37:34 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -51,6 +51,7 @@ u_int	tsc_get_timecount(struct timecount
 uint64_t	tsc_freq; /* exported for sysctl */
 static int64_t	tsc_drift_max = 250;	/* max cycles */
 static int64_t	tsc_drift_observed;
+static bool	tsc_good;
 
 static volatile int64_t	tsc_sync_val;
 static volatile struct cpu_info	*tsc_sync_cpu;
@@ -76,6 +77,7 @@ tsc_tc_init(void)
 	ci = curcpu();
 	safe = false;
 	tsc_freq = ci-ci_data.cpu_cc_freq;
+	tsc_good = (cpu_feature[0]  CPUID_MSR) != 0  rdmsr(MSR_TSC) != 0;
 
 	if (cpu_vendor == CPUVENDOR_INTEL) {
 		/*
@@ -258,10 +260,12 @@ cpu_hascounter(void)
 	return cpu_feature[0]  CPUID_TSC;
 }
 
+extern int cpu_msr_tsc;
+
 uint64_t
 cpu_counter_serializing(void)
 {
-	if (cpu_feature[0]  CPUID_MSR)
+	if (tsc_good)
 		return rdmsr(MSR_TSC);
 	else
 		return cpu_counter();



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

2013-06-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jun 27 00:38:18 UTC 2013

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

Log Message:
back out previous, fix is in tsc.c


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

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

Modified files:

Index: src/sys/arch/x86/x86/identcpu.c
diff -u src/sys/arch/x86/x86/identcpu.c:1.33 src/sys/arch/x86/x86/identcpu.c:1.34
--- src/sys/arch/x86/x86/identcpu.c:1.33	Wed Jun 26 16:52:28 2013
+++ src/sys/arch/x86/x86/identcpu.c	Wed Jun 26 20:38:18 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: identcpu.c,v 1.33 2013/06/26 20:52:28 christos Exp $	*/
+/*	$NetBSD: identcpu.c,v 1.34 2013/06/27 00:38:18 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: identcpu.c,v 1.33 2013/06/26 20:52:28 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: identcpu.c,v 1.34 2013/06/27 00:38:18 christos Exp $);
 
 #include opt_xen.h
 
@@ -563,17 +563,6 @@ cpu_probe_geode(struct cpu_info *ci)
 }
 
 static void
-cpu_probe_qemu(struct cpu_info *ci)
-{
-   if (memcmp(QEMU Virtual CPU, cpu_brand_string, 16) != 0)
-   return;
-
-   /* if QEMU does not implement MSR_TSC, disable the TSC */
-   ci-ci_feat_val[0] = ~CPUID_MSR;
-   cpu_feature[0] = ~CPUID_MSR;
-}
-
-static void
 cpu_probe_vortex86(struct cpu_info *ci)
 {
 #define PCI_MODE1_ADDRESS_REG	0x0cf8
@@ -720,7 +709,6 @@ cpu_probe(struct cpu_info *ci)
 	cpu_probe_c3(ci);
 	cpu_probe_geode(ci);
 	cpu_probe_vortex86(ci);
-	cpu_probe_qemu(ci);
 
 	x86_cpu_topology(ci);
 



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

2013-06-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jun 27 01:01:08 UTC 2013

Modified Files:
src/sys/arch/cats/conf: Makefile.cats.inc

Log Message:
Don't force MACHINE_ARCH to be arm


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/cats/conf/Makefile.cats.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/arch/cats/conf/Makefile.cats.inc
diff -u src/sys/arch/cats/conf/Makefile.cats.inc:1.25 src/sys/arch/cats/conf/Makefile.cats.inc:1.26
--- src/sys/arch/cats/conf/Makefile.cats.inc:1.25	Sun Jul 10 04:37:56 2011
+++ src/sys/arch/cats/conf/Makefile.cats.inc	Thu Jun 27 01:01:08 2013
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile.cats.inc,v 1.25 2011/07/10 04:37:56 tsutsui Exp $
+#	$NetBSD: Makefile.cats.inc,v 1.26 2013/06/27 01:01:08 matt Exp $
 
-MACHINE_ARCH=	arm
+MACHINE_ARCH?=	arm
 CPPFLAGS+=	-D${MACHINE}
 
 .if defined(ABLEELF)  (${ABLEELF} == 1)



CVS commit: src

2013-06-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jun 27 01:02:13 UTC 2013

Modified Files:
src: build.sh

Log Message:
Add earm aliases for various arm ports (ecats, hpcearm, eshark, etc.)


To generate a diff of this commit:
cvs rdiff -u -r1.267 -r1.268 src/build.sh

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

Modified files:

Index: src/build.sh
diff -u src/build.sh:1.267 src/build.sh:1.268
--- src/build.sh:1.267	Wed May  1 13:12:00 2013
+++ src/build.sh	Thu Jun 27 01:02:13 2013
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.267 2013/05/01 13:12:00 kiyohara Exp $
+#	$NetBSD: build.sh,v 1.268 2013/06/27 01:02:13 matt Exp $
 #
 # Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -580,7 +580,7 @@ MACHINE=arc		MACHINE_ARCH=mipsel	DEFAULT
 MACHINE=atari		MACHINE_ARCH=m68k
 MACHINE=bebox		MACHINE_ARCH=powerpc
 MACHINE=cats		MACHINE_ARCH=arm	DEFAULT
-MACHINE=cats		MACHINE_ARCH=earm
+MACHINE=cats		MACHINE_ARCH=earm	ALIAS=ecats
 MACHINE=cesfic		MACHINE_ARCH=m68k
 MACHINE=cobalt		MACHINE_ARCH=mips64el	ALIAS=cobalt64
 MACHINE=cobalt		MACHINE_ARCH=mipsel	DEFAULT
@@ -607,13 +607,14 @@ MACHINE=ews4800mips	MACHINE_ARCH=mipseb
 MACHINE=hp300		MACHINE_ARCH=m68k
 MACHINE=hp700		MACHINE_ARCH=hppa
 MACHINE=hpcarm		MACHINE_ARCH=arm
+MACHINE=hpcarm		MACHINE_ARCH=earm	ALIAS=hpcearm
 MACHINE=hpcmips		MACHINE_ARCH=mipsel
 MACHINE=hpcsh		MACHINE_ARCH=sh3el
 MACHINE=i386		MACHINE_ARCH=i386
 MACHINE=ia64		MACHINE_ARCH=ia64
 MACHINE=ibmnws		MACHINE_ARCH=powerpc
 MACHINE=iyonix		MACHINE_ARCH=arm	DEFAULT
-MACHINE=iyonix		MACHINE_ARCH=earm
+MACHINE=iyonix		MACHINE_ARCH=earm	ALIAS=eiyonix
 MACHINE=landisk		MACHINE_ARCH=sh3el
 MACHINE=luna68k		MACHINE_ARCH=m68k
 MACHINE=mac68k		MACHINE_ARCH=m68k
@@ -624,7 +625,7 @@ MACHINE=mmeye		MACHINE_ARCH=sh3eb
 MACHINE=mvme68k		MACHINE_ARCH=m68k
 MACHINE=mvmeppc		MACHINE_ARCH=powerpc
 MACHINE=netwinder	MACHINE_ARCH=arm	DEFAULT
-MACHINE=netwinder	MACHINE_ARCH=earm
+MACHINE=netwinder	MACHINE_ARCH=earm	ALIAS=enetwinder
 MACHINE=news68k		MACHINE_ARCH=m68k
 MACHINE=newsmips	MACHINE_ARCH=mipseb
 MACHINE=next68k		MACHINE_ARCH=m68k
@@ -643,7 +644,7 @@ MACHINE=sbmips		MACHINE_ARCH=mipsel	ALIA
 MACHINE=sgimips		MACHINE_ARCH=mips64eb	ALIAS=sgimips64
 MACHINE=sgimips		MACHINE_ARCH=mipseb	DEFAULT
 MACHINE=shark		MACHINE_ARCH=arm	DEFAULT
-MACHINE=shark		MACHINE_ARCH=earm
+MACHINE=shark		MACHINE_ARCH=earm	ALIAS=eshark
 MACHINE=sparc		MACHINE_ARCH=sparc
 MACHINE=sparc64		MACHINE_ARCH=sparc64
 MACHINE=sun2		MACHINE_ARCH=m68000
@@ -651,7 +652,7 @@ MACHINE=sun3		MACHINE_ARCH=m68k
 MACHINE=vax		MACHINE_ARCH=vax
 MACHINE=x68k		MACHINE_ARCH=m68k
 MACHINE=zaurus		MACHINE_ARCH=arm	DEFAULT
-MACHINE=zaurus		MACHINE_ARCH=earm
+MACHINE=zaurus		MACHINE_ARCH=earm	ALIAS=ezaurus
 '
 
 # getarch -- find the default MACHINE_ARCH for a MACHINE,
@@ -1731,7 +1732,7 @@ createmakewrapper()
 	eval cat EOF ${makewrapout}
 #! ${HOST_SH}
 # Set proper variables to allow easy make building of a NetBSD subtree.
-# Generated from:  \$NetBSD: build.sh,v 1.267 2013/05/01 13:12:00 kiyohara Exp $
+# Generated from:  \$NetBSD: build.sh,v 1.268 2013/06/27 01:02:13 matt Exp $
 # with these arguments: ${_args}
 #
 



CVS commit: [netbsd-6] src/external/gpl3/binutils/dist/ld/emultempl

2013-06-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jun 27 01:18:32 UTC 2013

Modified Files:
src/external/gpl3/binutils/dist/ld/emultempl [netbsd-6]: elf32.em

Log Message:
Pull up following revision(s) (requested by joerg in ticket #911):
external/gpl3/binutils/dist/ld/emultempl/elf32.em: revision 1.6
PR 47922: Properly resolve DT_NEEDED entries under sysroot and don't
accidently try the installed system.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.4.1 \
src/external/gpl3/binutils/dist/ld/emultempl/elf32.em

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/binutils/dist/ld/emultempl/elf32.em
diff -u src/external/gpl3/binutils/dist/ld/emultempl/elf32.em:1.4 src/external/gpl3/binutils/dist/ld/emultempl/elf32.em:1.4.4.1
--- src/external/gpl3/binutils/dist/ld/emultempl/elf32.em:1.4	Sun Sep 25 04:32:43 2011
+++ src/external/gpl3/binutils/dist/ld/emultempl/elf32.em	Thu Jun 27 01:18:32 2013
@@ -452,15 +452,25 @@ fragment EOF
 
 static bfd_boolean
 gld${EMULATION_NAME}_search_needed (const char *path,
-struct dt_needed *n, int force)
+struct dt_needed *n, int force, int prepend_sysroot)
 {
   const char *s;
   const char *name = n-name;
   size_t len;
   struct dt_needed needed;
 
-  if (name[0] == '/')
+  if (name[0] == '/') {
+if (prepend_sysroot  ld_sysroot) {
+  bfd_boolean rv;
+  needed.by = n-by;
+  char *filename= concat(ld_sysroot, n-name, (const char *)NULL);
+  needed.name = filename;
+  rv = gld${EMULATION_NAME}_try_needed (needed, force);
+  free(filename);
+  return rv;
+}
 return gld${EMULATION_NAME}_try_needed (n, force);
+  }
 
   if (path == NULL || *path == '\0')
 return FALSE;
@@ -499,6 +509,13 @@ gld${EMULATION_NAME}_search_needed (cons
 	}
   strcpy (sset, name);
 
+  if (prepend_sysroot  filename[0] == '=')
+abort();
+  if (filename[0] == '/'  prepend_sysroot  ld_sysroot) {
+char *filename2 = concat(ld_sysroot, filename, (const char *)NULL);
+free(filename);
+filename = filename2;
+  }
   needed.name = filename;
   if (gld${EMULATION_NAME}_try_needed (needed, force))
 	return TRUE;
@@ -613,7 +630,7 @@ gld${EMULATION_NAME}_check_ld_elf_hints 
   needed.by = NULL;
   needed.name = name;
   return gld${EMULATION_NAME}_search_needed (ld_elf_hints,  needed,
-	 force);
+	 force, 0);
 }
 EOF
 # FreeBSD
@@ -824,7 +841,7 @@ gld${EMULATION_NAME}_check_ld_so_conf (c
 
   needed.by = NULL;
   needed.name = name;
-  return gld${EMULATION_NAME}_search_needed (ld_so_conf, needed, force);
+  return gld${EMULATION_NAME}_search_needed (ld_so_conf, needed, force, 0);
 }
 
 EOF
@@ -1256,13 +1273,13 @@ fi
 fragment EOF
 
 	  if (gld${EMULATION_NAME}_search_needed (command_line.rpath_link,
-		  n, force))
+		  n, force, 0))
 	break;
 EOF
 if [ x${USE_LIBPATH} = xyes ] ; then
 fragment EOF
 	  if (gld${EMULATION_NAME}_search_needed (command_line.rpath,
-		  n, force))
+		  n, force, 1))
 	break;
 EOF
 fi
@@ -1273,11 +1290,11 @@ fragment EOF
 	{
 	  lib_path = (const char *) getenv (LD_RUN_PATH);
 	  if (gld${EMULATION_NAME}_search_needed (lib_path, n,
-		  force))
+		  force, 0))
 		break;
 	}
 	  lib_path = (const char *) getenv (LD_LIBRARY_PATH);
-	  if (gld${EMULATION_NAME}_search_needed (lib_path, n, force))
+	  if (gld${EMULATION_NAME}_search_needed (lib_path, n, force, 0))
 	break;
 EOF
 fi
@@ -1287,12 +1304,10 @@ fragment EOF
 	  rp = bfd_elf_get_runpath_list (link_info.output_bfd, link_info);
 	  for (; !found  rp != NULL; rp = rp-next)
 	{
-	  char *tmpname = gld${EMULATION_NAME}_add_sysroot (rp-name);
 	  found = (rp-by == l-by
-		gld${EMULATION_NAME}_search_needed (tmpname,
+		gld${EMULATION_NAME}_search_needed (rp-name,
 			  n,
-			  force));
-	  free (tmpname);
+			  force, 1));
 	}
 	  if (found)
 	break;



CVS commit: [netbsd-6] src/doc

2013-06-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jun 27 01:19:36 UTC 2013

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

Log Message:
Ticket 911.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.12 -r1.1.2.13 src/doc/CHANGES-6.2

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

Modified files:

Index: src/doc/CHANGES-6.2
diff -u src/doc/CHANGES-6.2:1.1.2.12 src/doc/CHANGES-6.2:1.1.2.13
--- src/doc/CHANGES-6.2:1.1.2.12	Sun Jun 23 11:22:29 2013
+++ src/doc/CHANGES-6.2	Thu Jun 27 01:19:36 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.12 2013/06/23 11:22:29 bouyer Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.13 2013/06/27 01:19:36 msaitoh Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -259,3 +259,8 @@ sys/arch/i386/eisa/eisa_machdep.c		1.38
 	Patch from Felix Deichmann.
 	[uebayasi, ticket #904]
 
+external/gpl3/binutils/dist/ld/emultempl/elf32.em 1.6
+
+	PR 47922: Properly resolve DT_NEEDED entries under sysroot and don't
+	accidently try the installed system.
+	[joerg, ticket #911]



CVS commit: [netbsd-6-0] src/external/gpl3/binutils/dist/ld/emultempl

2013-06-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jun 27 01:26:36 UTC 2013

Modified Files:
src/external/gpl3/binutils/dist/ld/emultempl [netbsd-6-0]: elf32.em

Log Message:
Pull up following revision(s) (requested by joerg in ticket #911):
external/gpl3/binutils/dist/ld/emultempl/elf32.em: revision 1.6
PR 47922: Properly resolve DT_NEEDED entries under sysroot and don't
accidently try the installed system.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.8.1 \
src/external/gpl3/binutils/dist/ld/emultempl/elf32.em

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/binutils/dist/ld/emultempl/elf32.em
diff -u src/external/gpl3/binutils/dist/ld/emultempl/elf32.em:1.4 src/external/gpl3/binutils/dist/ld/emultempl/elf32.em:1.4.8.1
--- src/external/gpl3/binutils/dist/ld/emultempl/elf32.em:1.4	Sun Sep 25 04:32:43 2011
+++ src/external/gpl3/binutils/dist/ld/emultempl/elf32.em	Thu Jun 27 01:26:36 2013
@@ -452,15 +452,25 @@ fragment EOF
 
 static bfd_boolean
 gld${EMULATION_NAME}_search_needed (const char *path,
-struct dt_needed *n, int force)
+struct dt_needed *n, int force, int prepend_sysroot)
 {
   const char *s;
   const char *name = n-name;
   size_t len;
   struct dt_needed needed;
 
-  if (name[0] == '/')
+  if (name[0] == '/') {
+if (prepend_sysroot  ld_sysroot) {
+  bfd_boolean rv;
+  needed.by = n-by;
+  char *filename= concat(ld_sysroot, n-name, (const char *)NULL);
+  needed.name = filename;
+  rv = gld${EMULATION_NAME}_try_needed (needed, force);
+  free(filename);
+  return rv;
+}
 return gld${EMULATION_NAME}_try_needed (n, force);
+  }
 
   if (path == NULL || *path == '\0')
 return FALSE;
@@ -499,6 +509,13 @@ gld${EMULATION_NAME}_search_needed (cons
 	}
   strcpy (sset, name);
 
+  if (prepend_sysroot  filename[0] == '=')
+abort();
+  if (filename[0] == '/'  prepend_sysroot  ld_sysroot) {
+char *filename2 = concat(ld_sysroot, filename, (const char *)NULL);
+free(filename);
+filename = filename2;
+  }
   needed.name = filename;
   if (gld${EMULATION_NAME}_try_needed (needed, force))
 	return TRUE;
@@ -613,7 +630,7 @@ gld${EMULATION_NAME}_check_ld_elf_hints 
   needed.by = NULL;
   needed.name = name;
   return gld${EMULATION_NAME}_search_needed (ld_elf_hints,  needed,
-	 force);
+	 force, 0);
 }
 EOF
 # FreeBSD
@@ -824,7 +841,7 @@ gld${EMULATION_NAME}_check_ld_so_conf (c
 
   needed.by = NULL;
   needed.name = name;
-  return gld${EMULATION_NAME}_search_needed (ld_so_conf, needed, force);
+  return gld${EMULATION_NAME}_search_needed (ld_so_conf, needed, force, 0);
 }
 
 EOF
@@ -1256,13 +1273,13 @@ fi
 fragment EOF
 
 	  if (gld${EMULATION_NAME}_search_needed (command_line.rpath_link,
-		  n, force))
+		  n, force, 0))
 	break;
 EOF
 if [ x${USE_LIBPATH} = xyes ] ; then
 fragment EOF
 	  if (gld${EMULATION_NAME}_search_needed (command_line.rpath,
-		  n, force))
+		  n, force, 1))
 	break;
 EOF
 fi
@@ -1273,11 +1290,11 @@ fragment EOF
 	{
 	  lib_path = (const char *) getenv (LD_RUN_PATH);
 	  if (gld${EMULATION_NAME}_search_needed (lib_path, n,
-		  force))
+		  force, 0))
 		break;
 	}
 	  lib_path = (const char *) getenv (LD_LIBRARY_PATH);
-	  if (gld${EMULATION_NAME}_search_needed (lib_path, n, force))
+	  if (gld${EMULATION_NAME}_search_needed (lib_path, n, force, 0))
 	break;
 EOF
 fi
@@ -1287,12 +1304,10 @@ fragment EOF
 	  rp = bfd_elf_get_runpath_list (link_info.output_bfd, link_info);
 	  for (; !found  rp != NULL; rp = rp-next)
 	{
-	  char *tmpname = gld${EMULATION_NAME}_add_sysroot (rp-name);
 	  found = (rp-by == l-by
-		gld${EMULATION_NAME}_search_needed (tmpname,
+		gld${EMULATION_NAME}_search_needed (rp-name,
 			  n,
-			  force));
-	  free (tmpname);
+			  force, 1));
 	}
 	  if (found)
 	break;



CVS commit: [netbsd-6-0] src/doc

2013-06-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jun 27 01:27:57 UTC 2013

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

Log Message:
Ticket 911.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.7 -r1.1.2.8 src/doc/CHANGES-6.0.3

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

Modified files:

Index: src/doc/CHANGES-6.0.3
diff -u src/doc/CHANGES-6.0.3:1.1.2.7 src/doc/CHANGES-6.0.3:1.1.2.8
--- src/doc/CHANGES-6.0.3:1.1.2.7	Sun Jun 23 11:17:53 2013
+++ src/doc/CHANGES-6.0.3	Thu Jun 27 01:27:56 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0.3,v 1.1.2.7 2013/06/23 11:17:53 bouyer Exp $
+# $NetBSD: CHANGES-6.0.3,v 1.1.2.8 2013/06/27 01:27:56 msaitoh Exp $
 
 A complete list of changes from the NetBSD 6.0.2 release to the NetBSD 6.0.3
 release:
@@ -103,3 +103,8 @@ tests/lib/libm/t_atan.c1.4 - 1.7, 1.
 	PR port-i386/46108.
 	[isaki, ticket #903]
 
+external/gpl3/binutils/dist/ld/emultempl/elf32.em 1.6
+
+	PR 47922: Properly resolve DT_NEEDED entries under sysroot and don't
+	accidently try the installed system.
+	[joerg, ticket #911]



CVS commit: [netbsd-6-1] src/external/gpl3/binutils/dist/ld/emultempl

2013-06-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jun 27 01:29:54 UTC 2013

Modified Files:
src/external/gpl3/binutils/dist/ld/emultempl [netbsd-6-1]: elf32.em

Log Message:
Pull up following revision(s) (requested by joerg in ticket #911):
external/gpl3/binutils/dist/ld/emultempl/elf32.em: revision 1.6
PR 47922: Properly resolve DT_NEEDED entries under sysroot and don't
accidently try the installed system.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.10.1 \
src/external/gpl3/binutils/dist/ld/emultempl/elf32.em

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/binutils/dist/ld/emultempl/elf32.em
diff -u src/external/gpl3/binutils/dist/ld/emultempl/elf32.em:1.4 src/external/gpl3/binutils/dist/ld/emultempl/elf32.em:1.4.10.1
--- src/external/gpl3/binutils/dist/ld/emultempl/elf32.em:1.4	Sun Sep 25 04:32:43 2011
+++ src/external/gpl3/binutils/dist/ld/emultempl/elf32.em	Thu Jun 27 01:29:54 2013
@@ -452,15 +452,25 @@ fragment EOF
 
 static bfd_boolean
 gld${EMULATION_NAME}_search_needed (const char *path,
-struct dt_needed *n, int force)
+struct dt_needed *n, int force, int prepend_sysroot)
 {
   const char *s;
   const char *name = n-name;
   size_t len;
   struct dt_needed needed;
 
-  if (name[0] == '/')
+  if (name[0] == '/') {
+if (prepend_sysroot  ld_sysroot) {
+  bfd_boolean rv;
+  needed.by = n-by;
+  char *filename= concat(ld_sysroot, n-name, (const char *)NULL);
+  needed.name = filename;
+  rv = gld${EMULATION_NAME}_try_needed (needed, force);
+  free(filename);
+  return rv;
+}
 return gld${EMULATION_NAME}_try_needed (n, force);
+  }
 
   if (path == NULL || *path == '\0')
 return FALSE;
@@ -499,6 +509,13 @@ gld${EMULATION_NAME}_search_needed (cons
 	}
   strcpy (sset, name);
 
+  if (prepend_sysroot  filename[0] == '=')
+abort();
+  if (filename[0] == '/'  prepend_sysroot  ld_sysroot) {
+char *filename2 = concat(ld_sysroot, filename, (const char *)NULL);
+free(filename);
+filename = filename2;
+  }
   needed.name = filename;
   if (gld${EMULATION_NAME}_try_needed (needed, force))
 	return TRUE;
@@ -613,7 +630,7 @@ gld${EMULATION_NAME}_check_ld_elf_hints 
   needed.by = NULL;
   needed.name = name;
   return gld${EMULATION_NAME}_search_needed (ld_elf_hints,  needed,
-	 force);
+	 force, 0);
 }
 EOF
 # FreeBSD
@@ -824,7 +841,7 @@ gld${EMULATION_NAME}_check_ld_so_conf (c
 
   needed.by = NULL;
   needed.name = name;
-  return gld${EMULATION_NAME}_search_needed (ld_so_conf, needed, force);
+  return gld${EMULATION_NAME}_search_needed (ld_so_conf, needed, force, 0);
 }
 
 EOF
@@ -1256,13 +1273,13 @@ fi
 fragment EOF
 
 	  if (gld${EMULATION_NAME}_search_needed (command_line.rpath_link,
-		  n, force))
+		  n, force, 0))
 	break;
 EOF
 if [ x${USE_LIBPATH} = xyes ] ; then
 fragment EOF
 	  if (gld${EMULATION_NAME}_search_needed (command_line.rpath,
-		  n, force))
+		  n, force, 1))
 	break;
 EOF
 fi
@@ -1273,11 +1290,11 @@ fragment EOF
 	{
 	  lib_path = (const char *) getenv (LD_RUN_PATH);
 	  if (gld${EMULATION_NAME}_search_needed (lib_path, n,
-		  force))
+		  force, 0))
 		break;
 	}
 	  lib_path = (const char *) getenv (LD_LIBRARY_PATH);
-	  if (gld${EMULATION_NAME}_search_needed (lib_path, n, force))
+	  if (gld${EMULATION_NAME}_search_needed (lib_path, n, force, 0))
 	break;
 EOF
 fi
@@ -1287,12 +1304,10 @@ fragment EOF
 	  rp = bfd_elf_get_runpath_list (link_info.output_bfd, link_info);
 	  for (; !found  rp != NULL; rp = rp-next)
 	{
-	  char *tmpname = gld${EMULATION_NAME}_add_sysroot (rp-name);
 	  found = (rp-by == l-by
-		gld${EMULATION_NAME}_search_needed (tmpname,
+		gld${EMULATION_NAME}_search_needed (rp-name,
 			  n,
-			  force));
-	  free (tmpname);
+			  force, 1));
 	}
 	  if (found)
 	break;



CVS commit: [netbsd-6-1] src/doc

2013-06-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jun 27 01:34:34 UTC 2013

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

Log Message:
Ticket 911.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.7 -r1.1.2.8 src/doc/CHANGES-6.1.1

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

Modified files:

Index: src/doc/CHANGES-6.1.1
diff -u src/doc/CHANGES-6.1.1:1.1.2.7 src/doc/CHANGES-6.1.1:1.1.2.8
--- src/doc/CHANGES-6.1.1:1.1.2.7	Sun Jun 23 11:17:42 2013
+++ src/doc/CHANGES-6.1.1	Thu Jun 27 01:34:34 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1.1,v 1.1.2.7 2013/06/23 11:17:42 bouyer Exp $
+# $NetBSD: CHANGES-6.1.1,v 1.1.2.8 2013/06/27 01:34:34 msaitoh Exp $
 
 A complete list of changes from the NetBSD 6.1 release to the NetBSD 6.1.1
 release:
@@ -103,3 +103,8 @@ tests/lib/libm/t_atan.c1.4 - 1.7, 1.
 	PR port-i386/46108.
 	[isaki, ticket #903]
 
+external/gpl3/binutils/dist/ld/emultempl/elf32.em 1.6
+
+	PR 47922: Properly resolve DT_NEEDED entries under sysroot and don't
+	accidently try the installed system.
+	[joerg, ticket #911]



CVS commit: src/tools/gcc

2013-06-26 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Jun 27 02:38:39 UTC 2013

Modified Files:
src/tools/gcc: Makefile

Log Message:
use NETBSDSRCDIR to find mpc/mpfr/gmp, not NEWCONFIGDIR, the
latter which is for finding a r/w directory to write to if
we're running from a read-only tree.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/tools/gcc/Makefile

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

Modified files:

Index: src/tools/gcc/Makefile
diff -u src/tools/gcc/Makefile:1.54 src/tools/gcc/Makefile:1.55
--- src/tools/gcc/Makefile:1.54	Thu Apr 25 16:18:43 2013
+++ src/tools/gcc/Makefile	Thu Jun 27 02:38:39 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.54 2013/04/25 16:18:43 skrll Exp $
+#	$NetBSD: Makefile,v 1.55 2013/06/27 02:38:39 mrg Exp $
 
 .include bsd.own.mk
 
@@ -112,6 +112,8 @@ GCCSRCDIR=${.CURDIR}/../../external/gpl3
 CXXADDFLAGS=	--sysroot=${DESTDIR}
 CCADDFLAGS=	--sysroot=${DESTDIR} -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/ -I${.OBJDIR}/.native/gcc/include
 
+# NEWCONFIGDIR can be set to a read-write location of the source tree
+# in case the version being used is not.
 NEWCONFIGDIR?=	${.CURDIR}/../..
 MKNATIVE?=	${.CURDIR}/mknative-gcc
 
@@ -129,9 +131,9 @@ native-gcc: .native/.configure_done
 
 NATIVE_CONFIGURE_ARGS=	${COMMON_CONFIGURE_ARGS}
 .if ${HAVE_GCC} = 45
-MPC=		${NEWCONFIGDIR}/external/lgpl2/mpc
-MPFR=		${NEWCONFIGDIR}/external/lgpl3/mpfr
-GMP=		${NEWCONFIGDIR}/external/lgpl3/gmp
+MPC=		${NETBSDSRCDIR}/external/lgpl2/mpc
+MPFR=		${NETBSDSRCDIR}/external/lgpl3/mpfr
+GMP=		${NETBSDSRCDIR}/external/lgpl3/gmp
 MPCOBJ!=	cd ${MPC}/lib/libmpc  ${PRINTOBJDIR}
 MPFROBJ!=	cd ${MPFR}/lib/libmpfr  ${PRINTOBJDIR}
 GMPOBJ!=	cd ${GMP}/lib/libgmp  ${PRINTOBJDIR}



CVS commit: src/distrib/utils/embedded

2013-06-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jun 27 03:00:53 UTC 2013

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
tidy up, fix usage


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/distrib/utils/embedded/mkimage

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/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.40 src/distrib/utils/embedded/mkimage:1.41
--- src/distrib/utils/embedded/mkimage:1.40	Sun Jun 16 09:47:42 2013
+++ src/distrib/utils/embedded/mkimage	Wed Jun 26 23:00:53 2013
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.40 2013/06/16 13:47:42 jakllsch Exp $
+# $NetBSD: mkimage,v 1.41 2013/06/27 03:00:53 christos Exp $
 #
 # Copyright (c) 2013 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -69,7 +69,7 @@ getsize() {
 
 usage() {
 	cat  EOF 12
-Usage: $PROG -h host-arch [-bmx] [-K kerneldir] [-S srcdir] [-D destdir] [-c custom-files-dir] [-s Mb size] [image]
+Usage: $PROG -h host-arch [-bdmx] [-K kerneldir] [-S srcdir] [-D destdir] [-c custom-files-dir] [-s Mb size] [image]
 
 -b	Boot only, no sets loaded
 -d	Add the debug sets
@@ -115,7 +115,7 @@ do
 	D)	release=$OPTARG;;
 	K)	kernel=$OPTARG;;
 	S)	;;
-	b)	bootonly=true;;
+	b)	bootonly=true;;
 	d)	dsets=true
 		selected_sets=$selected_sets debug
 		if $xsets; then
@@ -170,15 +170,15 @@ fi
 if [ -n ${msdosid} ]; then
 	echo ${bar} Populating msdos filesystem ${bar}
 	${MAKEFS} -N ${release}/etc -t msdos \
-	-O $((${init} / 2))m -s $((${boot} / 2 + ${init} / 2))m ${image} ${mnt}/boot
+	-O $((${init} / 2))m -s $((${boot} / 2 + ${init} / 2))m \
+	${image} ${mnt}/boot
 fi
 
 if [ -z $bootonly ]; then
 	echo ${bar} Populating ffs filesystem ${bar}
 	${MAKEFS} -N ${release}/etc -t ffs -rx \
 	-O $(((${init} + ${boot} + ${swap}) / 2))m \
-		-o d=4096 \
-	-b $((${extra}))m \
+	-o d=4096 -b $((${extra}))m \
 	-F $tmp/selected_sets ${image} ${release} ${mnt}
 fi
 



CVS commit: src/distrib/utils/embedded

2013-06-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jun 27 03:03:16 UTC 2013

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
explain -m better


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/distrib/utils/embedded/mkimage

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/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.41 src/distrib/utils/embedded/mkimage:1.42
--- src/distrib/utils/embedded/mkimage:1.41	Wed Jun 26 23:00:53 2013
+++ src/distrib/utils/embedded/mkimage	Wed Jun 26 23:03:16 2013
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.41 2013/06/27 03:00:53 christos Exp $
+# $NetBSD: mkimage,v 1.42 2013/06/27 03:03:16 christos Exp $
 #
 # Copyright (c) 2013 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -73,7 +73,7 @@ Usage: $PROG -h host-arch [-bdmx] [-K 
 
 -b	Boot only, no sets loaded
 -d	Add the debug sets
--m	Mimimize disk writes for sd cards
+-m	Optimize the OS installation to mimimize disk writes for SSD cards
 -x	Load the x sets too, not just the base ones
 EOF
 	exit 1



CVS commit: src/lib/csu/common

2013-06-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jun 27 03:37:21 UTC 2013

Modified Files:
src/lib/csu/common: Makefile.inc

Log Message:
Add -fPIC to compile of crtbeginS.o


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/csu/common/Makefile.inc

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

Modified files:

Index: src/lib/csu/common/Makefile.inc
diff -u src/lib/csu/common/Makefile.inc:1.10 src/lib/csu/common/Makefile.inc:1.11
--- src/lib/csu/common/Makefile.inc:1.10	Tue Jun 25 07:18:02 2013
+++ src/lib/csu/common/Makefile.inc	Thu Jun 27 03:37:21 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.10 2013/06/25 07:18:02 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.11 2013/06/27 03:37:21 matt Exp $
 
 .include bsd.own.mk
 
@@ -34,7 +34,7 @@ crtbeginS.o: crtbegin.S
 .else
 crtbeginS.o: crtbegin.c crtbegin.h
 	${_MKTARGET_COMPILE}
-	${COMPILE.c} -DPIC -DSHARED ${COMMON_DIR}/crtbegin.c -o ${.TARGET}.o
+	${COMPILE.c} -fPIC -DPIC -DSHARED ${COMMON_DIR}/crtbegin.c -o ${.TARGET}.o
 .endif
 	${LD} -x -r -o ${.TARGET} ${.TARGET}.o
 	rm -f ${.TARGET}.o