svn commit: r300947 - head/usr.sbin/rpcbind
Author: ngie Date: Sun May 29 07:01:12 2016 New Revision: 300947 URL: https://svnweb.freebsd.org/changeset/base/300947 Log: Staticize variables only used in rpcbind.c This is some low hanging fruit necessary for making this WARNS?= 6 clean MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpcbind/rpcbind.c Modified: head/usr.sbin/rpcbind/rpcbind.c == --- head/usr.sbin/rpcbind/rpcbind.c Sun May 29 06:46:17 2016 (r300946) +++ head/usr.sbin/rpcbind/rpcbind.c Sun May 29 07:01:12 2016 (r300947) @@ -85,7 +85,7 @@ rpcblist_ptr list_rbl;/* A list of vers #define RPCBINDDLOCK "/var/run/rpcbind.lock" -int runasdaemon = 0; +static int runasdaemon = 0; int insecure = 0; int oldstyle_local = 0; #ifdef LIBWRAP @@ -93,12 +93,12 @@ int libwrap = 0; #endif int verboselog = 0; -char **hosts = NULL; -struct sockaddr **bound_sa; -int ipv6_only = 0; -int nhosts = 0; -int on = 1; -int rpcbindlockfd; +static char **hosts = NULL; +static struct sockaddr **bound_sa; +static int ipv6_only = 0; +static int nhosts = 0; +static int on = 1; +static int rpcbindlockfd; #ifdef WARMSTART /* Local Variable */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300925 - in head: contrib/libxo contrib/libxo/doc contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved lib/libxo
Author: phil Date: Sun May 29 01:43:28 2016 New Revision: 300925 URL: https://svnweb.freebsd.org/changeset/base/300925 Log: Submitted by: phil Reviewed by: sjg (mentor) Approved by: sjg Modified: head/contrib/libxo/configure.ac head/contrib/libxo/doc/libxo-manual.html head/contrib/libxo/doc/libxo.txt head/contrib/libxo/libxo/libxo.c head/contrib/libxo/libxo/xo_buf.h head/contrib/libxo/libxo/xo_encoder.c head/contrib/libxo/libxo/xo_format.5 head/contrib/libxo/tests/core/saved/test_03.E.out head/contrib/libxo/tests/core/saved/test_03.H.out head/contrib/libxo/tests/core/saved/test_03.HIPx.out head/contrib/libxo/tests/core/saved/test_03.HP.out head/contrib/libxo/tests/core/saved/test_03.J.out head/contrib/libxo/tests/core/saved/test_03.JP.out head/contrib/libxo/tests/core/saved/test_03.T.out head/contrib/libxo/tests/core/saved/test_03.X.out head/contrib/libxo/tests/core/saved/test_03.XP.out head/contrib/libxo/tests/core/test_03.c head/lib/libxo/add.man head/lib/libxo/xo_config.h Directory Properties: head/contrib/libxo/ (props changed) Modified: head/contrib/libxo/configure.ac == --- head/contrib/libxo/configure.ac Sun May 29 01:40:48 2016 (r300924) +++ head/contrib/libxo/configure.ac Sun May 29 01:43:28 2016 (r300925) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [0.6.1], [p...@juniper.net]) +AC_INIT([libxo], [0.6.2], [p...@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. Modified: head/contrib/libxo/doc/libxo-manual.html == --- head/contrib/libxo/doc/libxo-manual.htmlSun May 29 01:40:48 2016 (r300924) +++ head/contrib/libxo/doc/libxo-manual.htmlSun May 29 01:43:28 2016 (r300925) @@ -515,7 +515,7 @@ li.indline1 { } @top-right { - content: "April 2016"; + content: "May 2016"; } @top-center { @@ -22009,7 +22009,7 @@ jQuery(function ($) { -April 15, 2016 +May 28, 2016 libxo: The Easy Way to Generate text, XML, JSON, and HTML outputlibxo-manual @@ -22739,7 +22739,7 @@ jQuery(function ($) { make make test sudo make install -The following sections will walk thru each of these steps with additional details and options, but the above directions should be all that's needed. +The following sections will walk through each of these steps with additional details and options, but the above directions should be all that's needed. Section Contents: Section�1.1.2.1 @@ -23087,7 +23087,7 @@ jQuery(function ($) { xo_emit("{L:Free}{D::}{P: }{:free/%u} {U:Blocks}\n", free_blocks); When a role is not provided, the "value" role is used as the default. -Roles and modifiers can also use more verbose names, when preceeded by a comma: +Roles and modifiers can also use more verbose names, when preceded by a comma: EXAMPLE: xo_emit("{,label:Free}{,decoration::}{,padding: }" @@ -23444,7 +23444,7 @@ jQuery(function ($) { -Roles and modifiers can also use more verbose names, when preceeded by a comma. For example, the modifier string "Lwc" (or "L,white,colon") means the field has a label role (text that describes the next field) and should be followed by a colon ('c') and a space ('w'). The modifier string "Vkq" (or ":key,quote") means the field has a value role (the default role), that it is a key for the current instance, and that the value should be quoted when encoded for JSON. +Roles and modifiers can also use more verbose names, when preceded by a comma. For example, the modifier string "Lwc" (or "L,white,colon") means the field has a label role (text that describes the next field) and should be followed by a colon ('c') and a space ('w'). The modifier string "Vkq" (or ":key,quote") means the field has a value role (the default role), that it is a key for the current instance, and that the value should be quoted when encoded for JSON. Section Contents: Section�2.2.2.1 @@ -23688,7 +23688,7 @@ jQuery(function ($) { a '#' character, indicating the output value should be prefixed with '0x', typically to indicate a base 16 (hex) value. a minus sign ('‑'), indicating the output value should be padded on the right instead of the left. a leading zero ('0') indicating the output value should be padded on the left with zeroes instead of spaces (' '). -one or more digits ('0' - '9') indicating the minimum width of the argument. If the width in columns of the output value is less that the minumum width, the value will be padded to reach the minimum. +one or more digits ('0' - '9') indicating the minimum width of the argument. If the width in columns of the output value is less than the minimum width, the value wi
Re: svn commit: r300931 - head/etc/rc.d
> On May 28, 2016, at 19:59, Garrett Cooper wrote: > > Author: ngie > Date: Sun May 29 02:59:03 2016 > New Revision: 300931 > URL: https://svnweb.freebsd.org/changeset/base/300931 > > Log: > Make netif REQUIRE hostid > > As noted in the PR, if etc/rc.d/zvol is removed, netif will be run before > hostid, and the MAC address generated for any bridge devices will be > non-deterministic. Make the MAC address generated be deterministic for > bridge devices by explicitly REQUIRE'ing hostid. > > This fixes up the rest of the PR, inadvertently committed in r299844 > > MFC after: 1 week > PR: 195188 Reported by: Guy Yur signature.asc Description: Message signed with OpenPGP using GPGMail
Re: svn commit: r300922 - head/etc/mtree
> On May 28, 2016, at 18:45, Bryan Drewery wrote: > > On 5/28/16 6:39 PM, Ngie Cooper (yaneurabeya) wrote: >> >>> On May 28, 2016, at 18:38, Garrett Cooper wrote: >>> >>> Author: ngie >>> Date: Sun May 29 01:38:12 2016 >>> New Revision: 300922 >>> URL: https://svnweb.freebsd.org/changeset/base/300922 >>> >>> Log: >>> Fix "make installworld" with MK_CDDL == no after r300906 by >> >> This should read, "!= no" >_>.. > > Pointyhat to: ngie For the commit message, yeah... signature.asc Description: Message signed with OpenPGP using GPGMail
svn commit: r300951 - head/sys/arm/arm
Author: mmel Date: Sun May 29 07:39:56 2016 New Revision: 300951 URL: https://svnweb.freebsd.org/changeset/base/300951 Log: ARM GIC: Allow to setup interrupt without configuration data. In some cases, like for PCI devices, only interrupt numbers are enumerated from HW. In this case, use INTR_foo_CONFORM as level and trigger values. Modified: head/sys/arm/arm/gic.c Modified: head/sys/arm/arm/gic.c == --- head/sys/arm/arm/gic.c Sun May 29 07:29:35 2016(r300950) +++ head/sys/arm/arm/gic.c Sun May 29 07:39:56 2016(r300951) @@ -1128,8 +1128,11 @@ arm_gic_setup_intr(device_t dev, struct if (gi->gi_irq != irq) return (EINVAL); - } else - return (ENOTSUP); + } else { + irq = gi->gi_irq; + pol = INTR_POLARITY_CONFORM; + trig = INTR_TRIGGER_CONFORM; + } /* Compare config if this is not first setup. */ if (isrc->isrc_handlers != 0) { ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300934 - head/usr.sbin/rpcbind
Author: ngie Date: Sun May 29 04:02:02 2016 New Revision: 300934 URL: https://svnweb.freebsd.org/changeset/base/300934 Log: Plug leak with ifp by calling freeifaddrs after calling getifaddrs MFC after: 1 week Obtained from: NetBSD v1.18 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpcbind/util.c Modified: head/usr.sbin/rpcbind/util.c == --- head/usr.sbin/rpcbind/util.cSun May 29 03:44:37 2016 (r300933) +++ head/usr.sbin/rpcbind/util.cSun May 29 04:02:02 2016 (r300934) @@ -393,6 +393,7 @@ network_init(void) if (debugging) perror("setsockopt v6 multicast"); } + freeifaddrs(ifp); #endif /* close(s); */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r300932 - head/usr.sbin/rpcbind
On 5/28/2016 8:42 PM, Garrett Cooper wrote: > Author: ngie > Date: Sun May 29 03:42:50 2016 > New Revision: 300932 > URL: https://svnweb.freebsd.org/changeset/base/300932 > > Log: > Catch malloc(3) errors and socket(2) errors > > - malloc failing will result in a delayed segfault > - socket failing will result in delayed failures with setsockopt > > Exit in the event that either of these high-level conditions are met. > > Reported by: Coverity > CID: 976288, 976321, 976858 > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/usr.sbin/rpcbind/util.c > > Modified: head/usr.sbin/rpcbind/util.c > == > --- head/usr.sbin/rpcbind/util.c Sun May 29 02:59:03 2016 > (r300931) > +++ head/usr.sbin/rpcbind/util.c Sun May 29 03:42:50 2016 > (r300932) > @@ -336,6 +336,7 @@ network_init(void) > if (local_in4 == NULL) { > if (debugging) > fprintf(stderr, "can't alloc local ip4 addr\n"); > + exit(1); > } > memcpy(local_in4, res->ai_addr, sizeof *local_in4); > } > @@ -351,6 +352,7 @@ network_init(void) > if (local_in6 == NULL) { > if (debugging) > fprintf(stderr, "can't alloc local ip6 addr\n"); > + exit(1); Did something meaningful get printed before this on hitting this error, without debug? > } > memcpy(local_in6, res->ai_addr, sizeof *local_in6); > } > @@ -365,6 +367,11 @@ network_init(void) > inet_pton(AF_INET6, RPCB_MULTICAST_ADDR, &mreq6.ipv6mr_multiaddr); > > s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); > + if (s == -1) { > + if (debugging) > + fprintf(stderr, "couldn't create ip6 socket"); > + exit(1); > + } > > /* >* Loop through all interfaces. For each IPv6 multicast-capable > -- Regards, Bryan Drewery signature.asc Description: OpenPGP digital signature
svn commit: r300935 - head/usr.sbin/rpc.statd
Author: ngie Date: Sun May 29 04:18:47 2016 New Revision: 300935 URL: https://svnweb.freebsd.org/changeset/base/300935 Log: Mark out_of_mem(..) and usage(..) with __dead2 as they both directly call exit as a hint to static analysis tools MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpc.statd/statd.c Modified: head/usr.sbin/rpc.statd/statd.c == --- head/usr.sbin/rpc.statd/statd.c Sun May 29 04:02:02 2016 (r300934) +++ head/usr.sbin/rpc.statd/statd.c Sun May 29 04:18:47 2016 (r300935) @@ -72,9 +72,9 @@ static intcreate_service(struct netconf static voidcomplete_service(struct netconfig *nconf, char *port_str); static voidclearout_service(void); static void handle_sigchld(int sig); -void out_of_mem(void); +void out_of_mem(void) __dead2; -static void usage(void); +static void usage(void) __dead2; int main(int argc, char **argv) @@ -613,7 +613,7 @@ clearout_service(void) } static void -usage() +usage(void) { fprintf(stderr, "usage: rpc.statd [-d] [-h ] [-p ]\n"); exit(1); @@ -647,7 +647,7 @@ static void handle_sigchld(int sig __unu * Out of memory, fatal */ void -out_of_mem() +out_of_mem(void) { syslog(LOG_ERR, "out of memory"); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r300926 - head
On 5/28/16 6:45 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Sun May 29 01:45:15 2016 > New Revision: 300926 > URL: https://svnweb.freebsd.org/changeset/base/300926 > > Log: > Libcompat: Set build tools in environment rather than make overrides. > Sigh. I just realized this breaks the build for users who put CC= in their make.conf. I'm just going to revert all of work leading up to this and implement the original fix differently. > This allows the CXX hack in r300917 for external GCC to work for > the lib32 build. It is also the same pattern as the native > build uses by adding the tools into CROSSENV for external > toolchain, rather than make overrides. > > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/Makefile.libcompat > > Modified: head/Makefile.libcompat > == > --- head/Makefile.libcompat Sun May 29 01:43:28 2016(r300925) > +++ head/Makefile.libcompat Sun May 29 01:45:15 2016(r300926) > @@ -17,7 +17,7 @@ LIB32CPUFLAGS= -march=${TARGET_CPUTYPE} > .endif > LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \ > MACHINE_CPU="i686 mmx sse sse2" > -LIB32WMAKEFLAGS= \ > +LIB32WMAKEENV+= \ > AS="${XAS} --32" \ > LD="${XLD} -m elf_i386_fbsd -Y P,${LIBCOMPATTMP}/usr/lib32" \ > OBJCOPY="${XOBJCOPY}" > @@ -29,7 +29,7 @@ LIB32CPUFLAGS= -mcpu=powerpc > LIB32CPUFLAGS= -mcpu=${TARGET_CPUTYPE} > .endif > LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc > -LIB32WMAKEFLAGS= \ > +LIB32WMAKEENV+= \ > LD="${XLD} -m elf32ppc_fbsd" \ > OBJCOPY="${XOBJCOPY}" > .endif > @@ -84,9 +84,11 @@ LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${L > # Don't rebuild build-tools targets during normal build. > LIBCOMPATWMAKEENV+= BUILD_TOOLS_META=.NOMETA_CMP > .endif > -LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \ > +LIBCOMPATWMAKEENV+= \ > + CC="${XCC} ${LIBCOMPATCFLAGS}" \ > CXX="${XCXX} ${LIBCOMPATCFLAGS} ${LIBCOMPATCXXFLAGS}" \ > - CPP="${XCPP} ${LIBCOMPATCFLAGS}" \ > + CPP="${XCPP} ${LIBCOMPATCFLAGS}" > +LIBCOMPATWMAKEFLAGS+= \ > DESTDIR=${LIBCOMPATTMP} \ > -DNO_CPU_CFLAGS \ > MK_CTF=no \ > -- Regards, Bryan Drewery ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300941 - head/usr.sbin/rpcbind
Author: ngie Date: Sun May 29 05:55:21 2016 New Revision: 300941 URL: https://svnweb.freebsd.org/changeset/base/300941 Log: Don't leak res in network_init(..) Call freeaddrinfo on it after it's been used MFC after: 1 week Reported by: Coverity CID: 1225050 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpcbind/util.c Modified: head/usr.sbin/rpcbind/util.c == --- head/usr.sbin/rpcbind/util.cSun May 29 04:56:48 2016 (r300940) +++ head/usr.sbin/rpcbind/util.cSun May 29 05:55:21 2016 (r300941) @@ -396,6 +396,7 @@ network_init(void) freeifaddrs(ifp); #endif + freeaddrinfo(res); /* close(s); */ } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300939 - head/bin/ls/tests
Author: ngie Date: Sun May 29 04:50:49 2016 New Revision: 300939 URL: https://svnweb.freebsd.org/changeset/base/300939 Log: Use require.progs with bc instead of require.files with /usr/bin/bc This will make things more flexible if the program path changes in the future, and the test in and of itself doesn't call /usr/bin/bc -- it just calls bc MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/bin/ls/tests/ls_tests.sh Modified: head/bin/ls/tests/ls_tests.sh == --- head/bin/ls/tests/ls_tests.sh Sun May 29 04:47:10 2016 (r300938) +++ head/bin/ls/tests/ls_tests.sh Sun May 29 04:50:49 2016 (r300939) @@ -535,7 +535,7 @@ atf_test_case h_flag h_flag_head() { atf_set "descr" "Verify that -h prints out the humanized units for file sizes with ls -l" - atf_set "require.files" "/usr/bin/bc" + atf_set "require.progs" "bc" } h_flag_body() ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300942 - head/usr.sbin/rpcbind
Author: ngie Date: Sun May 29 06:01:18 2016 New Revision: 300942 URL: https://svnweb.freebsd.org/changeset/base/300942 Log: Remove a useless if (x != NULL) check before calling free on allocated_uaddr MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpcbind/check_bound.c Modified: head/usr.sbin/rpcbind/check_bound.c == --- head/usr.sbin/rpcbind/check_bound.c Sun May 29 05:55:21 2016 (r300941) +++ head/usr.sbin/rpcbind/check_bound.c Sun May 29 06:01:18 2016 (r300942) @@ -219,8 +219,7 @@ mergeaddr(SVCXPRT *xprt, char *netid, ch fprintf(stderr, "mergeaddr: uaddr = %s, merged uaddr = %s\n", uaddr, m_uaddr); #endif - if (allocated_uaddr != NULL) - free(allocated_uaddr); + free(allocated_uaddr); return (m_uaddr); } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300940 - head/tools/build/mk
Author: ngie Date: Sun May 29 04:56:48 2016 New Revision: 300940 URL: https://svnweb.freebsd.org/changeset/base/300940 Log: Remove yacc and the yacc tests if MK_TOOLCHAIN == no yacc's install is conditional based on MK_TOOLCHAIN != no MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc == --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 29 04:50:49 2016(r300939) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 29 04:56:48 2016(r300940) @@ -8009,6 +8009,7 @@ OLD_FILES+=usr/share/man/man1/ul.1.gz .if ${MK_TOOLCHAIN} == no OLD_FILES+=usr/bin/addr2line OLD_FILES+=usr/bin/as +OLD_FILES+=usr/bin/byacc OLD_FILES+=usr/bin/cc OLD_FILES+=usr/bin/c88 OLD_FILES+=usr/bin/c++ @@ -8020,6 +8021,7 @@ OLD_FILES+=usr/bin/readelf OLD_FILES+=usr/bin/size OLD_FILES+=usr/bin/strings OLD_FILES+=usr/bin/strip +OLD_FILES+=usr/bin/yacc OLD_FILES+=usr/share/man/man1/addr2line.1.gz OLD_FILES+=usr/share/man/man1/c++filt.1.gz OLD_FILES+=usr/share/man/man1/nm.1.gz @@ -8031,6 +8033,314 @@ OLD_FILES+=usr/share/man/man1/strip.1.gz OLD_FILES+=usr/bin/objcopy OLD_FILES+=usr/share/man/man1/objcopy.1.gz .endif +OLD_FILES+=usr/tests/usr.bin/yacc/Kyuafile +OLD_FILES+=usr/tests/usr.bin/yacc/btyacc_calc1.y +OLD_FILES+=usr/tests/usr.bin/yacc/btyacc_demo.y +OLD_FILES+=usr/tests/usr.bin/yacc/calc.y +OLD_FILES+=usr/tests/usr.bin/yacc/calc1.y +OLD_FILES+=usr/tests/usr.bin/yacc/calc2.y +OLD_FILES+=usr/tests/usr.bin/yacc/calc3.y +OLD_FILES+=usr/tests/usr.bin/yacc/code_calc.y +OLD_FILES+=usr/tests/usr.bin/yacc/code_debug.y +OLD_FILES+=usr/tests/usr.bin/yacc/code_error.y +OLD_FILES+=usr/tests/usr.bin/yacc/empty.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_inherit1.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_inherit2.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_inherit3.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_inherit4.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_inherit5.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax1.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax10.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax11.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax12.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax13.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax14.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax15.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax16.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax17.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax18.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax19.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax2.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax20.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax21.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax22.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax23.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax24.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax25.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax26.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax27.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax3.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax4.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax5.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax6.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax7.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax7a.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax7b.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax8.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax8a.y +OLD_FILES+=usr/tests/usr.bin/yacc/err_syntax9.y +OLD_FILES+=usr/tests/usr.bin/yacc/error.y +OLD_FILES+=usr/tests/usr.bin/yacc/grammar.y +OLD_FILES+=usr/tests/usr.bin/yacc/inherit0.y +OLD_FILES+=usr/tests/usr.bin/yacc/inherit1.y +OLD_FILES+=usr/tests/usr.bin/yacc/inherit2.y +OLD_FILES+=usr/tests/usr.bin/yacc/ok_syntax1.y +OLD_FILES+=usr/tests/usr.bin/yacc/pure_calc.y +OLD_FILES+=usr/tests/usr.bin/yacc/pure_error.y +OLD_FILES+=usr/tests/usr.bin/yacc/quote_calc.y +OLD_FILES+=usr/tests/usr.bin/yacc/quote_calc2.y +OLD_FILES+=usr/tests/usr.bin/yacc/quote_calc3.y +OLD_FILES+=usr/tests/usr.bin/yacc/quote_calc4.y +OLD_FILES+=usr/tests/usr.bin/yacc/run_test +OLD_FILES+=usr/tests/usr.bin/yacc/varsyntax_calc1.y +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/big_b.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/big_b.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/big_l.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/big_l.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc1.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc1.output +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc1.tab.c +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc1.tab.h +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc2.error +OLD_FILES+=usr/tests/usr.bin/yacc/yacc/calc2.output
svn commit: r300944 - head
Author: bdrewery Date: Sun May 29 06:20:36 2016 New Revision: 300944 URL: https://svnweb.freebsd.org/changeset/base/300944 Log: Libcompat: Swap CXX/CFLAGS. This is the same as done for the native build in r300770 to ensure that the libc++ build reads from SYSROOT/usr/include/c++/v1 before reading from SYSROOT/usr/include. Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat == --- head/Makefile.libcompat Sun May 29 06:20:15 2016(r300943) +++ head/Makefile.libcompat Sun May 29 06:20:36 2016(r300944) @@ -92,7 +92,7 @@ LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${L LIBCOMPATWMAKEENV+=BUILD_TOOLS_META=.NOMETA_CMP .endif LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \ - CXX="${XCXX} ${LIBCOMPATCFLAGS} ${LIBCOMPATCXXFLAGS}" \ + CXX="${XCXX} ${LIBCOMPATCXXFLAGS} ${LIBCOMPATCFLAGS}" \ CPP="${XCPP} ${LIBCOMPATCFLAGS}" \ DESTDIR=${LIBCOMPATTMP} \ -DNO_CPU_CFLAGS \ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300943 - in head: . lib/libc++ lib/libcxxrt share/mk
Author: bdrewery Date: Sun May 29 06:20:15 2016 New Revision: 300943 URL: https://svnweb.freebsd.org/changeset/base/300943 Log: GCC External: Revert r300886, r300904, r300917, r300918 The fix in r300873 is mostly enough. A fix for lib32 will be committed.separately. Modified: head/Makefile.inc1 head/Makefile.libcompat head/lib/libc++/Makefile head/lib/libcxxrt/Makefile head/share/mk/bsd.compiler.mk head/share/mk/bsd.sys.mk Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Sun May 29 06:01:18 2016(r300942) +++ head/Makefile.inc1 Sun May 29 06:20:15 2016(r300943) @@ -527,7 +527,13 @@ TARGET_ABI=gnueabihf TARGET_ABI=gnueabi .endif .endif -.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == "clang" +.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc +# GCC requires -isystem and -L when using a cross-compiler. +XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib +# Force using libc++ for external GCC. +XCXXFLAGS+=-isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \ + -nostdinc++ -L${WORLDTMP}/../lib/libc++ +.else TARGET_ABI?= unknown TARGET_TRIPLE?=${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0 XCFLAGS+= -target ${TARGET_TRIPLE} Modified: head/Makefile.libcompat == --- head/Makefile.libcompat Sun May 29 06:01:18 2016(r300942) +++ head/Makefile.libcompat Sun May 29 06:20:15 2016(r300943) @@ -17,7 +17,7 @@ LIB32CPUFLAGS=-march=${TARGET_CPUTYPE} .endif LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \ MACHINE_CPU="i686 mmx sse sse2" -LIB32WMAKEENV+=\ +LIB32WMAKEFLAGS= \ AS="${XAS} --32" \ LD="${XLD} -m elf_i386_fbsd -Y P,${LIBCOMPATTMP}/usr/lib32" \ OBJCOPY="${XOBJCOPY}" @@ -29,7 +29,7 @@ LIB32CPUFLAGS=-mcpu=powerpc LIB32CPUFLAGS= -mcpu=${TARGET_CPUTYPE} .endif LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc -LIB32WMAKEENV+=\ +LIB32WMAKEFLAGS= \ LD="${XLD} -m elf32ppc_fbsd" \ OBJCOPY="${XOBJCOPY}" .endif @@ -72,6 +72,13 @@ LIBCOMPATCFLAGS+=${LIBCOMPATCPUFLAGS} \ # -B is needed to find /usr/lib32/crti.o for GCC and /usr/libsoft/crti.o for # Clang/GCC. LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat} +.if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc +# GCC requires -isystem when using a cross-compiler. +LIBCOMPATCFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include +# Force using libc++ for external GCC. +LIBCOMPATCXXFLAGS+=-isystem ${LIBCOMPATTMP}/usr/include/c++/v1 -std=c++11 \ + -nostdinc++ -L${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc++ +.endif # Yes, the flags are redundant. LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${LIBCOMPAT_OBJTREE} \ @@ -84,11 +91,9 @@ LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${L # Don't rebuild build-tools targets during normal build. LIBCOMPATWMAKEENV+=BUILD_TOOLS_META=.NOMETA_CMP .endif -LIBCOMPATWMAKEENV+= \ - CC="${XCC} ${LIBCOMPATCFLAGS}" \ +LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \ CXX="${XCXX} ${LIBCOMPATCFLAGS} ${LIBCOMPATCXXFLAGS}" \ - CPP="${XCPP} ${LIBCOMPATCFLAGS}" -LIBCOMPATWMAKEFLAGS+= \ + CPP="${XCPP} ${LIBCOMPATCFLAGS}" \ DESTDIR=${LIBCOMPATTMP} \ -DNO_CPU_CFLAGS \ MK_CTF=no \ Modified: head/lib/libc++/Makefile == --- head/lib/libc++/MakefileSun May 29 06:01:18 2016(r300942) +++ head/lib/libc++/MakefileSun May 29 06:20:15 2016(r300943) @@ -63,7 +63,7 @@ cxxrt_${_S}: ${_LIBCXXRTDIR}/${_S} .NOME .endfor WARNS= 0 -CFLAGS+= -I${HDRDIR} -I${_LIBCXXRTDIR} -nostdinc++ -nostdlib -DLIBCXXRT +CFLAGS+= -isystem ${HDRDIR} -isystem ${_LIBCXXRTDIR} -nostdinc++ -nostdlib -DLIBCXXRT .if empty(CXXFLAGS:M-std=*) CXXFLAGS+= -std=c++11 .endif Modified: head/lib/libcxxrt/Makefile == --- head/lib/libcxxrt/Makefile Sun May 29 06:01:18 2016(r300942) +++ head/lib/libcxxrt/Makefile Sun May 29 06:20:15 2016(r300943) @@ -21,7 +21,7 @@ SRCS+=libelftc_dem_gnu3.c\ guard.cc WARNS= 0 -CFLAGS+= -I${SRCDIR} -nostdinc++ +CFLAGS+= -isystem ${SRCDIR} -nostdinc++ .if empty(CXXFLAGS:M-std=*) CXXFLAGS+= -std=c++11 .endif Modified: head/share/mk/bsd.compiler.mk == --- head/share/mk/bsd.compiler.mk Sun May 29 06:01:18 2016 (r300942) +++ head/share/mk/bsd.compiler.mk Sun May 29 06:20:15 2016 (r300943) @@ -108,10
svn commit: r300949 - head/sys/netpfil/ipfw
Author: truckman Date: Sun May 29 07:23:56 2016 New Revision: 300949 URL: https://svnweb.freebsd.org/changeset/base/300949 Log: Cast some expressions that multiply a long long constant by a floating point constant to int64_t. This avoids the runtime conversion of the the other operand in a set of comparisons from int64_t to floating point and doing the comparisions in floating point. Suggested by: lidl Submitted by: Rasool Al-Saadi MFC after:2 weeks (with r300779) Modified: head/sys/netpfil/ipfw/dn_aqm_pie.c head/sys/netpfil/ipfw/dn_sched_fq_pie.c Modified: head/sys/netpfil/ipfw/dn_aqm_pie.c == --- head/sys/netpfil/ipfw/dn_aqm_pie.c Sun May 29 07:14:51 2016 (r300948) +++ head/sys/netpfil/ipfw/dn_aqm_pie.c Sun May 29 07:23:56 2016 (r300949) @@ -244,17 +244,17 @@ calculate_drop_prob(void *x) p *= (PIE_MAX_PROB << 12) / AQM_TIME_1S; /* auto-tune drop probability */ - if (prob< PIE_MAX_PROB * 0.01) + if (prob < (int64_t)(PIE_MAX_PROB * 0.01)) p >>= 11 + PIE_FIX_POINT_BITS+12; - else if (prob < PIE_MAX_PROB * 0.1) + else if (prob < (int64_t)(PIE_MAX_PROB * 0.1)) p >>= 9 + PIE_FIX_POINT_BITS+12; - else if (prob < PIE_MAX_PROB * 0.0001) + else if (prob < (int64_t)(PIE_MAX_PROB * 0.0001)) p >>= 7 + PIE_FIX_POINT_BITS+12; - else if (prob < PIE_MAX_PROB * 0.001) + else if (prob < (int64_t)(PIE_MAX_PROB * 0.001)) p >>= 5 + PIE_FIX_POINT_BITS+12; - elseif (prob < PIE_MAX_PROB * 0.01) + elseif (prob < (int64_t)(PIE_MAX_PROB * 0.01)) p >>= 3 + PIE_FIX_POINT_BITS+12; - else if (prob < PIE_MAX_PROB * 0.1) + else if (prob < (int64_t)(PIE_MAX_PROB * 0.1)) p >>= 1 + PIE_FIX_POINT_BITS+12; else p >>= PIE_FIX_POINT_BITS+12; Modified: head/sys/netpfil/ipfw/dn_sched_fq_pie.c == --- head/sys/netpfil/ipfw/dn_sched_fq_pie.c Sun May 29 07:14:51 2016 (r300948) +++ head/sys/netpfil/ipfw/dn_sched_fq_pie.c Sun May 29 07:23:56 2016 (r300949) @@ -407,17 +407,17 @@ fq_calculate_drop_prob(void *x) p *= (PIE_MAX_PROB << 12) / AQM_TIME_1S; /* auto-tune drop probability */ - if (prob< PIE_MAX_PROB * 0.01) + if (prob < (int64_t)(PIE_MAX_PROB * 0.01)) p >>= 11 + PIE_FIX_POINT_BITS+12; - else if (prob < PIE_MAX_PROB * 0.1) + else if (prob < (int64_t)(PIE_MAX_PROB * 0.1)) p >>= 9 + PIE_FIX_POINT_BITS+12; - else if (prob < PIE_MAX_PROB * 0.0001) + else if (prob < (int64_t)(PIE_MAX_PROB * 0.0001)) p >>= 7 + PIE_FIX_POINT_BITS+12; - else if (prob < PIE_MAX_PROB * 0.001) + else if (prob < (int64_t)(PIE_MAX_PROB * 0.001)) p >>= 5 + PIE_FIX_POINT_BITS+12; - elseif (prob < PIE_MAX_PROB * 0.01) + elseif (prob < (int64_t)(PIE_MAX_PROB * 0.01)) p >>= 3 + PIE_FIX_POINT_BITS+12; - else if (prob < PIE_MAX_PROB * 0.1) + else if (prob < (int64_t)(PIE_MAX_PROB * 0.1)) p >>= 1 + PIE_FIX_POINT_BITS+12; else p >>= PIE_FIX_POINT_BITS+12; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300945 - head/usr.sbin/rpcbind
Author: ngie Date: Sun May 29 06:29:22 2016 New Revision: 300945 URL: https://svnweb.freebsd.org/changeset/base/300945 Log: Remove unnecessary caller_uaddr != NULL test before calling free on it MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpcbind/util.c Modified: head/usr.sbin/rpcbind/util.c == --- head/usr.sbin/rpcbind/util.cSun May 29 06:20:36 2016 (r300944) +++ head/usr.sbin/rpcbind/util.cSun May 29 06:29:22 2016 (r300945) @@ -293,8 +293,7 @@ found: ret = taddr2uaddr(nconf, &tbuf); freeit: - if (caller_uaddr != NULL) - free(caller_uaddr); + free(caller_uaddr); if (hint_nbp != NULL) { free(hint_nbp->buf); free(hint_nbp); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r300935 - head/usr.sbin/rpc.statd
On Sun, 29 May 2016, Garrett Cooper wrote: Log: Mark out_of_mem(..) and usage(..) with __dead2 as they both directly call exit as a hint to static analysis tools This is bogus for usage() since it is static so only very broken static analyis tools can't see its full details. Modified: head/usr.sbin/rpc.statd/statd.c == --- head/usr.sbin/rpc.statd/statd.c Sun May 29 04:02:02 2016 (r300934) +++ head/usr.sbin/rpc.statd/statd.c Sun May 29 04:18:47 2016 (r300935) @@ -72,9 +72,9 @@ static intcreate_service(struct netconf static void complete_service(struct netconfig *nconf, char *port_str); static void clearout_service(void); static void handle_sigchld(int sig); -void out_of_mem(void); +void out_of_mem(void) __dead2; This is even more bogus: - out_of_mem() is public, and this adds __dead2 in the one place that clearly doesn't need it - the declarartions are unsorted internally and externally. Prototypes for public functions belong in a header file. Some are already there, but this one is unsorted into the middle of static ones - however, perhaps this function should be static. It is only directly referenced in this file. I don't know if it is also referenced in some other utility or rpc generated code. If so, then these are probably missing the __dead2. -static void usage(void); +static void usage(void) __dead2; There are also many lexical (indentation) style bugs near here, in all of the newer prototypes starting with handle_sigchld(). int main(int argc, char **argv) @@ -613,7 +613,7 @@ clearout_service(void) } static void -usage() +usage(void) Perhaps Coverity was just complaining about this K&R definition. No change was needed, since there is a prototype in scope. Bruce ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r300949 - head/sys/netpfil/ipfw
On Sun, 29 May 2016, Don Lewis wrote: Log: Cast some expressions that multiply a long long constant by a floating point constant to int64_t. This avoids the runtime conversion of the the other operand in a set of comparisons from int64_t to floating point and doing the comparisions in floating point. Suggested by: lidl Submitted by: Rasool Al-Saadi MFC after: 2 weeks (with r300779) Compilers are still permitted to (and perhaps even required to) evaluate FP constant expressions at runtime (to get rounding and/or exception flags right). They probably don't in practice, but it is unclear what happens for -O0 and the rules for rounding are too hard to understand. Modified: head/sys/netpfil/ipfw/dn_aqm_pie.c == --- head/sys/netpfil/ipfw/dn_aqm_pie.c Sun May 29 07:14:51 2016 (r300948) +++ head/sys/netpfil/ipfw/dn_aqm_pie.c Sun May 29 07:23:56 2016 (r300949) @@ -244,17 +244,17 @@ calculate_drop_prob(void *x) p *= (PIE_MAX_PROB << 12) / AQM_TIME_1S; /* auto-tune drop probability */ - if (prob< PIE_MAX_PROB * 0.01) + if (prob < (int64_t)(PIE_MAX_PROB * 0.01)) p >>= 11 + PIE_FIX_POINT_BITS+12; + else if (prob < (int64_t)(PIE_MAX_PROB * 0.1)) p >>= 9 + PIE_FIX_POINT_BITS+12; Why not just divide by integer powers of 10? This might not give a suitably monotonic/continuous scaling at the endpoints, but it is unclear if the FP gives that either even if we are more careful with the rounding mode. A table of endpoints could be used to get precise control. Then FP can be used more safely, since it is clear that constants in tables must be evaluated at compile time. ... Similarly for all cases. Bruce ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300922 - head/etc/mtree
Author: ngie Date: Sun May 29 01:38:12 2016 New Revision: 300922 URL: https://svnweb.freebsd.org/changeset/base/300922 Log: Fix "make installworld" with MK_CDDL == no after r300906 by adding a missing entry for ${TESTSBASE}/cddl/sbin X-MFC with: r300906 Pointyhat to: asomers Reported by: Shawn Webb Sponsored by: EMC / Isilon Storage Division Modified: head/etc/mtree/BSD.tests.dist Modified: head/etc/mtree/BSD.tests.dist == --- head/etc/mtree/BSD.tests.dist Sun May 29 01:15:36 2016 (r300921) +++ head/etc/mtree/BSD.tests.dist Sun May 29 01:38:12 2016 (r300922) @@ -48,6 +48,8 @@ cddl lib .. +sbin +.. usr.bin .. usr.sbin ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r300922 - head/etc/mtree
On 5/28/16 6:39 PM, Ngie Cooper (yaneurabeya) wrote: > >> On May 28, 2016, at 18:38, Garrett Cooper wrote: >> >> Author: ngie >> Date: Sun May 29 01:38:12 2016 >> New Revision: 300922 >> URL: https://svnweb.freebsd.org/changeset/base/300922 >> >> Log: >> Fix "make installworld" with MK_CDDL == no after r300906 by > > This should read, "!= no" >_>.. > Pointyhat to: ngie -- Regards, Bryan Drewery signature.asc Description: OpenPGP digital signature
svn commit: r300926 - head
Author: bdrewery Date: Sun May 29 01:45:15 2016 New Revision: 300926 URL: https://svnweb.freebsd.org/changeset/base/300926 Log: Libcompat: Set build tools in environment rather than make overrides. This allows the CXX hack in r300917 for external GCC to work for the lib32 build. It is also the same pattern as the native build uses by adding the tools into CROSSENV for external toolchain, rather than make overrides. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat == --- head/Makefile.libcompat Sun May 29 01:43:28 2016(r300925) +++ head/Makefile.libcompat Sun May 29 01:45:15 2016(r300926) @@ -17,7 +17,7 @@ LIB32CPUFLAGS=-march=${TARGET_CPUTYPE} .endif LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \ MACHINE_CPU="i686 mmx sse sse2" -LIB32WMAKEFLAGS= \ +LIB32WMAKEENV+=\ AS="${XAS} --32" \ LD="${XLD} -m elf_i386_fbsd -Y P,${LIBCOMPATTMP}/usr/lib32" \ OBJCOPY="${XOBJCOPY}" @@ -29,7 +29,7 @@ LIB32CPUFLAGS=-mcpu=powerpc LIB32CPUFLAGS= -mcpu=${TARGET_CPUTYPE} .endif LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc -LIB32WMAKEFLAGS= \ +LIB32WMAKEENV+=\ LD="${XLD} -m elf32ppc_fbsd" \ OBJCOPY="${XOBJCOPY}" .endif @@ -84,9 +84,11 @@ LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${L # Don't rebuild build-tools targets during normal build. LIBCOMPATWMAKEENV+=BUILD_TOOLS_META=.NOMETA_CMP .endif -LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \ +LIBCOMPATWMAKEENV+= \ + CC="${XCC} ${LIBCOMPATCFLAGS}" \ CXX="${XCXX} ${LIBCOMPATCFLAGS} ${LIBCOMPATCXXFLAGS}" \ - CPP="${XCPP} ${LIBCOMPATCFLAGS}" \ + CPP="${XCPP} ${LIBCOMPATCFLAGS}" +LIBCOMPATWMAKEFLAGS+= \ DESTDIR=${LIBCOMPATTMP} \ -DNO_CPU_CFLAGS \ MK_CTF=no \ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300931 - head/etc/rc.d
Author: ngie Date: Sun May 29 02:59:03 2016 New Revision: 300931 URL: https://svnweb.freebsd.org/changeset/base/300931 Log: Make netif REQUIRE hostid As noted in the PR, if etc/rc.d/zvol is removed, netif will be run before hostid, and the MAC address generated for any bridge devices will be non-deterministic. Make the MAC address generated be deterministic for bridge devices by explicitly REQUIRE'ing hostid. This fixes up the rest of the PR, inadvertently committed in r299844 MFC after: 1 week PR: 195188 Sponsored by: EMC / Isilon Storage Division Modified: head/etc/rc.d/netif Modified: head/etc/rc.d/netif == --- head/etc/rc.d/netif Sun May 29 02:24:51 2016(r300930) +++ head/etc/rc.d/netif Sun May 29 02:59:03 2016(r300931) @@ -27,7 +27,7 @@ # PROVIDE: netif # REQUIRE: FILESYSTEMS iovctl serial sppp sysctl -# REQUIRE: ipfilter ipfs +# REQUIRE: hostid ipfilter ipfs # KEYWORD: nojailvnet . /etc/rc.subr ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300932 - head/usr.sbin/rpcbind
Author: ngie Date: Sun May 29 03:42:50 2016 New Revision: 300932 URL: https://svnweb.freebsd.org/changeset/base/300932 Log: Catch malloc(3) errors and socket(2) errors - malloc failing will result in a delayed segfault - socket failing will result in delayed failures with setsockopt Exit in the event that either of these high-level conditions are met. Reported by: Coverity CID: 976288, 976321, 976858 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpcbind/util.c Modified: head/usr.sbin/rpcbind/util.c == --- head/usr.sbin/rpcbind/util.cSun May 29 02:59:03 2016 (r300931) +++ head/usr.sbin/rpcbind/util.cSun May 29 03:42:50 2016 (r300932) @@ -336,6 +336,7 @@ network_init(void) if (local_in4 == NULL) { if (debugging) fprintf(stderr, "can't alloc local ip4 addr\n"); + exit(1); } memcpy(local_in4, res->ai_addr, sizeof *local_in4); } @@ -351,6 +352,7 @@ network_init(void) if (local_in6 == NULL) { if (debugging) fprintf(stderr, "can't alloc local ip6 addr\n"); + exit(1); } memcpy(local_in6, res->ai_addr, sizeof *local_in6); } @@ -365,6 +367,11 @@ network_init(void) inet_pton(AF_INET6, RPCB_MULTICAST_ADDR, &mreq6.ipv6mr_multiaddr); s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); + if (s == -1) { + if (debugging) + fprintf(stderr, "couldn't create ip6 socket"); + exit(1); + } /* * Loop through all interfaces. For each IPv6 multicast-capable ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300936 - head/tools/build/mk
Author: ngie Date: Sun May 29 04:39:20 2016 New Revision: 300936 URL: https://svnweb.freebsd.org/changeset/base/300936 Log: Remove the calendar tests if MK_CALENDAR == no when "make delete-old" is run MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc == --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 29 04:18:47 2016(r300935) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 29 04:39:20 2016(r300936) @@ -851,6 +851,39 @@ OLD_FILES+=usr/share/calendar/uk_UA.KOI8 OLD_DIRS+=usr/share/calendar/uk_UA.KOI8-U OLD_DIRS+=usr/share/calendar OLD_FILES+=usr/share/man/man1/calendar.1.gz +OLD_FILES+=usr/tests/usr.bin/calendar/Kyuafile +OLD_FILES+=usr/tests/usr.bin/calendar/calendar.calibrate +OLD_FILES+=usr/tests/usr.bin/calendar/legacy_test +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.a5.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.b5.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.s1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.s2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.s3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.s4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.sh +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-5.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-6.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.w0-7.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-1.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-2.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-3.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-4.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-5.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-6.out +OLD_FILES+=usr/tests/usr.bin/calendar/regress.wn-7.out +OLD_DIRS+=usr/tests/usr.bin/calendar .endif .if ${MK_CASPER} == no ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300937 - head/tools/build/mk
Author: ngie Date: Sun May 29 04:43:24 2016 New Revision: 300937 URL: https://svnweb.freebsd.org/changeset/base/300937 Log: Remove the etcupdate tests if MK_RCS == no when "make delete-old" is run etcupdate is conditionally installed based on MK_RCS != no today MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc == --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 29 04:39:20 2016(r300936) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun May 29 04:43:24 2016(r300937) @@ -6792,6 +6792,15 @@ OLD_FILES+=usr/share/man/man1/rcsmerge.1 OLD_FILES+=usr/share/man/man1/rlog.1.gz OLD_FILES+=usr/share/man/man5/rcsfile.5.gz OLD_FILES+=usr/share/man/man8/etcupdate.8.gz +OLD_FILES+=usr/tests/usr.sbin/etcupdate/Kyuafile +OLD_FILES+=usr/tests/usr.sbin/etcupdate/always_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/conflicts_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/fbsdid_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/ignore_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/preworld_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/tests_test +OLD_FILES+=usr/tests/usr.sbin/etcupdate/tzsetup_test +OLD_DIRS+=usr/tests/usr.sbin/etcupdate .endif #.if ${MK_RESCUE} == no ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300950 - in head/sys: conf modules/dummynet
Author: truckman Date: Sun May 29 07:29:35 2016 New Revision: 300950 URL: https://svnweb.freebsd.org/changeset/base/300950 Log: Now that PIE is free of runtime floating point, revert r300853 to reconnect PIE to the build. Modified: head/sys/conf/files head/sys/modules/dummynet/Makefile Modified: head/sys/conf/files == --- head/sys/conf/files Sun May 29 07:23:56 2016(r300949) +++ head/sys/conf/files Sun May 29 07:29:35 2016(r300950) @@ -3824,9 +3824,11 @@ netnatm/natm.c optional natm netnatm/natm_pcb.c optional natm netnatm/natm_proto.c optional natm netpfil/ipfw/dn_aqm_codel.coptional inet dummynet +netpfil/ipfw/dn_aqm_pie.c optional inet dummynet netpfil/ipfw/dn_heap.c optional inet dummynet netpfil/ipfw/dn_sched_fifo.c optional inet dummynet netpfil/ipfw/dn_sched_fq_codel.c optional inet dummynet +netpfil/ipfw/dn_sched_fq_pie.c optional inet dummynet netpfil/ipfw/dn_sched_prio.c optional inet dummynet netpfil/ipfw/dn_sched_qfq.coptional inet dummynet netpfil/ipfw/dn_sched_rr.c optional inet dummynet Modified: head/sys/modules/dummynet/Makefile == --- head/sys/modules/dummynet/Makefile Sun May 29 07:23:56 2016 (r300949) +++ head/sys/modules/dummynet/Makefile Sun May 29 07:29:35 2016 (r300950) @@ -4,9 +4,9 @@ KMOD= dummynet SRCS= ip_dummynet.c SRCS+= ip_dn_glue.c ip_dn_io.c -SRCS+= dn_aqm_codel.c +SRCS+= dn_aqm_codel.c dn_aqm_pie.c SRCS+= dn_heap.c dn_sched_fifo.c dn_sched_qfq.c dn_sched_rr.c dn_sched_wf2q.c -SRCS+= dn_sched_prio.c dn_sched_fq_codel.c +SRCS+= dn_sched_prio.c dn_sched_fq_codel.c dn_sched_fq_pie.c SRCS+= opt_inet6.h .include ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r300935 - head/usr.sbin/rpc.statd
Hi Bruce, Garrett, 2016-05-29 9:31 GMT+02:00 Bruce Evans : > On Sun, 29 May 2016, Garrett Cooper wrote: > >> Log: >> Mark out_of_mem(..) and usage(..) with __dead2 as they both directly call >> exit >> as a hint to static analysis tools > > This is bogus for usage() since it is static so only very broken static > analyis tools can't see its full details. Exactly. I think it's important to keep in mind what the intent of this attribute is: to pass compiler optimization state across compilation units. For static functions, this has absolutely no meaning. Also, as we already live in the year 2016, please use the following construct in case you really want to mark this function as no-return: #include static noreturn void usage(void) { ... } In public header files where you likely don't want to pollute the namespace, use _Noreturn instead. Thanks, -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300952 - head/usr.sbin/services_mkdb
Author: ed Date: Sun May 29 10:41:27 2016 New Revision: 300952 URL: https://svnweb.freebsd.org/changeset/base/300952 Log: Invoke the dirname() function in a POSIX compliant way. POSIX requires that the argument of dirname() is of type "char *". In other words, the input buffer can be modified by the function to store the directory name. Pull a copy of the string before calling dirname(). We don't care about freeing up the memory afterwards, as this is done at the very bottom of main(), right before the program terminates. Reviewed by: bapt Differential Revision:https://reviews.freebsd.org/D6628 Modified: head/usr.sbin/services_mkdb/services_mkdb.c Modified: head/usr.sbin/services_mkdb/services_mkdb.c == --- head/usr.sbin/services_mkdb/services_mkdb.c Sun May 29 07:39:56 2016 (r300951) +++ head/usr.sbin/services_mkdb/services_mkdb.c Sun May 29 10:41:27 2016 (r300952) @@ -92,7 +92,7 @@ main(int argc, char *argv[]) size_t cnt = 0; StringList *sl, ***svc; size_t port, proto; - char *dbname_dir; + char *dbname_dir, *dbname_dirbuf; int dbname_dir_fd = -1; setprogname(argv[0]); @@ -172,7 +172,8 @@ main(int argc, char *argv[]) * fsync() to the directory where file lies */ if (rename(tname, dbname) == -1 || - (dbname_dir = dirname(dbname)) == NULL || + (dbname_dirbuf = strdup(dbname)) == NULL || + (dbname_dir = dirname(dbname_dirbuf)) == NULL || (dbname_dir_fd = open(dbname_dir, O_RDONLY|O_DIRECTORY)) == -1 || fsync(dbname_dir_fd) != 0) { if (dbname_dir_fd != -1) ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300953 - head/lib/libc/stdlib
Author: ache Date: Sun May 29 11:54:09 2016 New Revision: 300953 URL: https://svnweb.freebsd.org/changeset/base/300953 Log: 1) Unifdef USE_WEAK_SEEDING it is too obsolete to support and makes reading harder. 2) ACM paper require seed to be in [1, 2^31-2] range, so use the same range shifting as already done for rand(3). Also protect srandomdev() + TYPE_0 case (non default) from negative seeds. 3) Don't check for valid "type" range in setstate(), it is always valid as calculated. Instead add a check that rear pointer not exceeed end pointer. MFC after: 1 week Modified: head/lib/libc/stdlib/random.c Modified: head/lib/libc/stdlib/random.c == --- head/lib/libc/stdlib/random.c Sun May 29 10:41:27 2016 (r300952) +++ head/lib/libc/stdlib/random.c Sun May 29 11:54:09 2016 (r300953) @@ -137,11 +137,7 @@ __FBSDID("$FreeBSD$"); */ #defineMAX_TYPES 5 /* max number of types above */ -#ifdef USE_WEAK_SEEDING -#define NSHUFF 0 -#else /* !USE_WEAK_SEEDING */ #define NSHUFF 50 /* to drop some "seed -> 1st value" linearity */ -#endif /* !USE_WEAK_SEEDING */ static const int degrees[MAX_TYPES] = { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 }; static const int seps [MAX_TYPES] ={ SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 }; @@ -162,23 +158,12 @@ static const int seps [MAX_TYPES] = { SE static uint32_t randtbl[DEG_3 + 1] = { TYPE_3, -#ifdef USE_WEAK_SEEDING -/* Historic implementation compatibility */ -/* The random sequences do not vary much with the seed */ - 0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342, 0xde3b81e0, 0xdf0a6fb5, - 0xf103bc02, 0x48f340fb, 0x7449e56b, 0xbeb1dbb0, 0xab5c5918, 0x946554fd, - 0x8c2e680f, 0xeb3d799f, 0xb11ee0b7, 0x2d436b86, 0xda672e2a, 0x1588ca88, - 0xe369735d, 0x904f35f7, 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc, - 0x36413f93, 0xc622c298, 0xf5a42ab8, 0x8a88d77b, 0xf5ad9d0e, 0x8999220b, - 0x27fb47b9, -#else /* !USE_WEAK_SEEDING */ - 0x991539b1, 0x16a5bce3, 0x6774a4cd, 0x3e01511e, 0x4e508aaa, 0x61048c05, - 0xf5500617, 0x846b7115, 0x6a19892c, 0x896a97af, 0xdb48f936, 0x14898454, - 0x37ffd106, 0xb58bff9c, 0x59e17104, 0xcf918a49, 0x09378c83, 0x52c7a471, - 0x8d293ea9, 0x1f4fc301, 0xc3db71be, 0x39b44e1c, 0xf8a44ef9, 0x4c8b80b1, - 0x19edc328, 0x87bf4bdd, 0xc9b240e5, 0xe9ee4b1b, 0x4382aee7, 0x535b6b41, - 0xf3bec5da -#endif /* !USE_WEAK_SEEDING */ + 0x2cf41758, 0x27bb3711, 0x4916d4d1, 0x7b02f59f, 0x9b8e28eb, 0xc0e80269, + 0x696f5c16, 0x878f1ff5, 0x52d9c07f, 0x916a06cd, 0xb50b3a20, 0x2776970a, + 0xee4eb2a6, 0xe94640ec, 0xb1d65612, 0x9d1ed968, 0x1043f6b7, 0xa3432a76, + 0x17eacbb9, 0x3c09e2eb, 0x4f8c2b3, 0x708a1f57, 0xee341814, 0x95d0e4d2, + 0xb06f216c, 0x8bd2e72e, 0x8f7c38d7, 0xcfc6a8fc, 0x2a59495, 0xa20d2a69, + 0xe29d12d1 }; /* @@ -215,16 +200,8 @@ static int rand_sep = SEP_3; static uint32_t *end_ptr = &randtbl[DEG_3 + 1]; static inline uint32_t -good_rand(int32_t x) +good_rand(uint32_t ctx) { -#ifdef USE_WEAK_SEEDING -/* - * Historic implementation compatibility. - * The random sequences do not vary much with the seed, - * even with overflowing. - */ - return (1103515245 * x + 12345); -#else /* !USE_WEAK_SEEDING */ /* * Compute x = (7^5 * x) mod (2^31 - 1) * wihout overflowing 31 bits: @@ -233,18 +210,17 @@ good_rand(int32_t x) * Park and Miller, Communications of the ACM, vol. 31, no. 10, * October 1988, p. 1195. */ - int32_t hi, lo; + int32_t hi, lo, x; - /* Can't be initialized with 0, so use another value. */ - if (x == 0) - x = 123459876; + /* Transform to [1, 0x7ffe] range. */ + x = (ctx % 0x7ffe) + 1; hi = x / 127773; lo = x % 127773; x = 16807 * lo - 2836 * hi; if (x < 0) x += 0x7fff; - return (x); -#endif /* !USE_WEAK_SEEDING */ + /* Transform to [0, 0x7ffd] range. */ + return (x - 1); } /* @@ -404,16 +380,8 @@ setstate(char *arg_state) uint32_t rear = new_state[0] / MAX_TYPES; char *ostate = (char *)(&state[-1]); - switch(type) { - case TYPE_0: - case TYPE_1: - case TYPE_2: - case TYPE_3: - case TYPE_4: - break; - default: + if (type != TYPE_0 && rear >= degrees[type]) return (NULL); - } if (rand_type == TYPE_0) state[-1] = rand_type; else @@ -455,7 +423,7 @@ random(void) if (rand_type == TYPE_0) { i = state[0]; - state[0] = i = (good_rand(i)) & 0x7fff; + state[0] = i = good_rand(i); } else { /* * Use local variables rather than static variables for speed.
svn commit: r300955 - head/include
Author: ed Date: Sun May 29 12:21:54 2016 New Revision: 300955 URL: https://svnweb.freebsd.org/changeset/base/300955 Log: Fix style of the libgen.h header. - Remove unneeded declarations of removed/unimplemented features. - Add missing tab after #define. - Add missing ! before trailing comment. Modified: head/include/libgen.h Modified: head/include/libgen.h == --- head/include/libgen.h Sun May 29 12:16:58 2016(r300954) +++ head/include/libgen.h Sun May 29 12:21:54 2016(r300955) @@ -29,22 +29,14 @@ */ #ifndef _LIBGEN_H_ -#define _LIBGEN_H_ +#define_LIBGEN_H_ #include __BEGIN_DECLS - char *basename(const char *); char *basename_r(const char *, char *); char *dirname(const char *); -#if 0 -char *regcmp(const char *, ...); -char *regex(const char *, const char *, ...); - -extern char *__loc1; -#endif - __END_DECLS -#endif /* _LIBGEN_H_ */ +#endif /* !_LIBGEN_H_ */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300956 - head/lib/libc/stdlib
Author: ache Date: Sun May 29 13:57:06 2016 New Revision: 300956 URL: https://svnweb.freebsd.org/changeset/base/300956 Log: 1) Unifdef USE_WEAK_SEEDING since it is too obsolete to support and makes reading hard. 2) Instead of doing range transformation in each and every function here, do it single time directly in do_rand(). One "mod" operation overhead is not a big deal, but the code looks nicer and possible future functions additions or PRNG change do not miss range transformations neither have unneeded ones. 3) Use POSIX argument types for visible functions (cosmetic). MFC after: 1 week Modified: head/lib/libc/stdlib/rand.c Modified: head/lib/libc/stdlib/rand.c == --- head/lib/libc/stdlib/rand.c Sun May 29 12:21:54 2016(r300955) +++ head/lib/libc/stdlib/rand.c Sun May 29 13:57:06 2016(r300956) @@ -48,14 +48,6 @@ __FBSDID("$FreeBSD$"); static int do_rand(unsigned long *ctx) { -#ifdef USE_WEAK_SEEDING -/* - * Historic implementation compatibility. - * The random sequences do not vary much with the seed, - * even with overflowing. - */ - return ((*ctx = *ctx * 1103515245 + 12345) % ((u_long)RAND_MAX + 1)); -#else /* !USE_WEAK_SEEDING */ /* * Compute x = (7^5 * x) mod (2^31 - 1) * without overflowing 31 bits: @@ -66,48 +58,34 @@ do_rand(unsigned long *ctx) */ long hi, lo, x; - /* Must be in [1, 0x7ffe] range at this point. */ - hi = *ctx / 127773; - lo = *ctx % 127773; + /* Transform to [1, 0x7ffe] range. */ + x = (*ctx % 0x7ffe) + 1; + hi = x / 127773; + lo = x % 127773; x = 16807 * lo - 2836 * hi; if (x < 0) x += 0x7fff; - *ctx = x; /* Transform to [0, 0x7ffd] range. */ - return (x - 1); -#endif /* !USE_WEAK_SEEDING */ + x--; + *ctx = x; + return (x); } int -rand_r(unsigned int *ctx) +rand_r(unsigned *ctx) { u_long val; int r; -#ifdef USE_WEAK_SEEDING val = *ctx; -#else - /* Transform to [1, 0x7ffe] range. */ - val = (*ctx % 0x7ffe) + 1; -#endif r = do_rand(&val); - -#ifdef USE_WEAK_SEEDING - *ctx = (unsigned int)val; -#else - *ctx = (unsigned int)(val - 1); -#endif + *ctx = (unsigned)val; return (r); } -static u_long next = -#ifdef USE_WEAK_SEEDING -1; -#else -2; -#endif +static u_long next = 1; int rand(void) @@ -116,13 +94,9 @@ rand(void) } void -srand(u_int seed) +srand(unsigned seed) { next = seed; -#ifndef USE_WEAK_SEEDING - /* Transform to [1, 0x7ffe] range. */ - next = (next % 0x7ffe) + 1; -#endif } @@ -144,10 +118,6 @@ sranddev(void) mib[0] = CTL_KERN; mib[1] = KERN_ARND; sysctl(mib, 2, (void *)&next, &len, NULL, 0); -#ifndef USE_WEAK_SEEDING - /* Transform to [1, 0x7ffe] range. */ - next = (next % 0x7ffe) + 1; -#endif } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300957 - head/lib/libc/sys
Author: jilles Date: Sun May 29 14:16:23 2016 New Revision: 300957 URL: https://svnweb.freebsd.org/changeset/base/300957 Log: _umtx_op(2),thr_*(2): Various spelling, grammar and mdoc fixes. Modified: head/lib/libc/sys/_umtx_op.2 head/lib/libc/sys/thr_exit.2 head/lib/libc/sys/thr_kill.2 head/lib/libc/sys/thr_new.2 head/lib/libc/sys/thr_self.2 head/lib/libc/sys/thr_set_name.2 Modified: head/lib/libc/sys/_umtx_op.2 == --- head/lib/libc/sys/_umtx_op.2Sun May 29 13:57:06 2016 (r300956) +++ head/lib/libc/sys/_umtx_op.2Sun May 29 14:16:23 2016 (r300957) @@ -257,7 +257,7 @@ are defined, in addition to the common f .It Dv URWLOCK_PREFER_READER If specified, immediately grant read lock requests when .Dv urwlock -is already read-locked, even in presence of the unsatisfied write +is already read-locked, even in presence of unsatisfied write lock requests. By default, if there is a write lock waiter, further read requests are not granted, to prevent unfair write lock waiter starvation. @@ -387,7 +387,7 @@ variant which returns an error rather th be obtained. Also, .Fn _umtx_op -provides requests which explicitely put the thread to sleep. +provides requests which explicitly put the thread to sleep. .Pp Wakes need to know which threads to make runnable, so sleeping threads are grouped into containers called @@ -399,12 +399,12 @@ Note that the .Em physical address is used, which means that same variable mapped multiple times will give one key value. -This mechanism enables the construction of the +This mechanism enables the construction of .Em process-shared locks. .Pp A related attribute of the key is shareability. -Some requests always interpet keys as private for the current process, +Some requests always interpret keys as private for the current process, creating sleep queues with the scope of the current process even if the memory is shared. Others either select the shareability automatically from the @@ -435,7 +435,8 @@ the queue are selected. The .Em robust umutexes are provided as a substrate for a userspace library to implement -POSIX robust mutexes. +.Tn POSIX +robust mutexes. A robust umutex must have the .Dv UMUTEX_ROBUST flag set. @@ -524,13 +525,13 @@ argument is compared with the If they are equal, the requesting thread is put to interruptible sleep until woken up or the optionally specified timeout expires. .Pp -The comparision and sleep are atomic. +The comparison and sleep are atomic. In other words, if another thread writes a new value to .Dv *obj and then issues .Dv UMTX_OP_WAKE , the request is guaranteed to not miss the wakeup, -which might otherwise happen between comparision and blocking. +which might otherwise happen between comparison and blocking. .Pp The physical address of memory where the .Fa *obj @@ -599,7 +600,7 @@ contention indicator, and provides the a lock entrance semantic. .Pp If the lock cannot be obtained immediately because another thread owns -the lock, the current thread is put into sleep, with +the lock, the current thread is put to sleep, with .Dv UMUTEX_CONTESTED bit set before. Upon wake up, the lock conditions are re-tested. @@ -668,7 +669,9 @@ New ceiling value. .It Fa uaddr Address of a variable of type .Vt uint32_t . -If not NULL, after the successful update the previous ceiling value is +If not +.Dv NULL +and the update was successful, the previous ceiling value is written to the location pointed to by .Fa uaddr . .El @@ -685,7 +688,9 @@ member of the after which the umutex is unlocked. .Pp The locking does not adhere to the priority protect protocol, -to confirm with the POSIX requirements for the +to conform to the +.Tn POSIX +requirements for the .Xr pthread_mutex_setprioceiling 3 interface. .It Dv UMTX_OP_CV_WAIT @@ -769,7 +774,8 @@ If the flag is supplied, the timeout specifies absolute time value, otherwise it denotes a relative time interval. .Pp -The request is not restartable. An unblocked signal delivered during +The request is not restartable. +An unblocked signal delivered during the wait always results in sleep interruption and .Er EINTR error. @@ -845,7 +851,7 @@ If the .Dv URWLOCK_WRITE_OWNER bit is set in the word .Dv rw_state , -the lock was granted to a writer which has not yet relinguished +the lock was granted to a writer which has not yet relinquished its ownership. In this case the current thread is put to sleep until it makes sense to retry. @@ -959,7 +965,7 @@ Same as .Dv UMTX_OP_WAKE , but unconditionally select the process-private sleep queue. .It Dv UMTX_OP_MUTEX_WAIT -Wait for the mutex availability. +Wait for mutex availability. The arguments to the request are: .Bl -tag -width "It Fa obj" .It Fa obj @@ -986,12 +992,12 @@ priority inherited protocol mutexes. Optionally, a timeout for the request may be specified. .Pp .Pp -The request with a t
svn commit: r300958 - head/lib/libc/sys
Author: jilles Date: Sun May 29 15:02:55 2016 New Revision: 300958 URL: https://svnweb.freebsd.org/changeset/base/300958 Log: _umtx_op(2): Note deprecation of UMTX_OP_MUTEX_WAKE. Modified: head/lib/libc/sys/_umtx_op.2 Modified: head/lib/libc/sys/_umtx_op.2 == --- head/lib/libc/sys/_umtx_op.2Sun May 29 14:16:23 2016 (r300957) +++ head/lib/libc/sys/_umtx_op.2Sun May 29 15:02:55 2016 (r300958) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 17, 2016 +.Dd May 29, 2016 .Dt _UMTX_OP 2 .Os .Sh NAME @@ -1041,6 +1041,20 @@ with the byte addressed by the if any. Only normal mutexes are supported by the request. The sleep queue is always one for a normal mutex type. +.Pp +This request is deprecated in favor of +.Dv UMTX_OP_MUTEX_WAKE2 +since mutexes using it cannot synchronize their own destruction. +That is, the +.Dv m_owner +word has already been set to +.Dv UMUTEX_UNOWNED +when this request is made, +so that another thread can lock, unlock and destroy the mutex +(if no other thread uses the mutex afterwards). +Clearing the +.Dv UMUTEX_CONTESTED +bit may then modify freed memory. .It Dv UMTX_OP_MUTEX_WAKE2 Check if a umutex is unlocked and wake up a waiter. The arguments for the request are: ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300959 - head/sys/vm
Author: kib Date: Sun May 29 15:46:19 2016 New Revision: 300959 URL: https://svnweb.freebsd.org/changeset/base/300959 Log: Do not leak the vm object lock when swap reservation failed, in vm_object_coalesce(). Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c == --- head/sys/vm/vm_object.c Sun May 29 15:02:55 2016(r300958) +++ head/sys/vm/vm_object.c Sun May 29 15:46:19 2016(r300959) @@ -2123,6 +2123,7 @@ vm_object_coalesce(vm_object_t prev_obje */ if (!reserved && !swap_reserve_by_cred(ptoa(next_size), prev_object->cred)) { + VM_OBJECT_WUNLOCK(prev_object); return (FALSE); } prev_object->charge += ptoa(next_size); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r300957 - head/lib/libc/sys
On Sun, May 29, 2016 at 02:16:24PM +, Jilles Tjoelker wrote: > Author: jilles > Date: Sun May 29 14:16:23 2016 > New Revision: 300957 > URL: https://svnweb.freebsd.org/changeset/base/300957 > > Log: > _umtx_op(2),thr_*(2): Various spelling, grammar and mdoc fixes. I must say thanks both to Ed Maste and to you for making my original text tolerable for the native English readers. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300960 - head/contrib/binutils/include
Author: ed Date: Sun May 29 16:10:01 2016 New Revision: 300960 URL: https://svnweb.freebsd.org/changeset/base/300960 Log: Replace local prototype of basename() with an inclusion of . libiberty currently defines the prototype for basename() itself instead of using . It still uses the BSD-style prototype instead of the POSIX one, meaning that if FreeBSD would switch over to the POSIX one, you wouldn't be able to use libiberty.h and libgen.h in a single source file. It turns out that kgdb does this. Patch up libiberty to just include . I'm currently talking to upstream to see whether we can come up with a more complete solution that could be integrated, but for our unmaintained copy of GDB in base, let's just apply the simplest workaround possible. Reviewed by: pfg Differential Revision:https://reviews.freebsd.org/D6631 Modified: head/contrib/binutils/include/libiberty.h Modified: head/contrib/binutils/include/libiberty.h == --- head/contrib/binutils/include/libiberty.h Sun May 29 15:46:19 2016 (r300959) +++ head/contrib/binutils/include/libiberty.h Sun May 29 16:10:01 2016 (r300960) @@ -102,7 +102,7 @@ extern int writeargv PARAMS ((char **, F is 1, we found it so don't provide any declaration at all. */ #if !HAVE_DECL_BASENAME #if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) || defined (HAVE_DECL_BASENAME) -extern char *basename (const char *); +#include #else /* Do not allow basename to be used if there is no prototype seen. We either need to use the above prototype or have one from ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r300914 - head/share/timedef
On Sat, May 28, 2016 at 09:26:50PM +, Baptiste Daroussin wrote: > New Revision: 300914 > URL: https://svnweb.freebsd.org/changeset/base/300914 > > Log: > Readd week day to default dates > > Requested by: many OK, so it means I no longer have to use LC_TIME=ja_JP.UTF-8 to get those? Nice, thank you. ./danfe ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300965 - head/lib/libc/stdlib
Author: ache Date: Sun May 29 16:39:28 2016 New Revision: 300965 URL: https://svnweb.freebsd.org/changeset/base/300965 Log: Micro optimize: C standard guarantees that right shift for unsigned value fills left bits with zero, and we have exact 32bit unsigned value (uint32_t), so there is no reason to add "& 0x7fff" here. MFC after: 1 week Modified: head/lib/libc/stdlib/random.c Modified: head/lib/libc/stdlib/random.c == --- head/lib/libc/stdlib/random.c Sun May 29 16:32:56 2016 (r300964) +++ head/lib/libc/stdlib/random.c Sun May 29 16:39:28 2016 (r300965) @@ -430,7 +430,7 @@ random(void) */ f = fptr; r = rptr; *f += *r; - i = (*f >> 1) & 0x7fff; /* chucking least random bit */ + i = *f >> 1;/* chucking least random bit */ if (++f >= end_ptr) { f = state; ++r; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r300952 - head/usr.sbin/services_mkdb
On Sun, May 29, 2016 at 4:41 AM, Ed Schouten wrote: > Author: ed > Date: Sun May 29 10:41:27 2016 > New Revision: 300952 > URL: https://svnweb.freebsd.org/changeset/base/300952 > > Log: > Invoke the dirname() function in a POSIX compliant way. > > POSIX requires that the argument of dirname() is of type "char *". In > other words, the input buffer can be modified by the function to store > the directory name. > > Pull a copy of the string before calling dirname(). We don't care about > freeing up the memory afterwards, as this is done at the very bottom of > main(), right before the program terminates. > > Reviewed by: bapt > Differential Revision:https://reviews.freebsd.org/D6628 > > Modified: > head/usr.sbin/services_mkdb/services_mkdb.c > > Modified: head/usr.sbin/services_mkdb/services_mkdb.c > == > --- head/usr.sbin/services_mkdb/services_mkdb.c Sun May 29 07:39:56 2016 > (r300951) > +++ head/usr.sbin/services_mkdb/services_mkdb.c Sun May 29 10:41:27 2016 > (r300952) > @@ -92,7 +92,7 @@ main(int argc, char *argv[]) > size_t cnt = 0; > StringList *sl, ***svc; > size_t port, proto; > - char *dbname_dir; > + char *dbname_dir, *dbname_dirbuf; > int dbname_dir_fd = -1; > > setprogname(argv[0]); > @@ -172,7 +172,8 @@ main(int argc, char *argv[]) > * fsync() to the directory where file lies > */ > if (rename(tname, dbname) == -1 || > - (dbname_dir = dirname(dbname)) == NULL || > + (dbname_dirbuf = strdup(dbname)) == NULL || > + (dbname_dir = dirname(dbname_dirbuf)) == NULL || > (dbname_dir_fd = open(dbname_dir, O_RDONLY|O_DIRECTORY)) == -1 || > fsync(dbname_dir_fd) != 0) { > if (dbname_dir_fd != -1) > Even though the program is about to exit, it's worth freeing the memory just to make Coverity shut up. -Alan ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300966 - head/sys/crypto/sha2
Author: cperciva Date: Sun May 29 17:26:40 2016 New Revision: 300966 URL: https://svnweb.freebsd.org/changeset/base/300966 Log: Retune SHA2 code for improved performance on CPUs with more ILP and a preference for memory load instructions over large code footprints with embedded immediate variables. On amd64 CPUs from 2007-2008 there is not a significant change, but amd64 CPUs from 2009-2010 get roughly 10% more throughput with this code; amd64 CPUs from 2011-2012 get roughly 15% more throughput; and AMD64 CPUs from 2013-2015 get 20-25% more throughput. The Raspberry Pi 2 increases its throughput by 6-8%. Sponsored by: Tarsnap Backup Inc. Performance tested by:allanjude MFC after:3 weeks Modified: head/sys/crypto/sha2/sha256c.c head/sys/crypto/sha2/sha512c.c Modified: head/sys/crypto/sha2/sha256c.c == --- head/sys/crypto/sha2/sha256c.c Sun May 29 16:39:28 2016 (r300965) +++ head/sys/crypto/sha2/sha256c.c Sun May 29 17:26:40 2016 (r300966) @@ -78,6 +78,26 @@ be32dec_vect(uint32_t *dst, const unsign #endif /* BYTE_ORDER != BIG_ENDIAN */ +/* SHA256 round constants. */ +static const uint32_t K[64] = { + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, + 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, + 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, + 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, + 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +}; + /* Elementary functions used by SHA256 */ #define Ch(x, y, z)((x & (y ^ z)) ^ z) #define Maj(x, y, z) ((x & (y | z)) | (y & z)) @@ -90,18 +110,21 @@ be32dec_vect(uint32_t *dst, const unsign /* SHA256 round function */ #define RND(a, b, c, d, e, f, g, h, k) \ - t0 = h + S1(e) + Ch(e, f, g) + k; \ - t1 = S0(a) + Maj(a, b, c); \ - d += t0;\ - h = t0 + t1; + h += S1(e) + Ch(e, f, g) + k; \ + d += h; \ + h += S0(a) + Maj(a, b, c); /* Adjusted round function for rotating state */ -#define RNDr(S, W, i, k) \ +#define RNDr(S, W, i, ii) \ RND(S[(64 - i) % 8], S[(65 - i) % 8], \ S[(66 - i) % 8], S[(67 - i) % 8], \ S[(68 - i) % 8], S[(69 - i) % 8], \ S[(70 - i) % 8], S[(71 - i) % 8], \ - W[i] + k) + W[i + ii] + K[i + ii]) + +/* Message schedule computation */ +#define MSCH(W, ii, i) \ + W[i + ii + 16] = s1(W[i + ii + 14]) + W[i + ii + 9] + s0(W[i + ii + 1]) + W[i + ii] /* * SHA256 block compression function. The 256-bit state is transformed via @@ -112,82 +135,52 @@ SHA256_Transform(uint32_t * state, const { uint32_t W[64]; uint32_t S[8]; - uint32_t t0, t1; int i; - /* 1. Prepare message schedule W. */ + /* 1. Prepare the first part of the message schedule W. */ be32dec_vect(W, block, 64); - for (i = 16; i < 64; i++) - W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16]; /* 2. Initialize working variables. */ memcpy(S, state, 32); /* 3. Mix. */ - RNDr(S, W, 0, 0x428a2f98); - RNDr(S, W, 1, 0x71374491); - RNDr(S, W, 2, 0xb5c0fbcf); - RNDr(S, W, 3, 0xe9b5dba5); - RNDr(S, W, 4, 0x3956c25b); - RNDr(S, W, 5, 0x59f111f1); - RNDr(S, W, 6, 0x923f82a4); - RNDr(S, W, 7, 0xab1c5ed5); - RNDr(S, W, 8, 0xd807aa98); - RNDr(S, W, 9, 0x12835b01); - RNDr(S, W, 10, 0x243185be); - RNDr(S, W, 11, 0x550c7dc3); - RNDr(S, W, 12, 0x72be5d74); - RNDr(S, W, 13, 0x80deb1fe); - RNDr(S, W, 14, 0x9bdc06a7); - RNDr(S, W, 15, 0xc19bf174); - RNDr(S, W, 16, 0xe49b69c1); - RNDr(S, W, 17, 0xefbe4786); - RNDr(S, W, 18, 0x0fc19dc6); - RNDr(S, W, 19, 0x240ca1cc); - RNDr(S, W, 20, 0x2de92c6f); - RNDr(S, W, 21, 0x4a7484aa); - RNDr(S, W, 22, 0x5cb0a9dc); - RNDr(S, W, 23, 0x76f988da); - RNDr(S, W, 24, 0x983e5152); - RNDr(S, W, 25, 0xa831c66d); - RNDr(S, W, 26, 0xb00327c8); - RNDr(S, W, 27, 0xbf597fc7); -
svn commit: r300967 - head/sys/sys
Author: dim Date: Sun May 29 17:32:19 2016 New Revision: 300967 URL: https://svnweb.freebsd.org/changeset/base/300967 Log: Stop exposing the C11 _Atomic() macro in , when compiling for C++. It clashes with the one in libc++'s header. (Previously, the _Atomic() macro was defined in , which is only for use with C11, but for various reasons it was moved to its current location in r251804.) Discussed with: bdrewery, ed MFC after:2 weeks Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h == --- head/sys/sys/cdefs.hSun May 29 17:26:40 2016(r300966) +++ head/sys/sys/cdefs.hSun May 29 17:32:19 2016(r300967) @@ -275,7 +275,8 @@ #define_Alignof(x) __alignof(x) #endif -#if !__has_extension(c_atomic) && !__has_extension(cxx_atomic) +#if !defined(__cplusplus) && !__has_extension(c_atomic) && \ +!__has_extension(cxx_atomic) /* * No native support for _Atomic(). Place object in structure to prevent * most forms of direct non-atomic access. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300968 - head/sys/arm/arm
Author: zbb Date: Sun May 29 17:33:49 2016 New Revision: 300968 URL: https://svnweb.freebsd.org/changeset/base/300968 Log: Fix debug_monitor code for older ARMs (ARM11) - Enable monitor mode prior to accessing watchpoint registers for v6, v6.1 architectures. - Fix configuration scheme for v6, v6.1 and v7 Debug Archs - Enable monitor unconditionally and for good instead of enabling and disabling it (needed for single stepping on on v6/v6.1) Tested on RPI-B and Arndale Differential Revision: https://reviews.freebsd.org/D6008 Modified: head/sys/arm/arm/debug_monitor.c Modified: head/sys/arm/arm/debug_monitor.c == --- head/sys/arm/arm/debug_monitor.cSun May 29 17:32:19 2016 (r300967) +++ head/sys/arm/arm/debug_monitor.cSun May 29 17:33:49 2016 (r300968) @@ -82,8 +82,6 @@ static boolean_t dbg_ossr;/* OS Save an static uint32_t dbg_watchpoint_num; static uint32_t dbg_breakpoint_num; -static int dbg_ref_count_mme; /* Times monitor mode was enabled */ - /* ID_DFR0 - Debug Feature Register 0 */ #defineID_DFR0_CP_DEBUG_M_SHIFT0 #defineID_DFR0_CP_DEBUG_M_MASK (0xF << ID_DFR0_CP_DEBUG_M_SHIFT) @@ -250,6 +248,13 @@ dbg_wb_write_reg(int reg, int n, uint32_ boolean_t kdb_cpu_pc_is_singlestep(db_addr_t pc) { + /* +* XXX: If the platform fails to enable its debug arch. +* there will be no stepping capabilities +* (SOFTWARE_SSTEP is not defined for __ARM_ARCH >= 6). +*/ + if (!dbg_capable) + return (FALSE); if (dbg_find_slot(DBG_TYPE_BREAKPOINT, pc) != ~0U) return (TRUE); @@ -265,6 +270,9 @@ kdb_cpu_set_singlestep(void) uint32_t wcr; u_int i; + if (!dbg_capable) + return; + /* * Disable watchpoints, e.g. stepping over watched instruction will * trigger break exception instead of single-step exception and locks @@ -295,6 +303,9 @@ kdb_cpu_clear_singlestep(void) uint32_t wvr, wcr; u_int i; + if (!dbg_capable) + return; + dbg_remove_breakpoint(DBG_BKPT_BT_SLOT); dbg_remove_breakpoint(DBG_BKPT_BNT_SLOT); @@ -572,34 +583,6 @@ dbg_enable_monitor(void) } static int -dbg_disable_monitor(void) -{ - uint32_t dbg_dscr; - - if (!dbg_monitor_is_enabled()) - return (0); - - dbg_dscr = cp14_dbgdscrint_get(); - switch (dbg_model) { - case ID_DFR0_CP_DEBUG_M_V6: - case ID_DFR0_CP_DEBUG_M_V6_1: /* fall through */ - dbg_dscr &= ~DBGSCR_MDBG_EN; - cp14_dbgdscr_v6_set(dbg_dscr); - break; - case ID_DFR0_CP_DEBUG_M_V7: /* fall through */ - case ID_DFR0_CP_DEBUG_M_V7_1: - dbg_dscr &= ~DBGSCR_MDBG_EN; - cp14_dbgdscr_v7_set(dbg_dscr); - break; - default: - return (ENXIO); - } - isb(); - - return (0); -} - -static int dbg_setup_xpoint(struct dbg_wb_conf *conf) { struct pcpu *pcpu; @@ -702,13 +685,6 @@ dbg_setup_xpoint(struct dbg_wb_conf *con dbg_wb_write_reg(reg_addr, i, addr); dbg_wb_write_reg(reg_ctrl, i, ctrl); - err = dbg_enable_monitor(); - if (err != 0) - return (err); - - /* Increment monitor enable counter */ - dbg_ref_count_mme++; - /* * Save watchpoint settings for all CPUs. * We don't need to do the same with breakpoints since HW breakpoints @@ -775,19 +751,6 @@ dbg_remove_xpoint(struct dbg_wb_conf *co dbg_wb_write_reg(reg_ctrl, i, 0); dbg_wb_write_reg(reg_addr, i, 0); - /* Decrement monitor enable counter */ - dbg_ref_count_mme--; - if (dbg_ref_count_mme < 0) - dbg_ref_count_mme = 0; - - atomic_thread_fence_rel(); - - if (dbg_ref_count_mme == 0) { - err = dbg_disable_monitor(); - if (err != 0) - return (err); - } - /* * Save watchpoint settings for all CPUs. * We don't need to do the same with breakpoints since HW breakpoints @@ -827,7 +790,7 @@ dbg_get_ossr(void) { switch (dbg_model) { - case ID_DFR0_CP_DEBUG_M_V6_1: + case ID_DFR0_CP_DEBUG_M_V7: if ((cp14_dbgoslsr_get() & DBGOSLSR_OSLM0) != 0) return (TRUE); @@ -844,10 +807,8 @@ dbg_arch_supported(void) { switch (dbg_model) { -#ifdef not_yet case ID_DFR0_CP_DEBUG_M_V6: case ID_DFR0_CP_DEBUG_M_V6_1: -#endif case ID_DFR0_CP_DEBUG_M_V7: case ID_DFR0_CP_DEBUG_M_V7_1: /* fall through */ return (TRUE); @@ -889,9 +850,16 @@ dbg_reset_state(void) switch (dbg_model) { case ID_DFR0_CP_DEBUG_M_V6: - /* v6 Debug logic reset upon power-u
svn commit: r300969 - in head/sys/arm: arm include
Author: zbb Date: Sun May 29 17:35:38 2016 New Revision: 300969 URL: https://svnweb.freebsd.org/changeset/base/300969 Log: Improve ARM debug_monitor for SMP machines - Reset debug architecture and enable monitor for secondary CPUs in init_secondary() rather than when configuring watchpoint, etc. - Disable HW debugging capabilities when one of the CPU cores fails to set up. - Use dbg_capable() in a more atomic manner to avoid any mismatch between CPUs. Differential Revision: https://reviews.freebsd.org/D6009 Modified: head/sys/arm/arm/debug_monitor.c head/sys/arm/arm/mp_machdep.c head/sys/arm/include/debug_monitor.h Modified: head/sys/arm/arm/debug_monitor.c == --- head/sys/arm/arm/debug_monitor.cSun May 29 17:33:49 2016 (r300968) +++ head/sys/arm/arm/debug_monitor.cSun May 29 17:35:38 2016 (r300969) @@ -72,9 +72,8 @@ static boolean_t dbg_check_slot_free(enu static int dbg_remove_xpoint(struct dbg_wb_conf *); static int dbg_setup_xpoint(struct dbg_wb_conf *); -static boolean_t dbg_capable; /* Indicates that machine is capable of using +static int dbg_capable_var;/* Indicates that machine is capable of using HW watchpoints/breakpoints */ -static boolean_t dbg_ready[MAXCPU]; /* Debug arch. reset performed on this CPU */ static uint32_t dbg_model; /* Debug Arch. Model */ static boolean_t dbg_ossr; /* OS Save and Restore implemented */ @@ -245,6 +244,13 @@ dbg_wb_write_reg(int reg, int n, uint32_ isb(); } +static __inline boolean_t +dbg_capable(void) +{ + + return (atomic_cmpset_int(&dbg_capable_var, 0, 0) == 0); +} + boolean_t kdb_cpu_pc_is_singlestep(db_addr_t pc) { @@ -253,7 +259,7 @@ kdb_cpu_pc_is_singlestep(db_addr_t pc) * there will be no stepping capabilities * (SOFTWARE_SSTEP is not defined for __ARM_ARCH >= 6). */ - if (!dbg_capable) + if (!dbg_capable()) return (FALSE); if (dbg_find_slot(DBG_TYPE_BREAKPOINT, pc) != ~0U) @@ -270,7 +276,7 @@ kdb_cpu_set_singlestep(void) uint32_t wcr; u_int i; - if (!dbg_capable) + if (!dbg_capable()) return; /* @@ -303,7 +309,7 @@ kdb_cpu_clear_singlestep(void) uint32_t wvr, wcr; u_int i; - if (!dbg_capable) + if (!dbg_capable()) return; dbg_remove_breakpoint(DBG_BKPT_BT_SLOT); @@ -423,7 +429,7 @@ dbg_show_watchpoint(void) boolean_t is_enabled; int i; - if (!dbg_capable) { + if (!dbg_capable()) { db_printf("Architecture does not support HW " "breakpoints/watchpoints\n"); return; @@ -591,24 +597,15 @@ dbg_setup_xpoint(struct dbg_wb_conf *con uint32_t cr_size, cr_priv, cr_access; uint32_t reg_ctrl, reg_addr, ctrl, addr; boolean_t is_bkpt; - u_int cpuid, cpu; + u_int cpu; u_int i; - int err; - if (!dbg_capable) + if (!dbg_capable()) return (ENXIO); is_bkpt = (conf->type == DBG_TYPE_BREAKPOINT); typestr = is_bkpt ? "breakpoint" : "watchpoint"; - cpuid = PCPU_GET(cpuid); - if (!dbg_ready[cpuid]) { - err = dbg_reset_state(); - if (err != 0) - return (err); - dbg_ready[cpuid] = TRUE; - } - if (is_bkpt) { if (dbg_breakpoint_num == 0) { db_printf("Breakpoints not supported on this architecture\n"); @@ -698,7 +695,7 @@ dbg_setup_xpoint(struct dbg_wb_conf *con d->dbg_wvr[i] = addr; d->dbg_wcr[i] = ctrl; /* Skip update command for the current CPU */ - if (cpu != cpuid) + if (cpu != PCPU_GET(cpuid)) pcpu->pc_dbreg_cmd = PC_DBREG_CMD_LOAD; } } @@ -715,23 +712,13 @@ dbg_remove_xpoint(struct dbg_wb_conf *co struct dbreg *d; uint32_t reg_ctrl, reg_addr, addr; boolean_t is_bkpt; - u_int cpuid, cpu; + u_int cpu; u_int i; - int err; - if (!dbg_capable) + if (!dbg_capable()) return (ENXIO); is_bkpt = (conf->type == DBG_TYPE_BREAKPOINT); - - cpuid = PCPU_GET(cpuid); - if (!dbg_ready[cpuid]) { - err = dbg_reset_state(); - if (err != 0) - return (err); - dbg_ready[cpuid] = TRUE; - } - addr = conf->address; if (is_bkpt) { @@ -764,7 +751,7 @@ dbg_remove_xpoint(struct dbg_wb_conf *co d->dbg_wvr[i] = 0; d->dbg_wcr[i] = 0; /* Skip update command for the current CPU */ -
svn commit: r300970 - in head: lib/libthr share/man/man3
Author: jilles Date: Sun May 29 18:25:11 2016 New Revision: 300970 URL: https://svnweb.freebsd.org/changeset/base/300970 Log: Remove non-history libkse references and fix PTHREAD_PROCESSES_PRIVATE typo. Modified: head/lib/libthr/libthr.3 head/share/man/man3/pthread_barrier_destroy.3 head/share/man/man3/pthread_barrierattr.3 head/share/man/man3/pthread_condattr.3 head/share/man/man3/pthread_spin_init.3 Modified: head/lib/libthr/libthr.3 == --- head/lib/libthr/libthr.3Sun May 29 17:35:38 2016(r300969) +++ head/lib/libthr/libthr.3Sun May 29 18:25:11 2016(r300970) @@ -47,9 +47,7 @@ library provides a 1:1 implementation of library interfaces for application threading. It has been optimized for use by applications expecting system scope thread -semantics, and can provide significant performance improvements -compared to -.Lb libkse . +semantics. .Pp The library is tightly integrated with the run-time link editor .Xr ld-elf.so.1 1 Modified: head/share/man/man3/pthread_barrier_destroy.3 == --- head/share/man/man3/pthread_barrier_destroy.3 Sun May 29 17:35:38 2016(r300969) +++ head/share/man/man3/pthread_barrier_destroy.3 Sun May 29 18:25:11 2016(r300970) @@ -75,9 +75,7 @@ argument to .Fn pthread_barrier_init . Once the threads have been released the barrier will be reset. .Sh IMPLEMENTATION NOTES -In both -.Lb libkse -and +In .Lb libthr the .Dv PTHREAD_BARRIER_SERIAL_THREAD Modified: head/share/man/man3/pthread_barrierattr.3 == --- head/share/man/man3/pthread_barrierattr.3 Sun May 29 17:35:38 2016 (r300969) +++ head/share/man/man3/pthread_barrierattr.3 Sun May 29 18:25:11 2016 (r300970) @@ -137,11 +137,9 @@ barriers does not fully conform to .St -p1003.2 because the process-shared attribute is ignored in -.Lb libthr , -and in -.Lb libkse ; +.Lb libthr ; if any value other than -.Dv PTHREAD_PROCESSES_PRIVATE +.Dv PTHREAD_PROCESS_PRIVATE is specified in a call to .Fn pthread_barrierattr_setpshared , it will return Modified: head/share/man/man3/pthread_condattr.3 == --- head/share/man/man3/pthread_condattr.3 Sun May 29 17:35:38 2016 (r300969) +++ head/share/man/man3/pthread_condattr.3 Sun May 29 18:25:11 2016 (r300970) @@ -167,7 +167,7 @@ does not fully conform to .St -p1003.2 because the process-shared attribute is ignored; if any value other than -.Dv PTHREAD_PROCESSES_PRIVATE +.Dv PTHREAD_PROCESS_PRIVATE is specified in a call to .Fn pthread_condattr_setpshared , it will return Modified: head/share/man/man3/pthread_spin_init.3 == --- head/share/man/man3/pthread_spin_init.3 Sun May 29 17:35:38 2016 (r300969) +++ head/share/man/man3/pthread_spin_init.3 Sun May 29 18:25:11 2016 (r300970) @@ -129,10 +129,8 @@ does not fully conform to because the .Fa pshared argument is ignored in -.Lb libthr , -and in -.Lb libkse +.Lb libthr ; if any value other than -.Dv PTHREAD_PROCESSES_PRIVATE +.Dv PTHREAD_PROCESS_PRIVATE is specified, it returns .Er EINVAL . ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300971 - head/lib/libthr/thread
Author: kib Date: Sun May 29 19:35:55 2016 New Revision: 300971 URL: https://svnweb.freebsd.org/changeset/base/300971 Log: Stop inlining the struct ucond definition into struct pthread_cond. This avoids unneccessary casts and make the calls to _thr_ucond_*() functions less questionable. The c_spare field was not included into struct pthread_cond, so the change modifies libthr ABI for shared condvars. But since an off-page does not legitimately contains any other data past the struct pthread_cond, the change keeps shared condvars from pre- and post- changed libthr compatible. Also note that the whole struct ucond was never copied in or out by kernel. For private condvars, the privately allocated memory was never exposed outside libthr. Sponsored by: The FreeBSD Foundation Modified: head/lib/libthr/thread/thr_cond.c head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_cond.c == --- head/lib/libthr/thread/thr_cond.c Sun May 29 18:25:11 2016 (r300970) +++ head/lib/libthr/thread/thr_cond.c Sun May 29 19:35:55 2016 (r300971) @@ -69,18 +69,18 @@ __weak_reference(_pthread_cond_destroy, __weak_reference(_pthread_cond_signal, pthread_cond_signal); __weak_reference(_pthread_cond_broadcast, pthread_cond_broadcast); -#define CV_PSHARED(cvp)(((cvp)->__flags & USYNC_PROCESS_SHARED) != 0) +#define CV_PSHARED(cvp)(((cvp)->kcond.c_flags & USYNC_PROCESS_SHARED) != 0) static void cond_init_body(struct pthread_cond *cvp, const struct pthread_cond_attr *cattr) { if (cattr == NULL) { - cvp->__clock_id = CLOCK_REALTIME; + cvp->kcond.c_clockid = CLOCK_REALTIME; } else { if (cattr->c_pshared) - cvp->__flags |= USYNC_PROCESS_SHARED; - cvp->__clock_id = cattr->c_clockid; + cvp->kcond.c_flags |= USYNC_PROCESS_SHARED; + cvp->kcond.c_clockid = cattr->c_clockid; } } @@ -205,9 +205,8 @@ cond_wait_kernel(struct pthread_cond *cv if (cancel) _thr_cancel_enter2(curthread, 0); - error = _thr_ucond_wait((struct ucond *)&cvp->__has_kern_waiters, - (struct umutex *)&mp->m_lock, abstime, CVWAIT_ABSTIME | - CVWAIT_CLOCKID); + error = _thr_ucond_wait(&cvp->kcond, &mp->m_lock, abstime, + CVWAIT_ABSTIME | CVWAIT_CLOCKID); if (cancel) _thr_cancel_leave(curthread, 0); @@ -292,7 +291,7 @@ cond_wait_user(struct pthread_cond *cvp, if (cancel) _thr_cancel_enter2(curthread, 0); - error = _thr_sleep(curthread, cvp->__clock_id, abstime); + error = _thr_sleep(curthread, cvp->kcond.c_clockid, abstime); if (cancel) _thr_cancel_leave(curthread, 0); @@ -349,8 +348,7 @@ cond_wait_common(pthread_cond_t *cond, p if (curthread->attr.sched_policy != SCHED_OTHER || (mp->m_lock.m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT | - USYNC_PROCESS_SHARED)) != 0 || - (cvp->__flags & USYNC_PROCESS_SHARED) != 0) + USYNC_PROCESS_SHARED)) != 0 || CV_PSHARED(cvp)) return (cond_wait_kernel(cvp, mp, abstime, cancel)); else return (cond_wait_user(cvp, mp, abstime, cancel)); @@ -413,7 +411,7 @@ cond_signal_common(pthread_cond_t *cond) pshared = CV_PSHARED(cvp); - _thr_ucond_signal((struct ucond *)&cvp->__has_kern_waiters); + _thr_ucond_signal(&cvp->kcond); if (pshared || cvp->__has_user_waiters == 0) return (0); @@ -496,7 +494,7 @@ cond_broadcast_common(pthread_cond_t *co pshared = CV_PSHARED(cvp); - _thr_ucond_broadcast((struct ucond *)&cvp->__has_kern_waiters); + _thr_ucond_broadcast(&cvp->kcond); if (pshared || cvp->__has_user_waiters == 0) return (0); Modified: head/lib/libthr/thread/thr_private.h == --- head/lib/libthr/thread/thr_private.hSun May 29 18:25:11 2016 (r300970) +++ head/lib/libthr/thread/thr_private.hSun May 29 19:35:55 2016 (r300971) @@ -190,9 +190,7 @@ struct pthread_mutex_attr { struct pthread_cond { __uint32_t __has_user_waiters; - __uint32_t __has_kern_waiters; - __uint32_t __flags; - __uint32_t __clock_id; + struct ucondkcond; }; struct pthread_cond_attr { ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300972 - head/usr.sbin/rpcbind
Author: markj Date: Sun May 29 19:46:34 2016 New Revision: 300972 URL: https://svnweb.freebsd.org/changeset/base/300972 Log: Fix rpcbind init after r300941. - getaddrinfo() sets res = NULL on failure and freeaddrinfo() always dereferences its argument, so we should only free the address list after a successful call. - Address a second potential leak caused by getaddrinfo(AF_INET6) overwriting the address list returned by getaddrinfo(AF_INET). X-MFC-With: r300941 Modified: head/usr.sbin/rpcbind/util.c Modified: head/usr.sbin/rpcbind/util.c == --- head/usr.sbin/rpcbind/util.cSun May 29 19:35:55 2016 (r300971) +++ head/usr.sbin/rpcbind/util.cSun May 29 19:46:34 2016 (r300972) @@ -338,6 +338,7 @@ network_init(void) exit(1); } memcpy(local_in4, res->ai_addr, sizeof *local_in4); + freeaddrinfo(res); } #ifdef INET6 @@ -354,6 +355,7 @@ network_init(void) exit(1); } memcpy(local_in6, res->ai_addr, sizeof *local_in6); + freeaddrinfo(res); } /* @@ -395,7 +397,6 @@ network_init(void) freeifaddrs(ifp); #endif - freeaddrinfo(res); /* close(s); */ } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r300965 - head/lib/libc/stdlib
Does clang actually generate different code with this change? On Sun, May 29, 2016 at 9:39 AM, Andrey A. Chernov wrote: > Author: ache > Date: Sun May 29 16:39:28 2016 > New Revision: 300965 > URL: https://svnweb.freebsd.org/changeset/base/300965 > > Log: > Micro optimize: C standard guarantees that right shift for unsigned value > fills left bits with zero, and we have exact 32bit unsigned value > (uint32_t), so there is no reason to add "& 0x7fff" here. > > MFC after: 1 week > > Modified: > head/lib/libc/stdlib/random.c > > Modified: head/lib/libc/stdlib/random.c > == > --- head/lib/libc/stdlib/random.c Sun May 29 16:32:56 2016 > (r300964) > +++ head/lib/libc/stdlib/random.c Sun May 29 16:39:28 2016 > (r300965) > @@ -430,7 +430,7 @@ random(void) > */ > f = fptr; r = rptr; > *f += *r; > - i = (*f >> 1) & 0x7fff; /* chucking least random bit > */ > + i = *f >> 1;/* chucking least random bit */ > if (++f >= end_ptr) { > f = state; > ++r; > ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300973 - head/usr.sbin/rpcbind
Author: ngie Date: Sun May 29 20:28:01 2016 New Revision: 300973 URL: https://svnweb.freebsd.org/changeset/base/300973 Log: Follow up to r300932 In the event MK_INET6 != no in userspace, but is disabled in the kernel, or if there aren't any IPv6 addresses configured in userspace (for lo0 and all physical interfaces), rpcbind would terminate immediately instead of silently failing on Skip over the IPv6 block to its respective cleanup with freeifaddrs if creating the socket failed instead of terminating rpcbind immediately MFC after: 6 days X-MFC with: r300932 Reported by: O. Hartmann Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpcbind/util.c Modified: head/usr.sbin/rpcbind/util.c == --- head/usr.sbin/rpcbind/util.cSun May 29 19:46:34 2016 (r300972) +++ head/usr.sbin/rpcbind/util.cSun May 29 20:28:01 2016 (r300973) @@ -371,7 +371,7 @@ network_init(void) if (s == -1) { if (debugging) fprintf(stderr, "couldn't create ip6 socket"); - exit(1); + goto done_inet6; } /* @@ -394,6 +394,7 @@ network_init(void) if (debugging) perror("setsockopt v6 multicast"); } +done_inet6: freeifaddrs(ifp); #endif ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300974 - head/contrib/llvm/lib/Transforms/Vectorize
Author: dim Date: Sun May 29 20:54:16 2016 New Revision: 300974 URL: https://svnweb.freebsd.org/changeset/base/300974 Log: Pull in r269908 from upstream llvm trunk (by James Molloy): [VectorUtils] Fix nasty use-after-free In truncateToMinimalBitwidths() we were RAUW'ing an instruction then erasing it. However, that intruction could be cached in the map we're iterating over. The first check is "I->use_empty()" which in most cases would return true, as the (deleted) object was RAUW'd first so would have zero use count. However in some cases the object could have been polluted or written over and this wouldn't be the case. Also it makes valgrind, asan and traditionalists who don't like their compiler to crash sad. No testcase as there are no externally visible symptoms apart from a crash if the stars align. Fixes PR26509. This should fix crashes when building a number of ports on arm64. Reported by: andrew Modified: head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp Modified: head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp == --- head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cppSun May 29 20:28:01 2016(r300973) +++ head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cppSun May 29 20:54:16 2016(r300974) @@ -3161,10 +3161,11 @@ void InnerLoopVectorizer::truncateToMini // truncated version of `I` and reextend its result. InstCombine runs // later and will remove any ext/trunc pairs. // + SmallPtrSet Erased; for (auto &KV : MinBWs) { VectorParts &Parts = WidenMap.get(KV.first); for (Value *&I : Parts) { - if (I->use_empty()) + if (Erased.count(I) || I->use_empty()) continue; Type *OriginalTy = I->getType(); Type *ScalarTruncatedTy = IntegerType::get(OriginalTy->getContext(), @@ -3238,6 +3239,7 @@ void InnerLoopVectorizer::truncateToMini Value *Res = B.CreateZExtOrTrunc(NewI, OriginalTy); I->replaceAllUsesWith(Res); cast(I)->eraseFromParent(); + Erased.insert(I); I = Res; } } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r300965 - head/lib/libc/stdlib
On 29.05.2016 22:39, Conrad Meyer wrote: > Does clang actually generate different code with this change? Yes, without -O it generates andl$2147483647, ... With -O nothing is changed. In general, it can be not clang and I see no point to left junk code in any case. > > On Sun, May 29, 2016 at 9:39 AM, Andrey A. Chernov wrote: >> Author: ache >> Date: Sun May 29 16:39:28 2016 >> New Revision: 300965 >> URL: https://svnweb.freebsd.org/changeset/base/300965 >> >> Log: >> Micro optimize: C standard guarantees that right shift for unsigned value >> fills left bits with zero, and we have exact 32bit unsigned value >> (uint32_t), so there is no reason to add "& 0x7fff" here. >> >> MFC after: 1 week >> >> Modified: >> head/lib/libc/stdlib/random.c >> >> Modified: head/lib/libc/stdlib/random.c >> == >> --- head/lib/libc/stdlib/random.c Sun May 29 16:32:56 2016 >> (r300964) >> +++ head/lib/libc/stdlib/random.c Sun May 29 16:39:28 2016 >> (r300965) >> @@ -430,7 +430,7 @@ random(void) >> */ >> f = fptr; r = rptr; >> *f += *r; >> - i = (*f >> 1) & 0x7fff; /* chucking least random bit >> */ >> + i = *f >> 1;/* chucking least random bit */ >> if (++f >= end_ptr) { >> f = state; >> ++r; >> > ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r300973 - head/usr.sbin/rpcbind
> On 29 May 2016, at 20:28 , Garrett Cooper wrote: > > Author: ngie > Date: Sun May 29 20:28:01 2016 > New Revision: 300973 > URL: https://svnweb.freebsd.org/changeset/base/300973 > > Log: > Follow up to r300932 > > In the event MK_INET6 != no in userspace, but is disabled in the > kernel, or if there aren't any IPv6 addresses configured in userspace > (for lo0 and all physical interfaces), rpcbind would terminate > immediately instead of silently failing on > > Skip over the IPv6 block to its respective cleanup with freeifaddrs if > creating the socket failed instead of terminating rpcbind immediately Stupid question (without me looking at the code): what does it do in case I have no IPv4 support in the kernel anymore (as I do on some machines)? /bz ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r300973 - head/usr.sbin/rpcbind
> On May 29, 2016, at 14:52, Bjoern A. Zeeb > wrote: > > >> On 29 May 2016, at 20:28 , Garrett Cooper wrote: >> >> Author: ngie >> Date: Sun May 29 20:28:01 2016 >> New Revision: 300973 >> URL: https://svnweb.freebsd.org/changeset/base/300973 >> >> Log: >> Follow up to r300932 >> >> In the event MK_INET6 != no in userspace, but is disabled in the >> kernel, or if there aren't any IPv6 addresses configured in userspace >> (for lo0 and all physical interfaces), rpcbind would terminate >> immediately instead of silently failing on >> >> Skip over the IPv6 block to its respective cleanup with freeifaddrs if >> creating the socket failed instead of terminating rpcbind immediately > > Stupid question (without me looking at the code): what does it do in case I > have no IPv4 support in the kernel anymore (as I do on some machines)? The socket call only applied to IPv6. It intentionally sets the multicast address and leaks the socket, which causes coverity to note the leak as fd is local to the function. I'll definite try out this case as well tonight.. init_transport(..) (another function in rpcbind that uses rpc(3) under the covers) was not working under certain edge cases with some changes I had put up for CR. I feel like I wandered into another blackberry bramble patch with rpc(3). I have some ideas for refactoring rpcbind and friends to ease maintenance that I'll work on after 11.0-RELEASE hits. Thanks! -Ngie ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300975 - head/tools/tools/locale/tools
Author: bapt Date: Sun May 29 22:27:42 2016 New Revision: 300975 URL: https://svnweb.freebsd.org/changeset/base/300975 Log: Add more hacks to correct CLDR data For Russian: - Convert AM/PM which are badly formatted in CLDR to replace it by the proper cyrillic - Add a dependency on Text::Iconv so non unicode get the proper encoding for AM/PM - fix the date format having 'r.,' and convert it to 'r.' (also fixed in Bulgarian) For All: - Use complete Day of Week instead of the abbreviated one Reported by: ache Modified: head/tools/tools/locale/tools/cldr2def.pl Modified: head/tools/tools/locale/tools/cldr2def.pl == --- head/tools/tools/locale/tools/cldr2def.pl Sun May 29 20:54:16 2016 (r300974) +++ head/tools/tools/locale/tools/cldr2def.pl Sun May 29 22:27:42 2016 (r300975) @@ -5,6 +5,7 @@ use strict; use File::Copy; use XML::Parser; use Tie::IxHash; +use Text::Iconv; use Data::Dumper; use Getopt::Long; use Digest::SHA qw(sha1_hex); @@ -69,6 +70,7 @@ my %callback = ( cformat => \&callback_cformat, dtformat => \&callback_dtformat, cbabmon => \&callback_abmon, + cbampm => \&callback_ampm, data => undef, ); @@ -183,7 +185,7 @@ if ($TYPE eq "timedef") { "t_fmt" => "s", "d_fmt" => "s", "c_fmt" => " "as", + "am_pm" => " "s", "d_t_fmt" => " "new("utf-8", "$enc"); + + if ($nl eq 'ru_RU') { + if ($enc eq 'UTF-8') { + $s = 'дп;пп'; + } else { + $s = $converter->convert("дп;пп"); + } + } + return $s; +} + sub callback_cformat { my $s = shift; + my $nl = $callback{data}{l} . "_" . $callback{data}{c}; + + $s =~ s/\.,/\./; $s =~ s/ %Z//; $s =~ s/ %z//; - $s =~ s/^"(%B %e, )/"%a, $1/; - $s =~ s/^"(%e %B )/"%a $1/; + $s =~ s/^"(%B %e, )/"%A, $1/; + $s =~ s/^"(%e %B )/"%A $1/; return $s; }; @@ -211,8 +232,9 @@ sub callback_dtformat { if ($nl eq 'ja_JP') { $s =~ s/(> )(%H)/$1%A $2/; } - $s =~ s/^"(%B %e, )/"%a, $1/; - $s =~ s/^"(%e %B )/"%a $1/; + $s =~ s/\.,/\./; + $s =~ s/^"(%B %e, )/"%A, $1/; + $s =~ s/^"(%e %B )/"%A $1/; return $s; }; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300976 - head/share/timedef
Author: bapt Date: Sun May 29 22:28:39 2016 New Revision: 300976 URL: https://svnweb.freebsd.org/changeset/base/300976 Log: Regenerate timedef: For Russian: - Convert AM/PM which are badly formatted in CLDR to replace it by the proper cyrillic - Add a dependency on Text::Iconv so non unicode get the proper encoding for AM/PM - fix the date format having 'r.,' and convert it to 'r.' (also fixed in Bulgarian) For All: - Use complete Day of Week instead of the abbreviated one Reported by: ache Modified: head/share/timedef/am_ET.UTF-8.src head/share/timedef/be_BY.CP1131.src head/share/timedef/be_BY.CP1251.src head/share/timedef/be_BY.ISO8859-5.src head/share/timedef/be_BY.UTF-8.src head/share/timedef/bg_BG.CP1251.src head/share/timedef/bg_BG.UTF-8.src head/share/timedef/ca_IT.ISO8859-15.src head/share/timedef/ca_IT.UTF-8.src head/share/timedef/el_GR.ISO8859-7.src head/share/timedef/el_GR.UTF-8.src head/share/timedef/en_CA.UTF-8.src head/share/timedef/en_GB.UTF-8.src head/share/timedef/en_HK.UTF-8.src head/share/timedef/en_IE.UTF-8.src head/share/timedef/en_PH.UTF-8.src head/share/timedef/en_SG.UTF-8.src head/share/timedef/en_US.UTF-8.src head/share/timedef/fr_BE.ISO8859-15.src head/share/timedef/fr_BE.UTF-8.src head/share/timedef/fr_CA.ISO8859-15.src head/share/timedef/fr_CA.UTF-8.src head/share/timedef/fr_CH.ISO8859-15.src head/share/timedef/fr_CH.UTF-8.src head/share/timedef/fr_FR.ISO8859-15.src head/share/timedef/fr_FR.UTF-8.src head/share/timedef/hi_IN.ISCII-DEV.src head/share/timedef/hi_IN.UTF-8.src head/share/timedef/hy_AM.ARMSCII-8.src head/share/timedef/hy_AM.UTF-8.src head/share/timedef/it_CH.ISO8859-15.src head/share/timedef/it_CH.UTF-8.src head/share/timedef/it_IT.ISO8859-15.src head/share/timedef/it_IT.UTF-8.src head/share/timedef/kk_Cyrl_KZ.UTF-8.src head/share/timedef/nl_BE.UTF-8.src head/share/timedef/nl_NL.UTF-8.src head/share/timedef/pl_PL.ISO8859-2.src head/share/timedef/pl_PL.UTF-8.src head/share/timedef/ro_RO.ISO8859-2.src head/share/timedef/ro_RO.UTF-8.src head/share/timedef/ru_RU.CP1251.src head/share/timedef/ru_RU.CP866.src head/share/timedef/ru_RU.ISO8859-5.src head/share/timedef/ru_RU.KOI8-R.src head/share/timedef/ru_RU.UTF-8.src head/share/timedef/sv_FI.ISO8859-15.src head/share/timedef/sv_FI.UTF-8.src head/share/timedef/sv_SE.ISO8859-15.src head/share/timedef/sv_SE.UTF-8.src head/share/timedef/tr_TR.ISO8859-9.src head/share/timedef/tr_TR.UTF-8.src head/share/timedef/uk_UA.CP1251.src head/share/timedef/uk_UA.ISO8859-5.src head/share/timedef/uk_UA.KOI8-U.src head/share/timedef/uk_UA.UTF-8.src Modified: head/share/timedef/am_ET.UTF-8.src == Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.CP1131.src == Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.CP1251.src == Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.ISO8859-5.src == Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.UTF-8.src == Binary file (source and/or target). No diff available. Modified: head/share/timedef/bg_BG.CP1251.src == --- head/share/timedef/bg_BG.CP1251.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/bg_BG.CP1251.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ %e.%m.%y г. # # c_fmt -%a %e %B %Y �., %H:%M:%S +%A %e %B %Y �. %H:%M:%S # # AM/PM ��.��. ��.��. # # date_fmt -%a %e %B %Y �., %H:%M:%S %Z +%A %e %B %Y �. %H:%M:%S %Z # # Long month names (without case ending) �� Modified: head/share/timedef/bg_BG.UTF-8.src == Binary file (source and/or target). No diff available. Modified: head/share/timedef/ca_IT.ISO8859-15.src == --- head/share/timedef/ca_IT.ISO8859-15.src Sun May 29 22:27:42 2016 (r300975) +++ head/share/timedef/ca_IT.ISO8859-15.src Sun May 29 22:28:39 2016 (r300976) @@ -56,14 +56,14 @@ dissabte %e/%m/%y # # c_fmt -%a %e %B de %Y, %H:%M:%S +%A %e %B de %Y, %H:%M:%S # # AM/PM a. m. p. m. # # date_fmt -%a %e %B de %Y, %H:%M:%S %Z +%A %e %B de %Y, %H:%M:%S %Z # # Long month names (without case ending) de gener Modified: head/share/timedef/ca_IT.UTF-8.src =
svn commit: r300980 - head
Author: lidl Date: Mon May 30 02:09:19 2016 New Revision: 300980 URL: https://svnweb.freebsd.org/changeset/base/300980 Log: Remove extraneous altq header files At some point during stable/10, the headers altq_codel.h and altq_fairq.h where added to /usr/include/altq, before all of altq was moved to /usr/include/net/altq. Reviewed by: rpaulo Approved by: rpaulo Differential Revision:https://reviews.freebsd.org/D6596 Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Mon May 30 01:21:44 2016(r300979) +++ head/ObsoleteFiles.inc Mon May 30 02:09:19 2016(r300980) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20160523: remove extranous ALTQ files +OLD_FILES+=usr/include/altq/altq_codel.h +OLD_FILES+=usr/include/altq/altq_fairq.h # 20160519: remove DTrace Toolkit from base OLD_FILES+=usr/share/dtrace/toolkit/execsnoop OLD_FILES+=usr/share/dtrace/toolkit/hotkernel ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r300956 - head/lib/libc/stdlib
On Sun, 29 May 2016, Andrey A. Chernov wrote: Log: 1) Unifdef USE_WEAK_SEEDING since it is too obsolete to support and makes reading hard. Good. 2) Instead of doing range transformation in each and every function here, do it single time directly in do_rand(). One "mod" operation overhead is not a big deal, but the code looks nicer and possible future functions additions or PRNG change do not miss range transformations neither have unneeded ones. The whole implementation is silly. It is manually optimized for 1980's compilers. More below. 3) Use POSIX argument types for visible functions (cosmetic). Not sure I like type changes. Modified: head/lib/libc/stdlib/rand.c == --- head/lib/libc/stdlib/rand.c Sun May 29 12:21:54 2016(r300955) +++ head/lib/libc/stdlib/rand.c Sun May 29 13:57:06 2016(r300956) @@ -48,14 +48,6 @@ __FBSDID("$FreeBSD$"); static int do_rand(unsigned long *ctx) { -#ifdef USE_WEAK_SEEDING -/* - * Historic implementation compatibility. - * The random sequences do not vary much with the seed, - * even with overflowing. - */ - return ((*ctx = *ctx * 1103515245 + 12345) % ((u_long)RAND_MAX + 1)); This is a good implementation of a not very good LCG, made very bad by botching RAND_MAX. The magic numbers except for RAND_MAX are copied from the example in the C90 spec. I think they are good enough there. The comment in at least the C99 spec says "// RAND_MAX assumed to be 32767". This means that these magic numbers were chosen to work with this value of RAND_MAX. (unsigned) longs are used to give a period much longer than RAND_MAX and for technical reasons. Taking the modulo to many fewer bits than the minimum of 32 for an unsigned long then disguises the linearity. The BSD version almost completly breaks this on arches with 32 bit longs by taking the modulo to 31 bits (mod 32 bits would give complete breakage). Arches with 64-bit longs accidentally work a bit better, by the coefficients are poorly chosen -- they should be 64 bits and the arithmetic 128 bits. -#else /* !USE_WEAK_SEEDING */ /* * Compute x = (7^5 * x) mod (2^31 - 1) * without overflowing 31 bits: These coefficients are probably better, but they are still basically 32-bit ones and thus not very good for more than a 15-bit RAND_MAX, and the details of the calculation are excessively optimized for 1980's compilers and 32-bit uintmax_t. This can be written as x = (1687 * x) % 2147483647 (with some care about type sizes and signedness and overflow. It then looks like an even worse LCG than the botched C90 one, at least with the botch making its internals more visible. E.g., when x = 1, the first couple of iterations don't even involve the linear term in 31 bits. Even 1980's compiler technology was not far from reducing the division to a multiplication. The LCG expression would then reduce to (uintN_t)(A * x + B) where N is either 32 or 64. Perhaps N needs to be 64 even with the small coeefficients, due to the divisor being large and not a power of 2. But if we have 64-bit arithmetic, then we can choose much better coefficients than the C90 32-bit ones or the ACM barely 16-bit ones, and uses A * x + B directly, giving a 64-bit period, and have a chance of our 31-bit RAND_MAX finally working. @@ -66,48 +58,34 @@ do_rand(unsigned long *ctx) */ long hi, lo, x; - /* Must be in [1, 0x7ffe] range at this point. */ - hi = *ctx / 127773; - lo = *ctx % 127773; + /* Transform to [1, 0x7ffe] range. */ + x = (*ctx % 0x7ffe) + 1; + hi = x / 127773; + lo = x % 127773; x = 16807 * lo - 2836 * hi; if (x < 0) x += 0x7fff; This does the division more magically but more slowly than the compiler would do. It uses one division and one remainder, and doesn't use the newfangled (late 1980's) ldiv() function to explicitly try to reduce these to one hardware divrem operation. But compilers can easily do this reduction. I think compilers can't easily (or perhaps at all) reduce to an A * x + B expression. It isn't clear if using signed long here makes things easier or harder for compilers. The algorithm is special to avoid overflow with signed longs, but it the compiler might not understand this. Then -fwrapv would inhibit it from doing much reduction, and -fno-wrapv is just complicated. - *ctx = x; /* Transform to [0, 0x7ffd] range. */ - return (x - 1); -#endif /* !USE_WEAK_SEEDING */ + x--; + *ctx = x; + return (x); } int -rand_r(unsigned int *ctx) +rand_r(unsigned *ctx) You didn't change the type, but fixed a style bug (the verbose spelling of "unsigned") :-). It is interesting that the style bug is missing in POSIX. I thought that standards mostly got this wrong. Actually, POSIX almost never uses the verbose spelling. In the a 2001 draft, it has just 2 inst
Re: svn commit: r300965 - head/lib/libc/stdlib
On Sun, 29 May 2016, Conrad Meyer wrote: Does clang actually generate different code with this change? It should, on exotic arches. On Sun, May 29, 2016 at 9:39 AM, Andrey A. Chernov wrote: Log: Micro optimize: C standard guarantees that right shift for unsigned value fills left bits with zero, and we have exact 32bit unsigned value (uint32_t), so there is no reason to add "& 0x7fff" here. Using uint32_t at all is an unportable pessimization. On exotic arches that don't have native uint32_t registers, a theoretically perfect implementation wouldn't implement uint32_t. This would expose the brokenness of broken code, so a practical implementation would emulate uint32_t so that the broken code would just run slower for arithmetic and much slower for locked memory operations. uint32_t might be implemented not very slowly using 128-bit integer registers, or more slowly using the 53-bit mantissa part of an IEEE double precision floating point register. If uint32_t is emulated, then the compiler is forced to act as if the code uses a longer type and does "& 0x" after every operation. Thes extra operations can only be combined sometimes. More careful code can use a minimal number of this or similar "&" operations. In checksum calculations, one "&" at the end is usually enough. Modified: head/lib/libc/stdlib/random.c random.c was mostly written before uint32_t was standard, so it used u_long and long. Perhaps it wasn't careful enough with the "&"s to actually work unless u_long is precisely uint32_t and long is normal 2's complement with benign overflow. Anyway, it was "fixed" (unimproved) using s/u_long/uint32_/ in most places where the API/ABI doesn't require longs (there is 1 dubious long left in a comment). The correct fix is s/u_long/uint_fast32_t in most places and s/u_long/uint_least32_t/ in some places and then fix any missing "&"'s. The "fast" and "least" types always exist, unlike the fixed-width types, and using them asks for time/space efficiency instead of emulated fixed-width. On non-exotic arches, fast == least == fixed-width, so the correct substitution works as a quick fix even with missing "&"s. It is not necessary to use the newfangled standard integer types to fix this here, since correct use of long types would work (they give 32 bits), but long is wasteful if it actually 64 bits or longer. Even larger problems are looming with uintmax_t. Any code that is careful enough to use it is likely to break or be bloated if it is expanded. This is just like using u_long in old random(). == --- head/lib/libc/stdlib/random.c Sun May 29 16:32:56 2016 (r300964) +++ head/lib/libc/stdlib/random.c Sun May 29 16:39:28 2016 (r300965) @@ -430,7 +430,7 @@ random(void) */ f = fptr; r = rptr; *f += *r; - i = (*f >> 1) & 0x7fff; /* chucking least random bit */ + i = *f >> 1;/* chucking least random bit */ This gives an "&" to restore in the version with correct substitutions. It also breaks the indentation. (This file mostly indents comments to the right of code to column 40, but column 48 was used here and now column 32 is used.) if (++f >= end_ptr) { f = state; ++r; Bruce ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300981 - head/sys/netinet
Author: sephe Date: Mon May 30 03:31:37 2016 New Revision: 300981 URL: https://svnweb.freebsd.org/changeset/base/300981 Log: tcp: Don't prematurely drop receiving-only connections If the connection was persistent and receiving-only, several (12) sporadic device insufficient buffers would cause the connection be dropped prematurely: Upon ENOBUFS in tcp_output() for an ACK, retransmission timer is started. No one will stop this retransmission timer for receiving- only connection, so the retransmission timer promises to expire and t_rxtshift is promised to be increased. And t_rxtshift will not be reset to 0, since no RTT measurement will be done for receiving-only connection. If this receiving-only connection lived long enough (e.g. >350sec, given the RTO starts from 200ms), and it suffered 12 sporadic device insufficient buffers, i.e. t_rxtshift >= 12, this receiving-only connection would be dropped prematurely by the retransmission timer. We now assert that for data segments, SYNs or FINs either rexmit or persist timer was wired upon ENOBUFS. And don't set rexmit timer for other cases, i.e. ENOBUFS upon ACKs. Discussed with: lstewart, hiren, jtl, Mike Karels MFC after:3 weeks Sponsored by: Microsoft OSTC Differential Revision:https://reviews.freebsd.org/D5872 Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c == --- head/sys/netinet/tcp_output.c Mon May 30 02:09:19 2016 (r300980) +++ head/sys/netinet/tcp_output.c Mon May 30 03:31:37 2016 (r300981) @@ -130,6 +130,16 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, send &VNET_NAME(tcp_autosndbuf_max), 0, "Max size of automatic send buffer"); +/* + * Make sure that either retransmit or persist timer is set for SYN, FIN and + * non-ACK. + */ +#define TCP_XMIT_TIMER_ASSERT(tp, len, th_flags) \ + KASSERT(((len) == 0 && ((th_flags) & (TH_SYN | TH_FIN)) == 0) ||\ + tcp_timer_active((tp), TT_REXMT) || \ + tcp_timer_active((tp), TT_PERSIST), \ + ("neither rexmt nor persist timer is set")) + static void inline hhook_run_tcp_est_out(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to, long len, int tso); @@ -1545,9 +1555,7 @@ timer: tp->t_softerror = error; return (error); case ENOBUFS: - if (!tcp_timer_active(tp, TT_REXMT) && - !tcp_timer_active(tp, TT_PERSIST)) - tcp_timer_activate(tp, TT_REXMT, tp->t_rxtcur); + TCP_XMIT_TIMER_ASSERT(tp, len, flags); tp->snd_cwnd = tp->t_maxseg; return (0); case EMSGSIZE: ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300982 - head/sys/sys
Author: sephe Date: Mon May 30 04:48:06 2016 New Revision: 300982 URL: https://svnweb.freebsd.org/changeset/base/300982 Log: mbuf: Add a flag for M_HASHTYPE_ to indicate the type has hash properties This flag has not been used, and drivers setting M_HASHTYPE_OPAQUE have not been converted as of this commit. Reviewed by: hps, gallatin (early version) Sponsored by: Microsoft OSTC Differential Revision:https://reviews.freebsd.org/D6406 Modified: head/sys/sys/mbuf.h head/sys/sys/param.h Modified: head/sys/sys/mbuf.h == --- head/sys/sys/mbuf.h Mon May 30 03:31:37 2016(r300981) +++ head/sys/sys/mbuf.h Mon May 30 04:48:06 2016(r300982) @@ -318,30 +318,41 @@ struct mbuf { * * Most NICs support RSS, which provides ordering and explicit affinity, and * use the hash m_flag bits to indicate what header fields were covered by - * the hash. M_HASHTYPE_OPAQUE can be set by non-RSS cards or configurations - * that provide an opaque flow identifier, allowing for ordering and - * distribution without explicit affinity. + * the hash. M_HASHTYPE_OPAQUE and M_HASHTYPE_OPAQUE_HASH can be set by non- + * RSS cards or configurations that provide an opaque flow identifier, allowing + * for ordering and distribution without explicit affinity. Additionally, + * M_HASHTYPE_OPAQUE_HASH indicates that the flow identifier has hash + * properties. */ +#defineM_HASHTYPE_HASHPROP 0x80/* has hash properties */ +#defineM_HASHTYPE_HASH(t) (M_HASHTYPE_HASHPROP | (t)) /* Microsoft RSS standard hash types */ #defineM_HASHTYPE_NONE 0 -#defineM_HASHTYPE_RSS_IPV4 1 /* IPv4 2-tuple */ -#defineM_HASHTYPE_RSS_TCP_IPV4 2 /* TCPv4 4-tuple */ -#defineM_HASHTYPE_RSS_IPV6 3 /* IPv6 2-tuple */ -#defineM_HASHTYPE_RSS_TCP_IPV6 4 /* TCPv6 4-tuple */ -#defineM_HASHTYPE_RSS_IPV6_EX 5 /* IPv6 2-tuple + ext hdrs */ -#defineM_HASHTYPE_RSS_TCP_IPV6_EX 6 /* TCPv6 4-tiple + ext hdrs */ +#defineM_HASHTYPE_RSS_IPV4 M_HASHTYPE_HASH(1) /* IPv4 2-tuple */ +#defineM_HASHTYPE_RSS_TCP_IPV4 M_HASHTYPE_HASH(2) /* TCPv4 4-tuple */ +#defineM_HASHTYPE_RSS_IPV6 M_HASHTYPE_HASH(3) /* IPv6 2-tuple */ +#defineM_HASHTYPE_RSS_TCP_IPV6 M_HASHTYPE_HASH(4) /* TCPv6 4-tuple */ +#defineM_HASHTYPE_RSS_IPV6_EX M_HASHTYPE_HASH(5) /* IPv6 2-tuple + + * ext hdrs */ +#defineM_HASHTYPE_RSS_TCP_IPV6_EX M_HASHTYPE_HASH(6) /* TCPv6 4-tiple + + * ext hdrs */ /* Non-standard RSS hash types */ -#defineM_HASHTYPE_RSS_UDP_IPV4 7 /* IPv4 UDP 4-tuple */ -#defineM_HASHTYPE_RSS_UDP_IPV4_EX 8 /* IPv4 UDP 4-tuple + ext hdrs */ -#defineM_HASHTYPE_RSS_UDP_IPV6 9 /* IPv6 UDP 4-tuple */ -#defineM_HASHTYPE_RSS_UDP_IPV6_EX 10 /* IPv6 UDP 4-tuple + ext hdrs */ - -#defineM_HASHTYPE_OPAQUE 255 /* ordering, not affinity */ +#defineM_HASHTYPE_RSS_UDP_IPV4 M_HASHTYPE_HASH(7) /* IPv4 UDP 4-tuple*/ +#defineM_HASHTYPE_RSS_UDP_IPV4_EX M_HASHTYPE_HASH(8) /* IPv4 UDP 4-tuple + + * ext hdrs */ +#defineM_HASHTYPE_RSS_UDP_IPV6 M_HASHTYPE_HASH(9) /* IPv6 UDP 4-tuple*/ +#defineM_HASHTYPE_RSS_UDP_IPV6_EX M_HASHTYPE_HASH(10)/* IPv6 UDP 4-tuple + + * ext hdrs */ + +#defineM_HASHTYPE_OPAQUE 63 /* ordering, not affinity */ +#defineM_HASHTYPE_OPAQUE_HASH M_HASHTYPE_HASH(M_HASHTYPE_OPAQUE) + /* ordering+hash, not affinity*/ #defineM_HASHTYPE_CLEAR(m) ((m)->m_pkthdr.rsstype = 0) #defineM_HASHTYPE_GET(m) ((m)->m_pkthdr.rsstype) #defineM_HASHTYPE_SET(m, v)((m)->m_pkthdr.rsstype = (v)) #defineM_HASHTYPE_TEST(m, v) (M_HASHTYPE_GET(m) == (v)) +#defineM_HASHTYPE_ISHASH(m)(M_HASHTYPE_GET(m) & M_HASHTYPE_HASHPROP) /* * COS/QOS class and quality of service tags. Modified: head/sys/sys/param.h == --- head/sys/sys/param.hMon May 30 03:31:37 2016(r300981) +++ head/sys/sys/param.hMon May 30 04:48:06 2016(r300982) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100114 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100115 /* Master, propagated to newver
Re: svn commit: r300956 - head/lib/libc/stdlib
On 30.05.2016 5:17, Bruce Evans wrote: > On Sun, 29 May 2016, Andrey A. Chernov wrote: > >> Log: >> 1) Unifdef USE_WEAK_SEEDING since it is too obsolete to support and >> makes >> reading hard. > > Good. > >> 2) Instead of doing range transformation in each and every function >> here, >> do it single time directly in do_rand(). One "mod" operation overhead >> is not >> a big deal, but the code looks nicer and possible future functions >> additions >> or PRNG change do not miss range transformations neither have >> unneeded ones. > > The whole implementation is silly. It is manually optimized for 1980's > compilers. More below. > >> 3) Use POSIX argument types for visible functions (cosmetic). > > Not sure I like type changes. > >> Modified: head/lib/libc/stdlib/rand.c >> == >> >> --- head/lib/libc/stdlib/rand.cSun May 29 12:21:54 2016(r300955) >> +++ head/lib/libc/stdlib/rand.cSun May 29 13:57:06 2016(r300956) >> @@ -48,14 +48,6 @@ __FBSDID("$FreeBSD$"); >> static int >> do_rand(unsigned long *ctx) >> { >> -#ifdef USE_WEAK_SEEDING >> -/* >> - * Historic implementation compatibility. >> - * The random sequences do not vary much with the seed, >> - * even with overflowing. >> - */ >> -return ((*ctx = *ctx * 1103515245 + 12345) % ((u_long)RAND_MAX + >> 1)); > > This is a good implementation of a not very good LCG, made very bad by > botching RAND_MAX. The magic numbers except for RAND_MAX are copied > from the example in the C90 spec. I think they are good enough there. > The comment in at least the C99 spec says "// RAND_MAX assumed to be > 32767". This means that these magic numbers were chosen to work with > this value of RAND_MAX. (unsigned) longs are used to give a period > much longer than RAND_MAX and for technical reasons. Taking the modulo > to many fewer bits than the minimum of 32 for an unsigned long then > disguises the linearity. The BSD version almost completly breaks this > on arches with 32 bit longs by taking the modulo to 31 bits (mod 32 bits > would give complete breakage). Arches with 64-bit longs accidentally > work a bit better, by the coefficients are poorly chosen -- they should > be 64 bits and the arithmetic 128 bits. > >> -#else /* !USE_WEAK_SEEDING */ >> /* >> * Compute x = (7^5 * x) mod (2^31 - 1) >> * without overflowing 31 bits: > > These coefficients are probably better, but they are still basically > 32-bit ones and thus not very good for more than a 15-bit RAND_MAX, > and the details of the calculation are excessively optimized for 1980's > compilers and 32-bit uintmax_t. > > This can be written as x = (1687 * x) % 2147483647 (with some care about > type sizes and signedness and overflow. It then looks like an even worse > LCG than the botched C90 one, at least with the botch making its internals > more visible. E.g., when x = 1, the first couple of iterations don't even > involve the linear term in 31 bits. > > Even 1980's compiler technology was not far from reducing the division > to a multiplication. The LCG expression would then reduce to > (uintN_t)(A * x + B) where N is either 32 or 64. Perhaps N needs to > be 64 even with the small coeefficients, due to the divisor being large > and not a power of 2. But if we have 64-bit arithmetic, then we can > choose much better coefficients than the C90 32-bit ones or the ACM > barely 16-bit ones, and uses A * x + B directly, giving a 64-bit period, > and have a chance of our 31-bit RAND_MAX finally working. > >> @@ -66,48 +58,34 @@ do_rand(unsigned long *ctx) >> */ >> long hi, lo, x; >> >> -/* Must be in [1, 0x7ffe] range at this point. */ >> -hi = *ctx / 127773; >> -lo = *ctx % 127773; >> +/* Transform to [1, 0x7ffe] range. */ >> +x = (*ctx % 0x7ffe) + 1; >> +hi = x / 127773; >> +lo = x % 127773; >> x = 16807 * lo - 2836 * hi; >> if (x < 0) >> x += 0x7fff; > > This does the division more magically but more slowly than the compiler > would do. It uses one division and one remainder, and doesn't use > the newfangled (late 1980's) ldiv() function to explicitly try to > reduce these to one hardware divrem operation. But compilers can > easily do this reduction. I think compilers can't easily (or perhaps > at all) reduce to an A * x + B expression. It isn't clear if using > signed long here makes things easier or harder for compilers. The > algorithm is special to avoid overflow with signed longs, but it the > compiler might not understand this. Then -fwrapv would inhibit it > from doing much reduction, and -fno-wrapv is just complicated. > >> -*ctx = x; >> /* Transform to [0, 0x7ffd] range. */ >> -return (x - 1); >> -#endif /* !USE_WEAK_SEEDING */ >> +x--; >> +*ctx = x; >> +return (x); >> } >> >> >> int >> -rand_r(unsigned int *ctx) >> +rand_r(unsigned *ctx) > > You didn't change the type, but fi
Re: svn commit: r299393 - in head: . share/mk
On 27/05/2016 2:28 AM, John Baldwin wrote: On Wednesday, May 25, 2016 03:27:07 PM Hans Petter Selasky wrote: On 05/11/16 00:32, John Baldwin wrote: Author: jhb Date: Tue May 10 22:32:23 2016 New Revision: 299393 URL: https://svnweb.freebsd.org/changeset/base/299393 Log: Change the default installation directory for modules to /boot/modules. Kernel installs always override KMODDIR when installing modules, so this default setting is only used for standalone module builds. Many out-of-tree modules manually override KMODDIR already to avoid placing modules in /boot/kernel. This now makes that behavior the default. Discussed on:arch@ Reviewed by: imp Relnotes:yes Just a small nit: There is a comment in bsd.own.mk which needs updating too: # # KMODDIR Base path for loadable kernel modules # (see kld(4)). [/boot/kernel] Oops, thanks. Fixed. the comment should also mention it does not cover in-tree modules. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300983 - in head: lib/libc/sys sys/kern
Author: jamie Date: Mon May 30 05:21:24 2016 New Revision: 300983 URL: https://svnweb.freebsd.org/changeset/base/300983 Log: Mark jail(2), and the sysctls that it (and only it) uses as deprecated. jail(8) has long used jail_set(2), and those sysctl only cause confusion. Modified: head/lib/libc/sys/jail.2 head/sys/kern/kern_jail.c Modified: head/lib/libc/sys/jail.2 == --- head/lib/libc/sys/jail.2Mon May 30 04:48:06 2016(r300982) +++ head/lib/libc/sys/jail.2Mon May 30 05:21:24 2016(r300983) @@ -106,7 +106,7 @@ pointers can be set to an arrays of IPv4 the prison, or NULL if none. IPv4 addresses must be in network byte order. .Pp -This is equivalent to the +This is equivalent to, and deprecated in favor of, the .Fn jail_set system call (see below), with the parameters .Va path , Modified: head/sys/kern/kern_jail.c == --- head/sys/kern/kern_jail.c Mon May 30 04:48:06 2016(r300982) +++ head/sys/kern/kern_jail.c Mon May 30 05:21:24 2016(r300983) @@ -4276,7 +4276,7 @@ SYSCTL_PROC(_security_jail, OID_AUTO, vn #if defined(INET) || defined(INET6) SYSCTL_UINT(_security_jail, OID_AUTO, jail_max_af_ips, CTLFLAG_RW, &jail_max_af_ips, 0, -"Number of IP addresses a jail may have at most per address family"); +"Number of IP addresses a jail may have at most per address family (deprecated)"); #endif /* @@ -4316,59 +4316,59 @@ sysctl_jail_default_allow(SYSCTL_HANDLER SYSCTL_PROC(_security_jail, OID_AUTO, set_hostname_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_SET_HOSTNAME, sysctl_jail_default_allow, "I", -"Processes in jail can set their hostnames"); +"Processes in jail can set their hostnames (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, socket_unixiproute_only, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, (void *)1, PR_ALLOW_SOCKET_AF, sysctl_jail_default_allow, "I", -"Processes in jail are limited to creating UNIX/IP/route sockets only"); +"Processes in jail are limited to creating UNIX/IP/route sockets only (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, sysvipc_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_SYSVIPC, sysctl_jail_default_allow, "I", -"Processes in jail can use System V IPC primitives"); +"Processes in jail can use System V IPC primitives (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, allow_raw_sockets, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_RAW_SOCKETS, sysctl_jail_default_allow, "I", -"Prison root can create raw sockets"); +"Prison root can create raw sockets (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, chflags_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_CHFLAGS, sysctl_jail_default_allow, "I", -"Processes in jail can alter system file flags"); +"Processes in jail can alter system file flags (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT, sysctl_jail_default_allow, "I", -"Processes in jail can mount/unmount jail-friendly file systems"); +"Processes in jail can mount/unmount jail-friendly file systems (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_devfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_DEVFS, sysctl_jail_default_allow, "I", -"Processes in jail can mount the devfs file system"); +"Processes in jail can mount the devfs file system (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_fdescfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_FDESCFS, sysctl_jail_default_allow, "I", -"Processes in jail can mount the fdescfs file system"); +"Processes in jail can mount the fdescfs file system (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_nullfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_NULLFS, sysctl_jail_default_allow, "I", -"Processes in jail can mount the nullfs file system"); +"Processes in jail can mount the nullfs file system (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_procfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_PROCFS, sysctl_jail_default_allow, "I", -"Processes in jail can mount the procfs file system"); +"Processes in jail can mount the procfs file system (deprecated)"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_linprocfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_LINPROCFS, sysctl_jail_default_allow, "I", -"Processes in jail can mount the linprocfs file system"); +"Processes in jail can mount the linprocfs file system (deprecated)"); SYSCTL_PROC(_security_jail,
Re: svn commit: r300965 - head/lib/libc/stdlib
On 30.05.2016 6:09, Bruce Evans wrote: > On Sun, 29 May 2016, Conrad Meyer wrote: > >> Does clang actually generate different code with this change? > > It should, on exotic arches. > >> On Sun, May 29, 2016 at 9:39 AM, Andrey A. Chernov >> wrote: >>> Log: >>> Micro optimize: C standard guarantees that right shift for unsigned >>> value >>> fills left bits with zero, and we have exact 32bit unsigned value >>> (uint32_t), so there is no reason to add "& 0x7fff" here. > > Using uint32_t at all is an unportable pessimization. On exotic arches > that don't have native uint32_t registers, a theoretically perfect > implementation wouldn't implement uint32_t. This would expose the > brokenness of broken code, so a practical implementation would emulate > uint32_t so that the broken code would just run slower for arithmetic > and much slower for locked memory operations. > > uint32_t might be implemented not very slowly using 128-bit integer > registers, or more slowly using the 53-bit mantissa part of an IEEE > double precision floating point register. > > If uint32_t is emulated, then the compiler is forced to act as if the > code uses a longer type and does "& 0x" after every operation. > Thes extra operations can only be combined sometimes. More careful > code can use a minimal number of this or similar "&" operations. In > checksum calculations, one "&" at the end is usually enough. > >>> Modified: head/lib/libc/stdlib/random.c > > random.c was mostly written before uint32_t was standard, so it used > u_long and long. Perhaps it wasn't careful enough with the "&"s to > actually work unless u_long is precisely uint32_t and long is normal > 2's complement with benign overflow. > > Anyway, it was "fixed" (unimproved) using s/u_long/uint32_/ in most > places where the API/ABI doesn't require longs (there is 1 dubious > long left in a comment). The correct fix is s/u_long/uint_fast32_t > in most places and s/u_long/uint_least32_t/ in some places and then > fix any missing "&"'s. The "fast" and "least" types always exist, > unlike the fixed-width types, and using them asks for time/space > efficiency instead of emulated fixed-width. > > On non-exotic arches, fast == least == fixed-width, so the correct > substitution works as a quick fix even with missing "&"s. > > It is not necessary to use the newfangled standard integer types to > fix this here, since correct use of long types would work (they give > 32 bits), but long is wasteful if it actually 64 bits or longer. > > Even larger problems are looming with uintmax_t. Any code that is > careful enough to use it is likely to break or be bloated if it is > expanded. This is just like using u_long in old random(). > >>> == >>> >>> --- head/lib/libc/stdlib/random.c Sun May 29 16:32:56 >>> 2016(r300964) >>> +++ head/lib/libc/stdlib/random.c Sun May 29 16:39:28 >>> 2016(r300965) >>> @@ -430,7 +430,7 @@ random(void) >>> */ >>> f = fptr; r = rptr; >>> *f += *r; >>> - i = (*f >> 1) & 0x7fff; /* chucking least >>> random bit */ >>> + i = *f >> 1;/* chucking least random bit */ > > This gives an "&" to restore in the version with correct substitutions. > > It also breaks the indentation. (This file mostly indents comments to the > right of code to column 40, but column 48 was used here and now column 32 > is used.) > >>> if (++f >= end_ptr) { >>> f = state; >>> ++r; > > Bruce > I don't introduce uint32_t and int32_t here and don't have a slightest idea of which types will be better to change them. F.e. *f += *r; suppose unsigned 32bit overflow which don't naturally happens for large types. Assigning uint32_t to some large type then clip it to smaller after calculation - all of that can produce more code than save for calculation itself. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300984 - head/lib/clang/include/clang/Basic
Author: dim Date: Mon May 30 06:44:10 2016 New Revision: 300984 URL: https://svnweb.freebsd.org/changeset/base/300984 Log: Bump __FreeBSD_cc_version after r300974. Modified: head/lib/clang/include/clang/Basic/Version.inc Modified: head/lib/clang/include/clang/Basic/Version.inc == --- head/lib/clang/include/clang/Basic/Version.inc Mon May 30 05:21:24 2016(r300983) +++ head/lib/clang/include/clang/Basic/Version.inc Mon May 30 06:44:10 2016(r300984) @@ -9,4 +9,4 @@ #defineSVN_REVISION"262564" -#defineFREEBSD_CC_VERSION 112U +#defineFREEBSD_CC_VERSION 113U ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r300985 - head/sys/dev/bge
Author: sephe Date: Mon May 30 06:49:01 2016 New Revision: 300985 URL: https://svnweb.freebsd.org/changeset/base/300985 Log: bge: Support 5717 C0, which is almost same as 5720 A0 PR: 209758 Obtained from:DragonFlyBSD d79f5d8f5fe94cd6769207b2901422977d502bc0 MFC after:1 week Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c == --- head/sys/dev/bge/if_bge.c Mon May 30 06:44:10 2016(r300984) +++ head/sys/dev/bge/if_bge.c Mon May 30 06:49:01 2016(r300985) @@ -171,6 +171,7 @@ static const struct bge_type { { BCOM_VENDORID,BCOM_DEVICEID_BCM5715 }, { BCOM_VENDORID,BCOM_DEVICEID_BCM5715S }, { BCOM_VENDORID,BCOM_DEVICEID_BCM5717 }, + { BCOM_VENDORID,BCOM_DEVICEID_BCM5717C }, { BCOM_VENDORID,BCOM_DEVICEID_BCM5718 }, { BCOM_VENDORID,BCOM_DEVICEID_BCM5719 }, { BCOM_VENDORID,BCOM_DEVICEID_BCM5720 }, @@ -311,6 +312,7 @@ static const struct bge_revision { { BGE_CHIPID_BCM5715_A3,"BCM5715 A3" }, { BGE_CHIPID_BCM5717_A0,"BCM5717 A0" }, { BGE_CHIPID_BCM5717_B0,"BCM5717 B0" }, + { BGE_CHIPID_BCM5717_C0,"BCM5717 C0" }, { BGE_CHIPID_BCM5719_A0,"BCM5719 A0" }, { BGE_CHIPID_BCM5720_A0,"BCM5720 A0" }, { BGE_CHIPID_BCM5755_A0,"BCM5755 A0" }, @@ -2699,6 +2701,7 @@ bge_chipid(device_t dev) */ switch (pci_get_device(dev)) { case BCOM_DEVICEID_BCM5717: + case BCOM_DEVICEID_BCM5717C: case BCOM_DEVICEID_BCM5718: case BCOM_DEVICEID_BCM5719: case BCOM_DEVICEID_BCM5720: @@ -2727,6 +2730,8 @@ bge_chipid(device_t dev) default: id = pci_read_config(dev, BGE_PCI_PRODID_ASICREV, 4); } + if (id == BGE_CHIPID_BCM5717_C0) + id = BGE_CHIPID_BCM5720_A0; } return (id); } Modified: head/sys/dev/bge/if_bgereg.h == --- head/sys/dev/bge/if_bgereg.hMon May 30 06:44:10 2016 (r300984) +++ head/sys/dev/bge/if_bgereg.hMon May 30 06:49:01 2016 (r300985) @@ -329,6 +329,7 @@ #defineBGE_CHIPID_BCM57780_A1 0x57780001 #defineBGE_CHIPID_BCM5717_A0 0x05717000 #defineBGE_CHIPID_BCM5717_B0 0x05717100 +#defineBGE_CHIPID_BCM5717_C0 0x05717200 #defineBGE_CHIPID_BCM5719_A0 0x05719000 #defineBGE_CHIPID_BCM5720_A0 0x0572 #defineBGE_CHIPID_BCM5762_A0 0x05762000 @@ -2452,6 +2453,7 @@ struct bge_status_block { #defineBCOM_DEVICEID_BCM5715 0x1678 #defineBCOM_DEVICEID_BCM5715S 0x1679 #defineBCOM_DEVICEID_BCM5717 0x1655 +#defineBCOM_DEVICEID_BCM5717C 0x1665 #defineBCOM_DEVICEID_BCM5718 0x1656 #defineBCOM_DEVICEID_BCM5719 0x1657 #defineBCOM_DEVICEID_BCM5720_PP0x1658 /* Not released to public. */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"