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

2018-05-16 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed May 16 08:32:07 UTC 2018

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

Log Message:
Fix memory leak. it was leaking one page every pmap_create().
pm->pm_vmlist must be initialized before calling _pmap_alloc_pdp().


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/aarch64/aarch64/pmap.c

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.5 src/sys/arch/aarch64/aarch64/pmap.c:1.6
--- src/sys/arch/aarch64/aarch64/pmap.c:1.5	Sun Apr 29 12:07:05 2018
+++ src/sys/arch/aarch64/aarch64/pmap.c	Wed May 16 08:32:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.5 2018/04/29 12:07:05 ryo Exp $	*/
+/*	$NetBSD: pmap.c,v 1.6 2018/05/16 08:32:07 ryo Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.5 2018/04/29 12:07:05 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.6 2018/05/16 08:32:07 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -1229,10 +1229,10 @@ pmap_create(void)
 	memset(pm, 0, sizeof(*pm));
 	pm->pm_refcnt = 1;
 	pm->pm_asid = -1;
-	pm->pm_l0table = _pmap_alloc_pdp(pm, >pm_l0table_pa);
-	KASSERT(((vaddr_t)pm->pm_l0table & (PAGE_SIZE - 1)) == 0);
 	SLIST_INIT(>pm_vmlist);
 	mutex_init(>pm_lock, MUTEX_DEFAULT, IPL_VM);
+	pm->pm_l0table = _pmap_alloc_pdp(pm, >pm_l0table_pa);
+	KASSERT(((vaddr_t)pm->pm_l0table & (PAGE_SIZE - 1)) == 0);
 
 	UVMHIST_LOG(pmaphist, "pm=%p, pm_l0table=%016lx, pm_l0table_pa=%016lx",
 	pm, pm->pm_l0table, pm->pm_l0table_pa, 0);



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

2018-05-16 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed May 16 08:32:07 UTC 2018

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

Log Message:
Fix memory leak. it was leaking one page every pmap_create().
pm->pm_vmlist must be initialized before calling _pmap_alloc_pdp().


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/aarch64/aarch64/pmap.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/i386/i386

2018-05-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 16 08:16:36 UTC 2018

Modified Files:
src/sys/arch/i386/i386: i386_trap.S trap.c

Log Message:
Mitigation for CVE-2018-8897 on i386. Contrary to amd64 there is no clear
way to determine if we are in kernel mode but with the user context; so we
go the hard way, and scan the IDT.

On i386 the bug is less of a problem, since we don't have GSBASE. All an
attacker can do is panicking the system.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/i386/i386/i386_trap.S
cvs rdiff -u -r1.293 -r1.294 src/sys/arch/i386/i386/trap.c

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



CVS commit: src/sys/dev/pci/ixgbe

2018-05-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 16 07:51:17 UTC 2018

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
 Fix a problem that the watchdog timer sometimes mistakenly fires. Restore
TX sending check in the end of ixgbe_txeof which was wrongly removed in
ix_txrx.c rev. 1.42.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/pci/ixgbe/ix_txrx.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/i386/i386

2018-05-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 16 08:16:36 UTC 2018

Modified Files:
src/sys/arch/i386/i386: i386_trap.S trap.c

Log Message:
Mitigation for CVE-2018-8897 on i386. Contrary to amd64 there is no clear
way to determine if we are in kernel mode but with the user context; so we
go the hard way, and scan the IDT.

On i386 the bug is less of a problem, since we don't have GSBASE. All an
attacker can do is panicking the system.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/i386/i386/i386_trap.S
cvs rdiff -u -r1.293 -r1.294 src/sys/arch/i386/i386/trap.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/i386/i386/i386_trap.S
diff -u src/sys/arch/i386/i386/i386_trap.S:1.13 src/sys/arch/i386/i386/i386_trap.S:1.14
--- src/sys/arch/i386/i386/i386_trap.S:1.13	Fri Mar 16 12:48:54 2018
+++ src/sys/arch/i386/i386/i386_trap.S	Wed May 16 08:16:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386_trap.S,v 1.13 2018/03/16 12:48:54 maxv Exp $	*/
+/*	$NetBSD: i386_trap.S,v 1.14 2018/05/16 08:16:36 maxv Exp $	*/
 
 /*
  * Copyright 2002 (c) Wasabi Systems, Inc.
@@ -66,7 +66,7 @@
 
 #if 0
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i386_trap.S,v 1.13 2018/03/16 12:48:54 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i386_trap.S,v 1.14 2018/05/16 08:16:36 maxv Exp $");
 #endif
 
 /*
@@ -88,8 +88,49 @@ IDTVEC(trap00)
 	ZTRAP(T_DIVIDE)
 IDTVEC_END(trap00)
 
+/*
+ * Handle the SS shadow, CVE-2018-8897.
+ *
+ * We scan the IDT to determine if we hit an entry point. If so, we leave
+ * without restoring the segregs, because we could fault while doing that.
+ */
 IDTVEC(trap01)
+#ifndef XEN
+	pushl	$0
+	pushl	$T_TRCTRAP
+	INTRENTRY
+
+	testb	$SEL_UPL,TF_CS(%esp)
+	jnz	.Lnormal_dbentry
+
+	pushl	%esp
+	call	ss_shadow
+	addl	$4,%esp
+
+	cmpl	$1,%eax
+	jne	.Lnormal_dbentry
+
+	/* SS shadow, ignore the exception. */
+	xorl	%eax,%eax
+	movl	%eax,%dr6
+
+	/* INTRFASTEXIT, but without segregs. */
+	movl	TF_EDI(%esp),%edi
+	movl	TF_ESI(%esp),%esi
+	movl	TF_EBP(%esp),%ebp
+	movl	TF_EBX(%esp),%ebx
+	movl	TF_EDX(%esp),%edx
+	movl	TF_ECX(%esp),%ecx
+	movl	TF_EAX(%esp),%eax
+	addl	$(TF_PUSHSIZE+8),%esp
+	iret
+
+.Lnormal_dbentry:
+	STI(%eax)
+	jmp _C_LABEL(calltrap)
+#else
 	ZTRAP(T_TRCTRAP)
+#endif
 IDTVEC_END(trap01)
 
 /*

Index: src/sys/arch/i386/i386/trap.c
diff -u src/sys/arch/i386/i386/trap.c:1.293 src/sys/arch/i386/i386/trap.c:1.294
--- src/sys/arch/i386/i386/trap.c:1.293	Tue Feb 13 01:05:18 2018
+++ src/sys/arch/i386/i386/trap.c	Wed May 16 08:16:36 2018
@@ -1,5 +1,5 @@
 
-/*	$NetBSD: trap.c,v 1.293 2018/02/13 01:05:18 christos Exp $	*/
+/*	$NetBSD: trap.c,v 1.294 2018/05/16 08:16:36 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.293 2018/02/13 01:05:18 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.294 2018/05/16 08:16:36 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -128,6 +128,7 @@ dtrace_doubletrap_func_t	dtrace_doubletr
 void trap(struct trapframe *);
 void trap_tss(struct i386tss *, int, int);
 void trap_return_fault_return(struct trapframe *) __dead;
+int ss_shadow(struct trapframe *tf);
 
 const char * const trap_type[] = {
 	"privileged instruction fault",		/*  0 T_PRIVINFLT */
@@ -236,6 +237,25 @@ trap_print(const struct trapframe *frame
 	l, l->l_proc->p_pid, l->l_lid, KSTACK_LOWEST_ADDR(l));
 }
 
+int
+ss_shadow(struct trapframe *tf)
+{
+	struct gate_descriptor *gd;
+	uintptr_t eip, func;
+	size_t i;
+
+	eip = tf->tf_eip;
+
+	for (i = 0; i < 256; i++) {
+		gd = [i];
+		func = (gd->gd_hioffset << 16) | gd->gd_looffset;
+		if (eip == func)
+			return 1;
+	}
+
+	return 0;
+}
+
 /*
  * trap(frame): exception, fault, and trap interface to BSD kernel.
  *



CVS commit: src/sys/dev/pci/ixgbe

2018-05-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 16 07:51:17 UTC 2018

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
 Fix a problem that the watchdog timer sometimes mistakenly fires. Restore
TX sending check in the end of ixgbe_txeof which was wrongly removed in
ix_txrx.c rev. 1.42.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/pci/ixgbe/ix_txrx.c

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.42 src/sys/dev/pci/ixgbe/ix_txrx.c:1.43
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.42	Tue May  8 09:45:54 2018
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Wed May 16 07:51:17 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.42 2018/05/08 09:45:54 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.43 2018/05/16 07:51:17 msaitoh Exp $ */
 
 /**
 
@@ -1216,6 +1216,9 @@ ixgbe_txeof(struct tx_ring *txr)
 	work += txr->num_desc;
 	txr->next_to_clean = work;
 
+	if (txr->tx_avail == txr->num_desc)
+		txr->sending = false;
+
 	return ((limit > 0) ? false : true);
 } /* ixgbe_txeof */
 



CVS commit: src/sys/dev/pci/ixgbe

