CVS commit: src/lib/libc/rpc

2016-08-07 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Mon Aug  8 04:16:45 UTC 2016

Modified Files:
src/lib/libc/rpc: rpc_soc.3

Log Message:
Typo.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/rpc/rpc_soc.3

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

Modified files:

Index: src/lib/libc/rpc/rpc_soc.3
diff -u src/lib/libc/rpc/rpc_soc.3:1.14 src/lib/libc/rpc/rpc_soc.3:1.15
--- src/lib/libc/rpc/rpc_soc.3:1.14	Mon Mar  4 17:29:03 2013
+++ src/lib/libc/rpc/rpc_soc.3	Mon Aug  8 04:16:45 2016
@@ -1,5 +1,5 @@
 .\"	@(#)rpc.3n	2.4 88/08/08 4.0 RPCSRC; from 1.19 88/06/24 SMI
-.\"	$NetBSD: rpc_soc.3,v 1.14 2013/03/04 17:29:03 christos Exp $
+.\"	$NetBSD: rpc_soc.3,v 1.15 2016/08/08 04:16:45 dholland Exp $
 .\" Converted to mdoc by Thomas Klausner 
 .\"
 .Dd December 12, 2008
@@ -986,8 +986,8 @@ This allows the user to specify the maxi
 receiving UDP-based RPC messages.
 .It Fn svcudp_create
 This acts as
-.Fn svcudp_bufcreate with
-predefined sizes for the maximum packet sizes.
+.Fn svcudp_bufcreate
+with predefined sizes for the maximum packet sizes.
 .It Fn xdr_accepted_reply
 Used for encoding RPC reply messages.
 This routine is useful for users who wish to generate RPC-style



CVS commit: src/sys/net

2016-08-07 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Aug  8 02:50:05 UTC 2016

Modified Files:
src/sys/net: if_pppoe.c

Log Message:
Don't try to set-up our sysctl sub-tree if we're built-in - this will
happen automatically (via "registration" of the setup function in a
link-set), and if we're not a module, the SYSCTL_SETUP_PROTO() will
not have declared a function prototype!


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/net/if_pppoe.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/net/if_pppoe.c
diff -u src/sys/net/if_pppoe.c:1.114 src/sys/net/if_pppoe.c:1.115
--- src/sys/net/if_pppoe.c:1.114	Sun Aug  7 17:38:34 2016
+++ src/sys/net/if_pppoe.c	Mon Aug  8 02:50:05 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: if_pppoe.c,v 1.114 2016/08/07 17:38:34 christos Exp $ */
+/* $NetBSD: if_pppoe.c,v 1.115 2016/08/08 02:50:05 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.114 2016/08/07 17:38:34 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.115 2016/08/08 02:50:05 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "pppoe.h"
@@ -238,7 +238,9 @@ pppoeinit(void)
 
 	pppoe_softintr = softint_establish(SOFTINT_NET, pppoe_softintr_handler,
 	NULL);
+#ifdef _MODULE
 	sysctl_net_pppoe_setup(_sysctl_clog);
+#endif
 }
 
 static int



CVS commit: src/tests/net/if_pppoe

2016-08-07 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Aug  7 23:34:31 UTC 2016

Modified Files:
src/tests/net/if_pppoe: t_pppoe.sh

Log Message:
Add rumpdev library since we're now calling config_cfdriver_attach()

Should fix the newly-introduced test failure.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/net/if_pppoe/t_pppoe.sh

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

Modified files:

Index: src/tests/net/if_pppoe/t_pppoe.sh
diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.1 src/tests/net/if_pppoe/t_pppoe.sh:1.2
--- src/tests/net/if_pppoe/t_pppoe.sh:1.1	Fri Apr 15 01:38:17 2016
+++ src/tests/net/if_pppoe/t_pppoe.sh	Sun Aug  7 23:34:31 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: t_pppoe.sh,v 1.1 2016/04/15 01:38:17 ozaki-r Exp $
+#	$NetBSD: t_pppoe.sh,v 1.2 2016/08/07 23:34:31 pgoyette Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -25,8 +25,9 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
-server="rump_server -lrump -lrumpnet -lrumpnet_net -lrumpnet_netinet \
-		-lrumpnet_netinet6 -lrumpnet_shmif -lrumpnet_pppoe"
+server="rump_server -lrump -lrumpnet -lrumpnet_net -lrumpnet_netinet	\
+		-lrumpnet_netinet6 -lrumpnet_shmif -lrumpdev	\
+		-lrumpnet_pppoe"
 HIJACKING="env LD_PRELOAD=/usr/lib/librumphijack.so"
 
 SERVER=unix://commsock1



CVS commit: src/usr.bin/config

2016-08-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug  7 21:11:55 UTC 2016

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

Log Message:
Bump version for -no


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/usr.bin/config/defs.h

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

Modified files:

Index: src/usr.bin/config/defs.h
diff -u src/usr.bin/config/defs.h:1.96 src/usr.bin/config/defs.h:1.97
--- src/usr.bin/config/defs.h:1.96	Sun Aug  7 06:37:24 2016
+++ src/usr.bin/config/defs.h	Sun Aug  7 17:11:55 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.96 2016/08/07 10:37:24 christos Exp $	*/
+/*	$NetBSD: defs.h,v 1.97 2016/08/07 21:11:55 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -107,7 +107,7 @@ extern const char *progname;
  * The next two lines define the current version of the config(1) binary,
  * and the minimum version of the configuration files it supports.
  */
-#define CONFIG_VERSION		20151112
+#define CONFIG_VERSION		20160808
 #define CONFIG_MINVERSION	0
 
 /*



CVS commit: src/external/bsd/kyua-testers

2016-08-07 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Aug  7 20:23:09 UTC 2016

Modified Files:
src/external/bsd/kyua-testers/libexec/kyua-atf-tester: Makefile
src/external/bsd/kyua-testers/libexec/kyua-plain-tester: Makefile
src/external/bsd/kyua-testers/tests/kyua-testers: Makefile

Log Message:
Fix wrong objdir-finding logic. PR 51389.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/kyua-testers/libexec/kyua-atf-tester/Makefile
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/kyua-testers/libexec/kyua-plain-tester/Makefile
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/kyua-testers/tests/kyua-testers/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/bsd/kyua-testers/libexec/kyua-atf-tester/Makefile
diff -u src/external/bsd/kyua-testers/libexec/kyua-atf-tester/Makefile:1.1 src/external/bsd/kyua-testers/libexec/kyua-atf-tester/Makefile:1.2
--- src/external/bsd/kyua-testers/libexec/kyua-atf-tester/Makefile:1.1	Tue Feb 19 06:04:43 2013
+++ src/external/bsd/kyua-testers/libexec/kyua-atf-tester/Makefile	Sun Aug  7 20:23:09 2016
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2013/02/19 06:04:43 jmmv Exp $
+# $NetBSD: Makefile,v 1.2 2016/08/07 20:23:09 dholland Exp $
 
 .include 
 
@@ -11,11 +11,12 @@ SRCS=		atf_main.c
 MAN=		kyua-atf-tester.1
 MAN+=		kyua-atf-interface.7
 
-PRIVATELIBDIR!=	cd ${.CURDIR}/../../lib; ${PRINTOBJDIR}
-LDADD+=		${PRIVATELIBDIR}/libatf_tester/libatf_tester.a
-DPADD+=		${PRIVATELIBDIR}/libatf_tester/libatf_tester.a
-LDADD+=		${PRIVATELIBDIR}/libtester/libtester.a
-DPADD+=		${PRIVATELIBDIR}/libtester/libtester.a
+ATFTESTER_LIBDIR!=	cd ${.CURDIR}/../../lib/libatf_tester; ${PRINTOBJDIR}
+TESTER_LIBDIR!=		cd ${.CURDIR}/../../lib/libtester; ${PRINTOBJDIR}
+LDADD+=		${ATFTESTER_LIBDIR}/libatf_tester.a
+DPADD+=		${ATFTESTER_LIBDIR}/libatf_tester.a
+LDADD+=		${TESTER_LIBDIR}/libtester/libtester.a
+DPADD+=		${TESTER_LIBDIR}/libtester/libtester.a
 
 CPPFLAGS+=	-DHAVE_CONFIG_H
 CPPFLAGS+=	-I${.CURDIR}/../../lib/libtester

Index: src/external/bsd/kyua-testers/libexec/kyua-plain-tester/Makefile
diff -u src/external/bsd/kyua-testers/libexec/kyua-plain-tester/Makefile:1.1 src/external/bsd/kyua-testers/libexec/kyua-plain-tester/Makefile:1.2
--- src/external/bsd/kyua-testers/libexec/kyua-plain-tester/Makefile:1.1	Tue Feb 19 06:04:43 2013
+++ src/external/bsd/kyua-testers/libexec/kyua-plain-tester/Makefile	Sun Aug  7 20:23:09 2016
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2013/02/19 06:04:43 jmmv Exp $
+# $NetBSD: Makefile,v 1.2 2016/08/07 20:23:09 dholland Exp $
 
 .include 
 
@@ -11,9 +11,9 @@ SRCS=		plain_main.c
 MAN=		kyua-plain-tester.1
 MAN+=		kyua-plain-interface.7
 
-PRIVATELIBDIR!=	cd ${.CURDIR}/../../lib; ${PRINTOBJDIR}
-LDADD+=		${PRIVATELIBDIR}/libtester/libtester.a
-DPADD+=		${PRIVATELIBDIR}/libtester/libtester.a
+TESTER_LIBDIR!=		cd ${.CURDIR}/../../lib/libtester; ${PRINTOBJDIR}
+LDADD+=		${TESTER_LIBDIR}/libtester/libtester.a
+DPADD+=		${TESTER_LIBDIR}/libtester/libtester.a
 
 CPPFLAGS+=	-DHAVE_CONFIG_H
 CPPFLAGS+=	-I${.CURDIR}/../../lib/libtester

Index: src/external/bsd/kyua-testers/tests/kyua-testers/Makefile
diff -u src/external/bsd/kyua-testers/tests/kyua-testers/Makefile:1.1 src/external/bsd/kyua-testers/tests/kyua-testers/Makefile:1.2
--- src/external/bsd/kyua-testers/tests/kyua-testers/Makefile:1.1	Tue Feb 19 06:04:44 2013
+++ src/external/bsd/kyua-testers/tests/kyua-testers/Makefile	Sun Aug  7 20:23:09 2016
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2013/02/19 06:04:44 jmmv Exp $
+# $NetBSD: Makefile,v 1.2 2016/08/07 20:23:09 dholland Exp $
 
 .include 
 
@@ -12,11 +12,12 @@ CPPFLAGS+=	-DTESTERSDIR=\"/usr/libexec\"
 CPPFLAGS+=	-I${.CURDIR}/../../lib/libtester
 CPPFLAGS+=	-I${SRCDIR}
 
-PRIVATELIBDIR!=	cd ${.CURDIR}/../../lib; ${PRINTOBJDIR}
-.for lib in atf_tester tester
-LDADD+=		${PRIVATELIBDIR}/lib${lib}/lib${lib}.a
-DPADD+=		${PRIVATELIBDIR}/lib${lib}/lib${lib}.a
-.endfor
+ATFTESTER_LIBDIR!=	cd ${.CURDIR}/../../lib/libatf_tester; ${PRINTOBJDIR}
+TESTER_LIBDIR!=		cd ${.CURDIR}/../../lib/libtester; ${PRINTOBJDIR}
+LDADD+=		${ATFTESTER_LIBDIR}/libatf_tester.a
+DPADD+=		${ATFTESTER_LIBDIR}/libatf_tester.a
+LDADD+=		${TESTER_LIBDIR}/libtester/libtester.a
+DPADD+=		${TESTER_LIBDIR}/libtester/libtester.a
 
 TESTS_C=	atf_list_test
 TESTS_C+=	atf_result_test



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

2016-08-07 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sun Aug  7 19:35:43 UTC 2016

Modified Files:
src/sys/arch/sparc64/sparc64: copy.S

Log Message:
Make comment more readable - no functional changes


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sparc64/sparc64/copy.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/copy.S
diff -u src/sys/arch/sparc64/sparc64/copy.S:1.6 src/sys/arch/sparc64/sparc64/copy.S:1.7
--- src/sys/arch/sparc64/sparc64/copy.S:1.6	Sun Nov 22 10:18:14 2015
+++ src/sys/arch/sparc64/sparc64/copy.S	Sun Aug  7 19:35:43 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: copy.S,v 1.6 2015/11/22 10:18:14 martin Exp $	*/
+/*	$NetBSD: copy.S,v 1.7 2016/08/07 19:35:43 palle Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -432,7 +432,7 @@ Lcopyout_start:
 	 .empty
 0:
 	inc	%o0
-	ldsb	[%o0 - 1], %o4!	(++dst)[-1] = *src++;
+	ldsb	[%o0 - 1], %o4	! (++dst)[-1] = *src++;
 	stba	%o4, [%o1] %asi
 	deccc	%o2
 	bge	0b



CVS commit: src/sys/rump/net/lib/libnetmpls

2016-08-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug  7 17:42:18 UTC 2016

Modified Files:
src/sys/rump/net/lib/libnetmpls: NETMPLS.ioconf netmpls_component.c

Log Message:
finish ifmpls->mpls renaming.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libnetmpls/NETMPLS.ioconf
cvs rdiff -u -r1.4 -r1.5 src/sys/rump/net/lib/libnetmpls/netmpls_component.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/net/lib/libnetmpls/NETMPLS.ioconf
diff -u src/sys/rump/net/lib/libnetmpls/NETMPLS.ioconf:1.1 src/sys/rump/net/lib/libnetmpls/NETMPLS.ioconf:1.2
--- src/sys/rump/net/lib/libnetmpls/NETMPLS.ioconf:1.1	Thu Aug 20 08:20:09 2015
+++ src/sys/rump/net/lib/libnetmpls/NETMPLS.ioconf	Sun Aug  7 13:42:18 2016
@@ -1,7 +1,7 @@
-#	$NetBSD: NETMPLS.ioconf,v 1.1 2015/08/20 12:20:09 christos Exp $
+#	$NetBSD: NETMPLS.ioconf,v 1.2 2016/08/07 17:42:18 christos Exp $
 
 ioconf		netmpls
 
 include		"conf/files"
 
-pseudo-device   ifmpls
+pseudo-device   mpls

Index: src/sys/rump/net/lib/libnetmpls/netmpls_component.c
diff -u src/sys/rump/net/lib/libnetmpls/netmpls_component.c:1.4 src/sys/rump/net/lib/libnetmpls/netmpls_component.c:1.5
--- src/sys/rump/net/lib/libnetmpls/netmpls_component.c:1.4	Tue Jan 26 18:12:19 2016
+++ src/sys/rump/net/lib/libnetmpls/netmpls_component.c	Sun Aug  7 13:42:18 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: netmpls_component.c,v 1.4 2016/01/26 23:12:19 pooka Exp $ */
+/* $NetBSD: netmpls_component.c,v 1.5 2016/08/07 17:42:18 christos Exp $ */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netmpls_component.c,v 1.4 2016/01/26 23:12:19 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netmpls_component.c,v 1.5 2016/08/07 17:42:18 christos Exp $");
 
 #include 
 #include 
