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

2018-04-03 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Apr  3 12:52:16 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: files.sunxi
Added Files:
src/sys/arch/arm/sunxi: sunxi_debe.c sunxi_debereg.h sunxi_dep.c
sunxi_display.h sunxi_hdmi.c sunxi_hdmireg.h sunxi_tcon.c
sunxi_tconreg.h

Log Message:
work in progress on porting graphics drivers from arm/allwinner to fdt.
sunxidebe: display backend drivers
sunxitcon: lcd controller driver
sunxihdmi: hdmi controller driver
sunxidep: display engine pipeline driver. Its role is only to parse the
   fdt display-engine node, and activate de backend drivers based on the
   content of allwinner,pipelines

So far HDMI and lvds output works, in dual-framebuffer mode.
It has only been tested on A20. It should be OK on the A10 too, but
will likely need more work for other SoCs.
Console is not handled yet, and it conflicts with the simplefb driver if
it has been activated by u-boot.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r0 -r1.3 src/sys/arch/arm/sunxi/sunxi_debe.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/sunxi/sunxi_debereg.h \
src/sys/arch/arm/sunxi/sunxi_dep.c src/sys/arch/arm/sunxi/sunxi_display.h \
src/sys/arch/arm/sunxi/sunxi_hdmi.c \
src/sys/arch/arm/sunxi/sunxi_hdmireg.h \
src/sys/arch/arm/sunxi/sunxi_tcon.c \
src/sys/arch/arm/sunxi/sunxi_tconreg.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/arm/sunxi/files.sunxi
diff -u src/sys/arch/arm/sunxi/files.sunxi:1.47 src/sys/arch/arm/sunxi/files.sunxi:1.48
--- src/sys/arch/arm/sunxi/files.sunxi:1.47	Sun Apr  1 21:19:17 2018
+++ src/sys/arch/arm/sunxi/files.sunxi	Tue Apr  3 12:52:16 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sunxi,v 1.47 2018/04/01 21:19:17 bouyer Exp $
+#	$NetBSD: files.sunxi,v 1.48 2018/04/03 12:52:16 bouyer Exp $
 #
 # Configuration info for Allwinner sunxi family SoCs
 #
@@ -189,6 +189,28 @@ file	arch/arm/sunxi/sun8i_h3_codec.c		h3
 attach	genfb at fdt with simplefb
 file	dev/fdt/simplefb.c			simplefb
 
+# A10/A20 LCD/TV timing controller (TCON)
+device	sunxitcon
+attach	sunxitcon at fdt with sunxi_tcon
+file	arch/arm/sunxi/sunxi_tcon.c		sunxi_tcon needs-flag
+
+# A10/A20 Display engine backend (DE-BE)
+device	sunxidebe { }
+attach	sunxidebe at fdt with sunxi_debe
+file	arch/arm/sunxi/sunxi_debe.c		sunxi_debe needs-flag
+
+attach	genfb at sunxidebe with sunxi_befb
+
+# A10/A20 HDMI
+device	sunxihdmi: edid, videomode
+attach	sunxihdmi at fdt with sunxi_hdmi
+file	arch/arm/sunxi/sunxi_hdmi.c		sunxi_hdmi needs-flag
+
+# A10/A20 display engine pipeline
+device sunxidep
+attach	sunxidep at fdt with sunxi_dep
+file	arch/arm/sunxi/sunxi_dep.c		sunxi_dep
+
 # Touch Screen controller
 device	sunxits: wsmousedev, tpcalib, sysmon_envsys
 attach	sunxits at fdt with sunxi_ts

Added files:

Index: src/sys/arch/arm/sunxi/sunxi_debe.c
diff -u /dev/null src/sys/arch/arm/sunxi/sunxi_debe.c:1.3
--- /dev/null	Tue Apr  3 12:52:16 2018
+++ src/sys/arch/arm/sunxi/sunxi_debe.c	Tue Apr  3 12:52:16 2018
@@ -0,0 +1,937 @@
+/* $NetBSD: sunxi_debe.c,v 1.3 2018/04/03 12:52:16 bouyer Exp $ */
+
+/*-
+ * Copyright (c) 2018 Manuel Bouyer 
+ * All rights reserved.
+ *
+ * Copyright (c) 2014 Jared D. McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "genfb.h"
+
+#ifndef SUNXI_DEBE_VIDEOMEM
+#define SUNXI_DEBE_VIDEOMEM	(16 * 1024 * 1024)
+#endif
+
+#define SUNXI_DEBE_CURMAX	64
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: sunxi_debe.c,v 1.3 2018/04/03 12:52:16 bouyer Exp $");
+
+#include 
+#include 

CVS commit: src/sys

2018-04-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr  3 09:03:59 UTC 2018

Modified Files:
src/sys/netinet: tcp_input.c
src/sys/netipsec: ipsec.c ipsec.h

Log Message:
Remove ipsec_copy_policy and ipsec_copy_pcbpolicy. No functional change,
since we used only ipsec_copy_pcbpolicy, and it was a no-op.

Originally we were using ipsec_copy_policy to optimize the IPsec-PCB
cache: when an ACK was received in response to a SYN, we used to copy the
SP cached in the SYN's PCB into the ACK's PCB, so that
ipsec_getpolicybysock could use the cached SP instead of requerying it.

Then we switched to ipsec_copy_pcbpolicy which has always been a no-op. As
a result the SP cached in the SYN was/is not copied in the ACK, and the
first call to ipsec_getpolicybysock had to query the SP and cache it
itself. It's not totally clear to me why this change was made.

But it has been this way for years, and after a conversation with Ryota
Ozaki it turns out the optimization is not valid anymore due to
MP-ification, so it won't be re-enabled.

ok ozaki-r@


To generate a diff of this commit:
cvs rdiff -u -r1.403 -r1.404 src/sys/netinet/tcp_input.c
cvs rdiff -u -r1.152 -r1.153 src/sys/netipsec/ipsec.c
cvs rdiff -u -r1.71 -r1.72 src/sys/netipsec/ipsec.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/netinet/tcp_input.c
diff -u src/sys/netinet/tcp_input.c:1.403 src/sys/netinet/tcp_input.c:1.404
--- src/sys/netinet/tcp_input.c:1.403	Fri Mar 30 08:25:06 2018
+++ src/sys/netinet/tcp_input.c	Tue Apr  3 09:03:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_input.c,v 1.403 2018/03/30 08:25:06 maxv Exp $	*/
+/*	$NetBSD: tcp_input.c,v 1.404 2018/04/03 09:03:59 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.403 2018/03/30 08:25:06 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.404 2018/04/03 09:03:59 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -3896,29 +3896,6 @@ syn_cache_get(struct sockaddr *src, stru
 	}
 #endif
 
-#if defined(IPSEC)
-	if (ipsec_used) {
-		/*
-		 * we make a copy of policy, instead of sharing the policy, for
-		 * better behavior in terms of SA lookup and dead SA removal.
-		 */
-		if (inp) {
-			/* copy old policy into new socket's */
-			if (ipsec_copy_pcbpolicy(sotoinpcb(oso)->inp_sp,
-			inp->inp_sp))
-printf("tcp_input: could not copy policy\n");
-		}
-#ifdef INET6
-		else if (in6p) {
-			/* copy old policy into new socket's */
-			if (ipsec_copy_pcbpolicy(sotoin6pcb(oso)->in6p_sp,
-			in6p->in6p_sp))
-printf("tcp_input: could not copy policy\n");
-		}
-#endif
-	}
-#endif
-
 	/*
 	 * Give the new socket our cached route reference.
 	 */

Index: src/sys/netipsec/ipsec.c
diff -u src/sys/netipsec/ipsec.c:1.152 src/sys/netipsec/ipsec.c:1.153
--- src/sys/netipsec/ipsec.c:1.152	Sat Mar 31 19:27:14 2018
+++ src/sys/netipsec/ipsec.c	Tue Apr  3 09:03:59 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsec.c,v 1.152 2018/03/31 19:27:14 maxv Exp $ */
+/* $NetBSD: ipsec.c,v 1.153 2018/04/03 09:03:59 maxv Exp $ */
 /* $FreeBSD: src/sys/netipsec/ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $ */
 /* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.152 2018/03/31 19:27:14 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.153 2018/04/03 09:03:59 maxv Exp $");
 
 /*
  * IPsec controller part.
@@ -179,9 +179,6 @@ static void ipsec6_get_ulp(struct mbuf *
 static int ipsec6_setspidx_ipaddr(struct mbuf *, struct secpolicyindex *);
 #endif
 static void ipsec_delpcbpolicy(struct inpcbpolicy *);
-#if 0 /* unused */
-static struct secpolicy *ipsec_deepcopy_policy(const struct secpolicy *);
-#endif
 static void ipsec_destroy_policy(struct secpolicy *);
 static int ipsec_sp_reject(const struct secpolicy *, const struct mbuf *);
 static void vshiftl(unsigned char *, int, int);
@@ -1131,78 +1128,6 @@ ipsec_init_policy(struct socket *so, str
 	return 0;
 }
 