2018-05-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 16 08:08:24 UTC 2018

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
 Whitespace fix. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/pci/ixgbe/ix_txrx.c

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.43 src/sys/dev/pci/ixgbe/ix_txrx.c:1.44
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.43	Wed May 16 07:51:17 2018
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Wed May 16 08:08:24 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.43 2018/05/16 07:51:17 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.44 2018/05/16 08:08:24 msaitoh Exp $ */
 
 /**
 
@@ -169,6 +169,7 @@ ixgbe_legacy_start_locked(struct ifnet *
 		/* Send a copy of the frame to the BPF listener */
 		bpf_mtap(ifp, m_head);
 	}
+
 	if (enqueued) {
 		txr->lastsent = time_uptime;
 		txr->sending = true;
@@ -253,6 +254,8 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 		IXGBE_TX_UNLOCK(txr);
 	} else {
 		if (adapter->txrx_use_workqueue) {
+			u_int *enqueued;
+
 			/*
 			 * This function itself is not called in interrupt
 			 * context, however it can be called in fast softint
@@ -261,11 +264,12 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 			 * enqueuing when the machine uses both spontaneous
 			 * packets and forwarding packets.
 			 */
-			u_int *enqueued = percpu_getref(adapter->txr_wq_enqueued);
+			enqueued = percpu_getref(adapter->txr_wq_enqueued);
 			if (*enqueued == 0) {
 *enqueued = 1;
 percpu_putref(adapter->txr_wq_enqueued);
-workqueue_enqueue(adapter->txr_wq, >wq_cookie, curcpu());
+workqueue_enqueue(adapter->txr_wq,
+>wq_cookie, curcpu());
 			} else
 percpu_putref(adapter->txr_wq_enqueued);
 		} else
@@ -1960,46 +1964,46 @@ ixgbe_rxeof(struct ix_queue *que)
 			if (adapter->num_queues > 1) {
 sendmp->m_pkthdr.flowid =
 le32toh(cur->wb.lower.hi_dword.rss);
-switch (pkt_info & IXGBE_RXDADV_RSSTYPE_MASK) {	 
-case IXGBE_RXDADV_RSSTYPE_IPV4:
+switch (pkt_info & IXGBE_RXDADV_RSSTYPE_MASK) {
+case IXGBE_RXDADV_RSSTYPE_IPV4:
 	M_HASHTYPE_SET(sendmp,
 	M_HASHTYPE_RSS_IPV4);
 	break;
-case IXGBE_RXDADV_RSSTYPE_IPV4_TCP:
+case IXGBE_RXDADV_RSSTYPE_IPV4_TCP:
 	M_HASHTYPE_SET(sendmp,
 	M_HASHTYPE_RSS_TCP_IPV4);
 	break;
-case IXGBE_RXDADV_RSSTYPE_IPV6:
+case IXGBE_RXDADV_RSSTYPE_IPV6:
 	M_HASHTYPE_SET(sendmp,
 	M_HASHTYPE_RSS_IPV6);
 	break;
-case IXGBE_RXDADV_RSSTYPE_IPV6_TCP:
+case IXGBE_RXDADV_RSSTYPE_IPV6_TCP:
 	M_HASHTYPE_SET(sendmp,
 	M_HASHTYPE_RSS_TCP_IPV6);
 	break;
-case IXGBE_RXDADV_RSSTYPE_IPV6_EX:
+case IXGBE_RXDADV_RSSTYPE_IPV6_EX:
 	M_HASHTYPE_SET(sendmp,
 	M_HASHTYPE_RSS_IPV6_EX);
 	break;
-case IXGBE_RXDADV_RSSTYPE_IPV6_TCP_EX:
+case IXGBE_RXDADV_RSSTYPE_IPV6_TCP_EX:
 	M_HASHTYPE_SET(sendmp,
 	M_HASHTYPE_RSS_TCP_IPV6_EX);
 	break;
 #if __FreeBSD_version > 110
-case IXGBE_RXDADV_RSSTYPE_IPV4_UDP:
+case IXGBE_RXDADV_RSSTYPE_IPV4_UDP:
 	M_HASHTYPE_SET(sendmp,
 	M_HASHTYPE_RSS_UDP_IPV4);
 	break;
-case IXGBE_RXDADV_RSSTYPE_IPV6_UDP:
+case IXGBE_RXDADV_RSSTYPE_IPV6_UDP:
 	M_HASHTYPE_SET(sendmp,
 	M_HASHTYPE_RSS_UDP_IPV6);
 	break;
-case IXGBE_RXDADV_RSSTYPE_IPV6_UDP_EX:
+case IXGBE_RXDADV_RSSTYPE_IPV6_UDP_EX:
 	M_HASHTYPE_SET(sendmp,
 	M_HASHTYPE_RSS_UDP_IPV6_EX);
 	break;
 #endif
-default:
+default:
 	M_HASHTYPE_SET(sendmp,
 	M_HASHTYPE_OPAQUE_HASH);
 }
@@ -2124,7 +2128,8 @@ ixgbe_dma_malloc(struct adapter *adapter
 			   >dma_tag);
 	if (r != 0) {
 		aprint_error_dev(dev,
-		"%s: ixgbe_dma_tag_create failed; error %d\n", __func__, r);
+		"%s: ixgbe_dma_tag_create failed; error %d\n", __func__,
+		r);
 		goto fail_0;
 	}
 



CVS commit: src/sys/dev/pci/ixgbe

2018-05-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 16 08:08:24 UTC 2018

Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c

Log Message:
 Whitespace fix. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/pci/ixgbe/ix_txrx.c

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



CVS commit: src/external/gpl3/gdb/dist/gdb

2018-05-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May 16 13:54:48 UTC 2018

Modified Files:
src/external/gpl3/gdb/dist/gdb: dwarf2read.c

Log Message:
Annotate mixing of enums from different types with an explicit cast.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/gpl3/gdb/dist/gdb/dwarf2read.c

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



CVS commit: src/external/gpl3/gdb/dist/gdb

2018-05-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May 16 13:54:48 UTC 2018

Modified Files:
src/external/gpl3/gdb/dist/gdb: dwarf2read.c

Log Message:
Annotate mixing of enums from different types with an explicit cast.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/gpl3/gdb/dist/gdb/dwarf2read.c

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

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/dwarf2read.c
diff -u src/external/gpl3/gdb/dist/gdb/dwarf2read.c:1.1.1.7 src/external/gpl3/gdb/dist/gdb/dwarf2read.c:1.2
--- src/external/gpl3/gdb/dist/gdb/dwarf2read.c:1.1.1.7	Tue Nov 28 18:18:12 2017
+++ src/external/gpl3/gdb/dist/gdb/dwarf2read.c	Wed May 16 13:54:48 2018
@@ -22159,7 +22159,7 @@ dwarf_decode_macro_bytes (bfd *abfd,
 	  }
 	  break;
 
-case DW_MACINFO_vendor_ext:
+case (int)DW_MACINFO_vendor_ext:
 	  if (!section_is_gnu)
 	{
 	  unsigned int bytes_read;
@@ -22336,7 +22336,7 @@ dwarf_decode_macros (struct dwarf2_cu *c
 	  mac_ptr += offset_size;
 	  break;
 
-	case DW_MACINFO_vendor_ext:
+	case (int)DW_MACINFO_vendor_ext:
 	  /* Only skip the data by MAC_PTR.  */
 	  if (!section_is_gnu)
 	{



CVS commit: src/lib/libpam/modules/pam_unix

2018-05-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May 16 13:55:39 UTC 2018

Modified Files:
src/lib/libpam/modules/pam_unix: pam_unix.c

Log Message:
Improve type safety by using the correct enum values.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libpam/modules/pam_unix/pam_unix.c

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



CVS commit: src/external/gpl2/groff/dist/src/preproc/grn

2018-05-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May 16 13:53:29 UTC 2018

Modified Files:
src/external/gpl2/groff/dist/src/preproc/grn: hdb.cpp hgraph.cpp
hpoint.cpp main.cpp

Log Message:
Remove obsolete register keywords from C++ code.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl2/groff/dist/src/preproc/grn/hdb.cpp \
src/external/gpl2/groff/dist/src/preproc/grn/hgraph.cpp \
src/external/gpl2/groff/dist/src/preproc/grn/hpoint.cpp \
src/external/gpl2/groff/dist/src/preproc/grn/main.cpp

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



CVS commit: src/external/bsd/openpam/dist/lib/libpam

2018-05-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May 16 13:54:03 UTC 2018

Modified Files:
src/external/bsd/openpam/dist/lib/libpam: openpam_configure.c

Log Message:
Cast enum explicitly to different type.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/openpam/dist/lib/libpam/openpam_configure.c

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

Modified files:

Index: src/external/bsd/openpam/dist/lib/libpam/openpam_configure.c
diff -u src/external/bsd/openpam/dist/lib/libpam/openpam_configure.c:1.3 src/external/bsd/openpam/dist/lib/libpam/openpam_configure.c:1.4
--- src/external/bsd/openpam/dist/lib/libpam/openpam_configure.c:1.3	Sat May  6 19:50:09 2017
+++ src/external/bsd/openpam/dist/lib/libpam/openpam_configure.c	Wed May 16 13:54:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: openpam_configure.c,v 1.3 2017/05/06 19:50:09 christos Exp $	*/
+/*	$NetBSD: openpam_configure.c,v 1.4 2018/05/16 13:54:03 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2001-2003 Networks Associates Technology, Inc.
@@ -42,7 +42,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: openpam_configure.c,v 1.3 2017/05/06 19:50:09 christos Exp $");
+__RCSID("$NetBSD: openpam_configure.c,v 1.4 2018/05/16 13:54:03 joerg Exp $");
 
 #include 
 
@@ -262,7 +262,7 @@ openpam_parse_chain(pam_handle_t *pamh,
 		/* allocate new entry */
 		if ((this = calloc((size_t)1, sizeof *this)) == NULL)
 			goto syserr;
-		this->flag = ctlf;
+		this->flag = (int)ctlf;
 
 		/* load module */
 		if ((this->module = openpam_load_module(modulename)) == NULL) {



CVS commit: src/external/gpl2/groff/dist/src/preproc/grn

2018-05-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May 16 13:53:29 UTC 2018

Modified Files:
src/external/gpl2/groff/dist/src/preproc/grn: hdb.cpp hgraph.cpp
hpoint.cpp main.cpp

Log Message:
Remove obsolete register keywords from C++ code.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl2/groff/dist/src/preproc/grn/hdb.cpp \
src/external/gpl2/groff/dist/src/preproc/grn/hgraph.cpp \
src/external/gpl2/groff/dist/src/preproc/grn/hpoint.cpp \
src/external/gpl2/groff/dist/src/preproc/grn/main.cpp

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

Modified files:

Index: src/external/gpl2/groff/dist/src/preproc/grn/hdb.cpp
diff -u src/external/gpl2/groff/dist/src/preproc/grn/hdb.cpp:1.1.1.1 src/external/gpl2/groff/dist/src/preproc/grn/hdb.cpp:1.2
--- src/external/gpl2/groff/dist/src/preproc/grn/hdb.cpp:1.1.1.1	Wed Jan 13 18:41:49 2016
+++ src/external/gpl2/groff/dist/src/preproc/grn/hdb.cpp	Wed May 16 13:53:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: hdb.cpp,v 1.1.1.1 2016/01/13 18:41:49 christos Exp $	*/
+/*	$NetBSD: hdb.cpp,v 1.2 2018/05/16 13:53:28 joerg Exp $	*/
 
  /* Last non-groff version: hdb.c  1.8 (Berkeley) 84/10/20
  *
@@ -33,7 +33,7 @@ extern POINT *PTInit();
 extern POINT *PTMakePoint(double x, double y, POINT ** pplist);
 
 
-int DBGetType(register char *s);
+int DBGetType(char *s);
 
 
 /*
@@ -59,7 +59,7 @@ DBCreateElt(int type,
 	char *text,
 	ELT **db)
 {
-  register ELT *temp;
+  ELT *temp;
 
   temp = (ELT *) malloc(sizeof(ELT));
   temp->nextelt = *db;
@@ -78,11 +78,11 @@ DBCreateElt(int type,
  * pointer to that database.
  */
 ELT *
-DBRead(register FILE *file)
+DBRead(FILE *file)
 {
-  register int i;
-  register int done;		/* flag for input exhausted */
-  register double nx;		/* x holder so x is not set before orienting */
+  int i;
+  int done;			/* flag for input exhausted */
+  double nx;			/* x holder so x is not set before orienting */
   int type;			/* element type */
   ELT *elist;			/* pointer to the file's elements */
   POINT *plist;			/* pointer for reading in points */
@@ -207,7 +207,7 @@ DBRead(register FILE *file)
  * New file format has literal names for element types.
  */
 int
-DBGetType(register char *s)
+DBGetType(char *s)
 {
   if (isdigit(s[0]) || (s[0] == '-'))	/* old element format or EOF */
 return (atoi(s));
@@ -293,7 +293,7 @@ xscanf(FILE *f,
double *xp,
double *yp)
 {
-  register int c, i, j, m, frac;
+  int c, i, j, m, frac;
   int iscale = 1, jscale = 1;	/* x = i/scale, y=j/jscale */
 
   while ((c = getc(f)) == ' ');
Index: src/external/gpl2/groff/dist/src/preproc/grn/hgraph.cpp
diff -u src/external/gpl2/groff/dist/src/preproc/grn/hgraph.cpp:1.1.1.1 src/external/gpl2/groff/dist/src/preproc/grn/hgraph.cpp:1.2
--- src/external/gpl2/groff/dist/src/preproc/grn/hgraph.cpp:1.1.1.1	Wed Jan 13 18:41:49 2016
+++ src/external/gpl2/groff/dist/src/preproc/grn/hgraph.cpp	Wed May 16 13:53:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: hgraph.cpp,v 1.1.1.1 2016/01/13 18:41:49 christos Exp $	*/
+/*	$NetBSD: hgraph.cpp,v 1.2 2018/05/16 13:53:28 joerg Exp $	*/
 
 /* Last non-groff version: hgraph.c  1.14 (Berkeley) 84/11/27
  *
@@ -50,7 +50,7 @@ extern double adj4;
 extern int res;
 
 void HGSetFont(int font, int size);
-void HGPutText(int justify, POINT pnt, register char *string);
+void HGPutText(int justify, POINT pnt, char *string);
 void HGSetBrush(int mode);
 void tmove2(int px, int py);
 void doarc(POINT cp, POINT sp, int angle);
@@ -60,8 +60,8 @@ void drawwig(POINT * ptr, int type);
 void HGtline(int x1, int y1);
 void deltax(double x);
 void deltay(double y);
-void HGArc(register int cx, register int cy, int px, int py, int angle);
-void picurve(register int *x, register int *y, int npts);
+void HGArc(int cx, int cy, int px, int py, int angle);
+void picurve(int *x, int *y, int npts);
 void HGCurve(int *x, int *y, int numpoints);
 void Paramaterize(int x[], int y[], double h[], int n);
 void PeriodicSpline(double h[], int z[],
@@ -85,10 +85,10 @@ void
 HGPrintElt(ELT *element,
 	   int /* baseline */)
 {
-  register POINT *p1;
-  register POINT *p2;
-  register int length;
-  register int graylevel;
+  POINT *p1;
+  POINT *p2;
+  int length;
+  int graylevel;
 
   if (!DBNullelt(element) && !Nullpoint((p1 = element->ptlist))) {
 /* p1 always has first point */
@@ -280,7 +280,7 @@ HGPrintElt(ELT *element,
 void
 HGPutText(int justify,
 	  POINT pnt,
-	  register char *string)
+	  char *string)
 {
   int savelasty = lasty;	/* vertical motion for text is to be */
 /* ignored.  Save current y here */
@@ -389,7 +389,7 @@ HGSetFont(int font,
 void
 HGSetBrush(int mode)
 {
-  register int printed = 0;
+  int printed = 0;
 
   if (linmod != style[--mode]) {
 /* Groff doesn't understand \Ds, so we take it out */
@@ -419,7 +419,7 @@ HGSetBrush(int mode)
 void
 deltax(double x)
 {
-  register int ix = 

CVS commit: src/external/bsd/openpam/dist/lib/libpam

2018-05-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May 16 13:54:03 UTC 2018

Modified Files:
src/external/bsd/openpam/dist/lib/libpam: openpam_configure.c

Log Message:
Cast enum explicitly to different type.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/openpam/dist/lib/libpam/openpam_configure.c

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



CVS commit: src/lib/libpam/modules/pam_unix

2018-05-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May 16 13:55:39 UTC 2018

Modified Files:
src/lib/libpam/modules/pam_unix: pam_unix.c

Log Message:
Improve type safety by using the correct enum values.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libpam/modules/pam_unix/pam_unix.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/libpam/modules/pam_unix/pam_unix.c
diff -u src/lib/libpam/modules/pam_unix/pam_unix.c:1.16 src/lib/libpam/modules/pam_unix/pam_unix.c:1.17
--- src/lib/libpam/modules/pam_unix/pam_unix.c:1.16	Sun Dec 29 22:54:58 2013
+++ src/lib/libpam/modules/pam_unix/pam_unix.c	Wed May 16 13:55:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pam_unix.c,v 1.16 2013/12/29 22:54:58 christos Exp $	*/
+/*	$NetBSD: pam_unix.c,v 1.17 2018/05/16 13:55:39 joerg Exp $	*/
 
 /*-
  * Copyright 1998 Juniper Networks, Inc.
@@ -40,7 +40,7 @@
 #ifdef __FreeBSD__
 __FBSDID("$FreeBSD: src/lib/libpam/modules/pam_unix/pam_unix.c,v 1.49 2004/02/10 10:13:21 des Exp $");
 #else
-__RCSID("$NetBSD: pam_unix.c,v 1.16 2013/12/29 22:54:58 christos Exp $");
+__RCSID("$NetBSD: pam_unix.c,v 1.17 2018/05/16 13:55:39 joerg Exp $");
 #endif
 
 
@@ -248,6 +248,7 @@ yp_set_password(pam_handle_t *pamh, stru
 {
 	char *master;
 	int r, rpcport, status;
+	enum clnt_stat r2;
 	struct yppasswd yppwd;
 	CLIENT *client;
 	uid_t uid;
@@ -318,9 +319,9 @@ yp_set_password(pam_handle_t *pamh, stru
 	client->cl_auth = authunix_create_default();
 	tv.tv_sec = 2;
 	tv.tv_usec = 0;
-	r = clnt_call(client, YPPASSWDPROC_UPDATE,
+	r2 = clnt_call(client, YPPASSWDPROC_UPDATE,
 	xdr_yppasswd, , xdr_int, , tv);
-	if (r)
+	if (r2 != RPC_SUCCESS)
 		pam_error(pamh, "RPC to yppasswdd failed.");
 	else if (status)
 		pam_error(pamh, "Couldn't change NIS password.");



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

2018-05-16 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed May 16 12:40:43 UTC 2018

Modified Files:
src/sys/arch/usermode/include: asm.h bswap.h byte_swap.h cdefs.h
disklabel.h elf_machdep.h endian.h endian_machdep.h int_const.h
int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h limits.h
mcontext.h netbsd32_machdep.h param.h ptrace.h wchar_limits.h
Added Files:
src/sys/arch/usermode/include: frame_regs.h

Log Message:
Regen usermode headers


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/usermode/include/asm.h \
src/sys/arch/usermode/include/bswap.h \
src/sys/arch/usermode/include/byte_swap.h \
src/sys/arch/usermode/include/elf_machdep.h \
src/sys/arch/usermode/include/endian.h \
src/sys/arch/usermode/include/endian_machdep.h \
src/sys/arch/usermode/include/int_const.h \
src/sys/arch/usermode/include/int_fmtio.h \
src/sys/arch/usermode/include/int_limits.h \
src/sys/arch/usermode/include/int_mwgwtypes.h \
src/sys/arch/usermode/include/int_types.h \
src/sys/arch/usermode/include/limits.h \
src/sys/arch/usermode/include/netbsd32_machdep.h \
src/sys/arch/usermode/include/wchar_limits.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/usermode/include/cdefs.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/usermode/include/disklabel.h \
src/sys/arch/usermode/include/ptrace.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/usermode/include/frame_regs.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/usermode/include/mcontext.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/usermode/include/param.h

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



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

2018-05-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed May 16 10:23:43 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sun50i_a64_acodec.c

Log Message:
Add mic preamp controls and unswap L/R DAC channels to ADC mixer


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/sunxi/sun50i_a64_acodec.c

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



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

2018-05-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed May 16 10:23:43 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sun50i_a64_acodec.c

Log Message:
Add mic preamp controls and unswap L/R DAC channels to ADC mixer


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/sunxi/sun50i_a64_acodec.c

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

Modified files:

Index: src/sys/arch/arm/sunxi/sun50i_a64_acodec.c
diff -u src/sys/arch/arm/sunxi/sun50i_a64_acodec.c:1.7 src/sys/arch/arm/sunxi/sun50i_a64_acodec.c:1.8
--- src/sys/arch/arm/sunxi/sun50i_a64_acodec.c:1.7	Wed May 16 00:12:57 2018
+++ src/sys/arch/arm/sunxi/sun50i_a64_acodec.c	Wed May 16 10:23:43 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sun50i_a64_acodec.c,v 1.7 2018/05/16 00:12:57 jmcneill Exp $ */
+/* $NetBSD: sun50i_a64_acodec.c,v 1.8 2018/05/16 10:23:43 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sun50i_a64_acodec.c,v 1.7 2018/05/16 00:12:57 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sun50i_a64_acodec.c,v 1.8 2018/05/16 10:23:43 jmcneill Exp $");
 
 #include 
 #include 
@@ -85,7 +85,7 @@ __KERNEL_RCSID(0, "$NetBSD: sun50i_a64_a
 #define	 A64_ADCMIX_SRC_MIC1	__BIT(6)
 #define	 A64_ADCMIX_SRC_MIC2	__BIT(5)
 #define	 A64_ADCMIX_SRC_LINEIN	__BIT(2)
-#define	 A64_ADCMIX_SRC_OMIXER	__BIT(0)
+#define	 A64_ADCMIX_SRC_OMIXER	__BIT(1)
 #define	A64_ADC_CTRL		0x0d
 #define	 A64_ADCREN		__BIT(7)
 #define	 A64_ADCLEN		__BIT(6)
@@ -117,7 +117,9 @@ enum a64_acodec_mixer_ctrl {
 	A64_CODEC_INPUT_HP_VOLUME,
 	A64_CODEC_RECORD_LINE_VOLUME,
 	A64_CODEC_RECORD_MIC1_VOLUME,
+	A64_CODEC_RECORD_MIC1_PREAMP,
 	A64_CODEC_RECORD_MIC2_VOLUME,
+	A64_CODEC_RECORD_MIC2_PREAMP,
 	A64_CODEC_RECORD_AGC_VOLUME,
 	A64_CODEC_RECORD_SOURCE,
 
@@ -299,6 +301,26 @@ a64_acodec_set_port(void *priv, mixer_ct
 		a64_acodec_pr_write(sc, mix->reg, val);
 		return 0;
 
+	case A64_CODEC_RECORD_MIC1_PREAMP:
+		if (mc->un.ord < 0 || mc->un.ord > 1)
+			return EINVAL;
+		if (mc->un.ord) {
+			a64_acodec_pr_set_clear(sc, A64_MIC1_CTRL, A64_MIC1AMPEN, 0);
+		} else {
+			a64_acodec_pr_set_clear(sc, A64_MIC1_CTRL, 0, A64_MIC1AMPEN);
+		}
+		return 0;
+			
+	case A64_CODEC_RECORD_MIC2_PREAMP:
+		if (mc->un.ord < 0 || mc->un.ord > 1)
+			return EINVAL;
+		if (mc->un.ord) {
+			a64_acodec_pr_set_clear(sc, A64_MIC2_CTRL, A64_MIC2AMPEN, 0);
+		} else {
+			a64_acodec_pr_set_clear(sc, A64_MIC2_CTRL, 0, A64_MIC2AMPEN);
+		}
+		return 0;
+
 	case A64_CODEC_OUTPUT_MUTE:
 		if (mc->un.ord < 0 || mc->un.ord > 1)
 			return EINVAL;
@@ -367,6 +389,14 @@ a64_acodec_get_port(void *priv, mixer_ct
 		mc->un.value.level[AUDIO_MIXER_LEVEL_RIGHT] = nvol;
 		return 0;
 
+	case A64_CODEC_RECORD_MIC1_PREAMP:
+		mc->un.ord = !!(a64_acodec_pr_read(sc, A64_MIC1_CTRL) & A64_MIC1AMPEN);
+		return 0;
+			
+	case A64_CODEC_RECORD_MIC2_PREAMP:
+		mc->un.ord = !!(a64_acodec_pr_read(sc, A64_MIC2_CTRL) & A64_MIC2AMPEN);
+		return 0;
+
 	case A64_CODEC_OUTPUT_MUTE:
 		mc->un.ord = 1;
 		if (a64_acodec_pr_read(sc, A64_OL_MIX_CTRL) & A64_LMIXMUTE_LDAC)
@@ -445,11 +475,34 @@ a64_acodec_query_devinfo(void *priv, mix
 		di->un.v.delta =
 		256 / (__SHIFTOUT_MASK(mix->mask) + 1);
 		di->type = AUDIO_MIXER_VALUE;
-		di->next = di->prev = AUDIO_MIXER_LAST;
+		di->prev = AUDIO_MIXER_LAST;
+		if (di->index == A64_CODEC_RECORD_MIC1_VOLUME)
+			di->next = A64_CODEC_RECORD_MIC1_PREAMP;
+		else if (di->index == A64_CODEC_RECORD_MIC2_VOLUME)
+			di->next = A64_CODEC_RECORD_MIC2_PREAMP;
+		else
+			di->next = AUDIO_MIXER_LAST;
 		di->un.v.num_channels = 2;
 		strcpy(di->un.v.units.name, AudioNvolume);
 		return 0;
 
+	case A64_CODEC_RECORD_MIC1_PREAMP:
+	case A64_CODEC_RECORD_MIC2_PREAMP:
+		di->mixer_class = A64_CODEC_RECORD_CLASS;
+		strcpy(di->label.name, AudioNpreamp);
+		di->type = AUDIO_MIXER_ENUM;
+		if (di->index == A64_CODEC_RECORD_MIC1_PREAMP)
+			di->prev = A64_CODEC_RECORD_MIC1_VOLUME;
+		else
+			di->prev = A64_CODEC_RECORD_MIC2_VOLUME;
+		di->next = AUDIO_MIXER_LAST;
+		di->un.e.num_mem = 2;
+		strcpy(di->un.e.member[0].label.name, AudioNoff);
+		di->un.e.member[0].ord = 0;
+		strcpy(di->un.e.member[1].label.name, AudioNon);
+		di->un.e.member[1].ord = 1;
+		return 0;
+
 	case A64_CODEC_OUTPUT_MUTE:
 		di->mixer_class = A64_CODEC_OUTPUT_CLASS;
 		strcpy(di->label.name, AudioNmute);



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

2018-05-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed May 16 10:22:54 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sun8i_codec.c

Log Message:
Delete whitespace, NFC


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/sunxi/sun8i_codec.c

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

Modified files:

Index: src/sys/arch/arm/sunxi/sun8i_codec.c
diff -u src/sys/arch/arm/sunxi/sun8i_codec.c:1.4 src/sys/arch/arm/sunxi/sun8i_codec.c:1.5
--- src/sys/arch/arm/sunxi/sun8i_codec.c:1.4	Sat May 12 23:51:06 2018
+++ src/sys/arch/arm/sunxi/sun8i_codec.c	Wed May 16 10:22:54 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sun8i_codec.c,v 1.4 2018/05/12 23:51:06 jmcneill Exp $ */
+/* $NetBSD: sun8i_codec.c,v 1.5 2018/05/16 10:22:54 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sun8i_codec.c,v 1.4 2018/05/12 23:51:06 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sun8i_codec.c,v 1.5 2018/05/16 10:22:54 jmcneill Exp $");
 
 #include 
 #include 
@@ -427,7 +427,7 @@ sun8i_codec_attach(device_t parent, devi
 
 	/* Enable digital parts */
 	WR4(sc, DAC_DIG_CTRL, DAC_DIG_CTRL_ENDA);
-	WR4(sc, ADC_DIG_CTRL, ADC_DIG_CTRL_ENAD);	
+	WR4(sc, ADC_DIG_CTRL, ADC_DIG_CTRL_ENAD);
 
 	/* Set AIF1 to 48 kHz */
 	val = RD4(sc, SYS_SR_CTRL);



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

2018-05-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed May 16 10:22:54 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sun8i_codec.c

Log Message:
Delete whitespace, NFC


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/sunxi/sun8i_codec.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/usermode/include

2018-05-16 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed May 16 12:40:43 UTC 2018

Modified Files:
src/sys/arch/usermode/include: asm.h bswap.h byte_swap.h cdefs.h
disklabel.h elf_machdep.h endian.h endian_machdep.h int_const.h
int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h limits.h
mcontext.h netbsd32_machdep.h param.h ptrace.h wchar_limits.h
Added Files:
src/sys/arch/usermode/include: frame_regs.h

Log Message:
Regen usermode headers


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/usermode/include/asm.h \
src/sys/arch/usermode/include/bswap.h \
src/sys/arch/usermode/include/byte_swap.h \
src/sys/arch/usermode/include/elf_machdep.h \
src/sys/arch/usermode/include/endian.h \
src/sys/arch/usermode/include/endian_machdep.h \
src/sys/arch/usermode/include/int_const.h \
src/sys/arch/usermode/include/int_fmtio.h \
src/sys/arch/usermode/include/int_limits.h \
src/sys/arch/usermode/include/int_mwgwtypes.h \
src/sys/arch/usermode/include/int_types.h \
src/sys/arch/usermode/include/limits.h \
src/sys/arch/usermode/include/netbsd32_machdep.h \
src/sys/arch/usermode/include/wchar_limits.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/usermode/include/cdefs.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/usermode/include/disklabel.h \
src/sys/arch/usermode/include/ptrace.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/usermode/include/frame_regs.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/usermode/include/mcontext.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/usermode/include/param.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/usermode/include/asm.h
diff -u src/sys/arch/usermode/include/asm.h:1.11 src/sys/arch/usermode/include/asm.h:1.12
--- src/sys/arch/usermode/include/asm.h:1.11	Sun Nov 10 19:52:01 2013
+++ src/sys/arch/usermode/include/asm.h	Wed May 16 12:40:43 2018
@@ -1,7 +1,7 @@
-/* $NetBSD: asm.h,v 1.11 2013/11/10 19:52:01 jmcneill Exp $ */
+/* $NetBSD: asm.h,v 1.12 2018/05/16 12:40:43 reinoud Exp $ */
 
 /*
- * Automatically generated by genheaders.sh on Sun Nov 10 15:47:57 AST 2013
+ * Automatically generated by ./genheaders.sh on Wed May 16 14:39:02 CEST 2018
  * Do not modify directly!
  */
 #ifndef _USERMODE_ASM_H
Index: src/sys/arch/usermode/include/bswap.h
diff -u src/sys/arch/usermode/include/bswap.h:1.11 src/sys/arch/usermode/include/bswap.h:1.12
--- src/sys/arch/usermode/include/bswap.h:1.11	Sun Nov 10 19:52:01 2013
+++ src/sys/arch/usermode/include/bswap.h	Wed May 16 12:40:43 2018
@@ -1,7 +1,7 @@
-/* $NetBSD: bswap.h,v 1.11 2013/11/10 19:52:01 jmcneill Exp $ */
+/* $NetBSD: bswap.h,v 1.12 2018/05/16 12:40:43 reinoud Exp $ */
 
 /*
- * Automatically generated by genheaders.sh on Sun Nov 10 15:47:57 AST 2013
+ * Automatically generated by ./genheaders.sh on Wed May 16 14:39:02 CEST 2018
  * Do not modify directly!
  */
 #ifndef _USERMODE_BSWAP_H
Index: src/sys/arch/usermode/include/byte_swap.h
diff -u src/sys/arch/usermode/include/byte_swap.h:1.11 src/sys/arch/usermode/include/byte_swap.h:1.12
--- src/sys/arch/usermode/include/byte_swap.h:1.11	Sun Nov 10 19:52:01 2013
+++ src/sys/arch/usermode/include/byte_swap.h	Wed May 16 12:40:43 2018
@@ -1,7 +1,7 @@
-/* $NetBSD: byte_swap.h,v 1.11 2013/11/10 19:52:01 jmcneill Exp $ */
+/* $NetBSD: byte_swap.h,v 1.12 2018/05/16 12:40:43 reinoud Exp $ */
 
 /*
- * Automatically generated by genheaders.sh on Sun Nov 10 15:47:57 AST 2013
+ * Automatically generated by ./genheaders.sh on Wed May 16 14:39:02 CEST 2018
  * Do not modify directly!
  */
 #ifndef _USERMODE_BYTE_SWAP_H
Index: src/sys/arch/usermode/include/elf_machdep.h
diff -u src/sys/arch/usermode/include/elf_machdep.h:1.11 src/sys/arch/usermode/include/elf_machdep.h:1.12
--- src/sys/arch/usermode/include/elf_machdep.h:1.11	Sun Nov 10 19:52:01 2013
+++ src/sys/arch/usermode/include/elf_machdep.h	Wed May 16 12:40:43 2018
@@ -1,7 +1,7 @@
-/* $NetBSD: elf_machdep.h,v 1.11 2013/11/10 19:52:01 jmcneill Exp $ */
+/* $NetBSD: elf_machdep.h,v 1.12 2018/05/16 12:40:43 reinoud Exp $ */
 
 /*
- * Automatically generated by genheaders.sh on Sun Nov 10 15:47:57 AST 2013
+ * Automatically generated by ./genheaders.sh on Wed May 16 14:39:02 CEST 2018
  * Do not modify directly!
  */
 #ifndef _USERMODE_ELF_MACHDEP_H
Index: src/sys/arch/usermode/include/endian.h
diff -u src/sys/arch/usermode/include/endian.h:1.11 src/sys/arch/usermode/include/endian.h:1.12
--- src/sys/arch/usermode/include/endian.h:1.11	Sun Nov 10 19:52:01 2013
+++ src/sys/arch/usermode/include/endian.h	Wed May 16 12:40:43 2018
@@ -1,7 +1,7 @@
-/* $NetBSD: endian.h,v 1.11 2013/11/10 19:52:01 jmcneill Exp $ */
+/* $NetBSD: endian.h,v 1.12 2018/05/16 12:40:43 reinoud Exp $ */
 
 /*
- * Automatically generated by genheaders.sh on Sun Nov 10 15:47:57 AST 2013
+ * Automatically generated by ./genheaders.sh on Wed May 16 14:39:02 CEST 2018
  

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

2018-05-16 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed May 16 12:40:26 UTC 2018

Modified Files:
src/sys/arch/usermode/include: genheaders.sh

Log Message:
Add new mcontext and depends to the usermode generated headerfiles


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/usermode/include/genheaders.sh

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



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

2018-05-16 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed May 16 12:40:26 UTC 2018

Modified Files:
src/sys/arch/usermode/include: genheaders.sh

Log Message:
Add new mcontext and depends to the usermode generated headerfiles


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/usermode/include/genheaders.sh

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/usermode/include/genheaders.sh
diff -u src/sys/arch/usermode/include/genheaders.sh:1.9 src/sys/arch/usermode/include/genheaders.sh:1.10
--- src/sys/arch/usermode/include/genheaders.sh:1.9	Sun Nov 10 19:52:01 2013
+++ src/sys/arch/usermode/include/genheaders.sh	Wed May 16 12:40:26 2018
@@ -21,6 +21,8 @@ HDRS="$HDRS param.h"
 HDRS="$HDRS ptrace.h"
 HDRS="$HDRS wchar_limits.h"
 HDRS="$HDRS cdefs.h"
+HDRS="$HDRS mcontext.h"
+HDRS="$HDRS frame_regs.h"
 
 for hdr in ${HDRS}; do
 	G="_USERMODE_$(echo ${hdr} | sed 's/\./_/g' | tr [a-z] [A-Z])"



CVS commit: src/sys/arch/i386/i386

2018-05-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 16 16:33:23 UTC 2018

Modified Files:
src/sys/arch/i386/i386: trap.c

Log Message:
Fix compilation on Xen.


To generate a diff of this commit:
cvs rdiff -u -r1.294 -r1.295 src/sys/arch/i386/i386/trap.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/i386/i386/trap.c
diff -u src/sys/arch/i386/i386/trap.c:1.294 src/sys/arch/i386/i386/trap.c:1.295
--- src/sys/arch/i386/i386/trap.c:1.294	Wed May 16 08:16:36 2018
+++ src/sys/arch/i386/i386/trap.c	Wed May 16 16:33:23 2018
@@ -1,5 +1,5 @@
 
-/*	$NetBSD: trap.c,v 1.294 2018/05/16 08:16:36 maxv Exp $	*/
+/*	$NetBSD: trap.c,v 1.295 2018/05/16 16:33:23 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.294 2018/05/16 08:16:36 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.295 2018/05/16 16:33:23 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -128,7 +128,9 @@ dtrace_doubletrap_func_t	dtrace_doubletr
 void trap(struct trapframe *);
 void trap_tss(struct i386tss *, int, int);
 void trap_return_fault_return(struct trapframe *) __dead;
+#ifndef XEN
 int ss_shadow(struct trapframe *tf);
+#endif
 
 const char * const trap_type[] = {
 	"privileged instruction fault",		/*  0 T_PRIVINFLT */
@@ -237,6 +239,7 @@ trap_print(const struct trapframe *frame
 	l, l->l_proc->p_pid, l->l_lid, KSTACK_LOWEST_ADDR(l));
 }
 
+#ifndef XEN
 int
 ss_shadow(struct trapframe *tf)
 {
@@ -255,6 +258,7 @@ ss_shadow(struct trapframe *tf)
 
 	return 0;
 }
+#endif
 
 /*
  * trap(frame): exception, fault, and trap interface to BSD kernel.



CVS commit: src/sys/arch/i386/i386

2018-05-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 16 16:33:23 UTC 2018

Modified Files:
src/sys/arch/i386/i386: trap.c

Log Message:
Fix compilation on Xen.


To generate a diff of this commit:
cvs rdiff -u -r1.294 -r1.295 src/sys/arch/i386/i386/trap.c

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



CVS commit: src/sys/dev/pci

2018-05-16 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Wed May 16 19:02:00 UTC 2018

Modified Files:
src/sys/dev/pci: pci_map.c

Log Message:
Enable the appropriate memory or I/O space decode in the PCI
Command/Status Register upon mapping a BAR.

This should fix PR #53286.  It's also possible there are other similar
PRs that might be fixed by this.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pci/pci_map.c

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

Modified files:

Index: src/sys/dev/pci/pci_map.c
diff -u src/sys/dev/pci/pci_map.c:1.33 src/sys/dev/pci/pci_map.c:1.34
--- src/sys/dev/pci/pci_map.c:1.33	Fri Mar 17 11:21:45 2017
+++ src/sys/dev/pci/pci_map.c	Wed May 16 19:02:00 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_map.c,v 1.33 2017/03/17 11:21:45 msaitoh Exp $	*/
+/*	$NetBSD: pci_map.c,v 1.34 2018/05/16 19:02:00 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_map.c,v 1.33 2017/03/17 11:21:45 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_map.c,v 1.34 2018/05/16 19:02:00 jakllsch Exp $");
 
 #include 
 #include 
@@ -287,11 +287,17 @@ pci_mapreg_submap(const struct pci_attac
 	bus_space_handle_t handle;
 	bus_addr_t base;
 	bus_size_t realmaxsize;
-	int flags;
+	pcireg_t csr;
+	int flags, s;
 
 	if (PCI_MAPREG_TYPE(type) == PCI_MAPREG_TYPE_IO) {
 		if ((pa->pa_flags & PCI_FLAGS_IO_OKAY) == 0)
 			return 1;
+		s = splhigh();
+		csr = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
+		csr |= PCI_COMMAND_IO_ENABLE;
+		pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, csr);
+		splx(s);
 		if (pci_io_find(pa->pa_pc, pa->pa_tag, reg, type, ,
 		, ))
 			return 1;
@@ -299,6 +305,11 @@ pci_mapreg_submap(const struct pci_attac
 	} else {
 		if ((pa->pa_flags & PCI_FLAGS_MEM_OKAY) == 0)
 			return 1;
+		s = splhigh();
+		csr = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
+		csr |= PCI_COMMAND_MEM_ENABLE;
+		pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, csr);
+		splx(s);
 		if (pci_mem_find(pa->pa_pc, pa->pa_tag, reg, type, ,
 		, ))
 			return 1;
@@ -307,7 +318,6 @@ pci_mapreg_submap(const struct pci_attac
 
 	if (reg == PCI_MAPREG_ROM) {
 		pcireg_t 	mask;
-		int		s;
 		/* we have to enable the ROM address decoder... */
 		s = splhigh();
 		mask = pci_conf_read(pa->pa_pc, pa->pa_tag, reg);



CVS commit: src/sys/dev/pci

2018-05-16 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Wed May 16 19:02:00 UTC 2018

Modified Files:
src/sys/dev/pci: pci_map.c

Log Message:
Enable the appropriate memory or I/O space decode in the PCI
Command/Status Register upon mapping a BAR.

This should fix PR #53286.  It's also possible there are other similar
PRs that might be fixed by this.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pci/pci_map.c

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



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

2018-05-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed May 16 10:15:20 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sunxi_i2s.c

Log Message:
Set AUDIO_PROP_INDEPENDENT.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sunxi_i2s.c

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

Modified files:

Index: src/sys/arch/arm/sunxi/sunxi_i2s.c
diff -u src/sys/arch/arm/sunxi/sunxi_i2s.c:1.1 src/sys/arch/arm/sunxi/sunxi_i2s.c:1.2
--- src/sys/arch/arm/sunxi/sunxi_i2s.c:1.1	Thu May 10 00:00:21 2018
+++ src/sys/arch/arm/sunxi/sunxi_i2s.c	Wed May 16 10:15:20 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_i2s.c,v 1.1 2018/05/10 00:00:21 jmcneill Exp $ */
+/* $NetBSD: sunxi_i2s.c,v 1.2 2018/05/16 10:15:20 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_i2s.c,v 1.1 2018/05/10 00:00:21 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_i2s.c,v 1.2 2018/05/16 10:15:20 jmcneill Exp $");
 
 #include 
 #include 
@@ -336,7 +336,7 @@ static int
 sunxi_i2s_get_props(void *priv)
 {
 	return AUDIO_PROP_PLAYBACK|AUDIO_PROP_CAPTURE|
-	AUDIO_PROP_MMAP|AUDIO_PROP_FULLDUPLEX;
+	AUDIO_PROP_MMAP|AUDIO_PROP_FULLDUPLEX|AUDIO_PROP_INDEPENDENT;
 }
 
 static int



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

2018-05-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed May 16 10:15:20 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sunxi_i2s.c

Log Message:
Set AUDIO_PROP_INDEPENDENT.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sunxi_i2s.c

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



CVS commit: src

2018-05-16 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu May 17 02:34:32 UTC 2018

Modified Files:
src/sbin/mount_nfs: mount_nfs.8 mount_nfs.c
src/sys/nfs: files.nfs nfs_boot.c

Log Message:
Default NFS mounts to using TCP transport instead of UDP.
PR kern/53166


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sbin/mount_nfs/mount_nfs.8
cvs rdiff -u -r1.71 -r1.72 src/sbin/mount_nfs/mount_nfs.c
cvs rdiff -u -r1.14 -r1.15 src/sys/nfs/files.nfs
cvs rdiff -u -r1.87 -r1.88 src/sys/nfs/nfs_boot.c

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

Modified files:

Index: src/sbin/mount_nfs/mount_nfs.8
diff -u src/sbin/mount_nfs/mount_nfs.8:1.46 src/sbin/mount_nfs/mount_nfs.8:1.47
--- src/sbin/mount_nfs/mount_nfs.8:1.46	Mon Jul  3 21:33:41 2017
+++ src/sbin/mount_nfs/mount_nfs.8	Thu May 17 02:34:31 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mount_nfs.8,v 1.46 2017/07/03 21:33:41 wiz Exp $
+.\"	$NetBSD: mount_nfs.8,v 1.47 2018/05/17 02:34:31 thorpej Exp $
 .\"
 .\" Copyright (c) 1992, 1993, 1994, 1995
 .\"	The Regents of the University of California.  All rights reserved.
@@ -37,7 +37,7 @@
 .Nd mount NFS file systems
 .Sh SYNOPSIS
 .Nm
-.Op Fl 23bCcdilPpqsTUX
+.Op Fl 23bCcdilPpqsTUuX
 .Op Fl a Ar maxreadahead
 .Op Fl D Ar deadthresh
 .Op Fl g Ar maxgroups
@@ -241,6 +241,9 @@ Same as
 .It Cm tcp
 Same as
 .Fl T .
+.It Cm udp
+Same as
+.Fl u .
 .It Cm timeo Ns = Ns Aq Ar timeout
 Same as
 .Fl t Ar timeout .
@@ -294,11 +297,8 @@ Use
 .Tn TCP
 transport instead of
 .Tn UDP .
-This is recommended for servers that are not on the same physical network as
-the client.
-Not all
-.Tn NFS
-servers, especially not old ones, support this.
+This is the default;
+the flag is maintained for backwards compatibility.
 .It Fl t Ar timeout
 Set the initial retransmit timeout to the specified value in 0.1 seconds.
 May be useful for fine tuning
@@ -323,6 +323,12 @@ mounts.
 This is necessary for some old
 .Bx
 servers.
+.It Fl u
+Use
+.Tn UDP
+transport instead of
+.Tn TCP .
+This may be necessary for some very old servers.
 .It Fl w Ar writesize
 Set the write data size to the specified value in bytes.
 .Pp

Index: src/sbin/mount_nfs/mount_nfs.c
diff -u src/sbin/mount_nfs/mount_nfs.c:1.71 src/sbin/mount_nfs/mount_nfs.c:1.72
--- src/sbin/mount_nfs/mount_nfs.c:1.71	Sat Jun 29 22:56:26 2013
+++ src/sbin/mount_nfs/mount_nfs.c	Thu May 17 02:34:31 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount_nfs.c,v 1.71 2013/06/29 22:56:26 christos Exp $	*/
+/*	$NetBSD: mount_nfs.c,v 1.72 2018/05/17 02:34:31 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993, 1994
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 19
 #if 0
 static char sccsid[] = "@(#)mount_nfs.c	8.11 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: mount_nfs.c,v 1.71 2013/06/29 22:56:26 christos Exp $");
+__RCSID("$NetBSD: mount_nfs.c,v 1.72 2018/05/17 02:34:31 thorpej Exp $");
 #endif
 #endif /* not lint */
 
@@ -98,6 +98,7 @@ __RCSID("$NetBSD: mount_nfs.c,v 1.71 201
 #define ALTF_DEADTHRESH	0x0020
 #define ALTF_TIMEO	0x0040
 #define ALTF_RETRANS	0x0080
+#define ALTF_UDP	0x0100
 
 static const struct mntopt mopts[] = {
 	MOPT_STDOPTS,
@@ -115,6 +116,7 @@ static const struct mntopt mopts[] = {
 	{ "nqnfs", 0, ALTF_NQNFS, 1 },
 	{ "soft", 0, ALTF_SOFT, 1 },
 	{ "tcp", 0, ALTF_TCP, 1 },
+	{ "udp", 0, ALTF_UDP, 1 },
 	{ "nfsv2", 0, ALTF_NFSV2, 1 },
 	{ "port", 0, ALTF_PORT, 1 },
 	{ "rsize", 0, ALTF_RSIZE, 1 },
@@ -133,7 +135,7 @@ struct nfs_args nfsdefargs = {
 	.version = NFS_ARGSVERSION,
 	.addr = NULL,
 	.addrlen = sizeof(struct sockaddr_in),
-	.sotype = SOCK_DGRAM,
+	.sotype = SOCK_STREAM,
 	.proto = 0,
 	.fh = NULL,
 	.fhsize = 0,
@@ -201,7 +203,7 @@ mount_nfs_parseargs(int argc, char *argv
 	memset(nfsargsp, 0, sizeof(*nfsargsp));
 	*nfsargsp = nfsdefargs;
 	while ((c = getopt(argc, argv,
-	"23a:bcCdD:g:I:iKL:lm:o:PpqR:r:sTt:w:x:UX")) != -1)
+	"23a:bcCdD:g:I:iKL:lm:o:PpqR:r:sTt:w:x:UuX")) != -1)
 		switch (c) {
 		case '3':
 		case 'q':
@@ -298,6 +300,13 @@ mount_nfs_parseargs(int argc, char *argv
 nfsargsp->flags &= ~NFSMNT_RESVPORT;
 			if (altflags & ALTF_SOFT)
 nfsargsp->flags |= NFSMNT_SOFT;
+			if (altflags & ALTF_UDP) {
+nfsargsp->sotype = SOCK_DGRAM;
+			}
+			/*
+			 * After UDP, because TCP overrides if both
+			 * are present.
+			 */
 			if (altflags & ALTF_TCP) {
 nfsargsp->sotype = SOCK_STREAM;
 			}
@@ -404,6 +413,9 @@ mount_nfs_parseargs(int argc, char *argv
 		case 'X':
 			nfsargsp->flags |= NFSMNT_XLATECOOKIE;
 			break;
+		case 'u':
+			nfsargsp->sotype = SOCK_DGRAM;
+			break;
 		case 'U':
 			mnttcp_ok = 0;
 			break;
@@ -500,7 +512,7 @@ static void
 usage(void)
 {
 	(void)fprintf(stderr, "usage: %s %s\n%s\n%s\n%s\n%s\n", getprogname(),
-"[-23bCcdilPpqsTUX] [-a maxreadahead] [-D deadthresh]",
+"[-23bCcdilPpqsTUuX] [-a maxreadahead] [-D deadthresh]",
 "\t[-g maxgroups] [-I readdirsize] [-L leaseterm]",
 "\t[-o options] [-R 

CVS commit: src

2018-05-16 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu May 17 02:34:32 UTC 2018

Modified Files:
src/sbin/mount_nfs: mount_nfs.8 mount_nfs.c
src/sys/nfs: files.nfs nfs_boot.c

Log Message:
Default NFS mounts to using TCP transport instead of UDP.
PR kern/53166


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sbin/mount_nfs/mount_nfs.8
cvs rdiff -u -r1.71 -r1.72 src/sbin/mount_nfs/mount_nfs.c
cvs rdiff -u -r1.14 -r1.15 src/sys/nfs/files.nfs
cvs rdiff -u -r1.87 -r1.88 src/sys/nfs/nfs_boot.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/powerpc/pic

2018-05-16 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed May 16 21:54:38 UTC 2018

Modified Files:
src/sys/arch/powerpc/pic: pic_openpic.c

Log Message:
special case IPIs so we don't mess with hardware IRQ sources
now SMP works on my PCI-X G5


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/powerpc/pic/pic_openpic.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/powerpc/pic/pic_openpic.c
diff -u src/sys/arch/powerpc/pic/pic_openpic.c:1.13 src/sys/arch/powerpc/pic/pic_openpic.c:1.14
--- src/sys/arch/powerpc/pic/pic_openpic.c:1.13	Thu Mar 22 21:27:36 2018
+++ src/sys/arch/powerpc/pic/pic_openpic.c	Wed May 16 21:54:38 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pic_openpic.c,v 1.13 2018/03/22 21:27:36 macallan Exp $ */
+/*	$NetBSD: pic_openpic.c,v 1.14 2018/05/16 21:54:38 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pic_openpic.c,v 1.13 2018/03/22 21:27:36 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic_openpic.c,v 1.14 2018/05/16 21:54:38 macallan Exp $");
 
 #include 
 #include 
@@ -66,7 +66,7 @@ setup_openpic(void *addr, int passthroug
 	"Supports %d CPUs and %d interrupt sources.\n",
 	x & 0xff, ((x & 0x1f00) >> 8) + 1, ((x & 0x07ff) >> 16) + 1);
 
-	pic->pic_numintrs = ((x & 0x07ff) >> 16) + 2; /* one more slot for IPI */
+	pic->pic_numintrs = IPI_VECTOR + 1;
 	pic->pic_cookie = addr;
 	pic->pic_enable_irq = opic_enable_irq;
 	pic->pic_reenable_irq = opic_enable_irq;
@@ -92,7 +92,7 @@ setup_openpic(void *addr, int passthroug
 #if 1
 	openpic_set_priority(0, 15);
 
-	for (irq = 0; irq < pic->pic_numintrs; irq++) {
+	for (irq = 0; irq < (pic->pic_numintrs - 1); irq++) {
 		/* make sure to keep disabled */
 		openpic_write(OPENPIC_SRC_VECTOR(irq), OPENPIC_IMASK);
 		/* send all interrupts to CPU 0 */
@@ -155,7 +155,10 @@ opic_establish_irq(struct pic_ops *pic, 
 		x |= OPENPIC_SENSE_LEVEL;
 
 	x |= realpri << OPENPIC_PRIORITY_SHIFT;
-	openpic_write(OPENPIC_SRC_VECTOR(irq), x);
+#ifdef MULTIPROCESSOR
+	if (irq < IPI_VECTOR)
+#endif 
+		openpic_write(OPENPIC_SRC_VECTOR(irq), x);
 
 	aprint_debug("%s: setting IRQ %d to priority %d\n", __func__, irq,
 	realpri);
@@ -165,7 +168,9 @@ static void
 opic_enable_irq(struct pic_ops *pic, int irq, int type)
 {
 	u_int x;
-
+#ifdef MULTIPROCESSOR
+	if (irq == IPI_VECTOR) return;
+#endif
 	x = openpic_read(OPENPIC_SRC_VECTOR(irq));
 	x &= ~OPENPIC_IMASK;
 	openpic_write(OPENPIC_SRC_VECTOR(irq), x);
@@ -176,6 +181,9 @@ opic_disable_irq(struct pic_ops *pic, in
 {
 	u_int x;
 
+#ifdef MULTIPROCESSOR
+	if (irq == IPI_VECTOR) return;
+#endif
 	x = openpic_read(OPENPIC_SRC_VECTOR(irq));
 	x |= OPENPIC_IMASK;
 	openpic_write(OPENPIC_SRC_VECTOR(irq), x);



CVS commit: src/sys/arch/powerpc/pic

2018-05-16 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed May 16 21:54:38 UTC 2018

Modified Files:
src/sys/arch/powerpc/pic: pic_openpic.c

Log Message:
special case IPIs so we don't mess with hardware IRQ sources
now SMP works on my PCI-X G5


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/powerpc/pic/pic_openpic.c

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



Re: CVS commit: src/share/man/man7

2018-05-16 Thread Thomas Klausner
On Tue, May 15, 2018 at 02:19:13PM +0300, Valeriy E. Ushakov wrote:
> On Tue, May 15, 2018 at 09:13:36 +, Thomas Klausner wrote:
> 
> > Module Name:src
> > Committed By:   wiz
> > Date:   Tue May 15 09:13:36 UTC 2018
> > 
> > Modified Files:
> > src/share/man/man7: intro.7
> > 
> > Log Message:
> > Remove Tn.
> 
> I wonder why we are doing this?  .Tn is small caps in the PostScript
> output and it definitely looks better than all caps.

mandoc warns about them, because it doesn't do anything with them.

If you use them because they are small caps, it's a kind of a misuse,
because the point of mandoc is that you do semantic markup.

Tn has been used for lots of stuff, many of which are not trademarks.

Pick any of these :)
 Thomas


CVS commit: src/sys/arch/i386/stand/efiboot

2018-05-16 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Wed May 16 19:53:54 UTC 2018

Modified Files:
src/sys/arch/i386/stand/efiboot: eficons.c

Log Message:
During awaitkey(), move the cursor back to the beginning of the
countdown with '\b' only after waiting.

Some UEFI implementations have a destructive/erasing backspace,
and will not show the countdown if we move the cursor back before the
wait.

My ThinkPad T430 w/ Lenovo's UEFI exhibited this whiteout-backspace,
while my Gigabyte Brix GB-BXBT-2807 did not.

Should fix PR #53292.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/stand/efiboot/eficons.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/i386/stand/efiboot/eficons.c
diff -u src/sys/arch/i386/stand/efiboot/eficons.c:1.5 src/sys/arch/i386/stand/efiboot/eficons.c:1.6
--- src/sys/arch/i386/stand/efiboot/eficons.c:1.5	Tue Mar 27 14:15:05 2018
+++ src/sys/arch/i386/stand/efiboot/eficons.c	Wed May 16 19:53:54 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: eficons.c,v 1.5 2018/03/27 14:15:05 nonaka Exp $	*/
+/*	$NetBSD: eficons.c,v 1.6 2018/05/16 19:53:54 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -328,10 +328,10 @@ awaitkey(int timeout, int tell)
 	char c = 0;
 
 	for (;;) {
-		if (tell && timeout) {
-			char numbuf[32];
-			int len;
+		char numbuf[32];
+		int len;
 
+		if (tell && timeout) {
 			len = snprintf(numbuf, sizeof(numbuf), "%d seconds. ",
 			timeout);
 			if (len > 0 && len < sizeof(numbuf)) {
@@ -340,7 +340,6 @@ awaitkey(int timeout, int tell)
 printf("%s", numbuf);
 while (*p)
 	*p++ = '\b';
-printf("%s", numbuf);
 			}
 		}
 		if (iskey(1)) {
@@ -355,6 +354,8 @@ awaitkey(int timeout, int tell)
 			internal_waitforinputevent(1000);
 		else
 			break;
+		if (tell)
+			printf("%s", numbuf);
 	}
 
 out:



CVS commit: src/sys/arch/i386/stand/efiboot

2018-05-16 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Wed May 16 19:53:54 UTC 2018

Modified Files:
src/sys/arch/i386/stand/efiboot: eficons.c

Log Message:
During awaitkey(), move the cursor back to the beginning of the
countdown with '\b' only after waiting.

Some UEFI implementations have a destructive/erasing backspace,
and will not show the countdown if we move the cursor back before the
wait.

My ThinkPad T430 w/ Lenovo's UEFI exhibited this whiteout-backspace,
while my Gigabyte Brix GB-BXBT-2807 did not.

Should fix PR #53292.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/stand/efiboot/eficons.c

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



CVS commit: src

2018-05-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May 16 20:21:39 UTC 2018

Modified Files:
src/lib/libc/gen: sysctl.c
src/sys/sys: sysctl.h

Log Message:
Avoid complicated arithmetic involving NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/lib/libc/gen/sysctl.c
cvs rdiff -u -r1.225 -r1.226 src/sys/sys/sysctl.h

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

Modified files:

Index: src/lib/libc/gen/sysctl.c
diff -u src/lib/libc/gen/sysctl.c:1.36 src/lib/libc/gen/sysctl.c:1.37
--- src/lib/libc/gen/sysctl.c:1.36	Tue Jan 10 17:46:47 2017
+++ src/lib/libc/gen/sysctl.c	Wed May 16 20:21:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysctl.c,v 1.36 2017/01/10 17:46:47 christos Exp $	*/
+/*	$NetBSD: sysctl.c,v 1.37 2018/05/16 20:21:39 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)sysctl.c	8.2 (Berkeley) 1/4/94";
 #else
-__RCSID("$NetBSD: sysctl.c,v 1.36 2017/01/10 17:46:47 christos Exp $");
+__RCSID("$NetBSD: sysctl.c,v 1.37 2018/05/16 20:21:39 joerg Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -309,7 +309,7 @@ user_sysctl(const int *name, unsigned in
 _DIAGASSERT(__type_fit(uint32_t, dlen));
 d1->descr_len = (uint32_t)dlen;
 			}
-			d = (size_t)__sysc_desc_adv(NULL, d1->descr_len);
+			d = (size_t)__sysc_desc_len(d1->descr_len);
 			if (d2 != NULL)
 memcpy(d2, d1, d);
 			sz += d;

Index: src/sys/sys/sysctl.h
diff -u src/sys/sys/sysctl.h:1.225 src/sys/sys/sysctl.h:1.226
--- src/sys/sys/sysctl.h:1.225	Fri Sep  8 10:53:55 2017
+++ src/sys/sys/sysctl.h	Wed May 16 20:21:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysctl.h,v 1.225 2017/09/08 10:53:55 wiz Exp $	*/
+/*	$NetBSD: sysctl.h,v 1.226 2018/05/16 20:21:39 joerg Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -1472,10 +1472,11 @@ struct sysctldesc {
 };
 
 #define __sysc_desc_roundup(x) x) - 1) | (sizeof(int32_t) - 1)) + 1)
+#define __sysc_desc_len(l) (offsetof(struct sysctldesc, descr_str) +\
+		__sysc_desc_roundup(l))
 #define __sysc_desc_adv(d, l) \
 	(/*XXXUNCONST ptr cast*/(struct sysctldesc *) \
-	__UNCONST(((const char*)(d)) + offsetof(struct sysctldesc, descr_str) +\
-		__sysc_desc_roundup(l)))
+	__UNCONST(((const char*)(d)) + __sysc_desc_len(l)))
 #define NEXT_DESCR(d) __sysc_desc_adv((d), (d)->descr_len)
 
 static __inline const struct sysctlnode *



CVS commit: src

2018-05-16 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May 16 20:21:39 UTC 2018

Modified Files:
src/lib/libc/gen: sysctl.c
src/sys/sys: sysctl.h

Log Message:
Avoid complicated arithmetic involving NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/lib/libc/gen/sysctl.c
cvs rdiff -u -r1.225 -r1.226 src/sys/sys/sysctl.h

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