CVS commit: [pgoyette-compat] src/sys/sys

2018-10-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Oct  4 02:24:26 UTC 2018

Modified Files:
src/sys/sys [pgoyette-compat]: module_hook.h

Log Message:
Also in the UNSET_HOOK2 case, release the mutex before destroying it.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/sys/module_hook.h

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

Modified files:

Index: src/sys/sys/module_hook.h
diff -u src/sys/sys/module_hook.h:1.1.2.5 src/sys/sys/module_hook.h:1.1.2.6
--- src/sys/sys/module_hook.h:1.1.2.5	Thu Oct  4 01:56:03 2018
+++ src/sys/sys/module_hook.h	Thu Oct  4 02:24:26 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: module_hook.h,v 1.1.2.5 2018/10/04 01:56:03 pgoyette Exp $	*/
+/* $NetBSD: module_hook.h,v 1.1.2.6 2018/10/04 02:24:26 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -158,6 +158,8 @@ static void (hook ## _unset)(void)\
 	/* Wait for existing localcount references to drain.  */\
 	localcount_drain(, , );	\
 \
+	/* Release the mutex and clean up all resources */	\
+	mutex_exit();	\
 	localcount_fini();\
 	cv_destroy();	\
 	mutex_destroy();\



CVS commit: [pgoyette-compat] src/sys/modules/compat_netbsd32

2018-10-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Oct  4 02:20:29 UTC 2018

Modified Files:
src/sys/modules/compat_netbsd32 [pgoyette-compat]: Makefile

Log Message:
Add missing file to the build


To generate a diff of this commit:
cvs rdiff -u -r1.20.12.14 -r1.20.12.15 \
src/sys/modules/compat_netbsd32/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/modules/compat_netbsd32/Makefile
diff -u src/sys/modules/compat_netbsd32/Makefile:1.20.12.14 src/sys/modules/compat_netbsd32/Makefile:1.20.12.15
--- src/sys/modules/compat_netbsd32/Makefile:1.20.12.14	Thu Sep 27 02:44:24 2018
+++ src/sys/modules/compat_netbsd32/Makefile	Thu Oct  4 02:20:29 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.20.12.14 2018/09/27 02:44:24 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.20.12.15 2018/10/04 02:20:29 pgoyette Exp $
 
 .include "../Makefile.inc"
 .include "../Makefile.assym"
@@ -28,6 +28,7 @@ SRCS+=	netbsd32_core.c netbsd32_event.c
 SRCS+=	netbsd32_exec_elf32.c
 SRCS+=	netbsd32_execve.c netbsd32_fs.c
 SRCS+=	netbsd32_ioctl.c
+SRCS+=	netbsd32_kern_proc.c
 SRCS+=	netbsd32_lwp.c netbsd32_netbsd.c
 SRCS+=	netbsd32_select.c
 SRCS+=	netbsd32_sem.c netbsd32_signal.c



CVS commit: [pgoyette-compat] src/sys/sys

2018-10-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Oct  4 01:56:03 UTC 2018

Modified Files:
src/sys/sys [pgoyette-compat]: module_hook.h

Log Message:
Grab the mutex for UNSET_HOOK2 (fixed previously for UNSET_HOOK)


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/sys/module_hook.h

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

Modified files:

Index: src/sys/sys/module_hook.h
diff -u src/sys/sys/module_hook.h:1.1.2.4 src/sys/sys/module_hook.h:1.1.2.5
--- src/sys/sys/module_hook.h:1.1.2.4	Sat Sep 29 21:36:15 2018
+++ src/sys/sys/module_hook.h	Thu Oct  4 01:56:03 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: module_hook.h,v 1.1.2.4 2018/09/29 21:36:15 pgoyette Exp $	*/
+/* $NetBSD: module_hook.h,v 1.1.2.5 2018/10/04 01:56:03 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -146,6 +146,9 @@ static void (hook ## _unset)(void)\
 	KASSERT(hook.f1);	\
 	KASSERT(hook.f2);	\
 \
+	/* Grab the mutex */	\
+	mutex_enter();	\
+\
 	/* Prevent new localcount_acquire calls.  */		\
 	hook.hooked = false;	\
 \



CVS commit: [pgoyette-compat] src/sys/modules/compat_raid_80

2018-10-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Oct  4 01:55:17 UTC 2018

Modified Files:
src/sys/modules/compat_raid_80 [pgoyette-compat]: Makefile

Log Message:
Don't include common compat_80 code in the raid-speific module


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/modules/compat_raid_80/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/modules/compat_raid_80/Makefile
diff -u src/sys/modules/compat_raid_80/Makefile:1.1.2.1 src/sys/modules/compat_raid_80/Makefile:1.1.2.2
--- src/sys/modules/compat_raid_80/Makefile:1.1.2.1	Sat Sep 22 22:21:46 2018
+++ src/sys/modules/compat_raid_80/Makefile	Thu Oct  4 01:55:17 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1.2.1 2018/09/22 22:21:46 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.1.2.2 2018/10/04 01:55:17 pgoyette Exp $
 
 .include "../Makefile.inc"
 
@@ -8,8 +8,6 @@ KMOD=	compat_raid_80
 
 CPPFLAGS+=	-DCOMPAT_80
 
-SRCS+=	compat_80_mod.c
-
 .PATH:	${S}/dev/raidframe
 
 SRCS+=	rf_compat80.c 



CVS commit: [pgoyette-compat] src/sys/kern

2018-10-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Oct  3 22:53:52 UTC 2018

Modified Files:
src/sys/kern [pgoyette-compat]: kern_module.c

Log Message:
Better diagnostic message


To generate a diff of this commit:
cvs rdiff -u -r1.130.2.23 -r1.130.2.24 src/sys/kern/kern_module.c

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

Modified files:

Index: src/sys/kern/kern_module.c
diff -u src/sys/kern/kern_module.c:1.130.2.23 src/sys/kern/kern_module.c:1.130.2.24
--- src/sys/kern/kern_module.c:1.130.2.23	Sun Sep  9 11:54:10 2018
+++ src/sys/kern/kern_module.c	Wed Oct  3 22:53:52 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_module.c,v 1.130.2.23 2018/09/09 11:54:10 pgoyette Exp $	*/
+/*	$NetBSD: kern_module.c,v 1.130.2.24 2018/10/03 22:53:52 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.130.2.23 2018/09/09 11:54:10 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.130.2.24 2018/10/03 22:53:52 pgoyette Exp $");
 
 #define _MODULE_INTERNAL
 
@@ -1453,8 +1453,8 @@ module_fetch_info(module_t *mod)
 		return error;
 	}
 	if (size != sizeof(modinfo_t **)) {
-		module_error("`link_set_modules' section wrong size %zu != %zu",
-		size, sizeof(modinfo_t **));
+		module_error("`link_set_modules' section wrong size "
+		"(got %zu, wanted %zu)", size, sizeof(modinfo_t **));
 		return ENOEXEC;
 	}
 	mod->mod_info = *(modinfo_t **)addr;



CVS commit: [pgoyette-compat] src/sys/modules

2018-10-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Oct  3 22:50:51 UTC 2018

Modified Files:
src/sys/modules/compat_50 [pgoyette-compat]: Makefile
src/sys/modules/compat_80 [pgoyette-compat]: Makefile

Log Message:
There are version-specific raid modules so don't include their code in
the "generic" version-specific module.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.10 -r1.1.2.11 src/sys/modules/compat_50/Makefile
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/modules/compat_80/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/modules/compat_50/Makefile
diff -u src/sys/modules/compat_50/Makefile:1.1.2.10 src/sys/modules/compat_50/Makefile:1.1.2.11
--- src/sys/modules/compat_50/Makefile:1.1.2.10	Sun Sep 23 01:33:25 2018
+++ src/sys/modules/compat_50/Makefile	Wed Oct  3 22:50:50 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1.2.10 2018/09/23 01:33:25 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.1.2.11 2018/10/03 22:50:50 pgoyette Exp $
 
 .include "../Makefile.inc"
 
@@ -14,10 +14,6 @@ SRCS+=	vfs_syscalls_50.c uipc_syscalls_5
 SRCS+=	rndpseudo_50.c clockctl_50.c if_spppsubr50.c
 SRCS+=	rtsock_50.c
 
-.PATH:	${S}/dev/raidframe
-
-SRCS+=	rf_compat50.c
-
 .PATH:	${S}/fs/puffs
 
 SRCS+=	puffs_compat.c

Index: src/sys/modules/compat_80/Makefile
diff -u src/sys/modules/compat_80/Makefile:1.1.2.3 src/sys/modules/compat_80/Makefile:1.1.2.4
--- src/sys/modules/compat_80/Makefile:1.1.2.3	Tue Apr  3 08:29:44 2018
+++ src/sys/modules/compat_80/Makefile	Wed Oct  3 22:50:50 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1.2.3 2018/04/03 08:29:44 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.1.2.4 2018/10/03 22:50:50 pgoyette Exp $
 
 .include "../Makefile.inc"
 
@@ -11,8 +11,4 @@ CPPFLAGS+=	-DCOMPAT_80
 SRCS+=	compat_80_mod.c
 SRCS+=	kern_mod_80.c
 
-.PATH:	${S}/dev/raidframe
-
-SRCS+=	rf_compat80.c 
-
 .include 



CVS commit: [pgoyette-compat] src/sys/compat/common

2018-10-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Oct  3 21:52:02 UTC 2018

Modified Files:
src/sys/compat/common [pgoyette-compat]: if_43.c if_43.h

Log Message:
Don't define if_43_{init,fini}() in multiple .h files.


To generate a diff of this commit:
cvs rdiff -u -r1.14.2.8 -r1.14.2.9 src/sys/compat/common/if_43.c
cvs rdiff -u -r1.1.20.1 -r1.1.20.2 src/sys/compat/common/if_43.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/compat/common/if_43.c
diff -u src/sys/compat/common/if_43.c:1.14.2.8 src/sys/compat/common/if_43.c:1.14.2.9
--- src/sys/compat/common/if_43.c:1.14.2.8	Wed Oct  3 21:27:14 2018
+++ src/sys/compat/common/if_43.c	Wed Oct  3 21:52:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_43.c,v 1.14.2.8 2018/10/03 21:27:14 pgoyette Exp $	*/
+/*	$NetBSD: if_43.c,v 1.14.2.9 2018/10/03 21:52:02 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1990, 1993
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.14.2.8 2018/10/03 21:27:14 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.14.2.9 2018/10/03 21:52:02 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -73,6 +73,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.
 #include 
 
 #include 
+#include 
 #include 
 #include 
 

Index: src/sys/compat/common/if_43.h
diff -u src/sys/compat/common/if_43.h:1.1.20.1 src/sys/compat/common/if_43.h:1.1.20.2
--- src/sys/compat/common/if_43.h:1.1.20.1	Wed Oct  3 21:27:14 2018
+++ src/sys/compat/common/if_43.h	Wed Oct  3 21:52:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_43.h,v 1.1.20.1 2018/10/03 21:27:14 pgoyette Exp $	*/
+/*	$NetBSD: if_43.h,v 1.1.20.2 2018/10/03 21:52:02 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -36,9 +36,6 @@
 extern u_long (*vec_compat_cvtcmd)(u_long); 
 extern int (*vec_compat_ifioctl)(struct socket *, u_long, u_long, 
 void *, struct lwp *);
-
-int if_43_init(void);
-int if_43_fini(void);
 #endif
 
 #endif /* !_COMPAT_IF_43_H_ */