-#if 0 /* unused */
-/* copy old ipsec policy into new */
-int
-ipsec_copy_policy(const struct inpcbpolicy *old, struct inpcbpolicy *new)
-{
-	struct secpolicy *sp;
-
-	sp = ipsec_deepcopy_policy(old->sp_in);
-	if (sp) {
-		KEY_SP_UNREF(>sp_in);
-		new->sp_in = sp;
-	} else
-		return ENOBUFS;
-
-	sp = ipsec_deepcopy_policy(old->sp_out);
-	if (sp) {
-		KEY_SP_UNREF(>sp_out);
-		new->sp_out = sp;
-	} else
-		return ENOBUFS;
-
-	new->priv = old->priv;
-
-	return 0;
-}
-
-/* deep-copy a policy in PCB */
-static struct secpolicy *
-ipsec_deepcopy_policy(const struct secpolicy *src)
-{
-	struct ipsecrequest *newchain = NULL;
-	const struct ipsecrequest *p;
-	struct ipsecrequest **q;
-	struct secpolicy *dst;
-
-	if (src == NULL)
-		return NULL;
-	dst = KEY_NEWSP();
-	if (dst == NULL)
-		return NULL;
-
-	/*
-	 * deep-copy IPsec request chain.  This 

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

2018-04-03 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Apr  3 12:56:21 UTC 2018

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

Log Message:
Add commented out entries for the display drivers.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/evbarm/conf/SUNXI

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

Modified files:

Index: src/sys/arch/evbarm/conf/SUNXI
diff -u src/sys/arch/evbarm/conf/SUNXI:1.60 src/sys/arch/evbarm/conf/SUNXI:1.61
--- src/sys/arch/evbarm/conf/SUNXI:1.60	Wed Mar  7 20:55:31 2018
+++ src/sys/arch/evbarm/conf/SUNXI	Tue Apr  3 12:56:21 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: SUNXI,v 1.60 2018/03/07 20:55:31 bouyer Exp $
+#	$NetBSD: SUNXI,v 1.61 2018/04/03 12:56:21 bouyer Exp $
 #
 #	Allwinner sunxi family
 #
@@ -283,6 +283,14 @@ wd*		at atabus? drive ?
 # Display
 genfb*		at fdt?
 wsdisplay*	at genfb?
+
+#sunxidebe*	at fdt? pass 4	# Display Backend
+#genfb*		at sunxidebe?
+#sunxitcon*	at fdt? pass 4	# LCD LVDS/RGB controller
+#sunxihdmi*	at fdt? pass 4	# HDMI controller
+#connector*	at fdt? pass 4
+#panel*		at fdt? pass 4
+#sunxidep*	at fdt?		# Display Engine Pipeline
 options 	VCONS_DRAW_INTR
 options 	WSEMUL_VT100
 options 	WS_DEFAULT_FG=WSCOL_WHITE



CVS commit: src/sys/netinet

2018-04-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr  3 08:46:01 UTC 2018

Modified Files:
src/sys/netinet: ip_var.h

Log Message:
Remove unused fields and outdated comment.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sys/netinet/ip_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/netinet/ip_var.h
diff -u src/sys/netinet/ip_var.h:1.122 src/sys/netinet/ip_var.h:1.123
--- src/sys/netinet/ip_var.h:1.122	Wed Jan 10 10:56:30 2018
+++ src/sys/netinet/ip_var.h	Tue Apr  3 08:46:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_var.h,v 1.122 2018/01/10 10:56:30 knakahara Exp $	*/
+/*	$NetBSD: ip_var.h,v 1.123 2018/04/03 08:46:01 maxv Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -68,22 +68,10 @@ struct ipflow {
 
 /*
  * IP sequence queue structure.
- *
- * XXX -- The following explains why the ipqe_m field is here, for TCP's use:
- * We want to avoid doing m_pullup on incoming packets but that
- * means avoiding dtom on the tcp reassembly code.  That in turn means
- * keeping an mbuf pointer in the reassembly queue (since we might
- * have a cluster).  As a quick hack, the source & destination
- * port numbers (which are no longer needed once we've located the
- * tcpcb) are overlayed with an mbuf pointer.
  */
 TAILQ_HEAD(ipqehead, ipqent);
 struct ipqent {
 	TAILQ_ENTRY(ipqent) ipqe_q;
-	union {
-		struct ip	*_ip;
-		struct tcpiphdr *_tcp;
-	} _ipqe_u1;
 	struct mbuf	*ipqe_m;	/* point to first mbuf */
 	struct mbuf	*ipre_mlast;	/* point to last mbuf */
 	u_int8_t	ipqe_mff;	/* for IP fragmentation */
@@ -95,7 +83,6 @@ struct ipqent {
 	u_int32_t ipqe_len;
 	u_int32_t ipqe_flags;
 };
-#define	ipqe_tcp	_ipqe_u1._tcp
 
 /*
  * Structure stored in mbuf in inpcb.ip_options



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

2018-04-03 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Apr  3 10:10:17 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sun4i_a10_gpio.c sun7i_a20_gpio.c

Log Message:
external interrupt functions are named "eint" in the sunxi_gpio_pins[]
arrays, while sunxi_gpio_establish() looks for "eint".
Rename eint to eint in sunxi_gpio_pins[]. Tested with an external interrupt
on PH0 on an A20.

XXX others sunxi_gpio_pins[] contains names like px_eint, px being the
name of the port bank. I guess they should be renamed to "eint" too to work
with sunxi_gpio_establish() but I'm not sure the functions are really the
same, and I have no way to test.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/sunxi/sun4i_a10_gpio.c \
src/sys/arch/arm/sunxi/sun7i_a20_gpio.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/sun4i_a10_gpio.c
diff -u src/sys/arch/arm/sunxi/sun4i_a10_gpio.c:1.2 src/sys/arch/arm/sunxi/sun4i_a10_gpio.c:1.3
--- src/sys/arch/arm/sunxi/sun4i_a10_gpio.c:1.2	Thu Oct 12 20:17:27 2017
+++ src/sys/arch/arm/sunxi/sun4i_a10_gpio.c	Tue Apr  3 10:10:17 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sun4i_a10_gpio.c,v 1.2 2017/10/12 20:17:27 jmcneill Exp $ */
+/* $NetBSD: sun4i_a10_gpio.c,v 1.3 2018/04/03 10:10:17 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2016 Emmanuel Vadot 
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sun4i_a10_gpio.c,v 1.2 2017/10/12 20:17:27 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sun4i_a10_gpio.c,v 1.3 2018/04/03 10:10:17 bouyer Exp $");
 
 #include 
 #include 
@@ -170,28 +170,28 @@ static const struct sunxi_gpio_pins a10_
 	{"PG10", 6, 10, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}},
 	{"PG11", 6, 11, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}},
 
-	{"PH0",  7,  0, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint0", "csi1"}, 6, 0},
-	{"PH1",  7,  1, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint1", "csi1"}, 6, 1},
-	{"PH2",  7,  2, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint2", "csi1"}, 6, 2},
-	{"PH3",  7,  3, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint3", "csi1"}, 6, 3},
-	{"PH4",  7,  4, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint4", "csi1"}, 6, 4},
-	{"PH5",  7,  5, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint5", "csi1"}, 6, 5},
-	{"PH6",  7,  6, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint6", "csi1"}, 6, 6},
-	{"PH7",  7,  7, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint7", "csi1"}, 6, 7},
-	{"PH8",  7,  8, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint8", "csi1"}, 6, 8},
-	{"PH9",  7,  9, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint9", "csi1"}, 6, 9},
-	{"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint10", "csi1"}, 6, 10},
-	{"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint11", "csi1"}, 6, 11},
-	{"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", NULL, "eint12", "csi1"}, 6, 12},
-	{"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", "sim", "eint13", "csi1"}, 6, 13},
-	{"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint14", "csi1"}, 6, 14},
-	{"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint15", "csi1"}, 6, 15},
-	{"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", NULL, "eint16", "csi1"}, 6, 16},
-	{"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint17", "csi1"}, 6, 17},
-	{"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint18", "csi1"}, 6, 18},
-	{"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint19", "csi1"}, 6, 19},
-	{"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint20", "csi1"}, 6, 20},
-	{"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint21", "csi1"}, 6, 21},
+	{"PH0",  7,  0, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}, 6, 0},
+	{"PH1",  7,  1, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}, 6, 1},
+	{"PH2",  7,  2, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}, 6, 2},
+	{"PH3",  7,  3, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}, 6, 3},
+	{"PH4",  7,  4, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint", "csi1"}, 6, 4},
+	{"PH5",  7,  5, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint", "csi1"}, 6, 5},
+	{"PH6",  7,  6, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint", "csi1"}, 6, 6},
+	{"PH7",  7,  7, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint", "csi1"}, 6, 7},
+	{"PH8",  7,  8, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}, 6, 8},
+	

CVS commit: src/sys/dev/fdt

2018-04-03 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Apr  3 12:40:20 UTC 2018

Modified Files:
src/sys/dev/fdt: files.fdt
Added Files:
src/sys/dev/fdt: connector_fdt.c connector_fdt.h fdt_port.c fdt_port.h
panel_fdt.c panel_fdt.h

Log Message:
Add connector and panel drivers (panel supports only panel-lvds and
panel-dual-lvds at this time, but can easily be extended to other types
of panels).
Add an API for ports/endpoints.
Proposed on tech-kern@ a few days ago, ok jmcneill@


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/connector_fdt.c \
src/sys/dev/fdt/connector_fdt.h src/sys/dev/fdt/fdt_port.c \
src/sys/dev/fdt/fdt_port.h src/sys/dev/fdt/panel_fdt.c \
src/sys/dev/fdt/panel_fdt.h
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/fdt/files.fdt

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/fdt/files.fdt
diff -u src/sys/dev/fdt/files.fdt:1.22 src/sys/dev/fdt/files.fdt:1.23
--- src/sys/dev/fdt/files.fdt:1.22	Sun Oct 22 13:56:49 2017
+++ src/sys/dev/fdt/files.fdt	Tue Apr  3 12:40:20 2018
@@ -1,4 +1,4 @@
-# $NetBSD: files.fdt,v 1.22 2017/10/22 13:56:49 jmcneill Exp $
+# $NetBSD: files.fdt,v 1.23 2018/04/03 12:40:20 bouyer Exp $
 
 include	"external/bsd/libfdt/conf/files.libfdt"
 
@@ -34,6 +34,16 @@ device	gpioleds: leds
 attach	gpioleds at fdt
 file	dev/fdt/gpioleds.c			gpioleds
 
+file	dev/fdt/fdt_port.c			fdt_port
+
+device	connector: fdt_port
+attach	connector at fdt with fdt_connector
+file	dev/fdt/connector_fdt.c			fdt_connector
+
+device	panel: fdt_port
+attach	panel at fdt with fdt_panel
+file	dev/fdt/panel_fdt.c			fdt_panel
+
 file	dev/fdt/fdt_openfirm.c			fdtbus
 file	dev/fdt/fdt_subr.c			fdtbus
 file	dev/fdt/fdt_clock.c			fdtbus

Added files:

Index: src/sys/dev/fdt/connector_fdt.c
diff -u /dev/null src/sys/dev/fdt/connector_fdt.c:1.1
--- /dev/null	Tue Apr  3 12:40:20 2018
+++ src/sys/dev/fdt/connector_fdt.c	Tue Apr  3 12:40:20 2018
@@ -0,0 +1,129 @@
+/*	$NetBSD: connector_fdt.c,v 1.1 2018/04/03 12:40:20 bouyer Exp $	*/
+
+/*-
+ * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Manuel Bouyer.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * connector driver.
+ * specified in linux/Documentation/devicetree/bindings/display/connector/
+ * basically it only register its endpoint.
+ */
+
+#include 
+
+__KERNEL_RCSID(1, "$NetBSD: connector_fdt.c,v 1.1 2018/04/03 12:40:20 bouyer Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+static int fdt_connector_match(device_t, cfdata_t, void *);
+static void fdt_connector_attach(device_t, device_t, void *);
+static void *fdt_connector_get_data(device_t, struct fdt_endpoint *);
+
+SLIST_HEAD(, fdt_connector_softc) fdt_connectors =
+SLIST_HEAD_INITIALIZER(_connectors);
+
+struct fdt_connector_softc {
+	device_t sc_dev;
+	int sc_phandle;
+	struct fdt_connector sc_con;
+	SLIST_ENTRY(fdt_connector_softc) sc_list;
+	struct fdt_device_ports sc_ports;
+};
+
+#define sc_type sc_con.con_type
+
+CFATTACH_DECL_NEW(fdt_connector, sizeof(struct fdt_connector_softc),
+fdt_connector_match, fdt_connector_attach, NULL, NULL);
+
+static const struct of_compat_data compat_data[] = {
+	{"composite-video-connector", CON_TV},
+	{"dvi-connector", CON_DVI},
+	{"hdmi-connector", CON_HDMI},
+	{"vga-connector", CON_VGA},
+	{ NULL }
+};
+
+static int
+fdt_connector_match(device_t parent, cfdata_t cf, void *aux)
+{
+	const struct fdt_attach_args *faa = aux;
+
+	return 

CVS commit: src/sys/arch

2018-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  3 07:20:52 UTC 2018

Modified Files:
src/sys/arch/amd64/amd64: db_interface.c vector.S
src/sys/arch/i386/i386: db_interface.c machdep.c vector.S
src/sys/arch/x86/x86: lapic.c

Log Message:
Rename the DDB IPI IDT vectors for consistency. ok maxv@


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/amd64/amd64/db_interface.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/amd64/amd64/vector.S
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/i386/i386/db_interface.c
cvs rdiff -u -r1.804 -r1.805 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/i386/i386/vector.S
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/x86/x86/lapic.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/db_interface.c
diff -u src/sys/arch/amd64/amd64/db_interface.c:1.32 src/sys/arch/amd64/amd64/db_interface.c:1.33
--- src/sys/arch/amd64/amd64/db_interface.c:1.32	Tue Feb 13 01:44:13 2018
+++ src/sys/arch/amd64/amd64/db_interface.c	Tue Apr  3 03:20:52 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.32 2018/02/13 06:44:13 maxv Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.33 2018/04/03 07:20:52 christos Exp $	*/
 
 /*
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.32 2018/02/13 06:44:13 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.33 2018/04/03 07:20:52 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -99,7 +99,7 @@ static bool ddb_mp_online;
 int ddb_cpu = NOCPU;
 
 typedef void (vector)(void);
-extern vector Xintrddbipi, Xx2apic_intrddbipi;
+extern vector Xintr_ddbipi, Xintr_x2apic_ddbipi;
 
 void
 db_machine_init(void)
@@ -107,10 +107,10 @@ db_machine_init(void)
 
 #ifdef MULTIPROCESSOR
 #ifndef XEN
-	vector *handler = 
+	vector *handler = _ddbipi;
 #if NLAPIC > 0
 	if (lapic_is_x2apic())
-		handler = _intrddbipi;
+		handler = _x2apic_ddbipi;
 #endif
 	ddb_vec = idt_vec_alloc(0xf0, 0xff);
 	setgate([ddb_vec], handler, 1, SDT_SYS386IGT, SEL_KPL,

Index: src/sys/arch/amd64/amd64/vector.S
diff -u src/sys/arch/amd64/amd64/vector.S:1.61 src/sys/arch/amd64/amd64/vector.S:1.62
--- src/sys/arch/amd64/amd64/vector.S:1.61	Fri Mar 16 04:48:34 2018
+++ src/sys/arch/amd64/amd64/vector.S	Tue Apr  3 03:20:52 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.61 2018/03/16 08:48:34 maxv Exp $	*/
+/*	$NetBSD: vector.S,v 1.62 2018/04/03 07:20:52 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -161,7 +161,7 @@ IDTVEC_END(intr_lapic_ipi)
 	TEXT_USER_END
 
 #if defined(DDB)
-IDTVEC(handle_intrddbipi)
+IDTVEC(handle_ddbipi)
 	movl	$0xf,%eax
 	movq	%rax,%cr8
 	movq	_C_LABEL(local_apic_va),%rbx
@@ -171,8 +171,8 @@ IDTVEC(handle_intrddbipi)
 	xorl	%eax,%eax
 	movq	%rax,%cr8
 	INTRFASTEXIT
-IDTVEC_END(handle_intrddbipi)
-IDTVEC(handle_x2apic_intrddbipi)
+IDTVEC_END(handle_ddbipi)
+IDTVEC(handle_x2apic_ddbipi)
 	movl	$0xf,%eax
 	movq	%rax,%cr8
 	movl	$(MSR_X2APIC_BASE + MSR_X2APIC_EOI),%ecx
@@ -184,21 +184,21 @@ IDTVEC(handle_x2apic_intrddbipi)
 	xorl	%eax,%eax
 	movq	%rax,%cr8
 	INTRFASTEXIT
-IDTVEC_END(handle_x2apic_intrddbipi)
+IDTVEC_END(handle_x2apic_ddbipi)
 
 	TEXT_USER_BEGIN
-IDTVEC(intrddbipi)
+IDTVEC(intr_ddbipi)
 	pushq	$0
 	pushq	$T_BPTFLT
 	INTRENTRY
-	jmp	_C_LABEL(Xhandle_intrddbipi)
-IDTVEC_END(intrddbipi)
-IDTVEC(x2apic_intrddbipi)
+	jmp	_C_LABEL(Xhandle_ddbipi)
+IDTVEC_END(intr_ddbipi)
+IDTVEC(intr_x2apic_ddbipi)
 	pushq	$0
 	pushq	$T_BPTFLT
 	INTRENTRY
-	jmp	_C_LABEL(Xhandle_x2apic_intrddbipi)
-IDTVEC_END(x2apic_intrddbipi)
+	jmp	_C_LABEL(Xhandle_x2apic_ddbipi)
+IDTVEC_END(intr_x2apic_ddbipi)
 	TEXT_USER_END
 
 #endif /* DDB */

Index: src/sys/arch/i386/i386/db_interface.c
diff -u src/sys/arch/i386/i386/db_interface.c:1.81 src/sys/arch/i386/i386/db_interface.c:1.82
--- src/sys/arch/i386/i386/db_interface.c:1.81	Tue Feb 13 01:44:13 2018
+++ src/sys/arch/i386/i386/db_interface.c	Tue Apr  3 03:20:52 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.81 2018/02/13 06:44:13 maxv Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.82 2018/04/03 07:20:52 christos Exp $	*/
 
 /*
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.81 2018/02/13 06:44:13 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.82 2018/04/03 07:20:52 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -105,7 +105,7 @@ static bool ddb_mp_online;
 int ddb_cpu = NOCPU;
 
 typedef void (vector)(void);
-extern vector Xintrddbipi, Xx2apic_intrddbipi;
+extern vector Xintr_ddbipi, Xintr_x2apic_ddbipi;
 
 void
 db_machine_init(void)
@@ -113,10 +113,10 @@ db_machine_init(void)
 
 #ifdef MULTIPROCESSOR
 #ifndef XEN
-	vector *handler = 
+	vector *handler = _ddbipi;
 #if NLAPIC > 0
 	if (lapic_is_x2apic())
-		handler = _intrddbipi;
+		

CVS commit: src/doc

2018-04-03 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Apr  3 06:11:14 UTC 2018

Modified Files:
src/doc: 3RDPARTY

Log Message:
openssh-7.7 out


To generate a diff of this commit:
cvs rdiff -u -r1.1507 -r1.1508 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1507 src/doc/3RDPARTY:1.1508
--- src/doc/3RDPARTY:1.1507	Tue Mar 27 06:34:25 2018
+++ src/doc/3RDPARTY	Tue Apr  3 06:11:14 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1507 2018/03/27 06:34:25 roy Exp $
+#	$NetBSD: 3RDPARTY,v 1.1508 2018/04/03 06:11:14 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1031,7 +1031,7 @@ Patch applied after OpenSSH import.
 
 Package:	OpenSSH
 Version:	7.6
-Current Vers:	7.6 / portable 7.6p1
+Current Vers:	7.7 / portable 7.7p1
 Maintainer:	OpenSSH
 Archive Site:	http://www.openssh.com/ftp.html
 Home Page:	http://www.openssh.com/portable.html



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

2018-04-03 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Apr  3 13:38:13 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sunxi_debe.c sunxi_dep.c sunxi_hdmi.c
sunxi_tcon.c

Log Message:
A10 and A20 should have the same display hardware, so consistenly support
sun4i-a10 the same way as sun7i-a20.
This would need to be tested on a real A10.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/sunxi/sunxi_debe.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sunxi_dep.c \
src/sys/arch/arm/sunxi/sunxi_hdmi.c src/sys/arch/arm/sunxi/sunxi_tcon.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_debe.c
diff -u src/sys/arch/arm/sunxi/sunxi_debe.c:1.3 src/sys/arch/arm/sunxi/sunxi_debe.c:1.4
--- src/sys/arch/arm/sunxi/sunxi_debe.c:1.3	Tue Apr  3 12:52:16 2018
+++ src/sys/arch/arm/sunxi/sunxi_debe.c	Tue Apr  3 13:38:13 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_debe.c,v 1.3 2018/04/03 12:52:16 bouyer Exp $ */
+/* $NetBSD: sunxi_debe.c,v 1.4 2018/04/03 13:38:13 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2018 Manuel Bouyer 
@@ -38,7 +38,7 @@
 #define SUNXI_DEBE_CURMAX	64
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_debe.c,v 1.3 2018/04/03 12:52:16 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_debe.c,v 1.4 2018/04/03 13:38:13 bouyer Exp $");
 
 #include 
 #include 
@@ -61,7 +61,6 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_debe.c
 
 enum sunxi_debe_type {
 	DEBE_A10 = 1,
-	DEBE_A20,
 };
 
 struct sunxi_debe_softc {
@@ -100,7 +99,7 @@ struct sunxi_debe_softc {
 
 static const struct of_compat_data compat_data[] = {
 	{"allwinner,sun4i-a10-display-backend", DEBE_A10},
-	{"allwinner,sun7i-a20-display-backend", DEBE_A20},
+	{"allwinner,sun7i-a20-display-backend", DEBE_A10},
 	{NULL}
 };
 

Index: src/sys/arch/arm/sunxi/sunxi_dep.c
diff -u src/sys/arch/arm/sunxi/sunxi_dep.c:1.1 src/sys/arch/arm/sunxi/sunxi_dep.c:1.2
--- src/sys/arch/arm/sunxi/sunxi_dep.c:1.1	Tue Apr  3 12:52:16 2018
+++ src/sys/arch/arm/sunxi/sunxi_dep.c	Tue Apr  3 13:38:13 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunxi_dep.c,v 1.1 2018/04/03 12:52:16 bouyer Exp $	*/
+/*	$NetBSD: sunxi_dep.c,v 1.2 2018/04/03 13:38:13 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: sunxi_dep.c,v 1.1 2018/04/03 12:52:16 bouyer Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sunxi_dep.c,v 1.2 2018/04/03 13:38:13 bouyer Exp $");
 
 #include 
 #include 
@@ -52,6 +52,7 @@ struct sunxi_dep_softc {
 };
 
 static const struct of_compat_data compat_data[] = {
+	{"allwinner,sun4i-a10-display-engine", 0},
 	{"allwinner,sun7i-a20-display-engine", 0},
 	{NULL}
 };
Index: src/sys/arch/arm/sunxi/sunxi_hdmi.c
diff -u src/sys/arch/arm/sunxi/sunxi_hdmi.c:1.1 src/sys/arch/arm/sunxi/sunxi_hdmi.c:1.2
--- src/sys/arch/arm/sunxi/sunxi_hdmi.c:1.1	Tue Apr  3 12:52:16 2018
+++ src/sys/arch/arm/sunxi/sunxi_hdmi.c	Tue Apr  3 13:38:13 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_hdmi.c,v 1.1 2018/04/03 12:52:16 bouyer Exp $ */
+/* $NetBSD: sunxi_hdmi.c,v 1.2 2018/04/03 13:38:13 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "opt_ddb.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_hdmi.c,v 1.1 2018/04/03 12:52:16 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_hdmi.c,v 1.2 2018/04/03 13:38:13 bouyer Exp $");
 
 #include 
 #include 
@@ -55,7 +55,6 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_hdmi.c
 
 enum sunxi_hdmi_type {
 	HDMI_A10 = 1,
-	HDMI_A20,
 	HDMI_A31,
 };
 
@@ -107,7 +106,7 @@ struct sunxi_hdmi_softc {
 
 static const struct of_compat_data compat_data[] = {
 	{"allwinner,sun4i-a10-hdmi", HDMI_A10},
-	{"allwinner,sun7i-a20-hdmi", HDMI_A20},
+	{"allwinner,sun7i-a20-hdmi", HDMI_A10},
 	{NULL}
 };
 
@@ -618,7 +617,7 @@ sunxi_hdmi_do_enable(struct sunxi_hdmi_s
 
 	HDMI_WRITE(sc, SUNXI_HDMI_CTRL_REG, SUNXI_HDMI_CTRL_MODULE_EN);
 	delay(1000);
-	if (sc->sc_type == HDMI_A20) {
+	if (sc->sc_type == HDMI_A10) {
 		HDMI_WRITE(sc, SUNXI_HDMI_PAD_CTRL0_REG, 0xfe80);
 		HDMI_WRITE(sc, SUNXI_HDMI_PAD_CTRL1_REG, 0x00d8c830);
 	} else if (sc->sc_type == HDMI_A31) {
Index: src/sys/arch/arm/sunxi/sunxi_tcon.c
diff -u src/sys/arch/arm/sunxi/sunxi_tcon.c:1.1 src/sys/arch/arm/sunxi/sunxi_tcon.c:1.2
--- src/sys/arch/arm/sunxi/sunxi_tcon.c:1.1	Tue Apr  3 12:52:16 2018
+++ src/sys/arch/arm/sunxi/sunxi_tcon.c	Tue Apr  3 13:38:13 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_tcon.c,v 1.1 2018/04/03 12:52:16 bouyer Exp $ */
+/* $NetBSD: sunxi_tcon.c,v 1.2 2018/04/03 13:38:13 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2018 Manuel Bouyer 
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_tcon.c,v 1.1 2018/04/03 12:52:16 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_tcon.c,v 1.2 2018/04/03 13:38:13 bouyer Exp $");
 
 #include 
 #include 
@@ -54,7 +54,6 @@ 

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

2018-04-03 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Apr  3 16:01:25 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sun4i_a10_gpio.c sun50i_a64_gpio.c
sun50i_h6_gpio.c sun5i_a13_gpio.c sun6i_a31_gpio.c sun7i_a20_gpio.c
sun8i_a83t_gpio.c sun8i_h3_gpio.c sun9i_a80_gpio.c sunxi_gpio.c

Log Message:
Consistently name the interrupt function "irq" and use this name
in sunxi_gpio_establish(). This is the name used by linux.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/sunxi/sun4i_a10_gpio.c \
src/sys/arch/arm/sunxi/sun7i_a20_gpio.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sun50i_a64_gpio.c \
src/sys/arch/arm/sunxi/sun50i_h6_gpio.c \
src/sys/arch/arm/sunxi/sun8i_a83t_gpio.c \
src/sys/arch/arm/sunxi/sun8i_h3_gpio.c \
src/sys/arch/arm/sunxi/sun9i_a80_gpio.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/sunxi/sun5i_a13_gpio.c \
src/sys/arch/arm/sunxi/sun6i_a31_gpio.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/sunxi/sunxi_gpio.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/sun4i_a10_gpio.c
diff -u src/sys/arch/arm/sunxi/sun4i_a10_gpio.c:1.3 src/sys/arch/arm/sunxi/sun4i_a10_gpio.c:1.4
--- src/sys/arch/arm/sunxi/sun4i_a10_gpio.c:1.3	Tue Apr  3 10:10:17 2018
+++ src/sys/arch/arm/sunxi/sun4i_a10_gpio.c	Tue Apr  3 16:01:25 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sun4i_a10_gpio.c,v 1.3 2018/04/03 10:10:17 bouyer Exp $ */
+/* $NetBSD: sun4i_a10_gpio.c,v 1.4 2018/04/03 16:01:25 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2016 Emmanuel Vadot 
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sun4i_a10_gpio.c,v 1.3 2018/04/03 10:10:17 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sun4i_a10_gpio.c,v 1.4 2018/04/03 16:01:25 bouyer Exp $");
 
 #include 
 #include 
@@ -170,28 +170,28 @@ static const struct sunxi_gpio_pins a10_
 	{"PG10", 6, 10, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}},
 	{"PG11", 6, 11, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}},
 
-	{"PH0",  7,  0, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}, 6, 0},
-	{"PH1",  7,  1, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}, 6, 1},
-	{"PH2",  7,  2, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}, 6, 2},
-	{"PH3",  7,  3, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}, 6, 3},
-	{"PH4",  7,  4, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint", "csi1"}, 6, 4},
-	{"PH5",  7,  5, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint", "csi1"}, 6, 5},
-	{"PH6",  7,  6, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint", "csi1"}, 6, 6},
-	{"PH7",  7,  7, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint", "csi1"}, 6, 7},
-	{"PH8",  7,  8, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}, 6, 8},
-	{"PH9",  7,  9, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}, 6, 9},
-	{"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}, 6, 10},
-	{"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}, 6, 11},
-	{"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", NULL, "eint", "csi1"}, 6, 12},
-	{"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", "sim", "eint", "csi1"}, 6, 13},
-	{"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}, 6, 14},
-	{"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}, 6, 15},
-	{"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", NULL, "eint", "csi1"}, 6, 16},
-	{"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}, 6, 17},
-	{"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}, 6, 18},
-	{"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}, 6, 19},
-	{"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint", "csi1"}, 6, 20},
-	{"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint", "csi1"}, 6, 21},
+	{"PH0",  7,  0, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "irq", "csi1"}, 6, 0},
+	{"PH1",  7,  1, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "irq", "csi1"}, 6, 1},
+	{"PH2",  7,  2, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "irq", "csi1"}, 6, 2},
+	{"PH3",  7,  3, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "irq", "csi1"}, 6, 3},
+	{"PH4",  7,  4, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "irq", "csi1"}, 6, 4},
+	{"PH5",  7,  5, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "irq", "csi1"}, 6, 5},
+	{"PH6",  7,  6, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "irq", "csi1"}, 6, 6},
+	{"PH7",  7,  7, 

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

2018-04-03 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Apr  3 16:17:59 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sunxi_debe.c sunxi_hdmi.c sunxi_tcon.c

Log Message:
disable all clocks at end of attach function, and re-enable ahb and mod only
in activate function.
enable ram gate (in debe) and video plls (in tcon) only when the video output
is enabled. Saves about 20mw when both video outputs are off.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/sunxi/sunxi_debe.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/sunxi/sunxi_hdmi.c \
src/sys/arch/arm/sunxi/sunxi_tcon.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_debe.c
diff -u src/sys/arch/arm/sunxi/sunxi_debe.c:1.4 src/sys/arch/arm/sunxi/sunxi_debe.c:1.5
--- src/sys/arch/arm/sunxi/sunxi_debe.c:1.4	Tue Apr  3 13:38:13 2018
+++ src/sys/arch/arm/sunxi/sunxi_debe.c	Tue Apr  3 16:17:59 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_debe.c,v 1.4 2018/04/03 13:38:13 bouyer Exp $ */
+/* $NetBSD: sunxi_debe.c,v 1.5 2018/04/03 16:17:59 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2018 Manuel Bouyer 
@@ -38,7 +38,7 @@
 #define SUNXI_DEBE_CURMAX	64
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_debe.c,v 1.4 2018/04/03 13:38:13 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_debe.c,v 1.5 2018/04/03 16:17:59 bouyer Exp $");
 
 #include 
 #include 
@@ -204,11 +204,13 @@ sunxi_debe_attach(device_t parent, devic
 	}
 
 	if (clk_enable(sc->sc_clk_ahb) != 0 ||
-	clk_enable(sc->sc_clk_mod) != 0 ||
-	clk_enable(sc->sc_clk_ram) != 0) {
+	clk_enable(sc->sc_clk_mod) != 0) {
 		aprint_error(": couldn't enable clocks\n");
 		return;
 	}
+	if (clk_disable(sc->sc_clk_ram) != 0) {
+		aprint_error(": couldn't disable ram clock\n");
+	}
 
 	sc->sc_type = of_search_compatible(faa->faa_phandle, compat_data)->data;
 
@@ -278,6 +280,12 @@ sunxi_debe_attach(device_t parent, devic
 #ifdef AWIN_DEBE_FWINIT
 	sunxi_debe_set_videomode(device_unit(self), );
 	sunxi_debe_enable(device_unit(self), true);
+#else
+	if (clk_disable(sc->sc_clk_ahb) != 0 ||
+	clk_disable(sc->sc_clk_mod) != 0) {
+		aprint_error(": couldn't disable clocks\n");
+		return;
+	}
 #endif
 }
 
@@ -520,6 +528,10 @@ sunxi_debe_ep_enable(device_t dev, struc
 	sc = device_private(dev);
 
 	if (enable) {
+		if (clk_enable(sc->sc_clk_ram) != 0) {
+			device_printf(dev,
+			": warning: failed to enable ram clock\n");
+		}
 		val = DEBE_READ(sc, SUNXI_DEBE_REGBUFFCTL_REG);
 		val |= SUNXI_DEBE_REGBUFFCTL_REGLOADCTL;
 		DEBE_WRITE(sc, SUNXI_DEBE_REGBUFFCTL_REG, val);
@@ -534,6 +546,10 @@ sunxi_debe_ep_enable(device_t dev, struc
 		val = DEBE_READ(sc, SUNXI_DEBE_MODCTL_REG);
 		val &= ~SUNXI_DEBE_MODCTL_START_CTL;
 		DEBE_WRITE(sc, SUNXI_DEBE_MODCTL_REG, val);
+		if (clk_disable(sc->sc_clk_ram) != 0) {
+			device_printf(dev,
+			": warning: failed to disable ram clock\n");
+		}
 	}
 #if 0
 	for (int i = 0; i < 0x1000; i += 4) {
@@ -860,6 +876,11 @@ sunxi_debe_pipeline(int phandle, bool ac
 			break;
 	}
 	aprint_normal("activate %s\n", device_xname(dev));
+	if (clk_enable(sc->sc_clk_ahb) != 0 ||
+	clk_enable(sc->sc_clk_mod) != 0) {
+		aprint_error_dev(dev, "couldn't enable clocks\n");
+		return EIO;
+	}
 	/* connect debd0 to tcon0, debe1 to tcon1 */
 	ep = fdt_endpoint_get_from_index(>sc_ports, SUNXI_PORT_OUTPUT,
 	sc->sc_unit);

Index: src/sys/arch/arm/sunxi/sunxi_hdmi.c
diff -u src/sys/arch/arm/sunxi/sunxi_hdmi.c:1.2 src/sys/arch/arm/sunxi/sunxi_hdmi.c:1.3
--- src/sys/arch/arm/sunxi/sunxi_hdmi.c:1.2	Tue Apr  3 13:38:13 2018
+++ src/sys/arch/arm/sunxi/sunxi_hdmi.c	Tue Apr  3 16:17:59 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_hdmi.c,v 1.2 2018/04/03 13:38:13 bouyer Exp $ */
+/* $NetBSD: sunxi_hdmi.c,v 1.3 2018/04/03 16:17:59 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "opt_ddb.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_hdmi.c,v 1.2 2018/04/03 13:38:13 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_hdmi.c,v 1.3 2018/04/03 16:17:59 bouyer Exp $");
 
 #include 
 #include 
@@ -237,6 +237,10 @@ sunxi_hdmi_attach(device_t parent, devic
 	mutex_init(>sc_pwr_lock, MUTEX_DEFAULT, IPL_NONE);
 	sunxi_hdmi_i2c_init(sc);
 
+	if (clk_disable(sc->sc_clk_ahb) != 0) {
+		aprint_error(": couldn't disable ahb clock\n");
+		return;
+	}
 }
 
 static void
@@ -580,6 +584,10 @@ sunxi_hdmi_do_enable(struct sunxi_hdmi_s
 	int error;
 	uint32_t dbg0_reg;
 
+	if (clk_enable(sc->sc_clk_ahb) != 0) {
+		aprint_error_dev(sc->sc_dev, "couldn't enable ahb clock\n");
+		return;
+	}
 	/* assume tcon0 uses pll3, tcon1 uses pll7 */
 	switch(fdt_endpoint_index(sc->sc_in_ep)) {
 	case 0:
@@ -805,6 +813,7 @@ sunxi_hdmi_video_enable(struct sunxi_hdm
 	uint32_t val;
 
 	fdt_endpoint_enable(sc->sc_out_ep, enable);
+
 	val = HDMI_READ(sc, SUNXI_HDMI_VID_CTRL_REG);
 	val &= 

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

2018-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr  3 18:03:16 UTC 2018

Modified Files:
src/distrib/sets/lists/debug: mi

Log Message:
the zombie test is not a rump test.


To generate a diff of this commit:
cvs rdiff -u -r1.245 -r1.246 src/distrib/sets/lists/debug/mi

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

Modified files:

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.245 src/distrib/sets/lists/debug/mi:1.246
--- src/distrib/sets/lists/debug/mi:1.245	Tue Mar 13 22:13:47 2018
+++ src/distrib/sets/lists/debug/mi	Tue Apr  3 14:03:16 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.245 2018/03/14 02:13:47 kamil Exp $
+# $NetBSD: mi,v 1.246 2018/04/03 18:03:16 christos Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -1750,7 +1750,7 @@
 ./usr/libdata/debug/usr/tests/kernel/t_timeleft.debug			tests-kernel-tests	debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/kernel/t_ucontext.debug			tests-obsolete		obsolete,compattestfile
 ./usr/libdata/debug/usr/tests/kernel/t_writev.debug			tests-obsolete		obsolete,compattestfile
-./usr/libdata/debug/usr/tests/kernel/t_zombie.debug			tests-kernel-tests	debug,atf,rump
+./usr/libdata/debug/usr/tests/kernel/t_zombie.debug			tests-kernel-tests	debug,atf
 ./usr/libdata/debug/usr/tests/kernel/tty/t_pr.debug			tests-kernel-tests	debug,atf,rump
 ./usr/libdata/debug/usr/tests/kyua-cli/bootstrap/atf_helpers.debug			tests-kyua-tests	debug,atf,kyua,compattestfile
 ./usr/libdata/debug/usr/tests/kyua-cli/bootstrap/plain_helpers.debug			tests-kyua-tests	debug,atf,kyua,compattestfile



CVS commit: xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting

2018-04-03 Thread Ryo Shimizu
Module Name:xsrc
Committed By:   ryo
Date:   Tue Apr  3 19:53:57 UTC 2018

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting:
driver.h present.c vblank.c

Log Message:
Fix compile error on evbarm-aarch64. (incompatible pointer types initializing 
'present_get_ust_msc_ptr')


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/driver.h \
xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/present.c
cvs rdiff -u -r1.2 -r1.3 \
xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/vblank.c

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

Modified files:

Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/driver.h
diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/driver.h:1.1.1.1 xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/driver.h:1.2
--- xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/driver.h:1.1.1.1	Wed Aug 10 07:44:34 2016
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/driver.h	Tue Apr  3 19:53:57 2018
@@ -139,7 +139,7 @@ xf86CrtcPtr ms_dri2_crtc_covering_drawab
 xf86CrtcPtr ms_covering_crtc(ScrnInfoPtr scrn, BoxPtr box,
  xf86CrtcPtr desired, BoxPtr crtc_box_ret);
 
-int ms_get_crtc_ust_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc);
+int ms_get_crtc_ust_msc(xf86CrtcPtr crtc, uint64_t *ust, uint64_t *msc);
 
 uint32_t ms_crtc_msc_to_kernel_msc(xf86CrtcPtr crtc, uint64_t expect);
 uint64_t ms_kernel_msc_to_crtc_msc(xf86CrtcPtr crtc, uint32_t sequence);
Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/present.c
diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/present.c:1.1.1.1 xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/present.c:1.2
--- xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/present.c:1.1.1.1	Wed Aug 10 07:44:34 2016
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/present.c	Tue Apr  3 19:53:57 2018
@@ -64,7 +64,7 @@ ms_present_get_crtc(WindowPtr window)
 }
 
 static int
-ms_present_get_ust_msc(RRCrtcPtr crtc, CARD64 *ust, CARD64 *msc)
+ms_present_get_ust_msc(RRCrtcPtr crtc, uint64_t *ust, uint64_t *msc)
 {
 xf86CrtcPtr xf86_crtc = crtc->devPrivate;
 

Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/vblank.c
diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/vblank.c:1.2 xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/vblank.c:1.3
--- xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/vblank.c:1.2	Fri Oct  7 16:08:48 2016
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/drivers/modesetting/vblank.c	Tue Apr  3 19:53:57 2018
@@ -196,7 +196,7 @@ ms_kernel_msc_to_crtc_msc(xf86CrtcPtr cr
 }
 
 int
-ms_get_crtc_ust_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc)
+ms_get_crtc_ust_msc(xf86CrtcPtr crtc, uint64_t *ust, uint64_t *msc)
 {
 uint32_t kernel_msc;
 



CVS commit: src/libexec/ld.elf_so

2018-04-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Apr  3 21:10:28 UTC 2018

Modified Files:
src/libexec/ld.elf_so: reloc.c rtld.c rtld.h
src/libexec/ld.elf_so/arch/arm: Makefile.inc mdreloc.c
src/libexec/ld.elf_so/arch/i386: Makefile.inc mdreloc.c
src/libexec/ld.elf_so/arch/powerpc: Makefile.inc ppc_reloc.c
src/libexec/ld.elf_so/arch/sparc: Makefile.inc mdreloc.c
src/libexec/ld.elf_so/arch/sparc64: Makefile.inc mdreloc.c
src/libexec/ld.elf_so/arch/x86_64: Makefile.inc mdreloc.c

Log Message:
Rework ifunc support to address a number of short comings:
- Move to a shared _rtld_call_ifunc for rel and rela architectures
- Architectures using rel format must patch IRELATIVE non-PLT
  relocations like RELATIVE in additition to the later ifunc handling
- Consistently record the delta to the end of the relocation group for
  non-PLT IRELATIVE relocations

Hidden ifunc is now supported on all ifunc platforms, even when using
-fno-plt. The combination of -fno-plt and relro is broken due to
incorrect GNU ld output though.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/libexec/ld.elf_so/reloc.c
cvs rdiff -u -r1.191 -r1.192 src/libexec/ld.elf_so/rtld.c
cvs rdiff -u -r1.132 -r1.133 src/libexec/ld.elf_so/rtld.h
cvs rdiff -u -r1.20 -r1.21 src/libexec/ld.elf_so/arch/arm/Makefile.inc
cvs rdiff -u -r1.43 -r1.44 src/libexec/ld.elf_so/arch/arm/mdreloc.c
cvs rdiff -u -r1.14 -r1.15 src/libexec/ld.elf_so/arch/i386/Makefile.inc
cvs rdiff -u -r1.40 -r1.41 src/libexec/ld.elf_so/arch/i386/mdreloc.c
cvs rdiff -u -r1.15 -r1.16 src/libexec/ld.elf_so/arch/powerpc/Makefile.inc
cvs rdiff -u -r1.56 -r1.57 src/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c
cvs rdiff -u -r1.14 -r1.15 src/libexec/ld.elf_so/arch/sparc/Makefile.inc
cvs rdiff -u -r1.54 -r1.55 src/libexec/ld.elf_so/arch/sparc/mdreloc.c
cvs rdiff -u -r1.8 -r1.9 src/libexec/ld.elf_so/arch/sparc64/Makefile.inc
cvs rdiff -u -r1.68 -r1.69 src/libexec/ld.elf_so/arch/sparc64/mdreloc.c
cvs rdiff -u -r1.7 -r1.8 src/libexec/ld.elf_so/arch/x86_64/Makefile.inc
cvs rdiff -u -r1.46 -r1.47 src/libexec/ld.elf_so/arch/x86_64/mdreloc.c

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

Modified files:

Index: src/libexec/ld.elf_so/reloc.c
diff -u src/libexec/ld.elf_so/reloc.c:1.111 src/libexec/ld.elf_so/reloc.c:1.112
--- src/libexec/ld.elf_so/reloc.c:1.111	Thu Aug 10 19:03:25 2017
+++ src/libexec/ld.elf_so/reloc.c	Tue Apr  3 21:10:27 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: reloc.c,v 1.111 2017/08/10 19:03:25 joerg Exp $	 */
+/*	$NetBSD: reloc.c,v 1.112 2018/04/03 21:10:27 joerg Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -39,7 +39,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: reloc.c,v 1.111 2017/08/10 19:03:25 joerg Exp $");
+__RCSID("$NetBSD: reloc.c,v 1.112 2018/04/03 21:10:27 joerg Exp $");
 #endif /* not lint */
 
 #include 
@@ -276,3 +276,93 @@ _rtld_resolve_ifunc2(const Obj_Entry *ob
 
 	return target;
 }
+
+#ifdef RTLD_COMMON_CALL_IFUNC_RELA
+#  ifdef __sparc__
+#  include 
+#  endif
+
+void
+_rtld_call_ifunc(Obj_Entry *obj, sigset_t *mask, u_int cur_objgen)
+{
+	const Elf_Rela *rela;
+	Elf_Addr *where;
+#ifdef __sparc__
+	Elf_Word *where2;
+#endif
+	Elf_Addr target;
+
+	while (obj->ifunc_remaining > 0 && _rtld_objgen == cur_objgen) {
+		rela = obj->pltrelalim - obj->ifunc_remaining--;
+#ifdef __sparc__
+#define PLT_IRELATIVE R_TYPE(JMP_IREL)
+#else
+#define PLT_IRELATIVE R_TYPE(IRELATIVE)
+#endif
+		if (ELF_R_TYPE(rela->r_info) != PLT_IRELATIVE)
+			continue;
+#ifdef __sparc__
+		where2 = (Elf_Word *)(obj->relocbase + rela->r_offset);
+#else
+		where = (Elf_Addr *)(obj->relocbase + rela->r_offset);
+#endif
+		target = (Elf_Addr)(obj->relocbase + rela->r_addend);
+		_rtld_exclusive_exit(mask);
+		target = _rtld_resolve_ifunc2(obj, target);
+		_rtld_exclusive_enter(mask);
+#ifdef __sparc__
+		sparc_write_branch(where2 + 1, (void *)target);
+#else
+		if (*where != target)
+			*where = target;
+#endif
+	}
+
+	while (obj->ifunc_remaining_nonplt > 0 && _rtld_objgen == cur_objgen) {
+		rela = obj->relalim - obj->ifunc_remaining_nonplt--;
+		if (ELF_R_TYPE(rela->r_info) != R_TYPE(IRELATIVE))
+			continue;
+		where = (Elf_Addr *)(obj->relocbase + rela->r_offset);
+		target = (Elf_Addr)(obj->relocbase + rela->r_addend);
+		_rtld_exclusive_exit(mask);
+		target = _rtld_resolve_ifunc2(obj, target);
+		_rtld_exclusive_enter(mask);
+		if (*where != target)
+			*where = target;
+	}
+}
+#endif
+
+#ifdef RTLD_COMMON_CALL_IFUNC_REL
+void
+_rtld_call_ifunc(Obj_Entry *obj, sigset_t *mask, u_int cur_objgen)
+{
+	const Elf_Rel *rel;
+	Elf_Addr *where, target;
+
+	while (obj->ifunc_remaining > 0 && _rtld_objgen == cur_objgen) {
+		rel = obj->pltrellim - obj->ifunc_remaining;
+		--obj->ifunc_remaining;
+		if (ELF_R_TYPE(rel->r_info) == R_TYPE(IRELATIVE)) {
+			where = (Elf_Addr *)(obj->relocbase + rel->r_offset);
+			_rtld_exclusive_exit(mask);
+			target = 

CVS commit: src/crypto/external/bsd/netpgp/dist/src

2018-04-03 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Tue Apr  3 21:57:15 UTC 2018

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/lib: libnetpgp.3
src/crypto/external/bsd/netpgp/dist/src/libbn: libnetpgpbn.3
src/crypto/external/bsd/netpgp/dist/src/libmj: libmj.3
src/crypto/external/bsd/netpgp/dist/src/netpgpverify: netpgpverify.1

Log Message:
Some further changes from PR bin/48395.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3
cvs rdiff -u -r1.4 -r1.5 \
src/crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3
cvs rdiff -u -r1.7 -r1.8 \
src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3
cvs rdiff -u -r1.11 -r1.12 \
src/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1

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/netpgp/dist/src/lib/libnetpgp.3
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3:1.18 src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3:1.19
--- src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3:1.18	Mon Apr  2 10:30:06 2018
+++ src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3	Tue Apr  3 21:57:14 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: libnetpgp.3,v 1.18 2018/04/02 10:30:06 sevan Exp $
+.\" $NetBSD: libnetpgp.3,v 1.19 2018/04/03 21:57:14 sevan Exp $
 .\"
 .\" Copyright (c) 2009,2010 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 February 16, 2014
+.Dd April 03, 2018
 .Dt LIBNETPGP 3
 .Os
 .Sh NAME
@@ -223,13 +223,13 @@ Output is sent to the standard output.
 .Pp
 To import a key onto the public keyring, the
 .Fn netpgp_import_key
-is used.
+function is used.
 The name of the file containing the key to be imported is provided
 as the filename argument.
 .Pp
 To generate a key, the
 .Fn netpgp_generate_key
-is used.
+function is used.
 It takes an argument of the number of bits to use in the key.
 At the time that this manual page was created (April 2009),
 the recommendations are that the bare minimum key size

Index: src/crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3
diff -u src/crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3:1.4 src/crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3:1.5
--- src/crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3:1.4	Mon Feb 17 07:23:18 2014
+++ src/crypto/external/bsd/netpgp/dist/src/libbn/libnetpgpbn.3	Tue Apr  3 21:57:14 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: libnetpgpbn.3,v 1.4 2014/02/17 07:23:18 agc Exp $
+.\" $NetBSD: libnetpgpbn.3,v 1.5 2018/04/03 21:57:14 sevan Exp $
 .\"
 .\" Copyright (c) 2010 Alistair Crooks 
 .\" All rights reserved.
@@ -23,7 +23,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 16, 2014
+.Dd April 03, 2018
 .Dt LIBNETPGPBN 3
 .Os
 .Sh NAME
@@ -257,7 +257,7 @@ in the
 buffer called
 .Va buf
 where
-.Dq USERNAME
+.Dq USER
 is the name of the user taken from the runtime environment.
 The encoded text will be in an allocated buffer called
 .Va s .

Index: src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3
diff -u src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3:1.7 src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3:1.8
--- src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3:1.7	Mon Feb 17 07:23:18 2014
+++ src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3	Tue Apr  3 21:57:14 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: libmj.3,v 1.7 2014/02/17 07:23:18 agc Exp $
+.\" $NetBSD: libmj.3,v 1.8 2018/04/03 21:57:14 sevan Exp $
 .\"
 .\" Copyright (c) 2010 Alistair Crooks 
 .\" All rights reserved.
@@ -23,7 +23,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 16, 2014
+.Dd April 03, 2018
 .Dt LIBMJ 3
 .Os
 .Sh NAME
@@ -227,10 +227,10 @@ in the
 buffer called
 .Va buf
 where
-.Dq USERNAME
+.Dq USER
 is the name of the user taken from the runtime environment.
 The encoded text will be in an allocated buffer called
-.Va s
+.Va s .
 .Bd -literal -offset indent
 mj_t atom;
 char buf[BUFSIZ];

Index: src/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1
diff -u src/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1:1.11 src/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1:1.12
--- src/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1:1.11	Mon Apr 17 19:50:28 2017
+++ src/crypto/external/bsd/netpgp/dist/src/netpgpverify/netpgpverify.1	Tue Apr  3 21:57:14 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: netpgpverify.1,v 1.11 2017/04/17 19:50:28 agc Exp $
+.\" 

CVS commit: src/sys/netinet

2018-04-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr  3 08:02:34 UTC 2018

Modified Files:
src/sys/netinet: tcp_output.c

Log Message:
bcopy -> memcpy, it's obvious the areas don't overlap.


To generate a diff of this commit:
cvs rdiff -u -r1.204 -r1.205 src/sys/netinet/tcp_output.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/tcp_output.c
diff -u src/sys/netinet/tcp_output.c:1.204 src/sys/netinet/tcp_output.c:1.205
--- src/sys/netinet/tcp_output.c:1.204	Sun Apr  1 12:58:47 2018
+++ src/sys/netinet/tcp_output.c	Tue Apr  3 08:02:34 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_output.c,v 1.204 2018/04/01 12:58:47 maxv Exp $	*/
+/*	$NetBSD: tcp_output.c,v 1.205 2018/04/03 08:02:34 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -135,7 +135,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.204 2018/04/01 12:58:47 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.205 2018/04/03 08:02:34 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -299,7 +299,7 @@ tcp_segsize(struct tcpcb *tp, int *txseg
 		if (IN6_IS_ADDR_V4MAPPED(>in6p_faddr)) {
 			/* mapped addr case */
 			struct in_addr d;
-			bcopy(>in6p_faddr.s6_addr32[3], , sizeof(d));
+			memcpy(, >in6p_faddr.s6_addr32[3], sizeof(d));
 			if (tp->t_mtudisc || in_localaddr(d))
 size = ifp->if_mtu - hdrlen;
 		} else {
@@ -1400,7 +1400,7 @@ reset:			TCP_REASS_UNLOCK(tp);
 	}
 	th->th_ack = htonl(tp->rcv_nxt);
 	if (optlen) {
-		bcopy((void *)opt, (void *)(th + 1), optlen);
+		memcpy(th + 1, opt, optlen);
 		th->th_off = (sizeof (struct tcphdr) + optlen) >> 2;
 	}
 	th->th_flags = flags;



CVS commit: src/external/mit/xorg/lib/libxcb/dri3

2018-04-03 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Tue Apr  3 08:18:11 UTC 2018

Modified Files:
src/external/mit/xorg/lib/libxcb/dri3: Makefile

Log Message:
Fix build with "USE_SSP=yes".


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/mit/xorg/lib/libxcb/dri3/Makefile

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

Modified files:

Index: src/external/mit/xorg/lib/libxcb/dri3/Makefile
diff -u src/external/mit/xorg/lib/libxcb/dri3/Makefile:1.1 src/external/mit/xorg/lib/libxcb/dri3/Makefile:1.2
--- src/external/mit/xorg/lib/libxcb/dri3/Makefile:1.1	Mon Mar 17 07:25:34 2014
+++ src/external/mit/xorg/lib/libxcb/dri3/Makefile	Tue Apr  3 08:18:11 2018
@@ -1,5 +1,7 @@
-#	$NetBSD: Makefile,v 1.1 2014/03/17 07:25:34 mrg Exp $
+#	$NetBSD: Makefile,v 1.2 2018/04/03 08:18:11 tron Exp $
 
 XCBEXT=	dri3
 
+COPTS.dri3.c +=	-Wno-stack-protector
+
 .include "../xcb.mk"



CVS commit: [pgoyette-compat] src

2018-04-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Apr  3 08:29:44 UTC 2018

Modified Files:
src/doc [pgoyette-compat]: COMPAT-branch-notes
src/lib/libc/sys [pgoyette-compat]: modctl.2
src/sbin/modstat [pgoyette-compat]: main.c
src/sys/compat/common [pgoyette-compat]: Makefile.sysio compat_80_mod.c
compat_mod.h files.common
src/sys/compat/netbsd32 [pgoyette-compat]: netbsd32_module.c
src/sys/kern [pgoyette-compat]: compat_stub.c sys_module.c
src/sys/modules/compat_80 [pgoyette-compat]: Makefile
src/sys/sys [pgoyette-compat]: compat_stub.h module.h
Added Files:
src/sys/compat/common [pgoyette-compat]: kern_mod_80.c

Log Message:
Remove fixed allocation of modules' "required" lists (previously
limited to MAXMODDEPS entries).  Update the modctl(MODCTL_STAT)
syscall to return the required data in a new format, and retain
the previous data format in MODCTL_OSTAT.  Update the compat_80
and compat_netbsd32 modules as needed.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.8 -r1.1.2.9 src/doc/COMPAT-branch-notes
cvs rdiff -u -r1.13 -r1.13.4.1 src/lib/libc/sys/modctl.2
cvs rdiff -u -r1.24.12.1 -r1.24.12.2 src/sbin/modstat/main.c
cvs rdiff -u -r1.7.18.19 -r1.7.18.20 src/sys/compat/common/Makefile.sysio
cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/sys/compat/common/compat_80_mod.c
cvs rdiff -u -r1.1.42.17 -r1.1.42.18 src/sys/compat/common/compat_mod.h
cvs rdiff -u -r1.1.2.29 -r1.1.2.30 src/sys/compat/common/files.common
cvs rdiff -u -r0 -r1.1.2.1 src/sys/compat/common/kern_mod_80.c
cvs rdiff -u -r1.6 -r1.6.2.1 src/sys/compat/netbsd32/netbsd32_module.c
cvs rdiff -u -r1.1.2.13 -r1.1.2.14 src/sys/kern/compat_stub.c
cvs rdiff -u -r1.23.2.5 -r1.23.2.6 src/sys/kern/sys_module.c
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/modules/compat_80/Makefile
cvs rdiff -u -r1.1.2.13 -r1.1.2.14 src/sys/sys/compat_stub.h
cvs rdiff -u -r1.41.14.7 -r1.41.14.8 src/sys/sys/module.h

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

Modified files:

Index: src/doc/COMPAT-branch-notes
diff -u src/doc/COMPAT-branch-notes:1.1.2.8 src/doc/COMPAT-branch-notes:1.1.2.9
--- src/doc/COMPAT-branch-notes:1.1.2.8	Wed Mar 28 03:41:26 2018
+++ src/doc/COMPAT-branch-notes	Tue Apr  3 08:29:44 2018
@@ -27,6 +27,11 @@ DONE
defopt/defflag lines in the config files* as needed, to insure that
built-in dependencies get resolved.
 
+8. Fixed limits on the number of module depedencies and maximum
+   recursion level have been removed.  Previous code for reporting
+   module status to userland has been versioned and moved to the
+   compat_80 module.
+
 
 TODO
 

Index: src/lib/libc/sys/modctl.2
diff -u src/lib/libc/sys/modctl.2:1.13 src/lib/libc/sys/modctl.2:1.13.4.1
--- src/lib/libc/sys/modctl.2:1.13	Mon Jul  3 21:32:50 2017
+++ src/lib/libc/sys/modctl.2	Tue Apr  3 08:29:44 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: modctl.2,v 1.13 2017/07/03 21:32:50 wiz Exp $
+.\"	$NetBSD: modctl.2,v 1.13.4.1 2018/04/03 08:29:44 pgoyette Exp $
 .\"
 .\" Copyright (c) 2009 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -74,9 +74,19 @@ In this case, the
 argument should be a
 .Em struct iovec
 pointing to a suitable block of memory.
-The kernel will fill this block with an array of
+The kernel will fill this block with
+.Bl -bullet 
+.It
+a count of the number of modules loaded (including aliases),
+.It
+an array of
 .Em modstat_t
-structures, one per loaded module.
+structures, one per loaded module, and
+.It
+a series of NUL-terminated strings containing the modules'
+required modules lists.
+.El
+.Pp
 If the block is not large enough, the data returned will be truncated
 to fit.
 The kernel will then update the
@@ -146,9 +156,6 @@ contains the following elements, which a
 .Bl -tag -width 
 .It Fa "char ms_name[MAXMODNAME]"
 The name of the module.
-.It Fa "char ms_required[MAXMODNAME * MAXMODDEPS]"
-The list of modules required by this module
-as a comma-delimited list of module names.
 .It Fa "modsrc_t ms_source"
 One of the following enumerated constants:
 .Bl -tag -compact -width "MODULE_SOURCE_FILESYS"
@@ -172,14 +179,13 @@ Device driver.
 Executable file format.
 .It Dv MODULE_CLASS_MISC
 Miscellaneous.
-.It Dv MODULE_CLASS_ANY
-Any module class.
-.\" XXX: is MODULE_CLASS_ANY ever returned by this interface?
 .El
 .It Fa "uint64_t ms_addr"
 The load address within the kernel.
+(This value is available only for privileged users.)
 .It Fa "u_int ms_size"
 Loaded size of the module.
+(This value is available only for privileged users.)
 .It Fa "u_int ms_refcnt"
 Current number of live references to this module.
 .It Fa "u_int ms_flags"
@@ -190,6 +196,8 @@ The "force" flag must be specified to re
 .It Dv MODFLAG_AUTO_LOADED
 The module was auto-loaded by the operating system.
 .El
+.It Fa "uint_ms_reqoffset"
+The offset (in bytes) from the beginning of the required-module data.
 .El
 .Sh RETURN 

CVS commit: src

2018-04-03 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed Apr  4 04:43:46 UTC 2018

Modified Files:
src/distrib/sets/lists/comp: mi
src/lib/libutil: Makefile opendisk.3

Log Message:
Document opendisk1() - it has been around long enough.
(pity about the name...)

XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.2185 -r1.2186 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.81 -r1.82 src/lib/libutil/Makefile
cvs rdiff -u -r1.14 -r1.15 src/lib/libutil/opendisk.3

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2185 src/distrib/sets/lists/comp/mi:1.2186
--- src/distrib/sets/lists/comp/mi:1.2185	Sun Feb 25 12:28:18 2018
+++ src/distrib/sets/lists/comp/mi	Wed Apr  4 04:43:46 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2185 2018/02/25 12:28:18 kamil Exp $
+#	$NetBSD: mi,v 1.2186 2018/04/04 04:43:46 kre Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -8387,6 +8387,7 @@
 ./usr/share/man/cat3/open_wmemstream.0		comp-c-catman		.cat
 ./usr/share/man/cat3/opendir.0			comp-c-catman		.cat
 ./usr/share/man/cat3/opendisk.0			comp-c-catman		.cat
+./usr/share/man/cat3/opendisk1.0		comp-c-catman		.cat
 ./usr/share/man/cat3/openlog.0			comp-c-catman		.cat
 ./usr/share/man/cat3/openlog_r.0		comp-c-catman		.cat
 ./usr/share/man/cat3/openpam.0			comp-c-catman		.cat,pam
@@ -16127,6 +16128,7 @@
 ./usr/share/man/html3/open_wmemstream.html	comp-c-htmlman		html
 ./usr/share/man/html3/opendir.html		comp-c-htmlman		html
 ./usr/share/man/html3/opendisk.html		comp-c-htmlman		html
+./usr/share/man/html3/opendisk1.html		comp-c-htmlman		html
 ./usr/share/man/html3/openlog.html		comp-c-htmlman		html
 ./usr/share/man/html3/openlog_r.html		comp-c-htmlman		html
 ./usr/share/man/html3/openpam.html		comp-c-htmlman		html,pam
@@ -23879,6 +23881,7 @@
 ./usr/share/man/man3/open_wmemstream.3		comp-c-man		.man
 ./usr/share/man/man3/opendir.3			comp-c-man		.man
 ./usr/share/man/man3/opendisk.3			comp-c-man		.man
+./usr/share/man/man3/opendisk1.3		comp-c-man		.man
 ./usr/share/man/man3/openlog.3			comp-c-man		.man
 ./usr/share/man/man3/openlog_r.3		comp-c-man		.man
 ./usr/share/man/man3/openpam.3			comp-c-man		.man,pam

Index: src/lib/libutil/Makefile
diff -u src/lib/libutil/Makefile:1.81 src/lib/libutil/Makefile:1.82
--- src/lib/libutil/Makefile:1.81	Sat Apr  1 14:31:05 2017
+++ src/lib/libutil/Makefile	Wed Apr  4 04:43:46 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.81 2017/04/01 14:31:05 abhinav Exp $
+#	$NetBSD: Makefile,v 1.82 2018/04/04 04:43:46 kre Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/4/93
 
 USE_SHLIBDIR=	yes
@@ -60,6 +60,7 @@ MLINKS+=login_cap.3 login_close.3
 MLINKS+=login_cap.3 setclasscontext.3
 MLINKS+=login_cap.3 setusercontext.3
 MLINKS+=loginx.3 logoutx.3 loginx.3 logwtmpx.3
+MLINKS+=opendisk.3 opendisk1.3
 MLINKS+=openpty.3 login_tty.3
 MLINKS+=openpty.3 forkpty.3
 MLINKS+=pidfile.3 pidfile_clean.3

Index: src/lib/libutil/opendisk.3
diff -u src/lib/libutil/opendisk.3:1.14 src/lib/libutil/opendisk.3:1.15
--- src/lib/libutil/opendisk.3:1.14	Sun Jan 29 05:13:55 2017
+++ src/lib/libutil/opendisk.3	Wed Apr  4 04:43:46 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: opendisk.3,v 1.14 2017/01/29 05:13:55 snj Exp $
+.\"	$NetBSD: opendisk.3,v 1.15 2018/04/04 04:43:46 kre Exp $
 .\"
 .\" Copyright (c) 1997, 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,11 +27,12 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd June 6, 2016
+.Dd April 4, 2018
 .Dt OPENDISK 3
 .Os
 .Sh NAME
-.Nm opendisk
+.Nm opendisk ,
+.Nm opendisk1
 .Nd open a disk partition
 .Sh LIBRARY
 .Lb libutil
@@ -45,6 +46,15 @@
 .Fa "size_t buflen"
 .Fa "int iscooked"
 .Fc
+.Ft int
+.Fo opendisk1
+.Fa "const char *path"
+.Fa "int flags"
+.Fa "char *buf"
+.Fa "size_t buflen"
+.Fa "int iscooked"
+.Fa "int (*ofn)(const char *, int, ...))"
+.Fc
 .Sh DESCRIPTION
 .Fn opendisk
 opens
@@ -137,15 +147,33 @@ where
 represents the raw partition of the device, as determined by
 .Xr getrawpartition 3 ,
 usually
-.Dq c .
+.Dq c
+or
+.Dq d .
 .El
 .El
+.Pp
+.Fn opendisk1
+is identical to
+.Fn opendisk
+except uses the supplied
+.Fa ofn
+function instead of
+.Xr open 2 .
+This function must be compatible
+with
+.Xr open 2
+in the parameters it takes,
+the value it returns,
+and way that errors are indicated.
 .Sh RETURN VALUES
 An open file descriptor, or -1 if the
 .Xr open 2
 failed.
 .Sh ERRORS
 .Fn opendisk
+and
+.Fn opendisk1
 may set
 .Va errno
 to one of the following values:
@@ -172,6 +200,14 @@ may also set
 to any value specified by the
 .Xr open 2
 function.
+.PP
+The
+.Fn opendisk1
+function may also set
+.Va errno
+to any value set by the
+.Fa ofn
+function.
 .Sh SEE ALSO
 .Xr open 2 ,
 .Xr getrawpartition 3
@@ -180,6 +216,13 @@ The
 .Fn