CVS commit: src

2017-05-20 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sat May 20 07:27:15 UTC 2017

Modified Files:
src/share/man/man9: uvm_map.9
src/sys/uvm: uvm_extern.h uvm_map.c uvm_mmap.c

Log Message:
MAP_FIXED means something different for mremap() than it does for mmap(),
so we cannot use UVM_FLAG_FIXED to specify both behaviors.
keep UVM_FLAG_FIXED with its earlier meaning (prior to my previous change)
of whether to use uvm_map_findspace() to locate space for the new mapping or
to use the hint address that the caller passed in, and add a new flag
UVM_FLAG_UNMAP to indicate that any existing entries in the range should be
unmapped as part of creating the new mapping.  the new UVM_FLAG_UNMAP flag
may only be used if UVM_FLAG_FIXED is also specified.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/share/man/man9/uvm_map.9
cvs rdiff -u -r1.205 -r1.206 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.348 -r1.349 src/sys/uvm/uvm_map.c
cvs rdiff -u -r1.165 -r1.166 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/share/man/man9/uvm_map.9
diff -u src/share/man/man9/uvm_map.9:1.8 src/share/man/man9/uvm_map.9:1.9
--- src/share/man/man9/uvm_map.9:1.8	Sun May 14 12:31:13 2017
+++ src/share/man/man9/uvm_map.9	Sat May 20 07:27:15 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: uvm_map.9,v 1.8 2017/05/14 12:31:13 wiz Exp $
+.\"	$NetBSD: uvm_map.9,v 1.9 2017/05/20 07:27:15 chs Exp $
 .\"
 .\" Copyright (c) 1998 Matthew R. Green
 .\" All rights reserved.
@@ -239,6 +239,12 @@ Sleep until VA space is available, if it
 Unmap only VA space.
 Used by
 .Fn uvm_unmap .
+.It UVM_FLAG_UNMAP
+Any existing entires in the range for this mapping should be
+unmapped as part of creating the new mapping.  Use of this flag
+without also specifying
+.Dv UVM_FLAG_FIXED
+is a bug.
 .El
 .Pp
 The

Index: src/sys/uvm/uvm_extern.h
diff -u src/sys/uvm/uvm_extern.h:1.205 src/sys/uvm/uvm_extern.h:1.206
--- src/sys/uvm/uvm_extern.h:1.205	Wed May 17 22:43:12 2017
+++ src/sys/uvm/uvm_extern.h	Sat May 20 07:27:15 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_extern.h,v 1.205 2017/05/17 22:43:12 christos Exp $	*/
+/*	$NetBSD: uvm_extern.h,v 1.206 2017/05/20 07:27:15 chs Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -121,16 +121,17 @@
 #define UVM_ADV_MASK	0x7	/* mask */
 
 /* bits 0x: mapping flags */
-#define UVM_FLAG_FIXED   0x01 /* find space */
-#define UVM_FLAG_OVERLAY 0x02 /* establish overlay */
-#define UVM_FLAG_NOMERGE 0x04 /* don't merge map entries */
-#define UVM_FLAG_COPYONW 0x08 /* set copy_on_write flag */
-#define UVM_FLAG_AMAPPAD 0x10 /* for bss: pad amap to reduce allocations */
-#define UVM_FLAG_TRYLOCK 0x20 /* fail if we can not lock map */
-#define UVM_FLAG_NOWAIT  0x40 /* not allowed to sleep */
-#define UVM_FLAG_WAITVA  0x80 /* wait for va */
-#define UVM_FLAG_VAONLY  0x200 /* unmap: no pages are mapped */
-#define UVM_FLAG_COLORMATCH 0x400 /* match color given in off */
+#define UVM_FLAG_FIXED		0x0001 /* find space */
+#define UVM_FLAG_OVERLAY	0x0002 /* establish overlay */
+#define UVM_FLAG_NOMERGE	0x0004 /* don't merge map entries */
+#define UVM_FLAG_COPYONW	0x0008 /* set copy_on_write flag */
+#define UVM_FLAG_AMAPPAD	0x0010 /* for bss: pad amap */
+#define UVM_FLAG_TRYLOCK	0x0020 /* fail if we can not lock map */
+#define UVM_FLAG_NOWAIT		0x0040 /* not allowed to sleep */
+#define UVM_FLAG_WAITVA		0x0080 /* wait for va */
+#define UVM_FLAG_VAONLY		0x0200 /* unmap: no pages are mapped */
+#define UVM_FLAG_COLORMATCH	0x0400 /* match color given in off */
+#define UVM_FLAG_UNMAP		0x0800 /* unmap existing entries */
 
 #define UVM_FLAG_BITS "\177\020\
 F\0\3\