@@ -60,5 +60,5 @@ RUMP_COMPONENT(RUMP_COMPONENT_NET)
 RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)
 {
 
-	ifmplsattach(0);
+	mplsattach(0);
 }



CVS commit: src/sys/net

2016-08-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug  7 17:38:34 UTC 2016

Modified Files:
src/sys/net: if_faith.c if_gif.c if_gre.c if_loop.c if_mpls.c if_ppp.c
if_pppoe.c if_sl.c if_srt.c if_stf.c if_strip.c if_tap.c if_tun.c
if_vlan.c
src/sys/net/agr: if_agr.c
Added Files:
src/sys/net: if_module.h

Log Message:
modularize some more drivers and merge the module glue


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/net/if_faith.c
cvs rdiff -u -r1.119 -r1.120 src/sys/net/if_gif.c
cvs rdiff -u -r1.169 -r1.170 src/sys/net/if_gre.c
cvs rdiff -u -r1.89 -r1.90 src/sys/net/if_loop.c
cvs rdiff -u -r0 -r1.1 src/sys/net/if_module.h
cvs rdiff -u -r1.26 -r1.27 src/sys/net/if_mpls.c
cvs rdiff -u -r1.156 -r1.157 src/sys/net/if_ppp.c
cvs rdiff -u -r1.113 -r1.114 src/sys/net/if_pppoe.c
cvs rdiff -u -r1.125 -r1.126 src/sys/net/if_sl.c
cvs rdiff -u -r1.22 -r1.23 src/sys/net/if_srt.c
cvs rdiff -u -r1.97 -r1.98 src/sys/net/if_stf.c
cvs rdiff -u -r1.105 -r1.106 src/sys/net/if_strip.c
cvs rdiff -u -r1.84 -r1.85 src/sys/net/if_tap.c
cvs rdiff -u -r1.127 -r1.128 src/sys/net/if_tun.c
cvs rdiff -u -r1.90 -r1.91 src/sys/net/if_vlan.c
cvs rdiff -u -r1.38 -r1.39 src/sys/net/agr/if_agr.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/net/if_faith.c
diff -u src/sys/net/if_faith.c:1.53 src/sys/net/if_faith.c:1.54
--- src/sys/net/if_faith.c:1.53	Fri Jun 10 09:27:16 2016
+++ src/sys/net/if_faith.c	Sun Aug  7 13:38:33 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_faith.c,v 1.53 2016/06/10 13:27:16 ozaki-r Exp $	*/
+/*	$NetBSD: if_faith.c,v 1.54 2016/08/07 17:38:33 christos Exp $	*/
 /*	$KAME: if_faith.c,v 1.21 2001/02/20 07:59:26 itojun Exp $	*/
 
 /*
@@ -40,9 +40,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_faith.c,v 1.53 2016/06/10 13:27:16 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_faith.c,v 1.54 2016/08/07 17:38:33 christos Exp $");
 
+#ifdef _KERNEL_OPT
 #include "opt_inet.h"
+#endif
 
 #include 
 #include 
@@ -53,6 +55,9 @@ __KERNEL_RCSID(0, "$NetBSD: if_faith.c,v
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 
@@ -98,15 +103,40 @@ static struct if_clone faith_cloner =
 
 #define	FAITHMTU	1500
 
+static u_int faith_count;
+
 /* ARGSUSED */
 void
 faithattach(int count)
 {
 
+	/*
+	 * Nothing to do here, initialization is handled by the
+	 * module initialization code in faithinit() below).
+	 */
+}
+
+static void
+faithinit(void)
+{
 	if_clone_attach(_cloner);
 }
 
 static int
+faithdetach(void)
+{
+	int error = 0;
+
+	if (faith_count != 0)
+		error = EBUSY;
+
+	if (error == 0)
+		if_clone_detach(_cloner);
+
+	return error;
+}
+
+static int
 faith_clone_create(struct if_clone *ifc, int unit)
 {
 	struct ifnet *ifp;
@@ -127,6 +157,7 @@ faith_clone_create(struct if_clone *ifc,
 	if_attach(ifp);
 	if_alloc_sadl(ifp);
 	bpf_attach(ifp, DLT_NULL, sizeof(u_int));
+	atomic_inc_uint(_count);
 	return (0);
 }
 
@@ -138,6 +169,7 @@ faith_clone_destroy(struct ifnet *ifp)
 	if_detach(ifp);
 	if_free(ifp);
 
+	atomic_dec_uint(_count);
 	return (0);
 }
 
@@ -294,3 +326,10 @@ faithprefix(struct in6_addr *in6)
 	return ret;
 }
 #endif
+
+/*
+ * Module infrastructure
+ */
+#include "if_module.h"
+
+IF_MODULE(MODULE_CLASS_DRIVER, faith, "")

