CVS commit: src/distrib/sun3/miniroot

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 27 02:07:42 UTC 2019

Modified Files:
src/distrib/sun3/miniroot: Makefile

Log Message:
make this a bit bigger to prepare for gcc-8


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/distrib/sun3/miniroot/Makefile

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



CVS commit: src/distrib/sun3/miniroot

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 27 02:07:42 UTC 2019

Modified Files:
src/distrib/sun3/miniroot: Makefile

Log Message:
make this a bit bigger to prepare for gcc-8


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/distrib/sun3/miniroot/Makefile

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

Modified files:

Index: src/distrib/sun3/miniroot/Makefile
diff -u src/distrib/sun3/miniroot/Makefile:1.47 src/distrib/sun3/miniroot/Makefile:1.48
--- src/distrib/sun3/miniroot/Makefile:1.47	Sun Jul 28 06:29:49 2019
+++ src/distrib/sun3/miniroot/Makefile	Sat Oct 26 22:07:42 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.47 2019/07/28 10:29:49 martin Exp $
+#	$NetBSD: Makefile,v 1.48 2019/10/27 02:07:42 christos Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -6,7 +6,7 @@
 .include 
 
 IMAGE=		miniroot.fs
-IMAGESIZE=	6m
+IMAGESIZE=	6500k
 MAKEFS_FLAGS+=	-o density=8k
 
 KERNEL3=	${KERNOBJDIR}/INSTALL/netbsd



CVS commit: src/tests/net/net

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 23:08:27 UTC 2019

Modified Files:
src/tests/net/net: t_tcp.c

Log Message:
- use accept4 instead of paccept for everyone.
- add test for accept preserving non-block
- comment on FreeBSD and Linux behavior.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/net/net/t_tcp.c

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

Modified files:

Index: src/tests/net/net/t_tcp.c
diff -u src/tests/net/net/t_tcp.c:1.10 src/tests/net/net/t_tcp.c:1.11
--- src/tests/net/net/t_tcp.c:1.10	Fri Feb 16 17:20:18 2018
+++ src/tests/net/net/t_tcp.c	Sat Oct 26 19:08:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_tcp.c,v 1.10 2018/02/16 22:20:18 christos Exp $	*/
+/*	$NetBSD: t_tcp.c,v 1.11 2019/10/26 23:08:27 christos Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -33,22 +33,27 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#define _GNU_SOURCE
+
 #include 
 #ifdef __RCSID
-__RCSID("$Id: t_tcp.c,v 1.10 2018/02/16 22:20:18 christos Exp $");
+__RCSID("$Id: t_tcp.c,v 1.11 2019/10/26 23:08:27 christos Exp $");
 #endif
 
-/* Example code. Should block; does with accept not paccept. */
+/* Example code. Should block; does with accept not accept4_. */
 /* Original by: Justin Cormack  */
 
