CVS commit: src/sys/arch/luna68k/stand/boot

2018-09-27 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Sep 28 04:34:02 UTC 2018

Modified Files:
src/sys/arch/luna68k/stand/boot: locore.S

Log Message:
Improve codes.  No functional changes intended.
Confirmed on LUNA-I.  OK'ed by tsutsui@.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/luna68k/stand/boot/locore.S

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

Modified files:

Index: src/sys/arch/luna68k/stand/boot/locore.S
diff -u src/sys/arch/luna68k/stand/boot/locore.S:1.13 src/sys/arch/luna68k/stand/boot/locore.S:1.14
--- src/sys/arch/luna68k/stand/boot/locore.S:1.13	Fri Sep 28 04:13:24 2018
+++ src/sys/arch/luna68k/stand/boot/locore.S	Fri Sep 28 04:34:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.13 2018/09/28 04:13:24 isaki Exp $	*/
+/*	$NetBSD: locore.S,v 1.14 2018/09/28 04:34:02 isaki Exp $	*/
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -137,7 +137,7 @@ ASGLOBAL(Reset)
 	VECTOR(badtrap)		/* 28: level 4 interrupt autovector */
 	VECTOR(lev5intr)	/* 29: level 5 interrupt autovector */
 	VECTOR(lev6intr)	/* 30: level 6 interrupt autovector */
-	VECTOR(badtrap)		/* 31: level 7 interrupt autovector */
+	VECTOR(exit)		/* 31: level 7 interrupt autovector */
 	VECTOR(illinst)		/* 32: syscalls */
 	VECTOR(illinst)		/* 33: sigreturn syscall or breakpoint */
 	VECTOR(illinst)		/* 34: breakpoint or sigreturn syscall */
@@ -211,32 +211,21 @@ Lbssclr:
 	bne	Lbssclr			| no, keep going
 
 /* save address to goto ROM monitor */
-	movec	%vbr,%a0		| ROM vbr to %a0
-	movl	%a0@(NMIVEC),%d0	| restore NMIVEC
-	movl	#_ASM_LABEL(gotoROM),%a0	| save to _gotoROM
-	movl	%d0,%a0@		|
+	movec	%vbr,%a0		| save ROM vbr
+	movl	%a0,_ASM_LABEL(romvbr)
 	movl	#_ASM_LABEL(Reset),%a0	| BP vbr to %a0
-	movl	#_C_LABEL(exit),%a0@(NMIVEC)	| save address
-
-
-/* switch vector tabel */
-	movec	%vbr,%a0
-	movl	%a0@(ILLGINST),%sp@-	| save ILLINST vector for BrkPtr
-	movl	%a0@(EVTRAPF),%sp@-
-
-	movl	#_ASM_LABEL(Reset),%a0
-	movl	%sp@+,%a0@(EVTRAPF)
-	movl	%sp@+,%a0@(ILLGINST)	| restore ILLINST vector
+/* copy ROM vectors */
+	movl	%a0@(ILLGINST),_ASM_LABEL(Reset) + ILLGINST
+	movl	%a0@(EVTRAPF),_ASM_LABEL(Reset) + EVTRAPF
 	movec	%a0,%vbr
 
-	movl	#DIPSW,%a0
-	movw	%a0@,%d0
-	lsrl	#8,%d0
-	andl	#0xFF,%d0
-	movl	%d0,_C_LABEL(dipsw1)
-	movw	%a0@,%d0
-	andl	#0xFF,%d0
-	movl	%d0,_C_LABEL(dipsw2)
+	movw	DIPSW,%d0
+	clrl	%d1
+	movw	%d0,%d1
+	lsrl	#8,%d1
+	movl	%d1,_C_LABEL(dipsw1)
+	movb	%d0,%d1
+	movl	%d1,_C_LABEL(dipsw2)
 
 /* determine our CPU */
 
@@ -268,16 +257,12 @@ Lstart0:
 /*
  * exit to ROM monitor
  */
-
-	ROM_VBR = 0
-
 ENTRY_NOPROFILE(exit)
 GLOBAL(_rtt)
 	movw	#PSL_HIGHIPL,%sr	| no interrupts
-	movl	#ROM_VBR,%a0
+	movl	_ASM_LABEL(romvbr),%a0
 	movec	%a0,%vbr
-	movl	#_ASM_LABEL(gotoROM),%a0
-	movl	%a0@,%a1
+	movl	%a0@(NMIVEC),%a1
 	jmp	%a1@
 
 /*
@@ -760,7 +745,7 @@ ENTRY(spl7)
  * Memory Information Field for secondary booter memory allocator
  */
 
-ASLOCAL(gotoROM)
+ASLOCAL(romvbr)
 	.long	0
 
 GLOBAL(dipsw1)



CVS commit: src/sys/arch/luna68k/stand/boot

2018-09-27 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Sep 28 04:34:02 UTC 2018

Modified Files:
src/sys/arch/luna68k/stand/boot: locore.S

Log Message:
Improve codes.  No functional changes intended.
Confirmed on LUNA-I.  OK'ed by tsutsui@.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/luna68k/stand/boot/locore.S

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



CVS commit: src/sys/arch/luna68k/stand/boot

2018-09-27 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Sep 28 04:13:24 UTC 2018

Modified Files:
src/sys/arch/luna68k/stand/boot: locore.S

Log Message:
Remove unused variable.
OK'ed by tsutsui@.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/luna68k/stand/boot/locore.S

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

Modified files:

Index: src/sys/arch/luna68k/stand/boot/locore.S
diff -u src/sys/arch/luna68k/stand/boot/locore.S:1.12 src/sys/arch/luna68k/stand/boot/locore.S:1.13
--- src/sys/arch/luna68k/stand/boot/locore.S:1.12	Fri Sep 28 03:53:59 2018
+++ src/sys/arch/luna68k/stand/boot/locore.S	Fri Sep 28 04:13:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.12 2018/09/28 03:53:59 isaki Exp $	*/
+/*	$NetBSD: locore.S,v 1.13 2018/09/28 04:13:24 isaki Exp $	*/
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -202,11 +202,6 @@ ASENTRY_NOPROFILE(start1)
 	movw	#PSL_HIGHIPL,%sr	| no interrupts
 	movl	#STACK,%sp		| set SP
 
-	movl	#_C_LABEL(prgcore), %a2	| save program address
-	movl	#_ASM_LABEL(Reset), %a2@+	| save start of core
-	movl	#_C_LABEL(end),  %a2@+	| save end of core
-	movl	#STACK, %a2@		| save initial stack addr
-
 /* clear BSS area */
 	movl	#_C_LABEL(edata),%a2	| start of BSS
 	movl	#_C_LABEL(end),%a3	| end
@@ -765,11 +760,6 @@ ENTRY(spl7)
  * Memory Information Field for secondary booter memory allocator
  */
 
-GLOBAL(prgcore)
-	.long	0
-	.long	0
-	.long	0
-
 ASLOCAL(gotoROM)
 	.long	0
 



CVS commit: src/sys/arch/luna68k/stand/boot

2018-09-27 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Sep 28 04:13:24 UTC 2018

Modified Files:
src/sys/arch/luna68k/stand/boot: locore.S

Log Message:
Remove unused variable.
OK'ed by tsutsui@.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/luna68k/stand/boot/locore.S

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



CVS commit: src/sys/arch/luna68k/stand/boot

2018-09-27 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Sep 28 03:53:59 UTC 2018

Modified Files:
src/sys/arch/luna68k/stand/boot: locore.S

Log Message:
Fix a wrong comment.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/luna68k/stand/boot/locore.S

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

Modified files:

Index: src/sys/arch/luna68k/stand/boot/locore.S
diff -u src/sys/arch/luna68k/stand/boot/locore.S:1.11 src/sys/arch/luna68k/stand/boot/locore.S:1.12
--- src/sys/arch/luna68k/stand/boot/locore.S:1.11	Mon Mar 24 10:46:58 2014
+++ src/sys/arch/luna68k/stand/boot/locore.S	Fri Sep 28 03:53:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.11 2014/03/24 10:46:58 martin Exp $	*/
+/*	$NetBSD: locore.S,v 1.12 2018/09/28 03:53:59 isaki Exp $	*/
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -266,7 +266,7 @@ Lstart0:
 	movl	%d0,_C_LABEL(cputype)
 
 /* final setup for C code */
-	movw	#PSL_LOWIPL,%sr		| no interrupts
+	movw	#PSL_LOWIPL,%sr		| enable interrupts
 	jsr	_C_LABEL(main)		| lets go
 	jsr	start
 



CVS commit: src/sys/arch/luna68k/stand/boot

2018-09-27 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Sep 28 03:53:59 UTC 2018

Modified Files:
src/sys/arch/luna68k/stand/boot: locore.S

Log Message:
Fix a wrong comment.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/luna68k/stand/boot/locore.S

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



CVS commit: src/sys/arch/luna68k/stand/boot

2018-09-27 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Sep 28 03:51:34 UTC 2018

Modified Files:
src/sys/arch/luna68k/stand/boot: Makefile

Log Message:
Add missing link message.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/luna68k/stand/boot/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/luna68k/stand/boot/Makefile
diff -u src/sys/arch/luna68k/stand/boot/Makefile:1.14 src/sys/arch/luna68k/stand/boot/Makefile:1.15
--- src/sys/arch/luna68k/stand/boot/Makefile:1.14	Sun Nov 12 08:24:37 2017
+++ src/sys/arch/luna68k/stand/boot/Makefile	Fri Sep 28 03:51:34 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.14 2017/11/12 08:24:37 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.15 2018/09/28 03:51:34 isaki Exp $
 #	@(#)Makefile	8.2 (Berkeley) 8/15/93
 
 NOMAN= # defined
@@ -78,6 +78,7 @@ LIBS=	${SALIB} ${ZLIB} ${KERNLIB}
 .include "${S}/conf/newvers_stand.mk"
 
 ${PROG}: ${LDSCRIPT} ${OBJS} ${LIBS}
+	${_MKTARGET_LINK}
 	${LD} ${LINKFORMAT} -x -o ${PROG}.elf ${OBJS} ${LIBS}
 	${ELF2AOUT} ${PROG}.elf ${PROG}.aout
 	mv ${PROG}.aout ${PROG}



CVS commit: src/sys/arch/luna68k/stand/boot

2018-09-27 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Sep 28 03:51:34 UTC 2018

Modified Files:
src/sys/arch/luna68k/stand/boot: Makefile

Log Message:
Add missing link message.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/luna68k/stand/boot/Makefile

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



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

2018-09-27 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Sep 27 23:48:58 UTC 2018

Modified Files:
src/sys/compat/common [pgoyette-compat]: files.common

Log Message:
Add dependencies to ensure that the utility routines get included
as built-in module when needed.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.37 -r1.1.2.38 src/sys/compat/common/files.common

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/files.common
diff -u src/sys/compat/common/files.common:1.1.2.37 src/sys/compat/common/files.common:1.1.2.38
--- src/sys/compat/common/files.common:1.1.2.37	Sat Sep 22 10:30:53 2018
+++ src/sys/compat/common/files.common	Thu Sep 27 23:48:58 2018
@@ -1,11 +1,11 @@
-#	$NetBSD: files.common,v 1.1.2.37 2018/09/22 10:30:53 pgoyette Exp $
+#	$NetBSD: files.common,v 1.1.2.38 2018/09/27 23:48:58 pgoyette Exp $
 
 #
-# Generic files, used by all compat options.
+# Generic utility files, used by various compat options.
 #
-#file	compat/common/compat_mod.c		compat_netbsd
-file	compat/common/compat_exec.c		compat_netbsd
-file	compat/common/compat_util.c		compat_netbsd
+define	compat_netbsd_util
+file	compat/common/compat_exec.c		compat_30 | compat_09
+file	compat/common/compat_util.c		compat_30 | compat_09
 
 #
 # Sources for syscall and ioctl compatibility across the versions.



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

2018-09-27 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Sep 27 23:48:58 UTC 2018

Modified Files:
src/sys/compat/common [pgoyette-compat]: files.common

Log Message:
Add dependencies to ensure that the utility routines get included
as built-in module when needed.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.37 -r1.1.2.38 src/sys/compat/common/files.common

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



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

2018-09-27 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Sep 27 21:35:54 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64 [pgoyette-compat]: netbsd32_machdep_13.c

Log Message:
Add empty init/fini routines so MI code can call them.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 \
src/sys/arch/amd64/amd64/netbsd32_machdep_13.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/amd64/amd64/netbsd32_machdep_13.c
diff -u src/sys/arch/amd64/amd64/netbsd32_machdep_13.c:1.1.2.1 src/sys/arch/amd64/amd64/netbsd32_machdep_13.c:1.1.2.2
--- src/sys/arch/amd64/amd64/netbsd32_machdep_13.c:1.1.2.1	Fri Sep 14 05:37:08 2018
+++ src/sys/arch/amd64/amd64/netbsd32_machdep_13.c	Thu Sep 27 21:35:54 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep_13.c,v 1.1.2.1 2018/09/14 05:37:08 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep_13.c,v 1.1.2.2 2018/09/27 21:35:54 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_13.c,v 1.1.2.1 2018/09/14 05:37:08 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_13.c,v 1.1.2.2 2018/09/27 21:35:54 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -144,3 +144,17 @@ compat_13_netbsd32_sigreturn(struct lwp 
 
 	return (EJUSTRETURN);
 }