Index: src/sys/net/if_gif.c
diff -u src/sys/net/if_gif.c:1.119 src/sys/net/if_gif.c:1.120
--- src/sys/net/if_gif.c:1.119	Mon Jul  4 00:43:46 2016
+++ src/sys/net/if_gif.c	Sun Aug  7 13:38:33 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gif.c,v 1.119 2016/07/04 04:43:46 knakahara Exp $	*/
+/*	$NetBSD: if_gif.c,v 1.120 2016/08/07 17:38:33 christos Exp $	*/
 /*	$KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.119 2016/07/04 04:43:46 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.120 2016/08/07 17:38:33 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -55,6 +55,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -106,8 +108,6 @@ static int	gif_set_tunnel(struct ifnet *
 			   struct sockaddr *);
 static void	gif_delete_tunnel(struct ifnet *);
 
-static void	gif_sysctl_setup(struct sysctllog **);
-
 static int	gif_clone_create(struct if_clone *, int);
 static int	gif_clone_destroy(struct ifnet *);
 static int	gif_check_nesting(struct ifnet *, struct mbuf *);
@@ -132,12 +132,15 @@ static struct if_clone gif_cloner =
 #endif
 static int max_gif_nesting = MAX_GIF_NEST;
 
+static struct sysctllog *gif_sysctl;
+
 static void
-gif_sysctl_setup(struct sysctllog **clog)
+gif_sysctl_setup(void)
 {
+	gif_sysctl = NULL;
 
 #ifdef INET
-	sysctl_createv(clog, 0, NULL, NULL,
+	sysctl_createv(_sysctl, 0, NULL, NULL,
 		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
 		   CTLTYPE_INT, "gifttl",
 		   

CVS commit: src/sys/modules/if_srt

2016-08-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug  7 17:33:04 UTC 2016

Added Files:
src/sys/modules/if_srt: srt.ioconf

Log Message:
missed this one


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/modules/if_srt/srt.ioconf

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

Added files:

Index: src/sys/modules/if_srt/srt.ioconf
diff -u /dev/null src/sys/modules/if_srt/srt.ioconf:1.1
--- /dev/null	Sun Aug  7 13:33:04 2016
+++ src/sys/modules/if_srt/srt.ioconf	Sun Aug  7 13:33:04 2016
@@ -0,0 +1,7 @@
+#	$NetBSD: srt.ioconf,v 1.1 2016/08/07 17:33:04 christos Exp $
+
+ioconf		srt
+
+include		"conf/files"
+
+pseudo-device   srt



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

2016-08-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug  7 14:28:55 UTC 2016

Modified Files:
src/sys/arch/amd64/conf: MODULAR

Log Message:
Add some more drivers


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amd64/conf/MODULAR

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

Modified files:

Index: src/sys/arch/amd64/conf/MODULAR
diff -u src/sys/arch/amd64/conf/MODULAR:1.3 src/sys/arch/amd64/conf/MODULAR:1.4
--- src/sys/arch/amd64/conf/MODULAR:1.3	Sun Aug  7 07:33:38 2016
+++ src/sys/arch/amd64/conf/MODULAR	Sun Aug  7 10:28:55 2016
@@ -1,4 +1,4 @@
-# $NetBSD: MODULAR,v 1.3 2016/08/07 11:33:38 christos Exp $
+# $NetBSD: MODULAR,v 1.4 2016/08/07 14:28:55 christos Exp $
 #
 # Try to exclude all the drivers in GENERIC that have been modularized
 # XXX: incomplete
@@ -74,12 +74,16 @@ options 	MODULAR_DEFAULT_AUTOLOAD
 -no options	NFSSERVER
 
 -no axe*	at uhub?
+-no axen*	at uhub?
 -no rum*	at uhub?
 -no urtwn*	at uhub?
 -no urtw*	at uhub?
 -no run*	at uhub?
 -no athn*	at uhub?
 
+-no alc*	at pci?
+-no ath*	at pci?
+
 -no pseudo-device 	crypto			# /dev/crypto device
 -no pseudo-device	swcrypto		# software crypto implementation
 



CVS commit: src/sys/modules

2016-08-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug  7 14:27:39 UTC 2016

Modified Files:
src/sys/modules: Makefile
Added Files:
src/sys/modules/if_agr: Makefile agr.ioconf
src/sys/modules/if_faith: Makefile faith.ioconf
src/sys/modules/if_gif: Makefile gif.ioconf
src/sys/modules/if_gre: Makefile gre.ioconf
src/sys/modules/if_loop: Makefile loop.ioconf
src/sys/modules/if_mpls: Makefile mpls.ioconf
src/sys/modules/if_srt: Makefile
src/sys/modules/if_stf: Makefile stf.ioconf
src/sys/modules/if_tun: Makefile tun.ioconf
src/sys/modules/if_vlan: Makefile vlan.ioconf

Log Message:
add new modules


To generate a diff of this commit:
cvs rdiff -u -r1.174 -r1.175 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/if_agr/Makefile \
src/sys/modules/if_agr/agr.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/if_faith/Makefile \
src/sys/modules/if_faith/faith.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/if_gif/Makefile \
src/sys/modules/if_gif/gif.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/if_gre/Makefile \
src/sys/modules/if_gre/gre.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/if_loop/Makefile \
src/sys/modules/if_loop/loop.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/if_mpls/Makefile \
src/sys/modules/if_mpls/mpls.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/if_srt/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/if_stf/Makefile \
src/sys/modules/if_stf/stf.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/if_tun/Makefile \
src/sys/modules/if_tun/tun.ioconf
cvs rdiff -u -r0 -r1.1 src/sys/modules/if_vlan/Makefile \
src/sys/modules/if_vlan/vlan.ioconf

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

Modified files:

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.174 src/sys/modules/Makefile:1.175
--- src/sys/modules/Makefile:1.174	Sat Aug  6 19:46:30 2016
+++ src/sys/modules/Makefile	Sun Aug  7 10:27:38 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.174 2016/08/06 23:46:30 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.175 2016/08/07 14:27:38 christos Exp $
 
 .include 
 
@@ -45,14 +45,24 @@ SUBDIR+=	hfs
 SUBDIR+=	hythygtemp
 SUBDIR+=	i2cexec
 SUBDIR+=	i2c_bitbang
+SUBDIR+=	if_agr
 SUBDIR+=	if_axe
 SUBDIR+=	if_axen
+SUBDIR+=	if_faith
+SUBDIR+=	if_gif
+SUBDIR+=	if_gre
+SUBDIR+=	if_loop
+SUBDIR+=	if_mpls
 SUBDIR+=	if_npflog
 SUBDIR+=	if_ppp
 SUBDIR+=	if_pppoe
 SUBDIR+=	if_sl
 SUBDIR+=	if_smsc
+SUBDIR+=	if_srt
+SUBDIR+=	if_stf
 SUBDIR+=	if_strip
+SUBDIR+=	if_tun
+SUBDIR+=	if_vlan
 SUBDIR+=	iic
 SUBDIR+=	ipl
 SUBDIR+=	kernfs

Added files:

Index: src/sys/modules/if_agr/Makefile
diff -u /dev/null src/sys/modules/if_agr/Makefile:1.1
--- /dev/null	Sun Aug  7 10:27:39 2016
+++ src/sys/modules/if_agr/Makefile	Sun Aug  7 10:27:38 2016
@@ -0,0 +1,30 @@
+# $NetBSD: Makefile,v 1.1 2016/08/07 14:27:38 christos Exp $
+
+.include "../Makefile.inc"
+
+.PATH:  ${S}/net/agr
+
+KMOD=		if_agr
+IOCONF=		agr.ioconf
+SRCS= \
+ieee8023_tlv.c \
+ieee8023ad_lacp.c \
+ieee8023ad_lacp_debug.c \
+ieee8023ad_lacp_select.c \
+ieee8023ad_lacp_sm_mux.c \
+ieee8023ad_lacp_sm_ptx.c \
+ieee8023ad_lacp_sm_rx.c \
+ieee8023ad_lacp_sm_tx.c \
+ieee8023ad_lacp_timer.c \
+ieee8023ad_marker.c \
+if_agr.c \
+if_agrether.c \
+if_agrether_hash.c \
+if_agrmonitor.c \
+if_agrsoftc.c \
+if_agrsubr.c \
+if_agrtimer.c 
+
+CPPFLAGS+=	-DINET
+
+.include 
Index: src/sys/modules/if_agr/agr.ioconf
diff -u /dev/null src/sys/modules/if_agr/agr.ioconf:1.1
--- /dev/null	Sun Aug  7 10:27:39 2016
+++ src/sys/modules/if_agr/agr.ioconf	Sun Aug  7 10:27:38 2016
@@ -0,0 +1,7 @@
+#	$NetBSD: agr.ioconf,v 1.1 2016/08/07 14:27:38 christos Exp $
+
+ioconf		agr
+
+include		"conf/files"
+
+pseudo-device   agr

Index: src/sys/modules/if_faith/Makefile
diff -u /dev/null src/sys/modules/if_faith/Makefile:1.1
--- /dev/null	Sun Aug  7 10:27:39 2016
+++ src/sys/modules/if_faith/Makefile	Sun Aug  7 10:27:38 2016
@@ -0,0 +1,14 @@
+# $NetBSD: Makefile,v 1.1 2016/08/07 14:27:38 christos Exp $
+
+.include "../Makefile.inc"
+
+.PATH:  ${S}/net
+
+KMOD=		if_faith
+IOCONF=		faith.ioconf
+SRCS=		if_faith.c
+
+CPPFLAGS+=	-DINET
+CPPFLAGS+=	-DINET6
+
+.include 
Index: src/sys/modules/if_faith/faith.ioconf
diff -u /dev/null src/sys/modules/if_faith/faith.ioconf:1.1
--- /dev/null	Sun Aug  7 10:27:39 2016
+++ src/sys/modules/if_faith/faith.ioconf	Sun Aug  7 10:27:38 2016
@@ -0,0 +1,7 @@
+#	$NetBSD: faith.ioconf,v 1.1 2016/08/07 14:27:38 christos Exp $
+
+ioconf		faith
+
+include		"conf/files"
+
+pseudo-device   faith

Index: src/sys/modules/if_gif/Makefile
diff -u /dev/null src/sys/modules/if_gif/Makefile:1.1
--- /dev/null	Sun Aug  7 10:27:39 2016
+++ src/sys/modules/if_gif/Makefile	Sun Aug  7 10:27:38 2016
@@ -0,0 +1,14 @@
+# $NetBSD: Makefile,v 1.1 2016/08/07 14:27:38 christos Exp $
+
+.include "../Makefile.inc"
+
+.PATH:  ${S}/net
+
+KMOD=		if_gif
+IOCONF=		gif.ioconf
+SRCS=		

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

2016-08-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug  7 14:28:12 UTC 2016

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

Log Message:
Sets for new modules


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/distrib/sets/lists/modules/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/modules/mi
diff -u src/distrib/sets/lists/modules/mi:1.92 src/distrib/sets/lists/modules/mi:1.93
--- src/distrib/sets/lists/modules/mi:1.92	Sat Aug  6 19:46:30 2016
+++ src/distrib/sets/lists/modules/mi	Sun Aug  7 10:28:11 2016
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.92 2016/08/06 23:46:30 pgoyette Exp $
+# $NetBSD: mi,v 1.93 2016/08/07 14:28:11 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -44,10 +44,10 @@
 ./@MODULEDIR@/coda5/coda5.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/compatbase-kernel-modules	kmod
 ./@MODULEDIR@/compat/compat.kmod		base-kernel-modules	kmod
-./@MODULEDIR@/compat_sysv			base-obsolete		obsolete
-./@MODULEDIR@/compat_sysv/compat_sysv.kmod	base-obsolete		obsolete
 ./@MODULEDIR@/compat_ossaudio			base-kernel-modules	kmod
 ./@MODULEDIR@/compat_ossaudio/compat_ossaudio.kmod	base-kernel-modules	kmod
+./@MODULEDIR@/compat_sysv			base-obsolete		obsolete
+./@MODULEDIR@/compat_sysv/compat_sysv.kmod	base-obsolete		obsolete
 ./@MODULEDIR@/coredumpbase-kernel-modules	kmod
 ./@MODULEDIR@/coredump/coredump.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/cryptobase-kernel-modules	kmod
@@ -116,14 +116,26 @@
 ./@MODULEDIR@/hfs/hfs.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/hythygtemp			base-kernel-modules	kmod
 ./@MODULEDIR@/hythygtemp/hythygtemp.kmod	base-kernel-modules	kmod
-./@MODULEDIR@/i2cexecbase-kernel-modules	kmod
-./@MODULEDIR@/i2cexec/i2cexec.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/i2c_bitbang			base-kernel-modules	kmod
 ./@MODULEDIR@/i2c_bitbang/i2c_bitbang.kmod	base-kernel-modules	kmod
+./@MODULEDIR@/i2cexecbase-kernel-modules	kmod
+./@MODULEDIR@/i2cexec/i2cexec.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/if_agrbase-kernel-modules	kmod
+./@MODULEDIR@/if_agr/if_agr.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/if_axebase-kernel-modules	kmod
 ./@MODULEDIR@/if_axe/if_axe.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/if_axenbase-kernel-modules	kmod
 ./@MODULEDIR@/if_axen/if_axen.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/if_faithbase-kernel-modules	kmod
+./@MODULEDIR@/if_faith/if_faith.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/if_gifbase-kernel-modules	kmod
+./@MODULEDIR@/if_gif/if_gif.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/if_grebase-kernel-modules	kmod
+./@MODULEDIR@/if_gre/if_gre.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/if_loopbase-kernel-modules	kmod
+./@MODULEDIR@/if_loop/if_loop.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/if_mplsbase-kernel-modules	kmod
+./@MODULEDIR@/if_mpls/if_mpls.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/if_npflogbase-kernel-modules	kmod
 ./@MODULEDIR@/if_npflog/if_npflog.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/if_pppbase-kernel-modules	kmod
@@ -134,8 +146,16 @@
 ./@MODULEDIR@/if_sl/if_sl.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/if_smscbase-kernel-modules	kmod
 ./@MODULEDIR@/if_smsc/if_smsc.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/if_srtbase-kernel-modules	kmod
+./@MODULEDIR@/if_srt/if_srt.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/if_stfbase-kernel-modules	kmod
+./@MODULEDIR@/if_stf/if_stf.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/if_stripbase-kernel-modules	kmod
 ./@MODULEDIR@/if_strip/if_strip.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/if_tunbase-kernel-modules	kmod
+./@MODULEDIR@/if_tun/if_tun.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/if_vlanbase-kernel-modules	kmod
+./@MODULEDIR@/if_vlan/if_vlan.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/iicbase-kernel-modules	kmod
 ./@MODULEDIR@/iic/iic.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/iplbase-kernel-modules	kmod
@@ -266,10 +286,10 @@
 ./@MODULEDIR@/sysmon_taskq/sysmon_taskq.kmod	base-kernel-modules	kmod
 ./@MODULEDIR@/sysmon_wdog			base-kernel-modules	kmod
 ./@MODULEDIR@/sysmon_wdog/sysmon_wdog.kmod	base-kernel-modules	kmod
-./@MODULEDIR@/sysvbfsbase-kernel-modules	kmod
-./@MODULEDIR@/sysvbfs/sysvbfs.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/sysv_ipcbase-kernel-modules	kmod
 ./@MODULEDIR@/sysv_ipc/sysv_ipc.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/sysvbfsbase-kernel-modules	kmod
+./@MODULEDIR@/sysvbfs/sysvbfs.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/tmpfsbase-kernel-modules	kmod
 ./@MODULEDIR@/tmpfs/tmpfs.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/tprofbase-kernel-modules	kmod



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

2016-08-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug  7 11:33:38 UTC 2016

Modified Files:
src/sys/arch/amd64/conf: MODULAR

Log Message:
don't load loopback as a module as other parts of the code use it directly.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/amd64/conf/MODULAR

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

Modified files:

Index: src/sys/arch/amd64/conf/MODULAR
diff -u src/sys/arch/amd64/conf/MODULAR:1.2 src/sys/arch/amd64/conf/MODULAR:1.3
--- src/sys/arch/amd64/conf/MODULAR:1.2	Sun Aug  7 06:39:59 2016
+++ src/sys/arch/amd64/conf/MODULAR	Sun Aug  7 07:33:38 2016
@@ -1,4 +1,4 @@
-# $NetBSD: MODULAR,v 1.2 2016/08/07 10:39:59 christos Exp $
+# $NetBSD: MODULAR,v 1.3 2016/08/07 11:33:38 christos Exp $
 #
 # Try to exclude all the drivers in GENERIC that have been modularized
 # XXX: incomplete
@@ -95,7 +95,8 @@ options 	MODULAR_DEFAULT_AUTOLOAD
 # network pseudo-devices
 -no pseudo-device	bpfilter		# Berkeley packet filter
 -no pseudo-device	ipfilter		# IP filter (firewall) and NAT
--no pseudo-device	loop			# network loopback
+# Loopback is hardcoded (looutput) everywhere!
+#no pseudo-device	loop			# network loopback
 -no pseudo-device	mpls			# MPLS pseudo-interface
 -no pseudo-device	ppp			# Point-to-Point Protocol
 -no pseudo-device	pppoe			# PPP over Ethernet (RFC 2516)



CVS commit: src/sys/arch/evbmips/malta/dev

2016-08-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug  7 10:45:20 UTC 2016

Modified Files:
src/sys/arch/evbmips/malta/dev: mainbus.c

Log Message:
Fix compile for PCI_NETBSD_CONFIGURE


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbmips/malta/dev/mainbus.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/evbmips/malta/dev/mainbus.c
diff -u src/sys/arch/evbmips/malta/dev/mainbus.c:1.12 src/sys/arch/evbmips/malta/dev/mainbus.c:1.13
--- src/sys/arch/evbmips/malta/dev/mainbus.c:1.12	Mon Jun  6 17:13:05 2011
+++ src/sys/arch/evbmips/malta/dev/mainbus.c	Sun Aug  7 10:45:19 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.12 2011/06/06 17:13:05 matt Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.13 2016/08/07 10:45:19 skrll Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.12 2011/06/06 17:13:05 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.13 2016/08/07 10:45:19 skrll Exp $");
 
 #include "opt_pci.h"
 
@@ -108,12 +108,11 @@ mainbus_attach(device_t parent, device_t
 {
 	struct mainbus_attach_args ma;
 	const struct mainbusdev *md;
-#if defined(PCI_NETBSD_CONFIGURE)
-	struct extent *ioext, *memext;
-#endif
-#if defined(PCI_NETBSD_ENABLE_IDE)
+#if defined(PCI_NETBSD_ENABLE_IDE) || defined(PCI_NETBSD_CONFIGURE)
 	struct malta_config *mcp = _configuration;
 	pci_chipset_tag_t pc = >mc_pc;
+#endif
+#if defined(PCI_NETBSD_ENABLE_IDE)
 	pcitag_t idetag;
 	pcireg_t idetim;
 #endif
@@ -122,13 +121,15 @@ mainbus_attach(device_t parent, device_t
 	printf("\n");
 
 #if defined(PCI_NETBSD_CONFIGURE)
-	ioext = extent_create("pciio",  0x1000, 0xefff,
-	M_DEVBUF, NULL, 0, EX_NOWAIT);
-	memext = extent_create("pcimem", MALTA_PCIMEM1_BASE,
+	struct mips_cache_info * const mci = _cache_info;
+
+	struct extent *ioext = extent_create("pciio", 0x1000, 0xefff,
+	NULL, 0, EX_NOWAIT);
+	struct extent *memext = extent_create("pcimem", MALTA_PCIMEM1_BASE,
 	MALTA_PCIMEM1_BASE + MALTA_PCIMEM1_SIZE,
-	M_DEVBUF, NULL, 0, EX_NOWAIT);
+	NULL, 0, EX_NOWAIT);
 
-	pci_configure_bus(pc, ioext, memext, NULL, 0, mips_dcache_align);
+	pci_configure_bus(pc, ioext, memext, NULL, 0, mci->mci_dcache_align);
 	extent_destroy(ioext);
 	extent_destroy(memext);
 #endif /* PCI_NETBSD_CONFIGURE */



