svn commit: r234528 - head/lib/libc/stdio
Author: das Date: Sat Apr 21 06:08:02 2012 New Revision: 234528 URL: http://svn.freebsd.org/changeset/base/234528 Log: Fix a bug introduced in r187302 that was causing fputws() to enter an infinite loop pretty much unconditionally. It's remarkable that the patch that introduced the bug was never tested, but even more remarkable that nobody noticed for over two years. PR: 167039 MFC after:3 days Modified: head/lib/libc/stdio/fputws.c Modified: head/lib/libc/stdio/fputws.c == --- head/lib/libc/stdio/fputws.cSat Apr 21 05:26:02 2012 (r234527) +++ head/lib/libc/stdio/fputws.cSat Apr 21 06:08:02 2012 (r234528) @@ -70,7 +70,7 @@ fputws_l(const wchar_t * __restrict ws, iov.iov_len = uio.uio_resid = nbytes; if (__sfvwrite(fp, uio) != 0) goto error; - } while (ws != NULL); + } while (wsp != NULL); FUNLOCKFILE(fp); return (0); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234529 - head/lib/libc/stdio
Author: das Date: Sat Apr 21 06:08:29 2012 New Revision: 234529 URL: http://svn.freebsd.org/changeset/base/234529 Log: Ensure that the {,v}swprintf functions always null-terminate the output string, even if an encoding error or malloc failure occurs. Modified: head/lib/libc/stdio/vswprintf.c Modified: head/lib/libc/stdio/vswprintf.c == --- head/lib/libc/stdio/vswprintf.c Sat Apr 21 06:08:02 2012 (r234528) +++ head/lib/libc/stdio/vswprintf.c Sat Apr 21 06:08:29 2012 (r234529) @@ -66,6 +66,7 @@ vswprintf_l(wchar_t * __restrict s, size f._bf._base = f._p = (unsigned char *)malloc(128); if (f._bf._base == NULL) { errno = ENOMEM; + *s = L'\0'; return (-1); } f._bf._size = f._w = 127; /* Leave room for the NUL */ @@ -74,6 +75,7 @@ vswprintf_l(wchar_t * __restrict s, size sverrno = errno; free(f._bf._base); errno = sverrno; + *s = L'\0'; return (-1); } *f._p = '\0'; @@ -87,6 +89,7 @@ vswprintf_l(wchar_t * __restrict s, size free(f._bf._base); if (nwc == (size_t)-1) { errno = EILSEQ; + *s = L'\0'; return (-1); } if (nwc == n) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234530 - head/lib/libc/stdio
Author: das Date: Sat Apr 21 06:09:09 2012 New Revision: 234530 URL: http://svn.freebsd.org/changeset/base/234530 Log: - Fix the claim that the output is always null-terminated. This isn't true if the size is zero. - Fix a claim that sprintf() is the same as snprintf() with an infinite size. It's equivalent to snprintf() with a size of INT_MAX + 1. - Document the return values in the return values section. - Document the possible errno value of EOVERFLOW. MFC after:2 weeks Modified: head/lib/libc/stdio/printf.3 Modified: head/lib/libc/stdio/printf.3 == --- head/lib/libc/stdio/printf.3Sat Apr 21 06:08:29 2012 (r234529) +++ head/lib/libc/stdio/printf.3Sat Apr 21 06:09:09 2012 (r234530) @@ -113,20 +113,6 @@ string that specifies how subsequent arg .Xr stdarg 3 ) are converted for output. .Pp -These functions return the number of characters printed -(not including the trailing -.Ql \e0 -used to end output to strings) or a negative value if an output error occurs, -except for -.Fn snprintf -and -.Fn vsnprintf , -which return the number of characters that would have been printed if the -.Fa size -were unlimited -(again, not including the final -.Ql \e0 ) . -.Pp The .Fn asprintf and @@ -164,15 +150,19 @@ if the return value is greater than or e .Fa size argument, the string was too short and some of the printed characters were discarded. -The output is always null-terminated. +The output is always null-terminated, unless +.Fa size +is 0. .Pp The .Fn sprintf and .Fn vsprintf functions -effectively assume an infinite -.Fa size . +effectively assume a +.Fa size +of +.Dv INT_MAX + 1. .Pp The format string is composed of zero or more directives: ordinary @@ -670,6 +660,21 @@ In no case does a non-existent or small a numeric field; if the result of a conversion is wider than the field width, the field is expanded to contain the conversion result. +.Sh RETURN VALUES +These functions return the number of characters printed +(not including the trailing +.Ql \e0 +used to end output to strings), +except for +.Fn snprintf +and +.Fn vsnprintf , +which return the number of characters that would have been printed if the +.Fa size +were unlimited +(again, not including the final +.Ql \e0 ) . +These functions return a negative value if an error occurs. .Sh EXAMPLES To print a date and time in the form .Dq Li Sunday, July 3, 10:02 , @@ -771,6 +776,13 @@ family of functions may fail if: An invalid wide character code was encountered. .It Bq Er ENOMEM Insufficient storage space is available. +.It Bq Er EOVERFLOW +The +.Fa size +argument exceeds +.Dv INT_MAX + 1 , +or the return value would be too large to be represented by an +.Vt int . .El .Sh SEE ALSO .Xr printf 1 , ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234531 - head/lib/libc/stdio
Author: das Date: Sat Apr 21 06:10:18 2012 New Revision: 234531 URL: http://svn.freebsd.org/changeset/base/234531 Log: If the size passed to {,v}s{w,n}printf is larger than INT_MAX+1 (i.e., the return value would overflow), set errno to EOVERFLOW and return an error. This improves the chances that buggy applications -- for instance, ones that pass in a negative integer as the size due to a bogus calculation -- will fail in safe ways. Returning an error in these situations is specified by POSIX, but POSIX appears to have an off-by-one error that isn't duplicated in this change. Previously, some of these functions would silently cap the size at INT_MAX+1, and others would exit with an error after writing more than INT_MAX characters. PR: 39256 MFC after:2 weeks Modified: head/lib/libc/stdio/snprintf.c head/lib/libc/stdio/vfprintf.c head/lib/libc/stdio/vfwprintf.c head/lib/libc/stdio/vsnprintf.c head/lib/libc/stdio/vswprintf.c Modified: head/lib/libc/stdio/snprintf.c == --- head/lib/libc/stdio/snprintf.c Sat Apr 21 06:09:09 2012 (r234530) +++ head/lib/libc/stdio/snprintf.c Sat Apr 21 06:10:18 2012 (r234531) @@ -41,6 +41,7 @@ static char sccsid[] = @(#)snprintf.c8 #include sys/cdefs.h __FBSDID($FreeBSD$); +#include errno.h #include limits.h #include stdio.h #include stdarg.h @@ -59,8 +60,11 @@ snprintf(char * __restrict str, size_t n on = n; if (n != 0) n--; - if (n INT_MAX) - n = INT_MAX; + if (n INT_MAX) { + errno = EOVERFLOW; + *str = '\0'; + return (EOF); + } va_start(ap, fmt); f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *)str; @@ -84,8 +88,11 @@ snprintf_l(char * __restrict str, size_t on = n; if (n != 0) n--; - if (n INT_MAX) - n = INT_MAX; + if (n INT_MAX) { + errno = EOVERFLOW; + *str = '\0'; + return (EOF); + } va_start(ap, fmt); f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *)str; Modified: head/lib/libc/stdio/vfprintf.c == --- head/lib/libc/stdio/vfprintf.c Sat Apr 21 06:09:09 2012 (r234530) +++ head/lib/libc/stdio/vfprintf.c Sat Apr 21 06:10:18 2012 (r234531) @@ -51,6 +51,7 @@ __FBSDID($FreeBSD$); #include sys/types.h #include ctype.h +#include errno.h #include limits.h #include locale.h #include stddef.h @@ -480,6 +481,7 @@ __vfprintf(FILE *fp, locale_t locale, co if ((n = fmt - cp) != 0) { if ((unsigned)ret + n INT_MAX) { ret = EOF; + errno = EOVERFLOW; goto error; } PRINT(cp, n); @@ -935,6 +937,7 @@ number: if ((dprec = prec) = 0) prsize = width realsz ? width : realsz; if ((unsigned)ret + prsize INT_MAX) { ret = EOF; + errno = EOVERFLOW; goto error; } Modified: head/lib/libc/stdio/vfwprintf.c == --- head/lib/libc/stdio/vfwprintf.c Sat Apr 21 06:09:09 2012 (r234530) +++ head/lib/libc/stdio/vfwprintf.c Sat Apr 21 06:10:18 2012 (r234531) @@ -54,6 +54,7 @@ __FBSDID($FreeBSD$); #include sys/types.h #include ctype.h +#include errno.h #include limits.h #include locale.h #include stdarg.h @@ -553,6 +554,7 @@ __vfwprintf(FILE *fp, locale_t locale, c if ((n = fmt - cp) != 0) { if ((unsigned)ret + n INT_MAX) { ret = EOF; + errno = EOVERFLOW; goto error; } PRINT(cp, n); @@ -1003,6 +1005,7 @@ number: if ((dprec = prec) = 0) prsize = width realsz ? width : realsz; if ((unsigned)ret + prsize INT_MAX) { ret = EOF; + errno = EOVERFLOW; goto error; } Modified: head/lib/libc/stdio/vsnprintf.c == --- head/lib/libc/stdio/vsnprintf.c Sat Apr 21 06:09:09 2012 (r234530) +++ head/lib/libc/stdio/vsnprintf.c Sat Apr 21 06:10:18 2012 (r234531) @@ -41,6 +41,7 @@ static char sccsid[] = @(#)vsnprintf.c #include sys/cdefs.h __FBSDID($FreeBSD$); +#include errno.h #include limits.h #include stdio.h
svn commit: r234533 - stable/7/lib/msun/src
Author: das Date: Sat Apr 21 06:59:48 2012 New Revision: 234533 URL: http://svn.freebsd.org/changeset/base/234533 Log: MFC r233973 (partial): Fix bugs in remquo{,f}. Modified: stable/7/lib/msun/src/s_remquo.c stable/7/lib/msun/src/s_remquof.c Directory Properties: stable/7/lib/msun/ (props changed) Modified: stable/7/lib/msun/src/s_remquo.c == --- stable/7/lib/msun/src/s_remquo.cSat Apr 21 06:29:44 2012 (r234532) +++ stable/7/lib/msun/src/s_remquo.cSat Apr 21 06:59:48 2012 (r234533) @@ -49,7 +49,7 @@ remquo(double x, double y, int *quo) goto fixup; /* |x||y| return x or x-y */ } if(lx==ly) { - *quo = 1; + *quo = (sxy ? -1 : 1); return Zero[(u_int32_t)sx31]; /* |x|=|y| return x*0*/ } } @@ -112,6 +112,7 @@ remquo(double x, double y, int *quo) /* convert back to floating value and restore the sign */ if((hx|lx)==0) {/* return sign(x)*0 */ + q = 0x7fff; *quo = (sxy ? -q : q); return Zero[(u_int32_t)sx31]; } @@ -127,9 +128,9 @@ remquo(double x, double y, int *quo) lx = (lxn)|((u_int32_t)hx(32-n)); hx = n; } else if (n=31) { - lx = (hx(32-n))|(lxn); hx = sx; + lx = (hx(32-n))|(lxn); hx = 0; } else { - lx = hx(n-32); hx = sx; + lx = hx(n-32); hx = 0; } } fixup: Modified: stable/7/lib/msun/src/s_remquof.c == --- stable/7/lib/msun/src/s_remquof.c Sat Apr 21 06:29:44 2012 (r234532) +++ stable/7/lib/msun/src/s_remquof.c Sat Apr 21 06:59:48 2012 (r234533) @@ -46,7 +46,7 @@ remquof(float x, float y, int *quo) q = 0; goto fixup; /* |x||y| return x or x-y */ } else if(hx==hy) { - *quo = 1; + *quo = (sxy ? -1 : 1); return Zero[(u_int32_t)sx31]; /* |x|=|y| return x*0*/ } @@ -88,6 +88,7 @@ remquof(float x, float y, int *quo) /* convert back to floating value and restore the sign */ if(hx==0) { /* return sign(x)*0 */ + q = 0x7fff; *quo = (sxy ? -q : q); return Zero[(u_int32_t)sx31]; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234534 - stable/8/lib/msun/src
Author: das Date: Sat Apr 21 07:00:00 2012 New Revision: 234534 URL: http://svn.freebsd.org/changeset/base/234534 Log: MFC r233973: Fix bugs in remquo{,f,l}. Modified: stable/8/lib/msun/src/s_remquo.c stable/8/lib/msun/src/s_remquof.c stable/8/lib/msun/src/s_remquol.c Directory Properties: stable/8/lib/msun/ (props changed) Modified: stable/8/lib/msun/src/s_remquo.c == --- stable/8/lib/msun/src/s_remquo.cSat Apr 21 06:59:48 2012 (r234533) +++ stable/8/lib/msun/src/s_remquo.cSat Apr 21 07:00:00 2012 (r234534) @@ -51,7 +51,7 @@ remquo(double x, double y, int *quo) goto fixup; /* |x||y| return x or x-y */ } if(lx==ly) { - *quo = 1; + *quo = (sxy ? -1 : 1); return Zero[(u_int32_t)sx31]; /* |x|=|y| return x*0*/ } } @@ -114,6 +114,7 @@ remquo(double x, double y, int *quo) /* convert back to floating value and restore the sign */ if((hx|lx)==0) {/* return sign(x)*0 */ + q = 0x7fff; *quo = (sxy ? -q : q); return Zero[(u_int32_t)sx31]; } @@ -129,9 +130,9 @@ remquo(double x, double y, int *quo) lx = (lxn)|((u_int32_t)hx(32-n)); hx = n; } else if (n=31) { - lx = (hx(32-n))|(lxn); hx = sx; + lx = (hx(32-n))|(lxn); hx = 0; } else { - lx = hx(n-32); hx = sx; + lx = hx(n-32); hx = 0; } } fixup: Modified: stable/8/lib/msun/src/s_remquof.c == --- stable/8/lib/msun/src/s_remquof.c Sat Apr 21 06:59:48 2012 (r234533) +++ stable/8/lib/msun/src/s_remquof.c Sat Apr 21 07:00:00 2012 (r234534) @@ -46,7 +46,7 @@ remquof(float x, float y, int *quo) q = 0; goto fixup; /* |x||y| return x or x-y */ } else if(hx==hy) { - *quo = 1; + *quo = (sxy ? -1 : 1); return Zero[(u_int32_t)sx31]; /* |x|=|y| return x*0*/ } @@ -88,6 +88,7 @@ remquof(float x, float y, int *quo) /* convert back to floating value and restore the sign */ if(hx==0) { /* return sign(x)*0 */ + q = 0x7fff; *quo = (sxy ? -q : q); return Zero[(u_int32_t)sx31]; } Modified: stable/8/lib/msun/src/s_remquol.c == --- stable/8/lib/msun/src/s_remquol.c Sat Apr 21 06:59:48 2012 (r234533) +++ stable/8/lib/msun/src/s_remquol.c Sat Apr 21 07:00:00 2012 (r234534) @@ -96,7 +96,7 @@ remquol(long double x, long double y, in goto fixup; /* |x||y| return x or x-y */ } if(ux.bits.manh==uy.bits.manh ux.bits.manl==uy.bits.manl) { - *quo = 1; + *quo = (sxy ? -1 : 1); return Zero[sx];/* |x|=|y| return x*0*/ } } @@ -138,6 +138,7 @@ remquol(long double x, long double y, in /* convert back to floating value and restore the sign */ if((hx|lx)==0) {/* return sign(x)*0 */ + q = 0x7fff; *quo = (sxy ? -q : q); return Zero[sx]; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234535 - stable/9/lib/msun/src
Author: das Date: Sat Apr 21 07:00:39 2012 New Revision: 234535 URL: http://svn.freebsd.org/changeset/base/234535 Log: MFC r233973: Fix bugs in remquo{,f,l}. Modified: stable/9/lib/msun/src/s_remquo.c stable/9/lib/msun/src/s_remquof.c stable/9/lib/msun/src/s_remquol.c Directory Properties: stable/9/lib/msun/ (props changed) Modified: stable/9/lib/msun/src/s_remquo.c == --- stable/9/lib/msun/src/s_remquo.cSat Apr 21 07:00:00 2012 (r234534) +++ stable/9/lib/msun/src/s_remquo.cSat Apr 21 07:00:39 2012 (r234535) @@ -51,7 +51,7 @@ remquo(double x, double y, int *quo) goto fixup; /* |x||y| return x or x-y */ } if(lx==ly) { - *quo = 1; + *quo = (sxy ? -1 : 1); return Zero[(u_int32_t)sx31]; /* |x|=|y| return x*0*/ } } @@ -114,6 +114,7 @@ remquo(double x, double y, int *quo) /* convert back to floating value and restore the sign */ if((hx|lx)==0) {/* return sign(x)*0 */ + q = 0x7fff; *quo = (sxy ? -q : q); return Zero[(u_int32_t)sx31]; } @@ -129,9 +130,9 @@ remquo(double x, double y, int *quo) lx = (lxn)|((u_int32_t)hx(32-n)); hx = n; } else if (n=31) { - lx = (hx(32-n))|(lxn); hx = sx; + lx = (hx(32-n))|(lxn); hx = 0; } else { - lx = hx(n-32); hx = sx; + lx = hx(n-32); hx = 0; } } fixup: Modified: stable/9/lib/msun/src/s_remquof.c == --- stable/9/lib/msun/src/s_remquof.c Sat Apr 21 07:00:00 2012 (r234534) +++ stable/9/lib/msun/src/s_remquof.c Sat Apr 21 07:00:39 2012 (r234535) @@ -46,7 +46,7 @@ remquof(float x, float y, int *quo) q = 0; goto fixup; /* |x||y| return x or x-y */ } else if(hx==hy) { - *quo = 1; + *quo = (sxy ? -1 : 1); return Zero[(u_int32_t)sx31]; /* |x|=|y| return x*0*/ } @@ -88,6 +88,7 @@ remquof(float x, float y, int *quo) /* convert back to floating value and restore the sign */ if(hx==0) { /* return sign(x)*0 */ + q = 0x7fff; *quo = (sxy ? -q : q); return Zero[(u_int32_t)sx31]; } Modified: stable/9/lib/msun/src/s_remquol.c == --- stable/9/lib/msun/src/s_remquol.c Sat Apr 21 07:00:00 2012 (r234534) +++ stable/9/lib/msun/src/s_remquol.c Sat Apr 21 07:00:39 2012 (r234535) @@ -96,7 +96,7 @@ remquol(long double x, long double y, in goto fixup; /* |x||y| return x or x-y */ } if(ux.bits.manh==uy.bits.manh ux.bits.manl==uy.bits.manl) { - *quo = 1; + *quo = (sxy ? -1 : 1); return Zero[sx];/* |x|=|y| return x*0*/ } } @@ -138,6 +138,7 @@ remquol(long double x, long double y, in /* convert back to floating value and restore the sign */ if((hx|lx)==0) {/* return sign(x)*0 */ + q = 0x7fff; *quo = (sxy ? -q : q); return Zero[sx]; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r234528 - head/lib/libc/stdio
On 2012-Apr-21 06:08:02 +, David Schultz d...@freebsd.org wrote: Log: Fix a bug introduced in r187302 that was causing fputws() to enter an infinite loop pretty much unconditionally. Unfortunately, I suspect you've just turned an unconditional infinite loop into a conditional one. There's still a wsp = ws; inside the loop so if you pass in a long string (one that exceeds BUFSIZ bytes when converted to a multi-byte string) then wsp will be non-NULL after the call to __wcsnrtombs(), causing the do loop to loop and then wsp will be re-initialised to ws. I think the fix is to move the wsp = ws; outside the loop. It's remarkable that the patch that introduced the bug was never tested, but even more remarkable that nobody noticed for over two years. It took me a while to work out that the problem was libc and not my code. -- Peter Jeremy pgp74c8x5kqW0.pgp Description: PGP signature
svn commit: r234536 - head/lib/libc/stdio
Author: das Date: Sat Apr 21 07:31:27 2012 New Revision: 234536 URL: http://svn.freebsd.org/changeset/base/234536 Log: As noted by Peter Jeremy, r234528 only partially fixed the infinite loop bug introduced in r187302. This completes the fix. PR: 167039 MFC after:3 days Modified: head/lib/libc/stdio/fputws.c Modified: head/lib/libc/stdio/fputws.c == --- head/lib/libc/stdio/fputws.cSat Apr 21 07:00:39 2012 (r234535) +++ head/lib/libc/stdio/fputws.cSat Apr 21 07:31:27 2012 (r234536) @@ -61,8 +61,8 @@ fputws_l(const wchar_t * __restrict ws, uio.uio_iov = iov; uio.uio_iovcnt = 1; iov.iov_base = buf; + wsp = ws; do { - wsp = ws; nbytes = l-__wcsnrtombs(buf, wsp, SIZE_T_MAX, sizeof(buf), fp-_mbstate); if (nbytes == (size_t)-1) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r234528 - head/lib/libc/stdio
On Sat, Apr 21, 2012, Peter Jeremy wrote: On 2012-Apr-21 06:08:02 +, David Schultz d...@freebsd.org wrote: Log: Fix a bug introduced in r187302 that was causing fputws() to enter an infinite loop pretty much unconditionally. Unfortunately, I suspect you've just turned an unconditional infinite loop into a conditional one. There's still a wsp = ws; inside the loop so if you pass in a long string (one that exceeds BUFSIZ bytes when converted to a multi-byte string) then wsp will be non-NULL after the call to __wcsnrtombs(), causing the do loop to loop and then wsp will be re-initialised to ws. I think the fix is to move the wsp = ws; outside the loop. Whoops -- good catch. This should be fixed now. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r234353 - in head: . contrib/llvm contrib/llvm/include/llvm contrib/llvm/include/llvm-c contrib/llvm/include/llvm-c/Transforms contrib/llvm/include/llvm/ADT contrib/llvm/include/llvm/A
On 2012-04-19 23:14, Alexander Best wrote: On Mon Apr 16 12, Dimitry Andric wrote: Author: dim Date: Mon Apr 16 21:23:25 2012 New Revision: 234353 URL: http://svn.freebsd.org/changeset/base/234353 Log: Upgrade our copy of llvm/clang to trunk r154661, in preparation of the upcoming 3.1 release (expected in a few weeks). Preliminary release notes can be found at:http://llvm.org/docs/ReleaseNotes.html very nice. :) any reason '-fformat-extensions'-support still hasn't been pushed upstream as something like '-fbsd-extensions'? Simply ENOTIME. The support as it is now, is not really acceptable for upstream, because it is rather a quick 'n dirty hack. :) Besides, llvm/clang 3.1 has branched for release, and only serious bugs will be fixed in there, from now on. So even if I got something whipped up right now, it would probably not make it in. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234537 - head/sys/ufs/ffs
Author: trasz Date: Sat Apr 21 10:45:46 2012 New Revision: 234537 URL: http://svn.freebsd.org/changeset/base/234537 Log: Fix use-after-free introduced in r234036. Reviewed by: mckusick Tested by:pho Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c == --- head/sys/ufs/ffs/ffs_vfsops.c Sat Apr 21 07:31:27 2012 (r234536) +++ head/sys/ufs/ffs/ffs_vfsops.c Sat Apr 21 10:45:46 2012 (r234537) @@ -699,10 +699,14 @@ ffs_reload(struct mount *mp, struct thre * We no longer know anything about clusters per cylinder group. */ if (fs-fs_contigsumsize 0) { - lp = fs-fs_maxcluster; + fs-fs_maxcluster = lp = space; for (i = 0; i fs-fs_ncg; i++) *lp++ = fs-fs_contigsumsize; + space = lp; } + size = fs-fs_ncg * sizeof(u_int8_t); + fs-fs_contigdirs = (u_int8_t *)space; + bzero(fs-fs_contigdirs, size); loop: MNT_VNODE_FOREACH_ALL(vp, mp, mvp) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234538 - head/share/man/man4
Author: joel (doc committer) Date: Sat Apr 21 11:51:31 2012 New Revision: 234538 URL: http://svn.freebsd.org/changeset/base/234538 Log: Minor mdoc fixes. Modified: head/share/man/man4/iscsi_initiator.4 Modified: head/share/man/man4/iscsi_initiator.4 == --- head/share/man/man4/iscsi_initiator.4 Sat Apr 21 10:45:46 2012 (r234537) +++ head/share/man/man4/iscsi_initiator.4 Sat Apr 21 11:51:31 2012 (r234538) @@ -25,8 +25,8 @@ .\ $FreeBSD$ .\ .Dd August 3, 2010 -.Os .Dt ISCSI_INITIATOR 4 +.Os .Sh NAME .Nm iscsi_initiator .Nd kernel driver for the iSCSI protocol @@ -75,9 +75,9 @@ is the IP address of the target of sessi .Em n . .It Va net.iscsi.n.stats are some statistics for session -.EM n +.Em n .It Va net.iscsi.n.pid -is the +is the .Em process id of the userland side of session .Em n , @@ -85,11 +85,11 @@ see .Xr iscontrol 8 . .El .Sh FILES -The +The .Nm driver creates the following: -.Bl -tag -width .Pa /dev/iscsi%dxx -compact .Pp +.Bl -tag -width .Pa /dev/iscsi%dxx -compact .It Pa /dev/iscsi used to create new sessions. .It Pa /dev/iscsi%d @@ -102,7 +102,7 @@ for each new session. .Sh STANDARDS iSCSI RFC 3720 .\ .Sh HISTORY -.\ .Sh AUTHORS +.Sh AUTHORS This software was written by Daniel Braniss da...@cs.huji.ac.il .Sh BUGS The lun discovery method is old-fashioned. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234539 - head/sys/netinet
Author: tuexen Date: Sat Apr 21 11:53:24 2012 New Revision: 234539 URL: http://svn.freebsd.org/changeset/base/234539 Log: Fix check used by stream reset related events. MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c == --- head/sys/netinet/sctputil.c Sat Apr 21 11:51:31 2012(r234538) +++ head/sys/netinet/sctputil.c Sat Apr 21 11:53:24 2012(r234539) @@ -3214,7 +3214,7 @@ sctp_notify_stream_reset_add(struct sctp struct sctp_stream_change_event *stradd; int len; - if (sctp_is_feature_off(stcb-sctp_ep, SCTP_PCB_FLAGS_STREAM_RESETEVNT)) { + if (sctp_stcb_is_feature_off(stcb-sctp_ep, stcb, SCTP_PCB_FLAGS_STREAM_RESETEVNT)) { /* event not enabled */ return; } @@ -3275,7 +3275,7 @@ sctp_notify_stream_reset_tsn(struct sctp struct sctp_assoc_reset_event *strasoc; int len; - if (sctp_is_feature_off(stcb-sctp_ep, SCTP_PCB_FLAGS_STREAM_RESETEVNT)) { + if (sctp_stcb_is_feature_off(stcb-sctp_ep, stcb, SCTP_PCB_FLAGS_STREAM_RESETEVNT)) { /* event not enabled */ return; } @@ -,7 +,7 @@ sctp_notify_stream_reset(struct sctp_tcb struct sctp_stream_reset_event *strreset; int len; - if (sctp_is_feature_off(stcb-sctp_ep, SCTP_PCB_FLAGS_STREAM_RESETEVNT)) { + if (sctp_stcb_is_feature_off(stcb-sctp_ep, stcb, SCTP_PCB_FLAGS_STREAM_RESETEVNT)) { /* event not enabled */ return; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r234504 - in head/sys: amd64/conf i386/conf
On Fri, Apr 20, 2012 at 5:37 PM, Brooks Davis bro...@freebsd.org wrote: Author: brooks Date: Fri Apr 20 21:37:42 2012 New Revision: 234504 URL: http://svn.freebsd.org/changeset/base/234504 Log: Enable DTrace hooks in GENERIC. Reviewed by: gnn Approved by: core (jhb, imp) Requested by: a cast of thousands MFC after: 3 days Excellent! Thanks to everybody who helped make this happen, starting with the participants at dtrace.conf who gave us the requisite whacks with the clue-by-four. However, what is our policy for enabling features in -STABLE that are known to be unstable? If we MFC this I don't have the slightest worry that somebody might see instability in their system just because the hooks are all of a sudden there, but I would worry that somebody make take DTrace hooks being enabled in GENERIC on -STABLE to imply that DTrace is stable, start using it and being upset when they trip over a DTrace bug. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234540 - head/sys/dev/dpt
Author: dim Date: Sat Apr 21 14:23:46 2012 New Revision: 234540 URL: http://svn.freebsd.org/changeset/base/234540 Log: Fix the following clang warning in dpt(4): sys/dev/dpt/dpt_scsi.c:612:18: error: implicit truncation from 'int' to bitfield changes value from -2 to 2 [-Werror,-Wconstant-conversion] dpt-cache_type = DPT_CACHE_WRITEBACK; ^ ~~~ by defining DPT_CACHE_WRITEBACK as 2, since dpt_softc::cache_type is an unsigned bitfield. No binary change. MFC after:1 week Modified: head/sys/dev/dpt/dpt.h Modified: head/sys/dev/dpt/dpt.h == --- head/sys/dev/dpt/dpt.h Sat Apr 21 11:53:24 2012(r234539) +++ head/sys/dev/dpt/dpt.h Sat Apr 21 14:23:46 2012(r234540) @@ -142,7 +142,7 @@ typedef void *physaddr; */ #define DPT_NO_CACHE 0 #define DPT_CACHE_WRITETHROUGH 1 -#define DPT_CACHE_WRITEBACK-2 +#define DPT_CACHE_WRITEBACK2 #define min(a,b) ((ab)?(a):(b)) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234541 - in head/sys/dev/usb: . serial
Author: kevlo Date: Sat Apr 21 14:30:51 2012 New Revision: 234541 URL: http://svn.freebsd.org/changeset/base/234541 Log: Add support for the SIMCom SIM5218, tested by me. Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c == --- head/sys/dev/usb/serial/u3g.c Sat Apr 21 14:23:46 2012 (r234540) +++ head/sys/dev/usb/serial/u3g.c Sat Apr 21 14:30:51 2012 (r234541) @@ -354,6 +354,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QISDA, H21_2, 0), U3G_DEV(QUALCOMM2, AC8700, 0), U3G_DEV(QUALCOMM2, MF330, 0), + U3G_DEV(QUALCOMM2, SIM5218, 0), U3G_DEV(QUALCOMM2, VW110L, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMMINC, AC2726, 0), U3G_DEV(QUALCOMMINC, AC8700, 0), Modified: head/sys/dev/usb/usbdevs == --- head/sys/dev/usb/usbdevsSat Apr 21 14:23:46 2012(r234540) +++ head/sys/dev/usb/usbdevsSat Apr 21 14:30:51 2012(r234541) @@ -2683,6 +2683,7 @@ product QUALCOMM2 RWT_FCT 0x3100 RWT FCT product QUALCOMM2 CDMA_MSM 0x3196 CDMA Technologies MSM modem product QUALCOMM2 AC8700 0x6000 AC8700 product QUALCOMM2 VW110L 0x1000 Vertex Wireless 110L modem +product QUALCOMM2 SIM5218 0x9000 SIM5218 product QUALCOMMINC CDMA_MSM 0x0001 CDMA Technologies MSM modem product QUALCOMMINC E0002 0x0002 3G modem product QUALCOMMINC E0003 0x0003 3G modem ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234542 - head/sys/powerpc/include
Author: nwhitehorn Date: Sat Apr 21 14:39:47 2012 New Revision: 234542 URL: http://svn.freebsd.org/changeset/base/234542 Log: Organize some members of ucontext_t in the same order they are in the trap frame. These are usually not used, and so this changes very little. MFC after:5 days Modified: head/sys/powerpc/include/ucontext.h Modified: head/sys/powerpc/include/ucontext.h == --- head/sys/powerpc/include/ucontext.h Sat Apr 21 14:30:51 2012 (r234541) +++ head/sys/powerpc/include/ucontext.h Sat Apr 21 14:39:47 2012 (r234542) @@ -71,9 +71,9 @@ typedef struct __mcontext32 { #definemc_ctr mc_frame[35] #define mc_srr0mc_frame[36] #define mc_srr1mc_frame[37] -#define mc_dar mc_frame[38] -#define mc_dsisr mc_frame[39] -#define mc_exc mc_frame[40] +#define mc_exc mc_frame[38] +#define mc_dar mc_frame[39] +#define mc_dsisr mc_frame[40] /* floating-point state */ #define mc_fpscr mc_fpreg[32] ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234543 - in head/contrib/jemalloc: . doc include/jemalloc include/jemalloc/internal src
Author: jasone Date: Sat Apr 21 15:09:22 2012 New Revision: 234543 URL: http://svn.freebsd.org/changeset/base/234543 Log: Import jemalloc 606f1fdc3cdbc700717133ca56685313caea24bb (dev branch, prior to 3.0.0 release), and mangle internal symbols. Modified: head/contrib/jemalloc/ChangeLog head/contrib/jemalloc/FREEBSD-diffs head/contrib/jemalloc/FREEBSD-upgrade head/contrib/jemalloc/VERSION head/contrib/jemalloc/doc/jemalloc.3 head/contrib/jemalloc/include/jemalloc/internal/arena.h head/contrib/jemalloc/include/jemalloc/internal/chunk_mmap.h head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h head/contrib/jemalloc/include/jemalloc/internal/prof.h head/contrib/jemalloc/include/jemalloc/internal/tcache.h head/contrib/jemalloc/include/jemalloc/internal/tsd.h head/contrib/jemalloc/include/jemalloc/jemalloc.h head/contrib/jemalloc/include/jemalloc/jemalloc_defs.h head/contrib/jemalloc/src/arena.c head/contrib/jemalloc/src/chunk.c head/contrib/jemalloc/src/chunk_mmap.c head/contrib/jemalloc/src/ctl.c head/contrib/jemalloc/src/jemalloc.c head/contrib/jemalloc/src/prof.c head/contrib/jemalloc/src/quarantine.c head/contrib/jemalloc/src/stats.c head/contrib/jemalloc/src/tcache.c head/contrib/jemalloc/src/tsd.c head/contrib/jemalloc/src/util.c Modified: head/contrib/jemalloc/ChangeLog == --- head/contrib/jemalloc/ChangeLog Sat Apr 21 14:39:47 2012 (r234542) +++ head/contrib/jemalloc/ChangeLog Sat Apr 21 15:09:22 2012 (r234543) @@ -34,6 +34,8 @@ found in the git revision history: - Add the --with-mangling option. - Add the --disable-experimental option. - Add the thread.tcache.enabled mallctl. + - Add the opt.prof_final mallctl. + - Update pprof (from gperftools 2.0). Incompatible changes: - Enable stats by default. @@ -41,6 +43,8 @@ found in the git revision history: - Disable lazy locking by default. - Rename the tcache.flush mallctl to thread.tcache.flush. - Rename the arenas.pagesize mallctl to arenas.page. + - Change the opt.lg_prof_sample default from 0 to 19 (1 B to 512 KiB). + - Change the opt.prof_accum default from true to false. Removed features: - Remove the swap feature, including the config.swap, swap.avail, @@ -77,6 +81,7 @@ found in the git revision history: - Add missing opt.lg_tcache_max mallctl implementation. - Use glibc allocator hooks to make mixed allocator usage less likely. - Fix build issues for --disable-tcache. + - Don't mangle pthread_create() when --with-private-namespace is specified. * 2.2.5 (November 14, 2011) Modified: head/contrib/jemalloc/FREEBSD-diffs == --- head/contrib/jemalloc/FREEBSD-diffs Sat Apr 21 14:39:47 2012 (r234542) +++ head/contrib/jemalloc/FREEBSD-diffs Sat Apr 21 15:09:22 2012 (r234543) @@ -1,5 +1,5 @@ diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in -index 98d0ba4..23d2152 100644 +index f78f423..ce6df80 100644 --- a/doc/jemalloc.xml.in +++ b/doc/jemalloc.xml.in @@ -51,12 +51,23 @@ @@ -27,7 +27,7 @@ index 98d0ba4..23d2152 100644 refsect2 titleStandard API/title funcprototype -@@ -2080,4 +2091,16 @@ malloc_conf = lg_chunk:24;]]/programlisting/para +@@ -2091,4 +2102,16 @@ malloc_conf = lg_chunk:24;]]/programlisting/para paraThe functionposix_memalignparameter//function function conforms to IEEE Std 1003.1-2001 (ldquo;POSIX.1rdquo;)./para /refsect1 @@ -45,7 +45,7 @@ index 98d0ba4..23d2152 100644 + /refsect1 /refentry diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in -index 905653a..b235a0d 100644 +index b61abe8..edbb437 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in @@ -1,5 +1,8 @@ @@ -68,18 +68,38 @@ index 905653a..b235a0d 100644 #include ../jemalloc@install_suffix@.h diff --git a/include/jemalloc/internal/mutex.h b/include/jemalloc/internal/mutex.h -index c46feee..d7133f4 100644 +index 8837ef5..d7133f4 100644 --- a/include/jemalloc/internal/mutex.h +++ b/include/jemalloc/internal/mutex.h -@@ -39,8 +39,6 @@ struct malloc_mutex_s { +@@ -39,9 +39,6 @@ struct malloc_mutex_s { #ifdef JEMALLOC_LAZY_LOCK extern bool isthreaded; -#else +-# undef isthreaded /* Undo private_namespace.h definition. */ -# define isthreaded true #endif bool malloc_mutex_init(malloc_mutex_t *mutex); +diff --git a/include/jemalloc/internal/private_namespace.h b/include/jemalloc/internal/private_namespace.h +index 15fe3c5..be94eb8 100644 +--- a/include/jemalloc/internal/private_namespace.h b/include/jemalloc/internal/private_namespace.h +@@ -1,6 +1,3 @@ +-#define a0calloc
svn commit: r234546 - head/gnu/lib/libgcc
Author: imp Date: Sat Apr 21 16:02:00 2012 New Revision: 234546 URL: http://svn.freebsd.org/changeset/base/234546 Log: Replace a bare use of nm with ${NM} for easier cross compilation in environments where nm is spelled differently. Modified: head/gnu/lib/libgcc/Makefile Modified: head/gnu/lib/libgcc/Makefile == --- head/gnu/lib/libgcc/MakefileSat Apr 21 15:37:38 2012 (r234545) +++ head/gnu/lib/libgcc/MakefileSat Apr 21 16:02:00 2012 (r234546) @@ -276,7 +276,7 @@ ${ASM_S}: ${LIB1ASMSRC} ${ASM_V}: ${LIB1ASMSRC} ${CC} -x assembler-with-cpp -c ${CFLAGS} -DL${.PREFIX} \ -o ${.PREFIX}.vo ${.ALLSRC:N*.h} - ( nm -pg ${.PREFIX}.vo | \ + ( ${NM} -pg ${.PREFIX}.vo | \ awk 'NF == 3 $$2 !~ /^[UN]$$/ { print \t.hidden , $$3 }'\ ) ${.TARGET} @@ -325,7 +325,7 @@ SHLIB_MAPFILES = ${GCCDIR}/libgcc-std. VERSION_MAP = libgcc.map libgcc.map: ${SHLIB_MKMAP} ${SHLIB_MAPFILES} ${SOBJS} ${OBJS:R:S/$/.So/} - ( nm -pg ${SOBJS};echo %% ; \ + ( ${NM} -pg ${SOBJS};echo %% ; \ cat ${SHLIB_MAPFILES} \ | sed -e '/^[ ]*#/d' \ -e 's/^%\(if\|else\|elif\|endif\|define\)/#\1/' \ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r234504 - in head/sys: amd64/conf i386/conf
On Sat, Apr 21, 2012 at 09:45:57AM -0400, Ryan Stone wrote: On Fri, Apr 20, 2012 at 5:37 PM, Brooks Davis bro...@freebsd.org wrote: Author: brooks Date: Fri Apr 20 21:37:42 2012 New Revision: 234504 URL: http://svn.freebsd.org/changeset/base/234504 Log: ?Enable DTrace hooks in GENERIC. ?Reviewed by: ?gnn ?Approved by: ?core (jhb, imp) ?Requested by: a cast of thousands ?MFC after: ? ?3 days Excellent! Thanks to everybody who helped make this happen, starting with the participants at dtrace.conf who gave us the requisite whacks with the clue-by-four. However, what is our policy for enabling features in -STABLE that are known to be unstable? If we MFC this I don't have the slightest worry that somebody might see instability in their system just because the hooks are all of a sudden there, but I would worry that somebody make take DTrace hooks being enabled in GENERIC on -STABLE to imply that DTrace is stable, start using it and being upset when they trip over a DTrace bug. I think we should note that it remains experimental and somewhat buggy in the release notes and probably in the MFC message. Otherwise, it's like any new feature. If you start using a feature in production without extensive testing you may be surprised. -- Brooks pgpScDoNKhmuj.pgp Description: PGP signature
svn commit: r234549 - head/share/mk
Author: imp Date: Sat Apr 21 17:45:40 2012 New Revision: 234549 URL: http://svn.freebsd.org/changeset/base/234549 Log: Fix partially merged patch from my external compiler tree in r234546. Define NM except when we're in strict POSIX mode. Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk == --- head/share/mk/sys.mkSat Apr 21 16:27:50 2012(r234548) +++ head/share/mk/sys.mkSat Apr 21 17:45:40 2012(r234549) @@ -141,6 +141,10 @@ YFLAGS ?= YFLAGS ?= -d .endif +.if !defined(%POSIX) +NM ?= nm +.endif + .if defined(%POSIX) # Posix 1003.2 mandated rules ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234551 - svnadmin/conf
Author: kib Date: Sat Apr 21 17:49:23 2012 New Revision: 234551 URL: http://svn.freebsd.org/changeset/base/234551 Log: Add Jeremie Le Hen to the src committers. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access == --- svnadmin/conf/accessSat Apr 21 17:48:17 2012(r234550) +++ svnadmin/conf/accessSat Apr 21 17:49:23 2012(r234551) @@ -126,6 +126,7 @@ jimharris jinmei jkim jkoshy +jlh jls jmallett jmg Modified: svnadmin/conf/mentors == --- svnadmin/conf/mentors Sat Apr 21 17:48:17 2012(r234550) +++ svnadmin/conf/mentors Sat Apr 21 17:49:23 2012(r234551) @@ -21,6 +21,7 @@ jceel wkoszek Co-mentor: cognet jhibbits nwhitehorn jimharris scottl Co-mentor: sbruno jinmei gnn +jlhkib jonathan rwatson kargl das melifaro ae Co-mentor: kib ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234552 - stable/9/share/man/man4
Author: melifaro Date: Sat Apr 21 18:12:24 2012 New Revision: 234552 URL: http://svn.freebsd.org/changeset/base/234552 Log: MFC r229930 Add setsockopt(2) example to ng_ksocket(4). While here, fix formatting a bit Approved by: ae(mentor) Modified: stable/9/share/man/man4/ng_ksocket.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/ng_ksocket.4 == --- stable/9/share/man/man4/ng_ksocket.4Sat Apr 21 17:49:23 2012 (r234551) +++ stable/9/share/man/man4/ng_ksocket.4Sat Apr 21 18:12:24 2012 (r234552) @@ -34,7 +34,7 @@ .\ .\ $FreeBSD$ .\ -.Dd October 28, 2005 +.Dd January 09, 2012 .Dt NG_KSOCKET 4 .Os .Sh NAME @@ -199,7 +199,7 @@ For the address is the pathname as a doubly quoted string. .Pp Examples: -.Bl -tag -width XX +.Bl -tag -width PF_LOCAL .It Dv PF_LOCAL local//tmp/foo.socket .It Dv PF_INET @@ -215,6 +215,12 @@ the normal form for that structure is used. In the future, more convenient encoding of the more common socket options may be supported. +.Pp +Setting socket options example: +.Bl -tag -width PF_LOCAL +.It Set FIB 2 for a socket (SOL_SOCKET, SO_SETFIB): +.Dv setopt \{ level=0x name=0x1014 data=[ 2 ] \} +.El .Sh SHUTDOWN This node shuts down upon receipt of a .Dv NGM_SHUTDOWN ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234553 - stable/8/share/man/man4
Author: melifaro Date: Sat Apr 21 18:14:46 2012 New Revision: 234553 URL: http://svn.freebsd.org/changeset/base/234553 Log: MFC r229930 Add setsockopt(2) example to ng_ksocket(4). While here, fix formatting a bit Approved by: ae(mentor) Modified: stable/8/share/man/man4/ng_ksocket.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/ng_ksocket.4 == --- stable/8/share/man/man4/ng_ksocket.4Sat Apr 21 18:12:24 2012 (r234552) +++ stable/8/share/man/man4/ng_ksocket.4Sat Apr 21 18:14:46 2012 (r234553) @@ -34,7 +34,7 @@ .\ .\ $FreeBSD$ .\ -.Dd October 28, 2005 +.Dd January 09, 2012 .Dt NG_KSOCKET 4 .Os .Sh NAME @@ -199,7 +199,7 @@ For the address is the pathname as a doubly quoted string. .Pp Examples: -.Bl -tag -width XX +.Bl -tag -width PF_LOCAL .It Dv PF_LOCAL local//tmp/foo.socket .It Dv PF_INET @@ -215,6 +215,12 @@ the normal form for that structure is used. In the future, more convenient encoding of the more common socket options may be supported. +.Pp +Setting socket options example: +.Bl -tag -width PF_LOCAL +.It Set FIB 2 for a socket (SOL_SOCKET, SO_SETFIB): +.Dv setopt \{ level=0x name=0x1014 data=[ 2 ] \} +.El .Sh SHUTDOWN This node shuts down upon receipt of a .Dv NGM_SHUTDOWN ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234554 - head/sys/vm
Author: alc Date: Sat Apr 21 18:26:16 2012 New Revision: 234554 URL: http://svn.freebsd.org/changeset/base/234554 Log: As documented in vm_page.h, updates to the vm_page's flags no longer require the page queues lock. MFC after:1 week Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c == --- head/sys/vm/vm_page.c Sat Apr 21 18:14:46 2012(r234553) +++ head/sys/vm/vm_page.c Sat Apr 21 18:26:16 2012(r234554) @@ -2155,13 +2155,10 @@ vm_page_unwire(vm_page_t m, int activate if ((m-oflags VPO_UNMANAGED) != 0 || m-object == NULL) return; - vm_page_lock_queues(); - if (activate) - vm_page_enqueue(PQ_ACTIVE, m); - else { + if (!activate) m-flags = ~PG_WINATCFLS; - vm_page_enqueue(PQ_INACTIVE, m); - } + vm_page_lock_queues(); + vm_page_enqueue(activate ? PQ_ACTIVE : PQ_INACTIVE, m); vm_page_unlock_queues(); } } else @@ -2201,8 +2198,8 @@ _vm_page_deactivate(vm_page_t m, int ath if ((queue = m-queue) == PQ_INACTIVE) return; if (m-wire_count == 0 (m-oflags VPO_UNMANAGED) == 0) { - vm_page_lock_queues(); m-flags = ~PG_WINATCFLS; + vm_page_lock_queues(); if (queue != PQ_NONE) vm_page_queue_remove(queue, m); if (athead) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234555 - stable/8/lib/libradius
Author: melifaro Date: Sat Apr 21 18:30:48 2012 New Revision: 234555 URL: http://svn.freebsd.org/changeset/base/234555 Log: MFC: r228730 Add binding support to libradius(3). Submitted by:Sergey Matveychuk se...@yandex-team.ru Approved by: kib(mentor) Modified: stable/8/lib/libradius/Makefile stable/8/lib/libradius/libradius.3 stable/8/lib/libradius/radlib.c stable/8/lib/libradius/radlib.h stable/8/lib/libradius/radlib_private.h Directory Properties: stable/8/lib/libradius/ (props changed) Modified: stable/8/lib/libradius/Makefile == --- stable/8/lib/libradius/Makefile Sat Apr 21 18:26:16 2012 (r234554) +++ stable/8/lib/libradius/Makefile Sat Apr 21 18:30:48 2012 (r234555) @@ -36,6 +36,7 @@ MAN= libradius.3 radius.conf.5 MLINKS+=libradius.3 rad_acct_open.3 \ libradius.3 rad_add_server.3 \ libradius.3 rad_auth_open.3 \ + libradius.3 rad_bind_to.3 \ libradius.3 rad_close.3 \ libradius.3 rad_config.3 \ libradius.3 rad_continue_send_request.3 \ Modified: stable/8/lib/libradius/libradius.3 == --- stable/8/lib/libradius/libradius.3 Sat Apr 21 18:26:16 2012 (r234554) +++ stable/8/lib/libradius/libradius.3 Sat Apr 21 18:30:48 2012 (r234555) @@ -91,6 +91,8 @@ .Fn rad_server_open int fd .Ft const char * .Fn rad_server_secret struct rad_handle *h +.Ft void +.Fn rad_bind_to struct rad_handle *h in_addr_t addr .Ft u_char * .Fn rad_demangle struct rad_handle *h const void *mangled size_t mlen .Ft u_char * @@ -431,6 +433,10 @@ returns the secret shared with the curre supplied rad_handle. .Pp The +.Fn rad_bind_to +assigns a source address for all requests to the current RADIUS server. +.Pp +The .Fn rad_demangle function demangles attributes containing passwords and MS-CHAPv1 MPPE-Keys. The return value is Modified: stable/8/lib/libradius/radlib.c == --- stable/8/lib/libradius/radlib.c Sat Apr 21 18:26:16 2012 (r234554) +++ stable/8/lib/libradius/radlib.c Sat Apr 21 18:30:48 2012 (r234555) @@ -756,9 +756,16 @@ rad_create_request(struct rad_handle *h, clear_password(h); h-authentic_pos = 0; h-out_created = 1; + h-bindto = INADDR_ANY; return 0; } +void +rad_bind_to(struct rad_handle *h, in_addr_t addr) +{ +h-bindto = addr; +} + int rad_create_response(struct rad_handle *h, int code) { @@ -857,7 +864,7 @@ rad_init_send_request(struct rad_handle memset(sin, 0, sizeof sin); sin.sin_len = sizeof sin; sin.sin_family = AF_INET; - sin.sin_addr.s_addr = INADDR_ANY; + sin.sin_addr.s_addr = h-bindto; sin.sin_port = htons(0); if (bind(h-fd, (const struct sockaddr *)sin, sizeof sin) == -1) { Modified: stable/8/lib/libradius/radlib.h == --- stable/8/lib/libradius/radlib.h Sat Apr 21 18:26:16 2012 (r234554) +++ stable/8/lib/libradius/radlib.h Sat Apr 21 18:30:48 2012 (r234555) @@ -195,6 +195,7 @@ struct rad_handle *rad_acct_open(void); int rad_add_server(struct rad_handle *, const char *, int, const char *, int, int); struct rad_handle *rad_auth_open(void); +voidrad_bind_to(struct rad_handle *, in_addr_t); voidrad_close(struct rad_handle *); int rad_config(struct rad_handle *, const char *); int rad_continue_send_request(struct rad_handle *, int, Modified: stable/8/lib/libradius/radlib_private.h == --- stable/8/lib/libradius/radlib_private.h Sat Apr 21 18:26:16 2012 (r234554) +++ stable/8/lib/libradius/radlib_private.h Sat Apr 21 18:30:48 2012 (r234555) @@ -92,6 +92,7 @@ struct rad_handle { int try; /* How many requests we've sent */ int srv; /* Server number we did last */ int type; /* Handle type */ + in_addr_tbindto;/* Bind to address */ }; struct vendor_attribute { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234556 - head/sys/vm
Author: kib Date: Sat Apr 21 18:36:53 2012 New Revision: 234556 URL: http://svn.freebsd.org/changeset/base/234556 Log: When MAP_STACK mapping is created, the map entry is created only to cover the initial stack size. For MCL_WIREFUTURE maps, the subsequent call to vm_map_wire() to wire the whole stack region fails due to VM_MAP_WIRE_NOHOLES flag. Use the VM_MAP_WIRE_HOLESOK to only wire mapped part of the stack. Reported and tested by: Sushanth Rai sushanth_rai yahoo com Reviewed by: alc MFC after:1 week Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c == --- head/sys/vm/vm_mmap.c Sat Apr 21 18:30:48 2012(r234555) +++ head/sys/vm/vm_mmap.c Sat Apr 21 18:36:53 2012(r234556) @@ -1561,9 +1561,11 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, * If the process has requested that all future mappings * be wired, then heed this. */ - if (map-flags MAP_WIREFUTURE) + if (map-flags MAP_WIREFUTURE) { vm_map_wire(map, *addr, *addr + size, - VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); + VM_MAP_WIRE_USER | ((flags MAP_STACK) ? + VM_MAP_WIRE_HOLESOK : VM_MAP_WIRE_NOHOLES)); + } } else { /* * If this mapping was accounted for in the vnode's ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r234504 - in head/sys: amd64/conf i386/conf
On Sat, Apr 21, 2012 at 12:11:28PM -0500, Brooks Davis wrote: On Sat, Apr 21, 2012 at 09:45:57AM -0400, Ryan Stone wrote: Excellent! Thanks to everybody who helped make this happen, starting with the participants at dtrace.conf who gave us the requisite whacks with the clue-by-four. However, what is our policy for enabling features in -STABLE that are known to be unstable? If we MFC this I don't have the slightest worry that somebody might see instability in their system just because the hooks are all of a sudden there, but I would worry that somebody make take DTrace hooks being enabled in GENERIC on -STABLE to imply that DTrace is stable, start using it and being upset when they trip over a DTrace bug. I think we should note that it remains experimental and somewhat buggy in the release notes and probably in the MFC message. Otherwise, it's like any new feature. If you start using a feature in production without extensive testing you may be surprised. I think that given we're just broken 9.x ice, it should be MFCed. ./danfe ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234558 - in stable/9/sys: boot/fdt boot/uboot/common i386/conf kern
Author: raj Date: Sat Apr 21 20:10:26 2012 New Revision: 234558 URL: http://svn.freebsd.org/changeset/base/234558 Log: MFC r233230, r233323: Improve device tree blob (DTB) handling in loader(8). Enable using the statically embedded blob from the kernel, if present. The KLD loaded DTB takes precedence, but they are both recognized and handled in the same way. Improve FDT handling in loader(8) and make it more robust. o Fix buffer overflows when using a long property body in node paths. o Fix loop end condition when iterating through the symbol table. o Better error handling during node modification, better problem reporting. o Eliminate build time warnings. Submitted by: Lukasz Wojcik Obtained from: Semihalf Modified: stable/9/sys/boot/fdt/fdt_loader_cmd.c stable/9/sys/boot/uboot/common/metadata.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) stable/9/sys/kern/subr_witness.c (props changed) Modified: stable/9/sys/boot/fdt/fdt_loader_cmd.c == --- stable/9/sys/boot/fdt/fdt_loader_cmd.c Sat Apr 21 19:22:53 2012 (r234557) +++ stable/9/sys/boot/fdt/fdt_loader_cmd.c Sat Apr 21 20:10:26 2012 (r234558) @@ -33,6 +33,9 @@ __FBSDID($FreeBSD$); #include stand.h #include fdt.h #include libfdt.h +#include sys/param.h +#include sys/linker.h +#include machine/elf.h #include bootstrap.h #include glue.h @@ -54,7 +57,9 @@ __FBSDID($FreeBSD$); #define STR(number) #number #define STRINGIFY(number) STR(number) -#define MIN(num1, num2)(((num1) (num2)) ? (num1):(num2)) +#define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l) + +#define FDT_STATIC_DTB_SYMBOL fdt_static_dtb static struct fdt_header *fdtp = NULL; @@ -92,6 +97,91 @@ static const struct cmdtab commands[] = static char cwd[FDT_CWD_LEN] = /; +static vm_offset_t +fdt_find_static_dtb(void) +{ + Elf_Sym sym; + vm_offset_t dyntab, esym; + uint64_t offs; + struct preloaded_file *kfp; + struct file_metadata *md; + Elf_Sym *symtab; + Elf_Dyn *dyn; + char *strtab, *strp; + int i, sym_count; + + symtab = NULL; + dyntab = esym = 0; + strtab = strp = NULL; + + offs = __elfN(relocation_offset); + + kfp = file_findfile(NULL, NULL); + if (kfp == NULL) + return (0); + + md = file_findmetadata(kfp, MODINFOMD_ESYM); + if (md == NULL) + return (0); + COPYOUT(md-md_data, esym, sizeof(esym)); + + md = file_findmetadata(kfp, MODINFOMD_DYNAMIC); + if (md == NULL) + return (0); + COPYOUT(md-md_data, dyntab, sizeof(dyntab)); + + dyntab += offs; + + /* Locate STRTAB and DYNTAB */ + for (dyn = (Elf_Dyn *)dyntab; dyn-d_tag != DT_NULL; dyn++) { + if (dyn-d_tag == DT_STRTAB) { + strtab = (char *)(uintptr_t)(dyn-d_un.d_ptr + offs); + continue; + } else if (dyn-d_tag == DT_SYMTAB) { + symtab = (Elf_Sym *)(uintptr_t) + (dyn-d_un.d_ptr + offs); + continue; + } + } + + if (symtab == NULL || strtab == NULL) { + /* +* No symtab? No strtab? That should not happen here, +* and should have been verified during __elfN(loadimage). +* This must be some kind of a bug. +*/ + return (0); + } + + sym_count = (int)((Elf_Sym *)esym - symtab) / sizeof(Elf_Sym); + + /* +* The most efficent way to find a symbol would be to calculate a +* hash, find proper bucket and chain, and thus find a symbol. +* However, that would involve code duplication (e.g. for hash +* function). So we're using simpler and a bit slower way: we're +* iterating through symbols, searching for the one which name is +* 'equal' to 'fdt_static_dtb'. To speed up the process a little bit, +* we are eliminating symbols type of which is not STT_NOTYPE, or(and) +* those
svn commit: r234559 - in stable/9/sys: arm/conf arm/mv boot/fdt/dts dev/cesa i386/conf kern
Author: raj Date: Sat Apr 21 20:22:02 2012 New Revision: 234559 URL: http://svn.freebsd.org/changeset/base/234559 Log: MFC r227730: Initial version of cesa(4) driver for Marvell crypto engine and security accelerator. The following algorithms and schemes are supported: - 3DES, AES, DES - MD5, SHA1 Obtained from: Semihalf Written by: Piotr Ziecik Added: stable/9/sys/dev/cesa/ - copied from r227730, head/sys/dev/cesa/ Modified: stable/9/sys/arm/conf/DB-88F6XXX stable/9/sys/arm/conf/SHEEVAPLUG stable/9/sys/arm/mv/files.mv stable/9/sys/boot/fdt/dts/db88f6281.dts stable/9/sys/boot/fdt/dts/sheevaplug.dts Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) stable/9/sys/kern/subr_witness.c (props changed) Modified: stable/9/sys/arm/conf/DB-88F6XXX == --- stable/9/sys/arm/conf/DB-88F6XXXSat Apr 21 20:10:26 2012 (r234558) +++ stable/9/sys/arm/conf/DB-88F6XXXSat Apr 21 20:22:02 2012 (r234559) @@ -66,6 +66,10 @@ device mii device e1000phy device bpf +device cesa# Marvell security engine +device crypto +device cryptodev + # USB optionsUSB_DEBUG # enable debug msgs device usb Modified: stable/9/sys/arm/conf/SHEEVAPLUG == --- stable/9/sys/arm/conf/SHEEVAPLUGSat Apr 21 20:10:26 2012 (r234558) +++ stable/9/sys/arm/conf/SHEEVAPLUGSat Apr 21 20:22:02 2012 (r234559) @@ -60,6 +60,10 @@ options HZ=1000 optionsDEVICE_POLLING device vlan +device cesa# Marvell security engine +device crypto +device cryptodev + # USB optionsUSB_DEBUG # enable debug msgs device usb Modified: stable/9/sys/arm/mv/files.mv == --- stable/9/sys/arm/mv/files.mvSat Apr 21 20:10:26 2012 (r234558) +++ stable/9/sys/arm/mv/files.mvSat Apr 21 20:22:02 2012 (r234559) @@ -28,6 +28,7 @@ arm/mv/mv_sata.c optionalata | atamvsa arm/mv/timer.c standard arm/mv/twsi.c optionaliicbus +dev/cesa/cesa.coptionalcesa dev/mge/if_mge.c optionalmge dev/mvs/mvs_soc.c optionalmvs dev/uart/uart_dev_ns8250.c optionaluart Modified: stable/9/sys/boot/fdt/dts/db88f6281.dts == --- stable/9/sys/boot/fdt/dts/db88f6281.dts Sat Apr 21 20:10:26 2012 (r234558) +++ stable/9/sys/boot/fdt/dts/db88f6281.dts Sat Apr 21 20:22:02 2012 (r234559) @@ -239,6 +239,8 @@ reg = 0x3 0x1; interrupts = 22; interrupt-parent = PIC; + + sram-handle = SRAM; }; usb@5 { Modified: stable/9/sys/boot/fdt/dts/sheevaplug.dts == --- stable/9/sys/boot/fdt/dts/sheevaplug.dtsSat Apr 21 20:10:26 2012 (r234558) +++ stable/9/sys/boot/fdt/dts/sheevaplug.dtsSat Apr 21 20:22:02 2012 (r234559) @@ -236,6 +236,8 @@ reg = 0x3 0x1; interrupts = 22; interrupt-parent = PIC; + + sram-handle = SRAM; }; usb@5 { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234560 - head/sys/arm/at91
Author: marius Date: Sun Apr 22 00:43:32 2012 New Revision: 234560 URL: http://svn.freebsd.org/changeset/base/234560 Log: - Add support for MCI1 revision 2xx controllers and a work-around for their Data Write Operation and number of bytes erratum. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. Modified: head/sys/arm/at91/at91_mci.c head/sys/arm/at91/at91_mcireg.h Modified: head/sys/arm/at91/at91_mci.c == --- head/sys/arm/at91/at91_mci.cSat Apr 21 20:22:02 2012 (r234559) +++ head/sys/arm/at91/at91_mci.cSun Apr 22 00:43:32 2012 (r234560) @@ -113,6 +113,7 @@ static void at91_mci_intr(void *); /* helper routines */ static int at91_mci_activate(device_t dev); static void at91_mci_deactivate(device_t dev); +static int at91_mci_is_mci1rev2xx(void); #define AT91_MCI_LOCK(_sc) mtx_lock((_sc)-sc_mtx) #defineAT91_MCI_UNLOCK(_sc)mtx_unlock((_sc)-sc_mtx) @@ -141,11 +142,16 @@ static void at91_mci_init(device_t dev) { struct at91_mci_softc *sc = device_get_softc(dev); + uint32_t val; WR4(sc, MCI_CR, MCI_CR_MCIEN); /* Enable controller */ WR4(sc, MCI_IDR, 0x); /* Turn off interrupts */ WR4(sc, MCI_DTOR, MCI_DTOR_DTOMUL_1M | 1); - WR4(sc, MCI_MR, 0x834a);// XXX GROSS HACK FROM LINUX + val = MCI_MR_PDCMODE; + val |= 0x34a; /* PWSDIV = 3; CLKDIV = 74 */ + if (at91_mci_is_mci1rev2xx()) + val |= MCI_MR_RDPROOF | MCI_MR_WRPROOF; + WR4(sc, MCI_MR, val); #ifndef AT91_MCI_SLOT_B WR4(sc, MCI_SDCR, 0); /* SLOT A, 1 bit bus */ #else @@ -303,6 +309,29 @@ at91_mci_deactivate(device_t dev) return; } +static int +at91_mci_is_mci1rev2xx(void) +{ + + switch (AT91_CPU(at91_chip_id)) { + case AT91_CPU_SAM9260: + case AT91_CPU_SAM9263: +#ifdef notyet + case AT91_CPU_CAP9: +#endif + case AT91_CPU_SAM9G10: + case AT91_CPU_SAM9G20: +#ifdef notyet + case AT91_CPU_SAM9RL: +#endif + case AT91_CPU_SAM9XE128: + case AT91_CPU_SAM9XE256: + case AT91_CPU_SAM9XE512: + return(1); + } + return (0); +} + static void at91_mci_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { @@ -346,6 +375,7 @@ at91_mci_update_ios(device_t brdev, devi static void at91_mci_start_cmd(struct at91_mci_softc *sc, struct mmc_command *cmd) { + size_t len; uint32_t cmdr, ier = 0, mr; uint32_t *src, *dst; int i; @@ -397,6 +427,7 @@ at91_mci_start_cmd(struct at91_mci_softc WR4(sc, MCI_MR, mr | (data-len 16) | MCI_MR_PDCMODE); WR4(sc, PDC_PTCR, PDC_PTCR_RXTDIS | PDC_PTCR_TXTDIS); if (cmdr MCI_CMDR_TRCMD_START) { + len = data-len; if (cmdr MCI_CMDR_TRDIR) vaddr = cmd-data-data; else { @@ -411,6 +442,15 @@ at91_mci_start_cmd(struct at91_mci_softc vaddr = sc-bounce_buffer; src = (uint32_t *)cmd-data-data; dst = (uint32_t *)vaddr; + /* +* If this is MCI1 revision 2xx controller, apply +* a work-around for the Data Write Operation and +* number of bytes erratum. +*/ + if (at91_mci_is_mci1rev2xx() data-len 12) { + len = 12; + memset(dst, 0, 12); + } if (sc-sc_cap CAP_NEEDS_BYTESWAP) { for (i = 0; i data-len / 4; i++) dst[i] = bswap32(src[i]); @@ -418,7 +458,7 @@ at91_mci_start_cmd(struct at91_mci_softc memcpy(dst, src, data-len); } data-xfer_len = 0; - if (bus_dmamap_load(sc-dmatag, sc-map, vaddr, data-len, + if (bus_dmamap_load(sc-dmatag, sc-map, vaddr, len, at91_mci_getaddr, paddr, 0) != 0) { cmd-error = MMC_ERR_NO_MEMORY; sc-req = NULL; @@ -430,12 +470,12 @@ at91_mci_start_cmd(struct at91_mci_softc if (cmdr MCI_CMDR_TRDIR) { bus_dmamap_sync(sc-dmatag, sc-map, BUS_DMASYNC_PREREAD); WR4(sc, PDC_RPR, paddr); - WR4(sc, PDC_RCR, data-len / 4); + WR4(sc, PDC_RCR, len / 4); ier = MCI_SR_ENDRX; } else { bus_dmamap_sync(sc-dmatag, sc-map, BUS_DMASYNC_PREWRITE); WR4(sc, PDC_TPR, paddr); - WR4(sc, PDC_TCR, data-len / 4); +
svn commit: r234562 - stable/9/sys/boot/pc98/boot2
Author: nyan Date: Sun Apr 22 03:53:11 2012 New Revision: 234562 URL: http://svn.freebsd.org/changeset/base/234562 Log: MFC: revision 232784 MFi386: revisions 232570 and 232754 Fix boot2 to handle boot config files that only contain a custom path to a loader or kernel. Modified: stable/9/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/pc98/boot2/boot2.c == --- stable/9/sys/boot/pc98/boot2/boot2.cSun Apr 22 00:58:04 2012 (r234561) +++ stable/9/sys/boot/pc98/boot2/boot2.cSun Apr 22 03:53:11 2012 (r234562) @@ -130,9 +130,9 @@ static struct dsk { unsigned part; unsigned start; } dsk; -static char cmd[512], cmddup[512]; +static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname = NULL; -static uint32_t opts; +static uint32_t opts = 0; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -352,6 +352,7 @@ main(void) #endif uint8_t autoboot; ino_t ino; +size_t nbyte; dmadat = (void *)(roundup2(__base + (int32_t)_end, 0x1) - __base); v86.ctl = V86_FLAGS; @@ -378,8 +379,10 @@ main(void) autoboot = 1; if ((ino = lookup(PATH_CONFIG)) || -(ino = lookup(PATH_DOTCONFIG))) - fsread(ino, cmd, sizeof(cmd)); +(ino = lookup(PATH_DOTCONFIG))) { + nbyte = fsread(ino, cmd, sizeof(cmd) - 1); + cmd[nbyte] = '\0'; +} if (*cmd) { memcpy(cmddup, cmd, sizeof(cmd)); @@ -396,9 +399,9 @@ main(void) * or in case of failure, try to load a kernel directly instead. */ -if (autoboot !kname) { +if (!kname) { kname = PATH_BOOT3; - if (!keyhit(3*SECOND)) { + if (autoboot !keyhit(3*SECOND)) { load(); kname = PATH_KERNEL; } @@ -595,7 +598,12 @@ parse() dsk.daua = dsk.disk | dsk.unit; dsk_meta = 0; } -kname = arg; + if ((i = ep - arg)) { + if ((size_t)i = sizeof(knamebuf)) + return -1; + memcpy(knamebuf, arg, i + 1); + kname = knamebuf; + } } arg = p; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234563 - stable/8/sys/boot/pc98/boot2
Author: nyan Date: Sun Apr 22 03:57:33 2012 New Revision: 234563 URL: http://svn.freebsd.org/changeset/base/234563 Log: MFC: revision 232784 MFi386: revisions 232570 and 232754 Fix boot2 to handle boot config files that only contain a custom path to a loader or kernel. Modified: stable/8/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Modified: stable/8/sys/boot/pc98/boot2/boot2.c == --- stable/8/sys/boot/pc98/boot2/boot2.cSun Apr 22 03:53:11 2012 (r234562) +++ stable/8/sys/boot/pc98/boot2/boot2.cSun Apr 22 03:57:33 2012 (r234563) @@ -130,9 +130,9 @@ static struct dsk { unsigned part; unsigned start; } dsk; -static char cmd[512], cmddup[512]; +static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname = NULL; -static uint32_t opts; +static uint32_t opts = 0; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -352,6 +352,7 @@ main(void) #endif uint8_t autoboot; ino_t ino; +size_t nbyte; dmadat = (void *)(roundup2(__base + (int32_t)_end, 0x1) - __base); v86.ctl = V86_FLAGS; @@ -378,8 +379,10 @@ main(void) autoboot = 1; if ((ino = lookup(PATH_CONFIG)) || -(ino = lookup(PATH_DOTCONFIG))) - fsread(ino, cmd, sizeof(cmd)); +(ino = lookup(PATH_DOTCONFIG))) { + nbyte = fsread(ino, cmd, sizeof(cmd) - 1); + cmd[nbyte] = '\0'; +} if (*cmd) { memcpy(cmddup, cmd, sizeof(cmd)); @@ -396,9 +399,9 @@ main(void) * or in case of failure, try to load a kernel directly instead. */ -if (autoboot !kname) { +if (!kname) { kname = PATH_BOOT3; - if (!keyhit(3*SECOND)) { + if (autoboot !keyhit(3*SECOND)) { load(); kname = PATH_KERNEL; } @@ -595,7 +598,12 @@ parse() dsk.daua = dsk.disk | dsk.unit; dsk_meta = 0; } -kname = arg; + if ((i = ep - arg)) { + if ((size_t)i = sizeof(knamebuf)) + return -1; + memcpy(knamebuf, arg, i + 1); + kname = knamebuf; + } } arg = p; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r234564 - head/sys/pc98/pc98
Author: nyan Date: Sun Apr 22 04:36:25 2012 New Revision: 234564 URL: http://svn.freebsd.org/changeset/base/234564 Log: MFi386: revisions 234074 and 234105 - Adding the BSP as an interrupt target directly in cpu_startup(). Modified: head/sys/pc98/pc98/machdep.c Modified: head/sys/pc98/pc98/machdep.c == --- head/sys/pc98/pc98/machdep.cSun Apr 22 03:57:33 2012 (r234563) +++ head/sys/pc98/pc98/machdep.cSun Apr 22 04:36:25 2012 (r234564) @@ -271,6 +271,13 @@ cpu_startup(dummy) bufinit(); vm_pager_bufferinit(); cpu_setregs(); + +#ifdef SMP + /* +* Add BSP as an interrupt target. +*/ + intr_add_cpu(0); +#endif } /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org