CVS commit: [pgoyette-compat] src/sys/compat/common

2018-10-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Oct  3 21:27:14 UTC 2018

Modified Files:
src/sys/compat/common [pgoyette-compat]: if_43.c if_43.h

Log Message:
Make if_43_{init,fini} return an int, for consistency with all the
related *_{init,fini} routines.


To generate a diff of this commit:
cvs rdiff -u -r1.14.2.7 -r1.14.2.8 src/sys/compat/common/if_43.c
cvs rdiff -u -r1.1 -r1.1.20.1 src/sys/compat/common/if_43.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/compat/common/if_43.c
diff -u src/sys/compat/common/if_43.c:1.14.2.7 src/sys/compat/common/if_43.c:1.14.2.8
--- src/sys/compat/common/if_43.c:1.14.2.7	Sun Sep 30 01:45:49 2018
+++ src/sys/compat/common/if_43.c	Wed Oct  3 21:27:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_43.c,v 1.14.2.7 2018/09/30 01:45:49 pgoyette Exp $	*/
+/*	$NetBSD: if_43.c,v 1.14.2.8 2018/10/03 21:27:14 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1990, 1993
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.14.2.7 2018/09/30 01:45:49 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.14.2.8 2018/10/03 21:27:14 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -301,17 +301,19 @@ compat_ifioctl(struct socket *so, u_long
 MODULE_SET_HOOK2(if_43_hook, "if_43", do_compat_cvtcmd, compat_ifioctl);
 MODULE_UNSET_HOOK2(if_43_hook);
 
-void
+int
 if_43_init(void)
 {
 
 	if_43_hook_set();
+	return 0;
 }
 
-void
+int
 if_43_fini(void)
 {
 
 	if_43_hook_unset();
+	return 0;
 }
 #endif /* defined(COMPAT_43) */

Index: src/sys/compat/common/if_43.h
diff -u src/sys/compat/common/if_43.h:1.1 src/sys/compat/common/if_43.h:1.1.20.1
--- src/sys/compat/common/if_43.h:1.1	Sat Nov  5 23:30:22 2016
+++ src/sys/compat/common/if_43.h	Wed Oct  3 21:27:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_43.h,v 1.1 2016/11/05 23:30:22 pgoyette Exp $	*/
+/*	$NetBSD: if_43.h,v 1.1.20.1 2018/10/03 21:27:14 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -37,8 +37,8 @@ extern u_long (*vec_compat_cvtcmd)(u_lon
 extern int (*vec_compat_ifioctl)(struct socket *, u_long, u_long, 
 void *, struct lwp *);
 
-void if_43_init(void);
-void if_43_fini(void);
+int if_43_init(void);
+int if_43_fini(void);
 #endif
 
 #endif /* !_COMPAT_IF_43_H_ */



CVS commit: [jdolecek-ncqfixes] src/sys/dev

2018-10-03 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Oct  3 19:20:48 UTC 2018

Modified Files:
src/sys/dev/ata [jdolecek-ncqfixes]: TODO.ncq ata.c atavar.h wd.c
src/sys/dev/ic [jdolecek-ncqfixes]: ahcisata_core.c mvsata.c siisata.c
wdc.c

Log Message:
change channel reset and drive reset for all ATA controllers to always
run via thread, and with channel lock held the whole time; the queue is
frozen while reset is pending

for this repurpose ata_reset_channel() into new ata_thread_run()

also adjust some device printfs to not leak xfer pointer, and avoid
aprint_* for non-autoconf messages


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.9 -r1.4.2.10 src/sys/dev/ata/TODO.ncq
cvs rdiff -u -r1.141.6.10 -r1.141.6.11 src/sys/dev/ata/ata.c
cvs rdiff -u -r1.99.2.7 -r1.99.2.8 src/sys/dev/ata/atavar.h
cvs rdiff -u -r1.441.2.6 -r1.441.2.7 src/sys/dev/ata/wd.c
cvs rdiff -u -r1.62.2.5 -r1.62.2.6 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.41.2.4 -r1.41.2.5 src/sys/dev/ic/mvsata.c
cvs rdiff -u -r1.35.6.5 -r1.35.6.6 src/sys/dev/ic/siisata.c
cvs rdiff -u -r1.288.6.2 -r1.288.6.3 src/sys/dev/ic/wdc.c

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

Modified files:

Index: src/sys/dev/ata/TODO.ncq
diff -u src/sys/dev/ata/TODO.ncq:1.4.2.9 src/sys/dev/ata/TODO.ncq:1.4.2.10
--- src/sys/dev/ata/TODO.ncq:1.4.2.9	Mon Sep 24 19:48:02 2018
+++ src/sys/dev/ata/TODO.ncq	Wed Oct  3 19:20:48 2018
@@ -2,8 +2,6 @@ jdolecek-ncqfixes goals:
 - fix ahci(4) error handling under paralles - invalid bio via WD_CHAOS_MONKEY
   ends up being handled as NOERROR, triggering KASSERT() in wd(4)
 - remove controller-specific slot bitmaps (ic/siisata.c, ic/ahcisata_core.c)
-- revert rev 1.431 of wd.c (AT_POOL removal) - ensure still works
-  for the reset-via-thread case
 
 Bugs
 

Index: src/sys/dev/ata/ata.c
diff -u src/sys/dev/ata/ata.c:1.141.6.10 src/sys/dev/ata/ata.c:1.141.6.11
--- src/sys/dev/ata/ata.c:1.141.6.10	Mon Sep 24 19:48:02 2018
+++ src/sys/dev/ata/ata.c	Wed Oct  3 19:20:48 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata.c,v 1.141.6.10 2018/09/24 19:48:02 jdolecek Exp $	*/
+/*	$NetBSD: ata.c,v 1.141.6.11 2018/10/03 19:20:48 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.141.6.10 2018/09/24 19:48:02 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.141.6.11 2018/10/03 19:20:48 jdolecek Exp $");
 
 #include "opt_ata.h"
 
@@ -440,7 +440,7 @@ atabus_thread(void *arg)
 	struct ata_channel *chp = sc->sc_chan;
 	struct ata_queue *chq = chp->ch_queue;
 	struct ata_xfer *xfer;
-	int i, rv, s;
+	int i, rv;
 
 	ata_channel_lock(chp);
 	chp->ch_flags |= ATACH_TH_RUN;
@@ -462,7 +462,8 @@ atabus_thread(void *arg)
 
 	ata_channel_lock(chp);
 	for (;;) {
-		if ((chp->ch_flags & (ATACH_TH_RESET | ATACH_SHUTDOWN)) == 0 &&
+		if ((chp->ch_flags & (ATACH_TH_RESET | ATACH_TH_DRIVE_RESET
+		| ATACH_SHUTDOWN)) == 0 &&
 		(chq->queue_active == 0 || chq->queue_freeze == 0)) {
 			chp->ch_flags &= ~ATACH_TH_RUN;
 			cv_wait(>ch_thr_idle, >ch_lock);
@@ -478,12 +479,24 @@ atabus_thread(void *arg)
 			ata_channel_lock(chp);
 		}
 		if (chp->ch_flags & ATACH_TH_RESET) {
-			/* ata_reset_channel() will unfreeze the channel */
-			ata_channel_unlock(chp);
-			s = splbio();
-			ata_reset_channel(chp, AT_WAIT | chp->ch_reset_flags);
-			splx(s);
-			ata_channel_lock(chp);
+			/* this will unfreeze the channel */
+			ata_thread_run(chp, AT_WAIT | chp->ch_reset_flags,
+			ATACH_TH_RESET, ATACH_NODRIVE);
+		} else if (chp->ch_flags & ATACH_TH_DRIVE_RESET) {
+			for (i = 0; i < chp->ch_ndrives; i++) {
+struct ata_drive_datas *drvp;
+int drv_reset_flags;
+
+drvp = >ch_drive[i];
+drv_reset_flags = drvp->drive_reset_flags;
+
+if (drvp->drive_flags & ATACH_TH_DRIVE_RESET) {
+	ata_thread_run(chp,
+	AT_WAIT | drv_reset_flags,
+	ATACH_TH_DRIVE_RESET, i);
+}
+			}
+			chp->ch_flags &= ~ATACH_TH_DRIVE_RESET;
 		} else if (chq->queue_active > 0 && chq->queue_freeze == 1) {
 			/*
 			 * Caller has bumped queue_freeze, decrease it. This
@@ -511,6 +524,11 @@ atabus_thread(void *arg)
 			}
 		} else if (chq->queue_freeze > 1)
 			panic("%s: queue_freeze", __func__);
+
+		/* Try to run down the queue once after each event is handled */
+		ata_channel_unlock(chp);
+		atastart(chp);
+		ata_channel_lock(chp);
 	}
 	chp->ch_thread = NULL;
 	cv_signal(>ch_thr_idle);
@@ -1471,7 +1489,8 @@ ata_timo_xfer_check(struct ata_xfer *xfe
 			ata_channel_unlock(chp);
 
 			device_printf(drvp->drv_softc,
-			"xfer %p freed while invoking timeout\n", xfer); 
+			"xfer %"PRIxPTR" freed while invoking timeout\n",
+			(intptr_t)xfer & PAGE_MASK); 
 
 			ata_free_xfer(chp, xfer);
 			return true;
