svn commit: r363824 - in head: . lib
Author: kevans Date: Tue Aug 4 03:43:28 2020 New Revision: 363824 URL: https://svnweb.freebsd.org/changeset/base/363824 Log: Ensure libregex is built in time for googletest In lib/Makefile, we document the dependency with SUBDIR_DEPEND For buildworld orchestration, just prebuild libregex if GOOGLETEST is enabled. googletest will get built in a later pass. Modified: head/Makefile.inc1 head/lib/Makefile Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Tue Aug 4 02:47:24 2020(r363823) +++ head/Makefile.inc1 Tue Aug 4 03:43:28 2020(r363824) @@ -2741,6 +2741,10 @@ _prebuild_libs+= gnu/lib/libdialog gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L .endif +.if ${MK_GOOGLETEST} != "no" +_prebuild_libs+= lib/libregex +.endif + .if ${MK_LIBCPLUSPLUS} != "no" _prebuild_libs+= lib/libc++ .endif Modified: head/lib/Makefile == --- head/lib/Makefile Tue Aug 4 02:47:24 2020(r363823) +++ head/lib/Makefile Tue Aug 4 03:43:28 2020(r363824) @@ -107,6 +107,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ # libraries, those libraries should be listed as build order dependencies here. SUBDIR_DEPEND_geom=libufs +SUBDIR_DEPEND_googletest= libregex SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd libzstd SUBDIR_DEPEND_libauditdm= libbsm SUBDIR_DEPEND_libbsnmp= ${_libnetgraph} ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363823 - head/usr.bin/grep
Author: kevans Date: Tue Aug 4 02:47:24 2020 New Revision: 363823 URL: https://svnweb.freebsd.org/changeset/base/363823 Log: bsdgrep: switch to libregex for GNU_GREP_COMPAT libregex is incomplete, but it's a bit less buggy than the in-base libgnuregex and mostly OK. While here, rename -DIWTH_GNU -> -DWITH_GNU_COMPAT; the option implies that we're compatible with the GNU counterpart, not that we're including GNU anything. Modified: head/usr.bin/grep/Makefile head/usr.bin/grep/grep.c Modified: head/usr.bin/grep/Makefile == --- head/usr.bin/grep/Makefile Tue Aug 4 02:31:52 2020(r363822) +++ head/usr.bin/grep/Makefile Tue Aug 4 02:47:24 2020(r363823) @@ -61,8 +61,8 @@ MLINKS+= grep.1 egrep.1 \ .endif .if ${MK_GNU_GREP_COMPAT} != "no" -CFLAGS+= -I${SYSROOT:U${DESTDIR}}/usr/include/gnu -DWITH_GNU -LIBADD+= gnuregex +CFLAGS+= -DWITH_GNU_COMPAT +LIBADD+= regex .endif HAS_TESTS= Modified: head/usr.bin/grep/grep.c == --- head/usr.bin/grep/grep.cTue Aug 4 02:31:52 2020(r363822) +++ head/usr.bin/grep/grep.cTue Aug 4 02:47:24 2020(r363823) @@ -555,7 +555,7 @@ main(int argc, char *argv[]) filebehave = FILE_MMAP; break; case 'V': -#ifdef WITH_GNU +#ifdef WITH_GNU_COMPAT printf(errstr[9], getprogname(), VERSION); #else printf(errstr[8], getprogname(), VERSION); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363822 - stable/12/usr.sbin/ctld
Author: mav Date: Tue Aug 4 02:31:52 2020 New Revision: 363822 URL: https://svnweb.freebsd.org/changeset/base/363822 Log: MFC r363656: When modifying LUN pass "special" options too. Before switching to nvlists CTL merged previous and new options, so any options not passed just kept previous value. Now CTL completely replaces them, so we must pass everything still relevant. Modified: stable/12/usr.sbin/ctld/kernel.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/ctld/kernel.c == --- stable/12/usr.sbin/ctld/kernel.cTue Aug 4 02:20:15 2020 (r363821) +++ stable/12/usr.sbin/ctld/kernel.cTue Aug 4 02:31:52 2020 (r363822) @@ -776,6 +776,30 @@ kernel_lun_modify(struct lun *lun) req.reqdata.modify.lun_id = lun->l_ctl_lun; req.reqdata.modify.lun_size_bytes = lun->l_size; + if (lun->l_path != NULL) { + o = option_find(&lun->l_options, "file"); + if (o != NULL) { + option_set(o, lun->l_path); + } else { + o = option_new(&lun->l_options, "file", lun->l_path); + assert(o != NULL); + } + } + + o = option_find(&lun->l_options, "ctld_name"); + if (o != NULL) { + option_set(o, lun->l_name); + } else { + o = option_new(&lun->l_options, "ctld_name", lun->l_name); + assert(o != NULL); + } + + o = option_find(&lun->l_options, "scsiname"); + if (o == NULL && lun->l_scsiname != NULL) { + o = option_new(&lun->l_options, "scsiname", lun->l_scsiname); + assert(o != NULL); + } + if (!TAILQ_EMPTY(&lun->l_options)) { req.args_nvl = nvlist_create(0); if (req.args_nvl == NULL) { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363821 - head/contrib/googletest/googletest/test
Author: kevans Date: Tue Aug 4 02:20:15 2020 New Revision: 363821 URL: https://svnweb.freebsd.org/changeset/base/363821 Log: Re-enable disabled googletest-port-test tests after r363820 gtest now links against libregex here, and the tests pass locally. PR: 248452 Modified: head/contrib/googletest/googletest/test/googletest-port-test.cc Modified: head/contrib/googletest/googletest/test/googletest-port-test.cc == --- head/contrib/googletest/googletest/test/googletest-port-test.cc Tue Aug 4 02:18:24 2020(r363820) +++ head/contrib/googletest/googletest/test/googletest-port-test.cc Tue Aug 4 02:20:15 2020(r363821) @@ -403,8 +403,6 @@ typedef testing::Types< TYPED_TEST_CASE(RETest, StringTypes); // Tests RE's implicit constructors. -/* -https://bugs.freebsd.org/248452 TYPED_TEST(RETest, ImplicitConstructorWorks) { const RE empty(TypeParam("")); EXPECT_STREQ("", empty.pattern()); @@ -415,7 +413,6 @@ TYPED_TEST(RETest, ImplicitConstructorWorks) { const RE normal(TypeParam(".*(\\w+)")); EXPECT_STREQ(".*(\\w+)", normal.pattern()); } -*/ // Tests that RE's constructors reject invalid regular expressions. TYPED_TEST(RETest, RejectsInvalidRegex) { @@ -864,8 +861,6 @@ TEST(MatchRegexAnywhereTest, ReturnsTrueWhenMatchingNo } // Tests RE's implicit constructors. -/* -https://bugs.freebsd.org/248452 TEST(RETest, ImplicitConstructorWorks) { const RE empty(""); EXPECT_STREQ("", empty.pattern()); @@ -873,7 +868,6 @@ TEST(RETest, ImplicitConstructorWorks) { const RE simple("hello"); EXPECT_STREQ("hello", simple.pattern()); } -*/ // Tests that RE's constructors reject invalid regular expressions. TEST(RETest, RejectsInvalidRegex) { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363820 - in head: lib/googletest/gtest share/mk
Author: kevans Date: Tue Aug 4 02:18:24 2020 New Revision: 363820 URL: https://svnweb.freebsd.org/changeset/base/363820 Log: gtest: link against libregex for GNU extensions gtest tests want to use \w ([[:alnum:]]) at the very least, which was causing them to fail after r363679. Start linking against libregex so that this shorthand is implemented. PR: 248452 Modified: head/lib/googletest/gtest/Makefile head/share/mk/src.libnames.mk Modified: head/lib/googletest/gtest/Makefile == --- head/lib/googletest/gtest/Makefile Tue Aug 4 02:16:43 2020 (r363819) +++ head/lib/googletest/gtest/Makefile Tue Aug 4 02:18:24 2020 (r363820) @@ -45,7 +45,7 @@ INTERNAL_CUSTOM_INCS+=gtest/internal/custom/gtest.h SRCS+= gtest-all.cc -LIBADD+= pthread +LIBADD+= pthread regex HAS_TESTS= SUBDIR.${MK_TESTS}+= tests Modified: head/share/mk/src.libnames.mk == --- head/share/mk/src.libnames.mk Tue Aug 4 02:16:43 2020 (r363819) +++ head/share/mk/src.libnames.mk Tue Aug 4 02:18:24 2020 (r363820) @@ -320,7 +320,7 @@ _DP_dpv=dialog figpar util ncursesw _DP_dialog=ncursesw m _DP_cuse= pthread _DP_atf_cxx= atf_c -_DP_gtest= pthread +_DP_gtest= pthread regex _DP_gmock= gtest _DP_gmock_main=gmock _DP_gtest_main=gtest ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363819 - head/lib/libregex/tests
Author: kevans Date: Tue Aug 4 02:16:43 2020 New Revision: 363819 URL: https://svnweb.freebsd.org/changeset/base/363819 Log: libregex: disable some of the unimplemented test cases for now This should allow the tests to actually pass. Future work will uncomment the unimplemented tests as they're implemented. Modified: head/lib/libregex/tests/gnuext.in head/lib/libregex/tests/libregex_test.sh Modified: head/lib/libregex/tests/gnuext.in == --- head/lib/libregex/tests/gnuext.in Tue Aug 4 02:14:51 2020 (r363818) +++ head/lib/libregex/tests/gnuext.in Tue Aug 4 02:16:43 2020 (r363819) @@ -17,14 +17,16 @@ a\|b\|c b abc a \s\+ b aSNTb SNT # Word boundaries (\b, \B, \<, \>, \`, \') # (is/not boundary, start/end word, start/end subject string) -\babc\b& abc +# Most of these are disabled for the moment, and will be re-enabled as +# we become feature complete. +#\babc\b & abc \ & abc -\Babc\B& abc -\B[abc]\B & b -\B[abc]+ - bc -\B[abc]\+ b bc -\`abc\'& abc abc -\`.+\' - abNcabNc -\`.\+\'b abNcabNc -(\`a) - Na -(a\') - aN +#\Babc\B & abc +#\B[abc]\B & b +#\B[abc]+ - bc +#\B[abc]\+ b bc +#\`abc\' & abc abc +#\`.+\'- abNcabNc +#\`.\+\' b abNcabNc +#(\`a) - Na +#(a\') - aN Modified: head/lib/libregex/tests/libregex_test.sh == --- head/lib/libregex/tests/libregex_test.shTue Aug 4 02:14:51 2020 (r363818) +++ head/lib/libregex/tests/libregex_test.shTue Aug 4 02:16:43 2020 (r363819) @@ -30,10 +30,6 @@ check() { local dataname="${1}"; shift - if [ "${dataname}" == "gnuext" ]; then - atf_expect_fail "GNU extensions are not currently implemented" - fi - prog="$(atf_get_srcdir)/h_regex" data="$(atf_get_srcdir)/data/${dataname}.in" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363818 - head/lib/libc/regex
Author: kevans Date: Tue Aug 4 02:14:51 2020 New Revision: 363818 URL: https://svnweb.freebsd.org/changeset/base/363818 Log: libregex: Implement a subset of the GNU extensions The entire patch-set is not yet mature enough for commit, but this usable subset is generally enough for googletest to be happy with and mostly map to some existing concepts, so they're not as invasive. The specific changes included here are: - Branching in BREs with \| - \w and \W for [[:alnum:]] and [^[:alnum:]] respectively - \s and \S for [[:space:]] and [^[:space:]] respectively - Additional quantifiers in BREs, \? and \+ (self-explanatory) There's some #ifdef'd out work for allowing empty branches as a match-all. This is a feature that's under assessment... future work will determine how standard this behavior is and act accordingly. Modified: head/lib/libc/regex/regcomp.c head/lib/libc/regex/regex2.h Modified: head/lib/libc/regex/regcomp.c == --- head/lib/libc/regex/regcomp.c Tue Aug 4 02:06:49 2020 (r363817) +++ head/lib/libc/regex/regcomp.c Tue Aug 4 02:14:51 2020 (r363818) @@ -92,6 +92,7 @@ struct parse { const char *next; /* next character in RE */ const char *end;/* end of string (-> NUL normally) */ int error; /* has an error been seen? */ + int gnuext; sop *strip; /* malloced strip */ sopno ssize;/* malloced strip size (allocated) */ sopno slen; /* malloced strip length (used) */ @@ -131,7 +132,9 @@ static int p_count(struct parse *p); static void p_bracket(struct parse *p); static int p_range_cmp(wchar_t c1, wchar_t c2); static void p_b_term(struct parse *p, cset *cs); +static int p_b_pseudoclass(struct parse *p, char c); static void p_b_cclass(struct parse *p, cset *cs); +static void p_b_cclass_named(struct parse *p, cset *cs, const char[]); static void p_b_eclass(struct parse *p, cset *cs); static wint_t p_b_symbol(struct parse *p); static wint_t p_b_coll_elem(struct parse *p, wint_t endc); @@ -181,6 +184,7 @@ static char nuls[10]; /* place to point scanner in ev #defineSEESPEC(a) (p->bre ? SEETWO('\\', a) : SEE(a)) #defineEAT(c) ((SEE(c)) ? (NEXT(), 1) : 0) #defineEATTWO(a, b)((SEETWO(a, b)) ? (NEXT2(), 1) : 0) +#defineEATSPEC(a) (p->bre ? EATTWO('\\', a) : EAT(a)) #defineNEXT() (p->next++) #defineNEXT2() (p->next += 2) #defineNEXTn(n)(p->next += (n)) @@ -270,14 +274,22 @@ regcomp_internal(regex_t * __restrict preg, p->pbegin[i] = 0; p->pend[i] = 0; } +#ifdef LIBREGEX + if (cflags®_POSIX) { + p->gnuext = false; + p->allowbranch = (cflags & REG_EXTENDED) != 0; + } else + p->gnuext = p->allowbranch = true; +#else + p->gnuext = false; + p->allowbranch = (cflags & REG_EXTENDED) != 0; +#endif if (cflags & REG_EXTENDED) { - p->allowbranch = true; p->bre = false; p->parse_expr = p_ere_exp; p->pre_parse = NULL; p->post_parse = NULL; } else { - p->allowbranch = false; p->bre = true; p->parse_expr = p_simp_re; p->pre_parse = p_bre_pre_parse; @@ -388,6 +400,10 @@ p_ere_exp(struct parse *p, struct branchc *bc) sopno pos; int count; int count2; +#ifdef LIBREGEX + int i; + int handled; +#endif sopno subno; int wascaret = 0; @@ -395,6 +411,9 @@ p_ere_exp(struct parse *p, struct branchc *bc) assert(MORE()); /* caller should have ensured this */ c = GETNEXT(); +#ifdef LIBREGEX + handled = 0; +#endif pos = HERE(); switch (c) { case '(': @@ -457,6 +476,47 @@ p_ere_exp(struct parse *p, struct branchc *bc) case '\\': (void)REQUIRE(MORE(), REG_EESCAPE); wc = WGETNEXT(); +#ifdef LIBREGEX + if (p->gnuext) { + handled = 1; + switch (wc) { + case 'W': + case 'w': + case 'S': + case 's': + p_b_pseudoclass(p, wc); + break; + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + i = wc - '0'; + assert(i < NPAREN); + if (p->pend[i] != 0
svn commit: r363817 - head/lib/libc/regex
Author: kevans Date: Tue Aug 4 02:06:49 2020 New Revision: 363817 URL: https://svnweb.freebsd.org/changeset/base/363817 Log: regex(3): belatedly document REG_POSIX from r363734 My original patch included this documented, but it appears that I failed to include the manpage update. Do so now. Modified: head/lib/libc/regex/regex.3 Modified: head/lib/libc/regex/regex.3 == --- head/lib/libc/regex/regex.3 Tue Aug 4 00:28:06 2020(r363816) +++ head/lib/libc/regex/regex.3 Tue Aug 4 02:06:49 2020(r363817) @@ -32,7 +32,7 @@ .\"@(#)regex.3 8.4 (Berkeley) 3/20/94 .\" $FreeBSD$ .\" -.Dd May 25, 2016 +.Dd April 15, 2017 .Dt REGEX 3 .Os .Sh NAME @@ -178,6 +178,17 @@ member is of type .Ft "const char *" . This flag permits inclusion of NULs in the RE; they are considered ordinary characters. +This is an extension, +compatible with but not specified by +.St -p1003.2 , +and should be used with +caution in software intended to be portable to other systems. +.It Dv REG_POSIX +Compile only +.St -p1003.2 +compliant expressions. +This flag has no effect unless linking against +.Nm libregex . This is an extension, compatible with but not specified by .St -p1003.2 , ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363816 - stable/12/bin/ps
Author: markj Date: Tue Aug 4 00:28:06 2020 New Revision: 363816 URL: https://svnweb.freebsd.org/changeset/base/363816 Log: MFC r363649: ps(1): Fix formatting of the "command" field for kernel threads. Modified: stable/12/bin/ps/ps.c Directory Properties: stable/12/ (props changed) Modified: stable/12/bin/ps/ps.c == --- stable/12/bin/ps/ps.c Mon Aug 3 23:06:33 2020(r363815) +++ stable/12/bin/ps/ps.c Tue Aug 4 00:28:06 2020(r363816) @@ -1264,6 +1264,7 @@ fmt(char **(*fn)(kvm_t *, const struct kinfo_proc *, i static void saveuser(KINFO *ki) { + char tdname[COMMLEN + 1]; char *argsp; if (ki->ki_p->ki_flag & P_INMEM) { @@ -1280,12 +1281,14 @@ saveuser(KINFO *ki) * save arguments if needed */ if (needcomm) { - if (ki->ki_p->ki_stat == SZOMB) + if (ki->ki_p->ki_stat == SZOMB) { ki->ki_args = strdup(""); - else if (UREADOK(ki) || (ki->ki_p->ki_args != NULL)) + } else if (UREADOK(ki) || (ki->ki_p->ki_args != NULL)) { + (void)snprintf(tdname, sizeof(tdname), "%s%s", + ki->ki_p->ki_tdname, ki->ki_p->ki_moretdname); ki->ki_args = fmt(kvm_getargv, ki, - ki->ki_p->ki_comm, ki->ki_p->ki_tdname, MAXCOMLEN); - else { + ki->ki_p->ki_comm, tdname, COMMLEN * 2 + 1); + } else { asprintf(&argsp, "(%s)", ki->ki_p->ki_comm); ki->ki_args = argsp; } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363815 - in stable/12/sys/dev: mpr mps
Author: markj Date: Mon Aug 3 23:06:33 2020 New Revision: 363815 URL: https://svnweb.freebsd.org/changeset/base/363815 Log: MFC r363608: mpr(4), mps(4): Stop checking for failures from malloc(M_WAITOK). Modified: stable/12/sys/dev/mpr/mpr.c stable/12/sys/dev/mpr/mpr_sas.c stable/12/sys/dev/mpr/mpr_user.c stable/12/sys/dev/mps/mps.c stable/12/sys/dev/mps/mps_sas.c stable/12/sys/dev/mps/mps_user.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mpr/mpr.c == --- stable/12/sys/dev/mpr/mpr.c Mon Aug 3 23:05:47 2020(r363814) +++ stable/12/sys/dev/mpr/mpr.c Mon Aug 3 23:06:33 2020(r363815) @@ -1562,10 +1562,6 @@ mpr_alloc_requests(struct mpr_softc *sc) */ sc->commands = malloc(sizeof(struct mpr_command) * sc->num_reqs, M_MPR, M_WAITOK | M_ZERO); - if (!sc->commands) { - mpr_dprint(sc, MPR_ERROR, "Cannot allocate command memory\n"); - return (ENOMEM); - } for (i = 1; i < sc->num_reqs; i++) { cm = &sc->commands[i]; cm->cm_req = sc->req_frames + i * sc->reqframesz; @@ -2716,11 +2712,6 @@ mpr_register_events(struct mpr_softc *sc, uint8_t *mas int error = 0; eh = malloc(sizeof(struct mpr_event_handle), M_MPR, M_WAITOK|M_ZERO); - if (!eh) { - mpr_dprint(sc, MPR_EVENT|MPR_ERROR, - "Cannot allocate event memory\n"); - return (ENOMEM); - } eh->callback = cb; eh->data = data; TAILQ_INSERT_TAIL(&sc->event_list, eh, eh_list); Modified: stable/12/sys/dev/mpr/mpr_sas.c == --- stable/12/sys/dev/mpr/mpr_sas.c Mon Aug 3 23:05:47 2020 (r363814) +++ stable/12/sys/dev/mpr/mpr_sas.c Mon Aug 3 23:06:33 2020 (r363815) @@ -755,11 +755,6 @@ mpr_attach_sas(struct mpr_softc *sc) mpr_dprint(sc, MPR_INIT, "%s entered\n", __func__); sassc = malloc(sizeof(struct mprsas_softc), M_MPR, M_WAITOK|M_ZERO); - if (!sassc) { - mpr_dprint(sc, MPR_INIT|MPR_ERROR, - "Cannot allocate SAS subsystem memory\n"); - return (ENOMEM); - } /* * XXX MaxTargets could change during a reinit. Since we don't @@ -770,12 +765,6 @@ mpr_attach_sas(struct mpr_softc *sc) sassc->maxtargets = sc->facts->MaxTargets + sc->facts->MaxVolumes; sassc->targets = malloc(sizeof(struct mprsas_target) * sassc->maxtargets, M_MPR, M_WAITOK|M_ZERO); - if (!sassc->targets) { - mpr_dprint(sc, MPR_INIT|MPR_ERROR, - "Cannot allocate SAS target memory\n"); - free(sassc, M_MPR); - return (ENOMEM); - } sc->sassc = sassc; sassc->sc = sc; @@ -3960,8 +3949,4 @@ mprsas_realloc_targets(struct mpr_softc *sc, int maxta sassc->targets = malloc(sizeof(struct mprsas_target) * maxtargets, M_MPR, M_WAITOK|M_ZERO); - if (!sassc->targets) { - panic("%s failed to alloc targets with error %d\n", - __func__, ENOMEM); - } } Modified: stable/12/sys/dev/mpr/mpr_user.c == --- stable/12/sys/dev/mpr/mpr_user.cMon Aug 3 23:05:47 2020 (r363814) +++ stable/12/sys/dev/mpr/mpr_user.cMon Aug 3 23:06:33 2020 (r363815) @@ -1533,13 +1533,6 @@ mpr_diag_register(struct mpr_softc *sc, mpr_fw_diag_re bzero(sc->fw_diag_buffer, buffer_size); ctx = malloc(sizeof(*ctx), M_MPR, M_WAITOK | M_ZERO); - if (ctx == NULL) { - device_printf(sc->mpr_dev, "%s: context malloc failed\n", - __func__); - *return_code = MPR_FW_DIAG_ERROR_NO_BUFFER; - status = MPR_DIAG_FAILURE; - goto bailout; - } ctx->addr = &sc->fw_diag_busaddr; ctx->buffer_dmat = sc->fw_diag_dmat; ctx->buffer_dmamap = sc->fw_diag_map; Modified: stable/12/sys/dev/mps/mps.c == --- stable/12/sys/dev/mps/mps.c Mon Aug 3 23:05:47 2020(r363814) +++ stable/12/sys/dev/mps/mps.c Mon Aug 3 23:06:33 2020(r363815) @@ -1513,10 +1513,6 @@ mps_alloc_requests(struct mps_softc *sc) */ sc->commands = malloc(sizeof(struct mps_command) * sc->num_reqs, M_MPT2, M_WAITOK | M_ZERO); - if(!sc->commands) { - mps_dprint(sc, MPS_ERROR, "Cannot allocate command memory\n"); - return (ENOMEM); - } for (i = 1; i < sc->num_reqs; i++) { cm = &sc->commands[i]; cm->cm_req = sc->req_frames + i * sc->reqframesz; @@ -2584,10 +2580,6 @@ mps_register_events(struct mps_s
svn commit: r363814 - stable/12/sys/dev/cxgbe
Author: markj Date: Mon Aug 3 23:05:47 2020 New Revision: 363814 URL: https://svnweb.freebsd.org/changeset/base/363814 Log: MFC r363623: cxgbe(4): Stop checking for failures from malloc(M_WAITOK). Modified: stable/12/sys/dev/cxgbe/t4_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/t4_main.c == --- stable/12/sys/dev/cxgbe/t4_main.c Mon Aug 3 22:13:02 2020 (r363813) +++ stable/12/sys/dev/cxgbe/t4_main.c Mon Aug 3 23:05:47 2020 (r363814) @@ -9667,10 +9667,6 @@ load_fw(struct adapter *sc, struct t4_data *fw) } fw_data = malloc(fw->len, M_CXGBE, M_WAITOK); - if (fw_data == NULL) { - rc = ENOMEM; - goto done; - } rc = copyin(fw->data, fw_data, fw->len); if (rc == 0) @@ -9699,10 +9695,6 @@ load_cfg(struct adapter *sc, struct t4_data *cfg) } cfg_data = malloc(cfg->len, M_CXGBE, M_WAITOK); - if (cfg_data == NULL) { - rc = ENOMEM; - goto done; - } rc = copyin(cfg->data, cfg_data, cfg->len); if (rc == 0) @@ -9748,10 +9740,6 @@ load_boot(struct adapter *sc, struct t4_bootrom *br) } br_data = malloc(br->len, M_CXGBE, M_WAITOK); - if (br_data == NULL) { - rc = ENOMEM; - goto done; - } rc = copyin(br->data, br_data, br->len); if (rc == 0) @@ -9780,10 +9768,6 @@ load_bootcfg(struct adapter *sc, struct t4_data *bc) } bc_data = malloc(bc->len, M_CXGBE, M_WAITOK); - if (bc_data == NULL) { - rc = ENOMEM; - goto done; - } rc = copyin(bc->data, bc_data, bc->len); if (rc == 0) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363813 - in head: lib/libc/gen share/man/man4 sys/kern sys/sys
Author: kib Date: Mon Aug 3 22:13:02 2020 New Revision: 363813 URL: https://svnweb.freebsd.org/changeset/base/363813 Log: Add SOL_LOCAL symbolic constant for unix socket option level. The constant seems to exists on MacOS X >= 10.8. Requested by: swills Reviewed by: allanjude, kevans Sponsored by: The FreeBSD Foundation MFC after:1 week Differential revision:https://reviews.freebsd.org/D25933 Modified: head/lib/libc/gen/getpeereid.c head/share/man/man4/unix.4 head/sys/kern/uipc_usrreq.c head/sys/sys/un.h Modified: head/lib/libc/gen/getpeereid.c == --- head/lib/libc/gen/getpeereid.c Mon Aug 3 22:12:18 2020 (r363812) +++ head/lib/libc/gen/getpeereid.c Mon Aug 3 22:13:02 2020 (r363813) @@ -47,7 +47,7 @@ getpeereid(int s, uid_t *euid, gid_t *egid) int error; xuclen = sizeof(xuc); - error = _getsockopt(s, 0, LOCAL_PEERCRED, &xuc, &xuclen); + error = _getsockopt(s, SOL_LOCAL, LOCAL_PEERCRED, &xuc, &xuclen); if (error != 0) return (error); if (xuc.cr_version != XUCRED_VERSION) { Modified: head/share/man/man4/unix.4 == --- head/share/man/man4/unix.4 Mon Aug 3 22:12:18 2020(r363812) +++ head/share/man/man4/unix.4 Mon Aug 3 22:13:02 2020(r363813) @@ -28,7 +28,7 @@ .\" @(#)unix.4 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd August 19, 2018 +.Dd August 3, 2020 .Dt UNIX 4 .Os .Sh NAME @@ -195,7 +195,9 @@ The sending process could have exited and its process reused for a new process. .Sh SOCKET OPTIONS .Tn UNIX -domain sockets support a number of socket options which can be set with +domain sockets support a number of socket options for the options level +.Dv SOL_LOCAL , +which can be set with .Xr setsockopt 2 and tested with .Xr getsockopt 2 : Modified: head/sys/kern/uipc_usrreq.c == --- head/sys/kern/uipc_usrreq.c Mon Aug 3 22:12:18 2020(r363812) +++ head/sys/kern/uipc_usrreq.c Mon Aug 3 22:13:02 2020(r363813) @@ -1470,7 +1470,7 @@ uipc_ctloutput(struct socket *so, struct sockopt *sopt struct xucred xu; int error, optval; - if (sopt->sopt_level != 0) + if (sopt->sopt_level != SOL_LOCAL) return (EINVAL); unp = sotounpcb(so); Modified: head/sys/sys/un.h == --- head/sys/sys/un.h Mon Aug 3 22:12:18 2020(r363812) +++ head/sys/sys/un.h Mon Aug 3 22:13:02 2020(r363813) @@ -62,6 +62,8 @@ struct sockaddr_un { #if __BSD_VISIBLE +#defineSOL_LOCAL 0 /* Options for local socket */ + /* Socket options. */ #defineLOCAL_PEERCRED 1 /* retrieve peer credentials */ #defineLOCAL_CREDS 2 /* pass credentials to receiver */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363812 - head/sys/kern
Author: imp Date: Mon Aug 3 22:12:18 2020 New Revision: 363812 URL: https://svnweb.freebsd.org/changeset/base/363812 Log: Some function had the blank lines, others didn't. Most of the ones that didn't were newer, so remove this now-optional blank line everywhere. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c == --- head/sys/kern/subr_bus.cMon Aug 3 20:26:04 2020(r363811) +++ head/sys/kern/subr_bus.cMon Aug 3 22:12:18 2020(r363812) @@ -234,7 +234,6 @@ devclass_sysctl_handler(SYSCTL_HANDLER_ARGS) static void devclass_sysctl_init(devclass_t dc) { - if (dc->sysctl_tree != NULL) return; sysctl_ctx_init(&dc->sysctl_ctx); @@ -453,7 +452,6 @@ devinit(void) static int devopen(struct cdev *dev, int oflags, int devtype, struct thread *td) { - mtx_lock(&devsoftc.mtx); if (devsoftc.inuse) { mtx_unlock(&devsoftc.mtx); @@ -468,7 +466,6 @@ devopen(struct cdev *dev, int oflags, int devtype, str static int devclose(struct cdev *dev, int fflag, int devtype, struct thread *td) { - mtx_lock(&devsoftc.mtx); devsoftc.inuse = 0; devsoftc.nonblock = 0; @@ -522,7 +519,6 @@ static int devioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) { switch (cmd) { - case FIONBIO: if (*(int*)data) devsoftc.nonblock = 1; @@ -585,7 +581,6 @@ devkqfilter(struct cdev *dev, struct knote *kn) static void filt_devctl_detach(struct knote *kn) { - knlist_remove(&devsoftc.sel.si_note, kn, 0); } @@ -661,7 +656,6 @@ out: void devctl_queue_data(char *data) { - devctl_queue_data_f(data, M_NOWAIT); } @@ -704,7 +698,6 @@ void devctl_notify(const char *system, const char *subsystem, const char *type, const char *data) { - devctl_notify_f(system, subsystem, type, data, M_NOWAIT); } @@ -876,7 +869,6 @@ sysctl_devctl_queue(SYSCTL_HANDLER_ARGS) void devctl_safe_quote_sb(struct sbuf *sb, const char *src) { - while (*src != '\0') { if (*src == '"' || *src == '\\') sbuf_putc(sb, '\\'); @@ -2597,7 +2589,6 @@ device_claim_softc(device_t dev) void * device_get_ivars(device_t dev) { - KASSERT(dev != NULL, ("device_get_ivars(NULL, ...)")); return (dev->ivars); } @@ -2608,7 +2599,6 @@ device_get_ivars(device_t dev) void device_set_ivars(device_t dev, void * ivars) { - KASSERT(dev != NULL, ("device_set_ivars(NULL, ...)")); dev->ivars = ivars; } @@ -3087,7 +3077,6 @@ device_detach(device_t dev) int device_quiesce(device_t dev) { - PDEBUG(("%s", DEVICENAME(dev))); if (dev->state == DS_BUSY) return (EBUSY); @@ -3148,7 +3137,6 @@ device_set_unit(device_t dev, int unit) void resource_init_map_request_impl(struct resource_map_request *args, size_t sz) { - bzero(args, sz); args->size = sz; args->memattr = VM_MEMATTR_UNCACHEABLE; @@ -3704,7 +3692,6 @@ resource_list_purge(struct resource_list *rl) device_t bus_generic_add_child(device_t dev, u_int order, const char *name, int unit) { - return (device_add_child_ordered(dev, order, name, unit)); } @@ -3852,7 +3839,6 @@ bus_generic_suspend_child(device_t dev, device_t child int bus_generic_resume_child(device_t dev, device_t child) { - DEVICE_RESUME(child); child->flags &= ~DF_SUSPENDED; @@ -3944,7 +3930,6 @@ bus_helper_reset_post(device_t dev, int flags) static void bus_helper_reset_prepare_rollback(device_t dev, device_t child, int flags) { - child = TAILQ_NEXT(child, link); if (child == NULL) return; @@ -4356,7 +4341,6 @@ int bus_generic_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu) { - /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent) return (BUS_BIND_INTR(dev->parent, child, irq, cpu)); @@ -4373,7 +4357,6 @@ int bus_generic_config_intr(device_t dev, int irq, enum intr_trigger trig, enum intr_polarity pol) { - /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent) return (BUS_CONFIG_INTR(dev->parent, irq, trig, pol)); @@ -4390,7 +4373,6 @@ int bus_generic_describe_intr(device_t dev, device_t child, struct resource *irq, void *cookie, const char *descr) { - /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent) return (BUS_DESCRIBE_INTR(dev->parent, child, irq, cookie, @@ -4408,7 +4390,6 @@ int bus_generic_get_cpus(device_t dev, device_t child, enum cpu_sets op, size_t setsize, cpuset_t *cpuset) { - /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent != NULL) return
svn commit: r363811 - in head: etc/mtree usr.bin/gh-bc usr.bin/gh-bc/tests
Author: se Date: Mon Aug 3 20:26:04 2020 New Revision: 363811 URL: https://svnweb.freebsd.org/changeset/base/363811 Log: Connect the tests provided with the new bc and dc The tests compare the command output (including of error cases) with the expected output and exit code. Not all tests are executed, since some expect to have a known good bc and dc binary installed and compare results of large amounts of generated data being processed by both versions to test for regressions. Added: head/usr.bin/gh-bc/tests/ head/usr.bin/gh-bc/tests/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/gh-bc/Makefile Modified: head/etc/mtree/BSD.tests.dist == --- head/etc/mtree/BSD.tests.dist Mon Aug 3 19:20:26 2020 (r363810) +++ head/etc/mtree/BSD.tests.dist Mon Aug 3 20:26:04 2020 (r363811) @@ -1002,6 +1002,8 @@ .. getconf .. +gh-bc +.. grep .. gzip Modified: head/usr.bin/gh-bc/Makefile == --- head/usr.bin/gh-bc/Makefile Mon Aug 3 19:20:26 2020(r363810) +++ head/usr.bin/gh-bc/Makefile Mon Aug 3 20:26:04 2020(r363811) @@ -59,9 +59,8 @@ MAN_SRC_DC= dc/A.1 CFLAGS+= -flto .endif -.if ${MK_TESTS} != "no" -#SUBDIR+= tests -.endif +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests .for catalog in ${CATALOGS} NLS+= ${catalog:C/.*://} Added: head/usr.bin/gh-bc/tests/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/gh-bc/tests/Makefile Mon Aug 3 20:26:04 2020 (r363811) @@ -0,0 +1,67 @@ +# $FreeBSD$ + +.include + +PACKAGE= tests + +TEST_DIR= ${SRCTOP}/contrib/bc + +TESTSDIR= ${TESTSBASE}/usr.bin/gh-bc + +.PATH: ${SRCTOP}/tests + +FILESGROUPS+= FILESf +FILESfPACKAGE= ${PACKAGE} +FILESfDIR= ${TESTSDIR} +FILESf=${TEST_DIR}/functions.sh +FILESfMODE=0755 + +FILESGROUPS+= FILEStests +FILEStestsPACKAGE= ${PACKAGE} +FILEStestsDIR= ${TESTSDIR}/tests +FILEStests!= echo ${TEST_DIR}/tests/*.py ${TEST_DIR}/tests/*.sh ${TEST_DIR}/tests/*.txt +FILEStestsMODE=0755 + +FILESGROUPS+= FILESbc +FILESbcPACKAGE=${PACKAGE} +FILESbcDIR=${TESTSDIR}/tests/bc +FILESbc!= echo ${TEST_DIR}/tests/bc/*.* + +FILESGROUPS+= FILESbc_errors +FILESbc_errorsPACKAGE= ${PACKAGE} +FILESbc_errorsDIR= ${TESTSDIR}/tests/bc/errors +FILESbc_errors!= echo ${TEST_DIR}/tests/bc/errors/*.* + +FILESGROUPS+= FILESbc_scripts +FILESbc_scriptsPACKAGE=${PACKAGE} +FILESbc_scriptsDIR=${TESTSDIR}/tests/bc/scripts +FILESbc_scripts!= echo ${TEST_DIR}/tests/bc/scripts/*.* +FILESbc_scriptsMODE= 0755 + +FILESGROUPS+= FILESdc +FILESdcPACKAGE=${PACKAGE} +FILESdcDIR=${TESTSDIR}/tests/dc +FILESdc!= echo ${TEST_DIR}/tests/dc/*.* + +FILESGROUPS+= FILESdc_errors +FILESdc_errorsPACKAGE= ${PACKAGE} +FILESdc_errorsDIR= ${TESTSDIR}/tests/dc/errors +FILESdc_errors!= echo ${TEST_DIR}/tests/dc/errors/*.* + +FILESGROUPS+= FILESdc_scripts +FILESdc_scriptsPACKAGE=${PACKAGE} +FILESdc_scriptsDIR=${TESTSDIR}/tests/dc/scripts +FILESdc_scripts!= echo ${TEST_DIR}/tests/dc/scripts/*.* +FILESdc_scriptsMODE= 0755 + +PLAIN_TESTS_SH=bc_tests dc_tests + +bc_tests.sh: + echo "#!/bin/sh" > ${.TARGET} + echo "env LANG=C ${TESTSDIR}/tests/all.sh bc 1 1 0 0 bc" >> ${.TARGET} + +dc_tests.sh: + echo "#!/bin/sh" > ${.TARGET} + echo "env LANG=C ${TESTSDIR}/tests/all.sh dc 1 1 0 0 dc" >> ${.TARGET} + +.include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363810 - in head/contrib/bc: . include manuals manuals/bc manuals/dc src src/bc src/dc tests/bc
Author: se Date: Mon Aug 3 19:20:26 2020 New Revision: 363810 URL: https://svnweb.freebsd.org/changeset/base/363810 Log: Upgrade to version 3.1.4 This version omits the printing of a copyright header in interactive mode and the dc command now exits afterexecution ofthe commands passed via -e or -f instead of switching to interactive mode. To pass further commands via STDIN when dc has been invoked with -e or -f, add "-f -" to the parameter list. Added: head/contrib/bc/tests/bc/misc6.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc6.txt head/contrib/bc/tests/bc/misc6_results.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc6_results.txt head/contrib/bc/tests/bc/misc7.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc7.txt head/contrib/bc/tests/bc/misc7_results.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc7_results.txt head/contrib/bc/tests/bc/stdin1.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin1.txt head/contrib/bc/tests/bc/stdin1_results.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin1_results.txt head/contrib/bc/tests/bc/stdin2.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin2.txt head/contrib/bc/tests/bc/stdin2_results.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin2_results.txt Modified: head/contrib/bc/Makefile.in head/contrib/bc/NEWS.md head/contrib/bc/README.md head/contrib/bc/include/bc.h head/contrib/bc/include/vm.h head/contrib/bc/manuals/bc.1.md.in head/contrib/bc/manuals/bc/A.1 head/contrib/bc/manuals/bc/A.1.md head/contrib/bc/manuals/bc/E.1 head/contrib/bc/manuals/bc/E.1.md head/contrib/bc/manuals/bc/EH.1 head/contrib/bc/manuals/bc/EH.1.md head/contrib/bc/manuals/bc/EHN.1 head/contrib/bc/manuals/bc/EHN.1.md head/contrib/bc/manuals/bc/EHNP.1 head/contrib/bc/manuals/bc/EHNP.1.md head/contrib/bc/manuals/bc/EHP.1 head/contrib/bc/manuals/bc/EHP.1.md head/contrib/bc/manuals/bc/EN.1 head/contrib/bc/manuals/bc/EN.1.md head/contrib/bc/manuals/bc/ENP.1 head/contrib/bc/manuals/bc/ENP.1.md head/contrib/bc/manuals/bc/EP.1 head/contrib/bc/manuals/bc/EP.1.md head/contrib/bc/manuals/bc/H.1 head/contrib/bc/manuals/bc/H.1.md head/contrib/bc/manuals/bc/HN.1 head/contrib/bc/manuals/bc/HN.1.md head/contrib/bc/manuals/bc/HNP.1 head/contrib/bc/manuals/bc/HNP.1.md head/contrib/bc/manuals/bc/HP.1 head/contrib/bc/manuals/bc/HP.1.md head/contrib/bc/manuals/bc/N.1 head/contrib/bc/manuals/bc/N.1.md head/contrib/bc/manuals/bc/NP.1 head/contrib/bc/manuals/bc/NP.1.md head/contrib/bc/manuals/bc/P.1 head/contrib/bc/manuals/bc/P.1.md head/contrib/bc/manuals/dc.1.md.in head/contrib/bc/manuals/dc/A.1 head/contrib/bc/manuals/dc/A.1.md head/contrib/bc/manuals/dc/E.1 head/contrib/bc/manuals/dc/E.1.md head/contrib/bc/manuals/dc/EH.1 head/contrib/bc/manuals/dc/EH.1.md head/contrib/bc/manuals/dc/EHN.1 head/contrib/bc/manuals/dc/EHN.1.md head/contrib/bc/manuals/dc/EHNP.1 head/contrib/bc/manuals/dc/EHNP.1.md head/contrib/bc/manuals/dc/EHP.1 head/contrib/bc/manuals/dc/EHP.1.md head/contrib/bc/manuals/dc/EN.1 head/contrib/bc/manuals/dc/EN.1.md head/contrib/bc/manuals/dc/ENP.1 head/contrib/bc/manuals/dc/ENP.1.md head/contrib/bc/manuals/dc/EP.1 head/contrib/bc/manuals/dc/EP.1.md head/contrib/bc/manuals/dc/H.1 head/contrib/bc/manuals/dc/H.1.md head/contrib/bc/manuals/dc/HN.1 head/contrib/bc/manuals/dc/HN.1.md head/contrib/bc/manuals/dc/HNP.1 head/contrib/bc/manuals/dc/HNP.1.md head/contrib/bc/manuals/dc/HP.1 head/contrib/bc/manuals/dc/HP.1.md head/contrib/bc/manuals/dc/N.1 head/contrib/bc/manuals/dc/N.1.md head/contrib/bc/manuals/dc/NP.1 head/contrib/bc/manuals/dc/NP.1.md head/contrib/bc/manuals/dc/P.1 head/contrib/bc/manuals/dc/P.1.md head/contrib/bc/src/args.c head/contrib/bc/src/bc/bc.c head/contrib/bc/src/bc/parse.c head/contrib/bc/src/dc/dc.c head/contrib/bc/src/vm.c head/contrib/bc/tests/bc/all.txt Directory Properties: head/contrib/bc/ (props changed) Modified: head/contrib/bc/Makefile.in == --- head/contrib/bc/Makefile.in Mon Aug 3 19:18:38 2020(r363809) +++ head/contrib/bc/Makefile.in Mon Aug 3 19:20:26 2020(r363810) @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.1.3 +VERSION = 3.1.4 SRC = %%SRC%% OBJ = %%OBJ%% Modified: head/contrib/bc/NEWS.md == --- head/contrib/bc/NEWS.md Mon Aug 3 19:18:38 2020(r363809) +++ head/contrib/bc/NEWS.md Mon Aug 3 19:20:26 2020(r363810) @@ -1,5 +1,24 @@ # News +## 3.1.4 + +This is a production release that fixes one bug, changes two behaviors, and +removes one environment variable. + +The bug is like t
svn commit: r363809 - head/usr.bin/gh-bc
Author: se Date: Mon Aug 3 19:18:38 2020 New Revision: 363809 URL: https://svnweb.freebsd.org/changeset/base/363809 Log: Upgrade to version 3.1.4 This version omits the printing of a copyright header in interactive mode and the dc command now exits after execution of the commands passed via -e or -f instead of switching to interactive mode. To pass further commands via STDIN when dc has been invoked with -e or -f, add "-f -" to the parameter list. Modified: head/usr.bin/gh-bc/Makefile Modified: head/usr.bin/gh-bc/Makefile == --- head/usr.bin/gh-bc/Makefile Mon Aug 3 19:00:12 2020(r363808) +++ head/usr.bin/gh-bc/Makefile Mon Aug 3 19:18:38 2020(r363809) @@ -59,6 +59,10 @@ MAN_SRC_DC= dc/A.1 CFLAGS+= -flto .endif +.if ${MK_TESTS} != "no" +#SUBDIR+= tests +.endif + .for catalog in ${CATALOGS} NLS+= ${catalog:C/.*://} NLSSRCFILES_${catalog:C/.*://}= ${catalog:C/.*://}.msg ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363808 - vendor/bc/3.1.4
Author: se Date: Mon Aug 3 19:00:12 2020 New Revision: 363808 URL: https://svnweb.freebsd.org/changeset/base/363808 Log: Tag version 3.1.4 Added: vendor/bc/3.1.4/ - copied from r363807, vendor/bc/dist/ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363807 - in vendor/bc/dist: . include manuals manuals/bc manuals/dc src src/bc src/dc tests/bc
Author: se Date: Mon Aug 3 18:55:39 2020 New Revision: 363807 URL: https://svnweb.freebsd.org/changeset/base/363807 Log: Import version 3.1.4 This version makes dc exit after processing all commands passed via -e or -f instead of waiting for more input on STDIN (add "-f -" to the command line to emulate the behavior of versionm 3.1.3 and earlier, if desired). The version and copyright message are no longer printed for interactive sessions as was the case with the prior implementation in the FreeBSD base system. Obtained from:https://git.yzena.com/gavin/bc Added: vendor/bc/dist/tests/bc/misc6.txt (contents, props changed) vendor/bc/dist/tests/bc/misc6_results.txt (contents, props changed) vendor/bc/dist/tests/bc/misc7.txt (contents, props changed) vendor/bc/dist/tests/bc/misc7_results.txt (contents, props changed) vendor/bc/dist/tests/bc/stdin1.txt (contents, props changed) vendor/bc/dist/tests/bc/stdin1_results.txt (contents, props changed) vendor/bc/dist/tests/bc/stdin2.txt (contents, props changed) vendor/bc/dist/tests/bc/stdin2_results.txt (contents, props changed) Modified: vendor/bc/dist/Makefile.in vendor/bc/dist/NEWS.md vendor/bc/dist/README.md vendor/bc/dist/include/bc.h vendor/bc/dist/include/vm.h vendor/bc/dist/manuals/bc.1.md.in vendor/bc/dist/manuals/bc/A.1 vendor/bc/dist/manuals/bc/A.1.md vendor/bc/dist/manuals/bc/E.1 vendor/bc/dist/manuals/bc/E.1.md vendor/bc/dist/manuals/bc/EH.1 vendor/bc/dist/manuals/bc/EH.1.md vendor/bc/dist/manuals/bc/EHN.1 vendor/bc/dist/manuals/bc/EHN.1.md vendor/bc/dist/manuals/bc/EHNP.1 vendor/bc/dist/manuals/bc/EHNP.1.md vendor/bc/dist/manuals/bc/EHP.1 vendor/bc/dist/manuals/bc/EHP.1.md vendor/bc/dist/manuals/bc/EN.1 vendor/bc/dist/manuals/bc/EN.1.md vendor/bc/dist/manuals/bc/ENP.1 vendor/bc/dist/manuals/bc/ENP.1.md vendor/bc/dist/manuals/bc/EP.1 vendor/bc/dist/manuals/bc/EP.1.md vendor/bc/dist/manuals/bc/H.1 vendor/bc/dist/manuals/bc/H.1.md vendor/bc/dist/manuals/bc/HN.1 vendor/bc/dist/manuals/bc/HN.1.md vendor/bc/dist/manuals/bc/HNP.1 vendor/bc/dist/manuals/bc/HNP.1.md vendor/bc/dist/manuals/bc/HP.1 vendor/bc/dist/manuals/bc/HP.1.md vendor/bc/dist/manuals/bc/N.1 vendor/bc/dist/manuals/bc/N.1.md vendor/bc/dist/manuals/bc/NP.1 vendor/bc/dist/manuals/bc/NP.1.md vendor/bc/dist/manuals/bc/P.1 vendor/bc/dist/manuals/bc/P.1.md vendor/bc/dist/manuals/dc.1.md.in vendor/bc/dist/manuals/dc/A.1 vendor/bc/dist/manuals/dc/A.1.md vendor/bc/dist/manuals/dc/E.1 vendor/bc/dist/manuals/dc/E.1.md vendor/bc/dist/manuals/dc/EH.1 vendor/bc/dist/manuals/dc/EH.1.md vendor/bc/dist/manuals/dc/EHN.1 vendor/bc/dist/manuals/dc/EHN.1.md vendor/bc/dist/manuals/dc/EHNP.1 vendor/bc/dist/manuals/dc/EHNP.1.md vendor/bc/dist/manuals/dc/EHP.1 vendor/bc/dist/manuals/dc/EHP.1.md vendor/bc/dist/manuals/dc/EN.1 vendor/bc/dist/manuals/dc/EN.1.md vendor/bc/dist/manuals/dc/ENP.1 vendor/bc/dist/manuals/dc/ENP.1.md vendor/bc/dist/manuals/dc/EP.1 vendor/bc/dist/manuals/dc/EP.1.md vendor/bc/dist/manuals/dc/H.1 vendor/bc/dist/manuals/dc/H.1.md vendor/bc/dist/manuals/dc/HN.1 vendor/bc/dist/manuals/dc/HN.1.md vendor/bc/dist/manuals/dc/HNP.1 vendor/bc/dist/manuals/dc/HNP.1.md vendor/bc/dist/manuals/dc/HP.1 vendor/bc/dist/manuals/dc/HP.1.md vendor/bc/dist/manuals/dc/N.1 vendor/bc/dist/manuals/dc/N.1.md vendor/bc/dist/manuals/dc/NP.1 vendor/bc/dist/manuals/dc/NP.1.md vendor/bc/dist/manuals/dc/P.1 vendor/bc/dist/manuals/dc/P.1.md vendor/bc/dist/src/args.c vendor/bc/dist/src/bc/bc.c vendor/bc/dist/src/bc/parse.c vendor/bc/dist/src/dc/dc.c vendor/bc/dist/src/vm.c vendor/bc/dist/tests/bc/all.txt Modified: vendor/bc/dist/Makefile.in == --- vendor/bc/dist/Makefile.in Mon Aug 3 18:08:10 2020(r363806) +++ vendor/bc/dist/Makefile.in Mon Aug 3 18:55:39 2020(r363807) @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.1.3 +VERSION = 3.1.4 SRC = %%SRC%% OBJ = %%OBJ%% Modified: vendor/bc/dist/NEWS.md == --- vendor/bc/dist/NEWS.md Mon Aug 3 18:08:10 2020(r363806) +++ vendor/bc/dist/NEWS.md Mon Aug 3 18:55:39 2020(r363807) @@ -1,5 +1,24 @@ # News +## 3.1.4 + +This is a production release that fixes one bug, changes two behaviors, and +removes one environment variable. + +The bug is like the one in the last release except it applies if files are being +executed. I also made the fix more general. + +The behavior that was changed is that `bc` now exits when given `-e`, `-f`, +`--expression` or `--file`. However, if the last one of those is `-f-` (using +`stdin` as the file), `bc` does not exit. If `-f-` exists and is not the last of +the `-e` and `-f` options (and equivalents), `bc` gives a fatal error and exits. + +N
svn commit: r363806 - head/usr.sbin/nmtree
Author: arichardson Date: Mon Aug 3 18:08:10 2020 New Revision: 363806 URL: https://svnweb.freebsd.org/changeset/base/363806 Log: Allow bootstrapping mtree on Linux systems Linux glibc has a dummy lchmod that always fails and emitting a linker warning when used. Don't fail the build due to that warning when bootstrapping by setting LD_FATAL_WARNINGS=no. Reviewed By: brooks, emaste Differential Revision: https://reviews.freebsd.org/D25930 Modified: head/usr.sbin/nmtree/Makefile Modified: head/usr.sbin/nmtree/Makefile == --- head/usr.sbin/nmtree/Makefile Mon Aug 3 18:08:04 2020 (r363805) +++ head/usr.sbin/nmtree/Makefile Mon Aug 3 18:08:10 2020 (r363806) @@ -22,4 +22,10 @@ MLINKS= mtree.8 nmtree.8 HAS_TESTS= SUBDIR.${MK_TESTS}+= tests +.if defined(BOOTSTRAPPING) +# Linux glibc has a dummy lchmod that always fails. Don't fail due to +# the linker warning that it emits. +LD_FATAL_WARNINGS=no +.endif + .include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363805 - head/lib/libc/gen
Author: arichardson Date: Mon Aug 3 18:08:04 2020 New Revision: 363805 URL: https://svnweb.freebsd.org/changeset/base/363805 Log: Allow building setmode.c on Linux/macOS We bootstrap this file to allow compiling FreeBSD on Linux systems since some boostrap tools use setmode(). Unfortunately, glibc's sys/stat.h declares a non-static getumask() function (which is unimplemented!) and that conflicts with the local getumask() function. To work around this simply use a different name here. Reviewed By: brooks, emaste Differential Revision: https://reviews.freebsd.org/D25929 Modified: head/lib/libc/gen/setmode.c Modified: head/lib/libc/gen/setmode.c == --- head/lib/libc/gen/setmode.c Mon Aug 3 17:53:15 2020(r363804) +++ head/lib/libc/gen/setmode.c Mon Aug 3 18:08:04 2020(r363805) @@ -70,7 +70,7 @@ typedef struct bitcmd { #defineCMD2_OBITS 0x08 #defineCMD2_UBITS 0x10 -static mode_t getumask(void); +static mode_t get_current_umask(void); static BITCMD *addcmd(BITCMD *, mode_t, mode_t, mode_t, mode_t); static void compress_mode(BITCMD *); #ifdef SETMODE_DEBUG @@ -186,7 +186,7 @@ setmode(const char *p) * Get a copy of the mask for the permissions that are mask relative. * Flip the bits, we want what's not set. */ - mask = ~getumask(); + mask = ~get_current_umask(); setlen = SET_LEN + 2; @@ -343,13 +343,14 @@ out: } static mode_t -getumask(void) +get_current_umask(void) { sigset_t sigset, sigoset; size_t len; mode_t mask; u_short smask; +#ifdef KERN_PROC_UMASK /* * First try requesting the umask without temporarily modifying it. * Note that this does not work if the sysctl @@ -359,7 +360,7 @@ getumask(void) if (sysctl((int[4]){ CTL_KERN, KERN_PROC, KERN_PROC_UMASK, 0 }, 4, &smask, &len, NULL, 0) == 0) return (smask); - +#endif /* * Since it's possible that the caller is opening files inside a signal * handler, protect them as best we can. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r363733 - head/usr.sbin/bhyve
-Original Message- From: on behalf of Peter Grehan Date: 2020-07-31, Friday at 05:10 To: , , Subject: svn commit: r363733 - head/usr.sbin/bhyve Author: grehan Date: Fri Jul 31 12:10:28 2020 New Revision: 363733 URL: https://svnweb.freebsd.org/changeset/base/363733 Log: Replace magic numbers in Identify page register 0 with ATA definitions. No functional change. Verified with objdump output before/after. Requested by: rpokala Reviewed by: rpokala MFC after:3 weeks Thanks! :-) -Ravi (rpokala@) Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c == --- head/usr.sbin/bhyve/pci_ahci.c Fri Jul 31 12:09:59 2020 (r363732) +++ head/usr.sbin/bhyve/pci_ahci.c Fri Jul 31 12:10:28 2020 (r363733) @@ -999,7 +999,8 @@ ata_identify_init(struct ahci_port* p, int atapi) struct ata_params* ata_ident = &p->ata_ident; if (atapi) { - ata_ident->config = (2 << 14 | 5 << 8 | 1 << 7 | 2 << 5); + ata_ident->config = ATA_PROTO_ATAPI | ATA_ATAPI_TYPE_CDROM | + ATA_ATAPI_REMOVABLE | ATA_DRQ_FAST; ata_ident->capabilities1 = ATA_SUPPORT_LBA | ATA_SUPPORT_DMA; ata_ident->capabilities2 = (1 << 14 | 1); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363804 - head/lib/ncurses/ncurses
Author: jhb Date: Mon Aug 3 17:53:15 2020 New Revision: 363804 URL: https://svnweb.freebsd.org/changeset/base/363804 Log: Pass the full CFLAGS to cpp for MKlib_gen.sh. GCC's cpp was exiting immediately when it failed to find requested includes ( and ). clang-cpp emitted an error for the missing header files but continued processing the file (thus not honoring any macros defined in the missing headers). Arguably, the awk script is buggy since it doesn't check the return value of the command it executes. Reviewed by: kevans Differential Revision:https://reviews.freebsd.org/D25731 Modified: head/lib/ncurses/ncurses/Makefile Modified: head/lib/ncurses/ncurses/Makefile == --- head/lib/ncurses/ncurses/Makefile Mon Aug 3 17:51:57 2020 (r363803) +++ head/lib/ncurses/ncurses/Makefile Mon Aug 3 17:53:15 2020 (r363804) @@ -345,7 +345,7 @@ codes.c: MKcodes.awk ${AWK} -f ${NCURSES_DIR}/ncurses/tinfo/MKcodes.awk bigstrings=${USE_BIG_STRINGS} ${NCURSES_DIR}/include/Caps > codes.c lib_gen.c: MKlib_gen.sh curses.h ncurses_dll.h - LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh "${CPP:N${CCACHE_BIN}} ${CPPFLAGS}" \ + LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh "${CPP:N${CCACHE_BIN}} ${CFLAGS}" \ "${AWK}" generated < curses.h >$@ lib_keyname.c: keys.list MKkeyname.awk ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363802 - in head/sys: arm/broadcom/bcm2835 conf
Author: andrew Date: Mon Aug 3 17:18:12 2020 New Revision: 363802 URL: https://svnweb.freebsd.org/changeset/base/363802 Log: Add a GPIO driver for the Raspberry Pi firmware GPIOs These exist on the Raspberry Pi 3 and 4 and control and external IO expander. Reviewed by: manu Sponsored by: Innovate UK Differential Revision:https://reviews.freebsd.org/D25858 Added: head/sys/arm/broadcom/bcm2835/raspberrypi_gpio.c (contents, props changed) Modified: head/sys/conf/files.arm64 Added: head/sys/arm/broadcom/bcm2835/raspberrypi_gpio.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/raspberrypi_gpio.cMon Aug 3 17:18:12 2020(r363802) @@ -0,0 +1,457 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012-2015 Luiz Otavio O Souza + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include "gpio_if.h" + +#defineRPI_FW_GPIO_PINS8 +#defineRPI_FW_GPIO_BASE128 +#defineRPI_FW_GPIO_DEFAULT_CAPS(GPIO_PIN_INPUT | GPIO_PIN_OUTPUT) + +struct rpi_fw_gpio_softc { + device_tsc_busdev; + device_tsc_firmware; + struct sx sc_sx; + struct gpio_pin sc_gpio_pins[RPI_FW_GPIO_PINS]; + uint8_t sc_gpio_state; +}; + +#defineRPI_FW_GPIO_LOCK(_sc) sx_xlock(&(_sc)->sc_sx) +#defineRPI_FW_GPIO_UNLOCK(_sc) sx_xunlock(&(_sc)->sc_sx) + +static struct ofw_compat_data compat_data[] = { + {"raspberrypi,firmware-gpio", 1}, + {NULL, 0} +}; + +static int +rpi_fw_gpio_pin_configure(struct rpi_fw_gpio_softc *sc, struct gpio_pin *pin, +unsigned int flags) +{ + union msg_get_gpio_config old_cfg; + union msg_set_gpio_config new_cfg; + int rv; + + bzero(&old_cfg, sizeof(old_cfg)); + bzero(&new_cfg, sizeof(new_cfg)); + old_cfg.req.gpio = RPI_FW_GPIO_BASE + pin->gp_pin; + + RPI_FW_GPIO_LOCK(sc); + rv = bcm2835_firmware_property(sc->sc_firmware, + BCM2835_FIRMWARE_TAG_GET_GPIO_CONFIG, &old_cfg, sizeof(old_cfg)); + if (rv == 0 && old_cfg.resp.gpio != 0) + rv = EIO; + if (rv != 0) + goto fail; + + new_cfg.req.gpio = RPI_FW_GPIO_BASE + pin->gp_pin; + if (flags & GPIO_PIN_INPUT) { + new_cfg.req.dir = BCM2835_FIRMWARE_GPIO_IN; + new_cfg.req.state = 0; + pin->gp_flags = GPIO_PIN_INPUT; + } else if (flags & GPIO_PIN_OUTPUT) { + new_cfg.req.dir = BCM2835_FIRMWARE_GPIO_OUT; + if (flags & (GPIO_PIN_PRESET_HIGH | GPIO_PIN_PRESET_LOW)) { + if (flags & GPIO_PIN_PRESET_HIGH) { + new_cfg.req.state = 1; + sc->sc_gpio_state |= (1 << pin->gp_pin); + } else { + new_cfg.req.state = 0; + sc->sc_gpio_state &= ~(1 << pin->gp_pin); + } + } else { + if ((sc->sc_gpio_state & (1 << pin->gp_pin)) != 0) { + new_cfg.req.state = 1; + } else { + new_cfg.req.state = 0; +
svn commit: r363801 - head/sys/kern
Author: kib Date: Mon Aug 3 17:17:17 2020 New Revision: 363801 URL: https://svnweb.freebsd.org/changeset/base/363801 Log: Provide more correct description for sysctl kern.smp.cores. Reported by: dewa...@heuristicsystems.com.au PR: 248454 Sponsored by: The FreeBSD Foundation MFC after:3 days Modified: head/sys/kern/subr_smp.c Modified: head/sys/kern/subr_smp.c == --- head/sys/kern/subr_smp.cMon Aug 3 16:43:40 2020(r363800) +++ head/sys/kern/subr_smp.cMon Aug 3 17:17:17 2020(r363801) @@ -104,7 +104,7 @@ SYSCTL_INT(_kern_smp, OID_AUTO, threads_per_core, CTLF int mp_ncores = -1;/* how many physical cores running */ SYSCTL_INT(_kern_smp, OID_AUTO, cores, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_ncores, 0, -"Number of CPUs online"); +"Number of physical cores online"); int smp_topology = 0; /* Which topology we're using. */ SYSCTL_INT(_kern_smp, OID_AUTO, topology, CTLFLAG_RDTUN, &smp_topology, 0, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363800 - head/sys/arm/broadcom/bcm2835
Author: andrew Date: Mon Aug 3 16:43:40 2020 New Revision: 363800 URL: https://svnweb.freebsd.org/changeset/base/363800 Log: Allow the Raspberry Pi firmware driver to be a bus There are child nodes in the device tree, e.g. the Raspberry Pi firmware GPIO device. Add support for this to be a bus so we can attach these children. Reviewed by: manu Sponsored by: Innovate UK Differential Revision:https://reviews.freebsd.org/D25848 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c == --- head/sys/arm/broadcom/bcm2835/bcm2835_firmware.cMon Aug 3 16:26:10 2020(r363799) +++ head/sys/arm/broadcom/bcm2835/bcm2835_firmware.cMon Aug 3 16:43:40 2020(r363800) @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include @@ -47,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include struct bcm2835_firmware_softc { - device_tsc_dev; + struct simplebus_softc sc; phandle_t sc_mbox; }; @@ -82,7 +84,6 @@ bcm2835_firmware_attach(device_t dev) int rv; sc = device_get_softc(dev); - sc->sc_dev = dev; node = ofw_bus_get_node(dev); rv = OF_getencprop(node, "mboxes", &mbox, sizeof(mbox)); @@ -94,14 +95,17 @@ bcm2835_firmware_attach(device_t dev) OF_device_register_xref(OF_xref_from_node(node), dev); - ctx = device_get_sysctl_ctx(sc->sc_dev); - tree_node = device_get_sysctl_tree(sc->sc_dev); + ctx = device_get_sysctl_ctx(dev); + tree_node = device_get_sysctl_tree(dev); tree = SYSCTL_CHILDREN(tree_node); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "revision", CTLTYPE_UINT | CTLFLAG_RD, sc, sizeof(*sc), sysctl_bcm2835_firmware_get_revision, "IU", "Firmware revision"); - return (0); + + /* The firmwaare doesn't have a ranges property */ + sc->sc.flags |= SB_FLAG_NO_RANGES; + return (simplebus_attach(dev)); } int @@ -150,7 +154,7 @@ sysctl_bcm2835_firmware_get_revision(SYSCTL_HANDLER_AR uint32_t rev; int err; - if (bcm2835_firmware_property(sc->sc_dev, + if (bcm2835_firmware_property(sc->sc.dev, BCM2835_MBOX_TAG_FIRMWARE_REVISION, &rev, sizeof(rev)) != 0) return (ENXIO); @@ -171,11 +175,9 @@ static device_method_t bcm2835_firmware_methods[] = { }; static devclass_t bcm2835_firmware_devclass; -static driver_t bcm2835_firmware_driver = { - "bcm2835_firmware", - bcm2835_firmware_methods, - sizeof(struct bcm2835_firmware_softc), -}; +DEFINE_CLASS_1(bcm2835_firmware, bcm2835_firmware_driver, +bcm2835_firmware_methods, sizeof(struct bcm2835_firmware_softc), +simplebus_driver); EARLY_DRIVER_MODULE(bcm2835_firmware, simplebus, bcm2835_firmware_driver, bcm2835_firmware_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363799 - head/sys/dev/fdt
Author: andrew Date: Mon Aug 3 16:26:10 2020 New Revision: 363799 URL: https://svnweb.freebsd.org/changeset/base/363799 Log: Allow child classes of simplebus to call attach directly Reduce code duplication when a bus is subclassed from simplebus by allowing them to call simplebus_attach directly. This is useful when the child bus will just implement the same calls. As not all children will expect to have a ranges property, e.g. the Raspberry Pi firmware, allow this property to be missing. Reviewed by: manu Sponsored by: Innovate UK Differential Revision:https://reviews.freebsd.org/D25925 Modified: head/sys/dev/fdt/simplebus.c head/sys/dev/fdt/simplebus.h Modified: head/sys/dev/fdt/simplebus.c == --- head/sys/dev/fdt/simplebus.cMon Aug 3 13:12:07 2020 (r363798) +++ head/sys/dev/fdt/simplebus.cMon Aug 3 16:26:10 2020 (r363799) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); * Bus interface. */ static int simplebus_probe(device_t dev); -static int simplebus_attach(device_t dev); static struct resource *simplebus_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); static voidsimplebus_probe_nomatch(device_t bus, device_t child); @@ -134,7 +133,7 @@ simplebus_probe(device_t dev) return (BUS_PROBE_GENERIC); } -static int +int simplebus_attach(device_t dev) { struct simplebus_softc *sc; @@ -142,7 +141,8 @@ simplebus_attach(device_t dev) sc = device_get_softc(dev); simplebus_init(dev, 0); - if (simplebus_fill_ranges(sc->node, sc) < 0) { + if ((sc->flags & SB_FLAG_NO_RANGES) == 0 && + simplebus_fill_ranges(sc->node, sc) < 0) { device_printf(dev, "could not get ranges\n"); return (ENXIO); } Modified: head/sys/dev/fdt/simplebus.h == --- head/sys/dev/fdt/simplebus.hMon Aug 3 13:12:07 2020 (r363798) +++ head/sys/dev/fdt/simplebus.hMon Aug 3 16:26:10 2020 (r363799) @@ -47,6 +47,8 @@ struct simplebus_softc { struct simplebus_range *ranges; int nranges; +#defineSB_FLAG_NO_RANGES (1 << 0) /* Bus doesn't have ranges property */ + int flags; pcell_t acells, scells; }; @@ -63,4 +65,7 @@ struct simplebus_devinfo *simplebus_setup_dinfo(device struct simplebus_devinfo *di); int simplebus_fill_ranges(phandle_t node, struct simplebus_softc *sc); + +int simplebus_attach(device_t dev); + #endif /* _FDT_SIMPLEBUS_H */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363798 - head/share/man/man7
Author: 0mp (doc,ports committer) Date: Mon Aug 3 13:12:07 2020 New Revision: 363798 URL: https://svnweb.freebsd.org/changeset/base/363798 Log: Do not mention portsnap(8) in ports.7 As we are moving away from portsnap, let's not recommend it in the manual page. Reviewed by: bcr (manpages), mat (portmgr) Differential Revision:https://reviews.freebsd.org/D25847 Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 == --- head/share/man/man7/ports.7 Mon Aug 3 12:51:14 2020(r363797) +++ head/share/man/man7/ports.7 Mon Aug 3 13:12:07 2020(r363798) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 17, 2020 +.Dd August 3, 2020 .Dt PORTS 7 .Os .Sh NAME @@ -70,9 +70,7 @@ branch contains all the latest changes, while the branches only provide critical fixes. The .Em head -branch can be installed or updated using either -.Xr portsnap 8 , -or from Subversion repository at: +branch can be installed or updated from the Subversion repository located at: .Pp .Lk https://svn.FreeBSD.org/ports/head .Pp @@ -626,8 +624,7 @@ is going to be built with Python 3.7 support.) .Xr make 1 , .Xr make.conf 5 , .Xr development 7 , -.Xr pkg 7 , -.Xr portsnap 8 +.Xr pkg 7 .Pp Additional developer documentation: .Bl -dash -width "" -offset indent ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363797 - head/contrib/googletest/googletest/test
Author: lwhsu Date: Mon Aug 3 12:51:14 2020 New Revision: 363797 URL: https://svnweb.freebsd.org/changeset/base/363797 Log: Disable tests failing after r363679 PR: 248452 Sponsored by: The FreeBSD Foundation Modified: head/contrib/googletest/googletest/test/googletest-port-test.cc Modified: head/contrib/googletest/googletest/test/googletest-port-test.cc == --- head/contrib/googletest/googletest/test/googletest-port-test.cc Mon Aug 3 12:48:51 2020(r363796) +++ head/contrib/googletest/googletest/test/googletest-port-test.cc Mon Aug 3 12:51:14 2020(r363797) @@ -403,6 +403,8 @@ typedef testing::Types< TYPED_TEST_CASE(RETest, StringTypes); // Tests RE's implicit constructors. +/* +https://bugs.freebsd.org/248452 TYPED_TEST(RETest, ImplicitConstructorWorks) { const RE empty(TypeParam("")); EXPECT_STREQ("", empty.pattern()); @@ -413,6 +415,7 @@ TYPED_TEST(RETest, ImplicitConstructorWorks) { const RE normal(TypeParam(".*(\\w+)")); EXPECT_STREQ(".*(\\w+)", normal.pattern()); } +*/ // Tests that RE's constructors reject invalid regular expressions. TYPED_TEST(RETest, RejectsInvalidRegex) { @@ -861,6 +864,8 @@ TEST(MatchRegexAnywhereTest, ReturnsTrueWhenMatchingNo } // Tests RE's implicit constructors. +/* +https://bugs.freebsd.org/248452 TEST(RETest, ImplicitConstructorWorks) { const RE empty(""); EXPECT_STREQ("", empty.pattern()); @@ -868,6 +873,7 @@ TEST(RETest, ImplicitConstructorWorks) { const RE simple("hello"); EXPECT_STREQ("hello", simple.pattern()); } +*/ // Tests that RE's constructors reject invalid regular expressions. TEST(RETest, RejectsInvalidRegex) { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363796 - in head: lib/libc/riscv/gen sys/riscv/include
Author: kp Date: Mon Aug 3 12:48:51 2020 New Revision: 363796 URL: https://svnweb.freebsd.org/changeset/base/363796 Log: libc: Provide sub fp(s|g)etmask() implementations for RISC-V RISC-V doesn't support floating-point exceptions. RISC-V Instruction Set Manual: Volume I: User-Level ISA, 11.2 Floating-Point Control and Status Register: "As allowed by the standard, we do not support traps on floating-point exceptions in the base ISA, but instead require explicit checks of the flags in software. We considered adding branches controlled directly by the contents of the floating-point accrued exception flags, but ultimately chose to omit these instructions to keep the ISA simple." We still need these functions, because some applications (notably Perl) call them, but we cannot provide a meaningful implementation. Sponsored by: Axiado Differential Revision:https://reviews.freebsd.org/D25740 Added: head/lib/libc/riscv/gen/fpgetmask.c (contents, props changed) head/lib/libc/riscv/gen/fpsetmask.c (contents, props changed) Modified: head/lib/libc/riscv/gen/Makefile.inc head/sys/riscv/include/ieeefp.h Modified: head/lib/libc/riscv/gen/Makefile.inc == --- head/lib/libc/riscv/gen/Makefile.incMon Aug 3 10:19:50 2020 (r363795) +++ head/lib/libc/riscv/gen/Makefile.incMon Aug 3 12:48:51 2020 (r363796) @@ -3,6 +3,8 @@ SRCS+= _ctx_start.S \ fabs.S \ flt_rounds.c \ + fpgetmask.c \ + fpsetmask.c \ infinity.c \ ldexp.c \ makecontext.c \ Added: head/lib/libc/riscv/gen/fpgetmask.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/riscv/gen/fpgetmask.c Mon Aug 3 12:48:51 2020 (r363796) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2020 Axiado + * All rights reserved. + * + * This software was developed by Kristof Provost under + * sponsorship from Axiado. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +fp_except_t +fpgetmask(void) +{ + + return (0); +} Added: head/lib/libc/riscv/gen/fpsetmask.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/riscv/gen/fpsetmask.c Mon Aug 3 12:48:51 2020 (r363796) @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2020 Axiado + * All rights reserved. + * + * This software was developed by Kristof Provost under + * sponsorship from Axiado. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA
svn commit: r363795 - in head/sys: arm/broadcom/bcm2835 conf dev/usb/controller
Author: andrew Date: Mon Aug 3 10:19:50 2020 New Revision: 363795 URL: https://svnweb.freebsd.org/changeset/base/363795 Log: Handle Raspberry Pi 4 xhci firmware loading. The newer hardware revisions of the Raspberry Pi 4 removed the ability of the VIA VL805 xhci controller to load its own firmware. Instead the firmware must be installed at the appropriate time by the VideoCore coprocessor. Submitted by: Robert Crowston Differential Revision:https://reviews.freebsd.org/D25261 Added: head/sys/arm/broadcom/bcm2835/bcm2838_xhci.c (contents, props changed) Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h head/sys/arm/broadcom/bcm2835/files.bcm283x head/sys/conf/files.arm64 head/sys/dev/usb/controller/xhci.h head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c == --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.cMon Aug 3 09:20:32 2020(r363794) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.cMon Aug 3 10:19:50 2020(r363795) @@ -397,10 +397,10 @@ int bcm2835_mbox_property(void *msg, size_t msg_size) { struct bcm_mbox_softc *sc; - struct msg_set_power_state *buf; bus_dma_tag_t msg_tag; bus_dmamap_t msg_map; bus_addr_t msg_phys; + char *buf; uint32_t reg; device_t mbox; int err; @@ -468,6 +468,26 @@ bcm2835_mbox_set_power_state(uint32_t device_id, boole } int +bcm2835_mbox_notify_xhci_reset(uint32_t pci_dev_addr) +{ + struct msg_notify_xhci_reset msg; + int err; + + memset(&msg, 0, sizeof(msg)); + msg.hdr.buf_size = sizeof(msg); + msg.hdr.code = BCM2835_MBOX_CODE_REQ; + msg.tag_hdr.tag = BCM2835_MBOX_TAG_NOTIFY_XHCI_RESET; + msg.tag_hdr.val_buf_size = sizeof(msg.body); + msg.tag_hdr.val_len = sizeof(msg.body.req); + msg.body.req.pci_device_addr = pci_dev_addr; + msg.end_tag = 0; + + err = bcm2835_mbox_property(&msg, sizeof(msg)); + + return (err); +} + +int bcm2835_mbox_get_clock_rate(uint32_t clock_id, uint32_t *hz) { struct msg_get_clock_rate msg; @@ -572,3 +592,4 @@ bcm2835_mbox_fb_init(struct bcm2835_fb_config *fb) return (err); } + Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h == --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Mon Aug 3 09:20:32 2020(r363794) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Mon Aug 3 10:19:50 2020(r363795) @@ -112,6 +112,24 @@ struct msg_set_power_state { /* Sets the power state for a given device */ int bcm2835_mbox_set_power_state(uint32_t, boolean_t); +#define BCM2835_MBOX_TAG_NOTIFY_XHCI_RESET 0x00030058 + +struct msg_notify_xhci_reset { + struct bcm2835_mbox_hdr hdr; + struct bcm2835_mbox_tag_hdr tag_hdr; + union { + struct { + uint32_t pci_device_addr; + } req; + struct { + } resp; + } body; + uint32_t end_tag; +}; + +/* Prompts the VideoCore processor to reload the xhci firmware. */ +int bcm2835_mbox_notify_xhci_reset(uint32_t); + #define BCM2835_MBOX_CLOCK_ID_EMMC 0x0001 #define BCM2838_MBOX_CLOCK_ID_EMMC20x000c Added: head/sys/arm/broadcom/bcm2835/bcm2838_xhci.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2838_xhci.cMon Aug 3 10:19:50 2020(r363795) @@ -0,0 +1,217 @@ +/*- + * SPDX-License-Identifier: ISC + * + * Copyright (c) 2020 Dr Robert Harvey Crowston + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * + * $FreeBSD$ + * + */ + +/* + * VIA VL805 controller on the Raspberry Pi 4. + * The VL805 is a generic xhci controller. However, in the newer hardware + * revisions of the Raspberry Pi 4, it is incapable of loading its own firmware. + * Instead, the VideoCore GPU must load the firmware into the controller at the + * appropriate time. T
svn commit: r363794 - stable/11/sys/compat/linuxkpi/common/include/linux
Author: hselasky Date: Mon Aug 3 09:20:32 2020 New Revision: 363794 URL: https://svnweb.freebsd.org/changeset/base/363794 Log: MFC r363078: Implement the bitmap_subset() function in the LinuxKPI. This function checks if the bitmap pointed to by the first argument is a subset of the bitmap pointed to by the second argument. The function returns one on success and zero on failure. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/bitmap.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/bitmap.h == --- stable/11/sys/compat/linuxkpi/common/include/linux/bitmap.h Mon Aug 3 09:18:59 2020(r363793) +++ stable/11/sys/compat/linuxkpi/common/include/linux/bitmap.h Mon Aug 3 09:20:32 2020(r363794) @@ -243,6 +243,28 @@ bitmap_equal(const unsigned long *pa, return (1); } +static inline int +bitmap_subset(const unsigned long *pa, +const unsigned long *pb, unsigned size) +{ + const unsigned end = BIT_WORD(size); + const unsigned tail = size & (BITS_PER_LONG - 1); + unsigned i; + + for (i = 0; i != end; i++) { + if (pa[i] & ~pb[i]) + return (0); + } + + if (tail) { + const unsigned long mask = BITMAP_LAST_WORD_MASK(tail); + + if (pa[end] & ~pb[end] & mask) + return (0); + } + return (1); +} + static inline void bitmap_complement(unsigned long *dst, const unsigned long *src, const unsigned int size) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363793 - stable/12/sys/compat/linuxkpi/common/include/linux
Author: hselasky Date: Mon Aug 3 09:18:59 2020 New Revision: 363793 URL: https://svnweb.freebsd.org/changeset/base/363793 Log: MFC r363078: Implement the bitmap_subset() function in the LinuxKPI. This function checks if the bitmap pointed to by the first argument is a subset of the bitmap pointed to by the second argument. The function returns one on success and zero on failure. Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/bitmap.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/bitmap.h == --- stable/12/sys/compat/linuxkpi/common/include/linux/bitmap.h Mon Aug 3 09:15:38 2020(r363792) +++ stable/12/sys/compat/linuxkpi/common/include/linux/bitmap.h Mon Aug 3 09:18:59 2020(r363793) @@ -243,6 +243,28 @@ bitmap_equal(const unsigned long *pa, return (1); } +static inline int +bitmap_subset(const unsigned long *pa, +const unsigned long *pb, unsigned size) +{ + const unsigned end = BIT_WORD(size); + const unsigned tail = size & (BITS_PER_LONG - 1); + unsigned i; + + for (i = 0; i != end; i++) { + if (pa[i] & ~pb[i]) + return (0); + } + + if (tail) { + const unsigned long mask = BITMAP_LAST_WORD_MASK(tail); + + if (pa[end] & ~pb[end] & mask) + return (0); + } + return (1); +} + static inline void bitmap_complement(unsigned long *dst, const unsigned long *src, const unsigned int size) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363792 - in stable/11/sys: compat/linuxkpi/common/include/linux sys
Author: hselasky Date: Mon Aug 3 09:15:38 2020 New Revision: 363792 URL: https://svnweb.freebsd.org/changeset/base/363792 Log: MFC r363077: Implement the array_size() function in the LinuxKPI. This function basically multiplies its two arguments and returns SIZE_MAX if the result overflows the size_t type. Else the product of the two arguments is returned. Bump the FreeBSD_version to mitigate issues with existing implementation of array_size() in drm-devel-kmod. Discussed with: manu@ Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/overflow.h stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/overflow.h == --- stable/11/sys/compat/linuxkpi/common/include/linux/overflow.h Mon Aug 3 09:14:16 2020(r363791) +++ stable/11/sys/compat/linuxkpi/common/include/linux/overflow.h Mon Aug 3 09:15:38 2020(r363792) @@ -31,6 +31,9 @@ #ifndef __LINUX_OVERFLOW_H__ #define__LINUX_OVERFLOW_H__ +#include +#include + #ifndef__has_builtin #define__has_builtin(x)0 #endif @@ -45,6 +48,16 @@ #if __has_builtin(__builtin_mul_overflow) #define check_mul_overflow(a, b, c)\ __builtin_mul_overflow(a, b, c) + +static inline size_t +array_size(size_t x, size_t y) +{ + size_t retval; + + if (__builtin_mul_overflow(x, y, &retval)) + retval = SIZE_MAX; + return (retval); +} #else #error "Compiler does not support __builtin_mul_overflow" #endif Modified: stable/11/sys/sys/param.h == --- stable/11/sys/sys/param.h Mon Aug 3 09:14:16 2020(r363791) +++ stable/11/sys/sys/param.h Mon Aug 3 09:15:38 2020(r363792) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1104503 /* Master, propagated to newvers */ +#define __FreeBSD_version 1104504 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363791 - stable/11/sys/compat/linuxkpi/common/include/linux
Author: hselasky Date: Mon Aug 3 09:14:16 2020 New Revision: 363791 URL: https://svnweb.freebsd.org/changeset/base/363791 Log: MFC r361549: Add overflow.h to the LinuxKPI. Only add check_add_overflow and check_mul_overflow as those are the only two needed function by DRM v5.3. Both gcc and clang have builtin to do this check so use them directly but throw an error if the compiler/code checker doesn't support this builtin. Sponsored-by: The FreeBSD Foundation Reviewed by: hselsasky Differential Revision:https://reviews.freebsd.org/D25015 Added: stable/11/sys/compat/linuxkpi/common/include/linux/overflow.h - copied unchanged from r361549, head/sys/compat/linuxkpi/common/include/linux/overflow.h Modified: Directory Properties: stable/11/ (props changed) Copied: stable/11/sys/compat/linuxkpi/common/include/linux/overflow.h (from r361549, head/sys/compat/linuxkpi/common/include/linux/overflow.h) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/compat/linuxkpi/common/include/linux/overflow.h Mon Aug 3 09:14:16 2020(r363791, copy of r361549, head/sys/compat/linuxkpi/common/include/linux/overflow.h) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Emmanuel Vadot under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __LINUX_OVERFLOW_H__ +#define__LINUX_OVERFLOW_H__ + +#ifndef__has_builtin +#define__has_builtin(x)0 +#endif + +#if __has_builtin(__builtin_add_overflow) +#define check_add_overflow(a, b, c)\ + __builtin_add_overflow(a, b, c) +#else +#error "Compiler does not support __builtin_add_overflow" +#endif + +#if __has_builtin(__builtin_mul_overflow) +#define check_mul_overflow(a, b, c)\ + __builtin_mul_overflow(a, b, c) +#else +#error "Compiler does not support __builtin_mul_overflow" +#endif + +#endif /* __LINUX_OVERFLOW_H__ */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363790 - in stable/12/sys: compat/linuxkpi/common/include/linux sys
Author: hselasky Date: Mon Aug 3 09:13:06 2020 New Revision: 363790 URL: https://svnweb.freebsd.org/changeset/base/363790 Log: MFC r363077: Implement the array_size() function in the LinuxKPI. This function basically multiplies its two arguments and returns SIZE_MAX if the result overflows the size_t type. Else the product of the two arguments is returned. Bump the FreeBSD_version to mitigate issues with existing implementation of array_size() in drm-devel-kmod. Discussed with: manu@ Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/overflow.h stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/overflow.h == --- stable/12/sys/compat/linuxkpi/common/include/linux/overflow.h Mon Aug 3 09:11:10 2020(r363789) +++ stable/12/sys/compat/linuxkpi/common/include/linux/overflow.h Mon Aug 3 09:13:06 2020(r363790) @@ -31,6 +31,9 @@ #ifndef __LINUX_OVERFLOW_H__ #define__LINUX_OVERFLOW_H__ +#include +#include + #ifndef__has_builtin #define__has_builtin(x)0 #endif @@ -45,6 +48,16 @@ #if __has_builtin(__builtin_mul_overflow) #define check_mul_overflow(a, b, c)\ __builtin_mul_overflow(a, b, c) + +static inline size_t +array_size(size_t x, size_t y) +{ + size_t retval; + + if (__builtin_mul_overflow(x, y, &retval)) + retval = SIZE_MAX; + return (retval); +} #else #error "Compiler does not support __builtin_mul_overflow" #endif Modified: stable/12/sys/sys/param.h == --- stable/12/sys/sys/param.h Mon Aug 3 09:11:10 2020(r363789) +++ stable/12/sys/sys/param.h Mon Aug 3 09:13:06 2020(r363790) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1201520 /* Master, propagated to newvers */ +#define __FreeBSD_version 1201521 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r363789 - stable/12/sys/compat/linuxkpi/common/include/linux
Author: hselasky Date: Mon Aug 3 09:11:10 2020 New Revision: 363789 URL: https://svnweb.freebsd.org/changeset/base/363789 Log: MFC r361549: Add overflow.h to the LinuxKPI. Only add check_add_overflow and check_mul_overflow as those are the only two needed function by DRM v5.3. Both gcc and clang have builtin to do this check so use them directly but throw an error if the compiler/code checker doesn't support this builtin. Sponsored-by: The FreeBSD Foundation Reviewed by: hselsasky Differential Revision:https://reviews.freebsd.org/D25015 Added: stable/12/sys/compat/linuxkpi/common/include/linux/overflow.h - copied unchanged from r361549, head/sys/compat/linuxkpi/common/include/linux/overflow.h Modified: Directory Properties: stable/12/ (props changed) Copied: stable/12/sys/compat/linuxkpi/common/include/linux/overflow.h (from r361549, head/sys/compat/linuxkpi/common/include/linux/overflow.h) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/compat/linuxkpi/common/include/linux/overflow.h Mon Aug 3 09:11:10 2020(r363789, copy of r361549, head/sys/compat/linuxkpi/common/include/linux/overflow.h) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Emmanuel Vadot under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __LINUX_OVERFLOW_H__ +#define__LINUX_OVERFLOW_H__ + +#ifndef__has_builtin +#define__has_builtin(x)0 +#endif + +#if __has_builtin(__builtin_add_overflow) +#define check_add_overflow(a, b, c)\ + __builtin_add_overflow(a, b, c) +#else +#error "Compiler does not support __builtin_add_overflow" +#endif + +#if __has_builtin(__builtin_mul_overflow) +#define check_mul_overflow(a, b, c)\ + __builtin_mul_overflow(a, b, c) +#else +#error "Compiler does not support __builtin_mul_overflow" +#endif + +#endif /* __LINUX_OVERFLOW_H__ */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"