Re: svn commit: r211505 - head/contrib/gcc

2010-08-21 Thread Rui Paulo

On 20 Aug 2010, at 21:36, Bruce Evans wrote:

> On Fri, 20 Aug 2010, Dimitry Andric wrote:
> 
>> On 2010-08-20 00:20, Bruce Evans wrote:
>>> These seem to be needed, and some of them valid.  Any lvalue arg that
>>> can be put in a register can be cast to USItype (unsigned int) on i386.
>>> The args are macro args, so they may have any integer type no larger
>>> than USItype originally, and they must be cast to USItype for the asms
>>> to work if the args are smaller than USItype...
>> 
>> But will the casts not potentially hide problems, if you pass the wrong
>> types to those macros?  Maybe it is better if the compiler complains
>> that some argument is of an incompatible type, than just forcing it to
>> cast?
> 
> This is unclear.  All integer types are compatible to some extent.
> Upcasting them always works and downcasting them works iff the value
> is not changed.

I think he meant that downcasting might not work.

> 
 which are apparently "heinous" GNU extensions, so clang can
 compile this without using the -fheinous-gnu-extensions option.
>>> 
>>> But when the args are lvalues, casting them is invalid.  This is
>>> apparently the heinous extension depended on.
>> 
>> Yes, clang complains precisely about that:
>> 
>> gnu/lib/libgcc/../../../contrib/gcc/libgcc2.c:536:22: error: invalid use of 
>> a cast in a inline asm context requiring an l-value: remove the cast or 
>> build with -fheinous-gnu-extensions
>> DWunion w = {.ll = __umulsidi3 (uu.s.low, vv.s.low)};
>>^~~~
>> In file included from gnu/lib/libgcc/../../../contrib/gcc/libgcc2.c:65:
>> In file included from gnu/lib/libgcc/../../../contrib/gcc/libgcc2.h:435:
>> gnu/lib/libgcc/../../../contrib/gcc/longlong.h:1293:5: note: instantiated 
>> from:
>>   umul_ppmm (__w.s.high, __w.s.low, u, v);\
>>   ^
>> 
>> It turns out that only removing the casts for these specific lvalues is
>> indeed enough to make clang happy.  Attached patch reverts all other
>> changes, if that is to be preferred.
> 
> I prefer this.

I'll commit this.

> 
 Results in *no* binary change, neither with clang, nor with gcc.