+
+void
+netbsd32_machdep_md_13_init(void)
+{
+ 
+	/* Nothing to do */
+}
+ 
+void
+netbsd32_machdep_md_13_fini(void)
+{
+
+	/* Nothing to do */
+}



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

2018-09-27 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Sep 27 21:35:54 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64 [pgoyette-compat]: netbsd32_machdep_13.c

Log Message:
Add empty init/fini routines so MI code can call them.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 \
src/sys/arch/amd64/amd64/netbsd32_machdep_13.c

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



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

2018-09-27 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Sep 27 21:34:57 UTC 2018

Modified Files:
src/sys/conf [pgoyette-compat]: files

Log Message:
EXEC_ELF32 does not depend on COMPAT_NETBSD32


To generate a diff of this commit:
cvs rdiff -u -r1.1196.2.12 -r1.1196.2.13 src/sys/conf/files

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



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

2018-09-27 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Sep 27 21:34:57 UTC 2018

Modified Files:
src/sys/conf [pgoyette-compat]: files

Log Message:
EXEC_ELF32 does not depend on COMPAT_NETBSD32


To generate a diff of this commit:
cvs rdiff -u -r1.1196.2.12 -r1.1196.2.13 src/sys/conf/files

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

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1196.2.12 src/sys/conf/files:1.1196.2.13
--- src/sys/conf/files:1.1196.2.12	Thu Sep  6 06:55:47 2018
+++ src/sys/conf/files	Thu Sep 27 21:34:57 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1196.2.12 2018/09/06 06:55:47 pgoyette Exp $
+#	$NetBSD: files,v 1.1196.2.13 2018/09/27 21:34:57 pgoyette Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20171118
@@ -83,7 +83,7 @@ defflag	opt_revcache.h		NAMECACHE_ENTER_
 
 defflag	opt_exec.h		DEBUG_EXEC
 
-defflag	opt_execfmt.h		EXEC_AOUT EXEC_COFF EXEC_ECOFF
+defflag	opt_execfmt.h		EXEC_AOUT EXEC_COFF EXEC_ECOFF EXEC_ELF32
 EXEC_ELF64 EXEC_SCRIPT
 EXEC_ELF_NOTELESS
 
@@ -158,7 +158,6 @@ defflagCOMPAT_SUNOS: COMPAT_30
 defflag	opt_compat_svr4.h	COMPAT_SVR4 COMPAT_SVR4_32 SVR4_COMPAT_SOLARIS2
 defflagCOMPAT_ULTRIX: COMPAT_50
 defflagCOMPAT_NETBSD32
-defflag opt_execfmt.h		EXEC_ELF32	: COMPAT_NETBSD32
 defflagCOMPAT_SYSV
 defflagSYSV_IPC	: SYSVSHM, SYSVSEM, SYSVMSG
 defflagCOMPAT_NETBSD32_SYSVIPC : SYSV_IPC,



CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto

2018-09-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 27 18:18:53 UTC 2018

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto: Makefile

Log Message:
Remove debugging accidentally left in! Noticed by Tobias Ulmer


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 \
src/crypto/external/bsd/openssl/lib/libcrypto/Makefile

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



CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto

2018-09-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 27 18:18:53 UTC 2018

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto: Makefile

Log Message:
Remove debugging accidentally left in! Noticed by Tobias Ulmer


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 \
src/crypto/external/bsd/openssl/lib/libcrypto/Makefile

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

Modified files:

Index: src/crypto/external/bsd/openssl/lib/libcrypto/Makefile
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/Makefile:1.17 src/crypto/external/bsd/openssl/lib/libcrypto/Makefile:1.18
--- src/crypto/external/bsd/openssl/lib/libcrypto/Makefile:1.17	Sun Sep 23 09:33:04 2018
+++ src/crypto/external/bsd/openssl/lib/libcrypto/Makefile	Thu Sep 27 14:18:53 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.17 2018/09/23 13:33:04 christos Exp $
+#	$NetBSD: Makefile,v 1.18 2018/09/27 18:18:53 christos Exp $
 
 # RCSid:
 #	Id: Makefile,v 1.33 1998/11/11 11:53:53 sjg Exp
@@ -20,7 +20,7 @@ LIB=	crypto
 USE_FORT?= yes	# cryptographic software
 USE_SHLIBDIR=	yes
 USE_FIPS=	no
-DBG=-g
+#DBG=-g
 
 .include 
 .include 



CVS commit: src/sys/arch/sgimips

2018-09-27 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Sep 27 17:34:28 UTC 2018

Modified Files:
src/sys/arch/sgimips/dev: int.c
src/sys/arch/sgimips/include: intr.h

Log Message:
add event counters for int0 at mainbus


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/sgimips/dev/int.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/sgimips/include/intr.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/sgimips/dev/int.c
diff -u src/sys/arch/sgimips/dev/int.c:1.28 src/sys/arch/sgimips/dev/int.c:1.29
--- src/sys/arch/sgimips/dev/int.c:1.28	Wed Feb 18 16:47:58 2015
+++ src/sys/arch/sgimips/dev/int.c	Thu Sep 27 17:34:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: int.c,v 1.28 2015/02/18 16:47:58 macallan Exp $	*/
+/*	$NetBSD: int.c,v 1.29 2018/09/27 17:34:28 macallan Exp $	*/
 
 /*
  * Copyright (c) 2009 Stephen M. Rumble 
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: int.c,v 1.28 2015/02/18 16:47:58 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: int.c,v 1.29 2018/09/27 17:34:28 macallan Exp $");
 
 #define __INTR_PRIVATE
 #include "opt_cputype.h"
@@ -114,6 +114,12 @@ static void
 int_attach(device_t parent, device_t self, void *aux)
 {
 	uint32_t address;
+	int i;
+
+	for (i = 0; i < NINTR; i++) {
+		intrtab[i].ih_fun = NULL;
+		snprintf(intrtab[i].ih_evname, 7, "%d", i);
+	}
 
 	switch (mach_type) {
 	case MACH_SGI_IP6 | MACH_SGI_IP10:
@@ -220,9 +226,17 @@ int_attach(device_t parent, device_t sel
 		/* Wire interrupts 7, 11 to mappable interrupt 0,1 handlers */
 		intrtab[7].ih_fun = int2_mappable_intr;
 		intrtab[7].ih_arg = (void*) 0;
+		snprintf(intrtab[7].ih_evname, 7, "map0");
 
 		intrtab[11].ih_fun = int2_mappable_intr;
 		intrtab[11].ih_arg = (void*) 1;
+		snprintf(intrtab[11].ih_evname, 7, "map1");
+	}
+
+	for (i = 0; i < NINTR; i++) {
+		evcnt_attach_dynamic([i].ih_evcnt,
+			EVCNT_TYPE_INTR, NULL,
+			"int", intrtab[i].ih_evname);
 	}
 }
 