+
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -58,18 +63,14 @@ __RCSID("$Id: t_tcp.c,v 1.10 2018/02/16 
 
 #include "test.h"
 
-#ifdef __linux__
-#define paccept(a, b, c, d, e) accept4((a), (b), (c), (e))
-#endif
-
 static void
 ding(int al)
 {
 }
 
 static void 
-paccept_block(sa_family_t sfamily, sa_family_t cfamily,
-bool pacceptblock, bool fcntlblock)
+accept_test(sa_family_t sfamily, sa_family_t cfamily,
+bool useaccept, bool accept4_block, bool fcntlblock)
 {
 	int srvr = -1, clnt = -1, acpt = -1;
 	int ok, fl;
@@ -152,9 +153,19 @@ paccept_block(sa_family_t sfamily, sa_fa
 
 	/* may not connect first time */
 	ok = connect(clnt, (struct sockaddr *) &bs, addrlen);
+#ifndef __FreeBSD__
+	/* FreeBSD: What's going on here, connect succeeds with no-one
+	 * accepting?
+	 */
 	if (ok != -1 || errno != EINPROGRESS)
 		FAIL("expected connect to fail");
-	acpt = paccept(srvr, NULL, NULL, NULL, pacceptblock ? 0 : SOCK_NONBLOCK);
+#endif
+	if (useaccept) {
+		acpt = accept(srvr, NULL, NULL);
+	} else {
+		acpt = accept4(srvr, NULL, NULL,
+		accept4_block ? 0 : SOCK_NONBLOCK);
+	}
 again:
 	ok = connect(clnt, (struct sockaddr *) &bs, addrlen);
 	if (ok == -1 && errno != EISCONN) {
@@ -183,28 +194,44 @@ again:
 #endif
 
 	if (acpt == -1) {		/* not true under NetBSD */
-		acpt = paccept(srvr, NULL, NULL, NULL,
-		pacceptblock ? 0 : SOCK_NONBLOCK);
+		if (useaccept) {
+			acpt = accept(srvr, NULL, NULL);
+		} else {
+			acpt = accept4(srvr, NULL, NULL,
+			accept4_block ? 0 : SOCK_NONBLOCK);
+		}
 		if (acpt == -1)
-			FAIL("paccept");
+			FAIL("accept4_");
 	}
-	/* This is supposed to only work on Unix sockets but returns garbage */
+#ifdef BSD4_4
+#ifndef __FreeBSD__
+	/* NetBSD: This is supposed to only work on Unix sockets but returns
+	 * garbage
+	 * FreeBSD: fails with EISCONN
+	 */
+
 	if (getpeereid(clnt, &euid, &egid) != -1)
 		FAIL("getpeereid(clnt)");
-	/* This is supposed to only work on Unix sockets but returns garbage */
+	/* NetBSD: This is supposed to only work on Unix sockets but returns
+	 * garbage
+	 * FreeBSD: fails with EISCONN
+	 */
 	if (getpeereid(acpt, &euid, &egid) != -1)
 		FAIL("getpeereid(srvr)");
-
-	if (fcntlblock) {
+#endif
+#endif
+	if (fcntlblock || useaccept) {
 		fl = fcntl(acpt, F_GETFL, 0);
 		if (fl == -1)
 			FAIL("fnctl");
+#ifndef __linux__
+		/* Linux accept returns a blocking socket */
 		if (fl != (O_RDWR|O_NONBLOCK))
 			FAIL("fl 0x%x != 0x%x\n", fl, O_RDWR|O_NONBLOCK);
 		ok = fcntl(acpt, F_SETFL, fl & ~O_NONBLOCK);
 		if (ok == -1)
 			FAIL("fnctl setfl");
-
+#endif
 		fl = fcntl(acpt, F_GETFL, 0);
 		if (fl & O_NONBLOCK)
 			FAIL("fl non blocking after reset");
@@ -216,7 +243,7 @@ again:
 	alarm(1);
 	n = read(acpt, buf, 10);
 
-	if (pacceptblock || fcntlblock) {
+	if (useaccept || accept4_block || fcntlblock) {
 		if (n == -1 && errno != EINTR)
 			FAIL("read");
 	} else {
@@ -232,17 +259,30 @@ fail:
 
 #ifndef TEST
 
-ATF_TC(paccept44_reset_nonblock);
-ATF_TC_HEAD(paccept44_reset_nonblock, tc)
+ATF_TC(accept_44_preserve_nonblock);
+ATF_TC_HEAD(accept_44_preserve_nonblock, tc)
+{
+
+	atf_tc_set_md_var(tc, "descr", "Check that accept(2) preserves "
+	"the non-blocking flag on non-blocking sockets (ipv4->ipv4)");
+}
+
+ATF_TC_BODY(accept_44_preserve_nonblock, tc)
+{
+	accept_test(AF_INET, AF_INET, true, false, false);
+}
+
+ATF_TC(accept4_44_reset_nonblock);
+ATF_TC_HEAD(accept4_44_reset_nonblock, tc)
 {
 
-	atf_tc_set_md_var(tc, "descr", "Check that paccept(2) resets "
+	atf_tc_set_md_var(tc, "descr", "Check that

CVS commit: src/tests/net/net

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 23:08:27 UTC 2019

Modified Files:
src/tests/net/net: t_tcp.c

Log Message:
- use accept4 instead of paccept for everyone.
- add test for accept preserving non-block
- comment on FreeBSD and Linux behavior.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/net/net/t_tcp.c

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



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

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 18:36:25 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_allocator.h

Log Message:
add some more machines to the 32 bit part


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h

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



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

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 18:36:25 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/lsan: lsan_allocator.h

Log Message:
add some more machines to the 32 bit part


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.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/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.2 src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.3
--- src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h:1.2	Fri Oct  4 04:51:33 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/lsan/lsan_allocator.h	Sat Oct 26 14:36:25 2019
@@ -51,6 +51,10 @@ struct ChunkMetadata {
 #if defined(__aarch64__) || defined(__i386__) || defined(__arm__) || \
 ((defined(__sparc__) || \
   defined(__powerpc__) || \
+  defined(__m68k__) || \
+  defined(__hppa__) || \
+  defined(__sh3__) || \
+  defined(__vax__) || \
   defined(__mips__)) && !defined(_LP64))
 static const uptr kRegionSizeLog = 20;
 static const uptr kNumRegions = SANITIZER_MMAP_RANGE_SIZE >> kRegionSizeLog;
@@ -68,7 +72,7 @@ struct AP32 {
 };
 typedef SizeClassAllocator32 PrimaryAllocator;
 #elif defined(__x86_64__) || defined(__powerpc64__) || defined(__sparc64__) || \
-  (defined(__mips64) && defined(_LP64))
+  defined(__alpha__) || (defined(__mips64) && defined(_LP64))
 struct AP64 {  // Allocator64 parameters. Deliberately using a short name.
   static const uptr kSpaceBeg = 0x6000ULL;
   static const uptr kSpaceSize =  0x400ULL; // 4T.



CVS commit: src/lib/libm

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 17:57:20 UTC 2019

Modified Files:
src/lib/libm/arch/m68k: fenv.c
src/lib/libm/src: namespace.h

Log Message:
Separate the NetBSD-specific fenv functions from the standard ones.
No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/arch/m68k/fenv.c
cvs rdiff -u -r1.14 -r1.15 src/lib/libm/src/namespace.h

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

Modified files:

Index: src/lib/libm/arch/m68k/fenv.c
diff -u src/lib/libm/arch/m68k/fenv.c:1.2 src/lib/libm/arch/m68k/fenv.c:1.3
--- src/lib/libm/arch/m68k/fenv.c:1.2	Wed Mar 22 19:11:08 2017
+++ src/lib/libm/arch/m68k/fenv.c	Sat Oct 26 13:57:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.c,v 1.2 2017/03/22 23:11:08 chs Exp $	*/
+/*	$NetBSD: fenv.c,v 1.3 2019/10/26 17:57:20 christos Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: fenv.c,v 1.2 2017/03/22 23:11:08 chs Exp $");
+__RCSID("$NetBSD: fenv.c,v 1.3 2019/10/26 17:57:20 christos Exp $");
 
 #include "namespace.h"
 
@@ -38,10 +38,7 @@ __RCSID("$NetBSD: fenv.c,v 1.2 2017/03/2
 
 #ifdef __weak_alias
 __weak_alias(feclearexcept,_feclearexcept)
-__weak_alias(fedisableexcept,_fedisableexcept)
-__weak_alias(feenableexcept,_feenableexcept)
 __weak_alias(fegetenv,_fegetenv)
-__weak_alias(fegetexcept,_fegetexcept)
 __weak_alias(fegetexceptflag,_fegetexceptflag)
 __weak_alias(fegetround,_fegetround)
 __weak_alias(feholdexcept,_feholdexcept)
@@ -51,6 +48,10 @@ __weak_alias(fesetexceptflag,_fesetexcep
 __weak_alias(fesetround,_fesetround)
 __weak_alias(fetestexcept,_fetestexcept)
 __weak_alias(feupdateenv,_feupdateenv)
+
+__weak_alias(fedisableexcept,_fedisableexcept)
+__weak_alias(feenableexcept,_feenableexcept)
+__weak_alias(fegetexcept,_fegetexcept)
 #endif
 
 #if defined(__GNUC_GNU_INLINE__) && !defined(__lint__)
@@ -68,6 +69,7 @@ extern inline int fegetenv(fenv_t *__env
 extern inline int feholdexcept(fenv_t *__envp);
 extern inline int fesetenv(const fenv_t *__envp);
 extern inline int feupdateenv(const fenv_t *__envp);
+
 extern inline int feenableexcept(int __excepts);
 extern inline int fedisableexcept(int __excepts);
 extern inline int fegetexcept(void);

Index: src/lib/libm/src/namespace.h
diff -u src/lib/libm/src/namespace.h:1.14 src/lib/libm/src/namespace.h:1.15
--- src/lib/libm/src/namespace.h:1.14	Wed Mar 22 19:11:09 2017
+++ src/lib/libm/src/namespace.h	Sat Oct 26 13:57:20 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: namespace.h,v 1.14 2017/03/22 23:11:09 chs Exp $ */
+/* $NetBSD: namespace.h,v 1.15 2019/10/26 17:57:20 christos Exp $ */
 
 #define atan2 _atan2
 #define atan2f _atan2f
@@ -75,10 +75,7 @@
 #define erfcl	_erfcl
 
 #define feclearexcept _feclearexcept
-#define fedisableexcept _fedisableexcept
-#define feenableexcept _feenableexcept
 #define fegetenv _fegetenv
-#define fegetexcept _fegetexcept
 #define fegetexceptflag _fegetexceptflag
 #define fegetround _fegetround
 #define feholdexcept _feholdexcept
@@ -88,3 +85,7 @@
 #define fesetround _fesetround
 #define fetestexcept _fetestexcept
 #define feupdateenv _feupdateenv
+
+#define fedisableexcept _fedisableexcept
+#define feenableexcept _feenableexcept
+#define fegetexcept _fegetexcept



CVS commit: src/lib/libm

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 17:57:20 UTC 2019

Modified Files:
src/lib/libm/arch/m68k: fenv.c
src/lib/libm/src: namespace.h

Log Message:
Separate the NetBSD-specific fenv functions from the standard ones.
No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/arch/m68k/fenv.c
cvs rdiff -u -r1.14 -r1.15 src/lib/libm/src/namespace.h

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



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

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 17:51:49 UTC 2019

Modified Files:
src/sys/arch/m68k/include: fenv.h

Log Message:
disable -Wshadow because in c99 mode these get marked as builtins.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/m68k/include/fenv.h

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

Modified files:

Index: src/sys/arch/m68k/include/fenv.h
diff -u src/sys/arch/m68k/include/fenv.h:1.7 src/sys/arch/m68k/include/fenv.h:1.8
--- src/sys/arch/m68k/include/fenv.h:1.7	Wed Sep 13 05:55:35 2017
+++ src/sys/arch/m68k/include/fenv.h	Sat Oct 26 13:51:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fenv.h,v 1.7 2017/09/13 09:55:35 phx Exp $	*/
+/*	$NetBSD: fenv.h,v 1.8 2019/10/26 17:51:49 christos Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -108,6 +108,11 @@ typedef struct {
 
 __BEGIN_DECLS
 
+#if __GNUC_PREREQ__(8, 0)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow"
+#endif
+
 __fenv_static inline int
 feclearexcept(int __excepts)
 {
@@ -259,6 +264,10 @@ feupdateenv(const fenv_t *__envp)
 	return 0;
 }
 
+#if __GNUC_PREREQ__(8, 0)
+#pragma GCC diagnostic pop
+#endif
+
 #if defined(_NETBSD_SOURCE) || defined(_GNU_SOURCE)
 
 __fenv_static inline int



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

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 17:51:49 UTC 2019

Modified Files:
src/sys/arch/m68k/include: fenv.h

Log Message:
disable -Wshadow because in c99 mode these get marked as builtins.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/m68k/include/fenv.h

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



CVS commit: src/sys/arch/m68k/m68k

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 17:50:18 UTC 2019

Modified Files:
src/sys/arch/m68k/m68k: db_disasm.c

Log Message:
Add missing FALLTHROUGH (I am not 100% certain if this is correct), but
breaking/returning will end up printing nothing.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/m68k/m68k/db_disasm.c

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



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

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 17:49:34 UTC 2019

Modified Files:
src/sys/arch/m68k/include: reg.h

Log Message:
Hide the register definitions that should eventually be removed (or prefixed
with _REG_ with #ifdef _KERNEL. This avoids conflicts with let's say PC in
.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/m68k/include/reg.h

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



CVS commit: src/sys/arch/m68k/m68k

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 17:50:18 UTC 2019

Modified Files:
src/sys/arch/m68k/m68k: db_disasm.c

Log Message:
Add missing FALLTHROUGH (I am not 100% certain if this is correct), but
breaking/returning will end up printing nothing.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/m68k/m68k/db_disasm.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/m68k/m68k/db_disasm.c
diff -u src/sys/arch/m68k/m68k/db_disasm.c:1.43 src/sys/arch/m68k/m68k/db_disasm.c:1.44
--- src/sys/arch/m68k/m68k/db_disasm.c:1.43	Wed Jul 10 23:49:51 2019
+++ src/sys/arch/m68k/m68k/db_disasm.c	Sat Oct 26 13:50:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_disasm.c,v 1.43 2019/07/11 03:49:51 msaitoh Exp $	*/
+/*	$NetBSD: db_disasm.c,v 1.44 2019/10/26 17:50:18 christos Exp $	*/
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.43 2019/07/11 03:49:51 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.44 2019/10/26 17:50:18 christos Exp $");
 
 #include 
 #ifdef _KERNEL
@@ -1493,6 +1493,7 @@ opcode_fpu(dis_buffer_t *dbuf, u_short o
 			return;
 
 		}
+		/* FALLTHROUGH */
 	/* cpBcc */
 	case 2:
 		if (BITFIELD(opc,5,0) == 0 && *(dbuf->val + 1) == 0) {



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

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 17:49:34 UTC 2019

Modified Files:
src/sys/arch/m68k/include: reg.h

Log Message:
Hide the register definitions that should eventually be removed (or prefixed
with _REG_ with #ifdef _KERNEL. This avoids conflicts with let's say PC in
.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/m68k/include/reg.h

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

Modified files:

Index: src/sys/arch/m68k/include/reg.h
diff -u src/sys/arch/m68k/include/reg.h:1.19 src/sys/arch/m68k/include/reg.h:1.20
--- src/sys/arch/m68k/include/reg.h:1.19	Fri Jan  3 19:10:02 2014
+++ src/sys/arch/m68k/include/reg.h	Sat Oct 26 13:49:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: reg.h,v 1.19 2014/01/04 00:10:02 dsl Exp $	*/
+/*	$NetBSD: reg.h,v 1.20 2019/10/26 17:49:34 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -57,8 +57,9 @@ struct fpreg {
 	int	r_fpiar;
 };
 
-/*  this is historical (but it can't be deprecated quite yet) */
+#ifdef _KERNEL
 
+/*  this is historical (but it can't be deprecated quite yet) */
 /*
  * Location of the users' stored
  * registers relative to D0.
@@ -86,7 +87,6 @@ struct fpreg {
 #define	PS	(16)
 #define	PC	(17)
 
-#ifdef _KERNEL
 /*
  * Due to a mental lapse somewhere down the line, wait returns its values
  * in strange registers.  Kludge it up here so we don't have to in the



CVS commit: src/sys/arch/arm/ti

2019-10-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 26 15:58:55 UTC 2019

Modified Files:
src/sys/arch/arm/ti: files.ti
Added Files:
src/sys/arch/arm/ti: ti_sysc.c

Log Message:
Add bus driver for TI sysc interconncet.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/ti/files.ti
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/ti/ti_sysc.c

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

Modified files:

Index: src/sys/arch/arm/ti/files.ti
diff -u src/sys/arch/arm/ti/files.ti:1.5 src/sys/arch/arm/ti/files.ti:1.6
--- src/sys/arch/arm/ti/files.ti:1.5	Sat Oct 26 14:57:27 2019
+++ src/sys/arch/arm/ti/files.ti	Sat Oct 26 15:58:55 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.ti,v 1.5 2019/10/26 14:57:27 jmcneill Exp $
+#	$NetBSD: files.ti,v 1.6 2019/10/26 15:58:55 jmcneill Exp $
 #
 
 file	arch/arm/ti/ti_platform.c	soc_ti
@@ -6,7 +6,12 @@ file	arch/arm/ti/ti_platform.c	soc_ti
 # Interrupt controller
 device	omapintc: pic, pic_splfuncs
 attach  omapintc at fdt
-file	arch/arm/ti/ti_omapintc.c omapintc
+file	arch/arm/ti/ti_omapintc.c	omapintc
+
+# sysc interconnect
+device	tisysc { } : fdt, ti_prcm
+attach	tisysc at fdt with ti_sysc
+file	arch/arm/ti/ti_sysc.c		ti_sysc
 
 # PRCM
 define	ti_prcm

Added files:

Index: src/sys/arch/arm/ti/ti_sysc.c
diff -u /dev/null src/sys/arch/arm/ti/ti_sysc.c:1.1
--- /dev/null	Sat Oct 26 15:58:55 2019
+++ src/sys/arch/arm/ti/ti_sysc.c	Sat Oct 26 15:58:55 2019
@@ -0,0 +1,72 @@
+/* $NetBSD: ti_sysc.c,v 1.1 2019/10/26 15:58:55 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2019 Jared McNeill 
+ * 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 AUTHOR ``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 AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: ti_sysc.c,v 1.1 2019/10/26 15:58:55 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+static int	ti_sysc_match(device_t, cfdata_t, void *);
+static void	ti_sysc_attach(device_t, device_t, void *);
+
+CFATTACH_DECL_NEW(ti_sysc, 0, ti_sysc_match, ti_sysc_attach, NULL, NULL);
+
+static const char * compatible[] = {
+	"ti,sysc",
+	NULL
+};
+
+static int
+ti_sysc_match(device_t parent, cfdata_t cf, void *aux)
+{
+	struct fdt_attach_args * const faa = aux;
+
+	return of_match_compatible(faa->faa_phandle, compatible);
+}
+
+static void
+ti_sysc_attach(device_t parent, device_t self, void *aux)
+{
+	struct fdt_attach_args * const faa = aux;
+	const int phandle = faa->faa_phandle;
+
+	aprint_naive("\n");
+	aprint_normal("\n");
+
+	fdt_add_bus(self, phandle, faa);
+}



CVS commit: src/sys/arch/arm/ti

2019-10-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 26 15:58:55 UTC 2019

Modified Files:
src/sys/arch/arm/ti: files.ti
Added Files:
src/sys/arch/arm/ti: ti_sysc.c

Log Message:
Add bus driver for TI sysc interconncet.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/ti/files.ti
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/ti/ti_sysc.c

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



CVS commit: src/sys/arch/arm/ti

2019-10-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 26 15:58:15 UTC 2019

Modified Files:
src/sys/arch/arm/ti: ti_platform.c

Log Message:
Fix am33xx_platform_early_putchar for pre-MMU output


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/ti/ti_platform.c

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

Modified files:

Index: src/sys/arch/arm/ti/ti_platform.c
diff -u src/sys/arch/arm/ti/ti_platform.c:1.6 src/sys/arch/arm/ti/ti_platform.c:1.7
--- src/sys/arch/arm/ti/ti_platform.c:1.6	Tue Oct 30 16:41:52 2018
+++ src/sys/arch/arm/ti/ti_platform.c	Sat Oct 26 15:58:15 2019
@@ -1,9 +1,9 @@
-/* $NetBSD: ti_platform.c,v 1.6 2018/10/30 16:41:52 skrll Exp $ */
+/* $NetBSD: ti_platform.c,v 1.7 2019/10/26 15:58:15 jmcneill Exp $ */
 
 #include "opt_console.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ti_platform.c,v 1.6 2018/10/30 16:41:52 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ti_platform.c,v 1.7 2019/10/26 15:58:15 jmcneill Exp $");
 
 #include 
 
@@ -25,7 +25,9 @@ am33xx_platform_early_putchar(char c)
 {
 #ifdef CONSADDR
 #define CONSADDR_VA ((CONSADDR - 0x44c0) + 0xe4c0)
-	volatile uint32_t *uartaddr = (volatile uint32_t *)CONSADDR_VA;
+	volatile uint32_t *uartaddr = cpu_earlydevice_va_p() ?
+	(volatile uint32_t *)CONSADDR_VA :
+	(volatile uint32_t *)CONSADDR;
 
 	while ((le32toh(uartaddr[com_lsr]) & LSR_TXRDY) == 0)
 		;



CVS commit: src/sys/arch/arm/ti

2019-10-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 26 15:58:15 UTC 2019

Modified Files:
src/sys/arch/arm/ti: ti_platform.c

Log Message:
Fix am33xx_platform_early_putchar for pre-MMU output


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/ti/ti_platform.c

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



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

2019-10-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 26 15:01:18 UTC 2019

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

Log Message:
Do not search 64-bit directories for dts files


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/evbarm/conf/GENERIC

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



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

2019-10-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 26 15:01:18 UTC 2019

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

Log Message:
Do not search 64-bit directories for dts files


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/evbarm/conf/GENERIC

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

Modified files:

Index: src/sys/arch/evbarm/conf/GENERIC
diff -u src/sys/arch/evbarm/conf/GENERIC:1.54 src/sys/arch/evbarm/conf/GENERIC:1.55
--- src/sys/arch/evbarm/conf/GENERIC:1.54	Tue Oct  8 23:03:01 2019
+++ src/sys/arch/evbarm/conf/GENERIC	Sat Oct 26 15:01:18 2019
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC,v 1.54 2019/10/08 23:03:01 bad Exp $
+#	$NetBSD: GENERIC,v 1.55 2019/10/26 15:01:18 jmcneill Exp $
 #
 #	GENERIC ARM (aarch32) kernel
 #
@@ -12,9 +12,9 @@ include	"arch/evbarm/conf/GENERIC.common
 # FDT files supported by this kernel - add to DTSSUBDIR and DTS as
 # appropriate
 #
-makeoptions	DTSARCH="arm aarch64"
-makeoptions	DTSGNUARCH="arm arm64"
-makeoptions	DTSSUBDIR="allwinner broadcom nvidia rockchip socfpga"
+makeoptions	DTSARCH="arm"
+makeoptions	DTSGNUARCH="arm"
+makeoptions	DTSSUBDIR=""
 makeoptions	DTS="
 	bcm2836-rpi-2-b.dts
 	bcm2837-rpi-3-a-plus.dts



CVS commit: src/sys/arch

2019-10-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 26 14:57:27 UTC 2019

Modified Files:
src/sys/arch/arm/ti: files.ti
src/sys/arch/evbarm/conf: files.generic
Removed Files:
src/sys/arch/evbarm/conf: TI files.ti std.ti

Log Message:
Adapt ti fdt glue to support GENERIC kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/ti/files.ti
cvs rdiff -u -r1.6 -r0 src/sys/arch/evbarm/conf/TI
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/conf/files.generic
cvs rdiff -u -r1.2 -r0 src/sys/arch/evbarm/conf/files.ti
cvs rdiff -u -r1.5 -r0 src/sys/arch/evbarm/conf/std.ti

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



CVS commit: src/sys/arch

2019-10-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 26 14:57:27 UTC 2019

Modified Files:
src/sys/arch/arm/ti: files.ti
src/sys/arch/evbarm/conf: files.generic
Removed Files:
src/sys/arch/evbarm/conf: TI files.ti std.ti

Log Message:
Adapt ti fdt glue to support GENERIC kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/ti/files.ti
cvs rdiff -u -r1.6 -r0 src/sys/arch/evbarm/conf/TI
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/conf/files.generic
cvs rdiff -u -r1.2 -r0 src/sys/arch/evbarm/conf/files.ti
cvs rdiff -u -r1.5 -r0 src/sys/arch/evbarm/conf/std.ti

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

Modified files:

Index: src/sys/arch/arm/ti/files.ti
diff -u src/sys/arch/arm/ti/files.ti:1.4 src/sys/arch/arm/ti/files.ti:1.5
--- src/sys/arch/arm/ti/files.ti:1.4	Wed Nov 21 08:55:05 2018
+++ src/sys/arch/arm/ti/files.ti	Sat Oct 26 14:57:27 2019
@@ -1,16 +1,7 @@
-#	$NetBSD: files.ti,v 1.4 2018/11/21 08:55:05 skrll Exp $
+#	$NetBSD: files.ti,v 1.5 2019/10/26 14:57:27 jmcneill Exp $
 #
 
-file	arch/arm/arm32/arm32_boot.c
-file	arch/arm/arm32/arm32_kvminit.c
-file	arch/arm/arm32/arm32_reboot.c
-file	arch/arm/arm32/irq_dispatch.S
-
-file	arch/arm/arm32/armv7_generic_space.c
-file	arch/arm/arm/arm_generic_dma.c
-file	arch/arm/arm/bus_space_a4x.S
-
-file	arch/arm/ti/ti_platform.c
+file	arch/arm/ti/ti_platform.c	soc_ti
 
 # Interrupt controller
 device	omapintc: pic, pic_splfuncs
@@ -27,8 +18,10 @@ attach	am3prcm at fdt with am3_prcm
 file	arch/arm/ti/am3_prcm.c		am3_prcm
 
 # UART
-attach	com at fdt with ti_com
-file	arch/arm/ti/ti_com.c	ti_com needs-flag
+ifdef soc_ti
+attach	com at fdt with ti_com: ti_prcm
+file	arch/arm/ti/ti_com.c		ti_com needs-flag
+endif
 
 # Timer
 device	omaptimer
@@ -38,4 +31,8 @@ file	arch/arm/ti/ti_omaptimer.c	omaptime
 # Ethernet
 device  cpsw: ether, ifnet, arp, mii, mii_phy
 attach  cpsw at fdt
-filearch/arm/ti/if_cpsw.c cpsw
+filearch/arm/ti/if_cpsw.c		cpsw
+
+# SOC parameters
+defflag	opt_soc.h			SOC_TI
+defflag	opt_soc.h			SOC_TI_AM335X: SOC_TI

Index: src/sys/arch/evbarm/conf/files.generic
diff -u src/sys/arch/evbarm/conf/files.generic:1.8 src/sys/arch/evbarm/conf/files.generic:1.9
--- src/sys/arch/evbarm/conf/files.generic:1.8	Sun Sep 15 21:04:41 2019
+++ src/sys/arch/evbarm/conf/files.generic	Sat Oct 26 14:57:27 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.generic,v 1.8 2019/09/15 21:04:41 bouyer Exp $
+#	$NetBSD: files.generic,v 1.9 2019/10/26 14:57:27 jmcneill Exp $
 #
 # A generic (aarch32) kernel configuration info
 #
@@ -23,6 +23,7 @@ include "arch/arm/broadcom/files.bcm2835
 include "arch/arm/nvidia/files.tegra"
 include "arch/arm/samsung/files.exynos"
 include "arch/arm/sunxi/files.sunxi"
+include "arch/arm/ti/files.ti"
 include "arch/arm/vexpress/files.vexpress"
 include "arch/arm/virt/files.virt"
 include "arch/arm/xilinx/files.zynq"



CVS commit: src/sys/compat

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 11:34:48 UTC 2019

Modified Files:
src/sys/compat/sunos: sunos_misc.c
src/sys/compat/sunos32: sunos32_misc.c

Log Message:
use strlcpy() for the uts conversion, makes the code simpler and more readable.


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/compat/sunos/sunos_misc.c
cvs rdiff -u -r1.82 -r1.83 src/sys/compat/sunos32/sunos32_misc.c

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



CVS commit: src/sys/compat

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 11:34:48 UTC 2019

Modified Files:
src/sys/compat/sunos: sunos_misc.c
src/sys/compat/sunos32: sunos32_misc.c

Log Message:
use strlcpy() for the uts conversion, makes the code simpler and more readable.


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/compat/sunos/sunos_misc.c
cvs rdiff -u -r1.82 -r1.83 src/sys/compat/sunos32/sunos32_misc.c

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

Modified files:

Index: src/sys/compat/sunos/sunos_misc.c
diff -u src/sys/compat/sunos/sunos_misc.c:1.175 src/sys/compat/sunos/sunos_misc.c:1.176
--- src/sys/compat/sunos/sunos_misc.c:1.175	Fri Oct  4 08:24:12 2019
+++ src/sys/compat/sunos/sunos_misc.c	Sat Oct 26 07:34:48 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunos_misc.c,v 1.175 2019/10/04 12:24:12 mrg Exp $	*/
+/*	$NetBSD: sunos_misc.c,v 1.176 2019/10/26 11:34:48 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.175 2019/10/04 12:24:12 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.176 2019/10/26 11:34:48 christos Exp $");
 
 #include 
 #include 
@@ -653,15 +653,13 @@ sunos_sys_uname(struct lwp *l, const str
 
 	memset(&sut, 0, sizeof(sut));
 
-	memcpy(sut.sysname, ostype, sizeof(sut.sysname) - 1);
-	memcpy(sut.nodename, hostname, sizeof(sut.nodename));
-	sut.nodename[sizeof(sut.nodename)-1] = '\0';
-	memcpy(sut.release, osrelease, sizeof(sut.release) - 1);
-	sut.version[0] = '1';
-	memcpy(sut.machine, machine, sizeof(sut.machine) - 1);
+	strlcpy(sut.sysname, ostype, sizeof(sut.sysname));
+	strlcpy(sut.nodename, hostname, sizeof(sut.nodename));
+	strlcpy(sut.release, osrelease, sizeof(sut.release));
+	strlcpy(sut.version, "1", sizeof(sut.version));
+	strlcpy(sut.machine, machine, sizeof(sut.machine));
 
-	return copyout((void *)&sut, (void *)SCARG(uap, name),
-	sizeof(struct sunos_utsname));
+	return copyout(&sut, SCARG(uap, name), sizeof(sut));
 }
 
 int

Index: src/sys/compat/sunos32/sunos32_misc.c
diff -u src/sys/compat/sunos32/sunos32_misc.c:1.82 src/sys/compat/sunos32/sunos32_misc.c:1.83
--- src/sys/compat/sunos32/sunos32_misc.c:1.82	Mon Sep 23 17:07:39 2019
+++ src/sys/compat/sunos32/sunos32_misc.c	Sat Oct 26 07:34:48 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunos32_misc.c,v 1.82 2019/09/23 21:07:39 christos Exp $	*/
+/*	$NetBSD: sunos32_misc.c,v 1.83 2019/10/26 11:34:48 christos Exp $	*/
 /* from :NetBSD: sunos_misc.c,v 1.107 2000/12/01 19:25:10 jdolecek Exp	*/
 
 /*
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.82 2019/09/23 21:07:39 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.83 2019/10/26 11:34:48 christos Exp $");
 
 #define COMPAT_SUNOS 1
 
@@ -926,15 +926,13 @@ sunos32_sys_uname(struct lwp *l, const s
 
 	memset(&sut, 0, sizeof(sut));
 
-	memcpy(sut.sysname, ostype, sizeof(sut.sysname) - 1);
-	memcpy(sut.nodename, hostname, sizeof(sut.nodename));
-	sut.nodename[sizeof(sut.nodename)-1] = '\0';
-	memcpy(sut.release, osrelease, sizeof(sut.release) - 1);
-	memcpy(sut.version, "1", sizeof(sut.version) - 1);
-	memcpy(sut.machine, machine, sizeof(sut.machine) - 1);
+	strlcpy(sut.sysname, ostype, sizeof(sut.sysname));
+	strlcpy(sut.nodename, hostname, sizeof(sut.nodename));
+	strlcpy(sut.release, osrelease, sizeof(sut.release));
+	strlcpy(sut.version, "1", sizeof(sut.version));
+	strlcpy(sut.machine, machine, sizeof(sut.machine));
 
-	return copyout((void *)&sut, SCARG_P32(uap, name),
-	sizeof(struct sunos_utsname));
+	return copyout(&sut, SCARG_P32(uap, name), sizeof(sut));
 }
 
 int



CVS commit: src/sys/arch/zaurus/stand/zbsdmod

2019-10-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Oct 26 10:10:14 UTC 2019

Modified Files:
src/sys/arch/zaurus/stand/zbsdmod: Makefile

Log Message:
Misc cleanup to avoid future confusion.

- Remove more unnecessary debug sections
- Use DBG instead of COPTS to specify -Os as defined in bsd.prog.mk
- Use CFLAGS and CPPFLAGS correctly
- Explicitly set -ffreestanding


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/zaurus/stand/zbsdmod/Makefile

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



CVS commit: src/sys/arch/zaurus/stand/zbsdmod

2019-10-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Oct 26 10:10:14 UTC 2019

Modified Files:
src/sys/arch/zaurus/stand/zbsdmod: Makefile

Log Message:
Misc cleanup to avoid future confusion.

- Remove more unnecessary debug sections
- Use DBG instead of COPTS to specify -Os as defined in bsd.prog.mk
- Use CFLAGS and CPPFLAGS correctly
- Explicitly set -ffreestanding


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/zaurus/stand/zbsdmod/Makefile

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/zaurus/stand/zbsdmod/Makefile
diff -u src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.11 src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.12
--- src/sys/arch/zaurus/stand/zbsdmod/Makefile:1.11	Mon Sep 23 13:42:37 2019
+++ src/sys/arch/zaurus/stand/zbsdmod/Makefile	Sat Oct 26 10:10:14 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.11 2019/09/23 13:42:37 christos Exp $
+#	$NetBSD: Makefile,v 1.12 2019/10/26 10:10:14 tsutsui Exp $
 
 WARNS?=	4
 
@@ -10,8 +10,18 @@ OBJS=	zbsdmod.o
 SRCS=	zbsdmod.c
 NOMAN=	# defined
 
+OBJCOPY_FLAGS=			\
+	-R .debug_abbrev	\
+	-R .debug_aranges	\
+	-R .debug_info		\
+	-R .debug_line		\
+	-R .debug_loc		\
+	-R .debug_ranges	\
+	-R .debug_str		\
+	-R .eh_frame
+
 realall: ${OBJS}
-	${OBJCOPY} -R .eh_frame ${.OBJDIR}/zbsdmod.o
+	${OBJCOPY} ${OBJCOPY_FLAGS} ${.OBJDIR}/zbsdmod.o
 
 .include 
 .include 
@@ -21,11 +31,12 @@ afterinstall:
 		${OBJS} ${DESTDIR}/${BINDIR}
 
 CPUFLAGS=
-COPTS=		-Os
+DBG=		-Os
 CFLAGS+=	-fno-strict-aliasing
-CFLAGS+=	-DMACHINE=\"${MACHINE}\" -DUTS_RELEASE=\"2.4.20\"
-CPPFLAGS+=	${ARM_APCS_FLAGS} -mcpu=xscale
-CPPFLAGS+=  -nostdinc -D_STANDALONE
+CFLAGS+=	-ffreestanding -nostdinc
+CFLAGS+=	${ARM_APCS_FLAGS} -mcpu=xscale
+CPPFLAGS+=	-DMACHINE=\"${MACHINE}\" -DUTS_RELEASE=\"2.4.20\"
+CPPFLAGS+=	-D_STANDALONE
 CPPFLAGS+=	-I${.OBJDIR} -I${S}
 
 release: check_RELEASEDIR



CVS commit: src/sys/arch/zaurus/stand/zbsdmod

2019-10-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Oct 26 09:58:40 UTC 2019

Modified Files:
src/sys/arch/zaurus/stand/zbsdmod: zbsdmod.c

Log Message:
Fix another boot failure issue of NetBSD/zaurus 8.x and later.

It looks some cacheline alignment restriction so that zbsdmod.o in
NetBSD/zaurus 8.x release cannot jump to a loaded kernel properly.
Adding an explicit alingment pseudo op to put all instructions
between I-cache flush and jumping to the loaded kernel into the
same cacheline solves the issue.

See my post in port-zaurus@ for details:
 https://mail-index.netbsd.org/port-zaurus/2019/10/22/msg69.html

Should be pulled up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.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/zaurus/stand/zbsdmod/zbsdmod.c
diff -u src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.9 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.10
--- src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:1.9	Mon Dec  2 18:36:11 2013
+++ src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c	Sat Oct 26 09:58:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: zbsdmod.c,v 1.9 2013/12/02 18:36:11 joerg Exp $	*/
+/*	$NetBSD: zbsdmod.c,v 1.10 2019/10/26 09:58:40 tsutsui Exp $	*/
 /*	$OpenBSD: zbsdmod.c,v 1.7 2005/05/02 02:45:29 uwe Exp $	*/
 
 /*
@@ -284,6 +284,13 @@ elf32bsdboot(void)
 		"mov	r1, r1;"
 		"sub	pc, pc, #4;"
 		"mov	r1, #(0x0010 | 0x0020);"
+		/*
+		 * Put the rest of instructions into the same cacheline
+		 * to make sure no I$ refill after invalidation.
+		 */
+		"b	2f;"
+		".align 5;"
+		"2:"
 		"mcr	p15, 0, r1, c1, c0, 0;" /* Write new control register */
 		"mcr	p15, 0, r1, c8, c7, 0;" /* invalidate I+D TLB */
 		"mcr	p15, 0, r1, c7, c5, 0;" /* invalidate I$ and BTB */



CVS commit: src/sys/arch/zaurus/stand/zbsdmod

2019-10-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Oct 26 09:58:40 UTC 2019

Modified Files:
src/sys/arch/zaurus/stand/zbsdmod: zbsdmod.c

Log Message:
Fix another boot failure issue of NetBSD/zaurus 8.x and later.

It looks some cacheline alignment restriction so that zbsdmod.o in
NetBSD/zaurus 8.x release cannot jump to a loaded kernel properly.
Adding an explicit alingment pseudo op to put all instructions
between I-cache flush and jumping to the loaded kernel into the
same cacheline solves the issue.

See my post in port-zaurus@ for details:
 https://mail-index.netbsd.org/port-zaurus/2019/10/22/msg69.html

Should be pulled up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c

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



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

2019-10-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Oct 26 09:49:14 UTC 2019

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

Log Message:
Explicitly set empty LINKENTRY to keep ENTRY address specified in ldscript.

This fixes kernel boot failures of NetBSD/zaurus 8.x and later.
While here, also set empty TEXTADDR also specified in ldscript.

See my post in port-zaurus@ for details:
 https://mail-index.netbsd.org/port-zaurus/2019/10/22/msg69.html

Should be pulled up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/zaurus/conf/Makefile.zaurus.inc

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

Modified files:

Index: src/sys/arch/zaurus/conf/Makefile.zaurus.inc
diff -u src/sys/arch/zaurus/conf/Makefile.zaurus.inc:1.9 src/sys/arch/zaurus/conf/Makefile.zaurus.inc:1.10
--- src/sys/arch/zaurus/conf/Makefile.zaurus.inc:1.9	Tue Aug 25 02:38:15 2015
+++ src/sys/arch/zaurus/conf/Makefile.zaurus.inc	Sat Oct 26 09:49:13 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.zaurus.inc,v 1.9 2015/08/25 02:38:15 uebayasi Exp $
+#	$NetBSD: Makefile.zaurus.inc,v 1.10 2019/10/26 09:49:13 tsutsui Exp $
 
 MACHINE_ARCH?=		arm
 CPPFLAGS+=		-D${MACHINE}
@@ -20,6 +20,8 @@ SYSTEM_LD_TAIL_EXTRA+=; \
 KERNEL_BASE_VIRT=	$(LOADADDRESS)
 
 KERNLDSCRIPT=		ldscript
+TEXTADDR=		# defined in ldscript
+LINKENTRY=		# defined in ldscript
 
 EXTRA_CLEAN+=		netbsd.map assym.d ldscript tmp
 



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

2019-10-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Oct 26 09:49:14 UTC 2019

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

Log Message:
Explicitly set empty LINKENTRY to keep ENTRY address specified in ldscript.

This fixes kernel boot failures of NetBSD/zaurus 8.x and later.
While here, also set empty TEXTADDR also specified in ldscript.

See my post in port-zaurus@ for details:
 https://mail-index.netbsd.org/port-zaurus/2019/10/22/msg69.html

Should be pulled up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/zaurus/conf/Makefile.zaurus.inc

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



CVS commit: src/usr.sbin/sysinst

2019-10-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 26 07:32:52 UTC 2019

Modified Files:
src/usr.sbin/sysinst: part_edit.c partitions.c

Log Message:
In non-MBR specific files, #ifdef all tests for MBR for architectures
that do not even compile in MBR support.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sysinst/part_edit.c
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/partitions.c

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

Modified files:

Index: src/usr.sbin/sysinst/part_edit.c
diff -u src/usr.sbin/sysinst/part_edit.c:1.9 src/usr.sbin/sysinst/part_edit.c:1.10
--- src/usr.sbin/sysinst/part_edit.c:1.9	Fri Oct 25 12:24:34 2019
+++ src/usr.sbin/sysinst/part_edit.c	Sat Oct 26 07:32:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: part_edit.c,v 1.9 2019/10/25 12:24:34 martin Exp $ */
+/*	$NetBSD: part_edit.c,v 1.10 2019/10/26 07:32:52 martin Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -1218,8 +1218,10 @@ select_part_scheme(
 		if (bootable && p->have_boot_support != NULL &&
 		!p->have_boot_support(dev->diskdev))
 			continue;
+#ifdef HAVE_MBR
 		if (dev->no_mbr && p->name == MSG_parttype_mbr)
 			continue;
+#endif
 		if (p->size_limit && dev->dlsize > p->size_limit) {
 			char buf[255], hum_lim[5];
 

Index: src/usr.sbin/sysinst/partitions.c
diff -u src/usr.sbin/sysinst/partitions.c:1.3 src/usr.sbin/sysinst/partitions.c:1.4
--- src/usr.sbin/sysinst/partitions.c:1.3	Fri Oct 25 12:49:58 2019
+++ src/usr.sbin/sysinst/partitions.c	Sat Oct 26 07:32:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partitions.c,v 1.3 2019/10/25 12:49:58 martin Exp $	*/
+/*	$NetBSD: partitions.c,v 1.4 2019/10/26 07:32:52 martin Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -53,8 +53,10 @@ partitions_read_disk(const char *dev, da
 		return NULL;
 
 	for (ps = available_part_schemes; *ps; ps++) {
+#ifdef HAVE_MBR
 		if (no_mbr && (*ps)->name == MSG_parttype_mbr)
 			continue;
+#endif
 		struct disk_partitions *parts =
 		(*ps)->read_from_disk(dev, 0, disk_size, *ps);
 		if (parts)



CVS commit: src/usr.sbin/sysinst

2019-10-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 26 07:32:52 UTC 2019

Modified Files:
src/usr.sbin/sysinst: part_edit.c partitions.c

Log Message:
In non-MBR specific files, #ifdef all tests for MBR for architectures
that do not even compile in MBR support.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/sysinst/part_edit.c
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/partitions.c

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



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

2019-10-26 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Sat Oct 26 07:31:39 UTC 2019

Modified Files:
src/distrib/sets/lists/xserver: md.alpha md.amd64 md.amiga md.bebox
md.cats md.dreamcast md.evbarm md.evbmips md.ews4800mips md.hp300
md.hpcarm md.hpcmips md.hpcsh md.i386 md.ibmnws md.iyonix
md.luna68k md.mac68k md.macppc md.netwinder md.newsmips md.ofppc
md.prep md.sgimips md.shark md.sparc md.sparc64 md.vax md.x68k
md.zaurus mi

Log Message:
Give syspkg names to xserver without machine dependet files


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/distrib/sets/lists/xserver/md.alpha
cvs rdiff -u -r1.109 -r1.110 src/distrib/sets/lists/xserver/md.amd64
cvs rdiff -u -r1.28 -r1.29 src/distrib/sets/lists/xserver/md.amiga
cvs rdiff -u -r1.19 -r1.20 src/distrib/sets/lists/xserver/md.bebox \
src/distrib/sets/lists/xserver/md.luna68k \
src/distrib/sets/lists/xserver/md.vax \
src/distrib/sets/lists/xserver/md.x68k
cvs rdiff -u -r1.60 -r1.61 src/distrib/sets/lists/xserver/md.cats \
src/distrib/sets/lists/xserver/md.sgimips
cvs rdiff -u -r1.26 -r1.27 src/distrib/sets/lists/xserver/md.dreamcast
cvs rdiff -u -r1.16 -r1.17 src/distrib/sets/lists/xserver/md.evbarm
cvs rdiff -u -r1.11 -r1.12 src/distrib/sets/lists/xserver/md.evbmips
cvs rdiff -u -r1.22 -r1.23 src/distrib/sets/lists/xserver/md.ews4800mips \
src/distrib/sets/lists/xserver/md.hp300 \
src/distrib/sets/lists/xserver/md.prep
cvs rdiff -u -r1.25 -r1.26 src/distrib/sets/lists/xserver/md.hpcarm
cvs rdiff -u -r1.31 -r1.32 src/distrib/sets/lists/xserver/md.hpcmips
cvs rdiff -u -r1.24 -r1.25 src/distrib/sets/lists/xserver/md.hpcsh
cvs rdiff -u -r1.126 -r1.127 src/distrib/sets/lists/xserver/md.i386
cvs rdiff -u -r1.6 -r1.7 src/distrib/sets/lists/xserver/md.ibmnws
cvs rdiff -u -r1.1 -r1.2 src/distrib/sets/lists/xserver/md.iyonix
cvs rdiff -u -r1.21 -r1.22 src/distrib/sets/lists/xserver/md.mac68k \
src/distrib/sets/lists/xserver/md.newsmips \
src/distrib/sets/lists/xserver/md.zaurus
cvs rdiff -u -r1.79 -r1.80 src/distrib/sets/lists/xserver/md.macppc
cvs rdiff -u -r1.39 -r1.40 src/distrib/sets/lists/xserver/md.netwinder
cvs rdiff -u -r1.30 -r1.31 src/distrib/sets/lists/xserver/md.ofppc
cvs rdiff -u -r1.53 -r1.54 src/distrib/sets/lists/xserver/md.shark
cvs rdiff -u -r1.70 -r1.71 src/distrib/sets/lists/xserver/md.sparc
cvs rdiff -u -r1.67 -r1.68 src/distrib/sets/lists/xserver/md.sparc64
cvs rdiff -u -r1.42 -r1.43 src/distrib/sets/lists/xserver/mi

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