CVS commit: src/sys

2016-08-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug  7 10:44:05 UTC 2016

Modified Files:
src/sys/arch/amd64/conf: ALL GENERIC
src/sys/arch/evbarm/conf: ARMADILLO-IOT-G3 CUBOX-I NITROGEN6X
src/sys/arch/i386/conf: ALL GENERIC
src/sys/arch/riscv/conf: GENERIC
src/sys/conf: files

Log Message:
rename ifmpls to mpls, so we don't have if_ifmpls...


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.436 -r1.437 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/conf/ARMADILLO-IOT-G3
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/CUBOX-I
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/conf/NITROGEN6X
cvs rdiff -u -r1.400 -r1.401 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.1138 -r1.1139 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/conf/GENERIC
cvs rdiff -u -r1.1160 -r1.1161 src/sys/conf/files

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

Modified files:

Index: src/sys/arch/amd64/conf/ALL
diff -u src/sys/arch/amd64/conf/ALL:1.37 src/sys/arch/amd64/conf/ALL:1.38
--- src/sys/arch/amd64/conf/ALL:1.37	Wed Jul 27 03:04:57 2016
+++ src/sys/arch/amd64/conf/ALL	Sun Aug  7 06:44:05 2016
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.37 2016/07/27 07:04:57 msaitoh Exp $
+# $NetBSD: ALL,v 1.38 2016/08/07 10:44:05 christos Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"ALL-$Revision: 1.37 $"
+#ident 		"ALL-$Revision: 1.38 $"
 
 maxusers	64		# estimated number of users
 
@@ -219,7 +219,7 @@ options 	INET		# IP + ICMP + TCP + UDP
 options 	INET6		# IPv6
 options 	IPSEC		# IP security
 #options 	IPSEC_DEBUG	# debug for IP security
-options 	MPLS		# MultiProtocol Label Switching (needs ifmpls)
+options 	MPLS		# MultiProtocol Label Switching (needs mpls)
 options 	MROUTING	# IP multicast routing
 options 	PIM		# Protocol Independent Multicast
 options 	NETATALK	# AppleTalk networking protocols
@@ -1551,7 +1551,7 @@ pseudo-device 	dm			# device-mapper disk
 pseudo-device	bpfilter		# Berkeley packet filter
 pseudo-device	carp			# Common Address Redundancy Protocol
 pseudo-device	ipfilter		# IP filter (firewall) and NAT