>>> 
>>> This cannot be tested by compiling a few binaries, since the few binaries
>>> might not include enough examples to give test coverage of cases with
>>> args smaller than USItype.  Perhaps the macros are only used for building
>>> libgcc, but this is unclear.
>> 
>> contrib/gcc/longlong.h is only used in contrib/gcc/libgcc2.h, and in
>> contrib/gcc/config/soft-fp/soft-fp.h.  On i386, soft-fp is not used,
>> and libgcc2.h is only used in contrib/gcc/libgcc2.c, so libgcc is the
>> only consumer, as far as I can see.
> 
> There are many parameters.  Probably the casts are needed for some arches,
> so gnu can't just remove them and wouldn't like your patch.  But they should
> fix the casts of lvalues someday.
> 
> The ifdefs are hard to untangle.  I thought I found a simple case where
> the cast helps, but actually the ifdefs make the cast have no effect
> although the code is logically wrong.  From your patch:
> 
> %  #define count_leading_zeros(count, x) \
> %do { 
> \
> %  USItype __cbtmp;   
> \
> %  __asm__ ("bsrl %1,%0"  \
> % -: "=r" (__cbtmp) : "rm" (x));  \
> % +: "=r" (__cbtmp) : "rm" ((USItype) (x)));  \
> %  (count) = __cbtmp ^ 31;
> \
> %} while (0)
> %  #define count_trailing_zeros(count, x) \
> 
> This interface is supposed to operate on `UWtype x'.  UWtype is UDItype
> on some arches, so casting it to USItype breaks it.  However, the breakage
> is only logical since all this is under a __i386__ && W_TYPE_SIZE == 32
> ifdef, which makes UWtype the same width as USItype so the cast has no
> effect if x has the correct type.
> 
> The above wouldn't work on amd64 since the correct code is bsrq with no
> cast (the value is 64 bits; the cast would give a 32-bit value; apart from 
> breaking the value, this would give invalid asm like "bsrq %eax" if the
> casted value ends up in a register.  Handling all the cases is apparently
> too hard, so longlong.h doesn't have any special support for clz on amd64
> and a generic version -- the above is apparently used for __clzsi2() and
> _clzdi2() on i386, but on amd64 a slow loop is used.  gcc asm still seems
> to be missing support for writing this correctly ("bsr%[mumble1] %1,%0",
> where %[mumble1] is either q or l (or w or b?) depending on the size of %1).

I agree with you. Thanks for the careful analysis.

Regards,
--
Rui Paulo


___
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...

svn commit: r211537 - head/contrib/gcc

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 10:31:26 2010
New Revision: 211537
URL: http://svn.freebsd.org/changeset/base/211537

Log:
  Revert part of r211505. Some of the removed casts are actually safe so
  put them back in again. Also, clang only complained about the lvalue
  cast.
  
  Submitted by: Dimitry Andric 
  Pointed out:  bde

Modified:
  head/contrib/gcc/longlong.h

Modified: head/contrib/gcc/longlong.h
==
--- head/contrib/gcc/longlong.h Sat Aug 21 08:49:53 2010(r211536)
+++ head/contrib/gcc/longlong.h Sat Aug 21 10:31:26 2010(r211537)
@@ -314,38 +314,38 @@ UDItype __umulsidi3 (USItype, USItype);
 #if (defined (__i386__) || defined (__i486__)) && W_TYPE_SIZE == 32
 #define add_ss(sh, sl, ah, al, bh, bl) \
   __asm__ ("addl %5,%1\n\tadcl %3,%0"  \
-  : "=r" (sh), \
-"=&r" (sl) \
-  : "%0" (ah), \
-"g" (bh),  \
-"%1" (al), \
-"g" (bl))
+  : "=r" ((USItype) (sh)), \
+"=&r" ((USItype) (sl)) \
+  : "%0" ((USItype) (ah)), \
+"g" ((USItype) (bh)),  \
+"%1" ((USItype) (al)), \
+"g" ((USItype) (bl)))
 #define sub_ddmmss(sh, sl, ah, al, bh, bl) \
   __asm__ ("subl %5,%1\n\tsbbl %3,%0"  \
   : "=r" (sh), \
 "=&r" (sl) \
-  : "0" (ah),  \
-"g" (bh),  \
-"1" (al),  \
-"g" (bl))
+  : "0" ((USItype) (ah)),  \
+"g" ((USItype) (bh)),  \
+"1" ((USItype) (al)),  \
+"g" ((USItype) (bl)))
 #define umul_ppmm(w1, w0, u, v) \
   __asm__ ("mull %3"   \
   : "=a" (w0), \
 "=d" (w1)  \
-  : "%0" (u),  \
-"rm" (v))
+  : "%0" ((USItype) (u)),  \
+"rm" ((USItype) (v)))
 #define udiv_qrnnd(q, r, n1, n0, dv) \
   __asm__ ("divl %4"   \
   : "=a" (q),  \
 "=d" (r)   \
-  : "0" (n0),  \
-"1" (n1),  \
-"rm" (dv))
+  : "0" ((USItype) (n0)),  \
+"1" ((USItype) (n1)),  \
+"rm" ((USItype) (dv)))
 #define count_leading_zeros(count, x) \
   do { \
 USItype __cbtmp;   \
 __asm__ ("bsrl %1,%0"  \
-: "=r" (__cbtmp) : "rm" (x));  \
+: "=r" (__cbtmp) : "rm" ((USItype) (x)));  \
 (count) = __cbtmp ^ 31;\
   } while (0)
 #define count_trailing_zeros(count, x) \
___
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: r211540 - head/lib/libelf

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 10:40:12 2010
New Revision: 211540
URL: http://svn.freebsd.org/changeset/base/211540

Log:
  Install a PIC libelf. This will be needed by the DTrace runtime
  instrumentation object (dtri.o).
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libelf/Makefile

Modified: head/lib/libelf/Makefile
==
--- head/lib/libelf/MakefileSat Aug 21 10:39:51 2010(r211539)
+++ head/lib/libelf/MakefileSat Aug 21 10:40:12 2010(r211540)
@@ -55,6 +55,7 @@ SRCS= elf_begin.c 
\
${GENSRCS}
 INCS=  libelf.h gelf.h
 
+INSTALL_PIC_ARCHIVE=yes
 GENSRCS=   libelf_fsize.c libelf_msize.c libelf_convert.c
 CLEANFILES=${GENSRCS}
 CFLAGS+=   -I. -I${.CURDIR}
___
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: r211545 - in head/cddl/contrib/opensolaris/cmd/dtrace/test: cmd/scripts tst/common/aggs tst/common/assocs tst/common/dtraceUtil tst/common/funcs tst/common/ip tst/common/misc tst/common...

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 11:04:38 2010
New Revision: 211545
URL: http://svn.freebsd.org/changeset/base/211545

Log:
  Port most of the DTrace tests to FreeBSD.
  
  Sponsored by: The FreeBSD Foundation

Added:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/Makefile   
(contents, props changed)
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/main.c   
(contents, props changed)
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.h   
(contents, props changed)
Modified:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.orthogonality.d
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.AddSearchPath.d.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationOut.d.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationWithO.d.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.PreprocessorStatement.d.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.index.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.include.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.c
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.c
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printT.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printY.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exec.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ENOENT.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.d
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh
  
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scr

svn commit: r211546 - head/sys/net80211

2010-08-21 Thread Bernhard Schmidt
Author: bschmidt
Date: Sat Aug 21 11:06:21 2010
New Revision: 211546
URL: http://svn.freebsd.org/changeset/base/211546

Log:
  Wrap remaining ieee80211_ratectl_node_init() calls missed in r211314.
  
  MFC after:1 week

Modified:
  head/sys/net80211/ieee80211_node.c

Modified: head/sys/net80211/ieee80211_node.c
==
--- head/sys/net80211/ieee80211_node.c  Sat Aug 21 11:04:38 2010
(r211545)
+++ head/sys/net80211/ieee80211_node.c  Sat Aug 21 11:06:21 2010
(r211546)
@@ -1404,7 +1404,8 @@ ieee80211_fakeup_adhoc_node(struct ieee8
 #endif
}
ieee80211_node_setuptxparms(ni);
-   ieee80211_ratectl_node_init(ni);
+   if (vap->iv_caps & IEEE80211_C_RATECTL)
+   ieee80211_ratectl_node_init(ni);
if (ic->ic_newassoc != NULL)
ic->ic_newassoc(ni, 1);
/* XXX not right for 802.1x/WPA */
@@ -1474,7 +1475,8 @@ ieee80211_add_neighbor(struct ieee80211v
if (ieee80211_iserp_rateset(&ni->ni_rates))
ni->ni_flags |= IEEE80211_NODE_ERP;
ieee80211_node_setuptxparms(ni);
-   ieee80211_ratectl_node_init(ni);
+   if (vap->iv_caps & IEEE80211_C_RATECTL)
+   ieee80211_ratectl_node_init(ni);
if (ic->ic_newassoc != NULL)
ic->ic_newassoc(ni, 1);
/* XXX not right for 802.1x/WPA */
@@ -2343,7 +2345,8 @@ ieee80211_node_join(struct ieee80211_nod
);
 
ieee80211_node_setuptxparms(ni);
-   ieee80211_ratectl_node_init(ni);
+   if (vap->iv_caps & IEEE80211_C_RATECTL)
+   ieee80211_ratectl_node_init(ni);
/* give driver a chance to setup state like ni_txrate */
if (ic->ic_newassoc != NULL)
ic->ic_newassoc(ni, newassoc);
___
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: r211547 - head/cddl/lib

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 11:09:03 2010
New Revision: 211547
URL: http://svn.freebsd.org/changeset/base/211547

Log:
  The DTrace instrumentation object is going to be i386/amd64 only.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/cddl/lib/Makefile

Modified: head/cddl/lib/Makefile
==
--- head/cddl/lib/Makefile  Sat Aug 21 11:06:21 2010(r211546)
+++ head/cddl/lib/Makefile  Sat Aug 21 11:09:03 2010(r211547)
@@ -2,7 +2,7 @@
 
 .include 
 
-SUBDIR=drti \
+SUBDIR=${_drti} \
libavl \
libctf \
${_libdtrace} \
@@ -20,6 +20,7 @@ _libzpool=libzpool
 .endif
 
 .if ${MACHINE_ARCH} == amd64 || ${MACHINE_ARCH} == i386
+_drti= drti
 _libdtrace=libdtrace
 .endif
 
___
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: r211550 - head/cddl/lib

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 11:14:50 2010
New Revision: 211550
URL: http://svn.freebsd.org/changeset/base/211550

Log:
  Use double quotes when checking the value of MACHINE_ARCH.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/cddl/lib/Makefile

Modified: head/cddl/lib/Makefile
==
--- head/cddl/lib/Makefile  Sat Aug 21 11:11:32 2010(r211549)
+++ head/cddl/lib/Makefile  Sat Aug 21 11:14:50 2010(r211550)
@@ -19,7 +19,7 @@ _libzpool=libzpool
 .endif
 .endif
 
-.if ${MACHINE_ARCH} == amd64 || ${MACHINE_ARCH} == i386
+.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
 _drti= drti
 _libdtrace=libdtrace
 .endif
___
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: r211553 - head/sys/cddl/compat/opensolaris/kern

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 11:41:32 2010
New Revision: 211553
URL: http://svn.freebsd.org/changeset/base/211553

Log:
  Add sysname to struct opensolaris_utsname. This is needed by one DTrace
  test.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c

Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c
==
--- head/sys/cddl/compat/opensolaris/kern/opensolaris_misc.cSat Aug 21 
11:33:49 2010(r211552)
+++ head/sys/cddl/compat/opensolaris/kern/opensolaris_misc.cSat Aug 21 
11:41:32 2010(r211553)
@@ -38,7 +38,8 @@ __FBSDID("$FreeBSD$");
 char hw_serial[11] = "0";
 
 struct opensolaris_utsname utsname = {
-   .nodename = "unset"
+   .nodename = "unset",
+   .sysname  = "SunOS"
 };
 
 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: r211554 - in head/cddl: contrib/opensolaris/cmd/dtrace contrib/opensolaris/lib/libdtrace/common contrib/opensolaris/lib/libdtrace/i386 lib/libdtrace

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 11:50:53 2010
New Revision: 211554
URL: http://svn.freebsd.org/changeset/base/211554

Log:
  Add libdtrace support for tracing userland programs.
  
  Summary of changes:
  * Implement a compatibility shim between Solaris libproc and our
  libproc and remove several ifdefs because of this.
  * Port the drti to FreeBSD.
  * Implement the missing DOODAD sections
  * Link with libproc and librtld_db
  * Support for ustack, jstack and uregs (by sson@)
  * Misc bugfixing
  
  When writing the SUWN_dof section, we had to resort to building the ELF
  file layout by "hand". This is the job of libelf, but our libelf doesn't
  support this yet. When libelf is fixed, we can remove the code under
  #ifdef BROKEN_LIBELF.
  
  Sponsored by: The FreeBSD Foundation

Added:
  head/cddl/lib/libdtrace/libproc_compat.h   (contents, props changed)
  head/cddl/lib/libdtrace/regs_x86.d   (contents, props changed)
Modified:
  head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.h
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h
  head/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c
  head/cddl/lib/libdtrace/Makefile

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
==
--- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c   Sat Aug 21 11:41:32 
2010(r211553)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c   Sat Aug 21 11:50:53 
2010(r211554)
@@ -773,19 +773,27 @@ compile_str(dtrace_cmd_t *dcp)
 static void
 prochandler(struct ps_prochandle *P, const char *msg, void *arg)
 {
-fatal("DOODAD in function %s, file %s, line 
%d\n",__FUNCTION__,__FILE__,__LINE__);
-#ifdef DOODAD
+#if defined(sun)
const psinfo_t *prp = Ppsinfo(P);
int pid = Pstatus(P)->pr_pid;
char name[SIG2STR_MAX];
+#else
+   int wstatus = proc_getwstat(P);
+   int pid = proc_getpid(P);
+#endif
 
if (msg != NULL) {
notice("pid %d: %s\n", pid, msg);
return;
}
 
+#if defined(sun)
switch (Pstate(P)) {
+#else
+   switch (proc_state(P)) {
+#endif
case PS_UNDEAD:
+#if defined(sun)
/*
 * Ideally we would like to always report pr_wstat here, but it
 * isn't possible given current /proc semantics.  If we grabbed
@@ -798,9 +806,20 @@ fatal("DOODAD in function %s, file %s, l
notice("pid %d terminated by %s\n", pid,
proc_signame(WTERMSIG(prp->pr_wstat),
name, sizeof (name)));
+#else
+   if (WIFSIGNALED(wstatus)) {
+   notice("pid %d terminated by %d\n", pid,
+   WTERMSIG(wstatus));
+#endif
+#if defined(sun)
} else if (prp != NULL && WEXITSTATUS(prp->pr_wstat) != 0) {
notice("pid %d exited with status %d\n",
pid, WEXITSTATUS(prp->pr_wstat));
+#else
+   } else if (WEXITSTATUS(wstatus) != 0) {
+   notice("pid %d exited with status %d\n",
+   pid, WEXITSTATUS(wstatus));
+#endif
} else {
notice("pid %d has exited\n", pid);
}
@@ -812,7 +831,6 @@ fatal("DOODAD in function %s, file %s, l
g_pslive--;
break;
}
-#endif
 }
 
 /*ARGSUSED*/

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c   Sat Aug 21 
11:41:32 2010(r211553)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c   Sat Aug 21 
11:50:53 2010(r211554)
@@ -34,6 +34,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 /*
  * In Solaris 10 GA, the only mechanism for communicating helper information
@@ -53,12 +55,16 @@
  */
 
 static const char *devnamep = "/dev/dtrace/helper";
+#if defined(sun)
 static const char *olddevname = "/devices/pseudo/dtr...@0:helper";
+#endif
 
 static const char *modname;/* Name of this load object */
 static int gen;/* DOF helper generation */
+#if defined(sun)
 extern dof_hdr_t __SUNW_dof;   /* DOF defined in the .SUNW_dof section */
-static boolean_t dof_init_debug = B_FALSE;   

svn commit: r211555 - head/sys/cddl/contrib/opensolaris/uts/common/sys

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 11:58:08 2010
New Revision: 211555
URL: http://svn.freebsd.org/changeset/base/211555

Log:
  Port the DTrace helper ioctls to FreeBSD and add a helper member to
  dof_helper_t (needed by drti.o).
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h

Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h   Sat Aug 21 
11:50:53 2010(r211554)
+++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h   Sat Aug 21 
11:58:08 2010(r211555)
@@ -1322,15 +1322,24 @@ typedef struct {
  * helpers and should no longer be used.  No other ioctls are valid on the
  * helper minor node.
  */
+#if defined(sun)
 #defineDTRACEHIOC  (('d' << 24) | ('t' << 16) | ('h' << 8))
 #defineDTRACEHIOC_ADD  (DTRACEHIOC | 1)/* add helper */
 #defineDTRACEHIOC_REMOVE   (DTRACEHIOC | 2)/* remove 
helper */
 #defineDTRACEHIOC_ADDDOF   (DTRACEHIOC | 3)/* add helper 
DOF */
+#else
+#defineDTRACEHIOC_ADD  _IOWR('z', 1, dof_hdr_t)/* add helper */
+#defineDTRACEHIOC_REMOVE   _IOW('z', 2, int)   /* remove 
helper */
+#defineDTRACEHIOC_ADDDOF   _IOWR('z', 3, dof_helper_t)/* add 
helper DOF */
+#endif
 
 typedef struct dof_helper {
char dofhp_mod[DTRACE_MODNAMELEN];  /* executable or library name */
uint64_t dofhp_addr;/* base address of object */
uint64_t dofhp_dof; /* address of helper DOF */
+#if !defined(sun)
+   int gen;
+#endif
 } dof_helper_t;
 
 #defineDTRACEMNR_DTRACE"dtrace"/* node for DTrace ops 
*/
@@ -2219,10 +2228,11 @@ extern void dtrace_vtime_enable(void);
 extern void dtrace_vtime_disable(void);
 
 struct regs;
+struct reg;
 
 #if defined(sun)
-extern int (*dtrace_pid_probe_ptr)(struct regs *);
-extern int (*dtrace_return_probe_ptr)(struct regs *);
+extern int (*dtrace_pid_probe_ptr)(struct reg *);
+extern int (*dtrace_return_probe_ptr)(struct reg *);
 extern void (*dtrace_fasttrap_fork_ptr)(proc_t *, proc_t *);
 extern void (*dtrace_fasttrap_exec_ptr)(proc_t *);
 extern void (*dtrace_fasttrap_exit_ptr)(proc_t *);
___
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: r211501 - in head/sys: modules modules/send netinet netinet6 sys

2010-08-21 Thread Rui Paulo
On 20 Aug 2010, at 02:33, Doug Barton wrote:

> On 08/19/2010 14:50, Bjoern A. Zeeb wrote:
>> On Thu, 19 Aug 2010, Doug Barton wrote:
>> 
>>> On 08/19/2010 04:42, Ana Kukec wrote:
 Hi all,
 
 A man page for the kernel side SeND, and an updated port with
 Secure Neighbor Discovery application will follow soon.
>>> 
>>> At minimum committing the man page along with new code is how such
>>> things should be done. Can you define "soon?"
>> 
>> Yes I can: soon will be when it'll be comitted.
> 
> I'm guessing that's an attempt at humor, but what I'm looking for is an 
> actual timeline. If the answer is "in the next day or two" then that's fine, 
> we'll let this one go with a warning. If the answer is "someday" then I'm 
> going to request that the code be backed out until the man page(s) are done. 
> I'm actually trying to be reasonable and work with a new developer so that 
> they can learn how we like to have things done around here. What are you 
> trying to do?

What? Are you serious? Do you really want some code to be backed out because it 
doesn't have a man page yet? Talking about overkill..
You don't seem to have an idea how many times code was committed without a man 
page.
I didn't see you complain back then.. It's very likely you wouldn't be 
complaining if the developer in question hadn't posted a message to the mailing 
list saying she intends to commit a man page soon.

> 
>> Meanwhile if you have time I'd know several dozen other things we
>> don't have a man page for ...
> 
> I would definitely recommend that you make a list of them, preferably 
> someplace visible like the wiki. If you don't already have access to the wiki 
> (or some other suitable forum) then send the list to -doc@ and we'll make 
> sure that it gets posted. Given the recent resurgence of interest in updating 
> our documentation it certainly wouldn't hurt to have some examples of 
> low-hanging fruit that we can turn budding mdoc gurus loose on.
> 
> Meanwhile, the fact that in the past code has been committed without man 
> pages is the exact cause of the problem you're describing. It is certainly 
> not a justification for continuing to do it wrong.

Reverting code just because it doesn't have a man page is pointless. Everyone 
can write the damn man page, but not everyone can write code. You should really 
take this into consideration when proposing a commit to be reverted.

Regards,
--
Rui Paulo


___
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: r211558 - head/cddl/contrib/dtracetoolkit

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 13:21:05 2010
New Revision: 211558
URL: http://svn.freebsd.org/changeset/base/211558

Log:
  Add a directory for the DTraceToolkit.
  
  Sponsored by: The FreeBSD Foundation

Added:
  head/cddl/contrib/dtracetoolkit/
___
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: r211560 - head

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 13:42:12 2010
New Revision: 211560
URL: http://svn.freebsd.org/changeset/base/211560

Log:
  Add libelf to the prebuild libs.
  
  This is needed for the DTrace instrumentation object.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sat Aug 21 13:23:54 2010(r211559)
+++ head/Makefile.inc1  Sat Aug 21 13:42:12 2010(r211560)
@@ -1142,7 +1142,7 @@ gnu/lib/libgcc__L: lib/libc__L
 _prebuild_libs=${_kerberos5_lib_libasn1} ${_kerberos5_lib_libheimntlm} 
\
${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \
${_kerberos5_lib_libroken} \
-   lib/libbz2 lib/libcom_err lib/libcrypt \
+   lib/libbz2 lib/libcom_err lib/libcrypt lib/libelf \
lib/libexpat lib/libfetch \
${_lib_libgssapi} ${_lib_libipx} \
lib/libkiconv lib/libkvm lib/liblzma lib/libmd \
___
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: r211561 - head/cddl/lib/drti

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 13:48:04 2010
New Revision: 211561
URL: http://svn.freebsd.org/changeset/base/211561

Log:
  Link drti.o with a PIC version of libelf. This is needed because
  drti.o depends on libelf and this avoids linking every other drti.o
  program (namely programs with USDT probes) with libelf.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/cddl/lib/drti/Makefile

Modified: head/cddl/lib/drti/Makefile
==
--- head/cddl/lib/drti/Makefile Sat Aug 21 13:42:12 2010(r211560)
+++ head/cddl/lib/drti/Makefile Sat Aug 21 13:48:04 2010(r211561)
@@ -8,13 +8,20 @@ FILESOWN= ${LIBOWN}
 FILESGRP=  ${LIBGRP}
 FILESMODE= ${LIBMODE}
 FILESDIR=  ${LIBDIR}/dtrace
-CLEANFILES=${FILES}
+CLEANFILES=${FILES} ${FILES}.tmp
 
 CFLAGS+=   -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
-I${.CURDIR}/../../../cddl/compat/opensolaris/include \
-I${OPENSOLARIS_USR_DISTDIR}/head \
-I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \
-I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \
-   -I${OPENSOLARIS_SYS_DISTDIR}/uts/common
+   -I${OPENSOLARIS_SYS_DISTDIR}/uts/common \
+   -DPIC -fpic
+
+.c.o:
+   ${CC} ${CFLAGS} -c ${.IMPSRC}
+   mv ${FILES} ${FILES}.tmp
+   ${LD} -o ${FILES} -r ${FILES}.tmp ${LIBELF_PIC}
+   rm -f ${FILES}.tmp
 
 .include 
___
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: r211562 - in head/cddl: contrib/opensolaris/cmd/plockstat usr.sbin/plockstat

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 13:54:33 2010
New Revision: 211562
URL: http://svn.freebsd.org/changeset/base/211562

Log:
  Port plockstat to FreeBSD. This will be connected to the build later.
  
  Sponsored by: The FreeBSD Foundation

Added:
  head/cddl/usr.sbin/plockstat/
  head/cddl/usr.sbin/plockstat/Makefile   (contents, props changed)
Modified:
  head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c

Modified: head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c
==
--- head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c Sat Aug 21 
13:48:04 2010(r211561)
+++ head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c Sat Aug 21 
13:54:33 2010(r211562)
@@ -24,7 +24,9 @@
  * Use is subject to license terms.
  */
 
+#if defined(sun)
 #pragma ident  "%Z%%M% %I% %E% SMI"
+#endif
 
 #include 
 #include 
@@ -41,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 
 static char *g_pname;
 static dtrace_hdl_t *g_dtp;
@@ -502,7 +505,12 @@ getsym(struct ps_prochandle *P, uintptr_
 {
char name[256];
GElf_Sym sym;
+#if defined(sun)
prsyminfo_t info;
+#else
+   prmap_t *map;
+   int info; /* XXX unused */
+#endif
size_t len;
 
if (P == NULL || Pxlookup_by_addr(P, addr, name, sizeof (name),
@@ -510,6 +518,7 @@ getsym(struct ps_prochandle *P, uintptr_
(void) snprintf(buf, size, "%#lx", addr);
return (0);
}
+#if defined(sun)
if (info.prs_object == NULL)
info.prs_object = "";
 
@@ -520,15 +529,19 @@ getsym(struct ps_prochandle *P, uintptr_
}
 
len = snprintf(buf, size, "%s`%s", info.prs_object, info.prs_name);
+#else
+   map = proc_addr2map(P, addr);
+   len = snprintf(buf, size, "%s`%s", map->pr_mapname, name);
+#endif
buf += len;
size -= len;
 