@@ -246,6 +260,7 @@ int2_mappable_intr(void *arg)
 	for (i = 0; i < 8; i++) {
 		intnum = i + 16 + (which << 3);
 		if (mstat & (1 << i)) {
+			intrtab[intnum].ih_evcnt.ev_count++;
 			for (ih = [intnum]; ih != NULL;
 			ih = ih->ih_next) {
 if (ih->ih_fun != NULL)
@@ -276,6 +291,7 @@ int1_local_intr(vaddr_t pc, uint32_t sta
 
 	for (i = 0; stat != 0; i++, stat >>= 1) {
 		if (stat & 1) {
+			intrtab[i].ih_evcnt.ev_count++;
 			for (ih = [i]; ih != NULL; ih = ih->ih_next) {
 if (ih->ih_fun != NULL)
 	(ih->ih_fun)(ih->ih_arg);
@@ -302,6 +318,7 @@ int2_local0_intr(vaddr_t pc, uint32_t st
 
 	for (i = 0; i < 8; i++) {
 		if (l0stat & (1 << i)) {
+			intrtab[i].ih_evcnt.ev_count++;
 			for (ih = [i]; ih != NULL; ih = ih->ih_next) {
 if (ih->ih_fun != NULL)
 	(ih->ih_fun)(ih->ih_arg);
@@ -328,6 +345,7 @@ int2_local1_intr(vaddr_t pc, uint32_t st
 
 	for (i = 0; i < 8; i++) {
 		if (l1stat & (1 << i)) {
+			intrtab[i].ih_evcnt.ev_count++;
 			for (ih = [8+i]; ih != NULL; ih = ih->ih_next) {
 if (ih->ih_fun != NULL)
 	(ih->ih_fun)(ih->ih_arg);

Index: src/sys/arch/sgimips/include/intr.h
diff -u src/sys/arch/sgimips/include/intr.h:1.28 src/sys/arch/sgimips/include/intr.h:1.29
--- src/sys/arch/sgimips/include/intr.h:1.28	Fri Jun 26 22:55:06 2015
+++ src/sys/arch/sgimips/include/intr.h	Thu Sep 27 17:34:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.28 2015/06/26 22:55:06 matt Exp $	*/
+/*	$NetBSD: intr.h,v 1.29 2018/09/27 17:34:28 macallan Exp $	*/
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang
@@ -53,11 +53,12 @@ struct sgimips_intrhand {
 	struct	sgimips_intr *ih_intrhead;
 	struct	sgimips_intrhand *ih_next;
 	int	ih_pending;
+	struct evcnt ih_evcnt;
+	char	ih_evname[8];
 };
 
 struct sgimips_intr {
 	LIST_HEAD(,sgimips_intrhand) intr_q;
-	struct	evcnt ih_evcnt;
 	unsigned long intr_ipl;
 };
 



CVS commit: src/sys/arch/sgimips

2018-09-27 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Sep 27 17:34:28 UTC 2018

Modified Files:
src/sys/arch/sgimips/dev: int.c
src/sys/arch/sgimips/include: intr.h

Log Message:
add event counters for int0 at mainbus


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/sgimips/dev/int.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/sgimips/include/intr.h

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



CVS commit: src/doc

2018-09-27 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Sep 27 16:34:08 UTC 2018

Modified Files:
src/doc: RESPONSIBLE

Log Message:
no isdn


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/doc/RESPONSIBLE

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

Modified files:

Index: src/doc/RESPONSIBLE
diff -u src/doc/RESPONSIBLE:1.120 src/doc/RESPONSIBLE:1.121
--- src/doc/RESPONSIBLE:1.120	Wed Jan 24 09:04:41 2018
+++ src/doc/RESPONSIBLE	Thu Sep 27 16:34:08 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: RESPONSIBLE,v 1.120 2018/01/24 09:04:41 skrll Exp $
+#	$NetBSD: RESPONSIBLE,v 1.121 2018/09/27 16:34:08 maxv Exp $
 
 List of sections of the system, and who is responsible for them (or at
 least considered an expert on them).
@@ -123,7 +123,6 @@ flash		ahoka
 gpio		mbalmer
 ide/atapi	bouyer
 irda		augustss*, kenh
-isdn		martin
 keylock		mbalmer
 mca		jdolecek*
 nand		ahoka



CVS commit: src/doc

2018-09-27 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Sep 27 16:34:08 UTC 2018

Modified Files:
src/doc: RESPONSIBLE

Log Message:
no isdn


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/doc/RESPONSIBLE

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



CVS commit: src/share/man/man8

2018-09-27 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Sep 27 16:33:14 UTC 2018

Modified Files:
src/share/man/man8: MAKEDEV.8

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/share/man/man8/MAKEDEV.8

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

Modified files:

Index: src/share/man/man8/MAKEDEV.8
diff -u src/share/man/man8/MAKEDEV.8:1.48 src/share/man/man8/MAKEDEV.8:1.49
--- src/share/man/man8/MAKEDEV.8:1.48	Sun May 20 14:08:33 2018
+++ src/share/man/man8/MAKEDEV.8	Thu Sep 27 16:33:14 2018
@@ -6,7 +6,7 @@
 .\" *** DO NOT EDIT - any changes will be lost!!!
 .\" *** --
 .\"
-.\" $NetBSD: MAKEDEV.8,v 1.48 2018/05/20 14:08:33 thorpej Exp $
+.\" $NetBSD: MAKEDEV.8,v 1.49 2018/09/27 16:33:14 maxv Exp $
 .\"
 .\" Copyright (c) 2001, 2003, 2007, 2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -35,7 +35,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 11, 2018
+.Dd September 27, 2018
 .Dt MAKEDEV 8
 .Os
 .Sh NAME
@@ -244,8 +244,6 @@ Lua device
 Make wscons devices
 .It Ar usbs
 Make USB devices
-.It Ar isdns
-Make ISDN devices
 .El
 .Pp
 Please note that any hash marks
@@ -591,26 +589,6 @@ USB modems, see
 . It Ar ttyY#
 USB serial adapters
 . El
-.It ISDN devices :
-. Bl -tag -width 0123456789 -compact
-. It Ar isdn
-Communication between userland isdnd and kernel, see
-.Xr \ 4
-. It Ar isdnctl
-Control device, see
-.Xr \ 4
-. It Ar isdnbchan#
-Raw b-channel access, see
-.Xr \ 4
-. It Ar isdntel#
-Telephony device, see
-.Xr \ 4
-. It Ar isdnteld#
-Telephony dialout device
-. It Ar isdntrc#
-Trace device, see
-.Xr \ 4
-. El
 .It Video devices :
 . Bl -tag -width 0123456789 -compact
 . It Ar bwtwo#



CVS commit: src/share/man/man8

2018-09-27 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Sep 27 16:33:14 UTC 2018

Modified Files:
src/share/man/man8: MAKEDEV.8

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/share/man/man8/MAKEDEV.8

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



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

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 15:57:07 UTC 2018

Modified Files:
src/sys/netinet6 [netbsd-8]: ip6_var.h

Log Message:
Additional change needed for ticket #1041:

sys/netinet6/ip6_var.h (apply patch)

When reassembling IPv4/IPv6 packets, ensure each fragment has been subject
to the same IPsec processing. That is to say, that all fragments are ESP,
or AH, or AH+ESP, or none.

Add ipsec flags to struct ip6q.


To generate a diff of this commit:
cvs rdiff -u -r1.74.6.2 -r1.74.6.3 src/sys/netinet6/ip6_var.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/netinet6/ip6_var.h
diff -u src/sys/netinet6/ip6_var.h:1.74.6.2 src/sys/netinet6/ip6_var.h:1.74.6.3
--- src/sys/netinet6/ip6_var.h:1.74.6.2	Sun Feb 11 21:17:34 2018
+++ src/sys/netinet6/ip6_var.h	Thu Sep 27 15:57:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_var.h,v 1.74.6.2 2018/02/11 21:17:34 snj Exp $	*/
+/*	$NetBSD: ip6_var.h,v 1.74.6.3 2018/09/27 15:57:07 martin Exp $	*/
 /*	$KAME: ip6_var.h,v 1.33 2000/06/11 14:59:20 jinmei Exp $	*/
 
 /*
@@ -89,6 +89,7 @@ struct	ip6q {
 	u_char		*ip6q_nxtp;
 #endif
 	int		ip6q_nfrag;	/* # of fragments */
+	int		ip6q_ipsec;	/* IPsec flags */
 };
 
 struct	ip6asfrag {



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

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 15:57:07 UTC 2018

Modified Files:
src/sys/netinet6 [netbsd-8]: ip6_var.h

Log Message:
Additional change needed for ticket #1041:

sys/netinet6/ip6_var.h (apply patch)

When reassembling IPv4/IPv6 packets, ensure each fragment has been subject
to the same IPsec processing. That is to say, that all fragments are ESP,
or AH, or AH+ESP, or none.

Add ipsec flags to struct ip6q.


To generate a diff of this commit:
cvs rdiff -u -r1.74.6.2 -r1.74.6.3 src/sys/netinet6/ip6_var.h

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



CVS commit: [netbsd-8] src/doc

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 15:54:21 UTC 2018

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

Log Message:
Ammend #1041 for additional changes


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.26 -r1.1.2.27 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.26 src/doc/CHANGES-8.1:1.1.2.27
--- src/doc/CHANGES-8.1:1.1.2.26	Thu Sep 27 15:15:58 2018
+++ src/doc/CHANGES-8.1	Thu Sep 27 15:54:21 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.26 2018/09/27 15:15:58 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.27 2018/09/27 15:54:21 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1163,6 +1163,7 @@ lib/libcurses/move.c1.19
 
 sys/netinet/ip_reass.c1.17 (patch)
 sys/netinet6/frag6.c1.74 (patch)
+sys/netinet6/ip6_var.h(apply patch)
 
 	When reassembling IPv4/IPv6 packets, ensure each fragment has been
 	subject to the same IPsec processing. That is to say, that all



CVS commit: [netbsd-8] src/doc

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 15:54:21 UTC 2018

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

Log Message:
Ammend #1041 for additional changes


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

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



CVS commit: [netbsd-8] src/doc

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 15:15:59 UTC 2018

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

Log Message:
Tickets #1030, #1036, #1037, #1039 - #1042


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.25 -r1.1.2.26 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.25 src/doc/CHANGES-8.1:1.1.2.26
--- src/doc/CHANGES-8.1:1.1.2.25	Sun Sep 23 18:04:52 2018
+++ src/doc/CHANGES-8.1	Thu Sep 27 15:15:58 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.25 2018/09/23 18:04:52 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.26 2018/09/27 15:15:58 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1115,3 +1115,65 @@ sys/dev/pci/files.pci1.403
 	ixg and ixv depend on mii and mii_phy.
 	[nakayama, ticket #1035]
 
+usr.sbin/npf/npfctl/npf.conf.5			1.71-1.79 (patch)
+
+	Sync with NetBSD-current.
+	[maxv, ticket #1030]
+
+sys/external/bsd/drm2/linux/linux_ww_mutex.c	(apply patch)
+
+	Fix LOCKDEBUG build.
+	[mrg, ticket #1036]
+
+share/man/man4/usb.41.110 (patch)
+sys/ddb/db_command.c1.159,1.160 (patch)
+sys/ddb/db_output.c1.34 (patch)
+sys/dev/pci/xhci_pci.c1.14 (patch)
+sys/dev/usb/ehci.c1.264,1.265 (patch)
+sys/dev/usb/ehcivar.h1.46 (patch)
+sys/dev/usb/ohci.c1.287 (patch)
+sys/dev/usb/uhci.c1.284 (patch)
+sys/dev/usb/uhcivar.h1.56 (patch)
+sys/dev/usb/uhub.c1.139 (patch)
+sys/dev/usb/usb.c1.172-1.174 (patch)
+sys/dev/usb/usb_subr.c1.227 (patch)
+sys/dev/usb/usbdi.c1.178 (patch)
+sys/dev/usb/xhci.c1.99 (patch)
+sys/external/bsd/dwc2/dwc2.c			1.55 (patch)
+sys/kern/subr_userconf.c			1.27 (patch)
+
+	Fix usb keyboard "boot -a" issues and sync with -current.
+	[mrg, ticket #1037]
+
+lib/libcurses/get_wch.c1.15,1.16
+lib/libcurses/getch.c1.66,1.67
+lib/libcurses/tstp.c1.43
+
+	PR lib/53615: getch() and get_wch() should return KEY_RESIZE
+	when interrupted by SIGWINCH.
+	Before invoking a previous signal handler, make sure it is not SIG_*.
+	Correct detecting of terminal resize in curses(3) with keypad(,TRUE).
+	Handle catching terminal resize in INKEY_NORM and INKEY_ASSEMBLING.
+	[kamil, ticket #1039]
+
+lib/libcurses/move.c1.19
+
+	According to POSIX moving the cursor in curses(3) touches the window.
+	[kamil, ticket #1040]
+
+sys/netinet/ip_reass.c1.17 (patch)
+sys/netinet6/frag6.c1.74 (patch)
+
+	When reassembling IPv4/IPv6 packets, ensure each fragment has been
+	subject to the same IPsec processing. That is to say, that all
+	fragments are ESP, or AH, or AH+ESP, or none.
+	[maxv, ticket #1041]
+
+lib/libcurses/curses_private.h			1.63
+lib/libcurses/get_wch.c1.17,1.18
+lib/libcurses/getch.c1.68,1.69
+
+	Unify resize handling in getch.
+	Call resizeterm if getch issues KEY_RESIZE.
+	[roy, ticket #1042]
+



CVS commit: [netbsd-8] src/doc

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 15:15:59 UTC 2018

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

Log Message:
Tickets #1030, #1036, #1037, #1039 - #1042


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

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



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

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 15:12:15 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by roy in ticket #1042):
lib/libcurses/getch.c: revision 1.68
lib/libcurses/getch.c: revision 1.69
lib/libcurses/get_wch.c: revision 1.17
lib/libcurses/get_wch.c: revision 1.18
lib/libcurses/curses_private.h: revision 1.63
curses: unify resize handling in getch
Instead of testing each fgetc call for resize event, add the wrapper
__fgetc_resize to simplify the logic.
While here, ensure that get_wch uses the correct input stream which
may or may not be stdin.
curses: call resizeterm if getch issues KEY_RESIZE
This fixes PR #53633.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.62.4.1 src/lib/libcurses/curses_private.h
cvs rdiff -u -r1.14.4.1 -r1.14.4.2 src/lib/libcurses/get_wch.c
cvs rdiff -u -r1.65.4.1 -r1.65.4.2 src/lib/libcurses/getch.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.62 src/lib/libcurses/curses_private.h:1.62.4.1
--- src/lib/libcurses/curses_private.h:1.62	Tue Jan 31 09:17:53 2017
+++ src/lib/libcurses/curses_private.h	Thu Sep 27 15:12:15 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses_private.h,v 1.62 2017/01/31 09:17:53 roy Exp $	*/
+/*	$NetBSD: curses_private.h,v 1.62.4.1 2018/09/27 15:12:15 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998-2000 Brett Lymn
@@ -365,6 +365,7 @@ void	__cursesi_win_free_nsp(WINDOW *);
 void	__cursesi_putnsp(nschar_t *, const int, const int);
 void	__cursesi_chtype_to_cchar(chtype, cchar_t *);
 #endif /* HAVE_WCHAR */
+int	 __fgetc_resize(FILE *);
 int	 __unget(wint_t);
 int	 __mvcur(int, int, int, int, int);
 WINDOW  *__newwin(SCREEN *, int, int, int, int, int);

Index: src/lib/libcurses/get_wch.c
diff -u src/lib/libcurses/get_wch.c:1.14.4.1 src/lib/libcurses/get_wch.c:1.14.4.2
--- src/lib/libcurses/get_wch.c:1.14.4.1	Thu Sep 27 14:59:28 2018
+++ src/lib/libcurses/get_wch.c	Thu Sep 27 15:12:15 2018
@@ -1,4 +1,4 @@
-/*   $NetBSD: get_wch.c,v 1.14.4.1 2018/09/27 14:59:28 martin Exp $ */
+/*   $NetBSD: get_wch.c,v 1.14.4.2 2018/09/27 15:12:15 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.1 2018/09/27 14:59:28 martin Exp $");
+__RCSID("$NetBSD: get_wch.c,v 1.14.4.2 2018/09/27 15:12:15 martin Exp $");
 #endif		  /* not lint */
 
 #include 
@@ -56,6 +56,7 @@ extern short state;		/* storage declared
 /* prototypes for private functions */
 #ifdef HAVE_WCHAR
 static int inkey(wchar_t *wc, int to, int delay);
+static wint_t __fgetwc_resize(FILE *infd, bool *resized);
 #endif /* HAVE_WCHAR */
 
 #ifdef HAVE_WCHAR
@@ -100,14 +101,10 @@ inkey(wchar_t *wc, int to, int delay)
 		if (wstate == INKEY_NORM) {
 			if (delay && __timeout(delay) == ERR)
 return ERR;
-			c = fgetc(infd);
-			if (c == WEOF) {
+			c = __fgetc_resize(infd);
+			if (c == ERR || c == KEY_RESIZE) {
 clearerr(infd);
-if (errno == EINTR && _cursesi_screen->resized) {
-	_cursesi_screen->resized = 0;
-	return KEY_RESIZE;
-} else
-	return ERR;
+return c;
 			}
 
 			if (delay && (__notimeout() == ERR))
@@ -152,14 +149,10 @@ inkey(wchar_t *wc, int to, int delay)
 	return ERR;
 			}
 
-			c = fgetc(infd);
+			c = __fgetc_resize(infd);
 			if (ferror(infd)) {
 clearerr(infd);
-if (errno == EINTR && _cursesi_screen->resized) {
-	_cursesi_screen->resized = 0;
-	return KEY_RESIZE;
-} else
-	return ERR;
+return c;
 			}
 
 			if ((to || delay) && (__notimeout() == ERR))
@@ -206,10 +199,10 @@ inkey(wchar_t *wc, int to, int delay)
 	return ERR;
 			}
 
-			c = fgetc(infd);
+			c = __fgetc_resize(infd);
 			if (ferror(infd)) {
 clearerr(infd);
-return ERR;
+return c;
 			}
 
 			if ((to || delay) && (__notimeout() == ERR))
@@ -538,6 +531,7 @@ wget_wch(WINDOW *win, wint_t *ch)
 #endif
 	if (_cursesi_screen->resized) {
 		_cursesi_screen->resized = 0;
+		resizeterm(LINES, COLS);
 		*ch = KEY_RESIZE;
 		return KEY_CODE_YES;
 	}
@@ -583,6 +577,8 @@ wget_wch(WINDOW *win, wint_t *ch)
 		if ( ret == ERR )
 			return ERR;
 	} else {
+		bool resized;
+
 		switch (win->delay) {
 			case -1:
 break;
@@ -596,17 +592,11 @@ wget_wch(WINDOW *win, wint_t *ch)
 break;
 		}
 
-		c = getwchar();
-		if (feof(infd)) {
+		c = __fgetwc_resize(infd, );
+		if (c == WEOF) {
 			clearerr(infd);
 			__restore_termios();
-			return ERR;	/* we have timed out */
-		}
-
-		if (ferror(infd)) {
-			clearerr(infd);
-			if (errno == EINTR && _cursesi_screen->resized) {
-_cursesi_screen->resized = 0;
+			if (resized) {
 *ch = KEY_RESIZE;
 return KEY_CODE_YES;
 			} else
@@ -674,3 +664,29 @@ 

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

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 15:12:15 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by roy in ticket #1042):
lib/libcurses/getch.c: revision 1.68
lib/libcurses/getch.c: revision 1.69
lib/libcurses/get_wch.c: revision 1.17
lib/libcurses/get_wch.c: revision 1.18
lib/libcurses/curses_private.h: revision 1.63
curses: unify resize handling in getch
Instead of testing each fgetc call for resize event, add the wrapper
__fgetc_resize to simplify the logic.
While here, ensure that get_wch uses the correct input stream which
may or may not be stdin.
curses: call resizeterm if getch issues KEY_RESIZE
This fixes PR #53633.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.62.4.1 src/lib/libcurses/curses_private.h
cvs rdiff -u -r1.14.4.1 -r1.14.4.2 src/lib/libcurses/get_wch.c
cvs rdiff -u -r1.65.4.1 -r1.65.4.2 src/lib/libcurses/getch.c

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



CVS commit: [netbsd-8] src/sys

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 15:07:35 UTC 2018

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

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

sys/netinet/ip_reass.c: revision 1.17 (patch)
sys/netinet6/frag6.c: revision 1.74 (patch)

When reassembling IPv4/IPv6 packets, ensure each fragment has been subject
to the same IPsec processing. That is to say, that all fragments are ESP,
or AH, or AH+ESP, or none.

The reassembly mechanism can be used both on the wire and inside an IPsec
tunnel, so we need to make sure all fragments of a packet were received
on only one side.

Even though I haven't tried, I believe there are configurations where it
would be possible for an attacker to inject an unencrypted fragment into a
legitimate stream of already-decrypted-and-authenticated fragments.

Typically on IPsec gateways with ESP tunnels, where we can encapsulate
fragments (as opposed to the general case, where we fragment encapsulated
data).

Note, for the record: a funnier thing, under IPv4, would be to send a
zero-sized !MFF fragment at the head of the packet, and manage to trigger
an ICMP error; M_DECRYPTED gets lost by the reassembly, and ICMP will reply
with the packet in clear (not encrypted).


To generate a diff of this commit:
cvs rdiff -u -r1.11.8.3 -r1.11.8.4 src/sys/netinet/ip_reass.c
cvs rdiff -u -r1.60.6.4 -r1.60.6.5 src/sys/netinet6/frag6.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.3 src/sys/netinet/ip_reass.c:1.11.8.4
--- src/sys/netinet/ip_reass.c:1.11.8.3	Mon Apr  9 16:40:07 2018
+++ src/sys/netinet/ip_reass.c	Thu Sep 27 15:07:34 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_reass.c,v 1.11.8.3 2018/04/09 16:40:07 martin Exp $	*/
+/*	$NetBSD: ip_reass.c,v 1.11.8.4 2018/09/27 15:07:34 martin Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1988, 1993
@@ -46,7 +46,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_reass.c,v 1.11.8.3 2018/04/09 16:40:07 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_reass.c,v 1.11.8.4 2018/09/27 15:07:34 martin Exp $");
 
 #include 
 #include 
@@ -93,7 +93,8 @@ typedef struct ipfr_queue {
 	struct in_addr		ipq_src;
 	struct in_addr		ipq_dst;
 	uint16_t		ipq_nfrags;	/* frags in this queue entry */
-	uint8_t 		ipq_tos;	/* TOS of this fragment */
+	uint8_t			ipq_tos;	/* TOS of this fragment */
+	int			ipq_ipsec;	/* IPsec flags */
 } ipfr_queue_t;
 
 /*
@@ -217,6 +218,7 @@ ip_reass(ipfr_qent_t *ipqe, ipfr_queue_t
 	struct ip *ip = ipqe->ipqe_ip, *qip;
 	const int hlen = ip->ip_hl << 2;
 	struct mbuf *m = ipqe->ipqe_m, *t;
+	int ipsecflags = m->m_flags & (M_DECRYPTED|M_AUTHIPHDR);
 	ipfr_qent_t *nq, *p, *q;
 	int i, next;
 
@@ -269,6 +271,7 @@ ip_reass(ipfr_qent_t *ipqe, ipfr_queue_t
 		fp->ipq_p = ip->ip_p;
 		fp->ipq_id = ip->ip_id;
 		fp->ipq_tos = ip->ip_tos;
+		fp->ipq_ipsec = ipsecflags;
 		fp->ipq_src = ip->ip_src;
 		fp->ipq_dst = ip->ip_dst;
 		LIST_INSERT_HEAD(_frags[hash], fp, ipq_q);
@@ -614,6 +617,7 @@ ip_reass_packet(struct mbuf **m0, struct
 	const int hlen = ip->ip_hl << 2;
 	const int len = ntohs(ip->ip_len);
 	struct mbuf *m = *m0;
+	int ipsecflags = m->m_flags & (M_DECRYPTED|M_AUTHIPHDR);
 	ipfr_queue_t *fp;
 	ipfr_qent_t *ipqe;
 	u_int hash, off, flen;
@@ -669,11 +673,20 @@ ip_reass_packet(struct mbuf **m0, struct
 		break;
 	}
 
-	/* Make sure that TOS matches previous fragments. */
-	if (fp && fp->ipq_tos != ip->ip_tos) {
-		IP_STATINC(IP_STAT_BADFRAGS);
-		mutex_exit(_lock);
-		return EINVAL;
+	if (fp) {
+		/* All fragments must have the same IPsec flags. */
+		if (fp->ipq_ipsec != ipsecflags) {
+			IP_STATINC(IP_STAT_BADFRAGS);
+			mutex_exit(_lock);
+			return EINVAL;
+		}
+
+		/* Make sure that TOS matches previous fragments. */
+		if (fp->ipq_tos != ip->ip_tos) {
+			IP_STATINC(IP_STAT_BADFRAGS);
+			mutex_exit(_lock);
+			return EINVAL;
+		}
 	}
 
 	/*

Index: src/sys/netinet6/frag6.c
diff -u src/sys/netinet6/frag6.c:1.60.6.4 src/sys/netinet6/frag6.c:1.60.6.5
--- src/sys/netinet6/frag6.c:1.60.6.4	Thu Apr  5 14:33:41 2018
+++ src/sys/netinet6/frag6.c	Thu Sep 27 15:07:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: frag6.c,v 1.60.6.4 2018/04/05 14:33:41 martin Exp $	*/
+/*	$NetBSD: frag6.c,v 1.60.6.5 2018/09/27 15:07:35 martin Exp $	*/
 /*	$KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.60.6.4 2018/04/05 14:33:41 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.60.6.5 2018/09/27 15:07:35 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -124,6 +124,7 @@ frag6_input(struct mbuf **mp, int *offp,
 	struct ip6q *q6;
 	struct ip6asfrag *af6, *ip6af, *af6dwn;
 	int offset = *offp, nxt, i, next;
+	int ipsecflags = m->m_flags & 

CVS commit: [netbsd-8] src/sys

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 15:07:35 UTC 2018

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

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

sys/netinet/ip_reass.c: revision 1.17 (patch)
sys/netinet6/frag6.c: revision 1.74 (patch)

When reassembling IPv4/IPv6 packets, ensure each fragment has been subject
to the same IPsec processing. That is to say, that all fragments are ESP,
or AH, or AH+ESP, or none.

The reassembly mechanism can be used both on the wire and inside an IPsec
tunnel, so we need to make sure all fragments of a packet were received
on only one side.

Even though I haven't tried, I believe there are configurations where it
would be possible for an attacker to inject an unencrypted fragment into a
legitimate stream of already-decrypted-and-authenticated fragments.

Typically on IPsec gateways with ESP tunnels, where we can encapsulate
fragments (as opposed to the general case, where we fragment encapsulated
data).

Note, for the record: a funnier thing, under IPv4, would be to send a
zero-sized !MFF fragment at the head of the packet, and manage to trigger
an ICMP error; M_DECRYPTED gets lost by the reassembly, and ICMP will reply
with the packet in clear (not encrypted).


To generate a diff of this commit:
cvs rdiff -u -r1.11.8.3 -r1.11.8.4 src/sys/netinet/ip_reass.c
cvs rdiff -u -r1.60.6.4 -r1.60.6.5 src/sys/netinet6/frag6.c

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



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

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 15:02:26 UTC 2018

Modified Files:
src/lib/libcurses [netbsd-8]: move.c

Log Message:
Pull up following revision(s) (requested by kamil in ticket #1040):

lib/libcurses/move.c: revision 1.19

According to POSIX moving the cursor in curses(3) touches the window

Mark the old and new lines as dirty, so they will be refreshed upon next
call to getch(3)-like routine.

This also matches the ncurses behavior.
Reviewed by 


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.6.1 src/lib/libcurses/move.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/move.c
diff -u src/lib/libcurses/move.c:1.18 src/lib/libcurses/move.c:1.18.6.1
--- src/lib/libcurses/move.c:1.18	Fri Jan  6 13:53:18 2017
+++ src/lib/libcurses/move.c	Thu Sep 27 15:02:26 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: move.c,v 1.18 2017/01/06 13:53:18 roy Exp $	*/
+/*	$NetBSD: move.c,v 1.18.6.1 2018/09/27 15:02:26 martin Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)move.c	8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: move.c,v 1.18 2017/01/06 13:53:18 roy Exp $");
+__RCSID("$NetBSD: move.c,v 1.18.6.1 2018/09/27 15:02:26 martin Exp $");
 #endif
 #endif/* not lint */
 
@@ -72,8 +72,10 @@ wmove(WINDOW *win, int y, int x)
 		return ERR;
 	win->curx = x;
 	win->alines[win->cury]->flags &= ~__ISPASTEOL;
+	win->alines[win->cury]->flags |= __ISDIRTY;
 	win->cury = y;
 	win->alines[y]->flags &= ~__ISPASTEOL;
+	win->alines[y]->flags |= __ISDIRTY;
 	return OK;
 }
 



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

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 15:02:26 UTC 2018

Modified Files:
src/lib/libcurses [netbsd-8]: move.c

Log Message:
Pull up following revision(s) (requested by kamil in ticket #1040):

lib/libcurses/move.c: revision 1.19

According to POSIX moving the cursor in curses(3) touches the window

Mark the old and new lines as dirty, so they will be refreshed upon next
call to getch(3)-like routine.

This also matches the ncurses behavior.
Reviewed by 


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.6.1 src/lib/libcurses/move.c

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



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

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 14:59:28 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by kamil in ticket #1039):

lib/libcurses/getch.c: revision 1.66
lib/libcurses/getch.c: revision 1.67
lib/libcurses/tstp.c: revision 1.43
lib/libcurses/get_wch.c: revision 1.15
lib/libcurses/get_wch.c: revision 1.16

PR lib/53615
getch() and get_wch() should return KEY_RESIZE when interrupted by SIGWIN=
CH.

OK roy

 -

PR lib/53615
Before invoking a previous signal handler, make sure it is not SIG_*.
Fix potential crash with SIGWINCH.

OK roy

 -

Correct detecting of terminal resize in curses(3) with keypad(,TRUE)
A previous change fixed only keypad(,FALSE) scenarios.

 -

Handle catching terminal resize in INKEY_NORM and INKEY_ASSEMBLING (in the
middle of assembling a key code from passed codes) as both accept keys with
fgetc(3) and both can be in theory interrupted with a resize.

PR lib/53615


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.4.1 src/lib/libcurses/get_wch.c
cvs rdiff -u -r1.65 -r1.65.4.1 src/lib/libcurses/getch.c
cvs rdiff -u -r1.42 -r1.42.6.1 src/lib/libcurses/tstp.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 src/lib/libcurses/get_wch.c:1.14.4.1
--- src/lib/libcurses/get_wch.c:1.14	Tue Jan 31 09:17:53 2017
+++ src/lib/libcurses/get_wch.c	Thu Sep 27 14:59:28 2018
@@ -1,4 +1,4 @@
-/*   $NetBSD: get_wch.c,v 1.14 2017/01/31 09:17:53 roy Exp $ */
+/*   $NetBSD: get_wch.c,v 1.14.4.1 2018/09/27 14:59:28 martin Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,9 +36,10 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: get_wch.c,v 1.14 2017/01/31 09:17:53 roy Exp $");
+__RCSID("$NetBSD: get_wch.c,v 1.14.4.1 2018/09/27 14:59:28 martin Exp $");
 #endif		  /* not lint */
 
+#include 
 #include 
 #include 
 #include 
@@ -102,7 +103,11 @@ inkey(wchar_t *wc, int to, int delay)
 			c = fgetc(infd);
 			if (c == WEOF) {
 clearerr(infd);
-return ERR;
+if (errno == EINTR && _cursesi_screen->resized) {
+	_cursesi_screen->resized = 0;
+	return KEY_RESIZE;
+} else
+	return ERR;
 			}
 
 			if (delay && (__notimeout() == ERR))
@@ -150,7 +155,11 @@ inkey(wchar_t *wc, int to, int delay)
 			c = fgetc(infd);
 			if (ferror(infd)) {
 clearerr(infd);
-return ERR;
+if (errno == EINTR && _cursesi_screen->resized) {
+	_cursesi_screen->resized = 0;
+	return KEY_RESIZE;
+} else
+	return ERR;
 			}
 
 			if ((to || delay) && (__notimeout() == ERR))
@@ -596,7 +605,12 @@ wget_wch(WINDOW *win, wint_t *ch)
 
 		if (ferror(infd)) {
 			clearerr(infd);
-			return ERR;
+			if (errno == EINTR && _cursesi_screen->resized) {
+_cursesi_screen->resized = 0;
+*ch = KEY_RESIZE;
+return KEY_CODE_YES;
+			} else
+return ERR;
 		} else {
 			ret = c;
 			inp = c;

Index: src/lib/libcurses/getch.c
diff -u src/lib/libcurses/getch.c:1.65 src/lib/libcurses/getch.c:1.65.4.1
--- src/lib/libcurses/getch.c:1.65	Tue Jan 31 09:17:53 2017
+++ src/lib/libcurses/getch.c	Thu Sep 27 14:59:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: getch.c,v 1.65 2017/01/31 09:17:53 roy Exp $	*/
+/*	$NetBSD: getch.c,v 1.65.4.1 2018/09/27 14:59:28 martin Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,10 +34,11 @@
 #if 0
 static char sccsid[] = "@(#)getch.c	8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: getch.c,v 1.65 2017/01/31 09:17:53 roy Exp $");
+__RCSID("$NetBSD: getch.c,v 1.65.4.1 2018/09/27 14:59:28 martin Exp $");
 #endif
 #endif	/* not lint */
 
+#include 
 #include 
 #include 
 #include 
@@ -562,7 +563,11 @@ reread:
 			c = fgetc(infd);
 			if (c == EOF) {
 clearerr(infd);
-return ERR;
+if (errno == EINTR && _cursesi_screen->resized) {
+	_cursesi_screen->resized = 0;
+	return KEY_RESIZE;
+} else
+	return ERR;
 			}
 
 			if (delay && (__notimeout() == ERR))
@@ -604,7 +609,11 @@ reread:
 			c = fgetc(infd);
 			if (ferror(infd)) {
 clearerr(infd);
-return ERR;
+if (errno == EINTR && _cursesi_screen->resized) {
+	_cursesi_screen->resized = 0;
+	return KEY_RESIZE;
+} else
+	return ERR;
 			}
 
 			if ((to || delay) && (__notimeout() == ERR))
@@ -889,7 +898,11 @@ wgetch(WINDOW *win)
 
 		if (ferror(infd)) {
 			clearerr(infd);
-			inp = ERR;
+			if (errno == EINTR && _cursesi_screen->resized) {
+_cursesi_screen->resized = 0;
+inp = KEY_RESIZE;
+			} else
+inp = ERR;
 		} else {
 			inp = c;
 		}

Index: src/lib/libcurses/tstp.c
diff -u src/lib/libcurses/tstp.c:1.42 src/lib/libcurses/tstp.c:1.42.6.1
--- src/lib/libcurses/tstp.c:1.42	Fri Jan  6 13:53:18 2017
+++ src/lib/libcurses/tstp.c	Thu Sep 27 14:59:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tstp.c,v 1.42 

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

2018-09-27 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Sep 27 14:59:43 UTC 2018

Modified Files:
src/sys/arch/x86/pci: amdtemp.c

Log Message:
Improve a bit, no real functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x86/pci/amdtemp.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/x86/pci

2018-09-27 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Sep 27 14:59:43 UTC 2018

Modified Files:
src/sys/arch/x86/pci: amdtemp.c

Log Message:
Improve a bit, no real functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x86/pci/amdtemp.c

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

Modified files:

Index: src/sys/arch/x86/pci/amdtemp.c
diff -u src/sys/arch/x86/pci/amdtemp.c:1.20 src/sys/arch/x86/pci/amdtemp.c:1.21
--- src/sys/arch/x86/pci/amdtemp.c:1.20	Thu Jun  1 02:45:08 2017
+++ src/sys/arch/x86/pci/amdtemp.c	Thu Sep 27 14:59:43 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: amdtemp.c,v 1.20 2017/06/01 02:45:08 chs Exp $ */
+/*  $NetBSD: amdtemp.c,v 1.21 2018/09/27 14:59:43 maxv Exp $ */
 /*  $OpenBSD: kate.c,v 1.2 2008/03/27 04:52:03 cnst Exp $   */
 
 /*
@@ -46,9 +46,8 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdtemp.c,v 1.20 2017/06/01 02:45:08 chs Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdtemp.c,v 1.21 2018/09/27 14:59:43 maxv Exp $ ");
 
 #include 
 #include 
@@ -103,17 +102,13 @@ __KERNEL_RCSID(0, "$NetBSD: amdtemp.c,v 
 #define K8_T_SEL_S0(v)   (v &= ~(K8_THERM_SENSE_SEL))
 #define K8_T_SEL_S1(v)   (v |= K8_THERM_SENSE_SEL)
 
-
-
 /*
  * AMD Family 10h Processors, Function 3 -- Miscellaneous Control
  */
 
 /* Function 3 Registers */
 #define F10_TEMPERATURE_CTL_R	0xa4
-
-/* Bits within Reported Temperature Control Register */
-#define F10_TEMP_CURTEMP	(1 << 21)
+#define 	F10_TEMP_CURTMP		__BITS(31,21)
 
 /*
  * Revision Guide for AMD NPT Family 0Fh Processors,
@@ -124,10 +119,10 @@ __KERNEL_RCSID(0, "$NetBSD: amdtemp.c,v 
 #define K8_SOCKET_S1	3	/* Laptop */
 
 static const struct {
-	const char  rev[5];
+	const char rev[5];
 	const struct {
-		const pcireg_t  cpuid;
-		const uint8_t   socket;
+		const pcireg_t cpuid;
+		const uint8_t socket;
 	} cpu[5];
 } amdtemp_core[] = {
 	{ "BH-F", { { 0x00040FB0, K8_SOCKET_AM2 },	/* F2 */
@@ -151,22 +146,20 @@ static const struct {
 		  { 0, 0 } } }
 };
 
-
 struct amdtemp_softc {
-pci_chipset_tag_t sc_pc;
-pcitag_t sc_pcitag;
+	pci_chipset_tag_t sc_pc;
+	pcitag_t sc_pcitag;
 
 	struct sysmon_envsys *sc_sme;
 	envsys_data_t *sc_sensor;
 	size_t sc_sensor_len;
 
-char sc_rev;
-int8_t sc_numsensors;
+	char sc_rev;
+	int8_t sc_numsensors;
 	uint32_t sc_family;
 	int32_t sc_adjustment;
 };
 
-
 static int  amdtemp_match(device_t, cfdata_t, void *);
 static void amdtemp_attach(device_t, device_t, void *);
 static int  amdtemp_detach(device_t, int);
@@ -180,7 +173,7 @@ static void amdtemp_family10_setup_senso
 static void amdtemp_family10_refresh(struct sysmon_envsys *, envsys_data_t *);
 
 CFATTACH_DECL_NEW(amdtemp, sizeof(struct amdtemp_softc),
-	amdtemp_match, amdtemp_attach, amdtemp_detach, NULL);
+amdtemp_match, amdtemp_attach, amdtemp_detach, NULL);
 
 static int
 amdtemp_match(device_t parent, cfdata_t match, void *aux)
@@ -194,8 +187,10 @@ amdtemp_match(device_t parent, cfdata_t 
 	cpu_signature = pci_conf_read(pa->pa_pc,
 	pa->pa_tag, CPUID_FAMILY_MODEL_R);
 
-	/* This CPUID northbridge register has been introduced
-	 * in Revision F */
+	/*
+	 * This CPUID northbridge register has been introduced in
+	 * Revision F.
+	 */
 	if (cpu_signature == 0x0)
 		return 0;
 
@@ -205,13 +200,12 @@ amdtemp_match(device_t parent, cfdata_t 
 	if (family == 0x10) {
 		if (CPUID_TO_BASEMODEL(cpu_signature) < 4)
 			return 0;
-		if (CPUID_TO_BASEMODEL(cpu_signature) == 4
-		&& CPUID_TO_STEPPING(cpu_signature) < 2)
+		if (CPUID_TO_BASEMODEL(cpu_signature) == 4 &&
+		CPUID_TO_STEPPING(cpu_signature) < 2)
 			return 0;
 	}
 
-
-	/* Not yet supported CPUs */
+	/* Not yet supported CPUs. */
 	if (family > 0x15)
 		return 0;
 
@@ -262,7 +256,7 @@ amdtemp_attach(device_t parent, device_t
 
 	default:
 		aprint_normal(", family 0x%x not supported\n",
-			 sc->sc_family);
+		sc->sc_family);
 		return;
 	}
 
@@ -292,8 +286,7 @@ amdtemp_attach(device_t parent, device_t
 	 * Set properties in sensors.
 	 */
 	for (i = 0; i < sc->sc_numsensors; i++) {
-		if (sysmon_envsys_sensor_attach(sc->sc_sme,
-		>sc_sensor[i]))
+		if (sysmon_envsys_sensor_attach(sc->sc_sme, >sc_sensor[i]))
 			goto bad;
 	}
 
@@ -371,8 +364,8 @@ amdtemp_k8_init(struct amdtemp_softc *sc
 
 			sc->sc_rev = amdtemp_core[i].rev[3];
 			aprint_normal(": core rev %.4s%.1x",
-amdtemp_core[i].rev,
-CPUID_TO_STEPPING(cpu_signature));
+			amdtemp_core[i].rev,
+			CPUID_TO_STEPPING(cpu_signature));
 
 			switch (amdtemp_core[i].cpu[j].socket) {
 			case K8_SOCKET_AM2:
@@ -391,9 +384,11 @@ amdtemp_k8_init(struct amdtemp_softc *sc
 	}
 
 	if (sc->sc_rev == '\0') {
-		/* CPUID Family Model Register was introduced in
-		 * Revision F */
-		sc->sc_rev = 'G';   /* newer than E, assume G */
+		/*
+		 * CPUID Family Model Register 

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

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 14:59:28 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by kamil in ticket #1039):

lib/libcurses/getch.c: revision 1.66
lib/libcurses/getch.c: revision 1.67
lib/libcurses/tstp.c: revision 1.43
lib/libcurses/get_wch.c: revision 1.15
lib/libcurses/get_wch.c: revision 1.16

PR lib/53615
getch() and get_wch() should return KEY_RESIZE when interrupted by SIGWIN=
CH.

OK roy

 -

PR lib/53615
Before invoking a previous signal handler, make sure it is not SIG_*.
Fix potential crash with SIGWINCH.

OK roy

 -

Correct detecting of terminal resize in curses(3) with keypad(,TRUE)
A previous change fixed only keypad(,FALSE) scenarios.

 -

Handle catching terminal resize in INKEY_NORM and INKEY_ASSEMBLING (in the
middle of assembling a key code from passed codes) as both accept keys with
fgetc(3) and both can be in theory interrupted with a resize.

PR lib/53615


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.4.1 src/lib/libcurses/get_wch.c
cvs rdiff -u -r1.65 -r1.65.4.1 src/lib/libcurses/getch.c
cvs rdiff -u -r1.42 -r1.42.6.1 src/lib/libcurses/tstp.c

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



CVS commit: [netbsd-8] src

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 14:52:27 UTC 2018

Modified Files:
src/share/man/man4 [netbsd-8]: usb.4
src/sys/ddb [netbsd-8]: db_command.c db_output.c
src/sys/dev/pci [netbsd-8]: xhci_pci.c
src/sys/dev/usb [netbsd-8]: ehci.c ohci.c uhci.c uhcivar.h uhub.c usb.c
usb_subr.c usbdi.c xhci.c
src/sys/external/bsd/dwc2 [netbsd-8]: dwc2.c
src/sys/kern [netbsd-8]: subr_userconf.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1037):

sys/dev/usb/uhub.c: revision 1.139
sys/external/bsd/dwc2/dwc2.c: revision 1.55
sys/ddb/db_output.c: revision 1.34
sys/ddb/db_command.c: revision 1.160
sys/dev/usb/ehci.c: revision 1.264
sys/dev/usb/xhci.c: revision 1.99
sys/dev/usb/ehci.c: revision 1.265
sys/kern/subr_userconf.c: revision 1.27
sys/dev/usb/ehcivar.h: revision 1.46
sys/dev/usb/ohci.c: revision 1.287
sys/dev/usb/uhci.c: revision 1.284
sys/dev/usb/usbdi.c: revision 1.178
sys/dev/usb/usb.c: revision 1.172
sys/dev/pci/xhci_pci.c: revision 1.14
sys/dev/usb/usb.c: revision 1.173
sys/dev/usb/usb.c: revision 1.174
share/man/man4/usb.4: revision 1.110
sys/ddb/db_command.c: revision 1.159
sys/dev/usb/usb_subr.c: revision 1.227
sys/dev/usb/uhcivar.h: revision 1.56
(all via patch)

consolidate the handling of polling across HC drivers, and generic USB:
- don't take mutexes if polling
- normalise the code across all drivers
- add some not yet code to block discovery to/from polling
- minor CSE
- adjust comment for usbd_set_polling() to reality now i properly
  understand what it is used for and why.

this, with a hack to make RB_ASKNAME to wait 5 seconds allows boot -a
work with USB keyboards.  there are still multiple issues remaining:
- discovery and polling need to be mutually exclusive
- attachment of ukbd and wskbd is not handled by config_pending, and
  the 5 second delay isn't going to always be enough.

call cnpollc(1) and cnpollc(0) around cngetc().
(christos has a good idea to add a function that does all 3,
and we should switch all the callers in this sequence to use
it (and fix the MD ones missing it still).  not all can, as
eg, line-grabbing functions can use cngetsn(), which only
calls cnpollc() twice.)

When this file is used when not building the kernel (eg: /usr/sbin/crash)
make cnpollc() go away.

reorder some struct members to remove holes.

add config_pending usage to uhub and general USB device attachment.
- call config_pending_incr() and config_pending_decr() around attaching
  devices against "usbdevif" attribute.

uhub:
- convert sc_explorepending and sc_running to bool.  add new sc_first_explore.
- call config_pending_incr() at the start of uhub_attach().  dropped in
  uhub_explore(), if this is the first explore.

implement a gross hack to fix "boot -a" on systems with usb keyboards on
systems with ehci handover to uhci (and maybe ohci), and fix a similar
problem for "boot -s".

there is effort to ensure that all devices attached via USB are probed
before RB_ASKNAME or RB_SINGLE attempts to ask any questions on the console,
and largely this works, often by chance, today, for USB disks and root.
i've recently pushed this more into uhub and general USB device attachment
as well, and kept a config_pending reference across the first explore of
a bus.  these fix many issues with directly attached hubs.

however, on systems where devices connected to ehci ports are handed over
to a companion uhci or ohci port, it may not be the first, or even second,
bus explore that finds the device finally before attachment, and at this
point all config_pending references are dropped.

there is no direct communication between drivers, the potentials are
looked up but their device_t is only used for generic things like the name,
so informing the correct companion to expect a device and deal with the
config_pending references is not possible without some fairly ugly layer
violations or multi-level callbacks (eg, we have "ehci0", and usually an
the relevant companion, eg, "uhci2", but it is the uhub that uhci2 has
attached that will deal with the device attachment.)

with the above fixes to generic USB code, the disown happens during the
first explore.  the hack works by, at this point, checking if (a) root
is not mounted, (b) single user or ask name are set, and (c) if the hack
as not been triggered already.  if all 3 conditions are true, then a
config_pending_incr() is called and a callback is triggered for (default)
5 seconds to call config_pending_decr().  ehci detach pauses waiting for
this callback if scheduled.

this allows enough time for the uhub and the ukbd/wskbd to attach before
the RK_ASKROOT prompts appear.  testing shows it takes between 1.5 and
2 seconds for the keyboard to appear after the disown occurs.

Index: 

CVS commit: [netbsd-8] src

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 14:52:27 UTC 2018

Modified Files:
src/share/man/man4 [netbsd-8]: usb.4
src/sys/ddb [netbsd-8]: db_command.c db_output.c
src/sys/dev/pci [netbsd-8]: xhci_pci.c
src/sys/dev/usb [netbsd-8]: ehci.c ohci.c uhci.c uhcivar.h uhub.c usb.c
usb_subr.c usbdi.c xhci.c
src/sys/external/bsd/dwc2 [netbsd-8]: dwc2.c
src/sys/kern [netbsd-8]: subr_userconf.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1037):

sys/dev/usb/uhub.c: revision 1.139
sys/external/bsd/dwc2/dwc2.c: revision 1.55
sys/ddb/db_output.c: revision 1.34
sys/ddb/db_command.c: revision 1.160
sys/dev/usb/ehci.c: revision 1.264
sys/dev/usb/xhci.c: revision 1.99
sys/dev/usb/ehci.c: revision 1.265
sys/kern/subr_userconf.c: revision 1.27
sys/dev/usb/ehcivar.h: revision 1.46
sys/dev/usb/ohci.c: revision 1.287
sys/dev/usb/uhci.c: revision 1.284
sys/dev/usb/usbdi.c: revision 1.178
sys/dev/usb/usb.c: revision 1.172
sys/dev/pci/xhci_pci.c: revision 1.14
sys/dev/usb/usb.c: revision 1.173
sys/dev/usb/usb.c: revision 1.174
share/man/man4/usb.4: revision 1.110
sys/ddb/db_command.c: revision 1.159
sys/dev/usb/usb_subr.c: revision 1.227
sys/dev/usb/uhcivar.h: revision 1.56
(all via patch)

consolidate the handling of polling across HC drivers, and generic USB:
- don't take mutexes if polling
- normalise the code across all drivers
- add some not yet code to block discovery to/from polling
- minor CSE
- adjust comment for usbd_set_polling() to reality now i properly
  understand what it is used for and why.

this, with a hack to make RB_ASKNAME to wait 5 seconds allows boot -a
work with USB keyboards.  there are still multiple issues remaining:
- discovery and polling need to be mutually exclusive
- attachment of ukbd and wskbd is not handled by config_pending, and
  the 5 second delay isn't going to always be enough.

call cnpollc(1) and cnpollc(0) around cngetc().
(christos has a good idea to add a function that does all 3,
and we should switch all the callers in this sequence to use
it (and fix the MD ones missing it still).  not all can, as
eg, line-grabbing functions can use cngetsn(), which only
calls cnpollc() twice.)

When this file is used when not building the kernel (eg: /usr/sbin/crash)
make cnpollc() go away.

reorder some struct members to remove holes.

add config_pending usage to uhub and general USB device attachment.
- call config_pending_incr() and config_pending_decr() around attaching
  devices against "usbdevif" attribute.

uhub:
- convert sc_explorepending and sc_running to bool.  add new sc_first_explore.
- call config_pending_incr() at the start of uhub_attach().  dropped in
  uhub_explore(), if this is the first explore.

implement a gross hack to fix "boot -a" on systems with usb keyboards on
systems with ehci handover to uhci (and maybe ohci), and fix a similar
problem for "boot -s".

there is effort to ensure that all devices attached via USB are probed
before RB_ASKNAME or RB_SINGLE attempts to ask any questions on the console,
and largely this works, often by chance, today, for USB disks and root.
i've recently pushed this more into uhub and general USB device attachment
as well, and kept a config_pending reference across the first explore of
a bus.  these fix many issues with directly attached hubs.

however, on systems where devices connected to ehci ports are handed over
to a companion uhci or ohci port, it may not be the first, or even second,
bus explore that finds the device finally before attachment, and at this
point all config_pending references are dropped.

there is no direct communication between drivers, the potentials are
looked up but their device_t is only used for generic things like the name,
so informing the correct companion to expect a device and deal with the
config_pending references is not possible without some fairly ugly layer
violations or multi-level callbacks (eg, we have "ehci0", and usually an
the relevant companion, eg, "uhci2", but it is the uhub that uhci2 has
attached that will deal with the device attachment.)

with the above fixes to generic USB code, the disown happens during the
first explore.  the hack works by, at this point, checking if (a) root
is not mounted, (b) single user or ask name are set, and (c) if the hack
as not been triggered already.  if all 3 conditions are true, then a
config_pending_incr() is called and a callback is triggered for (default)
5 seconds to call config_pending_decr().  ehci detach pauses waiting for
this callback if scheduled.

this allows enough time for the uhub and the ukbd/wskbd to attach before
the RK_ASKROOT prompts appear.  testing shows it takes between 1.5 and
2 seconds for the keyboard to appear after the disown occurs.

Index: 

CVS commit: [netbsd-8] src/sys/external/bsd/drm2/linux

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 14:38:56 UTC 2018

Modified Files:
src/sys/external/bsd/drm2/linux [netbsd-8]: linux_ww_mutex.c

Log Message:
Apply patch, requested by mrg in ticket #1036:

sys/external/bsd/drm2/linux/linux_ww_mutex.c(apply patch)

Fix LOCKDEBUG build error. Change not needed in -current.


To generate a diff of this commit:
cvs rdiff -u -r1.2.10.1 -r1.2.10.2 \
src/sys/external/bsd/drm2/linux/linux_ww_mutex.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/external/bsd/drm2/linux/linux_ww_mutex.c
diff -u src/sys/external/bsd/drm2/linux/linux_ww_mutex.c:1.2.10.1 src/sys/external/bsd/drm2/linux/linux_ww_mutex.c:1.2.10.2
--- src/sys/external/bsd/drm2/linux/linux_ww_mutex.c:1.2.10.1	Sat Sep  1 06:34:00 2018
+++ src/sys/external/bsd/drm2/linux/linux_ww_mutex.c	Thu Sep 27 14:38:56 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_ww_mutex.c,v 1.2.10.1 2018/09/01 06:34:00 martin Exp $	*/
+/*	$NetBSD: linux_ww_mutex.c,v 1.2.10.2 2018/09/27 14:38:56 martin Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_ww_mutex.c,v 1.2.10.1 2018/09/01 06:34:00 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_ww_mutex.c,v 1.2.10.2 2018/09/27 14:38:56 martin Exp $");
 
 #include 
 #include 
@@ -122,7 +122,7 @@ ww_acquire_fini(struct ww_acquire_ctx *c
 
 #ifdef LOCKDEBUG
 static void
-ww_dump(const volatile void *cookie)
+ww_dump(volatile void *cookie)
 {
 	const volatile struct ww_mutex *mutex = cookie;
 



CVS commit: [netbsd-8] src/sys/external/bsd/drm2/linux

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 14:38:56 UTC 2018

Modified Files:
src/sys/external/bsd/drm2/linux [netbsd-8]: linux_ww_mutex.c

Log Message:
Apply patch, requested by mrg in ticket #1036:

sys/external/bsd/drm2/linux/linux_ww_mutex.c(apply patch)

Fix LOCKDEBUG build error. Change not needed in -current.


To generate a diff of this commit:
cvs rdiff -u -r1.2.10.1 -r1.2.10.2 \
src/sys/external/bsd/drm2/linux/linux_ww_mutex.c

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



CVS commit: [netbsd-8] src/usr.sbin/npf/npfctl

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 14:33:30 UTC 2018

Modified Files:
src/usr.sbin/npf/npfctl [netbsd-8]: npf.conf.5

Log Message:
Pull up the following, requested by maxv in ticket #1030:

usr.sbin/npf/npfctl/npf.conf.5  1.71-1.79   (patch)

npf.conf(5): fix some of the previous incorrect or inaccurate changes.
The TCP flags option is not only for the stateful tracking.  Dynamic NAT
implies NAPT; algorithms, at least for now, are for static NAT mappings.
Mention that ALG ICMP is also for traceroute behind NAT; also mention
"MSS clamping" (some users might search for this term, so keeping the
terminology is helpful).



Remove superfluous Pp.



Be clearer about the difference between static vs dynamic interface list,
and slightly improve wording.

My understanding is that when none of inet4/inet6/ifaddrs is passed, NPF
assumes ifaddrs.



New sentence, new line. Use Fn for functions.



Fix the "Interfaces" section, I understood wrong. Talk about inference,
because it was not mentioned before, and it plays an important role.
Discussed with rmind. Probably not the last pass.



Switch back to tabs, it was nicer this way.



Wrap long lines, so that nothing overflows.



Improve markup.



According to the grammar and examples the static table is defined with
"file" keyword, not "static".


To generate a diff of this commit:
cvs rdiff -u -r1.48.4.1 -r1.48.4.2 src/usr.sbin/npf/npfctl/npf.conf.5

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



CVS commit: [netbsd-8] src/usr.sbin/npf/npfctl

2018-09-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 27 14:33:30 UTC 2018

Modified Files:
src/usr.sbin/npf/npfctl [netbsd-8]: npf.conf.5

Log Message:
Pull up the following, requested by maxv in ticket #1030:

usr.sbin/npf/npfctl/npf.conf.5  1.71-1.79   (patch)

npf.conf(5): fix some of the previous incorrect or inaccurate changes.
The TCP flags option is not only for the stateful tracking.  Dynamic NAT
implies NAPT; algorithms, at least for now, are for static NAT mappings.
Mention that ALG ICMP is also for traceroute behind NAT; also mention
"MSS clamping" (some users might search for this term, so keeping the
terminology is helpful).



Remove superfluous Pp.



Be clearer about the difference between static vs dynamic interface list,
and slightly improve wording.

My understanding is that when none of inet4/inet6/ifaddrs is passed, NPF
assumes ifaddrs.



New sentence, new line. Use Fn for functions.



Fix the "Interfaces" section, I understood wrong. Talk about inference,
because it was not mentioned before, and it plays an important role.
Discussed with rmind. Probably not the last pass.



Switch back to tabs, it was nicer this way.



Wrap long lines, so that nothing overflows.



Improve markup.



According to the grammar and examples the static table is defined with
"file" keyword, not "static".


To generate a diff of this commit:
cvs rdiff -u -r1.48.4.1 -r1.48.4.2 src/usr.sbin/npf/npfctl/npf.conf.5

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/npf/npfctl/npf.conf.5
diff -u src/usr.sbin/npf/npfctl/npf.conf.5:1.48.4.1 src/usr.sbin/npf/npfctl/npf.conf.5:1.48.4.2
--- src/usr.sbin/npf/npfctl/npf.conf.5:1.48.4.1	Sat Sep  1 06:19:12 2018
+++ src/usr.sbin/npf/npfctl/npf.conf.5	Thu Sep 27 14:33:30 2018
@@ -1,4 +1,4 @@
-.\"$NetBSD: npf.conf.5,v 1.48.4.1 2018/09/01 06:19:12 martin Exp $
+.\"$NetBSD: npf.conf.5,v 1.48.4.2 2018/09/27 14:33:30 martin Exp $
 .\"
 .\" Copyright (c) 2009-2017 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd August 31, 2018
+.Dd September 21, 2018
 .Dt NPF.CONF 5
 .Os
 .Sh NAME
@@ -46,7 +46,8 @@ in-depth information.
 There are multiple structural elements that
 .Nm
 may contain, such as:
-.Bl -bullet -offset indent
+.Pp
+.Bl -bullet -offset indent -compact
 .It
 variables
 .It
@@ -64,86 +65,123 @@ procedure definitions to call on filtere
 .El
 .Sh SYNTAX
 .Ss Variables
-Variables are specified using the dollar ($) sign, which is used for both
+Variables are specified using the dollar
+.Pq Li $
+sign, which is used for both
 definition and referencing of a variable.
 Variables are defined by assigning a value to them as follows:
-.Bd -literal
-$var1 = 10.0.0.1
-.Ed
+.Pp
+.Dl $var1 = 10.0.0.1
 .Pp
 A variable may also be defined as a set:
-.Bd -literal
-$var2 = { 10.0.0.1, 10.0.0.2 }
-.Ed
+.Pp
+.Dl $var2 = { 10.0.0.1, 10.0.0.2 }
 .Pp
 Common variable definitions are for IP addresses, networks, ports,
 and interfaces.
 .Ss Tables
 Tables are specified using a name between angle brackets
-< and >.
+.Sq Li <
+and
+.Sq Li > .
 The following is an example of table definition:
-.Bd -literal
-table  type hash dynamic
 .Pp
-.Ed
-Currently, tables support three data storage types: "hash", "tree", or "cdb".
-Tables can also be set as containing "dynamic" or "static" data i.e. loaded from
- a specified file.
-Tables of type "hash" and "cdb" can only contain IP addresses.
-Only static data can be used with a storage type of "cdb".
+.Dl table  type hash dynamic
+.Pp
+Currently, tables support three data storage types:
+.Cm hash,
+.Cm tree ,
+or
+.Cm cdb .
+Tables can also be set as containing
+.Cm dynamic
+data or static
+.Cm file Ar filename
+data loaded from a specified file.
+Tables of type
+.Dq hash
+and
+.Dq cdb
+can only contain IP addresses.
+Only static data can be used with a storage type of
+.Dq cdb .
 .Pp
 The specified file should contain a list of IP addresses and/or networks in the
-form of:
-.Bd -literal
-10.0.0.0/24
-10.1.1.1
-.Ed
+form of
+.Li 10.1.1.1
+or
+.Li 10.0.0.0/24
 .Ss Interfaces
-Interfaces can be specified as the values of the variables:
-.Bd 

CVS commit: src/lib/libcurses

2018-09-27 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Sep 27 14:07:55 UTC 2018

Modified Files:
src/lib/libcurses: get_wch.c getch.c

Log Message:
curses: call resizeterm if getch issues KEY_RESIZE

This fixes PR #53633.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/lib/libcurses/get_wch.c
cvs rdiff -u -r1.68 -r1.69 src/lib/libcurses/getch.c

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



CVS commit: src/lib/libcurses

2018-09-27 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Sep 27 14:07:55 UTC 2018

Modified Files:
src/lib/libcurses: get_wch.c getch.c

Log Message:
curses: call resizeterm if getch issues KEY_RESIZE

This fixes PR #53633.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/lib/libcurses/get_wch.c
cvs rdiff -u -r1.68 -r1.69 src/lib/libcurses/getch.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.17 src/lib/libcurses/get_wch.c:1.18
--- src/lib/libcurses/get_wch.c:1.17	Thu Sep 27 14:05:26 2018
+++ src/lib/libcurses/get_wch.c	Thu Sep 27 14:07:55 2018
@@ -1,4 +1,4 @@
-/*   $NetBSD: get_wch.c,v 1.17 2018/09/27 14:05:26 roy Exp $ */
+/*   $NetBSD: get_wch.c,v 1.18 2018/09/27 14:07:55 roy Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: get_wch.c,v 1.17 2018/09/27 14:05:26 roy Exp $");
+__RCSID("$NetBSD: get_wch.c,v 1.18 2018/09/27 14:07:55 roy Exp $");
 #endif		  /* not lint */
 
 #include 
@@ -531,6 +531,7 @@ wget_wch(WINDOW *win, wint_t *ch)
 #endif
 	if (_cursesi_screen->resized) {
 		_cursesi_screen->resized = 0;
+		resizeterm(LINES, COLS);
 		*ch = KEY_RESIZE;
 		return KEY_CODE_YES;
 	}
@@ -684,6 +685,7 @@ __fgetwc_resize(FILE *infd, bool *resize
 	__CTRACE(__CTRACE_INPUT, "__fgetwc_resize returning KEY_RESIZE\n");
 #endif
 	_cursesi_screen->resized = 0;
+	resizeterm(LINES, COLS);
 	*resized = true;
 	return c;
 }

Index: src/lib/libcurses/getch.c
diff -u src/lib/libcurses/getch.c:1.68 src/lib/libcurses/getch.c:1.69
--- src/lib/libcurses/getch.c:1.68	Thu Sep 27 14:05:26 2018
+++ src/lib/libcurses/getch.c	Thu Sep 27 14:07:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: getch.c,v 1.68 2018/09/27 14:05:26 roy Exp $	*/
+/*	$NetBSD: getch.c,v 1.69 2018/09/27 14:07:55 roy 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.68 2018/09/27 14:05:26 roy Exp $");
+__RCSID("$NetBSD: getch.c,v 1.69 2018/09/27 14:07:55 roy Exp $");
 #endif
 #endif	/* not lint */
 
@@ -825,6 +825,7 @@ wgetch(WINDOW *win)
 #endif
 	if (_cursesi_screen->resized) {
 		_cursesi_screen->resized = 0;
+		resizeterm(LINES, COLS);
 #ifdef DEBUG
 		__CTRACE(__CTRACE_INPUT, "wgetch returning KEY_RESIZE\n");
 #endif
@@ -1013,5 +1014,6 @@ __fgetc_resize(FILE *infd)
 	__CTRACE(__CTRACE_INPUT, "__fgetc_resize returning KEY_RESIZE\n");
 #endif
 	_cursesi_screen->resized = 0;
+	resizeterm(LINES, COLS);
 	return KEY_RESIZE;
 }



CVS commit: src/lib/libcurses

2018-09-27 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Sep 27 14:05:26 UTC 2018

Modified Files:
src/lib/libcurses: curses_private.h get_wch.c getch.c

Log Message:
curses: unify resize handling in getch

Instead of testing each fgetc call for resize event, add the wrapper
__fgetc_resize to simplify the logic.
While here, ensure that get_wch uses the correct input stream which
may or may not be stdin.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/lib/libcurses/curses_private.h
cvs rdiff -u -r1.16 -r1.17 src/lib/libcurses/get_wch.c
cvs rdiff -u -r1.67 -r1.68 src/lib/libcurses/getch.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.62 src/lib/libcurses/curses_private.h:1.63
--- src/lib/libcurses/curses_private.h:1.62	Tue Jan 31 09:17:53 2017
+++ src/lib/libcurses/curses_private.h	Thu Sep 27 14:05:26 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses_private.h,v 1.62 2017/01/31 09:17:53 roy Exp $	*/
+/*	$NetBSD: curses_private.h,v 1.63 2018/09/27 14:05:26 roy Exp $	*/
 
 /*-
  * Copyright (c) 1998-2000 Brett Lymn
@@ -365,6 +365,7 @@ void	__cursesi_win_free_nsp(WINDOW *);
 void	__cursesi_putnsp(nschar_t *, const int, const int);
 void	__cursesi_chtype_to_cchar(chtype, cchar_t *);
 #endif /* HAVE_WCHAR */
+int	 __fgetc_resize(FILE *);
 int	 __unget(wint_t);
 int	 __mvcur(int, int, int, int, int);
 WINDOW  *__newwin(SCREEN *, int, int, int, int, int);

Index: src/lib/libcurses/get_wch.c
diff -u src/lib/libcurses/get_wch.c:1.16 src/lib/libcurses/get_wch.c:1.17
--- src/lib/libcurses/get_wch.c:1.16	Wed Sep 26 14:42:22 2018
+++ src/lib/libcurses/get_wch.c	Thu Sep 27 14:05:26 2018
@@ -1,4 +1,4 @@
-/*   $NetBSD: get_wch.c,v 1.16 2018/09/26 14:42:22 kamil Exp $ */
+/*   $NetBSD: get_wch.c,v 1.17 2018/09/27 14:05:26 roy Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation Inc.
@@ -36,7 +36,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: get_wch.c,v 1.16 2018/09/26 14:42:22 kamil Exp $");
+__RCSID("$NetBSD: get_wch.c,v 1.17 2018/09/27 14:05:26 roy Exp $");
 #endif		  /* not lint */
 
 #include 
@@ -56,6 +56,7 @@ extern short state;		/* storage declared
 /* prototypes for private functions */
 #ifdef HAVE_WCHAR
 static int inkey(wchar_t *wc, int to, int delay);
+static wint_t __fgetwc_resize(FILE *infd, bool *resized);
 #endif /* HAVE_WCHAR */
 
 #ifdef HAVE_WCHAR
@@ -100,14 +101,10 @@ inkey(wchar_t *wc, int to, int delay)
 		if (wstate == INKEY_NORM) {
 			if (delay && __timeout(delay) == ERR)
 return ERR;
-			c = fgetc(infd);
-			if (c == WEOF) {
+			c = __fgetc_resize(infd);
+			if (c == ERR || c == KEY_RESIZE) {
 clearerr(infd);
-if (errno == EINTR && _cursesi_screen->resized) {
-	_cursesi_screen->resized = 0;
-	return KEY_RESIZE;
-} else
-	return ERR;
+return c;
 			}
 
 			if (delay && (__notimeout() == ERR))
@@ -152,14 +149,10 @@ inkey(wchar_t *wc, int to, int delay)
 	return ERR;
 			}
 
-			c = fgetc(infd);
+			c = __fgetc_resize(infd);
 			if (ferror(infd)) {
 clearerr(infd);
-if (errno == EINTR && _cursesi_screen->resized) {
-	_cursesi_screen->resized = 0;
-	return KEY_RESIZE;
-} else
-	return ERR;
+return c;
 			}
 
 			if ((to || delay) && (__notimeout() == ERR))
@@ -206,10 +199,10 @@ inkey(wchar_t *wc, int to, int delay)
 	return ERR;
 			}
 
-			c = fgetc(infd);
+			c = __fgetc_resize(infd);
 			if (ferror(infd)) {
 clearerr(infd);
-return ERR;
+return c;
 			}
 
 			if ((to || delay) && (__notimeout() == ERR))
@@ -583,6 +576,8 @@ wget_wch(WINDOW *win, wint_t *ch)
 		if ( ret == ERR )
 			return ERR;
 	} else {
+		bool resized;
+
 		switch (win->delay) {
 			case -1:
 break;
@@ -596,17 +591,11 @@ wget_wch(WINDOW *win, wint_t *ch)
 break;
 		}
 
-		c = getwchar();
-		if (feof(infd)) {
+		c = __fgetwc_resize(infd, );
+		if (c == WEOF) {
 			clearerr(infd);
 			__restore_termios();
-			return ERR;	/* we have timed out */
-		}
-
-		if (ferror(infd)) {
-			clearerr(infd);
-			if (errno == EINTR && _cursesi_screen->resized) {
-_cursesi_screen->resized = 0;
+			if (resized) {
 *ch = KEY_RESIZE;
 return KEY_CODE_YES;
 			} else
@@ -674,3 +663,28 @@ unget_wch(const wchar_t c)
 {
 	return __unget((wint_t)c);
 }
+
+#ifdef HAVE_WCHAR
+/*
+ * __fgetwc_resize --
+ *Any call to fgetwc(3) should use this function instead.
+ */
+static wint_t
+__fgetwc_resize(FILE *infd, bool *resized)
+{
+	wint_t c;
+
+	c = fgetwc(infd);
+	if (c != WEOF)
+		return c;
+
+	if (!ferror(infd) || errno != EINTR || !_cursesi_screen->resized)
+		return ERR;
+#ifdef DEBUG
+	__CTRACE(__CTRACE_INPUT, "__fgetwc_resize returning KEY_RESIZE\n");
+#endif
+	_cursesi_screen->resized = 0;
+	*resized = true;
+	return c;
+}
+#endif

Index: src/lib/libcurses/getch.c
diff -u src/lib/libcurses/getch.c:1.67 src/lib/libcurses/getch.c:1.68
--- 

CVS commit: src/lib/libcurses

2018-09-27 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Sep 27 14:05:26 UTC 2018

Modified Files:
src/lib/libcurses: curses_private.h get_wch.c getch.c

Log Message:
curses: unify resize handling in getch

Instead of testing each fgetc call for resize event, add the wrapper
__fgetc_resize to simplify the logic.
While here, ensure that get_wch uses the correct input stream which
may or may not be stdin.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/lib/libcurses/curses_private.h
cvs rdiff -u -r1.16 -r1.17 src/lib/libcurses/get_wch.c
cvs rdiff -u -r1.67 -r1.68 src/lib/libcurses/getch.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/x86

2018-09-27 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Sep 27 13:04:22 UTC 2018

Modified Files:
src/sys/arch/x86/include: dbregs.h
src/sys/arch/x86/x86: dbregs.c

Log Message:
Export x86_dbregs_{save/restore}, will be used outside. Reproduce some
internal dbregs logic in them.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/x86/include/dbregs.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x86/x86/dbregs.c

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

Modified files:

Index: src/sys/arch/x86/include/dbregs.h
diff -u src/sys/arch/x86/include/dbregs.h:1.6 src/sys/arch/x86/include/dbregs.h:1.7
--- src/sys/arch/x86/include/dbregs.h:1.6	Thu Jul 26 09:29:08 2018
+++ src/sys/arch/x86/include/dbregs.h	Thu Sep 27 13:04:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbregs.h,v 1.6 2018/07/26 09:29:08 maxv Exp $	*/
+/*	$NetBSD: dbregs.h,v 1.7 2018/09/27 13:04:22 maxv Exp $	*/
 
 /*
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -110,6 +110,10 @@ void x86_dbregs_init(void);
 void x86_dbregs_clear(struct lwp *);
 void x86_dbregs_abandon(struct lwp *);
 void x86_dbregs_read(struct lwp *, struct dbreg *);
+
+void x86_dbregs_save(struct lwp *);
+void x86_dbregs_restore(struct lwp *);
+
 void x86_dbregs_store_dr6(struct lwp *);
 int x86_dbregs_user_trap(void);
 int x86_dbregs_validate(const struct dbreg *);

Index: src/sys/arch/x86/x86/dbregs.c
diff -u src/sys/arch/x86/x86/dbregs.c:1.11 src/sys/arch/x86/x86/dbregs.c:1.12
--- src/sys/arch/x86/x86/dbregs.c:1.11	Thu Jul 26 09:29:08 2018
+++ src/sys/arch/x86/x86/dbregs.c	Thu Sep 27 13:04:21 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbregs.c,v 1.11 2018/07/26 09:29:08 maxv Exp $	*/
+/*	$NetBSD: dbregs.c,v 1.12 2018/09/27 13:04:21 maxv Exp $	*/
 
 /*
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -144,11 +144,15 @@ x86_dbregs_read(struct lwp *l, struct db
 	memcpy(regs, pcb->pcb_dbregs, sizeof(*regs));
 }
 
-static void
+void
 x86_dbregs_save(struct lwp *l)
 {
 	struct pcb *pcb = lwp_getpcb(l);
 
+	if (!(pcb->pcb_flags & PCB_DBREGS)) {
+		return;
+	}
+
 	KASSERT(pcb->pcb_dbregs != NULL);
 
 	pcb->pcb_dbregs->dr[0] = rdr0();
@@ -160,11 +164,15 @@ x86_dbregs_save(struct lwp *l)
 	pcb->pcb_dbregs->dr[7] = rdr7();
 }
 
-static void
+void
 x86_dbregs_restore(struct lwp *l)
 {
 	struct pcb *pcb = lwp_getpcb(l);
 
+	if (!(pcb->pcb_flags & PCB_DBREGS)) {
+		return;
+	}
+
 	KASSERT(pcb->pcb_dbregs != NULL);
 
 	ldr0(pcb->pcb_dbregs->dr[0]);



CVS commit: src/sys/arch/x86

2018-09-27 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Sep 27 13:04:22 UTC 2018

Modified Files:
src/sys/arch/x86/include: dbregs.h
src/sys/arch/x86/x86: dbregs.c

Log Message:
Export x86_dbregs_{save/restore}, will be used outside. Reproduce some
internal dbregs logic in them.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/x86/include/dbregs.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x86/x86/dbregs.c

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



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

2018-09-27 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Sep 27 08:20:44 UTC 2018

Modified Files:
src/sys/conf [pgoyette-compat]: std

Log Message:
This should no longer be needed


To generate a diff of this commit:
cvs rdiff -u -r1.22.14.1 -r1.22.14.2 src/sys/conf/std

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



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

2018-09-27 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Sep 27 08:20:44 UTC 2018

Modified Files:
src/sys/conf [pgoyette-compat]: std

Log Message:
This should no longer be needed


To generate a diff of this commit:
cvs rdiff -u -r1.22.14.1 -r1.22.14.2 src/sys/conf/std

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

Modified files:

Index: src/sys/conf/std
diff -u src/sys/conf/std:1.22.14.1 src/sys/conf/std:1.22.14.2
--- src/sys/conf/std:1.22.14.1	Tue Mar  6 05:43:02 2018
+++ src/sys/conf/std	Thu Sep 27 08:20:44 2018
@@ -1,4 +1,4 @@
-# $NetBSD: std,v 1.22.14.1 2018/03/06 05:43:02 pgoyette Exp $
+# $NetBSD: std,v 1.22.14.2 2018/09/27 08:20:44 pgoyette Exp $
 #
 # standard MI 'options'
 #
@@ -34,13 +34,6 @@ options	AIO		# POSIX asynchronous I/O
 options	MQUEUE		# POSIX message queues
 
 #
-# Common compatibility functions. They happen to be needed even when
-# no compatibility option is explicitly enabled.
-#
-options 	COMPAT_UTILS
-
-#
-
 # Security model.
 #
 options	secmodel_bsd44	# Traditional 4.4BSD security model



Re: CVS commit: src/sys/kern

2018-09-27 Thread Manuel Bouyer
On Thu, Sep 27, 2018 at 01:03:40AM +, Emmanuel Dreyfus wrote:
> Module Name:  src
> Committed By: manu
> Date: Thu Sep 27 01:03:40 UTC 2018
> 
> Modified Files:
>   src/sys/kern: vfs_trans.c
> 
> Log Message:
> Work around deadlock between fstchg and fstcnt
> 
> When suspending a filesystem in fstrans_setstate(), we wait on
> fstcnt for threads to finish transactions. While we do this, any
> thread trying to start a filesystem transaction will wait on fstchg
> in fstrans_start(), a situation which can deadlock.
> 
> The wait for fstcnt in fstrans_setstate() can be interrupted by
> a signal, but the wait for fstchg in fstrans_start() cannot. Once
> most processes are stuck in fstchg, it is impossible to send a
> signal to the thread that waits on fstcnt, because no process
> respond anymore to user input.
> 
> We fix that by adding a timeout to the wait on fstcnt in
> fstrans_setstate(). This means suspending a filesystem may fail,
> but it was already the case when the sleep was interupted by
> a signal, hence calling function must already handle a possible
> failure.

Actually callers do not, they just forward the failure.
This means that things like e.g. umount or snapshots will randomly
fail (whenever fstrans_setstate() can actually take a long
time without deadlock has to be determined, but I suspect it can). 

I think fstrans_setstate() should pause and retry in this case.

-- 
Manuel Bouyer 
 NetBSD: 26 ans d'experience feront toujours la difference
--


CVS commit: src/sys/dev/pci

2018-09-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Sep 27 07:09:29 UTC 2018

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

Log Message:
Root Complex Event Collector Bus Number Association ECN.
- If capability version is 2 (or greater), decode RCEC Associated Bus Numbers
  register.


To generate a diff of this commit:
cvs rdiff -u -r1.203 -r1.204 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.140 -r1.141 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.203 src/sys/dev/pci/pci_subr.c:1.204
--- src/sys/dev/pci/pci_subr.c:1.203	Wed Sep 12 07:42:22 2018
+++ src/sys/dev/pci/pci_subr.c	Thu Sep 27 07:09:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.203 2018/09/12 07:42:22 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.204 2018/09/27 07:09:29 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.203 2018/09/12 07:42:22 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.204 2018/09/27 07:09:29 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -3061,6 +3061,18 @@ pci_conf_print_rcec_assoc_cap(const pcir
 	reg = regs[o2i(extcapoff + PCI_RCEC_ASSOC_ASSOCBITMAP)];
 	printf("Association Bitmap for Root Complex Integrated Devices:"
 	" 0x%08x\n", reg);
+
+	if (PCI_EXTCAPLIST_VERSION(regs[o2i(extcapoff)]) >= 2) {
+		reg = regs[o2i(extcapoff + PCI_RCEC_ASSOC_ASSOCBUSNUM)];
+		printf("RCEC Associated Bus Numbers register: 0x%08x\n",
+		reg);
+		printf("  RCEC Next Bus: %u\n",
+		(unsigned int)__SHIFTOUT(reg,
+			PCI_RCEC_ASSOCBUSNUM_RCECNEXT));
+		printf("  RCEC Last Bus: %u\n",
+		(unsigned int)__SHIFTOUT(reg,
+			PCI_RCEC_ASSOCBUSNUM_RCECLAST));
+	}
 }
 
 /* XXX pci_conf_print_mfvc_cap */

Index: src/sys/dev/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.140 src/sys/dev/pci/pcireg.h:1.141
--- src/sys/dev/pci/pcireg.h:1.140	Wed Sep 12 07:42:21 2018
+++ src/sys/dev/pci/pcireg.h	Thu Sep 27 07:09:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcireg.h,v 1.140 2018/09/12 07:42:21 msaitoh Exp $	*/
+/*	$NetBSD: pcireg.h,v 1.141 2018/09/27 07:09:29 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -1699,7 +1699,10 @@ struct pci_rom {
  * Extended capability ID: 0x0007
  * Root Complex Event Collector Association
  */
-#define	PCI_RCEC_ASSOC_ASSOCBITMAP 0x04
+#define	PCI_RCEC_ASSOC_ASSOCBITMAP 0x04	/* Association Bitmap */
+#define	PCI_RCEC_ASSOC_ASSOCBUSNUM 0x08	/* Associcated Bus Number */
+#define	PCI_RCEC_ASSOCBUSNUM_RCECNEXT __BITS(15, 8)	/* RCEC Next Bus */
+#define	PCI_RCEC_ASSOCBUSNUM_RCECLAST __BITS(23, 16)	/* RCEC Last Bus */
 
 /*
  * Extended capability ID: 0x0008



CVS commit: src/sys/dev/pci

2018-09-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Sep 27 07:09:29 UTC 2018

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

Log Message:
Root Complex Event Collector Bus Number Association ECN.
- If capability version is 2 (or greater), decode RCEC Associated Bus Numbers
  register.


To generate a diff of this commit:
cvs rdiff -u -r1.203 -r1.204 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.140 -r1.141 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.