-pseudo-device	ifmpls			# MPLS pseudo-interface
+pseudo-device	mpls			# MPLS pseudo-interface
 pseudo-device	loop			# network loopback
 pseudo-device	ppp			# Point-to-Point Protocol
 pseudo-device	pppoe			# PPP over Ethernet (RFC 2516)

Index: src/sys/arch/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.436 src/sys/arch/amd64/conf/GENERIC:1.437
--- src/sys/arch/amd64/conf/GENERIC:1.436	Wed Jul 27 03:04:57 2016
+++ src/sys/arch/amd64/conf/GENERIC	Sun Aug  7 06:44:05 2016
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.436 2016/07/27 07:04:57 msaitoh Exp $
+# $NetBSD: GENERIC,v 1.437 2016/08/07 10:44:05 christos Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.436 $"
+#ident 		"GENERIC-$Revision: 1.437 $"
 
 maxusers	64		# estimated number of users
 
@@ -190,7 +190,7 @@ options 	INET		# IP + ICMP + TCP + UDP
 options 	INET6		# IPV6
 options 	IPSEC		# IP security
 #options 	IPSEC_DEBUG	# debug for IP security
-#options 	MPLS		# MultiProtocol Label Switching (needs ifmpls)
+#options 	MPLS		# MultiProtocol Label Switching (needs mpls)
 #options 	MROUTING	# IP multicast routing
 #options 	PIM		# Protocol Independent Multicast
 options 	NETATALK	# AppleTalk networking protocols
@@ -1255,7 +1255,7 @@ pseudo-device	bpfilter		# Berkeley packe
 #pseudo-device	carp			# Common Address Redundancy Protocol
 pseudo-device	ipfilter		# IP filter (firewall) and NAT
 pseudo-device	loop			# network loopback
-#pseudo-device	ifmpls			# MPLS pseudo-interface
+#pseudo-device	mpls			# MPLS pseudo-interface
 pseudo-device	ppp			# Point-to-Point Protocol
 pseudo-device	pppoe			# PPP over Ethernet (RFC 2516)
 pseudo-device	sl			# Serial Line IP

Index: src/sys/arch/evbarm/conf/ARMADILLO-IOT-G3
diff -u src/sys/arch/evbarm/conf/ARMADILLO-IOT-G3:1.1 src/sys/arch/evbarm/conf/ARMADILLO-IOT-G3:1.2
--- src/sys/arch/evbarm/conf/ARMADILLO-IOT-G3:1.1	Tue May 17 02:44:46 2016
+++ src/sys/arch/evbarm/conf/ARMADILLO-IOT-G3	Sun Aug  7 06:44:05 2016
@@ -1,4 +1,4 @@
-# $NetBSD: ARMADILLO-IOT-G3,v 1.1 2016/05/17 06:44:46 ryo Exp $
+# $NetBSD: ARMADILLO-IOT-G3,v 1.2 2016/08/07 10:44:05 christos Exp $
 #
 # ARMADILLO-IOT-G3 -- Atmark Techno, Armadillo-IoT G3
 #
@@ -148,7 +148,7 @@ options 	INET		# IP + ICMP + TCP + UDP
 options 	INET6		# IPv6
 options 	IPSEC		# IP security
 #options 	IPSEC_DEBUG	# debug for IP security
-#options 	MPLS		# MultiProtocol Label Switching (needs ifmpls)
+#options 	

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

2016-08-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug  7 10:39:59 UTC 2016

Modified Files:
src/sys/arch/amd64/conf: MODULAR

Log Message:
Use "-no" and add more cloners.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/amd64/conf/MODULAR

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

Modified files:

Index: src/sys/arch/amd64/conf/MODULAR
diff -u src/sys/arch/amd64/conf/MODULAR:1.1 src/sys/arch/amd64/conf/MODULAR:1.2
--- src/sys/arch/amd64/conf/MODULAR:1.1	Thu Aug  4 03:22:41 2016
+++ src/sys/arch/amd64/conf/MODULAR	Sun Aug  7 06:39:59 2016
@@ -1,4 +1,4 @@
-# $NetBSD: MODULAR,v 1.1 2016/08/04 07:22:41 christos Exp $
+# $NetBSD: MODULAR,v 1.2 2016/08/07 10:39:59 christos Exp $
 #
 # Try to exclude all the drivers in GENERIC that have been modularized
 # XXX: incomplete
@@ -7,108 +7,124 @@ include "arch/amd64/conf/GENERIC"
 options 	MODULAR		# new style module(7) framework
 options 	MODULAR_DEFAULT_AUTOLOAD
 
-no acpicpu*	at cpu?
-no est0		at cpu0
-no powernow0	at cpu0
-no vmt0		at cpu0
-
-no options 	COMPAT_15	# NetBSD 1.5,
-no options 	COMPAT_16	# NetBSD 1.6,
-no options 	COMPAT_20	# NetBSD 2.0,
-no options 	COMPAT_30	# NetBSD 3.0,
-no options 	COMPAT_40	# NetBSD 4.0,
-no options 	COMPAT_50	# NetBSD 5.0,
-no options 	COMPAT_60	# NetBSD 6.0, and
-no options 	COMPAT_70	# NetBSD 7.0 binary compatibility.
-no options 	COMPAT_43	# and 4.3BSD
+-no acpicpu*	at cpu?
+-no est0		at cpu0
+-no powernow0	at cpu0
+-no vmt0		at cpu0
+
+-no options 	COMPAT_15	# NetBSD 1.5,
+-no options 	COMPAT_16	# NetBSD 1.6,
+-no options 	COMPAT_20	# NetBSD 2.0,
+-no options 	COMPAT_30	# NetBSD 3.0,
+-no options 	COMPAT_40	# NetBSD 4.0,
+-no options 	COMPAT_50	# NetBSD 5.0,
+-no options 	COMPAT_60	# NetBSD 6.0, and
+-no options 	COMPAT_70	# NetBSD 7.0 binary compatibility.
+-no options 	COMPAT_43	# and 4.3BSD
 #options 	COMPAT_386BSD_MBRPART # recognize old partition ID
 
-no options 	COMPAT_OSSAUDIO
-no options 	COMPAT_NETBSD32
-no options 	COMPAT_LINUX
-no options 	COMPAT_LINUX32	# req. COMPAT_LINUX and COMPAT_NETBSD32
-no options 	EXEC_ELF32
-no options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
-
-no options	SYSVMSG		# System V-like message queues
-no options	SYSVSEM		# System V-like semaphores
-no options	SYSVSHM		# System V-like memory sharing
+-no options 	COMPAT_OSSAUDIO
+-no options 	COMPAT_NETBSD32
+-no options 	COMPAT_LINUX
+-no options 	COMPAT_LINUX32	# req. COMPAT_LINUX and COMPAT_NETBSD32
+-no options 	EXEC_ELF32
+-no options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
+
+-no options	SYSVMSG		# System V-like message queues
+-no options	SYSVSEM		# System V-like semaphores
+-no options	SYSVSHM		# System V-like memory sharing
 
 # XXX: for now
 #no file-system 	FFS		# UFS
-no file-system	MFS		# memory file system
-no file-system 	NFS		# Network File System client
-no file-system	TMPFS		# Efficient memory file-system
-no file-system	EXT2FS		# second extended file system (linux)
-no file-system	LFS		# log-structured file system
-no file-system	NTFS		# Windows/NT file system (experimental)
-no file-system	CD9660		# ISO 9660 + Rock Ridge file system
-no file-system	MSDOSFS		# MS-DOS file system
-no file-system	FDESC		# /dev/fd
-no file-system	KERNFS		# /kern
-no file-system	NULLFS		# loopback file system
-no file-system	OVERLAY		# overlay file system
-no file-system	PROCFS		# /proc
-no file-system	PUFFS		# Userspace file systems (e.g. ntfs-3g & sshfs)
-no file-system	SMBFS		# experimental - CIFS; also needs nsmb (below)
-no file-system	UMAPFS		# NULLFS + uid and gid remapping
-no file-system	UNION		# union file system
-no file-system	CODA		# Coda File System; also needs vcoda (below)
-no file-system	PTYFS		# /dev/ptm support
-
-no options 	PPP_BSDCOMP	# BSD-Compress compression support for PPP
-no options 	PPP_DEFLATE	# Deflate compression support for PPP
-
-no acpiacad*	at acpi?		# ACPI AC Adapter
-no acpibat*	at acpi?		# ACPI Battery
-no acpibut*	at acpi?		# ACPI Button
-no acpifan*	at acpi?		# ACPI Fan
-no acpilid*	at acpi?		# ACPI Lid Switch
-no acpitz* 	at acpi?		# ACPI Thermal Zone
-no acpivga*	at acpi?		# ACPI Display Adapter
-no acpiwdrt*	at acpi?		# ACPI Watchdog Resource Table
-no acpiwmi*	at acpi?		# ACPI WMI Mapper
-
-no options	NFSSERVER
-
-no axe*		at uhub?
-no rum*		at uhub?
-no urtwn*	at uhub?
-no urtw*	at uhub?
-no run*		at uhub?
-no athn*	at uhub?
+-no file-system	MFS		# memory file system
+-no file-system 	NFS		# Network File System client
+-no file-system	TMPFS		# Efficient memory file-system
+-no file-system	EXT2FS		# second extended file system (linux)
+-no file-system	LFS		# log-structured file system
+-no file-system	NTFS		# Windows/NT file system (experimental)
+-no file-system	CD9660		# ISO 9660 + Rock Ridge file system
+-no file-system	MSDOSFS		# MS-DOS file system
+-no file-system	FDESC		# /dev/fd
+-no file-system	KERNFS		# /kern
+-no file-system	NULLFS		# loopback file system
+-no file-system	

CVS commit: src/usr.bin/config

2016-08-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug  7 10:37:24 UTC 2016

Modified Files:
src/usr.bin/config: defs.h gram.y main.c scan.l sem.c sem.h

Log Message:
Accept "-no" as a "no" that does not cause errors if the object deleted
does not exist.


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/usr.bin/config/defs.h
cvs rdiff -u -r1.53 -r1.54 src/usr.bin/config/gram.y
cvs rdiff -u -r1.89 -r1.90 src/usr.bin/config/main.c
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/config/scan.l
cvs rdiff -u -r1.74 -r1.75 src/usr.bin/config/sem.c
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/config/sem.h

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

Modified files:

Index: src/usr.bin/config/defs.h
diff -u src/usr.bin/config/defs.h:1.95 src/usr.bin/config/defs.h:1.96
--- src/usr.bin/config/defs.h:1.95	Fri Mar 18 11:05:49 2016
+++ src/usr.bin/config/defs.h	Sun Aug  7 06:37:24 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.95 2016/03/18 15:05:49 christos Exp $	*/
+/*	$NetBSD: defs.h,v 1.96 2016/08/07 10:37:24 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -569,9 +569,9 @@ void	deffilesystem(struct nvlist *, stru
 void	defoption(const char *, struct defoptlist *, struct nvlist *);
 void	defflag(const char *, struct defoptlist *, struct nvlist *, int);
 void	defparam(const char *, struct defoptlist *, struct nvlist *, int);
-void	deloption(const char *);
-void	delfsoption(const char *);
-void	delmkoption(const char *);
+void	deloption(const char *, int);
+void	delfsoption(const char *, int);
+void	delmkoption(const char *, int);
 int	devbase_has_instances(struct devbase *, int);
 int	is_declared_option(const char *);
 int	deva_has_instances(struct deva *, int);

Index: src/usr.bin/config/gram.y
diff -u src/usr.bin/config/gram.y:1.53 src/usr.bin/config/gram.y:1.54
--- src/usr.bin/config/gram.y:1.53	Fri Apr 29 14:18:22 2016
+++ src/usr.bin/config/gram.y	Sun Aug  7 06:37:24 2016
@@ -1,5 +1,5 @@
 %{
-/*	$NetBSD: gram.y,v 1.53 2016/04/29 18:18:22 mlelstv Exp $	*/
+/*	$NetBSD: gram.y,v 1.54 2016/08/07 10:37:24 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: gram.y,v 1.53 2016/04/29 18:18:22 mlelstv Exp $");
+__RCSID("$NetBSD: gram.y,v 1.54 2016/08/07 10:37:24 christos Exp $");
 
 #include 
 #include 
@@ -60,6 +60,7 @@ __RCSID("$NetBSD: gram.y,v 1.53 2016/04/
 #define	stop(s)	cfgerror(s), exit(1)
 
 static	struct	config conf;	/* at most one active at a time */
+static	int	nowarn;		/* if warning suppression is on */
 
 
 /*
@@ -178,7 +179,7 @@ static struct loclist *namelocvals(const
 %token	IDENT IOCONF
 %token	LINKZERO
 %token	XMACHINE MAJOR MAKEOPTIONS MAXUSERS MAXPARTITIONS MINOR
-%token	NEEDS_COUNT NEEDS_FLAG NO
+%token	NEEDS_COUNT NEEDS_FLAG NO CNO
 %token	XOBJECT OBSOLETE ON OPTIONS
 %token	PACKAGE PLUSEQ PREFIX BUILDPREFIX PSEUDO_DEVICE PSEUDO_ROOT
 %token	ROOT
@@ -213,7 +214,7 @@ static struct loclist *namelocvals(const
 %type		value
 %type		major_minor
 %type		signed_number
-%type		int32 npseudo device_flags
+%type		int32 npseudo device_flags no
 %type		deffs
 %type		deffses
 %type		defopt
@@ -292,6 +293,11 @@ subarches:
 	| subarches WORD		{ $$ = new_nx($2, $1); }
 ;
 
+no:
+	  NO	{ $$ = 0; }
+	| CNO	{ $$ = 1; }
+;
+
 //
 
 /*
@@ -740,11 +746,11 @@ select_attr:
 ;
 
 select_no_attr:
-	NO SELECT WORD			{ delattr($3); }
+	no SELECT WORD			{ delattr($3, $1); }
 ;
 
 select_no_filesystems:
-	NO FILE_SYSTEM no_fs_list
+	no FILE_SYSTEM { nowarn = $1; } no_fs_list { nowarn = 0; }
 ;
 
 select_filesystems:
@@ -752,7 +758,7 @@ select_filesystems:
 ;
 
 select_no_makeoptions:
-	NO MAKEOPTIONS no_mkopt_list
+	no MAKEOPTIONS { nowarn = $1; } no_mkopt_list { nowarn = 0; }
 ;
 
 select_makeoptions:
@@ -760,7 +766,7 @@ select_makeoptions:
 ;
 
 select_no_options:
-	NO OPTIONS no_opt_list
+	no OPTIONS { nowarn = $1; } no_opt_list { nowarn = 0; }
 ;
 
 select_options:
@@ -776,7 +782,7 @@ select_ident:
 ;
 
 select_no_ident:
-	NO IDENT			{ setident(NULL); }
+	no IDENT			{ setident(NULL); }
 ;
 
 select_config:
@@ -785,11 +791,11 @@ select_config:
 ;
 
 select_no_config:
-	NO CONFIG WORD			{ delconf($3); }
+	no CONFIG WORD			{ delconf($3, $1); }
 ;
 
 select_no_pseudodev:
-	NO PSEUDO_DEVICE WORD		{ delpseudo($3); }
+	no PSEUDO_DEVICE WORD		{ delpseudo($3, $1); }
 ;
 
 select_pseudodev:
@@ -801,16 +807,16 @@ select_pseudoroot:
 ;
 
 select_no_device_instance_attachment:
-	NO device_instance AT attachment
-	{ deldevi($2, $4); }
+	no device_instance AT attachment
+	{ deldevi($2, $4, $1); }
 ;
 
 select_no_device_attachment:
-	NO DEVICE AT attachment		{ deldeva($4); }
+	no DEVICE AT attachment		{ deldeva($4, $1); }
 ;
 
 select_no_device_instance:
-	NO device_instance		{ deldev($2); }
+	no device_instance		{ deldev($2, $1); }
 ;
 
 select_device_instance:
@@ -837,7 +843,7 @@ no_fs_list:
 
 /* one filesystem that 

CVS commit: src/sys/arch

2016-08-07 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug  7 10:17:32 UTC 2016

Modified Files:
src/sys/arch/amd64/amd64: vector.S
src/sys/arch/i386/i386: vector.S

Log Message:
KNF a little.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/amd64/amd64/vector.S
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/i386/i386/vector.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/amd64/amd64/vector.S
diff -u src/sys/arch/amd64/amd64/vector.S:1.45 src/sys/arch/amd64/amd64/vector.S:1.46
--- src/sys/arch/amd64/amd64/vector.S:1.45	Sun Nov 22 13:41:24 2015
+++ src/sys/arch/amd64/amd64/vector.S	Sun Aug  7 10:17:32 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.45 2015/11/22 13:41:24 maxv Exp $	*/
+/*	$NetBSD: vector.S,v 1.46 2016/08/07 10:17:32 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -107,7 +107,6 @@
  * If the interrupt frame is made more flexible,  INTR can push %eax first and
  * decide the ipending case with less overhead, e.g., by avoiding loading the
  * segment registers.
- *
  */
 
 /* XXX See comment in locore.s */
@@ -121,16 +120,16 @@
 #ifdef MULTIPROCESSOR
 IDTVEC(recurse_lapic_ipi)
 	INTR_RECURSE_HWFRAME
-	pushq	$0		
+	pushq	$0
 	pushq	$T_ASTFLT
-	INTRENTRY		
+	INTRENTRY
 	jmp	1f
 IDTVEC_END(recurse_lapic_ipi)
 
 IDTVEC(intr_lapic_ipi)
-	pushq	$0		
+	pushq	$0
 	pushq	$T_ASTFLT
-	INTRENTRY		
+	INTRENTRY
 	movl	$0,_C_LABEL(local_apic)+LAPIC_EOI
 	movl	CPUVAR(ILEVEL),%ebx
 	cmpl	$IPL_HIGH,%ebx
@@ -166,22 +165,22 @@ IDTVEC(intrddb)
 IDTVEC_END(intrddb)
 #endif /* DDB */
 #endif /* MULTIPROCESSOR */
-	
+
 	/*
 	 * Interrupt from the local APIC timer.
 	 */
 IDTVEC(recurse_lapic_ltimer)
 	INTR_RECURSE_HWFRAME
-	pushq	$0		
+	pushq	$0
 	pushq	$T_ASTFLT
-	INTRENTRY		
+	INTRENTRY
 	jmp	1f
 IDTVEC_END(recurse_lapic_ltimer)
 
 IDTVEC(intr_lapic_ltimer)
-	pushq	$0		
+	pushq	$0
 	pushq	$T_ASTFLT
-	INTRENTRY		
+	INTRENTRY
 	movl	$0,_C_LABEL(local_apic)+LAPIC_EOI
 	movl	CPUVAR(ILEVEL),%ebx
 	cmpl	$IPL_CLOCK,%ebx
@@ -211,7 +210,7 @@ IDTVEC(intr_lapic_tlb)
 	pushq	$0
 	pushq	$T_ASTFLT
 	INTRENTRY
-	movl	$0, _C_LABEL(local_apic)+LAPIC_EOI
+	movl	$0,_C_LABEL(local_apic)+LAPIC_EOI
 	callq	_C_LABEL(pmap_tlb_intr)
 	INTRFASTEXIT
 IDTVEC_END(intr_lapic_tlb)