if (sym.st_value != addr)
len = snprintf(buf, size, "+%#lx", addr - sym.st_value);
 
-   if (nolocks && strcmp("libc.so.1", info.prs_object) == 0 &&
-   (strstr("mutex", info.prs_name) == 0 ||
-   strstr("rw", info.prs_name) == 0))
+   if (nolocks && strcmp("libc.so.1", map->pr_mapname) == 0 &&
+   (strstr("mutex", name) == 0 ||
+   strstr("rw", name) == 0))
return (-1);
 
return (0);
@@ -655,8 +668,13 @@ process_aggregate(const dtrace_aggdata_t
 static void
 prochandler(struct ps_prochandle *P, const char *msg, void *arg)
 {
+#if defined(sun)
const psinfo_t *prp = Ppsinfo(P);
int pid = Pstatus(P)->pr_pid;
+#else
+   int pid = proc_getpid(P);
+   int wstat = proc_getwstat(P);
+#endif
char name[SIG2STR_MAX];
 
if (msg != NULL) {
@@ -674,13 +692,13 @@ prochandler(struct ps_prochandle *P, con
 * When /proc provides a stable pr_wstat in the status file,
 * this code can be improved by examining this new pr_wstat.
 */
-   if (prp != NULL && WIFSIGNALED(prp->pr_wstat)) {
+   if (WIFSIGNALED(wstat)) {
notice("pid %d terminated by %s\n", pid,
-   proc_signame(WTERMSIG(prp->pr_wstat),
+   proc_signame(WTERMSIG(wstat),
name, sizeof (name)));
-   } else if (prp != NULL && WEXITSTATUS(prp->pr_wstat) != 0) {
+   } else if (WEXITSTATUS(wstat) != 0) {
notice("pid %d exited with status %d\n",
-   pid, WEXITSTATUS(prp->pr_wstat));
+   pid, WEXITSTATUS(wstat));
} else {
notice("pid %d has exited\n", pid);
}
@@ -755,7 +773,9 @@ intr(int signo)
 int
 main(int argc, char **argv)
 {
+#if defined(sun)
ucred_t *ucp;
+#endif
int err;
int opt_C = 0, opt_H = 0, opt_p = 0, opt_v = 0;
char c, *p, *end;
@@ -764,7 +784,7 @@ main(int argc, char **argv)
 
g_pname = basename(argv[0]);
argv[0] = g_pname; /* rewrite argv[0] for getopt errors */
-
+#if defined(sun)
/*
 * Make sure we have the required dtrace_proc privilege.
 */
@@ -777,6 +797,7 @@ main(int argc, char **argv)
 
ucred_free(ucp);
}
+#endif
 
while ((c = getopt(argc, argv, PLOCKSTAT_OPTSTR)) != EOF) {
switch (c) {
@@ -907,7 +928,7 @@ main(int argc, char **argv)
 
if (opt_H) {
dprog_add(g_hold_init);
-   if (g_opt_s == NULL)
+   if (!g_opt_s)
dprog_add(g_hold_times);
else
dprog_add(g_hold_histogram);
@@ -915,7 +936,7 @@ main(int argc, char **argv)
 
if (opt_C) {
dprog_add(g_ctnd_init);
-   if (g_opt_s == NULL)
+   if (!g_opt_s)
dprog_add(g_ctnd_tim

svn commit: r211563 - head/cddl/usr.sbin/dtruss

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 13:56:29 2010
New Revision: 211563
URL: http://svn.freebsd.org/changeset/base/211563

Log:
  Add a Makefile for dtruss.
  
  Sponsored by: The FreeBSD Foundation

Added:
  head/cddl/usr.sbin/dtruss/
  head/cddl/usr.sbin/dtruss/Makefile   (contents, props changed)

Added: head/cddl/usr.sbin/dtruss/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/cddl/usr.sbin/dtruss/Makefile  Sat Aug 21 13:56:29 2010
(r211563)
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../../cddl/contrib/dtracetoolkit
+
+SCRIPTS=dtruss
+NO_MAN=
+
+.include 
___
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: r211561 - head/cddl/lib/drti

2010-08-21 Thread Kostik Belousov
On Sat, Aug 21, 2010 at 01:48:05PM +, Rui Paulo wrote:
> Author: rpaulo
> Date: Sat Aug 21 13:48:04 2010
> New Revision: 211561
> URL: http://svn.freebsd.org/changeset/base/211561
> 
> Log:
>   Link drti.o with a PIC version of libelf. This is needed because
>   drti.o depends on libelf and this avoids linking every other drti.o
>   program (namely programs with USDT probes) with libelf.
What is wrong with having libelf as dependency of the resulting
binary ?

>   
>   Sponsored by:   The FreeBSD Foundation
> 
> Modified:
>   head/cddl/lib/drti/Makefile
> 
> Modified: head/cddl/lib/drti/Makefile
> ==
> --- head/cddl/lib/drti/Makefile   Sat Aug 21 13:42:12 2010
> (r211560)
> +++ head/cddl/lib/drti/Makefile   Sat Aug 21 13:48:04 2010
> (r211561)
> @@ -8,13 +8,20 @@ FILESOWN=   ${LIBOWN}
>  FILESGRP=${LIBGRP}
>  FILESMODE=   ${LIBMODE}
>  FILESDIR=${LIBDIR}/dtrace
> -CLEANFILES=  ${FILES}
> +CLEANFILES=  ${FILES} ${FILES}.tmp
>  
>  CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
>   -I${.CURDIR}/../../../cddl/compat/opensolaris/include \
>   -I${OPENSOLARIS_USR_DISTDIR}/head \
>   -I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \
>   -I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \
> - -I${OPENSOLARIS_SYS_DISTDIR}/uts/common
> + -I${OPENSOLARIS_SYS_DISTDIR}/uts/common \
> + -DPIC -fpic
> +
> +.c.o:
> + ${CC} ${CFLAGS} -c ${.IMPSRC}
> + mv ${FILES} ${FILES}.tmp
> + ${LD} -o ${FILES} -r ${FILES}.tmp ${LIBELF_PIC}
> + rm -f ${FILES}.tmp
>  
>  .include 


pgp4mvc55W276.pgp
Description: PGP signature


Re: svn commit: r211505 - head/contrib/gcc

2010-08-21 Thread Dimitry Andric
On 2010-08-20 22:36, Bruce Evans wrote:
> On Fri, 20 Aug 2010, Dimitry Andric wrote:
[...] 
>> But will the casts not potentially hide problems, if you pass the wrong
>> types to those macros?  Maybe it is better if the compiler complains
>> that some argument is of an incompatible type, than just forcing it to
>> cast?
> This is unclear.  All integer types are compatible to some extent.
> Upcasting them always works and downcasting them works iff the value
> is not changed.

I meant this in the context of this llvm PR, about matching inline asm
input constraints with output constraints of an incompatible type:

  http://llvm.org/bugs/show_bug.cgi?id=3373

Clang is currently somewhat pickier about the arguments to inline asm,
which we also noticed in OpenSSL code, where a rotate-left macro is
defined (for i386 and amd64) as:

#   define ROTATE(a,n)  ({ register unsigned int ret;   \
  asm ( \
  "roll %1,%0"  \
  : "=r"(ret)   \
  : "I"(n), "0"(a)  \
  : "cc");  \
 ret;   \
  })

On amd64, it was being called with the 'a' argument being of unsigned
long type.  Clang complained:

crypto/openssl/crypto/md4/md4_dgst.c:117:2:
error: unsupported inline asm: input with type 'unsigned long' matching
output with type 'unsigned int'
  R0(A,B,C,D,X( 0), 3,0); HOST_c2l(data,l); X( 2)=l;
  ^~

In this case, the OpenSSL developers chose to explicitly cast 'a' to
'unsigned int' (see ).
___
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: r211564 - head/cddl/usr.sbin

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 14:02:04 2010
New Revision: 211564
URL: http://svn.freebsd.org/changeset/base/211564

Log:
  Use double quotes when checking the value of MACHINE_ARCH.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/cddl/usr.sbin/Makefile

Modified: head/cddl/usr.sbin/Makefile
==
--- head/cddl/usr.sbin/Makefile Sat Aug 21 13:56:29 2010(r211563)
+++ head/cddl/usr.sbin/Makefile Sat Aug 21 14:02:04 2010(r211564)
@@ -12,7 +12,7 @@ _zdb= zdb
 .endif
 .endif
 
-.if ${MACHINE_ARCH} == amd64 || ${MACHINE_ARCH} == i386
+.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
 _dtrace=   dtrace
 _lockstat= lockstat
 .endif
___
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: r211565 - head/share/mk

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 14:08:04 2010
New Revision: 211565
URL: http://svn.freebsd.org/changeset/base/211565

Log:
  Add the definition of LIBELF_PIC.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/mk/bsd.libnames.mk

Modified: head/share/mk/bsd.libnames.mk
==
--- head/share/mk/bsd.libnames.mk   Sat Aug 21 14:02:04 2010
(r211564)
+++ head/share/mk/bsd.libnames.mk   Sat Aug 21 14:08:04 2010
(r211565)
@@ -45,6 +45,7 @@ LIBDTRACE?=   ${DESTDIR}${LIBDIR}/libdtrac
 LIBDWARF?= ${DESTDIR}${LIBDIR}/libdwarf.a
 LIBEDIT?=  ${DESTDIR}${LIBDIR}/libedit.a
 LIBELF?=   ${DESTDIR}${LIBDIR}/libelf.a
+LIBELF_PIC?=   ${DESTDIR}${LIBDIR}/libelf_pic.a
 LIBFETCH?= ${DESTDIR}${LIBDIR}/libfetch.a
 LIBFL?="don't use LIBFL, use LIBL"
 LIBFORM?=  ${DESTDIR}${LIBDIR}/libform.a
___
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: r211566 - head/sys/cddl/compat/opensolaris/sys

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 14:09:24 2010
New Revision: 211566
URL: http://svn.freebsd.org/changeset/base/211566

Log:
  Add a sysname char * to struct opensolaris_utsname.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/cddl/compat/opensolaris/sys/misc.h

Modified: head/sys/cddl/compat/opensolaris/sys/misc.h
==
--- head/sys/cddl/compat/opensolaris/sys/misc.h Sat Aug 21 14:08:04 2010
(r211565)
+++ head/sys/cddl/compat/opensolaris/sys/misc.h Sat Aug 21 14:09:24 2010
(r211566)
@@ -46,6 +46,7 @@
 #ifdef _KERNEL
 struct opensolaris_utsname {
char *nodename;
+   char *sysname;
 };
 
 extern char hw_serial[11];
___
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: r211567 - head/tools/test/dtrace

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 14:14:24 2010
New Revision: 211567
URL: http://svn.freebsd.org/changeset/base/211567

Log:
  Update for the new tests.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/tools/test/dtrace/Makefile

Modified: head/tools/test/dtrace/Makefile
==
--- head/tools/test/dtrace/Makefile Sat Aug 21 14:09:24 2010
(r211566)
+++ head/tools/test/dtrace/Makefile Sat Aug 21 14:14:24 2010
(r211567)
@@ -1,274 +1,206 @@
 # $FreeBSD$
 
 TESTSRCDIR=${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/dtrace/test
+CFLAGS+=   -w
 DTEST= ${TESTSRCDIR}/cmd/scripts/dtest.pl -n
 
 IGNORE=\
-   ${TESTSRCDIR}/tst/common/arrays/err.D_IDENT_UNDEF.badureg.d 
\
-   ${TESTSRCDIR}/tst/common/printa/err.D_PRINTF_ARG_TYPE.jstack.d  
\
-   ${TESTSRCDIR}/tst/common/printa/err.D_PRINTF_ARG_TYPE.ustack.d  
\
-   ${TESTSRCDIR}/tst/common/printa/tst.stack.d 
\
-   ${TESTSRCDIR}/tst/common/stack/err.D_USTACK_FRAMES.bad.d
\
-   ${TESTSRCDIR}/tst/common/stack/err.D_USTACK_PROTO.bad.d 
\
-   ${TESTSRCDIR}/tst/common/stack/err.D_USTACK_STRSIZE.bad.d   
\
-   ${TESTSRCDIR}/tst/common/stop/tst.stop1.d   
\
-   ${TESTSRCDIR}/tst/common/aggs/tst.subr.d
\
-   ${TESTSRCDIR}/tst/common/aggs/tst.signature.d   
\
-   ${TESTSRCDIR}/tst/common/arrays/tst.uregsarray.d
\
-   ${TESTSRCDIR}/tst/common/assocs/err.D_OP_INCOMPAT.dupgtype.d
\
-   ${TESTSRCDIR}/tst/common/assocs/err.D_OP_INCOMPAT.dupttype.d
\
-   ${TESTSRCDIR}/tst/common/assocs/tst.orthogonality.d 
\
-   ${TESTSRCDIR}/tst/common/buffering/tst.cputime.ksh  
\
-   ${TESTSRCDIR}/tst/common/buffering/tst.ring3.d  
\
-   ${TESTSRCDIR}/tst/common/builtinvar/tst.psinfo.d
\
-   ${TESTSRCDIR}/tst/common/builtinvar/tst.psinfo1.d   
\
-   ${TESTSRCDIR}/tst/common/drops/drp.DTRACEDROP_STKSTROVERFLOW.d  
\
-   
${TESTSRCDIR}/tst/common/dtraceUtil/err.D_PDESC_ZERO.InvalidDescription1.d  
\
-   ${TESTSRCDIR}/tst/common/dtraceUtil/tst.DataModel32.d.ksh   
\
-   ${TESTSRCDIR}/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh  
\
-   ${TESTSRCDIR}/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh
\
-   ${TESTSRCDIR}/tst/common/dtraceUtil/tst.PreprocessorStatement.d.ksh 
\
-   ${TESTSRCDIR}/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh
\
-   ${TESTSRCDIR}/tst/common/funcs/err.D_PROTO_ARG.mobadarg.d   
\
-   ${TESTSRCDIR}/tst/common/funcs/err.D_PROTO_LEN.motoofew.d   
\
-   ${TESTSRCDIR}/tst/common/funcs/err.D_PROTO_LEN.motoomany.d  
\
-   ${TESTSRCDIR}/tst/common/funcs/err.D_PROTO_LEN.mtabadarg.d  
\
-   ${TESTSRCDIR}/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d  
\
-   ${TESTSRCDIR}/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d 
\
-   ${TESTSRCDIR}/tst/common/funcs/tst.bcopy.d  
\
-   ${TESTSRCDIR}/tst/common/funcs/tst.copyin.d 
\
-   ${TESTSRCDIR}/tst/common/funcs/tst.copyinto.d   
\
-   ${TESTSRCDIR}/tst/common/funcs/tst.ddi_pathname.d   
\
-   ${TESTSRCDIR}/tst/common/inline/err.D_OP_INCOMPAT.badxlate.d
\
-   ${TESTSRCDIR}/tst/common/inline/tst.InlineDataAssign.d  
\
-   ${TESTSRCDIR}/tst/common/inline/tst.InlineExpression.d  
\
-   ${TESTSRCDIR}/tst/common/inline/tst.InlineTypedef.d 
\
-   ${TESTSRCDIR}/tst/common/io/tst.fds.c   
\
-   ${TESTSRCDIR}/tst/common/java_api/tst.FunctionLookup.c  
\
-   ${TESTSRCDIR}/tst/common/java_api/tst.ProbeData.c   
\
-   ${TESTSRCDIR}/tst/common/misc/tst.dynopt.d  
\
-   ${TESTSRCDIR}/tst/common/misc/tst.include.ksh   
\
-   ${TESTSRCDIR}/tst/common/misc/tst.roch.d
\
-   ${TESTSRCDIR}/tst/common/misc/tst.schrock.ksh   
\
-   ${TESTSRCDIR}/tst/common/nfs/tst.call.c 
\
-   ${TESTSRCDIR}/tst/common/nfs/tst.call.d 
\
-   ${TESTSRCDIR}/tst/common/nfs/tst.call3.c
\
-   ${TESTSRCDIR}/tst/common/nfs/tst.call3.d
\
-   ${TESTSRCDIR}/tst/common/offsetof/err.D_OFFSETOF_BITFIELD.bitfield.d
\
-   ${TESTSRCD

Re: svn commit: r211561 - head/cddl/lib/drti

2010-08-21 Thread Rui Paulo

On 21 Aug 2010, at 14:59, Kostik Belousov wrote:

> On Sat, Aug 21, 2010 at 01:48:05PM +, Rui Paulo wrote:
>> Author: rpaulo
>> Date: Sat Aug 21 13:48:04 2010
>> New Revision: 211561
>> URL: http://svn.freebsd.org/changeset/base/211561
>> 
>> Log:
>>  Link drti.o with a PIC version of libelf. This is needed because
>>  drti.o depends on libelf and this avoids linking every other drti.o
>>  program (namely programs with USDT probes) with libelf.
> What is wrong with having libelf as dependency of the resulting
> binary ?

The resulting binary can be a library. If I add drti.o to the libthr library, 
every other program will break because it can't find libelf symbols. The only 
way to fix it would be to rebuild every program that depends on libthr and I 
don't want that to happen.

Regards,
--
Rui Paulo


___
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: r211561 - head/cddl/lib/drti

2010-08-21 Thread Kostik Belousov
On Sat, Aug 21, 2010 at 03:16:49PM +0100, Rui Paulo wrote:
> 
> On 21 Aug 2010, at 14:59, Kostik Belousov wrote:
> 
> > On Sat, Aug 21, 2010 at 01:48:05PM +, Rui Paulo wrote:
> >> Author: rpaulo
> >> Date: Sat Aug 21 13:48:04 2010
> >> New Revision: 211561
> >> URL: http://svn.freebsd.org/changeset/base/211561
> >> 
> >> Log:
> >>  Link drti.o with a PIC version of libelf. This is needed because
> >>  drti.o depends on libelf and this avoids linking every other drti.o
> >>  program (namely programs with USDT probes) with libelf.
> > What is wrong with having libelf as dependency of the resulting
> > binary ?
> 
> The resulting binary can be a library. If I add drti.o to the libthr
> library, every other program will break because it can't find libelf
> symbols. The only way to fix it would be to rebuild every program that
> depends on libthr and I don't want that to happen.

I do not understand this. If drti.o is added to a library, library should
also record a dependency on libelf, i.e. be linked with it. Since you
already modifying link command to add drti.o, what is the problem to
add -lelf ?


pgpwwIDmE2SLM.pgp
Description: PGP signature


svn commit: r211568 - head/sys/sparc64/sparc64

2010-08-21 Thread Marius Strobl
Author: marius
Date: Sat Aug 21 14:28:48 2010
New Revision: 211568
URL: http://svn.freebsd.org/changeset/base/211568

Log:
  Skip a KASSERT which isn't appropriate when not employing page coloring.
  Reported by: Michael Moll

Modified:
  head/sys/sparc64/sparc64/pmap.c

Modified: head/sys/sparc64/sparc64/pmap.c
==
--- head/sys/sparc64/sparc64/pmap.c Sat Aug 21 14:14:24 2010
(r211567)
+++ head/sys/sparc64/sparc64/pmap.c Sat Aug 21 14:28:48 2010
(r211568)
@@ -833,14 +833,15 @@ pmap_cache_remove(vm_page_t m, vm_offset
m->md.colors[DCACHE_COLOR(va)]);
KASSERT((m->flags & PG_FICTITIOUS) == 0,
("pmap_cache_remove: fake page"));
-   KASSERT(m->md.colors[DCACHE_COLOR(va)] > 0,
-   ("pmap_cache_remove: no mappings %d <= 0",
-   m->md.colors[DCACHE_COLOR(va)]));
PMAP_STATS_INC(pmap_ncache_remove);
 
if (dcache_color_ignore != 0)
return;
 
+   KASSERT(m->md.colors[DCACHE_COLOR(va)] > 0,
+   ("pmap_cache_remove: no mappings %d <= 0",
+   m->md.colors[DCACHE_COLOR(va)]));
+
/*
 * Find the color for this virtual address and note the removal of
 * the mapping.
___
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: r211561 - head/cddl/lib/drti

2010-08-21 Thread Rui Paulo

On 21 Aug 2010, at 15:23, Kostik Belousov wrote:

> On Sat, Aug 21, 2010 at 03:16:49PM +0100, Rui Paulo wrote:
>> 
>> On 21 Aug 2010, at 14:59, Kostik Belousov wrote:
>> 
>>> On Sat, Aug 21, 2010 at 01:48:05PM +, Rui Paulo wrote:
 Author: rpaulo
 Date: Sat Aug 21 13:48:04 2010
 New Revision: 211561
 URL: http://svn.freebsd.org/changeset/base/211561
 
 Log:
 Link drti.o with a PIC version of libelf. This is needed because
 drti.o depends on libelf and this avoids linking every other drti.o
 program (namely programs with USDT probes) with libelf.
>>> What is wrong with having libelf as dependency of the resulting
>>> binary ?
>> 
>> The resulting binary can be a library. If I add drti.o to the libthr
>> library, every other program will break because it can't find libelf
>> symbols. The only way to fix it would be to rebuild every program that
>> depends on libthr and I don't want that to happen.
> 
> I do not understand this. If drti.o is added to a library, library should
> also record a dependency on libelf, i.e. be linked with it. Since you
> already modifying link command to add drti.o, what is the problem to
> add -lelf ?

I wanted the same steps to be done in FreeBSD as in Solaris. I.e., in Solaris 
you don't need to link with -lelf your program after you added DTrace probes to 
it.
I believe this is a good tradeoff.

Regards,
--
Rui Paulo


___
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: r211570 - head/gnu/lib/libobjc

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 14:59:37 2010
New Revision: 211570
URL: http://svn.freebsd.org/changeset/base/211570

Log:
  We need to pull bsd.own.mk before modifying the CC variable. Otherwise
  it will be overwritten when we include bsd.lib.mk.
  
  Pointed out by:   Dimitry Andric 

Modified:
  head/gnu/lib/libobjc/Makefile

Modified: head/gnu/lib/libobjc/Makefile
==
--- head/gnu/lib/libobjc/Makefile   Sat Aug 21 14:50:16 2010
(r211569)
+++ head/gnu/lib/libobjc/Makefile   Sat Aug 21 14:59:37 2010
(r211570)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include 
+
 OBJCDIR=${.CURDIR}/../../../contrib/libobjc
 GCCDIR=${.CURDIR}/../../../contrib/gcc
 GCCLIB=${.CURDIR}/../../../contrib/gcclibs
___
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: r211571 - head/sys/boot/i386/boot2

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 15:01:59 2010
New Revision: 211571
URL: http://svn.freebsd.org/changeset/base/211571

Log:
  Make sure the boot2 stage is compiled with gcc, as clang has no
  problems compiling it, but it just gets too big at the moment, even
  with -Os.  This is not applicable to gptboot, though.
  
  Submitted by: Dimitry Andric 

Modified:
  head/sys/boot/i386/boot2/Makefile

Modified: head/sys/boot/i386/boot2/Makefile
==
--- head/sys/boot/i386/boot2/Makefile   Sat Aug 21 14:59:37 2010
(r211570)
+++ head/sys/boot/i386/boot2/Makefile   Sat Aug 21 15:01:59 2010
(r211571)
@@ -1,5 +1,10 @@
 # $FreeBSD$
 
+.include 
+
+# XXX: clang can compile the boot code just fine, but boot2 gets too big
+CC:=${CC:C/^cc|^clang/gcc/}
+
 FILES= boot boot1 boot2
 
 NM?=   nm
___
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: r211572 - head

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 15:39:06 2010
New Revision: 211572
URL: http://svn.freebsd.org/changeset/base/211572

Log:
  Add clang to the cross-tools build stage.
  
  Submitted by: Dimitry Andric 

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sat Aug 21 15:01:59 2010(r211571)
+++ head/Makefile.inc1  Sat Aug 21 15:39:06 2010(r211572)
@@ -1078,8 +1078,15 @@ _kgzip=  usr.sbin/kgzip
 .endif
 .endif
 
+.if ${CC:T:Mclang} == "clang"
+_clang=usr.bin/clang
+_clang_libs=   lib/clang
+.endif
+
 cross-tools:
 .for _tool in \
+${_clang_libs} \
+${_clang} \
 gnu/usr.bin/binutils \
 gnu/usr.bin/cc \
 usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \
___
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: r211573 - in head: contrib/llvm/tools/clang/lib/Driver contrib/llvm/tools/clang/lib/Frontend lib/clang

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 15:46:33 2010
New Revision: 211573
URL: http://svn.freebsd.org/changeset/base/211573

Log:
  Modify clang so that when TOOLS_PREFIX is defined we register the
  CLANG_PREFIX macro. This changes the default header search path when we
  are building clang as part of cross-tools.
  
  Submitted by: Dimitry Andric 
  Reviewed by:  freebsd-current

Modified:
  head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp
  head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp
  head/lib/clang/clang.build.mk

Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp
==
--- head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Sat Aug 21 
15:39:06 2010(r211572)
+++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Sat Aug 21 
15:46:33 2010(r211573)
@@ -26,6 +26,10 @@
 
 #include  // ::getenv
 
+#ifndef CLANG_PREFIX
+#define CLANG_PREFIX
+#endif
+
 using namespace clang::driver;
 using namespace clang::driver::toolchains;
 
@@ -869,11 +873,9 @@ FreeBSD::FreeBSD(const HostInfo &Host, c
   getProgramPaths().push_back(getDriver().Dir + "/../libexec");
   getProgramPaths().push_back("/usr/libexec");
   if (Lib32) {
-getFilePaths().push_back(getDriver().Dir + "/../lib32");
-getFilePaths().push_back("/usr/lib32");
+getFilePaths().push_back(CLANG_PREFIX "/usr/lib32");
   } else {
-getFilePaths().push_back(getDriver().Dir + "/../lib");
-getFilePaths().push_back("/usr/lib");
+getFilePaths().push_back(CLANG_PREFIX "/usr/lib");
   }
 }
 

Modified: head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp
==
--- head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp Sat Aug 
21 15:39:06 2010(r211572)
+++ head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp Sat Aug 
21 15:46:33 2010(r211573)
@@ -30,6 +30,9 @@
   #define WIN32_LEAN_AND_MEAN 1
   #include 
 #endif
+#ifndef CLANG_PREFIX
+#define CLANG_PREFIX
+#endif
 using namespace clang;
 using namespace clang::frontend;
 
@@ -408,9 +411,10 @@ static bool getWindowsSDKDir(std::string
 
 void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
 const HeaderSearchOptions &HSOpts) 
{
-#if 0 /* Remove unneeded include paths. */
   // FIXME: temporary hack: hard-coded paths.
-  AddPath("/usr/local/include", System, true, false, false);
+#ifndef __FreeBSD__
+  AddPath(CLANG_PREFIX "/usr/local/include", System, true, false, false);
+#endif
 
   // Builtin includes use #include_next directives and should be positioned
   // just prior C include dirs.
@@ -421,7 +425,6 @@ void InitHeaderSearch::AddDefaultCInclud
 P.appendComponent("include");
 AddPath(P.str(), System, false, false, false, /*IgnoreSysRoot=*/ true);
   }
-#endif
 
   // Add dirs specified via 'configure --with-c-include-dirs'.
   llvm::StringRef CIncludeDirs(C_INCLUDE_DIRS);
@@ -518,13 +521,15 @@ void InitHeaderSearch::AddDefaultCInclud
   case llvm::Triple::MinGW32:
 AddPath("c:/mingw/include", System, true, false, false);
 break;
+  case llvm::Triple::FreeBSD:
+AddPath(CLANG_PREFIX "/usr/include/clang/" CLANG_VERSION_STRING,
+  System, false, false, false);
+break;
   default:
 break;
   }
 
-  AddPath("/usr/include/clang/" CLANG_VERSION_STRING,
-System, false, false, false);
-  AddPath("/usr/include", System, false, false, false);
+  AddPath(CLANG_PREFIX "/usr/include", System, false, false, false);
 }
 
 void InitHeaderSearch::
@@ -726,8 +731,10 @@ AddDefaultCPlusPlusIncludePaths(const ll
   case llvm::Triple::FreeBSD:
 // FreeBSD 8.0
 // FreeBSD 7.3
-AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2", "", "", "", triple);
-AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2/backward", "", "", "", 
triple);
+AddGnuCPlusPlusIncludePaths(CLANG_PREFIX "/usr/include/c++/4.2",
+"", "", "", triple);
+AddGnuCPlusPlusIncludePaths(CLANG_PREFIX "/usr/include/c++/4.2/backward",
+"", "", "", triple);
 break;
   case llvm::Triple::Minix:
 AddGnuCPlusPlusIncludePaths("/usr/gnu/include/c++/4.4.3",

Modified: head/lib/clang/clang.build.mk
==
--- head/lib/clang/clang.build.mk   Sat Aug 21 15:39:06 2010
(r211572)
+++ head/lib/clang/clang.build.mk   Sat Aug 21 15:46:33 2010
(r211573)
@@ -28,6 +28,10 @@ LLVM_REQUIRES_RTTI=
 CFLAGS+=-fno-rtti
 .endif
 
+.ifdef TOOLS_PREFIX
+CFLAGS+=-DCLANG_PREFIX=\"${TOOLS_PREFIX}\"
+.endif
+
 .PATH: ${LLVM_SRCS}/${SRCDIR}
 
 TBLGEN=tblgen ${CFLAGS:M-I*}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail 

Re: svn commit: r211530 - head/sys/netinet6

2010-08-21 Thread Hajimu UMEMOTO
Hi,

> On Fri, 20 Aug 2010 22:19:37 +0400
> pluknet  said:

pluknet> I think it still continues to test the remain condition
pluknet> regardless of test result of the first part (!optp).

No, I don't think my fix is wrong.  If the evaluation matches, the
latter should not be evaluated.

pluknet> That should work:

pluknet>  -   if (!optp->ip6po_pktinfo || 
!optp->ip6po_pktinfo->ipi6_ifindex)
pluknet>  +   if (optp != NULL && (!optp->ip6po_pktinfo ||
pluknet>  +   !optp->ip6po_pktinfo->ipi6_ifindex))

With your proposal, when optp is NULL, use_defzone doesn't set.  It is
not desired thing.

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
u...@mahoroba.org  u...@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/
___
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: r211561 - head/cddl/lib/drti

2010-08-21 Thread Kostik Belousov
On Sat, Aug 21, 2010 at 03:33:35PM +0100, Rui Paulo wrote:
> 
> On 21 Aug 2010, at 15:23, Kostik Belousov wrote:
> 
> > On Sat, Aug 21, 2010 at 03:16:49PM +0100, Rui Paulo wrote:
> >> 
> >> On 21 Aug 2010, at 14:59, Kostik Belousov wrote:
> >> 
> >>> On Sat, Aug 21, 2010 at 01:48:05PM +, Rui Paulo wrote:
>  Author: rpaulo
>  Date: Sat Aug 21 13:48:04 2010
>  New Revision: 211561
>  URL: http://svn.freebsd.org/changeset/base/211561
>  
>  Log:
>  Link drti.o with a PIC version of libelf. This is needed because
>  drti.o depends on libelf and this avoids linking every other drti.o
>  program (namely programs with USDT probes) with libelf.
> >>> What is wrong with having libelf as dependency of the resulting
> >>> binary ?
> >> 
> >> The resulting binary can be a library. If I add drti.o to the libthr
> >> library, every other program will break because it can't find libelf
> >> symbols. The only way to fix it would be to rebuild every program that
> >> depends on libthr and I don't want that to happen.
> > 
> > I do not understand this. If drti.o is added to a library, library should
> > also record a dependency on libelf, i.e. be linked with it. Since you
> > already modifying link command to add drti.o, what is the problem to
> > add -lelf ?
> 
> I wanted the same steps to be done in FreeBSD as in Solaris. I.e., in
> I Solaris you don't need to link with -lelf your program after you
> I added DTrace probes to it believe this is a good tradeoff  .

The drawbacks of linking library statically are, at least:
- Wasted space.
- Harder upgrade when libelf changes. Much harder for ports and hand-
  compiled programs.
- The mess that happen when the binary also linked with -lelf, and
  either your drti.o is linked, or a library that linked with its
  dcrti.o.
Pro argument seems to be that one less diff with Solaris code is needed.

This is becoming rather long.


pgpIFggeasjyW.pgp
Description: PGP signature


Re: svn commit: r211561 - head/cddl/lib/drti

2010-08-21 Thread Rui Paulo
On 21 Aug 2010, at 18:06, Kostik Belousov wrote:

> On Sat, Aug 21, 2010 at 03:33:35PM +0100, Rui Paulo wrote:
>> 
>> On 21 Aug 2010, at 15:23, Kostik Belousov wrote:
>> 
>>> On Sat, Aug 21, 2010 at 03:16:49PM +0100, Rui Paulo wrote:
 
 On 21 Aug 2010, at 14:59, Kostik Belousov wrote:
 
> On Sat, Aug 21, 2010 at 01:48:05PM +, Rui Paulo wrote:
>> Author: rpaulo
>> Date: Sat Aug 21 13:48:04 2010
>> New Revision: 211561
>> URL: http://svn.freebsd.org/changeset/base/211561
>> 
>> Log:
>> Link drti.o with a PIC version of libelf. This is needed because
>> drti.o depends on libelf and this avoids linking every other drti.o
>> program (namely programs with USDT probes) with libelf.
> What is wrong with having libelf as dependency of the resulting
> binary ?
 
 The resulting binary can be a library. If I add drti.o to the libthr
 library, every other program will break because it can't find libelf
 symbols. The only way to fix it would be to rebuild every program that
 depends on libthr and I don't want that to happen.
>>> 
>>> I do not understand this. If drti.o is added to a library, library should
>>> also record a dependency on libelf, i.e. be linked with it. Since you
>>> already modifying link command to add drti.o, what is the problem to
>>> add -lelf ?
>> 
>> I wanted the same steps to be done in FreeBSD as in Solaris. I.e., in
>> I Solaris you don't need to link with -lelf your program after you
>> I added DTrace probes to it believe this is a good tradeoff  .
> 
> The drawbacks of linking library statically are, at least:
> - Wasted space.

This is certainly not a problem nowadays.

> - Harder upgrade when libelf changes. Much harder for ports and hand-
>  compiled programs.
> - The mess that happen when the binary also linked with -lelf, and
>  either your drti.o is linked, or a library that linked with its
>  dcrti.o.

I'll try to find a way to make DTrace do the linking, if possible.

Regards,
--
Rui Paulo


___
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: r211577 - in head: . cddl/lib/drti lib/libelf

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 17:29:59 2010
New Revision: 211577
URL: http://svn.freebsd.org/changeset/base/211577

Log:
  Don't link drti.o with libelf_pic.a. This means that all software with
  userland SDT probes must be linked with libelf explicitly.
  
  Requested by: kib
  Sponsored by: The FreeBSD Foundation

Modified:
  head/Makefile.inc1
  head/cddl/lib/drti/Makefile
  head/lib/libelf/Makefile

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Sat Aug 21 17:15:37 2010(r211576)
+++ head/Makefile.inc1  Sat Aug 21 17:29:59 2010(r211577)
@@ -1149,7 +1149,7 @@ gnu/lib/libgcc__L: lib/libc__L
 _prebuild_libs=${_kerberos5_lib_libasn1} ${_kerberos5_lib_libheimntlm} 
\
${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \
${_kerberos5_lib_libroken} \
-   lib/libbz2 lib/libcom_err lib/libcrypt lib/libelf \
+   lib/libbz2 lib/libcom_err lib/libcrypt \
lib/libexpat lib/libfetch \
${_lib_libgssapi} ${_lib_libipx} \
lib/libkiconv lib/libkvm lib/liblzma lib/libmd \

Modified: head/cddl/lib/drti/Makefile
==
--- head/cddl/lib/drti/Makefile Sat Aug 21 17:15:37 2010(r211576)
+++ head/cddl/lib/drti/Makefile Sat Aug 21 17:29:59 2010(r211577)
@@ -8,7 +8,7 @@ FILESOWN=   ${LIBOWN}
 FILESGRP=  ${LIBGRP}
 FILESMODE= ${LIBMODE}
 FILESDIR=  ${LIBDIR}/dtrace
-CLEANFILES=${FILES} ${FILES}.tmp
+CLEANFILES=${FILES}
 
 CFLAGS+=   -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
-I${.CURDIR}/../../../cddl/compat/opensolaris/include \
@@ -18,10 +18,4 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/
-I${OPENSOLARIS_SYS_DISTDIR}/uts/common \
-DPIC -fpic
 
-.c.o:
-   ${CC} ${CFLAGS} -c ${.IMPSRC}
-   mv ${FILES} ${FILES}.tmp
-   ${LD} -o ${FILES} -r ${FILES}.tmp ${LIBELF_PIC}
-   rm -f ${FILES}.tmp
-
 .include 

Modified: head/lib/libelf/Makefile
==
--- head/lib/libelf/MakefileSat Aug 21 17:15:37 2010(r211576)
+++ head/lib/libelf/MakefileSat Aug 21 17:29:59 2010(r211577)
@@ -55,7 +55,6 @@ SRCS= elf_begin.c 
\
${GENSRCS}
 INCS=  libelf.h gelf.h
 
-INSTALL_PIC_ARCHIVE=yes
 GENSRCS=   libelf_fsize.c libelf_msize.c libelf_convert.c
 CLEANFILES=${GENSRCS}
 CFLAGS+=   -I. -I${.CURDIR}
___
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: r211577 - in head: . cddl/lib/drti lib/libelf

2010-08-21 Thread Kostik Belousov
On Sat, Aug 21, 2010 at 05:29:59PM +, Rui Paulo wrote:
> Author: rpaulo
> Date: Sat Aug 21 17:29:59 2010
> New Revision: 211577
> URL: http://svn.freebsd.org/changeset/base/211577
> 
> Log:
>   Don't link drti.o with libelf_pic.a. This means that all software with
>   userland SDT probes must be linked with libelf explicitly.
>   
>   Requested by:   kib
Thanks.


pgpfJQKj2pe59.pgp
Description: PGP signature


Re: svn commit: r211577 - in head: . cddl/lib/drti lib/libelf

2010-08-21 Thread Anonymous
Rui Paulo  writes:

> Author: rpaulo
> Date: Sat Aug 21 17:29:59 2010
> New Revision: 211577
> URL: http://svn.freebsd.org/changeset/base/211577
>
> Log:
>   Don't link drti.o with libelf_pic.a. This means that all software with
>   userland SDT probes must be linked with libelf explicitly.
>   
>   Requested by:   kib
>   Sponsored by:   The FreeBSD Foundation
>
> Modified:
>   head/Makefile.inc1
>   head/cddl/lib/drti/Makefile
>   head/lib/libelf/Makefile
>

I think there was one more file.

> Author: rpaulo
> Date: Sat Aug 21 14:08:04 2010
> New Revision: 211565
> URL: http://svn.freebsd.org/changeset/base/211565
>
> Log:
>   Add the definition of LIBELF_PIC.
>   
>   Sponsored by:   The FreeBSD Foundation
>
> Modified:
>   head/share/mk/bsd.libnames.mk
>
> Modified: head/share/mk/bsd.libnames.mk
> ==
> --- head/share/mk/bsd.libnames.mk Sat Aug 21 14:02:04 2010
> (r211564)
> +++ head/share/mk/bsd.libnames.mk Sat Aug 21 14:08:04 2010
> (r211565)
> @@ -45,6 +45,7 @@ LIBDTRACE?= ${DESTDIR}${LIBDIR}/libdtrac
>  LIBDWARF?=   ${DESTDIR}${LIBDIR}/libdwarf.a
>  LIBEDIT?=${DESTDIR}${LIBDIR}/libedit.a
>  LIBELF?= ${DESTDIR}${LIBDIR}/libelf.a
> +LIBELF_PIC?= ${DESTDIR}${LIBDIR}/libelf_pic.a
>  LIBFETCH?=   ${DESTDIR}${LIBDIR}/libfetch.a
>  LIBFL?=  "don't use LIBFL, use LIBL"
>  LIBFORM?=${DESTDIR}${LIBDIR}/libform.a
___
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: r211580 - head/share/mk

2010-08-21 Thread Rui Paulo
Author: rpaulo
Date: Sat Aug 21 17:53:16 2010
New Revision: 211580
URL: http://svn.freebsd.org/changeset/base/211580

Log:
  Remove LIBELF_PIC.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/mk/bsd.libnames.mk

Modified: head/share/mk/bsd.libnames.mk
==
--- head/share/mk/bsd.libnames.mk   Sat Aug 21 17:52:33 2010
(r211579)
+++ head/share/mk/bsd.libnames.mk   Sat Aug 21 17:53:16 2010
(r211580)
@@ -45,7 +45,6 @@ LIBDTRACE?=   ${DESTDIR}${LIBDIR}/libdtrac
 LIBDWARF?= ${DESTDIR}${LIBDIR}/libdwarf.a
 LIBEDIT?=  ${DESTDIR}${LIBDIR}/libedit.a
 LIBELF?=   ${DESTDIR}${LIBDIR}/libelf.a
-LIBELF_PIC?=   ${DESTDIR}${LIBDIR}/libelf_pic.a
 LIBFETCH?= ${DESTDIR}${LIBDIR}/libfetch.a
 LIBFL?="don't use LIBFL, use LIBL"
 LIBFORM?=  ${DESTDIR}${LIBDIR}/libform.a
___
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: r211577 - in head: . cddl/lib/drti lib/libelf

2010-08-21 Thread Rui Paulo

On 21 Aug 2010, at 18:36, Anonymous wrote:

> Rui Paulo  writes:
> 
>> Author: rpaulo
>> Date: Sat Aug 21 17:29:59 2010
>> New Revision: 211577
>> URL: http://svn.freebsd.org/changeset/base/211577
>> 
>> Log:
>>  Don't link drti.o with libelf_pic.a. This means that all software with
>>  userland SDT probes must be linked with libelf explicitly.
>> 
>>  Requested by:   kib
>>  Sponsored by:   The FreeBSD Foundation
>> 
>> Modified:
>>  head/Makefile.inc1
>>  head/cddl/lib/drti/Makefile
>>  head/lib/libelf/Makefile
>> 
> 
> I think there was one more file.

Thanks, fixed.

Regards,
--
Rui Paulo


___
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: r211501 - in head/sys: modules modules/send netinet netinet6 sys

2010-08-21 Thread Doug Barton

On 08/21/2010 05:07, Rui Paulo wrote:

Meanwhile, the fact that in the past code has been committed
without man pages is the exact cause of the problem you're
describing. It is certainly not a justification for continuing to
do it wrong.


Reverting code just because it doesn't have a man page is pointless.
Everyone can write the damn man page, but not everyone can write
code. You should really take this into consideration when proposing a
commit to be reverted.


So let's assume that having lots of code in the tree without a man page 
is a problem. Further, let's assume that we don't want the problem to 
get worse. How do you propose that we accomplish that?



Doug

--

Improve the effectiveness of your Internet presence with
a domain name makeover!http://SupersetSolutions.com/

Computers are useless. They can only give you answers.
-- Pablo Picasso

___
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: r211501 - in head/sys: modules modules/send netinet netinet6 sys

2010-08-21 Thread Rui Paulo

On 21 Aug 2010, at 19:20, Doug Barton wrote:

> On 08/21/2010 05:07, Rui Paulo wrote:
>>> Meanwhile, the fact that in the past code has been committed
>>> without man pages is the exact cause of the problem you're
>>> describing. It is certainly not a justification for continuing to
>>> do it wrong.
>> 
>> Reverting code just because it doesn't have a man page is pointless.
>> Everyone can write the damn man page, but not everyone can write
>> code. You should really take this into consideration when proposing a
>> commit to be reverted.
> 
> So let's assume that having lots of code in the tree without a man page is a 
> problem. Further, let's assume that we don't want the problem to get worse. 
> How do you propose that we accomplish that?

By writing man pages...?

Like I said, everyone can write a man page.. I did write man pages for stuff 
that hasn't had a man page for years (ctfmerge, ctfconvert, etc.).

Regards,
--
Rui Paulo


___
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: r211501 - in head/sys: modules modules/send netinet netinet6 sys

2010-08-21 Thread Doug Barton

On Sat, 21 Aug 2010, Rui Paulo wrote:


On 21 Aug 2010, at 19:20, Doug Barton wrote:


On 08/21/2010 05:07, Rui Paulo wrote:

Meanwhile, the fact that in the past code has been committed
without man pages is the exact cause of the problem you're
describing. It is certainly not a justification for continuing to
do it wrong.


Reverting code just because it doesn't have a man page is pointless.
Everyone can write the damn man page, but not everyone can write
code. You should really take this into consideration when proposing a
commit to be reverted.


So let's assume that having lots of code in the tree without a man page is a 
problem. Further, let's assume that we don't want the problem to get worse. How 
do you propose that we accomplish that?


By writing man pages...?


But that's the status quo (I.e., hope that people will/eventually write 
man pages for stuff) and it hasn't worked so far. The situation isn't 
actually going to be improved until we make a change. A simple (and I 
think abundantly reasonable) change that we can make today is, "Don't 
allow new work to be committed without a man page."


Meanwhile, there are a lot of benefits to this idea above and beyond the 
obvious one of having man pages for stuff. The biggest single benefit is 
that actually writing documentation for things forces you to re-examine 
assumptions, work through non-obvious and/or non-default code paths, 
etc. Speaking for myself, it's happened on more than one occasion that 
as I sit down to document some piece of code I realize that there are 
either bugs, or at least a better way of doing something. Requiring 
developers to work through this process before code goes into the tree 
gets us better code in addition to documentation.



Doug

--

Improve the effectiveness of your Internet presence with
a domain name makeover!http://SupersetSolutions.com/

Computers are useless. They can only give you answers.
-- Pablo Picasso

___
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: r211501 - in head/sys: modules modules/send netinet netinet6 sys

2010-08-21 Thread Rui Paulo

On 21 Aug 2010, at 22:15, Doug Barton wrote:

> On Sat, 21 Aug 2010, Rui Paulo wrote:
> 
>> On 21 Aug 2010, at 19:20, Doug Barton wrote:
>> 
>>> On 08/21/2010 05:07, Rui Paulo wrote:
> Meanwhile, the fact that in the past code has been committed
> without man pages is the exact cause of the problem you're
> describing. It is certainly not a justification for continuing to
> do it wrong.
 
 Reverting code just because it doesn't have a man page is pointless.
 Everyone can write the damn man page, but not everyone can write
 code. You should really take this into consideration when proposing a
 commit to be reverted.
>>> 
>>> So let's assume that having lots of code in the tree without a man page is 
>>> a problem. Further, let's assume that we don't want the problem to get 
>>> worse. How do you propose that we accomplish that?
>> 
>> By writing man pages...?
> 
> But that's the status quo (I.e., hope that people will/eventually write man 
> pages for stuff) and it hasn't worked so far. The situation isn't actually 
> going to be improved until we make a change. A simple (and I think abundantly 
> reasonable) change that we can make today is, "Don't allow new work to be 
> committed without a man page."
> 
> Meanwhile, there are a lot of benefits to this idea above and beyond the 
> obvious one of having man pages for stuff. The biggest single benefit is that 
> actually writing documentation for things forces you to re-examine 
> assumptions, work through non-obvious and/or non-default code paths, etc. 
> Speaking for myself, it's happened on more than one occasion that as I sit 
> down to document some piece of code I realize that there are either bugs, or 
> at least a better way of doing something. Requiring developers to work 
> through this process before code goes into the tree gets us better code in 
> addition to documentation.

If your concern is to change the status quo, you do understand that you picked 
the worst possible thread to hijack ? Esp. since the author promised to roll 
out a man page.

Regards,
--
Rui Paulo


___
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: r211501 - in head/sys: modules modules/send netinet netinet6 sys

2010-08-21 Thread Doug Barton

On Sat, 21 Aug 2010, Rui Paulo wrote:

If your concern is to change the status quo, you do understand that 
you picked the worst possible thread to hijack ? Esp. since the author 
promised to roll out a man page.


I didn't hijack anything, I responded to Ana's message saying that a man 
page was forthcoming. To me, since Ana intends to write a man page 
anyway I thought this was an excellent opportunity to highlight the fact 
that committing the man page along with the code is the preferred course 
of action.



Doug

--

Improve the effectiveness of your Internet presence with
a domain name makeover!http://SupersetSolutions.com/

Computers are useless. They can only give you answers.
-- Pablo Picasso

___
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: r211594 - head/sys/dev/bge

2010-08-21 Thread Pyun YongHyeon
Author: yongari
Date: Sat Aug 21 23:13:16 2010
New Revision: 211594
URL: http://svn.freebsd.org/changeset/base/211594

Log:
  Load tunable from loader.conf(5) instead of device.hints(5).

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Sat Aug 21 22:23:22 2010(r211593)
+++ head/sys/dev/bge/if_bge.c   Sat Aug 21 23:13:16 2010(r211594)
@@ -4898,6 +4898,8 @@ bge_add_sysctls(struct bge_softc *sc)
struct sysctl_ctx_list *ctx;
struct sysctl_oid_list *children, *schildren;
struct sysctl_oid *tree;
+   char tn[32];
+   int unit;
 
ctx = device_get_sysctl_ctx(sc->bge_dev);
children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->bge_dev));
@@ -4917,6 +4919,7 @@ bge_add_sysctls(struct bge_softc *sc)
 
 #endif
 
+   unit = device_get_unit(sc->bge_dev);
/*
 * A common design characteristic for many Broadcom client controllers
 * is that they only support a single outstanding DMA read operation
@@ -4929,13 +4932,13 @@ bge_add_sysctls(struct bge_softc *sc)
 * performance is about 850Mbps. However forcing coalescing mbufs
 * consumes a lot of CPU cycles, so leave it off by default.
 */
+   sc->bge_forced_collapse = 0;
+   snprintf(tn, sizeof(tn), "dev.bge.%d.forced_collapse", unit);
+   TUNABLE_INT_FETCH(tn, &sc->bge_forced_collapse);
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "forced_collapse",
CTLFLAG_RW, &sc->bge_forced_collapse, 0,
"Number of fragmented TX buffers of a frame allowed before "
"forced collapsing");
-   resource_int_value(device_get_name(sc->bge_dev),
-   device_get_unit(sc->bge_dev), "forced_collapse",
-   &sc->bge_forced_collapse);
 
if (BGE_IS_5705_PLUS(sc))
return;
___
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: r211594 - head/sys/dev/bge

2010-08-21 Thread M. Warner Losh
In message: <201008212313.o7lndgph083...@svn.freebsd.org>
Pyun YongHyeon  writes:
: Author: yongari
: Date: Sat Aug 21 23:13:16 2010
: New Revision: 211594
: URL: http://svn.freebsd.org/changeset/base/211594
: 
: Log:
:   Load tunable from loader.conf(5) instead of device.hints(5).

Why the move?

Warner

: Modified:
:   head/sys/dev/bge/if_bge.c
: 
: Modified: head/sys/dev/bge/if_bge.c
: ==
: --- head/sys/dev/bge/if_bge.c Sat Aug 21 22:23:22 2010(r211593)
: +++ head/sys/dev/bge/if_bge.c Sat Aug 21 23:13:16 2010(r211594)
: @@ -4898,6 +4898,8 @@ bge_add_sysctls(struct bge_softc *sc)
:   struct sysctl_ctx_list *ctx;
:   struct sysctl_oid_list *children, *schildren;
:   struct sysctl_oid *tree;
: + char tn[32];
: + int unit;
:  
:   ctx = device_get_sysctl_ctx(sc->bge_dev);
:   children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->bge_dev));
: @@ -4917,6 +4919,7 @@ bge_add_sysctls(struct bge_softc *sc)
:  
:  #endif
:  
: + unit = device_get_unit(sc->bge_dev);
:   /*
:* A common design characteristic for many Broadcom client controllers
:* is that they only support a single outstanding DMA read operation
: @@ -4929,13 +4932,13 @@ bge_add_sysctls(struct bge_softc *sc)
:* performance is about 850Mbps. However forcing coalescing mbufs
:* consumes a lot of CPU cycles, so leave it off by default.
:*/
: + sc->bge_forced_collapse = 0;
: + snprintf(tn, sizeof(tn), "dev.bge.%d.forced_collapse", unit);
: + TUNABLE_INT_FETCH(tn, &sc->bge_forced_collapse);
:   SYSCTL_ADD_INT(ctx, children, OID_AUTO, "forced_collapse",
:   CTLFLAG_RW, &sc->bge_forced_collapse, 0,
:   "Number of fragmented TX buffers of a frame allowed before "
:   "forced collapsing");
: - resource_int_value(device_get_name(sc->bge_dev),
: - device_get_unit(sc->bge_dev), "forced_collapse",
: - &sc->bge_forced_collapse);
:  
:   if (BGE_IS_5705_PLUS(sc))
:   return;
: 
___
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: r211501 - in head/sys: modules modules/send netinet netinet6 sys

2010-08-21 Thread M. Warner Losh
In message: 
Doug Barton  writes:
: On Sat, 21 Aug 2010, Rui Paulo wrote:
: 
: > If your concern is to change the status quo, you do understand that
: > you picked the worst possible thread to hijack ? Esp. since the author
: > promised to roll out a man page.
: 
: I didn't hijack anything, I responded to Ana's message saying that a
: man page was forthcoming. To me, since Ana intends to write a man page
: anyway I thought this was an excellent opportunity to highlight the
: fact that committing the man page along with the code is the preferred
: course of action.

Do we really need to have a bunch of threads about why people should
do the things they have promised to do?

Warner

___
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: r211594 - head/sys/dev/bge

2010-08-21 Thread Pyun YongHyeon
On Sat, Aug 21, 2010 at 07:13:34PM -0600, M. Warner Losh wrote:
> In message: <201008212313.o7lndgph083...@svn.freebsd.org>
> Pyun YongHyeon  writes:
> : Author: yongari
> : Date: Sat Aug 21 23:13:16 2010
> : New Revision: 211594
> : URL: http://svn.freebsd.org/changeset/base/211594
> : 
> : Log:
> :   Load tunable from loader.conf(5) instead of device.hints(5).
> 
> Why the move?
> 

Because bge(4) man page didn't mention device.hints. The tunable
could be set via sysctl or loader.
___
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: r211596 - head/sys/dev/bge

2010-08-21 Thread Pyun YongHyeon
Author: yongari
Date: Sun Aug 22 01:39:09 2010
New Revision: 211596
URL: http://svn.freebsd.org/changeset/base/211596

Log:
  It seems all Broadcom controllers have a bug that can generate UDP
  datagrams with checksum value 0 when TX UDP checksum offloading is
  enabled.  Generating UDP checksum value 0 is RFC 768 violation.
  Even though the probability of generating such UDP datagrams is
  low, I don't want to see FreeBSD boxes to inject such datagrams
  into network so disable UDP checksum offloading by default.  Users
  still override this behavior by setting a sysctl variable or loader
  tunable, dev.bge.%d.forced_udpcsum.
  
  I have no idea why this issue was not reported so far given that
  bge(4) is one of the most commonly used controller on high-end
  server class systems. Thanks to andre@ who passed the PR to me.
  
  PR:   kern/104826

Modified:
  head/sys/dev/bge/if_bge.c
  head/sys/dev/bge/if_bgereg.h

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Sun Aug 22 00:04:24 2010(r211595)
+++ head/sys/dev/bge/if_bge.c   Sun Aug 22 01:39:09 2010(r211596)
@@ -120,7 +120,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#defineBGE_CSUM_FEATURES   (CSUM_IP | CSUM_TCP | CSUM_UDP)
+#defineBGE_CSUM_FEATURES   (CSUM_IP | CSUM_TCP)
 #defineETHER_MIN_NOPAD (ETHER_MIN_LEN - ETHER_CRC_LEN) /* 
i.e., 60 */
 
 MODULE_DEPEND(bge, pci, 1, 1, 1);
@@ -2795,6 +2795,8 @@ bge_attach(device_t dev)
goto fail;
}
 
+   bge_add_sysctls(sc);
+
/* Set default tuneable values. */
sc->bge_stat_ticks = BGE_TICKS_PER_SEC;
sc->bge_rx_coal_ticks = 150;
@@ -2802,6 +2804,11 @@ bge_attach(device_t dev)
sc->bge_rx_max_coal_bds = 10;
sc->bge_tx_max_coal_bds = 10;
 
+   /* Initialize checksum features to use. */
+   sc->bge_csum_features = BGE_CSUM_FEATURES;
+   if (sc->bge_forced_udpcsum != 0)
+   sc->bge_csum_features |= CSUM_UDP;
+
/* Set up ifnet structure */
ifp = sc->bge_ifp = if_alloc(IFT_ETHER);
if (ifp == NULL) {
@@ -2818,7 +2825,7 @@ bge_attach(device_t dev)
ifp->if_snd.ifq_drv_maxlen = BGE_TX_RING_CNT - 1;
IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen);
IFQ_SET_READY(&ifp->if_snd);
-   ifp->if_hwassist = BGE_CSUM_FEATURES;
+   ifp->if_hwassist = sc->bge_csum_features;
ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING |
IFCAP_VLAN_MTU;
if ((sc->bge_flags & BGE_FLAG_TSO) != 0) {
@@ -2975,8 +2982,6 @@ again:
device_printf(sc->bge_dev, "couldn't set up irq\n");
}
 
-   bge_add_sysctls(sc);
-
return (0);
 
 fail:
@@ -3960,7 +3965,7 @@ bge_encap(struct bge_softc *sc, struct m
return (ENOBUFS);
csum_flags |= BGE_TXBDFLAG_CPU_PRE_DMA |
BGE_TXBDFLAG_CPU_POST_DMA;
-   } else if ((m->m_pkthdr.csum_flags & BGE_CSUM_FEATURES) != 0) {
+   } else if ((m->m_pkthdr.csum_flags & sc->bge_csum_features) != 0) {
if (m->m_pkthdr.csum_flags & CSUM_IP)
csum_flags |= BGE_TXBDFLAG_IP_CSUM;
if (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) {
@@ -4237,6 +4242,17 @@ bge_init_locked(struct bge_softc *sc)
/* Program VLAN tag stripping. */
bge_setvlan(sc);
 
+   /* Override UDP checksum offloading. */
+   if (sc->bge_forced_udpcsum == 0)
+   sc->bge_csum_features &= ~CSUM_UDP;
+   else
+   sc->bge_csum_features |= CSUM_UDP;
+   if (ifp->if_capabilities & IFCAP_TXCSUM &&
+   ifp->if_capenable & IFCAP_TXCSUM) {
+   ifp->if_hwassist &= ~(BGE_CSUM_FEATURES | CSUM_UDP);
+   ifp->if_hwassist |= sc->bge_csum_features;
+   }
+
/* Init RX ring. */
if (bge_init_rx_ring_std(sc) != 0) {
device_printf(sc->bge_dev, "no memory for std Rx buffers.\n");
@@ -4562,9 +4578,9 @@ bge_ioctl(struct ifnet *ifp, u_long comm
ifp->if_capenable ^= IFCAP_HWCSUM;
if (IFCAP_HWCSUM & ifp->if_capenable &&
IFCAP_HWCSUM & ifp->if_capabilities)
-   ifp->if_hwassist |= BGE_CSUM_FEATURES;
+   ifp->if_hwassist |= sc->bge_csum_features;
else
-   ifp->if_hwassist &= ~BGE_CSUM_FEATURES;
+   ifp->if_hwassist &= ~sc->bge_csum_features;
}
 
if ((mask & IFCAP_TSO4) != 0 &&
@@ -4940,6 +4956,24 @@ bge_add_sysctls(struct bge_softc *sc)
"Number of fragmented TX buffers of a frame allowed before "
"forced collapsing");
 
+   /*
+* It seems all Broadcom controllers have a bug that can generate UDP
+* datagra

svn commit: r211597 - head/share/man/man4

2010-08-21 Thread Pyun YongHyeon
Author: yongari
Date: Sun Aug 22 01:40:59 2010
New Revision: 211597
URL: http://svn.freebsd.org/changeset/base/211597

Log:
  Document newly introduced tunable dev.bge.%d.forced_udpcsum.
  While I'm here also mention tunable dev.bge.%d.forced_collapse.

Modified:
  head/share/man/man4/bge.4

Modified: head/share/man/man4/bge.4
==
--- head/share/man/man4/bge.4   Sun Aug 22 01:39:09 2010(r211596)
+++ head/share/man/man4/bge.4   Sun Aug 22 01:40:59 2010(r211597)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 7, 2009
+.Dd August 21, 2010
 .Dt BGE 4
 .Os
 .Sh NAME
@@ -219,6 +219,26 @@ Allow the ASF feature for cooperating wi
 Can cause system lockup problems on a small number of systems.
 Enabled by default.
 .El
+.Sh SYSCTL VARIABLES
+The following variables are available as both
+.Xr sysctl 8
+variables and
+.Xr loader 8
+tunables:
+.Bl -tag -width indent
+.It Va dev.bge.%d.forced_collapse
+Allow collapsing multiple transmit buffers into a single buffer
+to increase transmit performance with the cost of CPU cycles.
+The default value is 0 to disable transmit buffer collapsing.
+.It Va dev.bge.%d.forced_udpcsum
+Enable UDP transmit checksum offloading even if controller can generate
+UDP datagrams with checksum value 0.
+UDP datagrams with checksum value 0 can confuse receiver host as it means
+sender did not compute UDP checksum.
+The default value is 0 which disables UDP transmit checksum offloading.
+The interface need to be brought down and up again before a change takes
+effect.
+.El
 .Sh DIAGNOSTICS
 .Bl -diag
 .It "bge%d: couldn't map memory"
___
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: r211594 - head/sys/dev/bge

2010-08-21 Thread M. Warner Losh
In message: <20100822012433.gb1...@michelle.cdnetworks.com>
Pyun YongHyeon  writes:
: On Sat, Aug 21, 2010 at 07:13:34PM -0600, M. Warner Losh wrote:
: > In message: <201008212313.o7lndgph083...@svn.freebsd.org>
: > Pyun YongHyeon  writes:
: > : Author: yongari
: > : Date: Sat Aug 21 23:13:16 2010
: > : New Revision: 211594
: > : URL: http://svn.freebsd.org/changeset/base/211594
: > : 
: > : Log:
: > :   Load tunable from loader.conf(5) instead of device.hints(5).
: > 
: > Why the move?
: > 
: 
: Because bge(4) man page didn't mention device.hints. The tunable
: could be set via sysctl or loader.

It's just that our other drivers use the hints mechanism.

Of course, you could easily set either of these in either loader.conf
or device.hints...  They are basically the same thing...

Warner
___
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: r211594 - head/sys/dev/bge

2010-08-21 Thread Pyun YongHyeon
On Sat, Aug 21, 2010 at 08:10:42PM -0600, M. Warner Losh wrote:
> In message: <20100822012433.gb1...@michelle.cdnetworks.com>
> Pyun YongHyeon  writes:
> : On Sat, Aug 21, 2010 at 07:13:34PM -0600, M. Warner Losh wrote:
> : > In message: <201008212313.o7lndgph083...@svn.freebsd.org>
> : > Pyun YongHyeon  writes:
> : > : Author: yongari
> : > : Date: Sat Aug 21 23:13:16 2010
> : > : New Revision: 211594
> : > : URL: http://svn.freebsd.org/changeset/base/211594
> : > : 
> : > : Log:
> : > :   Load tunable from loader.conf(5) instead of device.hints(5).
> : > 
> : > Why the move?
> : > 
> : 
> : Because bge(4) man page didn't mention device.hints. The tunable
> : could be set via sysctl or loader.
> 
> It's just that our other drivers use the hints mechanism.
> 
> Of course, you could easily set either of these in either loader.conf
> or device.hints...  They are basically the same thing...
> 

Yes, but hints requires "hint" string to be present before
driver.unit.keyword string which is not the same syntax of sysctl
variable.

> Warner
___
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: r211594 - head/sys/dev/bge

2010-08-21 Thread M. Warner Losh
In message: <20100822022001.gc1...@michelle.cdnetworks.com>
Pyun YongHyeon  writes:
: On Sat, Aug 21, 2010 at 08:10:42PM -0600, M. Warner Losh wrote:
: > In message: <20100822012433.gb1...@michelle.cdnetworks.com>
: > Pyun YongHyeon  writes:
: > : On Sat, Aug 21, 2010 at 07:13:34PM -0600, M. Warner Losh wrote:
: > : > In message: <201008212313.o7lndgph083...@svn.freebsd.org>
: > : > Pyun YongHyeon  writes:
: > : > : Author: yongari
: > : > : Date: Sat Aug 21 23:13:16 2010
: > : > : New Revision: 211594
: > : > : URL: http://svn.freebsd.org/changeset/base/211594
: > : > : 
: > : > : Log:
: > : > :   Load tunable from loader.conf(5) instead of device.hints(5).
: > : > 
: > : > Why the move?
: > : > 
: > : 
: > : Because bge(4) man page didn't mention device.hints. The tunable
: > : could be set via sysctl or loader.
: > 
: > It's just that our other drivers use the hints mechanism.
: > 
: > Of course, you could easily set either of these in either loader.conf
: > or device.hints...  They are basically the same thing...
: > 
: 
: Yes, but hints requires "hint" string to be present before
: driver.unit.keyword string which is not the same syntax of sysctl
: variable.

I guess my bigger point is that we should consider migration now that
we have a better mechanism...

Warner
___
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: r211598 - head/sys/fs/tmpfs

2010-08-21 Thread Ed Schouten
Author: ed
Date: Sun Aug 22 05:36:06 2010
New Revision: 211598
URL: http://svn.freebsd.org/changeset/base/211598

Log:
  Add support for whiteouts on tmpfs.
  
  Right now unionfs only allows filesystems to be mounted on top of
  another if it supports whiteouts. Even though I have sent a patch to
  daichi@ to let unionfs work without it, we'd better also add support for
  whiteouts to tmpfs.
  
  This patch implements .vop_whiteout and makes necessary changes to
  lookup() and readdir() to take them into account. We must also make sure
  that when adding or removing a file, we honour the componentname's
  DOWHITEOUT and ISWHITEOUT, to prevent duplicate filenames.
  
  MFC after:1 month

Modified:
  head/sys/fs/tmpfs/tmpfs.h
  head/sys/fs/tmpfs/tmpfs_subr.c
  head/sys/fs/tmpfs/tmpfs_vnops.c

Modified: head/sys/fs/tmpfs/tmpfs.h
==
--- head/sys/fs/tmpfs/tmpfs.h   Sun Aug 22 01:40:59 2010(r211597)
+++ head/sys/fs/tmpfs/tmpfs.h   Sun Aug 22 05:36:06 2010(r211598)
@@ -72,7 +72,8 @@ struct tmpfs_dirent {
* td_namelen field must always be used when accessing its value. */
char *  td_name;
 
-   /* Pointer to the node this entry refers to. */
+   /* Pointer to the node this entry refers to.  In case this field
+* is NULL, the node is a whiteout. */
struct tmpfs_node * td_node;
 };
 
@@ -434,6 +435,8 @@ int tmpfs_dir_getdotdent(struct tmpfs_no
 inttmpfs_dir_getdotdotdent(struct tmpfs_node *, struct uio *);
 struct tmpfs_dirent *  tmpfs_dir_lookupbycookie(struct tmpfs_node *, off_t);
 inttmpfs_dir_getdents(struct tmpfs_node *, struct uio *, off_t *);
+inttmpfs_dir_whiteout_add(struct vnode *, struct componentname *);
+void   tmpfs_dir_whiteout_remove(struct vnode *, struct componentname *);
 inttmpfs_reg_resize(struct vnode *, off_t);
 inttmpfs_chflags(struct vnode *, int, struct ucred *, struct thread *);
 inttmpfs_chmod(struct vnode *, mode_t, struct ucred *, struct thread *);

Modified: head/sys/fs/tmpfs/tmpfs_subr.c
==
--- head/sys/fs/tmpfs/tmpfs_subr.c  Sun Aug 22 01:40:59 2010
(r211597)
+++ head/sys/fs/tmpfs/tmpfs_subr.c  Sun Aug 22 05:36:06 2010
(r211598)
@@ -261,7 +261,8 @@ tmpfs_alloc_dirent(struct tmpfs_mount *t
memcpy(nde->td_name, name, len);
 
nde->td_node = node;
-   node->tn_links++;
+   if (node != NULL)
+   node->tn_links++;
 
*de = nde;
 
@@ -287,9 +288,10 @@ tmpfs_free_dirent(struct tmpfs_mount *tm
struct tmpfs_node *node;
 
node = de->td_node;
-
-   MPASS(node->tn_links > 0);
-   node->tn_links--;
+   if (node != NULL) {
+   MPASS(node->tn_links > 0);
+   node->tn_links--;
+   }
}
 
free(de->td_name, M_TMPFSNAME);
@@ -518,6 +520,8 @@ tmpfs_alloc_file(struct vnode *dvp, stru
/* Now that all required items are allocated, we can proceed to
 * insert the new node into the directory, an operation that
 * cannot fail. */
+   if (cnp->cn_flags & ISWHITEOUT)
+   tmpfs_dir_whiteout_remove(dvp, cnp);
tmpfs_dir_attach(dvp, de);
 
 out:
@@ -768,39 +772,44 @@ tmpfs_dir_getdents(struct tmpfs_node *no
 
/* Create a dirent structure representing the current
 * tmpfs_node and fill it. */
-   d.d_fileno = de->td_node->tn_id;
-   switch (de->td_node->tn_type) {
-   case VBLK:
-   d.d_type = DT_BLK;
-   break;
-
-   case VCHR:
-   d.d_type = DT_CHR;
-   break;
-
-   case VDIR:
-   d.d_type = DT_DIR;
-   break;
-
-   case VFIFO:
-   d.d_type = DT_FIFO;
-   break;
-
-   case VLNK:
-   d.d_type = DT_LNK;
-   break;
-
-   case VREG:
-   d.d_type = DT_REG;
-   break;
-
-   case VSOCK:
-   d.d_type = DT_SOCK;
-   break;
-
-   default:
-   panic("tmpfs_dir_getdents: type %p %d",
-   de->td_node, (int)de->td_node->tn_type);
+   if (de->td_node == NULL) {
+   d.d_fileno = 1;
+   d.d_type = DT_WHT;
+   } else {
+   d.d_fileno = de->td_node->tn_id;
+   switch (de->td_node->tn_type) {
+   case VBLK:
+   d.d_type = DT_BLK;
+   break;
+
+   case VCHR:
+