Re: svn commit: r225947 - head/sys/netinet
On Sun, Oct 09, 2011 at 10:11:56PM -0700, Qing Li wrote: Q What confuses me most, is that in lines 1435-1445 you are Q assigning error to a positive value, BUT proceeding further Q with function. Q QThis is what was there before (meaning returning error immediately), Qbut I guess a couple of folks felt it looked a bit cluttered. QThis is mostly due to the fact the RTFREE_LOCKED() operation Qhas to be performed before returning. Well, we can assign error and then goto done label. Assigning error and continuing processing is confusing, isn't it? Q Well, after third review it is clear, that Q next if() case would definitely be true, and you would proceed Q with return. But that is difficult to see from first glance. Q QNot so, only for an indirect prefix route. Q Q I'd suggest to remove error variable, return immediately in Q all error cases, and also the RTF_GATEWAY check can be shifted up, Q since it is the most simple and the most usual to be true. Q Q Q No, the RTF_GATEWAY check cannot be shifted up because if we did Q that, the (indirect host route, with destination matching the gateway IP) Q would never be executed, if when that set of conditions are true, which is Q allowed and the reason for the patch in the first place. Can you elaborate on that please? As far as I see, any rtentry that has RTF_GATEWAY would return with EINVAL. The first if() clause doesn't do any actual processing, only checking flags and memcmp()ing. The third clause either. The error is never reset to 0. So, I don't see any difference in returning EINVAL for RTF_GATEWAY immediately or later after other checks. -- Totus tuus, Glebius. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r226183 - head/sys/teken
Author: ed Date: Mon Oct 10 06:13:27 2011 New Revision: 226183 URL: http://svn.freebsd.org/changeset/base/226183 Log: Properly use the cursor to bound the position for CUP. We must take the origin region into account when clamping the cursor position. MFC after:3 days Modified: head/sys/teken/teken_subr.h Modified: head/sys/teken/teken_subr.h == --- head/sys/teken/teken_subr.h Mon Oct 10 02:54:58 2011(r226182) +++ head/sys/teken/teken_subr.h Mon Oct 10 06:13:27 2011(r226183) @@ -325,7 +325,7 @@ teken_subr_cursor_position(teken_t *t, u { t-t_cursor.tp_row = t-t_originreg.ts_begin + row - 1; - if (row = t-t_originreg.ts_end) + if (t-t_cursor.tp_row = t-t_originreg.ts_end) t-t_cursor.tp_row = t-t_originreg.ts_end - 1; t-t_cursor.tp_col = col - 1; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r226184 - head/usr.bin/gzip
Author: delphij Date: Mon Oct 10 06:37:32 2011 New Revision: 226184 URL: http://svn.freebsd.org/changeset/base/226184 Log: Incorporate recent changes from NetBSD. Most notable change is the addition of support of decompressing xz files. Obtained from:NetBSD Added: head/usr.bin/gzip/unxz.c (contents, props changed) Modified: head/usr.bin/gzip/Makefile head/usr.bin/gzip/gzip.1 head/usr.bin/gzip/gzip.c Modified: head/usr.bin/gzip/Makefile == --- head/usr.bin/gzip/Makefile Mon Oct 10 06:13:27 2011(r226183) +++ head/usr.bin/gzip/Makefile Mon Oct 10 06:37:32 2011(r226184) @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.13 2009/04/14 22:15:20 lukem Exp $ +# $NetBSD: Makefile,v 1.16 2011/06/21 13:25:45 joerg Exp $ # $FreeBSD$ .include bsd.own.mk @@ -6,8 +6,8 @@ PROG= gzip MAN= gzip.1 gzexe.1 zdiff.1 zforce.1 zmore.1 znew.1 -DPADD= ${LIBZ} -LDADD= -lz +DPADD= ${LIBZ} ${LIBLZMA} +LDADD= -lz -llzma .if ${MK_BZIP2_SUPPORT} != no DPADD+=${LIBBZ2} Modified: head/usr.bin/gzip/gzip.1 == --- head/usr.bin/gzip/gzip.1Mon Oct 10 06:13:27 2011(r226183) +++ head/usr.bin/gzip/gzip.1Mon Oct 10 06:37:32 2011(r226184) @@ -1,4 +1,4 @@ -.\$NetBSD: gzip.1,v 1.20 2009/04/01 08:15:37 mrg Exp $ +.\$NetBSD: gzip.1,v 1.21 2011/06/19 02:22:36 christos Exp $ .\ .\ Copyright (c) 1997, 2003, 2004 Matthew R. Green .\ All rights reserved. @@ -25,7 +25,7 @@ .\ SUCH DAMAGE. .\ .\ $FreeBSD$ -.Dd May 23, 2011 +.Dd October 9, 2011 .Dt GZIP 1 .Os .Sh NAME @@ -185,6 +185,7 @@ Options on the command line will overrid .Sh SEE ALSO .Xr bzip2 1 , .Xr compress 1 , +.Xr xz 1 , .Xr fts 3 , .Xr zlib 3 .Sh HISTORY Modified: head/usr.bin/gzip/gzip.c == --- head/usr.bin/gzip/gzip.cMon Oct 10 06:13:27 2011(r226183) +++ head/usr.bin/gzip/gzip.cMon Oct 10 06:37:32 2011(r226184) @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.99 2011/03/23 12:59:44 tsutsui Exp $*/ +/* $NetBSD: gzip.c,v 1.105 2011/08/30 23:06:00 joerg Exp $ */ /*- * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green @@ -77,6 +77,9 @@ enum filetype { #ifndef NO_PACK_SUPPORT FT_PACK, #endif +#ifndef NO_XZ_SUPPORT + FT_XZ, +#endif FT_LAST, FT_UNKNOWN }; @@ -97,6 +100,12 @@ enum filetype { #define PACK_MAGIC \037\036 #endif +#ifndef NO_XZ_SUPPORT +#include lzma.h +#define XZ_SUFFIX .xz +#define XZ_MAGIC \3757zXZ +#endif + #define GZ_SUFFIX .gz #define BUFLEN (64 * 1024) @@ -139,6 +148,9 @@ static suffixes_t suffixes[] = { #ifndef NO_COMPRESS_SUPPORT SUFFIX(Z_SUFFIX,), #endif +#ifndef NO_XZ_SUPPORT + SUFFIX(XZ_SUFFIX, ), +#endif SUFFIX(GZ_SUFFIX, ),/* Overwritten by -S */ #endif /* SMALL */ #undef SUFFIX @@ -146,7 +158,7 @@ static suffixes_t suffixes[] = { #define NUM_SUFFIXES (sizeof suffixes / sizeof suffixes[0]) #define SUFFIX_MAXLEN 30 -static const char gzip_version[] = FreeBSD gzip 20110523; +static const char gzip_version[] = FreeBSD gzip 20111009; #ifndef SMALL static const char gzip_copyright[] = \ @@ -199,16 +211,13 @@ staticint exit_value = 0; /* exit valu static char*infile;/* name of file coming in */ -static voidmaybe_err(const char *fmt, ...) __dead2 -__attribute__((__format__(__printf__, 1, 2))); -#if !defined(NO_BZIP2_SUPPORT) || !defined(NO_PACK_SUPPORT) -static voidmaybe_errx(const char *fmt, ...) __dead2 -__attribute__((__format__(__printf__, 1, 2))); -#endif -static voidmaybe_warn(const char *fmt, ...) -__attribute__((__format__(__printf__, 1, 2))); -static voidmaybe_warnx(const char *fmt, ...) -__attribute__((__format__(__printf__, 1, 2))); +static voidmaybe_err(const char *fmt, ...) __printflike(1, 2) __dead2; +#if !defined(NO_BZIP2_SUPPORT) || !defined(NO_PACK_SUPPORT) || \ +!defined(NO_XZ_SUPPORT) +static voidmaybe_errx(const char *fmt, ...) __printflike(1, 2) __dead2; +#endif +static voidmaybe_warn(const char *fmt, ...) __printflike(1, 2); +static voidmaybe_warnx(const char *fmt, ...) __printflike(1, 2); static enum filetype file_gettype(u_char *); #ifdef SMALL #define gz_compress(if, of, sz, fn, tm) gz_compress(if, of, sz) @@ -223,8 +232,8 @@ static voidhandle_stdin(void); static voidhandle_stdout(void); static voidprint_ratio(off_t, off_t, FILE *); static voidprint_list(int fd, off_t, const char *, time_t); -static voidusage(void); -static voiddisplay_version(void); +static voidusage(void) __dead2; +static voiddisplay_version(void) __dead2; #ifndef SMALL
Re: svn commit: r225947 - head/sys/netinet
Okay, now I know what's confusing you ... it's that bug I introduced :-) The 2nd if() check on the RTF_GATEWAY flag should have been an else if(). In a nutshell, the logic is any indirect route should fail the check, except for that special host route. Attached is the rework of that part of the patch, with some cleaning up per your suggestion. Thank you very much for catching that bug. --Qing Q Well, after third review it is clear, that Q next if() case would definitely be true, and you would proceed Q with return. But that is difficult to see from first glance. Q Q Not so, only for an indirect prefix route. Q Q I'd suggest to remove error variable, return immediately in Q all error cases, and also the RTF_GATEWAY check can be shifted up, Q since it is the most simple and the most usual to be true. Q Q Q No, the RTF_GATEWAY check cannot be shifted up because if we did Q that, the (indirect host route, with destination matching the gateway IP) Q would never be executed, if when that set of conditions are true, which is Q allowed and the reason for the patch in the first place. Can you elaborate on that please? As far as I see, any rtentry that has RTF_GATEWAY would return with EINVAL. The first if() clause doesn't do any actual processing, only checking flags and memcmp()ing. The third clause either. The error is never reset to 0. So, I don't see any difference in returning EINVAL for RTF_GATEWAY immediately or later after other checks. in.c.diff Description: Binary data ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r226185 - head/sys/kgssapi/krb5
Author: brueffer Date: Mon Oct 10 09:13:07 2011 New Revision: 226185 URL: http://svn.freebsd.org/changeset/base/226185 Log: Add missing break statement to make sure all 3DES etypes really are treated the same. CID: 3624 Found with: Coverity Prevent(tm) Reviewed by: dfr MFC after:1 week Modified: head/sys/kgssapi/krb5/krb5_mech.c Modified: head/sys/kgssapi/krb5/krb5_mech.c == --- head/sys/kgssapi/krb5/krb5_mech.c Mon Oct 10 06:37:32 2011 (r226184) +++ head/sys/kgssapi/krb5/krb5_mech.c Mon Oct 10 09:13:07 2011 (r226185) @@ -288,6 +288,7 @@ get_keys(struct krb5_context *kc) case ETYPE_DES3_CBC_SHA1: case ETYPE_OLD_DES3_CBC_SHA1: etype = ETYPE_DES3_CBC_SHA1; + break; default: etype = keydata-kk_type; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r226186 - head/sys/netgraph
Author: melifaro Date: Mon Oct 10 09:33:07 2011 New Revision: 226186 URL: http://svn.freebsd.org/changeset/base/226186 Log: Free mbuf in case when protocol in unknown in ng_ipfw_rcvdata(). This change fixes (theoretically) possible mbuf leak introduced in r225586. Reorder code a bit and change return codes to be more specific Reviewed by: glebius Approved by:kib (mentor) Modified: head/sys/netgraph/ng_ipfw.c Modified: head/sys/netgraph/ng_ipfw.c == --- head/sys/netgraph/ng_ipfw.c Mon Oct 10 09:13:07 2011(r226185) +++ head/sys/netgraph/ng_ipfw.c Mon Oct 10 09:33:07 2011(r226186) @@ -242,7 +242,7 @@ ng_ipfw_rcvdata(hook_p hook, item_p item if (m-m_len sizeof(struct ip) (m = m_pullup(m, sizeof(struct ip))) == NULL) - return (EINVAL); + return (ENOBUFS); ip = mtod(m, struct ip *); @@ -252,18 +252,14 @@ ng_ipfw_rcvdata(hook_p hook, item_p item #ifdef INET case IPVERSION: ip_input(m); - break; + return (0); #endif #ifdef INET6 case IPV6_VERSION 4: ip6_input(m); - break; + return (0); #endif - default: - NG_FREE_M(m); - return (EINVAL); } - return (0); } else { switch (ip-ip_v) { #ifdef INET @@ -277,10 +273,12 @@ ng_ipfw_rcvdata(hook_p hook, item_p item return (ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL)); #endif - default: - return (EINVAL); } } + + /* unknown IP protocol version */ + NG_FREE_M(m); + return (EPROTONOSUPPORT); } static int ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r226203 - head/sys/netinet
Author: tuexen Date: Mon Oct 10 12:28:47 2011 New Revision: 226203 URL: http://svn.freebsd.org/changeset/base/226203 Log: When moving an stcb to a new inp and we copy over the list of bound addresses, update the last used address pointer. If not, it might result in a crash if the old inp goes away. MFC after: 3 days. Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c == --- head/sys/netinet/sctp_pcb.c Mon Oct 10 12:27:40 2011(r226202) +++ head/sys/netinet/sctp_pcb.c Mon Oct 10 12:28:47 2011(r226203) @@ -2786,6 +2786,9 @@ sctp_move_pcb_and_assoc(struct sctp_inpc LIST_INSERT_HEAD(new_inp-sctp_addr_list, laddr, sctp_nxt_addr); new_inp-laddr_count++; + if (oladdr == stcb-asoc.last_used_address) { + stcb-asoc.last_used_address = laddr; + } } } /* ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r226151 - head/usr.bin/kdump
Hi, On 2011-10-08, Dag-Erling Smorgrav wrote: Fix casting. Modified: head/usr.bin/kdump/kdump.c == --- head/usr.bin/kdump/kdump.cSat Oct 8 12:10:16 2011 (r226150) +++ head/usr.bin/kdump/kdump.cSat Oct 8 12:21:51 2011 (r226151) @@ -110,15 +110,16 @@ struct ktr_header ktr_header; #define TIME_FORMAT %b %e %T %Y #define eqs(s1, s2) (strcmp((s1), (s2)) == 0) -#define print_number(i,n,c) do { \ - if (decimal)\ - printf(%c%ld, c, (long)*i); \ - else\ - printf(%c%#lx, c, (long)*i); \ - i++;\ - n--;\ - c = ',';\ - } while (0); +#define print_number(i,n,c) \ + do {\ + if (decimal)\ + printf(%c%jd, c, (intmax_t)*i); \ + else\ + printf(%c%#jx, c, (intmax_t)*i); \ + i++;\ + n--;\ + c = ',';\ + } while (0) Are you sure that this change doesn't cause a regression on platforms where sizeof(long) != sizeof(intmax_t)? For example, previously, on i386 print_number() printed 0x for -1 while after your change it will print 0x (with %#jx). -- Jaakko ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r226216 - head/share/mk
Author: das Date: Mon Oct 10 15:39:29 2011 New Revision: 226216 URL: http://svn.freebsd.org/changeset/base/226216 Log: Pass -std= flags in CFLAGS to mkdep. Without this, preprocessor tests for particular compiler features might be evaluated differently by mkdep than they would be by cc. Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk == --- head/share/mk/bsd.dep.mkMon Oct 10 14:48:18 2011(r226215) +++ head/share/mk/bsd.dep.mkMon Oct 10 15:39:29 2011(r226216) @@ -125,8 +125,8 @@ depend: beforedepend ${DEPENDFILE} after # Different types of sources are compiled with slightly different flags. # Split up the sources, and filter out headers and non-applicable flags. -MKDEP_CFLAGS= ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BIDU]*} -MKDEP_CXXFLAGS=${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BIDU]*} +MKDEP_CFLAGS= ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BIDU]*} ${CFLAGS:M-std=*} +MKDEP_CXXFLAGS=${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BIDU]*} ${CFLAGS:M-std=*} DPSRCS+= ${SRCS} ${DEPENDFILE}: ${DPSRCS} ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r226217 - head/lib/libc
Author: das Date: Mon Oct 10 15:42:33 2011 New Revision: 226217 URL: http://svn.freebsd.org/changeset/base/226217 Log: Add a FBSD_1.3 namespace for FreeBSD 10. Modified: head/lib/libc/Versions.def Modified: head/lib/libc/Versions.def == --- head/lib/libc/Versions.def Mon Oct 10 15:39:29 2011(r226216) +++ head/lib/libc/Versions.def Mon Oct 10 15:42:33 2011(r226217) @@ -19,6 +19,10 @@ FBSD_1.1 { FBSD_1.2 { } FBSD_1.1; +# This version was first added to 10.0-current. +FBSD_1.3 { +} FBSD_1.2; + # This is our private namespace. Any global interfaces that are # strictly for use only by other FreeBSD applications and libraries # are listed here. We use a separate namespace so we can write @@ -26,4 +30,4 @@ FBSD_1.2 { # # Please do NOT increment the version of this namespace. FBSDprivate_1.0 { -} FBSD_1.2; +} FBSD_1.3; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r226218 - in head/lib/msun: . amd64 arm i387 ia64 mips powerpc sparc64
Author: das Date: Mon Oct 10 15:43:09 2011 New Revision: 226218 URL: http://svn.freebsd.org/changeset/base/226218 Log: Provide external definitions of all of the standardized functions in fenv.h that are currently inlined. The definitions are provided in fenv.c via 'extern inline' declaractions. This assumes the compiler handles 'extern inline' as specified in C99, which has been true under FreeBSD since 8.0. The goal is to eventually remove the 'static' keyword from the inline definitions in fenv.h, so that non-inlined references all wind up pointing to the same external definition like they're supposed to. I am deferring the second step to provide a window where newly-compiled apps will still link against old math libraries. (This isn't supported, but there's no need to cause undue breakage.) Reviewed by:stefanf, bde Modified: head/lib/msun/Symbol.map head/lib/msun/amd64/Symbol.map head/lib/msun/amd64/fenv.c head/lib/msun/amd64/fenv.h head/lib/msun/arm/Symbol.map head/lib/msun/arm/fenv.c head/lib/msun/arm/fenv.h head/lib/msun/i387/Symbol.map head/lib/msun/i387/fenv.c head/lib/msun/i387/fenv.h head/lib/msun/ia64/Symbol.map head/lib/msun/ia64/fenv.c head/lib/msun/ia64/fenv.h head/lib/msun/mips/Symbol.map head/lib/msun/mips/fenv.c head/lib/msun/mips/fenv.h head/lib/msun/powerpc/Symbol.map head/lib/msun/powerpc/fenv.c head/lib/msun/powerpc/fenv.h head/lib/msun/sparc64/Symbol.map head/lib/msun/sparc64/fenv.c head/lib/msun/sparc64/fenv.h Modified: head/lib/msun/Symbol.map == --- head/lib/msun/Symbol.mapMon Oct 10 15:42:33 2011(r226217) +++ head/lib/msun/Symbol.mapMon Oct 10 15:43:09 2011(r226218) @@ -228,3 +228,13 @@ FBSD_1.2 { log2; log2f; }; + +/* First added in 10.0-CURRENT */ +FBSD_1.3 { + feclearexcept; + fegetexceptflag; + fetestexcept; + fegetround; + fesetround; + fesetenv; +}; Modified: head/lib/msun/amd64/Symbol.map == --- head/lib/msun/amd64/Symbol.map Mon Oct 10 15:42:33 2011 (r226217) +++ head/lib/msun/amd64/Symbol.map Mon Oct 10 15:43:09 2011 (r226218) @@ -7,8 +7,6 @@ FBSD_1.0 { fegetenv; feholdexcept; feupdateenv; - __feenableexcept; - __fedisableexcept; feenableexcept; fedisableexcept; }; Modified: head/lib/msun/amd64/fenv.c == --- head/lib/msun/amd64/fenv.c Mon Oct 10 15:42:33 2011(r226217) +++ head/lib/msun/amd64/fenv.c Mon Oct 10 15:43:09 2011(r226218) @@ -29,8 +29,14 @@ #include sys/cdefs.h #include sys/types.h #include machine/fpu.h + +#define__fenv_static #include fenv.h +#ifdef __GNUC_GNU_INLINE__ +#error This file must be compiled with C99 'inline' semantics +#endif + const fenv_t __fe_dfl_env = { { 0x | __INITIAL_FPUCW__, 0x, @@ -41,6 +47,9 @@ const fenv_t __fe_dfl_env = { __INITIAL_MXCSR__ }; +extern inline int feclearexcept(int __excepts); +extern inline int fegetexceptflag(fexcept_t *__flagp, int __excepts); + int fesetexceptflag(const fexcept_t *flagp, int excepts) { @@ -69,6 +78,10 @@ feraiseexcept(int excepts) return (0); } +extern inline int fetestexcept(int __excepts); +extern inline int fegetround(void); +extern inline int fesetround(int __round); + int fegetenv(fenv_t *envp) { @@ -98,6 +111,8 @@ feholdexcept(fenv_t *envp) return (0); } +extern inline int fesetenv(const fenv_t *__envp); + int feupdateenv(const fenv_t *envp) { Modified: head/lib/msun/amd64/fenv.h == --- head/lib/msun/amd64/fenv.h Mon Oct 10 15:42:33 2011(r226217) +++ head/lib/msun/amd64/fenv.h Mon Oct 10 15:43:09 2011(r226218) @@ -32,6 +32,10 @@ #include sys/cdefs.h #include sys/_types.h +#ifndef__fenv_static +#define__fenv_static static +#endif + typedef struct { struct { __uint32_t __control; @@ -89,7 +93,7 @@ extern const fenv_t __fe_dfl_env; #define__ldmxcsr(__csr)__asm __volatile(ldmxcsr %0 : : m (__csr)) #define__stmxcsr(__csr)__asm __volatile(stmxcsr %0 : =m (*(__csr))) -static __inline int +__fenv_static inline int feclearexcept(int __excepts) { fenv_t __env; @@ -107,7 +111,7 @@ feclearexcept(int __excepts) return (0); } -static __inline int +__fenv_static inline int fegetexceptflag(fexcept_t *__flagp, int __excepts) { __uint32_t __mxcsr; @@ -122,7 +126,7 @@ fegetexceptflag(fexcept_t *__flagp, int int fesetexceptflag(const fexcept_t *__flagp, int __excepts); int feraiseexcept(int __excepts); -static __inline int
svn commit: r226219 - head/sys/dev/usb/serial
Author: hselasky Date: Mon Oct 10 15:54:44 2011 New Revision: 226219 URL: http://svn.freebsd.org/changeset/base/226219 Log: Bugfix: The ucom detach function is sometimes called on zeroed structures. Check for this case and just return, so that the UCOM unit number zero is not accidentially freed. Submitted by: Danish FreeBSD user at EuroBSDcon 2011 MFC after:3 days Modified: head/sys/dev/usb/serial/usb_serial.c Modified: head/sys/dev/usb/serial/usb_serial.c == --- head/sys/dev/usb/serial/usb_serial.cMon Oct 10 15:43:09 2011 (r226218) +++ head/sys/dev/usb/serial/usb_serial.cMon Oct 10 15:54:44 2011 (r226219) @@ -289,6 +289,9 @@ ucom_detach(struct ucom_super_softc *ssc { uint32_t subunit; + if (ssc-sc_subunits == 0) + return; /* not initialized */ + usb_proc_drain(ssc-sc_tq); for (subunit = 0; subunit ssc-sc_subunits; subunit++) { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r226220 - head/lib/libusb
Author: hselasky Date: Mon Oct 10 16:13:33 2011 New Revision: 226220 URL: http://svn.freebsd.org/changeset/base/226220 Log: Fix how libusb20_dev_kernel_driver_active() and libusb_dev_kernel_driver_active() works. In case of libusb20 the manpage was wrong and in case of libusb10 the implementation was wrong. Submitted by: Kai Wang MFC after:3 days Modified: head/lib/libusb/libusb.3 head/lib/libusb/libusb10.c head/lib/libusb/libusb20.3 Modified: head/lib/libusb/libusb.3 == --- head/lib/libusb/libusb.3Mon Oct 10 15:54:44 2011(r226219) +++ head/lib/libusb/libusb.3Mon Oct 10 16:13:33 2011(r226220) @@ -223,8 +223,8 @@ code on failure. .Ft int .Fn libusb_kernel_driver_active libusb_device_handle *devh int interface Determine if a driver is active on a interface. -Returns 0 if no kernel driver -is active, 1 if a kernel driver is active, LIBUSB_ERROR_NO_DEVICE +Returns 0 if no kernel driver is active +and 1 if a kernel driver is active, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and a LIBUSB_ERROR code on failure. .Pp .Ft int Modified: head/lib/libusb/libusb10.c == --- head/lib/libusb/libusb10.c Mon Oct 10 15:54:44 2011(r226219) +++ head/lib/libusb/libusb10.c Mon Oct 10 16:13:33 2011(r226220) @@ -216,7 +216,6 @@ libusb_get_device_list(libusb_context *c libusb20_be_free(usb_backend); return (LIBUSB_ERROR_NO_MEM); } - /* get device into libUSB v1.0 list */ libusb20_be_dequeue_device(usb_backend, pdev); @@ -718,8 +717,10 @@ libusb_kernel_driver_active(struct libus if (pdev == NULL) return (LIBUSB_ERROR_INVALID_PARAM); - return (libusb20_dev_kernel_driver_active( - pdev, interface)); + if (libusb20_dev_kernel_driver_active(pdev, interface)) + return (0); /* no kernel driver is active */ + else + return (1); /* kernel driver is active */ } int Modified: head/lib/libusb/libusb20.3 == --- head/lib/libusb/libusb20.3 Mon Oct 10 15:54:44 2011(r226219) +++ head/lib/libusb/libusb20.3 Mon Oct 10 16:13:33 2011(r226220) @@ -614,10 +614,9 @@ The file descriptor can be used for poll .Pp . .Fn libusb20_dev_kernel_driver_active -returns a non-zero value if a kernel driver is active on -the given USB interface. +returns zero if a kernel driver is active on the given USB interface. . -Else zero is returned. +Else a LIBUSB20_ERROR value is returned. . .Pp . ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r226221 - in head/sys/dev/usb: . quirk
Author: hselasky Date: Mon Oct 10 16:26:06 2011 New Revision: 226221 URL: http://svn.freebsd.org/changeset/base/226221 Log: Add USB mass storage quirk for device that emits errors after the automatic no synchronize cache detection. Submitted by: Scott Allendorf MFC after:3 days Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c == --- head/sys/dev/usb/quirk/usb_quirk.c Mon Oct 10 16:13:33 2011 (r226220) +++ head/sys/dev/usb/quirk/usb_quirk.c Mon Oct 10 16:26:06 2011 (r226221) @@ -464,6 +464,7 @@ static struct usb_quirk_entry usb_quirks */ USB_QUIRK(FEIYA, DUMMY, 0x, 0x, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), USB_QUIRK(REALTEK, DUMMY, 0x, 0x, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), + USB_QUIRK(INITIO, DUMMY, 0x, 0x, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY), }; #undef USB_QUIRK_VP #undef USB_QUIRK Modified: head/sys/dev/usb/usbdevs == --- head/sys/dev/usb/usbdevsMon Oct 10 16:13:33 2011(r226220) +++ head/sys/dev/usb/usbdevsMon Oct 10 16:26:06 2011(r226221) @@ -606,6 +606,7 @@ vendor BALTECH 0x13ad Baltech vendor CISCOLINKSYS0x13b1 Cisco-Linksys vendor SHARK 0x13d2 Shark vendor AZUREWAVE 0x13d3 AsureWave +vendor INITIO 0x13fd Initio Corporation vendor EMTEC 0x13fe Emtec vendor NOVATEL 0x1410 Novatel Wireless vendor MERLIN 0x1416 Merlin @@ -1887,6 +1888,10 @@ product IBM USBCDROMDRIVE0x4427 USB CD- /* Imagination Technologies products */ product IMAGINATION DBX1 0x2107 DBX1 DSP core +/* Initio Corporation products */ +product INITIO DUMMY 0x Dummy product +product INITIO INIC_1610P 0x1e40 USB to SATA Bridge + /* Inside Out Networks products */ product INSIDEOUT EDGEPORT40x0001 EdgePort/4 serial ports ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r226222 - head/sys/netinet
Author: tuexen Date: Mon Oct 10 16:31:18 2011 New Revision: 226222 URL: http://svn.freebsd.org/changeset/base/226222 Log: Get struct sctp_net_route in tune with struct route. struct route was changed in http://svn.freebsd.org/changeset/base/225698 and since then SCTP support was broken. This needs to be MFCed to stable/9 to unbreak SCTP support in 9.0 MFC after: 3 days. Modified: head/sys/netinet/sctp_structs.h Modified: head/sys/netinet/sctp_structs.h == --- head/sys/netinet/sctp_structs.h Mon Oct 10 16:26:06 2011 (r226221) +++ head/sys/netinet/sctp_structs.h Mon Oct 10 16:31:18 2011 (r226222) @@ -191,6 +191,8 @@ struct iterator_control { struct sctp_net_route { sctp_rtentry_t *ro_rt; void *ro_lle; + void *ro_ia; + int ro_flags; union sctp_sockstore _l_addr; /* remote peer addr */ struct sctp_ifa *_s_addr; /* our selected src addr */ }; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r225947 - head/sys/netinet
On 10. Oct 2011, at 08:44 , Qing Li wrote: Hey, Okay, now I know what's confusing you ... it's that bug I introduced :-) The 2nd if() check on the RTF_GATEWAY flag should have been an else if(). In a nutshell, the logic is any indirect route should fail the check, except for that special host route. Attached is the rework of that part of the patch, with some cleaning up per your suggestion. Thank you very much for catching that bug. --Qing Q Well, after third review it is clear, that Q next if() case would definitely be true, and you would proceed Q with return. But that is difficult to see from first glance. Q QNot so, only for an indirect prefix route. Q Q I'd suggest to remove error variable, return immediately in Q all error cases, and also the RTF_GATEWAY check can be shifted up, Q since it is the most simple and the most usual to be true. Q Q Q No, the RTF_GATEWAY check cannot be shifted up because if we did Q that, the (indirect host route, with destination matching the gateway IP) Q would never be executed, if when that set of conditions are true, which is Q allowed and the reason for the patch in the first place. Can you elaborate on that please? As far as I see, any rtentry that has RTF_GATEWAY would return with EINVAL. The first if() clause doesn't do any actual processing, only checking flags and memcmp()ing. The third clause either. The error is never reset to 0. So, I don't see any difference in returning EINVAL for RTF_GATEWAY immediately or later after other checks. I am a bit confused by this entire thing; it seems it's only parts of what I had looked at initially but maybe the commit was split due to follow-ups on an early change. I am however happy that some things I had mentioned initially are now being addressed in the cleanup patch. I have not checked the logic changes on it however. Thanks, Bjoern -- Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family.___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r226216 - head/share/mk
On Mon, 10 Oct 2011, David Schultz wrote: Log: Pass -std= flags in CFLAGS to mkdep. Without this, preprocessor tests for particular compiler features might be evaluated differently by mkdep than they would be by cc. Same with -ansi and -pedantic and any other spellings of -std=. Bruce ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r226224 - head/sys/netinet
Author: qingli Date: Mon Oct 10 17:41:11 2011 New Revision: 226224 URL: http://svn.freebsd.org/changeset/base/226224 Log: All indirect routes will fail the rtcheck, except for a special host route where the destination IP and the gateway IP is the same. This special case handling is only meant for backward compatibility reason. The last commit introduced a bug in the route check logic, where a valid special case is treated as an error. This patch fixes that bug along with some code cleanup. Suggested by: gleb Reviewed by: kmacy, discussed with gleb MFC after:1 day Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c == --- head/sys/netinet/in.c Mon Oct 10 17:39:58 2011(r226223) +++ head/sys/netinet/in.c Mon Oct 10 17:41:11 2011(r226224) @@ -1414,8 +1414,6 @@ static int in_lltable_rtcheck(struct ifnet *ifp, u_int flags, const struct sockaddr *l3addr) { struct rtentry *rt; - struct ifnet *xifp; - int error = 0; KASSERT(l3addr-sa_family == AF_INET, (sin_family %d, l3addr-sa_family)); @@ -1432,21 +1430,16 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ * such as MANET, and the interface is of the correct type, then * allow for ARP to proceed. */ - if (rt-rt_flags (RTF_GATEWAY | RTF_HOST)) { - xifp = rt-rt_ifp; - - if (xifp (xifp-if_type != IFT_ETHER || -(xifp-if_flags (IFF_NOARP | IFF_STATICARP)) != 0)) - error = EINVAL; - - if (memcmp(rt-rt_gateway-sa_data, l3addr-sa_data, - sizeof(in_addr_t)) != 0) - error = EINVAL; - } - if (rt-rt_flags RTF_GATEWAY) { - RTFREE_LOCKED(rt); - return (EINVAL); + if (!(rt-rt_flags RTF_HOST) || !rt-rt_ifp || + rt-rt_ifp-if_type != IFT_ETHER || + (rt-rt_ifp-if_flags + (IFF_NOARP | IFF_STATICARP)) != 0 || + memcmp(rt-rt_gateway-sa_data, l3addr-sa_data, +sizeof(in_addr_t)) != 0) { + RTFREE_LOCKED(rt); + return (EINVAL); + } } /* @@ -1455,32 +1448,31 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ * interfaces have the same prefix. An incoming packet arrives * on one interface and the corresponding outgoing packet leaves * another interface. -* */ if (rt-rt_ifp != ifp) { - char *sa, *mask, *addr, *lim; + const char *sa, *mask, *addr, *lim; int len; - sa = (char *)rt_key(rt); - mask = (char *)rt_mask(rt); - addr = (char *)__DECONST(struct sockaddr *, l3addr); - len = ((struct sockaddr_in *)__DECONST(struct sockaddr *, l3addr))-sin_len; + sa = (const char *)rt_key(rt); + mask = (const char *)rt_mask(rt); + addr = (const char *)l3addr; + len = ((const struct sockaddr_in *)l3addr)-sin_len; lim = addr + len; for ( ; addr lim; sa++, mask++, addr++) { if ((*sa ^ *addr) *mask) { - error = EINVAL; #ifdef DIAGNOSTIC log(LOG_INFO, IPv4 address: \%s\ is not on the network\n, inet_ntoa(((const struct sockaddr_in *)l3addr)-sin_addr)); #endif - break; + RTFREE_LOCKED(rt); + return (EINVAL); } } } RTFREE_LOCKED(rt); - return (error); + return (0); } /* ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r226216 - head/share/mk
On Mon, Oct 10, 2011 at 03:39:29PM +, David Schultz wrote: Author: das Date: Mon Oct 10 15:39:29 2011 New Revision: 226216 URL: http://svn.freebsd.org/changeset/base/226216 Log: Pass -std= flags in CFLAGS to mkdep. Without this, preprocessor tests for particular compiler features might be evaluated differently by mkdep than they would be by cc. Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk == --- head/share/mk/bsd.dep.mk Mon Oct 10 14:48:18 2011(r226215) +++ head/share/mk/bsd.dep.mk Mon Oct 10 15:39:29 2011(r226216) @@ -125,8 +125,8 @@ depend: beforedepend ${DEPENDFILE} after # Different types of sources are compiled with slightly different flags. # Split up the sources, and filter out headers and non-applicable flags. -MKDEP_CFLAGS=${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BIDU]*} -MKDEP_CXXFLAGS= ${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BIDU]*} +MKDEP_CFLAGS=${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BIDU]*} ${CFLAGS:M-std=*} +MKDEP_CXXFLAGS= ${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BIDU]*} ${CFLAGS:M-std=*} So we are passing the -std from CFLAGS to CXXFLAGS now? ie. something like c++ -std=gnu99 ? roman ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r226184 - head/usr.bin/gzip
On 10/09/2011 23:37, Xin LI wrote: Log: Incorporate recent changes from NetBSD. Most notable change is the addition of support of decompressing xz files. Why? Don't we already have xz in the base? -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r226184 - head/usr.bin/gzip
On 10/10/2011 13:05, Xin LI wrote: On Mon, Oct 10, 2011 at 12:40 PM, Doug Barton do...@freebsd.org wrote: On 10/09/2011 23:37, Xin LI wrote: Log: Incorporate recent changes from NetBSD. Most notable change is the addition of support of decompressing xz files. Why? Don't we already have xz in the base? zless and friends rely on gunzip. I'm sorry, I don't understand that answer. -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r226224 - head/sys/netinet
Qing, On Mon, Oct 10, 2011 at 05:41:11PM +, Qing Li wrote: Q Author: qingli Q Date: Mon Oct 10 17:41:11 2011 Q New Revision: 226224 Q URL: http://svn.freebsd.org/changeset/base/226224 Q Q Log: Q All indirect routes will fail the rtcheck, except for a special host Q route where the destination IP and the gateway IP is the same. This Q special case handling is only meant for backward compatibility reason. Q The last commit introduced a bug in the route check logic, where a Q valid special case is treated as an error. This patch fixes that bug Q along with some code cleanup. Q Q Suggested by: gleb Q Reviewed by: kmacy, discussed with gleb Q MFC after: 1 day Looks like you have committed a slightly different patch to stable/8 in r226230. Is that okay? Also, you haven't awaited even one day, while our policy suggests at least 3 days before MFC, and 3 days is actually a delay for critical fixes. P.S. Now I am not the only Gleb at FreeBSD.org community. Recently Gleb Kurtsou joined us, and his login name is exactly gleb, while mine is glebius. So, your commit may be confusing to later reviewers of VCS history. -- Totus tuus, Glebius. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r226184 - head/usr.bin/gzip
On Mon, Oct 10, 2011 at 1:10 PM, Doug Barton do...@freebsd.org wrote: On 10/10/2011 13:05, Xin LI wrote: On Mon, Oct 10, 2011 at 12:40 PM, Doug Barton do...@freebsd.org wrote: On 10/09/2011 23:37, Xin LI wrote: Log: Incorporate recent changes from NetBSD. Most notable change is the addition of support of decompressing xz files. Why? Don't we already have xz in the base? zless and friends rely on gunzip. I'm sorry, I don't understand that answer. Oh sorry, I meant zcat, zdiff, etc. zless already supported xz format. Cheers, -- Xin LI delp...@delphij.net https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r226224 - head/sys/netinet
MFC 225946 is the original patch, 225947 messed up the logic a bit while putting in the fix for another issue. 226224 is the fix to 225947, which I will MFC tomorrow. --Qing 2011/10/10 Gleb Smirnoff gleb...@freebsd.org: Qing, On Mon, Oct 10, 2011 at 05:41:11PM +, Qing Li wrote: Q Author: qingli Q Date: Mon Oct 10 17:41:11 2011 Q New Revision: 226224 Q URL: http://svn.freebsd.org/changeset/base/226224 Q Q Log: Q All indirect routes will fail the rtcheck, except for a special host Q route where the destination IP and the gateway IP is the same. This Q special case handling is only meant for backward compatibility reason. Q The last commit introduced a bug in the route check logic, where a Q valid special case is treated as an error. This patch fixes that bug Q along with some code cleanup. Q Q Suggested by: gleb Q Reviewed by: kmacy, discussed with gleb Q MFC after: 1 day Looks like you have committed a slightly different patch to stable/8 in r226230. Is that okay? Also, you haven't awaited even one day, while our policy suggests at least 3 days before MFC, and 3 days is actually a delay for critical fixes. P.S. Now I am not the only Gleb at FreeBSD.org community. Recently Gleb Kurtsou joined us, and his login name is exactly gleb, while mine is glebius. So, your commit may be confusing to later reviewers of VCS history. -- Totus tuus, Glebius. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r226184 - head/usr.bin/gzip
On Mon, Oct 10, 2011 at 12:40 PM, Doug Barton do...@freebsd.org wrote: On 10/09/2011 23:37, Xin LI wrote: Log: Incorporate recent changes from NetBSD. Most notable change is the addition of support of decompressing xz files. Why? Don't we already have xz in the base? zless and friends rely on gunzip. Cheers, -- Xin LI delp...@delphij.net https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r226234 - head/sys/fs/unionfs
Author: trasz Date: Mon Oct 10 21:32:08 2011 New Revision: 226234 URL: http://svn.freebsd.org/changeset/base/226234 Log: Make unionfs also clear VAPPEND when clearing VWRITE, since VAPPEND is just a modifier for VWRITE. Submitted by: rmacklem Modified: head/sys/fs/unionfs/union_vnops.c Modified: head/sys/fs/unionfs/union_vnops.c == --- head/sys/fs/unionfs/union_vnops.c Mon Oct 10 20:57:54 2011 (r226233) +++ head/sys/fs/unionfs/union_vnops.c Mon Oct 10 21:32:08 2011 (r226234) @@ -748,7 +748,7 @@ unionfs_access(struct vop_access_args *a return (error); } } - accmode = ~VWRITE; + accmode = ~(VWRITE | VAPPEND); accmode |= VREAD; /* will copy to upper */ } error = VOP_ACCESS(lvp, accmode, ap-a_cred, td); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r226242 - head/tools/tools/nanobsd/gateworks
Author: thompsa Date: Tue Oct 11 01:11:57 2011 New Revision: 226242 URL: http://svn.freebsd.org/changeset/base/226242 Log: Fix build after TARGET_BIG_ENDIAN was nuked from orbit. Modified: head/tools/tools/nanobsd/gateworks/common Modified: head/tools/tools/nanobsd/gateworks/common == --- head/tools/tools/nanobsd/gateworks/common Mon Oct 10 21:54:19 2011 (r226241) +++ head/tools/tools/nanobsd/gateworks/common Tue Oct 11 01:11:57 2011 (r226242) @@ -4,9 +4,8 @@ NANO_CFGDIR=${NANO_CFGDIR:-${NANO_SRC}/$ test -d ${NANO_CFGDIR} || NANO_CFGDIR=/var/empty NANO_PMAKE=make # NB: disable -j 3 -NANO_ARCH=arm +NANO_ARCH=armeb TARGET_CPUTYPE=xscale; export TARGET_CPUTYPE # XXX -TARGET_BIG_ENDIAN=true; export TARGET_BIG_ENDIAN # XXX NANO_CUSTOMIZE=cust_allow_ssh_root ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r226244 - head/share/mk
Author: das Date: Tue Oct 11 05:17:26 2011 New Revision: 226244 URL: http://svn.freebsd.org/changeset/base/226244 Log: Also pass the -ansi flag through to mkdep (requested by bde), and fix a cut-and-paste-o (noticed by rdivacky). Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk == --- head/share/mk/bsd.dep.mkTue Oct 11 04:40:06 2011(r226243) +++ head/share/mk/bsd.dep.mkTue Oct 11 05:17:26 2011(r226244) @@ -125,8 +125,8 @@ depend: beforedepend ${DEPENDFILE} after # Different types of sources are compiled with slightly different flags. # Split up the sources, and filter out headers and non-applicable flags. -MKDEP_CFLAGS= ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BIDU]*} ${CFLAGS:M-std=*} -MKDEP_CXXFLAGS=${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BIDU]*} ${CFLAGS:M-std=*} +MKDEP_CFLAGS= ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BIDU]*} ${CFLAGS:M-std=*} ${CFLAGS:M-ansi} +MKDEP_CXXFLAGS=${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BIDU]*} ${CXXFLAGS:M-std=*} ${CXXFLAGS:M-ansi} DPSRCS+= ${SRCS} ${DEPENDFILE}: ${DPSRCS} ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r226245 - head/lib/msun/src
Author: das Date: Tue Oct 11 05:17:45 2011 New Revision: 226245 URL: http://svn.freebsd.org/changeset/base/226245 Log: Refactor this code by introducing separate functions to handle the extra-precision add and multiply operations. This simplifies future work but shouldn't result in any functional change. Modified: head/lib/msun/src/s_fma.c head/lib/msun/src/s_fmal.c Modified: head/lib/msun/src/s_fma.c == --- head/lib/msun/src/s_fma.c Tue Oct 11 05:17:26 2011(r226244) +++ head/lib/msun/src/s_fma.c Tue Oct 11 05:17:45 2011(r226245) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005 David Schultz d...@freebsd.org + * Copyright (c) 2005-2011 David Schultz d...@freebsd.org * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,6 +32,63 @@ __FBSDID($FreeBSD$); #include math.h /* + * A struct dd represents a floating-point number with twice the precision + * of a double. We maintain the invariant that hi stores the 53 high-order + * bits of the result. + */ +struct dd { + double hi; + double lo; +}; + +/* + * Compute a+b exactly, returning the exact result in a struct dd. We assume + * that both a and b are finite, but make no assumptions about their relative + * magnitudes. + */ +static inline struct dd +dd_add(double a, double b) +{ + struct dd ret; + double s; + + ret.hi = a + b; + s = ret.hi - a; + ret.lo = (a - (ret.hi - s)) + (b - s); + return (ret); +} + +/* + * Compute a*b exactly, returning the exact result in a struct dd. We assume + * that both a and b are normalized, so no underflow or overflow will occur. + * The current rounding mode must be round-to-nearest. + */ +static inline struct dd +dd_mul(double a, double b) +{ + static const double split = 0x1p27 + 1.0; + struct dd ret; + double ha, hb, la, lb, p, q; + + p = a * split; + ha = a - p; + ha += p; + la = a - ha; + + p = b * split; + hb = b - p; + hb += p; + lb = b - hb; + + p = ha * hb; + q = ha * lb + la * hb; + + ret.hi = p + q; + ret.lo = p - ret.hi + q + la * lb; + return (ret); +} + +/* * Fused multiply-add: Compute x * y + z with a single rounding error. * * We use scaling to avoid overflow/underflow, along with the @@ -52,10 +109,10 @@ __FBSDID($FreeBSD$); double fma(double x, double y, double z) { - static const double split = 0x1p27 + 1.0; double xs, ys, zs; - double c, cc, hx, hy, p, q, tx, ty; - double r, rr, s; + struct dd xy, r, r2; + double p; + double s; int oround; int ex, ey, ez; int spread; @@ -95,29 +152,29 @@ fma(double x, double y, double z) if (x 0.0 ^ y 0.0 ^ z 0.0) return (x * y); feholdexcept(env); - r = x * y; + s = x * y; if (!fetestexcept(FE_INEXACT)) - r = nextafter(r, 0); + s = nextafter(s, 0); feupdateenv(env); - return (r); + return (s); case FE_DOWNWARD: if (z 0.0) return (x * y); feholdexcept(env); - r = x * y; + s = x * y; if (!fetestexcept(FE_INEXACT)) - r = nextafter(r, -INFINITY); + s = nextafter(s, -INFINITY); feupdateenv(env); - return (r); + return (s); default:/* FE_UPWARD */ if (z 0.0) return (x * y); feholdexcept(env); - r = x * y; + s = x * y; if (!fetestexcept(FE_INEXACT)) - r = nextafter(r, INFINITY); + s = nextafter(s, INFINITY); feupdateenv(env); - return (r); + return (s); } } if (spread -DBL_MANT_DIG) { @@ -145,50 +202,29 @@ fma(double x, double y, double z) } } - /* -* Use Dekker's algorithm to perform the multiplication and -* subsequent addition in twice the machine precision. -* Arrange so that x * y = c + cc, and x * y + z = r + rr. -*/ fesetround(FE_TONEAREST); - p = xs * split; - hx = xs - p; - hx += p; - tx = xs - hx; - - p = ys * split; - hy = ys - p; - hy += p; - ty = ys - hy; - - p = hx * hy; -