@@ -236,14 +235,14 @@ IDTVEC(recurse_ ## name ## num)		;\
 IDTVEC(resume_ ## name ## num)		\
 	movq	$IREENT_MAGIC,TF_ERR(%rsp);\
 	movl	%ebx,%r13d		;\
-	movq	CPUVAR(ISOURCES) + (num) * 8, %r14			;\
+	movq	CPUVAR(ISOURCES) + (num) * 8,%r14			;\
 	movl	IS_MAXLEVEL(%r14),%ebx	;\
 	jmp	1f			;\
 IDTVEC(intr_ ## name ## num)		;\
 	pushq	$0			/* dummy error code */		;\
 	pushq	$T_ASTFLT		/* trap # for doing ASTs */	;\
 	INTRENTRY			;\
-	movq	CPUVAR(ISOURCES) + (num) * 8, %r14			;\
+	movq	CPUVAR(ISOURCES) + (num) * 8,%r14			;\
 	mask(num)			/* mask it in hardware */	;\
 	early_ack(num)			/* and allow other intrs */	;\
 	testq	%r14,%r14		;\
@@ -279,14 +278,14 @@ IDTVEC(intr_ ## name ## num)		;\
 	jmp	_C_LABEL(Xdoreti)	/* lower spl and do ASTs */	;\
 7:	\
 	cli;\
-	orl $(1 << num),CPUVAR(IPENDING);\
+	orl	$(1 << num),CPUVAR(IPENDING);\
 	level_mask(num)			;\
 	late_ack(num)			;\
 	sti;\
 	jmp	_C_LABEL(Xdoreti)	/* lower spl and do ASTs */	;\
 10:	\
 	cli;\
-	orl $(1 << num),CPUVAR(IPENDING);\
+	orl	$(1 << num),CPUVAR(IPENDING);\
 	level_mask(num)			;\
 	late_ack(num)			;\
 	INTRFASTEXIT			;\
@@ -581,39 +580,39 @@ END(ioapic_level_stubs)
 /* Resume/recurse procedures for spl() */
 #define	XENINTRSTUB(name, num, early_ack, late_ack, mask, unmask, level_mask) \
 IDTVEC(recurse_ ## name ## num)		;\
-  	INTR_RECURSE_HWFRAME		;\
-  	subq	$8,%rsp			;\
-  	pushq	$T_ASTFLT		/* trap # for doing ASTs */	;\
-  	INTRENTRY			;\
+	INTR_RECURSE_HWFRAME		;\
+	subq	$8,%rsp			;\
+	pushq	$T_ASTFLT		/* trap # for doing ASTs */	;\
+	INTRENTRY			;\
 IDTVEC(resume_ ## name ## num)		\
-  	movq	$IREENT_MAGIC,TF_ERR(%rsp);\
-  	movl	%ebx,%r13d		;\
-  	movq	CPUVAR(ISOURCES) + (num) * 8, %r14			;\
+	movq	$IREENT_MAGIC,TF_ERR(%rsp);\
+	movl	%ebx,%r13d		;\
+	movq	CPUVAR(ISOURCES) + (num) * 8,%r14			;\
 1:	\
-  	pushq	%r13			;\
-  	movl	$num,CPUVAR(ILEVEL)	;\
-  	STI(si);\
-  	incl	CPUVAR(IDEPTH)		;\
-  	movq	IS_HANDLERS(%r14),%rbx	;\
+	pushq	%r13			;\
+	movl	$num,CPUVAR(ILEVEL)	;\
+	STI(si);\
+	incl	CPUVAR(IDEPTH)		;\
+	movq	IS_HANDLERS(%r14),%rbx	;\
 6:	\
-  	movq	IH_ARG(%rbx),%rdi	;\
-  	movq	%rsp,%rsi		;\
-  	call	*IH_FUN(%rbx)		/* call it */			;\
-  	movq	IH_IPL_NEXT(%rbx),%rbx	/* next handler in chain */	;\
-  	testq	%rbx,%rbx		;\
-  	jnz	6b			;\
+	movq	IH_ARG(%rbx),%rdi	;\
+	movq	%rsp,%rsi		;\
+	call	*IH_FUN(%rbx)		/* call it */			;\
+	movq	IH_IPL_NEXT(%rbx),%rbx	/* 

CVS commit: src/sys/uvm

2016-08-07 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug  7 10:07:58 UTC 2016

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

Log Message:
KNF a little.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/sys/uvm/uvm_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/sys/uvm/uvm_mmap.c
diff -u src/sys/uvm/uvm_mmap.c:1.160 src/sys/uvm/uvm_mmap.c:1.161
--- src/sys/uvm/uvm_mmap.c:1.160	Sun Aug  7 09:55:18 2016
+++ src/sys/uvm/uvm_mmap.c	Sun Aug  7 10:07:58 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_mmap.c,v 1.160 2016/08/07 09:55:18 maxv Exp $	*/
+/*	$NetBSD: uvm_mmap.c,v 1.161 2016/08/07 10:07:58 maxv Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -46,7 +46,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.160 2016/08/07 09:55:18 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.161 2016/08/07 10:07:58 maxv Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_pax.h"
@@ -64,7 +64,7 @@ __KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v
 #include 
 
 static int uvm_mmap(struct vm_map *, vaddr_t *, vsize_t, vm_prot_t, vm_prot_t,
-		int, int, struct uvm_object *, voff_t, vsize_t);
+int, int, struct uvm_object *, voff_t, vsize_t);
 
 static int
 range_test(struct vm_map *map, vaddr_t addr, vsize_t size, bool ismmap)
@@ -104,7 +104,7 @@ sys_sbrk(struct lwp *l, const struct sys
 		syscallarg(intptr_t) incr;
 	} */
 
-	return (ENOSYS);
+	return ENOSYS;
 }
 
 /*
@@ -119,7 +119,7 @@ sys_sstk(struct lwp *l, const struct sys
 		syscallarg(int) incr;
 	} */
 
-	return (ENOSYS);
+	return ENOSYS;
 }
 
 /*
@@ -155,11 +155,11 @@ sys_mincore(struct lwp *l, const struct 
 	vec = SCARG(uap, vec);
 
 	if (start & PAGE_MASK)
-		return (EINVAL);
+		return EINVAL;
 	len = round_page(len);
 	end = start + len;
 	if (end <= start)
-		return (EINVAL);
+		return EINVAL;
 
 	/*
 	 * Lock down vec, so our returned status isn't outdated by
@@ -259,7 +259,7 @@ sys_mincore(struct lwp *l, const struct 
  out:
 	vm_map_unlock_read(map);
 	uvm_vsunlock(p->p_vmspace, SCARG(uap, vec), npgs);
-	return (error);
+	return error;
 }
 
 /*
@@ -328,7 +328,7 @@ sys_mmap(struct lwp *l, const struct sys
 #endif
 	}
 	if ((flags & (MAP_SHARED|MAP_PRIVATE)) == (MAP_SHARED|MAP_PRIVATE))
-		return (EINVAL);
+		return EINVAL;
 
 	/*
 	 * align file position and save offset.  adjust size.
@@ -340,26 +340,23 @@ sys_mmap(struct lwp *l, const struct sys
 	newsize = (vsize_t)round_page(newsize);	/* round up */
 
 	if (newsize < size)
-		return (ENOMEM);
+		return ENOMEM;
 	size = newsize;
 
 	/*
 	 * now check (MAP_FIXED) or get (!MAP_FIXED) the "addr"
 	 */
 	if (flags & MAP_FIXED) {
-
 		/* ensure address and file offset are aligned properly */
 		addr -= pageoff;
 		if (addr & PAGE_MASK)
-			return (EINVAL);
+			return EINVAL;
 
 		error = range_test(>p_vmspace->vm_map, addr, size, true);
 		if (error) {
 			return error;
 		}
-
 	} else if (addr == 0 || !(flags & MAP_TRYFIXED)) {
-
 		/*
 		 * not fixed: make sure we skip over the largest
 		 * possible heap for non-topdown mapping arrangements.
@@ -371,8 +368,7 @@ sys_mmap(struct lwp *l, const struct sys
 		(vaddr_t)p->p_vmspace->vm_daddr, size,
 		p->p_vmspace->vm_map.flags & VM_MAP_TOPDOWN);
 
-		if (addr == 0 ||
-		!(p->p_vmspace->vm_map.flags & VM_MAP_TOPDOWN))
+		if (addr == 0 || !(p->p_vmspace->vm_map.flags & VM_MAP_TOPDOWN))
 			addr = MAX(addr, defaddr);
 		else
 			addr = MIN(addr, defaddr);
@@ -385,14 +381,14 @@ sys_mmap(struct lwp *l, const struct sys
 	advice = UVM_ADV_NORMAL;
 	if ((flags & MAP_ANON) == 0) {
 		if ((fp = fd_getfile(fd)) == NULL)
-			return (EBADF);
+			return EBADF;
 
 		if (fp->f_ops->fo_mmap == NULL) {
 			error = ENODEV;
 			goto out;
 		}
 		error = (*fp->f_ops->fo_mmap)(fp, , size, prot, ,
-	  , , );
+		, , );
 		if (error) {
 			goto out;
 		}
@@ -407,7 +403,7 @@ sys_mmap(struct lwp *l, const struct sys
 		 * XXX What do we do about (MAP_SHARED|MAP_PRIVATE) == 0?
 		 */
 		if (fd != -1)
-			return (EINVAL);
+			return EINVAL;
 
  is_anon:		/* label for SunOS style /dev/zero */
 		uobj = NULL;
@@ -430,10 +426,10 @@ sys_mmap(struct lwp *l, const struct sys
 	*retval = (register_t)(addr + pageoff);
 
  out:
- 	if (fp != NULL)
+	if (fp != NULL)
 		fd_putfile(fd);
 
-	return (error);
+	return error;
 }
 
 /*
@@ -468,7 +464,7 @@ sys___msync13(struct lwp *l, const struc
 	if ((flags & ~(MS_ASYNC | MS_SYNC | MS_INVALIDATE)) != 0 ||
 	(flags & (MS_ASYNC | MS_SYNC | MS_INVALIDATE)) == 0 ||
 	(flags & (MS_ASYNC | MS_SYNC)) == (MS_ASYNC | MS_SYNC))
-		return (EINVAL);
+		return EINVAL;
 	if ((flags & (MS_ASYNC | MS_SYNC)) == 0)
 		flags |= MS_SYNC;
 
@@ -513,7 +509,7 @@ sys___msync13(struct lwp *l, const struc
 		}
 		vm_map_unlock_read(map);
 		if (rv == false)
-			return (EINVAL);
+			return EINVAL;
 	}
 
 	/*
@@ -565,7 +561,7 @@ sys_munmap(struct lwp *l, const 

CVS commit: src/sys/uvm

2016-08-07 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug  7 09:55:18 UTC 2016

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

Log Message:
Explicitly return syscall-specific error codes, instead of the ones given
by range_test. This fixes msync, mlock and munlock, which all return EINVAL
instead of ENOMEM if the address is not in the va space.

It should also fix the recent ATF failures.


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/sys/uvm/uvm_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/sys/uvm/uvm_mmap.c
diff -u src/sys/uvm/uvm_mmap.c:1.159 src/sys/uvm/uvm_mmap.c:1.160
--- src/sys/uvm/uvm_mmap.c:1.159	Wed Jun  1 12:14:08 2016
+++ src/sys/uvm/uvm_mmap.c	Sun Aug  7 09:55:18 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_mmap.c,v 1.159 2016/06/01 12:14:08 pgoyette Exp $	*/
+/*	$NetBSD: uvm_mmap.c,v 1.160 2016/08/07 09:55:18 maxv Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -46,7 +46,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.159 2016/06/01 12:14:08 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.160 2016/08/07 09:55:18 maxv Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_pax.h"
@@ -489,7 +489,7 @@ sys___msync13(struct lwp *l, const struc
 
 	error = range_test(map, addr, size, false);
 	if (error)
-		return error;
+		return ENOMEM;
 
 	/*
 	 * XXXCDC: do we really need this semantic?
@@ -571,7 +571,7 @@ sys_munmap(struct lwp *l, const struct s
 
 	error = range_test(map, addr, size, false);
 	if (error)
-		return error;
+		return EINVAL;
 
 	/*
 	 * interesting system call semantic: make sure entire range is
@@ -630,7 +630,7 @@ sys_mprotect(struct lwp *l, const struct
 
 	error = range_test(>p_vmspace->vm_map, addr, size, false);
 	if (error)
-		return error;
+		return EINVAL;
 
 	error = uvm_map_protect(>p_vmspace->vm_map, addr, addr + size, prot,
 false);
@@ -671,7 +671,7 @@ sys_minherit(struct lwp *l, const struct
 
 	error = range_test(>p_vmspace->vm_map, addr, size, false);
 	if (error)
-		return error;
+		return EINVAL;
 
 	error = uvm_map_inherit(>p_vmspace->vm_map, addr, addr + size,
 inherit);
@@ -712,7 +712,7 @@ sys_madvise(struct lwp *l, const struct 
 
 	error = range_test(>p_vmspace->vm_map, addr, size, false);
 	if (error)
-		return error;
+		return EINVAL;
 
 	switch (advice) {
 	case MADV_NORMAL:
@@ -812,7 +812,7 @@ sys_mlock(struct lwp *l, const struct sy
 
 	error = range_test(>p_vmspace->vm_map, addr, size, false);
 	if (error)
-		return error;
+		return ENOMEM;
 
 	if (atop(size) + uvmexp.wired > uvmexp.wiredmax)
 		return (EAGAIN);
@@ -863,7 +863,7 @@ sys_munlock(struct lwp *l, const struct 
 
 	error = range_test(>p_vmspace->vm_map, addr, size, false);
 	if (error)
-		return error;
+		return ENOMEM;
 
 	error = uvm_map_pageable(>p_vmspace->vm_map, addr, addr+size, true,
 	0);



CVS commit: src/sys/arch/amd64/amd64

2016-08-07 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Aug  7 09:04:55 UTC 2016

Modified Files:
src/sys/arch/amd64/amd64: amd64_trap.S

Log Message:
Explain a little.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/amd64/amd64/amd64_trap.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/amd64/amd64/amd64_trap.S
diff -u src/sys/arch/amd64/amd64/amd64_trap.S:1.3 src/sys/arch/amd64/amd64/amd64_trap.S:1.4
--- src/sys/arch/amd64/amd64/amd64_trap.S:1.3	Sun Nov 22 13:41:24 2015
+++ src/sys/arch/amd64/amd64/amd64_trap.S	Sun Aug  7 09:04:55 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: amd64_trap.S,v 1.3 2015/11/22 13:41:24 maxv Exp $	*/
+/*	$NetBSD: amd64_trap.S,v 1.4 2016/08/07 09:04:55 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
 
 #if 0
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amd64_trap.S,v 1.3 2015/11/22 13:41:24 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amd64_trap.S,v 1.4 2016/08/07 09:04:55 maxv Exp $");
 #endif
 
 /*
@@ -229,28 +229,36 @@ IDTVEC_END(trap0a)
 IDTVEC(trap0b)		/* #NP() Segment not present */
 	TRAP_NJ(T_SEGNPFLT)
 	jmp	check_swapgs
-IDTVEC_END(trap0b)		/* #NP() Segment not present */
+IDTVEC_END(trap0b)
 
 IDTVEC(trap0c)		/* #SS() Stack exception */
 	TRAP_NJ(T_STKFLT)
 	jmp	check_swapgs
-IDTVEC_END(trap0c)		/* #SS() Stack exception */
+IDTVEC_END(trap0c)
 
 IDTVEC(trap0d)		/* #GP() General protection */
 	TRAP_NJ(T_PROTFLT)
 #ifdef check_swapgs
 	jmp	check_swapgs
 #else
-/* We need to worry about traps while the kernel %gs_base isn't loaded.
- * These are either loads to %gs (only 32bit) or faults on iret during
- * return to user. */
+/*
+ * We need to worry about traps in kernel mode while the kernel %gs isn't
+ * loaded. These are either faults on iretq during return to user or loads to
+ * %gs.
+ *
+ * When such traps happen, we have CPL=0 and %gs=userland, and we must perform
+ * an additional swapgs to get %gs=kernel.
+ */
 check_swapgs:
 	INTRENTRY_L(3f,1:)
-2:	sti
+2:
+	sti
 	jmp	calltrap
 3:
-	/* Trap in kernel mode. */
-	/* If faulting instruction is 'iret' we may need to do a 'swapgs'. */
+	/*
+	 * Trap in kernel mode.
+	 */
+	/* Case 1: fault on iretq? */
 	movq	TF_RIP(%rsp),%rax
 	cmpw	$0xcf48,(%rax)		/* Faulting instruction is iretq ? */
 	jne	5f			/* Jump if not */
@@ -259,7 +267,8 @@ check_swapgs:
 	je	2b			/* jump if iret was to kernel  */
 	jmp	1b			/* to user - must restore %gs */
 5:
-	/* Not 'iret', all moves to %gs also need a swapgs */
+
+	/* Case 2: move to %gs? */
 	movw	(%rax),%ax
 	andb	$070,%ah		/* mask mod/rm from mod/reg/rm */
 	cmpw	$0x8e+050*256,%ax	/* Any move to %gs (reg 5) */



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

2016-08-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug  7 07:13:57 UTC 2016

Modified Files:
src/sys/arch/mips/mips: mipsX_subr.S

Log Message:
Fix two bugs for tlb_invalidate_addr for (PGSHIFT & 1) == 0

- t0/t1 weren't being updated when both lo0/lo1 become invalid
- the global bit (G) needs to be preserved if the entry becomes invalid

The MIPSNN optimisation is disabled for now as it needs to be updated
appropriately


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/mips/mips/mipsX_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/mips/mips/mipsX_subr.S
diff -u src/sys/arch/mips/mips/mipsX_subr.S:1.82 src/sys/arch/mips/mips/mipsX_subr.S:1.83
--- src/sys/arch/mips/mips/mipsX_subr.S:1.82	Sun Aug  7 06:15:49 2016
+++ src/sys/arch/mips/mips/mipsX_subr.S	Sun Aug  7 07:13:57 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mipsX_subr.S,v 1.82 2016/08/07 06:15:49 skrll Exp $	*/
+/*	$NetBSD: mipsX_subr.S,v 1.83 2016/08/07 07:13:57 skrll Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -2307,18 +2307,21 @@ LEAF_NOPROFILE(MIPSX(tlb_invalidate_addr
 	and	a2, t0# a2=valid entryLo0 afterwards
 	and	a3, t1# a3=valid entryLo1 afterwards
 	or	v0, a2, a3			# will one be valid?
-#ifdef MIPSNN
+#ifdef MIPSNNX
+#error Global bit is lost here when V==0 and it needs to be preserved
 	movz	t0, zero, a2			# zero lo0 if V would not be set
 	movz	t1, zero, a3			# zero lo1 if V would not be set
 	movn	t2, a0, v0			# yes, keep VA the same
 #else
-	beqz	v0, 1f# no valid entry
-	 _SLL	a2, a2, PG_V_LSHIFT		# move V to MSB
+	_SLL	a2, a2, PG_V_LSHIFT		# move V to MSB
 	_SRA	a2, a2, PG_V_RSHIFT		# fill with MSB
+	or	a2, MIPS3_PG_G			# mask needs to preserve G
 	and	t0, t0, a2			# zero lo0 if V would not be set
 	_SLL	a3, a3, PG_V_LSHIFT		# move V to MSB
 	_SRA	a3, a3, PG_V_RSHIFT		# fill with MSB
-	and	t1, t1, a3			# zero lo1 if V would not be set
+	or	a3, MIPS3_PG_G			# mask needs to preserve G
+	beqz	v0, 1f# no valid entry
+	 and	t1, t1, a3			# zero lo1 if V would not be set
 	move	t2, a0# we need entryHi to be valid
 1:
 #endif /* MIPSNN */



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

2016-08-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug  7 06:15:50 UTC 2016

Modified Files:
src/sys/arch/mips/mips: mipsX_subr.S

Log Message:
Restore a MFC0_HAZARD lost in r1.68


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/mips/mips/mipsX_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/mips/mips/mipsX_subr.S
diff -u src/sys/arch/mips/mips/mipsX_subr.S:1.81 src/sys/arch/mips/mips/mipsX_subr.S:1.82
--- src/sys/arch/mips/mips/mipsX_subr.S:1.81	Sun Aug  7 06:12:24 2016
+++ src/sys/arch/mips/mips/mipsX_subr.S	Sun Aug  7 06:15:49 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mipsX_subr.S,v 1.81 2016/08/07 06:12:24 skrll Exp $	*/
+/*	$NetBSD: mipsX_subr.S,v 1.82 2016/08/07 06:15:49 skrll Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -2289,6 +2289,7 @@ LEAF_NOPROFILE(MIPSX(tlb_invalidate_addr
 	tlbp	# probe the entry in question
 	COP0_SYNC
 	mfc0	v0, MIPS_COP_0_TLB_INDEX	# see what we got
+	MFC0_HAZARD
 	bltz	v0, 2f# index < 0 then skip
 	 li	t2, MIPS_KSEG0_START		# invalid address
 	PTR_SLL	v0, PGSHIFT | 1			# PAGE_SHIFT | 1



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

2016-08-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Aug  7 06:12:24 UTC 2016

Modified Files:
src/sys/arch/mips/mips: mipsX_subr.S

Log Message:
Fix incorrect register usage in #if (PGSHIFT & 1) == 0 code


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/mips/mips/mipsX_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/mips/mips/mipsX_subr.S
diff -u src/sys/arch/mips/mips/mipsX_subr.S:1.80 src/sys/arch/mips/mips/mipsX_subr.S:1.81
--- src/sys/arch/mips/mips/mipsX_subr.S:1.80	Fri Aug  5 15:39:09 2016
+++ src/sys/arch/mips/mips/mipsX_subr.S	Sun Aug  7 06:12:24 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: mipsX_subr.S,v 1.80 2016/08/05 15:39:09 skrll Exp $	*/
+/*	$NetBSD: mipsX_subr.S,v 1.81 2016/08/07 06:12:24 skrll Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -2162,12 +2162,12 @@ LEAF(MIPSX(tlb_update_addr))
 	 li	v0, 0# assume failure
 	bnez	t1, 4f# Decide even odd
 	 nop
-	move	t3, a2# swap a2 and t0
-	move	a2, t0#
+	move	t3, a1# swap a1 and t0
+	move	a1, t0#
 	move	t0, t3#
 4:
 	_MTC0	t0, MIPS_COP_0_TLB_LO0		# init low reg0.
-	_MTC0	a2, MIPS_COP_0_TLB_LO1		# init low reg1.
+	_MTC0	a1, MIPS_COP_0_TLB_LO1		# init low reg1.
 #endif /* PGSHIFT & 1 */
 5:
 	COP0_SYNC