From owner-svn-src-projects@freebsd.org Sun Sep 15 02:17:31 2019 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 007BDD95B8 for ; Sun, 15 Sep 2019 02:17:31 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46WCgt6ClHz3HW0; Sun, 15 Sep 2019 02:17:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B87DC1227; Sun, 15 Sep 2019 02:17:30 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8F2HUqR094371; Sun, 15 Sep 2019 02:17:30 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8F2HUIH094370; Sun, 15 Sep 2019 02:17:30 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201909150217.x8F2HUIH094370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 15 Sep 2019 02:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r352343 - projects/nfsv42/sys/fs/nfs X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: projects/nfsv42/sys/fs/nfs X-SVN-Commit-Revision: 352343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Sep 2019 02:17:31 -0000 Author: rmacklem Date: Sun Sep 15 02:17:30 2019 New Revision: 352343 URL: https://svnweb.freebsd.org/changeset/base/352343 Log: Update the nfsstats structure. I had left slush in the NFSV42_NPROC sized arrays so that I wouldn't have to do this. But I was a dumbass and didn't leave slush in the NFSV42_NOPS arrays. I figured that since the NFSv4.2 RFC was published, that there would be no additional operations defined but RFC-8276 came along and defined four more of them. So, the nfsstats structure needed to be updated. I stuck with the nfsstatv1 name, since it only changed w.r.t. array sizes, which now have slush for all the arrays. Hopefully this won't need to be done again. Modified: projects/nfsv42/sys/fs/nfs/nfs_commonport.c projects/nfsv42/sys/fs/nfs/nfsport.h Modified: projects/nfsv42/sys/fs/nfs/nfs_commonport.c ============================================================================== --- projects/nfsv42/sys/fs/nfs/nfs_commonport.c Sun Sep 15 01:02:01 2019 (r352342) +++ projects/nfsv42/sys/fs/nfs/nfs_commonport.c Sun Sep 15 02:17:30 2019 (r352343) @@ -80,6 +80,7 @@ int nfs_pnfsio(task_fn_t *, void *); static int nfs_realign_test; static int nfs_realign_count; static struct ext_nfsstats oldnfsstats; +static struct nfsstatsov1 nfsstatsov1; SYSCTL_NODE(_vfs, OID_AUTO, nfs, CTLFLAG_RW, 0, "NFS filesystem"); SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_test, CTLFLAG_RW, &nfs_realign_test, @@ -580,11 +581,143 @@ nfssvc_call(struct thread *p, struct nfssvc_args *uap, } else { error = copyin(uap->argp, &nfsstatver, sizeof(nfsstatver)); - if (error == 0 && nfsstatver.vers != NFSSTATS_V1) - error = EPERM; - if (error == 0) - error = copyout(&nfsstatsv1, uap->argp, - sizeof (nfsstatsv1)); + if (error == 0) { + if (nfsstatver.vers == NFSSTATS_OV1) { + /* Copy nfsstatsv1 to nfsstatsov1. */ + nfsstatsov1.attrcache_hits = + nfsstatsv1.attrcache_hits; + nfsstatsov1.attrcache_misses = + nfsstatsv1.attrcache_misses; + nfsstatsov1.lookupcache_hits = + nfsstatsv1.lookupcache_hits; + nfsstatsov1.lookupcache_misses = + nfsstatsv1.lookupcache_misses; + nfsstatsov1.direofcache_hits = + nfsstatsv1.direofcache_hits; + nfsstatsov1.direofcache_misses = + nfsstatsv1.direofcache_misses; + nfsstatsov1.accesscache_hits = + nfsstatsv1.accesscache_hits; + nfsstatsov1.accesscache_misses = + nfsstatsv1.accesscache_misses; + nfsstatsov1.biocache_reads = + nfsstatsv1.biocache_reads; + nfsstatsov1.read_bios = + nfsstatsv1.read_bios; + nfsstatsov1.read_physios = + nfsstatsv1.read_physios; + nfsstatsov1.biocache_writes = + nfsstatsv1.biocache_writes; + nfsstatsov1.write_bios = + nfsstatsv1.write_bios; + nfsstatsov1.write_physios = + nfsstatsv1.write_physios; + nfsstatsov1.biocache_readlinks = + nfsstatsv1.biocache_readlinks; + nfsstatsov1.readlink_bios = + nfsstatsv1.readlink_bios; + nfsstatsov1.biocache_readdirs = + nfsstatsv1.biocache_readdirs; + nfsstatsov1.readdir_bios = + nfsstatsv1.readdir_bios; + for (i = 0; i < NFSV42_NPROCS; i++) + nfsstatsov1.rpccnt[i] = + nfsstatsv1.rpccnt[i]; + nfsstatsov1.rpcretries = + nfsstatsv1.rpcretries; + for (i = 0; i < NFSV42_PURENOPS; i++) + nfsstatsov1.srvrpccnt[i] = + nfsstatsv1.srvrpccnt[i]; + for (i = NFSV42_NOPS, + j = NFSV42_PURENOPS; + i < NFSV42_NOPS + NFSV4OP_FAKENOPS; + i++, j++) + nfsstatsov1.srvrpccnt[j] = + nfsstatsv1.srvrpccnt[i]; + nfsstatsov1.srvrpc_errs = + nfsstatsv1.srvrpc_errs; + nfsstatsov1.srv_errs = + nfsstatsv1.srv_errs; + nfsstatsov1.rpcrequests = + nfsstatsv1.rpcrequests; + nfsstatsov1.rpctimeouts = + nfsstatsv1.rpctimeouts; + nfsstatsov1.rpcunexpected = + nfsstatsv1.rpcunexpected; + nfsstatsov1.rpcinvalid = + nfsstatsv1.rpcinvalid; + nfsstatsov1.srvcache_inproghits = + nfsstatsv1.srvcache_inproghits; + nfsstatsov1.srvcache_idemdonehits = + nfsstatsv1.srvcache_idemdonehits; + nfsstatsov1.srvcache_nonidemdonehits = + nfsstatsv1.srvcache_nonidemdonehits; + nfsstatsov1.srvcache_misses = + nfsstatsv1.srvcache_misses; + nfsstatsov1.srvcache_tcppeak = + nfsstatsv1.srvcache_tcppeak; + nfsstatsov1.srvcache_size = + nfsstatsv1.srvcache_size; + nfsstatsov1.srvclients = + nfsstatsv1.srvclients; + nfsstatsov1.srvopenowners = + nfsstatsv1.srvopenowners; + nfsstatsov1.srvopens = + nfsstatsv1.srvopens; + nfsstatsov1.srvlockowners = + nfsstatsv1.srvlockowners; + nfsstatsov1.srvlocks = + nfsstatsv1.srvlocks; + nfsstatsov1.srvdelegates = + nfsstatsv1.srvdelegates; + for (i = 0; i < NFSV42_CBNOPS; i++) + nfsstatsov1.cbrpccnt[i] = + nfsstatsv1.cbrpccnt[i]; + nfsstatsov1.clopenowners = + nfsstatsv1.clopenowners; + nfsstatsov1.clopens = + nfsstatsv1.clopens; + nfsstatsov1.cllockowners = + nfsstatsv1.cllockowners; + nfsstatsov1.cllocks = + nfsstatsv1.cllocks; + nfsstatsov1.cldelegates = + nfsstatsv1.cldelegates; + nfsstatsov1.cllocalopenowners = + nfsstatsv1.cllocalopenowners; + nfsstatsov1.cllocalopens = + nfsstatsv1.cllocalopens; + nfsstatsov1.cllocallockowners = + nfsstatsv1.cllocallockowners; + nfsstatsov1.cllocallocks = + nfsstatsv1.cllocallocks; + nfsstatsov1.srvstartcnt = + nfsstatsv1.srvstartcnt; + nfsstatsov1.srvdonecnt = + nfsstatsv1.srvdonecnt; + for (i = NFSV42_NOPS, + j = NFSV42_PURENOPS; + i < NFSV42_NOPS + NFSV4OP_FAKENOPS; + i++, j++) { + nfsstatsov1.srvbytes[j] = + nfsstatsv1.srvbytes[i]; + nfsstatsov1.srvops[j] = + nfsstatsv1.srvops[i]; + nfsstatsov1.srvduration[j] = + nfsstatsv1.srvduration[i]; + } + nfsstatsov1.busyfrom = + nfsstatsv1.busyfrom; + nfsstatsov1.busyfrom = + nfsstatsv1.busyfrom; + error = copyout(&nfsstatsov1, uap->argp, + sizeof(nfsstatsov1)); + } else if (nfsstatver.vers != NFSSTATS_V1) + error = EPERM; + else + error = copyout(&nfsstatsv1, uap->argp, + sizeof(nfsstatsv1)); + } } if (error == 0) { if ((uap->flag & NFSSVC_ZEROCLTSTATS) != 0) { Modified: projects/nfsv42/sys/fs/nfs/nfsport.h ============================================================================== --- projects/nfsv42/sys/fs/nfs/nfsport.h Sun Sep 15 01:02:01 2019 (r352342) +++ projects/nfsv42/sys/fs/nfs/nfsport.h Sun Sep 15 02:17:30 2019 (r352343) @@ -277,6 +277,9 @@ #define NFSV4OP_WRITESAME 70 #define NFSV4OP_CLONE 71 +/* One greater than the last Operation # defined in RFC-7862. */ +#define NFSV42_PURENOPS 72 + /* and the optional Extended attribute operations (RFC-8276). */ #define NFSV4OP_GETXATTR 72 #define NFSV4OP_SETXATTR 73 @@ -420,10 +423,10 @@ #endif /* NFS_V3NPROCS */ /* - * New stats structure. + * Newest stats structure. * The vers field will be set to NFSSTATS_V1 by the caller. */ -#define NFSSTATS_V1 1 +#define NFSSTATS_V1 2 struct nfsstatsv1 { int vers; /* Set to version requested by caller. */ uint64_t attrcache_hits; @@ -444,9 +447,74 @@ struct nfsstatsv1 { uint64_t readlink_bios; uint64_t biocache_readdirs; uint64_t readdir_bios; + uint64_t rpccnt[NFSV42_NPROCS + 15]; + uint64_t rpcretries; + uint64_t srvrpccnt[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; + uint64_t srvrpc_errs; + uint64_t srv_errs; + uint64_t rpcrequests; + uint64_t rpctimeouts; + uint64_t rpcunexpected; + uint64_t rpcinvalid; + uint64_t srvcache_inproghits; + uint64_t srvcache_idemdonehits; + uint64_t srvcache_nonidemdonehits; + uint64_t srvcache_misses; + uint64_t srvcache_tcppeak; + int srvcache_size; /* Updated by atomic_xx_int(). */ + uint64_t srvclients; + uint64_t srvopenowners; + uint64_t srvopens; + uint64_t srvlockowners; + uint64_t srvlocks; + uint64_t srvdelegates; + uint64_t cbrpccnt[NFSV42_CBNOPS + 10]; + uint64_t clopenowners; + uint64_t clopens; + uint64_t cllockowners; + uint64_t cllocks; + uint64_t cldelegates; + uint64_t cllocalopenowners; + uint64_t cllocalopens; + uint64_t cllocallockowners; + uint64_t cllocallocks; + uint64_t srvstartcnt; + uint64_t srvdonecnt; + uint64_t srvbytes[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; + uint64_t srvops[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; + struct bintime srvduration[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; + struct bintime busyfrom; + struct bintime busytime; +}; + +/* + * Newer stats structure. + * The vers field will be set to NFSSTATS_OV1 by the caller. + */ +#define NFSSTATS_OV1 1 +struct nfsstatsov1 { + int vers; /* Set to version requested by caller. */ + uint64_t attrcache_hits; + uint64_t attrcache_misses; + uint64_t lookupcache_hits; + uint64_t lookupcache_misses; + uint64_t direofcache_hits; + uint64_t direofcache_misses; + uint64_t accesscache_hits; + uint64_t accesscache_misses; + uint64_t biocache_reads; + uint64_t read_bios; + uint64_t read_physios; + uint64_t biocache_writes; + uint64_t write_bios; + uint64_t write_physios; + uint64_t biocache_readlinks; + uint64_t readlink_bios; + uint64_t biocache_readdirs; + uint64_t readdir_bios; uint64_t rpccnt[NFSV42_NPROCS + 4]; uint64_t rpcretries; - uint64_t srvrpccnt[NFSV42_NOPS + NFSV4OP_FAKENOPS]; + uint64_t srvrpccnt[NFSV42_PURENOPS + NFSV4OP_FAKENOPS]; uint64_t srvrpc_errs; uint64_t srv_errs; uint64_t rpcrequests; @@ -477,9 +545,9 @@ struct nfsstatsv1 { uint64_t cllocallocks; uint64_t srvstartcnt; uint64_t srvdonecnt; - uint64_t srvbytes[NFSV42_NOPS + NFSV4OP_FAKENOPS]; - uint64_t srvops[NFSV42_NOPS + NFSV4OP_FAKENOPS]; - struct bintime srvduration[NFSV42_NOPS + NFSV4OP_FAKENOPS]; + uint64_t srvbytes[NFSV42_PURENOPS + NFSV4OP_FAKENOPS]; + uint64_t srvops[NFSV42_PURENOPS + NFSV4OP_FAKENOPS]; + struct bintime srvduration[NFSV42_PURENOPS + NFSV4OP_FAKENOPS]; struct bintime busyfrom; struct bintime busytime; }; From owner-svn-src-projects@freebsd.org Tue Sep 17 06:07:10 2019 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4432DF8B04 for ; Tue, 17 Sep 2019 06:07:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XXgy1578z4ZPX; Tue, 17 Sep 2019 06:07:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 043764380; Tue, 17 Sep 2019 06:07:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8H679SC008530; Tue, 17 Sep 2019 06:07:09 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8H6785S008522; Tue, 17 Sep 2019 06:07:08 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909170607.x8H6785S008522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 17 Sep 2019 06:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r352435 - in projects/clang900-import: lib/atf/libatf-c++ lib/googletest lib/libdevdctl lib/libpmc libexec/atf/atf-check libexec/atf/atf-sh share/mk X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang900-import: lib/atf/libatf-c++ lib/googletest lib/libdevdctl lib/libpmc libexec/atf/atf-check libexec/atf/atf-sh share/mk X-SVN-Commit-Revision: 352435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 06:07:10 -0000 Author: dim Date: Tue Sep 17 06:07:08 2019 New Revision: 352435 URL: https://svnweb.freebsd.org/changeset/base/352435 Log: Another round of attempting to squelch -Wdeprecated-declarations, which has become very trigger-happy with libc++ 9.0.0. It does not help that gcc's implementation of this warning is even more trigger-happy, in the sense that it already warns on the declaration itself, not when you are using it. This is very annoying with our use of -Wsystem-headers. That should really be disabled for gcc. Modified: projects/clang900-import/lib/atf/libatf-c++/Makefile projects/clang900-import/lib/googletest/Makefile.inc projects/clang900-import/lib/libdevdctl/Makefile projects/clang900-import/lib/libpmc/Makefile projects/clang900-import/libexec/atf/atf-check/Makefile projects/clang900-import/libexec/atf/atf-sh/Makefile projects/clang900-import/share/mk/atf.test.mk Modified: projects/clang900-import/lib/atf/libatf-c++/Makefile ============================================================================== --- projects/clang900-import/lib/atf/libatf-c++/Makefile Tue Sep 17 03:39:31 2019 (r352434) +++ projects/clang900-import/lib/atf/libatf-c++/Makefile Tue Sep 17 06:07:08 2019 (r352435) @@ -48,6 +48,9 @@ CFLAGS+= -I. CFLAGS+= -DHAVE_CONFIG_H +# Silence warnings about usage of deprecated std::auto_ptr +CXXWARNFLAGS+= -Wno-deprecated-declarations + SRCS= application.cpp \ build.cpp \ check.cpp \ Modified: projects/clang900-import/lib/googletest/Makefile.inc ============================================================================== --- projects/clang900-import/lib/googletest/Makefile.inc Tue Sep 17 03:39:31 2019 (r352434) +++ projects/clang900-import/lib/googletest/Makefile.inc Tue Sep 17 06:07:08 2019 (r352435) @@ -8,4 +8,7 @@ GOOGLETEST_SRCROOT= ${GTEST_DIR}/googletest CXXFLAGS+= ${GTESTS_FLAGS} +# Silence warnings about usage of deprecated std::auto_ptr +CXXWARNFLAGS+= -Wno-deprecated-declarations + WARNS?= 6 Modified: projects/clang900-import/lib/libdevdctl/Makefile ============================================================================== --- projects/clang900-import/lib/libdevdctl/Makefile Tue Sep 17 03:39:31 2019 (r352434) +++ projects/clang900-import/lib/libdevdctl/Makefile Tue Sep 17 06:07:08 2019 (r352435) @@ -18,4 +18,8 @@ WARNS?= 3 PRIVATELIB= true SHLIB_MAJOR= 0 +# Silence warnings about usage of deprecated std::auto_ptr, and various +# deprecated function objects from +CXXWARNFLAGS+= -Wno-deprecated-declarations + .include Modified: projects/clang900-import/lib/libpmc/Makefile ============================================================================== --- projects/clang900-import/lib/libpmc/Makefile Tue Sep 17 03:39:31 2019 (r352434) +++ projects/clang900-import/lib/libpmc/Makefile Tue Sep 17 06:07:08 2019 (r352435) @@ -32,6 +32,9 @@ WARNS?= 3 CFLAGS+= -I${.CURDIR} CWARNFLAGS.gcc+= -Wno-shadow -Wno-cast-align +# Silence warnings about usage of deprecated std::auto_ptr +CXXWARNFLAGS+= -Wno-deprecated-declarations + MAN= pmc.3 MAN+= pmc_allocate.3 MAN+= pmc_attach.3 Modified: projects/clang900-import/libexec/atf/atf-check/Makefile ============================================================================== --- projects/clang900-import/libexec/atf/atf-check/Makefile Tue Sep 17 03:39:31 2019 (r352434) +++ projects/clang900-import/libexec/atf/atf-check/Makefile Tue Sep 17 06:07:08 2019 (r352435) @@ -38,6 +38,9 @@ MAN= atf-check.1 CFLAGS+= -I${ATF} CFLAGS+= -DATF_SHELL='"/bin/sh"' +# Silence warnings about usage of deprecated std::auto_ptr +CXXWARNFLAGS+= -Wno-deprecated-declarations + LIBADD= atf_cxx HAS_TESTS= Modified: projects/clang900-import/libexec/atf/atf-sh/Makefile ============================================================================== --- projects/clang900-import/libexec/atf/atf-sh/Makefile Tue Sep 17 03:39:31 2019 (r352434) +++ projects/clang900-import/libexec/atf/atf-sh/Makefile Tue Sep 17 06:07:08 2019 (r352435) @@ -65,6 +65,9 @@ CFLAGS+= -DATF_PKGDATADIR='"${SHAREDIR}/atf"' CFLAGS+= -DATF_SHELL='"/bin/sh"' CFLAGS+= -I${ATF} +# Silence warnings about usage of deprecated std::auto_ptr +CXXWARNFLAGS+= -Wno-deprecated-declarations + LIBADD= atf_cxx FILESGROUPS= SUBR Modified: projects/clang900-import/share/mk/atf.test.mk ============================================================================== --- projects/clang900-import/share/mk/atf.test.mk Tue Sep 17 03:39:31 2019 (r352434) +++ projects/clang900-import/share/mk/atf.test.mk Tue Sep 17 06:07:08 2019 (r352435) @@ -55,6 +55,8 @@ LDADD.${_T}+= ${LIBATF_CXX} ${LIBATF_C} .endif TEST_INTERFACE.${_T}= atf .endfor +# Silence warnings about usage of deprecated std::auto_ptr +CXXWARNFLAGS+= -Wno-deprecated-declarations .endif .if !empty(ATF_TESTS_SH) From owner-svn-src-projects@freebsd.org Tue Sep 17 06:08:22 2019 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B330F8B4F for ; Tue, 17 Sep 2019 06:08:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46XXjL124Cz4ZVH; Tue, 17 Sep 2019 06:08:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1DE14381; Tue, 17 Sep 2019 06:08:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8H68LFl008677; Tue, 17 Sep 2019 06:08:21 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8H68GTq008647; Tue, 17 Sep 2019 06:08:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909170608.x8H68GTq008647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 17 Sep 2019 06:08:16 +0000 (UTC) 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... X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: 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/forth stand/libsa sys/amd6... X-SVN-Commit-Revision: 352436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2019 06:08:22 -0000 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 = <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 -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 +.\" 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 #include #include +#include #include #include #include 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 *** From owner-svn-src-projects@freebsd.org Thu Sep 19 17:42:02 2019 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE2AE129D2D for ; Thu, 19 Sep 2019 17:42:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Z40p4CGBz44G8; Thu, 19 Sep 2019 17:42:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 747CA18FD8; Thu, 19 Sep 2019 17:42:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8JHg2Go021599; Thu, 19 Sep 2019 17:42:02 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8JHg2q8021598; Thu, 19 Sep 2019 17:42:02 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909191742.x8JHg2q8021598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 19 Sep 2019 17:42:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r352533 - projects/clang900-import X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang900-import X-SVN-Commit-Revision: 352533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 17:42:02 -0000 Author: dim Date: Thu Sep 19 17:42:02 2019 New Revision: 352533 URL: https://svnweb.freebsd.org/changeset/base/352533 Log: Also add /usr/lib32/libc++fs.a to ObsoleteFiles. Modified: projects/clang900-import/ObsoleteFiles.inc Modified: projects/clang900-import/ObsoleteFiles.inc ============================================================================== --- projects/clang900-import/ObsoleteFiles.inc Thu Sep 19 17:17:59 2019 (r352532) +++ projects/clang900-import/ObsoleteFiles.inc Thu Sep 19 17:42:02 2019 (r352533) @@ -198,6 +198,7 @@ OLD_FILES+=usr/include/c++/v1/experimental/string_view OLD_FILES+=usr/include/c++/v1/experimental/system_error OLD_FILES+=usr/include/c++/v1/experimental/tuple OLD_FILES+=usr/lib/libc++fs.a +OLD_FILES+=usr/lib32/libc++fs.a # 20190910: mklocale(1) and colldef(1) removed OLD_FILES+=usr/bin/mklocale OLD_FILES+=usr/share/man/man1/mklocale.1.gz From owner-svn-src-projects@freebsd.org Thu Sep 19 19:25:05 2019 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4799012C536 for ; Thu, 19 Sep 2019 19:25:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Z6Hj1xn7z49t8; Thu, 19 Sep 2019 19:25:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 045661A1D6; Thu, 19 Sep 2019 19:25:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8JJP4l1084789; Thu, 19 Sep 2019 19:25:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8JJP2SF084775; Thu, 19 Sep 2019 19:25:02 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909191925.x8JJP2SF084775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 19 Sep 2019 19:25:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r352536 - in projects/clang900-import: contrib/llvm/include/llvm/IR contrib/llvm/lib/CodeGen contrib/llvm/lib/IR contrib/llvm/lib/Target/X86 contrib/llvm/lib/Transforms/Utils contrib/ll... X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang900-import: contrib/llvm/include/llvm/IR contrib/llvm/lib/CodeGen contrib/llvm/lib/IR contrib/llvm/lib/Target/X86 contrib/llvm/lib/Transforms/Utils contrib/llvm/tools/clang/include/cl... X-SVN-Commit-Revision: 352536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 19:25:05 -0000 Author: dim Date: Thu Sep 19 19:25:01 2019 New Revision: 352536 URL: https://svnweb.freebsd.org/changeset/base/352536 Log: Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb, and openmp release 9.0.0 r372316, and update version numbers. Replaced: projects/clang900-import/contrib/llvm/tools/lldb/utils/ - copied from r352534, vendor/lldb/dist-release_90/utils/ Modified: projects/clang900-import/contrib/llvm/include/llvm/IR/Instructions.h projects/clang900-import/contrib/llvm/lib/CodeGen/IfConversion.cpp projects/clang900-import/contrib/llvm/lib/IR/Instructions.cpp projects/clang900-import/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp projects/clang900-import/contrib/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp projects/clang900-import/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def projects/clang900-import/contrib/llvm/tools/clang/lib/AST/Decl.cpp projects/clang900-import/contrib/llvm/tools/clang/lib/Basic/Version.cpp projects/clang900-import/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp projects/clang900-import/lib/clang/include/VCSVersion.inc projects/clang900-import/lib/clang/include/llvm/Support/VCSRevision.h Directory Properties: projects/clang900-import/contrib/compiler-rt/ (props changed) projects/clang900-import/contrib/libc++/ (props changed) projects/clang900-import/contrib/libunwind/ (props changed) projects/clang900-import/contrib/llvm/ (props changed) projects/clang900-import/contrib/llvm/tools/clang/ (props changed) projects/clang900-import/contrib/llvm/tools/lld/ (props changed) projects/clang900-import/contrib/llvm/tools/lldb/ (props changed) projects/clang900-import/contrib/openmp/ (props changed) Modified: projects/clang900-import/contrib/llvm/include/llvm/IR/Instructions.h ============================================================================== --- projects/clang900-import/contrib/llvm/include/llvm/IR/Instructions.h Thu Sep 19 18:50:42 2019 (r352535) +++ projects/clang900-import/contrib/llvm/include/llvm/IR/Instructions.h Thu Sep 19 19:25:01 2019 (r352536) @@ -3938,6 +3938,9 @@ class CallBrInst : public CallBase { ArrayRef IndirectDests, ArrayRef Args, ArrayRef Bundles, const Twine &NameStr); + /// Should the Indirect Destinations change, scan + update the Arg list. + void updateArgBlockAddresses(unsigned i, BasicBlock *B); + /// Compute the number of operands to allocate. static int ComputeNumOperands(int NumArgs, int NumIndirectDests, int NumBundleInputs = 0) { @@ -4075,7 +4078,7 @@ class CallBrInst : public CallBase { return cast(*(&Op<-1>() - getNumIndirectDests() - 1)); } BasicBlock *getIndirectDest(unsigned i) const { - return cast(*(&Op<-1>() - getNumIndirectDests() + i)); + return cast_or_null(*(&Op<-1>() - getNumIndirectDests() + i)); } SmallVector getIndirectDests() const { SmallVector IndirectDests; @@ -4087,6 +4090,7 @@ class CallBrInst : public CallBase { *(&Op<-1>() - getNumIndirectDests() - 1) = reinterpret_cast(B); } void setIndirectDest(unsigned i, BasicBlock *B) { + updateArgBlockAddresses(i, B); *(&Op<-1>() - getNumIndirectDests() + i) = reinterpret_cast(B); } @@ -4096,11 +4100,10 @@ class CallBrInst : public CallBase { return i == 0 ? getDefaultDest() : getIndirectDest(i - 1); } - void setSuccessor(unsigned idx, BasicBlock *NewSucc) { - assert(idx < getNumIndirectDests() + 1 && + void setSuccessor(unsigned i, BasicBlock *NewSucc) { + assert(i < getNumIndirectDests() + 1 && "Successor # out of range for callbr!"); - *(&Op<-1>() - getNumIndirectDests() -1 + idx) = - reinterpret_cast(NewSucc); + return i == 0 ? setDefaultDest(NewSucc) : setIndirectDest(i - 1, NewSucc); } unsigned getNumSuccessors() const { return getNumIndirectDests() + 1; } Modified: projects/clang900-import/contrib/llvm/lib/CodeGen/IfConversion.cpp ============================================================================== --- projects/clang900-import/contrib/llvm/lib/CodeGen/IfConversion.cpp Thu Sep 19 18:50:42 2019 (r352535) +++ projects/clang900-import/contrib/llvm/lib/CodeGen/IfConversion.cpp Thu Sep 19 19:25:01 2019 (r352536) @@ -912,6 +912,12 @@ void IfConverter::AnalyzeBranches(BBInfo &BBI) { BBI.BrCond.clear(); BBI.IsBrAnalyzable = !TII->analyzeBranch(*BBI.BB, BBI.TrueBB, BBI.FalseBB, BBI.BrCond); + if (!BBI.IsBrAnalyzable) { + BBI.TrueBB = nullptr; + BBI.FalseBB = nullptr; + BBI.BrCond.clear(); + } + SmallVector RevCond(BBI.BrCond.begin(), BBI.BrCond.end()); BBI.IsBrReversible = (RevCond.size() == 0) || !TII->reverseBranchCondition(RevCond); Modified: projects/clang900-import/contrib/llvm/lib/IR/Instructions.cpp ============================================================================== --- projects/clang900-import/contrib/llvm/lib/IR/Instructions.cpp Thu Sep 19 18:50:42 2019 (r352535) +++ projects/clang900-import/contrib/llvm/lib/IR/Instructions.cpp Thu Sep 19 19:25:01 2019 (r352536) @@ -822,6 +822,17 @@ void CallBrInst::init(FunctionType *FTy, Value *Fn, Ba setName(NameStr); } +void CallBrInst::updateArgBlockAddresses(unsigned i, BasicBlock *B) { + assert(getNumIndirectDests() > i && "IndirectDest # out of range for callbr"); + if (BasicBlock *OldBB = getIndirectDest(i)) { + BlockAddress *Old = BlockAddress::get(OldBB); + BlockAddress *New = BlockAddress::get(B); + for (unsigned ArgNo = 0, e = getNumArgOperands(); ArgNo != e; ++ArgNo) + if (dyn_cast(getArgOperand(ArgNo)) == Old) + setArgOperand(ArgNo, New); + } +} + CallBrInst::CallBrInst(const CallBrInst &CBI) : CallBase(CBI.Attrs, CBI.FTy, CBI.getType(), Instruction::CallBr, OperandTraits::op_end(this) - CBI.getNumOperands(), Modified: projects/clang900-import/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- projects/clang900-import/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Sep 19 18:50:42 2019 (r352535) +++ projects/clang900-import/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Thu Sep 19 19:25:01 2019 (r352536) @@ -7650,17 +7650,22 @@ static SDValue EltsFromConsecutiveLoads(EVT VT, ArrayR // IsConsecutiveLoadWithZeros - we need to create a shuffle of the loaded // vector and a zero vector to clear out the zero elements. if (!isAfterLegalize && VT.isVector()) { - SmallVector ClearMask(NumElems, -1); - for (unsigned i = 0; i < NumElems; ++i) { - if (ZeroMask[i]) - ClearMask[i] = i + NumElems; - else if (LoadMask[i]) - ClearMask[i] = i; + unsigned NumMaskElts = VT.getVectorNumElements(); + if ((NumMaskElts % NumElems) == 0) { + unsigned Scale = NumMaskElts / NumElems; + SmallVector ClearMask(NumMaskElts, -1); + for (unsigned i = 0; i < NumElems; ++i) { + if (UndefMask[i]) + continue; + int Offset = ZeroMask[i] ? NumMaskElts : 0; + for (unsigned j = 0; j != Scale; ++j) + ClearMask[(i * Scale) + j] = (i * Scale) + j + Offset; + } + SDValue V = CreateLoad(VT, LDBase); + SDValue Z = VT.isInteger() ? DAG.getConstant(0, DL, VT) + : DAG.getConstantFP(0.0, DL, VT); + return DAG.getVectorShuffle(VT, DL, V, Z, ClearMask); } - SDValue V = CreateLoad(VT, LDBase); - SDValue Z = VT.isInteger() ? DAG.getConstant(0, DL, VT) - : DAG.getConstantFP(0.0, DL, VT); - return DAG.getVectorShuffle(VT, DL, V, Z, ClearMask); } } @@ -31664,8 +31669,8 @@ static bool matchUnaryPermuteShuffle(MVT MaskVT, Array if (!ContainsZeros && AllowIntDomain && MaskScalarSizeInBits == 16) { SmallVector RepeatedMask; if (is128BitLaneRepeatedShuffleMask(MaskEltVT, Mask, RepeatedMask)) { - ArrayRef LoMask(Mask.data() + 0, 4); - ArrayRef HiMask(Mask.data() + 4, 4); + ArrayRef LoMask(RepeatedMask.data() + 0, 4); + ArrayRef HiMask(RepeatedMask.data() + 4, 4); // PSHUFLW: permute lower 4 elements only. if (isUndefOrInRange(LoMask, 0, 4) && Modified: projects/clang900-import/contrib/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp ============================================================================== --- projects/clang900-import/contrib/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp Thu Sep 19 18:50:42 2019 (r352535) +++ projects/clang900-import/contrib/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp Thu Sep 19 19:25:01 2019 (r352536) @@ -1480,8 +1480,8 @@ Value *LibCallSimplifier::optimizePow(CallInst *Pow, I if (match(Expo, m_SpecificFP(-1.0))) return B.CreateFDiv(ConstantFP::get(Ty, 1.0), Base, "reciprocal"); - // pow(x, 0.0) -> 1.0 - if (match(Expo, m_SpecificFP(0.0))) + // pow(x, +/-0.0) -> 1.0 + if (match(Expo, m_AnyZeroFP())) return ConstantFP::get(Ty, 1.0); // pow(x, 1.0) -> x Modified: projects/clang900-import/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def ============================================================================== --- projects/clang900-import/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def Thu Sep 19 18:50:42 2019 (r352535) +++ projects/clang900-import/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def Thu Sep 19 19:25:01 2019 (r352536) @@ -440,7 +440,7 @@ BUILTIN(__builtin_rotateleft64, "UWiUWiUWi", "nc") BUILTIN(__builtin_rotateright8, "UcUcUc", "nc") BUILTIN(__builtin_rotateright16, "UsUsUs", "nc") BUILTIN(__builtin_rotateright32, "UZiUZiUZi", "nc") -BUILTIN(__builtin_rotateright64, "UWiUWiWi", "nc") +BUILTIN(__builtin_rotateright64, "UWiUWiUWi", "nc") // Random GCC builtins BUILTIN(__builtin_constant_p, "i.", "nctu") Modified: projects/clang900-import/contrib/llvm/tools/clang/lib/AST/Decl.cpp ============================================================================== --- projects/clang900-import/contrib/llvm/tools/clang/lib/AST/Decl.cpp Thu Sep 19 18:50:42 2019 (r352535) +++ projects/clang900-import/contrib/llvm/tools/clang/lib/AST/Decl.cpp Thu Sep 19 19:25:01 2019 (r352536) @@ -3332,7 +3332,8 @@ SourceRange FunctionDecl::getExceptionSpecSourceRange( /// an externally visible symbol, but "extern inline" will not create an /// externally visible symbol. bool FunctionDecl::isInlineDefinitionExternallyVisible() const { - assert((doesThisDeclarationHaveABody() || willHaveBody()) && + assert((doesThisDeclarationHaveABody() || willHaveBody() || + hasAttr()) && "Must be a function definition"); assert(isInlined() && "Function must be inline"); ASTContext &Context = getASTContext(); Modified: projects/clang900-import/contrib/llvm/tools/clang/lib/Basic/Version.cpp ============================================================================== --- projects/clang900-import/contrib/llvm/tools/clang/lib/Basic/Version.cpp Thu Sep 19 18:50:42 2019 (r352535) +++ projects/clang900-import/contrib/llvm/tools/clang/lib/Basic/Version.cpp Thu Sep 19 19:25:01 2019 (r352536) @@ -35,7 +35,7 @@ std::string getClangRepositoryPath() { // If the CLANG_REPOSITORY is empty, try to use the SVN keyword. This helps us // pick up a tag in an SVN export, for example. - StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/branches/release_90/lib/Basic/Version.cpp $"); + StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_900/final/lib/Basic/Version.cpp $"); if (URL.empty()) { URL = SVNRepository.slice(SVNRepository.find(':'), SVNRepository.find("/lib/Basic")); Modified: projects/clang900-import/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp ============================================================================== --- projects/clang900-import/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp Thu Sep 19 18:50:42 2019 (r352535) +++ projects/clang900-import/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp Thu Sep 19 19:25:01 2019 (r352536) @@ -4355,17 +4355,22 @@ void CodeGenModule::EmitAliasDefinition(GlobalDecl GD) // Create a reference to the named value. This ensures that it is emitted // if a deferred decl. llvm::Constant *Aliasee; - if (isa(DeclTy)) + llvm::GlobalValue::LinkageTypes LT; + if (isa(DeclTy)) { Aliasee = GetOrCreateLLVMFunction(AA->getAliasee(), DeclTy, GD, /*ForVTable=*/false); - else + LT = getFunctionLinkage(GD); + } else { Aliasee = GetOrCreateLLVMGlobal(AA->getAliasee(), llvm::PointerType::getUnqual(DeclTy), /*D=*/nullptr); + LT = getLLVMLinkageVarDefinition(cast(GD.getDecl()), + D->getType().isConstQualified()); + } // Create the new alias itself, but don't set a name yet. - auto *GA = llvm::GlobalAlias::create( - DeclTy, 0, llvm::Function::ExternalLinkage, "", Aliasee, &getModule()); + auto *GA = + llvm::GlobalAlias::create(DeclTy, 0, LT, "", Aliasee, &getModule()); if (Entry) { if (GA->getAliasee() == Entry) { Modified: projects/clang900-import/lib/clang/include/VCSVersion.inc ============================================================================== --- projects/clang900-import/lib/clang/include/VCSVersion.inc Thu Sep 19 18:50:42 2019 (r352535) +++ projects/clang900-import/lib/clang/include/VCSVersion.inc Thu Sep 19 19:25:01 2019 (r352536) @@ -1,14 +1,14 @@ // $FreeBSD$ -#define LLVM_REVISION "371301" -#define LLVM_REPOSITORY "https://llvm.org/svn/llvm-project/llvm/branches/release_90" +#define LLVM_REVISION "372316" +#define LLVM_REPOSITORY "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_900/final" -#define CLANG_REVISION "371301" -#define CLANG_REPOSITORY "https://llvm.org/svn/llvm-project/cfe/branches/release_90" +#define CLANG_REVISION "372316" +#define CLANG_REPOSITORY "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_900/final" // - -#define LLD_REVISION "371301-1300004" +#define LLD_REVISION "372316-1300004" #define LLD_REPOSITORY "FreeBSD" -#define LLDB_REVISION "371301" -#define LLDB_REPOSITORY "https://llvm.org/svn/llvm-project/lldb/branches/release_90" +#define LLDB_REVISION "372316" +#define LLDB_REPOSITORY "https://llvm.org/svn/llvm-project/lldb/tags/RELEASE_900/final" Modified: projects/clang900-import/lib/clang/include/llvm/Support/VCSRevision.h ============================================================================== --- projects/clang900-import/lib/clang/include/llvm/Support/VCSRevision.h Thu Sep 19 18:50:42 2019 (r352535) +++ projects/clang900-import/lib/clang/include/llvm/Support/VCSRevision.h Thu Sep 19 19:25:01 2019 (r352536) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define LLVM_REVISION "371301" -#define LLVM_REPOSITORY "https://llvm.org/svn/llvm-project/llvm/branches/release_90" +#define LLVM_REVISION "372316" +#define LLVM_REPOSITORY "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_900/final" From owner-svn-src-projects@freebsd.org Thu Sep 19 19:26:17 2019 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6082812C569 for ; Thu, 19 Sep 2019 19:26:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Z6K52cBmz4B00; Thu, 19 Sep 2019 19:26:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 223491A1D7; Thu, 19 Sep 2019 19:26:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8JJQHHn084927; Thu, 19 Sep 2019 19:26:17 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8JJQCTP084903; Thu, 19 Sep 2019 19:26:12 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909191926.x8JJQCTP084903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 19 Sep 2019 19:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r352537 - in projects/clang900-import: . cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common contrib/jemalloc/src contrib/netbsd-tests/lib/libc/sys lib lib/libar... X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang900-import: . cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common contrib/jemalloc/src contrib/netbsd-tests/lib/libc/sys lib lib/libarchive lib/libarchive/test... X-SVN-Commit-Revision: 352537 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 19:26:17 -0000 Author: dim Date: Thu Sep 19 19:26:12 2019 New Revision: 352537 URL: https://svnweb.freebsd.org/changeset/base/352537 Log: Merge ^/head r352436 through r352536. Added: projects/clang900-import/sys/dev/hwpmc/hwpmc_beri.c - copied unchanged from r352536, head/sys/dev/hwpmc/hwpmc_beri.c projects/clang900-import/sys/dev/hwpmc/hwpmc_beri.h - copied unchanged from r352536, head/sys/dev/hwpmc/hwpmc_beri.h projects/clang900-import/tests/sys/vm/page_fault_signal.c - copied unchanged from r352536, head/tests/sys/vm/page_fault_signal.c projects/clang900-import/tools/build/options/WITH_GOOGLETEST - copied unchanged from r352536, head/tools/build/options/WITH_GOOGLETEST Modified: projects/clang900-import/Makefile.inc1 projects/clang900-import/cddl/contrib/opensolaris/cmd/zfs/zfs.8 projects/clang900-import/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c projects/clang900-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h projects/clang900-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c projects/clang900-import/contrib/jemalloc/src/jemalloc.c projects/clang900-import/contrib/netbsd-tests/lib/libc/sys/t_stat.c projects/clang900-import/lib/Makefile projects/clang900-import/lib/libarchive/Makefile projects/clang900-import/lib/libarchive/tests/Makefile projects/clang900-import/lib/libbe/be.c projects/clang900-import/lib/libc/gen/sysctlnametomib.c projects/clang900-import/lib/libc/sys/open.2 projects/clang900-import/lib/libpmc/libpmc.c projects/clang900-import/sbin/ifconfig/ifmedia.c projects/clang900-import/share/man/man5/src.conf.5 projects/clang900-import/share/mk/src.libnames.mk projects/clang900-import/share/mk/src.opts.mk projects/clang900-import/stand/efi/libefi/efipart.c projects/clang900-import/stand/forth/loader.4th projects/clang900-import/stand/libsa/stand.h projects/clang900-import/stand/libsa/zalloc.c projects/clang900-import/stand/libsa/zalloc_defs.h projects/clang900-import/stand/libsa/zalloc_malloc.c projects/clang900-import/stand/libsa/zalloc_mem.h projects/clang900-import/stand/libsa/zalloc_protos.h projects/clang900-import/stand/mips/uboot/Makefile projects/clang900-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c projects/clang900-import/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c projects/clang900-import/sys/conf/files.mips projects/clang900-import/sys/dev/hwpmc/pmc_events.h projects/clang900-import/sys/dev/vt/vt_core.c projects/clang900-import/sys/fs/nfsclient/nfs_clport.c projects/clang900-import/sys/kern/kern_sysctl.c projects/clang900-import/sys/kern/vfs_cluster.c projects/clang900-import/sys/kern/vfs_default.c projects/clang900-import/sys/kern/vfs_vnops.c projects/clang900-import/sys/net/if.c projects/clang900-import/sys/net/if.h projects/clang900-import/sys/netinet/sctp_auth.c projects/clang900-import/sys/netinet/tcp_stacks/rack.c projects/clang900-import/sys/netinet6/ip6_input.c projects/clang900-import/sys/sys/pmc.h projects/clang900-import/sys/sys/sockio.h projects/clang900-import/sys/sys/sysctl.h projects/clang900-import/sys/vm/vm_glue.c projects/clang900-import/tests/sys/netpfil/common/forward.sh projects/clang900-import/tests/sys/netpfil/common/tos.sh projects/clang900-import/tests/sys/vm/Makefile projects/clang900-import/usr.bin/truss/syscall.h projects/clang900-import/usr.bin/truss/syscalls.c projects/clang900-import/usr.sbin/freebsd-update/freebsd-update.8 projects/clang900-import/usr.sbin/freebsd-update/freebsd-update.sh projects/clang900-import/usr.sbin/newsyslog/newsyslog.conf projects/clang900-import/usr.sbin/ntp/libntp/Makefile projects/clang900-import/usr.sbin/pkg/Makefile projects/clang900-import/usr.sbin/syslogd/syslog.conf Directory Properties: projects/clang900-import/ (props changed) projects/clang900-import/cddl/ (props changed) projects/clang900-import/cddl/contrib/opensolaris/ (props changed) projects/clang900-import/cddl/contrib/opensolaris/cmd/zfs/ (props changed) projects/clang900-import/cddl/contrib/opensolaris/lib/libzfs/ (props changed) projects/clang900-import/contrib/netbsd-tests/ (props changed) projects/clang900-import/sys/cddl/contrib/opensolaris/ (props changed) Modified: projects/clang900-import/Makefile.inc1 ============================================================================== --- projects/clang900-import/Makefile.inc1 Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/Makefile.inc1 Thu Sep 19 19:26:12 2019 (r352537) @@ -2773,6 +2773,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ lib/libfigpar \ ${_lib_libgssapi} \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd lib/libnv \ + lib/libzstd \ ${_lib_casper} \ lib/ncurses/ncurses lib/ncurses/ncursesw \ lib/libopie lib/libpam/libpam ${_lib_libthr} \ Modified: projects/clang900-import/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- projects/clang900-import/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Sep 19 19:26:12 2019 (r352537) @@ -190,8 +190,8 @@ .Ar snapshot .Nm .Cm send -.Op Fl Lce -.Op Fl i Ar snapshot Ns | Ns bookmark +.Op Fl LPcenv +.Op Fl i Ar snapshot Ns | Ns Ar bookmark .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Nm .Cm send @@ -2766,7 +2766,7 @@ on future versions of .It Xo .Nm .Cm send -.Op Fl Lce +.Op Fl LPcenv .Op Fl i Ar snapshot Ns | Ns Ar bookmark .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot .Xc @@ -2780,7 +2780,7 @@ stream generated from a filesystem or volume is receiv name will be .Pq --head-- . .Bl -tag -width indent -.It Fl i Ar snapshot Ns | Ns bookmark +.It Fl i Ar snapshot Ns | Ns Ar bookmark Generate an incremental send stream. The incremental source must be an earlier snapshot in the destination's history. @@ -2792,6 +2792,23 @@ specified as the last component of the name If the incremental target is a clone, the incremental source can be the origin snapshot, or an earlier snapshot in the origin's filesystem, or the origin's origin, etc. +.It Fl n, -dryrun +Do a dry-run +.Pq Qq No-op +send. +Do not generate any actual send data. +This is useful in conjunction with the +.Fl v +or +.Fl P +flags to determine what data will be sent. +In this case, the verbose output will be written to standard output +.Po contrast with a non-dry-run, where the stream is written to standard output +and the verbose output goes to standard error +.Pc . +.It Fl v, -verbose +Print verbose information about the stream package generated. +This information includes a per-second report of how much data has been sent. .It Fl L, -large-block Generate a stream which may contain blocks larger than 128KB. This flag @@ -2808,6 +2825,8 @@ See for details on ZFS feature flags and the .Sy large_blocks feature. +.It Fl P, -parsable +Print machine-parsable verbose information about the stream package generated. .It Fl c, -compressed Generate a more compact stream by using compressed WRITE records for blocks which are compressed on disk and in memory (see the Modified: projects/clang900-import/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- projects/clang900-import/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Thu Sep 19 19:26:12 2019 (r352537) @@ -290,7 +290,7 @@ get_usage(zfs_help_t idx) case HELP_SEND: return (gettext("\tsend [-DnPpRvLec] [-[iI] snapshot] " "\n" - "\tsend [-Le] [-i snapshot|bookmark] " + "\tsend [-LPcenv] [-i snapshot|bookmark] " "\n" "\tsend [-nvPe] -t \n")); case HELP_SET: @@ -3928,13 +3928,11 @@ zfs_do_send(int argc, char **argv) if (strchr(argv[0], '@') == NULL || (fromname && strchr(fromname, '#') != NULL)) { char frombuf[ZFS_MAX_DATASET_NAME_LEN]; - enum lzc_send_flags lzc_flags = 0; if (flags.replicate || flags.doall || flags.props || - flags.dedup || flags.dryrun || flags.verbose || - flags.progress) { - (void) fprintf(stderr, - gettext("Error: " + flags.dedup || (strchr(argv[0], '@') == NULL && + (flags.dryrun || flags.verbose || flags.progress))) { + (void) fprintf(stderr, gettext("Error: " "Unsupported flag with filesystem or bookmark.\n")); return (1); } @@ -3943,13 +3941,6 @@ zfs_do_send(int argc, char **argv) if (zhp == NULL) return (1); - if (flags.largeblock) - lzc_flags |= LZC_SEND_FLAG_LARGE_BLOCK; - if (flags.embed_data) - lzc_flags |= LZC_SEND_FLAG_EMBED_DATA; - if (flags.compress) - lzc_flags |= LZC_SEND_FLAG_COMPRESS; - if (fromname != NULL && (fromname[0] == '#' || fromname[0] == '@')) { /* @@ -3963,7 +3954,7 @@ zfs_do_send(int argc, char **argv) (void) strlcat(frombuf, fromname, sizeof (frombuf)); fromname = frombuf; } - err = zfs_send_one(zhp, fromname, STDOUT_FILENO, lzc_flags); + err = zfs_send_one(zhp, fromname, STDOUT_FILENO, flags); zfs_close(zhp); return (err != 0); } Modified: projects/clang900-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- projects/clang900-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Thu Sep 19 19:26:12 2019 (r352537) @@ -660,7 +660,7 @@ typedef boolean_t (snapfilter_cb_t)(zfs_handle_t *, vo extern int zfs_send(zfs_handle_t *, const char *, const char *, sendflags_t *, int, snapfilter_cb_t, void *, nvlist_t **); -extern int zfs_send_one(zfs_handle_t *, const char *, int, enum lzc_send_flags); +extern int zfs_send_one(zfs_handle_t *, const char *, int, sendflags_t flags); extern int zfs_send_resume(libzfs_handle_t *, sendflags_t *, int outfd, const char *); extern nvlist_t *zfs_send_resume_token_to_nvlist(libzfs_handle_t *hdl, Modified: projects/clang900-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- projects/clang900-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Thu Sep 19 19:26:12 2019 (r352537) @@ -1190,16 +1190,14 @@ send_print_verbose(FILE *fout, const char *tosnap, con } } - if (size != 0) { - if (parsable) { - (void) fprintf(fout, "\t%llu", - (longlong_t)size); - } else { - char buf[16]; - zfs_nicenum(size, buf, sizeof (buf)); - (void) fprintf(fout, dgettext(TEXT_DOMAIN, - " estimated size is %s"), buf); - } + if (parsable) { + (void) fprintf(fout, "\t%llu", + (longlong_t)size); + } else if (size != 0) { + char buf[16]; + zfs_nicenum(size, buf, sizeof (buf)); + (void) fprintf(fout, dgettext(TEXT_DOMAIN, + " estimated size is %s"), buf); } (void) fprintf(fout, "\n"); } @@ -2037,17 +2035,40 @@ err_out: } int -zfs_send_one(zfs_handle_t *zhp, const char *from, int fd, - enum lzc_send_flags flags) +zfs_send_one(zfs_handle_t *zhp, const char *from, int fd, sendflags_t flags) { - int err; + int err = 0; libzfs_handle_t *hdl = zhp->zfs_hdl; - + enum lzc_send_flags lzc_flags = 0; + FILE *fout = (flags.verbose && flags.dryrun) ? stdout : stderr; char errbuf[1024]; + + if (flags.largeblock) + lzc_flags |= LZC_SEND_FLAG_LARGE_BLOCK; + if (flags.embed_data) + lzc_flags |= LZC_SEND_FLAG_EMBED_DATA; + if (flags.compress) + lzc_flags |= LZC_SEND_FLAG_COMPRESS; + + if (flags.verbose) { + uint64_t size = 0; + err = lzc_send_space(zhp->zfs_name, from, lzc_flags, &size); + if (err == 0) { + send_print_verbose(fout, zhp->zfs_name, from, size, + flags.parsable); + } else { + (void) fprintf(stderr, "Cannot estimate send size: " + "%s\n", strerror(errno)); + } + } + + if (flags.dryrun) + return (err); + (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "warning: cannot send '%s'"), zhp->zfs_name); - err = lzc_send(zhp->zfs_name, from, fd, flags); + err = lzc_send(zhp->zfs_name, from, fd, lzc_flags); if (err != 0) { switch (errno) { case EXDEV: Modified: projects/clang900-import/contrib/jemalloc/src/jemalloc.c ============================================================================== --- projects/clang900-import/contrib/jemalloc/src/jemalloc.c Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/contrib/jemalloc/src/jemalloc.c Thu Sep 19 19:26:12 2019 (r352537) @@ -2299,21 +2299,6 @@ je_realloc(void *ptr, size_t size) { LOG("core.realloc.entry", "ptr: %p, size: %zu\n", ptr, size); if (unlikely(size == 0)) { - if (ptr != NULL) { - /* realloc(ptr, 0) is equivalent to free(ptr). */ - UTRACE(ptr, 0, 0); - tcache_t *tcache; - tsd_t *tsd = tsd_fetch(); - if (tsd_reentrancy_level_get(tsd) == 0) { - tcache = tcache_get(tsd); - } else { - tcache = NULL; - } - ifree(tsd, ptr, tcache, true); - - LOG("core.realloc.exit", "result: %p", NULL); - return NULL; - } size = 1; } Modified: projects/clang900-import/contrib/netbsd-tests/lib/libc/sys/t_stat.c ============================================================================== --- projects/clang900-import/contrib/netbsd-tests/lib/libc/sys/t_stat.c Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/contrib/netbsd-tests/lib/libc/sys/t_stat.c Thu Sep 19 19:26:12 2019 (r352537) @@ -332,6 +332,9 @@ ATF_TC_BODY(stat_socket, tc) uint32_t iaddr; int fd, flags; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/240621"); + (void)memset(&st, 0, sizeof(struct stat)); (void)memset(&addr, 0, sizeof(struct sockaddr_in)); Modified: projects/clang900-import/lib/Makefile ============================================================================== --- projects/clang900-import/lib/Makefile Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/lib/Makefile Thu Sep 19 19:26:12 2019 (r352537) @@ -102,7 +102,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ # libraries, those libraries should be listed as build order dependencies here. SUBDIR_DEPEND_geom= libufs -SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd +SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd libzstd SUBDIR_DEPEND_libauditdm= libbsm SUBDIR_DEPEND_libbsnmp= ${_libnetgraph} SUBDIR_DEPEND_libc++:= libcxxrt Modified: projects/clang900-import/lib/libarchive/Makefile ============================================================================== --- projects/clang900-import/lib/libarchive/Makefile Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/lib/libarchive/Makefile Thu Sep 19 19:26:12 2019 (r352537) @@ -6,8 +6,8 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive LIB= archive -LIBADD= z bz2 lzma bsdxml -CFLAGS+= -DHAVE_BZLIB_H=1 -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 +LIBADD= z bz2 lzma bsdxml zstd +CFLAGS+= -DHAVE_BZLIB_H=1 -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 -DHAVE_ZSTD_H=1 -DHAVE_LIBZSTD=1 # FreeBSD SHLIB_MAJOR value is managed as part of the FreeBSD system. # It has no real relation to the libarchive version number. @@ -15,6 +15,7 @@ SHLIB_MAJOR= 7 CFLAGS+= -DPLATFORM_CONFIG_H=\"${.CURDIR}/config_freebsd.h\" CFLAGS+= -I${.OBJDIR} +CFLAGS+= -I${SRCTOP}/sys/contrib/zstd/lib .if ${MK_OPENSSL} != "no" CFLAGS+= -DWITH_OPENSSL Modified: projects/clang900-import/lib/libarchive/tests/Makefile ============================================================================== --- projects/clang900-import/lib/libarchive/tests/Makefile Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/lib/libarchive/tests/Makefile Thu Sep 19 19:26:12 2019 (r352537) @@ -305,6 +305,9 @@ BROKEN_TESTS+= test_read_disk_directory_traversals # (Times out?) [and] crashes BROKEN_TESTS+= test_fuzz_rar +# https://bugs.freebsd.org/240683 +BROKEN_TESTS+= test_write_filter_zstd + # Build the test program. SRCS.libarchive_test= \ ${TESTS_SRCS} \ @@ -517,12 +520,12 @@ ${PACKAGE}FILES+= test_read_format_rar5_blake2.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_compressed.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_different_window_size.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_distance_overflow.rar.uu -${PACKAGE}FILES+= test_read_format_rar5_extra_field_version.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_extra_field_version.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_fileattr.rar.uu -${PACKAGE}FILES+= test_read_format_rar5_hardlink.rar.uu -${PACKAGE}FILES+= test_read_format_rar5_invalid_dict_reference.rar.uu -${PACKAGE}FILES+= test_read_format_rar5_leftshift1.rar.uu -${PACKAGE}FILES+= test_read_format_rar5_leftshift2.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_hardlink.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_invalid_dict_reference.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_leftshift1.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_leftshift2.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_multiarchive.part01.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_multiarchive.part02.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_multiarchive.part03.rar.uu @@ -538,13 +541,13 @@ ${PACKAGE}FILES+= test_read_format_rar5_multiarchive_s ${PACKAGE}FILES+= test_read_format_rar5_multiple_files.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_multiple_files_solid.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_nonempty_dir_stream.rar.uu -${PACKAGE}FILES+= test_read_format_rar5_owner.rar.uu -${PACKAGE}FILES+= test_read_format_rar5_readtables_overflow.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_owner.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_readtables_overflow.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_solid.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_stored.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_stored_manyfiles.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_symlink.rar.uu -${PACKAGE}FILES+= test_read_format_rar5_truncated_huff.rar.uu +${PACKAGE}FILES+= test_read_format_rar5_truncated_huff.rar.uu ${PACKAGE}FILES+= test_read_format_rar5_win32.rar.uu ${PACKAGE}FILES+= test_read_format_raw.bufr.uu ${PACKAGE}FILES+= test_read_format_raw.data.Z.uu Modified: projects/clang900-import/lib/libbe/be.c ============================================================================== --- projects/clang900-import/lib/libbe/be.c Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/lib/libbe/be.c Thu Sep 19 19:26:12 2019 (r352537) @@ -775,6 +775,7 @@ be_export(libbe_handle_t *lbh, const char *bootenv, in char snap_name[BE_MAXPATHLEN]; char buf[BE_MAXPATHLEN]; zfs_handle_t *zfs; + sendflags_t flags = { 0 }; int err; if ((err = be_snapshot(lbh, bootenv, NULL, true, snap_name)) != 0) @@ -786,7 +787,7 @@ be_export(libbe_handle_t *lbh, const char *bootenv, in if ((zfs = zfs_open(lbh->lzh, buf, ZFS_TYPE_DATASET)) == NULL) return (set_error(lbh, BE_ERR_ZFSOPEN)); - err = zfs_send_one(zfs, NULL, fd, 0); + err = zfs_send_one(zfs, NULL, fd, flags); zfs_close(zfs); return (err); Modified: projects/clang900-import/lib/libc/gen/sysctlnametomib.c ============================================================================== --- projects/clang900-import/lib/libc/gen/sysctlnametomib.c Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/lib/libc/gen/sysctlnametomib.c Thu Sep 19 19:26:12 2019 (r352537) @@ -47,8 +47,8 @@ sysctlnametomib(const char *name, int *mibp, size_t *s int oid[2]; int error; - oid[0] = 0; - oid[1] = 3; + oid[0] = CTL_SYSCTL; + oid[1] = CTL_SYSCTL_NAME2OID; *sizep *= sizeof(int); error = sysctl(oid, 2, mibp, sizep, name, strlen(name)); Modified: projects/clang900-import/lib/libc/sys/open.2 ============================================================================== --- projects/clang900-import/lib/libc/sys/open.2 Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/lib/libc/sys/open.2 Thu Sep 19 19:26:12 2019 (r352537) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd June 14, 2019 +.Dd September 17, 2019 .Dt OPEN 2 .Os .Sh NAME @@ -419,6 +419,11 @@ Too many symbolic links were encountered in translatin .It Bq Er EISDIR The named file is a directory, and the arguments specify it is to be modified. +.It Bq Er EISDIR +The named file is a directory, and the flags specified +.Dv O_CREAT +without +.Dv O_DIRECTORY . .It Bq Er EROFS The named file resides on a read-only file system, and the file is to be modified. Modified: projects/clang900-import/lib/libpmc/libpmc.c ============================================================================== --- projects/clang900-import/lib/libpmc/libpmc.c Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/lib/libpmc/libpmc.c Thu Sep 19 19:26:12 2019 (r352537) @@ -143,6 +143,7 @@ PMC_CLASSDEP_TABLE(k8, K8); PMC_CLASSDEP_TABLE(xscale, XSCALE); PMC_CLASSDEP_TABLE(armv7, ARMV7); PMC_CLASSDEP_TABLE(armv8, ARMV8); +PMC_CLASSDEP_TABLE(beri, BERI); PMC_CLASSDEP_TABLE(mips24k, MIPS24K); PMC_CLASSDEP_TABLE(mips74k, MIPS74K); PMC_CLASSDEP_TABLE(octeon, OCTEON); @@ -187,6 +188,7 @@ static const struct pmc_event_descr cortex_a57_event_t PMC_MDEP_TABLE(k8, K8, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(xscale, XSCALE, PMC_CLASS_SOFT, PMC_CLASS_XSCALE); +PMC_MDEP_TABLE(beri, BERI, PMC_CLASS_SOFT, PMC_CLASS_BERI); PMC_MDEP_TABLE(cortex_a8, ARMV7, PMC_CLASS_SOFT, PMC_CLASS_ARMV7); PMC_MDEP_TABLE(cortex_a9, ARMV7, PMC_CLASS_SOFT, PMC_CLASS_ARMV7); PMC_MDEP_TABLE(cortex_a53, ARMV8, PMC_CLASS_SOFT, PMC_CLASS_ARMV8); @@ -235,6 +237,7 @@ PMC_CLASS_TABLE_DESC(cortex_a53, ARMV8, cortex_a53, ar PMC_CLASS_TABLE_DESC(cortex_a57, ARMV8, cortex_a57, arm64); #endif #if defined(__mips__) +PMC_CLASS_TABLE_DESC(beri, BERI, beri, mips); PMC_CLASS_TABLE_DESC(mips24k, MIPS24K, mips24k, mips); PMC_CLASS_TABLE_DESC(mips74k, MIPS74K, mips74k, mips); PMC_CLASS_TABLE_DESC(octeon, OCTEON, octeon, mips); @@ -829,6 +832,11 @@ arm64_allocate_pmc(enum pmc_event pe, char *ctrspec __ #if defined(__mips__) +static struct pmc_event_alias beri_aliases[] = { + EV_ALIAS("instructions", "INST"), + EV_ALIAS(NULL, NULL) +}; + static struct pmc_event_alias mips24k_aliases[] = { EV_ALIAS("instructions", "INSTR_EXECUTED"), EV_ALIAS("branches", "BRANCH_COMPLETED"), @@ -1267,6 +1275,10 @@ pmc_event_names_of_class(enum pmc_class cl, const char break; } break; + case PMC_CLASS_BERI: + ev = beri_event_table; + count = PMC_EVENT_TABLE_SIZE(beri); + break; case PMC_CLASS_MIPS24K: ev = mips24k_event_table; count = PMC_EVENT_TABLE_SIZE(mips24k); @@ -1508,6 +1520,10 @@ pmc_init(void) break; #endif #if defined(__mips__) + case PMC_CPU_MIPS_BERI: + PMC_MDEP_INIT(beri); + pmc_class_table[n] = &beri_class_table_descr; + break; case PMC_CPU_MIPS_24K: PMC_MDEP_INIT(mips24k); pmc_class_table[n] = &mips24k_class_table_descr; @@ -1645,6 +1661,9 @@ _pmc_name_of_event(enum pmc_event pe, enum pmc_cputype default: /* Unknown CPU type. */ break; } + } else if (pe >= PMC_EV_BERI_FIRST && pe <= PMC_EV_BERI_LAST) { + ev = beri_event_table; + evfence = beri_event_table + PMC_EVENT_TABLE_SIZE(beri); } else if (pe >= PMC_EV_MIPS24K_FIRST && pe <= PMC_EV_MIPS24K_LAST) { ev = mips24k_event_table; evfence = mips24k_event_table + PMC_EVENT_TABLE_SIZE(mips24k); Modified: projects/clang900-import/sbin/ifconfig/ifmedia.c ============================================================================== --- projects/clang900-import/sbin/ifconfig/ifmedia.c Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/sbin/ifconfig/ifmedia.c Thu Sep 19 19:26:12 2019 (r352537) @@ -80,6 +80,7 @@ #include #include #include +#include #include #include #include @@ -110,18 +111,20 @@ static void media_status(int s) { struct ifmediareq ifmr; + struct ifdownreason ifdr; int *media_list, i; - int xmedia = 1; + bool no_carrier, xmedia; (void) memset(&ifmr, 0, sizeof(ifmr)); (void) strlcpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); + xmedia = true; /* * Check if interface supports extended media types. */ if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)&ifmr) < 0) - xmedia = 0; - if (xmedia == 0 && ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { + xmedia = false; + if (!xmedia && ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { /* * Interface doesn't support SIOC{G,S}IFMEDIA. */ @@ -158,6 +161,7 @@ media_status(int s) putchar('\n'); if (ifmr.ifm_status & IFM_AVALID) { + no_carrier = false; printf("\tstatus: "); switch (IFM_TYPE(ifmr.ifm_active)) { case IFM_ETHER: @@ -165,7 +169,7 @@ media_status(int s) if (ifmr.ifm_status & IFM_ACTIVE) printf("active"); else - printf("no carrier"); + no_carrier = true; break; case IFM_IEEE80211: @@ -176,8 +180,26 @@ media_status(int s) else printf("running"); } else - printf("no carrier"); + no_carrier = true; break; + } + if (no_carrier) { + printf("no carrier"); + memset(&ifdr, 0, sizeof(ifdr)); + strlcpy(ifdr.ifdr_name, name, sizeof(ifdr.ifdr_name)); + if (ioctl(s, SIOCGIFDOWNREASON, (caddr_t)&ifdr) == 0) { + switch (ifdr.ifdr_reason) { + case IFDR_REASON_MSG: + printf(" (%s)", ifdr.ifdr_msg); + break; + case IFDR_REASON_VENDOR: + printf(" (vendor code %d)", + ifdr.ifdr_vendor); + break; + default: + break; + } + } } putchar('\n'); } Modified: projects/clang900-import/share/man/man5/src.conf.5 ============================================================================== --- projects/clang900-import/share/man/man5/src.conf.5 Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/share/man/man5/src.conf.5 Thu Sep 19 19:26:12 2019 (r352537) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd August 16, 2019 +.Dd September 17, 2019 .Dt SRC.CONF 5 .Os .Sh NAME @@ -831,6 +831,17 @@ Set to neither build nor install .Lb libgmock , .Lb libgtest , and dependent tests. +.Pp +This is a default setting on +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf and mips/mips64hf. +.It Va WITH_GOOGLETEST +Set to build and install +.Lb libgmock , +.Lb libgtest , +and dependent tests. +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITHOUT_GPIO Set to not build .Xr gpioctl 8 Modified: projects/clang900-import/share/mk/src.libnames.mk ============================================================================== --- projects/clang900-import/share/mk/src.libnames.mk Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/share/mk/src.libnames.mk Thu Sep 19 19:26:12 2019 (r352537) @@ -230,7 +230,7 @@ LIBVERIEXEC?= ${LIBVERIEXECDIR}/libveriexec${PIE_SUFFI # Each library's LIBADD needs to be duplicated here for static linkage of # 2nd+ order consumers. Auto-generating this would be better. _DP_80211= sbuf bsdxml -_DP_archive= z bz2 lzma bsdxml +_DP_archive= z bz2 lzma bsdxml zstd _DP_zstd= pthread .if ${MK_BLACKLIST} != "no" _DP_blacklist+= pthread Modified: projects/clang900-import/share/mk/src.opts.mk ============================================================================== --- projects/clang900-import/share/mk/src.opts.mk Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/share/mk/src.opts.mk Thu Sep 19 19:26:12 2019 (r352537) @@ -108,7 +108,6 @@ __DEFAULT_YES_OPTIONS = \ GDB \ GNU_DIFF \ GNU_GREP \ - GOOGLETEST \ GPIO \ HAST \ HTML \ @@ -258,6 +257,15 @@ __T=${MACHINE_ARCH} __TT=${TARGET} .else __TT=${MACHINE} +.endif + +# Default GOOGLETEST to off for MIPS while LLVM PR 43263 is active. Part +# of the fusefs tests trigger excessively long compile times. It does +# eventually succeed, but this shouldn't be forced on those building by default. +.if ${__TT} == "mips" +__DEFAULT_NO_OPTIONS+= GOOGLETEST +.else +__DEFAULT_YES_OPTIONS+= GOOGLETEST .endif # All supported backends for LLVM_TARGET_XXX Modified: projects/clang900-import/stand/efi/libefi/efipart.c ============================================================================== --- projects/clang900-import/stand/efi/libefi/efipart.c Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/stand/efi/libefi/efipart.c Thu Sep 19 19:26:12 2019 (r352537) @@ -64,6 +64,9 @@ static int efipart_printhd(int); #define PNP0700 0x700 #define PNP0701 0x701 +/* Bounce buffer max size */ +#define BIO_BUFFER_SIZE 0x4000 + struct devsw efipart_fddev = { .dv_name = "fd", .dv_type = DEVT_FD, @@ -266,6 +269,12 @@ efipart_inithandles(void) continue; } + /* Allowed values are 0, 1 and power of 2. */ + if (blkio->Media->IoAlign > 1 && + !powerof2(blkio->Media->IoAlign)) { + continue; + } + /* This is bad. */ if ((pd = calloc(1, sizeof(*pd))) == NULL) { printf("efipart_inithandles: Out of memory.\n"); @@ -979,8 +988,10 @@ efipart_realstrategy(void *devdata, int rw, daddr_t bl EFI_BLOCK_IO *blkio; uint64_t off, disk_blocks, d_offset = 0; char *blkbuf; - size_t blkoff, blksz; - int error; + size_t blkoff, blksz, bio_size; + unsigned ioalign; + bool need_buf; + int rc; uint64_t diskend, readstart; if (dev == NULL || blk < 0) @@ -1028,40 +1039,118 @@ efipart_realstrategy(void *devdata, int rw, daddr_t bl size = size * blkio->Media->BlockSize; } - if (rsize != NULL) - *rsize = size; - + need_buf = true; + /* Do we need bounce buffer? */ if ((size % blkio->Media->BlockSize == 0) && (off % blkio->Media->BlockSize == 0)) - return (efipart_readwrite(blkio, rw, - off / blkio->Media->BlockSize, - size / blkio->Media->BlockSize, buf)); + need_buf = false; - /* - * The buffer size is not a multiple of the media block size. - */ - blkbuf = malloc(blkio->Media->BlockSize); + /* Do we have IO alignment requirement? */ + ioalign = blkio->Media->IoAlign; + if (ioalign == 0) + ioalign++; + + if (ioalign > 1 && (uintptr_t)buf != roundup2((uintptr_t)buf, ioalign)) + need_buf = true; + + if (need_buf) { + for (bio_size = BIO_BUFFER_SIZE; bio_size > 0; + bio_size -= blkio->Media->BlockSize) { + blkbuf = memalign(ioalign, bio_size); + if (blkbuf != NULL) + break; + } + } else { + blkbuf = buf; + bio_size = size; + } + if (blkbuf == NULL) return (ENOMEM); - error = 0; + if (rsize != NULL) + *rsize = size; + + rc = 0; blk = off / blkio->Media->BlockSize; blkoff = off % blkio->Media->BlockSize; - blksz = blkio->Media->BlockSize - blkoff; + while (size > 0) { - error = efipart_readwrite(blkio, rw, blk, 1, blkbuf); - if (error) + size_t x = min(size, bio_size); + + if (x < blkio->Media->BlockSize) + x = 1; + else + x /= blkio->Media->BlockSize; + + switch (rw & F_MASK) { + case F_READ: + blksz = blkio->Media->BlockSize * x - blkoff; + if (size < blksz) + blksz = size; + + rc = efipart_readwrite(blkio, rw, blk, x, blkbuf); + if (rc != 0) + goto error; + + if (need_buf) + bcopy(blkbuf + blkoff, buf, blksz); break; - if (size < blksz) - blksz = size; - bcopy(blkbuf + blkoff, buf, blksz); + case F_WRITE: + rc = 0; + if (blkoff != 0) { + /* + * We got offset to sector, read 1 sector to + * blkbuf. + */ + x = 1; + blksz = blkio->Media->BlockSize - blkoff; + blksz = min(blksz, size); + rc = efipart_readwrite(blkio, F_READ, blk, x, + blkbuf); + } else if (size < blkio->Media->BlockSize) { + /* + * The remaining block is not full + * sector. Read 1 sector to blkbuf. + */ + x = 1; + blksz = size; + rc = efipart_readwrite(blkio, F_READ, blk, x, + blkbuf); + } else { + /* We can write full sector(s). */ + blksz = blkio->Media->BlockSize * x; + } + + if (rc != 0) + goto error; + /* + * Put your Data In, Put your Data out, + * Put your Data In, and shake it all about + */ + if (need_buf) + bcopy(buf, blkbuf + blkoff, blksz); + rc = efipart_readwrite(blkio, F_WRITE, blk, x, blkbuf); + if (rc != 0) + goto error; + break; + default: + /* DO NOTHING */ + rc = EROFS; + goto error; + } + + blkoff = 0; buf += blksz; size -= blksz; - blk++; - blkoff = 0; - blksz = blkio->Media->BlockSize; + blk += x; } - free(blkbuf); - return (error); +error: + if (rsize != NULL) + *rsize -= size; + + if (need_buf) + free(blkbuf); + return (rc); } Modified: projects/clang900-import/stand/forth/loader.4th ============================================================================== --- projects/clang900-import/stand/forth/loader.4th Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/stand/forth/loader.4th Thu Sep 19 19:26:12 2019 (r352537) @@ -27,6 +27,29 @@ only forth definitions +\ provide u> if needed +s" u>" sfind [if] drop [else] + drop +: u> + 2dup u< if 2drop 0 exit then + swap u< if -1 exit then + 0 +; +[then] + +\ provide xemit if needed +s" xemit" sfind [if] drop [else] + drop +: xemit + dup 0x80 u< if emit exit then + 0 swap 0x3F + begin 2dup u> while + 2/ >r dup 0x3F and 0x80 or swap 6 rshift r> + repeat 0x7F xor 2* or + begin dup 0x80 u< 0= while emit repeat drop +; +[then] + s" arch-i386" environment? [if] [if] s" loader_version" environment? [if] 11 < [if] Modified: projects/clang900-import/stand/libsa/stand.h ============================================================================== --- projects/clang900-import/stand/libsa/stand.h Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/stand/libsa/stand.h Thu Sep 19 19:26:12 2019 (r352537) @@ -264,9 +264,6 @@ static __inline int tolower(int c) extern void setheap(void *base, void *top); extern char *sbrk(int incr); -extern void *reallocf(void *ptr, size_t size); -extern void mallocstats(void); - extern int printf(const char *fmt, ...) __printflike(1, 2); extern int asprintf(char **buf, const char *cfmt, ...) __printflike(2, 3); extern int sprintf(char *buf, const char *cfmt, ...) __printflike(2, 3); @@ -430,20 +427,27 @@ extern uint16_t ntohs(uint16_t); #endif void *Malloc(size_t, const char *, int); +void *Memalign(size_t, size_t, const char *, int); void *Calloc(size_t, size_t, const char *, int); void *Realloc(void *, size_t, const char *, int); +void *Reallocf(void *, size_t, const char *, int); void Free(void *, const char *, int); +extern void mallocstats(void); #ifdef DEBUG_MALLOC #define malloc(x) Malloc(x, __FILE__, __LINE__) +#define memalign(x, y) Memalign(x, y, __FILE__, __LINE__) #define calloc(x, y) Calloc(x, y, __FILE__, __LINE__) #define free(x) Free(x, __FILE__, __LINE__) #define realloc(x, y) Realloc(x, y, __FILE__, __LINE__) +#define reallocf(x, y) Reallocf(x, y, __FILE__, __LINE__) #else #define malloc(x) Malloc(x, NULL, 0) +#define memalign(x, y) Memalign(x, y, NULL, 0) #define calloc(x, y) Calloc(x, y, NULL, 0) #define free(x) Free(x, NULL, 0) #define realloc(x, y) Realloc(x, y, NULL, 0) +#define reallocf(x, y) Reallocf(x, y, NULL, 0) #endif #endif /* STAND_H */ Modified: projects/clang900-import/stand/libsa/zalloc.c ============================================================================== --- projects/clang900-import/stand/libsa/zalloc.c Thu Sep 19 19:25:01 2019 (r352536) +++ projects/clang900-import/stand/libsa/zalloc.c Thu Sep 19 19:26:12 2019 (r352537) @@ -1,5 +1,5 @@ /* - * This module derived from code donated to the FreeBSD Project by + * This module derived from code donated to the FreeBSD Project by * Matthew Dillon * * Copyright (c) 1998 The FreeBSD Project @@ -30,11 +30,13 @@ #include __FBSDID("$FreeBSD$"); +#include + /* - * LIB/MEMORY/ZALLOC.C - self contained low-overhead memory pool/allocation + * LIB/MEMORY/ZALLOC.C - self contained low-overhead memory pool/allocation * subsystem * - * This subsystem implements memory pools and memory allocation + * This subsystem implements memory pools and memory allocation * routines. * * Pools are managed via a linked list of 'free' areas. Allocating @@ -43,7 +45,7 @@ __FBSDID("$FreeBSD$"); * to allocate the entire pool without incuring any structural overhead. * * The system works best when allocating similarly-sized chunks of - * memory. Care must be taken to avoid fragmentation when + * memory. Care must be taken to avoid fragmentation when * allocating/deallocating dissimilar chunks. * * When a memory pool is first allocated, the entire pool is marked as @@ -53,7 +55,7 @@ __FBSDID("$FreeBSD$"); * available. * * z[n]xalloc() works like z[n]alloc() but the allocation is made from - * within the specified address range. If the segment could not be + * within the specified address range. If the segment could not be * allocated, NULL is returned. WARNING! The address range will be * aligned to an 8 or 16 byte boundry depending on the cpu so if you * give an unaligned address range, unexpected results may occur. @@ -86,58 +88,82 @@ typedef char assert_align[(sizeof(struct MemNode) <= M */ void * -znalloc(MemPool *mp, uintptr_t bytes) +znalloc(MemPool *mp, uintptr_t bytes, size_t align) { - /* - * align according to pool object size (can be 0). This is - * inclusive of the MEMNODE_SIZE_MASK minimum alignment. - * - */ - bytes = (bytes + MEMNODE_SIZE_MASK) & ~MEMNODE_SIZE_MASK; - - if (bytes == 0) - return((void *)-1); - - /* - * locate freelist entry big enough to hold the object. If all objects - * are the same size, this is a constant-time function. - */ - - if (bytes <= mp->mp_Size - mp->mp_Used) { MemNode **pmn; MemNode *mn; - for (pmn = &mp->mp_First; (mn=*pmn) != NULL; pmn = &mn->mr_Next) { - if (bytes > mn->mr_Bytes) - continue; + /* + * align according to pool object size (can be 0). This is + * inclusive of the MEMNODE_SIZE_MASK minimum alignment. + * + */ + bytes = (bytes + MEMNODE_SIZE_MASK) & ~MEMNODE_SIZE_MASK; - /* - * Cut a chunk of memory out of the beginning of this - * block and fixup the link appropriately. - */ + if (bytes == 0) + return ((void *)-1); - { + /* + * locate freelist entry big enough to hold the object. If all objects + * are the same size, this is a constant-time function. + */ + + if (bytes > mp->mp_Size - mp->mp_Used) + return (NULL); + + for (pmn = &mp->mp_First; (mn = *pmn) != NULL; pmn = &mn->mr_Next) { char *ptr = (char *)mn; + uintptr_t dptr; + char *aligned; + size_t extra; + dptr = (uintptr_t)(ptr + MALLOCALIGN); /* pointer to data */ + aligned = (char *)(roundup2(dptr, align) - MALLOCALIGN); + extra = aligned - ptr; + + if (bytes + extra > mn->mr_Bytes) + continue; + + /* + * Cut extra from head and create new memory node from reminder. + */ + + if (extra != 0) { + MemNode *new; + + new = (MemNode *)aligned; + new->mr_Next = mn->mr_Next; + new->mr_Bytes = mn->mr_Bytes - extra; + + /* And update current memory node */ + mn->mr_Bytes = extra; + mn->mr_Next = new; + /* In next iteration, we will get our aligned address */ + continue; + } + + /* + * Cut a chunk of memory out of the beginning of this + * block and fixup the link appropriately. + */ + if (mn->mr_Bytes == bytes) { - *pmn = mn->mr_Next; + *pmn = mn->mr_Next; } else { - mn = (MemNode *)((char *)mn + bytes); - mn->mr_Next = ((MemNode *)ptr)->mr_Next; - mn->mr_Bytes = ((MemNode *)ptr)->mr_Bytes - bytes; - *pmn = mn; + mn = (MemNode *)((char *)mn + bytes); + mn->mr_Next = ((MemNode *)ptr)->mr_Next; + mn->mr_Bytes = ((MemNode *)ptr)->mr_Bytes - bytes; + *pmn = mn; } mp->mp_Used += bytes; return(ptr); - } } - } - /* - * Memory pool is full, return NULL. - */ + /* + * Memory pool is full, return NULL. + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@freebsd.org Thu Sep 19 19:39:34 2019 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC0F512C989 for ; Thu, 19 Sep 2019 19:39:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Z6cQ5WGvz4BfH; Thu, 19 Sep 2019 19:39:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A13621A3B4; Thu, 19 Sep 2019 19:39:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8JJdYTC090664; Thu, 19 Sep 2019 19:39:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8JJdYMT090662; Thu, 19 Sep 2019 19:39:34 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909191939.x8JJdYMT090662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 19 Sep 2019 19:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r352538 - projects/clang900-import/contrib/libc++/include X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang900-import/contrib/libc++/include X-SVN-Commit-Revision: 352538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 19:39:34 -0000 Author: dim Date: Thu Sep 19 19:39:34 2019 New Revision: 352538 URL: https://svnweb.freebsd.org/changeset/base/352538 Log: Partially undo r351659, which unconditionally removed gets(3) from libc++. Instead, pull in r371324 from upstream libc++ trunk (by me): Remove ::gets for FreeBSD 13 and later Summary: In https://svnweb.freebsd.org/changeset/base/351659 @emaste removed gets() from FreeBSD 13's libc, and our copies of libc++ and libstdc++. In that change, the declarations were simply deleted, but I would like to propose this conditional test instead. Reviewers: EricWF, mclow.lists, emaste Reviewed By: mclow.lists Subscribers: krytarowski, christof, ldionne, emaste, libcxx-commits Differential Revision: https://reviews.llvm.org/D67316 This makes these changes more MFCable. Modified: projects/clang900-import/contrib/libc++/include/__config projects/clang900-import/contrib/libc++/include/cstdio Modified: projects/clang900-import/contrib/libc++/include/__config ============================================================================== --- projects/clang900-import/contrib/libc++/include/__config Thu Sep 19 19:26:12 2019 (r352537) +++ projects/clang900-import/contrib/libc++/include/__config Thu Sep 19 19:39:34 2019 (r352538) @@ -1129,6 +1129,13 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_ #define _LIBCPP_HAS_NO_STDOUT #endif +// Some systems do not provide gets() in their C library, for security reasons. +#ifndef _LIBCPP_C_HAS_NO_GETS +# if defined(_LIBCPP_MSVCRT) || (defined(__FreeBSD__) && __FreeBSD__ >= 13) +# define _LIBCPP_C_HAS_NO_GETS +# endif +#endif + #if defined(__BIONIC__) || defined(__CloudABI__) || \ defined(__Fuchsia__) || defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC) #define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE Modified: projects/clang900-import/contrib/libc++/include/cstdio ============================================================================== --- projects/clang900-import/contrib/libc++/include/cstdio Thu Sep 19 19:26:12 2019 (r352537) +++ projects/clang900-import/contrib/libc++/include/cstdio Thu Sep 19 19:39:34 2019 (r352538) @@ -73,6 +73,7 @@ int fputc(int c, FILE* stream); int fputs(const char* restrict s, FILE* restrict stream); int getc(FILE* stream); int getchar(void); +char* gets(char* s); // removed in C++14 int putc(int c, FILE* stream); int putchar(int c); int puts(const char* s); @@ -151,6 +152,9 @@ using ::tmpnam; #ifndef _LIBCPP_HAS_NO_STDIN using ::getchar; +#if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_C_HAS_NO_GETS) +using ::gets; +#endif using ::scanf; using ::vscanf; #endif From owner-svn-src-projects@freebsd.org Thu Sep 19 19:43:01 2019 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3983E12CC89 for ; Thu, 19 Sep 2019 19:43:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Z6hP07Ldz4CC9; Thu, 19 Sep 2019 19:43:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DBB601A585; Thu, 19 Sep 2019 19:43:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8JJh0Q4096364; Thu, 19 Sep 2019 19:43:00 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8JJh0ZJ096361; Thu, 19 Sep 2019 19:43:00 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909191943.x8JJh0ZJ096361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 19 Sep 2019 19:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r352539 - in projects/clang900-import/contrib/llvm/tools/clang: include/clang/Driver lib/Basic/Targets lib/CodeGen X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang900-import/contrib/llvm/tools/clang: include/clang/Driver lib/Basic/Targets lib/CodeGen X-SVN-Commit-Revision: 352539 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Sep 2019 19:43:01 -0000 Author: dim Date: Thu Sep 19 19:42:59 2019 New Revision: 352539 URL: https://svnweb.freebsd.org/changeset/base/352539 Log: Pull in r371066 from upstream clang trunk (by Justin Hibbits): Add -m(no)-spe to clang Summary: r337347 added support for the Signal Processing Engine (SPE) to LLVM. This follows that up with the clang side. This adds -mspe and -mno-spe, to match GCC. Subscribers: nemanjai, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D49754 Modified: projects/clang900-import/contrib/llvm/tools/clang/include/clang/Driver/Options.td projects/clang900-import/contrib/llvm/tools/clang/lib/Basic/Targets/PPC.cpp projects/clang900-import/contrib/llvm/tools/clang/lib/Basic/Targets/PPC.h projects/clang900-import/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Modified: projects/clang900-import/contrib/llvm/tools/clang/include/clang/Driver/Options.td ============================================================================== --- projects/clang900-import/contrib/llvm/tools/clang/include/clang/Driver/Options.td Thu Sep 19 19:39:34 2019 (r352538) +++ projects/clang900-import/contrib/llvm/tools/clang/include/clang/Driver/Options.td Thu Sep 19 19:42:59 2019 (r352539) @@ -2241,6 +2241,8 @@ def faltivec : Flag<["-"], "faltivec">, Group def fno_altivec : Flag<["-"], "fno-altivec">, Group, Flags<[DriverOption]>; def maltivec : Flag<["-"], "maltivec">, Group; def mno_altivec : Flag<["-"], "mno-altivec">, Group; +def mspe : Flag<["-"], "mspe">, Group; +def mno_spe : Flag<["-"], "mno-spe">, Group; def mvsx : Flag<["-"], "mvsx">, Group; def mno_vsx : Flag<["-"], "mno-vsx">, Group; def msecure_plt : Flag<["-"], "msecure-plt">, Group; Modified: projects/clang900-import/contrib/llvm/tools/clang/lib/Basic/Targets/PPC.cpp ============================================================================== --- projects/clang900-import/contrib/llvm/tools/clang/lib/Basic/Targets/PPC.cpp Thu Sep 19 19:39:34 2019 (r352538) +++ projects/clang900-import/contrib/llvm/tools/clang/lib/Basic/Targets/PPC.cpp Thu Sep 19 19:42:59 2019 (r352539) @@ -54,6 +54,10 @@ bool PPCTargetInfo::handleTargetFeatures(std::vector Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBC2312EE93 for ; Sat, 21 Sep 2019 21:01:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46bNLC57BWz40FF; Sat, 21 Sep 2019 21:01:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AD8E1BF74; Sat, 21 Sep 2019 21:01:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8LL1dWP055134; Sat, 21 Sep 2019 21:01:39 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8LL1dWB055133; Sat, 21 Sep 2019 21:01:39 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909212101.x8LL1dWB055133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 21 Sep 2019 21:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r352586 - projects/clang900-import/contrib/llvm/tools/clang/lib/AST X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: projects/clang900-import/contrib/llvm/tools/clang/lib/AST X-SVN-Commit-Revision: 352586 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2019 21:01:39 -0000 Author: dim Date: Sat Sep 21 21:01:38 2019 New Revision: 352586 URL: https://svnweb.freebsd.org/changeset/base/352586 Log: Pull in r371557 from upstream clang trunk (by Richard Smith): When evaluating a __builtin_constant_p conditional, always enter constant-folding mode regardless of the original evaluation mode. In order for this to be correct, we need to track whether we're checking for a potential constant expression or checking for undefined behavior separately from the evaluation mode enum, since we don't want to clobber those states when entering constant-folding mode. This should fix "ld: error: undefined symbol: ix86_isa_flags" (and many other symbol names) during the initial stages of the lang/gcc* ports. The issue was that without optimization, the __builtin_constant_p() expressions generated in gencondmd.c would emit references to global variables that were undefined, such as ix86_isa_flags. PR: 240629 Modified: projects/clang900-import/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp Modified: projects/clang900-import/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp ============================================================================== --- projects/clang900-import/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp Sat Sep 21 20:03:17 2019 (r352585) +++ projects/clang900-import/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp Sat Sep 21 21:01:38 2019 (r352586) @@ -794,58 +794,47 @@ namespace { /// constant value. bool InConstantContext; + /// Whether we're checking that an expression is a potential constant + /// expression. If so, do not fail on constructs that could become constant + /// later on (such as a use of an undefined global). + bool CheckingPotentialConstantExpression = false; + + /// Whether we're checking for an expression that has undefined behavior. + /// If so, we will produce warnings if we encounter an operation that is + /// always undefined. + bool CheckingForUndefinedBehavior = false; + enum EvaluationMode { /// Evaluate as a constant expression. Stop if we find that the expression /// is not a constant expression. EM_ConstantExpression, - /// Evaluate as a potential constant expression. Keep going if we hit a - /// construct that we can't evaluate yet (because we don't yet know the - /// value of something) but stop if we hit something that could never be - /// a constant expression. - EM_PotentialConstantExpression, + /// Evaluate as a constant expression. Stop if we find that the expression + /// is not a constant expression. Some expressions can be retried in the + /// optimizer if we don't constant fold them here, but in an unevaluated + /// context we try to fold them immediately since the optimizer never + /// gets a chance to look at it. + EM_ConstantExpressionUnevaluated, /// Fold the expression to a constant. Stop if we hit a side-effect that /// we can't model. EM_ConstantFold, - /// Evaluate the expression looking for integer overflow and similar - /// issues. Don't worry about side-effects, and try to visit all - /// subexpressions. - EM_EvaluateForOverflow, - /// Evaluate in any way we know how. Don't worry about side-effects that /// can't be modeled. EM_IgnoreSideEffects, - - /// Evaluate as a constant expression. Stop if we find that the expression - /// is not a constant expression. Some expressions can be retried in the - /// optimizer if we don't constant fold them here, but in an unevaluated - /// context we try to fold them immediately since the optimizer never - /// gets a chance to look at it. - EM_ConstantExpressionUnevaluated, - - /// Evaluate as a potential constant expression. Keep going if we hit a - /// construct that we can't evaluate yet (because we don't yet know the - /// value of something) but stop if we hit something that could never be - /// a constant expression. Some expressions can be retried in the - /// optimizer if we don't constant fold them here, but in an unevaluated - /// context we try to fold them immediately since the optimizer never - /// gets a chance to look at it. - EM_PotentialConstantExpressionUnevaluated, } EvalMode; /// Are we checking whether the expression is a potential constant /// expression? bool checkingPotentialConstantExpression() const { - return EvalMode == EM_PotentialConstantExpression || - EvalMode == EM_PotentialConstantExpressionUnevaluated; + return CheckingPotentialConstantExpression; } /// Are we checking an expression for overflow? // FIXME: We should check for any kind of undefined or suspicious behavior // in such constructs, not just overflow. - bool checkingForOverflow() { return EvalMode == EM_EvaluateForOverflow; } + bool checkingForUndefinedBehavior() { return CheckingForUndefinedBehavior; } EvalInfo(const ASTContext &C, Expr::EvalStatus &S, EvaluationMode Mode) : Ctx(const_cast(C)), EvalStatus(S), CurrentCall(nullptr), @@ -932,15 +921,12 @@ namespace { switch (EvalMode) { case EM_ConstantFold: case EM_IgnoreSideEffects: - case EM_EvaluateForOverflow: if (!HasFoldFailureDiagnostic) break; // We've already failed to fold something. Keep that diagnostic. LLVM_FALLTHROUGH; case EM_ConstantExpression: - case EM_PotentialConstantExpression: case EM_ConstantExpressionUnevaluated: - case EM_PotentialConstantExpressionUnevaluated: HasActiveDiagnostic = false; return OptionalDiagnostic(); } @@ -986,8 +972,8 @@ namespace { /// Diagnose that the evaluation does not produce a C++11 core constant /// expression. /// - /// FIXME: Stop evaluating if we're in EM_ConstantExpression or - /// EM_PotentialConstantExpression mode and we produce one of these. + /// FIXME: Stop evaluating if we're in EM_ConstantExpression mode + /// and we produce one of these. OptionalDiagnostic CCEDiag(SourceLocation Loc, diag::kind DiagId = diag::note_invalid_subexpr_in_const_expr, unsigned ExtraNotes = 0) { @@ -1023,16 +1009,16 @@ namespace { /// couldn't model? bool keepEvaluatingAfterSideEffect() { switch (EvalMode) { - case EM_PotentialConstantExpression: - case EM_PotentialConstantExpressionUnevaluated: - case EM_EvaluateForOverflow: case EM_IgnoreSideEffects: return true; case EM_ConstantExpression: case EM_ConstantExpressionUnevaluated: case EM_ConstantFold: - return false; + // By default, assume any side effect might be valid in some other + // evaluation of this expression from a different context. + return checkingPotentialConstantExpression() || + checkingForUndefinedBehavior(); } llvm_unreachable("Missed EvalMode case"); } @@ -1047,16 +1033,13 @@ namespace { /// Should we continue evaluation after encountering undefined behavior? bool keepEvaluatingAfterUndefinedBehavior() { switch (EvalMode) { - case EM_EvaluateForOverflow: case EM_IgnoreSideEffects: case EM_ConstantFold: return true; - case EM_PotentialConstantExpression: - case EM_PotentialConstantExpressionUnevaluated: case EM_ConstantExpression: case EM_ConstantExpressionUnevaluated: - return false; + return checkingForUndefinedBehavior(); } llvm_unreachable("Missed EvalMode case"); } @@ -1076,16 +1059,12 @@ namespace { return false; switch (EvalMode) { - case EM_PotentialConstantExpression: - case EM_PotentialConstantExpressionUnevaluated: - case EM_EvaluateForOverflow: - return true; - case EM_ConstantExpression: case EM_ConstantExpressionUnevaluated: case EM_ConstantFold: case EM_IgnoreSideEffects: - return false; + return checkingPotentialConstantExpression() || + checkingForUndefinedBehavior(); } llvm_unreachable("Missed EvalMode case"); } @@ -1142,9 +1121,7 @@ namespace { Info.EvalStatus.Diag->empty() && !Info.EvalStatus.HasSideEffects), OldMode(Info.EvalMode) { - if (Enabled && - (Info.EvalMode == EvalInfo::EM_ConstantExpression || - Info.EvalMode == EvalInfo::EM_ConstantExpressionUnevaluated)) + if (Enabled) Info.EvalMode = EvalInfo::EM_ConstantFold; } void keepDiagnostics() { Enabled = false; } @@ -1163,8 +1140,7 @@ namespace { EvalInfo::EvaluationMode OldMode; explicit IgnoreSideEffectsRAII(EvalInfo &Info) : Info(Info), OldMode(Info.EvalMode) { - if (!Info.checkingPotentialConstantExpression()) - Info.EvalMode = EvalInfo::EM_IgnoreSideEffects; + Info.EvalMode = EvalInfo::EM_IgnoreSideEffects; } ~IgnoreSideEffectsRAII() { Info.EvalMode = OldMode; } @@ -2323,7 +2299,7 @@ static bool CheckedIntArithmetic(EvalInfo &Info, const APSInt Value(Op(LHS.extend(BitWidth), RHS.extend(BitWidth)), false); Result = Value.trunc(LHS.getBitWidth()); if (Result.extend(BitWidth) != Value) { - if (Info.checkingForOverflow()) + if (Info.checkingForUndefinedBehavior()) Info.Ctx.getDiagnostics().Report(E->getExprLoc(), diag::warn_integer_constant_overflow) << Result.toString(10) << E->getType(); @@ -6047,6 +6023,8 @@ class ExprEvaluatorBase (public) // Always assume __builtin_constant_p(...) ? ... : ... is a potential // constant expression; we can't check whether it's potentially foldable. + // FIXME: We should instead treat __builtin_constant_p as non-constant if + // it would return 'false' in this mode. if (Info.checkingPotentialConstantExpression() && IsBcpCall) return false; @@ -6329,7 +6307,7 @@ class ExprEvaluatorBase (public) bool VisitStmtExpr(const StmtExpr *E) { // We will have checked the full-expressions inside the statement expression // when they were completed, and don't need to check them again now. - if (Info.checkingForOverflow()) + if (Info.checkingForUndefinedBehavior()) return Error(E); BlockScopeRAII Scope(Info); @@ -9499,14 +9477,11 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const Call // size of the referenced object. switch (Info.EvalMode) { case EvalInfo::EM_ConstantExpression: - case EvalInfo::EM_PotentialConstantExpression: case EvalInfo::EM_ConstantFold: - case EvalInfo::EM_EvaluateForOverflow: case EvalInfo::EM_IgnoreSideEffects: // Leave it to IR generation. return Error(E); case EvalInfo::EM_ConstantExpressionUnevaluated: - case EvalInfo::EM_PotentialConstantExpressionUnevaluated: // Reduce it to a constant now. return Success((Type & 2) ? 0 : -1, E); } @@ -12546,8 +12521,9 @@ APSInt Expr::EvaluateKnownConstIntCheckOverflow( EvalResult EVResult; EVResult.Diag = Diag; - EvalInfo Info(Ctx, EVResult, EvalInfo::EM_EvaluateForOverflow); + EvalInfo Info(Ctx, EVResult, EvalInfo::EM_IgnoreSideEffects); Info.InConstantContext = true; + Info.CheckingForUndefinedBehavior = true; bool Result = ::EvaluateAsRValue(Info, this, EVResult.Val); (void)Result; @@ -12564,7 +12540,8 @@ void Expr::EvaluateForOverflow(const ASTContext &Ctx) bool IsConst; EvalResult EVResult; if (!FastEvaluateAsRValue(this, EVResult, Ctx, IsConst)) { - EvalInfo Info(Ctx, EVResult, EvalInfo::EM_EvaluateForOverflow); + EvalInfo Info(Ctx, EVResult, EvalInfo::EM_IgnoreSideEffects); + Info.CheckingForUndefinedBehavior = true; (void)::EvaluateAsRValue(Info, this, EVResult.Val); } } @@ -13178,9 +13155,9 @@ bool Expr::isPotentialConstantExpr(const FunctionDecl Expr::EvalStatus Status; Status.Diag = &Diags; - EvalInfo Info(FD->getASTContext(), Status, - EvalInfo::EM_PotentialConstantExpression); + EvalInfo Info(FD->getASTContext(), Status, EvalInfo::EM_ConstantExpression); Info.InConstantContext = true; + Info.CheckingPotentialConstantExpression = true; const CXXMethodDecl *MD = dyn_cast(FD); const CXXRecordDecl *RD = MD ? MD->getParent()->getCanonicalDecl() : nullptr; @@ -13219,8 +13196,9 @@ bool Expr::isPotentialConstantExprUnevaluated(Expr *E, Status.Diag = &Diags; EvalInfo Info(FD->getASTContext(), Status, - EvalInfo::EM_PotentialConstantExpressionUnevaluated); + EvalInfo::EM_ConstantExpressionUnevaluated); Info.InConstantContext = true; + Info.CheckingPotentialConstantExpression = true; // Fabricate a call stack frame to give the arguments a plausible cover story. ArrayRef Args; From owner-svn-src-projects@freebsd.org Sat Sep 21 21:03:06 2019 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 077BD12F020 for ; Sat, 21 Sep 2019 21:03:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46bNMs6crNz40Q9; Sat, 21 Sep 2019 21:03:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5E9F1C0C5; Sat, 21 Sep 2019 21:03:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8LL35qx056933; Sat, 21 Sep 2019 21:03:05 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8LL2vKp056891; Sat, 21 Sep 2019 21:02:57 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201909212102.x8LL2vKp056891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 21 Sep 2019 21:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r352587 - in projects/clang900-import: . cddl/contrib/opensolaris/lib/libzfs/common contrib/ntp/ntpd share/man/man7 stand/forth stand/libsa stand/lua stand/powerpc/uboot sys/amd64/amd64... X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang900-import: . cddl/contrib/opensolaris/lib/libzfs/common contrib/ntp/ntpd share/man/man7 stand/forth stand/libsa stand/lua stand/powerpc/uboot sys/amd64/amd64 sys/arm64/arm64 sys/dev/... X-SVN-Commit-Revision: 352587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Sep 2019 21:03:06 -0000 Author: dim Date: Sat Sep 21 21:02:57 2019 New Revision: 352587 URL: https://svnweb.freebsd.org/changeset/base/352587 Log: Merge ^/head r352537 through r352586. Modified: projects/clang900-import/Makefile.inc1 projects/clang900-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c projects/clang900-import/contrib/ntp/ntpd/ntpd.c projects/clang900-import/share/man/man7/ascii.7 projects/clang900-import/stand/forth/color.4th projects/clang900-import/stand/libsa/zalloc.c projects/clang900-import/stand/lua/color.lua projects/clang900-import/stand/powerpc/uboot/Makefile projects/clang900-import/sys/amd64/amd64/pmap.c projects/clang900-import/sys/arm64/arm64/pmap.c projects/clang900-import/sys/dev/ioat/ioat.c projects/clang900-import/sys/dev/ioat/ioat_internal.h projects/clang900-import/sys/dev/usb/controller/xhci.c projects/clang900-import/sys/dev/usb/usb_bus.h projects/clang900-import/sys/dev/usb/usb_ioctl.h projects/clang900-import/sys/dev/usb/usb_transfer.c projects/clang900-import/sys/fs/msdosfs/msdosfs_denode.c projects/clang900-import/sys/kern/imgact_elf.c projects/clang900-import/sys/kern/kern_timeout.c projects/clang900-import/sys/kern/subr_lock.c projects/clang900-import/sys/kern/uipc_ktls.c projects/clang900-import/sys/kern/vfs_mount.c projects/clang900-import/sys/netinet/sctp_asconf.c projects/clang900-import/sys/sys/elf_common.h projects/clang900-import/sys/sys/mount.h projects/clang900-import/usr.bin/jot/jot.1 projects/clang900-import/usr.bin/quota/quota.c projects/clang900-import/usr.bin/top/display.c projects/clang900-import/usr.bin/top/display.h projects/clang900-import/usr.bin/top/machine.c projects/clang900-import/usr.bin/top/top.1 projects/clang900-import/usr.bin/top/top.c projects/clang900-import/usr.sbin/freebsd-update/freebsd-update.sh projects/clang900-import/usr.sbin/rpc.statd/Makefile projects/clang900-import/usr.sbin/rpc.statd/file.c projects/clang900-import/usr.sbin/rpc.statd/procs.c projects/clang900-import/usr.sbin/rpc.statd/statd.c projects/clang900-import/usr.sbin/rpc.statd/test.c Directory Properties: projects/clang900-import/ (props changed) projects/clang900-import/cddl/ (props changed) projects/clang900-import/cddl/contrib/opensolaris/ (props changed) projects/clang900-import/cddl/contrib/opensolaris/lib/libzfs/ (props changed) projects/clang900-import/contrib/ntp/ (props changed) Modified: projects/clang900-import/Makefile.inc1 ============================================================================== --- projects/clang900-import/Makefile.inc1 Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/Makefile.inc1 Sat Sep 21 21:02:57 2019 (r352587) @@ -2835,6 +2835,7 @@ _lib_casper= lib/libcasper lib/libpjdlog__L: lib/libutil__L lib/libcasper__L: lib/libnv__L lib/liblzma__L: lib/libthr__L +lib/libzstd__L: lib/libthr__L _generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib .if ${MK_IPFILTER} != "no" Modified: projects/clang900-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- projects/clang900-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Sat Sep 21 21:02:57 2019 (r352587) @@ -1289,13 +1289,11 @@ dump_snapshot(zfs_handle_t *zhp, void *arg) fromorigin = sdd->prevsnap[0] == '\0' && (sdd->fromorigin || sdd->replicate); - if (sdd->progress && sdd->dryrun) { + if (sdd->verbose || sdd->progress) { (void) estimate_ioctl(zhp, sdd->prevsnap_obj, fromorigin, flags, &size); sdd->size += size; - } - if (sdd->verbose) { send_print_verbose(fout, zhp->zfs_name, sdd->prevsnap[0] ? sdd->prevsnap : NULL, size, sdd->parsable); @@ -1663,7 +1661,7 @@ zfs_send_resume(libzfs_handle_t *hdl, sendflags_t *fla fromname = name; } - if (flags->progress) { + if (flags->progress || flags->verbose) { error = lzc_send_space(zhp->zfs_name, fromname, lzc_flags, &size); if (error == 0) @@ -1933,7 +1931,7 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, cons sdd.cleanup_fd = -1; sdd.snapholds = NULL; } - if (flags->progress || sdd.snapholds != NULL) { + if (flags->progress || flags->verbose || sdd.snapholds != NULL) { /* * Do a verbose no-op dry run to get all the verbose output * or to gather snapshot hold's before generating any data, Modified: projects/clang900-import/contrib/ntp/ntpd/ntpd.c ============================================================================== --- projects/clang900-import/contrib/ntp/ntpd/ntpd.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/contrib/ntp/ntpd/ntpd.c Sat Sep 21 21:02:57 2019 (r352587) @@ -999,7 +999,7 @@ ntpdmain( # if defined(HAVE_MLOCKALL) # ifdef HAVE_SETRLIMIT ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k"); -# ifdef RLIMIT_MEMLOCK +# if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) && DFLT_RLIMIT_MEMLOCK != -1 /* * The default RLIMIT_MEMLOCK is very low on Linux systems. * Unless we increase this limit malloc calls are likely to Modified: projects/clang900-import/share/man/man7/ascii.7 ============================================================================== --- projects/clang900-import/share/man/man7/ascii.7 Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/share/man/man7/ascii.7 Sat Sep 21 21:02:57 2019 (r352587) @@ -28,7 +28,7 @@ .\" @(#)ascii.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 30, 2017 +.Dd September 21, 2019 .Dt ASCII 7 .Os .Sh NAME @@ -146,8 +146,15 @@ ESC ; [ { 11011 .Bl -tag -width /usr/share/misc/ascii -compact .It Pa /usr/share/misc/ascii .El +.Sh STANDARDS +.Rs +.%T Information Systems - Coded Character Sets - 7-Bit American National\ + Standard Code for Information Interchange (7-Bit ASCII) +.%R INCITS 4-1986[R2017] +.%Q InterNational Committee for Information Technology Standards +.Re .Sh HISTORY An .Nm manual page appeared in -.At v7 . +.At v2 . Modified: projects/clang900-import/stand/forth/color.4th ============================================================================== --- projects/clang900-import/stand/forth/color.4th Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/stand/forth/color.4th Sat Sep 21 21:02:57 2019 (r352587) @@ -27,12 +27,14 @@ marker task-color.4th \ This function returns FALSE if the `loader_color' environment variable is set -\ to NO, no, or 0. Otherwise, TRUE is returned (unless booting serial). +\ to NO, no, or 0. It returns TRUE if `loader_color' is set to any other value. +\ If `loader_color' is unset, TRUE is returned (unless booting serial). \ -: loader_color? ( -- N ) +: loader_color? ( -- t ) s" loader_color" getenv dup -1 <> if - + \ `loader_color' is set. + \ Check if it is explicitly disabled. 2dup s" NO" compare-insensitive 0= if 2drop FALSE exit @@ -42,8 +44,12 @@ marker task-color.4th FALSE exit then drop + \ It is enabled. + TRUE + else + \ `loader_color' is unset. + \ Default to using color unless serial boot is active. + drop + boot_serial? 0= then - drop - - boot_serial? if FALSE else TRUE then ; Modified: projects/clang900-import/stand/libsa/zalloc.c ============================================================================== --- projects/clang900-import/stand/libsa/zalloc.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/stand/libsa/zalloc.c Sat Sep 21 21:02:57 2019 (r352587) @@ -125,7 +125,8 @@ znalloc(MemPool *mp, uintptr_t bytes, size_t align) continue; /* - * Cut extra from head and create new memory node from reminder. + * Cut extra from head and create new memory node from + * remainder. */ if (extra != 0) { Modified: projects/clang900-import/stand/lua/color.lua ============================================================================== --- projects/clang900-import/stand/lua/color.lua Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/stand/lua/color.lua Sat Sep 21 21:02:57 2019 (r352587) @@ -49,9 +49,7 @@ color.DIM = 2 function color.isEnabled() local c = loader.getenv("loader_color") if c ~= nil then - if c:lower() == "no" or c == "0" then - return false - end + return c:lower() ~= "no" and c ~= "0" end return not core.isSerialBoot() end Modified: projects/clang900-import/stand/powerpc/uboot/Makefile ============================================================================== --- projects/clang900-import/stand/powerpc/uboot/Makefile Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/stand/powerpc/uboot/Makefile Sat Sep 21 21:02:57 2019 (r352587) @@ -13,6 +13,7 @@ LOADER_BZIP2_SUPPORT?= no BINDIR= /boot/uboot PROG= ubldr +STRIP= NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH} INSTALLFLAGS= -b Modified: projects/clang900-import/sys/amd64/amd64/pmap.c ============================================================================== --- projects/clang900-import/sys/amd64/amd64/pmap.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/sys/amd64/amd64/pmap.c Sat Sep 21 21:02:57 2019 (r352587) @@ -10030,13 +10030,13 @@ sysctl_kmaps_dump(struct sbuf *sb, struct pmap_kernel_ mode = "WC"; break; default: - printf("%s: unknown PAT mode %#x for range %#016lx-%#016lx\n", + printf("%s: unknown PAT mode %#x for range 0x%016lx-0x%016lx\n", __func__, i, range->sva, eva); mode = "??"; break; } - sbuf_printf(sb, "%#016lx-%#016lx r%c%c%c%c %s %d %d %d\n", + sbuf_printf(sb, "0x%016lx-0x%016lx r%c%c%c%c %s %d %d %d\n", range->sva, eva, (range->attrs & X86_PG_RW) != 0 ? 'w' : '-', (range->attrs & pg_nx) != 0 ? '-' : 'x', @@ -10271,25 +10271,25 @@ DB_SHOW_COMMAND(pte, pmap_print_pte) PG_V = pmap_valid_bit(pmap); pml4 = pmap_pml4e(pmap, va); - db_printf("VA %#016lx pml4e %#016lx", va, *pml4); + db_printf("VA 0x%016lx pml4e 0x%016lx", va, *pml4); if ((*pml4 & PG_V) == 0) { db_printf("\n"); return; } pdp = pmap_pml4e_to_pdpe(pml4, va); - db_printf(" pdpe %#016lx", *pdp); + db_printf(" pdpe 0x%016lx", *pdp); if ((*pdp & PG_V) == 0 || (*pdp & PG_PS) != 0) { db_printf("\n"); return; } pde = pmap_pdpe_to_pde(pdp, va); - db_printf(" pde %#016lx", *pde); + db_printf(" pde 0x%016lx", *pde); if ((*pde & PG_V) == 0 || (*pde & PG_PS) != 0) { db_printf("\n"); return; } pte = pmap_pde_to_pte(pde, va); - db_printf(" pte %#016lx\n", *pte); + db_printf(" pte 0x%016lx\n", *pte); } DB_SHOW_COMMAND(phys2dmap, pmap_phys2dmap) Modified: projects/clang900-import/sys/arm64/arm64/pmap.c ============================================================================== --- projects/clang900-import/sys/arm64/arm64/pmap.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/sys/arm64/arm64/pmap.c Sat Sep 21 21:02:57 2019 (r352587) @@ -5810,23 +5810,33 @@ pmap_fault(pmap_t pmap, uint64_t esr, uint64_t far) case ISS_DATA_DFSC_TF_L1: case ISS_DATA_DFSC_TF_L2: case ISS_DATA_DFSC_TF_L3: - PMAP_LOCK(pmap); - /* Ask the MMU to check the address */ - intr = intr_disable(); - if (pmap == kernel_pmap) - par = arm64_address_translate_s1e1r(far); - else - par = arm64_address_translate_s1e0r(far); - intr_restore(intr); - PMAP_UNLOCK(pmap); - /* - * If the translation was successful the address was invalid - * due to a break-before-make sequence. We can unlock and - * return success to the trap handler. + * Retry the translation. A break-before-make sequence can + * produce a transient fault. */ - if (PAR_SUCCESS(par)) - rv = KERN_SUCCESS; + if (pmap == kernel_pmap) { + /* + * The translation fault may have occurred within a + * critical section. Therefore, we must check the + * address without acquiring the kernel pmap's lock. + */ + if (pmap_kextract(far) != 0) + rv = KERN_SUCCESS; + } else { + PMAP_LOCK(pmap); + /* Ask the MMU to check the address. */ + intr = intr_disable(); + par = arm64_address_translate_s1e0r(far); + intr_restore(intr); + PMAP_UNLOCK(pmap); + + /* + * If the translation was successful, then we can + * return success to the trap handler. + */ + if (PAR_SUCCESS(par)) + rv = KERN_SUCCESS; + } break; } Modified: projects/clang900-import/sys/dev/ioat/ioat.c ============================================================================== --- projects/clang900-import/sys/dev/ioat/ioat.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/sys/dev/ioat/ioat.c Sat Sep 21 21:02:57 2019 (r352587) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -44,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -266,6 +268,11 @@ ioat_attach(device_t device) ioat = DEVICE2SOFTC(device); ioat->device = device; + if (bus_get_domain(device, &ioat->domain) != 0) + ioat->domain = 0; + ioat->cpu = CPU_FFS(&cpuset_domain[ioat->domain]) - 1; + if (ioat->cpu < 0) + ioat->cpu = CPU_FIRST(); error = ioat_map_pci_bar(ioat); if (error != 0) @@ -600,8 +607,8 @@ ioat3_attach(device_t device) __func__, error); return (error); } - ioat->ring = malloc(num_descriptors * sizeof(*ring), M_IOAT, - M_ZERO | M_WAITOK); + ioat->ring = malloc_domainset(num_descriptors * sizeof(*ring), M_IOAT, + DOMAINSET_PREF(ioat->domain), M_ZERO | M_WAITOK); ring = ioat->ring; for (i = 0; i < num_descriptors; i++) { @@ -1107,8 +1114,8 @@ ioat_release(bus_dmaengine_t dmaengine) (uint16_t)ioat->head); if (!callout_pending(&ioat->poll_timer)) { - callout_reset(&ioat->poll_timer, 1, - ioat_poll_timer_callback, ioat); + callout_reset_on(&ioat->poll_timer, 1, + ioat_poll_timer_callback, ioat, ioat->cpu); } } mtx_unlock(&ioat->submit_lock); @@ -1644,7 +1651,7 @@ ioat_free_ring(struct ioat_softc *ioat, uint32_t size, struct ioat_descriptor *ring) { - free(ring, M_IOAT); + free_domain(ring, M_IOAT); } static struct ioat_descriptor * Modified: projects/clang900-import/sys/dev/ioat/ioat_internal.h ============================================================================== --- projects/clang900-import/sys/dev/ioat/ioat_internal.h Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/sys/dev/ioat/ioat_internal.h Sat Sep 21 21:02:57 2019 (r352587) @@ -442,6 +442,8 @@ struct ioat_softc { }) device_t device; + int domain; + int cpu; int version; unsigned chan_idx; Modified: projects/clang900-import/sys/dev/usb/controller/xhci.c ============================================================================== --- projects/clang900-import/sys/dev/usb/controller/xhci.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/sys/dev/usb/controller/xhci.c Sat Sep 21 21:02:57 2019 (r352587) @@ -601,6 +601,9 @@ xhci_init(struct xhci_softc *sc, device_t self, uint8_ device_printf(self, "%d bytes context size, %d-bit DMA\n", sc->sc_ctx_is_64_byte ? 64 : 32, (int)sc->sc_bus.dma_bits); + /* enable 64Kbyte control endpoint quirk */ + sc->sc_bus.control_ep_quirk = 1; + temp = XREAD4(sc, capa, XHCI_HCSPARAMS1); /* get number of device slots */ @@ -2003,7 +2006,7 @@ restart: /* clear TD SIZE to zero, hence this is the last TRB */ /* remove chain bit because this is the last data TRB in the chain */ - td->td_trb[td->ntrb - 1].dwTrb2 &= ~htole32(XHCI_TRB_2_TDSZ_SET(15)); + td->td_trb[td->ntrb - 1].dwTrb2 &= ~htole32(XHCI_TRB_2_TDSZ_SET(31)); td->td_trb[td->ntrb - 1].dwTrb3 &= ~htole32(XHCI_TRB_3_CHAIN_BIT); /* remove CHAIN-BIT from last LINK TRB */ td->td_trb[td->ntrb].dwTrb3 &= ~htole32(XHCI_TRB_3_CHAIN_BIT); Modified: projects/clang900-import/sys/dev/usb/usb_bus.h ============================================================================== --- projects/clang900-import/sys/dev/usb/usb_bus.h Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/sys/dev/usb/usb_bus.h Sat Sep 21 21:02:57 2019 (r352587) @@ -131,6 +131,7 @@ struct usb_bus { uint8_t do_probe; /* set if USB should be re-probed */ uint8_t no_explore; /* don't explore USB ports */ uint8_t dma_bits; /* number of DMA address lines */ + uint8_t control_ep_quirk; /* need 64kByte buffer for data stage */ }; #endif /* _USB_BUS_H_ */ Modified: projects/clang900-import/sys/dev/usb/usb_ioctl.h ============================================================================== --- projects/clang900-import/sys/dev/usb/usb_ioctl.h Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/sys/dev/usb/usb_ioctl.h Sat Sep 21 21:02:57 2019 (r352587) @@ -224,7 +224,7 @@ struct usb_fs_uninit { } USB_IOCTL_STRUCT_ALIGN(1); struct usb_fs_open { -#define USB_FS_MAX_BUFSIZE (1 << 18) +#define USB_FS_MAX_BUFSIZE (1 << 25) /* 32 MBytes */ uint32_t max_bufsize; #define USB_FS_MAX_FRAMES (1U << 12) #define USB_FS_MAX_FRAMES_PRE_SCALE (1U << 31) /* for ISOCHRONOUS transfers */ Modified: projects/clang900-import/sys/dev/usb/usb_transfer.c ============================================================================== --- projects/clang900-import/sys/dev/usb/usb_transfer.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/sys/dev/usb/usb_transfer.c Sat Sep 21 21:02:57 2019 (r352587) @@ -106,6 +106,33 @@ static const struct usb_config usb_control_ep_cfg[USB_ }, }; +static const struct usb_config usb_control_ep_quirk_cfg[USB_CTRL_XFER_MAX] = { + + /* This transfer is used for generic control endpoint transfers */ + + [0] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control endpoint */ + .direction = UE_DIR_ANY, + .bufsize = 65535, /* bytes */ + .callback = &usb_request_callback, + .usb_mode = USB_MODE_DUAL, /* both modes */ + }, + + /* This transfer is used for generic clear stall only */ + + [1] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* Control pipe */ + .direction = UE_DIR_ANY, + .bufsize = sizeof(struct usb_device_request), + .callback = &usb_do_clear_stall_callback, + .timeout = 1000, /* 1 second */ + .interval = 50, /* 50ms */ + .usb_mode = USB_MODE_HOST, + }, +}; + /* function prototypes */ static void usbd_update_max_frame_size(struct usb_xfer *); @@ -1021,7 +1048,8 @@ usbd_transfer_setup(struct usb_device *udev, * context, else there is a chance of * deadlock! */ - if (setup_start == usb_control_ep_cfg) + if (setup_start == usb_control_ep_cfg || + setup_start == usb_control_ep_quirk_cfg) info->done_p = USB_BUS_CONTROL_XFER_PROC(udev->bus); else if (xfer_mtx == &Giant) @@ -3149,7 +3177,8 @@ repeat: */ iface_index = 0; if (usbd_transfer_setup(udev, &iface_index, - udev->ctrl_xfer, usb_control_ep_cfg, USB_CTRL_XFER_MAX, NULL, + udev->ctrl_xfer, udev->bus->control_ep_quirk ? + usb_control_ep_quirk_cfg : usb_control_ep_cfg, USB_CTRL_XFER_MAX, NULL, &udev->device_mtx)) { DPRINTFN(0, "could not setup default " "USB transfer\n"); Modified: projects/clang900-import/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- projects/clang900-import/sys/fs/msdosfs/msdosfs_denode.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/sys/fs/msdosfs/msdosfs_denode.c Sat Sep 21 21:02:57 2019 (r352587) @@ -79,7 +79,7 @@ de_vncmpf(struct vnode *vp, void *arg) a = arg; de = VTODE(vp); - return (de->de_inode != *a); + return (de->de_inode != *a) || (de->de_refcnt <= 0); } /* @@ -124,8 +124,9 @@ deget(struct msdosfsmount *pmp, u_long dirclust, u_lon * address of "." entry. For root dir (if not FAT32) use cluster * MSDOSFSROOT, offset MSDOSFSROOT_OFS * - * NOTE: The check for de_refcnt > 0 below insures the denode being - * examined does not represent an unlinked but still open file. + * NOTE: de_vncmpf will explicitly skip any denodes that do not have + * a de_refcnt > 0. This insures that that we do not attempt to use + * a denode that represents an unlinked but still open file. * These files are not to be accessible even when the directory * entry that represented the file happens to be reused while the * deleted file is still open. Modified: projects/clang900-import/sys/kern/imgact_elf.c ============================================================================== --- projects/clang900-import/sys/kern/imgact_elf.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/sys/kern/imgact_elf.c Sat Sep 21 21:02:57 2019 (r352587) @@ -135,6 +135,27 @@ SYSCTL_INT(_kern_elf32, OID_AUTO, read_exec, CTLFLAG_R "enable execution from readable segments"); #endif +static u_long __elfN(pie_base) = ET_DYN_LOAD_ADDR; +static int +sysctl_pie_base(SYSCTL_HANDLER_ARGS) +{ + u_long val; + int error; + + val = __elfN(pie_base); + error = sysctl_handle_long(oidp, &val, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + if ((val & PAGE_MASK) != 0) + return (EINVAL); + __elfN(pie_base) = val; + return (0); +} +SYSCTL_PROC(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, pie_base, + CTLTYPE_ULONG | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, + sysctl_pie_base, "LU", + "PIE load base without randomization"); + SYSCTL_NODE(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, aslr, CTLFLAG_RW, 0, ""); #define ASLR_NODE_OID __CONCAT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), _aslr) @@ -1146,13 +1167,13 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i if (baddr == 0) { if ((sv->sv_flags & SV_ASLR) == 0 || (fctl0 & NT_FREEBSD_FCTL_ASLR_DISABLE) != 0) - et_dyn_addr = ET_DYN_LOAD_ADDR; + et_dyn_addr = __elfN(pie_base); else if ((__elfN(pie_aslr_enabled) && (imgp->proc->p_flag2 & P2_ASLR_DISABLE) == 0) || (imgp->proc->p_flag2 & P2_ASLR_ENABLE) != 0) et_dyn_addr = ET_DYN_ADDR_RAND; else - et_dyn_addr = ET_DYN_LOAD_ADDR; + et_dyn_addr = __elfN(pie_base); } } Modified: projects/clang900-import/sys/kern/kern_timeout.c ============================================================================== --- projects/clang900-import/sys/kern/kern_timeout.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/sys/kern/kern_timeout.c Sat Sep 21 21:02:57 2019 (r352587) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -325,8 +326,9 @@ callout_cpu_init(struct callout_cpu *cc, int cpu) mtx_init(&cc->cc_lock, "callout", NULL, MTX_SPIN | MTX_RECURSE); SLIST_INIT(&cc->cc_callfree); cc->cc_inited = 1; - cc->cc_callwheel = malloc(sizeof(struct callout_list) * callwheelsize, - M_CALLOUT, M_WAITOK); + cc->cc_callwheel = malloc_domainset(sizeof(struct callout_list) * + callwheelsize, M_CALLOUT, + DOMAINSET_PREF(pcpu_find(cpu)->pc_domain), M_WAITOK); for (i = 0; i < callwheelsize; i++) LIST_INIT(&cc->cc_callwheel[i]); TAILQ_INIT(&cc->cc_expireq); Modified: projects/clang900-import/sys/kern/subr_lock.c ============================================================================== --- projects/clang900-import/sys/kern/subr_lock.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/sys/kern/subr_lock.c Sat Sep 21 21:02:57 2019 (r352587) @@ -287,7 +287,7 @@ lock_prof_init(void *arg) { int cpu; - for (cpu = 0; cpu <= mp_maxid; cpu++) { + CPU_FOREACH(cpu) { lp_cpu[cpu] = malloc(sizeof(*lp_cpu[cpu]), M_DEVBUF, M_WAITOK | M_ZERO); lock_prof_init_type(&lp_cpu[cpu]->lpc_types[0]); @@ -330,14 +330,14 @@ lock_prof_reset(void) * before we zero the structures. Some items may still be linked * into per-thread lists as well. */ - for (cpu = 0; cpu <= mp_maxid; cpu++) { + CPU_FOREACH(cpu) { lpc = lp_cpu[cpu]; for (i = 0; i < LPROF_CACHE_SIZE; i++) { LIST_REMOVE(&lpc->lpc_types[0].lpt_objs[i], lpo_link); LIST_REMOVE(&lpc->lpc_types[1].lpt_objs[i], lpo_link); } } - for (cpu = 0; cpu <= mp_maxid; cpu++) { + CPU_FOREACH(cpu) { lpc = lp_cpu[cpu]; bzero(lpc, sizeof(*lpc)); lock_prof_init_type(&lpc->lpc_types[0]); @@ -378,9 +378,7 @@ lock_prof_sum(struct lock_prof *match, struct lock_pro dst->class = match->class; dst->name = match->name; - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (lp_cpu[cpu] == NULL) - continue; + CPU_FOREACH(cpu) { type = &lp_cpu[cpu]->lpc_types[spin]; SLIST_FOREACH(l, &type->lpt_hash[hash], link) { if (l->ticks == t) @@ -399,7 +397,6 @@ lock_prof_sum(struct lock_prof *match, struct lock_pro dst->cnt_contest_locking += l->cnt_contest_locking; } } - } static void @@ -438,9 +435,7 @@ dump_lock_prof_stats(SYSCTL_HANDLER_ARGS) lock_prof_enable = 0; quiesce_all_cpus("profstat", 0); t = ticks; - for (cpu = 0; cpu <= mp_maxid; cpu++) { - if (lp_cpu[cpu] == NULL) - continue; + CPU_FOREACH(cpu) { lock_prof_type_stats(&lp_cpu[cpu]->lpc_types[0], sb, 0, t); lock_prof_type_stats(&lp_cpu[cpu]->lpc_types[1], sb, 1, t); } Modified: projects/clang900-import/sys/kern/uipc_ktls.c ============================================================================== --- projects/clang900-import/sys/kern/uipc_ktls.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/sys/kern/uipc_ktls.c Sat Sep 21 21:02:57 2019 (r352587) @@ -349,7 +349,7 @@ ktls_init(void *dummy __unused) STAILQ_INIT(&ktls_wq[i].head); mtx_init(&ktls_wq[i].mtx, "ktls work queue", NULL, MTX_DEF); error = kproc_kthread_add(ktls_work_thread, &ktls_wq[i], - &ktls_proc, &td, 0, 0, "KTLS", "ktls_thr_%d", i); + &ktls_proc, &td, 0, 0, "KTLS", "thr_%d", i); if (error) panic("Can't add KTLS thread %d error %d", i, error); Modified: projects/clang900-import/sys/kern/vfs_mount.c ============================================================================== --- projects/clang900-import/sys/kern/vfs_mount.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/sys/kern/vfs_mount.c Sat Sep 21 21:02:57 2019 (r352587) @@ -157,7 +157,7 @@ vfs_mount_init(void *dummy __unused) { mount_zone = uma_zcreate("Mountpoints", sizeof(struct mount), NULL, - NULL, mount_init, mount_fini, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + NULL, mount_init, mount_fini, UMA_ALIGN_CACHE, UMA_ZONE_NOFREE); } SYSINIT(vfs_mount, SI_SUB_VFS, SI_ORDER_ANY, vfs_mount_init, NULL); Modified: projects/clang900-import/sys/netinet/sctp_asconf.c ============================================================================== --- projects/clang900-import/sys/netinet/sctp_asconf.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/sys/netinet/sctp_asconf.c Sat Sep 21 21:02:57 2019 (r352587) @@ -703,6 +703,7 @@ sctp_handle_asconf(struct mbuf *m, unsigned int offset if (param_length <= sizeof(struct sctp_paramhdr)) { SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: param length (%u) too short\n", param_length); sctp_m_freem(m_ack); + return; } /* get the entire parameter */ aph = (struct sctp_asconf_paramhdr *)sctp_m_getptr(m, offset, param_length, aparam_buf); Modified: projects/clang900-import/sys/sys/elf_common.h ============================================================================== --- projects/clang900-import/sys/sys/elf_common.h Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/sys/sys/elf_common.h Sat Sep 21 21:02:57 2019 (r352587) @@ -769,6 +769,12 @@ typedef struct { #define LL_DELAY_LOAD 0x10 #define LL_DELTA 0x20 +/* Note section names */ +#define ELF_NOTE_FREEBSD "FreeBSD" +#define ELF_NOTE_NETBSD "NetBSD" +#define ELF_NOTE_SOLARIS "SUNW Solaris" +#define ELF_NOTE_GNU "GNU" + /* Values for n_type used in executables. */ #define NT_FREEBSD_ABI_TAG 1 #define NT_FREEBSD_NOINIT_TAG 2 Modified: projects/clang900-import/sys/sys/mount.h ============================================================================== --- projects/clang900-import/sys/sys/mount.h Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/sys/sys/mount.h Sat Sep 21 21:02:57 2019 (r352587) @@ -226,7 +226,7 @@ struct mount { struct lock mnt_explock; /* vfs_export walkers lock */ TAILQ_ENTRY(mount) mnt_upper_link; /* (m) we in the all uppers */ TAILQ_HEAD(, mount) mnt_uppers; /* (m) upper mounts over us*/ - int mnt_vfs_ops; /* (i) pending vfs ops */ + int __aligned(CACHE_LINE_SIZE) mnt_vfs_ops;/* (i) pending vfs ops */ int *mnt_thread_in_ops_pcpu; int *mnt_ref_pcpu; int *mnt_lockref_pcpu; Modified: projects/clang900-import/usr.bin/jot/jot.1 ============================================================================== --- projects/clang900-import/usr.bin/jot/jot.1 Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/usr.bin/jot/jot.1 Sat Sep 21 21:02:57 2019 (r352587) @@ -28,7 +28,7 @@ .\" @(#)jot.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd April 7, 2015 +.Dd September 21, 2019 .Dt JOT 1 .Os .Sh NAME @@ -108,14 +108,16 @@ Any three of these arguments determines the fourth. If four are specified and the given and computed values of .Ar reps conflict, the lower value is used. -If fewer than three are specified, defaults are assigned -left to right, except for +If one or two are specified, defaults are assigned +starting with .Ar s , -which assumes a default of 1 or -1 if both +which assumes a default of 1 (or -1 if .Ar begin and .Ar end -are given. +specify a descending range). +Then the default values are assigned to the leftmost omitted arguments until +three arguments are set. .Pp Defaults for the four arguments are, respectively, 100, 1, 100, and 1, except that when random data are requested, Modified: projects/clang900-import/usr.bin/quota/quota.c ============================================================================== --- projects/clang900-import/usr.bin/quota/quota.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/usr.bin/quota/quota.c Sat Sep 21 21:02:57 2019 (r352587) @@ -606,7 +606,7 @@ getnfsquota(struct statfs *fst, struct quotause *qup, call_stat = callaurpc(host, RQUOTAPROG, EXT_RQUOTAVERS, RQUOTAPROC_GETQUOTA, (xdrproc_t)xdr_ext_getquota_args, (char *)&gq_args, (xdrproc_t)xdr_getquota_rslt, (char *)&gq_rslt); - if (call_stat == RPC_PROGVERSMISMATCH) { + if (call_stat == RPC_PROGVERSMISMATCH || call_stat == RPC_PROGNOTREGISTERED) { if (quotatype == USRQUOTA) { old_gq_args.gqa_pathp = cp + 1; old_gq_args.gqa_uid = id; Modified: projects/clang900-import/usr.bin/top/display.c ============================================================================== --- projects/clang900-import/usr.bin/top/display.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/usr.bin/top/display.c Sat Sep 21 21:02:57 2019 (r352587) @@ -1291,31 +1291,6 @@ line_update(char *old, char *new, int start, int line) } } -/* - * printable(str) - make the string pointed to by "str" into one that is - * printable (i.e.: all ascii), by converting all non-printable - * characters into '?'. Replacements are done in place and a pointer - * to the original buffer is returned. - */ - -char * -printable(char str[]) -{ - char *ptr; - char ch; - - ptr = str; - while ((ch = *ptr) != '\0') - { - if (!isprint(ch)) - { - *ptr = '?'; - } - ptr++; - } - return(str); -} - void i_uptime(struct timeval *bt, time_t *tod) { Modified: projects/clang900-import/usr.bin/top/display.h ============================================================================== --- projects/clang900-import/usr.bin/top/display.h Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/usr.bin/top/display.h Sat Sep 21 21:02:57 2019 (r352587) @@ -11,7 +11,6 @@ int display_updatecpus(struct statics *statics); void clear_message(void); int display_resize(void); void i_header(const char *text); -char *printable(char *string); void display_header(int t); int display_init(struct statics *statics); void i_arc(int *stats); Modified: projects/clang900-import/usr.bin/top/machine.c ============================================================================== --- projects/clang900-import/usr.bin/top/machine.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/usr.bin/top/machine.c Sat Sep 21 21:02:57 2019 (r352587) @@ -1003,7 +1003,7 @@ format_next_process(struct handle * xhandle, char *(*g len = (argbuflen - (dst - argbuf) - 1) / 4; strvisx(dst, src, MIN(strlen(src), len), - VIS_NL | VIS_CSTYLE); + VIS_NL | VIS_CSTYLE | VIS_OCTAL | VIS_SAFE); while (*dst != '\0') dst++; if ((argbuflen - (dst - argbuf) - 1) / 4 > 0) @@ -1102,7 +1102,7 @@ format_next_process(struct handle * xhandle, char *(*g sbuf_printf(procbuf, "%6s ", format_time(cputime)); sbuf_printf(procbuf, "%6.2f%% ", ps.wcpu ? 100.0 * weighted_cpu(PCTCPU(pp), pp) : 100.0 * PCTCPU(pp)); } - sbuf_printf(procbuf, "%s", printable(cmdbuf)); + sbuf_printf(procbuf, "%s", cmdbuf); free(cmdbuf); return (sbuf_data(procbuf)); } Modified: projects/clang900-import/usr.bin/top/top.1 ============================================================================== --- projects/clang900-import/usr.bin/top/top.1 Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/usr.bin/top/top.1 Sat Sep 21 21:02:57 2019 (r352587) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd October 2, 2018 +.Dd September 21, 2019 .Dt TOP 1 .Os .Sh NAME @@ -66,6 +66,9 @@ It it useful when you want to watch applications, that puts their status information there. If the real name differs from argv[0], it will be displayed in parenthesis. +Non-printable characters in the command line are +encoded in C-style backslash sequences or +a three digit octal sequences. .It Fl b Use \*(lqbatch\*(rq mode. In this mode, all input from the terminal is @@ -422,6 +425,12 @@ bytes paged out to swap devices (last interval) .It Ev TOP Default set of arguments to .Nm . +.It Ev LC_CTYPE +The locale to use when displaying the +.Va argv +vector when +.Fl a +flag is specified. .El .Sh SEE ALSO .Xr kill 1 , Modified: projects/clang900-import/usr.bin/top/top.c ============================================================================== --- projects/clang900-import/usr.bin/top/top.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/usr.bin/top/top.c Sat Sep 21 21:02:57 2019 (r352587) @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -264,6 +265,11 @@ main(int argc, const char *argv[]) #else setbuffer(stdout, stdoutbuf, Buffersize); #endif + + if (setlocale(LC_ALL, "") == NULL) { + fprintf(stderr, "invalid locale.\n"); + exit(1); + } mypid = getpid(); Modified: projects/clang900-import/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- projects/clang900-import/usr.sbin/freebsd-update/freebsd-update.sh Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/usr.sbin/freebsd-update/freebsd-update.sh Sat Sep 21 21:02:57 2019 (r352587) @@ -221,6 +221,14 @@ config_KeepModifiedMetadata () { # Add to the list of components which should be kept updated. config_Components () { for C in $@; do + COMPONENTS="${COMPONENTS} ${C}" + done +} + +# Remove src component from list if it isn't installed +finalize_components_config () { + COMPONENTS="" + for C in $@; do if [ "$C" = "src" ]; then if [ -e "${BASEDIR}/usr/src/COPYRIGHT" ]; then COMPONENTS="${COMPONENTS} ${C}" @@ -3284,6 +3292,7 @@ get_params () { parse_cmdline $@ parse_conffile default_params + finalize_components_config ${COMPONENTS} } # Fetch command. Make sure that we're being called Modified: projects/clang900-import/usr.sbin/rpc.statd/Makefile ============================================================================== --- projects/clang900-import/usr.sbin/rpc.statd/Makefile Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/usr.sbin/rpc.statd/Makefile Sat Sep 21 21:02:57 2019 (r352587) @@ -4,11 +4,12 @@ PROG= rpc.statd MAN= rpc.statd.8 SRCS= file.c sm_inter_svc.c sm_inter.h statd.c procs.c -CFLAGS+= -I. -WARNS?= 2 - +CFLAGS+= -I${.OBJDIR} LIBADD= rpcsvc +# XXX: mismatch between (xdrproc_t) and xdr_void(). +WARNS?= 2 + CLEANFILES= sm_inter_svc.c sm_inter.h RPCSRC= ${SYSROOT:U${DESTDIR}}/usr/include/rpcsvc/sm_inter.x @@ -20,7 +21,8 @@ sm_inter_svc.c: ${RPCSRC} sm_inter.h: ${RPCSRC} ${RPCGEN} -h -o ${.TARGET} ${.ALLSRC} -test: test.c - cc -o test test.c -lrpcsvc +test: test.o + ${CC} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} ${LIBADD:S/^/-l/} +CLEANFILES+= test test.o .include Modified: projects/clang900-import/usr.sbin/rpc.statd/file.c ============================================================================== --- projects/clang900-import/usr.sbin/rpc.statd/file.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/usr.sbin/rpc.statd/file.c Sat Sep 21 21:02:57 2019 (r352587) @@ -201,8 +201,8 @@ void init_file(const char *filename) /* defective, re-create from scratch. */ if (!new_file) { - if ((status_file_len < HEADER_LEN) || (status_file_len - < (HEADER_LEN + sizeof(HostInfo) * status_info->noOfHosts)) ) + if ((status_file_len < (off_t)HEADER_LEN) || (status_file_len + < (off_t)(HEADER_LEN + sizeof(HostInfo) * status_info->noOfHosts)) ) { warnx("status file is corrupt"); new_file = TRUE; Modified: projects/clang900-import/usr.sbin/rpc.statd/procs.c ============================================================================== --- projects/clang900-import/usr.sbin/rpc.statd/procs.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/usr.sbin/rpc.statd/procs.c Sat Sep 21 21:02:57 2019 (r352587) @@ -52,9 +52,10 @@ __FBSDID("$FreeBSD$"); #include "statd.h" +static const char *from_addr(struct sockaddr *); + static const char * -from_addr(saddr) - struct sockaddr *saddr; +from_addr(struct sockaddr *saddr) { static char inet_buf[INET6_ADDRSTRLEN]; Modified: projects/clang900-import/usr.sbin/rpc.statd/statd.c ============================================================================== --- projects/clang900-import/usr.sbin/rpc.statd/statd.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/usr.sbin/rpc.statd/statd.c Sat Sep 21 21:02:57 2019 (r352587) @@ -62,9 +62,9 @@ __FBSDID("$FreeBSD$"); int debug = 0; /* Controls syslog() calls for debug messages */ -char **hosts, *svcport_str = NULL; -int nhosts = 0; -int xcreated = 0; +static char **hosts, *svcport_str = NULL; +static int nhosts = 0; +static int xcreated = 0; static int mallocd_svcport = 0; static int *sock_fd; static int sock_fdcnt; @@ -86,7 +86,8 @@ main(int argc, char **argv) void *nc_handle; in_port_t svcport; int ch, i, s; - char *endptr, **hosts_bak; + char *endptr; + char **hosts_bak; int have_v6 = 1; int maxrec = RPC_MAXDATASIZE; int attempt_cnt, port_len, port_pos, ret; @@ -156,7 +157,7 @@ main(int argc, char **argv) if (hosts == NULL) out_of_mem(); - hosts[0] = "*"; + hosts[0] = strdup("*"); nhosts = 1; } else { hosts_bak = hosts; @@ -172,7 +173,7 @@ main(int argc, char **argv) hosts = hosts_bak; nhosts += 2; - hosts[nhosts - 2] = "::1"; + hosts[nhosts - 2] = strdup("::1"); } else { hosts_bak = realloc(hosts, (nhosts + 1) * sizeof(char *)); if (hosts_bak == NULL) { @@ -186,7 +187,7 @@ main(int argc, char **argv) hosts = hosts_bak; } } - hosts[nhosts - 1] = "127.0.0.1"; + hosts[nhosts - 1] = strdup("127.0.0.1"); } attempt_cnt = 1; Modified: projects/clang900-import/usr.sbin/rpc.statd/test.c ============================================================================== --- projects/clang900-import/usr.sbin/rpc.statd/test.c Sat Sep 21 21:01:38 2019 (r352586) +++ projects/clang900-import/usr.sbin/rpc.statd/test.c Sat Sep 21 21:02:57 2019 (r352587) @@ -1,14 +1,14 @@ - #ifndef lint static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ #include +#include +#include #include #include - /* Default timeout can be changed using clnt_control() */ static struct timeval TIMEOUT = { 25, 0 }; @@ -20,7 +20,8 @@ sm_stat_1(argp, clnt) static struct sm_stat_res res; bzero((char *)&res, sizeof(res)); - if (clnt_call(clnt, SM_STAT, xdr_sm_name, argp, xdr_sm_stat_res, &res, TIMEOUT) != RPC_SUCCESS) { + if (clnt_call(clnt, SM_STAT, (xdrproc_t)xdr_sm_name, argp, + (xdrproc_t)xdr_sm_stat_res, &res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (&res); @@ -35,7 +36,8 @@ sm_mon_1(argp, clnt) static struct sm_stat_res res; bzero((char *)&res, sizeof(res)); - if (clnt_call(clnt, SM_MON, xdr_mon, argp, xdr_sm_stat_res, &res, TIMEOUT) != RPC_SUCCESS) { + if (clnt_call(clnt, SM_MON, (xdrproc_t)xdr_mon, argp, + (xdrproc_t)xdr_sm_stat_res, &res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (&res); @@ -50,7 +52,8 @@ sm_unmon_1(argp, clnt) static struct sm_stat res; bzero((char *)&res, sizeof(res)); - if (clnt_call(clnt, SM_UNMON, xdr_mon_id, argp, xdr_sm_stat, &res, TIMEOUT) != RPC_SUCCESS) { + if (clnt_call(clnt, SM_UNMON, (xdrproc_t)xdr_mon_id, argp, + (xdrproc_t)xdr_sm_stat, &res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (&res); @@ -65,7 +68,8 @@ sm_unmon_all_1(argp, clnt) static struct sm_stat res; bzero((char *)&res, sizeof(res)); - if (clnt_call(clnt, SM_UNMON_ALL, xdr_my_id, argp, xdr_sm_stat, &res, TIMEOUT) != RPC_SUCCESS) { + if (clnt_call(clnt, SM_UNMON_ALL, (xdrproc_t)xdr_my_id, argp, + (xdrproc_t)xdr_sm_stat, &res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return (&res); @@ -80,7 +84,8 @@ sm_simu_crash_1(argp, clnt) static char res; bzero((char *)&res, sizeof(res)); - if (clnt_call(clnt, SM_SIMU_CRASH, xdr_void, argp, xdr_void, &res, TIMEOUT) != RPC_SUCCESS) { + if (clnt_call(clnt, SM_SIMU_CRASH, (xdrproc_t)xdr_void, argp, + (xdrproc_t)xdr_void, &res, TIMEOUT) != RPC_SUCCESS) { return (NULL); } return ((void *)&res); @@ -119,25 +124,20 @@ int main(int argc, char **argv) { /* Hostname given */ struct sm_stat_res *res; - if (res = sm_mon_1(&mon, cli)) *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***