Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Sep 2019 06:08:16 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r352436 - in projects/clang900-import: . bin/sh lib/libc/yp libexec/rc/rc.d libexec/rtld-elf release/packages sbin/fsck_msdosfs share/man/man3 share/man/man9 share/misc share/mk stand/f...
Message-ID:  <201909170608.x8H68GTq008647@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Tue Sep 17 06:08:15 2019
New Revision: 352436
URL: https://svnweb.freebsd.org/changeset/base/352436

Log:
  Merge ^/head r352319 through r352435.

Added:
  projects/clang900-import/release/packages/utilities.ucl
     - copied unchanged from r352435, head/release/packages/utilities.ucl
  projects/clang900-import/share/man/man3/arb.3
     - copied unchanged from r352435, head/share/man/man3/arb.3
  projects/clang900-import/sys/sys/arb.h
     - copied unchanged from r352435, head/sys/sys/arb.h
  projects/clang900-import/tests/sys/sys/arb_test.c
     - copied unchanged from r352435, head/tests/sys/sys/arb_test.c
Modified:
  projects/clang900-import/UPDATING
  projects/clang900-import/bin/sh/histedit.c
  projects/clang900-import/lib/libc/yp/yplib.c
  projects/clang900-import/libexec/rc/rc.d/growfs
  projects/clang900-import/libexec/rtld-elf/rtld.c
  projects/clang900-import/release/packages/runtime.ucl
  projects/clang900-import/sbin/fsck_msdosfs/boot.c
  projects/clang900-import/sbin/fsck_msdosfs/dir.c
  projects/clang900-import/sbin/fsck_msdosfs/dosfs.h
  projects/clang900-import/share/man/man3/Makefile
  projects/clang900-import/share/man/man3/queue.3
  projects/clang900-import/share/man/man3/tree.3
  projects/clang900-import/share/man/man9/sbuf.9
  projects/clang900-import/share/man/man9/vm_page_wire.9
  projects/clang900-import/share/misc/committers-doc.dot
  projects/clang900-import/share/misc/committers-ports.dot
  projects/clang900-import/share/mk/bsd.mkopt.mk
  projects/clang900-import/stand/forth/support.4th
  projects/clang900-import/stand/libsa/zalloc_malloc.c
  projects/clang900-import/sys/amd64/amd64/pmap.c
  projects/clang900-import/sys/arm/freescale/imx/imx6_machdep.c
  projects/clang900-import/sys/arm/ti/am335x/am335x_dmtpps.c
  projects/clang900-import/sys/arm/ti/ti_sysc.c
  projects/clang900-import/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
  projects/clang900-import/sys/dev/iicbus/iiconf.c
  projects/clang900-import/sys/dev/iicbus/iiconf.h
  projects/clang900-import/sys/dev/uart/uart_dev_ns8250.c
  projects/clang900-import/sys/fs/fuse/fuse_internal.c
  projects/clang900-import/sys/fs/fuse/fuse_node.h
  projects/clang900-import/sys/fs/fuse/fuse_vnops.c
  projects/clang900-import/sys/fs/nfsclient/nfs_clport.c
  projects/clang900-import/sys/fs/pseudofs/pseudofs.c
  projects/clang900-import/sys/fs/pseudofs/pseudofs.h
  projects/clang900-import/sys/fs/tmpfs/tmpfs_subr.c
  projects/clang900-import/sys/kern/kern_rangelock.c
  projects/clang900-import/sys/kern/subr_pcpu.c
  projects/clang900-import/sys/kern/vfs_default.c
  projects/clang900-import/sys/kern/vfs_mount.c
  projects/clang900-import/sys/kern/vfs_mountroot.c
  projects/clang900-import/sys/kern/vfs_subr.c
  projects/clang900-import/sys/kern/vfs_vnops.c
  projects/clang900-import/sys/mips/include/pcpu.h
  projects/clang900-import/sys/mips/mips/pmap.c
  projects/clang900-import/sys/netinet/sctp_crc32.c
  projects/clang900-import/sys/netinet/tcp_sack.c
  projects/clang900-import/sys/riscv/conf/GENERIC
  projects/clang900-import/sys/riscv/riscv/clock.c
  projects/clang900-import/sys/riscv/riscv/mp_machdep.c
  projects/clang900-import/sys/sys/mount.h
  projects/clang900-import/sys/sys/pcpu.h
  projects/clang900-import/sys/sys/rangelock.h
  projects/clang900-import/sys/ufs/ffs/ffs_softdep.c
  projects/clang900-import/sys/vm/uma.h
  projects/clang900-import/sys/vm/vm_map.c
  projects/clang900-import/sys/vm/vm_page.c
  projects/clang900-import/sys/vm/vm_page.h
  projects/clang900-import/tests/sys/fs/fusefs/create.cc
  projects/clang900-import/tests/sys/fs/fusefs/default_permissions.cc
  projects/clang900-import/tests/sys/fs/fusefs/io.cc
  projects/clang900-import/tests/sys/fs/fusefs/mknod.cc
  projects/clang900-import/tests/sys/fs/fusefs/opendir.cc
  projects/clang900-import/tests/sys/sys/Makefile
  projects/clang900-import/usr.bin/calendar/calendars/calendar.freebsd
Directory Properties:
  projects/clang900-import/   (props changed)

Modified: projects/clang900-import/UPDATING
==============================================================================
--- projects/clang900-import/UPDATING	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/UPDATING	Tue Sep 17 06:08:15 2019	(r352436)
@@ -89,8 +89,8 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
 
 20190507:
 	The tap(4) driver has been folded into tun(4), and the module has been
-	renamed to tuntap.  You should update any kld_load="if_tap" or
-	kld_load="if_tun" entries in /etc/rc.conf, if_tap_load="YES" or
+	renamed to tuntap.  You should update any kld_list="if_tap" or
+	kld_list="if_tun" entries in /etc/rc.conf, if_tap_load="YES" or
 	if_tun_load="YES" entries in /boot/loader.conf to load the if_tuntap
 	module instead, and "device tap" or "device tun" entries in kernel
 	config files to select the tuntap device instead.