@@ -172,7 +173,9 @@ b\25TRYLOCK\0\
 b\26NOWAIT\0\
 b\27WAITVA\0\
 b\30VAONLY\0\
-b\31COLORMATCH\0"
+b\31COLORMATCH\0\
+b\32UNMAP\0\
+"
 
 /* macros to extract info */
 #define UVM_PROTECTION(X)	((X) & UVM_PROT_MASK)

Index: src/sys/uvm/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.348 src/sys/uvm/uvm_map.c:1.349
--- src/sys/uvm/uvm_map.c:1.348	Fri May 19 16:56:35 2017
+++ src/sys/uvm/uvm_map.c	Sat May 20 07:27:15 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.348 2017/05/19 16:56:35 kamil Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.349 2017/05/20 07:27:15 chs Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.348 2017/05/19 16:56:35 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.349 2017/05/20 07:27:15 chs Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -1163,7 +1163,8 @@ retry:
 		}
 		vm_map_lock(map); /* could sleep here */
 	}
-	if (flags & UVM_FLAG_FIXED) {
+	if (flags & UVM_FLAG_UNMAP) {
+		KASSERT(flags & UVM_FLAG_FIXED);
 		KASSERT((flags & UVM_FLAG_NOWAIT) == 0);
 
 		/*
@@ -1301,8 +1302,8 @@ uvm_map_ent

CVS commit: src/share/man/man9

2017-05-20 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat May 20 08:00:47 UTC 2017

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

Log Message:
New sentence, new line. Bump date for previous.


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

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

Modified files:

Index: src/share/man/man9/uvm_map.9
diff -u src/share/man/man9/uvm_map.9:1.9 src/share/man/man9/uvm_map.9:1.10
--- src/share/man/man9/uvm_map.9:1.9	Sat May 20 07:27:15 2017
+++ src/share/man/man9/uvm_map.9	Sat May 20 08:00:47 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: uvm_map.9,v 1.9 2017/05/20 07:27:15 chs Exp $
+.\"	$NetBSD: uvm_map.9,v 1.10 2017/05/20 08:00:47 wiz Exp $
 .\"
 .\" Copyright (c) 1998 Matthew R. Green
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd May 6, 2017
+.Dd May 20, 2017
 .Dt UVM_MAP 9
 .Os
 .Sh NAME
@@ -241,8 +241,8 @@ Used by
 .Fn uvm_unmap .
 .It UVM_FLAG_UNMAP
 Any existing entires in the range for this mapping should be
-unmapped as part of creating the new mapping.  Use of this flag
-without also specifying
+unmapped as part of creating the new mapping.
+Use of this flag without also specifying
 .Dv UVM_FLAG_FIXED
 is a bug.
 .El



CVS commit: src/sys/modules/lua

2017-05-20 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Sat May 20 08:31:13 UTC 2017

Modified Files:
src/sys/modules/lua: lua.c

Log Message:
Only load a module if it is not already loaded in a state (much like userland
Lua handles require).
Fixes PR kern/52226.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/modules/lua/lua.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/modules/lua/lua.c
diff -u src/sys/modules/lua/lua.c:1.21 src/sys/modules/lua/lua.c:1.22
--- src/sys/modules/lua/lua.c:1.21	Thu May 11 07:34:27 2017
+++ src/sys/modules/lua/lua.c	Sat May 20 08:31:13 2017
@@ -1,8 +1,8 @@
-/*	$NetBSD: lua.c,v 1.21 2017/05/11 07:34:27 mbalmer Exp $ */
+/*	$NetBSD: lua.c,v 1.22 2017/05/20 08:31:13 mbalmer Exp $ */
 
 /*
+ * Copyright (c) 2011 - 2017 by Marc Balmer .
  * Copyright (c) 2014 by Lourival Vieira Neto .
- * Copyright (c) 2011 - 2014 by Marc Balmer .
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -514,6 +514,10 @@ lua_require(lua_State *L)
 	if (md != NULL)
 		LIST_FOREACH(s, &lua_states, lua_next)
 			if (s->K->L == L) {
+LIST_FOREACH(m, &s->lua_modules, mod_next)
+	if (m == md)
+		return 1;
+
 if (lua_verbose)
 	device_printf(sc_self,
 	"require module %s\n",



CVS commit: src/sys/modules/lua

2017-05-20 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Sat May 20 09:46:17 UTC 2017

Modified Files:
src/sys/modules/lua: lua.c

Log Message:
always put the module on the stack


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/modules/lua/lua.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/modules/lua/lua.c
diff -u src/sys/modules/lua/lua.c:1.22 src/sys/modules/lua/lua.c:1.23
--- src/sys/modules/lua/lua.c:1.22	Sat May 20 08:31:13 2017
+++ src/sys/modules/lua/lua.c	Sat May 20 09:46:17 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lua.c,v 1.22 2017/05/20 08:31:13 mbalmer Exp $ */
+/*	$NetBSD: lua.c,v 1.23 2017/05/20 09:46:17 mbalmer Exp $ */
 
 /*
  * Copyright (c) 2011 - 2017 by Marc Balmer .
@@ -514,16 +514,16 @@ lua_require(lua_State *L)
 	if (md != NULL)
 		LIST_FOREACH(s, &lua_states, lua_next)
 			if (s->K->L == L) {
-LIST_FOREACH(m, &s->lua_modules, mod_next)
-	if (m == md)
-		return 1;
-
 if (lua_verbose)
 	device_printf(sc_self,
 	"require module %s\n",
 	md->mod_name);
 luaL_requiref(L, md->mod_name, md->open, 0);
 
+LIST_FOREACH(m, &s->lua_modules, mod_next)
+	if (m == md)
+		return 1;
+
 md->refcount++;
 LIST_INSERT_HEAD(&s->lua_modules, md, mod_next);
 return 1;



CVS commit: src/external/mit/lua/dist/src

2017-05-20 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Sat May 20 10:12:29 UTC 2017

Modified Files:
src/external/mit/lua/dist/src: lua.h

Log Message:
don't spam the console, just output the Lua version information as lua(1) does


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/mit/lua/dist/src/lua.h

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

Modified files:

Index: src/external/mit/lua/dist/src/lua.h
diff -u src/external/mit/lua/dist/src/lua.h:1.9 src/external/mit/lua/dist/src/lua.h:1.10
--- src/external/mit/lua/dist/src/lua.h:1.9	Wed Apr 26 13:17:33 2017
+++ src/external/mit/lua/dist/src/lua.h	Sat May 20 10:12:29 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lua.h,v 1.9 2017/04/26 13:17:33 mbalmer Exp $	*/
+/*	$NetBSD: lua.h,v 1.10 2017/05/20 10:12:29 mbalmer Exp $	*/
 
 /*
 ** Id: lua.h,v 1.332 2016/12/22 15:51:20 roberto Exp 
@@ -23,21 +23,11 @@
 #define LUA_VERSION_MAJOR	"5"
 #define LUA_VERSION_MINOR	"3"
 #define LUA_VERSION_NUM		503
-#ifndef _KERNEL
 #define LUA_VERSION_RELEASE	"4"
-#else /* _KERNEL */
-#define LUA_VERSION_RELEASE	"4 (kernel)"
-#endif /* _KERNEL */
 
 #define LUA_VERSION	"Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
 #define LUA_RELEASE	LUA_VERSION "." LUA_VERSION_RELEASE
-#ifndef _KERNEL
 #define LUA_COPYRIGHT	LUA_RELEASE "  Copyright (C) 1994-2017 Lua.org, PUC-Rio"
-#else /* _KERNEL */
-#define LUA_COPYRIGHT	LUA_RELEASE \
-	"  Copyright (c) 2016-2016, Lourival Vieira Neto ." \
-	"  Copyright (C) 1994-2017 Lua.org, PUC-Rio"
-#endif /* _KERNEL */
 #define LUA_AUTHORS	"R. Ierusalimschy, L. H. de Figueiredo, W. Celes"
 
 



CVS commit: src

2017-05-20 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat May 20 16:35:55 UTC 2017

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/bin/sh: Makefile
Added Files:
src/tests/bin/sh: t_syntax.sh

Log Message:
Add a test of sh syntax & parsing (first attempt anyway.)


To generate a diff of this commit:
cvs rdiff -u -r1.743 -r1.744 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.11 -r1.12 src/tests/bin/sh/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/bin/sh/t_syntax.sh

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.743 src/distrib/sets/lists/tests/mi:1.744
--- src/distrib/sets/lists/tests/mi:1.743	Mon May 15 09:58:22 2017
+++ src/distrib/sets/lists/tests/mi	Sat May 20 16:35:55 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.743 2017/05/15 09:58:22 ozaki-r Exp $
+# $NetBSD: mi,v 1.744 2017/05/20 16:35:55 kre Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1278,6 +1278,7 @@
 ./usr/tests/bin/sh/t_redircloexec		tests-bin-tests		compattestfile,atf
 ./usr/tests/bin/sh/t_set_e			tests-bin-tests		compattestfile,atf
 ./usr/tests/bin/sh/t_shift			tests-bin-tests		compattestfile,atf
+./usr/tests/bin/sh/t_syntax			tests-bin-tests		compattestfile,atf
 ./usr/tests/bin/sh/t_ulimit			tests-bin-tests		compattestfile,atf
 ./usr/tests/bin/sh/t_varquote			tests-bin-tests		compattestfile,atf
 ./usr/tests/bin/sh/t_varval			tests-bin-tests		compattestfile,atf

Index: src/tests/bin/sh/Makefile
diff -u src/tests/bin/sh/Makefile:1.11 src/tests/bin/sh/Makefile:1.12
--- src/tests/bin/sh/Makefile:1.11	Sun Mar 20 22:57:04 2016
+++ src/tests/bin/sh/Makefile	Sat May 20 16:35:55 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2016/03/20 22:57:04 christos Exp $
+# $NetBSD: Makefile,v 1.12 2017/05/20 16:35:55 kre Exp $
 #
 
 .include 
@@ -19,6 +19,7 @@ TESTS_SH+=	t_redir
 TESTS_SH+=	t_redircloexec
 TESTS_SH+=	t_set_e
 TESTS_SH+=	t_shift
+TESTS_SH+=	t_syntax
 TESTS_SH+=	t_ulimit
 TESTS_SH+=	t_varquote
 TESTS_SH+=	t_varval

Added files:

Index: src/tests/bin/sh/t_syntax.sh
diff -u /dev/null src/tests/bin/sh/t_syntax.sh:1.1
--- /dev/null	Sat May 20 16:35:55 2017
+++ src/tests/bin/sh/t_syntax.sh	Sat May 20 16:35:55 2017
@@ -0,0 +1,888 @@
+# $NetBSD: t_syntax.sh,v 1.1 2017/05/20 16:35:55 kre Exp $
+#
+# Copyright (c) 2017 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+: ${TEST_SH:=/bin/sh}
+
+# This set of tests verifies various requirementgs relating to correct
+# (and incorrect) syntax of shell input
+#
+# There is no intent in these tests to verify correct operation
+# (though that sometimes cannot be separated from correct parsing.)
+# That is (or should be) verified elsewhere.
+#
+# Also, some very basic syntax is tested in almost every test
+# (they cannot work without basic parsing of elementary commands)
+# so that is also not explicitly tested here.
+#
+# Similarly word expansion, field splitting, redirection, all have
+# tests of their own (though we do test parsing of redirect ops).
+#
+# Note that in order to test the basic facilities, other shell operations
+# are used - a test failure here does not necessarily mean that the
+# operation intended to be tested is faulty, just that something is.
+
+atf_test_case a_basic_tokenisation
+a_basic_tokenisation_head() {
+	atf_set "descr" "Test the shell correctly finds various tokens"
+}
+a_basic_tokenisation_body() {
+	atf_check -s exit:0 -o 'inline:3\n' -e empty ${TEST_SH} -c \
+		'set -- a b c; echo $#'
+	atf_check -s exit:0 -o 'inline:2\n' -e empty ${TEST_SH} -c \
+		'se

CVS commit: src/sys/arch

2017-05-20 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun May 21 06:19:37 UTC 2017

Modified Files:
src/sys/arch/amd64/conf: XEN3_DOMU
src/sys/arch/i386/conf: XEN3_DOMU

Log Message:
Remove unnecessary SYSMON_* options.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/amd64/conf/XEN3_DOMU
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/i386/conf/XEN3_DOMU

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/XEN3_DOMU
diff -u src/sys/arch/amd64/conf/XEN3_DOMU:1.74 src/sys/arch/amd64/conf/XEN3_DOMU:1.75
--- src/sys/arch/amd64/conf/XEN3_DOMU:1.74	Thu May 11 15:42:15 2017
+++ src/sys/arch/amd64/conf/XEN3_DOMU	Sun May 21 06:19:37 2017
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOMU,v 1.74 2017/05/11 15:42:15 sborrill Exp $
+# $NetBSD: XEN3_DOMU,v 1.75 2017/05/21 06:19:37 pgoyette Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
@@ -145,12 +145,6 @@ options 	IPFILTER_COMPAT # Compat for IP
 #options 	ALTQ_RIO	# RED with IN/OUT
 #options 	ALTQ_WFQ	# Weighted Fair Queueing
 
-# pseudo-device support for sysmon and its sub-components
-options 	SYSMON_POWER
-options 	SYSMON_ENVSYS
-options 	SYSMON_WDOG
-options 	SYSMON_TASKQ
-
 options 	NFS_BOOT_DHCP,NFS_BOOT_BOOTPARAM
 #options 	NFS_BOOT_BOOTSTATIC
 #options 	NFS_BOOTSTATIC_MYIP="\"169.254.1.2\""

Index: src/sys/arch/i386/conf/XEN3_DOMU
diff -u src/sys/arch/i386/conf/XEN3_DOMU:1.76 src/sys/arch/i386/conf/XEN3_DOMU:1.77
--- src/sys/arch/i386/conf/XEN3_DOMU:1.76	Sun Feb 26 12:41:50 2017
+++ src/sys/arch/i386/conf/XEN3_DOMU	Sun May 21 06:19:37 2017
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOMU,v 1.76 2017/02/26 12:41:50 rin Exp $
+# $NetBSD: XEN3_DOMU,v 1.77 2017/05/21 06:19:37 pgoyette Exp $
 
 include 	"arch/xen/conf/std.xen"
 
@@ -150,12 +150,6 @@ options 	IPFILTER_COMPAT # Compat for IP
 #options 	IPFILTER_DEFAULT_BLOCK	# block all packets by default
 #options 	TCP_DEBUG	# Record last TCP_NDEBUG packets with SO_DEBUG
 
-# pseudo-device support for sysmon and its sub-components
-options 	SYSMON_POWER
-options 	SYSMON_ENVSYS
-options 	SYSMON_WDOG
-options 	SYSMON_TASKQ
-
 #options 	ALTQ		# Manipulate network interfaces' output queues
 #options 	ALTQ_BLUE	# Stochastic Fair Blue
 #options 	ALTQ_CBQ	# Class-Based Queueing



CVS commit: src/sys/arch

2017-05-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun May 21 06:49:13 UTC 2017

Modified Files:
src/sys/arch/evbmips/ingenic: clock.c cpu.c intr.c machdep.c mainbus.c
src/sys/arch/mips/conf: files.ingenic
src/sys/arch/mips/ingenic: ingenic_regs.h ingenic_var.h
Added Files:
src/sys/arch/mips/ingenic: ingenic_coreregs.h
src/sys/arch/mips/mips: locore_ingenic.S

Log Message:
Provide and use some CP0 accessor functions instead of M[TF]C0 macros
for readability.

While here convert some other M[TF]C0 uses to already exising accessor
functions, e.g. mipsNN_cp0_ebase_read


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbmips/ingenic/clock.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbmips/ingenic/cpu.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbmips/ingenic/intr.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbmips/ingenic/machdep.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbmips/ingenic/mainbus.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/mips/conf/files.ingenic
cvs rdiff -u -r0 -r1.1 src/sys/arch/mips/ingenic/ingenic_coreregs.h
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/mips/ingenic/ingenic_regs.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/mips/ingenic/ingenic_var.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/mips/mips/locore_ingenic.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/evbmips/ingenic/clock.c
diff -u src/sys/arch/evbmips/ingenic/clock.c:1.9 src/sys/arch/evbmips/ingenic/clock.c:1.10
--- src/sys/arch/evbmips/ingenic/clock.c:1.9	Fri May 19 07:40:58 2017
+++ src/sys/arch/evbmips/ingenic/clock.c	Sun May 21 06:49:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.9 2017/05/19 07:40:58 skrll Exp $ */
+/*	$NetBSD: clock.c,v 1.10 2017/05/21 06:49:12 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.9 2017/05/19 07:40:58 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.10 2017/05/21 06:49:12 skrll Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -38,6 +38,7 @@ __KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.
 #include 
 #include 
 
+#include 
 #include 
 
 #include "opt_ingenic.h"
@@ -236,7 +237,7 @@ ingenic_clockintr(struct clockframe *cf)
 	 * XXX
 	 * needs to take the IPI lock and ping all online CPUs, not just core 1
 	 */
-	MTC0(1 << IPI_CLOCK, 20, 1);
+	mips_cp0_corembox_write(1, 1 << IPI_CLOCK);
 #endif
 	hardclock(cf);
 	splx(s);

Index: src/sys/arch/evbmips/ingenic/cpu.c
diff -u src/sys/arch/evbmips/ingenic/cpu.c:1.3 src/sys/arch/evbmips/ingenic/cpu.c:1.4
--- src/sys/arch/evbmips/ingenic/cpu.c:1.3	Fri May 19 07:40:58 2017
+++ src/sys/arch/evbmips/ingenic/cpu.c	Sun May 21 06:49:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.3 2017/05/19 07:40:58 skrll Exp $	*/
+/*	$NetBSD: cpu.c,v 1.4 2017/05/21 06:49:12 skrll Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.3 2017/05/19 07:40:58 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.4 2017/05/21 06:49:12 skrll Exp $");
 
 #include "opt_ingenic.h"
 #include "opt_multiprocessor.h"
@@ -47,8 +47,9 @@ __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.3 
 #include 
 
 #include 
-#include 
+#include 
 #include 
+#include 
 
 static int	cpu_match(device_t, cfdata_t, void *);
 static void	cpu_attach(device_t, device_t, void *);
@@ -85,14 +86,16 @@ cpu_attach(device_t parent, device_t sel
 		ci = startup_cpu_info;
 		wbflush();
 		vec = (uint32_t)&ingenic_wakeup;
-		reg = MFC0(12, 4);	/* reset entry reg */
+		reg = mips_cp0_corereim_read();
 		reg &= ~REIM_ENTRY_M;
 		reg |= vec;
-		MTC0(reg, 12, 4);
-		reg = MFC0(12, 2);	/* core control reg */
+		mips_cp0_corereim_write(reg);
+
+		reg = mips_cp0_corectrl_read();
 		reg |= CC_RPC1;		/* use our exception vector */
 		reg &= ~CC_SW_RST1;	/* get core 1 out of reset */
-		MTC0(reg, 12, 2);
+		mips_cp0_corectrl_write(reg);
+
 		while ((!kcpuset_isset(cpus_hatched, cpu_index(startup_cpu_info))) && (bail > 0)) {
 			delay(1000);
 			bail--;

Index: src/sys/arch/evbmips/ingenic/intr.c
diff -u src/sys/arch/evbmips/ingenic/intr.c:1.12 src/sys/arch/evbmips/ingenic/intr.c:1.13
--- src/sys/arch/evbmips/ingenic/intr.c:1.12	Sat Aug 27 05:52:43 2016
+++ src/sys/arch/evbmips/ingenic/intr.c	Sun May 21 06:49:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.12 2016/08/27 05:52:43 skrll Exp $ */
+/*	$NetBSD: intr.c,v 1.13 2017/05/21 06:49:12 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.12 2016/08/27 05:52:43 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.13 2017/05/21 06:49:12 skrll Exp $");
 
 #define __INTR_PRIVATE
 
@@ -44,7 +44,9 @@ __KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.1
 #include 
 #include 
 
+#include 
 #include 
+#include 
 
 #include "opt_ingenic.h"
 
@@ -126,14 +128,15 @@ evbmips_intr_init(void)
 	writereg(JZ_ICMR1, 0x