From owner-svn-src-head@FreeBSD.ORG Sun May 13 01:33:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CDE9106564A; Sun, 13 May 2012 01:33:29 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E9D28FC12; Sun, 13 May 2012 01:33:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4D1XTUi060975; Sun, 13 May 2012 01:33:29 GMT (envelope-from jasone@svn.freebsd.org) Received: (from jasone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4D1XSFH060971; Sun, 13 May 2012 01:33:28 GMT (envelope-from jasone@svn.freebsd.org) Message-Id: <201205130133.q4D1XSFH060971@svn.freebsd.org> From: Jason Evans Date: Sun, 13 May 2012 01:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235385 - in head/contrib/jemalloc: . doc include/jemalloc/internal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 01:33:29 -0000 Author: jasone Date: Sun May 13 01:33:28 2012 New Revision: 235385 URL: http://svn.freebsd.org/changeset/base/235385 Log: Fix config_lazy_lock so that thread caching isn't used for single-threaded applications. Modified: head/contrib/jemalloc/FREEBSD-diffs head/contrib/jemalloc/doc/jemalloc.3 head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h Modified: head/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- head/contrib/jemalloc/FREEBSD-diffs Sun May 13 01:30:27 2012 (r235384) +++ head/contrib/jemalloc/FREEBSD-diffs Sun May 13 01:33:28 2012 (r235385) @@ -45,7 +45,7 @@ index 877c500..7d659a7 100644 + diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in -index 268cd14..cfb1fb9 100644 +index 268cd14..2acd2eb 100644 --- a/include/jemalloc/internal/jemalloc_internal.h.in +++ b/include/jemalloc/internal/jemalloc_internal.h.in @@ -1,5 +1,8 @@ @@ -67,6 +67,21 @@ index 268cd14..cfb1fb9 100644 #define JEMALLOC_NO_DEMANGLE #include "../jemalloc@install_suffix@.h" +@@ -95,13 +101,7 @@ static const bool config_fill = + false + #endif + ; +-static const bool config_lazy_lock = +-#ifdef JEMALLOC_LAZY_LOCK +- true +-#else +- false +-#endif +- ; ++static const bool config_lazy_lock = true; + static const bool config_prof = + #ifdef JEMALLOC_PROF + true diff --git a/include/jemalloc/internal/mutex.h b/include/jemalloc/internal/mutex.h index de44e14..564d604 100644 --- a/include/jemalloc/internal/mutex.h Modified: head/contrib/jemalloc/doc/jemalloc.3 ============================================================================== --- head/contrib/jemalloc/doc/jemalloc.3 Sun May 13 01:30:27 2012 (r235384) +++ head/contrib/jemalloc/doc/jemalloc.3 Sun May 13 01:33:28 2012 (r235385) @@ -2,12 +2,12 @@ .\" Title: JEMALLOC .\" Author: Jason Evans .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 05/11/2012 +.\" Date: 05/12/2012 .\" Manual: User Manual .\" Source: jemalloc 3.0.0-0-gfc9b1dbf69f59d7ecfc4ac68da9847e017e1d046 .\" Language: English .\" -.TH "JEMALLOC" "3" "05/11/2012" "jemalloc 3.0.0-0-gfc9b1dbf69f5" "User Manual" +.TH "JEMALLOC" "3" "05/12/2012" "jemalloc 3.0.0-0-gfc9b1dbf69f5" "User Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- Modified: head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h Sun May 13 01:30:27 2012 (r235384) +++ head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h Sun May 13 01:33:28 2012 (r235385) @@ -101,13 +101,7 @@ static const bool config_fill = false #endif ; -static const bool config_lazy_lock = -#ifdef JEMALLOC_LAZY_LOCK - true -#else - false -#endif - ; +static const bool config_lazy_lock = true; static const bool config_prof = #ifdef JEMALLOC_PROF true From owner-svn-src-head@FreeBSD.ORG Sun May 13 03:28:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E360E1065674; Sun, 13 May 2012 03:28:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id B0BED8FC0A; Sun, 13 May 2012 03:28:00 +0000 (UTC) Received: from John-Baldwins-MacBook-Air.local (unknown [24.114.252.231]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E8177B915; Sat, 12 May 2012 23:27:59 -0400 (EDT) Message-ID: <4FAF2A3F.5090708@FreeBSD.org> Date: Sat, 12 May 2012 23:27:59 -0400 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Bruce Evans References: <201205111237.q4BCbGX2083596@svn.freebsd.org> <20120511124820.GN2358@deviant.kiev.zoral.com.ua> <6AE99277-D90F-453D-AE40-EE731DFD3BAB@FreeBSD.org> <20120511130955.GO2358@deviant.kiev.zoral.com.ua> <20120512014148.C1953@besplex.bde.org> In-Reply-To: <20120512014148.C1953@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 12 May 2012 23:28:00 -0400 (EDT) Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, David Chisnall , svn-src-head@freebsd.org, Gabor Kovesdan , Konstantin Belousov Subject: Re: svn commit: r235267 - in head/usr.bin/sort: . nls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 03:28:01 -0000 On 5/11/12 1:17 PM, Bruce Evans wrote: > However, they may be some some boot programs that save space by not > bzeroing the bss. Not being a C program in this respect apparently > caused the following farcal churn in i386/boot2: > - the opts variable started with a bogus explicit initialization > to 0. Long ago (in 2003), but probably after the default of > -fzero-initialized-in-bss turned this into just a style bug, > the explicit initializaton was removed. > - zeroing of the bss was moved from i386/boot2/boot1.s ro rbx in 2004. > It hopefully still worked. > - in 2011, the kname variable was changed from char [1024] to a > pointer. The pointer was explicitly initialized to NULL. This > was not just a style bug, since the bss was apparently no > longer zeroed. > - initialization of the opts variable was apparently broken in the > same way some time before this (whenever the zeroing was optimized > away). > - in the next commit in 2011, it was claimed that the BSS is not > zeroed, and the initialization of kname was moved into main() > to fix this. bss was spelled BSS, so my greps didn't find this > immediately. > - in a later commit in 2012, the initialization of opts was moved into > main(), presumably for the same reason, but neither bss nor BSS was > mentioned in the commit log, so this took longer to find. > - these changes broke at least kname. Apparently, it can be initialized > to non-null before main() in some cases. This was fixed in the most > recent commit to boot2.c, in 2012, by moving the initialization of > kname out of main(). opts was moved similary. The commit message > doesn't mention bss or BSS, and says that this is to make clange > build again. But boot2 is compiled without -fzero-initialized-in-bss, > so initializing kname and opts outside of main() has no effect. They > are now uninitialized again, assuming that the 2011 commit message is > correct. Even the old char array for kname probably needed kname[0] > to be zero. We apparently depend on most memory being 0 when booting, > so that the chance of it being nonzero for these 2 variables is tiny. > > kname and opts are the only 2 global variables in i386/boot2 that need > to be initialized to 0 in some way (the others either need to be > initialized to non-0, so they never get put in the bss, or their initial > value doesn't matter. After reducing kname to a pointer, these variables > have total size 8. Perhaps the zeroing code would now take more than 8 > bytes. However, in the 2004 version when the zeroing code was in boot1.S, > it size seems to be 6 or 7 bytes (the code for this is smart). Thus the > savings might be negative, but they are more likely to be a whole 4-8 > bytes. There may be safer ways to save space. So I finally figured this out recently while looking at avg@'s recent patches. boot2's BSS is in fact zero'd by sys/boot/i386/btx/lib/btxcsu.S. This same code also zero's the BSS of /boot/loader. I have a patch to revert boot2 back to depending on the zero'd BSS in a tree, just need to commit it. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sun May 13 05:08:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6ECBF106566C; Sun, 13 May 2012 05:08:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F3A58FC0C; Sun, 13 May 2012 05:08:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4D58EY1067702; Sun, 13 May 2012 05:08:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4D58EcO067699; Sun, 13 May 2012 05:08:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205130508.q4D58EcO067699@svn.freebsd.org> From: Marius Strobl Date: Sun, 13 May 2012 05:08:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235388 - head/contrib/compiler-rt/lib/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 05:08:14 -0000 Author: marius Date: Sun May 13 05:08:13 2012 New Revision: 235388 URL: http://svn.freebsd.org/changeset/base/235388 Log: - Get rid of debugging support in order to get rid of the V8-specific C compiler frame size used there so this whole thing is V8/V9-agnostic. - Use 32-bit function alignment as GCC does when using UltraSPARC I or higher optimizations. - Don't waste delay slots when possible. Unfortunately, this still doesn't make libcompiler_rt a viable replacement for libgcc on sparc64 though as once installed instead, buildworld times increase by nearly 60% (which isn't related to these assembler functions). Modified: head/contrib/compiler-rt/lib/sparc64/divmod.m4 Modified: head/contrib/compiler-rt/lib/sparc64/divmod.m4 ============================================================================== --- head/contrib/compiler-rt/lib/sparc64/divmod.m4 Sun May 13 02:09:27 2012 (r235387) +++ head/contrib/compiler-rt/lib/sparc64/divmod.m4 Sun May 13 05:08:13 2012 (r235388) @@ -59,9 +59,6 @@ define(SC,`%g2') #include "../assembly.h" -.text - .align 4 - define(DEVELOP_QUOTIENT_BITS, ` !depth $1, accumulated bits $2 bl L.$1.eval(TWOSUPN+$2) @@ -84,12 +81,14 @@ L.$1.eval(TWOSUPN+$2): ifelse( $1, 1, `9:') ') ifelse( ANSWER, `quotient', ` +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__udivsi3) - save %sp,-64,%sp ! do this for debugging b divide mov 0,SIGN ! result always nonnegative +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__divsi3) - save %sp,-64,%sp ! do this for debugging orcc divisor,dividend,%g0 ! are either dividend or divisor negative bge divide ! if not, skip this junk xor divisor,dividend,SIGN ! record sign of result in sign of SIGN @@ -104,12 +103,14 @@ DEFINE_COMPILERRT_FUNCTION(__divsi3) neg dividend ! FALL THROUGH ',` +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__umodsi3) - save %sp,-64,%sp ! do this for debugging b divide mov 0,SIGN ! result always nonnegative +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__modsi3) - save %sp,-64,%sp ! do this for debugging orcc divisor,dividend,%g0 ! are either dividend or divisor negative bge divide ! if not, skip this junk mov dividend,SIGN ! record sign of result in sign of SIGN @@ -184,8 +185,8 @@ do_single_div: nop sub R,V,R mov 1,Q - b end_single_divloop - nop + b,a end_single_divloop + ! EMPTY single_divloop: sll Q,1,Q bl 1f @@ -202,8 +203,8 @@ single_divloop: deccc SC bge single_divloop tst R - b end_regular_divide - nop + b,a end_regular_divide + ! EMPTY not_really_big: 1: @@ -224,9 +225,8 @@ end_regular_divide: deccc ITER bge divloop tst R - bge got_result - nop - ! non-restoring fixup here + bl,a got_result + ! non-restoring fixup if remainder < 0, otherwise annulled ifelse( ANSWER, `quotient', ` dec Q ',` add R,divisor,R @@ -234,13 +234,11 @@ ifelse( ANSWER, `quotient', got_result: tst SIGN - bge 1f - restore - ! answer < 0 - retl ! leaf-routine return + bl,a 1f + ! negate for answer < 0, otherwise annulled ifelse( ANSWER, `quotient', -` neg %o2,%o0 ! quotient <- -Q -',` neg %o3,%o0 ! remainder <- -R +` neg %o2,%o2 ! Q <- -Q +',` neg %o3,%o3 ! R <- -R ') 1: retl ! leaf-routine return From owner-svn-src-head@FreeBSD.ORG Sun May 13 05:09:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 18BFC1065670; Sun, 13 May 2012 05:09:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 045708FC15; Sun, 13 May 2012 05:09:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4D59agC067774; Sun, 13 May 2012 05:09:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4D59avT067771; Sun, 13 May 2012 05:09:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205130509.q4D59avT067771@svn.freebsd.org> From: Marius Strobl Date: Sun, 13 May 2012 05:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235389 - head/contrib/compiler-rt/lib/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 05:09:37 -0000 Author: marius Date: Sun May 13 05:09:36 2012 New Revision: 235389 URL: http://svn.freebsd.org/changeset/base/235389 Log: Regenerate after r235388. Modified: head/contrib/compiler-rt/lib/sparc64/divsi3.S head/contrib/compiler-rt/lib/sparc64/modsi3.S Modified: head/contrib/compiler-rt/lib/sparc64/divsi3.S ============================================================================== --- head/contrib/compiler-rt/lib/sparc64/divsi3.S Sun May 13 05:08:13 2012 (r235388) +++ head/contrib/compiler-rt/lib/sparc64/divsi3.S Sun May 13 05:09:36 2012 (r235389) @@ -47,13 +47,13 @@ */ #include "../assembly.h" .text - .align 4 + .align 32 DEFINE_COMPILERRT_FUNCTION(__udivsi3) - save %sp,-64,%sp ! do this for debugging b divide mov 0,%g3 ! result always nonnegative +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__divsi3) - save %sp,-64,%sp ! do this for debugging orcc %o1,%o0,%g0 ! are either %o0 or %o1 negative bge divide ! if not, skip this junk xor %o1,%o0,%g3 ! record sign of result in sign of %g3 @@ -126,8 +126,8 @@ do_single_div: nop sub %o3,%o5,%o3 mov 1,%o2 - b end_single_divloop - nop + b,a end_single_divloop + ! EMPTY single_divloop: sll %o2,1,%o2 bl 1f @@ -144,8 +144,8 @@ single_divloop: deccc %g2 bge single_divloop tst %o3 - b end_regular_divide - nop + b,a end_regular_divide + ! EMPTY not_really_big: 1: sll %o5,4,%o5 @@ -317,17 +317,14 @@ end_regular_divide: deccc %o4 bge divloop tst %o3 - bge got_result - nop - ! non-restoring fixup here + bl,a got_result + ! non-restoring fixup if remainder < 0, otherwise annulled dec %o2 got_result: tst %g3 - bge 1f - restore - ! answer < 0 - retl ! leaf-routine return - neg %o2,%o0 ! quotient <- -%o2 + bl,a 1f + ! negate for answer < 0, otherwise annulled + neg %o2,%o2 ! %o2 <- -%o2 1: retl ! leaf-routine return mov %o2,%o0 ! quotient <- %o2 Modified: head/contrib/compiler-rt/lib/sparc64/modsi3.S ============================================================================== --- head/contrib/compiler-rt/lib/sparc64/modsi3.S Sun May 13 05:08:13 2012 (r235388) +++ head/contrib/compiler-rt/lib/sparc64/modsi3.S Sun May 13 05:09:36 2012 (r235389) @@ -47,13 +47,13 @@ */ #include "../assembly.h" .text - .align 4 + .align 32 DEFINE_COMPILERRT_FUNCTION(__umodsi3) - save %sp,-64,%sp ! do this for debugging b divide mov 0,%g3 ! result always nonnegative +.text + .align 32 DEFINE_COMPILERRT_FUNCTION(__modsi3) - save %sp,-64,%sp ! do this for debugging orcc %o1,%o0,%g0 ! are either %o0 or %o1 negative bge divide ! if not, skip this junk mov %o0,%g3 ! record sign of result in sign of %g3 @@ -126,8 +126,8 @@ do_single_div: nop sub %o3,%o5,%o3 mov 1,%o2 - b end_single_divloop - nop + b,a end_single_divloop + ! EMPTY single_divloop: sll %o2,1,%o2 bl 1f @@ -144,8 +144,8 @@ single_divloop: deccc %g2 bge single_divloop tst %o3 - b end_regular_divide - nop + b,a end_regular_divide + ! EMPTY not_really_big: 1: sll %o5,4,%o5 @@ -317,17 +317,14 @@ end_regular_divide: deccc %o4 bge divloop tst %o3 - bge got_result - nop - ! non-restoring fixup here + bl,a got_result + ! non-restoring fixup if remainder < 0, otherwise annulled add %o3,%o1,%o3 got_result: tst %g3 - bge 1f - restore - ! answer < 0 - retl ! leaf-routine return - neg %o3,%o0 ! remainder <- -%o3 + bl,a 1f + ! negate for answer < 0, otherwise annulled + neg %o3,%o3 ! %o3 <- -%o3 1: retl ! leaf-routine return mov %o3,%o0 ! remainder <- %o3 From owner-svn-src-head@FreeBSD.ORG Sun May 13 09:22:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6906A1065670; Sun, 13 May 2012 09:22:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52D1B8FC14; Sun, 13 May 2012 09:22:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4D9MJDh075493; Sun, 13 May 2012 09:22:19 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4D9MJcJ075490; Sun, 13 May 2012 09:22:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201205130922.q4D9MJcJ075490@svn.freebsd.org> From: Andriy Gapon Date: Sun, 13 May 2012 09:22:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235390 - head/sys/boot/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 09:22:19 -0000 Author: avg Date: Sun May 13 09:22:18 2012 New Revision: 235390 URL: http://svn.freebsd.org/changeset/base/235390 Log: zfs boot code: mark spa_t arguments as const where they are used as such MFC after: 1 month Modified: head/sys/boot/zfs/zfs.c head/sys/boot/zfs/zfsimpl.c Modified: head/sys/boot/zfs/zfs.c ============================================================================== --- head/sys/boot/zfs/zfs.c Sun May 13 05:09:36 2012 (r235389) +++ head/sys/boot/zfs/zfs.c Sun May 13 09:22:18 2012 (r235390) @@ -128,7 +128,7 @@ zfs_close(struct open_file *f) static int zfs_read(struct open_file *f, void *start, size_t size, size_t *resid /* out */) { - spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; + const spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; struct file *fp = (struct file *)f->f_fsdata; struct stat sb; size_t n; @@ -202,7 +202,7 @@ zfs_seek(struct open_file *f, off_t offs static int zfs_stat(struct open_file *f, struct stat *sb) { - spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; + const spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; struct file *fp = (struct file *)f->f_fsdata; return (zfs_dnode_stat(spa, &fp->f_dnode, sb)); @@ -211,7 +211,7 @@ zfs_stat(struct open_file *f, struct sta static int zfs_readdir(struct open_file *f, struct dirent *d) { - spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; + const spa_t *spa = ((struct zfsmount *)f->f_devdata)->spa; struct file *fp = (struct file *)f->f_fsdata; mzap_ent_phys_t mze; struct stat sb; Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Sun May 13 05:09:36 2012 (r235389) +++ head/sys/boot/zfs/zfsimpl.c Sun May 13 09:22:18 2012 (r235390) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); struct zfsmount { - spa_t *spa; + const spa_t *spa; objset_phys_t objset; uint64_t rootobj; }; @@ -63,7 +63,7 @@ static char *zfs_temp_buf, *zfs_temp_end #define TEMP_SIZE (1024 * 1024) -static int zio_read(spa_t *spa, const blkptr_t *bp, void *buf); +static int zio_read(const spa_t *spa, const blkptr_t *bp, void *buf); static void zfs_init(void) @@ -981,7 +981,7 @@ ilog2(int n) } static int -zio_read_gang(spa_t *spa, const blkptr_t *bp, void *buf) +zio_read_gang(const spa_t *spa, const blkptr_t *bp, void *buf) { blkptr_t gbh_bp; zio_gbh_phys_t zio_gb; @@ -1018,7 +1018,7 @@ zio_read_gang(spa_t *spa, const blkptr_t } static int -zio_read(spa_t *spa, const blkptr_t *bp, void *buf) +zio_read(const spa_t *spa, const blkptr_t *bp, void *buf) { int cpfunc = BP_GET_COMPRESS(bp); uint64_t align, size; @@ -1078,7 +1078,7 @@ zio_read(spa_t *spa, const blkptr_t *bp, } static int -dnode_read(spa_t *spa, const dnode_phys_t *dnode, off_t offset, void *buf, size_t buflen) +dnode_read(const spa_t *spa, const dnode_phys_t *dnode, off_t offset, void *buf, size_t buflen) { int ibshift = dnode->dn_indblkshift - SPA_BLKPTRSHIFT; int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; @@ -1141,7 +1141,7 @@ dnode_read(spa_t *spa, const dnode_phys_ * scratch buffer contains the directory contents. */ static int -mzap_lookup(spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) +mzap_lookup(const dnode_phys_t *dnode, const char *name, uint64_t *value) { const mzap_phys_t *mz; const mzap_ent_phys_t *mze; @@ -1222,7 +1222,7 @@ fzap_leaf_value(const zap_leaf_t *zl, co * buffer contains the directory header. */ static int -fzap_lookup(spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) +fzap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; zap_phys_t zh = *(zap_phys_t *) zap_scratch; @@ -1300,7 +1300,7 @@ fzap_lookup(spa_t *spa, const dnode_phys * Lookup a name in a zap object and return its value as a uint64_t. */ static int -zap_lookup(spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) +zap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) { int rc; uint64_t zap_type; @@ -1312,7 +1312,7 @@ zap_lookup(spa_t *spa, const dnode_phys_ zap_type = *(uint64_t *) zap_scratch; if (zap_type == ZBT_MICRO) - return mzap_lookup(spa, dnode, name, value); + return mzap_lookup(dnode, name, value); else if (zap_type == ZBT_HEADER) return fzap_lookup(spa, dnode, name, value); printf("ZFS: invalid zap_type=%d\n", (int)zap_type); @@ -1326,7 +1326,7 @@ zap_lookup(spa_t *spa, const dnode_phys_ * the directory contents. */ static int -mzap_list(spa_t *spa, const dnode_phys_t *dnode) +mzap_list(const dnode_phys_t *dnode) { const mzap_phys_t *mz; const mzap_ent_phys_t *mze; @@ -1356,7 +1356,7 @@ mzap_list(spa_t *spa, const dnode_phys_t * the directory header. */ static int -fzap_list(spa_t *spa, const dnode_phys_t *dnode) +fzap_list(const spa_t *spa, const dnode_phys_t *dnode) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; zap_phys_t zh = *(zap_phys_t *) zap_scratch; @@ -1395,7 +1395,7 @@ fzap_list(spa_t *spa, const dnode_phys_t namelen = zc->l_entry.le_name_length; if (namelen > sizeof(name)) namelen = sizeof(name); - + /* * Paste the name back together. */ @@ -1429,7 +1429,7 @@ fzap_list(spa_t *spa, const dnode_phys_t * List a zap directory. */ static int -zap_list(spa_t *spa, const dnode_phys_t *dnode) +zap_list(const spa_t *spa, const dnode_phys_t *dnode) { uint64_t zap_type; size_t size = dnode->dn_datablkszsec * 512; @@ -1439,7 +1439,7 @@ zap_list(spa_t *spa, const dnode_phys_t zap_type = *(uint64_t *) zap_scratch; if (zap_type == ZBT_MICRO) - return mzap_list(spa, dnode); + return mzap_list(dnode); else return fzap_list(spa, dnode); } @@ -1447,7 +1447,7 @@ zap_list(spa_t *spa, const dnode_phys_t #endif static int -objset_get_dnode(spa_t *spa, const objset_phys_t *os, uint64_t objnum, dnode_phys_t *dnode) +objset_get_dnode(const spa_t *spa, const objset_phys_t *os, uint64_t objnum, dnode_phys_t *dnode) { off_t offset; @@ -1457,7 +1457,7 @@ objset_get_dnode(spa_t *spa, const objse } static int -mzap_rlookup(spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) +mzap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) { const mzap_phys_t *mz; const mzap_ent_phys_t *mze; @@ -1510,7 +1510,7 @@ fzap_name_copy(const zap_leaf_t *zl, con } static int -fzap_rlookup(spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) +fzap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; zap_phys_t zh = *(zap_phys_t *) zap_scratch; @@ -1585,7 +1585,7 @@ fzap_rlookup(spa_t *spa, const dnode_phy } static int -zap_rlookup(spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) +zap_rlookup(const spa_t *spa, const dnode_phys_t *dnode, char *name, uint64_t value) { int rc; uint64_t zap_type; @@ -1603,7 +1603,7 @@ zap_rlookup(spa_t *spa, const dnode_phys } static int -zfs_rlookup(spa_t *spa, uint64_t objnum, char *result) +zfs_rlookup(const spa_t *spa, uint64_t objnum, char *result) { char name[256]; char component[256]; @@ -1661,7 +1661,7 @@ zfs_rlookup(spa_t *spa, uint64_t objnum, } static int -zfs_lookup_dataset(spa_t *spa, const char *name, uint64_t *objnum) +zfs_lookup_dataset(const spa_t *spa, const char *name, uint64_t *objnum) { char element[256]; uint64_t dir_obj, child_dir_zapobj; @@ -1714,7 +1714,7 @@ zfs_lookup_dataset(spa_t *spa, const cha * and return its details in *objset */ static int -zfs_mount_dataset(spa_t *spa, uint64_t objnum, objset_phys_t *objset) +zfs_mount_dataset(const spa_t *spa, uint64_t objnum, objset_phys_t *objset) { dnode_phys_t dataset; dsl_dataset_phys_t *ds; @@ -1739,7 +1739,7 @@ zfs_mount_dataset(spa_t *spa, uint64_t o * dataset if there is none and return its details in *objset */ static int -zfs_get_root(spa_t *spa, uint64_t *objid) +zfs_get_root(const spa_t *spa, uint64_t *objid) { dnode_phys_t dir, propdir; uint64_t props, bootfs, root; @@ -1784,7 +1784,7 @@ zfs_get_root(spa_t *spa, uint64_t *objid } static int -zfs_mount(spa_t *spa, uint64_t rootobj, struct zfsmount *mount) +zfs_mount(const spa_t *spa, uint64_t rootobj, struct zfsmount *mount) { mount->spa = spa; @@ -1822,7 +1822,7 @@ zfs_spa_init(spa_t *spa) } static int -zfs_dnode_stat(spa_t *spa, dnode_phys_t *dn, struct stat *sb) +zfs_dnode_stat(const spa_t *spa, dnode_phys_t *dn, struct stat *sb) { if (dn->dn_bonustype != DMU_OT_SA) { @@ -1881,7 +1881,7 @@ zfs_lookup(const struct zfsmount *mount, { int rc; uint64_t objnum, rootnum, parentnum; - spa_t *spa; + const spa_t *spa; dnode_phys_t dn; const char *p, *q; char element[256]; From owner-svn-src-head@FreeBSD.ORG Sun May 13 09:25:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31E761065672; Sun, 13 May 2012 09:25:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DD138FC19; Sun, 13 May 2012 09:25:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4D9Pdde075656; Sun, 13 May 2012 09:25:39 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4D9Pdtp075654; Sun, 13 May 2012 09:25:39 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201205130925.q4D9Pdtp075654@svn.freebsd.org> From: Andriy Gapon Date: Sun, 13 May 2012 09:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235391 - head/sys/i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 09:25:40 -0000 Author: avg Date: Sun May 13 09:25:39 2012 New Revision: 235391 URL: http://svn.freebsd.org/changeset/base/235391 Log: i386 bootinfo: re-arrange EFI fields for natural alignment and packing Suggested by: bde MFC after: 2 weeks Modified: head/sys/i386/include/bootinfo.h Modified: head/sys/i386/include/bootinfo.h ============================================================================== --- head/sys/i386/include/bootinfo.h Sun May 13 09:22:18 2012 (r235390) +++ head/sys/i386/include/bootinfo.h Sun May 13 09:25:39 2012 (r235391) @@ -65,13 +65,13 @@ struct bootinfo { u_int32_t bi_kernend; /* end of kernel space */ u_int32_t bi_envp; /* environment */ u_int32_t bi_modulep; /* preloaded modules */ + uint32_t bi_memdesc_version; /* EFI memory desc version */ + uint64_t bi_memdesc_size; /* sizeof EFI memory desc */ + uint64_t bi_memmap; /* pa of EFI memory map */ + uint64_t bi_memmap_size; /* size of EFI memory map */ uint64_t bi_hcdp; /* DIG64 HCDP table */ uint64_t bi_fpswa; /* FPSWA interface */ uint64_t bi_systab; /* pa of EFI system table */ - uint64_t bi_memmap; /* pa of EFI memory map */ - uint64_t bi_memmap_size; /* size of EFI memory map */ - uint64_t bi_memdesc_size; /* sizeof EFI memory desc */ - uint32_t bi_memdesc_version; /* EFI memory desc version */ }; #ifdef _KERNEL From owner-svn-src-head@FreeBSD.ORG Sun May 13 09:27:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B35EA106566C; Sun, 13 May 2012 09:27:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EE408FC15; Sun, 13 May 2012 09:27:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4D9R8UW075744; Sun, 13 May 2012 09:27:08 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4D9R8jf075742; Sun, 13 May 2012 09:27:08 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201205130927.q4D9R8jf075742@svn.freebsd.org> From: Andriy Gapon Date: Sun, 13 May 2012 09:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235392 - head/tools/tools/zfsboottest X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 09:27:08 -0000 Author: avg Date: Sun May 13 09:27:08 2012 New Revision: 235392 URL: http://svn.freebsd.org/changeset/base/235392 Log: zfsboottest: update for the recent zfs boot code changes MFC after: 1 month Modified: head/tools/tools/zfsboottest/zfsboottest.c Modified: head/tools/tools/zfsboottest/zfsboottest.c ============================================================================== --- head/tools/tools/zfsboottest/zfsboottest.c Sun May 13 09:25:39 2012 (r235391) +++ head/tools/tools/zfsboottest/zfsboottest.c Sun May 13 09:27:08 2012 (r235392) @@ -89,7 +89,11 @@ main(int argc, char** argv) char buf[512], hash[33]; MD5_CTX ctx; struct stat sb; + struct zfsmount zfsmnt; dnode_phys_t dn; +#if 0 + uint64_t rootobj; +#endif spa_t *spa; off_t off; ssize_t n; @@ -138,14 +142,28 @@ main(int argc, char** argv) exit(1); } - if (zfs_mount_pool(spa)) { - fprintf(stderr, "can't mount pool\n"); + if (zfs_spa_init(spa)) { + fprintf(stderr, "can't init pool\n"); exit(1); } +#if 0 + if (zfs_get_root(spa, &rootobj)) { + fprintf(stderr, "can't get root\n"); + exit(1); + } + + if (zfs_mount(spa, rootobj, &zfsmnt)) { +#else + if (zfs_mount(spa, 0, &zfsmnt)) { + fprintf(stderr, "can't mount\n"); + exit(1); + } +#endif + printf("\n"); for (++i, failures = 0; i < argc; i++) { - if (zfs_lookup(spa, argv[i], &dn)) { + if (zfs_lookup(&zfsmnt, argv[i], &dn)) { fprintf(stderr, "%s: can't lookup\n", argv[i]); failures++; continue; From owner-svn-src-head@FreeBSD.ORG Sun May 13 10:54:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60FE6106566B; Sun, 13 May 2012 10:54:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C3E88FC14; Sun, 13 May 2012 10:54:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4DAsi2F080116; Sun, 13 May 2012 10:54:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4DAsira080114; Sun, 13 May 2012 10:54:44 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201205131054.q4DAsira080114@svn.freebsd.org> From: Andriy Gapon Date: Sun, 13 May 2012 10:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235394 - head/sys/boot/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 10:54:44 -0000 Author: avg Date: Sun May 13 10:54:43 2012 New Revision: 235394 URL: http://svn.freebsd.org/changeset/base/235394 Log: zfs boot: cleanup remnants of temporary compat code MFC after: 1 month Modified: head/sys/boot/zfs/zfs.c Modified: head/sys/boot/zfs/zfs.c ============================================================================== --- head/sys/boot/zfs/zfs.c Sun May 13 10:31:08 2012 (r235393) +++ head/sys/boot/zfs/zfs.c Sun May 13 10:54:43 2012 (r235394) @@ -56,7 +56,6 @@ static int zfs_stat(struct open_file *f, static int zfs_readdir(struct open_file *f, struct dirent *d); struct devsw zfs_dev; -struct devsw zfs_dev_compat; struct fs_ops zfs_fsops = { "zfs", @@ -90,7 +89,7 @@ zfs_open(const char *upath, struct open_ struct file *fp; int rc; - if (f->f_dev != &zfs_dev && f->f_dev != &zfs_dev_compat) + if (f->f_dev != &zfs_dev) return (EINVAL); /* allocate file system specific data structure */ From owner-svn-src-head@FreeBSD.ORG Sun May 13 11:34:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 545E4106566C; Sun, 13 May 2012 11:34:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F9868FC0C; Sun, 13 May 2012 11:34:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4DBY6Z3081409; Sun, 13 May 2012 11:34:06 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4DBY6YO081407; Sun, 13 May 2012 11:34:06 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201205131134.q4DBY6YO081407@svn.freebsd.org> From: Andriy Gapon Date: Sun, 13 May 2012 11:34:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235395 - head/sys/boot/pc98/libpc98 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 11:34:06 -0000 Author: avg Date: Sun May 13 11:34:05 2012 New Revision: 235395 URL: http://svn.freebsd.org/changeset/base/235395 Log: libpc98: unbreak after zfs-related changes in libi386 code Pointyhat to: avg MFC after: 1 month Modified: head/sys/boot/pc98/libpc98/Makefile Modified: head/sys/boot/pc98/libpc98/Makefile ============================================================================== --- head/sys/boot/pc98/libpc98/Makefile Sun May 13 10:54:43 2012 (r235394) +++ head/sys/boot/pc98/libpc98/Makefile Sun May 13 11:34:05 2012 (r235395) @@ -10,6 +10,8 @@ SRCS= bioscd.c biosdisk.c biosmem.c bios comconsole.c devicename.c elf32_freebsd.c \ i386_copy.c i386_module.c nullconsole.c pc98_sys.c pxe.c pxetramp.s \ time.c vidconsole.c +.PATH: ${.CURDIR}/../../zfs +SRCS+= devicename_stubs.c # Enable PXE TFTP or NFS support, not both. .if defined(LOADER_TFTP_SUPPORT) From owner-svn-src-head@FreeBSD.ORG Sun May 13 14:16:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 04EC5106566C; Sun, 13 May 2012 14:16:05 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D948B8FC14; Sun, 13 May 2012 14:16:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4DEG4Kl086641; Sun, 13 May 2012 14:16:04 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4DEG4Sc086632; Sun, 13 May 2012 14:16:04 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201205131416.q4DEG4Sc086632@svn.freebsd.org> From: Joel Dahl Date: Sun, 13 May 2012 14:16:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235400 - in head: bin/expr bin/sh bin/test lib/libc/posix1e sbin/setkey usr.bin/dc usr.bin/make usr.bin/mklocale X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 14:16:05 -0000 Author: joel (doc committer) Date: Sun May 13 14:16:04 2012 New Revision: 235400 URL: http://svn.freebsd.org/changeset/base/235400 Log: Minor mdoc nits. Modified: head/bin/expr/expr.1 head/bin/sh/sh.1 head/bin/test/test.1 head/lib/libc/posix1e/mac_prepare.3 head/sbin/setkey/setkey.8 head/usr.bin/dc/dc.1 head/usr.bin/make/make.1 head/usr.bin/mklocale/mklocale.1 Modified: head/bin/expr/expr.1 ============================================================================== --- head/bin/expr/expr.1 Sun May 13 14:02:40 2012 (r235399) +++ head/bin/expr/expr.1 Sun May 13 14:16:04 2012 (r235400) @@ -77,7 +77,7 @@ Operators with equal precedence are grou and .Ql } . .Bl -tag -width indent -.It Ar expr1 Li | Ar expr2 +.It Ar expr1 Li \&| Ar expr2 Return the evaluation of .Ar expr1 if it is neither an empty string nor zero; Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sun May 13 14:02:40 2012 (r235399) +++ head/bin/sh/sh.1 Sun May 13 14:16:04 2012 (r235400) @@ -375,8 +375,8 @@ The following is a list of valid operato .Bl -tag -width indent .It Control operators: .Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact -.It Li & Ta Li && Ta Li ( Ta Li ) Ta Li \en -.It Li ;; Ta Li ;& Ta Li ; Ta Li | Ta Li || +.It Li & Ta Li && Ta Li \&( Ta Li \&) Ta Li \en +.It Li ;; Ta Li ;& Ta Li \&; Ta Li \&| Ta Li || .El .It Redirection operators: .Bl -column "XXX" "XXX" "XXX" "XXX" "XXX" -offset center -compact Modified: head/bin/test/test.1 ============================================================================== --- head/bin/test/test.1 Sun May 13 14:02:40 2012 (r235399) +++ head/bin/test/test.1 Sun May 13 14:16:04 2012 (r235400) @@ -43,7 +43,7 @@ .Nm .Ar expression .Nm \&[ -.Ar expression Cm ] +.Ar expression Cm \&] .Sh DESCRIPTION The .Nm Modified: head/lib/libc/posix1e/mac_prepare.3 ============================================================================== --- head/lib/libc/posix1e/mac_prepare.3 Sun May 13 14:02:40 2012 (r235399) +++ head/lib/libc/posix1e/mac_prepare.3 Sun May 13 14:16:04 2012 (r235400) @@ -64,7 +64,7 @@ when the label was prepared. Elements are specified in a nul-terminated string, using commas to delimit fields. Element names may be prefixed with the -.Dv ? +.Ql \&? character to indicate that a failure by the kernel to retrieve that element should not be considered fatal. .Pp Modified: head/sbin/setkey/setkey.8 ============================================================================== --- head/sbin/setkey/setkey.8 Sun May 13 14:02:40 2012 (r235399) +++ head/sbin/setkey/setkey.8 Sun May 13 14:16:04 2012 (r235400) @@ -130,7 +130,7 @@ are treated as comment lines. .Ar src Ar dst Ar protocol Ar spi .Op Ar extensions .Ar algorithm ... -.Li ; +.Li \&; .Xc Add an SAD entry. .Li add @@ -141,7 +141,7 @@ including when the key length does not m .Li get .Op Fl 46n .Ar src Ar dst Ar protocol Ar spi -.Li ; +.Li \&; .Xc Show an SAD entry. .\" @@ -149,7 +149,7 @@ Show an SAD entry. .Li delete .Op Fl 46n .Ar src Ar dst Ar protocol Ar spi -.Li ; +.Li \&; .Xc Remove an SAD entry. .\" @@ -157,14 +157,14 @@ Remove an SAD entry. .Li deleteall .Op Fl 46n .Ar src Ar dst Ar protocol -.Li ; +.Li \&; .Xc Remove all SAD entries that match the specification. .\" .It Xo .Li flush .Op Ar protocol -.Li ; +.Li \&; .Xc Clear all SAD entries matched by the options. .Fl F @@ -173,7 +173,7 @@ on the command line achieves the same fu .It Xo .Li dump .Op Ar protocol -.Li ; +.Li \&; .Xc Dumps all SAD entries matched by the options. .Fl D @@ -183,7 +183,7 @@ on the command line achieves the same fu .Li spdadd .Op Fl 46n .Ar src_range Ar dst_range Ar upperspec Ar policy -.Li ; +.Li \&; .Xc Add an SPD entry. .\" @@ -191,13 +191,13 @@ Add an SPD entry. .Li spddelete .Op Fl 46n .Ar src_range Ar dst_range Ar upperspec Fl P Ar direction -.Li ; +.Li \&; .Xc Delete an SPD entry. .\" .It Xo .Li spdflush -.Li ; +.Li \&; .Xc Clear all SPD entries. .Fl FP @@ -205,7 +205,7 @@ on the command line achieves the same fu .\" .It Xo .Li spddump -.Li ; +.Li \&; .Xc Dumps all SPD entries. .Fl DP Modified: head/usr.bin/dc/dc.1 ============================================================================== --- head/usr.bin/dc/dc.1 Sun May 13 14:02:40 2012 (r235399) +++ head/usr.bin/dc/dc.1 Sun May 13 14:16:04 2012 (r235400) @@ -315,7 +315,7 @@ The length of a number is its number of and decimal point. .It Ic z The stack level is pushed onto the stack. -.It Cm [ Ns ... Ns Cm ] +.It Cm \&[ Ns ... Ns Cm \&] Puts the bracketed .Tn ASCII string onto the top of the stack. @@ -375,12 +375,12 @@ command. .It Ic \&? A line of input is taken from the input source (usually the terminal) and executed. -.It Ic : Ns Ar r +.It Ic \&: Ns Ar r Pop two values from the stack. The second value on the stack is stored into the array .Ar r indexed by the top of stack. -.It Ic ; Ns Ar r +.It Ic \&; Ns Ar r Pop a value from the stack. The value is used as an index into register .Ar r . Modified: head/usr.bin/make/make.1 ============================================================================== --- head/usr.bin/make/make.1 Sun May 13 14:02:40 2012 (r235399) +++ head/usr.bin/make/make.1 Sun May 13 14:16:04 2012 (r235400) @@ -1661,7 +1661,7 @@ To prevent infinite loops the following .Ic :: targets that have no prerequisites .It -.Ic ! +.Ic \&! targets .It targets that have Modified: head/usr.bin/mklocale/mklocale.1 ============================================================================== --- head/usr.bin/mklocale/mklocale.1 Sun May 13 14:02:40 2012 (r235399) +++ head/usr.bin/mklocale/mklocale.1 Sun May 13 14:16:04 2012 (r235400) @@ -123,7 +123,7 @@ All are equivalent. .It Dv ">\|\^)\|]" Used to end a mapping. All are equivalent. -.It Dv : +.It Dv ":" Used as a delimiter in mappings. .El .El From owner-svn-src-head@FreeBSD.ORG Sun May 13 14:28:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 327F0106566C; Sun, 13 May 2012 14:28:02 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92C258FC15; Sun, 13 May 2012 14:28:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4DES1Cm087033; Sun, 13 May 2012 14:28:01 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4DES1MX087031; Sun, 13 May 2012 14:28:01 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201205131428.q4DES1MX087031@svn.freebsd.org> From: Joel Dahl Date: Sun, 13 May 2012 14:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235401 - head/lib/libc/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 14:28:02 -0000 Author: joel (doc committer) Date: Sun May 13 14:28:00 2012 New Revision: 235401 URL: http://svn.freebsd.org/changeset/base/235401 Log: mdoc: avoid unterminated quoted strings. Modified: head/lib/libc/net/nsdispatch.3 Modified: head/lib/libc/net/nsdispatch.3 ============================================================================== --- head/lib/libc/net/nsdispatch.3 Sun May 13 14:16:04 2012 (r235400) +++ head/lib/libc/net/nsdispatch.3 Sun May 13 14:28:00 2012 (r235401) @@ -173,11 +173,11 @@ While there is support for arbitrary sou #defines for commonly implemented sources are available: .Bl -column NSSRC_COMPAT compat -offset indent .It Sy "#define value" -.It Dv NSSRC_FILES Ta """files"" -.It Dv NSSRC_DB Ta """db"" -.It Dv NSSRC_DNS Ta """dns"" -.It Dv NSSRC_NIS Ta """nis"" -.It Dv NSSRC_COMPAT Ta """compat"" +.It Dv NSSRC_FILES Ta \&"files\&" +.It Dv NSSRC_DB Ta \&"db\&" +.It Dv NSSRC_DNS Ta \&"dns\&" +.It Dv NSSRC_NIS Ta \&"nis\&" +.It Dv NSSRC_COMPAT Ta \&"compat\&" .El .Pp Refer to From owner-svn-src-head@FreeBSD.ORG Sun May 13 16:07:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D3E3106566B; Sun, 13 May 2012 16:07:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 476848FC0A; Sun, 13 May 2012 16:07:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4DG7sU9090183; Sun, 13 May 2012 16:07:54 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4DG7sRo090181; Sun, 13 May 2012 16:07:54 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205131607.q4DG7sRo090181@svn.freebsd.org> From: Michael Tuexen Date: Sun, 13 May 2012 16:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235402 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 16:07:54 -0000 Author: tuexen Date: Sun May 13 16:07:53 2012 New Revision: 235402 URL: http://svn.freebsd.org/changeset/base/235402 Log: Ensure the user can read COMM_LOST notifications on 1-to-1 style sockets. MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun May 13 14:28:00 2012 (r235401) +++ head/sys/netinet/sctputil.c Sun May 13 16:07:53 2012 (r235402) @@ -2609,10 +2609,82 @@ sctp_notify_assoc_change(uint16_t state, #endif + if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT)) { + notif_len = sizeof(struct sctp_assoc_change); + if (abort != NULL) { + abort_len = htons(abort->ch.chunk_length); + } else { + abort_len = 0; + } + if ((state == SCTP_COMM_UP) || (state == SCTP_RESTART)) { + notif_len += SCTP_ASSOC_SUPPORTS_MAX; + } else if ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC)) { + notif_len += abort_len; + } + m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); + if (m_notify == NULL) { + /* Retry with smaller value. */ + notif_len = sizeof(struct sctp_assoc_change); + m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); + if (m_notify == NULL) { + goto set_error; + } + } + SCTP_BUF_NEXT(m_notify) = NULL; + sac = mtod(m_notify, struct sctp_assoc_change *); + sac->sac_type = SCTP_ASSOC_CHANGE; + sac->sac_flags = 0; + sac->sac_length = sizeof(struct sctp_assoc_change); + sac->sac_state = state; + sac->sac_error = error; + /* XXX verify these stream counts */ + sac->sac_outbound_streams = stcb->asoc.streamoutcnt; + sac->sac_inbound_streams = stcb->asoc.streamincnt; + sac->sac_assoc_id = sctp_get_associd(stcb); + if (notif_len > sizeof(struct sctp_assoc_change)) { + if ((state == SCTP_COMM_UP) || (state == SCTP_RESTART)) { + i = 0; + if (stcb->asoc.peer_supports_prsctp) { + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_PR; + } + if (stcb->asoc.peer_supports_auth) { + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_AUTH; + } + if (stcb->asoc.peer_supports_asconf) { + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_ASCONF; + } + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_MULTIBUF; + if (stcb->asoc.peer_supports_strreset) { + sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_RE_CONFIG; + } + sac->sac_length += i; + } else if ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC)) { + memcpy(sac->sac_info, abort, abort_len); + sac->sac_length += abort_len; + } + } + SCTP_BUF_LEN(m_notify) = sac->sac_length; + control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination, + 0, 0, stcb->asoc.context, 0, 0, 0, + m_notify); + if (control != NULL) { + control->length = SCTP_BUF_LEN(m_notify); + /* not that we need this */ + control->tail_mbuf = m_notify; + control->spec_flags = M_NOTIFICATION; + sctp_add_to_readq(stcb->sctp_ep, stcb, + control, + &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, + so_locked); + } else { + sctp_m_freem(m_notify); + } + } /* - * For TCP model AND UDP connected sockets we will send an error up - * when an ABORT comes in. + * For 1-to-1 style sockets, we send up and error when an ABORT + * comes in. */ +set_error: if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) { @@ -2623,127 +2695,34 @@ sctp_notify_assoc_change(uint16_t state, SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNRESET); stcb->sctp_socket->so_error = ECONNRESET; } - /* Wake ANY sleepers */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(stcb->sctp_ep); - if (!so_locked) { - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { - SCTP_SOCKET_UNLOCK(so, 1); - return; - } - } -#endif - socantrcvmore(stcb->sctp_socket); - sorwakeup(stcb->sctp_socket); - sowwakeup(stcb->sctp_socket); + } + /* Wake ANY sleepers */ #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - if (!so_locked) { + so = SCTP_INP_SO(stcb->sctp_ep); + if (!so_locked) { + atomic_add_int(&stcb->asoc.refcnt, 1); + SCTP_TCB_UNLOCK(stcb); + SCTP_SOCKET_LOCK(so, 1); + SCTP_TCB_LOCK(stcb); + atomic_subtract_int(&stcb->asoc.refcnt, 1); + if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { SCTP_SOCKET_UNLOCK(so, 1); - } -#endif - } - if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT)) { - /* event not enabled */ - return; - } - notif_len = sizeof(struct sctp_assoc_change); - if (abort != NULL) { - abort_len = htons(abort->ch.chunk_length); - } else { - abort_len = 0; - } - if ((state == SCTP_COMM_UP) || (state == SCTP_RESTART)) { - notif_len += SCTP_ASSOC_SUPPORTS_MAX; - } else if ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC)) { - notif_len += abort_len; - } - m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); - if (m_notify == NULL) { - /* Retry with smaller value. */ - notif_len = sizeof(struct sctp_assoc_change); - m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); - if (m_notify == NULL) { return; } } - SCTP_BUF_NEXT(m_notify) = NULL; - sac = mtod(m_notify, struct sctp_assoc_change *); - sac->sac_type = SCTP_ASSOC_CHANGE; - sac->sac_flags = 0; - sac->sac_length = sizeof(struct sctp_assoc_change); - sac->sac_state = state; - sac->sac_error = error; - /* XXX verify these stream counts */ - sac->sac_outbound_streams = stcb->asoc.streamoutcnt; - sac->sac_inbound_streams = stcb->asoc.streamincnt; - sac->sac_assoc_id = sctp_get_associd(stcb); - if (notif_len > sizeof(struct sctp_assoc_change)) { - if ((state == SCTP_COMM_UP) || (state == SCTP_RESTART)) { - i = 0; - if (stcb->asoc.peer_supports_prsctp) { - sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_PR; - } - if (stcb->asoc.peer_supports_auth) { - sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_AUTH; - } - if (stcb->asoc.peer_supports_asconf) { - sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_ASCONF; - } - sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_MULTIBUF; - if (stcb->asoc.peer_supports_strreset) { - sac->sac_info[i++] = SCTP_ASSOC_SUPPORTS_RE_CONFIG; - } - sac->sac_length += i; - } else if ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC)) { - memcpy(sac->sac_info, abort, abort_len); - sac->sac_length += abort_len; - } - } - SCTP_BUF_LEN(m_notify) = sac->sac_length; - control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination, - 0, 0, stcb->asoc.context, 0, 0, 0, - m_notify); - if (control == NULL) { - /* no memory */ - sctp_m_freem(m_notify); - return; - } - control->length = SCTP_BUF_LEN(m_notify); - /* not that we need this */ - control->tail_mbuf = m_notify; - control->spec_flags = M_NOTIFICATION; - sctp_add_to_readq(stcb->sctp_ep, stcb, - control, - &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, - so_locked); - if (state == SCTP_COMM_LOST) { - /* Wake up any sleeper */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(stcb->sctp_ep); - if (!so_locked) { - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - if (stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) { - SCTP_SOCKET_UNLOCK(so, 1); - return; - } - } #endif - sctp_sowwakeup(stcb->sctp_ep, stcb->sctp_socket); + if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && + ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) { + socantrcvmore(stcb->sctp_socket); + } + sorwakeup(stcb->sctp_socket); + sowwakeup(stcb->sctp_socket); #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - if (!so_locked) { - SCTP_SOCKET_UNLOCK(so, 1); - } -#endif + if (!so_locked) { + SCTP_SOCKET_UNLOCK(so, 1); } +#endif } static void @@ -5220,7 +5199,7 @@ restart_nosblocks: (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE)) { goto out; } - if (so->so_rcv.sb_state & SBS_CANTRCVMORE) { + if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && (so->so_rcv.sb_cc == 0)) { if (so->so_error) { error = so->so_error; if ((in_flags & MSG_PEEK) == 0) @@ -5228,7 +5207,6 @@ restart_nosblocks: goto out; } else { if (so->so_rcv.sb_cc == 0) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, ENOTCONN); /* indicate EOF */ error = 0; goto out; From owner-svn-src-head@FreeBSD.ORG Sun May 13 16:56:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3385106564A; Sun, 13 May 2012 16:56:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD3418FC1B; Sun, 13 May 2012 16:56:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4DGuGUJ091746; Sun, 13 May 2012 16:56:16 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4DGuGJU091739; Sun, 13 May 2012 16:56:16 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205131656.q4DGuGJU091739@svn.freebsd.org> From: Michael Tuexen Date: Sun, 13 May 2012 16:56:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235403 - in head/sys: netinet netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 16:56:17 -0000 Author: tuexen Date: Sun May 13 16:56:16 2012 New Revision: 235403 URL: http://svn.freebsd.org/changeset/base/235403 Log: Use ECONNABORTED in cases where the ABORT was sent to the peer. MFC after: 3 days Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Sun May 13 16:07:53 2012 (r235402) +++ head/sys/netinet/sctp_constants.h Sun May 13 16:56:16 2012 (r235403) @@ -757,7 +757,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_NOTIFY_INTERFACE_UP 4 #define SCTP_NOTIFY_DG_FAIL 5 #define SCTP_NOTIFY_STRDATA_ERR 6 -#define SCTP_NOTIFY_ASSOC_ABORTED 7 +#define SCTP_NOTIFY_ASSOC_LOC_ABORTED 7 #define SCTP_NOTIFY_PEER_OPENED_STREAM 8 #define SCTP_NOTIFY_STREAM_OPENED_OK 9 #define SCTP_NOTIFY_ASSOC_RESTART 10 @@ -781,7 +781,8 @@ __FBSDID("$FreeBSD$"); #define SCTP_NOTIFY_SENDER_DRY 29 #define SCTP_NOTIFY_STR_RESET_DENIED_OUT 30 #define SCTP_NOTIFY_STR_RESET_DENIED_IN 31 -#define SCTP_NOTIFY_MAX 31 +#define SCTP_NOTIFY_ASSOC_REM_ABORTED 32 +#define SCTP_NOTIFY_MAX 32 /* This is the value for messages that are NOT completely Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun May 13 16:07:53 2012 (r235402) +++ head/sys/netinet/sctp_input.c Sun May 13 16:56:16 2012 (r235403) @@ -782,7 +782,7 @@ sctp_handle_abort(struct sctp_abort_chun /* stop any receive timers */ sctp_timer_stop(SCTP_TIMER_TYPE_RECV, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_6); /* notify user of the abort and clean up... */ - sctp_abort_notification(stcb, error, abort, SCTP_SO_NOT_LOCKED); + sctp_abort_notification(stcb, 1, error, abort, SCTP_SO_NOT_LOCKED); /* free the tcb */ SCTP_STAT_INCR_COUNTER32(sctps_aborted); if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) || @@ -1173,7 +1173,7 @@ sctp_handle_error(struct sctp_chunkhdr * asoc->stale_cookie_count++; if (asoc->stale_cookie_count > asoc->max_init_times) { - sctp_abort_notification(stcb, 0, NULL, SCTP_SO_NOT_LOCKED); + sctp_abort_notification(stcb, 0, 0, NULL, SCTP_SO_NOT_LOCKED); /* now free the asoc */ #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun May 13 16:07:53 2012 (r235402) +++ head/sys/netinet/sctp_usrreq.c Sun May 13 16:56:16 2012 (r235403) @@ -283,7 +283,7 @@ sctp_notify(struct sctp_inpcb *inp, * now is dead. In either case treat it like a OOTB abort * with no TCB */ - sctp_abort_notification(stcb, 0, NULL, SCTP_SO_NOT_LOCKED); + sctp_abort_notification(stcb, 1, 0, NULL, SCTP_SO_NOT_LOCKED); #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun May 13 16:07:53 2012 (r235402) +++ head/sys/netinet/sctputil.c Sun May 13 16:56:16 2012 (r235403) @@ -2592,7 +2592,7 @@ sctp_pad_lastmbuf(struct mbuf *m, int pa static void sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb, - uint16_t error, struct sctp_abort_chunk *abort, int so_locked + uint16_t error, struct sctp_abort_chunk *abort, uint8_t from_peer, int so_locked #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED #endif @@ -2688,12 +2688,17 @@ set_error: if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) { - if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) { - SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNREFUSED); - stcb->sctp_socket->so_error = ECONNREFUSED; + if (from_peer) { + if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) { + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNREFUSED); + stcb->sctp_socket->so_error = ECONNREFUSED; + } else { + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNRESET); + stcb->sctp_socket->so_error = ECONNRESET; + } } else { - SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNRESET); - stcb->sctp_socket->so_error = ECONNRESET; + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNABORTED); + stcb->sctp_socket->so_error = ECONNABORTED; } } /* Wake ANY sleepers */ @@ -3493,7 +3498,7 @@ sctp_ulp_notify(uint32_t notification, s switch (notification) { case SCTP_NOTIFY_ASSOC_UP: if (stcb->asoc.assoc_up_sent == 0) { - sctp_notify_assoc_change(SCTP_COMM_UP, stcb, error, NULL, so_locked); + sctp_notify_assoc_change(SCTP_COMM_UP, stcb, error, NULL, 0, so_locked); stcb->asoc.assoc_up_sent = 1; } if (stcb->asoc.adaptation_needed && (stcb->asoc.adaptation_sent == 0)) { @@ -3505,7 +3510,7 @@ sctp_ulp_notify(uint32_t notification, s } break; case SCTP_NOTIFY_ASSOC_DOWN: - sctp_notify_assoc_change(SCTP_SHUTDOWN_COMP, stcb, error, NULL, so_locked); + sctp_notify_assoc_change(SCTP_SHUTDOWN_COMP, stcb, error, NULL, 0, so_locked); break; case SCTP_NOTIFY_INTERFACE_DOWN: { @@ -3553,12 +3558,20 @@ sctp_ulp_notify(uint32_t notification, s } case SCTP_NOTIFY_STRDATA_ERR: break; - case SCTP_NOTIFY_ASSOC_ABORTED: + case SCTP_NOTIFY_ASSOC_LOC_ABORTED: if ((stcb) && (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED))) { - sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, so_locked); + sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, 0, so_locked); } else { - sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, so_locked); + sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, 0, so_locked); + } + break; + case SCTP_NOTIFY_ASSOC_REM_ABORTED: + if ((stcb) && (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || + ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED))) { + sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, 1, so_locked); + } else { + sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, 1, so_locked); } break; case SCTP_NOTIFY_PEER_OPENED_STREAM: @@ -3566,7 +3579,7 @@ sctp_ulp_notify(uint32_t notification, s case SCTP_NOTIFY_STREAM_OPENED_OK: break; case SCTP_NOTIFY_ASSOC_RESTART: - sctp_notify_assoc_change(SCTP_RESTART, stcb, error, NULL, so_locked); + sctp_notify_assoc_change(SCTP_RESTART, stcb, error, NULL, 0, so_locked); if (stcb->asoc.peer_supports_auth == 0) { sctp_ulp_notify(SCTP_NOTIFY_NO_PEER_AUTH, stcb, 0, NULL, so_locked); @@ -3735,7 +3748,7 @@ sctp_report_all_outbound(struct sctp_tcb } void -sctp_abort_notification(struct sctp_tcb *stcb, uint16_t error, +sctp_abort_notification(struct sctp_tcb *stcb, uint8_t from_peer, uint16_t error, struct sctp_abort_chunk *abort, int so_locked #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED @@ -3757,7 +3770,11 @@ sctp_abort_notification(struct sctp_tcb } /* Tell them we lost the asoc */ sctp_report_all_outbound(stcb, 1, so_locked); - sctp_ulp_notify(SCTP_NOTIFY_ASSOC_ABORTED, stcb, error, abort, so_locked); + if (from_peer) { + sctp_ulp_notify(SCTP_NOTIFY_ASSOC_REM_ABORTED, stcb, error, abort, so_locked); + } else { + sctp_ulp_notify(SCTP_NOTIFY_ASSOC_LOC_ABORTED, stcb, error, abort, so_locked); + } } void @@ -3776,7 +3793,7 @@ sctp_abort_association(struct sctp_inpcb if (stcb != NULL) { /* We have a TCB to abort, send notification too */ vtag = stcb->asoc.peer_vtag; - sctp_abort_notification(stcb, 0, NULL, SCTP_SO_NOT_LOCKED); + sctp_abort_notification(stcb, 0, 0, NULL, SCTP_SO_NOT_LOCKED); /* get the assoc vrf id and table id */ vrf_id = stcb->asoc.vrf_id; stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; @@ -3899,7 +3916,7 @@ sctp_abort_an_association(struct sctp_in } /* notify the ulp */ if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) { - sctp_abort_notification(stcb, 0, NULL, so_locked); + sctp_abort_notification(stcb, 0, 0, NULL, so_locked); } /* notify the peer */ sctp_send_abort_tcb(stcb, op_err, so_locked); Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Sun May 13 16:07:53 2012 (r235402) +++ head/sys/netinet/sctputil.h Sun May 13 16:56:16 2012 (r235403) @@ -179,7 +179,7 @@ sctp_report_all_outbound(struct sctp_tcb int sctp_expand_mapping_array(struct sctp_association *, uint32_t); void -sctp_abort_notification(struct sctp_tcb *, uint16_t, +sctp_abort_notification(struct sctp_tcb *, uint8_t, uint16_t, struct sctp_abort_chunk *, int #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Sun May 13 16:07:53 2012 (r235402) +++ head/sys/netinet6/sctp6_usrreq.c Sun May 13 16:56:16 2012 (r235403) @@ -439,7 +439,7 @@ sctp6_notify(struct sctp_inpcb *inp, * now is dead. In either case treat it like a OOTB abort * with no TCB */ - sctp_abort_notification(stcb, 0, NULL, SCTP_SO_NOT_LOCKED); + sctp_abort_notification(stcb, 1, 0, NULL, SCTP_SO_NOT_LOCKED); #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); From owner-svn-src-head@FreeBSD.ORG Sun May 13 17:17:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C518106566B; Sun, 13 May 2012 17:17:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B2FC8FC12; Sun, 13 May 2012 17:17:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4DHHE1U092960; Sun, 13 May 2012 17:17:14 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4DHHEkW092957; Sun, 13 May 2012 17:17:14 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205131717.q4DHHEkW092957@svn.freebsd.org> From: Michael Tuexen Date: Sun, 13 May 2012 17:17:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235412 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 17:17:14 -0000 Author: tuexen Date: Sun May 13 17:17:13 2012 New Revision: 235412 URL: http://svn.freebsd.org/changeset/base/235412 Log: Remove unused constants. MFC after: 3 days Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Sun May 13 17:15:30 2012 (r235411) +++ head/sys/netinet/sctp_constants.h Sun May 13 17:17:13 2012 (r235412) @@ -756,34 +756,26 @@ __FBSDID("$FreeBSD$"); #define SCTP_NOTIFY_INTERFACE_DOWN 3 #define SCTP_NOTIFY_INTERFACE_UP 4 #define SCTP_NOTIFY_DG_FAIL 5 -#define SCTP_NOTIFY_STRDATA_ERR 6 +#define SCTP_NOTIFY_SPECIAL_SP_FAIL 6 #define SCTP_NOTIFY_ASSOC_LOC_ABORTED 7 -#define SCTP_NOTIFY_PEER_OPENED_STREAM 8 -#define SCTP_NOTIFY_STREAM_OPENED_OK 9 -#define SCTP_NOTIFY_ASSOC_RESTART 10 -#define SCTP_NOTIFY_HB_RESP 11 -#define SCTP_NOTIFY_ASCONF_SUCCESS 12 -#define SCTP_NOTIFY_ASCONF_FAILED 13 -#define SCTP_NOTIFY_PEER_SHUTDOWN 14 -#define SCTP_NOTIFY_ASCONF_ADD_IP 15 -#define SCTP_NOTIFY_ASCONF_DELETE_IP 16 -#define SCTP_NOTIFY_ASCONF_SET_PRIMARY 17 -#define SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION 18 -#define SCTP_NOTIFY_INTERFACE_CONFIRMED 20 -#define SCTP_NOTIFY_STR_RESET_RECV 21 -#define SCTP_NOTIFY_STR_RESET_SEND 22 -#define SCTP_NOTIFY_STR_RESET_FAILED_OUT 23 -#define SCTP_NOTIFY_STR_RESET_FAILED_IN 24 -#define SCTP_NOTIFY_AUTH_NEW_KEY 25 -#define SCTP_NOTIFY_AUTH_FREE_KEY 26 -#define SCTP_NOTIFY_SPECIAL_SP_FAIL 27 -#define SCTP_NOTIFY_NO_PEER_AUTH 28 -#define SCTP_NOTIFY_SENDER_DRY 29 -#define SCTP_NOTIFY_STR_RESET_DENIED_OUT 30 -#define SCTP_NOTIFY_STR_RESET_DENIED_IN 31 -#define SCTP_NOTIFY_ASSOC_REM_ABORTED 32 -#define SCTP_NOTIFY_MAX 32 - +#define SCTP_NOTIFY_ASSOC_REM_ABORTED 8 +#define SCTP_NOTIFY_ASSOC_RESTART 9 +#define SCTP_NOTIFY_PEER_SHUTDOWN 10 +#define SCTP_NOTIFY_ASCONF_ADD_IP 11 +#define SCTP_NOTIFY_ASCONF_DELETE_IP 12 +#define SCTP_NOTIFY_ASCONF_SET_PRIMARY 13 +#define SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION 14 +#define SCTP_NOTIFY_INTERFACE_CONFIRMED 15 +#define SCTP_NOTIFY_STR_RESET_RECV 16 +#define SCTP_NOTIFY_STR_RESET_SEND 17 +#define SCTP_NOTIFY_STR_RESET_FAILED_OUT 18 +#define SCTP_NOTIFY_STR_RESET_FAILED_IN 19 +#define SCTP_NOTIFY_STR_RESET_DENIED_OUT 20 +#define SCTP_NOTIFY_STR_RESET_DENIED_IN 21 +#define SCTP_NOTIFY_AUTH_NEW_KEY 22 +#define SCTP_NOTIFY_AUTH_FREE_KEY 23 +#define SCTP_NOTIFY_NO_PEER_AUTH 24 +#define SCTP_NOTIFY_SENDER_DRY 25 /* This is the value for messages that are NOT completely * copied down where we will start to split the message. Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun May 13 17:15:30 2012 (r235411) +++ head/sys/netinet/sctputil.c Sun May 13 17:17:13 2012 (r235412) @@ -3556,8 +3556,6 @@ sctp_ulp_notify(uint32_t notification, s sctp_notify_partial_delivery_indication(stcb, error, val, so_locked); break; } - case SCTP_NOTIFY_STRDATA_ERR: - break; case SCTP_NOTIFY_ASSOC_LOC_ABORTED: if ((stcb) && (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED))) { @@ -3574,10 +3572,6 @@ sctp_ulp_notify(uint32_t notification, s sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, 1, so_locked); } break; - case SCTP_NOTIFY_PEER_OPENED_STREAM: - break; - case SCTP_NOTIFY_STREAM_OPENED_OK: - break; case SCTP_NOTIFY_ASSOC_RESTART: sctp_notify_assoc_change(SCTP_RESTART, stcb, error, NULL, 0, so_locked); if (stcb->asoc.peer_supports_auth == 0) { @@ -3585,8 +3579,6 @@ sctp_ulp_notify(uint32_t notification, s NULL, so_locked); } break; - case SCTP_NOTIFY_HB_RESP: - break; case SCTP_NOTIFY_STR_RESET_SEND: sctp_notify_stream_reset(stcb, error, ((uint16_t *) data), SCTP_STREAM_RESET_OUTGOING_SSN); break; @@ -3621,10 +3613,6 @@ sctp_ulp_notify(uint32_t notification, s sctp_notify_peer_addr_change(stcb, SCTP_ADDR_MADE_PRIM, data, error); break; - case SCTP_NOTIFY_ASCONF_SUCCESS: - break; - case SCTP_NOTIFY_ASCONF_FAILED: - break; case SCTP_NOTIFY_PEER_SHUTDOWN: sctp_notify_shutdown_event(stcb); break; From owner-svn-src-head@FreeBSD.ORG Sun May 13 17:36:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD3A41065708; Sun, 13 May 2012 17:36:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 982FA8FC14; Sun, 13 May 2012 17:36:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4DHa5uj093674; Sun, 13 May 2012 17:36:05 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4DHa5Yw093668; Sun, 13 May 2012 17:36:05 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205131736.q4DHa5Yw093668@svn.freebsd.org> From: Michael Tuexen Date: Sun, 13 May 2012 17:36:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235414 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 17:36:05 -0000 Author: tuexen Date: Sun May 13 17:36:04 2012 New Revision: 235414 URL: http://svn.freebsd.org/changeset/base/235414 Log: Provide the error code in SCTP_PEER_ADDR_CHANGE notifications as specified in RFC 6458. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun May 13 17:32:12 2012 (r235413) +++ head/sys/netinet/sctp_indata.c Sun May 13 17:36:04 2012 (r235414) @@ -4024,7 +4024,7 @@ sctp_express_handle_sack(struct sctp_tcb /* addr came good */ net->dest_state |= SCTP_ADDR_REACHABLE; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, - SCTP_RECEIVED_SACK, (void *)net, SCTP_SO_NOT_LOCKED); + 0, (void *)net, SCTP_SO_NOT_LOCKED); } if (net == stcb->asoc.primary_destination) { if (stcb->asoc.alternate) { @@ -4831,7 +4831,7 @@ sctp_handle_sack(struct mbuf *m, int off /* addr came good */ net->dest_state |= SCTP_ADDR_REACHABLE; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, - SCTP_RECEIVED_SACK, (void *)net, SCTP_SO_NOT_LOCKED); + 0, (void *)net, SCTP_SO_NOT_LOCKED); } if (net == stcb->asoc.primary_destination) { if (stcb->asoc.alternate) { Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun May 13 17:32:12 2012 (r235413) +++ head/sys/netinet/sctp_input.c Sun May 13 17:36:04 2012 (r235414) @@ -632,7 +632,7 @@ sctp_handle_heartbeat_ack(struct sctp_he if (!(r_net->dest_state & SCTP_ADDR_REACHABLE)) { r_net->dest_state |= SCTP_ADDR_REACHABLE; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, - SCTP_HEARTBEAT_SUCCESS, (void *)r_net, SCTP_SO_NOT_LOCKED); + 0, (void *)r_net, SCTP_SO_NOT_LOCKED); } if (r_net->dest_state & SCTP_ADDR_PF) { r_net->dest_state &= ~SCTP_ADDR_PF; Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun May 13 17:32:12 2012 (r235413) +++ head/sys/netinet/sctp_output.c Sun May 13 17:36:04 2012 (r235414) @@ -3815,8 +3815,7 @@ sctp_handle_no_route(struct sctp_tcb *st if ((net->dest_state & SCTP_ADDR_REACHABLE) && stcb) { SCTPDBG(SCTP_DEBUG_OUTPUT1, "no route takes interface %p down\n", net); sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, - stcb, - SCTP_FAILED_THRESHOLD, + stcb, 0, (void *)net, so_locked); net->dest_state &= ~SCTP_ADDR_REACHABLE; Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Sun May 13 17:32:12 2012 (r235413) +++ head/sys/netinet/sctp_timer.c Sun May 13 17:36:04 2012 (r235414) @@ -101,8 +101,7 @@ sctp_threshold_management(struct sctp_in net->dest_state &= ~SCTP_ADDR_REQ_PRIMARY; net->dest_state &= ~SCTP_ADDR_PF; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, - stcb, - SCTP_FAILED_THRESHOLD, + stcb, 0, (void *)net, SCTP_SO_NOT_LOCKED); } } else if ((net->pf_threshold < net->failure_threshold) && Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun May 13 17:32:12 2012 (r235413) +++ head/sys/netinet/sctp_usrreq.c Sun May 13 17:36:04 2012 (r235414) @@ -270,7 +270,7 @@ sctp_notify(struct sctp_inpcb *inp, net->dest_state &= ~SCTP_ADDR_REACHABLE; net->dest_state &= ~SCTP_ADDR_PF; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, - stcb, SCTP_FAILED_THRESHOLD, + stcb, 0, (void *)net, SCTP_SO_NOT_LOCKED); } SCTP_TCB_UNLOCK(stcb); @@ -4826,12 +4826,12 @@ sctp_setopt(struct socket *so, int optna if (net->dest_state & SCTP_ADDR_REACHABLE) { if (net->error_count > paddrp->spp_pathmaxrxt) { net->dest_state &= ~SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, SCTP_RESPONSE_TO_USER_REQ, net, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, 0, net, SCTP_SO_LOCKED); } } else { if (net->error_count <= paddrp->spp_pathmaxrxt) { net->dest_state |= SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, SCTP_RESPONSE_TO_USER_REQ, net, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, 0, net, SCTP_SO_LOCKED); } } net->failure_threshold = paddrp->spp_pathmaxrxt; @@ -4869,12 +4869,12 @@ sctp_setopt(struct socket *so, int optna if (net->dest_state & SCTP_ADDR_REACHABLE) { if (net->error_count > paddrp->spp_pathmaxrxt) { net->dest_state &= ~SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, SCTP_RESPONSE_TO_USER_REQ, net, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, 0, net, SCTP_SO_LOCKED); } } else { if (net->error_count <= paddrp->spp_pathmaxrxt) { net->dest_state |= SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, SCTP_RESPONSE_TO_USER_REQ, net, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, 0, net, SCTP_SO_LOCKED); } } net->failure_threshold = paddrp->spp_pathmaxrxt; @@ -5680,12 +5680,12 @@ sctp_setopt(struct socket *so, int optna if (net->dest_state & SCTP_ADDR_REACHABLE) { if (net->failure_threshold > thlds->spt_pathmaxrxt) { net->dest_state &= ~SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, SCTP_RESPONSE_TO_USER_REQ, net, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, 0, net, SCTP_SO_LOCKED); } } else { if (net->failure_threshold <= thlds->spt_pathmaxrxt) { net->dest_state |= SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, SCTP_RESPONSE_TO_USER_REQ, net, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, 0, net, SCTP_SO_LOCKED); } } net->failure_threshold = thlds->spt_pathmaxrxt; @@ -5709,12 +5709,12 @@ sctp_setopt(struct socket *so, int optna if (net->dest_state & SCTP_ADDR_REACHABLE) { if (net->failure_threshold > thlds->spt_pathmaxrxt) { net->dest_state &= ~SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, SCTP_RESPONSE_TO_USER_REQ, net, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, 0, net, SCTP_SO_LOCKED); } } else { if (net->failure_threshold <= thlds->spt_pathmaxrxt) { net->dest_state |= SCTP_ADDR_REACHABLE; - sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, SCTP_RESPONSE_TO_USER_REQ, net, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb, 0, net, SCTP_SO_LOCKED); } } net->failure_threshold = thlds->spt_pathmaxrxt; From owner-svn-src-head@FreeBSD.ORG Sun May 13 19:25:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5CDB4106564A; Sun, 13 May 2012 19:25:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4833F8FC0A; Sun, 13 May 2012 19:25:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4DJPM4R097049; Sun, 13 May 2012 19:25:22 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4DJPMMu097047; Sun, 13 May 2012 19:25:22 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205131925.q4DJPMMu097047@svn.freebsd.org> From: Michael Tuexen Date: Sun, 13 May 2012 19:25:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235415 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 19:25:22 -0000 Author: tuexen Date: Sun May 13 19:25:21 2012 New Revision: 235415 URL: http://svn.freebsd.org/changeset/base/235415 Log: Missed to commit this in r235414. MFC after: 3 days Modified: head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Sun May 13 17:36:04 2012 (r235414) +++ head/sys/netinet6/sctp6_usrreq.c Sun May 13 19:25:21 2012 (r235415) @@ -426,8 +426,7 @@ sctp6_notify(struct sctp_inpcb *inp, net->dest_state &= ~SCTP_ADDR_REACHABLE; net->dest_state &= ~SCTP_ADDR_PF; sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, - stcb, SCTP_FAILED_THRESHOLD, - (void *)net, SCTP_SO_NOT_LOCKED); + stcb, 0, (void *)net, SCTP_SO_NOT_LOCKED); } SCTP_TCB_UNLOCK(stcb); } else if ((icmph->icmp6_code == ICMP_UNREACH_PROTOCOL) || From owner-svn-src-head@FreeBSD.ORG Sun May 13 19:32:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 966C9106566C; Sun, 13 May 2012 19:32:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FB718FC0A; Sun, 13 May 2012 19:32:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4DJWoha097311; Sun, 13 May 2012 19:32:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4DJWoTs097302; Sun, 13 May 2012 19:32:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205131932.q4DJWoTs097302@svn.freebsd.org> From: Michael Tuexen Date: Sun, 13 May 2012 19:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235416 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 19:32:50 -0000 Author: tuexen Date: Sun May 13 19:32:49 2012 New Revision: 235416 URL: http://svn.freebsd.org/changeset/base/235416 Log: Provide in the SCTP_SEND_FAILED and SCTP_SEND_FAILED_EVENT notifications the correct ssf_error or ssfe_error as required by RFC 6458. MFC after: 3 days Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_timer.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Sun May 13 19:25:21 2012 (r235415) +++ head/sys/netinet/sctp_constants.h Sun May 13 19:32:49 2012 (r235416) @@ -460,18 +460,6 @@ __FBSDID("$FreeBSD$"); #define SCTP_HAS_NAT_SUPPORT 0xc007 #define SCTP_NAT_VTAGS 0xc008 -/* Notification error codes */ -#define SCTP_NOTIFY_DATAGRAM_UNSENT 0x0001 -#define SCTP_NOTIFY_DATAGRAM_SENT 0x0002 -#define SCTP_FAILED_THRESHOLD 0x0004 -#define SCTP_HEARTBEAT_SUCCESS 0x0008 -#define SCTP_RESPONSE_TO_USER_REQ 0x0010 -#define SCTP_INTERNAL_ERROR 0x0020 -#define SCTP_SHUTDOWN_GUARD_EXPIRES 0x0040 -#define SCTP_RECEIVED_SACK 0x0080 -#define SCTP_PEER_FAULTY 0x0100 -#define SCTP_ICMP_REFUSED 0x0200 - /* bits for TOS field */ #define SCTP_ECT0_BIT 0x02 #define SCTP_ECT1_BIT 0x01 @@ -755,27 +743,28 @@ __FBSDID("$FreeBSD$"); #define SCTP_NOTIFY_ASSOC_DOWN 2 #define SCTP_NOTIFY_INTERFACE_DOWN 3 #define SCTP_NOTIFY_INTERFACE_UP 4 -#define SCTP_NOTIFY_DG_FAIL 5 -#define SCTP_NOTIFY_SPECIAL_SP_FAIL 6 -#define SCTP_NOTIFY_ASSOC_LOC_ABORTED 7 -#define SCTP_NOTIFY_ASSOC_REM_ABORTED 8 -#define SCTP_NOTIFY_ASSOC_RESTART 9 -#define SCTP_NOTIFY_PEER_SHUTDOWN 10 -#define SCTP_NOTIFY_ASCONF_ADD_IP 11 -#define SCTP_NOTIFY_ASCONF_DELETE_IP 12 -#define SCTP_NOTIFY_ASCONF_SET_PRIMARY 13 -#define SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION 14 -#define SCTP_NOTIFY_INTERFACE_CONFIRMED 15 -#define SCTP_NOTIFY_STR_RESET_RECV 16 -#define SCTP_NOTIFY_STR_RESET_SEND 17 -#define SCTP_NOTIFY_STR_RESET_FAILED_OUT 18 -#define SCTP_NOTIFY_STR_RESET_FAILED_IN 19 -#define SCTP_NOTIFY_STR_RESET_DENIED_OUT 20 -#define SCTP_NOTIFY_STR_RESET_DENIED_IN 21 -#define SCTP_NOTIFY_AUTH_NEW_KEY 22 -#define SCTP_NOTIFY_AUTH_FREE_KEY 23 -#define SCTP_NOTIFY_NO_PEER_AUTH 24 -#define SCTP_NOTIFY_SENDER_DRY 25 +#define SCTP_NOTIFY_SENT_DG_FAIL 5 +#define SCTP_NOTIFY_UNSENT_DG_FAIL 6 +#define SCTP_NOTIFY_SPECIAL_SP_FAIL 7 +#define SCTP_NOTIFY_ASSOC_LOC_ABORTED 8 +#define SCTP_NOTIFY_ASSOC_REM_ABORTED 9 +#define SCTP_NOTIFY_ASSOC_RESTART 10 +#define SCTP_NOTIFY_PEER_SHUTDOWN 11 +#define SCTP_NOTIFY_ASCONF_ADD_IP 12 +#define SCTP_NOTIFY_ASCONF_DELETE_IP 13 +#define SCTP_NOTIFY_ASCONF_SET_PRIMARY 14 +#define SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION 15 +#define SCTP_NOTIFY_INTERFACE_CONFIRMED 16 +#define SCTP_NOTIFY_STR_RESET_RECV 17 +#define SCTP_NOTIFY_STR_RESET_SEND 18 +#define SCTP_NOTIFY_STR_RESET_FAILED_OUT 19 +#define SCTP_NOTIFY_STR_RESET_FAILED_IN 20 +#define SCTP_NOTIFY_STR_RESET_DENIED_OUT 21 +#define SCTP_NOTIFY_STR_RESET_DENIED_IN 22 +#define SCTP_NOTIFY_AUTH_NEW_KEY 23 +#define SCTP_NOTIFY_AUTH_FREE_KEY 24 +#define SCTP_NOTIFY_NO_PEER_AUTH 25 +#define SCTP_NOTIFY_SENDER_DRY 26 /* This is the value for messages that are NOT completely * copied down where we will start to split the message. Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun May 13 19:25:21 2012 (r235415) +++ head/sys/netinet/sctp_indata.c Sun May 13 19:32:49 2012 (r235416) @@ -3194,8 +3194,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t if (timevalcmp(&now, &tp1->rec.data.timetodrop, >)) { /* Yes so drop it */ if (tp1->data != NULL) { - (void)sctp_release_pr_sctp_chunk(stcb, tp1, - (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), + (void)sctp_release_pr_sctp_chunk(stcb, tp1, 1, SCTP_SO_NOT_LOCKED); } continue; @@ -3452,8 +3451,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t if (tp1->snd_count > tp1->rec.data.timetodrop.tv_sec) { /* Yes, so drop it */ if (tp1->data != NULL) { - (void)sctp_release_pr_sctp_chunk(stcb, tp1, - (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), + (void)sctp_release_pr_sctp_chunk(stcb, tp1, 1, SCTP_SO_NOT_LOCKED); } /* Make sure to flag we had a FR */ @@ -3632,8 +3630,7 @@ sctp_try_advance_peer_ack_point(struct s /* Yes so drop it */ if (tp1->data) { (void)sctp_release_pr_sctp_chunk(stcb, tp1, - (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), - SCTP_SO_NOT_LOCKED); + 1, SCTP_SO_NOT_LOCKED); } } else { /* Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun May 13 19:25:21 2012 (r235415) +++ head/sys/netinet/sctp_input.c Sun May 13 19:32:49 2012 (r235416) @@ -300,8 +300,8 @@ sctp_process_init(struct sctp_init_chunk asoc->send_queue_cnt--; if (chk->data != NULL) { sctp_free_bufspace(stcb, asoc, chk, 1); - sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_UNSENT, chk, SCTP_SO_NOT_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_UNSENT_DG_FAIL, stcb, + 0, chk, SCTP_SO_NOT_LOCKED); if (chk->data) { sctp_m_freem(chk->data); chk->data = NULL; @@ -318,8 +318,7 @@ sctp_process_init(struct sctp_init_chunk TAILQ_REMOVE(&outs->outqueue, sp, next); asoc->stream_queue_cnt--; sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, - stcb, SCTP_NOTIFY_DATAGRAM_UNSENT, - sp, SCTP_SO_NOT_LOCKED); + stcb, 0, sp, SCTP_SO_NOT_LOCKED); if (sp->data) { sctp_m_freem(sp->data); sp->data = NULL; @@ -1006,7 +1005,7 @@ sctp_handle_shutdown_ack(struct sctp_shu if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { - sctp_report_all_outbound(stcb, 0, SCTP_SO_NOT_LOCKED); + sctp_report_all_outbound(stcb, 0, 0, SCTP_SO_NOT_LOCKED); } /* stop the timer */ sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_9); @@ -1889,7 +1888,7 @@ sctp_process_cookie_existing(struct mbuf /* send up all the data */ SCTP_TCB_SEND_LOCK(stcb); - sctp_report_all_outbound(stcb, 1, SCTP_SO_NOT_LOCKED); + sctp_report_all_outbound(stcb, 0, 1, SCTP_SO_NOT_LOCKED); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].next_sequence_sent = 0; @@ -3176,7 +3175,7 @@ sctp_handle_shutdown_complete(struct sct if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { - sctp_report_all_outbound(stcb, 0, SCTP_SO_NOT_LOCKED); + sctp_report_all_outbound(stcb, 0, 0, SCTP_SO_NOT_LOCKED); } } /* stop the timer */ Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun May 13 19:25:21 2012 (r235415) +++ head/sys/netinet/sctp_output.c Sun May 13 19:32:49 2012 (r235416) @@ -6091,14 +6091,14 @@ sctp_prune_prsctp(struct sctp_tcb *stcb, * if the mbuf is here */ int ret_spc; - int cause; + uint8_t sent; if (chk->sent > SCTP_DATAGRAM_UNSENT) - cause = SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT; + sent = 1; else - cause = SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_UNSENT; + sent = 0; ret_spc = sctp_release_pr_sctp_chunk(stcb, chk, - cause, + sent, SCTP_SO_LOCKED); freed_spc += ret_spc; if (freed_spc >= dataout) { @@ -6121,8 +6121,7 @@ sctp_prune_prsctp(struct sctp_tcb *stcb, int ret_spc; ret_spc = sctp_release_pr_sctp_chunk(stcb, chk, - SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_UNSENT, - SCTP_SO_LOCKED); + 0, SCTP_SO_LOCKED); freed_spc += ret_spc; if (freed_spc >= dataout) { Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun May 13 19:25:21 2012 (r235415) +++ head/sys/netinet/sctp_pcb.c Sun May 13 19:32:49 2012 (r235416) @@ -4990,8 +4990,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, if (so) { /* Still an open socket - report */ sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_UNSENT, - (void *)sp, SCTP_SO_LOCKED); + 0, (void *)sp, SCTP_SO_LOCKED); } if (sp->data) { sctp_m_freem(sp->data); @@ -5051,8 +5050,8 @@ sctp_free_assoc(struct sctp_inpcb *inp, if (chk->data) { if (so) { /* Still a socket? */ - sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_UNSENT, chk, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_UNSENT_DG_FAIL, stcb, + 0, chk, SCTP_SO_LOCKED); } if (chk->data) { sctp_m_freem(chk->data); @@ -5075,8 +5074,8 @@ sctp_free_assoc(struct sctp_inpcb *inp, if (chk->data) { if (so) { /* Still a socket? */ - sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_SENT, chk, SCTP_SO_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_SENT_DG_FAIL, stcb, + 0, chk, SCTP_SO_LOCKED); } if (chk->data) { sctp_m_freem(chk->data); Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Sun May 13 19:25:21 2012 (r235415) +++ head/sys/netinet/sctp_timer.c Sun May 13 19:32:49 2012 (r235416) @@ -614,7 +614,7 @@ start_again: if (chk->data) { (void)sctp_release_pr_sctp_chunk(stcb, chk, - (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), + 1, SCTP_SO_NOT_LOCKED); cnt_abandoned++; } @@ -627,7 +627,7 @@ start_again: if (chk->data) { (void)sctp_release_pr_sctp_chunk(stcb, chk, - (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), + 1, SCTP_SO_NOT_LOCKED); cnt_abandoned++; } Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun May 13 19:25:21 2012 (r235415) +++ head/sys/netinet/sctputil.c Sun May 13 19:32:49 2012 (r235416) @@ -2810,7 +2810,7 @@ sctp_notify_peer_addr_change(struct sctp static void -sctp_notify_send_failed(struct sctp_tcb *stcb, uint32_t error, +sctp_notify_send_failed(struct sctp_tcb *stcb, uint8_t sent, uint32_t error, struct sctp_tmit_chunk *chk, int so_locked #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED @@ -2844,10 +2844,11 @@ sctp_notify_send_failed(struct sctp_tcb if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) { ssfe = mtod(m_notify, struct sctp_send_failed_event *); ssfe->ssfe_type = SCTP_SEND_FAILED_EVENT; - if (error == SCTP_NOTIFY_DATAGRAM_UNSENT) - ssfe->ssfe_flags = SCTP_DATA_UNSENT; - else + if (sent) { ssfe->ssfe_flags = SCTP_DATA_SENT; + } else { + ssfe->ssfe_flags = SCTP_DATA_UNSENT; + } ssfe->ssfe_length = length; ssfe->ssfe_error = error; /* not exactly what the user sent in, but should be close :) */ @@ -2862,10 +2863,11 @@ sctp_notify_send_failed(struct sctp_tcb } else { ssf = mtod(m_notify, struct sctp_send_failed *); ssf->ssf_type = SCTP_SEND_FAILED; - if (error == SCTP_NOTIFY_DATAGRAM_UNSENT) - ssf->ssf_flags = SCTP_DATA_UNSENT; - else + if (sent) { ssf->ssf_flags = SCTP_DATA_SENT; + } else { + ssf->ssf_flags = SCTP_DATA_UNSENT; + } ssf->ssf_length = length; ssf->ssf_error = error; /* not exactly what the user sent in, but should be close :) */ @@ -2954,10 +2956,7 @@ sctp_notify_send_failed2(struct sctp_tcb if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVNSENDFAILEVNT)) { ssfe = mtod(m_notify, struct sctp_send_failed_event *); ssfe->ssfe_type = SCTP_SEND_FAILED; - if (error == SCTP_NOTIFY_DATAGRAM_UNSENT) - ssfe->ssfe_flags = SCTP_DATA_UNSENT; - else - ssfe->ssfe_flags = SCTP_DATA_SENT; + ssfe->ssfe_flags = SCTP_DATA_UNSENT; ssfe->ssfe_length = length; ssfe->ssfe_error = error; /* not exactly what the user sent in, but should be close :) */ @@ -2976,10 +2975,7 @@ sctp_notify_send_failed2(struct sctp_tcb } else { ssf = mtod(m_notify, struct sctp_send_failed *); ssf->ssf_type = SCTP_SEND_FAILED; - if (error == SCTP_NOTIFY_DATAGRAM_UNSENT) - ssf->ssf_flags = SCTP_DATA_UNSENT; - else - ssf->ssf_flags = SCTP_DATA_SENT; + ssf->ssf_flags = SCTP_DATA_UNSENT; ssf->ssf_length = length; ssf->ssf_error = error; /* not exactly what the user sent in, but should be close :) */ @@ -3543,8 +3539,12 @@ sctp_ulp_notify(uint32_t notification, s sctp_notify_send_failed2(stcb, error, (struct sctp_stream_queue_pending *)data, so_locked); break; - case SCTP_NOTIFY_DG_FAIL: - sctp_notify_send_failed(stcb, error, + case SCTP_NOTIFY_SENT_DG_FAIL: + sctp_notify_send_failed(stcb, 1, error, + (struct sctp_tmit_chunk *)data, so_locked); + break; + case SCTP_NOTIFY_UNSENT_DG_FAIL: + sctp_notify_send_failed(stcb, 0, error, (struct sctp_tmit_chunk *)data, so_locked); break; case SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION: @@ -3642,7 +3642,7 @@ sctp_ulp_notify(uint32_t notification, s } void -sctp_report_all_outbound(struct sctp_tcb *stcb, int holds_lock, int so_locked +sctp_report_all_outbound(struct sctp_tcb *stcb, uint16_t error, int holds_lock, int so_locked #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED #endif @@ -3677,8 +3677,8 @@ sctp_report_all_outbound(struct sctp_tcb asoc->sent_queue_cnt--; if (chk->data != NULL) { sctp_free_bufspace(stcb, asoc, chk, 1); - sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_SENT, chk, so_locked); + sctp_ulp_notify(SCTP_NOTIFY_SENT_DG_FAIL, stcb, + error, chk, so_locked); if (chk->data) { sctp_m_freem(chk->data); chk->data = NULL; @@ -3693,8 +3693,8 @@ sctp_report_all_outbound(struct sctp_tcb asoc->send_queue_cnt--; if (chk->data != NULL) { sctp_free_bufspace(stcb, asoc, chk, 1); - sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_UNSENT, chk, so_locked); + sctp_ulp_notify(SCTP_NOTIFY_UNSENT_DG_FAIL, stcb, + error, chk, so_locked); if (chk->data) { sctp_m_freem(chk->data); chk->data = NULL; @@ -3714,7 +3714,7 @@ sctp_report_all_outbound(struct sctp_tcb sctp_free_spbufspace(stcb, asoc, sp); if (sp->data) { sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_UNSENT, (void *)sp, so_locked); + error, (void *)sp, so_locked); if (sp->data) { sctp_m_freem(sp->data); sp->data = NULL; @@ -3757,7 +3757,7 @@ sctp_abort_notification(struct sctp_tcb return; } /* Tell them we lost the asoc */ - sctp_report_all_outbound(stcb, 1, so_locked); + sctp_report_all_outbound(stcb, error, 1, so_locked); if (from_peer) { sctp_ulp_notify(SCTP_NOTIFY_ASSOC_REM_ABORTED, stcb, error, abort, so_locked); } else { @@ -4655,7 +4655,7 @@ sctp_free_bufspace(struct sctp_tcb *stcb int sctp_release_pr_sctp_chunk(struct sctp_tcb *stcb, struct sctp_tmit_chunk *tp1, - int reason, int so_locked + uint8_t sent, int so_locked #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED #endif @@ -4682,7 +4682,11 @@ sctp_release_pr_sctp_chunk(struct sctp_t sctp_free_bufspace(stcb, &stcb->asoc, tp1, 1); stcb->asoc.peers_rwnd += tp1->send_size; stcb->asoc.peers_rwnd += SCTP_BASE_SYSCTL(sctp_peer_chunk_oh); - sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, reason, tp1, so_locked); + if (sent) { + sctp_ulp_notify(SCTP_NOTIFY_SENT_DG_FAIL, stcb, 0, tp1, so_locked); + } else { + sctp_ulp_notify(SCTP_NOTIFY_UNSENT_DG_FAIL, stcb, 0, tp1, so_locked); + } if (tp1->data) { sctp_m_freem(tp1->data); tp1->data = NULL; @@ -4729,7 +4733,11 @@ sctp_release_pr_sctp_chunk(struct sctp_t chk = tp1; ret_sz += tp1->book_size; sctp_free_bufspace(stcb, &stcb->asoc, tp1, 1); - sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, reason, tp1, so_locked); + if (sent) { + sctp_ulp_notify(SCTP_NOTIFY_SENT_DG_FAIL, stcb, 0, tp1, so_locked); + } else { + sctp_ulp_notify(SCTP_NOTIFY_UNSENT_DG_FAIL, stcb, 0, tp1, so_locked); + } if (tp1->data) { sctp_m_freem(tp1->data); tp1->data = NULL; Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Sun May 13 19:25:21 2012 (r235415) +++ head/sys/netinet/sctputil.h Sun May 13 19:32:49 2012 (r235416) @@ -170,7 +170,7 @@ sctp_pull_off_control_to_new_inp(struct void sctp_stop_timers_for_shutdown(struct sctp_tcb *); void -sctp_report_all_outbound(struct sctp_tcb *, int, int +sctp_report_all_outbound(struct sctp_tcb *, uint16_t, int, int #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED #endif @@ -244,7 +244,7 @@ void sctp_print_address_pkt(struct ip *, int sctp_release_pr_sctp_chunk(struct sctp_tcb *, struct sctp_tmit_chunk *, - int, int + uint8_t, int #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) SCTP_UNUSED #endif From owner-svn-src-head@FreeBSD.ORG Sun May 13 22:27:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F709106567D; Sun, 13 May 2012 22:27:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40C648FC1E; Sun, 13 May 2012 22:27:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4DMRtcT002860; Sun, 13 May 2012 22:27:55 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4DMRtqZ002856; Sun, 13 May 2012 22:27:55 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205132227.q4DMRtqZ002856@svn.freebsd.org> From: Michael Tuexen Date: Sun, 13 May 2012 22:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235418 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 22:27:55 -0000 Author: tuexen Date: Sun May 13 22:27:54 2012 New Revision: 235418 URL: http://svn.freebsd.org/changeset/base/235418 Log: Support SCTP_REMOTE_ERROR notification. MFC after: 3 days Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_input.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Sun May 13 20:28:43 2012 (r235417) +++ head/sys/netinet/sctp_constants.h Sun May 13 22:27:54 2012 (r235418) @@ -765,6 +765,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_NOTIFY_AUTH_FREE_KEY 24 #define SCTP_NOTIFY_NO_PEER_AUTH 25 #define SCTP_NOTIFY_SENDER_DRY 26 +#define SCTP_NOTIFY_REMOTE_ERROR 27 /* This is the value for messages that are NOT completely * copied down where we will start to split the message. Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun May 13 20:28:43 2012 (r235417) +++ head/sys/netinet/sctp_input.c Sun May 13 22:27:54 2012 (r235418) @@ -1111,7 +1111,7 @@ sctp_handle_error(struct sctp_chunkhdr * { int chklen; struct sctp_paramhdr *phdr; - uint16_t error_type; + uint16_t error, error_type; uint16_t error_len; struct sctp_association *asoc; int adjust; @@ -1126,6 +1126,7 @@ sctp_handle_error(struct sctp_chunkhdr * phdr = (struct sctp_paramhdr *)((caddr_t)ch + sizeof(struct sctp_chunkhdr)); chklen = ntohs(ch->chunk_length) - sizeof(struct sctp_chunkhdr); + error = 0; while ((size_t)chklen >= sizeof(struct sctp_paramhdr)) { /* Process an Error Cause */ error_type = ntohs(phdr->param_type); @@ -1136,6 +1137,10 @@ sctp_handle_error(struct sctp_chunkhdr * chklen, error_len); return (0); } + if (error == 0) { + /* report the first error cause */ + error = error_type; + } switch (error_type) { case SCTP_CAUSE_INVALID_STREAM: case SCTP_CAUSE_MISSING_PARAM: @@ -1252,6 +1257,7 @@ sctp_handle_error(struct sctp_chunkhdr * chklen -= adjust; phdr = (struct sctp_paramhdr *)((caddr_t)phdr + adjust); } + sctp_ulp_notify(SCTP_NOTIFY_REMOTE_ERROR, stcb, error, ch, SCTP_SO_NOT_LOCKED); return (0); } Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun May 13 20:28:43 2012 (r235417) +++ head/sys/netinet/sctputil.c Sun May 13 22:27:54 2012 (r235418) @@ -3464,6 +3464,63 @@ sctp_notify_stream_reset(struct sctp_tcb } +static void +sctp_notify_remote_error(struct sctp_tcb *stcb, uint16_t error, struct sctp_error_chunk *chunk) +{ + struct mbuf *m_notify; + struct sctp_remote_error *sre; + struct sctp_queued_to_read *control; + size_t notif_len, chunk_len; + + if ((stcb == NULL) || + sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVPEERERR)) { + return; + } + if (chunk != NULL) { + chunk_len = htons(chunk->ch.chunk_length); + } else { + chunk_len = 0; + } + notif_len = sizeof(struct sctp_remote_error) + chunk_len; + m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); + if (m_notify == NULL) { + /* Retry with smaller value. */ + notif_len = sizeof(struct sctp_remote_error); + m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); + if (m_notify == NULL) { + return; + } + } + SCTP_BUF_NEXT(m_notify) = NULL; + sre = mtod(m_notify, struct sctp_remote_error *); + sre->sre_type = SCTP_REMOTE_ERROR; + sre->sre_flags = 0; + sre->sre_length = sizeof(struct sctp_remote_error); + sre->sre_error = error; + sre->sre_assoc_id = sctp_get_associd(stcb); + if (notif_len > sizeof(struct sctp_remote_error)) { + memcpy(sre->sre_data, chunk, chunk_len); + sre->sre_length += chunk_len; + } + SCTP_BUF_LEN(m_notify) = sre->sre_length; + control = sctp_build_readq_entry(stcb, stcb->asoc.primary_destination, + 0, 0, stcb->asoc.context, 0, 0, 0, + m_notify); + if (control != NULL) { + control->length = SCTP_BUF_LEN(m_notify); + /* not that we need this */ + control->tail_mbuf = m_notify; + control->spec_flags = M_NOTIFICATION; + sctp_add_to_readq(stcb->sctp_ep, stcb, + control, + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); + } else { + sctp_m_freem(m_notify); + } +} + + void sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb, uint32_t error, void *data, int so_locked @@ -3634,6 +3691,9 @@ sctp_ulp_notify(uint32_t notification, s case SCTP_NOTIFY_SENDER_DRY: sctp_notify_sender_dry_event(stcb, so_locked); break; + case SCTP_NOTIFY_REMOTE_ERROR: + sctp_notify_remote_error(stcb, error, data); + break; default: SCTPDBG(SCTP_DEBUG_UTIL1, "%s: unknown notification %xh (%u)\n", __FUNCTION__, notification, notification); From owner-svn-src-head@FreeBSD.ORG Sun May 13 23:27:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1ADC5106564A; Sun, 13 May 2012 23:27:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 057678FC12; Sun, 13 May 2012 23:27:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4DNR6Pm004754; Sun, 13 May 2012 23:27:06 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4DNR6PU004752; Sun, 13 May 2012 23:27:06 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201205132327.q4DNR6PU004752@svn.freebsd.org> From: Eitan Adler Date: Sun, 13 May 2012 23:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235419 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 May 2012 23:27:07 -0000 Author: eadler Date: Sun May 13 23:27:06 2012 New Revision: 235419 URL: http://svn.freebsd.org/changeset/base/235419 Log: Add missing period at the end of the error message Submitted by: pjd Approved by: cperciva (implicit) MFC after: 3 days X-MFC-With: r235201 Modified: head/sys/geom/eli/g_eli_integrity.c Modified: head/sys/geom/eli/g_eli_integrity.c ============================================================================== --- head/sys/geom/eli/g_eli_integrity.c Sun May 13 22:27:54 2012 (r235418) +++ head/sys/geom/eli/g_eli_integrity.c Sun May 13 23:27:06 2012 (r235419) @@ -206,7 +206,7 @@ g_eli_auth_read_done(struct cryptop *crp */ if (coroff != -1) { G_ELI_DEBUG(0, "%s: Failed to authenticate %jd " - "bytes of data at offset %jd", + "bytes of data at offset %jd.", sc->sc_name, (intmax_t)corsize, (intmax_t)coroff); coroff = -1; @@ -222,7 +222,7 @@ g_eli_auth_read_done(struct cryptop *crp /* Report previous corruption if there was one. */ if (coroff != -1) { G_ELI_DEBUG(0, "%s: Failed to authenticate %jd " - "bytes of data at offset %jd", + "bytes of data at offset %jd.", sc->sc_name, (intmax_t)corsize, (intmax_t)coroff); } } From owner-svn-src-head@FreeBSD.ORG Mon May 14 05:10:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AACF8106566B; Mon, 14 May 2012 05:10:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 953DC8FC08; Mon, 14 May 2012 05:10:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4E5Afkw016039; Mon, 14 May 2012 05:10:41 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4E5AfoM016037; Mon, 14 May 2012 05:10:41 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201205140510.q4E5AfoM016037@svn.freebsd.org> From: Xin LI Date: Mon, 14 May 2012 05:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235425 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2012 05:10:41 -0000 Author: delphij Date: Mon May 14 05:10:41 2012 New Revision: 235425 URL: http://svn.freebsd.org/changeset/base/235425 Log: Sync DLTs with the latest pcap version. MFC after: 2 weeks Modified: head/sys/net/bpf.h Modified: head/sys/net/bpf.h ============================================================================== --- head/sys/net/bpf.h Mon May 14 04:24:24 2012 (r235424) +++ head/sys/net/bpf.h Mon May 14 05:10:41 2012 (r235425) @@ -279,6 +279,24 @@ struct bpf_zbuf_header { */ #define DLT_SYMANTEC_FIREWALL 99 +/* + * Values between 100 and 103 are used in capture file headers as + * link-layer header type LINKTYPE_ values corresponding to DLT_ types + * that differ between platforms; don't use those values for new DLT_ + * new types. + */ + +/* + * Values starting with 104 are used for newly-assigned link-layer + * header type values; for those link-layer header types, the DLT_ + * value returned by pcap_datalink() and passed to pcap_open_dead(), + * and the LINKTYPE_ value that appears in capture files, are the + * same. + * + * DLT_MATCHING_MIN is the lowest such value; DLT_MATCHING_MAX is + * the highest such value. + */ +#define DLT_MATCHING_MIN 104 /* * This value was defined by libpcap 0.5; platforms that have defined @@ -978,8 +996,110 @@ struct bpf_zbuf_header { * Raw IPv4/IPv6; different from DLT_RAW in that the DLT_ value specifies * whether it's v4 or v6. Requested by Darren Reed . */ -#define DLT_IPV4 228 -#define DLT_IPV6 229 +#define DLT_IPV4 228 +#define DLT_IPV6 229 + +/* + * IEEE 802.15.4, exactly as it appears in the spec (no padding, no + * nothing), and with no FCS at the end of the frame; requested by + * Jon Smirl . + */ +#define DLT_IEEE802_15_4_NOFCS 230 + +/* + * Raw D-Bus: + * + * http://www.freedesktop.org/wiki/Software/dbus + * + * messages: + * + * http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-messages + * + * starting with the endianness flag, followed by the message type, etc., + * but without the authentication handshake before the message sequence: + * + * http://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol + * + * Requested by Martin Vidner . + */ +#define DLT_DBUS 231 + +/* + * Juniper-private data link type, as per request from + * Hannes Gredler . + */ +#define DLT_JUNIPER_VS 232 +#define DLT_JUNIPER_SRX_E2E 233 +#define DLT_JUNIPER_FIBRECHANNEL 234 + +/* + * DVB-CI (DVB Common Interface for communication between a PC Card + * module and a DVB receiver). See + * + * http://www.kaiser.cx/pcap-dvbci.html + * + * for the specification. + * + * Requested by Martin Kaiser . + */ +#define DLT_DVB_CI 235 + +/* + * Variant of 3GPP TS 27.010 multiplexing protocol (similar to, but + * *not* the same as, 27.010). Requested by Hans-Christoph Schemmel + * . + */ +#define DLT_MUX27010 236 + +/* + * STANAG 5066 D_PDUs. Requested by M. Baris Demiray + * . + */ +#define DLT_STANAG_5066_D_PDU 237 + +/* + * Juniper-private data link type, as per request from + * Hannes Gredler . + */ +#define DLT_JUNIPER_ATM_CEMIC 238 + +/* + * NetFilter LOG messages + * (payload of netlink NFNL_SUBSYS_ULOG/NFULNL_MSG_PACKET packets) + * + * Requested by Jakub Zawadzki + */ +#define DLT_NFLOG 239 + +/* + * Hilscher Gesellschaft fuer Systemautomation mbH link-layer type + * for Ethernet packets with a 4-byte pseudo-header and always + * with the payload including the FCS, as supplied by their + * netANALYZER hardware and software. + * + * Requested by Holger P. Frommer + */ +#define DLT_NETANALYZER 240 + +/* + * Hilscher Gesellschaft fuer Systemautomation mbH link-layer type + * for Ethernet packets with a 4-byte pseudo-header and FCS and + * with the Ethernet header preceded by 7 bytes of preamble and + * 1 byte of SFD, as supplied by their netANALYZER hardware and + * software. + * + * Requested by Holger P. Frommer + */ +#define DLT_NETANALYZER_TRANSPARENT 241 + +/* + * IP-over-Infiniband, as specified by RFC 4391. + * + * Requested by Petr Sumbera . + */ +#define DLT_IPOIB 242 + +#define DLT_MATCHING_MAX 242 /* highest value in the "matching" range */ /* * DLT and savefile link type values are split into a class and From owner-svn-src-head@FreeBSD.ORG Mon May 14 05:12:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8050E1065670; Mon, 14 May 2012 05:12:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66E388FC1B; Mon, 14 May 2012 05:12:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4E5Cv9f016160; Mon, 14 May 2012 05:12:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4E5CvV9016150; Mon, 14 May 2012 05:12:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201205140512.q4E5CvV9016150@svn.freebsd.org> From: Xin LI Date: Mon, 14 May 2012 05:12:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235426 - in head: contrib/libpcap contrib/libpcap/bpf/net contrib/libpcap/packaging contrib/libpcap/pcap contrib/libpcap/test lib/libpcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2012 05:12:57 -0000 Author: delphij Date: Mon May 14 05:12:56 2012 New Revision: 235426 URL: http://svn.freebsd.org/changeset/base/235426 Log: Merge from vendor branch: update libpcap to 1.2.1. MFC after: 2 weeks Added: head/contrib/libpcap/pcap-netfilter-linux.c - copied unchanged from r235294, vendor/libpcap/dist/pcap-netfilter-linux.c head/contrib/libpcap/pcap-netfilter-linux.h - copied unchanged from r235294, vendor/libpcap/dist/pcap-netfilter-linux.h head/contrib/libpcap/pcap-tstamp.manmisc.in - copied unchanged from r235294, vendor/libpcap/dist/pcap-tstamp.manmisc.in head/contrib/libpcap/pcap_list_tstamp_types.3pcap.in - copied unchanged from r235294, vendor/libpcap/dist/pcap_list_tstamp_types.3pcap.in head/contrib/libpcap/pcap_set_tstamp_type.3pcap.in - copied unchanged from r235294, vendor/libpcap/dist/pcap_set_tstamp_type.3pcap.in head/contrib/libpcap/pcap_tstamp_type_name_to_val.3pcap - copied unchanged from r235294, vendor/libpcap/dist/pcap_tstamp_type_name_to_val.3pcap head/contrib/libpcap/pcap_tstamp_type_val_to_name.3pcap - copied unchanged from r235294, vendor/libpcap/dist/pcap_tstamp_type_val_to_name.3pcap head/contrib/libpcap/test/ - copied from r235294, vendor/libpcap/dist/test/ Deleted: head/contrib/libpcap/filtertest.c head/contrib/libpcap/findalldevstest.c head/contrib/libpcap/opentest.c head/contrib/libpcap/pcap_free_datalinks.3pcap head/contrib/libpcap/pcap_freealldevs.3pcap head/contrib/libpcap/selpolltest.c Modified: head/contrib/libpcap/CHANGES head/contrib/libpcap/CREDITS head/contrib/libpcap/Makefile.in head/contrib/libpcap/README head/contrib/libpcap/VERSION head/contrib/libpcap/bpf/net/bpf_filter.c head/contrib/libpcap/config.h.in head/contrib/libpcap/configure head/contrib/libpcap/configure.in head/contrib/libpcap/ethertype.h head/contrib/libpcap/fad-getad.c head/contrib/libpcap/gencode.c head/contrib/libpcap/gencode.h head/contrib/libpcap/grammar.y head/contrib/libpcap/inet.c head/contrib/libpcap/packaging/pcap.spec.in head/contrib/libpcap/pcap-bpf.c head/contrib/libpcap/pcap-bt-linux.c head/contrib/libpcap/pcap-common.c head/contrib/libpcap/pcap-config.in head/contrib/libpcap/pcap-dag.c head/contrib/libpcap/pcap-dlpi.c head/contrib/libpcap/pcap-filter.manmisc head/contrib/libpcap/pcap-filter.manmisc.in head/contrib/libpcap/pcap-int.h head/contrib/libpcap/pcap-libdlpi.c head/contrib/libpcap/pcap-linktype.manmisc head/contrib/libpcap/pcap-linktype.manmisc.in head/contrib/libpcap/pcap-linux.c head/contrib/libpcap/pcap-savefile.manfile head/contrib/libpcap/pcap-stdinc.h head/contrib/libpcap/pcap-usb-linux.c head/contrib/libpcap/pcap-win32.c head/contrib/libpcap/pcap.3pcap head/contrib/libpcap/pcap.3pcap.in head/contrib/libpcap/pcap.c head/contrib/libpcap/pcap/bpf.h head/contrib/libpcap/pcap/pcap.h head/contrib/libpcap/pcap_activate.3pcap head/contrib/libpcap/pcap_can_set_rfmon.3pcap head/contrib/libpcap/pcap_compile.3pcap head/contrib/libpcap/pcap_compile.3pcap.in head/contrib/libpcap/pcap_datalink.3pcap head/contrib/libpcap/pcap_datalink.3pcap.in head/contrib/libpcap/pcap_datalink_name_to_val.3pcap head/contrib/libpcap/pcap_datalink_val_to_name.3pcap head/contrib/libpcap/pcap_dump_open.3pcap head/contrib/libpcap/pcap_fileno.3pcap head/contrib/libpcap/pcap_findalldevs.3pcap head/contrib/libpcap/pcap_get_selectable_fd.3pcap head/contrib/libpcap/pcap_list_datalinks.3pcap head/contrib/libpcap/pcap_list_datalinks.3pcap.in head/contrib/libpcap/pcap_loop.3pcap head/contrib/libpcap/pcap_major_version.3pcap head/contrib/libpcap/pcap_next_ex.3pcap head/contrib/libpcap/pcap_open_dead.3pcap head/contrib/libpcap/pcap_open_live.3pcap head/contrib/libpcap/pcap_open_offline.3pcap head/contrib/libpcap/pcap_set_datalink.3pcap head/contrib/libpcap/savefile.c head/contrib/libpcap/scanner.l head/contrib/libpcap/sf-pcap-ng.c head/contrib/libpcap/sf-pcap.c head/lib/libpcap/Makefile head/lib/libpcap/config.h Directory Properties: head/contrib/libpcap/ (props changed) Modified: head/contrib/libpcap/CHANGES ============================================================================== --- head/contrib/libpcap/CHANGES Mon May 14 05:10:41 2012 (r235425) +++ head/contrib/libpcap/CHANGES Mon May 14 05:12:56 2012 (r235426) @@ -1,3 +1,77 @@ +Friday December 9, 2011. guy@alum.mit.edu. +Summary for 1.2.1 libpcap release + Update README file. + Fix typoes in README.linux file. + Clean up some compiler warnings. + Fix Linux compile problems and tests for ethtool.h. + Treat Debian/kFreeBSD and GNU/Hurd as systems with GNU + toolchains. + Support 802.1 QinQ as a form of VLAN in filters. + Treat "carp" as equivalent to "vrrp" in filters. + Fix code generated for "ip6 protochain". + Add some new link-layer header types. + Support capturing NetFilter log messages on Linux. + Clean up some error messages. + Turn off monitor mode on exit for mac80211 interfaces on Linux. + Fix problems turning monitor mode on for non-mac80211 interfaces + on Linux. + Properly fail if /sys/class/net or /proc/net/dev exist but can't + be opened. + Fail if pcap_activate() is called on an already-activated + pcap_t, and add a test program for that. + Fix filtering in pcap-ng files. + Don't build for PowerPC on Mac OS X Lion. + Simplify handling of new DLT_/LINKTYPE_ values. + Expand pcap(3PCAP) man page. + +Sunday July 24, 2011. mcr@sandelman.ca. +Summary for 1.2 libpcap release + All of the changes listed below for 1.1.1 and 1.1.2. + Changes to error handling for pcap_findalldevs(). + Fix the calculation of the frame size in memory-mapped captures. + Add a link-layer header type for STANAG 5066 D_PDUs. + Add a link-layer type for a variant of 3GPP TS 27.010. + Noted real nature of LINKTYPE_ARCNET. + Add a link-layer type for DVB-CI. + Fix configure-script discovery of VLAN acceleration support. + see http://netoptimizer.blogspot.com/2010/09/tcpdump-vs-vlan-tags.html + Linux, HP-UX, AIX, NetBSD and OpenBSD compilation/conflict fixes. + Protect against including AIX 5.x's having been included. + Add DLT_DBUS, for raw D-Bus messages. + Treat either EPERM or EACCES as "no soup for you". + Changes to permissions on DLPI systems. + Add DLT_IEEE802_15_4_NOFCS for 802.15.4 interfaces. + +Fri. August 6, 2010. guy@alum.mit.edu. +Summary for 1.1.2 libpcap release + Return DLT_ values, not raw LINKTYPE_ values from + pcap_datalink() when reading pcap-ng files + Add support for "wlan ra" and "wlan ta", to check the RA and TA + of WLAN frames that have them + Don't crash if "wlan addr{1,2,3,4}" are used without 802.11 + headers + Do filtering on USB and Bluetooth capturing + On FreeBSD/SPARC64, use -fPIC - it's apparently necessary + Check for valid port numbers (fit in a 16-bit unsigned field) in + "port" filters + Reject attempts to put savefiles into non-blocking mode + Check for "no such device" for the "get the media types" ioctl + in *BSD + Improve error messages from bpf_open(), and let it do the error + handling + Return more specific errors from pcap_can_set_rfmon(); fix + documentation + Update description fetching code for FreeBSD, fix code for + OpenBSD + Ignore /sys/net/dev files if we get ENODEV for them, not just + ENXIO; fixes handling of bonding devices on Linux + Fix check for a constant 0 argument to BPF_DIV + Use the right version of ar when cross-building + Free any filter set on a savefile when the savefile is closed + Include the CFLAGS setting when configure was run in the + compiler flags + Add support for 802.15.4 interfaces on Linux + Thu. April 1, 2010. guy@alum.mit.edu. Summary for 1.1.1 libpcap release Update CHANGES to reflect more of the changes in 1.1.0. Modified: head/contrib/libpcap/CREDITS ============================================================================== --- head/contrib/libpcap/CREDITS Mon May 14 05:10:41 2012 (r235425) +++ head/contrib/libpcap/CREDITS Mon May 14 05:12:56 2012 (r235426) @@ -1,145 +1,154 @@ This file lists people who have contributed to libpcap: The current maintainers: - Bill Fenner - Fulvio Risso - Guy Harris - Hannes Gredler - Michael Richardson + Bill Fenner + Fulvio Risso + Guy Harris + Hannes Gredler + Michael Richardson Additional people who have contributed patches: - Alan Bawden - Albert Chin - Alexander 'Leo' Bergolth - Alexey Kuznetsov - Alon Bar-Lev - Andrew Brown - Antti Kantee - Arien Vijn - Arkadiusz Miskiewicz - Armando L. Caro Jr. - Assar Westerlund - Brian Ginsbach - Charles M. Hannum - Chris G. Demetriou - Chris Lightfoot - Chris Maynard - Chris Pepper - Christian Bell - Christian Peron - Daniele Orlandi - Darren Reed - David Kaelbling - David Young - Dean Gaudet - Don Ebright - Dug Song - Dustin Spicuzza - Eric Anderson - Erik de Castro Lopo - Felix Obenhuber - Florent Drouin - Franz Schaefer - Fulko Hew - Fumiyuki Shimizu - Gianluca Varenni - Gilbert Hoyek - Gisle Vanem - Graeme Hewson - Greg Stark - Greg Troxel - Gregor Maier - Guillaume Pelat - Hagen Paul Pfeifer - Hyung Sik Yoon - Igor Khristophorov - Jan-Philip Velders - Jason R. Thorpe - Javier Achirica - Jean Tourrilhes - Jean-Louis Charton - Jefferson Ogata - Jesper Peterson - Joerg Mayer - John Bankier - Jon Lindgren - Jon Smirl - Juergen Schoenwaelder - Jung-uk Kim - Kazushi Sugyo - Klaus Klein - Koryn Grant - Kris Katterjohn - Krzysztof Halasa - Lorenzo Cavallaro - Loris Degioanni - Love Hörnquist-Ã…strand - Luis Martin Garcia - Maciej W. Rozycki - Marcus Felipe Pereira - Mark C. Brown - Mark Pizzolato - Markus Mayer - Martin Husemann - Márton Németh - Matthew Luckie - Max Laier - Mike Frysinger - Mike Kershaw - Mike Wiacek - Monroe Williams - N. Leiten - Nicolas Dade - Octavian Cerna - Olaf Kirch - Ollie Wild - Onno van der Linden - Paolo Abeni - Patrick Marie - Patrick McHardy - Paul Mundt - Pavel Kankovsky - Pawel Pokrywka - Peter Fales - Peter Jeremy - Peter Volkov - Phil Wood - Rafal Maszkowski - - Richard Stearn - Rick Jones - Robert Edmonds - Roberto Mariani - Romain Francoise - Sagun Shakya - Scott Barron - Scott Gifford - Sebastian Krahmer - Sebastien Roy - Sepherosa Ziehau - Shaun Clowes - Solomon Peachy - Stefan Hudson - Stephen Donnelly - Takashi Yamamoto - Tanaka Shin-ya - Tobias Poschwatta - Tony Li - Torsten Landschoff - Uns Lider - Uwe Girlich - Wesley Shields - Xianjie Zhang - Xin Li - Yen Yen Lim - Yvan Vanhullebus - Yoann Vandoorselaere + Alan Bawden + Albert Chin + Alexander 'Leo' Bergolth + Alexey Kuznetsov + Alon Bar-Lev + Andrew Brown + + Antti Kantee + Arien Vijn + Arkadiusz Miskiewicz + Armando L. Caro Jr. + Assar Westerlund + Brian Ginsbach + Charles M. Hannum + Chris G. Demetriou + Chris Lightfoot + Chris Maynard + Chris Pepper + Christian Bell + Christian Peron + Daniele Orlandi + Darren Reed + David Kaelbling + David Young + Dean Gaudet + Don Ebright + Dug Song + Dustin Spicuzza + Eric Anderson + Erik de Castro Lopo + Felix Obenhuber + Florent Drouin + Franz Schaefer + frederich + Fulko Hew + Fumiyuki Shimizu + Garrett Cooper + Gianluca Varenni + Gilbert Hoyek + Gisle Vanem + Graeme Hewson + Greg Stark + Greg Troxel + Gregor Maier + Guillaume Pelat + Hagen Paul Pfeifer + Henri Doreau + Hyung Sik Yoon + Igor Khristophorov + Jan-Philip Velders + Jason R. Thorpe + Javier Achirica + Jean Tourrilhes + Jean-Louis Charton + Jefferson Ogata + Jesper Dangaard Brouer + Jesper Peterson + Joerg Mayer + John Bankier + Jon Lindgren + Jon Smirl + Juergen Schoenwaelder + Julien Moutinho + Jung-uk Kim + Kazushi Sugyo + Klaus Klein + Koryn Grant + Kris Katterjohn + Krzysztof Halasa + Lorenzo Cavallaro + Loris Degioanni + Love Hörnquist-Ã…strand + Luis MartinGarcia + Maciej W. Rozycki + Marcus Felipe Pereira + Mark C. Brown + Mark Pizzolato + Markus Mayer + Martin Husemann + Márton Németh + Matthew Luckie + Max Laier + Mike Frysinger + Mike Kershaw + Mike Wiacek + Miroslav Lichvar + Monroe Williams + + N. Leiten + Nicolas Dade + Octavian Cerna + Olaf Kirch + Ollie Wild + Onno van der Linden + Paolo Abeni + Patrick Marie + Patrick McHardy + Paul Mundt + Pavel Kankovsky + Pawel Pokrywka + Peter Fales + Peter Jeremy + Peter Volkov + Phil Wood + Rafal Maszkowski + + Richard Stearn + Rick Jones + Robert Edmonds + Roberto Mariani + Romain Francoise + Sagun Shakya + Scott Barron + Scott Gifford + Scott Mcmillan + Sebastian Krahmer + Sebastien Roy + Sepherosa Ziehau + Shaun Clowes + Solomon Peachy + Stefan Hudson + Stephen Donnelly + Takashi Yamamoto + Tanaka Shin-ya + Tobias Poschwatta + Tony Li + Torsten Landschoff + Uns Lider + Uwe Girlich + Wesley Shields + Xianjie Zhang + Xin Li + Yen Yen Lim + Yvan Vanhullebus + Yoann Vandoorselaere The original LBL crew: - Steve McCanne - Craig Leres - Van Jacobson + Steve McCanne + Craig Leres + Van Jacobson Past maintainers: - Jun-ichiro itojun Hagino + Jun-ichiro itojun Hagino Modified: head/contrib/libpcap/Makefile.in ============================================================================== --- head/contrib/libpcap/Makefile.in Mon May 14 05:10:41 2012 (r235425) +++ head/contrib/libpcap/Makefile.in Mon May 14 05:12:56 2012 (r235426) @@ -46,19 +46,21 @@ VPATH = @srcdir@ LD = /usr/bin/ld CC = @CC@ +AR = @AR@ CCOPT = @V_CCOPT@ INCLS = -I. @V_INCLS@ DEFS = @DEFS@ @V_DEFS@ ADDLOBJS = @ADDLOBJS@ ADDLARCHIVEOBJS = @ADDLARCHIVEOBJS@ LIBS = @LIBS@ +CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ DYEXT = @DYEXT@ V_RPATH_OPT = @V_RPATH_OPT@ PROG=libpcap # Standard CFLAGS -CFLAGS = $(CCOPT) $(INCLS) $(DEFS) +FULL_CFLAGS = $(CCOPT) $(INCLS) $(DEFS) $(CFLAGS) INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -78,9 +80,9 @@ YACC = @V_YACC@ # problem if you don't own the file but can write to the directory. .c.o: @rm -f $@ - $(CC) $(CFLAGS) -c $(srcdir)/$*.c + $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c -PSRC = pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @CAN_SRC@ +PSRC = pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @CAN_SRC@ @NETFILTER_SRC@ FSRC = fad-@V_FINDALLDEVS@.c SSRC = @SSRC@ CSRC = pcap.c inet.c gencode.c optimize.c nametoaddr.c etherent.c \ @@ -123,14 +125,29 @@ HDR = $(PUBHDR) \ sf-pcap-ng.h \ sunatmpos.h +TESTS = \ + filtertest \ + findalldevstest \ + nonblocktest \ + opentest \ + selpolltest + +TESTS_SRC = \ + tests/filtertest.c \ + tests/findalldevstest.c \ + tests/nonblocktest.c \ + tests/opentest.c \ + tests/reactivatetest.c \ + tests/selpolltest.c + GENHDR = \ scanner.h tokdefs.h version.h TAGFILES = \ $(SRC) $(HDR) -CLEANFILES = $(OBJ) libpcap.* filtertest findalldevstest selpolltest \ - opentest $(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \ +CLEANFILES = $(OBJ) libpcap.* $(TESTS) \ + $(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \ lex.yy.c pcap-config MAN1 = pcap-config.1 @@ -141,8 +158,10 @@ MAN3PCAP_EXPAND = \ pcap_datalink.3pcap.in \ pcap_dump_open.3pcap.in \ pcap_list_datalinks.3pcap.in \ + pcap_list_tstamp_types.3pcap.in \ pcap_open_dead.3pcap.in \ - pcap_open_offline.3pcap.in + pcap_open_offline.3pcap.in \ + pcap_set_tstamp_type.3pcap.in MAN3PCAP_NOEXPAND = \ pcap_activate.3pcap \ @@ -160,9 +179,7 @@ MAN3PCAP_NOEXPAND = \ pcap_file.3pcap \ pcap_fileno.3pcap \ pcap_findalldevs.3pcap \ - pcap_freealldevs.3pcap \ pcap_freecode.3pcap \ - pcap_free_datalinks.3pcap \ pcap_get_selectable_fd.3pcap \ pcap_geterr.3pcap \ pcap_inject.3pcap \ @@ -187,7 +204,9 @@ MAN3PCAP_NOEXPAND = \ pcap_snapshot.3pcap \ pcap_stats.3pcap \ pcap_statustostr.3pcap \ - pcap_strerror.3pcap + pcap_strerror.3pcap \ + pcap_tstamp_type_name_to_val.3pcap \ + pcap_tstamp_type_val_to_name.3pcap MAN3PCAP = $(MAN3PCAP_NOEXPAND) $(MAN3PCAP_EXPAND:.in=) @@ -196,9 +215,11 @@ MANFILE = \ MANMISC = \ pcap-filter.manmisc.in \ - pcap-linktype.manmisc.in + pcap-linktype.manmisc.in \ + pcap-tstamp.manmisc.in EXTRA_DIST = \ + $(TESTS_SRC) \ CHANGES \ ChmodBPF/ChmodBPF \ ChmodBPF/StartupParameters.plist \ @@ -237,8 +258,6 @@ EXTRA_DIST = \ fad-null.c \ fad-sita.c \ fad-win32.c \ - filtertest.c \ - findalldevstest.c \ grammar.y \ install-sh \ lbl/os-aix4.h \ @@ -263,7 +282,6 @@ EXTRA_DIST = \ msdos/pktdrvr.c \ msdos/pktdrvr.h \ msdos/readme.dos \ - opentest.c \ org.tcpdump.chmod_bpf.plist \ packaging/pcap.spec.in \ pcap-bpf.c \ @@ -282,6 +300,8 @@ EXTRA_DIST = \ pcap-libdlpi.c \ pcap-linux.c \ pcap-namedb.h \ + pcap-netfilter-linux.c \ + pcap-netfilter-linux.h \ pcap-nit.c \ pcap-null.c \ pcap-pf.c \ @@ -299,7 +319,6 @@ EXTRA_DIST = \ pcap-win32.c \ runlex.sh \ scanner.l \ - selpolltest.c \ Win32/Include/Gnuc.h \ Win32/Include/addrinfo.h \ Win32/Include/bittypes.h \ @@ -328,7 +347,7 @@ all: libpcap.a shared pcap-config libpcap.a: $(OBJ) @rm -f $@ - ar rc $@ $(OBJ) $(ADDLARCHIVEOBJS) + $(AR) rc $@ $(OBJ) $(ADDLARCHIVEOBJS) $(RANLIB) $@ shared: libpcap.$(DYEXT) @@ -401,7 +420,7 @@ libpcap.sl: $(OBJ) libpcap.shareda: $(OBJ) @rm -f $@ shr.o $(CC) @V_SHLIB_OPT@ -o shr.o $(OBJ) $(ADDLOBJS) $(LDFLAGS) $(LIBS) - ar rc $@ shr.o + $(AR) rc $@ shr.o # # For platforms that don't support shared libraries (or on which we @@ -414,7 +433,7 @@ scanner.c: $(srcdir)/scanner.l $(srcdir)/runlex.sh $(LEX) -o$@ $< scanner.o: scanner.c tokdefs.h - $(CC) $(CFLAGS) -c scanner.c + $(CC) $(FULL_CFLAGS) -c scanner.c pcap.o: version.h @@ -427,13 +446,13 @@ grammar.c: $(srcdir)/grammar.y grammar.o: grammar.c @rm -f $@ - $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c + $(CC) $(FULL_CFLAGS) -Dyylval=pcap_lval -c grammar.c version.o: version.c - $(CC) $(CFLAGS) -c version.c + $(CC) $(FULL_CFLAGS) -c version.c snprintf.o: $(srcdir)/missing/snprintf.c - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c + $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c version.c: $(srcdir)/VERSION @rm -f $@ @@ -467,35 +486,47 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filt ln -s $(srcdir)/bpf/net/bpf_filter.c bpf_filter.c bpf_filter.o: bpf_filter.c - $(CC) $(CFLAGS) -c bpf_filter.c + $(CC) $(FULL_CFLAGS) -c bpf_filter.c # # Generate the pcap-config script. # -pcap-config: $(srcdir)/pcap-config.in +# Some Makes, e.g. AIX Make and Solaris Make, can't handle "--file=$@.tmp:$<"; +# for example, the Solaris 9 make man page says +# +# Because make assigns $< and $* as it would for implicit rules +# (according to the suffixes list and the directory contents), +# they may be unreliable when used within explicit target entries. +# +# and this is an explicit target entry. +# +# Therefore, instead of using $<, we explicitly put in $(srcdir)/pcap-config.in. +# +pcap-config: $(srcdir)/pcap-config.in ./config.status @rm -f $@ $@.tmp - sed -e 's|@includedir[@]|$(includedir)|g' \ - -e 's|@libdir[@]|$(libdir)|g' \ - -e 's|@LIBS[@]|$(LIBS)|g' \ - -e 's|@V_RPATH_OPT[@]|$(V_RPATH_OPT)|g' \ - $(srcdir)/pcap-config.in >$@.tmp + ./config.status --file=$@.tmp:$(srcdir)/pcap-config.in mv $@.tmp $@ chmod a+x $@ # # Test programs - not built by default, and not installed. # -filtertest: filtertest.c libpcap.a - $(CC) $(CFLAGS) -I. -L. -o filtertest $(srcdir)/filtertest.c libpcap.a $(LIBS) +tests: $(TESTS) + +filtertest: tests/filtertest.c libpcap.a + $(CC) $(FULL_CFLAGS) -I. -L. -o filtertest $(srcdir)/tests/filtertest.c libpcap.a $(LIBS) + +findalldevstest: tests/findalldevstest.c libpcap.a + $(CC) $(FULL_CFLAGS) -I. -L. -o findalldevstest $(srcdir)/tests/findalldevstest.c libpcap.a $(LIBS) -findalldevstest: findalldevstest.c libpcap.a - $(CC) $(CFLAGS) -I. -L. -o findalldevstest $(srcdir)/findalldevstest.c libpcap.a $(LIBS) +nonblocktest: tests/nonblocktest.c libpcap.a + $(CC) $(FULL_CFLAGS) -I. -L. -o nonblocktest $(srcdir)/tests/nonblocktest.c libpcap.a $(LIBS) -selpolltest: selpolltest.c libpcap.a - $(CC) $(CFLAGS) -I. -L. -o selpolltest $(srcdir)/selpolltest.c libpcap.a $(LIBS) +opentest: tests/opentest.c libpcap.a + $(CC) $(FULL_CFLAGS) -I. -L. -o opentest $(srcdir)/tests/opentest.c libpcap.a $(LIBS) -opentest: opentest.c libpcap.a - $(CC) $(CFLAGS) -I. -L. -o opentest $(srcdir)/opentest.c libpcap.a $(LIBS) +selpolltest: tests/selpolltest.c libpcap.a + $(CC) $(FULL_CFLAGS) -I. -L. -o selpolltest $(srcdir)/tests/selpolltest.c libpcap.a $(LIBS) install: install-shared install-archive pcap-config [ -d $(DESTDIR)$(libdir) ] || \ @@ -533,12 +564,21 @@ install: install-shared install-archive rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap ln $(DESTDIR)$(mandir)/man3/pcap_dump_open.3pcap \ $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap + rm -f $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3pcap + ln $(DESTDIR)$(mandir)/man3/pcap_findalldevs.3pcap \ + $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap ln $(DESTDIR)$(mandir)/man3/pcap_geterr.3pcap \ $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap ln $(DESTDIR)$(mandir)/man3/pcap_inject.3pcap \ $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap + rm -f $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3pcap + ln $(DESTDIR)$(mandir)/man3/pcap_list_datalinks.3pcap \ + $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3pcap + rm -f $(DESTDIR)$(mandir)/man3/pcap_free_tstamp_types.3pcap + ln $(DESTDIR)$(mandir)/man3/pcap_list_tstamp_types.3pcap \ + $(DESTDIR)$(mandir)/man3/pcap_free_tstamp_types.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap ln $(DESTDIR)$(mandir)/man3/pcap_loop.3pcap \ $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap @@ -622,8 +662,11 @@ uninstall: uninstall-shared rm -f $(DESTDIR)$(mandir)/man3/$$i; done rm -f $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap + rm -f $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap + rm -f $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3pcap + rm -f $(DESTDIR)$(mandir)/man3/pcap_free_tstamp_types.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_next.3pcap @@ -660,7 +703,7 @@ clean: distclean: clean rm -f Makefile config.cache config.log config.status \ - config.h gnuc.h os-proto.h bpf_filter.c pcap-config \ + config.h gnuc.h net os-proto.h bpf_filter.c pcap-config \ stamp-h stamp-h.in rm -f $(MAN3PCAP_EXPAND:.in=) $(MANFILE:.in=) $(MANMISC:.in=) rm -rf autom4te.cache Modified: head/contrib/libpcap/README ============================================================================== --- head/contrib/libpcap/README Mon May 14 05:10:41 2012 (r235425) +++ head/contrib/libpcap/README Mon May 14 05:12:56 2012 (r235426) @@ -63,13 +63,14 @@ added overhead (especially, for selectiv would translate BPF filters into a filter program that is compatible with the underlying kernel subsystem, but this is not yet implemented. -BPF is standard in 4.4BSD, BSD/OS, NetBSD, FreeBSD, and OpenBSD. DEC -OSF/1/Digital UNIX/Tru64 UNIX uses the packetfilter interface but has -been extended to accept BPF filters (which libpcap utilizes). Also, you -can add BPF filter support to Ultrix using the kernel source and/or -object patches available in: +BPF is standard in 4.4BSD, BSD/OS, NetBSD, FreeBSD, OpenBSD, DragonFly +BSD, and Mac OS X; an older, modified and undocumented version is +standard in AIX. {DEC OSF/1, Digital UNIX, Tru64 UNIX} uses the +packetfilter interface but has been extended to accept BPF filters +(which libpcap utilizes). Also, you can add BPF filter support to +Ultrix using the kernel source and/or object patches available in: - ftp://gatekeeper.dec.com/pub/DEC/net/bpfext42.tar.Z. + http://www.tcpdump.org/other/bpfext42.tar.Z Linux, in the 2.2 kernel and later kernels, has a "Socket Filter" mechanism that accepts BPF filters; see the README.linux file for Modified: head/contrib/libpcap/VERSION ============================================================================== --- head/contrib/libpcap/VERSION Mon May 14 05:10:41 2012 (r235425) +++ head/contrib/libpcap/VERSION Mon May 14 05:12:56 2012 (r235426) @@ -1 +1 @@ -1.1.1 +1.2.1 Modified: head/contrib/libpcap/bpf/net/bpf_filter.c ============================================================================== --- head/contrib/libpcap/bpf/net/bpf_filter.c Mon May 14 05:10:41 2012 (r235425) +++ head/contrib/libpcap/bpf/net/bpf_filter.c Mon May 14 05:12:56 2012 (r235426) @@ -619,7 +619,7 @@ bpf_validate(f, len) /* * Check for constant division by 0. */ - if (BPF_RVAL(p->code) == BPF_K && p->k == 0) + if (BPF_SRC(p->code) == BPF_K && p->k == 0) return 0; break; default: Modified: head/contrib/libpcap/config.h.in ============================================================================== --- head/contrib/libpcap/config.h.in Mon May 14 05:10:41 2012 (r235425) +++ head/contrib/libpcap/config.h.in Mon May 14 05:12:56 2012 (r235426) @@ -18,6 +18,9 @@ /* define if you have streams capable DAG API */ #undef HAVE_DAG_STREAMS_API +/* define if you have vdag_set_device_info() */ +#undef HAVE_DAG_VDAG + /* Define to 1 if you have the declaration of `ether_hostton', and to 0 if you don't. */ #undef HAVE_DECL_ETHER_HOSTTON @@ -52,12 +55,30 @@ /* if libnl exists */ #undef HAVE_LIBNL +/* if libnl exists and is version 2.x */ +#undef HAVE_LIBNL_2_x + /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_COMPILER_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_ETHTOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_IF_PACKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_NET_TSTAMP_H + /* if tp_vlan_tci exists */ #undef HAVE_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_TYPES_H + /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_USBDEVICE_FS_H @@ -73,6 +94,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IF_ETHER_H +/* Define to 1 if you have the header file. */ +#undef HAVE_NETPACKET_IF_PACKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETPACKET_PACKET_H + /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_MEDIA_H @@ -217,6 +244,9 @@ /* target host supports CAN sniffing */ #undef PCAP_SUPPORT_CAN +/* target host supports netfilter sniffing */ +#undef PCAP_SUPPORT_NETFILTER + /* target host supports USB sniffing */ #undef PCAP_SUPPORT_USB Modified: head/contrib/libpcap/configure ============================================================================== --- head/contrib/libpcap/configure Mon May 14 05:10:41 2012 (r235425) +++ head/contrib/libpcap/configure Mon May 14 05:12:56 2012 (r235426) @@ -679,6 +679,7 @@ HAVE_LINUX_TPACKET_AUXDATA V_LEX V_YACC RANLIB +AR V_CCOPT V_DEFS V_FINDALLDEVS @@ -696,6 +697,8 @@ MAN_FILE_FORMATS MAN_MISC_INFO PCAP_SUPPORT_USB USB_SRC +PCAP_SUPPORT_NETFILTER +NETFILTER_SRC PCAP_SUPPORT_BT BT_SRC PCAP_SUPPORT_CAN @@ -1293,6 +1296,7 @@ Optional Features: getaddrinfo available] --enable-optimizer-dbg build optimizer debugging code --enable-yydebug build parser debugging code + --disable-universal don't build universal on OS X --enable-bluetooth enable Bluetooth support [default=yes, if support available] --enable-can enable CAN support [default=yes, if support @@ -3229,7 +3233,24 @@ _ACEOF # or accepts command-line arguments like # those the GNU linker accepts. # - V_CCOPT="$V_CCOPT -fpic" + # Some instruction sets require -fPIC on some + # operating systems. Check for them. If you + # have a combination that requires it, add it + # here. + # + PIC_OPT=-fpic + case "$host_cpu" in + + sparc64*) + case "$host_os" in + + freebsd*) + PIC_OPT=-fPIC + ;; + esac + ;; + esac + V_CCOPT="$V_CCOPT $PIC_OPT" V_SONAME_OPT="-Wl,-soname," V_RPATH_OPT="-Wl,-rpath," ;; @@ -5425,24 +5446,29 @@ fi done -for ac_header in net/pfvar.h +for ac_header in linux/types.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else - cat >conftest.$ac_ext <<_ACEOF + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include -#include - +$ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext @@ -5462,19 +5488,94 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" + ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_Header=no" + ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } + +fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -5484,29 +5585,33 @@ fi done -if test "$ac_cv_header_net_pfvar_h" = yes; then - # - # Check for various PF actions. - # - { echo "$as_me:$LINENO: checking whether net/pfvar.h defines PF_NAT through PF_NORDR" >&5 -echo $ECHO_N "checking whether net/pfvar.h defines PF_NAT through PF_NORDR... $ECHO_C" >&6; } - cat >conftest.$ac_ext <<_ACEOF + + + +for ac_header in linux/if_packet.h netpacket/packet.h netpacket/if_packet.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon May 14 09:32:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8B22C106566C; Mon, 14 May 2012 09:32:11 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 741D68FC08; Mon, 14 May 2012 09:32:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4E9WBGL024852; Mon, 14 May 2012 09:32:11 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4E9WBEE024849; Mon, 14 May 2012 09:32:11 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201205140932.q4E9WBEE024849@svn.freebsd.org> From: Xin LI Date: Mon, 14 May 2012 09:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235429 - head/contrib/libpcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2012 09:32:11 -0000 Author: delphij Date: Mon May 14 09:32:10 2012 New Revision: 235429 URL: http://svn.freebsd.org/changeset/base/235429 Log: Add 3 missing files that was generated but not included with the initial commit. Reported by: buganini via IRC MFC after: 2 weeks Added: head/contrib/libpcap/pcap-tstamp.manmisc head/contrib/libpcap/pcap_list_tstamp_types.3pcap head/contrib/libpcap/pcap_set_tstamp_type.3pcap Added: head/contrib/libpcap/pcap-tstamp.manmisc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libpcap/pcap-tstamp.manmisc Mon May 14 09:32:10 2012 (r235429) @@ -0,0 +1,132 @@ +.\" +.\" Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997 +.\" The Regents of the University of California. All rights reserved. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that: (1) source code distributions +.\" retain the above copyright notice and this paragraph in its entirety, (2) +.\" distributions including binary code include the above copyright notice and +.\" this paragraph in its entirety in the documentation or other materials +.\" provided with the distribution, and (3) all advertising materials mentioning +.\" features or use of this software display the following acknowledgement: +.\" ``This product includes software developed by the University of California, +.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of +.\" the University nor the names of its contributors may be used to endorse +.\" or promote products derived from this software without specific prior +.\" written permission. +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED +.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" +.TH PCAP-TSTAMP 7 "22 August 2010" +.SH NAME +pcap-tstamp \- packet time stamps in libpcap +.SH DESCRIPTION +When capturing traffic, each packet is given a time stamp representing, +for incoming packets, the arrival time of the packet and, for outgoing +packets, the transmission time of the packet. This time is an +approximation of the arrival or transmission time. If it is supplied by +the operating system running on the host on which the capture is being +done, there are several reasons why it might not precisely represent the +arrival or transmission time: +.IP +if the time stamp is applied to the packet when the networking stack +receives the packet, the networking stack might not see the packet until +an interrupt is delivered for the packet or a timer event causes the +networking device driver to poll for packets, and the time stamp might +not be applied until the packet has had some processing done by other +code in the networking stack, so there might be a significant delay +between the time when the last bit of the packet is received by the +capture device and when the networking stack time-stamps the packet; +.IP +the timer used to generate the time stamps might have low resolution, +for example, it might be a timer updated once per host operating system +timer tick, with the host operating system timer ticking once every few +milliseconds; +.IP +a high-resolution timer might use a counter that runs at a rate +dependent on the processor clock speed, and that clock speed might be +adjusted upwards or downwards over time and the timer might not be able +to compensate for all those adjustments; +.IP +the host operating system's clock might be adjusted over time to match a +time standard to which the host is being synchronized, which might be +done by temporarily slowing down or speeding up the clock or by making a +single adjustment; +.IP +different CPU cores on a multi-core or multi-processor system might be +running at different speeds, or might not have time counters all +synchronized, so packets time-stamped by different cores might not have +consistent time stamps. +.LP +In addition, packets time-stamped by different cores might be +time-stamped in one order and added to the queue of packets for libpcap +to read in another order, so time stamps might not be monotonically +increasing. +.LP +Some capture devices on some platforms can provide time stamps for +packets; those time stamps are usually high-resolution time stamps, and +are usually applied to the packet when the first or last bit of the +packet arrives, and are thus more accurate than time stamps provided by +the host operating system. Those time stamps might not, however, be +synchronized with the host operating system's clock, so that, for +example, the time stamp of a packet might not correspond to the time +stamp of an event on the host triggered by the arrival of that packet. +.LP +Depending on the capture device and the software on the host, libpcap +might allow different types of time stamp to be used. The +.BR pcap_list_tstamp_types (3PCAP) +routine provides, for a packet capture handle created by +.BR pcap_create (3PCAP) +but not yet activated by +.BR pcap_activate (3PCAP), +a list of time stamp types supported by the capture device for that +handle. +The list might be empty, in which case no choice of time stamp type is +offered for that capture device. If the list is not empty, the +.BR pcap_set_tstamp_type (3PCAP) +routine can be used after a +.B pcap_create() +call and before a +.B pcap_activate() +call to specify the type of time stamp to be used on the device. +The time stamp types are listed here; the first value is the #define to +use in code, the second value is the value returned by +.B pcap_tstamp_type_val_to_name() +and accepted by +.BR pcap_tstamp_name_to_val() . +.RS 5 +.TP 5 +.BR PCAP_TSTAMP_HOST " - " host +Time stamp provided by the host on which the capture is being done. The +precision of this time stamp is unspecified; it might or might not be +synchronized with the host operating system's clock. +.TP 5 +.BR PCAP_TSTAMP_HOST_LOWPREC " - " host_lowprec +Time stamp provided by the host on which the capture is being done. +This is a low-precision time stamp, synchronized with the host operating +system's clock. +.TP 5 +.BR PCAP_TSTAMP_HOST_HIPREC " - " host_hiprec +Time stamp provided by the host on which the capture is being done. +This is a high-precision time stamp; it might or might not be +synchronized with the host operating system's clock. It might be more +expensive to fetch than +.BR PCAP_TSTAMP_HOST_LOWPREC . +.TP 5 +.BR PCAP_TSTAMP_ADAPTER " - " adapter +Time stamp provided by the network adapter on which the capture is being +done. This is a high-precision time stamp, synchronized with the host +operating system's clock. +.TP 5 +.BR PCAP_TSTAMP_ADAPTER_UNSYNCED " - " adapter_unsynced +Time stamp provided by the network adapter on which the capture is being +done. This is a high-precision time stamp; it is not synchronized with +the host operating system's clock. +.RE +.SH SEE ALSO +pcap_set_tstamp_type(3PCAP), +pcap_list_tstamp_types(3PCAP), +pcap_tstamp_type_val_to_name(3PCAP), +pcap_tstamp_name_to_val(3PCAP) Added: head/contrib/libpcap/pcap_list_tstamp_types.3pcap ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libpcap/pcap_list_tstamp_types.3pcap Mon May 14 09:32:10 2012 (r235429) @@ -0,0 +1,70 @@ +.\" +.\" Copyright (c) 1994, 1996, 1997 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that: (1) source code distributions +.\" retain the above copyright notice and this paragraph in its entirety, (2) +.\" distributions including binary code include the above copyright notice and +.\" this paragraph in its entirety in the documentation or other materials +.\" provided with the distribution, and (3) all advertising materials mentioning +.\" features or use of this software display the following acknowledgement: +.\" ``This product includes software developed by the University of California, +.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of +.\" the University nor the names of its contributors may be used to endorse +.\" or promote products derived from this software without specific prior +.\" written permission. +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED +.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" +.TH PCAP_LIST_TSTAMP_TYPES 3PCAP "21 August 2010" +.SH NAME +pcap_list_tstamp_types, pcap_free_tstamp_types \- get a list of time +stamp types supported by a capture device, and free that list +.SH SYNOPSIS +.nf +.ft B +#include +.ft +.LP +.ft B +int pcap_list_tstamp_types(pcap_t *p, int **tstamp_typesp); +void pcap_free_tstamp_types(int *tstamp_types); +.ft +.fi +.SH DESCRIPTION +.B pcap_list_tstamp_types() +is used to get a list of the supported time stamp types of the interface +associated with the pcap descriptor. +.B pcap_list_tstamp_types() +allocates an array to hold the list and sets +.I *tstamp_typesp +to point to the array. +See +.BR pcap-tstamp (7) +for a list of all the time stamp types. +.PP +The caller is responsible for freeing the array with +.BR pcap_free_tstamp_types() , +which frees the list pointed to by +.IR tstamp_types . +.SH RETURN VALUE +.B pcap_list_tstamp_types() +returns the number of time stamp types in the array on success and +.B PCAP_ERROR +on failure. +A return value of zero means that you cannot specify a time stamp type; +you are limited to the capture device's default time stamp type. +If +.B PCAP_ERROR +is returned, +.B pcap_geterr() +or +.B pcap_perror() +may be called with +.I p +as an argument to fetch or display the error text. +.SH SEE ALSO +pcap(3PCAP), pcap_geterr(3PCAP), pcap_tstamp_type_val_to_name(3PCAP), +pcap-tstamp(7) Added: head/contrib/libpcap/pcap_set_tstamp_type.3pcap ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libpcap/pcap_set_tstamp_type.3pcap Mon May 14 09:32:10 2012 (r235429) @@ -0,0 +1,65 @@ +.\" +.\" Copyright (c) 1994, 1996, 1997 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that: (1) source code distributions +.\" retain the above copyright notice and this paragraph in its entirety, (2) +.\" distributions including binary code include the above copyright notice and +.\" this paragraph in its entirety in the documentation or other materials +.\" provided with the distribution, and (3) all advertising materials mentioning +.\" features or use of this software display the following acknowledgement: +.\" ``This product includes software developed by the University of California, +.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of +.\" the University nor the names of its contributors may be used to endorse +.\" or promote products derived from this software without specific prior +.\" written permission. +.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED +.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +.\" +.TH PCAP_SET_TSTAMP_TYPE 3PCAP "21 August 2010" +.SH NAME +pcap_set_tstamp_type \- set the time stamp type to be used by a +capture device +.SH SYNOPSIS +.nf +.ft B +#include +.ft +.LP +.ft B +int pcap_set_tstamp_type(pcap_t *p, int tstamp_type); +.ft +.fi +.SH DESCRIPTION +.B pcap_set_tstamp_type() +sets the the type of time stamp desired for packets captured on the pcap +descriptor to the type specified by +.IR tstamp_type . +It must be called on a pcap descriptor created by +.B pcap_create() +that has not yet been activated by +.BR pcap_activate() . +.B pcap_list_tstamp_types() +will give a list of the time stamp types supported by a given capture +device. +See +.BR pcap-tstamp (7) +for a list of all the time stamp types. +.SH RETURN VALUE +.B pcap_set_tstamp_type() +returns 0 on success if the specified time stamp type is expected to be +supported by the capture device, +.B PCAP_WARNING_TSTAMP_TYPE_NOTSUP +on success if the specified time stamp type is not supported by the +capture device, +.B PCAP_ERROR_ACTIVATED +if called on a capture handle that has been activated, and +.B PCAP_ERROR_CANTSET_TSTAMP_TYPE +if the capture device doesn't support setting the time stamp type. +.SH SEE ALSO +pcap(3PCAP), +pcap_list_tstamp_types(3PCAP), +pcap_tstamp_type_name_to_val(3PCAP), +pcap-tstamp(7) From owner-svn-src-head@FreeBSD.ORG Mon May 14 09:53:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF9711065674; Mon, 14 May 2012 09:53:54 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF6F28FC19; Mon, 14 May 2012 09:53:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4E9rsWW025671; Mon, 14 May 2012 09:53:54 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4E9rsbB025667; Mon, 14 May 2012 09:53:54 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201205140953.q4E9rsbB025667@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 14 May 2012 09:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235432 - head/usr.bin/sort X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2012 09:53:55 -0000 Author: gabor Date: Mon May 14 09:53:54 2012 New Revision: 235432 URL: http://svn.freebsd.org/changeset/base/235432 Log: - Fix build with clang Modified: head/usr.bin/sort/file.c head/usr.bin/sort/sort.c Modified: head/usr.bin/sort/file.c ============================================================================== --- head/usr.bin/sort/file.c Mon May 14 09:51:43 2012 (r235431) +++ head/usr.bin/sort/file.c Mon May 14 09:53:54 2012 (r235432) @@ -598,7 +598,7 @@ openfile(const char *fn, const char *mod snprintf(cmd, cmdsz - 1, "%s > %s", compress_program, fn); else - err(2, getstr(7)); + err(2, "%s", getstr(7)); if ((file = popen(cmd, mode)) == NULL) err(2, NULL); @@ -939,7 +939,7 @@ file_header_init(struct file_header **fh (*fh)->fr = file_reader_init(fn); if ((*fh)->fr == NULL) { perror(fn); - err(2, getstr(8)); + err(2, "%s", getstr(8)); } line = file_reader_readline((*fh)->fr); if (line == NULL) { @@ -1276,7 +1276,7 @@ sort_list_to_file(struct sort_list *list sort_opts_vals.sort_method = SORT_RADIXSORT; } else if (sort_opts_vals.sort_method == SORT_RADIXSORT) - err(2, getstr(9)); + err(2, "%s", getstr(9)); /* * to handle stable sort and the unique cases in the @@ -1292,7 +1292,7 @@ sort_list_to_file(struct sort_list *list sort_opts_vals.sort_method = SORT_MERGESORT; break; default: - errx(2, getstr(10)); + errx(2, "%s", getstr(10)); }; } Modified: head/usr.bin/sort/sort.c ============================================================================== --- head/usr.bin/sort/sort.c Mon May 14 09:51:43 2012 (r235431) +++ head/usr.bin/sort/sort.c Mon May 14 09:53:54 2012 (r235432) @@ -74,9 +74,9 @@ MD5_CTX md5_ctx; * is found. */ const char *nlsstr[] = { "", -/* 1*/"you cannot use -%c and -%c together", +/* 1*/"mutually exclusive flags", /* 2*/"extra argument not allowed with -c", -/* 3*/"Unknown feature: %s", +/* 3*/"Unknown feature", /* 4*/"Wrong memory buffer specification", /* 5*/"0 field in key specs", /* 6*/"0 column in key specs", @@ -396,7 +396,7 @@ parse_memory_buffer_value(const char *va membuf = strtoll(value, &endptr, 10); if (errno != 0) { - warn(getstr(4)); + warn("%s",getstr(4)); membuf = available_free_memory; } else { switch (*endptr){ @@ -445,12 +445,10 @@ parse_memory_buffer_value(const char *va * Signal handler that clears the temporary files. */ static void -sig_handler(int sig, siginfo_t *siginfo, void *context) +sig_handler(int sig __unused, siginfo_t *siginfo __unused, + void *context __unused) { - sig = sig; - siginfo = siginfo; - context = context; clear_tmp_files(); exit(-1); } @@ -512,7 +510,7 @@ static void unknown(const char *what) { - errx(2, getstr(3), what); + errx(2, "%s: %s", getstr(3), what); } /* @@ -533,14 +531,13 @@ check_mutually_exclusive_flags(char c, b if (mec != c) { if (mef_flags[i]) { if (found_this) - errx(1, getstr(1), c, mec); + errx(1, "%c:%c: %s", c, mec, getstr(1)); found_others = true; fo_index = i; } } else { if (found_others) - errx(1, getstr(1), c, - mutually_exclusive_flags[fo_index]); + errx(1, "%c:%c: %s", c, mutually_exclusive_flags[fo_index], getstr(1)); mef_flags[i] = true; found_this = true; } @@ -661,7 +658,7 @@ parse_pos(const char *s, struct key_spec if (errno != 0) errx(2, "%s: -k", strerror(errno)); if (ks->f2 == 0) { - warn(getstr(5)); + warn("%s",getstr(5)); goto end; } } else { @@ -670,7 +667,7 @@ parse_pos(const char *s, struct key_spec if (errno != 0) errx(2, "%s: -k", strerror(errno)); if (ks->f1 == 0) { - warn(getstr(5)); + warn("%s",getstr(5)); goto end; } } @@ -693,7 +690,7 @@ parse_pos(const char *s, struct key_spec if (errno != 0) errx(2, "%s: -k", strerror(errno)); if (ks->c1 == 0) { - warn(getstr(6)); + warn("%s",getstr(6)); goto end; } } @@ -814,7 +811,7 @@ parse_pos_obs(const char *s, int *nf, in errno = 0; *nf = (size_t) strtoul(f, NULL, 10); if (errno != 0) - errx(2, getstr(11)); + errx(2, "%s", getstr(11)); if (pmatch[2].rm_eo > pmatch[2].rm_so) { len = pmatch[2].rm_eo - pmatch[2].rm_so - 1; @@ -826,7 +823,7 @@ parse_pos_obs(const char *s, int *nf, in errno = 0; *nc = (size_t) strtoul(c, NULL, 10); if (errno != 0) - errx(2, getstr(11)); + errx(2, "%s", getstr(11)); } if (pmatch[3].rm_eo > pmatch[3].rm_so) { @@ -1054,7 +1051,7 @@ main(int argc, char **argv) case 'o': outfile = sort_realloc(outfile, sizeof(char) * (strlen(optarg) + 1)); - strlcpy(outfile, optarg, (strlen(optarg) + 1)); + strlcpy(outfile, optarg, strlen(outfile)); break; case 's': sort_opts_vals.sflag = true; @@ -1183,7 +1180,7 @@ main(int argc, char **argv) #endif if (sort_opts_vals.cflag && sort_opts_vals.mflag) - errx(1, getstr(1), 'm', 'c'); + errx(1, "%c:%c: %s", 'm', 'c', getstr(1)); #ifndef WITHOUT_NLS catclose(catalog); From owner-svn-src-head@FreeBSD.ORG Mon May 14 09:55:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 081FC106566B; Mon, 14 May 2012 09:55:24 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD23C8FC1C; Mon, 14 May 2012 09:55:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4E9tNeG025820; Mon, 14 May 2012 09:55:23 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4E9tNoW025817; Mon, 14 May 2012 09:55:23 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201205140955.q4E9tNoW025817@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 14 May 2012 09:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235434 - head/usr.bin/sort/nls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2012 09:55:24 -0000 Author: gabor Date: Mon May 14 09:55:23 2012 New Revision: 235434 URL: http://svn.freebsd.org/changeset/base/235434 Log: - Update catalogs Modified: head/usr.bin/sort/nls/C.msg head/usr.bin/sort/nls/hu_HU.ISO8859-2.msg Modified: head/usr.bin/sort/nls/C.msg ============================================================================== --- head/usr.bin/sort/nls/C.msg Mon May 14 09:54:16 2012 (r235433) +++ head/usr.bin/sort/nls/C.msg Mon May 14 09:55:23 2012 (r235434) @@ -2,9 +2,15 @@ $ $FreeBSD$ $ $set 1 $quote " -1 "you cannot use -%c and -%c together" +1 "mutually exclusive flags" 2 "extra argument not allowed with -c" -3 "Unknown feature: %s\n" +3 "Unknown feature" 4 "Wrong memory buffer specification" -5 "0 field in key specs\n" -6 "0 column in key specs\n" +5 "0 field in key specs" +6 "0 column in key specs" +7 "Wrong file mode" +8 "Cannot open file for reading" +9 "Radix sort cannot be used with these sort options" +10 "The chosen sort method cannot be used with stable and/or unique sort" +11 "Invalid key position" +12 "Usage: %s [-bcCdfigMmnrsuz] [-kPOS1[,POS2] ... ] [+POS1 [-POS2]] [-S memsize] [-T tmpdir] [-t separator] [-o outfile] [--batch-size size] [--files0-from file] [--heapsort] [--mergesort] [--radixsort] [--qsort] [--nthreads thread_no] [--human-numeric-sort] [--version-sort] [--random-sort [--random-source file]] [--compress-program program] [file ...]\n" Modified: head/usr.bin/sort/nls/hu_HU.ISO8859-2.msg ============================================================================== --- head/usr.bin/sort/nls/hu_HU.ISO8859-2.msg Mon May 14 09:54:16 2012 (r235433) +++ head/usr.bin/sort/nls/hu_HU.ISO8859-2.msg Mon May 14 09:55:23 2012 (r235434) @@ -2,9 +2,15 @@ $ $FreeBSD$ $ $set 1 $quote " -1 "a -%c és -%c opciók nem használhatók együtt" +1 "egymást kizáró opciók" 2 "extra argumentum a -%c opcióval" -3 "Ismeretlen funkció: %s\n" +3 "Ismeretlen funkció\n" 4 "Rossz memória puffer érték" 5 "0 mezõ a kulcsspecifikációban\n" 6 "0 oszlop a kulcsspecifikációban\n" +7 "Helytelen fájl mód" +8 "A fájl nem nyitható meg olvasásra" +9 "A radix rendezés nem használható a megadott rendezési opciókkal" +10 "A választott rendezési mód nem használható a --stable és --unique opciókkal" +11 "Érvénytelen kulcs pozíció" +12 "Használat: %s [-bcCdfigMmnrsuz] [-kPOS1[,POS2] ... ] [+POS1 [-POS2]] [-S memóriaméret] [-T ideiglenes_könyvtár] [-t elválasztó] [-o kimeneti_fájl] [--batch-size méret] [--files0-from fájl] [--heapsort] [--mergesort] [--radixsort] [--qsort] [--nthreads szálak_száma] [--human-numeric-sort] [--version-sort] [--random-sort [--random-source fájl]] [--compress-program program] [fájl ...]\n" From owner-svn-src-head@FreeBSD.ORG Mon May 14 10:06:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E872106566C; Mon, 14 May 2012 10:06:50 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8B988FC1F; Mon, 14 May 2012 10:06:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4EA6nXB026305; Mon, 14 May 2012 10:06:49 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4EA6nDM026299; Mon, 14 May 2012 10:06:49 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201205141006.q4EA6nDM026299@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 14 May 2012 10:06:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235435 - head/usr.bin/sort X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2012 10:06:50 -0000 Author: gabor Date: Mon May 14 10:06:49 2012 New Revision: 235435 URL: http://svn.freebsd.org/changeset/base/235435 Log: - Eliminate initializations if global variables. Compilers are not required to optimize these so it may result in larger binary size. Pointed out by: kib Modified: head/usr.bin/sort/bwstring.c head/usr.bin/sort/coll.c head/usr.bin/sort/file.c head/usr.bin/sort/radixsort.c head/usr.bin/sort/sort.c Modified: head/usr.bin/sort/bwstring.c ============================================================================== --- head/usr.bin/sort/bwstring.c Mon May 14 09:55:23 2012 (r235434) +++ head/usr.bin/sort/bwstring.c Mon May 14 10:06:49 2012 (r235435) @@ -41,10 +41,10 @@ __FBSDID("$FreeBSD$"); #include "bwstring.h" #include "sort.h" -bool byte_sort = false; +bool byte_sort; -static wchar_t **wmonths = NULL; -static unsigned char **cmonths = NULL; +static wchar_t **wmonths; +static unsigned char **cmonths; /* initialise months */ Modified: head/usr.bin/sort/coll.c ============================================================================== --- head/usr.bin/sort/coll.c Mon May 14 09:55:23 2012 (r235434) +++ head/usr.bin/sort/coll.c Mon May 14 10:06:49 2012 (r235435) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include "coll.h" #include "vsort.h" -struct key_specs *keys = NULL; +struct key_specs *keys; size_t keys_num = 0; wchar_t symbol_decimal_point = L'.'; Modified: head/usr.bin/sort/file.c ============================================================================== --- head/usr.bin/sort/file.c Mon May 14 09:55:23 2012 (r235434) +++ head/usr.bin/sort/file.c Mon May 14 10:06:49 2012 (r235435) @@ -54,7 +54,7 @@ unsigned long long free_memory = 1000000 unsigned long long available_free_memory = 1000000; const char *tmpdir = "/var/tmp"; -const char* compress_program = NULL; +const char *compress_program; size_t max_open_files = 16; Modified: head/usr.bin/sort/radixsort.c ============================================================================== --- head/usr.bin/sort/radixsort.c Mon May 14 09:55:23 2012 (r235434) +++ head/usr.bin/sort/radixsort.c Mon May 14 10:06:49 2012 (r235435) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #define SMALL_NODE(sl) ((sl)->tosort_num < 5) /* are we sorting in reverse order ? */ -static bool reverse_sort = false; +static bool reverse_sort; /* sort sub-levels array size */ static const size_t slsz = 256 * sizeof(struct sort_level*); @@ -77,14 +77,14 @@ struct level_stack { struct sort_level *sl; }; -static struct level_stack *g_ls = NULL; +static struct level_stack *g_ls; #if defined(SORT_THREADS) /* stack guarding mutex */ static pthread_mutex_t g_ls_mutex; /* counter: how many items are left */ -static size_t sort_left = 0; +static size_t sort_left; /* guarding mutex */ static pthread_mutex_t sort_left_mutex; Modified: head/usr.bin/sort/sort.c ============================================================================== --- head/usr.bin/sort/sort.c Mon May 14 09:55:23 2012 (r235434) +++ head/usr.bin/sort/sort.c Mon May 14 10:06:49 2012 (r235435) @@ -62,10 +62,10 @@ nl_catd catalog; #define DEFAULT_RANDOM_SORT_SEED_FILE ("/dev/random") #define MAX_DEFAULT_RANDOM_SEED_DATA_SIZE (1024) -static bool need_random = false; -static const char* random_source = DEFAULT_RANDOM_SORT_SEED_FILE; -static const void* random_seed = NULL; -static size_t random_seed_size = 0; +static bool need_random; +static const char *random_source = DEFAULT_RANDOM_SORT_SEED_FILE; +static const void *random_seed; +static size_t random_seed_size; MD5_CTX md5_ctx; @@ -98,26 +98,26 @@ const char *nlsstr[] = { "", struct sort_opts sort_opts_vals; -bool debug_sort = false; -bool need_hint = false; +bool debug_sort; +bool need_hint; #if defined(SORT_THREADS) size_t ncpu = 1; size_t nthreads = 1; #endif -static bool gnusort_numeric_compatibility = false; +static bool gnusort_numeric_compatibility; static struct sort_mods default_sort_mods_object; struct sort_mods * const default_sort_mods = &default_sort_mods_object; -static bool print_symbols_on_debug = false; +static bool print_symbols_on_debug; /* * Arguments from file (when file0-from option is used: */ static int argc_from_file0 = -1; -static char **argv_from_file0 = NULL; +static char **argv_from_file0; /* * Placeholder symbols for options which have no single-character equivalent From owner-svn-src-head@FreeBSD.ORG Mon May 14 14:33:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 249691065742; Mon, 14 May 2012 14:33:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E8608FC0C; Mon, 14 May 2012 14:33:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4EEX8Dr037110; Mon, 14 May 2012 14:33:08 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4EEX8m0037108; Mon, 14 May 2012 14:33:08 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201205141433.q4EEX8m0037108@svn.freebsd.org> From: Glen Barber Date: Mon, 14 May 2012 14:33:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235441 - head/share/man/man8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2012 14:33:09 -0000 Author: gjb (doc committer) Date: Mon May 14 14:33:08 2012 New Revision: 235441 URL: http://svn.freebsd.org/changeset/base/235441 Log: Fix an mdoc(7) formatting nit. Modified: head/share/man/man8/rc.8 Modified: head/share/man/man8/rc.8 ============================================================================== --- head/share/man/man8/rc.8 Mon May 14 13:49:06 2012 (r235440) +++ head/share/man/man8/rc.8 Mon May 14 14:33:08 2012 (r235441) @@ -452,7 +452,7 @@ before starting the daemon. Following tradition, all startup files reside in .Pa /etc . .Sh FILES -.Bl -tag -compact +.Bl -tag -compact -width Pa .It Pa /etc/rc .It Pa /etc/rc.conf .It Pa /etc/rc.conf.local From owner-svn-src-head@FreeBSD.ORG Mon May 14 16:25:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F18A1106566C; Mon, 14 May 2012 16:25:17 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC0D68FC14; Mon, 14 May 2012 16:25:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4EGPHbD041196; Mon, 14 May 2012 16:25:17 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4EGPHsU041190; Mon, 14 May 2012 16:25:17 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201205141625.q4EGPHsU041190@svn.freebsd.org> From: Joel Dahl Date: Mon, 14 May 2012 16:25:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235450 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2012 16:25:18 -0000 Author: joel (doc committer) Date: Mon May 14 16:25:17 2012 New Revision: 235450 URL: http://svn.freebsd.org/changeset/base/235450 Log: mdoc: Avoid playing tricks with Ns: If Nm is present in the SYNOPSIS section, it will be output on its own line. Ns cancels this effect however. This change is also consistent with the rest of our manual pages. Modified: head/share/man/man4/divert.4 head/share/man/man4/gre.4 head/share/man/man4/ipfirewall.4 head/share/man/man4/send.4 head/share/man/man4/siftr.4 Modified: head/share/man/man4/divert.4 ============================================================================== --- head/share/man/man4/divert.4 Mon May 14 15:46:37 2012 (r235449) +++ head/share/man/man4/divert.4 Mon May 14 16:25:17 2012 (r235450) @@ -21,7 +21,7 @@ kernel configuration file: .Ed .Pp Alternatively, to load -.Ns Nm +the driver as a module at boot time, add the following lines into the .Xr loader.conf 5 file: Modified: head/share/man/man4/gre.4 ============================================================================== --- head/share/man/man4/gre.4 Mon May 14 15:46:37 2012 (r235449) +++ head/share/man/man4/gre.4 Mon May 14 16:25:17 2012 (r235450) @@ -37,16 +37,14 @@ .Nd encapsulating network device .Sh SYNOPSIS To compile the -.Ns Nm -device into the kernel, place the following line in the kernel +driver into the kernel, place the following line in the kernel configuration file: .Bd -ragged -offset indent .Cd "device gre" .Ed .Pp Alternatively, to load the -.Ns Nm -device as a module at boot time, place the following line in +driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent if_gre_load="YES" Modified: head/share/man/man4/ipfirewall.4 ============================================================================== --- head/share/man/man4/ipfirewall.4 Mon May 14 15:46:37 2012 (r235449) +++ head/share/man/man4/ipfirewall.4 Mon May 14 16:25:17 2012 (r235450) @@ -9,15 +9,14 @@ .Nd IP packet filter and traffic accounting .Sh SYNOPSIS To compile -.Ns Nm +the driver into the kernel, place the following option in the kernel configuration file: .Bd -ragged -offset indent .Cd "options IPFIREWALL" .Ed .Pp -Other kernel options related to -.Ns Nm +Other related kernel options which may also be useful are: .Bd -ragged -offset indent .Cd "options IPFIREWALL_DEFAULT_TO_ACCEPT" @@ -27,7 +26,7 @@ which may also be useful are: .Ed .Pp To load -.Ns Nm +the driver as a module at boot time, add the following line into the .Xr loader.conf 5 file: Modified: head/share/man/man4/send.4 ============================================================================== --- head/share/man/man4/send.4 Mon May 14 15:46:37 2012 (r235449) +++ head/share/man/man4/send.4 Mon May 14 16:25:17 2012 (r235450) @@ -38,10 +38,7 @@ .Ft int .Fn socket PF_INET6 SOCK_RAW IPPROTO_SEND .Pp -To enable -.Ns Nm -support, load the kernel side SeND as a module. -To load it at boot time, add the following line to +To load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent send_load="YES" Modified: head/share/man/man4/siftr.4 ============================================================================== --- head/share/man/man4/siftr.4 Mon May 14 15:46:37 2012 (r235449) +++ head/share/man/man4/siftr.4 Mon May 14 16:25:17 2012 (r235450) @@ -38,14 +38,14 @@ .Nd Statistical Information For TCP Research .Sh SYNOPSIS To load -.Ns Nm +the driver as a module at run-time, run the following command as root: .Bd -literal -offset indent kldload siftr .Ed .Pp Alternatively, to load -.Ns Nm +the driver as a module at boot time, add the following line into the .Xr loader.conf 5 file: @@ -53,13 +53,16 @@ file: siftr_load="YES" .Ed .Sh DESCRIPTION +The .Nm -.Ns ( Em S Ns tatistical +.Po +.Em S Ns tatistical .Em I Ns nformation .Em F Ns or .Em T Ns CP -.Em R Ns esearch ) -is a kernel module that logs a range of statistics on active TCP connections to +.Em R Ns esearch +.Pc +kernel module logs a range of statistics on active TCP connections to a log file. It provides the ability to make highly granular measurements of TCP connection state, aimed at system administrators, developers and researchers. From owner-svn-src-head@FreeBSD.ORG Mon May 14 17:00:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86BCA106566B; Mon, 14 May 2012 17:00:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7172F8FC08; Mon, 14 May 2012 17:00:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4EH0XF4042470; Mon, 14 May 2012 17:00:33 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4EH0Xwq042468; Mon, 14 May 2012 17:00:33 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201205141700.q4EH0Xwq042468@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 14 May 2012 17:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235451 - head/sys/dev/usb/input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2012 17:00:33 -0000 Author: hselasky Date: Mon May 14 17:00:32 2012 New Revision: 235451 URL: http://svn.freebsd.org/changeset/base/235451 Log: Move reset of USB mouse parameters from the USB mouse attach to the USB mouse device open. Protect against multi character device open. Some other nits. MFC after: 1 week Modified: head/sys/dev/usb/input/ums.c Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Mon May 14 16:25:17 2012 (r235450) +++ head/sys/dev/usb/input/ums.c Mon May 14 17:00:32 2012 (r235451) @@ -134,6 +134,7 @@ struct ums_softc { struct usb_xfer *sc_xfer[UMS_N_TRANSFER]; int sc_pollrate; + int sc_fflags; uint8_t sc_buttons; uint8_t sc_iid; @@ -677,32 +678,13 @@ ums_attach(device_t dev) DPRINTF("size=%d, id=%d\n", isize, sc->sc_iid); #endif - if (sc->sc_buttons > MOUSE_MSC_MAXBUTTON) - sc->sc_hw.buttons = MOUSE_MSC_MAXBUTTON; - else - sc->sc_hw.buttons = sc->sc_buttons; - - sc->sc_hw.iftype = MOUSE_IF_USB; - sc->sc_hw.type = MOUSE_MOUSE; - sc->sc_hw.model = MOUSE_MODEL_GENERIC; - sc->sc_hw.hwid = 0; - - sc->sc_mode.protocol = MOUSE_PROTO_MSC; - sc->sc_mode.rate = -1; - sc->sc_mode.resolution = MOUSE_RES_UNKNOWN; - sc->sc_mode.accelfactor = 0; - sc->sc_mode.level = 0; - sc->sc_mode.packetsize = MOUSE_MSC_PACKETSIZE; - sc->sc_mode.syncmask[0] = MOUSE_MSC_SYNCMASK; - sc->sc_mode.syncmask[1] = MOUSE_MSC_SYNC; - err = usb_fifo_attach(uaa->device, sc, &sc->sc_mtx, &ums_fifo_methods, &sc->sc_fifo, device_get_unit(dev), -1, uaa->info.bIfaceIndex, UID_ROOT, GID_OPERATOR, 0644); - if (err) { + if (err) goto detach; - } + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "parseinfo", CTLTYPE_STRING|CTLFLAG_RD, @@ -825,7 +807,7 @@ ums_put_queue(struct ums_softc *sc, int3 static void ums_reset_buf(struct ums_softc *sc) { - /* reset read queue */ + /* reset read queue, must be called locked */ usb_fifo_reset(sc->sc_fifo.fp[USB_FIFO_RX]); } @@ -836,7 +818,33 @@ ums_open(struct usb_fifo *fifo, int ffla DPRINTFN(2, "\n"); - if (fflags & FREAD) { + /* check for duplicate open, should not happen */ + if (sc->sc_fflags & fflags) + return (EBUSY); + + /* check for first open */ + if (sc->sc_fflags == 0) { + + /* reset all USB mouse parameters */ + + if (sc->sc_buttons > MOUSE_MSC_MAXBUTTON) + sc->sc_hw.buttons = MOUSE_MSC_MAXBUTTON; + else + sc->sc_hw.buttons = sc->sc_buttons; + + sc->sc_hw.iftype = MOUSE_IF_USB; + sc->sc_hw.type = MOUSE_MOUSE; + sc->sc_hw.model = MOUSE_MODEL_GENERIC; + sc->sc_hw.hwid = 0; + + sc->sc_mode.protocol = MOUSE_PROTO_MSC; + sc->sc_mode.rate = -1; + sc->sc_mode.resolution = MOUSE_RES_UNKNOWN; + sc->sc_mode.accelfactor = 0; + sc->sc_mode.level = 0; + sc->sc_mode.packetsize = MOUSE_MSC_PACKETSIZE; + sc->sc_mode.syncmask[0] = MOUSE_MSC_SYNCMASK; + sc->sc_mode.syncmask[1] = MOUSE_MSC_SYNC; /* reset status */ @@ -847,21 +855,31 @@ ums_open(struct usb_fifo *fifo, int ffla sc->sc_status.dy = 0; sc->sc_status.dz = 0; /* sc->sc_status.dt = 0; */ + } + if (fflags & FREAD) { + /* allocate RX buffer */ if (usb_fifo_alloc_buffer(fifo, UMS_BUF_SIZE, UMS_IFQ_MAXLEN)) { return (ENOMEM); } } + + sc->sc_fflags |= fflags & (FREAD | FWRITE); return (0); } static void ums_close(struct usb_fifo *fifo, int fflags) { - if (fflags & FREAD) { + struct ums_softc *sc = usb_fifo_softc(fifo); + + DPRINTFN(2, "\n"); + + if (fflags & FREAD) usb_fifo_free_buffer(fifo); - } + + sc->sc_fflags &= ~(fflags & (FREAD | FWRITE)); } static int @@ -891,7 +909,7 @@ ums_ioctl(struct usb_fifo *fifo, u_long /* don't change the current setting */ } else if ((mode.level < 0) || (mode.level > 1)) { error = EINVAL; - goto done; + break; } else { sc->sc_mode.level = mode.level; } @@ -928,7 +946,7 @@ ums_ioctl(struct usb_fifo *fifo, u_long case MOUSE_SETLEVEL: if (*(int *)addr < 0 || *(int *)addr > 1) { error = EINVAL; - goto done; + break; } sc->sc_mode.level = *(int *)addr; @@ -975,9 +993,9 @@ ums_ioctl(struct usb_fifo *fifo, u_long } default: error = ENOTTY; + break; } -done: mtx_unlock(&sc->sc_mtx); return (error); } From owner-svn-src-head@FreeBSD.ORG Mon May 14 18:03:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EBB0D1065677; Mon, 14 May 2012 18:03:59 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D6C458FC12; Mon, 14 May 2012 18:03:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4EI3xf3044697; Mon, 14 May 2012 18:03:59 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4EI3x7S044695; Mon, 14 May 2012 18:03:59 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201205141803.q4EI3x7S044695@svn.freebsd.org> From: Josh Paetzel Date: Mon, 14 May 2012 18:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235452 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2012 18:04:00 -0000 Author: jpaetzel Date: Mon May 14 18:03:59 2012 New Revision: 235452 URL: http://svn.freebsd.org/changeset/base/235452 Log: Set the MBR partition to active when doing a full disk MBR. Submitted by: kmoore Obtained from: PC-BSD Sponsored by: iXsystems MFC after: 3 days Modified: head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Modified: head/usr.sbin/pc-sysinstall/backend/functions-disk.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Mon May 14 17:00:32 2012 (r235451) +++ head/usr.sbin/pc-sysinstall/backend/functions-disk.sh Mon May 14 18:03:59 2012 (r235452) @@ -689,6 +689,9 @@ init_mbr_full_disk() echo_log "Cleaning up ${_intDISK}s1" rc_halt "dd if=/dev/zero of=${_intDISK}s1 count=1024" + # Make the partition active + rc_halt "gpart set -a active -i 1 ${_intDISK}" + if [ "$_intBOOT" = "bsd" ] ; then echo_log "Stamping boot0 on ${_intDISK}" rc_halt "gpart bootcode -b /boot/boot0 ${_intDISK}" From owner-svn-src-head@FreeBSD.ORG Mon May 14 18:06:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4740A1065675; Mon, 14 May 2012 18:06:52 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3298A8FC08; Mon, 14 May 2012 18:06:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4EI6qrO044839; Mon, 14 May 2012 18:06:52 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4EI6qCr044837; Mon, 14 May 2012 18:06:52 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201205141806.q4EI6qCr044837@svn.freebsd.org> From: Josh Paetzel Date: Mon, 14 May 2012 18:06:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235453 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2012 18:06:52 -0000 Author: jpaetzel Date: Mon May 14 18:06:51 2012 New Revision: 235453 URL: http://svn.freebsd.org/changeset/base/235453 Log: Style fixes. Submitted by: kmoore Obtained from: PC-BSD MFC after: 3 days Sponsored by: iXsystems Modified: head/usr.sbin/pc-sysinstall/backend/functions.sh Modified: head/usr.sbin/pc-sysinstall/backend/functions.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/functions.sh Mon May 14 18:03:59 2012 (r235452) +++ head/usr.sbin/pc-sysinstall/backend/functions.sh Mon May 14 18:06:51 2012 (r235453) @@ -208,15 +208,11 @@ fetch_file() FETCHOUTFILE="$2" EXITFAILED="$3" - SIZEFILE="${TMPDIR}/.fetchSize" EXITFILE="${TMPDIR}/.fetchExit" - rm ${SIZEFILE} 2>/dev/null >/dev/null rm ${FETCHOUTFILE} 2>/dev/null >/dev/null - fetch -s "${FETCHFILE}" >${SIZEFILE} - SIZE="`cat ${SIZEFILE}`" - SIZE=$((SIZE/1024)) + SIZE=$(( `fetch -s "${FETCHFILE}"` / 1024 )) echo "FETCH: ${FETCHFILE}" echo "FETCH: ${FETCHOUTFILE}" >>${LOGOUT} @@ -278,12 +274,10 @@ get_zpool_name() NUM=`ls ${TMPDIR}/.zpools/ | wc -l | sed 's| ||g'` # Is it used in another zpool? - while - z=1 + while : do NEWNAME="${BASENAME}${NUM}" - zpool import | grep -q "${NEWNAME}" - if [ $? -ne 0 ] ; then break ; fi + zpool import | grep -qw "${NEWNAME}" && break NUM=$((NUM+1)) done From owner-svn-src-head@FreeBSD.ORG Mon May 14 21:58:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8E4C41065742; Mon, 14 May 2012 21:58:23 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78FB28FC16; Mon, 14 May 2012 21:58:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4ELwNhm053020; Mon, 14 May 2012 21:58:23 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4ELwN6s053018; Mon, 14 May 2012 21:58:23 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201205142158.q4ELwN6s053018@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 14 May 2012 21:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235454 - head/cddl/contrib/dtracetoolkit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2012 21:58:23 -0000 Author: gnn Date: Mon May 14 21:58:22 2012 New Revision: 235454 URL: http://svn.freebsd.org/changeset/base/235454 Log: Fix opensnoop for FreeBSD by removing probes with 64 at the end as these are unnecessary. Reference sh in the correct location (/bin/sh) Modified: head/cddl/contrib/dtracetoolkit/opensnoop Modified: head/cddl/contrib/dtracetoolkit/opensnoop ============================================================================== --- head/cddl/contrib/dtracetoolkit/opensnoop Mon May 14 18:06:51 2012 (r235453) +++ head/cddl/contrib/dtracetoolkit/opensnoop Mon May 14 21:58:22 2012 (r235454) @@ -1,4 +1,4 @@ -#!/usr/bin/sh +#!/bin/sh # # opensnoop - snoop file opens as they occur. # Written using DTrace (Solaris 10 3/05). @@ -189,7 +189,7 @@ fi /* * Print open event */ - syscall::open:entry, syscall::open64:entry + syscall::open:entry { /* save pathname */ self->pathp = arg0; @@ -203,7 +203,7 @@ fi /* OPT_file is checked on return to ensure pathp is mapped */ } - syscall::open:return, syscall::open64:return + syscall::open:return /self->ok && (! OPT_failonly || (int)arg0 < 0) && ((OPT_file == 0) || (OPT_file == 1 && PATHNAME == copyinstr(self->pathp)))/ { @@ -235,7 +235,7 @@ fi /* * Cleanup */ - syscall::open:return, syscall::open64:return + syscall::open:return /self->ok/ { self->pathp = 0; From owner-svn-src-head@FreeBSD.ORG Mon May 14 21:59:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 61925106564A; Mon, 14 May 2012 21:59:48 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D6198FC08; Mon, 14 May 2012 21:59:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4ELxmS2053114; Mon, 14 May 2012 21:59:48 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4ELxmEQ053112; Mon, 14 May 2012 21:59:48 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201205142159.q4ELxmEQ053112@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 14 May 2012 21:59:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235455 - head/cddl/contrib/dtracetoolkit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2012 21:59:48 -0000 Author: gnn Date: Mon May 14 21:59:47 2012 New Revision: 235455 URL: http://svn.freebsd.org/changeset/base/235455 Log: Fix execsnoop by changing exece and exec to be FreeBSD's execve. Reference sh in the correct location (/bin/sh) Modified: head/cddl/contrib/dtracetoolkit/execsnoop Modified: head/cddl/contrib/dtracetoolkit/execsnoop ============================================================================== --- head/cddl/contrib/dtracetoolkit/execsnoop Mon May 14 21:58:22 2012 (r235454) +++ head/cddl/contrib/dtracetoolkit/execsnoop Mon May 14 21:59:47 2012 (r235455) @@ -1,4 +1,4 @@ -#!/usr/bin/sh +#!/bin/sh # # execsnoop - snoop process execution as it occurs. # Written using DTrace (Solaris 10 3/05). @@ -155,7 +155,7 @@ fi /* * Print exec event */ - syscall::exec:return, syscall::exece:return + syscall::execve:return /(FILTER == 0) || (OPT_cmd == 1 && COMMAND == execname)/ { /* print optional fields */ From owner-svn-src-head@FreeBSD.ORG Mon May 14 22:00:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CC2F01065688; Mon, 14 May 2012 22:00:24 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B747E8FC08; Mon, 14 May 2012 22:00:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4EM0Omw053198; Mon, 14 May 2012 22:00:24 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4EM0OHO053196; Mon, 14 May 2012 22:00:24 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201205142200.q4EM0OHO053196@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 14 May 2012 22:00:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235456 - head/cddl/contrib/dtracetoolkit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2012 22:00:24 -0000 Author: gnn Date: Mon May 14 22:00:24 2012 New Revision: 235456 URL: http://svn.freebsd.org/changeset/base/235456 Log: Move sh to the correct location for FreeBS (/bin/sh) Modified: head/cddl/contrib/dtracetoolkit/procsystime Modified: head/cddl/contrib/dtracetoolkit/procsystime ============================================================================== --- head/cddl/contrib/dtracetoolkit/procsystime Mon May 14 21:59:47 2012 (r235455) +++ head/cddl/contrib/dtracetoolkit/procsystime Mon May 14 22:00:24 2012 (r235456) @@ -1,4 +1,4 @@ -#!/usr/bin/sh +#!/bin/sh # # procsystime - print process system call time details. # Written using DTrace (Solaris 10 3/05). From owner-svn-src-head@FreeBSD.ORG Mon May 14 22:02:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D300E1065670; Mon, 14 May 2012 22:02:01 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE5028FC1C; Mon, 14 May 2012 22:02:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4EM21A8053292; Mon, 14 May 2012 22:02:01 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4EM21O5053290; Mon, 14 May 2012 22:02:01 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201205142202.q4EM21O5053290@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 14 May 2012 22:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235457 - head/cddl/contrib/dtracetoolkit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2012 22:02:01 -0000 Author: gnn Date: Mon May 14 22:02:01 2012 New Revision: 235457 URL: http://svn.freebsd.org/changeset/base/235457 Log: Move sh to the correct path for FreeBSD. Modified: head/cddl/contrib/dtracetoolkit/dtruss Modified: head/cddl/contrib/dtracetoolkit/dtruss ============================================================================== --- head/cddl/contrib/dtracetoolkit/dtruss Mon May 14 22:00:24 2012 (r235456) +++ head/cddl/contrib/dtracetoolkit/dtruss Mon May 14 22:02:01 2012 (r235457) @@ -1,4 +1,4 @@ -#!/usr/bin/sh +#!/bin/sh # # dtruss - print process system call time details. # Written using DTrace (Solaris 10 3/05). From owner-svn-src-head@FreeBSD.ORG Tue May 15 01:30:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88B12106566B; Tue, 15 May 2012 01:30:26 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 712C88FC12; Tue, 15 May 2012 01:30:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4F1UQpB060845; Tue, 15 May 2012 01:30:26 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4F1UQ7n060836; Tue, 15 May 2012 01:30:26 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201205150130.q4F1UQ7n060836@svn.freebsd.org> From: Ryan Stone Date: Tue, 15 May 2012 01:30:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235459 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2012 01:30:26 -0000 Author: rstone Date: Tue May 15 01:30:25 2012 New Revision: 235459 URL: http://svn.freebsd.org/changeset/base/235459 Log: Implement the DTrace sched provider. This implementation aims to be compatible with the sched provider implemented by Solaris and its open- source derivatives. Full documentation of the sched provider can be found on Oracle's DTrace wiki pages. Note that for compatibility with scripts originally written for Solaris, serveral probes are defined that will never fire. These probes are defined to fire when Solaris-specific features perform certain actions. As these features are not present in FreeBSD, the probes can never fire. Also, I have added a two probes that are not defined in Solaris, lend-pri and load-change. These probes have been added to make it possible to collect schedgraph data with DTrace. Finally, a few probes are defined in Solaris to take a cpuinfo_t * argument. As it was not immediately clear to me how to translate that to FreeBSD, currently those probes are passed NULL in place of a cpuinfo_t *. Sponsored by: Sandvine Incorporated MFC after: 2 weeks Modified: head/sys/kern/kern_clock.c head/sys/kern/kern_synch.c head/sys/kern/kern_thread.c head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/kern/subr_sleepqueue.c head/sys/kern/subr_turnstile.c head/sys/sys/sdt.h Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Tue May 15 00:42:12 2012 (r235458) +++ head/sys/kern/kern_clock.c Tue May 15 01:30:25 2012 (r235459) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include "opt_kdb.h" #include "opt_device_polling.h" #include "opt_hwpmc_hooks.h" +#include "opt_kdtrace.h" #include "opt_ntp.h" #include "opt_watchdog.h" @@ -56,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -88,6 +90,9 @@ SYSINIT(clocks, SI_SUB_CLOCKS, SI_ORDER_ /* Spin-lock protecting profiling statistics. */ static struct mtx time_lock; +SDT_PROVIDER_DECLARE(sched); +SDT_PROBE_DEFINE2(sched, , , tick, tick, "struct thread *", "struct proc *"); + static int sysctl_kern_cp_time(SYSCTL_HANDLER_ARGS) { @@ -760,6 +765,7 @@ statclock_cnt(int cnt, int usermode) ru->ru_maxrss = rss; KTR_POINT2(KTR_SCHED, "thread", sched_tdname(td), "statclock", "prio:%d", td->td_priority, "stathz:%d", (stathz)?stathz:hz); + SDT_PROBE2(sched, , , tick, td, td->td_proc); thread_lock_flags(td, MTX_QUIET); for ( ; cnt > 0; cnt--) sched_clock(td); Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Tue May 15 00:42:12 2012 (r235458) +++ head/sys/kern/kern_synch.c Tue May 15 01:30:25 2012 (r235459) @@ -37,6 +37,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_kdtrace.h" #include "opt_ktrace.h" #include "opt_sched.h" @@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -105,6 +107,20 @@ SYSCTL_INT(_kern, OID_AUTO, fscale, CTLF static void loadav(void *arg); +SDT_PROVIDER_DECLARE(sched); +SDT_PROBE_DEFINE(sched, , , preempt, preempt); + +/* + * These probes reference Solaris features that are not implemented in FreeBSD. + * Create the probes anyway for compatibility with existing D scripts; they'll + * just never fire. + */ +SDT_PROBE_DEFINE(sched, , , cpucaps_sleep, cpucaps-sleep); +SDT_PROBE_DEFINE(sched, , , cpucaps_wakeup, cpucaps-wakeup); +SDT_PROBE_DEFINE(sched, , , schedctl_nopreempt, schedctl-nopreempt); +SDT_PROBE_DEFINE(sched, , , schedctl_preempt, schedctl-preempt); +SDT_PROBE_DEFINE(sched, , , schedctl_yield, schedctl-yield); + void sleepinit(void) { @@ -462,6 +478,7 @@ mi_switch(int flags, struct thread *newt "prio:%d", td->td_priority, "wmesg:\"%s\"", td->td_wmesg, "lockname:\"%s\"", td->td_lockname); #endif + SDT_PROBE0(sched, , , preempt); #ifdef XEN PT_UPDATES_FLUSH(); #endif Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Tue May 15 00:42:12 2012 (r235458) +++ head/sys/kern/kern_thread.c Tue May 15 01:30:25 2012 (r235459) @@ -27,6 +27,7 @@ */ #include "opt_witness.h" +#include "opt_kdtrace.h" #include "opt_hwpmc_hooks.h" #include @@ -39,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -59,6 +61,10 @@ __FBSDID("$FreeBSD$"); #include #include +SDT_PROVIDER_DECLARE(proc); +SDT_PROBE_DEFINE(proc, , , lwp_exit, lwp-exit); + + /* * thread related storage. */ Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Tue May 15 00:42:12 2012 (r235458) +++ head/sys/kern/sched_4bsd.c Tue May 15 01:30:25 2012 (r235459) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -244,12 +245,31 @@ SYSCTL_INT(_kern_sched, OID_AUTO, follow "allow threads to share a quantum"); #endif +SDT_PROVIDER_DEFINE(sched); + +SDT_PROBE_DEFINE3(sched, , , change_pri, change-pri, "struct thread *", + "struct proc *", "uint8_t"); +SDT_PROBE_DEFINE3(sched, , , dequeue, dequeue, "struct thread *", + "struct proc *", "void *"); +SDT_PROBE_DEFINE4(sched, , , enqueue, enqueue, "struct thread *", + "struct proc *", "void *", "int"); +SDT_PROBE_DEFINE4(sched, , , lend_pri, lend-pri, "struct thread *", + "struct proc *", "uint8_t", "struct thread *"); +SDT_PROBE_DEFINE2(sched, , , load_change, load-change, "int", "int"); +SDT_PROBE_DEFINE2(sched, , , off_cpu, off-cpu, "struct thread *", + "struct proc *"); +SDT_PROBE_DEFINE(sched, , , on_cpu, on-cpu); +SDT_PROBE_DEFINE(sched, , , remain_cpu, remain-cpu); +SDT_PROBE_DEFINE2(sched, , , surrender, surrender, "struct thread *", + "struct proc *"); + static __inline void sched_load_add(void) { sched_tdcnt++; KTR_COUNTER0(KTR_SCHED, "load", "global load", sched_tdcnt); + SDT_PROBE2(sched, , , load_change, NOCPU, sched_tdcnt); } static __inline void @@ -258,6 +278,7 @@ sched_load_rem(void) sched_tdcnt--; KTR_COUNTER0(KTR_SCHED, "load", "global load", sched_tdcnt); + SDT_PROBE2(sched, , , load_change, NOCPU, sched_tdcnt); } /* * Arrange to reschedule if necessary, taking the priorities and @@ -795,10 +816,13 @@ sched_priority(struct thread *td, u_char KTR_POINT3(KTR_SCHED, "thread", sched_tdname(td), "priority change", "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, sched_tdname(curthread)); + SDT_PROBE3(sched, , , change_pri, td, td->td_proc, prio); if (td != curthread && prio > td->td_priority) { KTR_POINT3(KTR_SCHED, "thread", sched_tdname(curthread), "lend prio", "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, sched_tdname(td)); + SDT_PROBE4(sched, , , lend_pri, td, td->td_proc, prio, + curthread); } THREAD_LOCK_ASSERT(td, MA_OWNED); if (td->td_priority == prio) @@ -987,6 +1011,9 @@ sched_switch(struct thread *td, struct t if (PMC_PROC_IS_USING_PMCS(td->td_proc)) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif + + SDT_PROBE2(sched, , , off_cpu, td, td->td_proc); + /* I feel sleepy */ lock_profile_release_lock(&sched_lock.lock_object); #ifdef KDTRACE_HOOKS @@ -1018,11 +1045,14 @@ sched_switch(struct thread *td, struct t * needed to, or the thread_wait() or wait() will * need to reap it. */ + + SDT_PROBE0(sched, , , on_cpu); #ifdef HWPMC_HOOKS if (PMC_PROC_IS_USING_PMCS(td->td_proc)) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_IN); #endif - } + } else + SDT_PROBE0(sched, , , remain_cpu); #ifdef SMP if (td->td_flags & TDF_IDLETD) @@ -1223,6 +1253,8 @@ sched_add(struct thread *td, int flags) sched_tdname(curthread)); KTR_POINT1(KTR_SCHED, "thread", sched_tdname(curthread), "wokeup", KTR_ATTR_LINKED, sched_tdname(td)); + SDT_PROBE4(sched, , , enqueue, td, td->td_proc, NULL, + flags & SRQ_PREEMPTED); /* @@ -1315,6 +1347,8 @@ sched_add(struct thread *td, int flags) sched_tdname(curthread)); KTR_POINT1(KTR_SCHED, "thread", sched_tdname(curthread), "wokeup", KTR_ATTR_LINKED, sched_tdname(td)); + STD_PROBE4(sched, , , enqueue, td, td->td_proc, NULL, + flags & SRQ_PREEMPTED); /* * Now that the thread is moving to the run-queue, set the lock @@ -1362,6 +1396,7 @@ sched_rem(struct thread *td) KTR_STATE2(KTR_SCHED, "thread", sched_tdname(td), "runq rem", "prio:%d", td->td_priority, KTR_ATTR_LINKED, sched_tdname(curthread)); + SDT_PROBE3(sched, , , dequeue, td, td->td_proc, NULL); if ((td->td_flags & TDF_NOLOAD) == 0) sched_load_rem(); @@ -1425,6 +1460,8 @@ sched_choose(void) void sched_preempt(struct thread *td) { + + SDT_PROBE2(sched, , , surrender, td, td->td_proc); thread_lock(td); if (td->td_critnest > 1) td->td_owepreempt = 1; Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Tue May 15 00:42:12 2012 (r235458) +++ head/sys/kern/sched_ule.c Tue May 15 01:30:25 2012 (r235459) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -327,6 +328,24 @@ static void sched_initticks(void *dummy) SYSINIT(sched_initticks, SI_SUB_CLOCKS, SI_ORDER_THIRD, sched_initticks, NULL); +SDT_PROVIDER_DEFINE(sched); + +SDT_PROBE_DEFINE3(sched, , , change_pri, change-pri, "struct thread *", + "struct proc *", "uint8_t"); +SDT_PROBE_DEFINE3(sched, , , dequeue, dequeue, "struct thread *", + "struct proc *", "void *"); +SDT_PROBE_DEFINE4(sched, , , enqueue, enqueue, "struct thread *", + "struct proc *", "void *", "int"); +SDT_PROBE_DEFINE4(sched, , , lend_pri, lend-pri, "struct thread *", + "struct proc *", "uint8_t", "struct thread *"); +SDT_PROBE_DEFINE2(sched, , , load_change, load-change, "int", "int"); +SDT_PROBE_DEFINE2(sched, , , off_cpu, off-cpu, "struct thread *", + "struct proc *"); +SDT_PROBE_DEFINE(sched, , , on_cpu, on-cpu); +SDT_PROBE_DEFINE(sched, , , remain_cpu, remain-cpu); +SDT_PROBE_DEFINE2(sched, , , surrender, surrender, "struct thread *", + "struct proc *"); + /* * Print the threads waiting on a run-queue. */ @@ -509,6 +528,7 @@ tdq_load_add(struct tdq *tdq, struct thr if ((td->td_flags & TDF_NOLOAD) == 0) tdq->tdq_sysload++; KTR_COUNTER0(KTR_SCHED, "load", tdq->tdq_loadname, tdq->tdq_load); + SDT_PROBE2(sched, , , load_change, (int)TDQ_ID(tdq), tdq->tdq_load); } /* @@ -528,6 +548,7 @@ tdq_load_rem(struct tdq *tdq, struct thr if ((td->td_flags & TDF_NOLOAD) == 0) tdq->tdq_sysload--; KTR_COUNTER0(KTR_SCHED, "load", tdq->tdq_loadname, tdq->tdq_load); + SDT_PROBE2(sched, , , load_change, (int)TDQ_ID(tdq), tdq->tdq_load); } /* @@ -1625,10 +1646,13 @@ sched_thread_priority(struct thread *td, KTR_POINT3(KTR_SCHED, "thread", sched_tdname(td), "prio", "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, sched_tdname(curthread)); + SDT_PROBE3(sched, , , change_pri, td, td->td_proc, prio); if (td != curthread && prio > td->td_priority) { KTR_POINT3(KTR_SCHED, "thread", sched_tdname(curthread), "lend prio", "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, sched_tdname(td)); + SDT_PROBE4(sched, , , lend_pri, td, td->td_proc, prio, + curthread); } ts = td->td_sched; THREAD_LOCK_ASSERT(td, MA_OWNED); @@ -1879,6 +1903,7 @@ sched_switch(struct thread *td, struct t if (PMC_PROC_IS_USING_PMCS(td->td_proc)) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif + SDT_PROBE2(sched, , , off_cpu, td, td->td_proc); lock_profile_release_lock(&TDQ_LOCKPTR(tdq)->lock_object); TDQ_LOCKPTR(tdq)->mtx_lock = (uintptr_t)newtd; sched_pctcpu_update(newtd->td_sched, 0); @@ -1903,12 +1928,16 @@ sched_switch(struct thread *td, struct t tdq = TDQ_CPU(cpuid); lock_profile_obtain_lock_success( &TDQ_LOCKPTR(tdq)->lock_object, 0, 0, __FILE__, __LINE__); + + SDT_PROBE0(sched, , , on_cpu); #ifdef HWPMC_HOOKS if (PMC_PROC_IS_USING_PMCS(td->td_proc)) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_IN); #endif - } else + } else { thread_unblock_switch(td, mtx); + SDT_PROBE0(sched, , , remain_cpu); + } /* * Assert that all went well and return. */ @@ -2102,6 +2131,8 @@ sched_preempt(struct thread *td) { struct tdq *tdq; + SDT_PROBE2(sched, , , surrender, td, td->td_proc); + thread_lock(td); tdq = TDQ_SELF(); TDQ_LOCK_ASSERT(tdq, MA_OWNED); @@ -2330,6 +2361,8 @@ sched_add(struct thread *td, int flags) sched_tdname(curthread)); KTR_POINT1(KTR_SCHED, "thread", sched_tdname(curthread), "wokeup", KTR_ATTR_LINKED, sched_tdname(td)); + SDT_PROBE4(sched, , , enqueue, td, td->td_proc, NULL, + flags & SRQ_PREEMPTED); THREAD_LOCK_ASSERT(td, MA_OWNED); /* * Recalculate the priority before we select the target cpu or @@ -2375,6 +2408,7 @@ sched_rem(struct thread *td) KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "runq rem", "prio:%d", td->td_priority); + SDT_PROBE3(sched, , , dequeue, td, td->td_proc, NULL); tdq = TDQ_CPU(td->td_sched->ts_cpu); TDQ_LOCK_ASSERT(tdq, MA_OWNED); MPASS(td->td_lock == TDQ_LOCKPTR(tdq)); Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Tue May 15 00:42:12 2012 (r235458) +++ head/sys/kern/subr_sleepqueue.c Tue May 15 01:30:25 2012 (r235459) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include "opt_sleepqueue_profiling.h" #include "opt_ddb.h" +#include "opt_kdtrace.h" #include "opt_sched.h" #include @@ -75,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -166,6 +168,9 @@ static int sleepq_resume_thread(struct s static void sleepq_switch(void *wchan, int pri); static void sleepq_timeout(void *arg); +SDT_PROBE_DECLARE(sched, , , sleep); +SDT_PROBE_DECLARE(sched, , , wakeup); + /* * Early initialization of sleep queues that is called from the sleepinit() * SYSINIT. @@ -534,6 +539,7 @@ sleepq_switch(void *wchan, int pri) MPASS(td->td_sleepqueue == NULL); sched_sleep(td, pri); thread_lock_set(td, &sc->sc_lock); + SDT_PROBE0(sched, , , sleep); TD_SET_SLEEPING(td); mi_switch(SW_VOL | SWT_SLEEPQ, NULL); KASSERT(TD_IS_RUNNING(td), ("running but not TDS_RUNNING")); @@ -715,6 +721,8 @@ sleepq_resume_thread(struct sleepqueue * sc = SC_LOOKUP(sq->sq_wchan); mtx_assert(&sc->sc_lock, MA_OWNED); + SDT_PROBE2(sched, , , wakeup, td, td->td_proc); + /* Remove the thread from the queue. */ sq->sq_blockedcnt[td->td_sqqueue]--; TAILQ_REMOVE(&sq->sq_blocked[td->td_sqqueue], td, td_slpq); Modified: head/sys/kern/subr_turnstile.c ============================================================================== --- head/sys/kern/subr_turnstile.c Tue May 15 00:42:12 2012 (r235458) +++ head/sys/kern/subr_turnstile.c Tue May 15 01:30:25 2012 (r235459) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" +#include "opt_kdtrace.h" #include "opt_turnstile_profiling.h" #include "opt_sched.h" @@ -73,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -167,6 +169,11 @@ static void turnstile_dtor(void *mem, in static int turnstile_init(void *mem, int size, int flags); static void turnstile_fini(void *mem, int size); +SDT_PROVIDER_DECLARE(sched); +SDT_PROBE_DEFINE(sched, , , sleep, sleep); +SDT_PROBE_DEFINE2(sched, , , wakeup, wakeup, "struct thread *", + "struct proc *"); + /* * Walks the chain of turnstiles and their owners to propagate the priority * of the thread being blocked to all the threads holding locks that have to @@ -740,6 +747,8 @@ turnstile_wait(struct turnstile *ts, str CTR4(KTR_LOCK, "%s: td %d blocked on [%p] %s", __func__, td->td_tid, lock, lock->lo_name); + SDT_PROBE0(sched, , , sleep); + THREAD_LOCKPTR_ASSERT(td, &ts->ts_lock); mi_switch(SW_VOL | SWT_TURNSTILE, NULL); @@ -916,6 +925,7 @@ turnstile_unpend(struct turnstile *ts, i while (!TAILQ_EMPTY(&pending_threads)) { td = TAILQ_FIRST(&pending_threads); TAILQ_REMOVE(&pending_threads, td, td_lockq); + SDT_PROBE2(sched, , , wakeup, td, td->td_proc); thread_lock(td); THREAD_LOCKPTR_ASSERT(td, &ts->ts_lock); MPASS(td->td_proc->p_magic == P_MAGIC); Modified: head/sys/sys/sdt.h ============================================================================== --- head/sys/sys/sdt.h Tue May 15 00:42:12 2012 (r235458) +++ head/sys/sys/sdt.h Tue May 15 01:30:25 2012 (r235459) @@ -92,6 +92,7 @@ #define SDT_PROBE_DEFINE4(prov, mod, func, name, sname, arg0, arg1, arg2, arg3) #define SDT_PROBE_DEFINE5(prov, mod, func, name, sname, arg0, arg1, arg2, arg3, arg4) +#define SDT_PROBE0(prov, mod, func, name) #define SDT_PROBE1(prov, mod, func, name, arg0) #define SDT_PROBE2(prov, mod, func, name, arg0, arg1) #define SDT_PROBE3(prov, mod, func, name, arg0, arg1, arg2) @@ -231,6 +232,8 @@ struct sdt_provider { SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4) +#define SDT_PROBE0(prov, mod, func, name) \ + SDT_PROBE(prov, mod, func, name, 0, 0, 0, 0, 0) #define SDT_PROBE1(prov, mod, func, name, arg0) \ SDT_PROBE(prov, mod, func, name, arg0, 0, 0, 0, 0) #define SDT_PROBE2(prov, mod, func, name, arg0, arg1) \ From owner-svn-src-head@FreeBSD.ORG Tue May 15 04:55:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F09B91065678; Tue, 15 May 2012 04:55:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C27F18FC0C; Tue, 15 May 2012 04:55:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4F4tF06068095; Tue, 15 May 2012 04:55:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4F4tF6E068093; Tue, 15 May 2012 04:55:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205150455.q4F4tF6E068093@svn.freebsd.org> From: Adrian Chadd Date: Tue, 15 May 2012 04:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235461 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2012 04:55:16 -0000 Author: adrian Date: Tue May 15 04:55:15 2012 New Revision: 235461 URL: http://svn.freebsd.org/changeset/base/235461 Log: Handle non-xretry errors the same as xretry errors for now. Although I _should_ handle the other errors in various ways (specifically errors like FILT), treating them as having transmitted successfully is completely wrong. Here, they'd be counted as successful and the BAW would be advanced.. but the RX side wouldn't have received them. The specific errors I've been seeing here are HAL_TXERR_FILT. This patch does fix the issue - I've tested it using -i 0.001 pings (enough to start aggregation) and now the behaviour is correct: * The RX side never sees a "moved window" error, and * The TX side sends BARs as needed, with the RX side correctly handling them. PR: kern/167902 Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue May 15 03:21:36 2012 (r235460) +++ head/sys/dev/ath/if_ath_tx.c Tue May 15 04:55:15 2012 (r235461) @@ -3597,9 +3597,16 @@ ath_tx_aggr_comp_aggr(struct ath_softc * pktlen = bf_first->bf_state.bfs_pktlen; /* - * handle errors first + * Handle errors first! + * + * Here, handle _any_ error as a "exceeded retries" error. + * Later on (when filtered frames are to be specially handled) + * it'll have to be expanded. */ +#if 0 if (ts.ts_status & HAL_TXERR_XRETRY) { +#endif + if (ts.ts_status != 0) { ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); ath_tx_comp_aggr_error(sc, bf_first, atid); return; @@ -3839,7 +3846,10 @@ ath_tx_aggr_comp_unaggr(struct ath_softc * Don't bother with the retry check if all frames * are being failed (eg during queue deletion.) */ +#if 0 if (fail == 0 && ts->ts_status & HAL_TXERR_XRETRY) { +#endif + if (fail == 0 && ts->ts_status != 0) { ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: retry_unaggr\n", __func__); From owner-svn-src-head@FreeBSD.ORG Tue May 15 09:55:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C01FD106564A; Tue, 15 May 2012 09:55:15 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB4B28FC1A; Tue, 15 May 2012 09:55:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4F9tFvb079474; Tue, 15 May 2012 09:55:15 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4F9tFTo079472; Tue, 15 May 2012 09:55:15 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201205150955.q4F9tFTo079472@svn.freebsd.org> From: Grzegorz Bernacki Date: Tue, 15 May 2012 09:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235469 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2012 09:55:15 -0000 Author: gber Date: Tue May 15 09:55:15 2012 New Revision: 235469 URL: http://svn.freebsd.org/changeset/base/235469 Log: Do not call bremfree for managed buffers. Calling bremfree for these buffers results in panic: "bremfree: buffer %p not on a queue." Approved by: kib Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Tue May 15 09:37:22 2012 (r235468) +++ head/sys/kern/vfs_bio.c Tue May 15 09:55:15 2012 (r235469) @@ -2640,8 +2640,8 @@ loop: if (bp != NULL) { int lockflags; /* - * Buffer is in-core. If the buffer is not busy, it must - * be on a queue. + * Buffer is in-core. If the buffer is not busy nor managed, + * it must be on a queue. */ lockflags = LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK; @@ -2671,9 +2671,13 @@ loop: bp->b_flags &= ~B_CACHE; else if ((bp->b_flags & (B_VMIO | B_INVAL)) == 0) bp->b_flags |= B_CACHE; - BO_LOCK(bo); - bremfree(bp); - BO_UNLOCK(bo); + if (bp->b_flags & B_MANAGED) + MPASS(bp->b_qindex == QUEUE_NONE); + else { + BO_LOCK(bo); + bremfree(bp); + BO_UNLOCK(bo); + } /* * check for size inconsistancies for non-VMIO case. From owner-svn-src-head@FreeBSD.ORG Tue May 15 10:58:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A97EA106566C; Tue, 15 May 2012 10:58:17 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9518F8FC0A; Tue, 15 May 2012 10:58:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4FAwHJ3084579; Tue, 15 May 2012 10:58:17 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4FAwHZm084577; Tue, 15 May 2012 10:58:17 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201205151058.q4FAwHZm084577@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 15 May 2012 10:58:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235471 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2012 10:58:17 -0000 Author: pluknet Date: Tue May 15 10:58:17 2012 New Revision: 235471 URL: http://svn.freebsd.org/changeset/base/235471 Log: Fix typo in function name SDT_PROBE4 and unbreak 4BSD UP. Modified: head/sys/kern/sched_4bsd.c Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Tue May 15 10:09:31 2012 (r235470) +++ head/sys/kern/sched_4bsd.c Tue May 15 10:58:17 2012 (r235471) @@ -1347,7 +1347,7 @@ sched_add(struct thread *td, int flags) sched_tdname(curthread)); KTR_POINT1(KTR_SCHED, "thread", sched_tdname(curthread), "wokeup", KTR_ATTR_LINKED, sched_tdname(td)); - STD_PROBE4(sched, , , enqueue, td, td->td_proc, NULL, + SDT_PROBE4(sched, , , enqueue, td, td->td_proc, NULL, flags & SRQ_PREEMPTED); /* From owner-svn-src-head@FreeBSD.ORG Tue May 15 13:23:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77CFB106566B; Tue, 15 May 2012 13:23:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6231A8FC14; Tue, 15 May 2012 13:23:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4FDNjIw089640; Tue, 15 May 2012 13:23:45 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4FDNjeT089637; Tue, 15 May 2012 13:23:45 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205151323.q4FDNjeT089637@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 15 May 2012 13:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235474 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2012 13:23:45 -0000 Author: bz Date: Tue May 15 13:23:44 2012 New Revision: 235474 URL: http://svn.freebsd.org/changeset/base/235474 Log: Switch to a standard 2 clause BSD license (from bsd-style-copyright). Approved by: Myricom Inc. (gallatin) Approved by: Intel Corporation (jfv) Modified: head/sys/netinet/tcp_lro.c head/sys/netinet/tcp_lro.h Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Tue May 15 12:50:49 2012 (r235473) +++ head/sys/netinet/tcp_lro.c Tue May 15 13:23:44 2012 (r235474) @@ -1,37 +1,31 @@ -/****************************************************************************** - -Copyright (c) 2007, Myricom Inc. -Copyright (c) 2008, Intel Corporation. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Neither the name of the Myricom Inc, nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - 3. Neither the name of the Intel Corporation, nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -$FreeBSD$ -***************************************************************************/ +/*- + * Copyright (c) 2007, Myricom Inc. + * Copyright (c) 2008, Intel Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ #include #include Modified: head/sys/netinet/tcp_lro.h ============================================================================== --- head/sys/netinet/tcp_lro.h Tue May 15 12:50:49 2012 (r235473) +++ head/sys/netinet/tcp_lro.h Tue May 15 13:23:44 2012 (r235474) @@ -1,39 +1,32 @@ -/******************************************************************************* +/*- + * Copyright (c) 2006, Myricom Inc. + * Copyright (c) 2008, Intel Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ -Copyright (c) 2006, Myricom Inc. -Copyright (c) 2008, Intel Corporation. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Neither the name of the Myricom Inc, nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - 2. Neither the name of the Intel Corporation, nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - -$FreeBSD$ - -***************************************************************************/ #ifndef _TCP_LRO_H_ #define _TCP_LRO_H_ From owner-svn-src-head@FreeBSD.ORG Tue May 15 17:07:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6ADCC1065673; Tue, 15 May 2012 17:07:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 559E38FC1E; Tue, 15 May 2012 17:07:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4FH7Uth096836; Tue, 15 May 2012 17:07:30 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4FH7UDU096834; Tue, 15 May 2012 17:07:30 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201205151707.q4FH7UDU096834@svn.freebsd.org> From: Andriy Gapon Date: Tue, 15 May 2012 17:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235478 - head/cddl/contrib/opensolaris/cmd/zpool X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2012 17:07:30 -0000 Author: avg Date: Tue May 15 17:07:29 2012 New Revision: 235478 URL: http://svn.freebsd.org/changeset/base/235478 Log: zpool_do_import: use /dev instead of /dev/dsk as a default This affects behavior of zpool import without -d option. Reported by: Bruce Cran Submitted by: Fabian Keil MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue May 15 16:17:30 2012 (r235477) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Tue May 15 17:07:29 2012 (r235478) @@ -1909,7 +1909,7 @@ zpool_do_import(int argc, char **argv) if (searchdirs == NULL) { searchdirs = safe_malloc(sizeof (char *)); - searchdirs[0] = "/dev/dsk"; + searchdirs[0] = "/dev"; nsearch = 1; } From owner-svn-src-head@FreeBSD.ORG Tue May 15 17:11:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEFA4106566B; Tue, 15 May 2012 17:11:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8F508FC1B; Tue, 15 May 2012 17:11:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4FHB0vw096982; Tue, 15 May 2012 17:11:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4FHB03W096980; Tue, 15 May 2012 17:11:00 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201205151711.q4FHB03W096980@svn.freebsd.org> From: Andriy Gapon Date: Tue, 15 May 2012 17:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235479 - head/cddl/contrib/opensolaris/lib/libzfs/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2012 17:11:01 -0000 Author: avg Date: Tue May 15 17:11:00 2012 New Revision: 235479 URL: http://svn.freebsd.org/changeset/base/235479 Log: zpool_find_import_impl: another /dev/dsk -> /dev fix This seems to fix zdb -e behavior. PR: bin/155104 Submitted by: swell.k@gmail.com MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Tue May 15 17:07:29 2012 (r235478) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Tue May 15 17:11:00 2012 (r235479) @@ -1145,7 +1145,7 @@ zpool_find_import_impl(libzfs_handle_t * char *end, **dir = iarg->path; size_t pathleft; nvlist_t *ret = NULL; - static char *default_dir = "/dev/dsk"; + static char *default_dir = "/dev"; pool_list_t pools = { 0 }; pool_entry_t *pe, *penext; vdev_entry_t *ve, *venext; From owner-svn-src-head@FreeBSD.ORG Tue May 15 20:15:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 119D01065741; Tue, 15 May 2012 20:15:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0D218FC1B; Tue, 15 May 2012 20:15:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4FKFHZ0003644; Tue, 15 May 2012 20:15:17 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4FKFHob003642; Tue, 15 May 2012 20:15:17 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201205152015.q4FKFHob003642@svn.freebsd.org> From: Eitan Adler Date: Tue, 15 May 2012 20:15:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235481 - head/share/examples/csh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2012 20:15:18 -0000 Author: eadler Date: Tue May 15 20:15:17 2012 New Revision: 235481 URL: http://svn.freebsd.org/changeset/base/235481 Log: Rework sample code which sets SSH_AUTH_SOCK to the user's ssh-agent socket path if running PR: 167932 Submitted by: madpilot (pr) Submitted by: wblock (final patch) Reviewed by: If someone else reviewed your modification. Approved by: cperciva (implicit) MFC after: 3 days Modified: head/share/examples/csh/dot.cshrc Modified: head/share/examples/csh/dot.cshrc ============================================================================== --- head/share/examples/csh/dot.cshrc Tue May 15 17:21:46 2012 (r235480) +++ head/share/examples/csh/dot.cshrc Tue May 15 20:15:17 2012 (r235481) @@ -5,7 +5,7 @@ # Sets SSH_AUTH_SOCK to the user's ssh-agent socket path if running if (${?SSH_AUTH_SOCK} != "1") then - setenv SSH_AUTH_SOCK `sockstat | grep "${USER}" | cut -d ' ' -f 6` + setenv SSH_AUTH_SOCK `sockstat | grep "^${USER} " | awk '/ssh-agent/ { print $6 }'` endif # Change only root's prompt From owner-svn-src-head@FreeBSD.ORG Tue May 15 22:44:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ACBC2106564A; Tue, 15 May 2012 22:44:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97FF48FC14; Tue, 15 May 2012 22:44:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4FMitTu009120; Tue, 15 May 2012 22:44:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4FMit9c009118; Tue, 15 May 2012 22:44:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205152244.q4FMit9c009118@svn.freebsd.org> From: Marius Strobl Date: Tue, 15 May 2012 22:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235486 - head/contrib/compiler-rt/lib/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2012 22:44:55 -0000 Author: marius Date: Tue May 15 22:44:55 2012 New Revision: 235486 URL: http://svn.freebsd.org/changeset/base/235486 Log: Forced commit to denote that the claim in r235388, that libcompiler_rt when used as a replacement for libgcc on sparc64 would cause a 60% decrease in performance is wrong. Actually, the performance loss is only marginal and the huge difference seen was caused by a pilot error comparing libgcc builds using MALLOC_PRODUCTION with libcompiler_rt builds that did not. Modified: head/contrib/compiler-rt/lib/sparc64/divmod.m4 Modified: head/contrib/compiler-rt/lib/sparc64/divmod.m4 ============================================================================== From owner-svn-src-head@FreeBSD.ORG Tue May 15 22:47:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3B4B91065675; Tue, 15 May 2012 22:47:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 264488FC0A; Tue, 15 May 2012 22:47:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4FMlZF9009247; Tue, 15 May 2012 22:47:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4FMlYaT009244; Tue, 15 May 2012 22:47:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201205152247.q4FMlYaT009244@svn.freebsd.org> From: Marius Strobl Date: Tue, 15 May 2012 22:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235487 - in head: gnu/lib/libgcc lib/libcompiler_rt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2012 22:47:35 -0000 Author: marius Date: Tue May 15 22:47:34 2012 New Revision: 235487 URL: http://svn.freebsd.org/changeset/base/235487 Log: Switch sparc64 to using libcompiler_rt; since r230021 we have a workaround in place allowing it to be used there and since r235388 (see also r235486) we also have usable div/mod optimizations like libgcc has. Modified: head/gnu/lib/libgcc/Makefile head/lib/libcompiler_rt/Makefile Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Tue May 15 22:44:55 2012 (r235486) +++ head/gnu/lib/libgcc/Makefile Tue May 15 22:47:34 2012 (r235487) @@ -15,7 +15,7 @@ MK_SSP= no .include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt" -.if ${TARGET_CPUARCH} == "sparc64" || ${TARGET_CPUARCH} == "mips" +.if ${TARGET_CPUARCH} == "mips" LIB= gcc .endif Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Tue May 15 22:44:55 2012 (r235486) +++ head/lib/libcompiler_rt/Makefile Tue May 15 22:47:34 2012 (r235487) @@ -176,7 +176,7 @@ SRCS+= ${file}.c . endif .endfor -.if ${MACHINE_CPUARCH} != "sparc64" && ${MACHINE_CPUARCH} != "mips" +.if ${MACHINE_CPUARCH} != "mips" . if ${MK_INSTALLLIB} != "no" SYMLINKS+=libcompiler_rt.a ${LIBDIR}/libgcc.a . endif From owner-svn-src-head@FreeBSD.ORG Tue May 15 22:50:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80501106566B; Tue, 15 May 2012 22:50:48 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BF6A8FC08; Tue, 15 May 2012 22:50:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4FMomR3009390; Tue, 15 May 2012 22:50:48 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4FMomAX009388; Tue, 15 May 2012 22:50:48 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201205152250.q4FMomAX009388@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 15 May 2012 22:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235488 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2012 22:50:48 -0000 Author: jilles Date: Tue May 15 22:50:47 2012 New Revision: 235488 URL: http://svn.freebsd.org/changeset/base/235488 Log: sh: Remove an unused header. The read builtin no longer does things with termios. Modified: head/bin/sh/miscbltin.c Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Tue May 15 22:47:34 2012 (r235487) +++ head/bin/sh/miscbltin.c Tue May 15 22:50:47 2012 (r235488) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "shell.h" #include "options.h" From owner-svn-src-head@FreeBSD.ORG Tue May 15 23:39:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D32A106564A; Tue, 15 May 2012 23:39:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 375428FC12; Tue, 15 May 2012 23:39:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4FNdcD2011844; Tue, 15 May 2012 23:39:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4FNdbEO011838; Tue, 15 May 2012 23:39:37 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205152339.q4FNdbEO011838@svn.freebsd.org> From: Adrian Chadd Date: Tue, 15 May 2012 23:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235491 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2012 23:39:38 -0000 Author: adrian Date: Tue May 15 23:39:37 2012 New Revision: 235491 URL: http://svn.freebsd.org/changeset/base/235491 Log: Migrate ath_debug and sc_debug from an int to a uint64_t / QUAD; add some more BAR debugging logic. * Change the definition of ath_debug and ath_softc.sc_debug from int to uint64_t; * Change the relevant sysctls; * Add a new BAR TX debugging field; * Use this in if_ath_tx. This has been tested by using the sysctl program, which happily allows for fields > 32 bits to be configured. Modified: head/sys/dev/ath/if_ath_debug.c head/sys/dev/ath/if_ath_debug.h head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath_debug.c ============================================================================== --- head/sys/dev/ath/if_ath_debug.c Tue May 15 23:31:31 2012 (r235490) +++ head/sys/dev/ath/if_ath_debug.c Tue May 15 23:39:37 2012 (r235491) @@ -89,12 +89,12 @@ __FBSDID("$FreeBSD$"); #ifdef ATH_DEBUG #include -int ath_debug = 0; +uint64_t ath_debug = 0; SYSCTL_DECL(_hw_ath); -SYSCTL_INT(_hw_ath, OID_AUTO, debug, CTLFLAG_RW, &ath_debug, +SYSCTL_QUAD(_hw_ath, OID_AUTO, debug, CTLFLAG_RW, &ath_debug, 0, "control debugging printfs"); -TUNABLE_INT("hw.ath.debug", &ath_debug); +TUNABLE_QUAD("hw.ath.debug", &ath_debug); void ath_printrxbuf(struct ath_softc *sc, const struct ath_buf *bf, Modified: head/sys/dev/ath/if_ath_debug.h ============================================================================== --- head/sys/dev/ath/if_ath_debug.h Tue May 15 23:31:31 2012 (r235490) +++ head/sys/dev/ath/if_ath_debug.h Tue May 15 23:39:37 2012 (r235491) @@ -34,39 +34,40 @@ #ifdef ATH_DEBUG enum { - ATH_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ - ATH_DEBUG_XMIT_DESC = 0x00000002, /* xmit descriptors */ - ATH_DEBUG_RECV = 0x00000004, /* basic recv operation */ - ATH_DEBUG_RECV_DESC = 0x00000008, /* recv descriptors */ - ATH_DEBUG_RATE = 0x00000010, /* rate control */ - ATH_DEBUG_RESET = 0x00000020, /* reset processing */ - ATH_DEBUG_MODE = 0x00000040, /* mode init/setup */ - ATH_DEBUG_BEACON = 0x00000080, /* beacon handling */ - ATH_DEBUG_WATCHDOG = 0x00000100, /* watchdog timeout */ - ATH_DEBUG_INTR = 0x00001000, /* ISR */ - ATH_DEBUG_TX_PROC = 0x00002000, /* tx ISR proc */ - ATH_DEBUG_RX_PROC = 0x00004000, /* rx ISR proc */ - ATH_DEBUG_BEACON_PROC = 0x00008000, /* beacon ISR proc */ - ATH_DEBUG_CALIBRATE = 0x00010000, /* periodic calibration */ - ATH_DEBUG_KEYCACHE = 0x00020000, /* key cache management */ - ATH_DEBUG_STATE = 0x00040000, /* 802.11 state transitions */ - ATH_DEBUG_NODE = 0x00080000, /* node management */ - ATH_DEBUG_LED = 0x00100000, /* led management */ - ATH_DEBUG_FF = 0x00200000, /* fast frames */ - ATH_DEBUG_DFS = 0x00400000, /* DFS processing */ - ATH_DEBUG_TDMA = 0x00800000, /* TDMA processing */ - ATH_DEBUG_TDMA_TIMER = 0x01000000, /* TDMA timer processing */ - ATH_DEBUG_REGDOMAIN = 0x02000000, /* regulatory processing */ - ATH_DEBUG_SW_TX = 0x04000000, /* per-packet software TX */ - ATH_DEBUG_SW_TX_BAW = 0x08000000, /* BAW handling */ - ATH_DEBUG_SW_TX_CTRL = 0x10000000, /* queue control */ - ATH_DEBUG_SW_TX_AGGR = 0x20000000, /* aggregate TX */ - ATH_DEBUG_SW_TX_RETRIES = 0x40000000, /* software TX retries */ - ATH_DEBUG_FATAL = 0x80000000, /* fatal errors */ - ATH_DEBUG_ANY = 0xffffffff + ATH_DEBUG_XMIT = 0x000000001ULL, /* basic xmit operation */ + ATH_DEBUG_XMIT_DESC = 0x000000002ULL, /* xmit descriptors */ + ATH_DEBUG_RECV = 0x000000004ULL, /* basic recv operation */ + ATH_DEBUG_RECV_DESC = 0x000000008ULL, /* recv descriptors */ + ATH_DEBUG_RATE = 0x000000010ULL, /* rate control */ + ATH_DEBUG_RESET = 0x000000020ULL, /* reset processing */ + ATH_DEBUG_MODE = 0x000000040ULL, /* mode init/setup */ + ATH_DEBUG_BEACON = 0x000000080ULL, /* beacon handling */ + ATH_DEBUG_WATCHDOG = 0x000000100ULL, /* watchdog timeout */ + ATH_DEBUG_INTR = 0x000001000ULL, /* ISR */ + ATH_DEBUG_TX_PROC = 0x000002000ULL, /* tx ISR proc */ + ATH_DEBUG_RX_PROC = 0x000004000ULL, /* rx ISR proc */ + ATH_DEBUG_BEACON_PROC = 0x000008000ULL, /* beacon ISR proc */ + ATH_DEBUG_CALIBRATE = 0x000010000ULL, /* periodic calibration */ + ATH_DEBUG_KEYCACHE = 0x000020000ULL, /* key cache management */ + ATH_DEBUG_STATE = 0x000040000ULL, /* 802.11 state transitions */ + ATH_DEBUG_NODE = 0x000080000ULL, /* node management */ + ATH_DEBUG_LED = 0x000100000ULL, /* led management */ + ATH_DEBUG_FF = 0x000200000ULL, /* fast frames */ + ATH_DEBUG_DFS = 0x000400000ULL, /* DFS processing */ + ATH_DEBUG_TDMA = 0x000800000ULL, /* TDMA processing */ + ATH_DEBUG_TDMA_TIMER = 0x001000000ULL, /* TDMA timer processing */ + ATH_DEBUG_REGDOMAIN = 0x002000000ULL, /* regulatory processing */ + ATH_DEBUG_SW_TX = 0x004000000ULL, /* per-packet software TX */ + ATH_DEBUG_SW_TX_BAW = 0x008000000ULL, /* BAW handling */ + ATH_DEBUG_SW_TX_CTRL = 0x010000000ULL, /* queue control */ + ATH_DEBUG_SW_TX_AGGR = 0x020000000ULL, /* aggregate TX */ + ATH_DEBUG_SW_TX_RETRIES = 0x040000000ULL, /* software TX retries */ + ATH_DEBUG_FATAL = 0x080000000ULL, /* fatal errors */ + ATH_DEBUG_SW_TX_BAR = 0x100000000ULL, /* BAR TX */ + ATH_DEBUG_ANY = 0xffffffffffffffffULL }; -extern int ath_debug; +extern uint64_t ath_debug; #define IFF_DUMPPKTS(sc, m) \ ((sc->sc_debug & (m)) || \ Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Tue May 15 23:31:31 2012 (r235490) +++ head/sys/dev/ath/if_ath_sysctl.c Tue May 15 23:39:37 2012 (r235491) @@ -501,8 +501,8 @@ ath_sysctlattach(struct ath_softc *sc) "regdomain", CTLFLAG_RD, &sc->sc_eerd, 0, "EEPROM regdomain code"); #ifdef ATH_DEBUG - SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "debug", CTLFLAG_RW, &sc->sc_debug, 0, + SYSCTL_ADD_QUAD(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "debug", CTLFLAG_RW, &sc->sc_debug, "control debugging printfs"); #endif SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue May 15 23:31:31 2012 (r235490) +++ head/sys/dev/ath/if_ath_tx.c Tue May 15 23:39:37 2012 (r235491) @@ -2673,7 +2673,7 @@ ath_tx_tid_bar_suspend(struct ath_softc { ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); - DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, "%s: tid=%p, called\n", __func__, tid); @@ -2704,7 +2704,7 @@ ath_tx_tid_bar_unsuspend(struct ath_soft { ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); - DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, "%s: tid=%p, called\n", __func__, tid); @@ -2732,6 +2732,9 @@ ath_tx_tid_bar_tx_ready(struct ath_softc if (tid->bar_wait == 0 || tid->hwq_depth > 0) return (0); + DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, "%s: tid=%p (%d), bar ready\n", + __func__, tid, tid->tid); + return (1); } @@ -2754,7 +2757,7 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); - DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, "%s: tid=%p, called\n", __func__, tid); @@ -2776,7 +2779,7 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, /* Don't do anything if we still have pending frames */ if (tid->hwq_depth > 0) { - DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, "%s: tid=%p, hwq_depth=%d, waiting\n", __func__, tid, @@ -2793,7 +2796,7 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, * * XXX verify this is _actually_ the valid value to begin at! */ - DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, "%s: tid=%p, new BAW left edge=%d\n", __func__, tid, @@ -2865,10 +2868,11 @@ ath_tx_tid_drain(struct ath_softc *sc, s SEQNO(bf->bf_state.bfs_seqno), bf->bf_state.bfs_retries); device_printf(sc->sc_dev, - "%s: node %p: bf=%p: tid txq_depth=%d hwq_depth=%d\n", + "%s: node %p: bf=%p: tid txq_depth=%d hwq_depth=%d, bar_wait=%d\n", __func__, ni, bf, tid->axq_depth, - tid->hwq_depth); + tid->hwq_depth, + tid->bar_wait); device_printf(sc->sc_dev, "%s: node %p: bf=%p: tid %d: txq_depth=%d, " "txq_aggr_depth=%d, sched=%d, paused=%d, " @@ -4440,8 +4444,11 @@ ath_bar_response(struct ieee80211_node * struct ath_tid *atid = &an->an_tid[tid]; int attempts = tap->txa_attempts; - DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, - "%s: called; status=%d\n", __func__, status); + DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, + "%s: called; status=%d, attempts=%d\n", + __func__, + status, + attempts); /* Note: This may update the BAW details */ sc->sc_bar_response(ni, tap, status); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue May 15 23:31:31 2012 (r235490) +++ head/sys/dev/ath/if_athvar.h Tue May 15 23:39:37 2012 (r235491) @@ -351,7 +351,7 @@ struct ath_softc { struct ath_stats sc_stats; /* interface statistics */ struct ath_tx_aggr_stats sc_aggr_stats; struct ath_intr_stats sc_intr_stats; - int sc_debug; + uint64_t sc_debug; int sc_nvaps; /* # vaps */ int sc_nstavaps; /* # station vaps */ int sc_nmeshvaps; /* # mbss vaps */ From owner-svn-src-head@FreeBSD.ORG Wed May 16 00:23:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 28D9C106564A; Wed, 16 May 2012 00:23:24 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) by mx1.freebsd.org (Postfix) with ESMTP id C9D488FC12; Wed, 16 May 2012 00:23:23 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id E91EC25D3A05; Wed, 16 May 2012 00:23:16 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 1467EBE60CF; Wed, 16 May 2012 00:23:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 6w87z8DYOPew; Wed, 16 May 2012 00:23:15 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 14A0BBE60CE; Wed, 16 May 2012 00:23:14 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201205152015.q4FKFHob003642@svn.freebsd.org> Date: Wed, 16 May 2012 00:23:14 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <14EB5CAF-03DF-4D64-9707-A8129F02DB23@lists.zabbadoz.net> References: <201205152015.q4FKFHob003642@svn.freebsd.org> To: Eitan Adler X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235481 - head/share/examples/csh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2012 00:23:24 -0000 On 15. May 2012, at 20:15 , Eitan Adler wrote: > Author: eadler > Date: Tue May 15 20:15:17 2012 > New Revision: 235481 > URL: http://svn.freebsd.org/changeset/base/235481 >=20 > Log: > Rework sample code which sets SSH_AUTH_SOCK to the user's ssh-agent > socket path if running >=20 > PR: 167932 > Submitted by: madpilot (pr) > Submitted by: wblock (final patch) > Reviewed by: If someone else reviewed your modification. > Approved by: cperciva (implicit) > MFC after: 3 days >=20 > Modified: > head/share/examples/csh/dot.cshrc >=20 > Modified: head/share/examples/csh/dot.cshrc > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/share/examples/csh/dot.cshrc Tue May 15 17:21:46 2012 = (r235480) > +++ head/share/examples/csh/dot.cshrc Tue May 15 20:15:17 2012 = (r235481) > @@ -5,7 +5,7 @@ >=20 > # Sets SSH_AUTH_SOCK to the user's ssh-agent socket path if running > if (${?SSH_AUTH_SOCK} !=3D "1") then > - setenv SSH_AUTH_SOCK `sockstat | grep "${USER}" | cut -d ' ' -f = 6`=20 > + setenv SSH_AUTH_SOCK `sockstat | grep "^${USER} " | awk = '/ssh-agent/ { print $6 }'` Wow; how would that handle the 6 different agents I am running? Can you please get rid of that extra call for grep and move it into the = awk regex? Would sockstat -u be good enough to limit the output passed through the = pipe? > endif >=20 > # Change only root's prompt --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Wed May 16 00:31:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 26DFC1065673 for ; Wed, 16 May 2012 00:31:41 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 9B9B18FC16 for ; Wed, 16 May 2012 00:31:40 +0000 (UTC) Received: by wgbds11 with SMTP id ds11so150051wgb.31 for ; Tue, 15 May 2012 17:31:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=43PKJKV6e9ieLdvkbbEORAOqNYl/GTCJpw+mt3QqI0w=; b=YA2j8md1sA28ZokQPoBcDSg1Hlwffcf1uc7yDAjz1fGrwbqhdBrMSBVcYJQCQ9lddW LU5ZSg83kxhUzGi10Abn1NTFuSF2ONpEo4dQOKhbrVD/JnCFnQMUI6B02fRq2bT4d6GU gMy/9UYXPVoaCuBMQns9y7l1MVvvAOC4pCmJo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=43PKJKV6e9ieLdvkbbEORAOqNYl/GTCJpw+mt3QqI0w=; b=KR4GoluxkhH+ThgMvZtBfP76C0dxP16VTPWhg2r7j8sL7WELvPhetwxBE9+GztX9yq 6ogWWgE/c5f+huv0cx8ZSMMw+M2ekyBsyaG+VYSU8jbA9XAPcMwC+DXUfxAmUgecG2fn zOZdT7fuVxaxLc3VrKdwq3xiL5u3txc0baIyr9+K3ZG6XE2LzM8csUz5OPy5f8Zci+Kn zDCnoD4nYznEA2fON4CD9U8iUWIFNwZNZ5Mu08lcD8Xqj0h3woBEYSCfJXb23omB7h90 qsPGBETJ6OFSmv+6i3SvSJMEHBJwOqoxqaEwlnk+hipRl9MoGkbKZAWxdP542p/gOCSc 5ROw== Received: by 10.180.86.194 with SMTP id r2mr2460333wiz.15.1337128299461; Tue, 15 May 2012 17:31:39 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.120.6 with HTTP; Tue, 15 May 2012 17:31:08 -0700 (PDT) In-Reply-To: <14EB5CAF-03DF-4D64-9707-A8129F02DB23@lists.zabbadoz.net> References: <201205152015.q4FKFHob003642@svn.freebsd.org> <14EB5CAF-03DF-4D64-9707-A8129F02DB23@lists.zabbadoz.net> From: Eitan Adler Date: Tue, 15 May 2012 20:31:08 -0400 X-Google-Sender-Auth: BwaTYyMKdGoaAEKWjnFwz_uMpMg Message-ID: To: "Bjoern A. Zeeb" Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQntbMig0sA02ZfKj+973JYy1/1xs/mq6r2mNhfzlkOUXzYGhCnBwuDqDk/1xj0sRoiTLzzh Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235481 - head/share/examples/csh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2012 00:31:41 -0000 On 15 May 2012 20:23, Bjoern A. Zeeb wrote: > Wow; how would that handle the 6 different agents I am running? This is an example meant for new users. Since you are running into a non-usual case you would obviously have to change it to suit your needs. > Can you please get rid of that extra call for grep and move it into the awk regex? This is relatively clear, but I don't have any objection to moving the ${USER} into awk. > Would sockstat -u be good enough to limit the output passed through the pipe? I don't think so. -- Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-head@FreeBSD.ORG Wed May 16 01:39:36 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3559106564A; Wed, 16 May 2012 01:39:36 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id C33698FC08; Wed, 16 May 2012 01:39:35 +0000 (UTC) Received: from alph.allbsd.org (p4242-ipbf1504funabasi.chiba.ocn.ne.jp [118.7.211.242]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id q4G1dC4T083655; Wed, 16 May 2012 10:39:22 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id q4G1dBkY026618; Wed, 16 May 2012 10:39:12 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Wed, 16 May 2012 10:38:42 +0900 (JST) Message-Id: <20120516.103842.730056917692339809.hrs@allbsd.org> To: gjb@FreeBSD.org From: Hiroki Sato In-Reply-To: <201205121508.q4CF8MLI039258@svn.freebsd.org> References: <201205121508.q4CF8MLI039258@svn.freebsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.4.50 on Emacs 23.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Wed_May_16_10_38_42_2012_091)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.3 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [133.31.130.32]); Wed, 16 May 2012 10:39:28 +0900 (JST) X-Spam-Status: No, score=-104.1 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT,RCVD_IN_RP_RNBL,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235337 - in head: lib/libutil sbin/hastd sbin/iscontrol share/man/man5 share/termcap usr.sbin/jail usr.sbin/ntp/doc usr.sbin/wpa/hostapd usr.sbin/wpa/wpa_supplicant X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2012 01:39:36 -0000 ----Security_Multipart(Wed_May_16_10_38_42_2012_091)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Glen Barber wrote in <201205121508.q4CF8MLI039258@svn.freebsd.org>: gj> Author: gjb (doc committer) gj> Date: Sat May 12 15:08:22 2012 gj> New Revision: 235337 gj> URL: http://svn.freebsd.org/changeset/base/235337 gj> gj> Log: gj> General mdoc(7) and typo fixes. gj> gj> PR: 167804 gj> Submitted by: Nobuyuki Koganemaru (kogane!jp.freebsd.org) gj> MFC after: 3 days gj> gj> Modified: gj> head/lib/libutil/login.conf.5 gj> head/sbin/hastd/hast.conf.5 gj> head/sbin/iscontrol/iscsi.conf.5 gj> head/share/man/man5/device.hints.5 gj> head/share/man/man5/make.conf.5 gj> head/share/man/man5/nsmb.conf.5 gj> head/share/man/man5/portsnap.conf.5 gj> head/share/man/man5/rc.conf.5 gj> head/share/termcap/termcap.5 gj> head/usr.sbin/jail/jail.conf.5 gj> head/usr.sbin/ntp/doc/ntp.conf.5 gj> head/usr.sbin/wpa/hostapd/hostapd.conf.5 gj> head/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.conf.5 gj> (snip) gj> Optionally, WPA PSKs can be read from a separate text file (containing a gj> -list of (PSK,MAC address) pairs. gj> +list of PSK,MAC address pairs). I think "containing list of (PSK, MAC address) pairs." or "containing a list of PSK and MAC address pairs." is better for this part. -- Hiroki ----Security_Multipart(Wed_May_16_10_38_42_2012_091)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk+zBSIACgkQTyzT2CeTzy2H7ACeK1cT4BPj1+g9lvKOFhr7PAa7 gG0An2NF9j7Wg8L9PsQ7gpzRF2mflAIO =BZrz -----END PGP SIGNATURE----- ----Security_Multipart(Wed_May_16_10_38_42_2012_091)---- From owner-svn-src-head@FreeBSD.ORG Wed May 16 01:59:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2F531065673; Wed, 16 May 2012 01:59:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD5EC8FC0C; Wed, 16 May 2012 01:59:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4G1x9jl017021; Wed, 16 May 2012 01:59:09 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4G1x9Fc017019; Wed, 16 May 2012 01:59:09 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201205160159.q4G1x9Fc017019@svn.freebsd.org> From: Glen Barber Date: Wed, 16 May 2012 01:59:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235499 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2012 01:59:09 -0000 Author: gjb (doc committer) Date: Wed May 16 01:59:09 2012 New Revision: 235499 URL: http://svn.freebsd.org/changeset/base/235499 Log: Reword hostapd.conf(5) sentence. Suggested by: hrs MFC after: 3 days X-MFC-With: r235337 (a bit delayed...) Modified: head/usr.sbin/wpa/hostapd/hostapd.conf.5 Modified: head/usr.sbin/wpa/hostapd/hostapd.conf.5 ============================================================================== --- head/usr.sbin/wpa/hostapd/hostapd.conf.5 Wed May 16 00:37:37 2012 (r235498) +++ head/usr.sbin/wpa/hostapd/hostapd.conf.5 Wed May 16 01:59:09 2012 (r235499) @@ -172,8 +172,8 @@ will be converted to PSK. This conversion uses SSID so the PSK changes when ASCII passphrase is used and the SSID is changed. .It Va wpa_psk_file -Optionally, WPA PSKs can be read from a separate text file (containing a -list of PSK,MAC address pairs). +Optionally, WPA PSKs can be read from a separate text file containing a +list of PSK and MAC address pairs. .It Va wpa_key_mgmt Set of accepted key management algorithms (WPA-PSK, WPA-EAP, or both). .It Va wpa_pairwise From owner-svn-src-head@FreeBSD.ORG Wed May 16 02:00:28 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8428106567D for ; Wed, 16 May 2012 02:00:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with SMTP id 593F18FC18 for ; Wed, 16 May 2012 02:00:27 +0000 (UTC) Received: (qmail 78785 invoked by uid 0); 15 May 2012 22:00:27 -0400 Received: from unknown (HELO glenbarber.us) (76.124.49.145) by 0 with SMTP; 15 May 2012 22:00:27 -0400 Date: Tue, 15 May 2012 22:00:25 -0400 From: Glen Barber To: Hiroki Sato Message-ID: <20120516020025.GC1374@glenbarber.us> References: <201205121508.q4CF8MLI039258@svn.freebsd.org> <20120516.103842.730056917692339809.hrs@allbsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mvpLiMfbWzRoNl4x" Content-Disposition: inline In-Reply-To: <20120516.103842.730056917692339809.hrs@allbsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235337 - in head: lib/libutil sbin/hastd sbin/iscontrol share/man/man5 share/termcap usr.sbin/jail usr.sbin/ntp/doc usr.sbin/wpa/hostapd usr.sbin/wpa/wpa_supplicant X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2012 02:00:28 -0000 --mvpLiMfbWzRoNl4x Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 16, 2012 at 10:38:42AM +0900, Hiroki Sato wrote: > gj> Optionally, WPA PSKs can be read from a separate text file (containi= ng a > gj> -list of (PSK,MAC address) pairs. > gj> +list of PSK,MAC address pairs). >=20 > I think "containing list of (PSK, MAC address) pairs." or "containing > a list of PSK and MAC address pairs." is better for this part. >=20 Agreed. I have just committed a change with the latter suggestion. Glen --mvpLiMfbWzRoNl4x Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJPswo5AAoJEFJPDDeguUaj+hsH/jyxIuzWUlr2HWfCoZBATdJf EZ71VU9GQdko+0JzzjQncjVL6PjQkfMydupaD6W+p/IU9SMfLtPzC3jSYuDU3p4C tr6APHLMKox/z163boKZshsy/evegOwFNhS+GCwMPKRAzQpMfv9GJiJG+xVZ5Ayd RKdQe3GnlyoLsrg8SyNw6UgnVY3/cEcnQM/ZDnFSsRRrhSmkFj1z62KP7dIWzIPa 3TrW5ma35kd90DwX39t+B7yernDzgx9mTpIRE66cqUzw6uPgmrbeY7LqIAc62LRI H7400Vk26p6TMBbmK3tUeHDDyInlHbafbFCog3t7wcUKqce1usbWqL/og78gUzI= =spok -----END PGP SIGNATURE----- --mvpLiMfbWzRoNl4x-- From owner-svn-src-head@FreeBSD.ORG Wed May 16 04:21:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA790106566B; Wed, 16 May 2012 04:21:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CDCC8FC14; Wed, 16 May 2012 04:21:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4G4LM4o021984; Wed, 16 May 2012 04:21:22 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4G4LMFo021982; Wed, 16 May 2012 04:21:22 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201205160421.q4G4LMFo021982@svn.freebsd.org> From: Warner Losh Date: Wed, 16 May 2012 04:21:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235500 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2012 04:21:22 -0000 Author: imp Date: Wed May 16 04:21:21 2012 New Revision: 235500 URL: http://svn.freebsd.org/changeset/base/235500 Log: By request, add back support from 7.0 and newer, since the changes for that are so minimal. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed May 16 01:59:09 2012 (r235499) +++ head/Makefile.inc1 Wed May 16 04:21:21 2012 (r235500) @@ -978,8 +978,8 @@ update: # legacy: Build compatibility shims for the next three targets # legacy: -.if ${BOOTSTRAPPING} < 800107 && ${BOOTSTRAPPING} != 0 - @echo "ERROR: Source upgrades from versions prior to 8.0 not supported."; \ +.if ${BOOTSTRAPPING} < 700055 && ${BOOTSTRAPPING} != 0 + @echo "ERROR: Source upgrades from versions prior to 7.0 not supported."; \ false .endif .for _tool in tools/build @@ -1007,6 +1007,10 @@ _gperf= gnu/usr.bin/gperf _groff= gnu/usr.bin/groff .endif +.if ${BOOTSTRAPPING} < 800013 +_mklocale= usr.bin/mklocale +.endif + .if ${BOOTSTRAPPING} < 900002 _sed= usr.bin/sed .endif @@ -1020,7 +1024,7 @@ _yacc= usr.bin/yacc _awk= usr.bin/awk .endif -.if ${MK_BSNMP} != "no" && !exists(/usr/sbin/gensnmptree) +.if ${MK_BSNMP} != "no" && !exists(/usr/sbin/gensnmptree) _gensnmptree= usr.sbin/bsnmpd/gensnmptree .endif @@ -1034,7 +1038,9 @@ _clang_tblgen= \ # dtrace tools are required for older bootstrap env and cross-build .if ${MK_CDDL} != "no" && \ - (${MACHINE} != ${TARGET} || ${MACHINE_ARCH} != ${TARGET_ARCH}) + ((${BOOTSTRAPPING} < 800038 && \ + !(${BOOTSTRAPPING} >= 700112 && ${BOOTSTRAPPING} < 799999)) \ + || (${MACHINE} != ${TARGET} || ${MACHINE_ARCH} != ${TARGET_ARCH})) _dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge .endif @@ -1067,6 +1073,7 @@ bootstrap-tools: ${_awk} \ usr.bin/lorder \ usr.bin/makewhatis \ + ${_mklocale} \ usr.bin/rpcgen \ ${_sed} \ ${_lex} \ @@ -1132,7 +1139,7 @@ build-tools: # # cross-tools: Build cross-building tools # -.if ${TARGET_ARCH} != ${MACHINE_ARCH} +.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 800035 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" _btxld= usr.sbin/btxld .endif From owner-svn-src-head@FreeBSD.ORG Wed May 16 10:44:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05C3A106564A; Wed, 16 May 2012 10:44:10 +0000 (UTC) (envelope-from gleb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E45808FC0A; Wed, 16 May 2012 10:44:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4GAi9Cj038844; Wed, 16 May 2012 10:44:09 GMT (envelope-from gleb@svn.freebsd.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4GAi91b038841; Wed, 16 May 2012 10:44:09 GMT (envelope-from gleb@svn.freebsd.org) Message-Id: <201205161044.q4GAi91b038841@svn.freebsd.org> From: Gleb Kurtsou Date: Wed, 16 May 2012 10:44:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235503 - in head/sys: fs/unionfs kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2012 10:44:10 -0000 Author: gleb Date: Wed May 16 10:44:09 2012 New Revision: 235503 URL: http://svn.freebsd.org/changeset/base/235503 Log: Skip directory entries with zero inode number during traversal. Entries with zero inode number are considered placeholders by libc and UFS. Fix remaining uses of VOP_READDIR in kernel: vop_stdvptocnp, unionfs. Sponsored by: Google Summer of Code 2011 Modified: head/sys/fs/unionfs/union_subr.c head/sys/kern/vfs_default.c Modified: head/sys/fs/unionfs/union_subr.c ============================================================================== --- head/sys/fs/unionfs/union_subr.c Wed May 16 09:03:29 2012 (r235502) +++ head/sys/fs/unionfs/union_subr.c Wed May 16 10:44:09 2012 (r235503) @@ -1184,7 +1184,7 @@ unionfs_check_rmdir(struct vnode *vp, st edp = (struct dirent*)&buf[sizeof(buf) - uio.uio_resid]; for (dp = (struct dirent*)buf; !error && dp < edp; dp = (struct dirent*)((caddr_t)dp + dp->d_reclen)) { - if (dp->d_type == DT_WHT || + if (dp->d_type == DT_WHT || dp->d_fileno == 0 || (dp->d_namlen == 1 && dp->d_name[0] == '.') || (dp->d_namlen == 2 && !bcmp(dp->d_name, "..", 2))) continue; Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Wed May 16 09:03:29 2012 (r235502) +++ head/sys/kern/vfs_default.c Wed May 16 10:44:09 2012 (r235503) @@ -343,8 +343,8 @@ dirent_exists(struct vnode *vp, const ch if (error) goto out; - if ((dp->d_type != DT_WHT) && - !strcmp(dp->d_name, dirname)) { + if (dp->d_type != DT_WHT && dp->d_fileno != 0 && + strcmp(dp->d_name, dirname) == 0) { found = 1; goto out; } From owner-svn-src-head@FreeBSD.ORG Wed May 16 15:53:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3115B106564A; Wed, 16 May 2012 15:53:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11DF18FC16; Wed, 16 May 2012 15:53:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4GFrcMQ049501; Wed, 16 May 2012 15:53:38 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4GFrcls049498; Wed, 16 May 2012 15:53:38 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201205161553.q4GFrcls049498@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 16 May 2012 15:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235508 - head/sys/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2012 15:53:39 -0000 Author: pfg Date: Wed May 16 15:53:38 2012 New Revision: 235508 URL: http://svn.freebsd.org/changeset/base/235508 Log: Fix a couple of issues that appear to be inherited from the old 8.x code: - If the lock cannot be acquired immediately unlocks 'bar' vnode and then locks both vnodes in order. - wrong vnode type panics from cache_enter_time after calls by ext2_lookup. The fix merges the fixes from ufs/ufs_lookup.c. Submitted by: Mateusz Guzik Approved by: jhb@ (mentor) Reviewed by: kib@ MFC after: 1 week Modified: head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Wed May 16 15:17:51 2012 (r235507) +++ head/sys/fs/ext2fs/ext2_lookup.c Wed May 16 15:53:38 2012 (r235508) @@ -115,6 +115,8 @@ static u_char dt_to_ext2_ft[] = { static int ext2_dirbadentry(struct vnode *dp, struct ext2fs_direct_2 *de, int entryoffsetinblock); +static int ext2_lookup_ino(struct vnode *vdp, struct vnode **vpp, + struct componentname *cnp, ino_t *dd_ino); /* * Vnode op for reading directories. @@ -285,7 +287,14 @@ ext2_lookup(ap) struct componentname *a_cnp; } */ *ap; { - struct vnode *vdp; /* vnode for directory being searched */ + + return (ext2_lookup_ino(ap->a_dvp, ap->a_vpp, ap->a_cnp, NULL)); +} + +static int +ext2_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname *cnp, + ino_t *dd_ino) +{ struct inode *dp; /* inode for directory being searched */ struct buf *bp; /* a buffer of directory entries */ struct ext2fs_direct_2 *ep; /* the current directory entry */ @@ -305,22 +314,22 @@ ext2_lookup(ap) doff_t enduseful; /* pointer past last used dir slot */ u_long bmask; /* block offset mask */ int namlen, error; - struct vnode **vpp = ap->a_vpp; - struct componentname *cnp = ap->a_cnp; struct ucred *cred = cnp->cn_cred; int flags = cnp->cn_flags; int nameiop = cnp->cn_nameiop; - ino_t ino; + ino_t ino, ino1; int ltype; - int DIRBLKSIZ = VTOI(ap->a_dvp)->i_e2fs->e2fs_bsize; + int DIRBLKSIZ = VTOI(vdp)->i_e2fs->e2fs_bsize; + + if (vpp != NULL) + *vpp = NULL; - bp = NULL; - slotoffset = -1; - *vpp = NULL; - vdp = ap->a_dvp; dp = VTOI(vdp); bmask = VFSTOEXT2(vdp->v_mount)->um_mountp->mnt_stat.f_iosize - 1; +restart: + bp = NULL; + slotoffset = -1; /* * We now have a segment name to search for, and a directory to search. @@ -536,10 +545,12 @@ searchloop: * Insert name into cache (as non-existent) if appropriate. */ if ((cnp->cn_flags & MAKEENTRY) && nameiop != CREATE) - cache_enter(vdp, *vpp, cnp); + cache_enter(vdp, NULL, cnp); return (ENOENT); found: + if (dd_ino != NULL) + *dd_ino = ino; if (numdirpasses == 2) nchstats.ncs_pass2++; /* @@ -582,6 +593,8 @@ found: dp->i_count = 0; else dp->i_count = dp->i_offset - prevoff; + if (dd_ino != NULL) + return (0); if (dp->i_number == ino) { VREF(vdp); *vpp = vdp; @@ -622,6 +635,8 @@ found: */ if (dp->i_number == ino) return (EISDIR); + if (dd_ino != NULL) + return (0); if ((error = VFS_VGET(vdp->v_mount, ino, LK_EXCLUSIVE, &tdp)) != 0) return (error); @@ -629,6 +644,8 @@ found: cnp->cn_flags |= SAVENAME; return (0); } + if (dd_ino != NULL) + return (0); /* * Step through the translation in the name. We do not `vput' the @@ -655,8 +672,27 @@ found: VOP_UNLOCK(pdp, 0); /* race to get the inode */ error = VFS_VGET(vdp->v_mount, ino, cnp->cn_lkflags, &tdp); vn_lock(pdp, ltype | LK_RETRY); - if (error != 0) + if (pdp->v_iflag & VI_DOOMED) { + if (error == 0) + vput(tdp); + error = ENOENT; + } + if (error) return (error); + /* + * Recheck that ".." entry in the vdp directory points + * to the inode we looked up before vdp lock was + * dropped. + */ + error = ext2_lookup_ino(pdp, NULL, cnp, &ino1); + if (error) { + vput(tdp); + return (error); + } + if (ino1 != ino) { + vput(tdp); + goto restart; + } *vpp = tdp; } else if (dp->i_number == ino) { VREF(vdp); /* we want ourself, ie "." */ Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Wed May 16 15:17:51 2012 (r235507) +++ head/sys/fs/ext2fs/ext2_vnops.c Wed May 16 15:53:38 2012 (r235508) @@ -1336,7 +1336,11 @@ ext2_rmdir(ap) error = ext2_truncate(vp, (off_t)0, IO_SYNC, cnp->cn_cred, cnp->cn_thread); cache_purge(ITOV(ip)); - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); + if (vn_lock(dvp, LK_EXCLUSIVE | LK_NOWAIT) != 0) { + VOP_UNLOCK(vp, 0); + vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + } out: return (error); } From owner-svn-src-head@FreeBSD.ORG Wed May 16 17:51:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBD4F1065670; Wed, 16 May 2012 17:51:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D700E8FC1E; Wed, 16 May 2012 17:51:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4GHpu7P054497; Wed, 16 May 2012 17:51:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4GHpuce054494; Wed, 16 May 2012 17:51:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205161751.q4GHpuce054494@svn.freebsd.org> From: Alexander Motin Date: Wed, 16 May 2012 17:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235510 - in head: lib/libusbhid sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2012 17:51:57 -0000 Author: mav Date: Wed May 16 17:51:56 2012 New Revision: 235510 URL: http://svn.freebsd.org/changeset/base/235510 Log: HID Report ID is unsigned value, so clear the rest of bits from possible sign expansion. Modified: head/lib/libusbhid/parse.c head/sys/dev/usb/usb_hid.c Modified: head/lib/libusbhid/parse.c ============================================================================== --- head/lib/libusbhid/parse.c Wed May 16 17:26:14 2012 (r235509) +++ head/lib/libusbhid/parse.c Wed May 16 17:51:56 2012 (r235510) @@ -392,7 +392,7 @@ hid_get_item(hid_data_t s, hid_item_t *h s->loc_size = dval & mask; break; case 8: - hid_switch_rid(s, c, dval); + hid_switch_rid(s, c, dval & mask); break; case 9: /* mask because value is unsigned */ Modified: head/sys/dev/usb/usb_hid.c ============================================================================== --- head/sys/dev/usb/usb_hid.c Wed May 16 17:26:14 2012 (r235509) +++ head/sys/dev/usb/usb_hid.c Wed May 16 17:51:56 2012 (r235510) @@ -425,7 +425,7 @@ hid_get_item(struct hid_data *s, struct s->loc_size = dval & mask; break; case 8: - hid_switch_rid(s, c, dval); + hid_switch_rid(s, c, dval & mask); break; case 9: /* mask because value is unsigned */ From owner-svn-src-head@FreeBSD.ORG Wed May 16 20:30:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 267C2106564A; Wed, 16 May 2012 20:30:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECB9C8FC15; Wed, 16 May 2012 20:30:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4GKUKB9060607; Wed, 16 May 2012 20:30:20 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4GKUKWB060604; Wed, 16 May 2012 20:30:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205162030.q4GKUKWB060604@svn.freebsd.org> From: Alexander Motin Date: Wed, 16 May 2012 20:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235519 - head/usr.bin/usbhidctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2012 20:30:21 -0000 Author: mav Date: Wed May 16 20:30:20 2012 New Revision: 235519 URL: http://svn.freebsd.org/changeset/base/235519 Log: Add support for -z option for reading operations. It allows to not request current values from device, but only receive changes. Modified: head/usr.bin/usbhidctl/usbhid.c head/usr.bin/usbhidctl/usbhidctl.1 Modified: head/usr.bin/usbhidctl/usbhid.c ============================================================================== --- head/usr.bin/usbhidctl/usbhid.c Wed May 16 20:06:17 2012 (r235518) +++ head/usr.bin/usbhidctl/usbhid.c Wed May 16 20:30:20 2012 (r235519) @@ -182,11 +182,11 @@ usage(void) fprintf(stderr, "usage: %s -f device " - "[-l] [-n] [-r] [-t tablefile] [-v] [-x] name ...\n", + "[-l] [-n] [-r] [-t tablefile] [-v] [-x] [-z] name ...\n", getprogname()); fprintf(stderr, " %s -f device " - "[-l] [-n] [-r] [-t tablefile] [-v] [-x] -a\n", + "[-l] [-n] [-r] [-t tablefile] [-v] [-x] [-z] -a\n", getprogname()); fprintf(stderr, " %s -f device " @@ -304,7 +304,7 @@ dumpdata(int f, report_desc_t rd, int lo u_char *dbuf; enum hid_kind kind; - kind = 0; + kind = zflag ? 3 : 0; rid = -1; use_rid = !!hid_get_report_id(f); do { Modified: head/usr.bin/usbhidctl/usbhidctl.1 ============================================================================== --- head/usr.bin/usbhidctl/usbhidctl.1 Wed May 16 20:06:17 2012 (r235518) +++ head/usr.bin/usbhidctl/usbhidctl.1 Wed May 16 20:30:20 2012 (r235519) @@ -47,6 +47,7 @@ .Op Fl l .Op Fl v .Op Fl x +.Op Fl z .Fl a .Nm .Fl f Ar device @@ -55,6 +56,7 @@ .Op Fl n .Op Fl v .Op Fl x +.Op Fl z .Ar item ... .Nm .Fl f Ar device @@ -99,9 +101,8 @@ Only 'output' and 'feature' kinds can be .It Fl x Dump data in hexadecimal as well as decimal. .It Fl z -Reset reports to zero before processing -.Fl w -arguments. If not specified, current values will be requested from device. +Reset reports to zero before processing other arguments. +If not specified, current values will be requested from device. .El .Sh SYNTAX .Nm From owner-svn-src-head@FreeBSD.ORG Thu May 17 04:04:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E175106567D; Thu, 17 May 2012 04:04:49 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23A278FC18; Thu, 17 May 2012 04:04:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4H44m8q077805; Thu, 17 May 2012 04:04:48 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4H44mh0077802; Thu, 17 May 2012 04:04:48 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201205170404.q4H44mh0077802@svn.freebsd.org> From: Tim Kientzle Date: Thu, 17 May 2012 04:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235529 - in head/sys/boot: fdt uboot/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 04:04:49 -0000 Author: kientzle Date: Thu May 17 04:04:48 2012 New Revision: 235529 URL: http://svn.freebsd.org/changeset/base/235529 Log: Access the device tree blob via copyin/copyout. The code previously assumed that copyin/copyout did no address translation and that the device tree blob could be manipulated in-place (with only a few adjustments for the ELF loader offset). This isn't possible on all platforms, so the revised code uses copyout() to copy the device tree blob into a heap-allocated buffer and then updates the device tree with copyout(). This isn't ideal, since it bloats the loader memory usage, but seems the only feasible approach (short of rewriting all of the fdt manipulation routines). Modified: head/sys/boot/fdt/fdt_loader_cmd.c head/sys/boot/uboot/common/metadata.c Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Thu May 17 00:06:54 2012 (r235528) +++ head/sys/boot/fdt/fdt_loader_cmd.c Thu May 17 04:04:48 2012 (r235529) @@ -57,11 +57,17 @@ __FBSDID("$FreeBSD$"); #define STR(number) #number #define STRINGIFY(number) STR(number) -#define COPYOUT(s,d,l) archsw.arch_copyout((vm_offset_t)(s), d, l) +#define COPYOUT(s,d,l) archsw.arch_copyout(s, d, l) +#define COPYIN(s,d,l) archsw.arch_copyin(s, d, l) #define FDT_STATIC_DTB_SYMBOL "fdt_static_dtb" +/* Local copy of FDT */ static struct fdt_header *fdtp = NULL; +/* Size of FDT blob */ +static size_t fdtp_size = 0; +/* Location of FDT in kernel or module */ +static vm_offset_t fdtp_va = 0; static int fdt_cmd_nyi(int argc, char *argv[]); @@ -98,21 +104,19 @@ static const struct cmdtab commands[] = static char cwd[FDT_CWD_LEN] = "/"; static vm_offset_t -fdt_find_static_dtb(void) +fdt_find_static_dtb() { + Elf_Dyn dyn; Elf_Sym sym; - vm_offset_t dyntab, esym; + vm_offset_t dyntab, esym, strtab, symtab, fdt_start; uint64_t offs; struct preloaded_file *kfp; struct file_metadata *md; - Elf_Sym *symtab; - Elf_Dyn *dyn; - char *strtab, *strp; - int i, sym_count; - - symtab = NULL; - dyntab = esym = 0; - strtab = strp = NULL; + char *strp; + int sym_count; + + symtab = strtab = dyntab = esym = 0; + strp = NULL; offs = __elfN(relocation_offset); @@ -123,28 +127,29 @@ fdt_find_static_dtb(void) md = file_findmetadata(kfp, MODINFOMD_ESYM); if (md == NULL) return (0); - COPYOUT(md->md_data, &esym, sizeof(esym)); + bcopy(md->md_data, &esym, sizeof(esym)); + // esym is already offset md = file_findmetadata(kfp, MODINFOMD_DYNAMIC); if (md == NULL) return (0); - COPYOUT(md->md_data, &dyntab, sizeof(dyntab)); - + bcopy(md->md_data, &dyntab, sizeof(dyntab)); dyntab += offs; /* Locate STRTAB and DYNTAB */ - for (dyn = (Elf_Dyn *)dyntab; dyn->d_tag != DT_NULL; dyn++) { - if (dyn->d_tag == DT_STRTAB) { - strtab = (char *)(uintptr_t)(dyn->d_un.d_ptr + offs); - continue; - } else if (dyn->d_tag == DT_SYMTAB) { - symtab = (Elf_Sym *)(uintptr_t) - (dyn->d_un.d_ptr + offs); - continue; + for (;;) { + COPYOUT(dyntab, &dyn, sizeof(dyn)); + if (dyn.d_tag == DT_STRTAB) { + strtab = (vm_offset_t)(dyn.d_un.d_ptr) + offs; + } else if (dyn.d_tag == DT_SYMTAB) { + symtab = (vm_offset_t)(dyn.d_un.d_ptr) + offs; + } else if (dyn.d_tag == DT_NULL) { + break; } + dyntab += sizeof(dyn); } - if (symtab == NULL || strtab == NULL) { + if (symtab == 0 || strtab == 0) { /* * No symtab? No strtab? That should not happen here, * and should have been verified during __elfN(loadimage). @@ -153,7 +158,7 @@ fdt_find_static_dtb(void) return (0); } - sym_count = (int)((Elf_Sym *)esym - symtab) / sizeof(Elf_Sym); + sym_count = (int)(esym - symtab) / sizeof(Elf_Sym); /* * The most efficent way to find a symbol would be to calculate a @@ -165,26 +170,27 @@ fdt_find_static_dtb(void) * we are eliminating symbols type of which is not STT_NOTYPE, or(and) * those which binding attribute is not STB_GLOBAL. */ - for (i = 0; i < sym_count; i++) { - COPYOUT(symtab + i, &sym, sizeof(sym)); + fdt_start = 0; + while (sym_count > 0 && fdt_start == 0) { + COPYOUT(symtab, &sym, sizeof(sym)); + symtab += sizeof(sym); + --sym_count; if (ELF_ST_BIND(sym.st_info) != STB_GLOBAL || ELF_ST_TYPE(sym.st_info) != STT_NOTYPE) continue; - - strp = strdupout((vm_offset_t)(strtab + sym.st_name)); - if (strcmp(strp, FDT_STATIC_DTB_SYMBOL) == 0) { - /* Found a match ! */ - free(strp); - return ((vm_offset_t)(sym.st_value + offs)); - } + strp = strdupout(strtab + sym.st_name); + if (strcmp(strp, FDT_STATIC_DTB_SYMBOL) == 0) + fdt_start = (vm_offset_t)sym.st_value + offs; free(strp); } - return (0); + printf("fdt_start: 0x%08jX\n", (intmax_t)fdt_start); + return (fdt_start); } static int fdt_setup_fdtp() { + struct fdt_header header; struct preloaded_file *bfp; int err; @@ -193,15 +199,26 @@ fdt_setup_fdtp() */ bfp = file_findfile(NULL, "dtb"); if (bfp == NULL) { - if ((fdtp = (struct fdt_header *)fdt_find_static_dtb()) == 0) { + if ((fdtp_va = fdt_find_static_dtb()) == 0) { command_errmsg = "no device tree blob found!"; + printf("%s\n", command_errmsg); return (CMD_ERROR); } } else { /* Dynamic blob has precedence over static. */ - fdtp = (struct fdt_header *)bfp->f_addr; + fdtp_va = bfp->f_addr; } + COPYOUT(fdtp_va, &header, sizeof(header)); + fdtp_size = fdt_totalsize(&header); + fdtp = malloc(fdtp_size); + if (fdtp == NULL) { + command_errmsg = "can't allocate memory for device tree copy"; + printf("%s\n", command_errmsg); + return (CMD_ERROR); + } + COPYOUT(fdtp_va, fdtp, fdtp_size); + /* * Validate the blob. */ @@ -547,7 +564,7 @@ fixup_stdout(const char *env) /* * Locate the blob, fix it up and return its location. */ -void * +vm_offset_t fdt_fixup(void) { const char *env; @@ -563,7 +580,7 @@ fdt_fixup(void) err = fdt_setup_fdtp(); if (err) { sprintf(command_errbuf, "No valid device tree blob found!"); - return (NULL); + return (0); } /* Create /chosen node (if not exists) */ @@ -618,7 +635,9 @@ fdt_fixup(void) fdt_setprop(fdtp, chosen, "fixup-applied", NULL, 0); success: - return (fdtp); + /* Overwrite the FDT with the fixed version. */ + COPYIN(fdtp, fdtp_va, fdtp_size); + return (fdtp_va); } int @@ -636,7 +655,7 @@ command_fdt_internal(int argc, char *arg /* * Check if uboot env vars were parsed already. If not, do it now. */ - if (fdt_fixup() == NULL) + if (fdt_fixup() == 0) return (CMD_ERROR); /* @@ -1153,6 +1172,8 @@ fdt_modprop(int nodeoff, char *propname, else sprintf(command_errbuf, "Could not add/modify property!\n"); + } else { + COPYIN(fdtp, fdtp_va, fdtp_size); } return (rv); } @@ -1373,6 +1394,8 @@ fdt_cmd_rm(int argc, char *argv[]) if (rv) { sprintf(command_errbuf, "could not delete node"); return (CMD_ERROR); + } else { + COPYIN(fdtp, fdtp_va, fdtp_size); } return (CMD_OK); } @@ -1403,6 +1426,8 @@ fdt_cmd_mknode(int argc, char *argv[]) sprintf(command_errbuf, "Could not add node!\n"); return (CMD_ERROR); + } else { + COPYIN(fdtp, fdtp_va, fdtp_size); } return (CMD_OK); } Modified: head/sys/boot/uboot/common/metadata.c ============================================================================== --- head/sys/boot/uboot/common/metadata.c Thu May 17 00:06:54 2012 (r235528) +++ head/sys/boot/uboot/common/metadata.c Thu May 17 04:04:48 2012 (r235529) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include "glue.h" #if defined(LOADER_FDT_SUPPORT) -extern int fdt_fixup(void); +extern vm_offset_t fdt_fixup(void); #endif /* @@ -337,7 +337,7 @@ md_load(char *args, vm_offset_t *modulep #if defined(LOADER_FDT_SUPPORT) /* Handle device tree blob */ dtbp = fdt_fixup(); - if (dtbp != (vm_offset_t)NULL) + if (dtbp != 0) file_addmetadata(kfp, MODINFOMD_DTBP, sizeof dtbp, &dtbp); else pager_output("WARNING! Trying to fire up the kernel, but no " From owner-svn-src-head@FreeBSD.ORG Thu May 17 05:11:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50EF4106564A; Thu, 17 May 2012 05:11:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3903D8FC19; Thu, 17 May 2012 05:11:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4H5BwCp080008; Thu, 17 May 2012 05:11:58 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4H5Bvm5079996; Thu, 17 May 2012 05:11:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201205170511.q4H5Bvm5079996@svn.freebsd.org> From: Xin LI Date: Thu, 17 May 2012 05:11:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235530 - in head: contrib/tcpdump contrib/tcpdump/missing contrib/tcpdump/tests usr.sbin/tcpdump/tcpdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 05:11:58 -0000 Author: delphij Date: Thu May 17 05:11:57 2012 New Revision: 235530 URL: http://svn.freebsd.org/changeset/base/235530 Log: Merge tcpdump 4.2.1. MFC after: 2 weeks Added: head/contrib/tcpdump/in_cksum.c - copied unchanged from r235428, vendor/tcpdump/dist/in_cksum.c head/contrib/tcpdump/ppi.h - copied unchanged from r235428, vendor/tcpdump/dist/ppi.h head/contrib/tcpdump/print-802_15_4.c - copied unchanged from r235428, vendor/tcpdump/dist/print-802_15_4.c head/contrib/tcpdump/print-babel.c - copied unchanged from r235428, vendor/tcpdump/dist/print-babel.c head/contrib/tcpdump/print-carp.c - copied unchanged from r235428, vendor/tcpdump/dist/print-carp.c head/contrib/tcpdump/print-ppi.c - copied unchanged from r235428, vendor/tcpdump/dist/print-ppi.c head/contrib/tcpdump/print-rpki-rtr.c - copied unchanged from r235428, vendor/tcpdump/dist/print-rpki-rtr.c Deleted: head/contrib/tcpdump/missing/addrsize.h head/contrib/tcpdump/missing/bittypes.h head/contrib/tcpdump/missing/resolv6.h head/contrib/tcpdump/missing/resolv_ext.h head/contrib/tcpdump/tests/ Modified: head/contrib/tcpdump/CHANGES head/contrib/tcpdump/CREDITS head/contrib/tcpdump/Makefile.in head/contrib/tcpdump/VERSION head/contrib/tcpdump/acconfig.h head/contrib/tcpdump/addrtoname.c head/contrib/tcpdump/addrtoname.h head/contrib/tcpdump/bootp.h head/contrib/tcpdump/config.h.in head/contrib/tcpdump/configure head/contrib/tcpdump/configure.in head/contrib/tcpdump/cpack.c head/contrib/tcpdump/cpack.h head/contrib/tcpdump/ethertype.h head/contrib/tcpdump/forces.h head/contrib/tcpdump/ieee802_11_radio.h head/contrib/tcpdump/interface.h head/contrib/tcpdump/ip.h head/contrib/tcpdump/ip6.h head/contrib/tcpdump/ipproto.c head/contrib/tcpdump/ipproto.h head/contrib/tcpdump/netdissect.h head/contrib/tcpdump/ospf.h head/contrib/tcpdump/oui.c head/contrib/tcpdump/oui.h head/contrib/tcpdump/print-802_11.c head/contrib/tcpdump/print-ap1394.c head/contrib/tcpdump/print-arcnet.c head/contrib/tcpdump/print-arp.c head/contrib/tcpdump/print-atalk.c head/contrib/tcpdump/print-atm.c head/contrib/tcpdump/print-bgp.c head/contrib/tcpdump/print-cdp.c head/contrib/tcpdump/print-chdlc.c head/contrib/tcpdump/print-dccp.c head/contrib/tcpdump/print-dhcp6.c head/contrib/tcpdump/print-enc.c head/contrib/tcpdump/print-ether.c head/contrib/tcpdump/print-forces.c head/contrib/tcpdump/print-fr.c head/contrib/tcpdump/print-gre.c head/contrib/tcpdump/print-icmp.c head/contrib/tcpdump/print-icmp6.c head/contrib/tcpdump/print-igmp.c head/contrib/tcpdump/print-ip.c head/contrib/tcpdump/print-ip6.c head/contrib/tcpdump/print-ipnet.c head/contrib/tcpdump/print-ipx.c head/contrib/tcpdump/print-isoclns.c head/contrib/tcpdump/print-juniper.c head/contrib/tcpdump/print-lane.c head/contrib/tcpdump/print-llc.c head/contrib/tcpdump/print-lldp.c head/contrib/tcpdump/print-mobile.c head/contrib/tcpdump/print-mpls.c head/contrib/tcpdump/print-null.c head/contrib/tcpdump/print-ospf.c head/contrib/tcpdump/print-pflog.c head/contrib/tcpdump/print-pgm.c head/contrib/tcpdump/print-pim.c head/contrib/tcpdump/print-ppp.c head/contrib/tcpdump/print-rrcp.c head/contrib/tcpdump/print-sctp.c head/contrib/tcpdump/print-sflow.c head/contrib/tcpdump/print-sl.c head/contrib/tcpdump/print-sll.c head/contrib/tcpdump/print-sunrpc.c head/contrib/tcpdump/print-symantec.c head/contrib/tcpdump/print-tcp.c head/contrib/tcpdump/print-tftp.c head/contrib/tcpdump/print-udp.c head/contrib/tcpdump/print-vrrp.c head/contrib/tcpdump/tcp.h head/contrib/tcpdump/tcpdump-stdinc.h head/contrib/tcpdump/tcpdump.1.in head/contrib/tcpdump/tcpdump.c head/contrib/tcpdump/udp.h head/usr.sbin/tcpdump/tcpdump/Makefile head/usr.sbin/tcpdump/tcpdump/config.h head/usr.sbin/tcpdump/tcpdump/tcpdump.1 Directory Properties: head/contrib/tcpdump/ (props changed) Modified: head/contrib/tcpdump/CHANGES ============================================================================== --- head/contrib/tcpdump/CHANGES Thu May 17 04:04:48 2012 (r235529) +++ head/contrib/tcpdump/CHANGES Thu May 17 05:11:57 2012 (r235530) @@ -1,3 +1,64 @@ +Friday December 9, 2011. guy@alum.mit.edu. + Summary for 4.2.1 tcpdump release + Only build the Babel printer if IPv6 is enabled. + Support Babel on port 6696 as well as 6697. + Include ppi.h in release tarball. + Include all the test files in the release tarball, and don't + "include" test files that no longer exist. + Don't assume we have - check for it. + Support "-T carp" as a way of dissecting IP protocol 112 as CARP + rather than VRRP. + Support Hilscher NetAnalyzer link-layer header format. + Constify some pointers and fix compiler warnings. + Get rid of never-true test. + Fix an unintended fall-through in a case statement in the ARP + printer. + Fix several cases where sizeof(sizeof(XXX)) was used when just + sizeof(XXX) was intended. + Make stricter sanity checks in the ES-IS printer. + Get rid of some GCCisms that caused builds to fai with compilers + that don't support them. + Fix typo in man page. + Added length checks to Babel printer. + +Sunday July 24, 2011. mcr@sandelman.ca. + Summary for 4.2.+ + merged 802.15.4 decoder from Dmitry Eremin-Solenikov + updates to forces for new port numbers + Use "-H", not "-h", for the 802.11s option. (-h always help) + Better ICMPv6 checksum handling. + add support for the RPKI/Router Protocol, per -ietf-sidr-rpki-rtr-12 + get rid of uuencoded pcap test files, git can do binary. + sFlow changes for 64-bit counters. + fixes for PPI packet header handling and printing. + Add DCB Exchange protocol (DCBX) version 1.01. + Babel dissector, from Juliusz Chroboczek and Grégoire Henry. + improvements to radiotap for rate values > 127. + Many improvements to ForCES decode, including fix SCTP TML port + updated RPL type code to RPL-17 draft + Improve printout of DHCPv6 options. + added support and test case for QinQ (802.1q VLAN) packets + Handle DLT_IEEE802_15_4_NOFCS like DLT_IEEE802_15_4. + Build fixes for Sparc and other machines with alignment restrictions. + Merged changes from Debian package. + PGM: Add ACK decoding and add PGMCC DATA and FEEDBACK options. + Build fixes for OSX (Snow Leopard and others) + Add support for IEEE 802.15.4 packets + +Tue. July 20, 2010. guy@alum.mit.edu. + Summary for 4.1.2 tcpdump release + If -U is specified, flush the file after creating it, so it's + not zero-length + Fix TCP flags output description, and some typoes, in the man + page + Add a -h flag, and only attempt to recognize 802.11s mesh + headers if it's set + When printing the link-layer type list, send *all* output to + stderr + Include the CFLAGS setting when configure was run in the + compiler flags + Thu. April 1, 2010. guy@alum.mit.edu. Summary for 4.1.1 tcpdump release Fix build on systems with PF, such as FreeBSD and OpenBSD. Modified: head/contrib/tcpdump/CREDITS ============================================================================== --- head/contrib/tcpdump/CREDITS Thu May 17 04:04:48 2012 (r235529) +++ head/contrib/tcpdump/CREDITS Thu May 17 05:11:57 2012 (r235530) @@ -1,189 +1,203 @@ This file lists people who have contributed to tcpdump: The current maintainers: - Bill Fenner - David Young - Fulvio Risso - Guy Harris - Hannes Gredler - Michael Richardson + Bill Fenner + David Young + Fulvio Risso + Guy Harris + Hannes Gredler + Michael Richardson Additional people who have contributed patches: - Aaron Campbell - Alfredo Andres - Albert Chin - Ananth Suryanarayana - Andrea Bittau - Andrew Brown - Andrew Church - Andrew Hintz - Andrew Silent - Andrew Tridgell - Andy Heffernan - Arkadiusz Miskiewicz - Armando L. Caro Jr. - Arnaldo Carvalho de Melo - Ben Byer - Atsushi Onoe - Ben Smithurst - Bert Vermeulen - Bjoern A. Zeeb - Brent L. Bates - Brian Ginsbach - Bruce M. Simpson - Carles Kishimoto Bisbe - Charlie Lenahan - Charles M. Hannum - Chris Cogdon - Chris G. Demetriou - Christian Sievers - Chris Jepeway - Chris Larson - Craig Rodrigues - Crist J. Clark - Daniel Hagerty - Darren Reed - David Binderman - David Horn - David Smith - David Young - Don Ebright - Eddie Kohler - Elmar Kirchner - Fang Wang - Florent Drouin - Florian Forster - Francis Dupont - Francisco Matias Cuenca-Acuna - Francois-Xavier Le Bail - Frank Volf - Fulvio Risso - George Bakos - Gerald Combs - Gerrit Renker - Gert Doering - Greg Minshall - Greg Stark - Gilbert Ramirez Jr. - Gisle Vanem - Hannes Viertel - Hank Leininger - Harry Raaymakers - Heinz-Ado Arnolds - Hendrik Scholz - Ian McDonald - Ilpo Järvinen - Jacek Tobiasz - Jakob Schlyter - Jamal Hadi Salim - Jan Oravec - Jason R. Thorpe - Jefferson Ogata - Jeffrey Hutzelman - Jesper Peterson - Jim Hutchins - Jonathan Heusser - Tatuya Jinmei - João Medeiros - Joerg Mayer - Jørgen Thomsen - Julian Cowley - Kaarthik Sivakumar - Karl Norby - Kazushi Sugyo - Kelly Carmichael - Ken Hornstein - Kevin Steves - Klaus Klein - Kris Kennaway - Krzysztof Halasa - Larry Lile - Lennert Buytenhek - Loris Degioanni - Love Hörnquist-Ã…strand - Lucas C. Villa Real - Luis Martin Garcia - Maciej W. Rozycki - Manu Pathak - Marc Binderberger - Marc A. Lehmann - Mark Ellzey Thomas - Marko Kiiskila - Markus Schöpflin - Marshall Rose - Martin Husemann - Max Laier - Michael A. Meffie III - Michael Madore - Michael Riepe - Michael Shalayeff - Michael Shields - Michael T. Stolarchuk - Michele "mydecay" Marchetto - Mike Frysinger - Monroe Williams - Motonori Shindo - Nathan J. Williams - Nathaniel Couper-Noles - Neil T. Spring - Niels Provos - Nickolai Zeldovich - Nicolas Ferrero - Noritoshi Demizu - Olaf Kirch - Onno van der Linden - Paolo Abeni - Pascal Hennequin - Pasvorn Boonmark - Paul Mundt - Paul S. Traina - Pavlin Radoslavov - Pekka Savola - Peter Fales - Peter Jeremy - - Peter Volkov - Phil Wood - Rafal Maszkowski - Randy Sofia - Raphael Raimbault - Rick Cheng - Rick Jones - Rick Watson - Rob Braun - Robert Edmonds - Roderick Schertler - Sagun Shakya - Sami Farin - Scott Rose - Sebastian Krahmer - Sebastien Raveau - Sebastien Vincent - Sepherosa Ziehau - Seth Webster - Shinsuke Suzuki - Steinar Haug - Swaminathan Chandrasekaran - Takashi Yamamoto - Terry Kennedy - Timo Koskiahde - Tony Li - Toshihiro Kanda - Uns Lider - Victor Oppleman - Wesley Griffin - Wesley Shields - Wilbert de Graaf - Will Drewry - William J. Hulley - Yen Yen Lim - Yoshifumi Nishida + A Costa + Aaron Campbell + Alfredo Andres + Albert Chin + Ananth Suryanarayana + Andrea Bittau + Andrew Brown + Andrew Church + Andrew Hintz + Andrew Nording + Andrew Tridgell + Andy Heffernan + Anton Bernal + Arkadiusz Miskiewicz + Armando L. Caro Jr. + Arnaldo Carvalho de Melo + Ben Byer + Atsushi Onoe + Ben Smithurst + Bert Vermeulen + Bjoern A. Zeeb + Brent L. Bates + Brian Ginsbach + Bruce M. Simpson + Carles Kishimoto Bisbe + Charlie Lenahan + Charles M. Hannum + Chris Cogdon + Chris G. Demetriou + Chris Jepeway + Chris Larson + Christian Sievers + Christophe Rhodes + Craig Rodrigues + Crist J. Clark + Daniel Hagerty + Darren Reed + David Binderman + David Horn + David Smith + David Young + Dmitry Eremin-Solenikov + Don Ebright + Eddie Kohler + Elmar Kirchner + Fang Wang + Florent Drouin + Florian Forster + Francis Dupont + Francisco Matias Cuenca-Acuna + Francois-Xavier Le Bail + Frank Volf + Fulvio Risso + George Bakos + Gerald Combs + Gerrit Renker + Gert Doering + Greg Minshall + Greg Stark + Grégoire Henry + Gilbert Ramirez Jr. + Gisle Vanem + Hannes Viertel + Hank Leininger + Harry Raaymakers + Heinz-Ado Arnolds + Hendrik Scholz + Ian McDonald + Ilpo Järvinen + Jacek Tobiasz + Jakob Schlyter + Jamal Hadi Salim + Jan Oravec + Jason R. Thorpe + Jefferson Ogata + Jeffrey Hutzelman + Jesper Peterson + Jim Hutchins + Jonathan Heusser + Tatuya Jinmei + João Medeiros + Joerg Mayer + Jørgen Thomsen + Julian Cowley + Juliusz Chroboczek + Kaarthik Sivakumar + Kaladhar Musunuru + Karl Norby + Kazushi Sugyo + Kelly Carmichael + Ken Hornstein + Kevin Steves + Klaus Klein + Kris Kennaway + Krzysztof Halasa + Larry Lile + Lennert Buytenhek + Loris Degioanni + Love Hörnquist-Ã…strand + Lucas C. Villa Real + Luis MartinGarcia + Maciej W. Rozycki + Manu Pathak + Marc Binderberger + Marc A. Lehmann + Mark Ellzey Thomas + Marko Kiiskila + Markus Schöpflin + Marshall Rose + Martin Husemann + Max Laier + Michael A. Meffie III + Michael Madore + Michael Riepe + Michael Shalayeff + Michael Shields + Michael T. Stolarchuk + Michal Sekletar + Michele "mydecay" Marchetto + Mike Frysinger + Minto Jeyananth + Monroe Williams + Motonori Shindo + Nathan J. Williams + Nathaniel Couper-Noles + Neil T. Spring + Niels Provos + Nickolai Zeldovich + Nicolas Ferrero + Noritoshi Demizu + Olaf Kirch + Onno van der Linden + Paolo Abeni + Pascal Hennequin + Pasvorn Boonmark + Paul Ferrell + Paul Mundt + Paul S. Traina + Pavlin Radoslavov + Pawel Worach + Pekka Savola + Peter Fales + Peter Jeremy + + Peter Volkov + Phil Wood + Rafal Maszkowski + Randy Sofia + Raphael Raimbault + Rick Cheng + Rick Jones + Rick Watson + Rob Braun + Robert Edmonds + Roderick Schertler + Romain Francoise + Sagun Shakya + Sami Farin + Scott Mcmillan + Scott Rose + Sebastian Krahmer + Sebastien Raveau + Sebastien Vincent + Sepherosa Ziehau + Seth Webster + Shinsuke Suzuki + Steinar Haug + Swaminathan Chandrasekaran + Takashi Yamamoto + Terry Kennedy + Timo Koskiahde + Tony Li + Toshihiro Kanda + Uns Lider + Victor Oppleman + Weesan Lee + Wesley Griffin + Wesley Shields + Wilbert de Graaf + Will Drewry + William J. Hulley + Yen Yen Lim + Yoshifumi Nishida The original LBL crew: - Steve McCanne - Craig Leres - Van Jacobson + Steve McCanne + Craig Leres + Van Jacobson Past maintainers: - Jun-ichiro itojun Hagino + Jun-ichiro itojun Hagino Modified: head/contrib/tcpdump/Makefile.in ============================================================================== --- head/contrib/tcpdump/Makefile.in Thu May 17 04:04:48 2012 (r235529) +++ head/contrib/tcpdump/Makefile.in Thu May 17 05:11:57 2012 (r235530) @@ -26,6 +26,7 @@ # Top level hierarchy prefix = @prefix@ exec_prefix = @exec_prefix@ +datarootdir = @datarootdir@ # Pathname of directory to install the binary sbindir = @sbindir@ # Pathname of directory to install the man page @@ -46,7 +47,8 @@ INCLS = -I. @V_INCLS@ DEFS = @DEFS@ @CPPFLAGS@ @V_DEFS@ # Standard CFLAGS -CFLAGS = $(CCOPT) $(DEFS) $(INCLS) +CFLAGS = @CFLAGS@ +FULL_CFLAGS = $(CCOPT) $(DEFS) $(INCLS) $(CFLAGS) # Standard LDFLAGS LDFLAGS = @LDFLAGS@ @@ -64,15 +66,15 @@ RANLIB = @RANLIB@ # problem if you don't own the file but can write to the directory. .c.o: @rm -f $@ - $(CC) $(CFLAGS) -c $(srcdir)/$*.c + $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c CSRC = addrtoname.c af.c checksum.c cpack.c gmpls.c oui.c gmt2local.c ipproto.c \ - nlpid.c l2vpn.c machdep.c parsenfsfh.c \ - print-802_11.c print-ap1394.c print-ah.c print-arcnet.c \ - print-aodv.c print-arp.c print-ascii.c print-atalk.c print-atm.c \ - print-beep.c print-bfd.c print-bgp.c print-bootp.c print-bt.c \ - print-cdp.c print-cfm.c print-chdlc.c print-cip.c print-cnfp.c \ - print-dccp.c print-decnet.c \ + nlpid.c l2vpn.c machdep.c parsenfsfh.c in_cksum.c \ + print-802_11.c print-802_15_4.c print-ap1394.c print-ah.c \ + print-arcnet.c print-aodv.c print-arp.c print-ascii.c print-atalk.c \ + print-atm.c print-beep.c print-bfd.c print-bgp.c \ + print-bootp.c print-bt.c print-carp.c print-cdp.c print-cfm.c \ + print-chdlc.c print-cip.c print-cnfp.c print-dccp.c print-decnet.c \ print-domain.c print-dtp.c print-dvmrp.c print-enc.c print-egp.c \ print-eap.c print-eigrp.c\ print-esp.c print-ether.c print-fddi.c print-fr.c \ @@ -83,8 +85,9 @@ CSRC = addrtoname.c af.c checksum.c cpac print-lmp.c print-lspping.c print-lwapp.c \ print-lwres.c print-mobile.c print-mpcp.c print-mpls.c print-msdp.c \ print-nfs.c print-ntp.c print-null.c print-olsr.c print-ospf.c \ - print-pgm.c print-pim.c print-ppp.c print-pppoe.c print-pptp.c \ - print-radius.c print-raw.c print-rip.c print-rrcp.c print-rsvp.c \ + print-pgm.c print-pim.c \ + print-ppi.c print-ppp.c print-pppoe.c print-pptp.c \ + print-radius.c print-raw.c print-rip.c print-rpki-rtr.c print-rrcp.c print-rsvp.c \ print-rx.c print-sctp.c print-sflow.c print-sip.c print-sl.c print-sll.c \ print-slow.c print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c \ print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \ @@ -165,6 +168,7 @@ HDR = \ oui.h \ pcap-missing.h \ pmap_prot.h \ + ppi.h \ ppp.h \ route6d.h \ rpc_auth.h \ @@ -226,16 +230,12 @@ EXTRA_DIST = \ lbl/os-ultrix4.h \ makemib \ missing/addrinfo.h \ - missing/addrsize.h \ - missing/bittypes.h \ missing/dlnames.c \ missing/datalinks.c \ missing/getnameinfo.c \ missing/inet_aton.c \ missing/inet_ntop.c \ missing/inet_pton.c \ - missing/resolv6.h \ - missing/resolv_ext.h \ missing/snprintf.c \ missing/sockstorage.h \ missing/strdup.c \ @@ -245,6 +245,7 @@ EXTRA_DIST = \ mkdep \ packetdat.awk \ pcap_dump_ftell.c \ + print-babel.c \ print-dhcp6.c \ print-frag6.c \ print-icmp6.c \ @@ -262,12 +263,18 @@ EXTRA_DIST = \ stime.awk \ strcasecmp.c \ tcpdump.1.in \ - tests/02-sunrise-sunset-esp.puu \ - tests/08-sunrise-sunset-aes.puu \ - tests/08-sunrise-sunset-esp2.puu \ + tests/02-sunrise-sunset-esp.pcap \ + tests/08-sunrise-sunset-aes.pcap \ + tests/08-sunrise-sunset-esp2.pcap \ + tests/QinQpacket.out \ + tests/QinQpacket.pcap \ + tests/QinQpacketv.out \ tests/TESTLIST \ tests/TESTonce \ tests/TESTrun.sh \ + tests/babel.pcap \ + tests/babel1.out \ + tests/babel1v.out \ tests/bgp-infinite-loop.pcap \ tests/bgp_vpn_attrset.out \ tests/bgp_vpn_attrset.pcap \ @@ -279,8 +286,8 @@ EXTRA_DIST = \ tests/e1000g.pcap \ tests/eapon1.gdbinit \ tests/eapon1.out \ - tests/eapon1.puu \ - tests/eapon2.puu \ + tests/eapon1.pcap \ + tests/empty.uu \ tests/esp-secrets.txt \ tests/esp0.out \ tests/esp1.gdbinit \ @@ -292,61 +299,57 @@ EXTRA_DIST = \ tests/esp5.gdbinit \ tests/esp5.out \ tests/espudp1.out \ - tests/espudp1.puu \ + tests/espudp1.pcap \ tests/forces1.out \ tests/forces1.pcap \ tests/forces1vvv.out \ tests/forces1vvvv.out \ tests/forces2.out \ - tests/forces2.pcap \ tests/forces2v.out \ tests/forces2vv.out \ - tests/ikev2.puu \ + tests/forces3vvv.out \ tests/ikev2four.out \ - tests/ikev2four.puu \ + tests/ikev2four.pcap \ tests/ikev2fourv.out \ tests/ikev2fourv4.out \ tests/ikev2pI2-secrets.txt \ tests/ikev2pI2.out \ - tests/ikev2pI2.puu \ - tests/isakmp-delete-segfault.puu \ - tests/isakmp-identification-segfault.puu \ - tests/isakmp-pointer-loop.puu \ + tests/ikev2pI2.pcap \ + tests/isakmp-delete-segfault.pcap \ + tests/isakmp-identification-segfault.pcap \ + tests/isakmp-pointer-loop.pcap \ tests/isakmp1.out \ tests/isakmp2.out \ tests/isakmp3.out \ tests/isakmp4.out \ - tests/isakmp4500.puu \ + tests/isakmp4500.pcap \ tests/isis-infinite-loop.pcap \ tests/ldp-infinite-loop.pcap \ tests/lmp.out \ - tests/lmp.puu \ + tests/lmp.pcap \ tests/lmp.sh \ tests/lspping-fec-ldp.pcap \ tests/lspping-fec-rsvp.pcap \ tests/mpls-ldp-hello.out \ - tests/mpls-ldp-hello.puu \ + tests/mpls-ldp-hello.pcap \ tests/mpls-traceroute.pcap \ tests/ospf-gmpls.out \ - tests/ospf-gmpls.puu \ + tests/ospf-gmpls.pcap \ tests/print-A.out \ tests/print-AA.out \ tests/print-capX.out \ tests/print-capXX.out \ - tests/print-flags.puu \ + tests/print-flags.pcap \ tests/print-flags.sh \ tests/print-x.out \ tests/print-xx.out \ tests/rsvp-infinite-loop.pcap \ + tests/sflow_multiple_counter_30_pdus.out \ + tests/sflow_multiple_counter_30_pdus.pcap \ vfprintf.c \ - win32/Include/Arpa/tftp.h \ win32/Include/errno.h \ win32/Include/getopt.h \ - win32/Include/inetprivate.h \ - win32/Include/telnet.h \ win32/Include/w32_fzs.h \ - win32/Include/Netinet/in_systm.h \ - win32/Include/Netinet/ip.h \ win32/Src/getopt.c \ win32/prj/GNUmakefile \ win32/prj/WinDump.dsp \ @@ -356,7 +359,7 @@ all: $(PROG) $(PROG): $(OBJ) @V_PCAPDEP@ @rm -f $@ - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) + $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ) @rm -f $@ @@ -364,30 +367,30 @@ $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ) $(RANLIB) $@ datalinks.o: $(srcdir)/missing/datalinks.c - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c + $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c dlnames.o: $(srcdir)/missing/dlnames.c - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c + $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c getnameinfo.o: $(srcdir)/missing/getnameinfo.c - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/getnameinfo.c + $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getnameinfo.c getaddrinfo.o: $(srcdir)/missing/getaddrinfo.c - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/getaddrinfo.c + $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getaddrinfo.c inet_pton.o: $(srcdir)/missing/inet_pton.c - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/inet_pton.c + $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_pton.c inet_ntop.o: $(srcdir)/missing/inet_ntop.c - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/inet_ntop.c + $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_ntop.c inet_aton.o: $(srcdir)/missing/inet_aton.c - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/inet_aton.c + $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_aton.c snprintf.o: $(srcdir)/missing/snprintf.c - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c + $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c strlcat.o: $(srcdir)/missing/strlcat.c - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c + $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c strlcpy.o: $(srcdir)/missing/strlcpy.c - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c + $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c strsep.o: $(srcdir)/missing/strsep.c - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c + $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c version.o: version.c - $(CC) $(CFLAGS) -c version.c + $(CC) $(FULL_CFLAGS) -c version.c version.c: $(srcdir)/VERSION @rm -f $@ @@ -423,9 +426,9 @@ clean: distclean: rm -f $(CLEANFILES) Makefile config.cache config.log config.status \ config.h gnuc.h os-proto.h stamp-h stamp-h.in $(PROG).1 + rm -rf autom4te.cache check: tcpdump - uudecode --help || (echo "No uudecode program found, not running tests"; echo "apt-get/rpm install sharutils?"; exit 1) (cd tests && ./TESTrun.sh) tags: $(TAGFILES) Modified: head/contrib/tcpdump/VERSION ============================================================================== --- head/contrib/tcpdump/VERSION Thu May 17 04:04:48 2012 (r235529) +++ head/contrib/tcpdump/VERSION Thu May 17 05:11:57 2012 (r235530) @@ -1 +1 @@ -4.1.1 +4.2.1 Modified: head/contrib/tcpdump/acconfig.h ============================================================================== --- head/contrib/tcpdump/acconfig.h Thu May 17 04:04:48 2012 (r235529) +++ head/contrib/tcpdump/acconfig.h Thu May 17 05:11:57 2012 (r235530) @@ -8,12 +8,6 @@ /* Define if you enable support for the libsmi. */ #undef LIBSMI -/* define if you have struct __res_state_ext */ -#undef HAVE_RES_STATE_EXT - -/* define if your struct __res_state has the nsort member */ -#undef HAVE_NEW_RES_STATE - /* define if you have the addrinfo function. */ #undef HAVE_ADDRINFO @@ -23,15 +17,6 @@ /* define ifyou have the h_errno variable. */ #undef HAVE_H_ERRNO -/* define if IN6ADDRSZ is defined (XXX not used!) */ -#undef HAVE_IN6ADDRSZ - -/* define if INADDRSZ is defined (XXX not used!) */ -#undef HAVE_INADDRSZ - -/* define if RES_USE_INET6 is defined */ -#undef HAVE_RES_USE_INET6 - /* define if you have struct sockaddr_storage */ #undef HAVE_SOCKADDR_STORAGE @@ -68,9 +53,6 @@ /* define if you have getrpcbynumber() */ #undef HAVE_GETRPCBYNUMBER -/* AIX hack. */ -#undef _SUN - /* Workaround for missing 64-bit formats */ #undef PRId64 #undef PRIo64 Modified: head/contrib/tcpdump/addrtoname.c ============================================================================== --- head/contrib/tcpdump/addrtoname.c Thu May 17 04:04:48 2012 (r235529) +++ head/contrib/tcpdump/addrtoname.c Thu May 17 05:11:57 2012 (r235530) @@ -510,6 +510,34 @@ etheraddr_string(register const u_char * } const char * +le64addr_string(const u_char *ep) +{ + const unsigned int len = 8; + register u_int i; + register char *cp; + register struct enamemem *tp; + char buf[BUFSIZE]; + + tp = lookup_bytestring(ep, len); + if (tp->e_name) + return (tp->e_name); + + cp = buf; + for (i = len; i > 0 ; --i) { + *cp++ = hex[*(ep + i - 1) >> 4]; + *cp++ = hex[*(ep + i - 1) & 0xf]; + *cp++ = ':'; + } + cp --; + + *cp = '\0'; + + tp->e_name = strdup(buf); + + return (tp->e_name); +} + +const char * linkaddr_string(const u_char *ep, const unsigned int type, const unsigned int len) { register u_int i; Modified: head/contrib/tcpdump/addrtoname.h ============================================================================== --- head/contrib/tcpdump/addrtoname.h Thu May 17 04:04:48 2012 (r235529) +++ head/contrib/tcpdump/addrtoname.h Thu May 17 05:11:57 2012 (r235530) @@ -34,6 +34,7 @@ enum { extern const char *linkaddr_string(const u_char *, const unsigned int, const unsigned int); extern const char *etheraddr_string(const u_char *); +extern const char *le64addr_string(const u_char *); extern const char *etherproto_string(u_short); extern const char *tcpport_string(u_short); extern const char *udpport_string(u_short); Modified: head/contrib/tcpdump/bootp.h ============================================================================== --- head/contrib/tcpdump/bootp.h Thu May 17 04:04:48 2012 (r235529) +++ head/contrib/tcpdump/bootp.h Thu May 17 05:11:57 2012 (r235530) @@ -37,7 +37,7 @@ struct bootp { u_int8_t bp_sname[64]; /* server host name */ u_int8_t bp_file[128]; /* boot file name */ u_int8_t bp_vend[64]; /* vendor-specific area */ -}; +} UNALIGNED; /* * UDP port numbers, server and client. @@ -217,7 +217,7 @@ struct cmu_vend { struct in_addr v_ins1, v_ins2; /* IEN-116 name servers */ struct in_addr v_ts1, v_ts2; /* Time servers */ u_int8_t v_unused[24]; /* currently unused */ -}; +} UNALIGNED; /* v_flags values */ Modified: head/contrib/tcpdump/config.h.in ============================================================================== --- head/contrib/tcpdump/config.h.in Thu May 17 04:04:48 2012 (r235529) +++ head/contrib/tcpdump/config.h.in Thu May 17 05:11:57 2012 (r235530) @@ -8,12 +8,6 @@ /* Define if you enable support for the libsmi. */ #undef LIBSMI -/* define if you have struct __res_state_ext */ -#undef HAVE_RES_STATE_EXT - -/* define if your struct __res_state has the nsort member */ -#undef HAVE_NEW_RES_STATE - /* define if you have the addrinfo function. */ #undef HAVE_ADDRINFO @@ -23,15 +17,6 @@ /* define ifyou have the h_errno variable. */ #undef HAVE_H_ERRNO -/* define if IN6ADDRSZ is defined (XXX not used!) */ -#undef HAVE_IN6ADDRSZ - -/* define if INADDRSZ is defined (XXX not used!) */ -#undef HAVE_INADDRSZ - -/* define if RES_USE_INET6 is defined */ -#undef HAVE_RES_USE_INET6 - /* define if you have struct sockaddr_storage */ #undef HAVE_SOCKADDR_STORAGE @@ -68,9 +53,6 @@ /* define if you have getrpcbynumber() */ #undef HAVE_GETRPCBYNUMBER -/* AIX hack. */ -#undef _SUN - /* Workaround for missing 64-bit formats */ #undef PRId64 #undef PRIo64 @@ -108,6 +90,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H +/* Define to 1 if you have the `fork' function. */ +#undef HAVE_FORK + /* Define to 1 if you have the `getnameinfo' function. */ #undef HAVE_GETNAMEINFO @@ -165,6 +150,9 @@ /* Define to 1 if you have the `pcap_lib_version' function. */ #undef HAVE_PCAP_LIB_VERSION +/* Define to 1 if you have the `pcap_set_tstamp_type' function. */ +#undef HAVE_PCAP_SET_TSTAMP_TYPE + /* Define to 1 if you have the header file. */ #undef HAVE_PCAP_USB_H @@ -174,6 +162,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_RPC_RPCENT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_RPC_RPC_H + /* Define to 1 if you have the `setlinebuf' function. */ #undef HAVE_SETLINEBUF @@ -237,6 +228,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Define to 1 if you have the `vfork' function. */ +#undef HAVE_VFORK + /* Define to 1 if you have the `vfprintf' function. */ #undef HAVE_VFPRINTF @@ -276,21 +270,6 @@ /* return value of signal handlers */ #undef RETSIGVAL -/* The size of `char', as computed by sizeof. */ -#undef SIZEOF_CHAR - -/* The size of `int', as computed by sizeof. */ -#undef SIZEOF_INT - -/* The size of `long', as computed by sizeof. */ -#undef SIZEOF_LONG - -/* The size of `long long', as computed by sizeof. */ -#undef SIZEOF_LONG_LONG - -/* The size of `short', as computed by sizeof. */ -#undef SIZEOF_SHORT - /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS @@ -303,6 +282,9 @@ /* needed on HP-UX */ #undef _HPUX_SOURCE +/* define on AIX to get certain functions */ +#undef _SUN + /* define if your compiler allows __attribute__((format)) to be applied to function pointers */ #undef __ATTRIBUTE___FORMAT_OK_FOR_FUNCTION_POINTERS Modified: head/contrib/tcpdump/configure ============================================================================== --- head/contrib/tcpdump/configure Thu May 17 04:04:48 2012 (r235529) +++ head/contrib/tcpdump/configure Thu May 17 05:11:57 2012 (r235530) @@ -1267,6 +1267,7 @@ if test -n "$ac_init_help"; then Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-universal don't build universal on OS X --enable-smb enable possibly-buggy SMB printer default=yes --disable-smb disable possibly-buggy SMB printer --enable-ipv6 enable ipv6 (with ipv4) support @@ -1845,7 +1846,7 @@ fi V_CCOPT="-O" V_INCLS="" if test "${srcdir}" != "." ; then - V_INCLS="-I\$(srcdir)" + V_INCLS="-I$srcdir" fi if test "${CFLAGS+set}" = set; then LBL_CFLAGS="$CFLAGS" @@ -3217,7 +3218,8 @@ if test "${ac_cv___attribute__+set}" = s else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + + /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF @@ -3290,7 +3292,8 @@ if test "${ac_cv___attribute___format_fu else cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ + + /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF @@ -3986,7 +3989,8 @@ done -for ac_header in fcntl.h rpc/rpcent.h netdnet/dnetdb.h + +for ac_header in fcntl.h rpc/rpc.h rpc/rpcent.h netdnet/dnetdb.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then @@ -4387,6 +4391,36 @@ fi case "$host_os" in +darwin*) + # Check whether --enable-universal was given. +if test "${enable_universal+set}" = set; then + enableval=$enable_universal; +fi + + if test "$enable_universal" != "no"; then + case "$host_os" in + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu May 17 10:11:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 16ACC106566C; Thu, 17 May 2012 10:11:19 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F10758FC1F; Thu, 17 May 2012 10:11:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HABItu090244; Thu, 17 May 2012 10:11:18 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HABIJY090234; Thu, 17 May 2012 10:11:18 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201205171011.q4HABIJY090234@svn.freebsd.org> From: Grzegorz Bernacki Date: Thu, 17 May 2012 10:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235537 - in head: etc/mtree include lib lib/libnandfs lib/libstand sbin sbin/nandfs sbin/newfs_nandfs share/man/man4 share/man/man5 share/mk sys/boot/arm/uboot sys/boot/i386/loader sys... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 10:11:19 -0000 Author: gber Date: Thu May 17 10:11:18 2012 New Revision: 235537 URL: http://svn.freebsd.org/changeset/base/235537 Log: Import work done under project/nand (@235533) into head. The NAND Flash environment consists of several distinct components: - NAND framework (drivers harness for NAND controllers and NAND chips) - NAND simulator (NANDsim) - NAND file system (NAND FS) - Companion tools and utilities - Documentation (manual pages) This work is still experimental. Please use with caution. Obtained from: Semihalf Supported by: FreeBSD Foundation, Juniper Networks Added: head/lib/libnandfs/ head/lib/libnandfs/Makefile (contents, props changed) head/lib/libnandfs/libnandfs.h (contents, props changed) head/lib/libnandfs/nandfs.c (contents, props changed) head/lib/libstand/nandfs.c (contents, props changed) head/sbin/nandfs/ head/sbin/nandfs/Makefile (contents, props changed) head/sbin/nandfs/lssnap.c (contents, props changed) head/sbin/nandfs/mksnap.c (contents, props changed) head/sbin/nandfs/nandfs.8 (contents, props changed) head/sbin/nandfs/nandfs.c (contents, props changed) head/sbin/nandfs/nandfs.h (contents, props changed) head/sbin/nandfs/rmsnap.c (contents, props changed) head/sbin/newfs_nandfs/ head/sbin/newfs_nandfs/Makefile (contents, props changed) head/sbin/newfs_nandfs/newfs_nandfs.8 (contents, props changed) head/sbin/newfs_nandfs/newfs_nandfs.c (contents, props changed) head/share/man/man4/nand.4 (contents, props changed) head/share/man/man4/nandsim.4 (contents, props changed) head/share/man/man5/nandfs.5 (contents, props changed) head/sys/dev/nand/ head/sys/dev/nand/nand.c (contents, props changed) head/sys/dev/nand/nand.h (contents, props changed) head/sys/dev/nand/nand_bbt.c (contents, props changed) head/sys/dev/nand/nand_cdev.c (contents, props changed) head/sys/dev/nand/nand_dev.h (contents, props changed) head/sys/dev/nand/nand_ecc_pos.h (contents, props changed) head/sys/dev/nand/nand_generic.c (contents, props changed) head/sys/dev/nand/nand_geom.c (contents, props changed) head/sys/dev/nand/nand_id.c (contents, props changed) head/sys/dev/nand/nand_if.m (contents, props changed) head/sys/dev/nand/nandbus.c (contents, props changed) head/sys/dev/nand/nandbus.h (contents, props changed) head/sys/dev/nand/nandbus_if.m (contents, props changed) head/sys/dev/nand/nandsim.c (contents, props changed) head/sys/dev/nand/nandsim.h (contents, props changed) head/sys/dev/nand/nandsim_chip.c (contents, props changed) head/sys/dev/nand/nandsim_chip.h (contents, props changed) head/sys/dev/nand/nandsim_ctrl.c (contents, props changed) head/sys/dev/nand/nandsim_log.c (contents, props changed) head/sys/dev/nand/nandsim_log.h (contents, props changed) head/sys/dev/nand/nandsim_swap.c (contents, props changed) head/sys/dev/nand/nandsim_swap.h (contents, props changed) head/sys/dev/nand/nfc_if.m (contents, props changed) head/sys/dev/nand/nfc_mv.c (contents, props changed) head/sys/fs/nandfs/ head/sys/fs/nandfs/bmap.c (contents, props changed) head/sys/fs/nandfs/bmap.h (contents, props changed) head/sys/fs/nandfs/nandfs.h (contents, props changed) head/sys/fs/nandfs/nandfs_alloc.c (contents, props changed) head/sys/fs/nandfs/nandfs_bmap.c (contents, props changed) head/sys/fs/nandfs/nandfs_buffer.c (contents, props changed) head/sys/fs/nandfs/nandfs_cleaner.c (contents, props changed) head/sys/fs/nandfs/nandfs_cpfile.c (contents, props changed) head/sys/fs/nandfs/nandfs_dat.c (contents, props changed) head/sys/fs/nandfs/nandfs_dir.c (contents, props changed) head/sys/fs/nandfs/nandfs_fs.h (contents, props changed) head/sys/fs/nandfs/nandfs_ifile.c (contents, props changed) head/sys/fs/nandfs/nandfs_mount.h (contents, props changed) head/sys/fs/nandfs/nandfs_segment.c (contents, props changed) head/sys/fs/nandfs/nandfs_subr.c (contents, props changed) head/sys/fs/nandfs/nandfs_subr.h (contents, props changed) head/sys/fs/nandfs/nandfs_sufile.c (contents, props changed) head/sys/fs/nandfs/nandfs_vfsops.c (contents, props changed) head/sys/fs/nandfs/nandfs_vnops.c (contents, props changed) head/sys/modules/nandfs/ head/sys/modules/nandfs/Makefile (contents, props changed) head/sys/modules/nandsim/ head/sys/modules/nandsim/Makefile (contents, props changed) head/tools/build/options/WITHOUT_NAND (contents, props changed) head/tools/build/options/WITH_NAND (contents, props changed) head/usr.sbin/nandsim/ head/usr.sbin/nandsim/Makefile (contents, props changed) head/usr.sbin/nandsim/nandsim.8 (contents, props changed) head/usr.sbin/nandsim/nandsim.c (contents, props changed) head/usr.sbin/nandsim/nandsim_cfgparse.c (contents, props changed) head/usr.sbin/nandsim/nandsim_cfgparse.h (contents, props changed) head/usr.sbin/nandsim/nandsim_rcfile.c (contents, props changed) head/usr.sbin/nandsim/nandsim_rcfile.h (contents, props changed) head/usr.sbin/nandsim/sample.conf (contents, props changed) head/usr.sbin/nandtool/ head/usr.sbin/nandtool/Makefile (contents, props changed) head/usr.sbin/nandtool/nand_erase.c (contents, props changed) head/usr.sbin/nandtool/nand_info.c (contents, props changed) head/usr.sbin/nandtool/nand_read.c (contents, props changed) head/usr.sbin/nandtool/nand_readoob.c (contents, props changed) head/usr.sbin/nandtool/nand_write.c (contents, props changed) head/usr.sbin/nandtool/nand_writeoob.c (contents, props changed) head/usr.sbin/nandtool/nandtool.8 (contents, props changed) head/usr.sbin/nandtool/nandtool.c (contents, props changed) head/usr.sbin/nandtool/nandtool.h (contents, props changed) head/usr.sbin/nandtool/usage.h (contents, props changed) Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/lib/Makefile head/lib/libstand/Makefile head/lib/libstand/stand.h head/sbin/Makefile head/share/man/man4/Makefile head/share/man/man5/Makefile head/share/mk/bsd.own.mk head/sys/boot/arm/uboot/Makefile head/sys/boot/arm/uboot/conf.c head/sys/boot/arm/uboot/version head/sys/boot/i386/loader/Makefile head/sys/boot/i386/loader/conf.c head/sys/conf/files head/sys/conf/options head/sys/modules/Makefile head/usr.sbin/Makefile Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Thu May 17 08:14:10 2012 (r235536) +++ head/etc/mtree/BSD.include.dist Thu May 17 10:11:18 2012 (r235537) @@ -122,6 +122,8 @@ mpilib .. .. + nand + .. ofw .. pbio @@ -154,6 +156,8 @@ .. msdosfs .. + nandfs + .. nfs .. ntfs Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Thu May 17 08:14:10 2012 (r235536) +++ head/include/Makefile Thu May 17 10:11:18 2012 (r235537) @@ -43,7 +43,7 @@ LSUBDIRS= cam/ata cam/scsi \ dev/ic dev/iicbus ${_dev_ieee488} dev/io dev/lmc dev/mfi dev/ofw \ dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ - fs/devfs fs/fdescfs fs/msdosfs fs/nfs fs/ntfs fs/nullfs \ + fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/ntfs fs/nullfs \ ${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ geom/mirror geom/mountver geom/multipath geom/nop \ @@ -157,7 +157,7 @@ copies: done .endif .endfor -.for i in ${LDIRS} ${LSUBDIRS:Ndev/acpica:Ndev/bktr} ${LSUBSUBDIRS} +.for i in ${LDIRS} ${LSUBDIRS:Ndev/acpica:Ndev/bktr:Ndev/nand} ${LSUBSUBDIRS} cd ${.CURDIR}/../sys; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \ ${DESTDIR}${INCLUDEDIR}/$i @@ -168,6 +168,13 @@ copies: cd ${.CURDIR}/../sys/dev/bktr; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \ ${DESTDIR}${INCLUDEDIR}/dev/bktr +.if ${MK_NAND} != "no" + cd ${.CURDIR}/../sys/dev/nand; \ + ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 nandsim.h \ + ${DESTDIR}${INCLUDEDIR}/dev/nand; \ + ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 nand_dev.h \ + ${DESTDIR}${INCLUDEDIR}/dev/nand +.endif cd ${.CURDIR}/../sys/contrib/altq/altq; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}${INCLUDEDIR}/altq @@ -224,7 +231,7 @@ symlinks: ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ done .endfor -.for i in ${LSUBDIRS:Ndev/acpica:Ndev/bktr} +.for i in ${LSUBDIRS:Ndev/acpica:Ndev/bktr:Ndev/nand} cd ${.CURDIR}/../sys/$i; \ for h in *.h; do \ ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ @@ -240,6 +247,13 @@ symlinks: ln -fs ../../../../sys/dev/bktr/$$h \ ${DESTDIR}${INCLUDEDIR}/dev/bktr; \ done +.if ${MK_NAND} != "no" + cd ${.CURDIR}/../sys/dev/nand; \ + for h in nandsim.h nand_dev.h; do \ + ln -fs ../../../../sys/dev/nand/$$h \ + ${DESTDIR}${INCLUDEDIR}/dev/nand; \ + done +.endif .for i in ${LSUBSUBDIRS} cd ${.CURDIR}/../sys/$i; \ for h in *.h; do \ Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Thu May 17 08:14:10 2012 (r235536) +++ head/lib/Makefile Thu May 17 10:11:18 2012 (r235537) @@ -88,6 +88,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ libmemstat \ ${_libmilter} \ ${_libmp} \ + ${_libnandfs} \ ${_libncp} \ ${_libngatm} \ libopie \ @@ -175,6 +176,10 @@ _libipx= libipx _libthr= libthr .endif +.if ${MK_NAND} != "no" +_libnandfs= libnandfs +.endif + .if ${MK_NETGRAPH} != "no" _libnetgraph= libnetgraph .endif Added: head/lib/libnandfs/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnandfs/Makefile Thu May 17 10:11:18 2012 (r235537) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +LIB= nandfs +SRCS+= nandfs.c +INCS= libnandfs.h + +CFLAGS += -I${.CURDIR} + +.include Added: head/lib/libnandfs/libnandfs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnandfs/libnandfs.h Thu May 17 10:11:18 2012 (r235537) @@ -0,0 +1,65 @@ +/*- + * Copyright (c) 2010-2012 Semihalf. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LIBNANDFS_NANDFS_H +#define _LIBNANDFS_NANDFS_H + +struct nandfs { + struct nandfs_fsdata n_fsdata; + struct nandfs_super_block n_sb; + char n_ioc[MNAMELEN]; + char n_dev[MNAMELEN]; + int n_iocfd; + int n_devfd; + int n_flags; + char n_errmsg[120]; +}; + +int nandfs_iserror(struct nandfs *); +const char *nandfs_errmsg(struct nandfs *); + +void nandfs_init(struct nandfs *, const char *); +void nandfs_destroy(struct nandfs *); + +const char *nandfs_dev(struct nandfs *); + +int nandfs_open(struct nandfs *); +void nandfs_close(struct nandfs *); + +int nandfs_get_cpstat(struct nandfs *, struct nandfs_cpstat *); + +ssize_t nandfs_get_cp(struct nandfs *, uint64_t, + struct nandfs_cpinfo *, size_t); + +ssize_t nandfs_get_snap(struct nandfs *, uint64_t, + struct nandfs_cpinfo *, size_t); + +int nandfs_make_snap(struct nandfs *, uint64_t *); +int nandfs_delete_snap(struct nandfs *, uint64_t); + +#endif /* _LIBNANDFS_NANDFS_H */ Added: head/lib/libnandfs/nandfs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnandfs/nandfs.c Thu May 17 10:11:18 2012 (r235537) @@ -0,0 +1,247 @@ +/*- + * Copyright (c) 2010-2012 Semihalf. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define NANDFS_IS_VALID 0x1 +#define NANDFS_IS_OPENED 0x2 +#define NANDFS_IS_OPENED_DEV 0x4 +#define NANDFS_IS_ERROR 0x8 + +#define DEBUG +#undef DEBUG +#ifdef DEBUG +#define NANDFS_DEBUG(fmt, args...) do { \ + printf("libnandfs:" fmt "\n", ##args); } while (0) +#else +#define NANDFS_DEBUG(fmt, args...) +#endif + +#define NANDFS_ASSERT_VALID(fs) assert((fs)->n_flags & NANDFS_IS_VALID) +#define NANDFS_ASSERT_VALID_DEV(fs) \ + assert(((fs)->n_flags & (NANDFS_IS_VALID | NANDFS_IS_OPENED_DEV)) == \ + (NANDFS_IS_VALID | NANDFS_IS_OPENED_DEV)) + +int +nandfs_iserror(struct nandfs *fs) +{ + + NANDFS_ASSERT_VALID(fs); + + return (fs->n_flags & NANDFS_IS_ERROR); +} + +const char * +nandfs_errmsg(struct nandfs *fs) +{ + + NANDFS_ASSERT_VALID(fs); + + assert(nandfs_iserror(fs)); + assert(fs->n_errmsg); + return (fs->n_errmsg); +} + +static void +nandfs_seterr(struct nandfs *fs, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vsnprintf(fs->n_errmsg, sizeof(fs->n_errmsg), fmt, ap); + va_end(ap); + fs->n_flags |= NANDFS_IS_ERROR; +} + +const char * +nandfs_dev(struct nandfs *fs) +{ + + NANDFS_ASSERT_VALID(fs); + return (fs->n_dev); +} + +void +nandfs_init(struct nandfs *fs, const char *dir) +{ + + snprintf(fs->n_ioc, sizeof(fs->n_ioc), "%s/%s", dir, "."); + fs->n_iocfd = -1; + fs->n_flags = NANDFS_IS_VALID; +} + +void +nandfs_destroy(struct nandfs *fs) +{ + + assert(fs->n_iocfd == -1); + fs->n_flags &= + ~(NANDFS_IS_ERROR | NANDFS_IS_VALID); + assert(fs->n_flags == 0); +} + +int +nandfs_open(struct nandfs *fs) +{ + struct nandfs_fsinfo fsinfo; + + fs->n_flags |= NANDFS_IS_OPENED; + + fs->n_iocfd = open(fs->n_ioc, O_RDONLY, S_IRUSR | S_IWUSR | S_IRGRP | + S_IWGRP | S_IROTH | S_IWOTH); + if (fs->n_iocfd == -1) { + nandfs_seterr(fs, "couldn't open %s: %s", fs->n_ioc, + strerror(errno)); + return (-1); + } + + if (ioctl(fs->n_iocfd, NANDFS_IOCTL_GET_FSINFO, &fsinfo) == -1) { + nandfs_seterr(fs, "couldn't fetch fsinfo: %s", + strerror(errno)); + return (-1); + } + + memcpy(&fs->n_fsdata, &fsinfo.fs_fsdata, sizeof(fs->n_fsdata)); + memcpy(&fs->n_sb, &fsinfo.fs_super, sizeof(fs->n_sb)); + snprintf(fs->n_dev, sizeof(fs->n_dev), "%s", fsinfo.fs_dev); + + return (0); +} + +void +nandfs_close(struct nandfs *fs) +{ + + NANDFS_ASSERT_VALID(fs); + assert(fs->n_flags & NANDFS_IS_OPENED); + + close(fs->n_iocfd); + fs->n_iocfd = -1; + fs->n_flags &= ~NANDFS_IS_OPENED; +} + +int +nandfs_get_cpstat(struct nandfs *fs, struct nandfs_cpstat *cpstat) +{ + + NANDFS_ASSERT_VALID(fs); + + if (ioctl(fs->n_iocfd, NANDFS_IOCTL_GET_CPSTAT, cpstat) == -1) { + nandfs_seterr(fs, "ioctl NANDFS_IOCTL_GET_CPSTAT: %s", + strerror(errno)); + return (-1); + } + + return (0); +} + +static ssize_t +nandfs_get_cpinfo(struct nandfs *fs, uint64_t cno, int mode, + struct nandfs_cpinfo *cpinfo, size_t nci) +{ + struct nandfs_argv args; + + NANDFS_ASSERT_VALID(fs); + + args.nv_base = (u_long)cpinfo; + args.nv_nmembs = nci; + args.nv_index = cno; + args.nv_flags = mode; + + if (ioctl(fs->n_iocfd, NANDFS_IOCTL_GET_CPINFO, &args) == -1) { + nandfs_seterr(fs, "ioctl NANDFS_IOCTL_GET_CPINFO: %s", + strerror(errno)); + return (-1); + } + + return (args.nv_nmembs); +} + +ssize_t +nandfs_get_cp(struct nandfs *fs, uint64_t cno, struct nandfs_cpinfo *cpinfo, + size_t nci) +{ + + return (nandfs_get_cpinfo(fs, cno, NANDFS_CHECKPOINT, cpinfo, nci)); +} + +ssize_t +nandfs_get_snap(struct nandfs *fs, uint64_t cno, struct nandfs_cpinfo *cpinfo, + size_t nci) +{ + + return (nandfs_get_cpinfo(fs, cno, NANDFS_SNAPSHOT, cpinfo, nci)); +} + +int +nandfs_make_snap(struct nandfs *fs, uint64_t *cno) +{ + + NANDFS_ASSERT_VALID(fs); + + if (ioctl(fs->n_iocfd, NANDFS_IOCTL_MAKE_SNAP, cno) == -1) { + nandfs_seterr(fs, "ioctl NANDFS_IOCTL_MAKE_SNAP: %s", + strerror(errno)); + return (-1); + } + + return (0); +} + +int +nandfs_delete_snap(struct nandfs *fs, uint64_t cno) +{ + + NANDFS_ASSERT_VALID(fs); + + if (ioctl(fs->n_iocfd, NANDFS_IOCTL_DELETE_SNAP, &cno) == -1) { + nandfs_seterr(fs, "ioctl NANDFS_IOCTL_DELETE_SNAP: %s", + strerror(errno)); + return (-1); + } + + return (0); +} Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Thu May 17 08:14:10 2012 (r235536) +++ head/lib/libstand/Makefile Thu May 17 10:11:18 2012 (r235537) @@ -150,6 +150,9 @@ SRCS+= bootp.c rarp.c bootparam.c SRCS+= ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c SRCS+= dosfs.c ext2fs.c SRCS+= splitfs.c +.if ${MK_NAND} != "no" +SRCS+= nandfs.c +.endif .include Added: head/lib/libstand/nandfs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libstand/nandfs.c Thu May 17 10:11:18 2012 (r235537) @@ -0,0 +1,1041 @@ +/*- + * Copyright (c) 2010-2012 Semihalf. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include "stand.h" +#include "string.h" +#include "zlib.h" + +#define DEBUG +#undef DEBUG +#ifdef DEBUG +#define NANDFS_DEBUG(fmt, args...) do { \ + printf("NANDFS_DEBUG:" fmt "\n", ##args); } while (0) +#else +#define NANDFS_DEBUG(fmt, args...) +#endif + +struct nandfs_mdt { + uint32_t entries_per_block; + uint32_t entries_per_group; + uint32_t blocks_per_group; + uint32_t groups_per_desc_block; /* desc is super group */ + uint32_t blocks_per_desc_block; /* desc is super group */ +}; + +struct bmap_buf { + LIST_ENTRY(bmap_buf) list; + nandfs_daddr_t blknr; + uint64_t *map; +}; + +struct nandfs_node { + struct nandfs_inode *inode; + LIST_HEAD(, bmap_buf) bmap_bufs; +}; +struct nandfs { + int nf_blocksize; + int nf_sectorsize; + int nf_cpno; + + struct open_file *nf_file; + struct nandfs_node *nf_opened_node; + u_int nf_offset; + uint8_t *nf_buf; + int64_t nf_buf_blknr; + + struct nandfs_fsdata *nf_fsdata; + struct nandfs_super_block *nf_sb; + struct nandfs_segment_summary nf_segsum; + struct nandfs_checkpoint nf_checkpoint; + struct nandfs_super_root nf_sroot; + struct nandfs_node nf_ifile; + struct nandfs_node nf_datfile; + struct nandfs_node nf_cpfile; + struct nandfs_mdt nf_datfile_mdt; + struct nandfs_mdt nf_ifile_mdt; + + int nf_nindir[NIADDR]; +}; + +static int nandfs_open(const char *, struct open_file *); +static int nandfs_close(struct open_file *); +static int nandfs_read(struct open_file *, void *, size_t, size_t *); +static off_t nandfs_seek(struct open_file *, off_t, int); +static int nandfs_stat(struct open_file *, struct stat *); +static int nandfs_readdir(struct open_file *, struct dirent *); + +static int nandfs_buf_read(struct nandfs *, char **, size_t *); +static struct nandfs_node *nandfs_lookup_inode(struct nandfs *, nandfs_daddr_t); +static struct nandfs_node *nandfs_lookup_path(struct nandfs *, const char *); +static int nandfs_read_inode(struct nandfs *, struct nandfs_node *, + nandfs_lbn_t, u_int, void *, int); +static int nandfs_read_blk(struct nandfs *, nandfs_daddr_t, void *, int); +static int nandfs_bmap_lookup(struct nandfs *, struct nandfs_node *, + nandfs_lbn_t, nandfs_daddr_t *, int); +static int nandfs_get_checkpoint(struct nandfs *, uint64_t, + struct nandfs_checkpoint *); +static nandfs_daddr_t nandfs_vtop(struct nandfs *, nandfs_daddr_t); +static void nandfs_calc_mdt_consts(int, struct nandfs_mdt *, int); +static void nandfs_mdt_trans(struct nandfs_mdt *, uint64_t, + nandfs_daddr_t *, uint32_t *); +static int ioread(struct open_file *, off_t, void *, u_int); +static int nandfs_probe_sectorsize(struct open_file *); + +struct fs_ops nandfs_fsops = { + "nandfs", + nandfs_open, + nandfs_close, + nandfs_read, + null_write, + nandfs_seek, + nandfs_stat, + nandfs_readdir +}; + +#define NINDIR(fs) ((fs)->nf_blocksize / sizeof(nandfs_daddr_t)) + +static int +nandfs_check_fsdata_crc(struct nandfs_fsdata *fsdata) +{ + uint32_t fsdata_crc, comp_crc; + + if (fsdata->f_magic != NANDFS_FSDATA_MAGIC) + return (0); + + /* Preserve crc */ + fsdata_crc = fsdata->f_sum; + + /* Calculate */ + fsdata->f_sum = (0); + comp_crc = crc32(0, (uint8_t *)fsdata, fsdata->f_bytes); + + /* Restore */ + fsdata->f_sum = fsdata_crc; + + /* Check CRC */ + return (fsdata_crc == comp_crc); +} + +static int +nandfs_check_superblock_crc(struct nandfs_fsdata *fsdata, + struct nandfs_super_block *super) +{ + uint32_t super_crc, comp_crc; + + /* Check super block magic */ + if (super->s_magic != NANDFS_SUPER_MAGIC) + return (0); + + /* Preserve CRC */ + super_crc = super->s_sum; + + /* Calculate */ + super->s_sum = (0); + comp_crc = crc32(0, (uint8_t *)super, fsdata->f_sbbytes); + + /* Restore */ + super->s_sum = super_crc; + + /* Check CRC */ + return (super_crc == comp_crc); +} + +static int +nandfs_find_super_block(struct nandfs *fs, struct open_file *f) +{ + struct nandfs_super_block *sb; + int i, j, n; + int sectors_to_read, error; + + sb = malloc(fs->nf_sectorsize); + if (sb == NULL) + return (ENOMEM); + + memset(fs->nf_sb, 0, sizeof(*fs->nf_sb)); + + sectors_to_read = (NANDFS_NFSAREAS * fs->nf_fsdata->f_erasesize) / + fs->nf_sectorsize; + for (i = 0; i < sectors_to_read; i++) { + NANDFS_DEBUG("reading i %d offset %d\n", i, + i * fs->nf_sectorsize); + error = ioread(f, i * fs->nf_sectorsize, (char *)sb, + fs->nf_sectorsize); + if (error) { + NANDFS_DEBUG("error %d\n", error); + continue; + } + n = fs->nf_sectorsize / sizeof(struct nandfs_super_block); + if ((i * fs->nf_sectorsize) % fs->nf_fsdata->f_erasesize == 0) { + if (fs->nf_sectorsize == sizeof(struct nandfs_fsdata)) + continue; + else { + sb += (sizeof(struct nandfs_fsdata) / + sizeof(struct nandfs_super_block)); + n -= (sizeof(struct nandfs_fsdata) / + sizeof(struct nandfs_super_block)); + } + } + + for (j = 0; j < n; j++) { + if (!nandfs_check_superblock_crc(fs->nf_fsdata, &sb[j])) + continue; + NANDFS_DEBUG("magic %x wtime %jd\n", sb->s_magic, + sb->s_wtime); + if (sb[j].s_wtime > fs->nf_sb->s_wtime) + memcpy(fs->nf_sb, &sb[j], sizeof(*fs->nf_sb)); + } + } + + free(sb); + + return (fs->nf_sb->s_magic != 0 ? 0 : EINVAL); +} + +static int +nandfs_find_fsdata(struct nandfs *fs, struct open_file *f) +{ + int offset, error, i; + + NANDFS_DEBUG("starting\n"); + + offset = 0; + for (i = 0; i < 64 * NANDFS_NFSAREAS; i++) { + error = ioread(f, offset, (char *)fs->nf_fsdata, + sizeof(struct nandfs_fsdata)); + if (error) + return (error); + if (fs->nf_fsdata->f_magic == NANDFS_FSDATA_MAGIC) { + NANDFS_DEBUG("found at %x, volume %s\n", offset, + fs->nf_fsdata->f_volume_name); + if (nandfs_check_fsdata_crc(fs->nf_fsdata)) + break; + } + offset += fs->nf_sectorsize; + } + + return (error); +} + +static int +nandfs_read_structures(struct nandfs *fs, struct open_file *f) +{ + int error; + + error = nandfs_find_fsdata(fs, f); + if (error) + return (error); + + error = nandfs_find_super_block(fs, f); + + if (error == 0) + NANDFS_DEBUG("selected sb with w_time %jd last_pseg %jx\n", + fs->nf_sb->s_wtime, fs->nf_sb->s_last_pseg); + + return (error); +} + +static int +nandfs_mount(struct nandfs *fs, struct open_file *f) +{ + int err = 0, level; + uint64_t last_pseg; + + fs->nf_fsdata = malloc(sizeof(struct nandfs_fsdata)); + fs->nf_sb = malloc(sizeof(struct nandfs_super_block)); + + err = nandfs_read_structures(fs, f); + if (err) { + free(fs->nf_fsdata); + free(fs->nf_sb); + return (err); + } + + fs->nf_blocksize = 1 << (fs->nf_fsdata->f_log_block_size + 10); + + NANDFS_DEBUG("using superblock with wtime %jd\n", fs->nf_sb->s_wtime); + + fs->nf_cpno = fs->nf_sb->s_last_cno; + last_pseg = fs->nf_sb->s_last_pseg; + + /* + * Calculate indirect block levels. + */ + nandfs_daddr_t mult; + + mult = 1; + for (level = 0; level < NIADDR; level++) { + mult *= NINDIR(fs); + fs->nf_nindir[level] = mult; + } + + nandfs_calc_mdt_consts(fs->nf_blocksize, &fs->nf_datfile_mdt, + fs->nf_fsdata->f_dat_entry_size); + + nandfs_calc_mdt_consts(fs->nf_blocksize, &fs->nf_ifile_mdt, + fs->nf_fsdata->f_inode_size); + + err = ioread(f, last_pseg * fs->nf_blocksize, &fs->nf_segsum, + sizeof(struct nandfs_segment_summary)); + if (err) { + free(fs->nf_sb); + free(fs->nf_fsdata); + return (err); + } + + err = ioread(f, (last_pseg + fs->nf_segsum.ss_nblocks - 1) * + fs->nf_blocksize, &fs->nf_sroot, sizeof(struct nandfs_super_root)); + if (err) { + free(fs->nf_sb); + free(fs->nf_fsdata); + return (err); + } + + fs->nf_datfile.inode = &fs->nf_sroot.sr_dat; + LIST_INIT(&fs->nf_datfile.bmap_bufs); + fs->nf_cpfile.inode = &fs->nf_sroot.sr_cpfile; + LIST_INIT(&fs->nf_cpfile.bmap_bufs); + + err = nandfs_get_checkpoint(fs, fs->nf_cpno, &fs->nf_checkpoint); + if (err) { + free(fs->nf_sb); + free(fs->nf_fsdata); + return (err); + } + + NANDFS_DEBUG("checkpoint cp_cno=%lld\n", fs->nf_checkpoint.cp_cno); + NANDFS_DEBUG("checkpoint cp_inodes_count=%lld\n", + fs->nf_checkpoint.cp_inodes_count); + NANDFS_DEBUG("checkpoint cp_ifile_inode.i_blocks=%lld\n", + fs->nf_checkpoint.cp_ifile_inode.i_blocks); + + fs->nf_ifile.inode = &fs->nf_checkpoint.cp_ifile_inode; + LIST_INIT(&fs->nf_ifile.bmap_bufs); + return (0); +} + +#define NINDIR(fs) ((fs)->nf_blocksize / sizeof(nandfs_daddr_t)) + +static int +nandfs_open(const char *path, struct open_file *f) +{ + struct nandfs *fs; + struct nandfs_node *node; + int err, bsize, level; + + NANDFS_DEBUG("nandfs_open('%s', %p)\n", path, f); + + fs = malloc(sizeof(struct nandfs)); + f->f_fsdata = fs; + fs->nf_file = f; + + bsize = nandfs_probe_sectorsize(f); + if (bsize < 0) { + printf("Cannot probe medium sector size\n"); + return (EINVAL); + } + + fs->nf_sectorsize = bsize; + + /* + * Calculate indirect block levels. + */ + nandfs_daddr_t mult; + + mult = 1; + for (level = 0; level < NIADDR; level++) { + mult *= NINDIR(fs); + fs->nf_nindir[level] = mult; + } + + NANDFS_DEBUG("fs %p nf_sectorsize=%x\n", fs, fs->nf_sectorsize); + + err = nandfs_mount(fs, f); + if (err) { + NANDFS_DEBUG("Cannot mount nandfs: %s\n", strerror(err)); + return (err); + } + + node = nandfs_lookup_path(fs, path); + if (node == NULL) + return (EINVAL); + + fs->nf_offset = 0; + fs->nf_buf = NULL; + fs->nf_buf_blknr = -1; + fs->nf_opened_node = node; + LIST_INIT(&fs->nf_opened_node->bmap_bufs); + return (0); +} + +static int +nandfs_free_node(struct nandfs_node *node) +{ + struct bmap_buf *bmap, *tmp; + + free(node->inode); + LIST_FOREACH_SAFE(bmap, &node->bmap_bufs, list, tmp) { + LIST_REMOVE(bmap, list); + free(bmap->map); + free(bmap); + } + free(node); +} + +static int +nandfs_close(struct open_file *f) +{ + struct nandfs *fs = f->f_fsdata; + + NANDFS_DEBUG("nandfs_close(%p)\n", f); + + if (fs->nf_buf != NULL) + free(fs->nf_buf); + + nandfs_free_node(fs->nf_opened_node); + free(fs->nf_sb); + free(fs); +} + +static int +nandfs_read(struct open_file *f, void *addr, size_t size, size_t *resid) +{ + struct nandfs *fs = (struct nandfs *)f->f_fsdata; + size_t csize, buf_size; + uint8_t *buf; + int error = 0; + + NANDFS_DEBUG("nandfs_read(file=%p, addr=%p, size=%d)\n", f, addr, size); + + while (size != 0) { + if (fs->nf_offset >= fs->nf_opened_node->inode->i_size) + break; + + error = nandfs_buf_read(fs, (void *)&buf, &buf_size); + if (error) + break; + + csize = size; + if (csize > buf_size) + csize = buf_size; + + bcopy(buf, addr, csize); + + fs->nf_offset += csize; + addr = (char *)addr + csize; + size -= csize; + } + + if (resid) + *resid = size; + return (error); +} + +static off_t +nandfs_seek(struct open_file *f, off_t offset, int where) +{ + struct nandfs *fs = f->f_fsdata; + off_t off; + u_int size; + + NANDFS_DEBUG("nandfs_seek(file=%p, offset=%lld, where=%d)\n", f, + offset, where); + + size = fs->nf_opened_node->inode->i_size; + + switch (where) { + case SEEK_SET: + off = 0; + break; + case SEEK_CUR: + off = fs->nf_offset; + break; + case SEEK_END: + off = size; + break; + default: + errno = EINVAL; + return (-1); + } + + off += offset; + if (off < 0 || off > size) { + errno = EINVAL; + return(-1); + } + + fs->nf_offset = (u_int)off; + + return (off); +} + +static int +nandfs_stat(struct open_file *f, struct stat *sb) +{ + struct nandfs *fs = f->f_fsdata; + + NANDFS_DEBUG("nandfs_stat(file=%p, stat=%p)\n", f, sb); + + sb->st_size = fs->nf_opened_node->inode->i_size; + sb->st_mode = fs->nf_opened_node->inode->i_mode; + sb->st_uid = fs->nf_opened_node->inode->i_uid; + sb->st_gid = fs->nf_opened_node->inode->i_gid; + return (0); +} + +static int +nandfs_readdir(struct open_file *f, struct dirent *d) +{ + struct nandfs *fs = f->f_fsdata; + struct nandfs_dir_entry *dirent; + uint8_t *buf; + size_t buf_size; + + NANDFS_DEBUG("nandfs_readdir(file=%p, dirent=%p)\n", f, d); + + if (fs->nf_offset >= fs->nf_opened_node->inode->i_size) { + NANDFS_DEBUG("nandfs_readdir(file=%p, dirent=%p) ENOENT\n", + f, d); + return (ENOENT); + } + + if (nandfs_buf_read(fs, (void *)&buf, &buf_size)) { + NANDFS_DEBUG("nandfs_readdir(file=%p, dirent=%p)" + "buf_read failed\n", f, d); + return (EIO); + } + + NANDFS_DEBUG("nandfs_readdir(file=%p, dirent=%p) moving forward\n", + f, d); + + dirent = (struct nandfs_dir_entry *)buf; + fs->nf_offset += dirent->rec_len; + strncpy(d->d_name, dirent->name, dirent->name_len); + d->d_name[dirent->name_len] = '\0'; + d->d_type = dirent->file_type; + return (0); +} + +static int +nandfs_buf_read(struct nandfs *fs, char **buf_p, size_t *size_p) +{ + nandfs_daddr_t blknr, blkoff; + + blknr = fs->nf_offset / fs->nf_blocksize; + blkoff = fs->nf_offset % fs->nf_blocksize; + + if (blknr != fs->nf_buf_blknr) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu May 17 10:19:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D18F31065674; Thu, 17 May 2012 10:19:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7D6D8FC20; Thu, 17 May 2012 10:19:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HAJnjI090630; Thu, 17 May 2012 10:19:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HAJnYB090628; Thu, 17 May 2012 10:19:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205171019.q4HAJnYB090628@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 17 May 2012 10:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235538 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 10:19:49 -0000 Author: kib Date: Thu May 17 10:19:49 2012 New Revision: 235538 URL: http://svn.freebsd.org/changeset/base/235538 Log: Fix typo. MFC after: 3 days Modified: head/sys/amd64/amd64/fpu.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Thu May 17 10:11:18 2012 (r235537) +++ head/sys/amd64/amd64/fpu.c Thu May 17 10:19:49 2012 (r235538) @@ -141,7 +141,7 @@ CTASSERT(sizeof(struct savefpu_ymm) == 8 /* * This requirement is to make it easier for asm code to calculate * offset of the fpu save area from the pcb address. FPU save area - * must by 64-bytes aligned. + * must be 64-bytes aligned. */ CTASSERT(sizeof(struct pcb) % XSAVE_AREA_ALIGN == 0); From owner-svn-src-head@FreeBSD.ORG Thu May 17 11:10:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22EB11065674; Thu, 17 May 2012 11:10:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DDF28FC08; Thu, 17 May 2012 11:10:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HBADCt095829; Thu, 17 May 2012 11:10:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HBADMM095826; Thu, 17 May 2012 11:10:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205171110.q4HBADMM095826@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 17 May 2012 11:10:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235541 - head/usr.bin/lastcomm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 11:10:14 -0000 Author: kib Date: Thu May 17 11:10:13 2012 New Revision: 235541 URL: http://svn.freebsd.org/changeset/base/235541 Log: Allow to specify strftime(3) format for process start end exit times. Submitted by: Andrey Zonov MFC after: 1 week Modified: head/usr.bin/lastcomm/lastcomm.1 head/usr.bin/lastcomm/lastcomm.c Modified: head/usr.bin/lastcomm/lastcomm.1 ============================================================================== --- head/usr.bin/lastcomm/lastcomm.1 Thu May 17 10:36:32 2012 (r235540) +++ head/usr.bin/lastcomm/lastcomm.1 Thu May 17 11:10:13 2012 (r235541) @@ -28,7 +28,7 @@ .\" From: @(#)lastcomm.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd May 14, 2007 +.Dd May 17, 2012 .Dt LASTCOMM 1 .Os .Sh NAME @@ -38,6 +38,7 @@ .Nm .Op Fl EScesu .Op Fl f Ar file +.Op Cm + Ns Ar format .Op Ar command ...\& .Op Ar user ...\& .Op Ar terminal ...\& @@ -77,6 +78,15 @@ is a single dash reads accounting entries from the standard input. .El .Pp +An operand with a leading plus sign +.Pq Sq + +is followed a user-defined format string which specifies the format +in which to display the process's start or exit date and time. +The format string may contain any of the conversion specifications +described in the +.Xr strftime 3 +manual page, as well as arbitrary text. +.Pp If no options are specified, .Fl cS is assumed. @@ -165,6 +175,7 @@ will print details of each terminating c .Sh SEE ALSO .Xr last 1 , .Xr sigaction 2 , +.Xr strftime 3 , .Xr acct 5 , .Xr core 5 .Sh HISTORY Modified: head/usr.bin/lastcomm/lastcomm.c ============================================================================== --- head/usr.bin/lastcomm/lastcomm.c Thu May 17 10:36:32 2012 (r235540) +++ head/usr.bin/lastcomm/lastcomm.c Thu May 17 11:10:13 2012 (r235541) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "pathnames.h" @@ -82,10 +83,12 @@ main(int argc, char *argv[]) int (*readrec)(FILE *f, struct acctv2 *av2); time_t t; int ch, rv; - const char *acctfile; + const char *acctfile, *format; + char buf[1024]; int flags = 0; acctfile = _PATH_ACCT; + format = NULL; while ((ch = getopt(argc, argv, "f:usecSE")) != -1) switch((char)ch) { case 'f': @@ -126,6 +129,12 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + if (argc > 0 && **argv == '+') { + format = *argv + 1; /* skip + */ + argc--; + argv++; + } + if (strcmp(acctfile, "-") == 0) { fp = stdin; readrec = readrec_forward; @@ -177,14 +186,24 @@ main(int argc, char *argv[]) /* starting time */ if (flags & AC_BTIME) { - (void)printf(" %.16s", ctime(&ab.ac_btime)); + if (format != NULL) { + (void)strftime(buf, sizeof(buf), format, + localtime(&ab.ac_btime)); + (void)printf(" %s", buf); + } else + (void)printf(" %.16s", ctime(&ab.ac_btime)); } /* exit time (starting time + elapsed time )*/ if (flags & AC_FTIME) { t = ab.ac_btime; t += (time_t)(ab.ac_etime / 1000000); - (void)printf(" %.16s", ctime(&t)); + if (format != NULL) { + (void)strftime(buf, sizeof(buf), format, + localtime(&t)); + (void)printf(" %s", buf); + } else + (void)printf(" %.16s", ctime(&t)); } printf("\n"); } @@ -250,6 +269,7 @@ static void usage(void) { (void)fprintf(stderr, -"usage: lastcomm [-EScesu] [-f file] [command ...] [user ...] [terminal ...]\n"); + "usage: lastcomm [-EScesu] [-f file] [+format] [command ...] " + "[user ...] [terminal ...]\n"); exit(1); } From owner-svn-src-head@FreeBSD.ORG Thu May 17 11:29:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D22BB106566B; Thu, 17 May 2012 11:29:22 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC5888FC12; Thu, 17 May 2012 11:29:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HBTMnx096568; Thu, 17 May 2012 11:29:22 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HBTMJp096564; Thu, 17 May 2012 11:29:22 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201205171129.q4HBTMJp096564@svn.freebsd.org> From: Joel Dahl Date: Thu, 17 May 2012 11:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235542 - in head: sbin/nandfs share/man/man5 usr.sbin/nandsim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 11:29:22 -0000 Author: joel (doc committer) Date: Thu May 17 11:29:22 2012 New Revision: 235542 URL: http://svn.freebsd.org/changeset/base/235542 Log: mdoc: remove superfluous paragraph macro. Modified: head/sbin/nandfs/nandfs.8 head/share/man/man5/nandfs.5 head/usr.sbin/nandsim/nandsim.8 Modified: head/sbin/nandfs/nandfs.8 ============================================================================== --- head/sbin/nandfs/nandfs.8 Thu May 17 11:10:13 2012 (r235541) +++ head/sbin/nandfs/nandfs.8 Thu May 17 11:29:22 2012 (r235542) @@ -50,7 +50,6 @@ The .Nm utility allows to manage snapshots of a mounted NAND FS. .Sh EXAMPLES -.Pp Create a snapshot of filesystem mounted on .Em /nand . .Bd -literal -offset 2n Modified: head/share/man/man5/nandfs.5 ============================================================================== --- head/share/man/man5/nandfs.5 Thu May 17 11:10:13 2012 (r235541) +++ head/share/man/man5/nandfs.5 Thu May 17 11:29:22 2012 (r235542) @@ -88,7 +88,6 @@ structure, and .Pa /mnt is a mount point. .Pp -.Pp It is possible to define an entry in .Pa /etc/fstab for the Modified: head/usr.sbin/nandsim/nandsim.8 ============================================================================== --- head/usr.sbin/nandsim/nandsim.8 Thu May 17 11:10:13 2012 (r235541) +++ head/usr.sbin/nandsim/nandsim.8 Thu May 17 11:29:22 2012 (r235542) @@ -115,7 +115,6 @@ Reads simulator configuration from a spe the simulation "layout" i.e. controllers-chips assignments). Configuration changes for an already started simulation require a full stop-start cycle in order to take effect i.e.: -.Pp .Bl -column .It nandsim stop ... .It nandsim destroy ... From owner-svn-src-head@FreeBSD.ORG Thu May 17 11:45:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 969971065672; Thu, 17 May 2012 11:45:57 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 682528FC12; Thu, 17 May 2012 11:45:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HBjvWu097168; Thu, 17 May 2012 11:45:57 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HBjv0w097166; Thu, 17 May 2012 11:45:57 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201205171145.q4HBjv0w097166@svn.freebsd.org> From: Joel Dahl Date: Thu, 17 May 2012 11:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235543 - head/usr.sbin/nandtool X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 11:45:57 -0000 Author: joel (doc committer) Date: Thu May 17 11:45:56 2012 New Revision: 235543 URL: http://svn.freebsd.org/changeset/base/235543 Log: Minor mdoc fixes. Modified: head/usr.sbin/nandtool/nandtool.8 Modified: head/usr.sbin/nandtool/nandtool.8 ============================================================================== --- head/usr.sbin/nandtool/nandtool.8 Thu May 17 11:29:22 2012 (r235542) +++ head/usr.sbin/nandtool/nandtool.8 Thu May 17 11:45:56 2012 (r235543) @@ -62,7 +62,6 @@ Write OOB area bound to specified page. Get usage info. .El .Sh COMMAND read -.Pp The following operands are available for .Nm .Cm read @@ -87,13 +86,11 @@ to page granularity). Count of objects (pages, blocks, bytes). .El .Sh COMMAND readoob -.Bl -tag -width ".Cm of Ns = Ns Ar file" -.Pp The following operands are available for .Nm .Cm readoob command: -.Pp +.Bl -tag -width ".Cm of Ns = Ns Ar file" .It Cm dev Ns = Ns Ar Path to NAND device node. .It Cm page Ns = Ns Ar @@ -102,11 +99,11 @@ Offset on device, expressed as page numb Output file path, optional. .El .Sh COMMAND write -.Bl -tag -width ".Cm of Ns = Ns Ar file" The following operands are available for .Nm .Cm write command: +.Bl -tag -width ".Cm of Ns = Ns Ar file" .It Cm dev Ns = Ns Ar Path to NAND device node. .It Cm page Ns = Ns Ar @@ -120,11 +117,11 @@ to page granularity). Input file path. .El .Sh COMMAND writeoob -.Bl -tag -width ".Cm of Ns = Ns Ar file" The following operands are available for .Nm .Cm writeoob command: +.Bl -tag -width ".Cm of Ns = Ns Ar file" .It Cm dev Ns = Ns Ar Path to NAND device node. .It Cm page Ns = Ns Ar @@ -133,11 +130,11 @@ Offset on device, expressed as page numb Input file path. .El .Sh COMMAND erase -.Bl -tag -width ".Cm of Ns = Ns Ar file" The following operands are available for .Nm .Cm erase command: +.Bl -tag -width ".Cm of Ns = Ns Ar file" .It Cm dev Ns = Ns Ar Path to NAND device node. .It Cm page Ns = Ns Ar @@ -155,21 +152,20 @@ WARNING: The only required parameter for .Ar dev . When no other arguments are provided the whole device is erased! .Sh COMMAND info -.Bl -tag -width ".Cm of Ns = Ns Ar file" There is only one operand available for .Nm .Cm info command: +.Bl -tag -width ".Cm of Ns = Ns Ar file" .It Cm dev Ns = Ns Ar Path to NAND device node. .El .Sh COMMAND help -.Bl -tag -width ".Cm of Ns = Ns Ar file" There is only one operand available for .Nm .Cm help command: -.Pp +.Bl -tag -width ".Cm of Ns = Ns Ar file" .It Cm topic Ns = Ns Ar Help topic. .El From owner-svn-src-head@FreeBSD.ORG Thu May 17 11:50:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD2E9106564A; Thu, 17 May 2012 11:50:12 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8A168FC08; Thu, 17 May 2012 11:50:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HBoCB2097355; Thu, 17 May 2012 11:50:12 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HBoCmf097352; Thu, 17 May 2012 11:50:12 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201205171150.q4HBoCmf097352@svn.freebsd.org> From: Joel Dahl Date: Thu, 17 May 2012 11:50:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235544 - in head: sbin/newfs_nandfs usr.sbin/nandtool X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 11:50:13 -0000 Author: joel (doc committer) Date: Thu May 17 11:50:12 2012 New Revision: 235544 URL: http://svn.freebsd.org/changeset/base/235544 Log: mdoc: remove whitespace. Modified: head/sbin/newfs_nandfs/newfs_nandfs.8 head/usr.sbin/nandtool/nandtool.8 Modified: head/sbin/newfs_nandfs/newfs_nandfs.8 ============================================================================== --- head/sbin/newfs_nandfs/newfs_nandfs.8 Thu May 17 11:45:56 2012 (r235543) +++ head/sbin/newfs_nandfs/newfs_nandfs.8 Thu May 17 11:50:12 2012 (r235544) @@ -25,7 +25,6 @@ .\" .\" $FreeBSD$ .\" - .Dd April 11, 2009 .Dt NEWFS_NANDFS 8 .Os Modified: head/usr.sbin/nandtool/nandtool.8 ============================================================================== --- head/usr.sbin/nandtool/nandtool.8 Thu May 17 11:45:56 2012 (r235543) +++ head/usr.sbin/nandtool/nandtool.8 Thu May 17 11:50:12 2012 (r235544) @@ -73,7 +73,7 @@ Path to a device node, required for all operations. .It Cm out Ns = Ns Ar Output file path. If not specified, page contents -will be dumped to stdout in format similar to +will be dumped to stdout in format similar to .Xr hexdump 1 .It Cm page Ns = Ns Ar Offset on device, expressed as page number. From owner-svn-src-head@FreeBSD.ORG Thu May 17 11:53:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53DEC106564A; Thu, 17 May 2012 11:53:39 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 356028FC08; Thu, 17 May 2012 11:53:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HBrdxs097516; Thu, 17 May 2012 11:53:39 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HBrcEv097514; Thu, 17 May 2012 11:53:38 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201205171153.q4HBrcEv097514@svn.freebsd.org> From: Grzegorz Bernacki Date: Thu, 17 May 2012 11:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235545 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 11:53:39 -0000 Author: gber Date: Thu May 17 11:53:38 2012 New Revision: 235545 URL: http://svn.freebsd.org/changeset/base/235545 Log: Removed repeated content from man page. Modified: head/share/man/man4/nandsim.4 Modified: head/share/man/man4/nandsim.4 ============================================================================== --- head/share/man/man4/nandsim.4 Thu May 17 11:50:12 2012 (r235544) +++ head/share/man/man4/nandsim.4 Thu May 17 11:53:38 2012 (r235545) @@ -90,95 +90,3 @@ kernel driver was developed by .An Grzegorz Bernacki . This manual page was written by .An Rafal Jaworowski . -.\" -.\" Copyright (c) 2012 The FreeBSD Foundation -.\" All rights reserved. -.\" -.\" This documentation was written by Semihalf under sponsorship from -.\" the FreeBSD Foundation. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" $FreeBSD$ -.\" -.Dd March 8, 2012 -.Dt NANDSIM 4 -.Os -.Sh NAME -.Nm nandsim -.Nd NAND Flash simulator driver -.Sh SYNOPSIS -.Cd "device nand" -.Cd "device nandsim" -.Cd "options ALQ" -.Sh DESCRIPTION -The -.Nm -is part of the -.Fx -NAND framework -.Xr nand 4 -and can be characterized with the following highlights: -.Bl -bullet -.It -plugs into the -.Xr nand 4 -framework APIs as if it were a hardware controller (hanging on the nexus bus) -with real NAND chips connected to it -.It -physically part of the kernel code (either statically linked into the kernel -image or built as a module) -.It -controlled with a user space program -.Xr nandsim 8 -.El -.Pp -From the user perspective, the -.Nm -allows for imitating ONFI-compliant NAND Flash devices as if they were -attached to the system via a virtual controller. -.Pp -Some -.Nm -features rely on the ability to log contents to a file, which is achieved -through the -.Xr alq 9 -facility. -.Sh SEE ALSO -.Xr nand 4 , -.Xr nandsim.conf 5 , -.Xr nandsim 8 -.Sh STANDARDS -Open NAND Flash Interface Working Group -.Pq Vt ONFI . -.Sh HISTORY -The -.Nm -support first appeared in -.Fx 10.0 . -.Sh AUTHOR -The -.Nm -kernel driver was developed by -.An Grzegorz Bernacki . -This manual page was written by -.An Rafal Jaworowski . From owner-svn-src-head@FreeBSD.ORG Thu May 17 13:08:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BB591065670; Thu, 17 May 2012 13:08:31 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 269CE8FC0A; Thu, 17 May 2012 13:08:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HD8V68099996; Thu, 17 May 2012 13:08:31 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HD8U3o099994; Thu, 17 May 2012 13:08:30 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201205171308.q4HD8U3o099994@svn.freebsd.org> From: Gabor Kovesdan Date: Thu, 17 May 2012 13:08:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235546 - head/usr.bin/sort X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 13:08:31 -0000 Author: gabor Date: Thu May 17 13:08:30 2012 New Revision: 235546 URL: http://svn.freebsd.org/changeset/base/235546 Log: - Fix -o option that was broken by my clang compile fix Submitted by: Oleg Moskalenko Modified: head/usr.bin/sort/sort.c Modified: head/usr.bin/sort/sort.c ============================================================================== --- head/usr.bin/sort/sort.c Thu May 17 11:53:38 2012 (r235545) +++ head/usr.bin/sort/sort.c Thu May 17 13:08:30 2012 (r235546) @@ -1049,9 +1049,8 @@ main(int argc, char **argv) sort_opts_vals.mflag = true; break; case 'o': - outfile = sort_realloc(outfile, sizeof(char) * - (strlen(optarg) + 1)); - strlcpy(outfile, optarg, strlen(outfile)); + outfile = sort_realloc(outfile, (strlen(optarg) + 1)); + strcpy(outfile, optarg); break; case 's': sort_opts_vals.sflag = true; From owner-svn-src-head@FreeBSD.ORG Thu May 17 14:36:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BD423106578D; Thu, 17 May 2012 14:36:20 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7EF18FC1C; Thu, 17 May 2012 14:36:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HEaK84002975; Thu, 17 May 2012 14:36:20 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HEaKCM002973; Thu, 17 May 2012 14:36:20 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201205171436.q4HEaKCM002973@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 17 May 2012 14:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235547 - head/sys/dev/ixgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 14:36:20 -0000 Author: luigi Date: Thu May 17 14:36:19 2012 New Revision: 235547 URL: http://svn.freebsd.org/changeset/base/235547 Log: fix a typo in a comment Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Thu May 17 13:08:30 2012 (r235546) +++ head/sys/dev/ixgbe/ixgbe.c Thu May 17 14:36:19 2012 (r235547) @@ -322,7 +322,7 @@ static int fdir_pballoc = 1; * be a reference on how to implement netmap support in a driver. * Additional comments are in ixgbe_netmap.h . * - * contains functions for netmap support + * contains functions for netmap support * that extend the standard driver. */ #include From owner-svn-src-head@FreeBSD.ORG Thu May 17 16:28:41 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0189106566B; Thu, 17 May 2012 16:28:41 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 5171A8FC19; Thu, 17 May 2012 16:28:41 +0000 (UTC) Received: from marcelm-sslvpn-nc.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q4HGSTd2023601 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 17 May 2012 09:28:35 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <201205171011.q4HABIJY090234@svn.freebsd.org> Date: Thu, 17 May 2012 09:28:27 -0700 Content-Transfer-Encoding: 7bit Message-Id: <67EA71E7-0FB0-435F-9A08-26DE9C98EFD0@xcllnt.net> References: <201205171011.q4HABIJY090234@svn.freebsd.org> To: Grzegorz Bernacki X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235537 - in head: etc/mtree include lib lib/libnandfs lib/libstand sbin sbin/nandfs sbin/newfs_nandfs share/man/man4 share/man/man5 share/mk sys/boot/arm/uboot sys/boot/i386/loader sys... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 16:28:41 -0000 On May 17, 2012, at 3:11 AM, Grzegorz Bernacki wrote: > Author: gber > Date: Thu May 17 10:11:18 2012 > New Revision: 235537 > URL: http://svn.freebsd.org/changeset/base/235537 > > Log: > Import work done under project/nand (@235533) into head. I'm a happy man! -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Thu May 17 17:02:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE4961065674; Thu, 17 May 2012 17:02:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A6EC8FC0C; Thu, 17 May 2012 17:02:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HH2ltQ007810; Thu, 17 May 2012 17:02:47 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HH2ln6007808; Thu, 17 May 2012 17:02:47 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205171702.q4HH2ln6007808@svn.freebsd.org> From: Michael Tuexen Date: Thu, 17 May 2012 17:02:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235554 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 17:02:47 -0000 Author: tuexen Date: Thu May 17 17:02:47 2012 New Revision: 235554 URL: http://svn.freebsd.org/changeset/base/235554 Log: Support SCTP_EOF also for 1-to-1 style sockets. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Thu May 17 15:45:00 2012 (r235553) +++ head/sys/netinet/sctp_output.c Thu May 17 17:02:47 2012 (r235554) @@ -13610,8 +13610,7 @@ skip_preblock: dataless_eof: /* EOF thing ? */ if ((srcv->sinfo_flags & SCTP_EOF) && - (got_all_of_the_send == 1) && - (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE)) { + (got_all_of_the_send == 1)) { int cnt; SCTP_STAT_INCR(sctps_sends_with_eof); From owner-svn-src-head@FreeBSD.ORG Thu May 17 17:30:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED0061065672; Thu, 17 May 2012 17:30:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D77B78FC0A; Thu, 17 May 2012 17:30:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HHUGUK008743; Thu, 17 May 2012 17:30:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HHUGgY008741; Thu, 17 May 2012 17:30:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205171730.q4HHUGgY008741@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 17 May 2012 17:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235555 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 17:30:17 -0000 Author: kib Date: Thu May 17 17:30:16 2012 New Revision: 235555 URL: http://svn.freebsd.org/changeset/base/235555 Log: Use singular form for a modifier. Submitted by: alc MFC after: 3 days Modified: head/sys/amd64/amd64/fpu.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Thu May 17 17:02:47 2012 (r235554) +++ head/sys/amd64/amd64/fpu.c Thu May 17 17:30:16 2012 (r235555) @@ -141,7 +141,7 @@ CTASSERT(sizeof(struct savefpu_ymm) == 8 /* * This requirement is to make it easier for asm code to calculate * offset of the fpu save area from the pcb address. FPU save area - * must be 64-bytes aligned. + * must be 64-byte aligned. */ CTASSERT(sizeof(struct pcb) % XSAVE_AREA_ALIGN == 0); From owner-svn-src-head@FreeBSD.ORG Thu May 17 17:58:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA6E1106564A; Thu, 17 May 2012 17:58:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C68D8FC14; Thu, 17 May 2012 17:58:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HHwsja009635; Thu, 17 May 2012 17:58:54 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HHwsCn009629; Thu, 17 May 2012 17:58:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201205171758.q4HHwsCn009629@svn.freebsd.org> From: John Baldwin Date: Thu, 17 May 2012 17:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235556 - in head/sys: amd64/acpica dev/acpica i386/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 17:58:54 -0000 Author: jhb Date: Thu May 17 17:58:53 2012 New Revision: 235556 URL: http://svn.freebsd.org/changeset/base/235556 Log: Centralize declaration of the debug.acpi sysctl node. Modified: head/sys/amd64/acpica/acpi_machdep.c head/sys/dev/acpica/acpi_ec.c head/sys/dev/acpica/acpi_smbat.c head/sys/dev/acpica/acpivar.h head/sys/i386/acpica/acpi_machdep.c Modified: head/sys/amd64/acpica/acpi_machdep.c ============================================================================== --- head/sys/amd64/acpica/acpi_machdep.c Thu May 17 17:30:16 2012 (r235555) +++ head/sys/amd64/acpica/acpi_machdep.c Thu May 17 17:58:53 2012 (r235556) @@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$"); #include -SYSCTL_DECL(_debug_acpi); - int acpi_resume_beep; TUNABLE_INT("debug.acpi.resume_beep", &acpi_resume_beep); SYSCTL_INT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RW, &acpi_resume_beep, Modified: head/sys/dev/acpica/acpi_ec.c ============================================================================== --- head/sys/dev/acpica/acpi_ec.c Thu May 17 17:30:16 2012 (r235555) +++ head/sys/dev/acpica/acpi_ec.c Thu May 17 17:58:53 2012 (r235556) @@ -178,7 +178,6 @@ struct acpi_ec_softc { ACPI_SERIAL_DECL(ec, "ACPI embedded controller"); -SYSCTL_DECL(_debug_acpi); static SYSCTL_NODE(_debug_acpi, OID_AUTO, ec, CTLFLAG_RD, NULL, "EC debugging"); static int ec_burst_mode; Modified: head/sys/dev/acpica/acpi_smbat.c ============================================================================== --- head/sys/dev/acpica/acpi_smbat.c Thu May 17 17:30:16 2012 (r235555) +++ head/sys/dev/acpica/acpi_smbat.c Thu May 17 17:58:53 2012 (r235556) @@ -62,7 +62,6 @@ static int acpi_smbat_get_bst(device_t d ACPI_SERIAL_DECL(smbat, "ACPI Smart Battery"); -SYSCTL_DECL(_debug_acpi); static SYSCTL_NODE(_debug_acpi, OID_AUTO, batt, CTLFLAG_RD, NULL, "Battery debugging"); Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Thu May 17 17:30:16 2012 (r235555) +++ head/sys/dev/acpica/acpivar.h Thu May 17 17:58:53 2012 (r235556) @@ -492,5 +492,7 @@ ACPI_HANDLE acpi_GetReference(ACPI_HANDL /* Use the device logging level for ktr(4). */ #define KTR_ACPI KTR_DEV +SYSCTL_DECL(_debug_acpi); + #endif /* _KERNEL */ #endif /* !_ACPIVAR_H_ */ Modified: head/sys/i386/acpica/acpi_machdep.c ============================================================================== --- head/sys/i386/acpica/acpi_machdep.c Thu May 17 17:30:16 2012 (r235555) +++ head/sys/i386/acpica/acpi_machdep.c Thu May 17 17:58:53 2012 (r235556) @@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$"); #include -SYSCTL_DECL(_debug_acpi); - uint32_t acpi_resume_beep; TUNABLE_INT("debug.acpi.resume_beep", &acpi_resume_beep); SYSCTL_UINT(_debug_acpi, OID_AUTO, resume_beep, CTLFLAG_RW, &acpi_resume_beep, From owner-svn-src-head@FreeBSD.ORG Thu May 17 18:12:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D9C01106564A; Thu, 17 May 2012 18:12:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3F438FC0A; Thu, 17 May 2012 18:12:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HICOtE010144; Thu, 17 May 2012 18:12:24 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HICO7W010141; Thu, 17 May 2012 18:12:24 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201205171812.q4HICO7W010141@svn.freebsd.org> From: Michael Tuexen Date: Thu, 17 May 2012 18:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235557 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 18:12:24 -0000 Author: tuexen Date: Thu May 17 18:12:24 2012 New Revision: 235557 URL: http://svn.freebsd.org/changeset/base/235557 Log: Use a default for max_burst of 4 and l2var of 2. This was discussed with rrs@. MFC after: 3 days Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_sysctl.h Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Thu May 17 17:58:53 2012 (r235556) +++ head/sys/netinet/sctp_constants.h Thu May 17 18:12:24 2012 (r235557) @@ -348,7 +348,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_NO_FR_UNLESS_SEGMENT_SMALLER 1 /* default max I can burst out after a fast retransmit, 0 disables it */ -#define SCTP_DEF_MAX_BURST 0 +#define SCTP_DEF_MAX_BURST 4 #define SCTP_DEF_HBMAX_BURST 4 #define SCTP_DEF_FRMAX_BURST 4 Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Thu May 17 17:58:53 2012 (r235556) +++ head/sys/netinet/sctp_sysctl.h Thu May 17 18:12:24 2012 (r235557) @@ -377,7 +377,7 @@ struct sctp_sysctl { #define SCTPCTL_ABC_L_VAR_DESC "SCTP ABC max increase per SACK (L)" #define SCTPCTL_ABC_L_VAR_MIN 0 #define SCTPCTL_ABC_L_VAR_MAX 0xFFFFFFFF -#define SCTPCTL_ABC_L_VAR_DEFAULT 1 +#define SCTPCTL_ABC_L_VAR_DEFAULT 2 /* max_chained_mbufs: Default max number of small mbufs on a chain */ #define SCTPCTL_MAX_CHAINED_MBUFS_DESC "Default max number of small mbufs on a chain" From owner-svn-src-head@FreeBSD.ORG Thu May 17 18:40:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97CE21065670; Thu, 17 May 2012 18:40:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82AAE8FC19; Thu, 17 May 2012 18:40:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HIeSZf011043; Thu, 17 May 2012 18:40:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HIeSpE011041; Thu, 17 May 2012 18:40:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205171840.q4HIeSpE011041@svn.freebsd.org> From: Alexander Motin Date: Thu, 17 May 2012 18:40:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235558 - head/sys/dev/usb/input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 18:40:28 -0000 Author: mav Date: Thu May 17 18:40:27 2012 New Revision: 235558 URL: http://svn.freebsd.org/changeset/base/235558 Log: Add support for writing to HID devices through the interrupt output pipe. Supermicro LCD screen modules seem to not support accessing reports through the control pipes, but working fine with the interrupt pipes. Sponsored by: iXsystems, Inc. MFC after: 1 week Modified: head/sys/dev/usb/input/uhid.c Modified: head/sys/dev/usb/input/uhid.c ============================================================================== --- head/sys/dev/usb/input/uhid.c Thu May 17 18:12:24 2012 (r235557) +++ head/sys/dev/usb/input/uhid.c Thu May 17 18:40:27 2012 (r235558) @@ -87,6 +87,7 @@ SYSCTL_INT(_hw_usb_uhid, OID_AUTO, debug #define UHID_FRAME_NUM 50 /* bytes, frame number */ enum { + UHID_INTR_DT_WR, UHID_INTR_DT_RD, UHID_CTRL_DT_WR, UHID_CTRL_DT_RD, @@ -128,7 +129,8 @@ static device_probe_t uhid_probe; static device_attach_t uhid_attach; static device_detach_t uhid_detach; -static usb_callback_t uhid_intr_callback; +static usb_callback_t uhid_intr_write_callback; +static usb_callback_t uhid_intr_read_callback; static usb_callback_t uhid_write_callback; static usb_callback_t uhid_read_callback; @@ -152,7 +154,36 @@ static struct usb_fifo_methods uhid_fifo }; static void -uhid_intr_callback(struct usb_xfer *xfer, usb_error_t error) +uhid_intr_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct uhid_softc *sc = usbd_xfer_softc(xfer); + struct usb_page_cache *pc; + int actlen; + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + case USB_ST_SETUP: +tr_setup: + pc = usbd_xfer_get_frame(xfer, 0); + if (usb_fifo_get_data(sc->sc_fifo.fp[USB_FIFO_TX], pc, + 0, usbd_xfer_max_len(xfer), &actlen, 0)) { + usbd_xfer_set_frame_len(xfer, 0, actlen); + usbd_transfer_submit(xfer); + } + return; + + default: /* Error */ + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + return; + } +} + +static void +uhid_intr_read_callback(struct usb_xfer *xfer, usb_error_t error) { struct uhid_softc *sc = usbd_xfer_softc(xfer); struct usb_page_cache *pc; @@ -327,13 +358,22 @@ uhid_read_callback(struct usb_xfer *xfer static const struct usb_config uhid_config[UHID_N_TRANSFER] = { + [UHID_INTR_DT_WR] = { + .type = UE_INTERRUPT, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .flags = {.pipe_bof = 1, }, + .bufsize = UHID_BSIZE, + .callback = &uhid_intr_write_callback, + }, + [UHID_INTR_DT_RD] = { .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, .bufsize = UHID_BSIZE, - .callback = &uhid_intr_callback, + .callback = &uhid_intr_read_callback, }, [UHID_CTRL_DT_WR] = { @@ -381,7 +421,11 @@ uhid_start_write(struct usb_fifo *fifo) { struct uhid_softc *sc = usb_fifo_softc(fifo); - usbd_transfer_start(sc->sc_xfer[UHID_CTRL_DT_WR]); + if (sc->sc_flags & UHID_FLAG_IMMED) { + usbd_transfer_start(sc->sc_xfer[UHID_CTRL_DT_WR]); + } else { + usbd_transfer_start(sc->sc_xfer[UHID_INTR_DT_WR]); + } } static void @@ -390,6 +434,7 @@ uhid_stop_write(struct usb_fifo *fifo) struct uhid_softc *sc = usb_fifo_softc(fifo); usbd_transfer_stop(sc->sc_xfer[UHID_CTRL_DT_WR]); + usbd_transfer_stop(sc->sc_xfer[UHID_INTR_DT_WR]); } static int From owner-svn-src-head@FreeBSD.ORG Thu May 17 20:00:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B6831065673; Thu, 17 May 2012 20:00:37 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05DF68FC14; Thu, 17 May 2012 20:00:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HK0Z1w014406; Thu, 17 May 2012 20:00:35 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HK0ZLw014389; Thu, 17 May 2012 20:00:35 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201205172000.q4HK0ZLw014389@svn.freebsd.org> From: Devin Teske Date: Thu, 17 May 2012 20:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235560 - head/sys/boot/forth X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 20:00:37 -0000 Author: dteske Date: Thu May 17 20:00:34 2012 New Revision: 235560 URL: http://svn.freebsd.org/changeset/base/235560 Log: Update contact info. PR: N/A (mentor approved) Submitted by: dteske Reviewed by: dteske (mentor approved) Approved by: emaste (mentor) MFC after: 1 week Modified: head/sys/boot/forth/beastie.4th head/sys/boot/forth/beastie.4th.8 head/sys/boot/forth/brand.4th head/sys/boot/forth/brand.4th.8 head/sys/boot/forth/check-password.4th head/sys/boot/forth/check-password.4th.8 head/sys/boot/forth/color.4th head/sys/boot/forth/color.4th.8 head/sys/boot/forth/delay.4th head/sys/boot/forth/delay.4th.8 head/sys/boot/forth/menu-commands.4th head/sys/boot/forth/menu.4th head/sys/boot/forth/menu.4th.8 head/sys/boot/forth/shortcuts.4th head/sys/boot/forth/version.4th head/sys/boot/forth/version.4th.8 Modified: head/sys/boot/forth/beastie.4th ============================================================================== --- head/sys/boot/forth/beastie.4th Thu May 17 19:01:13 2012 (r235559) +++ head/sys/boot/forth/beastie.4th Thu May 17 20:00:34 2012 (r235560) @@ -1,6 +1,6 @@ \ Copyright (c) 2003 Scott Long \ Copyright (c) 2003 Aleksander Fafula -\ Copyright (c) 2006-2011 Devin Teske +\ Copyright (c) 2006-2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/forth/beastie.4th.8 ============================================================================== --- head/sys/boot/forth/beastie.4th.8 Thu May 17 19:01:13 2012 (r235559) +++ head/sys/boot/forth/beastie.4th.8 Thu May 17 20:00:34 2012 (r235560) @@ -168,4 +168,4 @@ set of commands was written by .An Scott Long Aq scottl@FreeBSD.org , .An Aleksander Fafula Aq alex@fafula.com and -.An Devin Teske Aq devinteske@hotmail.com . +.An Devin Teske Aq dteske@freebsd.org . Modified: head/sys/boot/forth/brand.4th ============================================================================== --- head/sys/boot/forth/brand.4th Thu May 17 19:01:13 2012 (r235559) +++ head/sys/boot/forth/brand.4th Thu May 17 20:00:34 2012 (r235560) @@ -1,4 +1,4 @@ -\ Copyright (c) 2006-2011 Devin Teske +\ Copyright (c) 2006-2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/forth/brand.4th.8 ============================================================================== --- head/sys/boot/forth/brand.4th.8 Thu May 17 19:01:13 2012 (r235559) +++ head/sys/boot/forth/brand.4th.8 Thu May 17 20:00:34 2012 (r235560) @@ -122,4 +122,4 @@ The .Nm set of commands was written by .An -nosplit -.An Devin Teske Aq devinteske@hotmail.com . +.An Devin Teske Aq dteske@freebsd.org . Modified: head/sys/boot/forth/check-password.4th ============================================================================== --- head/sys/boot/forth/check-password.4th Thu May 17 19:01:13 2012 (r235559) +++ head/sys/boot/forth/check-password.4th Thu May 17 20:00:34 2012 (r235560) @@ -1,4 +1,4 @@ -\ Copyright (c) 2006-2011 Devin Teske +\ Copyright (c) 2006-2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/forth/check-password.4th.8 ============================================================================== --- head/sys/boot/forth/check-password.4th.8 Thu May 17 19:01:13 2012 (r235559) +++ head/sys/boot/forth/check-password.4th.8 Thu May 17 20:00:34 2012 (r235560) @@ -120,4 +120,4 @@ The .Nm set of commands was written by .An -nosplit -.An Devin Teske Aq devinteske@hotmail.com . +.An Devin Teske Aq dteske@freebsd.org . Modified: head/sys/boot/forth/color.4th ============================================================================== --- head/sys/boot/forth/color.4th Thu May 17 19:01:13 2012 (r235559) +++ head/sys/boot/forth/color.4th Thu May 17 20:00:34 2012 (r235560) @@ -1,4 +1,4 @@ -\ Copyright (c) 2011 Devin Teske +\ Copyright (c) 2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/forth/color.4th.8 ============================================================================== --- head/sys/boot/forth/color.4th.8 Thu May 17 19:01:13 2012 (r235559) +++ head/sys/boot/forth/color.4th.8 Thu May 17 20:00:34 2012 (r235560) @@ -114,4 +114,4 @@ The .Nm set of commands was written by .An -nosplit -.An Devin Teske Aq devinteske@hotmail.com . +.An Devin Teske Aq dteske@freebsd.org . Modified: head/sys/boot/forth/delay.4th ============================================================================== --- head/sys/boot/forth/delay.4th Thu May 17 19:01:13 2012 (r235559) +++ head/sys/boot/forth/delay.4th Thu May 17 20:00:34 2012 (r235560) @@ -1,4 +1,4 @@ -\ Copyright (c) 2008-2011 Devin Teske +\ Copyright (c) 2008-2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/forth/delay.4th.8 ============================================================================== --- head/sys/boot/forth/delay.4th.8 Thu May 17 19:01:13 2012 (r235559) +++ head/sys/boot/forth/delay.4th.8 Thu May 17 20:00:34 2012 (r235560) @@ -123,4 +123,4 @@ The .Nm set of commands was written by .An -nosplit -.An Devin Teske Aq devinteske@hotmail.com . +.An Devin Teske Aq dteske@freebsd.org . Modified: head/sys/boot/forth/menu-commands.4th ============================================================================== --- head/sys/boot/forth/menu-commands.4th Thu May 17 19:01:13 2012 (r235559) +++ head/sys/boot/forth/menu-commands.4th Thu May 17 20:00:34 2012 (r235560) @@ -1,4 +1,4 @@ -\ Copyright (c) 2006-2011 Devin Teske +\ Copyright (c) 2006-2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/forth/menu.4th ============================================================================== --- head/sys/boot/forth/menu.4th Thu May 17 19:01:13 2012 (r235559) +++ head/sys/boot/forth/menu.4th Thu May 17 20:00:34 2012 (r235560) @@ -1,6 +1,6 @@ \ Copyright (c) 2003 Scott Long \ Copyright (c) 2003 Aleksander Fafula -\ Copyright (c) 2006-2011 Devin Teske +\ Copyright (c) 2006-2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/forth/menu.4th.8 ============================================================================== --- head/sys/boot/forth/menu.4th.8 Thu May 17 19:01:13 2012 (r235559) +++ head/sys/boot/forth/menu.4th.8 Thu May 17 20:00:34 2012 (r235560) @@ -320,4 +320,4 @@ The .Nm set of commands was written by .An -nosplit -.An Devin Teske Aq devinteske@hotmail.com . +.An Devin Teske Aq dteske@freebsd.org . Modified: head/sys/boot/forth/shortcuts.4th ============================================================================== --- head/sys/boot/forth/shortcuts.4th Thu May 17 19:01:13 2012 (r235559) +++ head/sys/boot/forth/shortcuts.4th Thu May 17 20:00:34 2012 (r235560) @@ -1,4 +1,4 @@ -\ Copyright (c) 2008-2011 Devin Teske +\ Copyright (c) 2008-2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/forth/version.4th ============================================================================== --- head/sys/boot/forth/version.4th Thu May 17 19:01:13 2012 (r235559) +++ head/sys/boot/forth/version.4th Thu May 17 20:00:34 2012 (r235560) @@ -1,4 +1,4 @@ -\ Copyright (c) 2006-2011 Devin Teske +\ Copyright (c) 2006-2011 Devin Teske \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without Modified: head/sys/boot/forth/version.4th.8 ============================================================================== --- head/sys/boot/forth/version.4th.8 Thu May 17 19:01:13 2012 (r235559) +++ head/sys/boot/forth/version.4th.8 Thu May 17 20:00:34 2012 (r235560) @@ -123,4 +123,4 @@ The .Nm set of commands was written by .An -nosplit -.An Devin Teske Aq devinteske@hotmail.com . +.An Devin Teske Aq dteske@freebsd.org . From owner-svn-src-head@FreeBSD.ORG Thu May 17 20:05:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DAFA106564A; Thu, 17 May 2012 20:05:14 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FB288FC1C; Thu, 17 May 2012 20:05:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HK5EA5014861; Thu, 17 May 2012 20:05:14 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HK5EOi014860; Thu, 17 May 2012 20:05:14 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201205172005.q4HK5EOi014860@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 17 May 2012 20:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235562 - head/sys/dev/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 20:05:14 -0000 Author: luigi Date: Thu May 17 20:05:13 2012 New Revision: 235562 URL: http://svn.freebsd.org/changeset/base/235562 Log: this file is too old and not interesting anymore now that netmap has been MFC'ed. Deleted: head/sys/dev/netmap/head.diff From owner-svn-src-head@FreeBSD.ORG Thu May 17 20:21:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A1841065675; Thu, 17 May 2012 20:21:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 855BE8FC1A; Thu, 17 May 2012 20:21:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HKLuN2015427; Thu, 17 May 2012 20:21:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HKLuGE015425; Thu, 17 May 2012 20:21:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201205172021.q4HKLuGE015425@svn.freebsd.org> From: John Baldwin Date: Thu, 17 May 2012 20:21:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235563 - head/sys/x86/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 20:21:56 -0000 Author: jhb Date: Thu May 17 20:21:55 2012 New Revision: 235563 URL: http://svn.freebsd.org/changeset/base/235563 Log: Don't expose i386-only ptrace constants on amd64. This broke gdb with libthread_db on amd64. Reported by: avg Modified: head/sys/x86/include/ptrace.h Modified: head/sys/x86/include/ptrace.h ============================================================================== --- head/sys/x86/include/ptrace.h Thu May 17 20:05:13 2012 (r235562) +++ head/sys/x86/include/ptrace.h Thu May 17 20:21:55 2012 (r235563) @@ -40,8 +40,10 @@ * PT_GETXSTATE and PT_SETXSTATE. They should not be (re)used. */ -#define PT_GETXMMREGS (PT_FIRSTMACH + 0) /* i386 only */ -#define PT_SETXMMREGS (PT_FIRSTMACH + 1) /* i386 only */ +#ifdef __i386__ +#define PT_GETXMMREGS (PT_FIRSTMACH + 0) +#define PT_SETXMMREGS (PT_FIRSTMACH + 1) +#endif #define PT_GETXSTATE (PT_FIRSTMACH + 2) #define PT_SETXSTATE (PT_FIRSTMACH + 3) From owner-svn-src-head@FreeBSD.ORG Thu May 17 20:24:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by hub.freebsd.org (Postfix) with ESMTP id 4140D1065673; Thu, 17 May 2012 20:24:34 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 68EF42019FF; Thu, 17 May 2012 20:23:36 +0000 (UTC) Message-ID: <4FB55E47.4050202@FreeBSD.org> Date: Thu, 17 May 2012 13:23:35 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120506 Thunderbird/12.0.1 MIME-Version: 1.0 To: Devin Teske References: <201205172000.q4HK0ZLw014389@svn.freebsd.org> In-Reply-To: <201205172000.q4HK0ZLw014389@svn.freebsd.org> X-Enigmail-Version: 1.5pre OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, emaste@FreeBSD.org Subject: Re: svn commit: r235560 - head/sys/boot/forth X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 20:24:34 -0000 On 05/17/2012 13:00, Devin Teske wrote: > Author: dteske > Date: Thu May 17 20:00:34 2012 > New Revision: 235560 > URL: http://svn.freebsd.org/changeset/base/235560 > > Log: > Update contact info. > > PR: N/A (mentor approved) > Submitted by: dteske > Reviewed by: dteske (mentor approved) All of the above is wrong. Your mentor should be helping you understand how to properly do commit messages. > +.An Devin Teske Aq dteske@freebsd.org . In formal contex' we write @FreeBSD.org, FYI. hth, Doug From owner-svn-src-head@FreeBSD.ORG Thu May 17 20:29:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 81DD3106566B; Thu, 17 May 2012 20:29:16 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53A078FC0C; Thu, 17 May 2012 20:29:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HKTGYw015780; Thu, 17 May 2012 20:29:16 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HKTGt3015778; Thu, 17 May 2012 20:29:16 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205172029.q4HKTGt3015778@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 17 May 2012 20:29:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235565 - head/bin/rcp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 20:29:16 -0000 Author: marcel Date: Thu May 17 20:29:15 2012 New Revision: 235565 URL: http://svn.freebsd.org/changeset/base/235565 Log: Remove unused header (libutil.h) Modified: head/bin/rcp/rcp.c Modified: head/bin/rcp/rcp.c ============================================================================== --- head/bin/rcp/rcp.c Thu May 17 20:27:24 2012 (r235564) +++ head/bin/rcp/rcp.c Thu May 17 20:29:15 2012 (r235565) @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Thu May 17 20:38:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 602CA1065675; Thu, 17 May 2012 20:38:02 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C2848FC16; Thu, 17 May 2012 20:38:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HKc2oj016088; Thu, 17 May 2012 20:38:02 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HKc2HM016086; Thu, 17 May 2012 20:38:02 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205172038.q4HKc2HM016086@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 17 May 2012 20:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235566 - head/gnu/lib/csu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 20:38:02 -0000 Author: marcel Date: Thu May 17 20:38:01 2012 New Revision: 235566 URL: http://svn.freebsd.org/changeset/base/235566 Log: Build the "S" objects with the same name they get installed under. That is, build crtbeginS.o and crtendS.o instead of crtbegin.So and crtend.So. Remove the name substitution during install. Obtained from: Juniper Networks, Inc. Modified: head/gnu/lib/csu/Makefile Modified: head/gnu/lib/csu/Makefile ============================================================================== --- head/gnu/lib/csu/Makefile Thu May 17 20:29:15 2012 (r235565) +++ head/gnu/lib/csu/Makefile Thu May 17 20:38:01 2012 (r235566) @@ -12,7 +12,7 @@ CCDIR= ${.CURDIR}/../../usr.bin/cc SRCS= crtstuff.c tconfig.h tm.h options.h OBJS= crtbegin.o crtend.o crtbeginT.o -SOBJS= crtbegin.So crtend.So +SOBJS= crtbeginS.o crtendS.o CSTD?= gnu89 CFLAGS+= -DIN_GCC -DHAVE_LD_EH_FRAME_HDR -DDT_CONFIG -D__GLIBC__=3 CFLAGS+= -finhibit-size-directive -fno-inline-functions \ @@ -55,7 +55,7 @@ crtbeginT.o: ${BEGINSRC} ${CC} ${CFLAGS} -g0 -DCRT_BEGIN -DCRTSTUFFT_O \ -c -o ${.TARGET} ${.ALLSRC:N*.h} -crtbegin.So: ${BEGINSRC} +crtbeginS.o: ${BEGINSRC} ${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \ -c -o ${.TARGET} ${.ALLSRC:N*.h} @@ -63,7 +63,7 @@ crtend.o: ${ENDSRC} ${CC} ${CFLAGS} -g0 -DCRT_END \ -c -o ${.TARGET} ${.ALLSRC:N*.h} -crtend.So: ${ENDSRC} +crtendS.o: ${ENDSRC} ${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \ -c -o ${.TARGET} ${.ALLSRC:N*.h} @@ -74,7 +74,7 @@ tm.h tconfig.h options.h: ${CCDIR}/cc_to realinstall: .for file in ${OBJS} ${SOBJS} ${TGTOBJS} ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${file} ${DESTDIR}${LIBDIR}/${file:S/.So$/S.o/} + ${file} ${DESTDIR}${LIBDIR}/${file} .endfor .include From owner-svn-src-head@FreeBSD.ORG Thu May 17 20:49:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7B01106564A; Thu, 17 May 2012 20:49:44 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C14338FC16; Thu, 17 May 2012 20:49:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HKninW016544; Thu, 17 May 2012 20:49:44 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HKniGJ016542; Thu, 17 May 2012 20:49:44 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201205172049.q4HKniGJ016542@svn.freebsd.org> From: Glen Barber Date: Thu, 17 May 2012 20:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235567 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 20:49:44 -0000 Author: gjb (doc committer) Date: Thu May 17 20:49:44 2012 New Revision: 235567 URL: http://svn.freebsd.org/changeset/base/235567 Log: mdoc(7) style/formatting fixes. While here, fix a few nits igor(1) does not like. MFC after: 3 days Modified: head/share/man/man4/siftr.4 Modified: head/share/man/man4/siftr.4 ============================================================================== --- head/share/man/man4/siftr.4 Thu May 17 20:38:01 2012 (r235566) +++ head/share/man/man4/siftr.4 Thu May 17 20:49:44 2012 (r235567) @@ -94,7 +94,7 @@ utilises the .Xr sysctl 8 interface to export its configuration variables to user-space. The following variables are available: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.enabled controls whether the module performs its measurements or not. @@ -107,7 +107,7 @@ packet filtering hooks are only inserted .Va net.inet.siftr.enabled is set to 1. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.ppl controls how many inbound/outbound packets for a given TCP connection will cause a log message to be generated for the connection. @@ -116,13 +116,13 @@ every packet of every TCP connection. The value can be set to any integer in the range [1,2^32], and can be changed at any time, even while the module is enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.logfile controls the path to the file that the module writes its log messages to. By default, the file /var/log/siftr.log is used. The path can be changed at any time, even while the module is enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va net.inet.siftr.genhashes controls whether a hash is generated for each TCP packet seen by .Nm . @@ -153,36 +153,36 @@ sysname=FreeBSD sysver=604000 ipmo .Ed .Pp Field descriptions are as follows: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va enable_time_secs time at which the module was enabled, in seconds since the UNIX epoch. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va enable_time_usecs time at which the module was enabled, in microseconds since enable_time_secs. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va siftrver version of .Nm . .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va hz tick rate of the kernel in ticks per second. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va tcp_rtt_scale smoothed RTT estimate scaling factor. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va sysname operating system name. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va sysver operating system version. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va ipmode IP mode as defined at compile time. An ipmode of "4" means IPv6 is not supported and IP addresses are logged in @@ -205,7 +205,7 @@ o,0xbec491a5,1238556193.463551,172.16.7. .Ed .Pp Field descriptions are as follows: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 1 Direction of packet that triggered the log message. Either @@ -214,77 +214,77 @@ for in, or .Qq o for out. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 2 Hash of the packet that triggered the log message. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 3 Time at which the packet that triggered the log message was processed by the .Xr pfil 9 hook function, in seconds and microseconds since the UNIX epoch. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 4 The IPv4 or IPv6 address of the local host, in dotted quad (IPv4 packet) or colon-separated hex (IPv6 packet) notation. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 5 The TCP port that the local host is communicating via. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 6 The IPv4 or IPv6 address of the foreign host, in dotted quad (IPv4 packet) or colon-separated hex (IPv6 packet) notation. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 7 The TCP port that the foreign host is communicating via. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 8 The slow start threshold for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 9 The current congestion window for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 10 The current bandwidth-controlled window for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 11 The current sending window for the flow, in bytes. The post scaled value is reported, except during the initial handshake (first few packets), during which time the unscaled value is reported. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 12 The current receive window for the flow, in bytes. The post scaled value is always reported. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 13 The current window scaling factor for the sending window. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 14 The current window scaling factor for the receiving window. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 15 The current state of the TCP finite state machine, as defined in .Aq Pa netinet/tcp_fsm.h . .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 16 The maximum segment size for the flow, in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 17 The current smoothed RTT estimate for the flow, in units of TCP_RTT_SCALE * HZ, where TCP_RTT_SCALE is a define found in tcp_var.h, and HZ is the kernel's tick @@ -292,46 +292,46 @@ timer. Divide by TCP_RTT_SCALE * HZ to get the RTT in secs. TCP_RTT_SCALE and HZ are reported in the enable log message. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 18 SACK enabled indicator. 1 if SACK enabled, 0 otherwise. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 19 The current state of the TCP flags for the flow. See .Aq Pa netinet/tcp_var.h for information about the various flags. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 20 The current retransmission timeout length for the flow, in units of HZ, where HZ is the kernel's tick timer. Divide by HZ to get the timeout length in seconds. HZ is reported in the enable log message. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 21 The current size of the socket send buffer in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 22 The current number of bytes in the socket send buffer. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 23 The current size of the socket receive buffer in bytes. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 24 The current number of bytes in the socket receive buffer. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 25 The current number of unacknowledged bytes in-flight. Bytes acknowledged via SACK are not excluded from this count. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va 26 The current number of segments in the reassembly queue. .El @@ -353,82 +353,82 @@ flow_list=172.16.7.28;22-172.16.2.5;5593 .Ed .Pp Field descriptions are as follows: -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va disable_time_secs Time at which the module was disabled, in seconds since the UNIX epoch. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va disable_time_usecs Time at which the module was disabled, in microseconds since disable_time_secs. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_tcp_pkts Number of TCP packets that traversed up the network stack. This only includes inbound TCP packets during the periods when .Nm was enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_tcp_pkts Number of TCP packets that traversed down the network stack. This only includes outbound TCP packets during the periods when .Nm was enabled. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va total_tcp_pkts The summation of num_inbound_tcp_pkts and num_outbound_tcp_pkts. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_malloc Number of inbound packets that were not processed because of failed malloc() calls. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_malloc Number of outbound packets that were not processed because of failed malloc() calls. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_mtx Number of inbound packets that were not processed because of failure to add the packet to the packet processing queue. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_mtx Number of outbound packets that were not processed because of failure to add the packet to the packet processing queue. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_tcb Number of inbound packets that were not processed because of failure to find the TCP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_tcb Number of outbound packets that were not processed because of failure to find the TCP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_inbound_skipped_pkts_icb Number of inbound packets that were not processed because of failure to find the IP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va num_outbound_skipped_pkts_icb Number of outbound packets that were not processed because of failure to find the IP control block associated with the packet. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va total_skipped_tcp_pkts The summation of all skipped packet counters. .El -.Bl -tag -offset indent +.Bl -tag -offset indent -width Va .It Va flow_list A CSV list of TCP flows that triggered data log messages to be generated since the module was loaded. Each flow entry in the CSV list is formatted as .Qq local_ip;local_port-foreign_ip;foreign_port . -If there are no entries in the list (i.e. no data log messages were generated), +If there are no entries in the list (i.e., no data log messages were generated), the value will be blank. If there is at least one entry in the list, a trailing comma will always be present. @@ -501,10 +501,10 @@ the system to trigger a dump of the stat flow. With the PPL set to 1, we are in effect sampling each TCP flow's control block state as frequently as flow packets enter/leave the system. -For example, setting PPL to 2 halves the sampling rate i.e. every second flow +For example, setting PPL to 2 halves the sampling rate i.e., every second flow packet (inbound OR outbound) causes a dump of the control block state. .Pp -The distinction between interrogating individual packets vs interrogating the +The distinction between interrogating individual packets versus interrogating the control block is important, because .Nm does not remove the need for packet capturing tools like @@ -546,7 +546,7 @@ If one thread holds the lock, the other This does introduce some additional bounded delay into the kernel's packet processing code path. .Pp -In some cases (e.g. low memory, connection termination), TCP packets that enter +In some cases (e.g., low memory, connection termination), TCP packets that enter the .Nm .Xr pfil 9 From owner-svn-src-head@FreeBSD.ORG Thu May 17 21:52:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 893A11065686; Thu, 17 May 2012 21:52:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 747A88FC08; Thu, 17 May 2012 21:52:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HLqIZi018522; Thu, 17 May 2012 21:52:18 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HLqIu0018520; Thu, 17 May 2012 21:52:18 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201205172152.q4HLqIu0018520@svn.freebsd.org> From: Rick Macklem Date: Thu, 17 May 2012 21:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235568 - head/sys/fs/nfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 21:52:18 -0000 Author: rmacklem Date: Thu May 17 21:52:17 2012 New Revision: 235568 URL: http://svn.freebsd.org/changeset/base/235568 Log: A problem with the NFSv4 server was reported by Andrew Leonard to freebsd-fs@, where the setfacl of an NFSv4 acl would fail. This was caused by the VOP_ACLCHECK() call for ZFS replying EOPNOTSUPP. After discussion with rwatson@, it was determined that a call to VOP_ACLCHECK() before doing VOP_SETACL() is not required. This patch fixes the problem by deleting the VOP_ACLCHECK() call. Tested by: Andrew Leonard (previous version) MFC after: 1 week Modified: head/sys/fs/nfs/nfs_commonacl.c Modified: head/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- head/sys/fs/nfs/nfs_commonacl.c Thu May 17 20:49:44 2012 (r235567) +++ head/sys/fs/nfs/nfs_commonacl.c Thu May 17 21:52:17 2012 (r235568) @@ -468,9 +468,7 @@ nfsrv_setacl(vnode_t vp, NFSACL_T *aclp, error = NFSERR_ATTRNOTSUPP; goto out; } - error = VOP_ACLCHECK(vp, ACL_TYPE_NFS4, aclp, cred, p); - if (!error) - error = VOP_SETACL(vp, ACL_TYPE_NFS4, aclp, cred, p); + error = VOP_SETACL(vp, ACL_TYPE_NFS4, aclp, cred, p); out: NFSEXITCODE(error); From owner-svn-src-head@FreeBSD.ORG Thu May 17 22:04:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3767A106564A; Thu, 17 May 2012 22:04:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22EB78FC1B; Thu, 17 May 2012 22:04:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4HM4HZc019023; Thu, 17 May 2012 22:04:17 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4HM4H2U019021; Thu, 17 May 2012 22:04:17 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201205172204.q4HM4H2U019021@svn.freebsd.org> From: Alexander Motin Date: Thu, 17 May 2012 22:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235569 - head/sys/dev/usb/input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2012 22:04:18 -0000 Author: mav Date: Thu May 17 22:04:17 2012 New Revision: 235569 URL: http://svn.freebsd.org/changeset/base/235569 Log: Fix for the r235558: interrupt output pipe is optional, so fix the driver attach and operation when it is absent. Sponsored by: iXsystems, Inc. MFC after: 1 week Modified: head/sys/dev/usb/input/uhid.c Modified: head/sys/dev/usb/input/uhid.c ============================================================================== --- head/sys/dev/usb/input/uhid.c Thu May 17 21:52:17 2012 (r235568) +++ head/sys/dev/usb/input/uhid.c Thu May 17 22:04:17 2012 (r235569) @@ -362,7 +362,7 @@ static const struct usb_config uhid_conf .type = UE_INTERRUPT, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .flags = {.pipe_bof = 1, }, + .flags = {.pipe_bof = 1,.no_pipe_ok = 1, }, .bufsize = UHID_BSIZE, .callback = &uhid_intr_write_callback, }, @@ -421,7 +421,8 @@ uhid_start_write(struct usb_fifo *fifo) { struct uhid_softc *sc = usb_fifo_softc(fifo); - if (sc->sc_flags & UHID_FLAG_IMMED) { + if ((sc->sc_flags & UHID_FLAG_IMMED) || + sc->sc_xfer[UHID_INTR_DT_WR] == NULL) { usbd_transfer_start(sc->sc_xfer[UHID_CTRL_DT_WR]); } else { usbd_transfer_start(sc->sc_xfer[UHID_INTR_DT_WR]); From owner-svn-src-head@FreeBSD.ORG Fri May 18 03:30:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C56B8106564A; Fri, 18 May 2012 03:30:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B14178FC0C; Fri, 18 May 2012 03:30:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4I3UosT032363; Fri, 18 May 2012 03:30:50 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4I3UoV7032361; Fri, 18 May 2012 03:30:50 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201205180330.q4I3UoV7032361@svn.freebsd.org> From: Glen Barber Date: Fri, 18 May 2012 03:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235597 - head/usr.bin/join X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 03:30:50 -0000 Author: gjb (doc committer) Date: Fri May 18 03:30:50 2012 New Revision: 235597 URL: http://svn.freebsd.org/changeset/base/235597 Log: Fix a typo that crept in. Pointyhat: gjb (myself) Spotted by: hrs MFC after: 2 days (minor change) Modified: head/usr.bin/join/join.1 Modified: head/usr.bin/join/join.1 ============================================================================== --- head/usr.bin/join/join.1 Fri May 18 02:20:15 2012 (r235596) +++ head/usr.bin/join/join.1 Fri May 18 03:30:50 2012 (r235597) @@ -107,7 +107,7 @@ representing the join field. The elements of list must be either comma .Pq Ql \&, or whitespace separated. -(The letter requires quoting to protect it from the shell, or, a simpler +(The latter requires quoting to protect it from the shell, or, a simpler approach is to use multiple .Fl o options.) From owner-svn-src-head@FreeBSD.ORG Fri May 18 05:36:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7A701106564A; Fri, 18 May 2012 05:36:05 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64A3A8FC08; Fri, 18 May 2012 05:36:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4I5a5Tf036233; Fri, 18 May 2012 05:36:05 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4I5a5Ks036230; Fri, 18 May 2012 05:36:05 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201205180536.q4I5a5Ks036230@svn.freebsd.org> From: Alan Cox Date: Fri, 18 May 2012 05:36:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235598 - in head/sys/amd64: amd64 include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 05:36:05 -0000 Author: alc Date: Fri May 18 05:36:04 2012 New Revision: 235598 URL: http://svn.freebsd.org/changeset/base/235598 Log: Rename pmap_collect() to pmap_pv_reclaim() and rewrite it such that it no longer uses the active and inactive paging queues. Instead, the pmap now maintains an LRU-ordered list of pv entry pages, and pmap_pv_reclaim() uses this list to select pv entries for reclamation. Note: The old pmap_collect() tried to avoid reclaiming mappings for pages that have either a hold_count or a busy field that is non-zero. However, this isn't necessary for correctness, and the locking in pmap_collect() was insufficient to guarantee that such mappings weren't reclaimed. The new pmap_pv_reclaim() doesn't even try. Reviewed by: kib MFC after: 6 weeks Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/include/pmap.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri May 18 03:30:50 2012 (r235597) +++ head/sys/amd64/amd64/pmap.c Fri May 18 05:36:04 2012 (r235598) @@ -201,6 +201,7 @@ static u_int64_t DMPDPphys; /* phys addr /* * Data for the pv entry allocation mechanism */ +static TAILQ_HEAD(pch, pv_chunk) pv_chunks = TAILQ_HEAD_INITIALIZER(pv_chunks); static long pv_entry_count; static struct md_page *pv_table; @@ -2028,71 +2029,136 @@ SYSCTL_LONG(_vm_pmap, OID_AUTO, pv_entry "Current number of pv entry allocs"); SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_spare, CTLFLAG_RD, &pv_entry_spare, 0, "Current number of spare pv entries"); - -static int pmap_collect_inactive, pmap_collect_active; - -SYSCTL_INT(_vm_pmap, OID_AUTO, pmap_collect_inactive, CTLFLAG_RD, &pmap_collect_inactive, 0, - "Current number times pmap_collect called on inactive queue"); -SYSCTL_INT(_vm_pmap, OID_AUTO, pmap_collect_active, CTLFLAG_RD, &pmap_collect_active, 0, - "Current number times pmap_collect called on active queue"); #endif /* * We are in a serious low memory condition. Resort to * drastic measures to free some pages so we can allocate - * another pv entry chunk. This is normally called to - * unmap inactive pages, and if necessary, active pages. + * another pv entry chunk. * * We do not, however, unmap 2mpages because subsequent accesses will * allocate per-page pv entries until repromotion occurs, thereby * exacerbating the shortage of free pv entries. */ -static void -pmap_collect(pmap_t locked_pmap, struct vpgqueues *vpq) +static vm_page_t +pmap_pv_reclaim(pmap_t locked_pmap) { + struct pch newtail; + struct pv_chunk *pc; + struct md_page *pvh; pd_entry_t *pde; pmap_t pmap; pt_entry_t *pte, tpte; - pv_entry_t next_pv, pv; + pv_entry_t pv; vm_offset_t va; - vm_page_t m, free; - - TAILQ_FOREACH(m, &vpq->pl, pageq) { - if ((m->flags & PG_MARKER) != 0 || m->hold_count || m->busy) - continue; - TAILQ_FOREACH_SAFE(pv, &m->md.pv_list, pv_list, next_pv) { - va = pv->pv_va; - pmap = PV_PMAP(pv); + vm_page_t free, m; + uint64_t inuse, freemask; + int bit, field, freed; + + mtx_assert(&vm_page_queue_mtx, MA_OWNED); + PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED); + pmap = NULL; + free = m = NULL; + TAILQ_INIT(&newtail); + while ((pc = TAILQ_FIRST(&pv_chunks)) != NULL && free == NULL) { + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); + if (pmap != pc->pc_pmap) { + if (pmap != NULL) { + pmap_invalidate_all(pmap); + if (pmap != locked_pmap) + PMAP_UNLOCK(pmap); + } + pmap = pc->pc_pmap; /* Avoid deadlock and lock recursion. */ if (pmap > locked_pmap) PMAP_LOCK(pmap); - else if (pmap != locked_pmap && !PMAP_TRYLOCK(pmap)) + else if (pmap != locked_pmap && !PMAP_TRYLOCK(pmap)) { + pmap = NULL; + TAILQ_INSERT_TAIL(&newtail, pc, pc_lru); continue; - pmap_resident_count_dec(pmap, 1); - pde = pmap_pde(pmap, va); - KASSERT((*pde & PG_PS) == 0, ("pmap_collect: found" - " a 2mpage in page %p's pv list", m)); - pte = pmap_pde_to_pte(pde, va); - tpte = pte_load_clear(pte); - KASSERT((tpte & PG_W) == 0, - ("pmap_collect: wired pte %#lx", tpte)); - if (tpte & PG_A) - vm_page_aflag_set(m, PGA_REFERENCED); - if ((tpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) - vm_page_dirty(m); - free = NULL; - pmap_unuse_pt(pmap, va, *pde, &free); - pmap_invalidate_page(pmap, va); - pmap_free_zero_pages(free); - TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); - free_pv_entry(pmap, pv); - if (pmap != locked_pmap) - PMAP_UNLOCK(pmap); + } } - if (TAILQ_EMPTY(&m->md.pv_list) && - TAILQ_EMPTY(&pa_to_pvh(VM_PAGE_TO_PHYS(m))->pv_list)) - vm_page_aflag_clear(m, PGA_WRITEABLE); + + /* + * Destroy every non-wired, 4 KB page mapping in the chunk. + */ + freed = 0; + for (field = 0; field < _NPCM; field++) { + freemask = 0; + for (inuse = ~pc->pc_map[field] & pc_freemask[field]; + inuse != 0; inuse &= ~(1UL << bit)) { + bit = bsfq(inuse); + pv = &pc->pc_pventry[field * 64 + bit]; + va = pv->pv_va; + pde = pmap_pde(pmap, va); + if ((*pde & PG_PS) != 0) + continue; + pte = pmap_pde_to_pte(pde, va); + if ((*pte & PG_W) != 0) + continue; + tpte = pte_load_clear(pte); + if ((tpte & PG_G) != 0) + pmap_invalidate_page(pmap, va); + m = PHYS_TO_VM_PAGE(tpte & PG_FRAME); + if ((tpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) + vm_page_dirty(m); + if ((tpte & PG_A) != 0) + vm_page_aflag_set(m, PGA_REFERENCED); + TAILQ_REMOVE(&m->md.pv_list, pv, pv_list); + if (TAILQ_EMPTY(&m->md.pv_list) && + (m->flags & PG_FICTITIOUS) == 0) { + pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); + if (TAILQ_EMPTY(&pvh->pv_list)) { + vm_page_aflag_clear(m, + PGA_WRITEABLE); + } + } + pmap_unuse_pt(pmap, va, *pde, &free); + freemask |= 1UL << bit; + freed++; + } + pc->pc_map[field] |= freemask; + } + if (freed == 0) { + TAILQ_INSERT_TAIL(&newtail, pc, pc_lru); + continue; + } + pmap_resident_count_dec(pmap, freed); + PV_STAT(pv_entry_frees += freed); + PV_STAT(pv_entry_spare += freed); + pv_entry_count -= freed; + TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); + if (pc->pc_map[0] == PC_FREE0 && pc->pc_map[1] == PC_FREE1 && + pc->pc_map[2] == PC_FREE2) { + PV_STAT(pv_entry_spare -= _NPCPV); + PV_STAT(pc_chunk_count--); + PV_STAT(pc_chunk_frees++); + /* Entire chunk is free; return it. */ + m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); + dump_drop_page(m->phys_addr); + break; + } + TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); + TAILQ_INSERT_TAIL(&newtail, pc, pc_lru); + /* One freed pv entry in locked_pmap is sufficient. */ + if (pmap == locked_pmap) + break; + } + TAILQ_CONCAT(&pv_chunks, &newtail, pc_lru); + if (pmap != NULL) { + pmap_invalidate_all(pmap); + if (pmap != locked_pmap) + PMAP_UNLOCK(pmap); + } + if (m == NULL && free != NULL) { + m = free; + free = m->right; + /* Recycle a freed page table page. */ + m->wire_count = 1; + atomic_add_int(&cnt.v_wire_count, 1); } + pmap_free_zero_pages(free); + return (m); } /* @@ -2125,6 +2191,7 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv return; } TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); PV_STAT(pv_entry_spare -= _NPCPV); PV_STAT(pc_chunk_count--); PV_STAT(pc_chunk_frees++); @@ -2142,7 +2209,6 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv static pv_entry_t get_pv_entry(pmap_t pmap, boolean_t try) { - struct vpgqueues *pq; int bit, field; pv_entry_t pv; struct pv_chunk *pc; @@ -2151,7 +2217,6 @@ get_pv_entry(pmap_t pmap, boolean_t try) PMAP_LOCK_ASSERT(pmap, MA_OWNED); mtx_assert(&vm_page_queue_mtx, MA_OWNED); PV_STAT(pv_entry_allocs++); - pq = NULL; retry: pc = TAILQ_FIRST(&pmap->pm_pvchunk); if (pc != NULL) { @@ -2171,35 +2236,26 @@ retry: TAILQ_INSERT_TAIL(&pmap->pm_pvchunk, pc, pc_list); } + if (pc != TAILQ_LAST(&pv_chunks, pch)) { + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); + TAILQ_INSERT_TAIL(&pv_chunks, pc, pc_lru); + } pv_entry_count++; PV_STAT(pv_entry_spare--); return (pv); } } /* No free items, allocate another chunk */ - m = vm_page_alloc(NULL, 0, (pq == &vm_page_queues[PQ_ACTIVE] ? - VM_ALLOC_SYSTEM : VM_ALLOC_NORMAL) | VM_ALLOC_NOOBJ | + m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); if (m == NULL) { if (try) { PV_STAT(pc_chunk_tryfail++); return (NULL); } - /* - * Reclaim pv entries: At first, destroy mappings to inactive - * pages. After that, if a pv chunk entry is still needed, - * destroy mappings to active pages. - */ - if (pq == NULL) { - PV_STAT(pmap_collect_inactive++); - pq = &vm_page_queues[PQ_INACTIVE]; - } else if (pq == &vm_page_queues[PQ_INACTIVE]) { - PV_STAT(pmap_collect_active++); - pq = &vm_page_queues[PQ_ACTIVE]; - } else - panic("get_pv_entry: allocation failed"); - pmap_collect(pmap, pq); - goto retry; + m = pmap_pv_reclaim(pmap); + if (m == NULL) + goto retry; } PV_STAT(pc_chunk_count++); PV_STAT(pc_chunk_allocs++); @@ -2209,6 +2265,7 @@ retry: pc->pc_map[0] = PC_FREE0 & ~1ul; /* preallocated bit 0 */ pc->pc_map[1] = PC_FREE1; pc->pc_map[2] = PC_FREE2; + TAILQ_INSERT_TAIL(&pv_chunks, pc, pc_lru); pv = &pc->pc_pventry[0]; TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); pv_entry_count++; @@ -4151,6 +4208,7 @@ pmap_remove_pages(pmap_t pmap) PV_STAT(pc_chunk_count--); PV_STAT(pc_chunk_frees++); TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); + TAILQ_REMOVE(&pv_chunks, pc, pc_lru); m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); dump_drop_page(m->phys_addr); vm_page_unwire(m, 0); Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Fri May 18 03:30:50 2012 (r235597) +++ head/sys/amd64/include/pmap.h Fri May 18 05:36:04 2012 (r235598) @@ -295,7 +295,7 @@ struct pv_chunk { pmap_t pc_pmap; TAILQ_ENTRY(pv_chunk) pc_list; uint64_t pc_map[_NPCM]; /* bitmap; 1 = free */ - uint64_t pc_spare[2]; + TAILQ_ENTRY(pv_chunk) pc_lru; struct pv_entry pc_pventry[_NPCPV]; }; From owner-svn-src-head@FreeBSD.ORG Fri May 18 06:30:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F777106566B; Fri, 18 May 2012 06:30:36 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mexforwardwc.lss.emc.com (mexforwardwc.lss.emc.com [137.69.117.200]) by mx1.freebsd.org (Postfix) with ESMTP id 35E678FC08; Fri, 18 May 2012 06:30:36 +0000 (UTC) Received: from scl02-01d02-si01.isus.emc.com (scl02-01d02-si01.isus.emc.com [137.69.225.84]) by mexforwardwc.lss.emc.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id q4I6UUPM024167 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 May 2012 23:30:30 -0700 Received: from mailhubwc.lss.emc.com (mailhubscprd03.lss.emc.com [137.69.224.145]) by scl02-01d02-si01.isus.emc.com (RSA Interceptor); Thu, 17 May 2012 23:30:17 -0700 Received: from seacasht02.desktop.isilon.com (seacasht02.isilon.com [137.69.159.81]) by mailhubwc.lss.emc.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id q4I6UHUt021306; Thu, 17 May 2012 23:30:17 -0700 Received: from seaxch12.isilon.com (137.69.158.60) by SEACASHT02.desktop.isilon.com (137.69.159.81) with Microsoft SMTP Server id 14.1.355.2; Thu, 17 May 2012 23:30:16 -0700 Received: from [137.69.152.66] ([137.69.152.66]) by seaxch12.isilon.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 17 May 2012 23:22:36 -0700 MIME-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset="windows-1252" From: Garrett Cooper In-Reply-To: <201111180305.pAI35LtC045952@svn.freebsd.org> Date: Thu, 17 May 2012 23:22:38 -0700 Content-Transfer-Encoding: quoted-printable Message-ID: <9AD9BD15-BC6A-4A85-A7BE-EE315AB39ECF@gmail.com> References: <201111180305.pAI35LtC045952@svn.freebsd.org> To: Kevin Lo X-Mailer: Apple Mail (2.1257) X-OriginalArrivalTime: 18 May 2012 06:22:36.0594 (UTC) FILETIME=[9E2F4120:01CD34BE] X-EMM-MHVC: 1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r227650 - in head: lib/libkiconv sys/conf sys/fs/msdosfs sys/fs/smbfs sys/kern sys/libkern sys/modules/libiconv sys/modules/libmchain sys/netsmb sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 06:30:36 -0000 On Nov 17, 2011, at 7:05 PM, Kevin Lo wrote: > Author: kevlo > Date: Fri Nov 18 03:05:20 2011 > New Revision: 227650 > URL: http://svn.freebsd.org/changeset/base/227650 >=20 > Log: > Add unicode support to msdosfs and smbfs; original pathes from imura, > bug fixes by Kuan-Chung Chiu . >=20 > Tested by me in production for several days at work. Some of the code in this commit breaks unloading of the libiconv module = (it hard locks on unload). In particular if I do the following=85 Index: /root/current/sys/libkern/iconv_ucs.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /root/current/sys/libkern/iconv_ucs.c (revision 235066) +++ /root/current/sys/libkern/iconv_ucs.c (working copy) @@ -373,6 +373,7 @@ static int iconv_ucs_init(struct iconv_converter_class *dcp) { +#if 0 int error; =20 error =3D iconv_add(ENCODING_UNICODE, ENCODING_UNICODE, = ENCODING_UTF8); @@ -381,6 +382,7 @@ error =3D iconv_add(ENCODING_UNICODE, ENCODING_UTF8, = ENCODING_UNICODE); if (error) return (error); +#endif return (0); } =20 Then unload works (maybe at the cost of leaking a converter or = two). It seems that iconv_unregister_handler succeeds when it's called = (I inserted some printfs just because), but it might be doing bad things = because of restructuring that took place in this commit. Thanks! -Garrett PS Committing kern/168095 beforehand may or may not help...= From owner-svn-src-head@FreeBSD.ORG Fri May 18 09:19:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5AC86106564A; Fri, 18 May 2012 09:19:08 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C4A98FC17; Fri, 18 May 2012 09:19:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4I9J8xn042968; Fri, 18 May 2012 09:19:08 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4I9J7BB042965; Fri, 18 May 2012 09:19:07 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201205180919.q4I9J7BB042965@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 18 May 2012 09:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235599 - head/sys/geom/mirror X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 09:19:08 -0000 Author: ae Date: Fri May 18 09:19:07 2012 New Revision: 235599 URL: http://svn.freebsd.org/changeset/base/235599 Log: Introduce new device flag G_MIRROR_DEVICE_FLAG_TASTING. It should protect geom from destroying while it is tasting. PR: kern/154860 Reviewed by: pjd MFC after: 1 week Modified: head/sys/geom/mirror/g_mirror.c head/sys/geom/mirror/g_mirror.h Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Fri May 18 05:36:04 2012 (r235598) +++ head/sys/geom/mirror/g_mirror.c Fri May 18 09:19:07 2012 (r235599) @@ -1693,6 +1693,8 @@ g_mirror_can_destroy(struct g_mirror_sof gp = sc->sc_geom; if (gp->softc == NULL) return (1); + if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_TASTING) != 0) + return (0); LIST_FOREACH(cp, &gp->consumer, consumer) { if (g_mirror_is_busy(sc, cp)) return (0); @@ -3054,6 +3056,7 @@ g_mirror_taste(struct g_class *mp, struc G_MIRROR_DEBUG(1, "Adding disk %s to %s.", pp->name, gp->name); g_topology_unlock(); sx_xlock(&sc->sc_lock); + sc->sc_flags |= G_MIRROR_DEVICE_FLAG_TASTING; error = g_mirror_add_disk(sc, pp, &md); if (error != 0) { G_MIRROR_DEBUG(0, "Cannot add disk %s to %s (error=%d).", @@ -3066,6 +3069,12 @@ g_mirror_taste(struct g_class *mp, struc } gp = NULL; } + sc->sc_flags &= ~G_MIRROR_DEVICE_FLAG_TASTING; + if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) { + g_mirror_destroy(sc, G_MIRROR_DESTROY_HARD); + g_topology_lock(); + return (NULL); + } sx_xunlock(&sc->sc_lock); g_topology_lock(); return (gp); Modified: head/sys/geom/mirror/g_mirror.h ============================================================================== --- head/sys/geom/mirror/g_mirror.h Fri May 18 05:36:04 2012 (r235598) +++ head/sys/geom/mirror/g_mirror.h Fri May 18 09:19:07 2012 (r235599) @@ -157,6 +157,7 @@ struct g_mirror_event { #define G_MIRROR_DEVICE_FLAG_DESTROY 0x0100000000000000ULL #define G_MIRROR_DEVICE_FLAG_WAIT 0x0200000000000000ULL #define G_MIRROR_DEVICE_FLAG_DESTROYING 0x0400000000000000ULL +#define G_MIRROR_DEVICE_FLAG_TASTING 0x0800000000000000ULL #define G_MIRROR_DEVICE_STATE_STARTING 0 #define G_MIRROR_DEVICE_STATE_RUNNING 1 From owner-svn-src-head@FreeBSD.ORG Fri May 18 09:22:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C36481065673; Fri, 18 May 2012 09:22:21 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFE068FC0A; Fri, 18 May 2012 09:22:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4I9MLk7043110; Fri, 18 May 2012 09:22:21 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4I9MLqO043108; Fri, 18 May 2012 09:22:21 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201205180922.q4I9MLqO043108@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 18 May 2012 09:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235600 - head/sys/geom/mirror X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 09:22:21 -0000 Author: ae Date: Fri May 18 09:22:21 2012 New Revision: 235600 URL: http://svn.freebsd.org/changeset/base/235600 Log: Prevent removing of the last active component from a mirror. PR: kern/154860 Reviewed by: pjd MFC after: 1 week Modified: head/sys/geom/mirror/g_mirror_ctl.c Modified: head/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- head/sys/geom/mirror/g_mirror_ctl.c Fri May 18 09:19:07 2012 (r235599) +++ head/sys/geom/mirror/g_mirror_ctl.c Fri May 18 09:22:21 2012 (r235600) @@ -560,7 +560,7 @@ g_mirror_ctl_remove(struct gctl_req *req const char *name; char param[16]; int *nargs; - u_int i; + u_int i, active; nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { @@ -587,6 +587,7 @@ g_mirror_ctl_remove(struct gctl_req *req "first."); return; } + active = g_mirror_ndisks(sc, G_MIRROR_DISK_STATE_ACTIVE); for (i = 1; i < (u_int)*nargs; i++) { snprintf(param, sizeof(param), "arg%u", i); name = gctl_get_asciiparam(req, param); @@ -599,6 +600,16 @@ g_mirror_ctl_remove(struct gctl_req *req gctl_error(req, "No such provider: %s.", name); continue; } + if (disk->d_state == G_MIRROR_DISK_STATE_ACTIVE) { + if (active > 1) + active--; + else { + gctl_error(req, "%s: Can't remove the last " + "ACTIVE component %s.", sc->sc_geom->name, + name); + continue; + } + } g_mirror_event_send(disk, G_MIRROR_DISK_STATE_DESTROY, G_MIRROR_EVENT_DONTWAIT); } From owner-svn-src-head@FreeBSD.ORG Fri May 18 09:56:23 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14E3E1065670; Fri, 18 May 2012 09:56:23 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id 996178FC0C; Fri, 18 May 2012 09:56:22 +0000 (UTC) Received: from [127.0.0.1] (git.kevlo.org [220.128.136.52]) by ns.kevlo.org (8.14.5/8.14.5) with ESMTP id q4I9uIlE006475; Fri, 18 May 2012 17:56:19 +0800 (CST) (envelope-from kevlo@FreeBSD.org) Message-ID: <1337334980.2286.24.camel@nsl> From: Kevin Lo To: Garrett Cooper Date: Fri, 18 May 2012 17:56:20 +0800 In-Reply-To: <9AD9BD15-BC6A-4A85-A7BE-EE315AB39ECF@gmail.com> References: <201111180305.pAI35LtC045952@svn.freebsd.org> <9AD9BD15-BC6A-4A85-A7BE-EE315AB39ECF@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 8bit Mime-Version: 1.0 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r227650 - in head: lib/libkiconv sys/conf sys/fs/msdosfs sys/fs/smbfs sys/kern sys/libkern sys/modules/libiconv sys/modules/libmchain sys/netsmb sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 09:56:23 -0000 Garrett Cooper wrote: > On Nov 17, 2011, at 7:05 PM, Kevin Lo wrote: > > > Author: kevlo > > Date: Fri Nov 18 03:05:20 2011 > > New Revision: 227650 > > URL: http://svn.freebsd.org/changeset/base/227650 > > > > Log: > > Add unicode support to msdosfs and smbfs; original pathes from imura, > > bug fixes by Kuan-Chung Chiu . > > > > Tested by me in production for several days at work. > > Some of the code in this commit breaks unloading of the libiconv module (it hard locks on unload). In particular if I do the following… Hmm, I have a machine running FreeBSD but not included r227650. Trying to unload libiconv.ko, I get the message: kldunload: attempt to unload file that was loaded by the kernel kldunload: can't unload file: Device busy > > Index: /root/current/sys/libkern/iconv_ucs.c > =================================================================== > --- /root/current/sys/libkern/iconv_ucs.c (revision 235066) > +++ /root/current/sys/libkern/iconv_ucs.c (working copy) > @@ -373,6 +373,7 @@ > static int > iconv_ucs_init(struct iconv_converter_class *dcp) > { > +#if 0 > int error; > > error = iconv_add(ENCODING_UNICODE, ENCODING_UNICODE, ENCODING_UTF8); > @@ -381,6 +382,7 @@ > error = iconv_add(ENCODING_UNICODE, ENCODING_UTF8, ENCODING_UNICODE); > if (error) > return (error); > +#endif > return (0); > } > > Then unload works (maybe at the cost of leaking a converter or two). It seems that iconv_unregister_handler succeeds when it's called (I inserted some printfs just because), but it might be doing bad things because of restructuring that took place in this commit. > Thanks! > -Garrett > > PS Committing kern/168095 beforehand may or may not help... Kevin From owner-svn-src-head@FreeBSD.ORG Fri May 18 10:01:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C65AF106566B; Fri, 18 May 2012 10:01:31 +0000 (UTC) (envelope-from gleb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B19808FC24; Fri, 18 May 2012 10:01:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4IA1Vet044376; Fri, 18 May 2012 10:01:31 GMT (envelope-from gleb@svn.freebsd.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4IA1VED044374; Fri, 18 May 2012 10:01:31 GMT (envelope-from gleb@svn.freebsd.org) Message-Id: <201205181001.q4IA1VED044374@svn.freebsd.org> From: Gleb Kurtsou Date: Fri, 18 May 2012 10:01:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235601 - head/include/protocols X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 10:01:31 -0000 Author: gleb Date: Fri May 18 10:01:31 2012 New Revision: 235601 URL: http://svn.freebsd.org/changeset/base/235601 Log: Don't use ino_t in dumprestore protocol definition. Since ino_t size is about to change to 64-bits, replace ino_t used in dump protocol definition with 32-bit dump_ino_t to preserve backward compatibility. At some point, it may be necessary to use spare fields in struct in order to fully support 64-bit inode numbers. Sponsored by: Google Summer of Code 2011 Modified: head/include/protocols/dumprestore.h Modified: head/include/protocols/dumprestore.h ============================================================================== --- head/include/protocols/dumprestore.h Fri May 18 09:22:21 2012 (r235600) +++ head/include/protocols/dumprestore.h Fri May 18 10:01:31 2012 (r235601) @@ -65,6 +65,15 @@ #endif #define CHECKSUM (int)84446 +/* + * Since ino_t size is changing to 64-bits, yet we desire this structure to + * remain compatible with exiting dump formats, we do NOT use ino_t here, + * but rather define a 32-bit type in its place. At some point, it may be + * necessary to use some of the c_spare[] in order to fully support 64-bit + * inode numbers. + */ +typedef uint32_t dump_ino_t; + union u_spcl { char dummy[TP_BSIZE]; struct s_spcl { @@ -73,7 +82,7 @@ union u_spcl { int32_t c_old_ddate; /* date of previous dump */ int32_t c_volume; /* dump volume number */ int32_t c_old_tapea; /* logical block of this record */ - ino_t c_inumber; /* number of inode */ + dump_ino_t c_inumber; /* number of inode */ int32_t c_magic; /* magic number (see above) */ int32_t c_checksum; /* record checksum */ /* From owner-svn-src-head@FreeBSD.ORG Fri May 18 10:10:06 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EC19B106564A; Fri, 18 May 2012 10:10:05 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id 601EB8FC14; Fri, 18 May 2012 10:10:05 +0000 (UTC) Received: from [127.0.0.1] (git.kevlo.org [220.128.136.52]) by ns.kevlo.org (8.14.5/8.14.5) with ESMTP id q4IAA2Tu006558; Fri, 18 May 2012 18:10:02 +0800 (CST) (envelope-from kevlo@FreeBSD.org) Message-ID: <1337335804.2286.28.camel@nsl> From: Kevin Lo To: Garrett Cooper Date: Fri, 18 May 2012 18:10:04 +0800 In-Reply-To: <1337334980.2286.24.camel@nsl> References: <201111180305.pAI35LtC045952@svn.freebsd.org> <9AD9BD15-BC6A-4A85-A7BE-EE315AB39ECF@gmail.com> <1337334980.2286.24.camel@nsl> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 8bit Mime-Version: 1.0 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r227650 - in head: lib/libkiconv sys/conf sys/fs/msdosfs sys/fs/smbfs sys/kern sys/libkern sys/modules/libiconv sys/modules/libmchain sys/netsmb sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 10:10:06 -0000 Kevin Lo wrote: > Garrett Cooper wrote: > > On Nov 17, 2011, at 7:05 PM, Kevin Lo wrote: > > > > > Author: kevlo > > > Date: Fri Nov 18 03:05:20 2011 > > > New Revision: 227650 > > > URL: http://svn.freebsd.org/changeset/base/227650 > > > > > > Log: > > > Add unicode support to msdosfs and smbfs; original pathes from imura, > > > bug fixes by Kuan-Chung Chiu . > > > > > > Tested by me in production for several days at work. > > > > Some of the code in this commit breaks unloading of the libiconv module (it hard locks on unload). In particular if I do the following… > > Hmm, I have a machine running FreeBSD but not included r227650. > Trying to unload libiconv.ko, I get the message: > > kldunload: attempt to unload file that was loaded by the kernel > kldunload: can't unload file: Device busy Ah I spoke too soon. It seems this commit does break unloading libiconv. I'll take a look at it, thanks. > > > > Index: /root/current/sys/libkern/iconv_ucs.c > > =================================================================== > > --- /root/current/sys/libkern/iconv_ucs.c (revision 235066) > > +++ /root/current/sys/libkern/iconv_ucs.c (working copy) > > @@ -373,6 +373,7 @@ > > static int > > iconv_ucs_init(struct iconv_converter_class *dcp) > > { > > +#if 0 > > int error; > > > > error = iconv_add(ENCODING_UNICODE, ENCODING_UNICODE, ENCODING_UTF8); > > @@ -381,6 +382,7 @@ > > error = iconv_add(ENCODING_UNICODE, ENCODING_UTF8, ENCODING_UNICODE); > > if (error) > > return (error); > > +#endif > > return (0); > > } > > > > Then unload works (maybe at the cost of leaking a converter or two). It seems that iconv_unregister_handler succeeds when it's called (I inserted some printfs just because), but it might be doing bad things because of restructuring that took place in this commit. > > Thanks! > > -Garrett > > > > PS Committing kern/168095 beforehand may or may not help... From owner-svn-src-head@FreeBSD.ORG Fri May 18 10:15:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0B81C1065673; Fri, 18 May 2012 10:15:47 +0000 (UTC) (envelope-from gleb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D197C8FC08; Fri, 18 May 2012 10:15:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4IAFktZ044828; Fri, 18 May 2012 10:15:46 GMT (envelope-from gleb@svn.freebsd.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4IAFkuA044824; Fri, 18 May 2012 10:15:46 GMT (envelope-from gleb@svn.freebsd.org) Message-Id: <201205181015.q4IAFkuA044824@svn.freebsd.org> From: Gleb Kurtsou Date: Fri, 18 May 2012 10:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235602 - in head: lib/libprocstat usr.bin/fstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 10:15:47 -0000 Author: gleb Date: Fri May 18 10:15:46 2012 New Revision: 235602 URL: http://svn.freebsd.org/changeset/base/235602 Log: Don't cast inode number or file size down to long or unsigned. Since ino_t size is about to change to 64-bits, casts to long would truncate 64-bit numbers on 32-bit archs. Sponsored by: Google Summer of Code 2011 Modified: head/lib/libprocstat/cd9660.c head/lib/libprocstat/common_kvm.c head/usr.bin/fstat/fstat.c Modified: head/lib/libprocstat/cd9660.c ============================================================================== --- head/lib/libprocstat/cd9660.c Fri May 18 10:01:31 2012 (r235601) +++ head/lib/libprocstat/cd9660.c Fri May 18 10:15:46 2012 (r235602) @@ -84,7 +84,7 @@ isofs_filestat(kvm_t *kd, struct vnode * } vn->vn_fsid = dev2udev(kd, mnt.im_dev); vn->vn_mode = (mode_t)isonode.inode.iso_mode; - vn->vn_fileid = (long)isonode.i_number; - vn->vn_size = (u_long)isonode.i_size; + vn->vn_fileid = isonode.i_number; + vn->vn_size = isonode.i_size; return (0); } Modified: head/lib/libprocstat/common_kvm.c ============================================================================== --- head/lib/libprocstat/common_kvm.c Fri May 18 10:01:31 2012 (r235601) +++ head/lib/libprocstat/common_kvm.c Fri May 18 10:15:46 2012 (r235602) @@ -99,9 +99,9 @@ ufs_filestat(kvm_t *kd, struct vnode *vp * comparisons */ vn->vn_fsid = dev2udev(kd, inode.i_dev); - vn->vn_fileid = (long)inode.i_number; + vn->vn_fileid = inode.i_number; vn->vn_mode = (mode_t)inode.i_mode; - vn->vn_size = (u_long)inode.i_size; + vn->vn_size = inode.i_size; return (0); } Modified: head/usr.bin/fstat/fstat.c ============================================================================== --- head/usr.bin/fstat/fstat.c Fri May 18 10:01:31 2012 (r235601) +++ head/usr.bin/fstat/fstat.c Fri May 18 10:15:46 2012 (r235602) @@ -244,7 +244,7 @@ print_file_info(struct procstat *procsta for (d = devs; d != NULL; d = d->next) if (d->fsid == vn.vn_fsid) { fsmatch = 1; - if ((unsigned)d->ino == vn.vn_fileid) { + if (d->ino == vn.vn_fileid) { filename = d->name; break; } From owner-svn-src-head@FreeBSD.ORG Fri May 18 10:23:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74A761065677; Fri, 18 May 2012 10:23:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FEB28FC0A; Fri, 18 May 2012 10:23:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4IANm7p047644; Fri, 18 May 2012 10:23:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4IANmak047642; Fri, 18 May 2012 10:23:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205181023.q4IANmak047642@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 18 May 2012 10:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235603 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 10:23:48 -0000 Author: kib Date: Fri May 18 10:23:47 2012 New Revision: 235603 URL: http://svn.freebsd.org/changeset/base/235603 Log: Do not double-reference the found vm object in cdev_pager_lookup(). vm_pager_object_lookup() already referenced the object. Note that there is no in-tree consumers of cdev_pager_lookup(). The only known user of the function is i915 gem driver, which is not yet imported. This should make the KPI change minor. Submitted by: avg MFC after: 1 week Modified: head/sys/vm/device_pager.c Modified: head/sys/vm/device_pager.c ============================================================================== --- head/sys/vm/device_pager.c Fri May 18 10:15:46 2012 (r235602) +++ head/sys/vm/device_pager.c Fri May 18 10:23:47 2012 (r235603) @@ -111,7 +111,6 @@ cdev_pager_lookup(void *handle) mtx_lock(&dev_pager_mtx); object = vm_pager_object_lookup(&dev_pager_object_list, handle); - vm_object_reference(object); mtx_unlock(&dev_pager_mtx); return (object); } From owner-svn-src-head@FreeBSD.ORG Fri May 18 14:12:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04BF61065672; Fri, 18 May 2012 14:12:18 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5D6C8FC17; Fri, 18 May 2012 14:12:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4IECH2v056586; Fri, 18 May 2012 14:12:17 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4IECHN3056584; Fri, 18 May 2012 14:12:17 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201205181412.q4IECHN3056584@svn.freebsd.org> From: Grzegorz Bernacki Date: Fri, 18 May 2012 14:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235607 - head/usr.sbin/nandsim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 14:12:18 -0000 Author: gber Date: Fri May 18 14:12:17 2012 New Revision: 235607 URL: http://svn.freebsd.org/changeset/base/235607 Log: Add missing include. Modified: head/usr.sbin/nandsim/nandsim_cfgparse.c Modified: head/usr.sbin/nandsim/nandsim_cfgparse.c ============================================================================== --- head/usr.sbin/nandsim/nandsim_cfgparse.c Fri May 18 12:51:48 2012 (r235606) +++ head/usr.sbin/nandsim/nandsim_cfgparse.c Fri May 18 14:12:17 2012 (r235607) @@ -23,6 +23,8 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ + +#include __FBSDID("$FreeBSD$"); #include From owner-svn-src-head@FreeBSD.ORG Fri May 18 14:27:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E6031065673; Fri, 18 May 2012 14:27:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id D81878FC15; Fri, 18 May 2012 14:27:50 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 48C51B93B; Fri, 18 May 2012 10:27:50 -0400 (EDT) From: John Baldwin To: Gleb Kurtsou Date: Fri, 18 May 2012 09:41:48 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p13; KDE/4.5.5; amd64; ; ) References: <201205181001.q4IA1VED044374@svn.freebsd.org> In-Reply-To: <201205181001.q4IA1VED044374@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201205180941.48076.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 18 May 2012 10:27:50 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235601 - head/include/protocols X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 14:27:51 -0000 On Friday, May 18, 2012 6:01:31 am Gleb Kurtsou wrote: > Author: gleb > Date: Fri May 18 10:01:31 2012 > New Revision: 235601 > URL: http://svn.freebsd.org/changeset/base/235601 > > Log: > Don't use ino_t in dumprestore protocol definition. > > Since ino_t size is about to change to 64-bits, replace ino_t used in > dump protocol definition with 32-bit dump_ino_t to preserve backward > compatibility. At some point, it may be necessary to use spare fields > in struct in order to fully support 64-bit inode numbers. > > Sponsored by: Google Summer of Code 2011 A question about your stat changes: did you expand dev_t to 32 bits for the AFS folks, or did you leave it as 16 bits? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Fri May 18 14:41:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 666931065672; Fri, 18 May 2012 14:41:15 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46C3D8FC08; Fri, 18 May 2012 14:41:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4IEfFNt057789; Fri, 18 May 2012 14:41:15 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4IEfFqP057774; Fri, 18 May 2012 14:41:15 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201205181441.q4IEfFqP057774@svn.freebsd.org> From: Grzegorz Bernacki Date: Fri, 18 May 2012 14:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235609 - in head/sys: arm/conf arm/include arm/mv arm/mv/discovery boot/fdt/dts boot/uboot/lib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 14:41:15 -0000 Author: gber Date: Fri May 18 14:41:14 2012 New Revision: 235609 URL: http://svn.freebsd.org/changeset/base/235609 Log: Add architecture dependent code to support NAND Framework on Marvell SoCs. Obtained from: Semihalf Supported by: FreeBSD Foundation, Juniper Networks Added: head/sys/boot/fdt/dts/bindings-localbus.txt (contents, props changed) Modified: head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/SHEEVAPLUG head/sys/arm/include/fdt.h head/sys/arm/mv/discovery/discovery.c head/sys/arm/mv/files.mv head/sys/arm/mv/mv_machdep.c head/sys/arm/mv/mvwin.h head/sys/boot/fdt/dts/db78100.dts head/sys/boot/fdt/dts/db88f6281.dts head/sys/boot/fdt/dts/sheevaplug.dts head/sys/boot/uboot/lib/api_public.h head/sys/boot/uboot/lib/glue.c Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Fri May 18 14:29:54 2012 (r235608) +++ head/sys/arm/conf/DB-78XXX Fri May 18 14:41:14 2012 (r235609) @@ -17,6 +17,7 @@ options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols options FFS #Berkeley Fast Filesystem +options NANDFS #NAND Filesystem options NFSCL #New Network Filesystem Client options NFSLOCKD #Network Lock Manager options NFS_ROOT #NFS usable as /, requires NFSCL @@ -82,6 +83,10 @@ device ds133x # SATA device mvs +# NAND +device nand + # Flattened Device Tree options FDT +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=db78100.dts Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Fri May 18 14:29:54 2012 (r235608) +++ head/sys/arm/conf/DB-88F6XXX Fri May 18 14:41:14 2012 (r235609) @@ -17,6 +17,7 @@ options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols options FFS #Berkeley Fast Filesystem +options NANDFS #NAND Filesystem options NFSCL #New Network Filesystem Client options NFSLOCKD #Network Lock Manager options NFS_ROOT #NFS usable as /, requires NFSCL @@ -85,6 +86,10 @@ device iicbus # SATA device mvs +# NAND +device nand + # Flattened Device Tree options FDT +options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=db88f6281.dts Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Fri May 18 14:29:54 2012 (r235608) +++ head/sys/arm/conf/SHEEVAPLUG Fri May 18 14:41:14 2012 (r235609) @@ -17,6 +17,7 @@ options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #IPv6 communications protocols options FFS #Berkeley Fast Filesystem +options NANDFS #NAND Filesystem options NFSCL #New Network Filesystem Client options NFSLOCKD #Network Lock Manager options NFS_ROOT #NFS usable as /, requires NFSCL @@ -72,6 +73,9 @@ device scbus device pass device da +# NAND +device nand + # Flattened Device Tree options FDT options FDT_DTB_STATIC Modified: head/sys/arm/include/fdt.h ============================================================================== --- head/sys/arm/include/fdt.h Fri May 18 14:29:54 2012 (r235608) +++ head/sys/arm/include/fdt.h Fri May 18 14:41:14 2012 (r235609) @@ -57,6 +57,7 @@ struct mem_region { vm_size_t mr_size; }; +int fdt_localbus_devmap(phandle_t, struct pmap_devmap *, int, int *); int fdt_pci_devmap(phandle_t, struct pmap_devmap *devmap, vm_offset_t, vm_offset_t); Modified: head/sys/arm/mv/discovery/discovery.c ============================================================================== --- head/sys/arm/mv/discovery/discovery.c Fri May 18 14:29:54 2012 (r235608) +++ head/sys/arm/mv/discovery/discovery.c Fri May 18 14:41:14 2012 (r235609) @@ -43,6 +43,30 @@ __FBSDID("$FreeBSD$"); #include #include +/* + * Virtual address space layout: + * ----------------------------- + * 0x0000_0000 - 0xBFFF_FFFF : User Process (3 GB) + * 0xC000_0000 - virtual_avail : Kernel Reserved (text, data, page tables, + * : stack etc.) + * virtual-avail - 0xEFFF_FFFF : KVA (virtual_avail is typically < 0xc0a0_0000) + * 0xF000_0000 - 0xF0FF_FFFF : No-Cache allocation area (16 MB) + * 0xF100_0000 - 0xF10F_FFFF : SoC Integrated devices registers range (1 MB) + * 0xF110_0000 - 0xF11F_FFFF : PCI-Express I/O space (1MB) + * 0xF120_0000 - 0xF12F_FFFF : PCI I/O space (1MB) + * 0xF130_0000 - 0xF52F_FFFF : PCI-Express memory space (64MB) + * 0xF530_0000 - 0xF92F_FFFF : PCI memory space (64MB) + * 0xF930_0000 - 0xF93F_FFFF : Device Bus: BOOT (1 MB) + * 0xF940_0000 - 0xF94F_FFFF : Device Bus: CS0 (1 MB) + * 0xF950_0000 - 0xFB4F_FFFF : Device Bus: CS1 (32 MB) + * 0xFB50_0000 - 0xFB5F_FFFF : Device Bus: CS2 (1 MB) + * 0xFB60_0000 - 0xFFFE_FFFF : Unused (~74MB) + * 0xFFFF_0000 - 0xFFFF_0FFF : 'High' vectors page (4 kB) + * 0xFFFF_1000 - 0xFFFF_1FFF : ARM_TP_ADDRESS/RAS page (4 kB) + * 0xFFFF_2000 - 0xFFFF_FFFF : Unused (56 kB) + */ + + struct resource_spec mv_gpio_res[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, { SYS_RES_IRQ, 0, RF_ACTIVE }, Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Fri May 18 14:29:54 2012 (r235608) +++ head/sys/arm/mv/files.mv Fri May 18 14:41:14 2012 (r235609) @@ -22,6 +22,7 @@ arm/mv/bus_space.c standard arm/mv/common.c standard arm/mv/gpio.c standard arm/mv/ic.c standard +arm/mv/mv_localbus.c standard arm/mv/mv_machdep.c standard arm/mv/mv_pci.c optional pci arm/mv/mv_sata.c optional ata | atamvsata @@ -30,6 +31,7 @@ arm/mv/twsi.c optional iicbus dev/cesa/cesa.c optional cesa dev/mge/if_mge.c optional mge +dev/nand/nfc_mv.c optional nand dev/mvs/mvs_soc.c optional mvs dev/uart/uart_dev_ns8250.c optional uart dev/usb/controller/ehci_mv.c optional ehci Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Fri May 18 14:29:54 2012 (r235608) +++ head/sys/arm/mv/mv_machdep.c Fri May 18 14:41:14 2012 (r235609) @@ -314,7 +314,7 @@ initarm(void *mdp, void *unused __unused uint32_t memsize, l2size; void *kmdp; u_int l1pagetable; - int i = 0, j = 0; + int i = 0, j = 0, err_devmap = 0; kmdp = NULL; lastaddr = 0; @@ -496,8 +496,7 @@ initarm(void *mdp, void *unused __unused VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); /* Map pmap_devmap[] entries */ - if (platform_devmap_init() != 0) - while (1); + err_devmap = platform_devmap_init(); pmap_devmap_bootstrap(l1pagetable, pmap_devmap_bootstrap_table); cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | @@ -530,12 +529,17 @@ initarm(void *mdp, void *unused __unused print_kernel_section_addr(); print_kenv(); + if (err_devmap != 0) + printf("WARNING: could not fully configure devmap, error=%d\n", + err_devmap); + /* * Re-initialise decode windows */ if (soc_decode_win() != 0) printf("WARNING: could not re-initialise decode windows! " "Running with existing settings...\n"); + /* * Pages were allocated during the secondary bootstrap for the * stacks for different CPU modes. @@ -733,25 +737,34 @@ moveon: return (0); } -#define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) +#define FDT_DEVMAP_MAX (MV_WIN_CPU_MAX + 1) static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } }; /* + * XXX: When device entry in devmap has pd_size smaller than section size, + * system will freeze during initialization + */ + +/* * Construct pmap_devmap[] with DT-derived config data. */ + static int platform_devmap_init(void) { phandle_t root, child; + pcell_t bank_count; u_long base, size; - int i; + int i, num_mapped; + + i = 0; + pmap_devmap_bootstrap_table = &fdt_devmap[0]; /* * IMMR range. */ - i = 0; fdt_devmap[i].pd_va = fdt_immr_va; fdt_devmap[i].pd_pa = fdt_immr_pa; fdt_devmap[i].pd_size = fdt_immr_size; @@ -760,12 +773,12 @@ platform_devmap_init(void) i++; /* - * PCI range(s). + * PCI range(s) and localbus. */ if ((root = OF_finddevice("/")) == -1) return (ENXIO); - for (child = OF_child(root); child != 0; child = OF_peer(child)) + for (child = OF_child(root); child != 0; child = OF_peer(child)) { if (fdt_is_type(child, "pci")) { /* * Check space: each PCI node will consume 2 devmap @@ -773,7 +786,6 @@ platform_devmap_init(void) */ if (i + 1 >= FDT_DEVMAP_MAX) { return (ENOMEM); - break; } /* @@ -786,6 +798,29 @@ platform_devmap_init(void) i += 2; } + if (fdt_is_compatible(child, "mrvl,lbc")) { + /* Check available space */ + if (OF_getprop(child, "bank-count", (void *)&bank_count, + sizeof(bank_count)) <= 0) + /* If no property, use default value */ + bank_count = 1; + else + bank_count = fdt32_to_cpu(bank_count); + + if ((i + bank_count) >= FDT_DEVMAP_MAX) + return (ENOMEM); + + /* Add all localbus ranges to device map */ + num_mapped = 0; + + if (fdt_localbus_devmap(child, &fdt_devmap[i], + (int)bank_count, &num_mapped) != 0) + return (ENXIO); + + i += num_mapped; + } + } + /* * CESA SRAM range. */ @@ -795,7 +830,7 @@ platform_devmap_init(void) if ((child = fdt_find_compatible(root, "mrvl,cesa-sram", 0)) == 0) /* No CESA SRAM node. */ - goto out; + return (0); moveon: if (i >= FDT_DEVMAP_MAX) return (ENOMEM); @@ -809,8 +844,6 @@ moveon: fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; fdt_devmap[i].pd_cache = PTE_NOCACHE; -out: - pmap_devmap_bootstrap_table = &fdt_devmap[0]; return (0); } Modified: head/sys/arm/mv/mvwin.h ============================================================================== --- head/sys/arm/mv/mvwin.h Fri May 18 14:29:54 2012 (r235608) +++ head/sys/arm/mv/mvwin.h Fri May 18 14:41:14 2012 (r235609) @@ -57,20 +57,17 @@ #define MV_PCI_MEM_BASE MV_PCI_MEM_PHYS_BASE #define MV_PCI_MEM_SIZE (64 * 1024 * 1024) -/* XXX DEV_BOOT, CSx are board specific, should be defined per platform */ +#define MV_DEV_BOOT_BASE 0xF9300000 +#define MV_DEV_BOOT_SIZE (1024 * 1024) /* 1 MB */ -/* 512KB NOR FLASH */ -#define MV_DEV_BOOT_PHYS_BASE (MV_PCI_MEM_PHYS_BASE + MV_PCI_MEM_SIZE) -#define MV_DEV_BOOT_SIZE (512 * 1024) -/* CS0: 7-seg LED */ -#define MV_DEV_CS0_PHYS_BASE 0xFA000000 -#define MV_DEV_CS0_SIZE (1024 * 1024) /* XXX u-boot has 2MB */ -/* CS1: 32MB NOR FLASH */ -#define MV_DEV_CS1_PHYS_BASE (MV_DEV_CS0_PHYS_BASE + MV_DEV_CS0_SIZE) -#define MV_DEV_CS1_SIZE (32 * 1024 * 1024) -/* CS2: 32MB NAND FLASH */ -#define MV_DEV_CS2_PHYS_BASE (MV_DEV_CS1_PHYS_BASE + MV_DEV_CS1_SIZE) -#define MV_DEV_CS2_SIZE 1024 /* XXX u-boot has 1MB */ +#define MV_DEV_CS0_BASE 0xF9400000 +#define MV_DEV_CS0_SIZE (1024 * 1024) /* 1 MB */ + +#define MV_DEV_CS1_BASE 0xF9500000 +#define MV_DEV_CS1_SIZE (32 * 1024 * 1024) /* 32 MB */ + +#define MV_DEV_CS2_BASE 0xFB500000 +#define MV_DEV_CS2_SIZE (1024 * 1024) /* 1 MB */ #define MV_CESA_SRAM_PHYS_BASE 0xFD000000 #define MV_CESA_SRAM_BASE MV_CESA_SRAM_PHYS_BASE /* VA == PA mapping */ @@ -107,8 +104,6 @@ #define MV_PCIE12_BASE (MV_PCIE_BASE + 0x48000) #define MV_PCIE13_BASE (MV_PCIE_BASE + 0x4C000) -#define MV_DEV_CS0_BASE MV_DEV_CS0_PHYS_BASE - /* * Decode windows definitions and macros */ Added: head/sys/boot/fdt/dts/bindings-localbus.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/bindings-localbus.txt Fri May 18 14:41:14 2012 (r235609) @@ -0,0 +1,83 @@ +$FreeBSD$ + +Marvell Device bus (localbus) configuration. +============================================ + +1. Properties for localbus nodes + +1.1 ranges + +Property: ranges + +Value type: encoded as arbitrary number of localbus + nodes specifiers. + +Description: ranges property defines values used for mapping devices + connected to localbus, in Marvell devices it is used also for + setting decoding windows. + + a) child node address-cells: + - first cell: number of bank (chip select) + - second cell: (Marvell devices) Target ID for decoding + windows setup + + b) parent node address cells: + - address offset: used with parent's node base address to + specify base address of mapped device + + c) child node size-cells: + - size: defines amount of memory that should be reserved for + device + +1.2 bank-count + +Property: bank-count + +Value type: + +Description: The bank_count property defines maximum number of banks on + localbus node. Bank is most often interpreted as device chip + select, but may also describe another device (e.g. SPI flash). + +1.3 Example + + localbus@0 { + #address-cells = <2>; + #size-cells = <1>; + compatible = "mrvl,lbc"; + bank-count = <5>; + + /* This reflects CPU decode windows setup. */ + ranges = <0x0 0x2f 0xb2200000 0x00100000 + 0x1 0x3e 0xb2100000 0x00100000 + 0x2 0x3d 0xb0000000 0x02000000 + 0x3 0x3b 0xb2000000 0x00100000>; + }; + +2. Properties for localbus consumer nodes: + +2.1 reg + +Property: reg + +Value type: + +Description: A standard property required for localbus child nodes. Defines + the device memory region. + + a) first cell: number of bank (chip select) + + b) address offset: used with address offset from parent's ranges + for corresponding bank to specify base address of + the device + + c) size: defines size of the device memory region + +2.2 Example + + nor@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x0 0x0 0x00100000>; + }; Modified: head/sys/boot/fdt/dts/db78100.dts ============================================================================== --- head/sys/boot/fdt/dts/db78100.dts Fri May 18 14:29:54 2012 (r235608) +++ head/sys/boot/fdt/dts/db78100.dts Fri May 18 14:41:14 2012 (r235609) @@ -69,25 +69,23 @@ reg = <0x0 0x20000000>; // 512M at 0x0 }; - localbus@f1000000 { + localbus@0 { #address-cells = <2>; #size-cells = <1>; compatible = "mrvl,lbc"; - win-count = <14>; + bank-count = <5>; /* This reflects CPU decode windows setup. */ - ranges = <0x0 0x0f 0xf9300000 0x00100000 - 0x1 0x1e 0xfa000000 0x00100000 - 0x2 0x1d 0xfa100000 0x02000000 - 0x3 0x1b 0xfc100000 0x00000400>; + ranges = <0x0 0x2f 0xf9300000 0x00100000 + 0x1 0x3e 0xf9400000 0x00100000 + 0x2 0x3d 0xf9500000 0x02000000 + 0x3 0x3b 0xfb500000 0x00100000>; nor@0,0 { #address-cells = <1>; #size-cells = <1>; compatible = "cfi-flash"; reg = <0x0 0x0 0x00100000>; - bank-width = <2>; - device-width = <1>; }; led@1,0 { @@ -102,16 +100,13 @@ #size-cells = <1>; compatible = "cfi-flash"; reg = <0x2 0x0 0x02000000>; - bank-width = <2>; - device-width = <1>; }; nand@3,0 { #address-cells = <1>; #size-cells = <1>; + compatible = "mrvl,nfc"; reg = <0x3 0x0 0x00100000>; - bank-width = <2>; - device-width = <1>; }; }; Modified: head/sys/boot/fdt/dts/db88f6281.dts ============================================================================== --- head/sys/boot/fdt/dts/db88f6281.dts Fri May 18 14:29:54 2012 (r235608) +++ head/sys/boot/fdt/dts/db88f6281.dts Fri May 18 14:41:14 2012 (r235609) @@ -72,48 +72,24 @@ reg = <0x0 0x20000000>; // 512M at 0x0 }; - localbus@f1000000 { + localbus@0 { #address-cells = <2>; #size-cells = <1>; compatible = "mrvl,lbc"; + bank-count = <3>; /* This reflects CPU decode windows setup. */ - ranges = <0x0 0x0f 0xf9300000 0x00100000 - 0x1 0x1e 0xfa000000 0x00100000 - 0x2 0x1d 0xfa100000 0x02000000 - 0x3 0x1b 0xfc100000 0x00000400>; + ranges = <0x0 0x2f 0xf9300000 0x00100000>; - nor@0,0 { + nand@0,0 { #address-cells = <1>; #size-cells = <1>; - compatible = "cfi-flash"; + compatible = "mrvl,nfc"; reg = <0x0 0x0 0x00100000>; bank-width = <2>; device-width = <1>; - }; - - led@1,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "led"; - reg = <0x1 0x0 0x00100000>; - }; - nor@2,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x2 0x0 0x02000000>; - bank-width = <2>; - device-width = <1>; - }; - nand@3,0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0x3 0x0 0x00100000>; - bank-width = <2>; - device-width = <1>; }; }; @@ -305,4 +281,9 @@ 0x0 0x00100000>; }; }; + + chosen { + stdin = "serial0"; + stdout = "serial0"; + }; }; Modified: head/sys/boot/fdt/dts/sheevaplug.dts ============================================================================== --- head/sys/boot/fdt/dts/sheevaplug.dts Fri May 18 14:29:54 2012 (r235608) +++ head/sys/boot/fdt/dts/sheevaplug.dts Fri May 18 14:41:14 2012 (r235609) @@ -71,48 +71,24 @@ reg = <0x0 0x20000000>; // 512M at 0x0 }; - localbus@f1000000 { + localbus@0 { #address-cells = <2>; #size-cells = <1>; compatible = "mrvl,lbc"; + bank-count = <3>; /* This reflects CPU decode windows setup. */ - ranges = <0x0 0x0f 0xf9300000 0x00100000 - 0x1 0x1e 0xfa000000 0x00100000 - 0x2 0x1d 0xfa100000 0x02000000 - 0x3 0x1b 0xfc100000 0x00000400>; + ranges = <0x0 0x2f 0xf9300000 0x00100000>; - nor@0,0 { + nand@0,0 { #address-cells = <1>; #size-cells = <1>; - compatible = "cfi-flash"; + compatible = "mrvl,nfc"; reg = <0x0 0x0 0x00100000>; bank-width = <2>; device-width = <1>; - }; - led@1,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "led"; - reg = <0x1 0x0 0x00100000>; - }; - - nor@2,0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "cfi-flash"; - reg = <0x2 0x0 0x02000000>; - bank-width = <2>; - device-width = <1>; - }; - nand@3,0 { - #address-cells = <1>; - #size-cells = <1>; - reg = <0x3 0x0 0x00100000>; - bank-width = <2>; - device-width = <1>; }; }; Modified: head/sys/boot/uboot/lib/api_public.h ============================================================================== --- head/sys/boot/uboot/lib/api_public.h Fri May 18 14:29:54 2012 (r235608) +++ head/sys/boot/uboot/lib/api_public.h Fri May 18 14:41:14 2012 (r235609) @@ -132,6 +132,7 @@ typedef unsigned long lbastart_t; #define DT_STOR_SCSI 0x0020 #define DT_STOR_USB 0x0040 #define DT_STOR_MMC 0x0080 +#define DT_STOR_NAND 0x0100 #define DEV_STA_CLOSED 0x0000 /* invalid, closed */ #define DEV_STA_OPEN 0x0001 /* open i.e. active */ Modified: head/sys/boot/uboot/lib/glue.c ============================================================================== --- head/sys/boot/uboot/lib/glue.c Fri May 18 14:29:54 2012 (r235608) +++ head/sys/boot/uboot/lib/glue.c Fri May 18 14:41:14 2012 (r235609) @@ -407,6 +407,9 @@ ub_stor_type(int type) if (type & DT_STOR_MMC) return ("MMC"); + if (type & DT_STOR_NAND) + return ("NAND"); + return ("Unknown"); } From owner-svn-src-head@FreeBSD.ORG Fri May 18 15:20:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09529106566B; Fri, 18 May 2012 15:20:22 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF8858FC0A; Fri, 18 May 2012 15:20:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4IFKL9l059390; Fri, 18 May 2012 15:20:21 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4IFKLNS059388; Fri, 18 May 2012 15:20:21 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201205181520.q4IFKLNS059388@svn.freebsd.org> From: Kirk McKusick Date: Fri, 18 May 2012 15:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235610 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 15:20:22 -0000 Author: mckusick Date: Fri May 18 15:20:21 2012 New Revision: 235610 URL: http://svn.freebsd.org/changeset/base/235610 Log: Add missing `continue' statement at end of case. Found by: Kevin Lo (kevlo@) MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Fri May 18 14:41:14 2012 (r235609) +++ head/sys/ufs/ffs/ffs_softdep.c Fri May 18 15:20:21 2012 (r235610) @@ -10687,6 +10687,7 @@ handle_jwork(wkhd) case D_FREEFRAG: rele_jseg(WK_JSEG(WK_FREEFRAG(wk)->ff_jdep)); WORKITEM_FREE(wk, D_FREEFRAG); + continue; case D_FREEWORK: handle_written_freework(WK_FREEWORK(wk)); continue; From owner-svn-src-head@FreeBSD.ORG Fri May 18 15:24:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3AABB1065674; Fri, 18 May 2012 15:24:43 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 0DA798FC18; Fri, 18 May 2012 15:24:41 +0000 (UTC) Received: by lbon10 with SMTP id n10so3011350lbo.13 for ; Fri, 18 May 2012 08:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=k6lGDTq0rLudRcD3B3w1BjAspqNh1fKBSdU8BsXj130=; b=zLMgbZJyvF/DEhkKWMYidrAottAbxufAOtboYwxNoJE4Eoc5t6YSC+vkY+mXTIZKYQ wzCXHQ/R0DG+26/IvDECFm9uVAyqfrjyEioxO0eIHQxc0B0vBXf9ELA4YeoSjknvtJm8 oL+gLD3zrMo+DjKKavfCdKfnZNv17y2NXXi6vN6EeLW6hpGJhDFtST7aBG2pNogtqslU Zk4gtyCt16gmfejt/QTa90Cm9JRQAxCNubuLz+hU5Pa772UuCj+JHP9ML0ckjhfiuASL 1ILcbubXb+7cL+/4DziBYEditnNr32nhN60m+fmDg3GRP5I+sAGzSeBVOp4w1EQqFNQ9 uIpA== Received: by 10.152.114.106 with SMTP id jf10mr11490284lab.16.1337354680020; Fri, 18 May 2012 08:24:40 -0700 (PDT) Received: from localhost ([78.157.92.5]) by mx.google.com with ESMTPS id gw17sm12799510lab.11.2012.05.18.08.24.37 (version=SSLv3 cipher=OTHER); Fri, 18 May 2012 08:24:38 -0700 (PDT) Date: Fri, 18 May 2012 18:24:36 +0300 From: Gleb Kurtsou To: John Baldwin Message-ID: <20120518152436.GA9116@reks> References: <201205181001.q4IA1VED044374@svn.freebsd.org> <201205180941.48076.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201205180941.48076.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235601 - head/include/protocols X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 15:24:43 -0000 On (18/05/2012 09:41), John Baldwin wrote: > On Friday, May 18, 2012 6:01:31 am Gleb Kurtsou wrote: > > Author: gleb > > Date: Fri May 18 10:01:31 2012 > > New Revision: 235601 > > URL: http://svn.freebsd.org/changeset/base/235601 > > > > Log: > > Don't use ino_t in dumprestore protocol definition. > > > > Since ino_t size is about to change to 64-bits, replace ino_t used in > > dump protocol definition with 32-bit dump_ino_t to preserve backward > > compatibility. At some point, it may be necessary to use spare fields > > in struct in order to fully support 64-bit inode numbers. > > > > Sponsored by: Google Summer of Code 2011 > > A question about your stat changes: did you expand dev_t to 32 bits for the > AFS folks, or did you leave it as 16 bits? dev_t is already 32-bit. Changing it to 64-bit was discussed at some point and from what I recall no decision was made: http://marc.info/?t=129119478700005&r=1&w=2 I'm going to commit preparatory changes only for now. Then publish diff for testing. We can still change dev_t to 64-bit if needed. Although I didn't work on it. Thanks, Gleb. From owner-svn-src-head@FreeBSD.ORG Fri May 18 15:25:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1477E106566C; Fri, 18 May 2012 15:25:44 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E96358FC15; Fri, 18 May 2012 15:25:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4IFPhis059648; Fri, 18 May 2012 15:25:43 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4IFPhpR059647; Fri, 18 May 2012 15:25:43 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201205181525.q4IFPhpR059647@svn.freebsd.org> From: Grzegorz Bernacki Date: Fri, 18 May 2012 15:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235611 - head/sys/arm/mv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 15:25:44 -0000 Author: gber Date: Fri May 18 15:25:43 2012 New Revision: 235611 URL: http://svn.freebsd.org/changeset/base/235611 Log: Add localbus driver for Marvell's platforms. Obtained from: Semihalf Supported by: FreeBSD Foundation, Juniper Networks Added: head/sys/arm/mv/mv_localbus.c (contents, props changed) Added: head/sys/arm/mv/mv_localbus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/mv/mv_localbus.c Fri May 18 15:25:43 2012 (r235611) @@ -0,0 +1,493 @@ +/*- + * Copyright (c) 2012 Semihalf. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include "dev/fdt/fdt_common.h" +#include "ofw_bus_if.h" + +#include + +#define DEBUG +#undef DEBUG + +#ifdef DEBUG +#define debugf(fmt, args...) do { printf("%s(): ", __func__); \ + printf(fmt,##args); } while (0) +#else +#define debugf(fmt, args...) +#endif + +#define MV_LOCALBUS_MAX_BANKS 8 +#define MV_LOCALBUS_MAX_BANK_CELLS 4 + +static MALLOC_DEFINE(M_LOCALBUS, "localbus", "localbus devices information"); + +struct localbus_bank { + vm_offset_t va; /* VA of the bank */ + vm_paddr_t pa; /* physical address of the bank */ + vm_size_t size; /* bank size */ + uint8_t mapped; /* device memory has mapping */ +}; + +struct localbus_softc { + device_t sc_dev; + bus_space_handle_t sc_bsh; + bus_space_tag_t sc_bst; + int sc_rid; + + struct localbus_bank *sc_banks; +}; + +struct localbus_devinfo { + struct ofw_bus_devinfo di_ofw; + struct resource_list di_res; + int di_bank; +}; + +struct localbus_va_entry { + int8_t bank; + vm_offset_t va; + vm_size_t size; +}; + +/* + * Prototypes. + */ +static int localbus_probe(device_t); +static int localbus_attach(device_t); +static int localbus_print_child(device_t, device_t); + +static struct resource *localbus_alloc_resource(device_t, device_t, int, + int *, u_long, u_long, u_long, u_int); +static struct resource_list *localbus_get_resource_list(device_t, device_t); + +static ofw_bus_get_devinfo_t localbus_get_devinfo; + +/* + * Bus interface definition. + */ +static device_method_t localbus_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, localbus_probe), + DEVMETHOD(device_attach, localbus_attach), + DEVMETHOD(device_detach, bus_generic_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* Bus interface */ + DEVMETHOD(bus_print_child, localbus_print_child), + DEVMETHOD(bus_alloc_resource, localbus_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(bus_get_resource_list, localbus_get_resource_list), + + /* OFW bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, localbus_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + { 0, 0 } +}; + +static driver_t localbus_driver = { + "localbus", + localbus_methods, + sizeof(struct localbus_softc) +}; + +const struct localbus_va_entry localbus_virtmap[] = { + { 0, MV_DEV_BOOT_BASE, MV_DEV_BOOT_SIZE }, + { 1, MV_DEV_CS0_BASE, MV_DEV_CS0_SIZE }, + { 2, MV_DEV_CS1_BASE, MV_DEV_CS1_SIZE }, + { 3, MV_DEV_CS2_BASE, MV_DEV_CS2_SIZE }, + + { -1, 0, 0 } +}; + +static struct localbus_bank localbus_banks[MV_LOCALBUS_MAX_BANKS]; + +devclass_t localbus_devclass; + +DRIVER_MODULE(localbus, fdtbus, localbus_driver, localbus_devclass, 0, 0); + +static int +fdt_localbus_reg_decode(phandle_t node, struct localbus_softc *sc, + struct localbus_devinfo *di) +{ + u_long start, end, count; + pcell_t *reg, *regptr; + pcell_t addr_cells, size_cells; + int tuple_size, tuples; + int i, rv, bank; + + if (fdt_addrsize_cells(OF_parent(node), &addr_cells, &size_cells) != 0) + return (ENXIO); + + tuple_size = sizeof(pcell_t) * (addr_cells + size_cells); + tuples = OF_getprop_alloc(node, "reg", tuple_size, (void **)®); + debugf("addr_cells = %d, size_cells = %d\n", addr_cells, size_cells); + debugf("tuples = %d, tuple size = %d\n", tuples, tuple_size); + if (tuples <= 0) + /* No 'reg' property in this node. */ + return (0); + + regptr = reg; + for (i = 0; i < tuples; i++) { + + bank = fdt_data_get((void *)regptr, 1); + + if (bank >= MV_LOCALBUS_MAX_BANKS) { + device_printf(sc->sc_dev, "bank number [%d] out of " + "range\n", bank); + continue; + } + + /* + * If device doesn't have virtual to physical mapping don't add + * resources + */ + if (!(sc->sc_banks[bank].mapped)) { + device_printf(sc->sc_dev, "device [%d]: missing memory " + "mapping\n", bank); + continue; + } + + di->di_bank = bank; + regptr += 1; + + /* Get address/size. */ + rv = fdt_data_to_res(regptr, addr_cells - 1, size_cells, &start, + &count); + if (rv != 0) { + resource_list_free(&di->di_res); + goto out; + } + + /* Check if enough amount of memory is mapped */ + if (sc->sc_banks[bank].size < count) { + device_printf(sc->sc_dev, "device [%d]: not enough " + "memory reserved\n", bank); + continue; + } + + regptr += addr_cells - 1 + size_cells; + + /* Calculate address range relative to VA base. */ + start = sc->sc_banks[bank].va + start; + end = start + count - 1; + + debugf("reg addr bank = %d, start = %lx, end = %lx, " + "count = %lx\n", bank, start, end, count); + + /* Use bank (CS) cell as rid. */ + resource_list_add(&di->di_res, SYS_RES_MEMORY, di->di_bank, + start, end, count); + } + rv = 0; +out: + free(reg, M_OFWPROP); + return (rv); +} + +static int +localbus_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible_strict(dev, "mrvl,lbc")) + return (ENXIO); + + device_set_desc(dev, "Marvell device bus"); + + return (BUS_PROBE_DEFAULT); +} + +static int +localbus_attach(device_t dev) +{ + device_t dev_child; + struct localbus_softc *sc; + struct localbus_devinfo *di; + phandle_t dt_node, dt_child; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_banks = localbus_banks; + + /* + * Walk localbus and add direct subordinates as our children. + */ + dt_node = ofw_bus_get_node(dev); + for (dt_child = OF_child(dt_node); dt_child != 0; + dt_child = OF_peer(dt_child)) { + + /* Check and process 'status' property. */ + if (!(fdt_is_enabled(dt_child))) + continue; + + if (!(fdt_pm_is_enabled(dt_child))) + continue; + + di = malloc(sizeof(*di), M_LOCALBUS, M_WAITOK | M_ZERO); + if (ofw_bus_gen_setup_devinfo(&di->di_ofw, dt_child) != 0) { + free(di, M_LOCALBUS); + device_printf(dev, "could not set up devinfo\n"); + continue; + } + + resource_list_init(&di->di_res); + if (fdt_localbus_reg_decode(dt_child, sc, di)) { + device_printf(dev, "could not process 'reg' " + "property\n"); + ofw_bus_gen_destroy_devinfo(&di->di_ofw); + free(di, M_LOCALBUS); + continue; + } + + /* Add newbus device for this FDT node */ + dev_child = device_add_child(dev, NULL, -1); + if (dev_child == NULL) { + device_printf(dev, "could not add child: %s\n", + di->di_ofw.obd_name); + resource_list_free(&di->di_res); + ofw_bus_gen_destroy_devinfo(&di->di_ofw); + free(di, M_LOCALBUS); + continue; + } +#ifdef DEBUG + device_printf(dev, "added child: %s\n\n", di->di_ofw.obd_name); +#endif + device_set_ivars(dev_child, di); + } + + return (bus_generic_attach(dev)); +} + +static int +localbus_print_child(device_t dev, device_t child) +{ + struct localbus_devinfo *di; + struct resource_list *rl; + int rv; + + di = device_get_ivars(child); + rl = &di->di_res; + + rv = 0; + rv += bus_print_child_header(dev, child); + rv += resource_list_print_type(rl, "mem", SYS_RES_MEMORY, "%#lx"); + rv += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld"); + rv += bus_print_child_footer(dev, child); + + return (rv); +} + +static struct resource * +localbus_alloc_resource(device_t bus, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct localbus_devinfo *di; + struct resource_list_entry *rle; + + /* + * Request for the default allocation with a given rid: use resource + * list stored in the local device info. + */ + if ((start == 0UL) && (end == ~0UL)) { + if ((di = device_get_ivars(child)) == NULL) + return (NULL); + + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + + rid = &di->di_bank; + rle = resource_list_find(&di->di_res, type, *rid); + if (rle == NULL) { + device_printf(bus, "no default resources for " + "rid = %d, type = %d\n", *rid, type); + return (NULL); + } + start = rle->start; + end = rle->end; + count = rle->count; + } + + return (bus_generic_alloc_resource(bus, child, type, rid, start, end, + count, flags)); +} + + +static struct resource_list * +localbus_get_resource_list(device_t bus, device_t child) +{ + struct localbus_devinfo *di; + + di = device_get_ivars(child); + return (&di->di_res); +} + +static const struct ofw_bus_devinfo * +localbus_get_devinfo(device_t bus, device_t child) +{ + struct localbus_devinfo *di; + + di = device_get_ivars(child); + return (&di->di_ofw); +} + +int +fdt_localbus_devmap(phandle_t dt_node, struct pmap_devmap *fdt_devmap, + int banks_max_num, int *banks_added) +{ + pcell_t ranges[MV_LOCALBUS_MAX_BANKS * MV_LOCALBUS_MAX_BANK_CELLS]; + pcell_t *rangesptr; + uint32_t tuple_size, bank; + vm_paddr_t offset; + vm_size_t size; + int dev_num, addr_cells, size_cells, par_addr_cells, va_index, i, j, k; + + if ((fdt_addrsize_cells(dt_node, &addr_cells, &size_cells)) != 0) + return (EINVAL); + + par_addr_cells = fdt_parent_addr_cells(dt_node); + if (par_addr_cells > 2) { + /* + * Localbus devmap initialization error: unsupported parent + * #addr-cells + */ + return (ERANGE); + } + + tuple_size = (addr_cells + par_addr_cells + size_cells); + if (tuple_size > MV_LOCALBUS_MAX_BANK_CELLS) + return (ERANGE); + + tuple_size *= sizeof(pcell_t); + + dev_num = OF_getprop(dt_node, "ranges", ranges, sizeof(ranges)); + if (dev_num <= 0) + return (EINVAL); + + /* Calculate number of devices attached to bus */ + dev_num = dev_num / tuple_size; + + /* + * If number of ranges > max number of localbus devices, + * additional entries will not be processed + */ + dev_num = MIN(dev_num, banks_max_num); + + rangesptr = &ranges[0]; + j = 0; + + /* Process data from FDT */ + for (i = 0; i < dev_num; i++) { + + /* First field is bank number */ + bank = fdt_data_get((void *)rangesptr, 1); + rangesptr += 1; + + if (bank < 0 || bank > MV_LOCALBUS_MAX_BANKS) { + /* Bank out of range */ + rangesptr += ((addr_cells - 1) + par_addr_cells + + size_cells); + continue; + } + + /* Find virtmap entry for this bank */ + va_index = -1; + for (k = 0; localbus_virtmap[k].bank >= 0; k++) { + if (localbus_virtmap[k].bank == bank) { + va_index = k; + break; + } + } + + /* Check if virtmap entry was found */ + if (va_index == -1) { + rangesptr += ((addr_cells - 1) + par_addr_cells + + size_cells); + continue; + } + + /* Remaining child's address fields are unused */ + rangesptr += (addr_cells - 1); + + /* Parent address offset */ + offset = fdt_data_get((void *)rangesptr, par_addr_cells); + rangesptr += par_addr_cells; + + /* Last field is size */ + size = fdt_data_get((void *)rangesptr, size_cells); + rangesptr += size_cells; + + if (size > localbus_virtmap[va_index].size) { + /* Not enough space reserved in virtual memory map */ + continue; + } + + fdt_devmap[j].pd_va = localbus_virtmap[va_index].va; + fdt_devmap[j].pd_pa = offset; + fdt_devmap[j].pd_size = size; + fdt_devmap[j].pd_prot = VM_PROT_READ | VM_PROT_WRITE; + fdt_devmap[j].pd_cache = PTE_NOCACHE; + + /* Copy data to structure used by localbus driver */ + localbus_banks[bank].va = fdt_devmap[j].pd_va; + localbus_banks[bank].pa = fdt_devmap[j].pd_pa; + localbus_banks[bank].size = fdt_devmap[j].pd_size; + localbus_banks[bank].mapped = 1; + + j++; + } + + *banks_added = j; + return (0); +} From owner-svn-src-head@FreeBSD.ORG Fri May 18 16:40:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C8B110656B4; Fri, 18 May 2012 16:40:16 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4828C8FC0C; Fri, 18 May 2012 16:40:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4IGeG4Q063492; Fri, 18 May 2012 16:40:16 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4IGeGLM063486; Fri, 18 May 2012 16:40:16 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201205181640.q4IGeGLM063486@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 18 May 2012 16:40:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235613 - in head: etc/mtree share share/dtrace share/dtrace/toolkit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 16:40:16 -0000 Author: gnn Date: Fri May 18 16:40:15 2012 New Revision: 235613 URL: http://svn.freebsd.org/changeset/base/235613 Log: Add support for our own DTrace scripts and those from the DTraceToolkit to the build system. FreeBSD written scripts are stored in src/share and the toolkit scripts are brought from the cddl directory into a working tree via install. MFC after: 2 weeks Added: head/share/dtrace/ head/share/dtrace/Makefile (contents, props changed) head/share/dtrace/README (contents, props changed) head/share/dtrace/toolkit/ head/share/dtrace/toolkit/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.usr.dist head/share/Makefile Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Fri May 18 16:16:47 2012 (r235612) +++ head/etc/mtree/BSD.usr.dist Fri May 18 16:40:15 2012 (r235613) @@ -200,6 +200,10 @@ .. .. .. + dtrace + toolkit + .. + .. examples BSD_daemon .. Modified: head/share/Makefile ============================================================================== --- head/share/Makefile Fri May 18 16:16:47 2012 (r235612) +++ head/share/Makefile Fri May 18 16:40:15 2012 (r235613) @@ -8,6 +8,7 @@ SUBDIR= ${_colldef} \ ${_dict} \ ${_doc} \ + dtrace \ ${_examples} \ ${_i18n} \ ${_man} \ Added: head/share/dtrace/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/dtrace/Makefile Fri May 18 16:40:15 2012 (r235613) @@ -0,0 +1,21 @@ +# $FreeBSD$ +# +# Hand installing our scripts and optionally (based on MK_CDDL) installing +# the DTraceToolkit. +# + +.include + +SUBDIR= ${_toolkit} + +.if ${MK_CDDL} != "no" +_toolkit= toolkit +.endif + +SCRIPTS= nfsclienttime + +SCRIPTSDIR= ${SHAREDIR}/dtrace/ + +NO_OBJ= + +.include Added: head/share/dtrace/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/dtrace/README Fri May 18 16:40:15 2012 (r235613) @@ -0,0 +1,11 @@ +$FreeBSD$ + +This directory contains scripts for use with the DTrace system. The +toolkit/ directory contains the latest vendor import of Brendan +Gregg's DTRaceToolkit while all the other files and directories +contain code generated by the FreeBSD Project for use with DTrace on +FreeBSD. + +NOTE: Do not add new scripts to the DTraceToolkit contained in this +directory. New DTraceToolkit scripts should be send to the maintainer +of the toolkit and then brought back into FreeBSD via future vendor imports. Added: head/share/dtrace/toolkit/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/dtrace/toolkit/Makefile Fri May 18 16:40:15 2012 (r235613) @@ -0,0 +1,17 @@ +#$FreeBSD$ +# +# Install scripts from the DTraceToolkit +# +DTRACETOOLKIT= ../../../cddl/contrib/dtracetoolkit + +SCRIPTS= ${DTRACETOOLKIT}/execsnoop \ + ${DTRACETOOLKIT}/hotuser \ + ${DTRACETOOLKIT}/hotkernel \ + ${DTRACETOOLKIT}/opensnoop \ + ${DTRACETOOLKIT}/procsystime \ + +SCRIPTSDIR= ${SHAREDIR}/dtrace/toolkit + +NO_OBJ= + +.include From owner-svn-src-head@FreeBSD.ORG Fri May 18 16:47:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97494106564A; Fri, 18 May 2012 16:47:16 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6829D8FC0A; Fri, 18 May 2012 16:47:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4IGlGSe063849; Fri, 18 May 2012 16:47:16 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4IGlGEL063848; Fri, 18 May 2012 16:47:16 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201205181647.q4IGlGEL063848@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 18 May 2012 16:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235614 - head/share/dtrace X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 16:47:16 -0000 Author: gnn Date: Fri May 18 16:47:15 2012 New Revision: 235614 URL: http://svn.freebsd.org/changeset/base/235614 Log: Add a DTrace script to show the frequency and latency of NFS client calls. Submitted by: rwatson Added: head/share/dtrace/nfsclienttime (contents, props changed) Added: head/share/dtrace/nfsclienttime ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/dtrace/nfsclienttime Fri May 18 16:47:15 2012 (r235614) @@ -0,0 +1,74 @@ +#!/bin/sh +# +# Copyright (c) 2012 Robert N. M. Watson +# All rights reserved. +# +# This software was developed at the University of Cambridge Computer +# Laboratory with support from a grant from Google, Inc. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +# This script measures all time spent waiting on RPC replies for each +# system call, and then generates a histogram of those times sorted by +# system call name. +# +# Currently only supports NFSv3 +# +# Usage: nfsclienttime +# +# Press Ctrl-C to exit and display statistics. +# + +/usr/sbin/dtrace -n ' +#pragma D option quiet + +dtrace:::BEGIN +{ + printf("Collecting data...press Ctrl-C to exit.\n"); +} + +syscall:::entry +{ + + self->count = 0; +} + +nfsclient:nfs3::start +{ + + self->timestamp = timestamp; +} + +nfsclient:nfs3::done +{ + + self->count += (timestamp - self->timestamp); +} + +syscall:::return +/self->count != 0/ { + + @syscalls[probefunc] = quantize(self->count); +} +' From owner-svn-src-head@FreeBSD.ORG Fri May 18 18:35:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD7091065673; Fri, 18 May 2012 18:35:09 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C90F78FC17; Fri, 18 May 2012 18:35:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4IIZ9MC068720; Fri, 18 May 2012 18:35:09 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4IIZ9nO068718; Fri, 18 May 2012 18:35:09 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201205181835.q4IIZ9nO068718@svn.freebsd.org> From: Kirk McKusick Date: Fri, 18 May 2012 18:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235619 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 18:35:10 -0000 Author: mckusick Date: Fri May 18 18:35:09 2012 New Revision: 235619 URL: http://svn.freebsd.org/changeset/base/235619 Log: Update comment to document that the vnode free-list mutex needs to be held when updating mnt_activevnodelist and mnt_activevnodelistsize. Modified: head/sys/sys/mount.h Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Fri May 18 18:34:29 2012 (r235618) +++ head/sys/sys/mount.h Fri May 18 18:35:09 2012 (r235619) @@ -148,6 +148,7 @@ struct vfsopt { * Lock reference: * m - mountlist_mtx * i - interlock + * v - vnode freelist mutex * * Unmarked fields are considered stable as long as a ref is held. * @@ -164,8 +165,8 @@ struct mount { int mnt_ref; /* (i) Reference count */ struct vnodelst mnt_nvnodelist; /* (i) list of vnodes */ int mnt_nvnodelistsize; /* (i) # of vnodes */ - struct vnodelst mnt_activevnodelist; /* (i) list of active vnodes */ - int mnt_activevnodelistsize;/* (i) # of active vnodes */ + struct vnodelst mnt_activevnodelist; /* (v) list of active vnodes */ + int mnt_activevnodelistsize;/* (v) # of active vnodes */ int mnt_writeopcount; /* (i) write syscalls pending */ int mnt_kern_flag; /* (i) kernel only flags */ uint64_t mnt_flag; /* (i) flags shared with user */ From owner-svn-src-head@FreeBSD.ORG Fri May 18 18:55:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 542FE1065673; Fri, 18 May 2012 18:55:59 +0000 (UTC) (envelope-from iwasaki@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C9CA8FC19; Fri, 18 May 2012 18:55:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4IItxev069718; Fri, 18 May 2012 18:55:59 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4IItxs0069711; Fri, 18 May 2012 18:55:59 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201205181855.q4IItxs0069711@svn.freebsd.org> From: Mitsuru IWASAKI Date: Fri, 18 May 2012 18:55:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235622 - in head/sys: i386/acpica i386/i386 i386/include kern pc98/pc98 sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 18:55:59 -0000 Author: iwasaki Date: Fri May 18 18:55:58 2012 New Revision: 235622 URL: http://svn.freebsd.org/changeset/base/235622 Log: Add SMP/i386 suspend/resume support. Most part is merged from amd64. - i386/acpica/acpi_wakecode.S Replaced with amd64 code (from realmode to paging enabling code). - i386/acpica/acpi_wakeup.c Replaced with amd64 code (except for wakeup_pagetables stuff). - i386/include/pcb.h - i386/i386/genassym.c Added PCB new members (CR0, CR2, CR4, DS, ED, FS, SS, GDT, IDT, LDT and TR) needed for suspend/resume, not for context switch. - i386/i386/swtch.s Added suspendctx() and resumectx(). Note that savectx() was not changed and used for suspending (while amd64 code uses it). BSP and AP execute the same sequence, suspendctx(), acpi_wakecode() and resumectx() for suspend/resume (in case of UP system also). - i386/i386/apic_vector.s Added cpususpend(). - i386/i386/mp_machdep.c - i386/include/smp.h Added cpususpend_handler(). - i386/include/apicvar.h - kern/subr_smp.c - sys/smp.h Added IPI_SUSPEND and suspend_cpus(). - i386/i386/initcpu.c - i386/i386/machdep.c - i386/include/md_var.h - pc98/pc98/machdep.c Moved initializecpu() declarations to md_var.h. MFC after: 3 days Modified: head/sys/i386/acpica/acpi_wakecode.S head/sys/i386/acpica/acpi_wakeup.c head/sys/i386/i386/apic_vector.s head/sys/i386/i386/genassym.c head/sys/i386/i386/initcpu.c head/sys/i386/i386/machdep.c head/sys/i386/i386/mp_machdep.c head/sys/i386/i386/swtch.s head/sys/i386/include/apicvar.h head/sys/i386/include/md_var.h head/sys/i386/include/pcb.h head/sys/i386/include/smp.h head/sys/kern/subr_smp.c head/sys/pc98/pc98/machdep.c head/sys/sys/smp.h Modified: head/sys/i386/acpica/acpi_wakecode.S ============================================================================== --- head/sys/i386/acpica/acpi_wakecode.S Fri May 18 18:53:28 2012 (r235621) +++ head/sys/i386/acpica/acpi_wakecode.S Fri May 18 18:55:58 2012 (r235622) @@ -1,6 +1,8 @@ /*- * Copyright (c) 2001 Takanori Watanabe - * Copyright (c) 2001 Mitsuru IWASAKI + * Copyright (c) 2001-2012 Mitsuru IWASAKI + * Copyright (c) 2003 Peter Wemm + * Copyright (c) 2008-2012 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,7 +30,9 @@ */ #include +#include #include +#include #include "assym.s" @@ -39,221 +43,163 @@ * Depending on the previous sleep state, we may need to initialize more * of the system (i.e., S3 suspend-to-RAM vs. S4 suspend-to-disk). */ - .align 4 - .code16 -wakeup_16: - nop - cli - cld + .data /* So we can modify it */ + + ALIGN_TEXT + .code16 +wakeup_start: /* * Set up segment registers for real mode, a small stack for * any calls we make, and clear any flags. */ - movw %cs,%ax - movw %ax,%ds - movw %ax,%ss - movw $PAGE_SIZE,%sp - pushl $0 - popfl + cli /* make sure no interrupts */ + mov %cs, %ax /* copy %cs to %ds. Remember these */ + mov %ax, %ds /* are offsets rather than selectors */ + mov %ax, %ss + movw $PAGE_SIZE, %sp + xorw %ax, %ax + pushw %ax + popfw /* To debug resume hangs, beep the speaker if the user requested. */ - cmpl $1,resume_beep - jne nobeep - movb $0xc0,%al - outb %al,$0x42 - movb $0x04,%al - outb %al,$0x42 - inb $0x61,%al - orb $0x3,%al - outb %al,$0x61 -nobeep: + testb $~0, resume_beep - wakeup_start + jz 1f + movb $0, resume_beep - wakeup_start + + /* Set PIC timer2 to beep. */ + movb $(TIMER_SEL2 | TIMER_SQWAVE | TIMER_16BIT), %al + outb %al, $TIMER_MODE + + /* Turn on speaker. */ + inb $IO_PPI, %al + orb $PIT_SPKR, %al + outb %al, $IO_PPI + + /* Set frequency. */ + movw $0x4c0, %ax + outb %al, $TIMER_CNTR2 + shrw $8, %ax + outb %al, $TIMER_CNTR2 +1: /* Re-initialize video BIOS if the reset_video tunable is set. */ - cmpl $1,reset_video - jne nobiosreset - lcall $0xc000,$3 + testb $~0, reset_video - wakeup_start + jz 1f + movb $0, reset_video - wakeup_start + lcall $0xc000, $3 + + /* When we reach here, int 0x10 should be ready. Hide cursor. */ + movb $0x01, %ah + movb $0x20, %ch + int $0x10 + + /* Re-start in case the previous BIOS call clobbers them. */ + jmp wakeup_start +1: /* - * Set up segment registers for real mode again in case the - * previous BIOS call clobbers them. + * Find relocation base and patch the gdt descript and ljmp targets */ - movw %cs,%ax - movw %ax,%ds - movw %ax,%ss -nobiosreset: - - /* Load GDT for real mode. Use 32 bit prefix for addresses >16 MB. */ - lgdtl physical_gdt - - /* Restore CR2, CR3 and CR4 */ - movl previous_cr2,%eax - movl %eax,%cr2 - movl previous_cr3,%eax - movl %eax,%cr3 - movl previous_cr4,%eax - movl %eax,%cr4 - - /* Transfer some values to protected mode with an inline stack */ -#define NVALUES 9 -#define TRANSFER_STACK32(val, idx) \ - movl val,%eax; \ - movl %eax,wakeup_32stack+(idx+1)+(idx*4) - - TRANSFER_STACK32(previous_ss, (NVALUES - 9)) - TRANSFER_STACK32(previous_fs, (NVALUES - 8)) - TRANSFER_STACK32(previous_ds, (NVALUES - 7)) - TRANSFER_STACK32(physical_gdt+2, (NVALUES - 6)) - TRANSFER_STACK32(where_to_recover, (NVALUES - 5)) - TRANSFER_STACK32(previous_idt+2, (NVALUES - 4)) - TRANSFER_STACK32(previous_ldt, (NVALUES - 3)) - TRANSFER_STACK32(previous_gdt+2, (NVALUES - 2)) - TRANSFER_STACK32(previous_tr, (NVALUES - 1)) - TRANSFER_STACK32(previous_cr0, (NVALUES - 0)) + xorl %ebx, %ebx + mov %cs, %bx + sall $4, %ebx /* %ebx is now our relocation base */ - mov physical_esp,%esi /* to be used in 32bit code */ + /* + * Load the descriptor table pointer. We'll need it when running + * in 16-bit protected mode. + */ + lgdtl bootgdtdesc - wakeup_start /* Enable protected mode */ - movl %cr0,%eax - orl $(CR0_PE),%eax - movl %eax,%cr0 + movl $CR0_PE, %eax + mov %eax, %cr0 + /* + * Now execute a far jump to turn on protected mode. This + * causes the segment registers to turn into selectors and causes + * %cs to be loaded from the gdt. + * + * The following instruction is: + * ljmpl $bootcode32 - bootgdt, $wakeup_32 - wakeup_start + * but gas cannot assemble that. And besides, we patch the targets + * in early startup and its a little clearer what we are patching. + */ wakeup_sw32: - /* Switch to protected mode by intersegmental jump */ - ljmpl $KCSEL,$0x12345678 /* Code location, to be replaced */ + .byte 0x66 /* size override to 32 bits */ + .byte 0xea /* opcode for far jump */ + .long wakeup_32 - wakeup_start /* offset in segment */ + .word bootcode32 - bootgdt /* index in gdt for 32 bit code */ /* - * Now switched to protected mode without paging enabled. - * %esi: KERNEL stack pointer (physical address) + * At this point, we are running in 32 bit legacy protected mode. */ + ALIGN_TEXT .code32 wakeup_32: - nop - /* Set up segment registers for protected mode */ - movw $KDSEL,%ax /* KDSEL to segment registers */ - movw %ax,%ds - movw %ax,%es - movw %ax,%gs - movw %ax,%ss - movw $KPSEL,%ax /* KPSEL to %fs */ - movw %ax,%fs - movl %esi,%esp /* physical address stack pointer */ - -wakeup_32stack: - /* Operands are overwritten in 16 bit code by TRANSFER_STACK32 macro */ - pushl $0xabcdef09 /* ss + dummy */ - pushl $0xabcdef08 /* fs + gs */ - pushl $0xabcdef07 /* ds + es */ - pushl $0xabcdef06 /* gdt:base (physical address) */ - pushl $0xabcdef05 /* recover address */ - pushl $0xabcdef04 /* idt:base */ - pushl $0xabcdef03 /* ldt + idt:limit */ - pushl $0xabcdef02 /* gdt:base */ - pushl $0xabcdef01 /* TR + gdt:limit */ - pushl $0xabcdef00 /* CR0 */ - - movl %esp,%ebp -#define CR0_REGISTER 0(%ebp) -#define TASK_REGISTER 4(%ebp) -#define PREVIOUS_GDT 6(%ebp) -#define PREVIOUS_LDT 12(%ebp) -#define PREVIOUS_IDT 14(%ebp) -#define RECOVER_ADDR 20(%ebp) -#define PHYSICAL_GDT_BASE 24(%ebp) -#define PREVIOUS_DS 28(%ebp) -#define PREVIOUS_ES 30(%ebp) -#define PREVIOUS_FS 32(%ebp) -#define PREVIOUS_GS 34(%ebp) -#define PREVIOUS_SS 36(%ebp) - - /* Fixup TSS type field */ -#define TSS_TYPEFIX_MASK 0xf9 - xorl %esi,%esi - movl PHYSICAL_GDT_BASE,%ebx - movw TASK_REGISTER,%si - leal (%ebx,%esi),%eax /* get TSS segment descriptor */ - andb $TSS_TYPEFIX_MASK,5(%eax) - - /* Prepare to return to sleep/wakeup code point */ - lgdtl PREVIOUS_GDT - lidtl PREVIOUS_IDT - - /* Pack values from the GDT to be loaded into segment registers. */ - movl PREVIOUS_DS,%ebx - movl PREVIOUS_FS,%ecx - movl PREVIOUS_SS,%edx - movw TASK_REGISTER,%si - shll $16,%esi - movw PREVIOUS_LDT,%si - movl RECOVER_ADDR,%edi - - /* Enable paging and etc. */ - movl CR0_REGISTER,%eax - movl %eax,%cr0 + mov $bootdata32 - bootgdt, %eax + mov %ax, %ds - /* Flush the prefetch queue */ - jmp 1f -1: jmp 1f -1: + /* Get PCB and return address. */ + movl wakeup_pcb - wakeup_start(%ebx), %esi + movl wakeup_ret - wakeup_start(%ebx), %edi + + /* Restore CR4 and CR3. */ + movl wakeup_cr4 - wakeup_start(%ebx), %eax + mov %eax, %cr4 + movl wakeup_cr3 - wakeup_start(%ebx), %eax + mov %eax, %cr3 /* - * Now we are in kernel virtual memory addressing with the following - * original register values: - * %ebx: ds + es - * %ecx: fs + gs - * %edx: ss + dummy - * %esi: LDTR + TR - * %edi: recover address - * We'll load these back into the segment registers now. + * Finally, switch to long bit mode by enabling paging. We have + * to be very careful here because all the segmentation disappears + * out from underneath us. The spec says we can depend on the + * subsequent pipelined branch to execute, but *only if* everthing + * is still identity mapped. If any mappings change, the pipeline + * will flush. */ - nop - - movl %esi,%eax /* LDTR + TR */ - lldt %ax /* load LDT register */ - shrl $16,%eax - ltr %ax /* load task register */ - - /* Restore segment registers */ - movl %ebx,%eax /* ds + es */ - movw %ax,%ds - shrl $16,%eax - movw %ax,%es - movl %ecx,%eax /* fs + gs */ - movw %ax,%fs - shrl $16,%eax - movw %ax,%gs - movl %edx,%eax /* ss */ - movw %ax,%ss + mov %cr0, %eax + orl $CR0_PG, %eax + mov %eax, %cr0 - /* Jump to acpi_restorecpu() */ + jmp 1f +1: + /* Jump to return address. */ jmp *%edi -/* used in real mode */ -physical_gdt: .word 0 - .long 0 -physical_esp: .long 0 -previous_cr2: .long 0 -previous_cr3: .long 0 -previous_cr4: .long 0 -resume_beep: .long 0 -reset_video: .long 0 + .data -/* - * Transfer from real mode to protected mode. The order of these variables - * is very important, DO NOT INSERT OR CHANGE unless you know why. - */ -previous_cr0: .long 0 -previous_tr: .word 0 -previous_gdt: .word 0 - .long 0 -previous_ldt: .word 0 -previous_idt: .word 0 - .long 0 -where_to_recover: .long 0 -previous_ds: .word 0 -previous_es: .word 0 -previous_fs: .word 0 -previous_gs: .word 0 -previous_ss: .word 0 -dummy: .word 0 +resume_beep: + .byte 0 +reset_video: + .byte 0 + + ALIGN_DATA +bootgdt: + .long 0x00000000 + .long 0x00000000 + +bootcode32: + .long 0x0000ffff + .long 0x00cf9b00 + +bootdata32: + .long 0x0000ffff + .long 0x00cf9300 +bootgdtend: + +bootgdtdesc: + .word bootgdtend - bootgdt /* Length */ + .long bootgdt - wakeup_start /* Offset plus %ds << 4 */ + + ALIGN_DATA +wakeup_cr4: + .long 0 +wakeup_cr3: + .long 0 +wakeup_pcb: + .long 0 +wakeup_ret: + .long 0 +dummy: Modified: head/sys/i386/acpica/acpi_wakeup.c ============================================================================== --- head/sys/i386/acpica/acpi_wakeup.c Fri May 18 18:53:28 2012 (r235621) +++ head/sys/i386/acpica/acpi_wakeup.c Fri May 18 18:55:58 2012 (r235622) @@ -1,6 +1,8 @@ /*- * Copyright (c) 2001 Takanori Watanabe - * Copyright (c) 2001 Mitsuru IWASAKI + * Copyright (c) 2001-2012 Mitsuru IWASAKI + * Copyright (c) 2003 Peter Wemm + * Copyright (c) 2008-2012 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,26 +31,29 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include -#include +#include +#include #include #include -#include -#include +#include #include #include -#include -#include -#include -#include -#include +#include #include #include -#include +#include +#include +#include +#include + +#ifdef SMP +#include +#include +#include +#endif #include @@ -57,164 +62,186 @@ __FBSDID("$FreeBSD$"); #include "acpi_wakecode.h" #include "acpi_wakedata.h" -/* Make sure the code is less than one page and leave room for the stack. */ +/* Make sure the code is less than a page and leave room for the stack. */ CTASSERT(sizeof(wakecode) < PAGE_SIZE - 1024); -#ifndef _SYS_CDEFS_H_ -#error this file needs sys/cdefs.h as a prerequisite +extern int acpi_resume_beep; +extern int acpi_reset_video; + +#ifdef SMP +extern struct pcb **susppcbs; +#else +static struct pcb **susppcbs; +#endif + +static void *acpi_alloc_wakeup_handler(void); +static void acpi_stop_beep(void *); + +#ifdef SMP +static int acpi_wakeup_ap(struct acpi_softc *, int); +static void acpi_wakeup_cpus(struct acpi_softc *, const cpuset_t *); #endif -extern uint32_t acpi_resume_beep; -extern uint32_t acpi_reset_video; -extern void initializecpu(void); - -static struct region_descriptor __used saved_idt, saved_gdt; -static struct region_descriptor *p_gdt; -static uint16_t __used saved_ldt; - -static uint32_t __used r_eax, r_ebx, r_ecx, r_edx, r_ebp, r_esi, r_edi, - r_efl, r_cr0, r_cr2, r_cr3, r_cr4, ret_addr; - -static uint16_t __used r_cs, r_ds, r_es, r_fs, r_gs, r_ss, r_tr; -static uint32_t __used r_esp; - -static void acpi_printcpu(void); -static void acpi_realmodeinst(void *arg, bus_dma_segment_t *segs, - int nsegs, int error); -static void acpi_alloc_wakeup_handler(void); - -/* XXX shut gcc up */ -extern int acpi_savecpu(void); -extern int acpi_restorecpu(void); - -#ifdef __GNUCLIKE_ASM -__asm__(" \n\ - .text \n\ - .p2align 2, 0x90 \n\ - .type acpi_restorecpu, @function\n\ -acpi_restorecpu: \n\ - .align 4 \n\ - movl r_eax,%eax \n\ - movl r_ebx,%ebx \n\ - movl r_ecx,%ecx \n\ - movl r_edx,%edx \n\ - movl r_ebp,%ebp \n\ - movl r_esi,%esi \n\ - movl r_edi,%edi \n\ - movl r_esp,%esp \n\ - \n\ - pushl r_efl \n\ - popfl \n\ - \n\ - movl ret_addr,%eax \n\ - movl %eax,(%esp) \n\ - xorl %eax,%eax \n\ - ret \n\ - \n\ - .text \n\ - .p2align 2, 0x90 \n\ - .type acpi_savecpu, @function \n\ -acpi_savecpu: \n\ - movw %cs,r_cs \n\ - movw %ds,r_ds \n\ - movw %es,r_es \n\ - movw %fs,r_fs \n\ - movw %gs,r_gs \n\ - movw %ss,r_ss \n\ - \n\ - movl %eax,r_eax \n\ - movl %ebx,r_ebx \n\ - movl %ecx,r_ecx \n\ - movl %edx,r_edx \n\ - movl %ebp,r_ebp \n\ - movl %esi,r_esi \n\ - movl %edi,r_edi \n\ - \n\ - movl %cr0,%eax \n\ - movl %eax,r_cr0 \n\ - movl %cr2,%eax \n\ - movl %eax,r_cr2 \n\ - movl %cr3,%eax \n\ - movl %eax,r_cr3 \n\ - movl %cr4,%eax \n\ - movl %eax,r_cr4 \n\ - \n\ - pushfl \n\ - popl r_efl \n\ - \n\ - movl %esp,r_esp \n\ - \n\ - sgdt saved_gdt \n\ - sidt saved_idt \n\ - sldt saved_ldt \n\ - str r_tr \n\ - \n\ - movl (%esp),%eax \n\ - movl %eax,ret_addr \n\ - movl $1,%eax \n\ - ret \n\ -"); -#endif /* __GNUCLIKE_ASM */ +#define ACPI_PAGETABLES 0 +#define WAKECODE_VADDR(sc) ((sc)->acpi_wakeaddr + (ACPI_PAGETABLES * PAGE_SIZE)) +#define WAKECODE_PADDR(sc) ((sc)->acpi_wakephys + (ACPI_PAGETABLES * PAGE_SIZE)) +#define WAKECODE_FIXUP(offset, type, val) do { \ + type *addr; \ + addr = (type *)(WAKECODE_VADDR(sc) + offset); \ + *addr = val; \ +} while (0) static void -acpi_printcpu(void) +acpi_stop_beep(void *arg) { - printf("======== acpi_printcpu() debug dump ========\n"); - printf("gdt[%04x:%08x] idt[%04x:%08x] ldt[%04x] tr[%04x] efl[%08x]\n", - saved_gdt.rd_limit, saved_gdt.rd_base, - saved_idt.rd_limit, saved_idt.rd_base, - saved_ldt, r_tr, r_efl); - printf("eax[%08x] ebx[%08x] ecx[%08x] edx[%08x]\n", - r_eax, r_ebx, r_ecx, r_edx); - printf("esi[%08x] edi[%08x] ebp[%08x] esp[%08x]\n", - r_esi, r_edi, r_ebp, r_esp); - printf("cr0[%08x] cr2[%08x] cr3[%08x] cr4[%08x]\n", - r_cr0, r_cr2, r_cr3, r_cr4); - printf("cs[%04x] ds[%04x] es[%04x] fs[%04x] gs[%04x] ss[%04x]\n", - r_cs, r_ds, r_es, r_fs, r_gs, r_ss); + + if (acpi_resume_beep != 0) + timer_spkr_release(); } -#define WAKECODE_FIXUP(offset, type, val) do { \ - type *addr; \ - addr = (type *)(sc->acpi_wakeaddr + offset); \ - *addr = val; \ -} while (0) +#ifdef SMP +static int +acpi_wakeup_ap(struct acpi_softc *sc, int cpu) +{ + int vector = (WAKECODE_PADDR(sc) >> 12) & 0xff; + int apic_id = cpu_apic_ids[cpu]; + int ms; + + WAKECODE_FIXUP(wakeup_pcb, struct pcb *, susppcbs[cpu]); + + /* do an INIT IPI: assert RESET */ + lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE | + APIC_LEVEL_ASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, apic_id); + + /* wait for pending status end */ + lapic_ipi_wait(-1); + + /* do an INIT IPI: deassert RESET */ + lapic_ipi_raw(APIC_DEST_ALLESELF | APIC_TRIGMOD_LEVEL | + APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, 0); + + /* wait for pending status end */ + DELAY(10000); /* wait ~10mS */ + lapic_ipi_wait(-1); -#define WAKECODE_BCOPY(offset, type, val) do { \ - void *addr; \ - addr = (void *)(sc->acpi_wakeaddr + offset); \ - bcopy(&(val), addr, sizeof(type)); \ -} while (0) + /* + * next we do a STARTUP IPI: the previous INIT IPI might still be + * latched, (P5 bug) this 1st STARTUP would then terminate + * immediately, and the previously started INIT IPI would continue. OR + * the previous INIT IPI has already run. and this STARTUP IPI will + * run. OR the previous INIT IPI was ignored. and this STARTUP IPI + * will run. + */ + + /* do a STARTUP IPI */ + lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE | + APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP | + vector, apic_id); + lapic_ipi_wait(-1); + DELAY(200); /* wait ~200uS */ + + /* + * finally we do a 2nd STARTUP IPI: this 2nd STARTUP IPI should run IF + * the previous STARTUP IPI was cancelled by a latched INIT IPI. OR + * this STARTUP IPI will be ignored, as only ONE STARTUP IPI is + * recognized after hardware RESET or INIT IPI. + */ + + lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE | + APIC_LEVEL_DEASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_STARTUP | + vector, apic_id); + lapic_ipi_wait(-1); + DELAY(200); /* wait ~200uS */ + + /* Wait up to 5 seconds for it to start. */ + for (ms = 0; ms < 5000; ms++) { + if (susppcbs[cpu]->pcb_eip == 0) + return (1); /* return SUCCESS */ + DELAY(1000); + } + return (0); /* return FAILURE */ +} + +#define WARMBOOT_TARGET 0 +#define WARMBOOT_OFF (KERNBASE + 0x0467) +#define WARMBOOT_SEG (KERNBASE + 0x0469) + +#define CMOS_REG (0x70) +#define CMOS_DATA (0x71) +#define BIOS_RESET (0x0f) +#define BIOS_WARM (0x0a) -/* Turn off bits 1&2 of the PIT, stopping the beep. */ static void -acpi_stop_beep(void *arg) +acpi_wakeup_cpus(struct acpi_softc *sc, const cpuset_t *wakeup_cpus) { - outb(0x61, inb(0x61) & ~0x3); + uint32_t mpbioswarmvec; + int cpu; + u_char mpbiosreason; + + /* save the current value of the warm-start vector */ + mpbioswarmvec = *((uint32_t *)WARMBOOT_OFF); + outb(CMOS_REG, BIOS_RESET); + mpbiosreason = inb(CMOS_DATA); + + /* setup a vector to our boot code */ + *((volatile u_short *)WARMBOOT_OFF) = WARMBOOT_TARGET; + *((volatile u_short *)WARMBOOT_SEG) = WAKECODE_PADDR(sc) >> 4; + outb(CMOS_REG, BIOS_RESET); + outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */ + + /* Wake up each AP. */ + for (cpu = 1; cpu < mp_ncpus; cpu++) { + if (!CPU_ISSET(cpu, wakeup_cpus)) + continue; + if (acpi_wakeup_ap(sc, cpu) == 0) { + /* restore the warmstart vector */ + *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; + panic("acpi_wakeup: failed to resume AP #%d (PHY #%d)", + cpu, cpu_apic_ids[cpu]); + } + } + + /* restore the warmstart vector */ + *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; + + outb(CMOS_REG, BIOS_RESET); + outb(CMOS_DATA, mpbiosreason); } +#endif int acpi_sleep_machdep(struct acpi_softc *sc, int state) { - ACPI_STATUS status; - struct pmap *pm; - int ret; - uint32_t cr3; - u_long ef; +#ifdef SMP + cpuset_t wakeup_cpus; +#endif + register_t cr3, rf; + ACPI_STATUS status; + struct pmap *pm; + int ret; ret = -1; - if (sc->acpi_wakeaddr == 0) + + if (sc->acpi_wakeaddr == 0ul) return (ret); - AcpiSetFirmwareWakingVector(sc->acpi_wakephys); +#ifdef SMP + wakeup_cpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &wakeup_cpus); +#endif + + if (acpi_resume_beep != 0) + timer_spkr_acquire(); - ef = intr_disable(); + AcpiSetFirmwareWakingVector(WAKECODE_PADDR(sc)); + + rf = intr_disable(); intr_suspend(); /* - * Temporarily switch to the kernel pmap because it provides an - * identity mapping (setup at boot) for the low physical memory - * region containing the wakeup code. + * Temporarily switch to the kernel pmap because it provides + * an identity mapping (setup at boot) for the low physical + * memory region containing the wakeup code. */ pm = kernel_pmap; cr3 = rcr3(); @@ -224,39 +251,22 @@ acpi_sleep_machdep(struct acpi_softc *sc load_cr3(vtophys(pm->pm_pdir)); #endif - ret_addr = 0; - if (acpi_savecpu()) { - /* Execute Sleep */ - - p_gdt = (struct region_descriptor *) - (sc->acpi_wakeaddr + physical_gdt); - p_gdt->rd_limit = saved_gdt.rd_limit; - p_gdt->rd_base = vtophys(saved_gdt.rd_base); - - WAKECODE_FIXUP(physical_esp, uint32_t, vtophys(r_esp)); - WAKECODE_FIXUP(previous_cr0, uint32_t, r_cr0); - WAKECODE_FIXUP(previous_cr2, uint32_t, r_cr2); - WAKECODE_FIXUP(previous_cr3, uint32_t, r_cr3); - WAKECODE_FIXUP(previous_cr4, uint32_t, r_cr4); - - WAKECODE_FIXUP(resume_beep, uint32_t, acpi_resume_beep); - WAKECODE_FIXUP(reset_video, uint32_t, acpi_reset_video); - - WAKECODE_FIXUP(previous_tr, uint16_t, r_tr); - WAKECODE_BCOPY(previous_gdt, struct region_descriptor, saved_gdt); - WAKECODE_FIXUP(previous_ldt, uint16_t, saved_ldt); - WAKECODE_BCOPY(previous_idt, struct region_descriptor, saved_idt); - - WAKECODE_FIXUP(where_to_recover, void *, acpi_restorecpu); - - WAKECODE_FIXUP(previous_ds, uint16_t, r_ds); - WAKECODE_FIXUP(previous_es, uint16_t, r_es); - WAKECODE_FIXUP(previous_fs, uint16_t, r_fs); - WAKECODE_FIXUP(previous_gs, uint16_t, r_gs); - WAKECODE_FIXUP(previous_ss, uint16_t, r_ss); + if (suspendctx(susppcbs[0])) { +#ifdef SMP + if (!CPU_EMPTY(&wakeup_cpus) && + suspend_cpus(wakeup_cpus) == 0) { + device_printf(sc->acpi_dev, "Failed to suspend APs\n"); + goto out; + } +#endif + + WAKECODE_FIXUP(resume_beep, uint8_t, (acpi_resume_beep != 0)); + WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0)); + + WAKECODE_FIXUP(wakeup_cr4, register_t, susppcbs[0]->pcb_cr4); + WAKECODE_FIXUP(wakeup_cr3, register_t, susppcbs[0]->pcb_cr3); - if (bootverbose) - acpi_printcpu(); + WAKECODE_FIXUP(wakeup_pcb, struct pcb *, susppcbs[0]); /* Call ACPICA to enter the desired sleep state */ if (state == ACPI_STATE_S4 && sc->acpi_s4bios) @@ -266,8 +276,8 @@ acpi_sleep_machdep(struct acpi_softc *sc if (status != AE_OK) { device_printf(sc->acpi_dev, - "AcpiEnterSleepState failed - %s\n", - AcpiFormatException(status)); + "AcpiEnterSleepState failed - %s\n", + AcpiFormatException(status)); goto out; } @@ -275,97 +285,96 @@ acpi_sleep_machdep(struct acpi_softc *sc ia32_pause(); } else { pmap_init_pat(); + initializecpu(); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); - if (bootverbose) { - acpi_savecpu(); - acpi_printcpu(); - } +#ifdef SMP + if (!CPU_EMPTY(&wakeup_cpus)) + acpi_wakeup_cpus(sc, &wakeup_cpus); +#endif ret = 0; } out: +#ifdef SMP + if (!CPU_EMPTY(&wakeup_cpus)) + restart_cpus(wakeup_cpus); +#endif + load_cr3(cr3); mca_resume(); intr_resume(); - intr_restore(ef); + intr_restore(rf); + + AcpiSetFirmwareWakingVector(0); if (ret == 0 && mem_range_softc.mr_op != NULL && mem_range_softc.mr_op->reinit != NULL) mem_range_softc.mr_op->reinit(&mem_range_softc); - /* If we beeped, turn it off after a delay. */ - if (acpi_resume_beep) - timeout(acpi_stop_beep, NULL, 3 * hz); - return (ret); } -static bus_dma_tag_t acpi_waketag; -static bus_dmamap_t acpi_wakemap; -static vm_offset_t acpi_wakeaddr; - -static void +static void * acpi_alloc_wakeup_handler(void) { - void *wakeaddr; - - if (!cold) - return; + void *wakeaddr; + int i; /* * Specify the region for our wakeup code. We want it in the low 1 MB - * region, excluding video memory and above (0xa0000). We ask for - * it to be page-aligned, just to be safe. + * region, excluding real mode IVT (0-0x3ff), BDA (0x400-0x4ff), EBDA + * (less than 128KB, below 0xa0000, must be excluded by SMAP and DSDT), + * and ROM area (0xa0000 and above). The temporary page tables must be + * page-aligned. */ - if (bus_dma_tag_create(/*parent*/ NULL, - /*alignment*/ PAGE_SIZE, /*no boundary*/ 0, - /*lowaddr*/ 0x9ffff, /*highaddr*/ BUS_SPACE_MAXADDR, NULL, NULL, - /*maxsize*/ PAGE_SIZE, /*segments*/ 1, /*maxsegsize*/ PAGE_SIZE, - 0, busdma_lock_mutex, &Giant, &acpi_waketag) != 0) { - printf("acpi_alloc_wakeup_handler: can't create wake tag\n"); - return; + wakeaddr = contigmalloc((ACPI_PAGETABLES + 1) * PAGE_SIZE, M_DEVBUF, + M_NOWAIT, 0x500, 0xa0000, PAGE_SIZE, 0ul); + if (wakeaddr == NULL) { + printf("%s: can't alloc wake memory\n", __func__); + return (NULL); } - if (bus_dmamem_alloc(acpi_waketag, &wakeaddr, BUS_DMA_NOWAIT, - &acpi_wakemap) != 0) { - printf("acpi_alloc_wakeup_handler: can't alloc wake memory\n"); - return; + if (EVENTHANDLER_REGISTER(power_resume, acpi_stop_beep, NULL, + EVENTHANDLER_PRI_LAST) == NULL) { + printf("%s: can't register event handler\n", __func__); + contigfree(wakeaddr, (ACPI_PAGETABLES + 1) * PAGE_SIZE, M_DEVBUF); + return (NULL); } - acpi_wakeaddr = (vm_offset_t)wakeaddr; -} - -SYSINIT(acpiwakeup, SI_SUB_KMEM, SI_ORDER_ANY, acpi_alloc_wakeup_handler, 0); - -static void -acpi_realmodeinst(void *arg, bus_dma_segment_t *segs, int nsegs, int error) -{ - struct acpi_softc *sc; - uint32_t *addr; - - /* Overwrite the ljmp target with the real address */ - sc = arg; - sc->acpi_wakephys = segs[0].ds_addr; - addr = (uint32_t *)&wakecode[wakeup_sw32 + 2]; - *addr = sc->acpi_wakephys + wakeup_32; - - /* Copy the wake code into our low page and save its physical addr. */ - bcopy(wakecode, (void *)sc->acpi_wakeaddr, sizeof(wakecode)); - if (bootverbose) { - device_printf(sc->acpi_dev, "wakeup code va %#x pa %#jx\n", - acpi_wakeaddr, (uintmax_t)sc->acpi_wakephys); + susppcbs = malloc(mp_ncpus * sizeof(*susppcbs), M_DEVBUF, M_WAITOK); + for (i = 0; i < mp_ncpus; i++) { + susppcbs[i] = malloc(sizeof(**susppcbs), M_DEVBUF, M_WAITOK); } + + return (wakeaddr); } void acpi_install_wakeup_handler(struct acpi_softc *sc) { - if (acpi_wakeaddr == 0) + static void *wakeaddr = NULL; + + if (wakeaddr != NULL) return; - sc->acpi_waketag = acpi_waketag; - sc->acpi_wakeaddr = acpi_wakeaddr; - sc->acpi_wakemap = acpi_wakemap; + wakeaddr = acpi_alloc_wakeup_handler(); + if (wakeaddr == NULL) + return; + + sc->acpi_wakeaddr = (vm_offset_t)wakeaddr; + sc->acpi_wakephys = vtophys(wakeaddr); + + bcopy(wakecode, (void *)WAKECODE_VADDR(sc), sizeof(wakecode)); - bus_dmamap_load(sc->acpi_waketag, sc->acpi_wakemap, - (void *)sc->acpi_wakeaddr, PAGE_SIZE, acpi_realmodeinst, sc, 0); + /* Patch GDT base address, ljmp target. */ + WAKECODE_FIXUP((bootgdtdesc + 2), uint32_t, + WAKECODE_PADDR(sc) + bootgdt); + WAKECODE_FIXUP((wakeup_sw32 + 2), uint32_t, + WAKECODE_PADDR(sc) + wakeup_32); + + /* Save pointers to some global data. */ + WAKECODE_FIXUP(wakeup_ret, void *, resumectx); + + if (bootverbose) + device_printf(sc->acpi_dev, "wakeup code va %p pa %p\n", + (void *)sc->acpi_wakeaddr, (void *)sc->acpi_wakephys); } Modified: head/sys/i386/i386/apic_vector.s ============================================================================== --- head/sys/i386/i386/apic_vector.s Fri May 18 18:53:28 2012 (r235621) +++ head/sys/i386/i386/apic_vector.s Fri May 18 18:55:58 2012 (r235622) @@ -334,6 +334,24 @@ IDTVEC(cpustop) iret /* + * Executed by a CPU when it receives an IPI_SUSPEND from another CPU. + */ + .text + SUPERALIGN_TEXT +IDTVEC(cpususpend) + PUSH_FRAME + SET_KERNEL_SREGS + cld + + movl lapic, %eax + movl $0, LA_EOI(%eax) /* End Of Interrupt to APIC */ + + call cpususpend_handler + + POP_FRAME + jmp doreti_iret + +/* * Executed by a CPU when it receives a RENDEZVOUS IPI from another CPU. * * - Calls the generic rendezvous action function. Modified: head/sys/i386/i386/genassym.c ============================================================================== --- head/sys/i386/i386/genassym.c Fri May 18 18:53:28 2012 (r235621) +++ head/sys/i386/i386/genassym.c Fri May 18 18:55:58 2012 (r235622) @@ -121,7 +121,10 @@ ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADD ASSYM(KERNBASE, KERNBASE); ASSYM(KERNLOAD, KERNLOAD); ASSYM(MCLBYTES, MCLBYTES); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri May 18 19:02:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3EBE1065692; Fri, 18 May 2012 19:02:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC4618FC0C; Fri, 18 May 2012 19:02:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4IJ2etN070509; Fri, 18 May 2012 19:02:40 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4IJ2ecZ070498; Fri, 18 May 2012 19:02:40 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201205181902.q4IJ2ecZ070498@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 18 May 2012 19:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235623 - in head/contrib/gcc: . config/rs6000 config/sparc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 19:02:40 -0000 Author: pfg Date: Fri May 18 19:02:39 2012 New Revision: 235623 URL: http://svn.freebsd.org/changeset/base/235623 Log: Bring in a subset of gcc fixes that were back ported to the GCC 4.1 branch and are available under GPLv2. 2007-11-07 Eric Botcazou PR rtl-optimization/33822 * rtl.h (REG_OFFSET): Fix comment. * var-tracking.c (INT_MEM_OFFSET): New macro. (var_mem_set): Use it. (var_mem_delete_and_set): Likewise. (var_mem_delete): Likewise. (vt_get_decl_and_offset): Likewise. (offset_valid_for_tracked_p): New predicate. (count_uses): Do not track locations with invalid offsets. (add_uses): Likewise. (add_stores): Likewise. http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129972 2007-11-16 Richard Guenther PR middle-end/34030 * fold-const.c (fold_binary): Use correct types for folding 1 << X & Y to Y >> X & 1. http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130242 2008-01-14 Eric Botcazou PR rtl-optimization/31944 * cse.c (remove_pseudo_from_table): New function. (merge_equiv_classes): Use above function to remove pseudo-registers. (invalidate): Likewise http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131524 2008-01-24 Kaveh R. Ghazi Backport: 2007-11-07 Kenneth Zadeck PR middle-end/33826 * ipa-pure-const (static_execute): Added code to keep recursive functions from being marked as pure or const. * ipa-utils (searchc): Fixed comment. http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131807 2008-02-01 Kaveh R. Ghazi Backport: 2007-08-02 Nathan Froyd PR middle-end/25445 * varasm.c (default_binds_local_p_1): Consult flag_whole_program if we are compiling with -fPIC. http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132061 2008-02-04 Richard Guenther PR middle-end/33631 * expr.c (count_type_elements): Give for unions instead of guessing. http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132101 2008-02-14 Alan Modra PR target/34393 * config/rs6000/rs6000.md (restore_stack_block): Force operands[1] to a reg. http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132309 2008-03-25 Richard Guenther Backport from mainline: 2008-02-12 Richard Guenther PR middle-end/35163 * fold-const.c (fold_widened_comparison): Use get_unwidened in value-preserving mode. Disallow final truncation. http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133509 2008-11-30 Eric Botcazou PR target/38287 * config/sparc/sparc.md (divsi3 expander): Remove constraints. (divsi3_sp32): Add new alternative with 'K' for operand #2. (cmp_sdiv_cc_set): Factor common string. (udivsi3_sp32): Add new alternative with 'K' for operand #2. Add TARGET_V9 case. (cmp_udiv_cc_set): Factor common string. http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142298 Reviewed by: mm Approved by: jhb (mentor) MFC after: 1 week Modified: head/contrib/gcc/config/rs6000/rs6000.md head/contrib/gcc/config/sparc/sparc.md head/contrib/gcc/cse.c head/contrib/gcc/expr.c head/contrib/gcc/fold-const.c head/contrib/gcc/ipa-pure-const.c head/contrib/gcc/ipa-utils.c head/contrib/gcc/rtl.h head/contrib/gcc/var-tracking.c head/contrib/gcc/varasm.c Modified: head/contrib/gcc/config/rs6000/rs6000.md ============================================================================== --- head/contrib/gcc/config/rs6000/rs6000.md Fri May 18 18:55:58 2012 (r235622) +++ head/contrib/gcc/config/rs6000/rs6000.md Fri May 18 19:02:39 2012 (r235623) @@ -10075,6 +10075,7 @@ "" " { + operands[1] = force_reg (Pmode, operands[1]); operands[2] = gen_reg_rtx (Pmode); operands[3] = gen_frame_mem (Pmode, operands[0]); operands[4] = gen_frame_mem (Pmode, operands[1]); Modified: head/contrib/gcc/config/sparc/sparc.md ============================================================================== --- head/contrib/gcc/config/sparc/sparc.md Fri May 18 18:55:58 2012 (r235622) +++ head/contrib/gcc/config/sparc/sparc.md Fri May 18 19:02:39 2012 (r235623) @@ -5071,14 +5071,11 @@ [(set_attr "type" "multi") (set_attr "length" "2")]) -;; The V8 architecture specifies that there must be 3 instructions between -;; a Y register write and a use of it for correct results. - (define_expand "divsi3" - [(parallel [(set (match_operand:SI 0 "register_operand" "=r,r") - (div:SI (match_operand:SI 1 "register_operand" "r,r") - (match_operand:SI 2 "input_operand" "rI,m"))) - (clobber (match_scratch:SI 3 "=&r,&r"))])] + [(parallel [(set (match_operand:SI 0 "register_operand" "") + (div:SI (match_operand:SI 1 "register_operand" "") + (match_operand:SI 2 "input_operand" ""))) + (clobber (match_scratch:SI 3 ""))])] "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS" { if (TARGET_ARCH64) @@ -5091,24 +5088,40 @@ } }) +;; The V8 architecture specifies that there must be at least 3 instructions +;; between a write to the Y register and a use of it for correct results. +;; We try to fill one of them with a simple constant or a memory load. + (define_insn "divsi3_sp32" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (div:SI (match_operand:SI 1 "register_operand" "r,r") - (match_operand:SI 2 "input_operand" "rI,m"))) - (clobber (match_scratch:SI 3 "=&r,&r"))] - "(TARGET_V8 || TARGET_DEPRECATED_V8_INSNS) - && TARGET_ARCH32" -{ - if (which_alternative == 0) - if (TARGET_V9) - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tsdiv\t%1, %2, %0"; - else - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tnop\n\tnop\n\tnop\n\tsdiv\t%1, %2, %0"; - else - if (TARGET_V9) - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tld\t%2, %3\n\tsdiv\t%1, %3, %0"; - else - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tld\t%2, %3\n\tnop\n\tnop\n\tsdiv\t%1, %3, %0"; + [(set (match_operand:SI 0 "register_operand" "=r,r,r") + (div:SI (match_operand:SI 1 "register_operand" "r,r,r") + (match_operand:SI 2 "input_operand" "rI,K,m"))) + (clobber (match_scratch:SI 3 "=&r,&r,&r"))] + "(TARGET_V8 || TARGET_DEPRECATED_V8_INSNS) && TARGET_ARCH32" +{ + output_asm_insn ("sra\t%1, 31, %3", operands); + output_asm_insn ("wr\t%3, 0, %%y", operands); + + switch (which_alternative) + { + case 0: + if (TARGET_V9) + return "sdiv\t%1, %2, %0"; + else + return "nop\n\tnop\n\tnop\n\tsdiv\t%1, %2, %0"; + case 1: + if (TARGET_V9) + return "sethi\t%%hi(%a2), %3\n\tsdiv\t%1, %3, %0"; + else + return "sethi\t%%hi(%a2), %3\n\tnop\n\tnop\n\tsdiv\t%1, %3, %0"; + case 2: + if (TARGET_V9) + return "ld\t%2, %3\n\tsdiv\t%1, %3, %0"; + else + return "ld\t%2, %3\n\tnop\n\tnop\n\tsdiv\t%1, %3, %0"; + default: + gcc_unreachable (); + } } [(set_attr "type" "multi") (set (attr "length") @@ -5143,10 +5156,13 @@ (clobber (match_scratch:SI 3 "=&r"))] "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS" { + output_asm_insn ("sra\t%1, 31, %3", operands); + output_asm_insn ("wr\t%3, 0, %%y", operands); + if (TARGET_V9) - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tsdivcc\t%1, %2, %0"; + return "sdivcc\t%1, %2, %0"; else - return "sra\t%1, 31, %3\n\twr\t%3, 0, %%y\n\tnop\n\tnop\n\tnop\n\tsdivcc\t%1, %2, %0"; + return "nop\n\tnop\n\tnop\n\tsdivcc\t%1, %2, %0"; } [(set_attr "type" "multi") (set (attr "length") @@ -5161,29 +5177,48 @@ "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS" "") -;; The V8 architecture specifies that there must be 3 instructions between -;; a Y register write and a use of it for correct results. +;; The V8 architecture specifies that there must be at least 3 instructions +;; between a write to the Y register and a use of it for correct results. +;; We try to fill one of them with a simple constant or a memory load. (define_insn "udivsi3_sp32" - [(set (match_operand:SI 0 "register_operand" "=r,&r,&r") - (udiv:SI (match_operand:SI 1 "nonimmediate_operand" "r,r,m") - (match_operand:SI 2 "input_operand" "rI,m,r")))] - "(TARGET_V8 || TARGET_DEPRECATED_V8_INSNS) - && TARGET_ARCH32" + [(set (match_operand:SI 0 "register_operand" "=r,&r,&r,&r") + (udiv:SI (match_operand:SI 1 "nonimmediate_operand" "r,r,r,m") + (match_operand:SI 2 "input_operand" "rI,K,m,r")))] + "(TARGET_V8 || TARGET_DEPRECATED_V8_INSNS) && TARGET_ARCH32" { - output_asm_insn ("wr\t%%g0, %%g0, %%y", operands); + output_asm_insn ("wr\t%%g0, 0, %%y", operands); + switch (which_alternative) { - default: - return "nop\n\tnop\n\tnop\n\tudiv\t%1, %2, %0"; + case 0: + if (TARGET_V9) + return "udiv\t%1, %2, %0"; + else + return "nop\n\tnop\n\tnop\n\tudiv\t%1, %2, %0"; case 1: - return "ld\t%2, %0\n\tnop\n\tnop\n\tudiv\t%1, %0, %0"; + if (TARGET_V9) + return "sethi\t%%hi(%a2), %0\n\tudiv\t%1, %0, %0"; + else + return "sethi\t%%hi(%a2), %0\n\tnop\n\tnop\n\tudiv\t%1, %0, %0"; case 2: - return "ld\t%1, %0\n\tnop\n\tnop\n\tudiv\t%0, %2, %0"; + if (TARGET_V9) + return "ld\t%2, %0\n\tudiv\t%1, %0, %0"; + else + return "ld\t%2, %0\n\tnop\n\tnop\n\tudiv\t%1, %0, %0"; + case 3: + if (TARGET_V9) + return "ld\t%1, %0\n\tudiv\t%0, %2, %0"; + else + return "ld\t%1, %0\n\tnop\n\tnop\n\tudiv\t%0, %2, %0"; + default: + gcc_unreachable (); } } [(set_attr "type" "multi") - (set_attr "length" "5")]) + (set (attr "length") + (if_then_else (eq_attr "isa" "v9") + (const_int 3) (const_int 5)))]) (define_insn "udivsi3_sp64" [(set (match_operand:SI 0 "register_operand" "=r") @@ -5209,13 +5244,14 @@ (const_int 0))) (set (match_operand:SI 0 "register_operand" "=r") (udiv:SI (match_dup 1) (match_dup 2)))] - "TARGET_V8 - || TARGET_DEPRECATED_V8_INSNS" + "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS" { + output_asm_insn ("wr\t%%g0, 0, %%y", operands); + if (TARGET_V9) - return "wr\t%%g0, %%g0, %%y\n\tudivcc\t%1, %2, %0"; + return "udivcc\t%1, %2, %0"; else - return "wr\t%%g0, %%g0, %%y\n\tnop\n\tnop\n\tnop\n\tudivcc\t%1, %2, %0"; + return "nop\n\tnop\n\tnop\n\tudivcc\t%1, %2, %0"; } [(set_attr "type" "multi") (set (attr "length") Modified: head/contrib/gcc/cse.c ============================================================================== --- head/contrib/gcc/cse.c Fri May 18 18:55:58 2012 (r235622) +++ head/contrib/gcc/cse.c Fri May 18 19:02:39 2012 (r235623) @@ -583,7 +583,8 @@ static void delete_reg_equiv (unsigned i static int mention_regs (rtx); static int insert_regs (rtx, struct table_elt *, int); static void remove_from_table (struct table_elt *, unsigned); -static struct table_elt *lookup (rtx, unsigned, enum machine_mode); +static void remove_pseudo_from_table (rtx, unsigned); +static struct table_elt *lookup (rtx, unsigned, enum machine_mode); static struct table_elt *lookup_for_remove (rtx, unsigned, enum machine_mode); static rtx lookup_as_function (rtx, enum rtx_code); static struct table_elt *insert (rtx, struct table_elt *, unsigned, @@ -1381,6 +1382,19 @@ remove_from_table (struct table_elt *elt table_size--; } +/* Same as above, but X is a pseudo-register. */ + +static void +remove_pseudo_from_table (rtx x, unsigned int hash) +{ + struct table_elt *elt; + + /* Because a pseudo-register can be referenced in more than one + mode, we might have to remove more than one table entry. */ + while ((elt = lookup_for_remove (x, hash, VOIDmode))) + remove_from_table (elt, hash); +} + /* Look up X in the hash table and return its table element, or 0 if X is not in the table. @@ -1707,7 +1721,10 @@ merge_equiv_classes (struct table_elt *c delete_reg_equiv (REGNO (exp)); } - remove_from_table (elt, hash); + if (REG_P (exp) && REGNO (exp) >= FIRST_PSEUDO_REGISTER) + remove_pseudo_from_table (exp, hash); + else + remove_from_table (elt, hash); if (insert_regs (exp, class1, 0) || need_rehash) { @@ -1803,14 +1820,7 @@ invalidate (rtx x, enum machine_mode ful SUBREG_TICKED (regno) = -1; if (regno >= FIRST_PSEUDO_REGISTER) - { - /* Because a register can be referenced in more than one mode, - we might have to remove more than one table entry. */ - struct table_elt *elt; - - while ((elt = lookup_for_remove (x, hash, GET_MODE (x)))) - remove_from_table (elt, hash); - } + remove_pseudo_from_table (x, hash); else { HOST_WIDE_INT in_table Modified: head/contrib/gcc/expr.c ============================================================================== --- head/contrib/gcc/expr.c Fri May 18 18:55:58 2012 (r235622) +++ head/contrib/gcc/expr.c Fri May 18 19:02:39 2012 (r235623) @@ -4750,14 +4750,7 @@ count_type_elements (tree type, bool all case UNION_TYPE: case QUAL_UNION_TYPE: - { - /* Ho hum. How in the world do we guess here? Clearly it isn't - right to count the fields. Guess based on the number of words. */ - HOST_WIDE_INT n = int_size_in_bytes (type); - if (n < 0) - return -1; - return n / UNITS_PER_WORD; - } + return -1; case COMPLEX_TYPE: return 2; Modified: head/contrib/gcc/fold-const.c ============================================================================== --- head/contrib/gcc/fold-const.c Fri May 18 18:55:58 2012 (r235622) +++ head/contrib/gcc/fold-const.c Fri May 18 19:02:39 2012 (r235623) @@ -6657,12 +6657,14 @@ fold_widened_comparison (enum tree_code if (TYPE_PRECISION (TREE_TYPE (arg0)) <= TYPE_PRECISION (shorter_type)) return NULL_TREE; - arg1_unw = get_unwidened (arg1, shorter_type); + arg1_unw = get_unwidened (arg1, NULL_TREE); /* If possible, express the comparison in the shorter mode. */ if ((code == EQ_EXPR || code == NE_EXPR || TYPE_UNSIGNED (TREE_TYPE (arg0)) == TYPE_UNSIGNED (shorter_type)) && (TREE_TYPE (arg1_unw) == shorter_type + || (TYPE_PRECISION (shorter_type) + >= TYPE_PRECISION (TREE_TYPE (arg1_unw))) || (TREE_CODE (arg1_unw) == INTEGER_CST && (TREE_CODE (shorter_type) == INTEGER_TYPE || TREE_CODE (shorter_type) == BOOLEAN_TYPE) @@ -10647,24 +10649,24 @@ fold_binary (enum tree_code code, tree t tree arg01 = TREE_OPERAND (arg0, 1); if (TREE_CODE (arg00) == LSHIFT_EXPR && integer_onep (TREE_OPERAND (arg00, 0))) - return - fold_build2 (code, type, - build2 (BIT_AND_EXPR, TREE_TYPE (arg0), - build2 (RSHIFT_EXPR, TREE_TYPE (arg00), - arg01, TREE_OPERAND (arg00, 1)), - fold_convert (TREE_TYPE (arg0), - integer_one_node)), - arg1); - else if (TREE_CODE (TREE_OPERAND (arg0, 1)) == LSHIFT_EXPR - && integer_onep (TREE_OPERAND (TREE_OPERAND (arg0, 1), 0))) - return - fold_build2 (code, type, - build2 (BIT_AND_EXPR, TREE_TYPE (arg0), - build2 (RSHIFT_EXPR, TREE_TYPE (arg01), - arg00, TREE_OPERAND (arg01, 1)), - fold_convert (TREE_TYPE (arg0), - integer_one_node)), - arg1); + { + tree tem = fold_build2 (RSHIFT_EXPR, TREE_TYPE (arg00), + arg01, TREE_OPERAND (arg00, 1)); + tem = fold_build2 (BIT_AND_EXPR, TREE_TYPE (arg0), tem, + build_int_cst (TREE_TYPE (arg0), 1)); + return fold_build2 (code, type, + fold_convert (TREE_TYPE (arg1), tem), arg1); + } + else if (TREE_CODE (arg01) == LSHIFT_EXPR + && integer_onep (TREE_OPERAND (arg01, 0))) + { + tree tem = fold_build2 (RSHIFT_EXPR, TREE_TYPE (arg01), + arg00, TREE_OPERAND (arg01, 1)); + tem = fold_build2 (BIT_AND_EXPR, TREE_TYPE (arg0), tem, + build_int_cst (TREE_TYPE (arg0), 1)); + return fold_build2 (code, type, + fold_convert (TREE_TYPE (arg1), tem), arg1); + } } /* If this is an NE or EQ comparison of zero against the result of a Modified: head/contrib/gcc/ipa-pure-const.c ============================================================================== --- head/contrib/gcc/ipa-pure-const.c Fri May 18 18:55:58 2012 (r235622) +++ head/contrib/gcc/ipa-pure-const.c Fri May 18 19:02:39 2012 (r235623) @@ -639,6 +639,7 @@ static_execute (void) for (i = 0; i < order_pos; i++ ) { enum pure_const_state_e pure_const_state = IPA_CONST; + int count = 0; node = order[i]; /* Find the worst state for any node in the cycle. */ @@ -655,11 +656,40 @@ static_execute (void) if (!w_l->state_set_in_source) { struct cgraph_edge *e; + count++; + + /* FIXME!!! Because of pr33826, we cannot have either + immediate or transitive recursive functions marked as + pure or const because dce can delete a function that + is in reality an infinite loop. A better solution + than just outlawing them is to add another bit the + functions to distinguish recursive from non recursive + pure and const function. This would allow the + recursive ones to be cse'd but not dce'd. In this + same vein, we could allow functions with loops to + also be cse'd but not dce'd. + + Unfortunately we are late in stage 3, and the fix + described above is is not appropriate. */ + if (count > 1) + { + pure_const_state = IPA_NEITHER; + break; + } + for (e = w->callees; e; e = e->next_callee) { struct cgraph_node *y = e->callee; /* Only look at the master nodes and skip external nodes. */ y = cgraph_master_clone (y); + + /* Check for immediate recursive functions. See the + FIXME above. */ + if (w == y) + { + pure_const_state = IPA_NEITHER; + break; + } if (y) { funct_state y_l = get_function_state (y); Modified: head/contrib/gcc/ipa-utils.c ============================================================================== --- head/contrib/gcc/ipa-utils.c Fri May 18 18:55:58 2012 (r235622) +++ head/contrib/gcc/ipa-utils.c Fri May 18 19:02:39 2012 (r235623) @@ -78,7 +78,7 @@ struct searchc_env { has been customized for cgraph_nodes. The env parameter is because it is recursive and there are no nested functions here. This function should only be called from itself or - cgraph_reduced_inorder. ENV is a stack env and would be + ipa_utils_reduced_inorder. ENV is a stack env and would be unnecessary if C had nested functions. V is the node to start searching from. */ Modified: head/contrib/gcc/rtl.h ============================================================================== --- head/contrib/gcc/rtl.h Fri May 18 18:55:58 2012 (r235622) +++ head/contrib/gcc/rtl.h Fri May 18 19:02:39 2012 (r235623) @@ -1189,8 +1189,8 @@ do { \ refer to part of a DECL. */ #define REG_EXPR(RTX) (REG_ATTRS (RTX) == 0 ? 0 : REG_ATTRS (RTX)->decl) -/* For a MEM rtx, the offset from the start of MEM_DECL, if known, as a - RTX that is always a CONST_INT. */ +/* For a REG rtx, the offset from the start of REG_EXPR, if known, as an + HOST_WIDE_INT. */ #define REG_OFFSET(RTX) (REG_ATTRS (RTX) == 0 ? 0 : REG_ATTRS (RTX)->offset) /* Copy the attributes that apply to memory locations from RHS to LHS. */ Modified: head/contrib/gcc/var-tracking.c ============================================================================== --- head/contrib/gcc/var-tracking.c Fri May 18 18:55:58 2012 (r235622) +++ head/contrib/gcc/var-tracking.c Fri May 18 19:02:39 2012 (r235623) @@ -259,6 +259,9 @@ typedef struct variable_def /* Pointer to the BB's information specific to variable tracking pass. */ #define VTI(BB) ((variable_tracking_info) (BB)->aux) +/* Macro to access MEM_OFFSET as an HOST_WIDE_INT. Evaluates MEM twice. */ +#define INT_MEM_OFFSET(mem) (MEM_OFFSET (mem) ? INTVAL (MEM_OFFSET (mem)) : 0) + /* Alloc pool for struct attrs_def. */ static alloc_pool attrs_pool; @@ -927,7 +930,7 @@ static void var_mem_set (dataflow_set *set, rtx loc) { tree decl = MEM_EXPR (loc); - HOST_WIDE_INT offset = MEM_OFFSET (loc) ? INTVAL (MEM_OFFSET (loc)) : 0; + HOST_WIDE_INT offset = INT_MEM_OFFSET (loc); decl = var_debug_decl (decl); @@ -945,7 +948,7 @@ static void var_mem_delete_and_set (dataflow_set *set, rtx loc, bool modify) { tree decl = MEM_EXPR (loc); - HOST_WIDE_INT offset = MEM_OFFSET (loc) ? INTVAL (MEM_OFFSET (loc)) : 0; + HOST_WIDE_INT offset = INT_MEM_OFFSET (loc); decl = var_debug_decl (decl); @@ -962,7 +965,7 @@ static void var_mem_delete (dataflow_set *set, rtx loc, bool clobber) { tree decl = MEM_EXPR (loc); - HOST_WIDE_INT offset = MEM_OFFSET (loc) ? INTVAL (MEM_OFFSET (loc)) : 0; + HOST_WIDE_INT offset = INT_MEM_OFFSET (loc); decl = var_debug_decl (decl); if (clobber) @@ -1540,6 +1543,18 @@ track_expr_p (tree expr) return 1; } +/* Return true if OFFSET is a valid offset for a register or memory + access we want to track. This is used to reject out-of-bounds + accesses that can cause assertions to fail later. Note that we + don't reject negative offsets because they can be generated for + paradoxical subregs on big-endian architectures. */ + +static inline bool +offset_valid_for_tracked_p (HOST_WIDE_INT offset) +{ + return (-MAX_VAR_PARTS < offset) && (offset < MAX_VAR_PARTS); +} + /* Determine whether a given LOC refers to the same variable part as EXPR+OFFSET. */ @@ -1560,7 +1575,7 @@ same_variable_part_p (rtx loc, tree expr else if (MEM_P (loc)) { expr2 = MEM_EXPR (loc); - offset2 = MEM_OFFSET (loc) ? INTVAL (MEM_OFFSET (loc)) : 0; + offset2 = INT_MEM_OFFSET (loc); } else return false; @@ -1590,7 +1605,8 @@ count_uses (rtx *loc, void *insn) } else if (MEM_P (*loc) && MEM_EXPR (*loc) - && track_expr_p (MEM_EXPR (*loc))) + && track_expr_p (MEM_EXPR (*loc)) + && offset_valid_for_tracked_p (INT_MEM_OFFSET (*loc))) { VTI (bb)->n_mos++; } @@ -1626,14 +1642,19 @@ add_uses (rtx *loc, void *insn) basic_block bb = BLOCK_FOR_INSN ((rtx) insn); micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++; - mo->type = ((REG_EXPR (*loc) && track_expr_p (REG_EXPR (*loc))) - ? MO_USE : MO_USE_NO_VAR); + if (REG_EXPR (*loc) + && track_expr_p (REG_EXPR (*loc)) + && offset_valid_for_tracked_p (REG_OFFSET (*loc))) + mo->type = MO_USE; + else + mo->type = MO_USE_NO_VAR; mo->u.loc = *loc; mo->insn = (rtx) insn; } else if (MEM_P (*loc) && MEM_EXPR (*loc) - && track_expr_p (MEM_EXPR (*loc))) + && track_expr_p (MEM_EXPR (*loc)) + && offset_valid_for_tracked_p (INT_MEM_OFFSET (*loc))) { basic_block bb = BLOCK_FOR_INSN ((rtx) insn); micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++; @@ -1667,8 +1688,9 @@ add_stores (rtx loc, rtx expr, void *ins micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++; if (GET_CODE (expr) == CLOBBER - || ! REG_EXPR (loc) - || ! track_expr_p (REG_EXPR (loc))) + || !(REG_EXPR (loc) + && track_expr_p (REG_EXPR (loc)) + && offset_valid_for_tracked_p (REG_OFFSET (loc)))) mo->type = MO_CLOBBER; else if (GET_CODE (expr) == SET && SET_DEST (expr) == loc @@ -1683,7 +1705,8 @@ add_stores (rtx loc, rtx expr, void *ins } else if (MEM_P (loc) && MEM_EXPR (loc) - && track_expr_p (MEM_EXPR (loc))) + && track_expr_p (MEM_EXPR (loc)) + && offset_valid_for_tracked_p (INT_MEM_OFFSET (loc))) { basic_block bb = BLOCK_FOR_INSN ((rtx) insn); micro_operation *mo = VTI (bb)->mos + VTI (bb)->n_mos++; @@ -1694,8 +1717,7 @@ add_stores (rtx loc, rtx expr, void *ins && SET_DEST (expr) == loc && same_variable_part_p (SET_SRC (expr), MEM_EXPR (loc), - MEM_OFFSET (loc) - ? INTVAL (MEM_OFFSET (loc)) : 0)) + INT_MEM_OFFSET (loc))) mo->type = MO_COPY; else mo->type = MO_SET; @@ -2726,7 +2748,7 @@ vt_get_decl_and_offset (rtx rtl, tree *d if (MEM_ATTRS (rtl)) { *declp = MEM_EXPR (rtl); - *offsetp = MEM_OFFSET (rtl) ? INTVAL (MEM_OFFSET (rtl)) : 0; + *offsetp = INT_MEM_OFFSET (rtl); return true; } } Modified: head/contrib/gcc/varasm.c ============================================================================== --- head/contrib/gcc/varasm.c Fri May 18 18:55:58 2012 (r235622) +++ head/contrib/gcc/varasm.c Fri May 18 19:02:39 2012 (r235623) @@ -5876,9 +5876,10 @@ default_binds_local_p_1 (tree exp, int s else if (DECL_WEAK (exp)) local_p = false; /* If PIC, then assume that any global name can be overridden by - symbols resolved from other modules. */ + symbols resolved from other modules, unless we are compiling with + -fwhole-program, which assumes that names are local. */ else if (shlib) - local_p = false; + local_p = flag_whole_program; /* Uninitialized COMMON variable may be unified with symbols resolved from other modules. */ else if (DECL_COMMON (exp) From owner-svn-src-head@FreeBSD.ORG Fri May 18 20:34:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B776B106564A; Fri, 18 May 2012 20:34:08 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A28568FC0A; Fri, 18 May 2012 20:34:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4IKY8le079233; Fri, 18 May 2012 20:34:08 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4IKY8Mi079231; Fri, 18 May 2012 20:34:08 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201205182034.q4IKY8Mi079231@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 18 May 2012 20:34:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235628 - head/share/dtrace X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 20:34:08 -0000 Author: gnn Date: Fri May 18 20:34:08 2012 New Revision: 235628 URL: http://svn.freebsd.org/changeset/base/235628 Log: Fix a case typo. Pointed out by: jlh@ Modified: head/share/dtrace/README Modified: head/share/dtrace/README ============================================================================== --- head/share/dtrace/README Fri May 18 20:24:31 2012 (r235627) +++ head/share/dtrace/README Fri May 18 20:34:08 2012 (r235628) @@ -2,7 +2,7 @@ $FreeBSD$ This directory contains scripts for use with the DTrace system. The toolkit/ directory contains the latest vendor import of Brendan -Gregg's DTRaceToolkit while all the other files and directories +Gregg's DTraceToolkit while all the other files and directories contain code generated by the FreeBSD Project for use with DTrace on FreeBSD. From owner-svn-src-head@FreeBSD.ORG Fri May 18 21:49:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6F53610657ED; Fri, 18 May 2012 21:49:41 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AED98FC0A; Fri, 18 May 2012 21:49:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4ILnfMJ082503; Fri, 18 May 2012 21:49:41 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4ILnfNq082501; Fri, 18 May 2012 21:49:41 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201205182149.q4ILnfNq082501@svn.freebsd.org> From: Sean Bruno Date: Fri, 18 May 2012 21:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235634 - head/sys/dev/mfi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 21:49:41 -0000 Author: sbruno Date: Fri May 18 21:49:40 2012 New Revision: 235634 URL: http://svn.freebsd.org/changeset/base/235634 Log: Fix and update battery status bits according to linux driver Reviewed by: ambrisko@ MFC after: 3 days Modified: head/sys/dev/mfi/mfireg.h Modified: head/sys/dev/mfi/mfireg.h ============================================================================== --- head/sys/dev/mfi/mfireg.h Fri May 18 21:49:11 2012 (r235633) +++ head/sys/dev/mfi/mfireg.h Fri May 18 21:49:40 2012 (r235634) @@ -1377,8 +1377,13 @@ struct mfi_bbu_status { #define MFI_BBU_STATE_PACK_MISSING (1 << 0) #define MFI_BBU_STATE_VOLTAGE_LOW (1 << 1) #define MFI_BBU_STATE_TEMPERATURE_HIGH (1 << 2) -#define MFI_BBU_STATE_CHARGE_ACTIVE (1 << 0) -#define MFI_BBU_STATE_DISCHARGE_ACTIVE (1 << 0) +#define MFI_BBU_STATE_CHARGE_ACTIVE (1 << 3) +#define MFI_BBU_STATE_DISCHARGE_ACTIVE (1 << 4) +#define MFI_BBU_STATE_LEARN_CYC_REQ (1 << 5) +#define MFI_BBU_STATE_LEARN_CYC_ACTIVE (1 << 6) +#define MFI_BBU_STATE_LEARN_CYC_FAIL (1 << 7) +#define MFI_BBU_STATE_LEARN_CYC_TIMEOUT (1 << 8) +#define MFI_BBU_STATE_I2C_ERR_DETECT (1 << 9) uint8_t pad[20]; union mfi_bbu_status_detail detail; } __packed; From owner-svn-src-head@FreeBSD.ORG Fri May 18 21:50:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 940CB10656F6; Fri, 18 May 2012 21:50:27 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F7E88FC12; Fri, 18 May 2012 21:50:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4ILoR4I082573; Fri, 18 May 2012 21:50:27 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4ILoReP082571; Fri, 18 May 2012 21:50:27 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201205182150.q4ILoReP082571@svn.freebsd.org> From: Sean Bruno Date: Fri, 18 May 2012 21:50:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235635 - head/usr.sbin/mfiutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 21:50:27 -0000 Author: sbruno Date: Fri May 18 21:50:26 2012 New Revision: 235635 URL: http://svn.freebsd.org/changeset/base/235635 Log: Decode new battery status indications. Requires r235634 Reviewed by: ambrisko@ MFC after: 3 days Modified: head/usr.sbin/mfiutil/mfi_show.c Modified: head/usr.sbin/mfiutil/mfi_show.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_show.c Fri May 18 21:49:40 2012 (r235634) +++ head/usr.sbin/mfiutil/mfi_show.c Fri May 18 21:50:26 2012 (r235635) @@ -224,7 +224,29 @@ show_battery(int ac, char **av) } if (stat.fw_status & MFI_BBU_STATE_DISCHARGE_ACTIVE) { printf("%s DISCHARGING", comma ? "," : ""); + comma = 1; } + if (stat.fw_status & MFI_BBU_STATE_LEARN_CYC_REQ) { + printf("%s LEARN_CYCLE_REQUESTED", comma ? "," : ""); + comma = 1; + } + if (stat.fw_status & MFI_BBU_STATE_LEARN_CYC_ACTIVE) { + printf("%s LEARN_CYCLE_ACTIVE", comma ? "," : ""); + comma = 1; + } + if (stat.fw_status & MFI_BBU_STATE_LEARN_CYC_FAIL) { + printf("%s LEARN_CYCLE_FAIL", comma ? "," : ""); + comma = 1; + } + if (stat.fw_status & MFI_BBU_STATE_LEARN_CYC_TIMEOUT) { + printf("%s LEARN_CYCLE_TIMEOUT", comma ? "," : ""); + comma = 1; + } + if (stat.fw_status & MFI_BBU_STATE_I2C_ERR_DETECT) { + printf("%s I2C_ERROR_DETECT", comma ? "," : ""); + comma = 1; + } + if (!comma) printf(" normal"); printf("\n"); From owner-svn-src-head@FreeBSD.ORG Sat May 19 02:08:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 720671065674; Sat, 19 May 2012 02:08:53 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E6308FC1A; Sat, 19 May 2012 02:08:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4J28rDH093331; Sat, 19 May 2012 02:08:53 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4J28rKM093329; Sat, 19 May 2012 02:08:53 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205190208.q4J28rKM093329@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 19 May 2012 02:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235637 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 02:08:53 -0000 Author: marcel Date: Sat May 19 02:08:52 2012 New Revision: 235637 URL: http://svn.freebsd.org/changeset/base/235637 Log: Fix bootstrapping from FreeBSD 7.x: we also need to build ar. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri May 18 23:29:30 2012 (r235636) +++ head/Makefile.inc1 Sat May 19 02:08:52 2012 (r235637) @@ -1007,6 +1007,10 @@ _gperf= gnu/usr.bin/gperf _groff= gnu/usr.bin/groff .endif +.if ${BOOTSTRAPPING} < 800022 +_ar= usr.bin/ar +.endif + .if ${BOOTSTRAPPING} < 800013 _mklocale= usr.bin/mklocale .endif @@ -1069,6 +1073,7 @@ bootstrap-tools: ${_strfile} \ ${_gperf} \ ${_groff} \ + ${_ar} \ ${_dtc} \ ${_awk} \ usr.bin/lorder \ From owner-svn-src-head@FreeBSD.ORG Sat May 19 02:30:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9AEA6106568E; Sat, 19 May 2012 02:30:15 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AAD88FC20; Sat, 19 May 2012 02:30:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4J2UB7F094204; Sat, 19 May 2012 02:30:11 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4J2UB98094202; Sat, 19 May 2012 02:30:11 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205190230.q4J2UB98094202@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 19 May 2012 02:30:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235638 - head/lib/libmagic X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 02:30:15 -0000 Author: marcel Date: Sat May 19 02:30:10 2012 New Revision: 235638 URL: http://svn.freebsd.org/changeset/base/235638 Log: Don't depend on getline being on the build machine. That's not the case for FreeBSD 7.x machines. Modified: head/lib/libmagic/Makefile head/lib/libmagic/config.h Modified: head/lib/libmagic/Makefile ============================================================================== --- head/lib/libmagic/Makefile Sat May 19 02:08:52 2012 (r235637) +++ head/lib/libmagic/Makefile Sat May 19 02:30:10 2012 (r235638) @@ -39,8 +39,9 @@ magic.mgc: mkmagic magic CLEANFILES+= mkmagic build-tools: mkmagic -mkmagic: apprentice.c funcs.c magic.c print.c - ${CC} ${CFLAGS} -DCOMPILE_ONLY ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} +mkmagic: apprentice.c funcs.c getline.c magic.c print.c + ${CC} ${CFLAGS} -DCOMPILE_ONLY -DHOSTPROG ${LDFLAGS} \ + -o ${.TARGET} ${.ALLSRC} FILEVER!= awk '$$1 == "\#define" && $$2 == "VERSION" { print $$3; exit }' \ ${.CURDIR}/config.h Modified: head/lib/libmagic/config.h ============================================================================== --- head/lib/libmagic/config.h Sat May 19 02:08:52 2012 (r235637) +++ head/lib/libmagic/config.h Sat May 19 02:30:10 2012 (r235638) @@ -39,7 +39,9 @@ #define HAVE_FSEEKO 1 /* Define to 1 if you have the `getline' function. */ +#ifndef HOSTPROG #define HAVE_GETLINE 1 +#endif /* Define to 1 if you have the header file. */ #define HAVE_GETOPT_H 1 From owner-svn-src-head@FreeBSD.ORG Sat May 19 02:31:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B87C1065672; Sat, 19 May 2012 02:31:39 +0000 (UTC) (envelope-from iwasaki@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 279B38FC0C; Sat, 19 May 2012 02:31:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4J2Vd7s094291; Sat, 19 May 2012 02:31:39 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4J2VcAv094289; Sat, 19 May 2012 02:31:38 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201205190231.q4J2VcAv094289@svn.freebsd.org> From: Mitsuru IWASAKI Date: Sat, 19 May 2012 02:31:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235639 - head/sys/i386/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 02:31:39 -0000 Author: iwasaki Date: Sat May 19 02:31:38 2012 New Revision: 235639 URL: http://svn.freebsd.org/changeset/base/235639 Log: Revert the previous commit on wakecode address verbose printing. This broke PAE kernel building. Modified: head/sys/i386/acpica/acpi_wakeup.c Modified: head/sys/i386/acpica/acpi_wakeup.c ============================================================================== --- head/sys/i386/acpica/acpi_wakeup.c Sat May 19 02:30:10 2012 (r235638) +++ head/sys/i386/acpica/acpi_wakeup.c Sat May 19 02:31:38 2012 (r235639) @@ -375,6 +375,6 @@ acpi_install_wakeup_handler(struct acpi_ WAKECODE_FIXUP(wakeup_ret, void *, resumectx); if (bootverbose) - device_printf(sc->acpi_dev, "wakeup code va %p pa %p\n", - (void *)sc->acpi_wakeaddr, (void *)sc->acpi_wakephys); + device_printf(sc->acpi_dev, "wakeup code va %#x pa %#jx\n", + sc->acpi_wakeaddr, (uintmax_t)sc->acpi_wakephys); } From owner-svn-src-head@FreeBSD.ORG Sat May 19 02:39:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3ADC6106564A; Sat, 19 May 2012 02:39:44 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C91D8FC08; Sat, 19 May 2012 02:39:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4J2dhbC094646; Sat, 19 May 2012 02:39:43 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4J2dhA7094639; Sat, 19 May 2012 02:39:43 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205190239.q4J2dhA7094639@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 19 May 2012 02:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235640 - in head: lib/libc/net sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 02:39:44 -0000 Author: marcel Date: Sat May 19 02:39:43 2012 New Revision: 235640 URL: http://svn.freebsd.org/changeset/base/235640 Log: Use the LLINDEX macro to access the link-level I/F index. This makes it possible to work with a different type for the sdl_index field -- it only requires a recompile. Obtained from: Juniper Networks, Inc. Modified: head/lib/libc/net/if_indextoname.c head/lib/libc/net/if_nameindex.c head/lib/libc/net/if_nametoindex.c head/lib/libc/net/sourcefilter.c head/sys/net/if_dl.h Modified: head/lib/libc/net/if_indextoname.c ============================================================================== --- head/lib/libc/net/if_indextoname.c Sat May 19 02:31:38 2012 (r235639) +++ head/lib/libc/net/if_indextoname.c Sat May 19 02:39:43 2012 (r235640) @@ -70,7 +70,7 @@ if_indextoname(unsigned int ifindex, cha for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) { if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_LINK && - ifindex == ((struct sockaddr_dl*)ifa->ifa_addr)->sdl_index) + ifindex == LLINDEX((struct sockaddr_dl*)ifa->ifa_addr)) break; } Modified: head/lib/libc/net/if_nameindex.c ============================================================================== --- head/lib/libc/net/if_nameindex.c Sat May 19 02:31:38 2012 (r235639) +++ head/lib/libc/net/if_nameindex.c Sat May 19 02:39:43 2012 (r235640) @@ -123,7 +123,7 @@ if_nameindex(void) if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_LINK) { ifni2->if_index = - ((struct sockaddr_dl*)ifa->ifa_addr)->sdl_index; + LLINDEX((struct sockaddr_dl*)ifa->ifa_addr); ifni2->if_name = cp; strcpy(cp, ifa->ifa_name); ifni2++; Modified: head/lib/libc/net/if_nametoindex.c ============================================================================== --- head/lib/libc/net/if_nametoindex.c Sat May 19 02:31:38 2012 (r235639) +++ head/lib/libc/net/if_nametoindex.c Sat May 19 02:39:43 2012 (r235640) @@ -90,7 +90,7 @@ if_nametoindex(const char *ifname) if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_LINK && strcmp(ifa->ifa_name, ifname) == 0) { - ni = ((struct sockaddr_dl*)ifa->ifa_addr)->sdl_index; + ni = LLINDEX((struct sockaddr_dl*)ifa->ifa_addr); break; } } Modified: head/lib/libc/net/sourcefilter.c ============================================================================== --- head/lib/libc/net/sourcefilter.c Sat May 19 02:31:38 2012 (r235639) +++ head/lib/libc/net/sourcefilter.c Sat May 19 02:39:43 2012 (r235640) @@ -120,7 +120,7 @@ __inaddr_to_index(in_addr_t ifaddr) psu = (sockunion_t *)ifa->ifa_addr; if (psu && psu->ss.ss_family == AF_LINK && strcmp(ifa->ifa_name, ifname) == 0) { - ifindex = psu->sdl.sdl_index; + ifindex = LLINDEX(&psu->sdl); break; } } Modified: head/sys/net/if_dl.h ============================================================================== --- head/sys/net/if_dl.h Sat May 19 02:31:38 2012 (r235639) +++ head/sys/net/if_dl.h Sat May 19 02:39:43 2012 (r235640) @@ -67,6 +67,7 @@ struct sockaddr_dl { }; #define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen)) +#define LLINDEX(s) ((s)->sdl_index) #ifndef _KERNEL From owner-svn-src-head@FreeBSD.ORG Sat May 19 04:57:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CACF21065670; Sat, 19 May 2012 04:57:37 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5BB68FC14; Sat, 19 May 2012 04:57:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4J4vbLT000975; Sat, 19 May 2012 04:57:37 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4J4vbMO000973; Sat, 19 May 2012 04:57:37 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205190457.q4J4vbMO000973@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 19 May 2012 04:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235641 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 04:57:37 -0000 Author: marcel Date: Sat May 19 04:57:37 2012 New Revision: 235641 URL: http://svn.freebsd.org/changeset/base/235641 Log: Add missing LIBPROCSTAT. Modified: head/share/mk/bsd.libnames.mk Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Sat May 19 02:39:43 2012 (r235640) +++ head/share/mk/bsd.libnames.mk Sat May 19 04:57:37 2012 (r235641) @@ -135,6 +135,7 @@ LIBPANEL?= ${DESTDIR}${LIBDIR}/libpanel. LIBPCAP?= ${DESTDIR}${LIBDIR}/libpcap.a LIBPMC?= ${DESTDIR}${LIBDIR}/libpmc.a LIBPROC?= ${DESTDIR}${LIBDIR}/libproc.a +LIBPROCSTAT?= ${DESTDIR}${LIBDIR}/libprocstat.a LIBPTHREAD?= ${DESTDIR}${LIBDIR}/libpthread.a LIBRADIUS?= ${DESTDIR}${LIBDIR}/libradius.a LIBREADLINE?= ${DESTDIR}${LIBDIR}/libreadline.a From owner-svn-src-head@FreeBSD.ORG Sat May 19 05:07:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5404D106564A; Sat, 19 May 2012 05:07:04 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E9B68FC15; Sat, 19 May 2012 05:07:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4J5747K001423; Sat, 19 May 2012 05:07:04 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4J574m9001420; Sat, 19 May 2012 05:07:04 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205190507.q4J574m9001420@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 19 May 2012 05:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235642 - in head/usr.bin: fstat procstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 05:07:04 -0000 Author: marcel Date: Sat May 19 05:07:03 2012 New Revision: 235642 URL: http://svn.freebsd.org/changeset/base/235642 Log: Bring DPADD in sync with LDADD. Modified: head/usr.bin/fstat/Makefile head/usr.bin/procstat/Makefile Modified: head/usr.bin/fstat/Makefile ============================================================================== --- head/usr.bin/fstat/Makefile Sat May 19 04:57:37 2012 (r235641) +++ head/usr.bin/fstat/Makefile Sat May 19 05:07:03 2012 (r235642) @@ -4,7 +4,7 @@ PROG= fstat SRCS= fstat.c fuser.c main.c LINKS= ${BINDIR}/fstat ${BINDIR}/fuser -DPADD= ${LIBKVM} +DPADD= ${LIBKVM} ${LIBUTIL} ${LIBPROCSTAT} LDADD= -lkvm -lutil -lprocstat MAN1= fuser.1 fstat.1 Modified: head/usr.bin/procstat/Makefile ============================================================================== --- head/usr.bin/procstat/Makefile Sat May 19 04:57:37 2012 (r235641) +++ head/usr.bin/procstat/Makefile Sat May 19 05:07:03 2012 (r235642) @@ -16,6 +16,6 @@ SRCS= procstat.c \ procstat_vm.c LDADD+= -lutil -lprocstat -lkvm -DPADD+= ${LIBUTIL} +DPADD+= ${LIBUTIL} ${LIBPROCSTAT} ${LIBKVM} .include From owner-svn-src-head@FreeBSD.ORG Sat May 19 05:10:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D169D106566B; Sat, 19 May 2012 05:10:47 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD83C8FC12; Sat, 19 May 2012 05:10:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4J5AlLI001603; Sat, 19 May 2012 05:10:47 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4J5AlSa001601; Sat, 19 May 2012 05:10:47 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205190510.q4J5AlSa001601@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 19 May 2012 05:10:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235643 - head/libexec/tftpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 05:10:47 -0000 Author: marcel Date: Sat May 19 05:10:47 2012 New Revision: 235643 URL: http://svn.freebsd.org/changeset/base/235643 Log: Properly use LDADD & DPADD to link against libwrap. Modified: head/libexec/tftpd/Makefile Modified: head/libexec/tftpd/Makefile ============================================================================== --- head/libexec/tftpd/Makefile Sat May 19 05:07:03 2012 (r235642) +++ head/libexec/tftpd/Makefile Sat May 19 05:10:47 2012 (r235643) @@ -6,6 +6,8 @@ MAN= tftpd.8 SRCS= tftp-file.c tftp-io.c tftp-options.c tftp-transfer.c tftp-utils.c SRCS+= tftpd.c WFORMAT=0 -LDFLAGS= -lwrap + +DPADD= ${LIBWRAP} +LDADD= -lwrap .include From owner-svn-src-head@FreeBSD.ORG Sat May 19 05:14:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4C1D1065672; Sat, 19 May 2012 05:14:25 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 312AC8FC19; Sat, 19 May 2012 05:14:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4J5EPAF001790; Sat, 19 May 2012 05:14:25 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4J5EO6u001788; Sat, 19 May 2012 05:14:24 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205190514.q4J5EO6u001788@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 19 May 2012 05:14:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235644 - head/sys/netinet/libalias X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 05:14:25 -0000 Author: marcel Date: Sat May 19 05:14:24 2012 New Revision: 235644 URL: http://svn.freebsd.org/changeset/base/235644 Log: Remove unused inclusion of curses.h Modified: head/sys/netinet/libalias/alias_sctp.h Modified: head/sys/netinet/libalias/alias_sctp.h ============================================================================== --- head/sys/netinet/libalias/alias_sctp.h Sat May 19 05:10:47 2012 (r235643) +++ head/sys/netinet/libalias/alias_sctp.h Sat May 19 05:14:24 2012 (r235644) @@ -92,7 +92,6 @@ #ifndef _KERNEL #include #include -#include #endif //#ifdef _KERNEL From owner-svn-src-head@FreeBSD.ORG Sat May 19 12:44:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9698A1065675; Sat, 19 May 2012 12:44:28 +0000 (UTC) (envelope-from gleb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DDE68FC17; Sat, 19 May 2012 12:44:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4JCiSp6022431; Sat, 19 May 2012 12:44:28 GMT (envelope-from gleb@svn.freebsd.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4JCiSmO022413; Sat, 19 May 2012 12:44:28 GMT (envelope-from gleb@svn.freebsd.org) Message-Id: <201205191244.q4JCiSmO022413@svn.freebsd.org> From: Gleb Kurtsou Date: Sat, 19 May 2012 12:44:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235647 - in head: include lib/libc/gen usr.sbin/cpucontrol usr.sbin/lpr/common_source usr.sbin/newsyslog X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 12:44:28 -0000 Author: gleb Date: Sat May 19 12:44:27 2012 New Revision: 235647 URL: http://svn.freebsd.org/changeset/base/235647 Log: Hide DIR definition by making it an opaque struct typedef. Introduce dirfd() libc exported symbol replacing macro with same name, preserve _dirfd() macro for internal use. Replace dirp->dd_fd with dirfd() call. Avoid using dirfd as variable name to prevent shadowing global symbol. Sponsored by: Google Summer Of Code 2011 Added: head/lib/libc/gen/dirfd.c (contents, props changed) head/lib/libc/gen/gen-private.h (contents, props changed) Modified: head/include/dirent.h head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map head/lib/libc/gen/closedir.c head/lib/libc/gen/fts-compat.c head/lib/libc/gen/fts.c head/lib/libc/gen/getcwd.c head/lib/libc/gen/opendir.c head/lib/libc/gen/readdir.c head/lib/libc/gen/rewinddir.c head/lib/libc/gen/seekdir.c head/lib/libc/gen/telldir.c head/usr.sbin/cpucontrol/cpucontrol.c head/usr.sbin/lpr/common_source/common.c head/usr.sbin/newsyslog/newsyslog.c Modified: head/include/dirent.h ============================================================================== --- head/include/dirent.h Sat May 19 05:45:38 2012 (r235646) +++ head/include/dirent.h Sat May 19 12:44:27 2012 (r235647) @@ -55,24 +55,8 @@ /* definitions for library routines operating on directories. */ #define DIRBLKSIZ 1024 -struct _telldir; /* see telldir.h */ -struct pthread_mutex; - -/* structure describing an open directory. */ -typedef struct _dirdesc { - int dd_fd; /* file descriptor associated with directory */ - long dd_loc; /* offset in current buffer */ - long dd_size; /* amount of data returned by getdirentries */ - char *dd_buf; /* data buffer */ - int dd_len; /* size of data buffer */ - long dd_seek; /* magic cookie returned by getdirentries */ - long dd_rewind; /* magic cookie for rewinding */ - int dd_flags; /* flags for readdir */ - struct pthread_mutex *dd_lock; /* lock */ - struct _telldir *dd_td; /* telldir position recording */ -} DIR; - -#define dirfd(dirp) ((dirp)->dd_fd) +struct _dirdesc; +typedef struct _dirdesc DIR; /* flags for opendir2 */ #define DTF_HIDEW 0x0001 /* hide whiteout entries */ @@ -91,6 +75,7 @@ typedef void * DIR; __BEGIN_DECLS #if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 700 int alphasort(const struct dirent **, const struct dirent **); +int dirfd(DIR *); #endif #if __BSD_VISIBLE DIR *__opendir2(const char *, int); Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Sat May 19 05:45:38 2012 (r235646) +++ head/lib/libc/gen/Makefile.inc Sat May 19 12:44:27 2012 (r235647) @@ -9,7 +9,7 @@ SRCS+= __getosreldate.c __xuname.c \ _thread_init.c \ alarm.c arc4random.c assert.c aux.c basename.c check_utility_compat.c \ clock.c closedir.c confstr.c \ - crypt.c ctermid.c daemon.c devname.c dirname.c disklabel.c \ + crypt.c ctermid.c daemon.c devname.c dirfd.c dirname.c disklabel.c \ dlfcn.c drand48.c elf_utils.c erand48.c err.c errlst.c errno.c \ exec.c fdevname.c feature_present.c fmtcheck.c fmtmsg.c fnmatch.c \ fpclassify.c frexp.c fstab.c ftok.c fts.c fts-compat.c ftw.c \ Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Sat May 19 05:45:38 2012 (r235646) +++ head/lib/libc/gen/Symbol.map Sat May 19 12:44:27 2012 (r235647) @@ -382,6 +382,7 @@ FBSD_1.2 { }; FBSD_1.3 { + dirfd; fdlopen; __FreeBSD_libc_enter_restricted_mode; getcontextx; Modified: head/lib/libc/gen/closedir.c ============================================================================== --- head/lib/libc/gen/closedir.c Sat May 19 05:45:38 2012 (r235646) +++ head/lib/libc/gen/closedir.c Sat May 19 12:44:27 2012 (r235647) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" +#include "gen-private.h" #include "telldir.h" /* Added: head/lib/libc/gen/dirfd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/dirfd.c Sat May 19 12:44:27 2012 (r235647) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include + +#include +#include "un-namespace.h" + +#include "gen-private.h" + +int +dirfd(DIR *dirp) +{ + + return (_dirfd(dirp)); +} Modified: head/lib/libc/gen/fts-compat.c ============================================================================== --- head/lib/libc/gen/fts-compat.c Sat May 19 05:45:38 2012 (r235646) +++ head/lib/libc/gen/fts-compat.c Sat May 19 12:44:27 2012 (r235647) @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$"); #include "fts-compat.h" #include "un-namespace.h" +#include "gen-private.h" + FTSENT *__fts_children_44bsd(FTS *, int); int __fts_close_44bsd(FTS *); void *__fts_get_clientptr_44bsd(FTS *); @@ -711,7 +713,7 @@ fts_build(sp, type) */ cderrno = 0; if (nlinks || type == BREAD) { - if (fts_safe_changedir(sp, cur, dirfd(dirp), NULL)) { + if (fts_safe_changedir(sp, cur, _dirfd(dirp), NULL)) { if (nlinks && type == BREAD) cur->fts_errno = errno; cur->fts_flags |= FTS_DONTCHDIR; Modified: head/lib/libc/gen/fts.c ============================================================================== --- head/lib/libc/gen/fts.c Sat May 19 05:45:38 2012 (r235646) +++ head/lib/libc/gen/fts.c Sat May 19 12:44:27 2012 (r235647) @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" +#include "gen-private.h" + static FTSENT *fts_alloc(FTS *, char *, size_t); static FTSENT *fts_build(FTS *, int); static void fts_lfree(FTSENT *); @@ -697,7 +699,7 @@ fts_build(FTS *sp, int type) */ cderrno = 0; if (nlinks || type == BREAD) { - if (fts_safe_changedir(sp, cur, dirfd(dirp), NULL)) { + if (fts_safe_changedir(sp, cur, _dirfd(dirp), NULL)) { if (nlinks && type == BREAD) cur->fts_errno = errno; cur->fts_flags |= FTS_DONTCHDIR; Added: head/lib/libc/gen/gen-private.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/gen-private.h Sat May 19 12:44:27 2012 (r235647) @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _GEN_PRIVATE_H_ +#define _GEN_PRIVATE_H_ + +struct _telldir; /* see telldir.h */ +struct pthread_mutex; + +/* + * Structure describing an open directory. + * + * NOTE. Change structure layout with care, at least dd_fd field has to + * remain unchanged to guarantee backward compatibility. + */ +struct _dirdesc { + int dd_fd; /* file descriptor associated with directory */ + long dd_loc; /* offset in current buffer */ + long dd_size; /* amount of data returned by getdirentries */ + char *dd_buf; /* data buffer */ + int dd_len; /* size of data buffer */ + long dd_seek; /* magic cookie returned by getdirentries */ + long dd_rewind; /* magic cookie for rewinding */ + int dd_flags; /* flags for readdir */ + struct pthread_mutex *dd_lock; /* lock */ + struct _telldir *dd_td; /* telldir position recording */ +}; + +#define _dirfd(dirp) ((dirp)->dd_fd) + +#endif /* !_GEN_PRIVATE_H_ */ Modified: head/lib/libc/gen/getcwd.c ============================================================================== --- head/lib/libc/gen/getcwd.c Sat May 19 05:45:38 2012 (r235646) +++ head/lib/libc/gen/getcwd.c Sat May 19 12:44:27 2012 (r235647) @@ -46,6 +46,8 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" +#include "gen-private.h" + #define ISDOT(dp) \ (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \ (dp->d_name[1] == '.' && dp->d_name[2] == '\0'))) @@ -117,7 +119,7 @@ getcwd(pt, size) for (first = 1;; first = 0) { /* Stat the current level. */ - if (dir != NULL ? _fstat(dirfd(dir), &s) : lstat(".", &s)) + if (dir != NULL ? _fstat(_dirfd(dir), &s) : lstat(".", &s)) goto err; /* Save current node values. */ @@ -139,13 +141,13 @@ getcwd(pt, size) } /* Open and stat parent directory. */ - fd = _openat(dir != NULL ? dirfd(dir) : AT_FDCWD, + fd = _openat(dir != NULL ? _dirfd(dir) : AT_FDCWD, "..", O_RDONLY); if (fd == -1) goto err; if (dir) (void) closedir(dir); - if (!(dir = fdopendir(fd)) || _fstat(dirfd(dir), &s)) { + if (!(dir = fdopendir(fd)) || _fstat(_dirfd(dir), &s)) { _close(fd); goto err; } @@ -171,7 +173,7 @@ getcwd(pt, size) continue; /* Save the first error for later. */ - if (fstatat(dirfd(dir), dp->d_name, &s, + if (fstatat(_dirfd(dir), dp->d_name, &s, AT_SYMLINK_NOFOLLOW)) { if (!save_errno) save_errno = errno; Modified: head/lib/libc/gen/opendir.c ============================================================================== --- head/lib/libc/gen/opendir.c Sat May 19 05:45:38 2012 (r235646) +++ head/lib/libc/gen/opendir.c Sat May 19 12:44:27 2012 (r235647) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" +#include "gen-private.h" #include "telldir.h" static DIR * __opendir_common(int, const char *, int); Modified: head/lib/libc/gen/readdir.c ============================================================================== --- head/lib/libc/gen/readdir.c Sat May 19 05:45:38 2012 (r235646) +++ head/lib/libc/gen/readdir.c Sat May 19 12:44:27 2012 (r235647) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" +#include "gen-private.h" #include "telldir.h" /* Modified: head/lib/libc/gen/rewinddir.c ============================================================================== --- head/lib/libc/gen/rewinddir.c Sat May 19 05:45:38 2012 (r235646) +++ head/lib/libc/gen/rewinddir.c Sat May 19 12:44:27 2012 (r235647) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "gen-private.h" #include "telldir.h" void Modified: head/lib/libc/gen/seekdir.c ============================================================================== --- head/lib/libc/gen/seekdir.c Sat May 19 05:45:38 2012 (r235646) +++ head/lib/libc/gen/seekdir.c Sat May 19 12:44:27 2012 (r235647) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" +#include "gen-private.h" #include "telldir.h" /* Modified: head/lib/libc/gen/telldir.c ============================================================================== --- head/lib/libc/gen/telldir.c Sat May 19 05:45:38 2012 (r235646) +++ head/lib/libc/gen/telldir.c Sat May 19 12:44:27 2012 (r235647) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" +#include "gen-private.h" #include "telldir.h" /* Modified: head/usr.sbin/cpucontrol/cpucontrol.c ============================================================================== --- head/usr.sbin/cpucontrol/cpucontrol.c Sat May 19 05:45:38 2012 (r235646) +++ head/usr.sbin/cpucontrol/cpucontrol.c Sat May 19 12:44:27 2012 (r235647) @@ -292,7 +292,7 @@ do_update(const char *dev) int error; struct ucode_handler *handler; struct datadir *dir; - DIR *dirfd; + DIR *dirp; struct dirent *direntry; char buf[MAXPATHLEN]; @@ -321,12 +321,12 @@ do_update(const char *dev) * Process every image in specified data directories. */ SLIST_FOREACH(dir, &datadirs, next) { - dirfd = opendir(dir->path); - if (dirfd == NULL) { + dirp = opendir(dir->path); + if (dirp == NULL) { WARNX(1, "skipping directory %s: not accessible", dir->path); continue; } - while ((direntry = readdir(dirfd)) != NULL) { + while ((direntry = readdir(dirp)) != NULL) { if (direntry->d_namlen == 0) continue; error = snprintf(buf, sizeof(buf), "%s/%s", dir->path, @@ -340,7 +340,7 @@ do_update(const char *dev) } handler->update(dev, buf); } - error = closedir(dirfd); + error = closedir(dirp); if (error != 0) WARN(0, "closedir(%s)", dir->path); } Modified: head/usr.sbin/lpr/common_source/common.c ============================================================================== --- head/usr.sbin/lpr/common_source/common.c Sat May 19 05:45:38 2012 (r235646) +++ head/usr.sbin/lpr/common_source/common.c Sat May 19 12:44:27 2012 (r235647) @@ -130,7 +130,7 @@ getq(const struct printer *pp, struct jo seteuid(uid); return (-1); } - if (fstat(dirp->dd_fd, &stbuf) < 0) + if (fstat(dirfd(dirp), &stbuf) < 0) goto errdone; seteuid(uid); Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Sat May 19 05:45:38 2012 (r235646) +++ head/usr.sbin/newsyslog/newsyslog.c Sat May 19 12:44:27 2012 (r235647) @@ -1451,7 +1451,7 @@ static void delete_oldest_timelog(const struct conf_entry *ent, const char *archive_dir) { char *logfname, *s, *dir, errbuf[80]; - int dirfd, i, logcnt, max_logcnt, valid; + int dir_fd, i, logcnt, max_logcnt, valid; struct oldlog_entry *oldlogs; size_t logfname_len; struct dirent *dp; @@ -1486,7 +1486,7 @@ delete_oldest_timelog(const struct conf_ /* First we create a 'list' of all archived logfiles */ if ((dirp = opendir(dir)) == NULL) err(1, "Cannot open log directory '%s'", dir); - dirfd = dirfd(dirp); + dir_fd = dirfd(dirp); while ((dp = readdir(dirp)) != NULL) { if (dp->d_type != DT_REG) continue; @@ -1578,7 +1578,7 @@ delete_oldest_timelog(const struct conf_ if (noaction) printf("\trm -f %s/%s\n", dir, oldlogs[i].fname); - else if (unlinkat(dirfd, oldlogs[i].fname, 0) != 0) { + else if (unlinkat(dir_fd, oldlogs[i].fname, 0) != 0) { snprintf(errbuf, sizeof(errbuf), "Could not delet old logfile '%s'", oldlogs[i].fname); From owner-svn-src-head@FreeBSD.ORG Sat May 19 13:38:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D838B106564A; Sat, 19 May 2012 13:38:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 518538FC12; Sat, 19 May 2012 13:38:14 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q4JDc8cT091976; Sat, 19 May 2012 16:38:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q4JDc8eI099149; Sat, 19 May 2012 16:38:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q4JDc8W8099148; Sat, 19 May 2012 16:38:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 19 May 2012 16:38:08 +0300 From: Konstantin Belousov To: Gleb Kurtsou Message-ID: <20120519133808.GI2358@deviant.kiev.zoral.com.ua> References: <201205191244.q4JCiSmO022413@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vDuE8pp2+RlIQOrG" Content-Disposition: inline In-Reply-To: <201205191244.q4JCiSmO022413@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235647 - in head: include lib/libc/gen usr.sbin/cpucontrol usr.sbin/lpr/common_source usr.sbin/newsyslog X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 13:38:15 -0000 --vDuE8pp2+RlIQOrG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 19, 2012 at 12:44:28PM +0000, Gleb Kurtsou wrote: > Author: gleb > Date: Sat May 19 12:44:27 2012 > New Revision: 235647 > URL: http://svn.freebsd.org/changeset/base/235647 >=20 > Log: > Hide DIR definition by making it an opaque struct typedef. > =20 > Introduce dirfd() libc exported symbol replacing macro with same name, > preserve _dirfd() macro for internal use. > =20 > Replace dirp->dd_fd with dirfd() call. Avoid using dirfd as variable > name to prevent shadowing global symbol. > =20 > Sponsored by: Google Summer Of Code 2011 >=20 > Added: > head/lib/libc/gen/dirfd.c (contents, props changed) > head/lib/libc/gen/gen-private.h (contents, props changed) I could agree with attribution of the gen-private.h content to 'regents of the university' in the copyright, but I very much doubt that this is right thing to do for dirfd.c. I think you should put your name, instead of university, as the copyright owner. --vDuE8pp2+RlIQOrG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk+3okAACgkQC3+MBN1Mb4jcUQCfcTQ3I5WQwzlC2g8OXFotoxvR X10An23kNkiB2tLNwtPk2fZiWPQR8tYB =bLfw -----END PGP SIGNATURE----- --vDuE8pp2+RlIQOrG-- From owner-svn-src-head@FreeBSD.ORG Sat May 19 14:30:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E1F21106564A; Sat, 19 May 2012 14:30:49 +0000 (UTC) (envelope-from gleb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC7F48FC19; Sat, 19 May 2012 14:30:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4JEUnf6027111; Sat, 19 May 2012 14:30:49 GMT (envelope-from gleb@svn.freebsd.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4JEUnD0027109; Sat, 19 May 2012 14:30:49 GMT (envelope-from gleb@svn.freebsd.org) Message-Id: <201205191430.q4JEUnD0027109@svn.freebsd.org> From: Gleb Kurtsou Date: Sat, 19 May 2012 14:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235649 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 14:30:50 -0000 Author: gleb Date: Sat May 19 14:30:49 2012 New Revision: 235649 URL: http://svn.freebsd.org/changeset/base/235649 Log: Put my name as copyright owner of lib/libc/gen/dirfd.c added in r235647. Requested by: kib@ Modified: head/lib/libc/gen/dirfd.c Modified: head/lib/libc/gen/dirfd.c ============================================================================== --- head/lib/libc/gen/dirfd.c Sat May 19 14:13:16 2012 (r235648) +++ head/lib/libc/gen/dirfd.c Sat May 19 14:30:49 2012 (r235649) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 2011 Gleb Kurtsou + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,14 +10,11 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) From owner-svn-src-head@FreeBSD.ORG Sat May 19 14:41:08 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 731B21065677; Sat, 19 May 2012 14:41:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 0AF338FC21; Sat, 19 May 2012 14:41:07 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4JEexGx009322 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 20 May 2012 00:41:00 +1000 Date: Sun, 20 May 2012 00:40:59 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov In-Reply-To: <20120519133808.GI2358@deviant.kiev.zoral.com.ua> Message-ID: <20120520000910.D1142@besplex.bde.org> References: <201205191244.q4JCiSmO022413@svn.freebsd.org> <20120519133808.GI2358@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, Gleb Kurtsou , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r235647 - in head: include lib/libc/gen usr.sbin/cpucontrol usr.sbin/lpr/common_source usr.sbin/newsyslog X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 14:41:08 -0000 On Sat, 19 May 2012, Konstantin Belousov wrote: >> Log: >> Hide DIR definition by making it an opaque struct typedef. >> >> Introduce dirfd() libc exported symbol replacing macro with same name, >> preserve _dirfd() macro for internal use. >> >> Replace dirp->dd_fd with dirfd() call. Avoid using dirfd as variable >> name to prevent shadowing global symbol. >> >> Sponsored by: Google Summer Of Code 2011 >> >> Added: >> head/lib/libc/gen/dirfd.c (contents, props changed) >> head/lib/libc/gen/gen-private.h (contents, props changed) > I could agree with attribution of the gen-private.h content to 'regents > of the university' in the copyright, but I very much doubt that this > is right thing to do for dirfd.c. > > I think you should put your name, instead of university, as the copyright > owner. gen-private.h is also missing all history and in particular is missing the history needed to connect it to the regents. gen-private.h also has a gnu-style name. If it had been provided by the regents or their direct contributors, then it would have a BSD-style name (gen_private.h or just genprivate.h, or maybe gen.h or dirfd.h (headers in libc/gen are private by definition; if they were private to libc and not just libc/gen, then they would be in libc/include)). In 4.4BSD-Lite2, there are 22246 files; 1237 of these are named *-*, but most of these are in src/contrib and other contribed files (mainly usr.sbin/amd); there are about 20 files whose name has a hyphen and whose contents has a regents copyright; none of these are in src/lib but 5 are in src/sys. In FreeBSD now, the naming scheme has already rotted to about 55 names with a hyphen in src/lib and 524 in src/sys (more than 1/2 of the latter in contrib/octeon and almost 1/4 in contribed drivers). Bruce From owner-svn-src-head@FreeBSD.ORG Sat May 19 17:42:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C994106566B; Sat, 19 May 2012 17:42:12 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBB708FC08; Sat, 19 May 2012 17:42:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4JHgB4u035944; Sat, 19 May 2012 17:42:11 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4JHgBvU035942; Sat, 19 May 2012 17:42:11 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205191742.q4JHgBvU035942@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 19 May 2012 17:42:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235652 - head/sys/dev/iicbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 17:42:12 -0000 Author: marcel Date: Sat May 19 17:42:11 2012 New Revision: 235652 URL: http://svn.freebsd.org/changeset/base/235652 Log: Don't include MIPS machine headers. There's no need for it. Modified: head/sys/dev/iicbus/ds1374.c Modified: head/sys/dev/iicbus/ds1374.c ============================================================================== --- head/sys/dev/iicbus/ds1374.c Sat May 19 14:38:14 2012 (r235651) +++ head/sys/dev/iicbus/ds1374.c Sat May 19 17:42:11 2012 (r235652) @@ -39,12 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#include - #include #include From owner-svn-src-head@FreeBSD.ORG Sat May 19 17:49:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 74B82106566B; Sat, 19 May 2012 17:49:21 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FF748FC0C; Sat, 19 May 2012 17:49:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4JHnLp8036294; Sat, 19 May 2012 17:49:21 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4JHnLaq036292; Sat, 19 May 2012 17:49:21 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205191749.q4JHnLaq036292@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 19 May 2012 17:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235653 - head/lib/libc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 17:49:21 -0000 Author: marcel Date: Sat May 19 17:49:20 2012 New Revision: 235653 URL: http://svn.freebsd.org/changeset/base/235653 Log: Don't link against libssp if MK_SSP is set to no. Note that this still misses a proper dependency at this time. Modified: head/lib/libc/Makefile Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Sat May 19 17:42:11 2012 (r235652) +++ head/lib/libc/Makefile Sat May 19 17:49:20 2012 (r235653) @@ -41,7 +41,11 @@ CFLAGS+=${CANCELPOINTS_CFLAGS} # DPADD+= ${LIBGCC} LDFLAGS+= -nodefaultlibs -LDADD+= -lgcc -lssp_nonshared +LDADD+= -lgcc + +.if ${MK_SSP} != "no" +LDADD+= -lssp_nonshared +.endif # Define (empty) variables so that make doesn't give substitution # errors if the included makefiles don't change these: From owner-svn-src-head@FreeBSD.ORG Sat May 19 17:55:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2195106566C; Sat, 19 May 2012 17:55:49 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D30B8FC08; Sat, 19 May 2012 17:55:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4JHtnIX036631; Sat, 19 May 2012 17:55:49 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4JHtncx036628; Sat, 19 May 2012 17:55:49 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205191755.q4JHtncx036628@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 19 May 2012 17:55:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235654 - in head: bin/ed share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 17:55:49 -0000 Author: marcel Date: Sat May 19 17:55:49 2012 New Revision: 235654 URL: http://svn.freebsd.org/changeset/base/235654 Log: Add build option MK_ED_CRYPTO to control whether ed(1) is to have the ability to encrypt/decrypt files. Embedded systems can typically have OpenSSL, but not for ed(1) to use it. Obtained from: Juniper Networks, Inc. Modified: head/bin/ed/Makefile head/share/mk/bsd.own.mk Modified: head/bin/ed/Makefile ============================================================================== --- head/bin/ed/Makefile Sat May 19 17:49:20 2012 (r235653) +++ head/bin/ed/Makefile Sat May 19 17:55:49 2012 (r235654) @@ -7,12 +7,12 @@ SRCS= buf.c cbc.c glbl.c io.c main.c re. LINKS= ${BINDIR}/ed ${BINDIR}/red MLINKS= ed.1 red.1 -.if !defined(RELEASE_CRUNCH) -.if ${MK_OPENSSL} != "no" +.if !defined(RELEASE_CRUNCH) && \ + ${MK_OPENSSL} != "no" && \ + ${MK_ED_CRYPTO} != "no" CFLAGS+=-DDES DPADD= ${LIBCRYPTO} LDADD= -lcrypto .endif -.endif .include Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sat May 19 17:49:20 2012 (r235653) +++ head/share/mk/bsd.own.mk Sat May 19 17:55:49 2012 (r235654) @@ -334,6 +334,7 @@ __DEFAULT_YES_OPTIONS = \ CXX \ DICT \ DYNAMICROOT \ + ED_CRYPTO \ EXAMPLES \ FLOPPY \ FORTH \ From owner-svn-src-head@FreeBSD.ORG Sat May 19 18:05:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91440106564A; Sat, 19 May 2012 18:05:01 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BBA88FC0A; Sat, 19 May 2012 18:05:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4JI51Iv037130; Sat, 19 May 2012 18:05:01 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4JI513M037128; Sat, 19 May 2012 18:05:01 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205191805.q4JI513M037128@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 19 May 2012 18:05:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235655 - in head: bin/ls share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 18:05:01 -0000 Author: marcel Date: Sat May 19 18:05:00 2012 New Revision: 235655 URL: http://svn.freebsd.org/changeset/base/235655 Log: Add build opton MK_LS_COLORS to control whether ls(1) supports colors (and thus needs to depend on libtermcap). Embedded systems may not want or need colors. Obtained from: Juniper Networks, Inc. Modified: head/bin/ls/Makefile head/share/mk/bsd.own.mk Modified: head/bin/ls/Makefile ============================================================================== --- head/bin/ls/Makefile Sat May 19 17:55:49 2012 (r235654) +++ head/bin/ls/Makefile Sat May 19 18:05:00 2012 (r235655) @@ -1,12 +1,15 @@ # @(#)Makefile 8.1 (Berkeley) 6/2/93 # $FreeBSD$ +.include + PROG= ls SRCS= cmp.c ls.c print.c util.c DPADD= ${LIBUTIL} LDADD= -lutil -.if !defined(RELEASE_CRUNCH) +.if !defined(RELEASE_CRUNCH) && \ + ${MK_LS_COLORS} != no CFLAGS+= -DCOLORLS DPADD+= ${LIBTERMCAP} LDADD+= -ltermcap Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sat May 19 17:55:49 2012 (r235654) +++ head/share/mk/bsd.own.mk Sat May 19 18:05:00 2012 (r235655) @@ -367,6 +367,7 @@ __DEFAULT_YES_OPTIONS = \ LOCALES \ LOCATE \ LPR \ + LS_COLORS \ MAIL \ MAILWRAPPER \ MAKE \ From owner-svn-src-head@FreeBSD.ORG Sat May 19 18:16:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A36A61065672; Sat, 19 May 2012 18:16:49 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F1F58FC08; Sat, 19 May 2012 18:16:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4JIGnJu037664; Sat, 19 May 2012 18:16:49 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4JIGnS1037662; Sat, 19 May 2012 18:16:49 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205191816.q4JIGnS1037662@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 19 May 2012 18:16:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235656 - head/sys/arm/mv X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 18:16:49 -0000 Author: marcel Date: Sat May 19 18:16:49 2012 New Revision: 235656 URL: http://svn.freebsd.org/changeset/base/235656 Log: Unbreak LINT for ARM: DEBUG is a kernel configuration option. Modified: head/sys/arm/mv/mv_localbus.c Modified: head/sys/arm/mv/mv_localbus.c ============================================================================== --- head/sys/arm/mv/mv_localbus.c Sat May 19 18:05:00 2012 (r235655) +++ head/sys/arm/mv/mv_localbus.c Sat May 19 18:16:49 2012 (r235656) @@ -48,9 +48,6 @@ __FBSDID("$FreeBSD$"); #include -#define DEBUG -#undef DEBUG - #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); \ printf(fmt,##args); } while (0) From owner-svn-src-head@FreeBSD.ORG Sat May 19 18:22:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 548B8106566B; Sat, 19 May 2012 18:22:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) by mx1.freebsd.org (Postfix) with ESMTP id C73948FC0C; Sat, 19 May 2012 18:22:48 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id BEA8625D3857; Sat, 19 May 2012 18:22:47 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id DA92CBE74BC; Sat, 19 May 2012 18:22:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 46DySP-qdvR3; Sat, 19 May 2012 18:22:45 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 9EB97BE74BB; Sat, 19 May 2012 18:22:45 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201205191755.q4JHtncx036628@svn.freebsd.org> Date: Sat, 19 May 2012 18:22:44 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <4CFA3665-472D-49E4-8832-3B304C2908D1@FreeBSD.org> References: <201205191755.q4JHtncx036628@svn.freebsd.org> To: Marcel Moolenaar X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235654 - in head: bin/ed share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 18:22:49 -0000 On 19. May 2012, at 17:55 , Marcel Moolenaar wrote: > Author: marcel > Date: Sat May 19 17:55:49 2012 > New Revision: 235654 > URL: http://svn.freebsd.org/changeset/base/235654 >=20 > Log: > Add build option MK_ED_CRYPTO to control whether ed(1) is to have the > ability to encrypt/decrypt files. Embedded systems can typically have > OpenSSL, but not for ed(1) to use it. This is totally wrong in my view and lacks documentation. 1) I really see no reason why ED needs it's own crypto flag for = src.conf, if we go that route what about telnet, and all the others? 2) If I do not build with OPENSSL this should as well turn off = MK_ED_CRYPTO automatically (but let's not go there, if avoidable). 3) if you insist on keeping it as a src.conf option please fix (2) and properly document it. >=20 > Obtained from: Juniper Networks, Inc. >=20 > Modified: > head/bin/ed/Makefile > head/share/mk/bsd.own.mk >=20 > Modified: head/bin/ed/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/bin/ed/Makefile Sat May 19 17:49:20 2012 = (r235653) > +++ head/bin/ed/Makefile Sat May 19 17:55:49 2012 = (r235654) > @@ -7,12 +7,12 @@ SRCS=3D buf.c cbc.c glbl.c io.c main.c re. > LINKS=3D ${BINDIR}/ed ${BINDIR}/red > MLINKS=3D ed.1 red.1 >=20 > -.if !defined(RELEASE_CRUNCH) > -.if ${MK_OPENSSL} !=3D "no" > +.if !defined(RELEASE_CRUNCH) && \ > + ${MK_OPENSSL} !=3D "no" && \ > + ${MK_ED_CRYPTO} !=3D "no" > CFLAGS+=3D-DDES > DPADD=3D ${LIBCRYPTO} > LDADD=3D -lcrypto > .endif > -.endif >=20 > .include >=20 > Modified: head/share/mk/bsd.own.mk > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/share/mk/bsd.own.mk Sat May 19 17:49:20 2012 = (r235653) > +++ head/share/mk/bsd.own.mk Sat May 19 17:55:49 2012 = (r235654) > @@ -334,6 +334,7 @@ __DEFAULT_YES_OPTIONS =3D \ > CXX \ > DICT \ > DYNAMICROOT \ > + ED_CRYPTO \ > EXAMPLES \ > FLOPPY \ > FORTH \ --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Sat May 19 18:23:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A49211065676; Sat, 19 May 2012 18:23:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 2E4718FC15; Sat, 19 May 2012 18:23:57 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 24B2825D3857; Sat, 19 May 2012 18:23:56 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 970D3BE74BE; Sat, 19 May 2012 18:23:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id q-PhJAntCe9i; Sat, 19 May 2012 18:23:54 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 09F2FBE74BD; Sat, 19 May 2012 18:23:53 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201205191805.q4JI513M037128@svn.freebsd.org> Date: Sat, 19 May 2012 18:23:53 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201205191805.q4JI513M037128@svn.freebsd.org> To: Marcel Moolenaar X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235655 - in head: bin/ls share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 18:23:57 -0000 On 19. May 2012, at 18:05 , Marcel Moolenaar wrote: > Author: marcel > Date: Sat May 19 18:05:00 2012 > New Revision: 235655 > URL: http://svn.freebsd.org/changeset/base/235655 >=20 > Log: > Add build opton MK_LS_COLORS to control whether ls(1) supports colors > (and thus needs to depend on libtermcap). Embedded systems may not > want or need colors. This once again is missing documentation. Please also understand that each src.conf option DOES come with a cost = and if you plan to bring another 20 I'd love to have discussion upfront. = Thanks. > Obtained from: Juniper Networks, Inc. >=20 > Modified: > head/bin/ls/Makefile > head/share/mk/bsd.own.mk >=20 > Modified: head/bin/ls/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/bin/ls/Makefile Sat May 19 17:55:49 2012 = (r235654) > +++ head/bin/ls/Makefile Sat May 19 18:05:00 2012 = (r235655) > @@ -1,12 +1,15 @@ > # @(#)Makefile 8.1 (Berkeley) 6/2/93 > # $FreeBSD$ >=20 > +.include > + > PROG=3D ls > SRCS=3D cmp.c ls.c print.c util.c > DPADD=3D ${LIBUTIL} > LDADD=3D -lutil >=20 > -.if !defined(RELEASE_CRUNCH) > +.if !defined(RELEASE_CRUNCH) && \ > + ${MK_LS_COLORS} !=3D no > CFLAGS+=3D -DCOLORLS > DPADD+=3D ${LIBTERMCAP} > LDADD+=3D -ltermcap >=20 > Modified: head/share/mk/bsd.own.mk > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/share/mk/bsd.own.mk Sat May 19 17:55:49 2012 = (r235654) > +++ head/share/mk/bsd.own.mk Sat May 19 18:05:00 2012 = (r235655) > @@ -367,6 +367,7 @@ __DEFAULT_YES_OPTIONS =3D \ > LOCALES \ > LOCATE \ > LPR \ > + LS_COLORS \ > MAIL \ > MAILWRAPPER \ > MAKE \ --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Sat May 19 20:05:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBA56106564A; Sat, 19 May 2012 20:05:29 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6D828FC0C; Sat, 19 May 2012 20:05:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4JK5St0042684; Sat, 19 May 2012 20:05:28 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4JK5SGq042682; Sat, 19 May 2012 20:05:28 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205192005.q4JK5SGq042682@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 19 May 2012 20:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235660 - head/tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 20:05:29 -0000 Author: marcel Date: Sat May 19 20:05:27 2012 New Revision: 235660 URL: http://svn.freebsd.org/changeset/base/235660 Log: Document the ED_CRYPTO and LS_COLORS options. Obtained from: Juniper Networks, Inc. Added: head/tools/build/options/WITHOUT_ED_CRYPTO (contents, props changed) head/tools/build/options/WITHOUT_LS_COLORS (contents, props changed) Added: head/tools/build/options/WITHOUT_ED_CRYPTO ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_ED_CRYPTO Sat May 19 20:05:27 2012 (r235660) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to build +.Xr ed 1 +without support for encryption/decryption. Added: head/tools/build/options/WITHOUT_LS_COLORS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LS_COLORS Sat May 19 20:05:27 2012 (r235660) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to build +.Xr ls 1 +without support for colors to distinguish file types. From owner-svn-src-head@FreeBSD.ORG Sat May 19 20:11:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A048106564A; Sat, 19 May 2012 20:11:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01B5C8FC15; Sat, 19 May 2012 20:11:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4JKBIGN042972; Sat, 19 May 2012 20:11:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4JKBICn042969; Sat, 19 May 2012 20:11:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201205192011.q4JKBICn042969@svn.freebsd.org> From: Adrian Chadd Date: Sat, 19 May 2012 20:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235661 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 20:11:19 -0000 Author: adrian Date: Sat May 19 20:11:18 2012 New Revision: 235661 URL: http://svn.freebsd.org/changeset/base/235661 Log: Enable the AR8316 switch on the routerstation pro board. The configuration is: * RGMII, both ports * arge0 - connected to PHY4 as a dedicated port (CPU port) * arge1 - connected to the switch ports I've verified this on my routerstation pro board. Modified: head/sys/mips/conf/RSPRO head/sys/mips/conf/RSPRO.hints Modified: head/sys/mips/conf/RSPRO ============================================================================== --- head/sys/mips/conf/RSPRO Sat May 19 20:05:27 2012 (r235660) +++ head/sys/mips/conf/RSPRO Sat May 19 20:11:18 2012 (r235661) @@ -21,6 +21,12 @@ options GEOM_PART_BSD options GEOM_PART_MBR options MSDOSFS +# For etherswitch support +options ARGE_MDIO +device miiproxy +device etherswitch +device arswitch + # Boot off of flash options ROOTDEVNAME=\"ufs:redboot/rootfs.uzip\" Modified: head/sys/mips/conf/RSPRO.hints ============================================================================== --- head/sys/mips/conf/RSPRO.hints Sat May 19 20:05:27 2012 (r235660) +++ head/sys/mips/conf/RSPRO.hints Sat May 19 20:11:18 2012 (r235661) @@ -1,10 +1,27 @@ # $FreeBSD$ -hint.arge.0.phymask=0x10 - -hint.arge.1.media=1000 -hint.arge.1.fduplex=1 -hint.arge.1.phymask=0x0e +# arge0 mdio bus +hint.argemdio.0.at="nexus0" +hint.argemdio.0.maddr=0x19000000 +hint.argemdio.0.msize=0x1000 +hint.argemdio.0.order=0 + +# arge0: dedicated switch port +hint.arge.0.phymask=0x10 # PHY4 +hint.arge.0.miimode=3 # RGMII +hint.arge.0.mdio=mdioproxy1 # .. off of the switch mdiobus + +# arge1: nail to 1000/full, RGMII - connected to the switch +hint.arge.1.media=1000 # Map to 1000/full +hint.arge.1.fduplex=1 # +hint.arge.1.phymask=0x0 # no directly mapped PHYs +hint.arge.1.miimode=3 # RGMII + +hint.arswitch.0.is_7240=0 +hint.arswitch.0.numphys=4 +hint.arswitch.0.phy4cpu=1 +hint.arswitch.0.is_rgmii=1 +hint.arswitch.0.is_gmii=0 # Don't flip on anything that isn't already enabled. # This includes leaving the SPI CS1/CS2 pins as GPIO pins as they're From owner-svn-src-head@FreeBSD.ORG Sat May 19 21:29:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C33EF1065674; Sat, 19 May 2012 21:29:19 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEF558FC17; Sat, 19 May 2012 21:29:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4JLTJVq046436; Sat, 19 May 2012 21:29:19 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4JLTJAW046434; Sat, 19 May 2012 21:29:19 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201205192129.q4JLTJAW046434@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 19 May 2012 21:29:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235662 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 21:29:20 -0000 Author: marcel Date: Sat May 19 21:29:18 2012 New Revision: 235662 URL: http://svn.freebsd.org/changeset/base/235662 Log: Regenerate after the additions of: WITHOUT_ED_CRYPTO WITHOUT_LS_COLORS WITH_NAND Pointed out by: Garrett Cooper Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sat May 19 20:11:18 2012 (r235661) +++ head/share/man/man5/src.conf.5 Sat May 19 21:29:18 2012 (r235662) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru .\" $FreeBSD$ -.Dd May 12, 2012 +.Dd May 19, 2012 .Dt SRC.CONF 5 .Os .Sh NAME @@ -207,7 +207,7 @@ and Set to enable the http statistics interface for named. This requires ports/textproc/libxml2 to be installed in /usr/local. .It Va WITHOUT_BINUTILS -.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 222090 2011-05-19 05:13:25Z imp +.\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 235342 2012-05-12 16:12:36Z gjb Set to not install binutils (as, c++-filt, gconv, gnu-ar, gnu-randlib, ld, nm, objcopy, objdump, readelf, size and strip). .Bf -symbolic @@ -292,7 +292,7 @@ amd64/amd64, i386/i386, pc98/i386, power .\" from FreeBSD: head/tools/build/options/WITH_CLANG_EXTRAS 231057 2012-02-05 23:56:22Z dim Set to build additional clang and llvm tools, such as bugpoint. .It Va WITH_CLANG_IS_CC -.\" from FreeBSD: head/tools/build/options/WITH_CLANG_IS_CC 232322 2012-02-29 22:58:51Z dim +.\" from FreeBSD: head/tools/build/options/WITH_CLANG_IS_CC 235342 2012-05-12 16:12:36Z gjb Set to install the Clang C/C++ compiler as .Pa /usr/bin/cc , .Pa /usr/bin/c++ @@ -368,6 +368,11 @@ Set this if you do not want to link and .Pa /sbin dynamically. +.It Va WITHOUT_ED_CRYPTO +.\" from FreeBSD: head/tools/build/options/WITHOUT_ED_CRYPTO 235660 2012-05-19 20:05:27Z marcel +Set to build +.Xr ed 1 +without support for encryption/decryption. .It Va WITHOUT_EXAMPLES .\" from FreeBSD: head/tools/build/options/WITHOUT_EXAMPLES 156938 2006-03-21 09:06:24Z ru Set to avoid installing examples to @@ -667,6 +672,11 @@ and related programs. Set to not build .Xr lpr 1 and related programs. +.It Va WITHOUT_LS_COLORS +.\" from FreeBSD: head/tools/build/options/WITHOUT_LS_COLORS 235660 2012-05-19 20:05:27Z marcel +Set to build +.Xr ls 1 +without support for colors to distinguish file types. .It Va WITHOUT_MAIL .\" from FreeBSD: head/tools/build/options/WITHOUT_MAIL 183242 2008-09-21 22:02:26Z sam Set to not build any mail support (MUA or MTA). @@ -709,6 +719,9 @@ Set to not build utilities for manual pa .Xr whatis 1 , .Xr manctl 8 , and related support files. +.It Va WITH_NAND +.\" from FreeBSD: head/tools/build/options/WITH_NAND 235537 2012-05-17 10:11:18Z gber +Set to build the NAND Flash components. .It Va WITHOUT_NCP .\" from FreeBSD: head/tools/build/options/WITHOUT_NCP 156932 2006-03-21 07:50:50Z ru Set to not build programs, libraries, and kernel modules @@ -893,7 +906,7 @@ Set to not build the .Bx 4.4 legacy docs. .It Va WITH_SHARED_TOOLCHAIN -.\" from FreeBSD: head/tools/build/options/WITH_SHARED_TOOLCHAIN 234782 2012-04-29 09:32:44Z kib +.\" from FreeBSD: head/tools/build/options/WITH_SHARED_TOOLCHAIN 235342 2012-05-12 16:12:36Z gjb Set to build the toolchain binaries shared. The set includes .Xr cc 1 , @@ -1015,7 +1028,7 @@ protocols (usable only via 802.1X). .\" from FreeBSD: head/tools/build/options/WITHOUT_ZFS 168409 2007-04-06 02:13:30Z pjd Set to not build ZFS file system. .It Va WITHOUT_ZONEINFO -.\" from FreeBSD: head/tools/build/options/WITHOUT_ZONEINFO 171994 2007-08-27 20:01:08Z remko +.\" from FreeBSD: head/tools/build/options/WITHOUT_ZONEINFO 235342 2012-05-12 16:12:36Z gjb Set to not build the timezone database. .El .Sh FILES From owner-svn-src-head@FreeBSD.ORG Sat May 19 23:25:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B65C106566C; Sat, 19 May 2012 23:25:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02F938FC08; Sat, 19 May 2012 23:25:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4JNPwdm052288; Sat, 19 May 2012 23:25:58 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4JNPwkK052285; Sat, 19 May 2012 23:25:58 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201205192325.q4JNPwkK052285@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 19 May 2012 23:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235671 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2012 23:25:59 -0000 Author: bz Date: Sat May 19 23:25:57 2012 New Revision: 235671 URL: http://svn.freebsd.org/changeset/base/235671 Log: MFp4 bz_ipv6_fast: Allow tso4 and tso6 be set individually given we have the bits. This will help with drivers not working as expected during the transition time and later. Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems Reviewed by: gnn MFC After: 1 week Modified: head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Sat May 19 22:50:38 2012 (r235670) +++ head/sbin/ifconfig/ifconfig.8 Sat May 19 23:25:57 2012 (r235671) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd May 1, 2012 +.Dd May 19, 2012 .Dt IFCONFIG 8 .Os .Sh NAME @@ -400,6 +400,22 @@ It will always disable TSO for .Xr ip 4 and .Xr ip6 4 . +.It Cm tso6 , tso4 +If the driver supports +.Xr tcp 4 +segmentation offloading for +.Xr ip6 4 +or +.Xr ip 4 +use one of these to selectively enabled it only for one protocol family. +.It Fl tso6 , tso4 +If the driver supports +.Xr tcp 4 +segmentation offloading for +.Xr ip6 4 +or +.Xr ip 4 +use one of these to selectively disable it only for one protocol family. .It Cm lro If the driver supports .Xr tcp 4 Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Sat May 19 22:50:38 2012 (r235670) +++ head/sbin/ifconfig/ifconfig.c Sat May 19 23:25:57 2012 (r235671) @@ -1201,6 +1201,10 @@ static struct cmd basic_cmds[] = { DEF_CMD("-netcons", -IFCAP_NETCONS, setifcap), DEF_CMD("polling", IFCAP_POLLING, setifcap), DEF_CMD("-polling", -IFCAP_POLLING, setifcap), + DEF_CMD("tso6", IFCAP_TSO6, setifcap), + DEF_CMD("-tso6", -IFCAP_TSO6, setifcap), + DEF_CMD("tso4", IFCAP_TSO4, setifcap), + DEF_CMD("-tso4", -IFCAP_TSO4, setifcap), DEF_CMD("tso", IFCAP_TSO, setifcap), DEF_CMD("-tso", -IFCAP_TSO, setifcap), DEF_CMD("lro", IFCAP_LRO, setifcap),