Modified: projects/clang900-import/bin/sh/histedit.c
==============================================================================
--- projects/clang900-import/bin/sh/histedit.c	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/bin/sh/histedit.c	Tue Sep 17 06:08:15 2019	(r352436)
@@ -122,7 +122,7 @@ histedit(void)
 				el_set(el, EL_PROMPT, getprompt);
 				el_set(el, EL_ADDFN, "sh-complete",
 				    "Filename completion",
-				    _el_fn_sh_complete);
+				    _el_fn_complete);
 			} else {
 bad:
 				out2fmt_flush("sh: can't initialize editing\n");

Modified: projects/clang900-import/lib/libc/yp/yplib.c
==============================================================================
--- projects/clang900-import/lib/libc/yp/yplib.c	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/lib/libc/yp/yplib.c	Tue Sep 17 06:08:15 2019	(r352436)
@@ -526,7 +526,7 @@ gotit:
 		tv.tv_usec = 0;
 		ysd->dom_socket = RPC_ANYSOCK;
 		ysd->dom_client = clntudp_bufcreate(&ysd->dom_server_addr,
-			YPPROG, YPVERS, tv, &ysd->dom_socket, 1280, 2304);
+		    YPPROG, YPVERS, tv, &ysd->dom_socket, 65507, 65507);
 		if (ysd->dom_client == NULL) {
 			clnt_pcreateerror("clntudp_create");
 			ysd->dom_vers = -1;

Modified: projects/clang900-import/libexec/rc/rc.d/growfs
==============================================================================
--- projects/clang900-import/libexec/rc/rc.d/growfs	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/libexec/rc/rc.d/growfs	Tue Sep 17 06:08:15 2019	(r352436)
@@ -31,7 +31,7 @@
 # BEFORE: sysctl
 # KEYWORD: firstboot
 
-# This allows us to distribute a image
+# This allows us to distribute an image
 # and have it work on essentially any size drive.
 #
 # TODO: Figure out where this should really be ordered.

Modified: projects/clang900-import/libexec/rtld-elf/rtld.c
==============================================================================
--- projects/clang900-import/libexec/rtld-elf/rtld.c	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/libexec/rtld-elf/rtld.c	Tue Sep 17 06:08:15 2019	(r352436)
@@ -499,6 +499,13 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr
 		    if (auxp->a_type == AT_NULL)
 			    break;
 		}