@@ -1481,7 +1500,8 @@ ata_timo_xfer_check(struct ata_xfer *xfe
 		ata_channel_unlock(chp);
 
 		

CVS commit: [netbsd-8] src/doc

2018-10-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct  3 18:08:28 UTC 2018

Modified Files:
src/doc [netbsd-8]: CHANGES-8.1

Log Message:
Tickets #1043 - #1046


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.27 -r1.1.2.28 src/doc/CHANGES-8.1

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

Modified files:

Index: src/doc/CHANGES-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.27 src/doc/CHANGES-8.1:1.1.2.28
--- src/doc/CHANGES-8.1:1.1.2.27	Thu Sep 27 15:54:21 2018
+++ src/doc/CHANGES-8.1	Wed Oct  3 18:08:28 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.27 2018/09/27 15:54:21 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.28 2018/10/03 18:08:28 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1178,3 +1178,33 @@ lib/libcurses/getch.c1.68,1.69
 	Call resizeterm if getch issues KEY_RESIZE.
 	[roy, ticket #1042]
 
+lib/libcurses/get_wch.c1.19
+lib/libcurses/getch.c1.70
+lib/libcurses/resize.c1.27
+
+	curses: resizeterm(3) should always send KEY_RESIZE.
+	[roy, ticket #1043]
+
+sys/dev/pad/pad.c1.58
+
+	pad(4) mixer has only 1 channel, so return EINVAL in the case
+	other than 1 is requested.
+	[nakayama, ticket #1044]
+
+sys/netinet/ip_reass.c1.19
+
+	Hold ip_off and ip_len in the fragment entry, instead of always
+	reading the associated mbuf (and converting to host order).
+	[maxv, ticket #1045]
+
+sys/net/if_bridge.c1.157-1.159
+
+	Fix a bug that checksum of spontaneous packets through a bridge
+	became wrong if the output interface's HW offload were enabled.
+	Fixes part of PR#53562. This change doesn't fix a case that a
+	packet is sent not from the outgoing interface which was selected
+	in ip[46]_output() but from other bridge member.
+
+	Micro optimization. m_copym(m, 0, M_COPYALL) -> m_copypacket(m).
+	[msaitoh, ticket #1046]
+



CVS commit: [netbsd-8] src/sys/net

2018-10-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct  3 17:57:39 UTC 2018

Modified Files:
src/sys/net [netbsd-8]: if_bridge.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1046):

sys/net/if_bridge.c: revision 1.157
sys/net/if_bridge.c: revision 1.158
sys/net/if_bridge.c: revision 1.159

  Fix a bug that bridge_enqueue() incorrectly cleared outgoing packet's offload
flags. bridge_enqueue() is called from bridge_output() when a packet is
spontaneous. Clear csum_flags before calling brige_enqueue() in
bridge_forward() or bridge_broadcast() instead of in the beginning of
bridge_enqueue().

Note that this change doesn't fix a problem on the following configuration:

A bridge has two or more interfaces.
An address is assigned to an bridge member interface and
some offload flags are set.
Another interface has no address and has no any offload flag.

XXX pullup-[78]

- Fix bridge_enqueue() which was broken by last commit. Use correct mbuf
   pointer.
- Modify comment.

Micro optimization. m_copym(M_COPYALL) -> m_copypacket().


To generate a diff of this commit:
cvs rdiff -u -r1.134.6.11 -r1.134.6.12 src/sys/net/if_bridge.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_bridge.c
diff -u src/sys/net/if_bridge.c:1.134.6.11 src/sys/net/if_bridge.c:1.134.6.12
--- src/sys/net/if_bridge.c:1.134.6.11	Thu Jun  7 17:42:25 2018
+++ src/sys/net/if_bridge.c	Wed Oct  3 17:57:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.134.6.11 2018/06/07 17:42:25 martin Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.134.6.12 2018/10/03 17:57:39 martin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.134.6.11 2018/06/07 17:42:25 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.134.6.12 2018/10/03 17:57:39 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bridge_ipf.h"
@@ -1395,11 +1395,6 @@ bridge_enqueue(struct bridge_softc *sc, 
 	int len, error;
 	short mflags;
 
-	/*
-	 * Clear any in-bound checksum flags for this packet.
-	 */
-	m->m_pkthdr.csum_flags = 0;
-
 	if (runfilt) {
 		if (pfil_run_hooks(sc->sc_if.if_pfil, ,
 		dst_ifp, PFIL_OUT) != 0) {
@@ -1545,7 +1540,7 @@ bridge_output(struct ifnet *ifp, struct 
 used = true;
 mc = m;
 			} else {
-mc = m_copym(m, 0, M_COPYALL, M_NOWAIT);
+mc = m_copypacket(m, M_DONTWAIT);
 if (mc == NULL) {
 	sc->sc_if.if_oerrors++;
 	goto next;
@@ -1563,8 +1558,7 @@ bridge_output(struct ifnet *ifp, struct 
 	used = true;
 	mc = m;
 } else {
-	mc = m_copym(m, 0, M_COPYALL,
-	M_DONTWAIT);
+	mc = m_copypacket(m, M_DONTWAIT);
 	if (mc == NULL) {
 		sc->sc_if.if_oerrors++;
 		goto next;
@@ -1768,6 +1762,13 @@ bridge_forward(struct bridge_softc *sc, 
 
 	bridge_release_member(sc, bif, );
 
+	/*
+	 * Before enqueueing this packet to the destination interface,
+	 * clear any in-bound checksum flags to prevent them from being
+	 * misused as out-bound flags.
+	 */
+	m->m_pkthdr.csum_flags = 0;
+
 	ACQUIRE_GLOBAL_LOCKS();
 	bridge_enqueue(sc, dst_if, m, 1);
 	RELEASE_GLOBAL_LOCKS();
@@ -1973,18 +1974,25 @@ bridge_broadcast(struct bridge_softc *sc
 			goto next;
 
 		if (dst_if != src_if) {
-			mc = m_copym(m, 0, M_COPYALL, M_DONTWAIT);
+			mc = m_copypacket(m, M_DONTWAIT);
 			if (mc == NULL) {
 sc->sc_if.if_oerrors++;
 goto next;
 			}
+			/*
+			 * Before enqueueing this packet to the destination
+			 * interface, clear any in-bound checksum flags to
+			 * prevent them from being misused as out-bound flags.
+			 */
+			mc->m_pkthdr.csum_flags = 0;
+
 			ACQUIRE_GLOBAL_LOCKS();
 			bridge_enqueue(sc, dst_if, mc, 1);
 			RELEASE_GLOBAL_LOCKS();
 		}
 
 		if (bmcast) {
-			mc = m_copym(m, 0, M_COPYALL, M_DONTWAIT);
+			mc = m_copypacket(m, M_DONTWAIT);
 			if (mc == NULL) {
 sc->sc_if.if_oerrors++;
 goto next;



CVS commit: [netbsd-8] src/sys/netinet

2018-10-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct  3 17:53:56 UTC 2018

Modified Files:
src/sys/netinet [netbsd-8]: ip_reass.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1045):

sys/netinet/ip_reass.c: revision 1.19

Hold ip_off and ip_len in the fragment entry, instead of always reading
the associated mbuf (and converting to host order). This reduces the
cache/TLB misses when processing long lists.


To generate a diff of this commit:
cvs rdiff -u -r1.11.8.4 -r1.11.8.5 src/sys/netinet/ip_reass.c

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

Modified files:

Index: src/sys/netinet/ip_reass.c
diff -u src/sys/netinet/ip_reass.c:1.11.8.4 src/sys/netinet/ip_reass.c:1.11.8.5
--- src/sys/netinet/ip_reass.c:1.11.8.4	Thu Sep 27 15:07:34 2018
+++ src/sys/netinet/ip_reass.c	Wed Oct  3 17:53:56 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_reass.c,v 1.11.8.4 2018/09/27 15:07:34 martin Exp $	*/
+/*	$NetBSD: ip_reass.c,v 1.11.8.5 2018/10/03 17:53:56 martin Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1988, 1993
@@ -46,7 +46,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_reass.c,v 1.11.8.4 2018/09/27 15:07:34 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_reass.c,v 1.11.8.5 2018/10/03 17:53:56 martin Exp $");
 
 #include 
 #include 
@@ -80,6 +80,8 @@ typedef struct ipfr_qent {
 	struct ip *		ipqe_ip;
 	struct mbuf *		ipqe_m;
 	bool			ipqe_mff;
+	uint16_t		ipqe_off;
+	uint16_t		ipqe_len;
 } ipfr_qent_t;
 
 TAILQ_HEAD(ipfr_qent_head, ipfr_qent);
@@ -215,7 +217,7 @@ ip_nmbclusters_changed(void)
 struct mbuf *
 ip_reass(ipfr_qent_t *ipqe, ipfr_queue_t *fp, const u_int hash)
 {
-	struct ip *ip = ipqe->ipqe_ip, *qip;
+	struct ip *ip = ipqe->ipqe_ip;
 	const int hlen = ip->ip_hl << 2;
 	struct mbuf *m = ipqe->ipqe_m, *t;
 	int ipsecflags = m->m_flags & (M_DECRYPTED|M_AUTHIPHDR);
@@ -230,16 +232,6 @@ ip_reass(ipfr_qent_t *ipqe, ipfr_queue_t
 	m->m_data += hlen;
 	m->m_len -= hlen;
 
-#ifdef	notyet
-	/* Make sure fragment limit is up-to-date. */
-	CHECK_NMBCLUSTER_PARAMS();
-
-	/* If we have too many fragments, drop the older half. */
-	if (ip_nfrags >= ip_maxfrags) {
-		ip_reass_drophalf(void);
-	}
-#endif
-
 	/*
 	 * We are about to add a fragment; increment frag count.
 	 */
@@ -255,9 +247,9 @@ ip_reass(ipfr_qent_t *ipqe, ipfr_queue_t
 		 * never accept fragments  b) if maxfrag is -1, accept
 		 * all fragments without limitation.
 		 */
-		if (ip_maxfragpackets < 0)
-			;
-		else if (ip_nfragpackets >= ip_maxfragpackets) {
+		if (ip_maxfragpackets < 0) {
+			/* no limit */
+		} else if (ip_nfragpackets >= ip_maxfragpackets) {
 			goto dropfrag;
 		}
 		fp = malloc(sizeof(ipfr_queue_t), M_FTABLE, M_NOWAIT);
@@ -285,7 +277,7 @@ ip_reass(ipfr_qent_t *ipqe, ipfr_queue_t
 	 * Find a segment which begins after this one does.
 	 */
 	TAILQ_FOREACH(q, >ipq_fragq, ipqe_q) {
-		if (ntohs(q->ipqe_ip->ip_off) > ntohs(ip->ip_off))
+		if (q->ipqe_off > ipqe->ipqe_off)
 			break;
 	}
 	if (q != NULL) {
@@ -300,15 +292,14 @@ ip_reass(ipfr_qent_t *ipqe, ipfr_queue_t
 	 * If it provides all of our data, drop us.
 	 */
 	if (p != NULL) {
-		i = ntohs(p->ipqe_ip->ip_off) + ntohs(p->ipqe_ip->ip_len) -
-		ntohs(ip->ip_off);
+		i = p->ipqe_off + p->ipqe_len - ipqe->ipqe_off;
 		if (i > 0) {
-			if (i >= ntohs(ip->ip_len)) {
+			if (i >= ipqe->ipqe_len) {
 goto dropfrag;
 			}
 			m_adj(ipqe->ipqe_m, i);
-			ip->ip_off = htons(ntohs(ip->ip_off) + i);
-			ip->ip_len = htons(ntohs(ip->ip_len) - i);
+			ipqe->ipqe_off = ipqe->ipqe_off + i;
+			ipqe->ipqe_len = ipqe->ipqe_len - i;
 		}
 	}
 
@@ -317,17 +308,13 @@ ip_reass(ipfr_qent_t *ipqe, ipfr_queue_t
 	 * completely covered, dequeue them.
 	 */
 	while (q != NULL) {
-		size_t end;
-
-		qip = q->ipqe_ip;
-		end = ntohs(ip->ip_off) + ntohs(ip->ip_len);
-		if (end <= ntohs(qip->ip_off)) {
+		i = ipqe->ipqe_off + ipqe->ipqe_len - q->ipqe_off;
+		if (i <= 0) {
 			break;
 		}
-		i = end - ntohs(qip->ip_off);
-		if (i < ntohs(qip->ip_len)) {
-			qip->ip_len = htons(ntohs(qip->ip_len) - i);
-			qip->ip_off = htons(ntohs(qip->ip_off) + i);
+		if (i < q->ipqe_len) {
+			q->ipqe_off = q->ipqe_off + i;
+			q->ipqe_len = q->ipqe_len - i;
 			m_adj(q->ipqe_m, i);
 			break;
 		}
@@ -351,12 +338,11 @@ insert:
 	}
 	next = 0;
 	TAILQ_FOREACH(q, >ipq_fragq, ipqe_q) {
-		qip = q->ipqe_ip;
-		if (ntohs(qip->ip_off) != next) {
+		if (q->ipqe_off != next) {
 			mutex_exit(_lock);
 			return NULL;
 		}
-		next += ntohs(qip->ip_len);
+		next += q->ipqe_len;
 	}
 	p = TAILQ_LAST(>ipq_fragq, ipfr_qent_head);
 	if (p->ipqe_mff) {
@@ -651,13 +637,6 @@ ip_reass_packet(struct mbuf **m0, struct
 		return EINVAL;
 	}
 
-	/*
-	 * Adjust total IP length to not reflect header and convert
-	 * offset of this to bytes.  XXX: clobbers struct ip.
-	 */
-	ip->ip_len = htons(flen);
-	ip->ip_off = htons(off);
-
 	/* Look for queue of fragments of this datagram. */
 	mutex_enter(_lock);
 	hash = 

CVS commit: [netbsd-8] src/sys/dev/pad

2018-10-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct  3 17:50:57 UTC 2018

Modified Files:
src/sys/dev/pad [netbsd-8]: pad.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1044):

sys/dev/pad/pad.c: revision 1.58

pad(4) mixer has only 1 channel, so return EINVAL in the case other than 1.

This fixes the following strange output of mixerctl(1):

outputs.master=255,0
inputs.dac=255,0


To generate a diff of this commit:
cvs rdiff -u -r1.32.2.2 -r1.32.2.3 src/sys/dev/pad/pad.c

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

Modified files:

Index: src/sys/dev/pad/pad.c
diff -u src/sys/dev/pad/pad.c:1.32.2.2 src/sys/dev/pad/pad.c:1.32.2.3
--- src/sys/dev/pad/pad.c:1.32.2.2	Sat Dec 23 18:48:41 2017
+++ src/sys/dev/pad/pad.c	Wed Oct  3 17:50:57 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pad.c,v 1.32.2.2 2017/12/23 18:48:41 snj Exp $ */
+/* $NetBSD: pad.c,v 1.32.2.3 2018/10/03 17:50:57 martin Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.32.2.2 2017/12/23 18:48:41 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.32.2.3 2018/10/03 17:50:57 martin Exp $");
 
 #include 
 #include 
@@ -572,6 +572,8 @@ pad_set_port(void *opaque, mixer_ctrl_t 
 	switch (mc->dev) {
 	case PAD_OUTPUT_MASTER_VOLUME:
 	case PAD_INPUT_DAC_VOLUME:
+		if (mc->un.value.num_channels != 1)
+			return EINVAL;
 		sc->sc_swvol = mc->un.value.level[AUDIO_MIXER_LEVEL_MONO];
 		return 0;
 	}
@@ -591,6 +593,8 @@ pad_get_port(void *opaque, mixer_ctrl_t 
 	switch (mc->dev) {
 	case PAD_OUTPUT_MASTER_VOLUME:
 	case PAD_INPUT_DAC_VOLUME:
+		if (mc->un.value.num_channels != 1)
+			return EINVAL;
 		mc->un.value.level[AUDIO_MIXER_LEVEL_MONO] = sc->sc_swvol;
 		return 0;
 	}



CVS commit: [netbsd-8] src/lib/libcurses

2018-10-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct  3 17:49:06 UTC 2018

Modified Files:
src/lib/libcurses [netbsd-8]: get_wch.c getch.c resize.c

Log Message:
Pull up following revision(s) (requested by roy in ticket #1043):

lib/libcurses/resize.c: revision 1.27
lib/libcurses/get_wch.c: revision 1.19
lib/libcurses/getch.c: revision 1.70

curses: resizeterm(3) should always send KEY_RESIZE

Fixes #53636

OK kamil@


To generate a diff of this commit:
cvs rdiff -u -r1.14.4.2 -r1.14.4.3 src/lib/libcurses/get_wch.c
cvs rdiff -u -r1.65.4.2 -r1.65.4.3 src/lib/libcurses/getch.c
cvs rdiff -u -r1.26 -r1.26.4.1 src/lib/libcurses/resize.c

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

Modified files:

Index: src/lib/libcurses/get_wch.c
diff -u src/lib/libcurses/get_wch.c:1.14.4.2 src/lib/libcurses/get_wch.c:1.14.4.3
--- src/lib/libcurses/get_wch.c:1.14.4.2	Thu Sep 27 15:12:15 2018
+++ src/lib/libcurses/get_wch.c	Wed Oct  3 17:49:06 2018
@@ -1,4 +1,4 @@
-/*   $NetBSD: get_wch.c,v 1.14.4.2 2018/09/27 15:12:15 martin Exp $ */
+/*   $NetBSD: get_wch.c,v 1.14.4.3 2018/10/03 17:49:06 martin Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: get_wch.c,v 1.14.4.2 2018/09/27 15:12:15 martin Exp $");
+__RCSID("$NetBSD: get_wch.c,v 1.14.4.3 2018/10/03 17:49:06 martin Exp $");
 #endif		  /* not lint */
 
 #include 
@@ -530,8 +530,8 @@ wget_wch(WINDOW *win, wint_t *ch)
 	__echoit, __rawmode, _cursesi_screen->nl, win->flags);
 #endif
 	if (_cursesi_screen->resized) {
-		_cursesi_screen->resized = 0;
 		resizeterm(LINES, COLS);
+		_cursesi_screen->resized = 0;
 		*ch = KEY_RESIZE;
 		return KEY_CODE_YES;
 	}
@@ -684,8 +684,8 @@ __fgetwc_resize(FILE *infd, bool *resize
 #ifdef DEBUG
 	__CTRACE(__CTRACE_INPUT, "__fgetwc_resize returning KEY_RESIZE\n");
 #endif
-	_cursesi_screen->resized = 0;
 	resizeterm(LINES, COLS);
+	_cursesi_screen->resized = 0;
 	*resized = true;
 	return c;
 }

Index: src/lib/libcurses/getch.c
diff -u src/lib/libcurses/getch.c:1.65.4.2 src/lib/libcurses/getch.c:1.65.4.3
--- src/lib/libcurses/getch.c:1.65.4.2	Thu Sep 27 15:12:15 2018
+++ src/lib/libcurses/getch.c	Wed Oct  3 17:49:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: getch.c,v 1.65.4.2 2018/09/27 15:12:15 martin Exp $	*/
+/*	$NetBSD: getch.c,v 1.65.4.3 2018/10/03 17:49:06 martin Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)getch.c	8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: getch.c,v 1.65.4.2 2018/09/27 15:12:15 martin Exp $");
+__RCSID("$NetBSD: getch.c,v 1.65.4.3 2018/10/03 17:49:06 martin Exp $");
 #endif
 #endif	/* not lint */
 
@@ -824,8 +824,8 @@ wgetch(WINDOW *win)
 	__echoit, __rawmode, _cursesi_screen->nl, win->flags, win->delay);
 #endif
 	if (_cursesi_screen->resized) {
-		_cursesi_screen->resized = 0;
 		resizeterm(LINES, COLS);
+		_cursesi_screen->resized = 0;
 #ifdef DEBUG
 		__CTRACE(__CTRACE_INPUT, "wgetch returning KEY_RESIZE\n");
 #endif
@@ -1013,7 +1013,7 @@ __fgetc_resize(FILE *infd)
 #ifdef DEBUG
 	__CTRACE(__CTRACE_INPUT, "__fgetc_resize returning KEY_RESIZE\n");
 #endif
-	_cursesi_screen->resized = 0;
 	resizeterm(LINES, COLS);
+	_cursesi_screen->resized = 0;
 	return KEY_RESIZE;
 }

Index: src/lib/libcurses/resize.c
diff -u src/lib/libcurses/resize.c:1.26 src/lib/libcurses/resize.c:1.26.4.1
--- src/lib/libcurses/resize.c:1.26	Tue Jan 24 17:27:30 2017
+++ src/lib/libcurses/resize.c	Wed Oct  3 17:49:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: resize.c,v 1.26 2017/01/24 17:27:30 roy Exp $	*/
+/*	$NetBSD: resize.c,v 1.26.4.1 2018/10/03 17:49:06 martin Exp $	*/
 
 /*
  * Copyright (c) 2001
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)resize.c   blymn 2001/08/26";
 #else
-__RCSID("$NetBSD: resize.c,v 1.26 2017/01/24 17:27:30 roy Exp $");
+__RCSID("$NetBSD: resize.c,v 1.26.4.1 2018/10/03 17:49:06 martin Exp $");
 #endif
 #endif/* not lint */
 
@@ -163,6 +163,8 @@ resizeterm(int nlines, int ncols)
 	__CTRACE(__CTRACE_WINDOW, "resizeterm: (%d, %d)\n", nlines, ncols);
 #endif
 
+	/* Unconditionally inform application screen has been resized. */
+	_cursesi_screen->resized = 1;
 
 	if (!is_term_resized(nlines, ncols))
 		return OK;



CVS commit: src/sys/arch/aarch64/aarch64

2018-10-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Oct  3 13:59:31 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: cpu.c

Log Message:
Another space that hurts Jared's eyes.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/aarch64/aarch64/cpu.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/aarch64/aarch64/cpu.c
diff -u src/sys/arch/aarch64/aarch64/cpu.c:1.9 src/sys/arch/aarch64/aarch64/cpu.c:1.10
--- src/sys/arch/aarch64/aarch64/cpu.c:1.9	Wed Oct  3 09:59:05 2018
+++ src/sys/arch/aarch64/aarch64/cpu.c	Wed Oct  3 13:59:31 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.9 2018/10/03 09:59:05 skrll Exp $ */
+/* $NetBSD: cpu.c,v 1.10 2018/10/03 13:59:31 skrll Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.9 2018/10/03 09:59:05 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.10 2018/10/03 13:59:31 skrll Exp $");
 
 #include "locators.h"
 #include "opt_arm_debug.h"
@@ -180,7 +180,7 @@ const struct cpuidtab cpuids[] = {
 	{ CPU_ID_THUNDERXRX, "Cavium ThunderX", "Cavium", "V8-A" },
 	{ CPU_ID_THUNDERX81XXRX, "Cavium ThunderX CN81XX", "Cavium", "V8-A" },
 	{ CPU_ID_THUNDERX83XXRX, "Cavium ThunderX CN83XX", "Cavium", "V8-A" },
-	{ CPU_ID_THUNDERX2RX, "Cavium Thunder X2", "Cavium", "V8.1-A" },
+	{ CPU_ID_THUNDERX2RX, "Cavium ThunderX2", "Cavium", "V8.1-A" },
 };
 
 static void



CVS commit: src/sbin/mount_qemufwcfg

2018-10-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Oct  3 13:34:45 UTC 2018

Modified Files:
src/sbin/mount_qemufwcfg: Makefile

Log Message:
Add libpuffs (fixes sun2 build)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sbin/mount_qemufwcfg/Makefile

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

Modified files:

Index: src/sbin/mount_qemufwcfg/Makefile
diff -u src/sbin/mount_qemufwcfg/Makefile:1.3 src/sbin/mount_qemufwcfg/Makefile:1.4
--- src/sbin/mount_qemufwcfg/Makefile:1.3	Tue Nov 28 11:59:16 2017
+++ src/sbin/mount_qemufwcfg/Makefile	Wed Oct  3 13:34:44 2018
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.3 2017/11/28 11:59:16 wiz Exp $
+# $NetBSD: Makefile,v 1.4 2018/10/03 13:34:44 jmcneill Exp $
 
 WARNS=	6
 
 PROG=	mount_qemufwcfg
 SRCS=	fwcfg.c virtdir.c
-DPADD+=	${LIBREFUSE} ${LIBUTIL}
-LDADD=	-lrefuse -lutil
+DPADD+=	${LIBREFUSE} ${LIBPUFFS} ${LIBUTIL}
+LDADD=	-lrefuse -lpuffs -lutil
 MAN=	mount_qemufwcfg.8
 
 CPPFLAGS+=	-D_KERNTYPES



CVS commit: src/lib/libcurses

2018-10-03 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Oct  3 13:22:29 UTC 2018

Modified Files:
src/lib/libcurses: curses_private.h resize.c ripoffline.c

Log Message:
curses: resize ripped off windows

The application must still redraw them though.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/lib/libcurses/curses_private.h
cvs rdiff -u -r1.28 -r1.29 src/lib/libcurses/resize.c
cvs rdiff -u -r1.4 -r1.5 src/lib/libcurses/ripoffline.c

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

Modified files:

Index: src/lib/libcurses/curses_private.h
diff -u src/lib/libcurses/curses_private.h:1.64 src/lib/libcurses/curses_private.h:1.65
--- src/lib/libcurses/curses_private.h:1.64	Tue Oct  2 17:35:44 2018
+++ src/lib/libcurses/curses_private.h	Wed Oct  3 13:22:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses_private.h,v 1.64 2018/10/02 17:35:44 roy Exp $	*/
+/*	$NetBSD: curses_private.h,v 1.65 2018/10/03 13:22:29 roy Exp $	*/
 
 /*-
  * Copyright (c) 1998-2000 Brett Lymn
@@ -379,7 +379,7 @@ void	 __restore_termios(void);
 void	 __restore_stophandler(void);
 void	 __restore_winchhandler(void);
 int	 __ripoffscreen(SCREEN *);
-void	 __ripoffresize(SCREEN *);
+int	 __ripoffresize(SCREEN *);
 void	 __ripofftouch(SCREEN *);
 int	 __rippedlines(const SCREEN *, int);
 void	 __save_termios(void);

Index: src/lib/libcurses/resize.c
diff -u src/lib/libcurses/resize.c:1.28 src/lib/libcurses/resize.c:1.29
--- src/lib/libcurses/resize.c:1.28	Tue Oct  2 17:35:44 2018
+++ src/lib/libcurses/resize.c	Wed Oct  3 13:22:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: resize.c,v 1.28 2018/10/02 17:35:44 roy Exp $	*/
+/*	$NetBSD: resize.c,v 1.29 2018/10/03 13:22:29 roy Exp $	*/
 
 /*
  * Copyright (c) 2001
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)resize.c   blymn 2001/08/26";
 #else
-__RCSID("$NetBSD: resize.c,v 1.28 2018/10/02 17:35:44 roy Exp $");
+__RCSID("$NetBSD: resize.c,v 1.29 2018/10/03 13:22:29 roy Exp $");
 #endif
 #endif/* not lint */
 
@@ -176,10 +176,7 @@ resizeterm(int nlines, int ncols)
 	clearok(curscr, TRUE);
 
 	if (result == OK) {
-		/* We know how to repaint the ripoffs */
-		__ripoffresize(_cursesi_screen);
-
-		/* We do need to reposition our slks. */
+		/* Redraw the soft label keys to the new size. */
 		__slk_resize(_cursesi_screen, ncols);
 		__slk_noutrefresh(_cursesi_screen);
 	}
@@ -218,12 +215,7 @@ resize_term(int nlines, int ncols)
 	LINES = nlines;
 	COLS = ncols;
 
-	if (_cursesi_screen->slk_window != NULL &&
-	__resizewin(_cursesi_screen->slk_window,
-		_cursesi_screen->slk_window->reqy, ncols) == ERR)
-		return ERR;
-
-	  /* tweak the flags now that we have updated the LINES and COLS */
+	/* tweak the flags now that we have updated the LINES and COLS */
 	for (list = _cursesi_screen->winlistp; list != NULL; list = list->nextp) {
 		win = list->winp;
 
@@ -231,6 +223,10 @@ resize_term(int nlines, int ncols)
 			__swflags(win);
 	}
 
+	/* Resize and re-position the ripped off windows. */
+	if (__ripoffresize(_cursesi_screen) == ERR)
+		return ERR;
+
 	return OK;
 }
 

Index: src/lib/libcurses/ripoffline.c
diff -u src/lib/libcurses/ripoffline.c:1.4 src/lib/libcurses/ripoffline.c:1.5
--- src/lib/libcurses/ripoffline.c:1.4	Tue Oct  2 17:35:44 2018
+++ src/lib/libcurses/ripoffline.c	Wed Oct  3 13:22:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ripoffline.c,v 1.4 2018/10/02 17:35:44 roy Exp $	*/
+/*	$NetBSD: ripoffline.c,v 1.5 2018/10/03 13:22:29 roy Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: ripoffline.c,v 1.4 2018/10/02 17:35:44 roy Exp $");
+__RCSID("$NetBSD: ripoffline.c,v 1.5 2018/10/03 13:22:29 roy Exp $");
 #endif/* not lint */
 
 #include "curses.h"
@@ -138,22 +138,28 @@ __ripoffscreen(SCREEN *screen)
  *	Called from resizeterm to ensure the ripped off lines are correctly
  *	placed and refreshed.
  */
-void
+int
 __ripoffresize(SCREEN *screen)
 {
-	int rbot = screen->LINES, i;
+	int rbot = screen->LINES, i, nlines, ret = OK;
 	struct __ripoff *rip;
 
 	for (i = 0, rip = screen->ripped; i < screen->nripped; i++, rip++) {
-		if (rip->nlines > 0)
-			touchwin(rip->win);
-		else {
+		if (rip->nlines == 0)
+			continue;
+		nlines = rip->nlines < 0 ? -rip->nlines : rip->nlines;
+		if (wresize(rip->win, nlines, screen->COLS) == ERR)
+			ret = ERR;
+		if (rip->nlines < 0) {
 			/* Reposition the lower windows. */
-			mvwin(rip->win, rbot + rip->nlines, 0);
-			rbot += rip->nlines;
+			if (mvwin(rip->win, rbot + rip->nlines, 0) == ERR)
+ret = ERR;
+			else
+rbot += rip->nlines;
 		}
-		wnoutrefresh(rip->win);
 	}
+
+	return ret;
 }
 
 /*



CVS commit: [pgoyette-compat] src/sys/compat/netbsd32

2018-10-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Oct  3 11:59:21 UTC 2018

Modified Files:
src/sys/compat/netbsd32 [pgoyette-compat]: netbsd32_compat_09.c
netbsd32_compat_12.c netbsd32_compat_13.c netbsd32_compat_16.c
netbsd32_compat_20.c netbsd32_compat_30.c netbsd32_compat_40.c
netbsd32_compat_50.c netbsd32_compat_60.c

Log Message:
Normalize the required lists.  Each compat_netbsd32_xx needs the
non-32bit module of the same version _and_ the 32-bit module for
the next higher version.


To generate a diff of this commit:
cvs rdiff -u -r1.18.86.5 -r1.18.86.6 \
src/sys/compat/netbsd32/netbsd32_compat_09.c
cvs rdiff -u -r1.33.36.8 -r1.33.36.9 \
src/sys/compat/netbsd32/netbsd32_compat_12.c
cvs rdiff -u -r1.26.28.8 -r1.26.28.9 \
src/sys/compat/netbsd32/netbsd32_compat_13.c
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/compat/netbsd32/netbsd32_compat_16.c
cvs rdiff -u -r1.36.10.9 -r1.36.10.10 \
src/sys/compat/netbsd32/netbsd32_compat_20.c
cvs rdiff -u -r1.31.16.12 -r1.31.16.13 \
src/sys/compat/netbsd32/netbsd32_compat_30.c
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/compat/netbsd32/netbsd32_compat_40.c
cvs rdiff -u -r1.32.16.11 -r1.32.16.12 \
src/sys/compat/netbsd32/netbsd32_compat_50.c
cvs rdiff -u -r1.3.2.8 -r1.3.2.9 src/sys/compat/netbsd32/netbsd32_compat_60.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_compat_09.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_09.c:1.18.86.5 src/sys/compat/netbsd32/netbsd32_compat_09.c:1.18.86.6
--- src/sys/compat/netbsd32/netbsd32_compat_09.c:1.18.86.5	Tue Sep 11 21:18:32 2018
+++ src/sys/compat/netbsd32/netbsd32_compat_09.c	Wed Oct  3 11:59:21 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_09.c,v 1.18.86.5 2018/09/11 21:18:32 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_compat_09.c,v 1.18.86.6 2018/10/03 11:59:21 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1998 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_09.c,v 1.18.86.5 2018/09/11 21:18:32 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_09.c,v 1.18.86.6 2018/10/03 11:59:21 pgoyette Exp $");
 
 #include 
 #include 
@@ -100,7 +100,7 @@ static struct syscall_package compat_net
 { 0, 0, NULL }
 };
 
-MODULE(MODULE_CLASS_EXEC, compat_netbsd32_09, "compat_netbsd32,compat_09");
+MODULE(MODULE_CLASS_EXEC, compat_netbsd32_09, "compat_netbsd32_12,compat_09");
 
 static int
 compat_netbsd32_09_modcmd(modcmd_t cmd, void *arg)

Index: src/sys/compat/netbsd32/netbsd32_compat_12.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_12.c:1.33.36.8 src/sys/compat/netbsd32/netbsd32_compat_12.c:1.33.36.9
--- src/sys/compat/netbsd32/netbsd32_compat_12.c:1.33.36.8	Wed Oct  3 07:03:17 2018
+++ src/sys/compat/netbsd32/netbsd32_compat_12.c	Wed Oct  3 11:59:21 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_12.c,v 1.33.36.8 2018/10/03 07:03:17 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_compat_12.c,v 1.33.36.9 2018/10/03 11:59:21 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_12.c,v 1.33.36.8 2018/10/03 07:03:17 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_12.c,v 1.33.36.9 2018/10/03 11:59:21 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -229,8 +229,7 @@ static struct syscall_package compat_net
 	{ 0, 0, NULL }
 };
 
-MODULE(MODULE_CLASS_EXEC, compat_netbsd32_12,
-"compat_netbsd32,compat_netbsd32_13,compat_12");
+MODULE(MODULE_CLASS_EXEC, compat_netbsd32_12, "compat_netbsd32_13,compat_12");
 
 static int
 compat_netbsd32_12_modcmd(modcmd_t cmd, void *arg)

Index: src/sys/compat/netbsd32/netbsd32_compat_13.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_13.c:1.26.28.8 src/sys/compat/netbsd32/netbsd32_compat_13.c:1.26.28.9
--- src/sys/compat/netbsd32/netbsd32_compat_13.c:1.26.28.8	Sat Sep 29 07:52:39 2018
+++ src/sys/compat/netbsd32/netbsd32_compat_13.c	Wed Oct  3 11:59:21 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_13.c,v 1.26.28.8 2018/09/29 07:52:39 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_compat_13.c,v 1.26.28.9 2018/10/03 11:59:21 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_13.c,v 1.26.28.8 2018/09/29 07:52:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_13.c,v 1.26.28.9 2018/10/03 11:59:21 pgoyette Exp $");
 
 #include 
 #include 
@@ -104,8 +104,7 @@ static struct syscall_package compat_net
 	{ 0, 0, NULL }
 }; 
 
-MODULE(MODULE_CLASS_EXEC, compat_netbsd32_13,
-"compat_netbsd32,compat_13,compat_netbsd32_16");
+MODULE(MODULE_CLASS_EXEC, compat_netbsd32_13, "compat_13,compat_netbsd32_16");
 
 static int
 compat_netbsd32_13_modcmd(modcmd_t cmd, void *arg)

Index: 

CVS commit: src/sys/dev/usb

2018-10-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct  3 10:02:08 UTC 2018

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

Log Message:
Add support for Panasonic N5HBZ055, from David H. Gutteridge
in PR kern/53647.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/usb/if_athn_usb.c

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

Modified files:

Index: src/sys/dev/usb/if_athn_usb.c
diff -u src/sys/dev/usb/if_athn_usb.c:1.30 src/sys/dev/usb/if_athn_usb.c:1.31
--- src/sys/dev/usb/if_athn_usb.c:1.30	Wed Sep 12 21:57:18 2018
+++ src/sys/dev/usb/if_athn_usb.c	Wed Oct  3 10:02:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_athn_usb.c,v 1.30 2018/09/12 21:57:18 christos Exp $	*/
+/*	$NetBSD: if_athn_usb.c,v 1.31 2018/10/03 10:02:08 martin Exp $	*/
 /*	$OpenBSD: if_athn_usb.c,v 1.12 2013/01/14 09:50:31 jsing Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.30 2018/09/12 21:57:18 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.31 2018/10/03 10:02:08 martin Exp $");
 
 #ifdef	_KERNEL_OPT
 #include "opt_inet.h"
@@ -225,6 +225,7 @@ athn_usb_lookup(int vendor, int product)
 		_D( NETGEAR,	NETGEAR_WNDA3200,	AR7010 ),
 		_D( VIA,	VIA_AR9271,		NONE ),
 		_D( MELCO,	MELCO_CEWL_1,		AR7010 ),
+		_D( PANASONIC,	PANASONIC_N5HBZ055,	AR7010 ),
 #undef _D
 	};
 



CVS commit: src/sys/dev/usb

2018-10-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct  3 10:00:30 UTC 2018

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
Regen


To generate a diff of this commit:
cvs rdiff -u -r1.751 -r1.752 src/sys/dev/usb/usbdevs.h \
src/sys/dev/usb/usbdevs_data.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/dev/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.751 src/sys/dev/usb/usbdevs.h:1.752
--- src/sys/dev/usb/usbdevs.h:1.751	Sun Aug 12 04:19:31 2018
+++ src/sys/dev/usb/usbdevs.h	Wed Oct  3 10:00:29 2018
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.751 2018/08/12 04:19:31 rin Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.752 2018/10/03 10:00:29 martin Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.758 2018/08/12 04:17:54 rin Exp
+ *	NetBSD: usbdevs,v 1.759 2018/10/03 09:59:34 martin Exp
  */
 
 /*-
@@ -2590,6 +2590,7 @@
 #define	USB_PRODUCT_PANASONIC_KXLCB20AN	0x0d0a		/* CD-R Drive KXL-CB20AN */
 #define	USB_PRODUCT_PANASONIC_KXLCB35AN	0x0d0e		/* DVD-ROM & CD-R/RW */
 #define	USB_PRODUCT_PANASONIC_SDCAAE	0x1b00		/* MultiMediaCard Adapter */
+#define	USB_PRODUCT_PANASONIC_N5HBZ055	0x3904		/* Wireless LAN USB Adapter */
 #define	USB_PRODUCT_PANASONIC_DMCFS45	0x2372		/* Lumix Camera DMC-FS45 */
 #define	USB_PRODUCT_PANASONIC_TYTP50P6S	0x3900		/* TY-TP50P6-S 50in Touch Panel */
 
Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.751 src/sys/dev/usb/usbdevs_data.h:1.752
--- src/sys/dev/usb/usbdevs_data.h:1.751	Sun Aug 12 04:19:31 2018
+++ src/sys/dev/usb/usbdevs_data.h	Wed Oct  3 10:00:29 2018
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.751 2018/08/12 04:19:31 rin Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.752 2018/10/03 10:00:29 martin Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.758 2018/08/12 04:17:54 rin Exp
+ *	NetBSD: usbdevs,v 1.759 2018/10/03 09:59:34 martin Exp
  */
 
 /*-
@@ -3472,6 +3472,8 @@ static const uint16_t usb_products[] = {
 	15655, 3102, 14425, 0,
 	USB_VENDOR_PANASONIC, USB_PRODUCT_PANASONIC_SDCAAE, 
 	15663, 4885, 0,
+	USB_VENDOR_PANASONIC, USB_PRODUCT_PANASONIC_N5HBZ055, 
+	651, 7290, 4871, 4885, 0,
 	USB_VENDOR_PANASONIC, USB_PRODUCT_PANASONIC_DMCFS45, 
 	15678, 2983, 15684, 0,
 	USB_VENDOR_PANASONIC, USB_PRODUCT_PANASONIC_TYTP50P6S, 
@@ -4992,7 +4994,7 @@ static const char usb_words[] = { "." 
 	"Lucent\0" /* 1 refs @ 624 */
 	"Plantronics\0" /* 1 refs @ 631 */
 	"Kyocera\0" /* 3 refs @ 643 */
-	"Wireless\0" /* 47 refs @ 651 */
+	"Wireless\0" /* 48 refs @ 651 */
 	"STMicroelectronics\0" /* 1 refs @ 660 */
 	"Foxconn\0" /* 1 refs @ 679 */
 	"/\0" /* 13 refs @ 687 */
@@ -5550,9 +5552,9 @@ static const char usb_words[] = { "." 
 	"GNU\0" /* 1 refs @ 4850 */
 	"USRP\0" /* 2 refs @ 4854 */
 	"HomeConnect\0" /* 4 refs @ 4859 */
-	"USB\0" /* 206 refs @ 4871 */
+	"USB\0" /* 207 refs @ 4871 */
 	"Bluetooth\0" /* 26 refs @ 4875 */
-	"Adapter\0" /* 75 refs @ 4885 */
+	"Adapter\0" /* 76 refs @ 4885 */
 	"3C19250\0" /* 1 refs @ 4893 */
 	"Ethernet\0" /* 90 refs @ 4901 */
 	"adapter\0" /* 85 refs @ 4910 */
@@ -5873,7 +5875,7 @@ static const char usb_words[] = { "." 
 	"F5U109\0" /* 1 refs @ 7270 */
 	"SCSI\0" /* 1 refs @ 7277 */
 	"Adaptor\0" /* 4 refs @ 7282 */
-	"LAN\0" /* 3 refs @ 7290 */
+	"LAN\0" /* 4 refs @ 7290 */
 	"Converter\0" /* 2 refs @ 7294 */
 	"F5U208\0" /* 1 refs @ 7304 */
 	"VideoBus\0" /* 1 refs @ 7311 */



CVS commit: src/sys/dev/usb

2018-10-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct  3 09:59:34 UTC 2018

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
David H. Gutteridge in PR kern/53647: add Panasonic N5HBZ055
WiFi device.


To generate a diff of this commit:
cvs rdiff -u -r1.758 -r1.759 src/sys/dev/usb/usbdevs

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

Modified files:

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.758 src/sys/dev/usb/usbdevs:1.759
--- src/sys/dev/usb/usbdevs:1.758	Sun Aug 12 04:17:54 2018
+++ src/sys/dev/usb/usbdevs	Wed Oct  3 09:59:34 2018
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.758 2018/08/12 04:17:54 rin Exp $
+$NetBSD: usbdevs,v 1.759 2018/10/03 09:59:34 martin Exp $
 
 /*-
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -2583,6 +2583,7 @@ product PANASONIC KXLRW32AN	0x0d09	CD-R 
 product PANASONIC KXLCB20AN	0x0d0a	CD-R Drive KXL-CB20AN
 product PANASONIC KXLCB35AN	0x0d0e	DVD-ROM & CD-R/RW
 product PANASONIC SDCAAE	0x1b00	MultiMediaCard Adapter
+product	PANASONIC N5HBZ055	0x3904	Wireless LAN USB Adapter
 product PANASONIC DMCFS45	0x2372	Lumix Camera DMC-FS45
 product PANASONIC TYTP50P6S	0x3900	TY-TP50P6-S 50in Touch Panel
 



CVS commit: src/sys/arch/aarch64/aarch64

2018-10-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Oct  3 09:59:05 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: cpu.c

Log Message:
Fix some product names and details as suggested by jmcneill


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/aarch64/aarch64/cpu.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/aarch64/aarch64/cpu.c
diff -u src/sys/arch/aarch64/aarch64/cpu.c:1.8 src/sys/arch/aarch64/aarch64/cpu.c:1.9
--- src/sys/arch/aarch64/aarch64/cpu.c:1.8	Wed Oct  3 05:49:53 2018
+++ src/sys/arch/aarch64/aarch64/cpu.c	Wed Oct  3 09:59:05 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.8 2018/10/03 05:49:53 skrll Exp $ */
+/* $NetBSD: cpu.c,v 1.9 2018/10/03 09:59:05 skrll Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.8 2018/10/03 05:49:53 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.9 2018/10/03 09:59:05 skrll Exp $");
 
 #include "locators.h"
 #include "opt_arm_debug.h"
@@ -177,10 +177,10 @@ const struct cpuidtab cpuids[] = {
 	{ CPU_ID_CORTEXA73R0 & CPU_PARTMASK, "Cortex-A73", "Cortex", "V8-A" },
 	{ CPU_ID_CORTEXA55R1 & CPU_PARTMASK, "Cortex-A55", "Cortex", "V8.2-A" },
 	{ CPU_ID_CORTEXA75R2 & CPU_PARTMASK, "Cortex-A75", "Cortex", "V8.2-A" },
-	{ CPU_ID_THUNDERXRX, "Cavium Thunder X", "Cavium", "V8-A" },
-	{ CPU_ID_THUNDERX81XXRX, "Cavium Thunder X CN81XX", "Cavium", "V8-A" },
-	{ CPU_ID_THUNDERX83XXRX, "Cavium Thunder X CN83XX", "Cavium", "V8-A" },
-	{ CPU_ID_THUNDERX2RX, "Cavium Thunder X2", "Cavium", "V8-A" },
+	{ CPU_ID_THUNDERXRX, "Cavium ThunderX", "Cavium", "V8-A" },
+	{ CPU_ID_THUNDERX81XXRX, "Cavium ThunderX CN81XX", "Cavium", "V8-A" },
+	{ CPU_ID_THUNDERX83XXRX, "Cavium ThunderX CN83XX", "Cavium", "V8-A" },
+	{ CPU_ID_THUNDERX2RX, "Cavium Thunder X2", "Cavium", "V8.1-A" },
 };
 
 static void



CVS commit: src/usr.sbin/acpitools/acpidump

2018-10-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct  3 09:52:59 UTC 2018

Modified Files:
src/usr.sbin/acpitools/acpidump: acpi.c

Log Message:
- Decode DMAR's ANDD (ACPI Name Space).
- Add X2APIC_MODE flag of DMAR. Note that Intel's VT-d's document says the
  flag's name is DMA_CTRL_PLATFORM_OPT_IN but actbl1.h says it's
  DMAR_X2APIC_MODE.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/acpitools/acpidump/acpi.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/acpitools/acpidump/acpi.c
diff -u src/usr.sbin/acpitools/acpidump/acpi.c:1.30 src/usr.sbin/acpitools/acpidump/acpi.c:1.31
--- src/usr.sbin/acpitools/acpidump/acpi.c:1.30	Wed Oct  3 09:46:11 2018
+++ src/usr.sbin/acpitools/acpidump/acpi.c	Wed Oct  3 09:52:59 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi.c,v 1.30 2018/10/03 09:46:11 msaitoh Exp $ */
+/* $NetBSD: acpi.c,v 1.31 2018/10/03 09:52:59 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 1998 Doug Rabson
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: acpi.c,v 1.30 2018/10/03 09:46:11 msaitoh Exp $");
+__RCSID("$NetBSD: acpi.c,v 1.31 2018/10/03 09:52:59 msaitoh Exp $");
 
 #include 
 #include 
@@ -2520,6 +2520,8 @@ devscope_type2str(int type)
 		return ("IOAPIC");
 	case 4:
 		return ("HPET");
+	case 5:
+		return ("ACPI Name space");
 	default:
 		snprintf(typebuf, sizeof(typebuf), "%d", type);
 		return (typebuf);
@@ -2667,6 +2669,17 @@ acpi_handle_dmar_rhsa(ACPI_DMAR_RHSA *rh
 	printf("\tProximityDomain=0x%08x\n", rhsa->ProximityDomain);
 }
 
+static void
+acpi_handle_dmar_andd(ACPI_DMAR_ANDD *andd)
+{
+
+	printf("\n");
+	printf("\tType=ANDD\n");
+	printf("\tLength=%d\n", andd->Header.Length);
+	printf("\tDeviceNumber=%d\n", andd->DeviceNumber);
+	printf("\tDeviceName=0x%s\n", andd->DeviceName);
+}
+
 static int
 acpi_handle_dmar_remapping_structure(void *addr, int remaining)
 {
@@ -2691,6 +2704,9 @@ acpi_handle_dmar_remapping_structure(voi
 	case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
 		acpi_handle_dmar_rhsa(addr);
 		break;
+	case ACPI_DMAR_TYPE_NAMESPACE:
+		acpi_handle_dmar_andd(addr);
+		break;
 	default:
 		printf("\n");
 		printf("\tType=%d\n", hdr->Type);
@@ -2721,6 +2737,7 @@ acpi_handle_dmar(ACPI_TABLE_HEADER *sdp)
 	printf("\tFlags=");
 	PRINTFLAG(dmar->Flags, INTR_REMAP);
 	PRINTFLAG(dmar->Flags, X2APIC_OPT_OUT);
+	PRINTFLAG(dmar->Flags, X2APIC_MODE);
 	PRINTFLAG_END();
 
 #undef PRINTFLAG



CVS commit: src/usr.sbin/acpitools/acpidump

2018-10-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct  3 09:46:11 UTC 2018

Modified Files:
src/usr.sbin/acpitools/acpidump: acpi.c acpidump.8

Log Message:
 Add ACPI LPIT (Low Power Idle Table) from FreeBSD r336185.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/acpitools/acpidump/acpi.c
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/acpitools/acpidump/acpidump.8

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/acpitools/acpidump/acpi.c
diff -u src/usr.sbin/acpitools/acpidump/acpi.c:1.29 src/usr.sbin/acpitools/acpidump/acpi.c:1.30
--- src/usr.sbin/acpitools/acpidump/acpi.c:1.29	Thu Sep 28 06:55:08 2017
+++ src/usr.sbin/acpitools/acpidump/acpi.c	Wed Oct  3 09:46:11 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi.c,v 1.29 2017/09/28 06:55:08 msaitoh Exp $ */
+/* $NetBSD: acpi.c,v 1.30 2018/10/03 09:46:11 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 1998 Doug Rabson
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: acpi.c,v 1.29 2017/09/28 06:55:08 msaitoh Exp $");
+__RCSID("$NetBSD: acpi.c,v 1.30 2018/10/03 09:46:11 msaitoh Exp $");
 
 #include 
 #include 
@@ -86,6 +86,7 @@ static void	acpi_handle_dbg2(ACPI_TABLE_
 static void	acpi_handle_einj(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_erst(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_hest(ACPI_TABLE_HEADER *sdp);
+static void	acpi_handle_lpit(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_madt(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_msct(ACPI_TABLE_HEADER *sdp);
 static void	acpi_handle_ecdt(ACPI_TABLE_HEADER *sdp);
@@ -1709,6 +1710,79 @@ acpi_handle_hpet(ACPI_TABLE_HEADER *sdp)
 }
 
 static void
+acpi_print_native_lpit(ACPI_LPIT_NATIVE *nl)
+{
+	printf("\tEntryTrigger=");
+	acpi_print_gas(>EntryTrigger);
+	printf("\tResidency=%u\n", nl->Residency);
+	printf("\tLatency=%u\n", nl->Latency);
+	if (nl->Header.Flags & ACPI_LPIT_NO_COUNTER)
+		printf("\tResidencyCounter=Not Present");
+	else {
+		printf("\tResidencyCounter=");
+		acpi_print_gas(>ResidencyCounter);
+	}
+	if (nl->CounterFrequency)
+		printf("\tCounterFrequency=%ju\n", nl->CounterFrequency);
+	else
+		printf("\tCounterFrequency=TSC\n");
+}
+
+static void
+acpi_print_lpit(ACPI_LPIT_HEADER *lpit)
+{
+	if (lpit->Type == ACPI_LPIT_TYPE_NATIVE_CSTATE)
+		printf("\tType=ACPI_LPIT_TYPE_NATIVE_CSTATE\n");
+	else
+		warnx("unknown LPIT type %u", lpit->Type);
+
+	printf("\tLength=%u\n", lpit->Length);
+	printf("\tUniqueId=0x%04x\n", lpit->UniqueId);
+#define	PRINTFLAG(var, flag)	printflag((var), ACPI_LPIT_## flag, #flag)
+	printf("\tFlags=");
+	PRINTFLAG(lpit->Flags, STATE_DISABLED);
+	PRINTFLAG_END();
+#undef PRINTFLAG
+
+	if (lpit->Type == ACPI_LPIT_TYPE_NATIVE_CSTATE)
+		return acpi_print_native_lpit((ACPI_LPIT_NATIVE *)lpit);
+}
+
+static void
+acpi_walk_lpit(ACPI_TABLE_HEADER *table, void *first,
+void (*action)(ACPI_LPIT_HEADER *))
+{
+	ACPI_LPIT_HEADER *subtable;
+	char *end;
+
+	subtable = first;
+	end = (char *)table + table->Length;
+	while ((char *)subtable < end) {
+		printf("\n");
+		if (subtable->Length < sizeof(ACPI_LPIT_HEADER)) {
+			warnx("invalid subtable length %u", subtable->Length);
+			return;
+		}
+		action(subtable);
+		subtable = (ACPI_LPIT_HEADER *)((char *)subtable +
+		subtable->Length);
+	}
+}
+
+static void
+acpi_handle_lpit(ACPI_TABLE_HEADER *sdp)
+{
+	ACPI_TABLE_LPIT *lpit;
+
+	printf(BEGIN_COMMENT);
+	acpi_print_sdt(sdp);
+	lpit = (ACPI_TABLE_LPIT *)sdp;
+	acpi_walk_lpit(sdp, (lpit + 1), acpi_print_lpit);
+
+	printf(END_COMMENT);
+}
+
+static void
 acpi_handle_msct(ACPI_TABLE_HEADER *sdp)
 {
 	ACPI_TABLE_MSCT *msct;
@@ -3323,6 +3397,8 @@ acpi_handle_rsdt(ACPI_TABLE_HEADER *rsdp
 			acpi_handle_hpet(sdp);
 		else if (!memcmp(sdp->Signature, ACPI_SIG_ECDT, 4))
 			acpi_handle_ecdt(sdp);
+		else if (!memcmp(sdp->Signature, ACPI_SIG_LPIT, 4))
+			acpi_handle_lpit(sdp);
 		else if (!memcmp(sdp->Signature, ACPI_SIG_MCFG, 4))
 			acpi_handle_mcfg(sdp);
 		else if (!memcmp(sdp->Signature, ACPI_SIG_SBST, 4))

Index: src/usr.sbin/acpitools/acpidump/acpidump.8
diff -u src/usr.sbin/acpitools/acpidump/acpidump.8:1.10 src/usr.sbin/acpitools/acpidump/acpidump.8:1.11
--- src/usr.sbin/acpitools/acpidump/acpidump.8:1.10	Fri Sep  1 18:35:50 2017
+++ src/usr.sbin/acpitools/acpidump/acpidump.8	Wed Oct  3 09:46:11 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: acpidump.8,v 1.10 2017/09/01 18:35:50 msaitoh Exp $
+.\" $NetBSD: acpidump.8,v 1.11 2018/10/03 09:46:11 msaitoh Exp $
 .\" ACPI (ACPI Package)
 .\"
 .\" Copyright (c) 1999 Doug Rabson 
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD: head/usr.sbin/acpi/acpidump/acpidump.8 267668 2014-06-20 09:57:27Z bapt $
 .\"
-.Dd September 1, 2017
+.Dd October 3, 2018
 .Dt ACPIDUMP 8
 .Os
 .Sh NAME
@@ -110,6 +110,7 @@ utility dumps contents of the following 
 .It FADT
 .It HEST
 .It HPET
+.It LPIT
 .It MADT
 .It MCFG
 .It MSCT



CVS commit: src/sys/arch

2018-10-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Oct  3 09:24:36 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: files.generic64
Added Files:
src/sys/arch/arm/cavium: files.thunderx thunderx_platform.c
thunderx_platform.h

Log Message:
Embryonic Cavium ThunderX support


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/cavium/files.thunderx \
src/sys/arch/arm/cavium/thunderx_platform.c \
src/sys/arch/arm/cavium/thunderx_platform.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/files.generic64

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/files.generic64
diff -u src/sys/arch/evbarm/conf/files.generic64:1.5 src/sys/arch/evbarm/conf/files.generic64:1.6
--- src/sys/arch/evbarm/conf/files.generic64:1.5	Sat Sep  8 00:51:57 2018
+++ src/sys/arch/evbarm/conf/files.generic64	Wed Oct  3 09:24:36 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.generic64,v 1.5 2018/09/08 00:51:57 jmcneill Exp $
+#	$NetBSD: files.generic64,v 1.6 2018/10/03 09:24:36 skrll Exp $
 #
 
 defparam opt_arm_debug.h	EARLYCONS
@@ -12,6 +12,7 @@ include "arch/evbarm/conf/files.fdt"
 #
 include "arch/arm/amd/files.seattle"
 include "arch/arm/broadcom/files.bcm2835"
+include "arch/arm/cavium/files.thunderx"
 include "arch/arm/nvidia/files.tegra"
 include "arch/arm/rockchip/files.rockchip"
 include "arch/arm/sunxi/files.sunxi"

Added files:

Index: src/sys/arch/arm/cavium/files.thunderx
diff -u /dev/null src/sys/arch/arm/cavium/files.thunderx:1.1
--- /dev/null	Wed Oct  3 09:24:36 2018
+++ src/sys/arch/arm/cavium/files.thunderx	Wed Oct  3 09:24:36 2018
@@ -0,0 +1,9 @@
+#	$NetBSD: files.thunderx,v 1.1 2018/10/03 09:24:36 skrll Exp $
+#
+# Configuration info for Cavium ThunderX based systems.
+#
+#
+
+file	arch/arm/cavium/thunderx_platform.c	soc_thunderx
+
+defflag	opt_soc.hSOC_THUNDERX
Index: src/sys/arch/arm/cavium/thunderx_platform.c
diff -u /dev/null src/sys/arch/arm/cavium/thunderx_platform.c:1.1
--- /dev/null	Wed Oct  3 09:24:36 2018
+++ src/sys/arch/arm/cavium/thunderx_platform.c	Wed Oct  3 09:24:36 2018
@@ -0,0 +1,131 @@
+/*	$NetBSD: thunderx_platform.c,v 1.1 2018/10/03 09:24:36 skrll Exp $	*/
+
+/*-
+ * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nick Hudson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "opt_console.h"
+#include "opt_soc.h"
+#include "opt_multiprocessor.h"
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: thunderx_platform.c,v 1.1 2018/10/03 09:24:36 skrll Exp $");
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+
+void thunderx_platform_early_putchar(char);
+
+static const struct pmap_devmap *
+thunderx_platform_devmap(void)
+{
+	static const struct pmap_devmap devmap[] = {
+		DEVMAP_ENTRY(THUNDERX_CORE_VBASE, THUNDERX_CORE_PBASE, THUNDERX_CORE_SIZE),
+		DEVMAP_ENTRY_END
+	};
+
+	return devmap;
+}
+
+static void
+thunderx_platform_init_attach_args(struct fdt_attach_args *faa)
+{
+	extern struct arm32_bus_dma_tag arm_generic_dma_tag;
+	extern struct bus_space arm_generic_bs_tag;
+	extern struct bus_space arm_generic_a4x_bs_tag;
+
+	faa->faa_bst = _generic_bs_tag;
+	faa->faa_a4x_bst = _generic_a4x_bs_tag;
+	faa->faa_dmat = _generic_dma_tag;
+}
+
+void
+thunderx_platform_early_putchar(char c)
+{
+#ifdef CONSADDR
+	volatile uint32_t *uartaddr = (volatile uint32_t *)CONSADDR;
+
+	while 

CVS commit: [pgoyette-compat] src/sys/compat/netbsd32

2018-10-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Oct  3 07:03:17 UTC 2018

Modified Files:
src/sys/compat/netbsd32 [pgoyette-compat]: netbsd32_compat_12.c
netbsd32_compat_16.c netbsd32_compat_20.c netbsd32_compat_30.c
netbsd32_compat_40.c netbsd32_compat_50.c netbsd32_compat_60.c

Log Message:
Make sure that each version-specific compat_netbsd32_xx module depends
on all higher-version-specific modules, similar to the non-32bit
compat_xx modules.


To generate a diff of this commit:
cvs rdiff -u -r1.33.36.7 -r1.33.36.8 \
src/sys/compat/netbsd32/netbsd32_compat_12.c
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/compat/netbsd32/netbsd32_compat_16.c
cvs rdiff -u -r1.36.10.8 -r1.36.10.9 \
src/sys/compat/netbsd32/netbsd32_compat_20.c
cvs rdiff -u -r1.31.16.11 -r1.31.16.12 \
src/sys/compat/netbsd32/netbsd32_compat_30.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/compat/netbsd32/netbsd32_compat_40.c
cvs rdiff -u -r1.32.16.10 -r1.32.16.11 \
src/sys/compat/netbsd32/netbsd32_compat_50.c
cvs rdiff -u -r1.3.2.7 -r1.3.2.8 src/sys/compat/netbsd32/netbsd32_compat_60.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_compat_12.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_12.c:1.33.36.7 src/sys/compat/netbsd32/netbsd32_compat_12.c:1.33.36.8
--- src/sys/compat/netbsd32/netbsd32_compat_12.c:1.33.36.7	Tue Sep 11 21:18:32 2018
+++ src/sys/compat/netbsd32/netbsd32_compat_12.c	Wed Oct  3 07:03:17 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_12.c,v 1.33.36.7 2018/09/11 21:18:32 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_compat_12.c,v 1.33.36.8 2018/10/03 07:03:17 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_12.c,v 1.33.36.7 2018/09/11 21:18:32 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_12.c,v 1.33.36.8 2018/10/03 07:03:17 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -229,7 +229,8 @@ static struct syscall_package compat_net
 	{ 0, 0, NULL }
 };
 
-MODULE(MODULE_CLASS_EXEC, compat_netbsd32_12, "compat_netbsd32,compat_12");
+MODULE(MODULE_CLASS_EXEC, compat_netbsd32_12,
+"compat_netbsd32,compat_netbsd32_13,compat_12");
 
 static int
 compat_netbsd32_12_modcmd(modcmd_t cmd, void *arg)

Index: src/sys/compat/netbsd32/netbsd32_compat_16.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_16.c:1.1.2.3 src/sys/compat/netbsd32/netbsd32_compat_16.c:1.1.2.4
--- src/sys/compat/netbsd32/netbsd32_compat_16.c:1.1.2.3	Fri Sep 14 08:38:37 2018
+++ src/sys/compat/netbsd32/netbsd32_compat_16.c	Wed Oct  3 07:03:17 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_16.c,v 1.1.2.3 2018/09/14 08:38:37 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_compat_16.c,v 1.1.2.4 2018/10/03 07:03:17 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_16.c,v 1.1.2.3 2018/09/14 08:38:37 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_16.c,v 1.1.2.4 2018/10/03 07:03:17 pgoyette Exp $");
 
 #include 
 #include 
@@ -53,7 +53,8 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_com
 
 struct uvm_object *emul_netbsd32_object;
 
-MODULE(MODULE_CLASS_EXEC, compat_netbsd32_16, "compat_netbsd32,compat_16");
+MODULE(MODULE_CLASS_EXEC, compat_netbsd32_16,
+"compat_netbsd32,compat_netbsd32_20,compat_16");
 
 static int
 compat_netbsd32_16_modcmd(modcmd_t cmd, void *arg)

Index: src/sys/compat/netbsd32/netbsd32_compat_20.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_20.c:1.36.10.8 src/sys/compat/netbsd32/netbsd32_compat_20.c:1.36.10.9
--- src/sys/compat/netbsd32/netbsd32_compat_20.c:1.36.10.8	Tue Sep 11 21:18:32 2018
+++ src/sys/compat/netbsd32/netbsd32_compat_20.c	Wed Oct  3 07:03:17 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_20.c,v 1.36.10.8 2018/09/11 21:18:32 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_compat_20.c,v 1.36.10.9 2018/10/03 07:03:17 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_20.c,v 1.36.10.8 2018/09/11 21:18:32 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_20.c,v 1.36.10.9 2018/10/03 07:03:17 pgoyette Exp $");
 
 #include 
 #include 
@@ -232,7 +232,8 @@ static struct syscall_package compat_net
 	{ 0, 0, NULL }
 };
 
-MODULE(MODULE_CLASS_EXEC, compat_netbsd32_20, "compat_netbsd32,compat_20");
+MODULE(MODULE_CLASS_EXEC, compat_netbsd32_20,
+"compat_netbsd32,compat_netbsd32_30,compat_20");
 
 static int
 compat_netbsd32_20_modcmd(modcmd_t cmd, void *arg)

Index: src/sys/compat/netbsd32/netbsd32_compat_30.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_30.c:1.31.16.11 src/sys/compat/netbsd32/netbsd32_compat_30.c:1.31.16.12
--- 

CVS commit: src/sys/dev/pci

2018-10-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct  3 06:46:09 UTC 2018

Modified Files:
src/sys/dev/pci: pci_subr.c pcireg.h

Log Message:
- Don't print TPH requester's ST Table Size if the ST table location field
  is not PCI_TPH_REQ_STTBLLOC_TPHREQ because the size field is only applicaple
  for PCI_TPH_REQ_STTBLLOC_TPHREQ case.
- Add comment.


To generate a diff of this commit:
cvs rdiff -u -r1.204 -r1.205 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.141 -r1.142 src/sys/dev/pci/pcireg.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/dev/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.204 src/sys/dev/pci/pci_subr.c:1.205
--- src/sys/dev/pci/pci_subr.c:1.204	Thu Sep 27 07:09:29 2018
+++ src/sys/dev/pci/pci_subr.c	Wed Oct  3 06:46:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.204 2018/09/27 07:09:29 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.205 2018/10/03 06:46:09 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.204 2018/09/27 07:09:29 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.205 2018/10/03 06:46:09 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -3538,7 +3538,7 @@ static void
 pci_conf_print_tph_req_cap(const pcireg_t *regs, int extcapoff)
 {
 	pcireg_t reg;
-	int size, i, j;
+	int size = 0, i, j;
 	uint8_t sttbloc;
 
 	printf("\n  TPH Requester Extended Capability\n");
@@ -3552,8 +3552,10 @@ pci_conf_print_tph_req_cap(const pcireg_
 	sttbloc = __SHIFTOUT(reg, PCI_TPH_REQ_CAP_STTBLLOC);
 	printf("  ST Table Location: %s\n",
 	pci_conf_print_tph_req_cap_sttabloc(sttbloc));
-	size = __SHIFTOUT(reg, PCI_TPH_REQ_CAP_STTBLSIZ) + 1;
-	printf("  ST Table Size: %d\n", size);
+	if (sttbloc == PCI_TPH_REQ_STTBLLOC_TPHREQ) {
+		size = __SHIFTOUT(reg, PCI_TPH_REQ_CAP_STTBLSIZ) + 1;
+		printf("  ST Table Size: %d\n", size);
+	}
 
 	reg = regs[o2i(extcapoff + PCI_TPH_REQ_CTL)];
 	printf("TPH Requester Control register: 0x%08x\n", reg);

Index: src/sys/dev/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.141 src/sys/dev/pci/pcireg.h:1.142
--- src/sys/dev/pci/pcireg.h:1.141	Thu Sep 27 07:09:29 2018
+++ src/sys/dev/pci/pcireg.h	Wed Oct  3 06:46:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcireg.h,v 1.141 2018/09/27 07:09:29 msaitoh Exp $	*/
+/*	$NetBSD: pcireg.h,v 1.142 2018/10/03 06:46:09 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -1186,8 +1186,8 @@ struct pci_msix_table_entry {
 	uint32_t pci_msix_vector_control;
 };
 #define	PCI_MSIX_VECTCTL_MASK	__BIT(0)
-#define	PCI_MSIX_VECTCTL_STLO	__BITS(23, 16)
-#define	PCI_MSIX_VECTCTL_STUP	__BITS(31, 24)
+#define	PCI_MSIX_VECTCTL_STLO	__BITS(23, 16)	/* ST lower */
+#define	PCI_MSIX_VECTCTL_STUP	__BITS(31, 24)	/* ST upper */
 
  /* Max number of MSI-X vectors. See PCI-SIG specification. */
 #define	PCI_MSIX_MAX_VECTORS	2048



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

2018-10-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Oct  3 06:02:33 UTC 2018

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

Log Message:
Sort the SOC_ list


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/evbarm/conf/GENERIC64

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/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.42 src/sys/arch/evbarm/conf/GENERIC64:1.43
--- src/sys/arch/evbarm/conf/GENERIC64:1.42	Wed Oct  3 05:45:49 2018
+++ src/sys/arch/evbarm/conf/GENERIC64	Wed Oct  3 06:02:33 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.42 2018/10/03 05:45:49 skrll Exp $
+#	$NetBSD: GENERIC64,v 1.43 2018/10/03 06:02:33 skrll Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -61,10 +61,10 @@ options 	CPU_CORTEXA57
 options 	SOC_BCM2837
 options 	SOC_RK3328
 options 	SOC_RK3399
-options 	SOC_TEGRA210
 options 	SOC_SUN50I_A64
 options 	SOC_SUN50I_H5
 options 	SOC_SUN50I_H6
+options 	SOC_TEGRA210
 options 	SOC_VIRT
 options 	MULTIPROCESSOR