+		/* Since the auxiliary vector has moved, redigest it. */
+		for (i = 0;  i < AT_COUNT;  i++)
+		    aux_info[i] = NULL;
+		for (auxp = aux;  auxp->a_type != AT_NULL;  auxp++) {
+		    if (auxp->a_type < AT_COUNT)
+			aux_info[auxp->a_type] = auxp;
+		}
 	    } else {
 		_rtld_error("No binary");
 		rtld_die();

Modified: projects/clang900-import/release/packages/runtime.ucl
==============================================================================
--- projects/clang900-import/release/packages/runtime.ucl	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/release/packages/runtime.ucl	Tue Sep 17 06:08:15 2019	(r352436)
@@ -18,7 +18,6 @@ desc = <<EOD
 EOD
 scripts: {
 	post-install = <<EOD
-	cap_mkdb %CAP_MKDB_ENDIAN% ${PKG_ROOTDIR}/etc/login.conf
 	pwd_mkdb -i -p -d  ${PKG_ROOTDIR}/etc ${PKG_ROOTDIR}/etc/master.passwd
 	services_mkdb %CAP_MKDB_ENDIAN% -q -o ${PKG_ROOTDIR}/var/db/services.db ${PKG_ROOTDIR}/etc/services
 	chmod 1777 ${PKG_ROOTDIR}/tmp

Copied: projects/clang900-import/release/packages/utilities.ucl (from r352435, head/release/packages/utilities.ucl)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/clang900-import/release/packages/utilities.ucl	Tue Sep 17 06:08:15 2019	(r352436, copy of r352435, head/release/packages/utilities.ucl)
@@ -0,0 +1,23 @@
+#
+# $FreeBSD$
+#
+
+name = "FreeBSD-%PKGNAME%"
+origin = "base"
+version = "%VERSION%"
+comment = "%COMMENT% %VCS_REVISION%"
+categories = [ base ]
+maintainer = "re@FreeBSD.org"
+www = "https://www.FreeBSD.org"
+prefix = "/"
+vital = true
+licenselogic = "single"
+licenses = [ BSD2CLAUSE ]
+desc = <<EOD
+%DESC%
+EOD
+scripts: {
+	post-install = <<EOD
+	cap_mkdb %CAP_MKDB_ENDIAN% ${PKG_ROOTDIR}/etc/login.conf
+EOD
+}

Modified: projects/clang900-import/sbin/fsck_msdosfs/boot.c
==============================================================================
--- projects/clang900-import/sbin/fsck_msdosfs/boot.c	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/sbin/fsck_msdosfs/boot.c	Tue Sep 17 06:08:15 2019	(r352436)
@@ -259,12 +259,18 @@ readboot(int dosfs, struct bootblock *boot)
 		return FSFATAL;
 	}
 
-	boot->ClusterOffset = (boot->bpbRootDirEnts * 32 +
+	boot->FirstCluster = (boot->bpbRootDirEnts * 32 +
 	    boot->bpbBytesPerSec - 1) / boot->bpbBytesPerSec +
-	    boot->bpbResSectors + boot->bpbFATs * boot->FATsecs -
-	    CLUST_FIRST * boot->bpbSecPerClust;
-	boot->NumClusters = (boot->NumSectors - boot->ClusterOffset) /
-	    boot->bpbSecPerClust;
+	    boot->bpbResSectors + boot->bpbFATs * boot->FATsecs;
+
+	if (boot->FirstCluster + boot->bpbSecPerClust > boot->NumSectors) {
+		pfatal("Cluster offset too large (%u clusters)\n",
+		    boot->FirstCluster);
+		return FSFATAL;
+	}
+
+	boot->NumClusters = (boot->NumSectors - boot->FirstCluster) / boot->bpbSecPerClust +
+	    CLUST_FIRST;
 
 	if (boot->flags & FAT32)
 		boot->ClustMask = CLUST32_MASK;

Modified: projects/clang900-import/sbin/fsck_msdosfs/dir.c
==============================================================================
--- projects/clang900-import/sbin/fsck_msdosfs/dir.c	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/sbin/fsck_msdosfs/dir.c	Tue Sep 17 06:08:15 2019	(r352436)
@@ -317,7 +317,8 @@ delete(int f, struct bootblock *boot, struct fatEntry 
 				break;
 			e = delbuf + endoff;
 		}
-		off = startcl * boot->bpbSecPerClust + boot->ClusterOffset;
+		off = (startcl - CLUST_FIRST) * boot->bpbSecPerClust + boot->FirstCluster;
+
 		off *= boot->bpbBytesPerSec;
 		if (lseek(f, off, SEEK_SET) != off) {
 			perr("Unable to lseek to %" PRId64, off);
@@ -457,7 +458,7 @@ check_subdirectory(int f, struct bootblock *boot, stru
 		off = boot->bpbResSectors + boot->bpbFATs *
 			boot->FATsecs;
 	} else {
-		off = cl * boot->bpbSecPerClust + boot->ClusterOffset;
+		off = (cl - CLUST_FIRST) * boot->bpbSecPerClust + boot->FirstCluster;
 	}
 
 	/*
@@ -538,7 +539,7 @@ readDosDirSection(int f, struct bootblock *boot, struc
 			    boot->FATsecs;
 		} else {
 			last = boot->bpbSecPerClust * boot->bpbBytesPerSec;
-			off = cl * boot->bpbSecPerClust + boot->ClusterOffset;
+			off = (cl - CLUST_FIRST) * boot->bpbSecPerClust + boot->FirstCluster;
 		}
 
 		off *= boot->bpbBytesPerSec;
@@ -1069,8 +1070,9 @@ reconnect(int dosfs, struct bootblock *boot, struct fa
 			lfcl = (lostDir->head < boot->NumClusters) ? lostDir->head : 0;
 			return FSERROR;
 		}
-		lfoff = lfcl * boot->ClusterSize
-		    + boot->ClusterOffset * boot->bpbBytesPerSec;
+		lfoff = (lfcl - CLUST_FIRST) * boot->ClusterSize
+		    + boot->FirstCluster * boot->bpbBytesPerSec;
+
 		if (lseek(dosfs, lfoff, SEEK_SET) != lfoff
 		    || (size_t)read(dosfs, lfbuf, boot->ClusterSize) != boot->ClusterSize) {
 			perr("could not read LOST.DIR");

Modified: projects/clang900-import/sbin/fsck_msdosfs/dosfs.h
==============================================================================
--- projects/clang900-import/sbin/fsck_msdosfs/dosfs.h	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/sbin/fsck_msdosfs/dosfs.h	Tue Sep 17 06:08:15 2019	(r352436)
@@ -74,7 +74,7 @@ struct bootblock {
 	u_int32_t NumSectors;		/* how many sectors are there */
 	u_int32_t FATsecs;		/* how many sectors are in FAT */
 	u_int32_t NumFatEntries;	/* how many entries really are there */
-	u_int	ClusterOffset;		/* at what sector would sector 0 start */
+	u_int	FirstCluster;		/* at what sector is Cluster CLUST_FIRST */
 	u_int	ClusterSize;		/* Cluster size in bytes */
 
 	/* Now some statistics: */

Modified: projects/clang900-import/share/man/man3/Makefile
==============================================================================
--- projects/clang900-import/share/man/man3/Makefile	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/share/man/man3/Makefile	Tue Sep 17 06:08:15 2019	(r352436)
@@ -3,7 +3,8 @@
 
 .include <src.opts.mk>
 
-MAN=		assert.3 \
+MAN=		arb.3 \
+		assert.3 \
 		ATOMIC_VAR_INIT.3 \
 		bitstring.3 \
 		CMSG_DATA.3 \
@@ -32,6 +33,42 @@ MAN=		assert.3 \
 		timeradd.3 \
 		tree.3
 
+MLINKS+=	arb.3 ARB8_ENTRY.3 \
+		arb.3 ARB16_ENTRY.3 \
+		arb.3 ARB32_ENTRY.3 \
+		arb.3 ARB8_HEAD.3 \
+		arb.3 ARB16_HEAD.3 \
+		arb.3 ARB32_HEAD.3 \
+		arb.3 ARB_ALLOCSIZE.3 \
+		arb.3 ARB_INITIALIZER.3 \
+		arb.3 ARB_ROOT.3 \
+		arb.3 ARB_EMPTY.3 \
+		arb.3 ARB_FULL.3 \
+		arb.3 ARB_CURNODES.3 \
+		arb.3 ARB_MAXNODES.3 \
+		arb.3 ARB_NEXT.3 \
+		arb.3 ARB_PREV.3 \
+		arb.3 ARB_MIN.3 \
+		arb.3 ARB_MAX.3 \
+		arb.3 ARB_FIND.3 \
+		arb.3 ARB_NFIND.3 \
+		arb.3 ARB_LEFT.3 \
+		arb.3 ARB_LEFTIDX.3 \
+		arb.3 ARB_RIGHT.3 \
+		arb.3 ARB_RIGHTIDX.3 \
+		arb.3 ARB_PARENT.3 \
+		arb.3 ARB_PARENTIDX.3 \
+		arb.3 ARB_GETFREE.3 \
+		arb.3 ARB_FREEIDX.3 \
+		arb.3 ARB_FOREACH.3 \
+		arb.3 ARB_FOREACH_FROM.3 \
+		arb.3 ARB_FOREACH_SAFE.3 \
+		arb.3 ARB_FOREACH_REVERSE.3 \
+		arb.3 ARB_FOREACH_REVERSE_FROM.3 \
+		arb.3 ARB_FOREACH_REVERSE_SAFE.3 \
+		arb.3 ARB_INIT.3 \
+		arb.3 ARB_INSERT.3 \
+		arb.3 ARB_REMOVE.3
 MLINKS=		ATOMIC_VAR_INIT.3 atomic_compare_exchange_strong.3 \
 		ATOMIC_VAR_INIT.3 atomic_compare_exchange_strong_explicit.3 \
 		ATOMIC_VAR_INIT.3 atomic_compare_exchange_weak.3 \

Copied: projects/clang900-import/share/man/man3/arb.3 (from r352435, head/share/man/man3/arb.3)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/clang900-import/share/man/man3/arb.3	Tue Sep 17 06:08:15 2019	(r352436, copy of r352435, head/share/man/man3/arb.3)
@@ -0,0 +1,483 @@
+.\"	$OpenBSD: tree.3,v 1.7 2002/06/12 01:09:20 provos Exp $
+.\"
+.\" Copyright 2002 Niels Provos <provos@citi.umich.edu>
+.\" 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.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"      This product includes software developed by Niels Provos.
+.\" 4. The name of the author may not be used to endorse or promote products
+.\"    derived from this software without specific prior written permission.
+.\"
+.\" 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.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 8, 2019
+.Dt ARB 3
+.Os
+.Sh NAME
+.Nm ARB_PROTOTYPE ,
+.Nm ARB_PROTOTYPE_STATIC ,
+.Nm ARB_PROTOTYPE_INSERT ,
+.Nm ARB_PROTOTYPE_INSERT_COLOR ,
+.Nm ARB_PROTOTYPE_REMOVE ,
+.Nm ARB_PROTOTYPE_REMOVE_COLOR ,
+.Nm ARB_PROTOTYPE_FIND ,
+.Nm ARB_PROTOTYPE_NFIND ,
+.Nm ARB_PROTOTYPE_NEXT ,
+.Nm ARB_PROTOTYPE_PREV ,
+.Nm ARB_PROTOTYPE_MINMAX ,
+.Nm ARB_GENERATE ,
+.Nm ARB_GENERATE_STATIC ,
+.Nm ARB_GENERATE_INSERT ,
+.Nm ARB_GENERATE_INSERT_COLOR ,
+.Nm ARB_GENERATE_REMOVE ,
+.Nm ARB_GENERATE_REMOVE_COLOR ,
+.Nm ARB_GENERATE_FIND ,
+.Nm ARB_GENERATE_NFIND ,
+.Nm ARB_GENERATE_NEXT ,
+.Nm ARB_GENERATE_PREV ,
+.Nm ARB_GENERATE_MINMAX ,
+.Nm ARB8_ENTRY ,
+.Nm ARB16_ENTRY ,
+.Nm ARB32_ENTRY ,
+.Nm ARB8_HEAD ,
+.Nm ARB16_HEAD ,
+.Nm ARB32_HEAD ,
+.Nm ARB_ALLOCSIZE ,
+.Nm ARB_INITIALIZER ,
+.Nm ARB_ROOT ,
+.Nm ARB_EMPTY ,
+.Nm ARB_FULL ,
+.Nm ARB_CURNODES ,
+.Nm ARB_MAXNODES ,
+.Nm ARB_NEXT ,
+.Nm ARB_PREV ,
+.Nm ARB_MIN ,
+.Nm ARB_MAX ,
+.Nm ARB_FIND ,
+.Nm ARB_NFIND ,
+.Nm ARB_LEFT ,
+.Nm ARB_LEFTIDX ,
+.Nm ARB_RIGHT ,
+.Nm ARB_RIGHTIDX ,
+.Nm ARB_PARENT ,
+.Nm ARB_PARENTIDX ,
+.Nm ARB_GETFREE ,
+.Nm ARB_FREEIDX ,
+.Nm ARB_FOREACH ,
+.Nm ARB_FOREACH_FROM ,
+.Nm ARB_FOREACH_SAFE ,
+.Nm ARB_FOREACH_REVERSE ,
+.Nm ARB_FOREACH_REVERSE_FROM ,
+.Nm ARB_FOREACH_REVERSE_SAFE ,
+.Nm ARB_INIT ,
+.Nm ARB_INSERT ,
+.Nm ARB_REMOVE
+.Nd "array-based red-black trees"
+.Sh SYNOPSIS
+.In sys/arb.h
+.Fn ARB_PROTOTYPE NAME TYPE FIELD CMP
+.Fn ARB_PROTOTYPE_STATIC NAME TYPE FIELD CMP
+.Fn ARB_PROTOTYPE_INSERT NAME TYPE ATTR
+.Fn ARB_PROTOTYPE_INSERT_COLOR NAME TYPE ATTR
+.Fn ARB_PROTOTYPE_REMOVE NAME TYPE ATTR
+.Fn ARB_PROTOTYPE_REMOVE_COLOR NAME TYPE ATTR
+.Fn ARB_PROTOTYPE_FIND NAME TYPE ATTR
+.Fn ARB_PROTOTYPE_NFIND NAME TYPE ATTR
+.Fn ARB_PROTOTYPE_NEXT NAME TYPE ATTR
+.Fn ARB_PROTOTYPE_PREV NAME TYPE ATTR
+.Fn ARB_PROTOTYPE_MINMAX NAME TYPE ATTR
+.Fn ARB_GENERATE NAME TYPE FIELD CMP
+.Fn ARB_GENERATE_STATIC NAME TYPE FIELD CMP
+.Fn ARB_GENERATE_INSERT NAME TYPE FIELD CMP ATTR
+.Fn ARB_GENERATE_INSERT_COLOR NAME TYPE FIELD ATTR
+.Fn ARB_GENERATE_REMOVE NAME TYPE FIELD ATTR
+.Fn ARB_GENERATE_REMOVE_COLOR NAME TYPE FIELD ATTR
+.Fn ARB_GENERATE_FIND NAME TYPE FIELD CMP ATTR
+.Fn ARB_GENERATE_NFIND NAME TYPE FIELD CMP ATTR
+.Fn ARB_GENERATE_NEXT NAME TYPE FIELD ATTR
+.Fn ARB_GENERATE_PREV NAME TYPE FIELD ATTR
+.Fn ARB_GENERATE_MINMAX NAME TYPE FIELD ATTR
+.Fn ARB<8|16|32>_ENTRY
+.Fn ARB<8|16|32>_HEAD HEADNAME TYPE
+.Ft "size_t"
+.Fn ARB_ALLOCSIZE "ARB_HEAD *head" "int<8|16|32>_t maxnodes" "struct TYPE *elm"
+.Fn ARB_INITIALIZER "ARB_HEAD *head" "int<8|16|32>_t maxnodes"
+.Ft "struct TYPE *"
+.Fn ARB_ROOT "ARB_HEAD *head"
+.Ft "bool"
+.Fn ARB_EMPTY "ARB_HEAD *head"
+.Ft "bool"
+.Fn ARB_FULL "ARB_HEAD *head"
+.Ft "int<8|16|32>_t"
+.Fn ARB_CURNODES "ARB_HEAD *head"
+.Ft "int<8|16|32>_t"
+.Fn ARB_MAXNODES "ARB_HEAD *head"
+.Ft "struct TYPE *"
+.Fn ARB_NEXT NAME "ARB_HEAD *head" "struct TYPE *elm"
+.Ft "struct TYPE *"
+.Fn ARB_PREV NAME "ARB_HEAD *head" "struct TYPE *elm"
+.Ft "struct TYPE *"
+.Fn ARB_MIN NAME "ARB_HEAD *head"
+.Ft "struct TYPE *"
+.Fn ARB_MAX NAME "ARB_HEAD *head"
+.Ft "struct TYPE *"
+.Fn ARB_FIND NAME "ARB_HEAD *head" "struct TYPE *elm"
+.Ft "struct TYPE *"
+.Fn ARB_NFIND NAME "ARB_HEAD *head" "struct TYPE *elm"
+.Ft "struct TYPE *"
+.Fn ARB_LEFT "struct TYPE *elm" "ARB_ENTRY NAME"
+.Ft "int<8|16|32>_t"
+.Fn ARB_LEFTIDX "struct TYPE *elm" "ARB_ENTRY NAME"
+.Ft "struct TYPE *"
+.Fn ARB_RIGHT "struct TYPE *elm" "ARB_ENTRY NAME"
+.Ft "int<8|16|32>_t"
+.Fn ARB_RIGHTIDX "struct TYPE *elm" "ARB_ENTRY NAME"
+.Ft "struct TYPE *"
+.Fn ARB_PARENT "struct TYPE *elm" "ARB_ENTRY NAME"
+.Ft "int<8|16|32>_t"
+.Fn ARB_PARENTIDX "struct TYPE *elm" "ARB_ENTRY NAME"
+.Ft "struct TYPE *"
+.Fn ARB_GETFREE "ARB_HEAD *head" "FIELD"
+.Ft "int<8|16|32>_t"
+.Fn ARB_FREEIDX "ARB_HEAD *head"
+.Fn ARB_FOREACH VARNAME NAME "ARB_HEAD *head"
+.Fn ARB_FOREACH_FROM "VARNAME" "NAME" "POS_VARNAME"
+.Fn ARB_FOREACH_SAFE "VARNAME" "NAME" "ARB_HEAD *head" "TEMP_VARNAME"
+.Fn ARB_FOREACH_REVERSE VARNAME NAME "ARB_HEAD *head"
+.Fn ARB_FOREACH_REVERSE_FROM "VARNAME" "NAME" "POS_VARNAME"
+.Fn ARB_FOREACH_REVERSE_SAFE "VARNAME" "NAME" "ARB_HEAD *head" "TEMP_VARNAME"
+.Ft void
+.Fn ARB_INIT "struct TYPE *elm" "FIELD" "ARB_HEAD *head" "int<8|16|32>_t maxnodes"
+.Ft "struct TYPE *"
+.Fn ARB_INSERT NAME "ARB_HEAD *head" "struct TYPE *elm"
+.Ft "struct TYPE *"
+.Fn ARB_REMOVE NAME "ARB_HEAD *head" "struct TYPE *elm"
+.Sh DESCRIPTION
+These macros define data structures for and array-based red-black trees.
+They use a single, continuous chunk of memory, and are useful
+e.g., when the tree needs to be transferred between userspace and kernel.
+.Pp
+In the macro definitions,
+.Fa TYPE
+is the name tag of a user defined structure that must contain a field of type
+.Vt ARB_ENTRY ,
+named
+.Fa ENTRYNAME .
+The argument
+.Fa HEADNAME
+is the name tag of a user defined structure that must be declared
+using the
+.Fn ARB_HEAD
+macro.
+The argument
+.Fa NAME
+has to be a unique name prefix for every tree that is defined.
+.Pp
+The function prototypes are declared with
+.Fn ARB_PROTOTYPE ,
+or
+.Fn ARB_PROTOTYPE_STATIC .
+The function bodies are generated with
+.Fn ARB_GENERATE ,
+or
+.Fn ARB_GENERATE_STATIC .
+See the examples below for further explanation of how these macros are used.
+.Pp
+A red-black tree is a binary search tree with the node color as an
+extra attribute.
+It fulfills a set of conditions:
+.Bl -enum -offset indent
+.It
+Every search path from the root to a leaf consists of the same number of
+black nodes.
+.It
+Each red node (except for the root) has a black parent.
+.It
+Each leaf node is black.
+.El
+.Pp
+Every operation on a red-black tree is bounded as
+.Fn O "lg n" .
+The maximum height of a red-black tree is
+.Fn 2lg "n + 1" .
+.Pp
+.Fn ARB_*
+trees require entries to be allocated as an array, and uses array
+indices to link entries together.
+The maximum number of
+.Fn ARB_*
+tree entries is therefore constrained by the minimum of array size and choice of
+signed integer data type used to store array indices.
+Use
+.Fn ARB_ALLOCSIZE
+to compute the size of memory chunk to allocate.
+.Pp
+A red-black tree is headed by a structure defined by the
+.Fn ARB_HEAD
+macro.
+A
+structure is declared with either of the following:
+.Bd -ragged -offset indent
+.Fn ARB<8|16|32>_HEAD HEADNAME TYPE
+.Va head ;
+.Ed
+.Pp
+where
+.Fa HEADNAME
+is the name of the structure to be defined, and struct
+.Fa TYPE
+is the type of the elements to be inserted into the tree.
+.Pp
+The
+.Fn ARB_HEAD
+variant includes a suffix denoting the signed integer data type size
+.Pq in bits
+used to store array indices.
+For example,
+.Fn ARB_HEAD8
+creates a red-black tree head strucutre with 8-bit signed array indices capable
+of indexing up to 128 entries.
+.Pp
+The
+.Fn ARB_ENTRY
+macro declares a structure that allows elements to be connected in the tree.
+Similarly to the
+.Fn ARB<8|16|32>_HEAD
+macro, the
+.Fn ARB_ENTRY
+variant includes a suffix denoting the signed integer data type size
+.Pq in bits
+used to store array indices.
+Entries should use the same number of bits as the tree head structure they will
+be linked into.
+.Pp
+In order to use the functions that manipulate the tree structure,
+their prototypes need to be declared with the
+.Fn ARB_PROTOTYPE
+or
+.Fn ARB_PROTOTYPE_STATIC
+macro,
+where
+.Fa NAME
+is a unique identifier for this particular tree.
+The
+.Fa TYPE
+argument is the type of the structure that is being managed
+by the tree.
+The
+.Fa FIELD
+argument is the name of the element defined by
+.Fn ARB_ENTRY .
+Individual prototypes can be declared with
+.Fn ARB_PROTOTYPE_INSERT ,
+.Fn ARB_PROTOTYPE_INSERT_COLOR ,
+.Fn ARB_PROTOTYPE_REMOVE ,
+.Fn ARB_PROTOTYPE_REMOVE_COLOR ,
+.Fn ARB_PROTOTYPE_FIND ,
+.Fn ARB_PROTOTYPE_NFIND ,
+.Fn ARB_PROTOTYPE_NEXT ,
+.Fn ARB_PROTOTYPE_PREV ,
+and
+.Fn ARB_PROTOTYPE_MINMAX
+in case not all functions are required.
+The individual prototype macros expect
+.Fa NAME ,
+.Fa TYPE ,
+and
+.Fa ATTR
+arguments.
+The
+.Fa ATTR
+argument must be empty for global functions or
+.Fa static
+for static functions.
+.Pp
+The function bodies are generated with the
+.Fn ARB_GENERATE
+or
+.Fn ARB_GENERATE_STATIC
+macro.
+These macros take the same arguments as the
+.Fn ARB_PROTOTYPE
+and
+.Fn ARB_PROTOTYPE_STATIC
+macros, but should be used only once.
+As an alternative individual function bodies are generated with the
+.Fn ARB_GENERATE_INSERT ,
+.Fn ARB_GENERATE_INSERT_COLOR ,
+.Fn ARB_GENERATE_REMOVE ,
+.Fn ARB_GENERATE_REMOVE_COLOR ,
+.Fn ARB_GENERATE_FIND ,
+.Fn ARB_GENERATE_NFIND ,
+.Fn ARB_GENERATE_NEXT ,
+.Fn ARB_GENERATE_PREV ,
+and
+.Fn ARB_GENERATE_MINMAX
+macros.
+.Pp
+Finally,
+the
+.Fa CMP
+argument is the name of a function used to compare tree nodes
+with each other.
+The function takes two arguments of type
+.Vt "struct TYPE *" .
+If the first argument is smaller than the second, the function returns a
+value smaller than zero.
+If they are equal, the function returns zero.
+Otherwise, it should return a value greater than zero.
+The compare
+function defines the order of the tree elements.
+.Pp
+The
+.Fn ARB_INIT
+macro initializes the tree referenced by
+.Fa head ,
+with the array length of
+.Fa maxnodes .
+.Pp
+The red-black tree can also be initialized statically by using the
+.Fn ARB_INITIALIZER
+macro:
+.Bd -ragged -offset indent
+.Fn ARB<8|16|32>_HEAD HEADNAME TYPE
+.Va head
+=
+.Fn ARB_INITIALIZER &head maxnodes ;
+.Ed
+.Pp
+The
+.Fn ARB_INSERT
+macro inserts the new element
+.Fa elm
+into the tree.
+.Pp
+The
+.Fn ARB_REMOVE
+macro removes the element
+.Fa elm
+from the tree pointed by
+.Fa head .
+.Pp
+The
+.Fn ARB_FIND
+and
+.Fn ARB_NFIND
+macros can be used to find a particular element in the tree.
+.Bd -literal -offset indent
+struct TYPE find, *res;
+find.key = 30;
+res = RB_FIND(NAME, head, &find);
+.Ed
+.Pp
+The
+.Fn ARB_ROOT ,
+.Fn ARB_MIN ,
+.Fn ARB_MAX ,
+.Fn ARB_NEXT ,
+and
+.Fn ARB_PREV
+macros can be used to traverse the tree:
+.Pp
+.Dl "for (np = RB_MIN(NAME, &head); np != NULL; np = RB_NEXT(NAME, &head, np))"
+.Pp
+Or, for simplicity, one can use the
+.Fn ARB_FOREACH
+or
+.Fn ARB_FOREACH_REVERSE
+macro:
+.Bd -ragged -offset indent
+.Fn RB_FOREACH np NAME head
+.Ed
+.Pp
+The macros
+.Fn ARB_FOREACH_SAFE
+and
+.Fn ARB_FOREACH_REVERSE_SAFE
+traverse the tree referenced by head
+in a forward or reverse direction respectively,
+assigning each element in turn to np.
+However, unlike their unsafe counterparts,
+they permit both the removal of np
+as well as freeing it from within the loop safely
+without interfering with the traversal.
+.Pp
+Both
+.Fn ARB_FOREACH_FROM
+and
+.Fn ARB_FOREACH_REVERSE_FROM
+may be used to continue an interrupted traversal
+in a forward or reverse direction respectively.
+The head pointer is not required.
+The pointer to the node from where to resume the traversal
+should be passed as their last argument,
+and will be overwritten to provide safe traversal.
+.Pp
+The
+.Fn ARB_EMPTY
+macro should be used to check whether a red-black tree is empty.
+.Pp
+Given that ARB trees have an intrinsic upper bound on the number of entries,
+some ARB-specific additional macros are defined.
+The
+.Fn ARB_FULL
+macro returns a boolean indicating whether the current number of tree entries
+equals the tree's maximum.
+The
+.Fn ARB_CURNODES
+and
+.Fn ARB_MAXNODES
+macros return the current and maximum number of entries respectively.
+The
+.Fn ARB_GETFREE
+macro returns a pointer to the next free entry in the array of entries, ready to
+be linked into the tree.
+The
+.Fn ARB_INSERT
+returns
+.Dv NULL
+if the element was inserted in the tree successfully, otherwise they
+return a pointer to the element with the colliding key.
+.Pp
+Accordingly,
+.Fn ARB_REMOVE
+returns the pointer to the removed element otherwise they return
+.Dv NULL
+to indicate an error.
+.Sh SEE ALSO
+.Xr queue 3 ,
+.Xr tree 3
+.Sh HISTORY
+The
+.Nm ARB
+macros first appeared in
+.Fx 13.0 .
+.Sh AUTHORS
+The
+.Nm ARB
+macros were implemented by
+.An Lawrence Stewart Aq Mt lstewart@FreeBSD.org ,
+based on
+.Xr tree 3
+macros written by
+.An Niels Provos .

Modified: projects/clang900-import/share/man/man3/queue.3
==============================================================================
--- projects/clang900-import/share/man/man3/queue.3	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/share/man/man3/queue.3	Tue Sep 17 06:08:15 2019	(r352436)
@@ -1329,6 +1329,7 @@ in
 mode.
 .El
 .Sh SEE ALSO
+.Xr arb 3 ,
 .Xr tree 3
 .Sh HISTORY
 The

Modified: projects/clang900-import/share/man/man3/tree.3
==============================================================================
--- projects/clang900-import/share/man/man3/tree.3	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/share/man/man3/tree.3	Tue Sep 17 06:08:15 2019	(r352436)
@@ -674,6 +674,7 @@ return the pointer to the removed element otherwise th
 .Dv NULL
 to indicate an error.
 .Sh SEE ALSO
+.Xr arb 3 ,
 .Xr queue 3
 .Sh AUTHORS
 The author of the tree macros is

Modified: projects/clang900-import/share/man/man9/sbuf.9
==============================================================================
--- projects/clang900-import/share/man/man9/sbuf.9	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/share/man/man9/sbuf.9	Tue Sep 17 06:08:15 2019	(r352436)
@@ -65,7 +65,12 @@
 .Sh SYNOPSIS
 .In sys/types.h
 .In sys/sbuf.h
-.Ft typedef\ int ( sbuf_drain_func ) ( void\ *arg, const\ char\ *data, int\ len ) ;
+.Ft typedef int
+.Fo (sbuf_drain_func)
+.Fa "void *arg"
+.Fa "const char *data"
+.Fa "int len"
+.Fc
 .Pp
 .Ft struct sbuf *
 .Fo sbuf_new

Modified: projects/clang900-import/share/man/man9/vm_page_wire.9
==============================================================================
--- projects/clang900-import/share/man/man9/vm_page_wire.9	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/share/man/man9/vm_page_wire.9	Tue Sep 17 06:08:15 2019	(r352436)
@@ -51,7 +51,7 @@ The
 .Fn vm_page_wire
 and
 .Fn vm_page_wire_mapped
-function wire the page, prevent it from being reclaimed by the page
+functions wire the page, which prevents it from being reclaimed by the page
 daemon or when its containing object is destroyed.
 Both functions require that the page belong to an object.
 The

Modified: projects/clang900-import/share/misc/committers-doc.dot
==============================================================================
--- projects/clang900-import/share/misc/committers-doc.dot	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/share/misc/committers-doc.dot	Tue Sep 17 06:08:15 2019	(r352436)
@@ -88,6 +88,7 @@ remko [label="Remko Lodder\nremko@FreeBSD.org\n2004/10
 rene [label="Rene Ladan\nrene@FreeBSD.org\n2008/11/03"]
 ryusuke [label="Ryusuke Suzuki\nryusuke@FreeBSD.org\n2009/12/21"]
 sevan [label="Sevan Janiyan\nsevan@FreeBSD.org\n2016/09/16"]
+sg [label="Stephen Gregoratto\nsg@FreeBSD.org\n2019/09/10"]
 simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2003/07/20"]
 skreuzer [label="Steven Kreuzer\nskreuzer@FreeBSD.org\n2014/01/15"]
 taras [label="Taras Korenko\ntaras@FreeBSD.org\n2010/06/25"]
@@ -110,6 +111,7 @@ bcr -> allanjude
 bcr -> bhd
 bcr -> sevan
 bcr -> dexter
+bcr -> sg
 
 blackend -> ale
 

Modified: projects/clang900-import/share/misc/committers-ports.dot
==============================================================================
--- projects/clang900-import/share/misc/committers-ports.dot	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/share/misc/committers-ports.dot	Tue Sep 17 06:08:15 2019	(r352436)
@@ -96,6 +96,7 @@ decke [label="Bernhard Froehlich\ndecke@FreeBSD.org\n2
 delphij [label="Xin Li\ndelphij@FreeBSD.org\n2006/05/01"]
 demon [label="Dmitry Sivachenko\ndemon@FreeBSD.org\n2000/11/13"]
 dhn [label="Dennis Herrmann\ndhn@FreeBSD.org\n2009/03/03"]
+dmgk [label="Dmitri Goutnik\ndmgk@FreeBSD.org\n2019/09/15"]
 dryice [label="Dryice Dong Liu\ndryice@FreeBSD.org\n2006/12/25"]
 dteske [label="Devin Teske\ndteske@FreeBSD.org\n2018/03/01"]
 dumbbell [label="Jean-Sebastien Pedron\ndumbbell@FreeBSD.org\n2017/01/10"]
@@ -304,6 +305,7 @@ amdmi3 -> arrowd
 
 antoine -> dumbbell
 
+araujo -> dmgk
 araujo -> egypcio
 araujo -> jhixson
 araujo -> lippe
@@ -736,6 +738,7 @@ timur -> kbowling
 tmclaugh -> itetcu
 tmclaugh -> xride
 
+tz -> dmgk
 tz -> joneum
 tz -> fernape
 tz -> mfechner

Modified: projects/clang900-import/share/mk/bsd.mkopt.mk
==============================================================================
--- projects/clang900-import/share/mk/bsd.mkopt.mk	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/share/mk/bsd.mkopt.mk	Tue Sep 17 06:08:15 2019	(r352436)
@@ -11,12 +11,16 @@
 # For each option FOO in __DEFAULT_NO_OPTIONS, MK_FOO is set to "no",
 # unless WITH_FOO is defined, in which case it is set to "yes".
 #
+# For each entry FOO/BAR in __DEFAULT_DEPENDENT_OPTIONS,
+# MK_FOO is set to "no" if WITHOUT_FOO is defined,
+# "yes" if WITH_FOO is defined, otherwise the value of MK_BAR.
+#
 # If both WITH_FOO and WITHOUT_FOO are defined, WITHOUT_FOO wins and
 # MK_FOO is set to "no" regardless of which list it was in.
 #
-# Both __DEFAULT_YES_OPTIONS and __DEFAULT_NO_OPTIONS are undef'd
-# after all this processing, allowing this file to be included
-# multiple times with different lists.
+# All of __DEFAULT_YES_OPTIONS, __DEFAULT_NO_OPTIONS and
+# __DEFAULT_DEPENDENT_OPTIONS are undef'd after all this processing,
+# allowing this file to be included multiple times with different lists.
 #
 # Other parts of the build system will set BROKEN_OPTIONS to a list
 # of options that are broken on this platform. This will not be unset

Modified: projects/clang900-import/stand/forth/support.4th
==============================================================================
--- projects/clang900-import/stand/forth/support.4th	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/stand/forth/support.4th	Tue Sep 17 06:08:15 2019	(r352436)
@@ -363,6 +363,7 @@ variable fd
 ;
 
 : line_buffer_resize  ( len -- len )
+  dup 0= if exit then
   >r
   line_buffer .len @ if
     line_buffer .addr @
@@ -376,6 +377,7 @@ variable fd
 ;
     
 : append_to_line_buffer  ( addr len -- )
+  dup 0= if 2drop exit then
   line_buffer strget
   2swap strcat
   line_buffer .len !

Modified: projects/clang900-import/stand/libsa/zalloc_malloc.c
==============================================================================
--- projects/clang900-import/stand/libsa/zalloc_malloc.c	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/stand/libsa/zalloc_malloc.c	Tue Sep 17 06:08:15 2019	(r352436)
@@ -55,6 +55,9 @@ Malloc(size_t bytes, const char *file, int line)
 {
     Guard *res;
 
+    if (bytes == 0)
+	return (NULL);
+
 #ifdef USEENDGUARD
     bytes += MALLOCALIGN + 1;
 #else

Modified: projects/clang900-import/sys/amd64/amd64/pmap.c
==============================================================================
--- projects/clang900-import/sys/amd64/amd64/pmap.c	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/sys/amd64/amd64/pmap.c	Tue Sep 17 06:08:15 2019	(r352436)
@@ -3064,10 +3064,8 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_
 {
 	pd_entry_t pde, *pdep;
 	pt_entry_t pte, PG_RW, PG_V;
-	vm_paddr_t pa;
 	vm_page_t m;
 
-	pa = 0;
 	m = NULL;
 	PG_RW = pmap_rw_bit(pmap);
 	PG_V = pmap_valid_bit(pmap);

Modified: projects/clang900-import/sys/arm/freescale/imx/imx6_machdep.c
==============================================================================
--- projects/clang900-import/sys/arm/freescale/imx/imx6_machdep.c	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/sys/arm/freescale/imx/imx6_machdep.c	Tue Sep 17 06:08:15 2019	(r352436)
@@ -148,12 +148,43 @@ fix_fdt_interrupt_data(void)
 	OF_setprop(socnode, "interrupt-parent", &gicxref, sizeof(gicxref));
 }
 
+static void
+fix_fdt_iomuxc_data(void)
+{
+	phandle_t node;
+
+	/*
+	 * The linux dts defines two nodes with the same mmio address range,
+	 * iomuxc-gpr and the regular iomuxc.  The -grp node is a simple_mfd and
+	 * a syscon, but it only has access to a small subset of the iomuxc
+	 * registers, so it can't serve as the accessor for the iomuxc driver's
+	 * register IO.  But right now, the simple_mfd driver attaches first,
+	 * preventing the real iomuxc driver from allocating its mmio register
+	 * range because it partially overlaps with the -gpr range.
+	 *
+	 * For now, by far the easiest thing to do to keep imx6 working is to
+	 * just disable the iomuxc-gpr node because we don't have a driver for
+	 * it anyway, we just need to prevent attachment of simple_mfd.
+	 *
+	 * If we ever write a -gpr driver, this code should probably switch to
+	 * modifying the reg property so that the range covers all the iomuxc
+	 * regs, then the -gpr driver can be a regular syscon driver that iomuxc
+	 * uses for register access.
+	 */
+	node = OF_finddevice("/soc/aips-bus@2000000/iomuxc-gpr@20e0000");
+	if (node != -1)
+		OF_setprop(node, "status", "disabled", sizeof("disabled"));
+}
+
 static int
 imx6_attach(platform_t plat)
 {
 
 	/* Fix soc interrupt-parent property. */
 	fix_fdt_interrupt_data();
+
+	/* Fix iomuxc-gpr and iomuxc nodes both using the same mmio range. */
+	fix_fdt_iomuxc_data();
 
 	/* Inform the MPCore timer driver that its clock is variable. */
 	arm_tmr_change_frequency(ARM_TMR_FREQUENCY_VARIES);

Modified: projects/clang900-import/sys/arm/ti/am335x/am335x_dmtpps.c
==============================================================================
--- projects/clang900-import/sys/arm/ti/am335x/am335x_dmtpps.c	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/sys/arm/ti/am335x/am335x_dmtpps.c	Tue Sep 17 06:08:15 2019	(r352436)
@@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/bus.h>
 #include <sys/conf.h>
 #include <sys/kernel.h>
+#include <sys/lock.h>
 #include <sys/module.h>
 #include <sys/malloc.h>
 #include <sys/mutex.h>

Modified: projects/clang900-import/sys/arm/ti/ti_sysc.c
==============================================================================
--- projects/clang900-import/sys/arm/ti/ti_sysc.c	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/sys/arm/ti/ti_sysc.c	Tue Sep 17 06:08:15 2019	(r352436)
@@ -71,6 +71,9 @@ ti_sysc_probe(device_t dev)
 		return (ENXIO);
 
 	device_set_desc(dev, "TI SYSC Interconnect");
+	if (!bootverbose)
+		device_quiet(dev);
+
 	return (BUS_PROBE_DEFAULT);
 }
 

Modified: projects/clang900-import/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
==============================================================================
--- projects/clang900-import/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c	Tue Sep 17 06:08:15 2019	(r352436)
@@ -242,6 +242,7 @@ mount_snapshot(kthread_t *td, vnode_t **vpp, const cha
 	if (VFS_ROOT(mp, LK_EXCLUSIVE, &mvp))
 		panic("mount: lost mount");
 	VOP_UNLOCK(vp, 0);
+	vfs_op_exit(mp);
 	vfs_unbusy(mp);
 	*vpp = mvp;
 	return (0);

Modified: projects/clang900-import/sys/dev/iicbus/iiconf.c
==============================================================================
--- projects/clang900-import/sys/dev/iicbus/iiconf.c	Tue Sep 17 06:07:08 2019	(r352435)
+++ projects/clang900-import/sys/dev/iicbus/iiconf.c	Tue Sep 17 06:08:15 2019	(r352436)
@@ -42,6 +42,18 @@ __FBSDID("$FreeBSD$");
 #include "iicbus_if.h"
 
 /*
+ * Encode a system errno value into the IIC_Exxxxx space by setting the
+ * IIC_ERRNO marker bit, so that iic2errno() can turn it back into a plain
+ * system errno value later.  This lets controller- and bus-layer code get
+ * important system errno values (such as EINTR/ERESTART) back to the caller.
+ */
+int
+errno2iic(int errno)
+{
+	return ((errno == 0) ? 0 : errno | IIC_ERRNO);
+}
+
+/*
  * Translate IIC_Exxxxx status values to vaguely-equivelent errno values.
  */
 int
@@ -59,7 +71,22 @@ iic2errno(int iic_status)
 	case IIC_ENOTSUPP:      return (EOPNOTSUPP);
 	case IIC_ENOADDR:       return (EADDRNOTAVAIL);
 	case IIC_ERESOURCE:     return (ENOMEM);
-	default:                return (EIO);
+	default:
+		/*
+		 * If the high bit is set, that means it's a system errno value
+		 * that was encoded into the IIC_Exxxxxx space by setting the
+		 * IIC_ERRNO marker bit.  If lots of high-order bits are set,
+		 * then it's one of the negative pseudo-errors such as ERESTART
+		 * and we return it as-is.  Otherwise it's a plain "small
+		 * positive integer" errno, so just remove the IIC_ERRNO marker
+		 * bit.  If it's some unknown number without the high bit set,
+		 * there isn't much we can do except call it an I/O error.
+		 */
+		if ((iic_status & IIC_ERRNO) == 0)
+			return (EIO);
+		if ((iic_status & 0xFFFF0000) != 0)
+			return (iic_status);
+		return (iic_status & ~IIC_ERRNO);
 	}
 }
 
@@ -97,7 +124,7 @@ iicbus_poll(struct iicbus_softc *sc, int how)
 		return (IIC_EBUSBSY);
 	}

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909170608.x8H68GTq008647>